Skip to content

Commit

Permalink
Merge pull request #3342 from bettyblocks/fix/set-selected-record-int…
Browse files Browse the repository at this point in the history
…eraction-PAGE-4019

Fix/set selected record interaction page 4019
  • Loading branch information
dylanBetty authored Jan 23, 2024
2 parents fc1e894 + 9fb3f14 commit 78d9ce9
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 18 deletions.
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "component-set",
"version": "2.174.1",
"version": "2.175.0",
"main": "dist/templates.json",
"license": "UNLICENSED",
"private": false,
"devDependencies": {
"@betty-blocks/cli": "^25.90.0",
"@betty-blocks/cli": "^25.91.0",
"@commitlint/cli": "^16.1.0",
"@commitlint/config-angular": "^16.0.0",
"@semantic-release/changelog": "^6.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/dataList.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@
}
}, [loading]);

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

const Looper = (results) =>
Expand All @@ -408,7 +408,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 @@ -503,7 +503,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';
}
}
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
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"

"@betty-blocks/cli@^25.90.0":
version "25.90.0"
resolved "https://registry.yarnpkg.com/@betty-blocks/cli/-/cli-25.90.0.tgz#4634d2414876ff2bfc37e2f71b0c2ee64f011293"
integrity sha512-6On0hTcFtCS7v+XBG4nfGxy7QaNF+scRxXeeKOva3YFgShP8XDsAQK+4wLLS64lFcn41colsjlI5+8TKC6pLbg==
"@betty-blocks/cli@^25.91.0":
version "25.91.0"
resolved "https://registry.yarnpkg.com/@betty-blocks/cli/-/cli-25.91.0.tgz#1b806699e9ed08ccd80dc82ec5f6cfa37814225d"
integrity sha512-qOBrkf9+NxkMq1IIWRomXQrIyMij1icyjft994inwmryFw3iYzrHqYisP8JoGHLa9gaXi767UaEJzXiCDvM1SA==
dependencies:
"@azure/ms-rest-js" "^2.0.4"
"@azure/storage-blob" "^10.3.0"
Expand Down

0 comments on commit 78d9ce9

Please sign in to comment.