From 6e567231b5e437ab2f68aec700f4ed25873aaafe Mon Sep 17 00:00:00 2001 From: realVinayak Date: Fri, 22 Dec 2023 03:01:20 +0000 Subject: [PATCH] Lint code with ESLint and Prettier Triggered by 1db4ce4ca600fbe748efe71d875fcc8ad44bec6c on branch refs/heads/batch-image-upload --- .../lib/components/Atoms/Internationalization.ts | 12 ++++++++---- .../lib/components/AttachmentsBulkImport/Import.tsx | 2 +- .../AttachmentsBulkImport/ViewAttachmentFiles.tsx | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/specifyweb/frontend/js_src/lib/components/Atoms/Internationalization.ts b/specifyweb/frontend/js_src/lib/components/Atoms/Internationalization.ts index 641c52b179b..5c0e01894ac 100644 --- a/specifyweb/frontend/js_src/lib/components/Atoms/Internationalization.ts +++ b/specifyweb/frontend/js_src/lib/components/Atoms/Internationalization.ts @@ -54,10 +54,14 @@ declare namespace Intl { public constructor( locales?: RA | string, options?: { - unit: 'byte'; // TODO: Expand unit - notation: 'standard' | 'compact' | 'scientific' | 'engineering'; - unitDisplay: 'short' | 'narrow' | 'long'; - style: 'unit' | 'decimal' | 'currency' | 'percent'; + readonly unit: 'byte'; // TODO: Expand unit + readonly notation: + | 'compact' + | 'engineering' + | 'scientific' + | 'standard'; + readonly unitDisplay: 'long' | 'narrow' | 'short'; + readonly style: 'currency' | 'decimal' | 'percent' | 'unit'; } ); diff --git a/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/Import.tsx b/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/Import.tsx index 6b578089b8a..062bb34a4e9 100644 --- a/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/Import.tsx +++ b/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/Import.tsx @@ -97,7 +97,7 @@ function AttachmentImportByIdSafe({ readonly id: number; }): JSX.Element | null { const [attachmentDataSet] = usePromise( - React.useMemo(() => fetchAndReconstructDataset(id), [id]), + React.useMemo(async () => fetchAndReconstructDataset(id), [id]), true ); return attachmentDataSet === undefined ? null : ( diff --git a/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/ViewAttachmentFiles.tsx b/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/ViewAttachmentFiles.tsx index 79488ff1197..c4db3ca09e6 100644 --- a/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/ViewAttachmentFiles.tsx +++ b/specifyweb/frontend/js_src/lib/components/AttachmentsBulkImport/ViewAttachmentFiles.tsx @@ -7,6 +7,7 @@ import { headerText } from '../../localization/header'; import { f } from '../../utils/functools'; import type { IR, RA } from '../../utils/types'; import { dialogIcons } from '../Atoms/Icons'; +import { formatFileSize } from '../Atoms/Internationalization'; import { Link } from '../Atoms/Link'; import { getResourceViewUrl } from '../DataModel/resource'; import type { Tables } from '../DataModel/types'; @@ -20,7 +21,6 @@ import { resolveAttachmentRecord, resolveAttachmentStatus, } from './utils'; -import { formatFileSize } from '../Atoms/Internationalization'; const resolveAttachmentDatasetData = ( uploadableFiles: RA, @@ -86,7 +86,7 @@ const resolveAttachmentDatasetData = ( ], progress: [ statusText, -
+
{status?.type === 'success' && status.successType === 'uploaded' && dialogIcons.success} @@ -224,7 +224,7 @@ export function ViewAttachmentFiles({ function StartUploadDescription(): JSX.Element { return ( -
+
  1. {attachmentsText.chooseFilesToGetStarted()}
  2. {attachmentsText.selectIdentifier()}