Skip to content

Commit 393bec4

Browse files
r0b1ngjulivan
authored andcommitted
chore: make it pretty
1 parent 6e562b5 commit 393bec4

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

packages/pluggableWidgets/file-uploader-web/src/components/ActionButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface ActionButtonProps {
1010
isDisabled: boolean;
1111
}
1212

13-
export function ActionButton({ action, icon, title, isDisabled }: ActionButtonProps) {
13+
export function ActionButton({ action, icon, title, isDisabled }: ActionButtonProps): ReactElement {
1414
const onClick = useCallback(
1515
(e: MouseEvent<HTMLButtonElement>) => {
1616
e.stopPropagation();
@@ -39,7 +39,7 @@ interface FileActionButtonProps {
3939
icon: ReactElement;
4040
}
4141

42-
export function FileActionButton({ listAction, store, title, icon }: FileActionButtonProps) {
42+
export function FileActionButton({ listAction, store, title, icon }: FileActionButtonProps): ReactElement {
4343
const action = useCallback(() => {
4444
store.executeAction(listAction);
4545
}, [store, listAction]);

packages/pluggableWidgets/file-uploader-web/src/components/ActionsBar.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ export const ActionsBar = ({ actions, store }: ButtonsBarProps): ReactElement |
1818
if (actions && store.canExecuteActions) {
1919
return (
2020
<div className={"entry-details-actions"}>
21-
{actions.map(a => {
21+
{actions.map((a, i) => {
2222
if (!a.buttonIsVisible.value) {
2323
return null;
2424
}
2525
const listAction = a.buttonActionImage ?? a.buttonActionFile;
2626

2727
return (
2828
<FileActionButton
29+
key={i}
2930
icon={<IconInternal icon={a.buttonIcon.value} className={"file-action-icon"} />}
3031
title={a.buttonCaption.value}
3132
store={store}
@@ -40,7 +41,7 @@ export const ActionsBar = ({ actions, store }: ButtonsBarProps): ReactElement |
4041
return null;
4142
};
4243

43-
function DefaultActionsBar(props: ButtonsBarProps) {
44+
function DefaultActionsBar(props: ButtonsBarProps): ReactElement {
4445
const translations = useTranslationsStore();
4546

4647
const onRemove = useCallback(() => {
@@ -54,13 +55,13 @@ function DefaultActionsBar(props: ButtonsBarProps) {
5455
return (
5556
<div className={"entry-details-actions"}>
5657
<ActionButton
57-
icon={<span className={"download-icon"} aria-hidden={true} />}
58+
icon={<span className={"download-icon"} aria-hidden />}
5859
title={translations.get("downloadButtonTextMessage")}
5960
action={onViewClick}
6061
isDisabled={!props.store.canDownload}
6162
/>
6263
<ActionButton
63-
icon={<span className={"remove-icon"} aria-hidden={true} />}
64+
icon={<span className={"remove-icon"} aria-hidden />}
6465
title={translations.get("removeButtonTextMessage")}
6566
action={onRemove}
6667
isDisabled={!props.store.canRemove}

packages/pluggableWidgets/file-uploader-web/src/components/FileEntry.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ function FileEntry(props: FileEntryProps): ReactElement {
8787
invalid: props.fileStatus === "validationError"
8888
})}
8989
title={props.title}
90-
tabIndex={!!defaultAction ? 0 : undefined}
91-
onClick={!!defaultAction ? onClick : undefined}
92-
onKeyDown={!!defaultAction ? onKeyDown : undefined}
90+
tabIndex={defaultAction ? 0 : undefined}
91+
onClick={defaultAction ? onClick : undefined}
92+
onKeyDown={defaultAction ? onKeyDown : undefined}
9393
>
9494
<div className={"entry-details"}>
9595
<div

packages/pluggableWidgets/file-uploader-web/src/stores/FileStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class FileStore {
6464
});
6565
}
6666

67-
markMissing() {
67+
markMissing(): void {
6868
this.fileStatus = "missing";
6969
this._mxObject = undefined;
7070
this._objectItem = undefined;
@@ -107,7 +107,7 @@ export class FileStore {
107107
runInAction(() => {
108108
this.fileStatus = "done";
109109
});
110-
} catch (e: unknown) {
110+
} catch (_e: unknown) {
111111
runInAction(() => {
112112
this.fileStatus = "uploadingError";
113113
});

packages/pluggableWidgets/file-uploader-web/src/utils/DatasourceUpdateProcessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export class DatasourceUpdateProcessor {
4545
currentItemsSet.add(item.id);
4646
});
4747

48-
let newItems = new Set([...currentItemsSet].filter(x => !this.seenItems.has(x)));
49-
let missingItems = new Set([...this.seenItems].filter(x => !currentItemsSet.has(x)));
48+
const newItems = new Set([...currentItemsSet].filter(x => !this.seenItems.has(x)));
49+
const missingItems = new Set([...this.seenItems].filter(x => !currentItemsSet.has(x)));
5050

5151
// missing
5252
for (const missingItem of missingItems) {

packages/pluggableWidgets/file-uploader-web/src/utils/__tests__/DatasourceUpdateProcessor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DatasourceUpdateProcessor, DatasourceUpdateProcessorCallbacks } from ".
22
import { ListValueBuilder, obj } from "@mendix/widget-plugin-test-utils";
33
import { ObjectItem } from "mendix";
44

5-
let fileHasContentsMock = jest.fn();
5+
const fileHasContentsMock = jest.fn();
66
jest.mock("../mx-data", () => ({
77
fileHasContents: (...args: any[]) => fileHasContentsMock(...args)
88
}));

0 commit comments

Comments
 (0)