From 43634dbaffd27d8cb85a14979fc2e5108a3e0f58 Mon Sep 17 00:00:00 2001 From: Pavel Klibani Date: Mon, 23 Oct 2023 12:49:20 +0200 Subject: [PATCH] Fix(web-react): Remove unused `isDisabled` prop from FileUploader - unused prop `isDisabled` was removed from FileUploader component #DS-933 --- .../components/FileUploader/FileUploader.tsx | 12 ++++++------ .../FileUploader/FileUploaderInput.tsx | 18 +++++++++--------- .../src/components/FileUploader/README.md | 1 - packages/web-react/src/types/fileUploader.ts | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/web-react/src/components/FileUploader/FileUploader.tsx b/packages/web-react/src/components/FileUploader/FileUploader.tsx index 768ab67948..da4ebe3630 100644 --- a/packages/web-react/src/components/FileUploader/FileUploader.tsx +++ b/packages/web-react/src/components/FileUploader/FileUploader.tsx @@ -13,16 +13,16 @@ import { const FileUploader = (props: SpiritFileUploaderProps) => { const { - children, - id, - fileQueue, - onDismiss, addToQueue, + children, clearQueue, - findInQueue, - updateQueue, errorMessages, + fileQueue, + findInQueue, + id, isFluid, + onDismiss, + updateQueue, ...restProps } = props; diff --git a/packages/web-react/src/components/FileUploader/FileUploaderInput.tsx b/packages/web-react/src/components/FileUploader/FileUploaderInput.tsx index 0557c12cbf..02097fbba5 100644 --- a/packages/web-react/src/components/FileUploader/FileUploaderInput.tsx +++ b/packages/web-react/src/components/FileUploader/FileUploaderInput.tsx @@ -17,9 +17,8 @@ const FileUploaderInput = (props: SpiritFileUploaderInputProps) => { iconName = 'upload', id, inputRef, - isLabelHidden, isDisabled, - queueLimitBehavior = 'none', + isLabelHidden, isMultiple, isRequired, label, @@ -28,6 +27,7 @@ const FileUploaderInput = (props: SpiritFileUploaderInputProps) => { maxFileSize = DEFAULT_FILE_SIZE_LIMIT, maxUploadedFiles = DEFAULT_FILE_QUEUE_LIMIT, onError, + queueLimitBehavior = 'none', validationState, validationText, ...restProps @@ -40,25 +40,25 @@ const FileUploaderInput = (props: SpiritFileUploaderInputProps) => { isDragging, isDropZoneHidden, onChange, - onDragOver, onDragEnter, onDragLeave, + onDragOver, onDrop, } = useFileUploaderInput({ accept, + isMultiple, maxFileSize, maxUploadedFiles, - isMultiple, - queueLimitBehavior, onError, + queueLimitBehavior, }); const { classProps } = useFileUploaderStyleProps({ - isDragAndDropSupported, - isLabelHidden, isDisabled, - isDropZoneHidden, - isDragging, isDisabledByQueueLimitBehavior, + isDragAndDropSupported, + isDragging, + isDropZoneHidden, + isLabelHidden, isRequired, queueLimitBehavior, validationState, diff --git a/packages/web-react/src/components/FileUploader/README.md b/packages/web-react/src/components/FileUploader/README.md index 701689d1cb..92732fa4eb 100644 --- a/packages/web-react/src/components/FileUploader/README.md +++ b/packages/web-react/src/components/FileUploader/README.md @@ -354,7 +354,6 @@ const customUpdate = (_event: MouseEvent, file: File) => { | `fileQueue` | `FileQueueMapType` | — | ✔ | Queue of items to upload | | `findInQueue` | `(key: string) => FileQueueMapType` | — | ✔ | A callback to find a particular item in the queue | | `id` | `string` | — | ✔ | FileUploader id | -| `isDisabled` | `bool` | — | ✕ | When the field is supposed to be disabled | | `isFluid` | `bool` | — | ✕ | When the field is supposed to be fluid | | `onDismiss` | `(key: string) => FileQueueMapType` | — | ✔ | A callback to delete a particular item from the queue | | `UNSAFE_className` | `string` | — | ✕ | FileUploader custom class name | diff --git a/packages/web-react/src/types/fileUploader.ts b/packages/web-react/src/types/fileUploader.ts index dc6ef170f1..91ee304dac 100644 --- a/packages/web-react/src/types/fileUploader.ts +++ b/packages/web-react/src/types/fileUploader.ts @@ -108,7 +108,6 @@ export interface FileUploaderAttachmentBaseProps extends Omit { id: string; - isDisabled?: boolean; isFluid?: boolean; } @@ -120,6 +119,7 @@ export interface UncontrolledFileUploaderBaseProps inputLabel: string; inputName: string; inputProps?: Partial; + isDisabled?: boolean; listId: string; listProps?: Partial; onChange?: (fileQueue: FileQueueMapType) => void;