From c4171e9020e2e096bbc8623e5aae29be369dfada Mon Sep 17 00:00:00 2001 From: Thuan Vo Date: Fri, 9 Aug 2024 19:27:59 -0700 Subject: [PATCH] chore: apply eslint fixes --- src/app/RecordingMetadata/BulkEditLabels.tsx | 4 ++-- src/app/RecordingMetadata/RecordingLabelFields.tsx | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/app/RecordingMetadata/BulkEditLabels.tsx b/src/app/RecordingMetadata/BulkEditLabels.tsx index d4f22ced9e..1d6944777a 100644 --- a/src/app/RecordingMetadata/BulkEditLabels.tsx +++ b/src/app/RecordingMetadata/BulkEditLabels.tsx @@ -51,7 +51,7 @@ export interface BulkEditLabelsProps { checkedIndices: number[]; directory?: RecordingDirectory; directoryRecordings?: ArchivedRecording[]; - closePanelFn: () => void; + closePanelFn?: () => void; } export const BulkEditLabels: React.FC = ({ @@ -125,7 +125,7 @@ export const BulkEditLabels: React.FC = ({ const handleCancel = React.useCallback(() => { setCommonLabels(savedCommonLabels); - closePanelFn(); + closePanelFn && closePanelFn(); }, [setCommonLabels, savedCommonLabels, closePanelFn]); const updateCommonLabels = React.useCallback( diff --git a/src/app/RecordingMetadata/RecordingLabelFields.tsx b/src/app/RecordingMetadata/RecordingLabelFields.tsx index 6a1047f4d6..6a4871e0da 100644 --- a/src/app/RecordingMetadata/RecordingLabelFields.tsx +++ b/src/app/RecordingMetadata/RecordingLabelFields.tsx @@ -16,20 +16,13 @@ import { LoadingView } from '@app/Shared/Components/LoadingView'; import { KeyValue, keyValueToString } from '@app/Shared/Services/api.types'; import { useSubscriptions } from '@app/utils/hooks/useSubscriptions'; -import { LABEL_TEXT_MAXWIDTH, portalRoot } from '@app/utils/utils'; +import { portalRoot } from '@app/utils/utils'; import { Button, Label, LabelGroup, List, ListItem, Popover, Text, ValidatedOptions } from '@patternfly/react-core'; import { ExclamationCircleIcon, FileIcon, UploadIcon } from '@patternfly/react-icons'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { catchError, Observable, of, zip } from 'rxjs'; -import { - isValidLabel, - getValidatedOption, - isDuplicateKey, - parseLabelsFromFile, - isValidLabelInput, - getLabelFromInput, -} from './utils'; +import { isValidLabel, getValidatedOption, isDuplicateKey, parseLabelsFromFile, getLabelFromInput } from './utils'; export interface RecordingLabelFieldsProps { labels: KeyValue[];