Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/set selected record interaction page 4019 #3342

Merged
merged 7 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.175.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.174.1...v2.175.0) (2024-01-18)


### Features

* input shows value in dev mode ([2c376ea](https://github.com/bettyblocks/material-ui-component-set/commit/2c376eafd0e205d1b38558d22f7fff02c820cc4f))

## [2.174.1](https://github.com/bettyblocks/material-ui-component-set/compare/v2.174.0...v2.174.1) (2024-01-17)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "component-set",
"version": "2.174.1",
"version": "2.175.0",
"main": "dist/templates.json",
"license": "UNLICENSED",
"private": false,
Expand Down
6 changes: 3 additions & 3 deletions src/components/dataList.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@
}
}, [loading]);

const handleClick = (event, context) => {
B.triggerEvent('OnItemClick', event, context);
const handleClick = (context) => {
B.triggerEvent('OnItemClick', context);
};

const Looper = (results) =>
Expand All @@ -409,7 +409,7 @@
<div
role="none"
className={isInline ? classes.inline : undefined}
onClick={(event) => handleClick(event, context)}
onClick={() => handleClick(context)}
>
{children}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@

const handleRowClick = (endpoint, context) => {
if (isDev) return;
B.triggerEvent('OnRowClick', endpoint, context);
B.triggerEvent('OnRowClick', context);

if (hasLink) {
history.push(endpoint);
Expand Down
11 changes: 8 additions & 3 deletions src/interactions/cursorToPointer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* eslint @typescript-eslint/no-unused-vars: ["error", { "varsIgnorePattern": "cursorToPointer" }] */

function cursorToPointer({ event }: { event: Event }): void {
// eslint-disable-next-line no-param-reassign
(event.target as HTMLAnchorElement).style.cursor = 'pointer';
function cursorToPointer({ event }: { event: unknown }): void {
function isEventType(unknownEvent: any): unknownEvent is Event {
return 'target' in unknownEvent;
}
if (isEventType(event)) {
// eslint-disable-next-line no-param-reassign
(event.target as HTMLAnchorElement).style.cursor = 'pointer';
}
}
4 changes: 2 additions & 2 deletions src/interactions/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface History {
push(url: string): string;
}

interface Event {
interface JWTData {
isValid: boolean;
jwtToken: string;
refreshToken: string;
Expand All @@ -20,7 +20,7 @@ function login({
event,
redirectTo,
}: {
event: Event;
event: JWTData;
redirectTo: Page;
}): void {
const { isValid, jwtToken, refreshToken } = event;
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Page {
url: string;
}

function logout({ redirectTo }: { event: Event; redirectTo: Page }): void {
function logout({ redirectTo }: { event: unknown; redirectTo: Page }): void {
const { url } = redirectTo;
localStorage.removeItem('TOKEN');
localStorage.removeItem('REFRESH_TOKEN');
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/navigateToOutputUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface History {
push(url: string): string;
}

function navigateToOutputUrl({ event }: { event: Event }): void {
function navigateToOutputUrl({ event }: { event: unknown }): void {
if (typeof event !== 'string') {
// eslint-disable-next-line no-console
console.warn('Event passed to navigateToOutputUrl is not a string');
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function redirect({
event,
redirectTo,
}: {
event: Event;
event: unknown;
redirectTo: Page;
}): void {
let { url } = redirectTo;
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/setCurrentRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function setCurrentRecord({
argument,
}: {
event: Event;
event: unknown;
argument: number;
}): number {
return argument;
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/setLanguage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint @typescript-eslint/no-unused-vars: ["error", { "varsIgnorePattern": "setLanguage" }] */

function setLanguage({ event }: { event: Event }): void {
function setLanguage({ event }: { event: unknown }): void {
if (typeof event !== 'string') {
return;
}
Expand Down
Loading