diff --git a/src/app/About/AboutDescription.tsx b/src/app/About/AboutDescription.tsx index a724d4b094..5cf46e9c56 100644 --- a/src/app/About/AboutDescription.tsx +++ b/src/app/About/AboutDescription.tsx @@ -41,7 +41,7 @@ export const AboutDescription: React.FC = () => { if (!result) { notificationsContext.warning( 'Cryostat Version Parse Failure', - `Could not parse Cryostat version string '${cryostatVersion}'.` + `Could not parse Cryostat version string '${cryostatVersion}'.`, ); return 'main'; } diff --git a/src/app/Agent/AgentLiveProbes.tsx b/src/app/Agent/AgentLiveProbes.tsx index c7df000150..d40c63ab9e 100644 --- a/src/app/Agent/AgentLiveProbes.tsx +++ b/src/app/Agent/AgentLiveProbes.tsx @@ -109,7 +109,7 @@ export const AgentLiveProbes: React.FC = (_) => { }, columnIndex, }), - [sortBy, setSortBy] + [sortBy, setSortBy], ); const handleProbes = React.useCallback( @@ -118,7 +118,7 @@ export const AgentLiveProbes: React.FC = (_) => { setErrorMessage(''); setIsLoading(false); }, - [setProbes, setIsLoading, setErrorMessage] + [setProbes, setIsLoading, setErrorMessage], ); const handleError = React.useCallback( @@ -126,7 +126,7 @@ export const AgentLiveProbes: React.FC = (_) => { setErrorMessage(error.message); setIsLoading(false); }, - [setIsLoading, setErrorMessage] + [setIsLoading, setErrorMessage], ); const refreshProbes = React.useCallback(() => { @@ -135,7 +135,7 @@ export const AgentLiveProbes: React.FC = (_) => { context.api.getActiveProbes(true).subscribe({ next: (value) => handleProbes(value), error: (err) => handleError(err), - }) + }), ); }, [addSubscription, context.api, setIsLoading, handleProbes, handleError]); @@ -158,7 +158,7 @@ export const AgentLiveProbes: React.FC = (_) => { REMOVE: false, }; }); - }) + }), ); }, [addSubscription, context.api, setActionLoadings]); @@ -181,7 +181,7 @@ export const AgentLiveProbes: React.FC = (_) => { context.target.target().subscribe(() => { setFilterText(''); refreshProbes(); - }) + }), ); }, [context, context.target, addSubscription, setFilterText, refreshProbes]); @@ -191,7 +191,7 @@ export const AgentLiveProbes: React.FC = (_) => { } const id = window.setInterval( () => refreshProbes(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshProbes]); @@ -200,7 +200,7 @@ export const AgentLiveProbes: React.FC = (_) => { addSubscription( context.target.authFailure().subscribe(() => { setErrorMessage(authFailMessage); - }) + }), ); }, [addSubscription, context.target, setErrorMessage]); @@ -221,13 +221,13 @@ export const AgentLiveProbes: React.FC = (_) => { } return old; }); - }) + }), ); }, [addSubscription, context, context.notificationChannel, context.target, setProbes]); React.useEffect(() => { addSubscription( - context.notificationChannel.messages(NotificationCategory.ProbesRemoved).subscribe((_) => setProbes([])) + context.notificationChannel.messages(NotificationCategory.ProbesRemoved).subscribe((_) => setProbes([])), ); }, [addSubscription, context, context.notificationChannel, setProbes]); @@ -243,7 +243,7 @@ export const AgentLiveProbes: React.FC = (_) => { t.description.toLowerCase().includes(ft) || t.clazz.toLowerCase().includes(ft) || t.methodDescriptor.toLowerCase().includes(ft) || - t.methodName.toLowerCase().includes(ft) + t.methodName.toLowerCase().includes(ft), ); } @@ -254,8 +254,8 @@ export const AgentLiveProbes: React.FC = (_) => { direction: sortBy.direction ?? SortByDirection.asc, }, filtered, - tableColumns - ) + tableColumns, + ), ); }, [filterText, probes, sortBy, setFilteredProbes]); @@ -280,7 +280,7 @@ export const AgentLiveProbes: React.FC = (_) => { )), - [filteredProbes] + [filteredProbes], ); const actionLoadingProps = React.useMemo>( @@ -291,7 +291,7 @@ export const AgentLiveProbes: React.FC = (_) => { isLoading: actionLoadings['REMOVE'], } as LoadingPropsType, }), - [actionLoadings] + [actionLoadings], ); if (errorMessage != '') { diff --git a/src/app/Agent/AgentProbeTemplates.tsx b/src/app/Agent/AgentProbeTemplates.tsx index 3e5823f0e3..33916c6707 100644 --- a/src/app/Agent/AgentProbeTemplates.tsx +++ b/src/app/Agent/AgentProbeTemplates.tsx @@ -106,7 +106,7 @@ export const AgentProbeTemplates: React.FC = (props) = }, columnIndex, }), - [sortBy, setSortBy] + [sortBy, setSortBy], ); const handleTemplates = React.useCallback( @@ -115,14 +115,14 @@ export const AgentProbeTemplates: React.FC = (props) = setIsLoading(false); setErrorMessage(''); }, - [setTemplates, setIsLoading, setErrorMessage] + [setTemplates, setIsLoading, setErrorMessage], ); const handleError = React.useCallback( (error) => { setIsLoading(false); setErrorMessage(error.message); }, - [setIsLoading, setErrorMessage] + [setIsLoading, setErrorMessage], ); const refreshTemplates = React.useCallback(() => { @@ -131,7 +131,7 @@ export const AgentProbeTemplates: React.FC = (props) = context.api.getProbeTemplates().subscribe({ next: (value) => handleTemplates(value), error: (err) => handleError(err), - }) + }), ); }, [addSubscription, context.api, setIsLoading, handleTemplates, handleError]); @@ -140,10 +140,10 @@ export const AgentProbeTemplates: React.FC = (props) = addSubscription( context.api.deleteCustomProbeTemplate(template.name).subscribe(() => { /** Do nothing. Notifications hook will handle */ - }) + }), ); }, - [addSubscription, context.api] + [addSubscription, context.api], ); const handleWarningModalAccept = React.useCallback(() => { @@ -176,7 +176,7 @@ export const AgentProbeTemplates: React.FC = (props) = } const id = window.setInterval( () => refreshTemplates(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshTemplates]); @@ -193,7 +193,7 @@ export const AgentProbeTemplates: React.FC = (props) = } as ProbeTemplate, ]; }); - }) + }), ); }, [addSubscription, context.notificationChannel, setTemplates]); @@ -201,7 +201,7 @@ export const AgentProbeTemplates: React.FC = (props) = addSubscription( context.notificationChannel.messages(NotificationCategory.ProbeTemplateDeleted).subscribe((event) => { setTemplates((old) => old.filter((t) => t.name !== event.message.probeTemplate)); - }) + }), ); }, [addSubscription, context.notificationChannel, setTemplates]); @@ -212,7 +212,7 @@ export const AgentProbeTemplates: React.FC = (props) = } else { const ft = filterText.trim().toLowerCase(); filtered = templates.filter( - (t: ProbeTemplate) => t.name.toLowerCase().includes(ft) || t.xml.toLowerCase().includes(ft) + (t: ProbeTemplate) => t.name.toLowerCase().includes(ft) || t.xml.toLowerCase().includes(ft), ); } @@ -223,8 +223,8 @@ export const AgentProbeTemplates: React.FC = (props) = direction: sortBy.direction ?? SortByDirection.asc, }, filtered, - tableColumns - ) + tableColumns, + ), ); }, [filterText, templates, sortBy, setFilteredTemplates]); @@ -237,7 +237,7 @@ export const AgentProbeTemplates: React.FC = (props) = handleDelete(template); } }, - [context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete] + [context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete], ); const handleInsertAction = React.useCallback( @@ -246,10 +246,10 @@ export const AgentProbeTemplates: React.FC = (props) = context.api .insertProbes(template.name) .pipe(first()) - .subscribe(() => undefined) + .subscribe(() => undefined), ); }, - [addSubscription, context.api] + [addSubscription, context.api], ); const templateRows = React.useMemo( @@ -273,7 +273,7 @@ export const AgentProbeTemplates: React.FC = (props) = ); }), - [filteredTemplates, props.agentDetected, handleInsertAction, handleDeleteAction] + [filteredTemplates, props.agentDetected, handleInsertAction, handleDeleteAction], ); if (errorMessage != '') { @@ -393,7 +393,7 @@ export const AgentProbeTemplateUploadModal: React.FC of(false)) - ) + catchError((_) => of(false)), + ), ); }); @@ -415,10 +415,10 @@ export const AgentProbeTemplateUploadModal: React.FC { setUploading(false); setAllOks(oks.reduce((prev, curr, _) => prev && curr, true)); - }) + }), ); }, - [addSubscription, context.api, setAllOks, setUploading] + [addSubscription, context.api, setAllOks, setUploading], ); const handleSubmit = React.useCallback(() => { @@ -430,7 +430,7 @@ export const AgentProbeTemplateUploadModal: React.FC !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -439,8 +439,8 @@ export const AgentProbeTemplateUploadModal: React.FC = ({ children }) => { addSubscription( serviceContext.target.authFailure().subscribe(() => { setShowAuthModal(true); - }) + }), ); }, [serviceContext.target, setShowAuthModal, addSubscription]); @@ -181,10 +181,10 @@ const AppLayout: React.FC = ({ children }) => { .unreadNotifications() .pipe( map((notifications: Notification[]) => - _.filter(notifications, (n) => n.variant === AlertVariant.danger || n.variant === AlertVariant.warning) - ) + _.filter(notifications, (n) => n.variant === AlertVariant.danger || n.variant === AlertVariant.warning), + ), ) - .subscribe((s) => setErrorNotificationsCount(s.length)) + .subscribe((s) => setErrorNotificationsCount(s.length)), ); }, [ notificationsContext, @@ -205,7 +205,7 @@ const AppLayout: React.FC = ({ children }) => { const handleMarkNotificationRead = React.useCallback( (key) => () => notificationsContext.setRead(key, true), - [notificationsContext] + [notificationsContext], ); const handleTimeout = React.useCallback((key) => () => notificationsContext.setHidden(key), [notificationsContext]); @@ -214,7 +214,7 @@ const AppLayout: React.FC = ({ children }) => { addSubscription( serviceContext.target.sslFailure().subscribe(() => { setShowSslErrorModal(true); - }) + }), ); }, [serviceContext.target, serviceContext.target.sslFailure, setShowSslErrorModal, addSubscription]); @@ -237,7 +237,7 @@ const AppLayout: React.FC = ({ children }) => { setIsNavOpen(!props.mobileView); } }, - [joyState, setIsMobileView, setIsNavOpen] + [joyState, setIsMobileView, setIsNavOpen], ); const mobileOnSelect = React.useCallback( @@ -246,7 +246,7 @@ const AppLayout: React.FC = ({ children }) => { setIsNavOpen(false); } }, - [isMobileView, setIsNavOpen] + [isMobileView, setIsNavOpen], ); const handleSettingsButtonClick = React.useCallback(() => { @@ -295,7 +295,7 @@ const AppLayout: React.FC = ({ children }) => { Log out , ], - [handleLogout, handleLanguagePref] + [handleLogout, handleLanguagePref], ); const UserInfoToggle = React.useMemo( @@ -304,7 +304,7 @@ const AppLayout: React.FC = ({ children }) => { {username || } ), - [username, handleUserInfoToggle] + [username, handleUserInfoToggle], ); const handleHelpToggle = React.useCallback(() => setShowHelpDropdown((v) => !v), [setShowHelpDropdown]); @@ -448,7 +448,7 @@ const AppLayout: React.FC = ({ children }) => { UserInfoToggle, userInfoItems, helpItems, - ] + ], ); const Header = React.useMemo( @@ -481,7 +481,7 @@ const AppLayout: React.FC = ({ children }) => { ), - [isNavOpen, aboutModalOpen, HeaderToolbar, handleCloseAboutModal, onNavToggle, levelBadge] + [isNavOpen, aboutModalOpen, HeaderToolbar, handleCloseAboutModal, onNavToggle, levelBadge], ); const isActiveRoute = React.useCallback( @@ -498,7 +498,7 @@ const AppLayout: React.FC = ({ children }) => { } return false; }, - [location] + [location], ); const Navigation = React.useMemo( @@ -537,22 +537,22 @@ const AppLayout: React.FC = ({ children }) => { })} ), - [mobileOnSelect, isActiveRoute, levelBadge, activeLevel] + [mobileOnSelect, isActiveRoute, levelBadge, activeLevel], ); const Sidebar = React.useMemo( () => , - [Navigation, isNavOpen] + [Navigation, isNavOpen], ); const PageSkipToContent = React.useMemo( () => Skip to Content, - [] + [], ); const NotificationDrawer = React.useMemo( () => , - [handleCloseNotificationCenter] + [handleCloseNotificationCenter], ); React.useEffect(() => { diff --git a/src/app/AppLayout/AuthModal.tsx b/src/app/AppLayout/AuthModal.tsx index ad71f275c1..413ee83e73 100644 --- a/src/app/AppLayout/AuthModal.tsx +++ b/src/app/AppLayout/AuthModal.tsx @@ -43,17 +43,17 @@ export const AuthModal: React.FC = ({ onDismiss, onSave: onProps filter((target) => target !== NO_TARGET), first(), map((target) => target.connectUrl), - mergeMap((connectUrl) => context.authCredentials.setCredential(connectUrl, username, password)) + mergeMap((connectUrl) => context.authCredentials.setCredential(connectUrl, username, password)), ) .subscribe((ok) => { setLoading(false); if (ok) { onPropsSave(); } - }) + }), ); }, - [addSubscription, context.authCredentials, targetObs, setLoading, onPropsSave] + [addSubscription, context.authCredentials, targetObs, setLoading, onPropsSave], ); return ( diff --git a/src/app/AppLayout/CredentialAuthForm.tsx b/src/app/AppLayout/CredentialAuthForm.tsx index 2439bb5587..46e8285b5f 100644 --- a/src/app/AppLayout/CredentialAuthForm.tsx +++ b/src/app/AppLayout/CredentialAuthForm.tsx @@ -60,7 +60,7 @@ export const CredentialAuthForm: React.FC = ({ handleSave(); } }, - [handleSave, username, password] + [handleSave, username, password], ); const saveButtonLoadingProps = React.useMemo( @@ -69,8 +69,8 @@ export const CredentialAuthForm: React.FC = ({ spinnerAriaValueText: 'Saving', spinnerAriaLabel: 'saving-credentials', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); return ( diff --git a/src/app/Archives/AllArchivedRecordingsTable.tsx b/src/app/Archives/AllArchivedRecordingsTable.tsx index 5b3bf8c90c..54709e3192 100644 --- a/src/app/Archives/AllArchivedRecordingsTable.tsx +++ b/src/app/Archives/AllArchivedRecordingsTable.tsx @@ -89,13 +89,13 @@ export const AllArchivedRecordingsTable: React.FC ({ ...dir, targetAsObs: of(getTargetFromDirectory(dir)) }))); setIsLoading(false); }, - [setDirectories, setIsLoading] + [setDirectories, setIsLoading], ); const refreshDirectoriesAndCounts = React.useCallback(() => { setIsLoading(true); addSubscription( - context.api.doGet('fs/recordings', 'beta').subscribe(handleDirectoriesAndCounts) + context.api.doGet('fs/recordings', 'beta').subscribe(handleDirectoriesAndCounts), ); }, [addSubscription, context.api, setIsLoading, handleDirectoriesAndCounts]); @@ -103,7 +103,7 @@ export const AllArchivedRecordingsTable: React.FC { setSearchText(searchInput); }, - [setSearchText] + [setSearchText], ); const handleSearchInputClear = React.useCallback(() => { @@ -123,7 +123,7 @@ export const AllArchivedRecordingsTable: React.FC d.jvmId.toLowerCase().includes(formattedSearchText) || - d.connectUrl.toLowerCase().includes(formattedSearchText) + d.connectUrl.toLowerCase().includes(formattedSearchText), ); } return sortResources( @@ -132,7 +132,7 @@ export const AllArchivedRecordingsTable: React.FC refreshDirectoriesAndCounts(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshDirectoriesAndCounts]); @@ -151,7 +151,7 @@ export const AllArchivedRecordingsTable: React.FC { refreshDirectoriesAndCounts(); - }) + }), ); }, [addSubscription, context.notificationChannel, refreshDirectoriesAndCounts]); @@ -159,7 +159,7 @@ export const AllArchivedRecordingsTable: React.FC { refreshDirectoriesAndCounts(); - }) + }), ); }, [addSubscription, context.notificationChannel, refreshDirectoriesAndCounts]); @@ -167,7 +167,7 @@ export const AllArchivedRecordingsTable: React.FC { refreshDirectoriesAndCounts(); - }) + }), ); }, [addSubscription, context.notificationChannel, refreshDirectoriesAndCounts]); @@ -175,7 +175,7 @@ export const AllArchivedRecordingsTable: React.FC { refreshDirectoriesAndCounts(); - }) + }), ); }, [addSubscription, context.notificationChannel, refreshDirectoriesAndCounts]); @@ -188,10 +188,10 @@ export const AllArchivedRecordingsTable: React.FC { diff --git a/src/app/Archives/AllTargetsArchivedRecordingsTable.tsx b/src/app/Archives/AllTargetsArchivedRecordingsTable.tsx index b07fe8859e..d1db8d47d2 100644 --- a/src/app/Archives/AllTargetsArchivedRecordingsTable.tsx +++ b/src/app/Archives/AllTargetsArchivedRecordingsTable.tsx @@ -99,7 +99,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC v.data.targetNodes)) - .subscribe(handleArchivesForTargets) + .subscribe(handleArchivesForTargets), ); }, [addSubscription, context.api, setIsLoading, handleArchivesForTargets]); @@ -168,7 +168,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC { setArchivesForTargets((old) => { @@ -181,10 +181,10 @@ export const AllTargetsArchivedRecordingsTable: React.FC old.filter(({ target: t }) => !isEqualTarget(t, target))); setExpandedTargets((old) => old.filter((t) => !isEqualTarget(t, target))); }, - [setArchivesForTargets, setExpandedTargets] + [setArchivesForTargets, setExpandedTargets], ); const handleTargetNotification = React.useCallback( @@ -221,14 +221,14 @@ export const AllTargetsArchivedRecordingsTable: React.FC { setSearchText(searchInput); }, - [setSearchText] + [setSearchText], ); const handleSearchInputClear = React.useCallback(() => { @@ -248,7 +248,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC t.alias.toLowerCase().includes(formattedSearchText) || - t.connectUrl.toLowerCase().includes(formattedSearchText) + t.connectUrl.toLowerCase().includes(formattedSearchText), ); } return sortResources( @@ -257,7 +257,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC !hideEmptyTargets || v.archiveCount > 0), - tableColumns + tableColumns, ); }, [searchText, archivesForTargets, sortBy, hideEmptyTargets]); @@ -267,7 +267,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC refreshArchivesForTargets(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.target, context.settings, refreshArchivesForTargets]); @@ -276,7 +276,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC handleTargetNotification(v.message.event)) + .subscribe((v) => handleTargetNotification(v.message.event)), ); }, [addSubscription, context.notificationChannel, handleTargetNotification]); @@ -284,7 +284,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC { updateCount(v.message.target, 1); - }) + }), ); }, [addSubscription, context.notificationChannel, updateCount]); @@ -292,7 +292,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC { updateCount(v.message.target, 1); - }) + }), ); }, [addSubscription, context.notificationChannel, updateCount]); @@ -300,7 +300,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC { updateCount(v.message.target, -1); - }) + }), ); }, [addSubscription, context.notificationChannel, updateCount]); @@ -310,10 +310,10 @@ export const AllTargetsArchivedRecordingsTable: React.FC idx >= 0 ? [...expandedTargets.slice(0, idx), ...expandedTargets.slice(idx + 1, expandedTargets.length)] - : [...expandedTargets, target] + : [...expandedTargets, target], ); }, - [expandedTargets, setExpandedTargets] + [expandedTargets, setExpandedTargets], ); const targetRows = React.useMemo(() => { diff --git a/src/app/Archives/ArchiveUploadModal.tsx b/src/app/Archives/ArchiveUploadModal.tsx index b9fe5134cb..3be41c1f7e 100644 --- a/src/app/Archives/ArchiveUploadModal.tsx +++ b/src/app/Archives/ArchiveUploadModal.tsx @@ -93,7 +93,7 @@ export const ArchiveUploadModal: React.FC = ({ onClose, fileUpload.file, getFormattedLabels(), getProgressUpdateCallback(fileUpload.file.name), - fileUpload.abortSignal + fileUpload.abortSignal, ) .pipe( tap({ @@ -104,8 +104,8 @@ export const ArchiveUploadModal: React.FC = ({ onClose, onSingleFailure(fileUpload.file.name, err); }, }), - catchError((_) => of(undefined)) - ) + catchError((_) => of(undefined)), + ), ); }); @@ -115,10 +115,10 @@ export const ArchiveUploadModal: React.FC = ({ onClose, .subscribe((savedNames) => { setUploading(false); setAllOks(!savedNames.some((name) => name === undefined)); - }) + }), ); }, - [addSubscriptions, context.api, setUploading, getFormattedLabels, setAllOks] + [addSubscriptions, context.api, setUploading, getFormattedLabels, setAllOks], ); const handleSubmit = React.useCallback(() => { @@ -130,7 +130,7 @@ export const ArchiveUploadModal: React.FC = ({ onClose, setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -139,8 +139,8 @@ export const ArchiveUploadModal: React.FC = ({ onClose, spinnerAriaValueText: 'Submitting', spinnerAriaLabel: 'submitting-uploaded-recording', isLoading: uploading, - } as LoadingPropsType), - [uploading] + }) as LoadingPropsType, + [uploading], ); return ( diff --git a/src/app/Archives/Archives.tsx b/src/app/Archives/Archives.tsx index e438cd84de..73a798cb85 100644 --- a/src/app/Archives/Archives.tsx +++ b/src/app/Archives/Archives.tsx @@ -66,7 +66,7 @@ export const Archives: React.FC = ({ ...props }) => { const onTabSelect = React.useCallback( (_: React.MouseEvent, key: string | number) => switchTab(history, pathname, search, { tabKey: 'tab', tabValue: `${key}` }), - [history, pathname, search] + [history, pathname, search], ); const uploadTargetAsObs = React.useMemo(() => of(uploadAsTarget), []); diff --git a/src/app/CreateRecording/CreateRecording.tsx b/src/app/CreateRecording/CreateRecording.tsx index ca4bc04f31..4f6eeac22c 100644 --- a/src/app/CreateRecording/CreateRecording.tsx +++ b/src/app/CreateRecording/CreateRecording.tsx @@ -57,7 +57,7 @@ const Comp: React.FC, StaticContext, C maxAge: props.location?.state?.maxAge, maxSize: props.location?.state?.maxSize, }), - [props.location] + [props.location], ); return ( diff --git a/src/app/CreateRecording/CustomRecordingForm.tsx b/src/app/CreateRecording/CustomRecordingForm.tsx index 91eb585821..af6c594fe2 100644 --- a/src/app/CreateRecording/CustomRecordingForm.tsx +++ b/src/app/CreateRecording/CustomRecordingForm.tsx @@ -80,7 +80,7 @@ export const CustomRecordingForm: React.FC = ({ prefil ? RecordingNamePattern.test(recordingName) ? ValidatedOptions.success : ValidatedOptions.error - : ValidatedOptions.default + : ValidatedOptions.default, ); const [restartExisting, setRestartExisting] = React.useState(prefilled?.restartExisting || false); const [continuous, setContinuous] = React.useState((prefilled?.duration || 30) < 1); @@ -115,17 +115,17 @@ export const CustomRecordingForm: React.FC = ({ prefil if (resp && resp.ok) { history.goBack(); } - }) + }), ); }, - [addSubscription, context.api, history, setLoading] + [addSubscription, context.api, history, setLoading], ); const handleRestartExistingChange = React.useCallback( (checked) => { setRestartExisting(checked); }, - [setRestartExisting] + [setRestartExisting], ); const handleContinuousChange = React.useCallback( @@ -134,7 +134,7 @@ export const CustomRecordingForm: React.FC = ({ prefil setDuration(0); setDurationValid(checked ? ValidatedOptions.success : ValidatedOptions.error); }, - [setContinuous, setDuration, setDurationValid] + [setContinuous, setDuration, setDurationValid], ); const handleDurationChange = React.useCallback( @@ -142,14 +142,14 @@ export const CustomRecordingForm: React.FC = ({ prefil setDuration(Number(evt)); setDurationValid(DurationPattern.test(evt) ? ValidatedOptions.success : ValidatedOptions.error); }, - [setDurationValid, setDuration] + [setDurationValid, setDuration], ); const handleDurationUnitChange = React.useCallback( (evt) => { setDurationUnit(Number(evt)); }, - [setDurationUnit] + [setDurationUnit], ); const handleTemplateChange = React.useCallback( @@ -159,7 +159,7 @@ export const CustomRecordingForm: React.FC = ({ prefil type: templateType, }); }, - [setTemplate] + [setTemplate], ); const eventSpecifierString = React.useMemo(() => { @@ -191,42 +191,42 @@ export const CustomRecordingForm: React.FC = ({ prefil setNameValid(RecordingNamePattern.test(name) ? ValidatedOptions.success : ValidatedOptions.error); setRecordingName(name); }, - [setNameValid, setRecordingName] + [setNameValid, setRecordingName], ); const handleMaxAgeChange = React.useCallback( (evt) => { setMaxAge(Number(evt)); }, - [setMaxAge] + [setMaxAge], ); const handleMaxAgeUnitChange = React.useCallback( (evt) => { setMaxAgeUnits(Number(evt)); }, - [setMaxAgeUnits] + [setMaxAgeUnits], ); const handleMaxSizeChange = React.useCallback( (evt) => { setMaxSize(Number(evt)); }, - [setMaxSize] + [setMaxSize], ); const handleMaxSizeUnitChange = React.useCallback( (evt) => { setMaxSizeUnits(Number(evt)); }, - [setMaxSizeUnits] + [setMaxSizeUnits], ); const handleToDiskChange = React.useCallback( (checked, evt) => { setToDisk(evt.target.checked); }, - [setToDisk] + [setToDisk], ); const setRecordingOptions = React.useCallback( @@ -237,7 +237,7 @@ export const CustomRecordingForm: React.FC = ({ prefil setMaxSize(prefilled?.maxSize || options.maxSize || 0); setMaxSizeUnits(1); }, - [setMaxAge, setMaxAgeUnits, setMaxSize, setMaxSizeUnits, prefilled] + [setMaxAge, setMaxAgeUnits, setMaxSize, setMaxSizeUnits, prefilled], ); const handleSubmit = React.useCallback(() => { @@ -295,7 +295,7 @@ export const CustomRecordingForm: React.FC = ({ prefil forkJoin({ templates: context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/templates`), recordingOptions: context.api.doGet( - `targets/${encodeURIComponent(target.connectUrl)}/recordingOptions` + `targets/${encodeURIComponent(target.connectUrl)}/recordingOptions`, ), }).subscribe({ next: ({ templates, recordingOptions }) => { @@ -313,10 +313,10 @@ export const CustomRecordingForm: React.FC = ({ prefil setTemplate({}); setRecordingOptions({}); }, - }) + }), ); }, - [addSubscription, context.api, setTemplates, setTemplate, setRecordingOptions, setErrorMessage] + [addSubscription, context.api, setTemplates, setTemplate, setRecordingOptions, setErrorMessage], ); React.useEffect(() => { @@ -326,7 +326,7 @@ export const CustomRecordingForm: React.FC = ({ prefil setTemplates([]); setTemplate({}); setRecordingOptions({}); - }) + }), ); }, [context.target, setErrorMessage, addSubscription, setTemplates, setTemplate, setRecordingOptions]); @@ -346,7 +346,7 @@ export const CustomRecordingForm: React.FC = ({ prefil const hasReservedLabels = React.useMemo( () => labels.some((label) => label.key === 'template.name' || label.key === 'template.type'), - [labels] + [labels], ); const createButtonLoadingProps = React.useMemo( @@ -355,8 +355,8 @@ export const CustomRecordingForm: React.FC = ({ prefil spinnerAriaValueText: 'Creating', spinnerAriaLabel: 'create-active-recording', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); const selectedSpecifier = React.useMemo(() => { diff --git a/src/app/CreateRecording/SnapshotRecordingForm.tsx b/src/app/CreateRecording/SnapshotRecordingForm.tsx index ba4b2974e7..6bb277acfd 100644 --- a/src/app/CreateRecording/SnapshotRecordingForm.tsx +++ b/src/app/CreateRecording/SnapshotRecordingForm.tsx @@ -42,7 +42,7 @@ export const SnapshotRecordingForm: React.FC = (_) = if (success) { history.push('/recordings'); } - }) + }), ); }, [addSubscription, context.api, history, setLoading]); @@ -52,8 +52,8 @@ export const SnapshotRecordingForm: React.FC = (_) = spinnerAriaValueText: 'Creating', spinnerAriaLabel: 'create-snapshot-recording', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); React.useEffect(() => { @@ -61,7 +61,7 @@ export const SnapshotRecordingForm: React.FC = (_) = context.target.sslFailure().subscribe(() => { // also triggered if api calls in Custom Recording form fail setErrorMessage(missingSSLMessage); - }) + }), ); }, [context.target, setErrorMessage, addSubscription]); @@ -69,7 +69,7 @@ export const SnapshotRecordingForm: React.FC = (_) = addSubscription( context.target.authRetry().subscribe(() => { setErrorMessage(''); // Reset on retry - }) + }), ); }, [context.target, setErrorMessage, addSubscription]); @@ -78,7 +78,7 @@ export const SnapshotRecordingForm: React.FC = (_) = context.target.authFailure().subscribe(() => { // also triggered if api calls in Custom Recording form fail setErrorMessage(authFailMessage); - }) + }), ); }, [context.target, setErrorMessage, addSubscription]); @@ -86,7 +86,7 @@ export const SnapshotRecordingForm: React.FC = (_) = addSubscription( context.target.target().subscribe(() => { setErrorMessage(''); // Reset on change - }) + }), ); }, [context.target, setErrorMessage, addSubscription]); diff --git a/src/app/Dashboard/AddCard.tsx b/src/app/Dashboard/AddCard.tsx index 6d01a9fa74..639c020803 100644 --- a/src/app/Dashboard/AddCard.tsx +++ b/src/app/Dashboard/AddCard.tsx @@ -112,7 +112,7 @@ export const AddCard: React.FC = ({ variant, ..._props }) => { } setPropsConfig(c); }, - [t, setSelection, setPropsConfig] + [t, setSelection, setPropsConfig], ); const handleAdd = React.useCallback(() => { @@ -144,7 +144,7 @@ export const AddCard: React.FC = ({ variant, ..._props }) => { isExpanded: boolean, steps: WizardControlStep[], activeStep: WizardControlStep, - goToStepByIndex: (index: number) => void + goToStepByIndex: (index: number) => void, ) => { return ( @@ -164,7 +164,7 @@ export const AddCard: React.FC = ({ variant, ..._props }) => { ); }, - [selection] + [selection], ); const content = React.useMemo(() => { @@ -453,7 +453,7 @@ const PropsConfigForm: React.FC = ({ onChange, ...props }) copy[k] = e; onChange(copy); }, - [onChange, props.config] + [onChange, props.config], ); const handleNumeric = React.useCallback( @@ -463,7 +463,7 @@ const PropsConfigForm: React.FC = ({ onChange, ...props }) copy[k] = value; onChange(copy); }, - [onChange, props.config] + [onChange, props.config], ); const handleNumericStep = React.useCallback( @@ -472,7 +472,7 @@ const PropsConfigForm: React.FC = ({ onChange, ...props }) copy[k] = props.config[k] + v; onChange(copy); }, - [onChange, props.config] + [onChange, props.config], ); const createControl = React.useCallback( @@ -537,7 +537,7 @@ const PropsConfigForm: React.FC = ({ onChange, ...props }) ); }, - [t, props.config, handleChange, handleNumeric, handleNumericStep] + [t, props.config, handleChange, handleNumeric, handleNumericStep], ); return ( @@ -574,7 +574,7 @@ const SelectControl: React.FC = ({ handleChange, control, se } setSelectOpen(false); }, - [handleChange, setSelectOpen] + [handleChange, setSelectOpen], ); React.useEffect(() => { @@ -599,7 +599,7 @@ const SelectControl: React.FC = ({ handleChange, control, se setErrored(true); setOptions([`${err}`]); }, - }) + }), ); }, [addSubscription, setOptions, setErrored, control, control.values]); diff --git a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx index 57b6f4cb4c..08a1e9cea2 100644 --- a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx @@ -145,7 +145,7 @@ export const AutomatedAnalysisCard: DashboardCardFC const targetAutomatedAnalysisFilters = useSelector((state: RootState) => { const filters = state.automatedAnalysisFilters.targetFilters.filter( - (targetFilter: TargetAutomatedAnalysisFilters) => targetFilter.target === targetConnectURL + (targetFilter: TargetAutomatedAnalysisFilters) => targetFilter.target === targetConnectURL, ); return filters.length > 0 ? filters[0].filters : emptyAutomatedAnalysisFilters; }) as AutomatedAnalysisFiltersCategories; @@ -170,7 +170,7 @@ export const AutomatedAnalysisCard: DashboardCardFC const sorted = (Array.from(map) as CategorizedRuleEvaluations[]).sort(); setCategorizedEvaluation(sorted); }, - [setCategorizedEvaluation, setEvaluations] + [setCategorizedEvaluation, setEvaluations], ); // Will perform analysis on the first ActiveRecording which has @@ -201,10 +201,10 @@ export const AutomatedAnalysisCard: DashboardCardFC } } }`, - { connectUrl } + { connectUrl }, ); }, - [context.api] + [context.api], ); const queryArchivedRecordings = React.useCallback( @@ -225,10 +225,10 @@ export const AutomatedAnalysisCard: DashboardCardFC } } }`, - { connectUrl } + { connectUrl }, ); }, - [context.api] + [context.api], ); const handleStateErrors = React.useCallback( @@ -238,7 +238,7 @@ export const AutomatedAnalysisCard: DashboardCardFC setUsingArchivedReport(false); setUsingCachedReport(false); }, - [setErrorMessage, setIsLoading, setUsingArchivedReport, setUsingCachedReport] + [setErrorMessage, setIsLoading, setUsingArchivedReport, setUsingCachedReport], ); const handleLoading = React.useCallback(() => { @@ -251,14 +251,14 @@ export const AutomatedAnalysisCard: DashboardCardFC const handleArchivedRecordings = React.useCallback( (recordings: ArchivedRecording[]) => { const freshestRecording = recordings.reduce((prev, current) => - prev?.archivedTime > current?.archivedTime ? prev : current + prev?.archivedTime > current?.archivedTime ? prev : current, ); addSubscription( context.target .target() .pipe( filter((target) => target !== NO_TARGET), - first() + first(), ) .subscribe((target) => { context.reports @@ -276,7 +276,7 @@ export const AutomatedAnalysisCard: DashboardCardFC handleStateErrors(err.message); }, }); - }) + }), ); }, [ @@ -289,7 +289,7 @@ export const AutomatedAnalysisCard: DashboardCardFC setReportTime, setIsLoading, setReport, - ] + ], ); // try generating report on cached or archived recordings @@ -307,7 +307,7 @@ export const AutomatedAnalysisCard: DashboardCardFC queryArchivedRecordings(connectUrl) .pipe( first(), - map((v) => v.data.archivedRecordings.data as ArchivedRecording[]) + map((v) => v.data.archivedRecordings.data as ArchivedRecording[]), ) .subscribe({ next: (recordings) => { @@ -320,7 +320,7 @@ export const AutomatedAnalysisCard: DashboardCardFC error: (err) => { handleStateErrors(err.message); }, - }) + }), ); } }, @@ -335,7 +335,7 @@ export const AutomatedAnalysisCard: DashboardCardFC setReportTime, setReport, setIsLoading, - ] + ], ); const generateReport = React.useCallback(() => { @@ -345,7 +345,7 @@ export const AutomatedAnalysisCard: DashboardCardFC .target() .pipe( filter((target) => target !== NO_TARGET), - first() + first(), ) .subscribe((target) => { addSubscription( @@ -367,7 +367,7 @@ export const AutomatedAnalysisCard: DashboardCardFC if (recording === null || recording === undefined) { throw new Error(NO_RECORDINGS_MESSAGE); } - }) + }), ) .subscribe({ next: (recording) => { @@ -392,9 +392,9 @@ export const AutomatedAnalysisCard: DashboardCardFC handleEmptyRecordings(target.connectUrl); } }, - }) + }), ); - }) + }), ); }, [ addSubscription, @@ -425,7 +425,7 @@ export const AutomatedAnalysisCard: DashboardCardFC } else { handleStateErrors(RECORDING_FAILURE_MESSAGE); } - }) + }), ); }, [addSubscription, context.api, context.settings, generateReport, handleStateErrors]); @@ -448,7 +448,7 @@ export const AutomatedAnalysisCard: DashboardCardFC } return [undefined, undefined]; }, - [t, startProfilingRecording, generateReport] + [t, startProfilingRecording, generateReport], ); React.useEffect(() => { @@ -489,8 +489,8 @@ export const AutomatedAnalysisCard: DashboardCardFC categorizedEvaluation, targetAutomatedAnalysisFilters, targetAutomatedAnalysisGlobalFilters, - showNAScores - ) + showNAScores, + ), ); }, [ categorizedEvaluation, @@ -526,7 +526,7 @@ export const AutomatedAnalysisCard: DashboardCardFC error: (error) => { handleStateErrors(error.message); }, - }) + }), ); } }, [ @@ -553,7 +553,7 @@ export const AutomatedAnalysisCard: DashboardCardFC dispatch(automatedAnalysisAddFilterIntent(target, filterKey, filterValue)); } }, - [dispatch] + [dispatch], ); const handleClearFilters = React.useCallback(() => { @@ -741,7 +741,7 @@ export const AutomatedAnalysisCard: DashboardCardFC (error) => { handleStateErrors(error.message); }, - [handleStateErrors] + [handleStateErrors], ); const view = React.useMemo(() => { diff --git a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.tsx b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.tsx index 9638e7db91..e1d8a74f4d 100644 --- a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.tsx @@ -76,7 +76,7 @@ export const AutomatedAnalysisCardList: React.FC }, columnIndex, }), - [setSortBy, sortBy] + [setSortBy, sortBy], ); const flatFiltered = React.useMemo(() => { diff --git a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.tsx b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.tsx index a4b1b88548..0c036d08f4 100644 --- a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.tsx @@ -77,10 +77,10 @@ export const AutomatedAnalysisConfigDrawer: React.FC { diff --git a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.tsx b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.tsx index 0d935d2ee6..2fc181b89c 100644 --- a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.tsx @@ -87,7 +87,7 @@ export const AutomatedAnalysisConfigForm: React.FC( - context.settings.automatedAnalysisRecordingConfig() + context.settings.automatedAnalysisRecordingConfig(), ); const [formConfig, setFormConfig] = React.useState({ maxAge: context.settings.automatedAnalysisRecordingConfig().maxAge, @@ -117,9 +117,9 @@ export const AutomatedAnalysisConfigForm: React.FC { setErrorMessage(''); @@ -144,17 +144,17 @@ export const AutomatedAnalysisConfigForm: React.FC { addSubscription( targetSubject.subscribe((target) => { refreshTemplates(target); - }) + }), ); }, [targetSubject, addSubscription, refreshTemplates, setIsLoading, editing]); @@ -166,7 +166,7 @@ export const AutomatedAnalysisConfigForm: React.FC { @@ -422,7 +422,7 @@ export const AutomatedAnalysisConfigForm: React.FC { refreshTemplates(target); - }) + }), ); }} targetObs={targetSubject} @@ -469,7 +469,7 @@ export const AutomatedAnalysisConfigForm: React.FC ), - [t, handleSubmit, toggleEdit, formConfig.template, targetSelect, configData, editing, authModal] + [t, handleSubmit, toggleEdit, formConfig.template, targetSelect, configData, editing, authModal], ); const formSection = React.useMemo( @@ -479,7 +479,7 @@ export const AutomatedAnalysisConfigForm: React.FC{formSection}; diff --git a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisFilters.tsx b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisFilters.tsx index e60d737372..e31deec3fb 100644 --- a/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisFilters.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisFilters.tsx @@ -63,7 +63,7 @@ export const AutomatedAnalysisFilters: React.FC = const currentCategory = useSelector((state: RootState) => { const targetAutomatedAnalysisFilters = state.automatedAnalysisFilters.targetFilters.filter( - (targetFilter) => targetFilter.target === target + (targetFilter) => targetFilter.target === target, ); if (!targetAutomatedAnalysisFilters.length) { return 'Name'; @@ -82,31 +82,31 @@ export const AutomatedAnalysisFilters: React.FC = setIsCategoryDropdownOpen(false); dispatch(automatedAnalysisUpdateCategoryIntent(target, category)); }, - [dispatch, setIsCategoryDropdownOpen, target] + [dispatch, setIsCategoryDropdownOpen, target], ); const onDelete = React.useCallback( (category: string | ToolbarChipGroup, value) => updateFilters(target, { filterKey: category as string, filterValue: value, deleted: true }), - [updateFilters, target] + [updateFilters, target], ); const onDeleteGroup = React.useCallback( (category: string | ToolbarChipGroup) => updateFilters(target, { filterKey: category as string, deleted: true, deleteOptions: { all: true } }), - [updateFilters, target] + [updateFilters, target], ); const onNameInput = React.useCallback( (inputName: string) => updateFilters(target, { filterKey: currentCategory, filterValue: inputName }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onTopicInput = React.useCallback( (inputTopic: string) => { updateFilters(target, { filterKey: currentCategory, filterValue: inputTopic }); }, - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const getCategoryDisplay = React.useCallback( @@ -120,7 +120,7 @@ export const AutomatedAnalysisFilters: React.FC = throw new Error(`Unknown Automated Analysis Filter Category: ${category}`); } }, - [t] + [t], ); const categoryDropdown = React.useMemo(() => { @@ -158,7 +158,7 @@ export const AutomatedAnalysisFilters: React.FC = onSubmit={onTopicInput} />, ], - [evaluations, filters.Name, filters.Topic, onNameInput, onTopicInput] + [evaluations, filters.Name, filters.Topic, onNameInput, onTopicInput], ); return ( @@ -190,7 +190,7 @@ export const filterAutomatedAnalysis = ( topicEvalTuple: [string, RuleEvaluation[]][], filters: AutomatedAnalysisFiltersCategories, globalFilters: AutomatedAnalysisGlobalFiltersCategories, - showNAScores: boolean + showNAScores: boolean, ) => { if (!topicEvalTuple || !topicEvalTuple.length) { return topicEvalTuple; @@ -202,7 +202,7 @@ export const filterAutomatedAnalysis = ( filtered = filtered.map(([topic, evaluations]) => { return [topic, evaluations.filter((evaluation) => filters.Name.includes(evaluation.name))] as [ string, - RuleEvaluation[] + RuleEvaluation[], ]; }); } diff --git a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.tsx b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.tsx index 05c98f0c0e..bd5535f34a 100644 --- a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.tsx @@ -35,7 +35,7 @@ export const AutomatedAnalysisNameFilter: React.FC { diff --git a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.tsx b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.tsx index 569916a2f6..a497b2b9c8 100644 --- a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.tsx @@ -80,7 +80,7 @@ export const AutomatedAnalysisScoreFilter: React.FC { diff --git a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.tsx b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.tsx index 54512d3482..a29b54431b 100644 --- a/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.tsx +++ b/src/app/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.tsx @@ -35,7 +35,7 @@ export const AutomatedAnalysisTopicFilter: React.FC { diff --git a/src/app/Dashboard/Charts/ChartContext.tsx b/src/app/Dashboard/Charts/ChartContext.tsx index 98a3563890..6b421e4f79 100644 --- a/src/app/Dashboard/Charts/ChartContext.tsx +++ b/src/app/Dashboard/Charts/ChartContext.tsx @@ -29,12 +29,12 @@ const ChartContext: React.Context = React.createContext({ defaultServices.api, defaultServices.target, defaultServices.notificationChannel, - defaultServices.settings + defaultServices.settings, ), mbeanController: new MBeanMetricsChartController( defaultServices.api, defaultServices.target, - defaultServices.settings + defaultServices.settings, ), }); diff --git a/src/app/Dashboard/Charts/jfr/JFRMetricsChartController.tsx b/src/app/Dashboard/Charts/jfr/JFRMetricsChartController.tsx index fe3f9ebc71..16a4205eef 100644 --- a/src/app/Dashboard/Charts/jfr/JFRMetricsChartController.tsx +++ b/src/app/Dashboard/Charts/jfr/JFRMetricsChartController.tsx @@ -55,12 +55,12 @@ export class JFRMetricsChartController { private readonly _api: ApiService, private readonly _target: TargetService, private readonly _notifications: NotificationChannel, - private readonly _settings: SettingsService + private readonly _settings: SettingsService, ) { this._lazy = this._refCount$ .pipe( map((v) => v > 0), - pairwise() + pairwise(), ) .subscribe(([prev, curr]) => { if (!prev && curr) { @@ -78,7 +78,7 @@ export class JFRMetricsChartController { this._refCount$.next(this._refCount$.value + 1); return this._state$.asObservable().pipe( distinctUntilChanged(), - finalize(() => this._refCount$.next(this._refCount$.value - 1)) + finalize(() => this._refCount$.next(this._refCount$.value - 1)), ); } @@ -106,9 +106,9 @@ export class JFRMetricsChartController { this._updates$.pipe(throttleTime(this._settings.chartControllerConfig().minRefresh * 1000)), this._notifications.messages(NotificationCategory.ActiveRecordingCreated), this._notifications.messages(NotificationCategory.ActiveRecordingDeleted), - this._notifications.messages(NotificationCategory.ActiveRecordingStopped) + this._notifications.messages(NotificationCategory.ActiveRecordingStopped), ).pipe(switchMap((_) => this._target.target().pipe(first()))), - this._target.target().pipe(tap((_) => this._state$.next(ControllerState.UNKNOWN))) + this._target.target().pipe(tap((_) => this._state$.next(ControllerState.UNKNOWN))), ) .pipe(concatMap((t) => this._hasRecording(t))) .subscribe((v) => { diff --git a/src/app/Dashboard/Charts/mbean/MBeanMetricsChartCard.tsx b/src/app/Dashboard/Charts/mbean/MBeanMetricsChartCard.tsx index ba32718999..84d8e0dde3 100644 --- a/src/app/Dashboard/Charts/mbean/MBeanMetricsChartCard.tsx +++ b/src/app/Dashboard/Charts/mbean/MBeanMetricsChartCard.tsx @@ -87,7 +87,7 @@ const SimpleChart: React.FC<{ const data = React.useMemo( () => samples.map((v) => ({ x: v.timestamp, y: v.datapoint.value, name: v.datapoint.name })), - [samples] + [samples], ); const keys = React.useMemo(() => _.uniqBy(data, (d) => d.name), [data]); @@ -99,7 +99,7 @@ const SimpleChart: React.FC<{ ) : ( ), - [units, interpolation] + [units, interpolation], ); return ( @@ -161,8 +161,8 @@ const SimpleChart: React.FC<{ render( k, data.filter((d) => d.name === k.name), - style - ) + style, + ), )} @@ -388,7 +388,7 @@ export const MBeanMetricsChartCard: DashboardCardFC } return [...old, ...newSamples].filter((d) => d.timestamp > timestamp - props.duration * 1000); }); - }) + }), ); }, [addSubscription, controllerContext, props.chartKind, props.duration]); @@ -411,7 +411,7 @@ export const MBeanMetricsChartCard: DashboardCardFC addSubscription( serviceContext.target.target().subscribe((_) => { setSamples([]); - }) + }), ); }, [addSubscription, serviceContext, setSamples, refresh]); @@ -435,7 +435,7 @@ export const MBeanMetricsChartCard: DashboardCardFC isDisabled={isLoading} /> ), - [t, props.chartKind, refresh, isLoading] + [t, props.chartKind, refresh, isLoading], ); const actions = React.useMemo(() => { @@ -452,7 +452,7 @@ export const MBeanMetricsChartCard: DashboardCardFC {actions} ), - [t, props.chartKind, props.duration, props.period, actions] + [t, props.chartKind, props.duration, props.period, actions], ); const chartKind = React.useMemo(() => getChartKindByName(props.chartKind), [props.chartKind]); @@ -463,7 +463,7 @@ export const MBeanMetricsChartCard: DashboardCardFC {chartKind.visual(theme, props.themeColor, cardWidth, samples)} ), - [theme, containerRef, props.themeColor, props.isFullHeight, chartKind, cardWidth, samples] + [theme, containerRef, props.themeColor, props.isFullHeight, chartKind, cardWidth, samples], ); return ( diff --git a/src/app/Dashboard/Charts/mbean/MBeanMetricsChartController.tsx b/src/app/Dashboard/Charts/mbean/MBeanMetricsChartController.tsx index 5bbc1b0eff..0df5017655 100644 --- a/src/app/Dashboard/Charts/mbean/MBeanMetricsChartController.tsx +++ b/src/app/Dashboard/Charts/mbean/MBeanMetricsChartController.tsx @@ -46,12 +46,12 @@ export class MBeanMetricsChartController { constructor( private readonly _api: ApiService, private readonly _target: TargetService, - private readonly _settings: SettingsService + private readonly _settings: SettingsService, ) { this._lazy = this._refCount$ .pipe( map((v) => v > 0), - pairwise() + pairwise(), ) .subscribe(([prev, curr]) => { if (!prev && curr) { @@ -84,7 +84,7 @@ export class MBeanMetricsChartController { } }); this._metrics.get(category)?.push(...updated); - }) + }), ); } @@ -114,14 +114,14 @@ export class MBeanMetricsChartController { this._attach = merge( this._updates$.pipe( throttleTime(this._settings.chartControllerConfig().minRefresh * 1000), - concatMap((_) => this._target.target().pipe(first())) + concatMap((_) => this._target.target().pipe(first())), ), - this._target.target() + this._target.target(), ) .pipe( tap((_) => this._loading$.next(true)), concatMap((t) => this._queryMetrics(t)), - tap((_) => this._loading$.next(false)) + tap((_) => this._loading$.next(false)), ) .subscribe((v) => this._state$.next(v)); } diff --git a/src/app/Dashboard/Dashboard.tsx b/src/app/Dashboard/Dashboard.tsx index 1f1de0dbc4..4bdc13a0c2 100644 --- a/src/app/Dashboard/Dashboard.tsx +++ b/src/app/Dashboard/Dashboard.tsx @@ -53,11 +53,11 @@ export const Dashboard: React.FC = (_) => { serviceContext.api, serviceContext.target, serviceContext.notificationChannel, - serviceContext.settings - ) + serviceContext.settings, + ), ); const mbeanChartController = React.useRef( - new MBeanMetricsChartController(serviceContext.api, serviceContext.target, serviceContext.settings) + new MBeanMetricsChartController(serviceContext.api, serviceContext.target, serviceContext.settings), ); const currLayout = React.useMemo(() => { @@ -91,7 +91,7 @@ export const Dashboard: React.FC = (_) => { (idx: number) => { dispatch(dashboardConfigDeleteCardIntent(idx)); }, - [dispatch] + [dispatch], ); const handleResetSize = React.useCallback( @@ -102,7 +102,7 @@ export const Dashboard: React.FC = (_) => { } dispatch(dashboardConfigResizeCardIntent(idx, defaultSpan)); }, - [dispatch, currLayout] + [dispatch, currLayout], ); const emptyLayout = React.useMemo(() => !currLayout.cards || !currLayout.cards.length, [currLayout.cards]); diff --git a/src/app/Dashboard/DashboardCard.tsx b/src/app/Dashboard/DashboardCard.tsx index b72370a279..4f3cb725fa 100644 --- a/src/app/Dashboard/DashboardCard.tsx +++ b/src/app/Dashboard/DashboardCard.tsx @@ -88,7 +88,7 @@ export const DashboardCard: React.FC = ({ {resizeBar} ), - [cardRef, props, onMouseEnter, onMouseLeave, cardHeader, children, isDraggable, dashboardId, resizeBar] + [cardRef, props, onMouseEnter, onMouseLeave, cardHeader, children, isDraggable, dashboardId, resizeBar], ); return {content}; diff --git a/src/app/Dashboard/DashboardCardActionMenu.tsx b/src/app/Dashboard/DashboardCardActionMenu.tsx index c04c0da6b8..3a2c40b1d6 100644 --- a/src/app/Dashboard/DashboardCardActionMenu.tsx +++ b/src/app/Dashboard/DashboardCardActionMenu.tsx @@ -38,7 +38,7 @@ export const DashboardCardActionMenu: React.FC = ({ (_) => { setOpen(false); }, - [setOpen] + [setOpen], ); return ( diff --git a/src/app/Dashboard/DashboardLayoutCreateModal.tsx b/src/app/Dashboard/DashboardLayoutCreateModal.tsx index 336137ae36..92a933e528 100644 --- a/src/app/Dashboard/DashboardLayoutCreateModal.tsx +++ b/src/app/Dashboard/DashboardLayoutCreateModal.tsx @@ -90,7 +90,7 @@ export const DashboardLayoutCreateModal: React.FC { setSelectedTemplate(template); }, - [setSelectedTemplate] + [setSelectedTemplate], ); const formGroup = React.useMemo(() => { @@ -197,7 +197,7 @@ export const DashboardLayoutCreateModal: React.FC ), - [t, isCreateModal] + [t, isCreateModal], ); return ( diff --git a/src/app/Dashboard/DashboardLayoutSetAsTemplateModal.tsx b/src/app/Dashboard/DashboardLayoutSetAsTemplateModal.tsx index 3ae43102d3..b7b85598af 100644 --- a/src/app/Dashboard/DashboardLayoutSetAsTemplateModal.tsx +++ b/src/app/Dashboard/DashboardLayoutSetAsTemplateModal.tsx @@ -76,7 +76,7 @@ export const DashboardLayoutSetAsTemplateModal: React.FC = (_p (_ev: React.MouseEvent) => { setIsUploadModalOpen(true); }, - [setIsUploadModalOpen] + [setIsUploadModalOpen], ); const handleUploadModalClose = React.useCallback(() => { @@ -149,7 +149,7 @@ export const DashboardLayoutToolbar: React.FC = (_p setIsSelectorOpen(false); setSelectedTemplate(DefaultSelectedTemplate); }, - [setOldName, setIsCreateModalOpen, setIsSelectorOpen] + [setOldName, setIsCreateModalOpen, setIsSelectorOpen], ); const handleCreateModalClose = React.useCallback(() => { @@ -162,7 +162,7 @@ export const DashboardLayoutToolbar: React.FC = (_p setSelectDelete(layout); setIsDeleteWarningModalOpen(true); }, - [setSelectDelete, setIsDeleteWarningModalOpen] + [setSelectDelete, setIsDeleteWarningModalOpen], ); const handleDeleteWarningModalClose = React.useCallback(() => { @@ -186,7 +186,7 @@ export const DashboardLayoutToolbar: React.FC = (_p } if (deleteRef.current) deleteRef.current.blur(); }, - [context.settings, dispatch, handleDeleteWarningModalOpen] + [context.settings, dispatch, handleDeleteWarningModalOpen], ); const handleRenameLayout = React.useCallback( @@ -194,14 +194,14 @@ export const DashboardLayoutToolbar: React.FC = (_p setOldName(oldName); setIsCreateModalOpen(true); }, - [setOldName, setIsCreateModalOpen] + [setOldName, setIsCreateModalOpen], ); const handleFavoriteLayout = React.useCallback( (layoutName: string) => { dispatch(dashboardConfigFavoriteLayoutIntent(layoutName)); }, - [dispatch] + [dispatch], ); const onFocus = React.useCallback(() => { @@ -220,7 +220,7 @@ export const DashboardLayoutToolbar: React.FC = (_p setIsSelectorOpen(false); onFocus(); }, - [dispatch, setIsSelectorOpen, onFocus, dashboardConfigs] + [dispatch, setIsSelectorOpen, onFocus, dashboardConfigs], ); const onActionClick = React.useCallback( @@ -234,14 +234,14 @@ export const DashboardLayoutToolbar: React.FC = (_p handleFavoriteLayout(itemId); } }, - [handleRenameLayout, handleDeleteButton, handleFavoriteLayout] + [handleRenameLayout, handleDeleteButton, handleFavoriteLayout], ); const onToggle = React.useCallback( (_ev: React.MouseEvent) => { setIsSelectorOpen((open) => !open); }, - [setIsSelectorOpen] + [setIsSelectorOpen], ); const onCreateDropdownSelect = React.useCallback(() => { @@ -251,7 +251,7 @@ export const DashboardLayoutToolbar: React.FC = (_p const createBlankLayout = React.useCallback(() => { const name = getUniqueIncrementingName( 'Custom', - dashboardConfigs.layouts.map((l) => l.name) + dashboardConfigs.layouts.map((l) => l.name), ); const template: DashboardLayout = { @@ -276,7 +276,7 @@ export const DashboardLayoutToolbar: React.FC = (_p Upload Template , ], - [createBlankLayout, handleCreateModalOpen, handleUploadModalOpen] + [createBlankLayout, handleCreateModalOpen, handleUploadModalOpen], ); const createTemplateButton = React.useMemo( @@ -317,7 +317,7 @@ export const DashboardLayoutToolbar: React.FC = (_p setIsCreateDropdownOpen, isCreateDropdownOpen, createTemplateDropdownItems, - ] + ], ); const renameButton = React.useMemo( @@ -332,7 +332,7 @@ export const DashboardLayoutToolbar: React.FC = (_p data-quickstart-id="dashboard-rename-btn" /> ), - [t, handleRenameLayout, currLayout.name] + [t, handleRenameLayout, currLayout.name], ); const deleteButton = React.useMemo( @@ -350,7 +350,7 @@ export const DashboardLayoutToolbar: React.FC = (_p {t('DELETE', { ns: 'common' })} ), - [t, handleDeleteButton, currLayout.name] + [t, handleDeleteButton, currLayout.name], ); const dropdownItems = React.useMemo(() => { @@ -400,7 +400,7 @@ export const DashboardLayoutToolbar: React.FC = (_p } setIsKebabOpen(false); }, - [handleSetAsTemplateModalOpen, handleDownloadTemplateModalOpen, handleClearLayout, setIsKebabOpen] + [handleSetAsTemplateModalOpen, handleDownloadTemplateModalOpen, handleClearLayout, setIsKebabOpen], ); const kebabDropdown = React.useMemo( @@ -428,7 +428,7 @@ export const DashboardLayoutToolbar: React.FC = (_p {dropdownItems} ), - [t, onKebabSelect, setIsKebabOpen, isKebabOpen, dropdownItems] + [t, onKebabSelect, setIsKebabOpen, isKebabOpen, dropdownItems], ); const menuGroups = React.useCallback( @@ -470,7 +470,7 @@ export const DashboardLayoutToolbar: React.FC = (_p ); }, - [t, currLayout.name, dashboardConfigs.layouts] + [t, currLayout.name, dashboardConfigs.layouts], ); const onOpenChange = React.useCallback( @@ -480,7 +480,7 @@ export const DashboardLayoutToolbar: React.FC = (_p } setIsSelectorOpen(_isOpen); }, - [setIsSelectorOpen, isDeleteWarningModalOpen, isCreateModalOpen, isUploadModalOpen] + [setIsSelectorOpen, isDeleteWarningModalOpen, isCreateModalOpen, isUploadModalOpen], ); const menuDropdown = React.useMemo(() => { diff --git a/src/app/Dashboard/DashboardSolo.tsx b/src/app/Dashboard/DashboardSolo.tsx index 5e51827928..66705a3513 100644 --- a/src/app/Dashboard/DashboardSolo.tsx +++ b/src/app/Dashboard/DashboardSolo.tsx @@ -38,7 +38,7 @@ const DashboardSolo: React.FC = ({ ..._props }) => { () => (dashboardConfigs.layouts.find((l) => l.name === layout) ?? dashboardConfigs.layouts[dashboardConfigs.current]) .cards, - [dashboardConfigs, layout] + [dashboardConfigs, layout], ); const cardConfig = React.useMemo(() => { diff --git a/src/app/Dashboard/DraggableRef.tsx b/src/app/Dashboard/DraggableRef.tsx index d918f6ac83..2a9050399b 100644 --- a/src/app/Dashboard/DraggableRef.tsx +++ b/src/app/Dashboard/DraggableRef.tsx @@ -65,7 +65,7 @@ const inBetween = ( ev: MouseEvent, rect1: DOMRect, rect2: DOMRect, - scales: [number, number] + scales: [number, number], ): [boolean, ItemPosition] => { const [leftScale, rightScale] = scales; const withinHeightRect1 = ev.clientY > rect1.top && ev.clientY < rect1.bottom; @@ -165,7 +165,7 @@ export const DraggableRef: React.FC = ({ children, dashboardI } handleDisabledElements(false); }, - [setIsDragging, setRefStyle, isDragging] + [setIsDragging, setRefStyle, isDragging], ); const onMouseUpWhileDragging = React.useCallback( @@ -189,7 +189,7 @@ export const DraggableRef: React.FC = ({ children, dashboardI } handleDisabledElements(false); }, - [dispatch, setIsDragging, setRefStyle, refStyle, dashboardId] + [dispatch, setIsDragging, setRefStyle, refStyle, dashboardId], ); const onMouseMoveWhileDragging = React.useCallback( @@ -315,7 +315,7 @@ export const DraggableRef: React.FC = ({ children, dashboardI }); handleDisabledElements(true); }, - [setRefStyle, refStyle] + [setRefStyle, refStyle], ); const onDragStart = React.useCallback( @@ -360,7 +360,7 @@ export const DraggableRef: React.FC = ({ children, dashboardI document.addEventListener('mouseup', mouseUpListener.current); handleDisabledElements(true); }, - [setRefStyle, setIsDragging, onMouseMoveWhileDragging, onMouseUpWhileDragging, refStyle, isDragging] + [setRefStyle, setIsDragging, onMouseMoveWhileDragging, onMouseUpWhileDragging, refStyle, isDragging], ); return ( diff --git a/src/app/Dashboard/LayoutTemplateGroup.tsx b/src/app/Dashboard/LayoutTemplateGroup.tsx index 14c5b62d48..bed2a43628 100644 --- a/src/app/Dashboard/LayoutTemplateGroup.tsx +++ b/src/app/Dashboard/LayoutTemplateGroup.tsx @@ -76,7 +76,7 @@ export const LayoutTemplateGroup: React.FC = ({ setSelectedTemplate(selected); onTemplateSelect(selected); }, - [setSelectedTemplate, onTemplateSelect, props.title] + [setSelectedTemplate, onTemplateSelect, props.title], ); const handleClearRecent = React.useCallback(() => { @@ -173,7 +173,7 @@ export const KebabCatalogTileBadge: React.FC = ({ te (_ev) => { setIsOpen(false); }, - [setIsOpen] + [setIsOpen], ); const openKebab = React.useCallback( @@ -181,7 +181,7 @@ export const KebabCatalogTileBadge: React.FC = ({ te e.stopPropagation(); setIsOpen(value); }, - [setIsOpen] + [setIsOpen], ); const handleTemplateDownload = React.useCallback( @@ -189,7 +189,7 @@ export const KebabCatalogTileBadge: React.FC = ({ te e.stopPropagation(); serviceContext.api.downloadLayoutTemplate(template); }, - [serviceContext.api, template] + [serviceContext.api, template], ); const handleTemplateDelete = React.useCallback( @@ -197,7 +197,7 @@ export const KebabCatalogTileBadge: React.FC = ({ te e.stopPropagation(); onTemplateDelete(template.name); }, - [onTemplateDelete, template.name] + [onTemplateDelete, template.name], ); const dropdownItems = React.useMemo(() => { diff --git a/src/app/Dashboard/LayoutTemplatePicker.tsx b/src/app/Dashboard/LayoutTemplatePicker.tsx index f2cc9d246e..61296afe44 100644 --- a/src/app/Dashboard/LayoutTemplatePicker.tsx +++ b/src/app/Dashboard/LayoutTemplatePicker.tsx @@ -123,10 +123,10 @@ export const LayoutTemplatePicker: React.FC = ({ onTe const { t } = useTranslation(); const recentTemplateRecords: LayoutTemplateRecord[] = useSelector( - (state: RootState) => state.dashboardConfigs.templateHistory + (state: RootState) => state.dashboardConfigs.templateHistory, ); const userSubmittedTemplates: LayoutTemplate[] = useSelector( - (state: RootState) => state.dashboardConfigs.customTemplates + (state: RootState) => state.dashboardConfigs.customTemplates, ); const searchFilteredTemplates = React.useCallback( @@ -136,7 +136,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe } return templates.filter((t) => t.name.toLowerCase().includes(searchFilter.toLowerCase())); }, - [searchFilter] + [searchFilter], ); const allTemplates: LayoutTemplate[] = React.useMemo(() => { @@ -153,7 +153,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe setSelectedTemplate(template); setIsDrawerExpanded(true); }, - [onTemplateSelect, setSelectedTemplate, setIsDrawerExpanded] + [onTemplateSelect, setSelectedTemplate, setIsDrawerExpanded], ); const handleTemplateDelete = React.useCallback( @@ -166,7 +166,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe return prev; }); }, - [dispatch, setSelectedTemplate] + [dispatch, setSelectedTemplate], ); const onInnerTemplateDelete = React.useCallback( @@ -178,7 +178,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe handleTemplateDelete(templateName); } }, - [serviceContext.settings, setIsDeleteWarningModalOpen, setToDelete, handleTemplateDelete] + [serviceContext.settings, setIsDeleteWarningModalOpen, setToDelete, handleTemplateDelete], ); const handleDeleteWarningModalClose = React.useCallback(() => { @@ -214,28 +214,28 @@ export const LayoutTemplatePicker: React.FC = ({ onTe {t('UPLOAD', { ns: 'common' })} ), - [t, handleUploadButton] + [t, handleUploadButton], ); const onSearchChange = React.useCallback( (value: string) => { setSearchFilter(value); }, - [setSearchFilter] + [setSearchFilter], ); const onDeleteChip = React.useCallback( (_category: string, chip: string) => { setSelectedFilters((prev) => prev.filter((item) => item !== chip)); }, - [setSelectedFilters] + [setSelectedFilters], ); const onFilterSelect = React.useCallback( ( _ev: React.MouseEvent | React.ChangeEvent, selection: string | SelectOptionObject, - isPlaceholder: boolean | undefined + isPlaceholder: boolean | undefined, ) => { const selected = selection as LayoutTemplateFilter; setSelectedFilters((prev) => { @@ -248,14 +248,14 @@ export const LayoutTemplatePicker: React.FC = ({ onTe return [...prev, selected]; }); }, - [setSelectedFilters] + [setSelectedFilters], ); const onFilterSelectToggle = React.useCallback( (isExpanded: boolean) => { setIsFilterSelectOpen(isExpanded); }, - [setIsFilterSelectOpen] + [setIsFilterSelectOpen], ); const onClearAllFilters = React.useCallback(() => { @@ -266,14 +266,14 @@ export const LayoutTemplatePicker: React.FC = ({ onTe (isExpanded: boolean) => { setIsSortSelectOpen(isExpanded); }, - [setIsSortSelectOpen] + [setIsSortSelectOpen], ); const onSortSelect = React.useCallback( ( _ev: React.MouseEvent | React.ChangeEvent, selection: string | SelectOptionObject, - isPlaceholder: boolean | undefined + isPlaceholder: boolean | undefined, ) => { const selected = selection.valueOf() as LayoutTemplateSort; setSelectedSort((_prev) => { @@ -284,7 +284,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe }); setIsSortSelectOpen(false); }, - [setSelectedSort, setIsSortSelectOpen] + [setSelectedSort, setIsSortSelectOpen], ); const sortArrowIcon = React.useMemo(() => { @@ -501,7 +501,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe sortDirection, onInnerTemplateSelect, onInnerTemplateDelete, - ] + ], ); const RecentTemplates = React.useMemo(() => { @@ -614,7 +614,7 @@ export const LayoutTemplatePicker: React.FC = ({ onTe {sortedFilteredFeatureLeveledTemplateLayoutGroup('Cryostat', CryostatLayoutTemplates)} {sortedFilteredFeatureLeveledTemplateLayoutGroup( t('USER_SUBMITTED', { ns: 'common' }), - userSubmittedTemplates + userSubmittedTemplates, )} ) : ( diff --git a/src/app/Dashboard/LayoutTemplateUploadModal.tsx b/src/app/Dashboard/LayoutTemplateUploadModal.tsx index e79e4050ca..df476926ba 100644 --- a/src/app/Dashboard/LayoutTemplateUploadModal.tsx +++ b/src/app/Dashboard/LayoutTemplateUploadModal.tsx @@ -115,10 +115,10 @@ export const LayoutTemplateUploadModal: React.FC cards: template.cards, vendor: LayoutTemplateVendor.USER, } as LayoutTemplate; - }) + }), ); }, - [t, customTemplates] + [t, customTemplates], ); const reset = React.useCallback(() => { @@ -136,13 +136,13 @@ export const LayoutTemplateUploadModal: React.FC onClose(); } }, - [uploading, reset, onClose] + [uploading, reset, onClose], ); const onFileSubmit = React.useCallback( ( fileUploads: FUpload[], - { getProgressUpdateCallback: _getProgressUpdateCallback, onSingleSuccess, onSingleFailure }: UploadCallbacks + { getProgressUpdateCallback: _getProgressUpdateCallback, onSingleSuccess, onSingleFailure }: UploadCallbacks, ) => { setUploading(true); @@ -162,7 +162,7 @@ export const LayoutTemplateUploadModal: React.FC Warning: To see this template in the template picker, make sure the Cryostat Feature Level is set to BETA. - + , ); } else { onSingleSuccess(fileUpload.file.name); @@ -172,7 +172,7 @@ export const LayoutTemplateUploadModal: React.FC // template name already taken from previous upload onSingleFailure( fileUpload.file.name, - new Error(t('LayoutTemplateUploadModal.ERROR.DUPLICATE_UPLOAD', { name: template.name })) + new Error(t('LayoutTemplateUploadModal.ERROR.DUPLICATE_UPLOAD', { name: template.name })), ); return of(null); } @@ -180,8 +180,8 @@ export const LayoutTemplateUploadModal: React.FC catchError((err) => { onSingleFailure(fileUpload.file.name, err); return of(null); - }) - ) + }), + ), ); }); @@ -198,10 +198,10 @@ export const LayoutTemplateUploadModal: React.FC category: 'User-submitted', }); } - }) + }), ); }, - [addSubscription, dispatch, t, validateParseTemplate, setUploading, setSelectedTemplate, setAllOks] + [addSubscription, dispatch, t, validateParseTemplate, setUploading, setSelectedTemplate, setAllOks], ); const handleSubmit = React.useCallback(() => { @@ -213,7 +213,7 @@ export const LayoutTemplateUploadModal: React.FC setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -222,8 +222,8 @@ export const LayoutTemplateUploadModal: React.FC spinnerAriaValueText: t('SUBMITTING', { ns: 'common' }), spinnerAriaLabel: 'submitting-layout-templates', isLoading: uploading, - } as LoadingPropsType), - [t, uploading] + }) as LoadingPropsType, + [t, uploading], ); return ( diff --git a/src/app/Dashboard/ResizableRef.tsx b/src/app/Dashboard/ResizableRef.tsx index 72869b204c..f097169a91 100644 --- a/src/app/Dashboard/ResizableRef.tsx +++ b/src/app/Dashboard/ResizableRef.tsx @@ -44,7 +44,7 @@ export const ResizableRef: React.FC = ({ ..._props }: ResizableRefProps) => { const cardConfigs: CardConfig[] = useSelector( - (state: RootState) => state.dashboardConfigs.layouts[state.dashboardConfigs.current].cards + (state: RootState) => state.dashboardConfigs.layouts[state.dashboardConfigs.current].cards, ); const dispatch = useDispatch(); @@ -91,7 +91,7 @@ export const ResizableRef: React.FC = ({ minCardRight, maxCardRight, cardSizes.span.minimum, - cardSizes.span.maximum + cardSizes.span.maximum, ) as gridSpans; dispatch(dashboardConfigResizeCardIntent(dashboardId, gridSpan)); @@ -99,7 +99,7 @@ export const ResizableRef: React.FC = ({ console.error('cardRef.current is undefined'); } }, - [dispatch, cardRef, cardConfigs, nearEdgeMultiplier, dashboardId, cardSizes] + [dispatch, cardRef, cardConfigs, nearEdgeMultiplier, dashboardId, cardSizes], ); const callbackMouseUp = React.useCallback(() => { @@ -125,7 +125,7 @@ export const ResizableRef: React.FC = ({ maxWidth.current = undefined; handleDisabledElements(true); }, - [callbackMouseMove, callbackMouseUp] + [callbackMouseMove, callbackMouseUp], ); return
; diff --git a/src/app/Dashboard/SearchAutocomplete.tsx b/src/app/Dashboard/SearchAutocomplete.tsx index b43c43cc76..9a5921290c 100644 --- a/src/app/Dashboard/SearchAutocomplete.tsx +++ b/src/app/Dashboard/SearchAutocomplete.tsx @@ -64,7 +64,7 @@ export const SearchAutocomplete: React.FC = ({ onChange setValue(newValue); onChange(newValue); }, - [setValue, setHint, setIsAutocompleteOpen, setAutocompleteOptions, onChange, props.values] + [setValue, setHint, setIsAutocompleteOpen, setAutocompleteOptions, onChange, props.values], ); // Whenever an autocomplete option is selected, set the search input value, close the menu, and put the browser @@ -77,7 +77,7 @@ export const SearchAutocomplete: React.FC = ({ onChange setIsAutocompleteOpen(false); searchInputRef.current && searchInputRef.current.focus(); }, - [setValue, setHint, setIsAutocompleteOpen] + [setValue, setHint, setIsAutocompleteOpen], ); const handleMenuKeys = React.useCallback( @@ -125,7 +125,7 @@ export const SearchAutocomplete: React.FC = ({ onChange searchInputRef.current && searchInputRef.current.focus(); } }, - [hint, isAutocompleteOpen] + [hint, isAutocompleteOpen], ); // The autocomplete menu should close if the user clicks outside the menu. @@ -135,7 +135,7 @@ export const SearchAutocomplete: React.FC = ({ onChange setIsAutocompleteOpen(false); } }, - [isAutocompleteOpen] + [isAutocompleteOpen], ); React.useEffect(() => { @@ -158,7 +158,7 @@ export const SearchAutocomplete: React.FC = ({ onChange id="cryostat-autocomplete-search" /> ), - [value, onSearchChange, onClear, hint] + [value, onSearchChange, onClear, hint], ); const autocomplete = React.useMemo( @@ -169,7 +169,7 @@ export const SearchAutocomplete: React.FC = ({ onChange ), - [autocompleteOptions, onSelect] + [autocompleteOptions, onSelect], ); return ( diff --git a/src/app/Dashboard/dashboard-utils.tsx b/src/app/Dashboard/dashboard-utils.tsx index 2e5428d4bc..942e933ab1 100644 --- a/src/app/Dashboard/dashboard-utils.tsx +++ b/src/app/Dashboard/dashboard-utils.tsx @@ -156,7 +156,7 @@ export const layoutize = (template: LayoutTemplate, name: string): DashboardLayo export const recordToLayoutTemplate = ( record: LayoutTemplateRecord, - allTemplates: LayoutTemplate[] + allTemplates: LayoutTemplate[], ): LayoutTemplate | undefined => { return allTemplates.find((template) => template.name === record.name && template.vendor === record.vendor); }; @@ -208,7 +208,7 @@ export function getCardDescriptorByTitle(title: string, t: TFunction): Dashboard } export const getDashboardCards: (featureLevel?: FeatureLevel) => DashboardCardDescriptor[] = ( - featureLevel = FeatureLevel.DEVELOPMENT + featureLevel = FeatureLevel.DEVELOPMENT, ) => { const cards = [ JvmDetailsCardDescriptor, diff --git a/src/app/DateTimePicker/DateTimePicker.tsx b/src/app/DateTimePicker/DateTimePicker.tsx index aa7606fd32..15744181cd 100644 --- a/src/app/DateTimePicker/DateTimePicker.tsx +++ b/src/app/DateTimePicker/DateTimePicker.tsx @@ -52,7 +52,7 @@ export const DateTimePicker: React.FC = ({ onSelect, onDism const handleTabSelect = React.useCallback( (_, key: string | number) => setActiveTab(`${key}` as _TabKey), - [setActiveTab] + [setActiveTab], ); const handleSubmit = React.useCallback(() => { @@ -67,28 +67,28 @@ export const DateTimePicker: React.FC = ({ onSelect, onDism }); setActiveTab('time'); // Switch to time }, - [setDatetime, setActiveTab, dayjs] + [setDatetime, setActiveTab, dayjs], ); const handleHourChange = React.useCallback( (hrIn24h: number) => { setDatetime((old) => dayjs(old).hour(hrIn24h).toDate()); }, - [setDatetime, dayjs] + [setDatetime, dayjs], ); const handleMinuteChange = React.useCallback( (m: number) => { setDatetime((old) => dayjs(old).minute(m).toDate()); }, - [setDatetime, dayjs] + [setDatetime, dayjs], ); const handleSecondChange = React.useCallback( (s: number) => { setDatetime((old) => dayjs(old).second(s).toDate()); }, - [setDatetime, dayjs] + [setDatetime, dayjs], ); const handleMeridiemChange = React.useCallback( @@ -101,7 +101,7 @@ export const DateTimePicker: React.FC = ({ onSelect, onDism return old; }); }, - [setDatetime, dayjs] + [setDatetime, dayjs], ); const selectedDatetimeDisplay = React.useMemo(() => dayjs(datetime).format('L LTS'), [datetime, dayjs]); diff --git a/src/app/DateTimePicker/TimePicker.tsx b/src/app/DateTimePicker/TimePicker.tsx index 2ed8b7013a..95169ba79f 100644 --- a/src/app/DateTimePicker/TimePicker.tsx +++ b/src/app/DateTimePicker/TimePicker.tsx @@ -68,7 +68,7 @@ export const TimePicker: React.FC = ({ const hour = is24h ? rawHour : hourIn24HrFormat(rawHour, meridiemAM); onHourSelect && onHourSelect(hour); }, - [is24h, onHourSelect, meridiemAM] + [is24h, onHourSelect, meridiemAM], ); return ( @@ -162,7 +162,7 @@ const TimeSpinner: React.FC = ({ variant, onChange, selected, (value: number) => { return _.clamp(value, computedMin, computedMax); }, - [computedMax, computedMin] + [computedMax, computedMin], ); const handleValueChange = React.useCallback( @@ -173,7 +173,7 @@ const TimeSpinner: React.FC = ({ variant, onChange, selected, const newVal = _sanitizeValue(Number(value)); onChange && onChange(newVal); }, - [onChange, _sanitizeValue] + [onChange, _sanitizeValue], ); const handleIncrement = React.useCallback(() => { diff --git a/src/app/DateTimePicker/TimezonePicker.tsx b/src/app/DateTimePicker/TimezonePicker.tsx index 90f2d22e5c..45935e435f 100644 --- a/src/app/DateTimePicker/TimezonePicker.tsx +++ b/src/app/DateTimePicker/TimezonePicker.tsx @@ -57,7 +57,7 @@ export const TimezonePicker: React.FC = ({ short: timezone.short, }); }, - [onTimezoneChange, setIsTimezoneOpen] + [onTimezoneChange, setIsTimezoneOpen], ); const timezones = React.useMemo(() => supportedTimezones(), []); @@ -66,7 +66,7 @@ export const TimezonePicker: React.FC = ({ (_e: React.MouseEvent) => { setNumOfOptions((old) => Math.min(old + OPTION_INCREMENT, timezones.length)); }, - [setNumOfOptions, timezones] + [setNumOfOptions, timezones], ); const mapToSelection = React.useCallback( @@ -85,7 +85,7 @@ export const TimezonePicker: React.FC = ({ ); }, - [dayjs] + [dayjs], ); const options = React.useMemo(() => { @@ -101,7 +101,7 @@ export const TimezonePicker: React.FC = ({ , ] - : [] + : [], ); }, [isCompact, timezones, numOfOptions, t, handleViewMore, mapToSelection]); @@ -115,7 +115,7 @@ export const TimezonePicker: React.FC = ({ .filter((op) => matchExp.test(op.full) || matchExp.test(op.short)) .map((t) => mapToSelection(t, isCompact)); }, - [timezones, options, isCompact, mapToSelection] + [timezones, options, isCompact, mapToSelection], ); return ( diff --git a/src/app/Events/EventTemplates.tsx b/src/app/Events/EventTemplates.tsx index 226c10b01c..1ea42a3e72 100644 --- a/src/app/Events/EventTemplates.tsx +++ b/src/app/Events/EventTemplates.tsx @@ -113,7 +113,7 @@ export const EventTemplates: React.FC = (_) => { }, columnIndex, }), - [sortBy, setSortBy] + [sortBy, setSortBy], ); React.useEffect(() => { @@ -126,7 +126,7 @@ export const EventTemplates: React.FC = (_) => { (t: EventTemplate) => t.name.toLowerCase().includes(ft) || t.description.toLowerCase().includes(ft) || - t.provider.toLowerCase().includes(ft) + t.provider.toLowerCase().includes(ft), ); } @@ -137,8 +137,8 @@ export const EventTemplates: React.FC = (_) => { direction: sortBy.direction ?? SortByDirection.asc, }, filtered, - tableColumns - ) + tableColumns, + ), ); }, [filterText, templates, sortBy]); @@ -148,7 +148,7 @@ export const EventTemplates: React.FC = (_) => { setIsLoading(false); setErrorMessage(''); }, - [setTemplates, setIsLoading, setErrorMessage] + [setTemplates, setIsLoading, setErrorMessage], ); const handleError = React.useCallback( @@ -156,7 +156,7 @@ export const EventTemplates: React.FC = (_) => { setIsLoading(false); setErrorMessage(error.message); }, - [setIsLoading, setErrorMessage] + [setIsLoading, setErrorMessage], ); const refreshTemplates = React.useCallback(() => { @@ -168,13 +168,13 @@ export const EventTemplates: React.FC = (_) => { filter((target) => target !== NO_TARGET), first(), concatMap((target) => - context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/templates`) - ) + context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/templates`), + ), ) .subscribe({ next: handleTemplates, error: handleError, - }) + }), ); }, [addSubscription, context.api, context.target, setIsLoading, handleTemplates, handleError]); @@ -183,7 +183,7 @@ export const EventTemplates: React.FC = (_) => { context.target.target().subscribe(() => { setFilterText(''); refreshTemplates(); - }) + }), ); }, [context.target, addSubscription, refreshTemplates]); @@ -191,7 +191,7 @@ export const EventTemplates: React.FC = (_) => { addSubscription( context.notificationChannel .messages(NotificationCategory.TemplateUploaded) - .subscribe((v) => setTemplates((old) => old.concat(v.message.template))) + .subscribe((v) => setTemplates((old) => old.concat(v.message.template))), ); }, [addSubscription, context, context.notificationChannel, setTemplates]); @@ -201,9 +201,9 @@ export const EventTemplates: React.FC = (_) => { .messages(NotificationCategory.TemplateDeleted) .subscribe((v) => setTemplates((old) => - old.filter((o) => o.name != v.message.template.name || o.type != v.message.template.type) - ) - ) + old.filter((o) => o.name != v.message.template.name || o.type != v.message.template.type), + ), + ), ); }, [addSubscription, context, context.notificationChannel, setTemplates]); @@ -213,7 +213,7 @@ export const EventTemplates: React.FC = (_) => { } const id = window.setInterval( () => refreshTemplates(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshTemplates]); @@ -222,7 +222,7 @@ export const EventTemplates: React.FC = (_) => { addSubscription( context.target.authFailure().subscribe(() => { setErrorMessage(authFailMessage); - }) + }), ); }, [addSubscription, context.target, setErrorMessage]); @@ -232,10 +232,10 @@ export const EventTemplates: React.FC = (_) => { context.api .deleteCustomEventTemplate(t.name) .pipe(first()) - .subscribe(() => undefined /* do nothing - notification will handle updating state */) + .subscribe(() => undefined /* do nothing - notification will handle updating state */), ); }, - [addSubscription, context.api] + [addSubscription, context.api], ); const handleDeleteButton = React.useCallback( @@ -247,7 +247,7 @@ export const EventTemplates: React.FC = (_) => { handleDelete(t); } }, - [context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete] + [context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete], ); const actionsResolver = React.useCallback( @@ -284,7 +284,7 @@ export const EventTemplates: React.FC = (_) => { } return actions; }, - [context.api, history, handleDeleteButton] + [context.api, history, handleDeleteButton], ); const handleUploadModalClose = React.useCallback(() => { @@ -316,7 +316,7 @@ export const EventTemplates: React.FC = (_) => { )), - [actionsResolver, filteredTemplates] + [actionsResolver, filteredTemplates], ); const handleWarningModalAccept = React.useCallback(() => { @@ -453,7 +453,7 @@ export const EventTemplatesUploadModal: React.FC .addCustomEventTemplate( fileUpload.file, getProgressUpdateCallback(fileUpload.file.name), - fileUpload.abortSignal + fileUpload.abortSignal, ) .pipe( tap({ @@ -464,8 +464,8 @@ export const EventTemplatesUploadModal: React.FC onSingleFailure(fileUpload.file.name, err); }, }), - catchError((_) => of(false)) - ) + catchError((_) => of(false)), + ), ); }); @@ -475,10 +475,10 @@ export const EventTemplatesUploadModal: React.FC .subscribe((oks) => { setUploading(false); setAllOks(oks.reduce((prev, curr, _) => prev && curr, true)); - }) + }), ); }, - [addSubscription, context.api, setUploading, setAllOks] + [addSubscription, context.api, setUploading, setAllOks], ); const handleSubmit = React.useCallback(() => { @@ -490,7 +490,7 @@ export const EventTemplatesUploadModal: React.FC setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -499,8 +499,8 @@ export const EventTemplatesUploadModal: React.FC spinnerAriaValueText: 'Submitting', spinnerAriaLabel: 'submitting-custom-event-template', isLoading: uploading, - } as LoadingPropsType), - [uploading] + }) as LoadingPropsType, + [uploading], ); return ( diff --git a/src/app/Events/EventTypes.tsx b/src/app/Events/EventTypes.tsx index 23df32719f..8def9e2c21 100644 --- a/src/app/Events/EventTypes.tsx +++ b/src/app/Events/EventTypes.tsx @@ -119,7 +119,7 @@ export const EventTypes: React.FC = (_) => { setIsLoading(false); setErrorMessage(''); }, - [setTypes, setIsLoading, setErrorMessage] + [setTypes, setIsLoading, setErrorMessage], ); const handleError = React.useCallback( @@ -127,7 +127,7 @@ export const EventTypes: React.FC = (_) => { setIsLoading(false); setErrorMessage(error.message); }, - [setIsLoading, setErrorMessage] + [setIsLoading, setErrorMessage], ); const refreshEvents = React.useCallback(() => { @@ -139,13 +139,13 @@ export const EventTypes: React.FC = (_) => { filter((target) => target !== NO_TARGET), first(), concatMap((target) => - context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/events`) - ) + context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/events`), + ), ) .subscribe({ next: handleTypes, error: handleError, - }) + }), ); }, [addSubscription, context.target, context.api, handleTypes, handleError]); @@ -154,7 +154,7 @@ export const EventTypes: React.FC = (_) => { context.target.target().subscribe(() => { setFilterText(''); refreshEvents(); - }) + }), ); }, [addSubscription, context, context.target, refreshEvents]); @@ -175,7 +175,7 @@ export const EventTypes: React.FC = (_) => { direction: sortBy.direction ?? SortByDirection.asc, }, types.filter(withFilters), - tableColumns + tableColumns, ); }, [types, filterText, sortBy]); @@ -204,7 +204,7 @@ export const EventTypes: React.FC = (_) => { (_, currentPage: number) => { setCurrentPage(currentPage); }, - [setCurrentPage] + [setCurrentPage], ); const onPerPage = React.useCallback( @@ -214,7 +214,7 @@ export const EventTypes: React.FC = (_) => { setPerPage(perPage); setCurrentPage(1 + Math.floor(offset / perPage)); }, - [currentPage, prevPerPage, setPerPage, setCurrentPage] + [currentPage, prevPerPage, setPerPage, setCurrentPage], ); const onToggle = React.useCallback( @@ -227,7 +227,7 @@ export const EventTypes: React.FC = (_) => { return [...old, typeId]; }); }, - [setOpenRows] + [setOpenRows], ); const onFilterTextChange = React.useCallback( @@ -235,7 +235,7 @@ export const EventTypes: React.FC = (_) => { setFilterText(filterText); setCurrentPage(1); }, - [setFilterText, setCurrentPage] + [setFilterText, setCurrentPage], ); const authRetry = React.useCallback(() => { diff --git a/src/app/Events/Events.tsx b/src/app/Events/Events.tsx index 28df5cd5b8..e8511a3d78 100644 --- a/src/app/Events/Events.tsx +++ b/src/app/Events/Events.tsx @@ -68,7 +68,7 @@ export const EventTabs: React.FC = () => { const onTabSelect = React.useCallback( (_: React.MouseEvent, key: string | number) => switchTab(history, pathname, search, { tabKey: 'eventTab', tabValue: `${key}` }), - [history, pathname, search] + [history, pathname, search], ); return ( @@ -104,7 +104,7 @@ export const AgentTabs: React.FC = () => { const onTabSelect = React.useCallback( (_: React.MouseEvent, key: string | number) => switchTab(history, pathname, search, { tabKey: 'agentTab', tabValue: `${key}` }), - [history, pathname, search] + [history, pathname, search], ); React.useEffect(() => { @@ -113,9 +113,9 @@ export const AgentTabs: React.FC = () => { .target() .pipe( filter((target) => target !== NO_TARGET), - concatMap((_) => context.api.isProbeEnabled()) + concatMap((_) => context.api.isProbeEnabled()), ) - .subscribe(setAgentDetected) + .subscribe(setAgentDetected), ); }, [addSubscription, context.target, context.api, setAgentDetected]); diff --git a/src/app/Joyride/CryostatJoyride.tsx b/src/app/Joyride/CryostatJoyride.tsx index 2dd285d3ef..afdf48c3a4 100644 --- a/src/app/Joyride/CryostatJoyride.tsx +++ b/src/app/Joyride/CryostatJoyride.tsx @@ -241,7 +241,7 @@ const CryostatJoyride: React.FC = (props) => { } } }, - [setState, isNavBarOpen] + [setState, isNavBarOpen], ); return ( diff --git a/src/app/Joyride/JoyrideProvider.tsx b/src/app/Joyride/JoyrideProvider.tsx index 21c9b92ccd..51deb07b55 100644 --- a/src/app/Joyride/JoyrideProvider.tsx +++ b/src/app/Joyride/JoyrideProvider.tsx @@ -50,7 +50,7 @@ export const JoyrideProvider: React.FC<{ children }> = (props) => { const [isNavBarOpen, setIsNavBarOpen] = React.useState(true); const value = React.useMemo( () => ({ state, setState, isNavBarOpen, setIsNavBarOpen }), - [state, setState, isNavBarOpen, setIsNavBarOpen] + [state, setState, isNavBarOpen, setIsNavBarOpen], ); return ( diff --git a/src/app/Login/BasicAuthForm.tsx b/src/app/Login/BasicAuthForm.tsx index 2d8535e785..8df64dffa2 100644 --- a/src/app/Login/BasicAuthForm.tsx +++ b/src/app/Login/BasicAuthForm.tsx @@ -47,28 +47,28 @@ export const BasicAuthForm: React.FC = ({ onSubmit }) => { (evt) => { setUsername(evt); }, - [setUsername] + [setUsername], ); const handlePasswordChange = React.useCallback( (evt) => { setPassword(evt); }, - [setPassword] + [setPassword], ); const handleRememberMeToggle = React.useCallback( (evt) => { setRememberMe(evt); }, - [setRememberMe] + [setRememberMe], ); const handleSubmit = React.useCallback( (evt) => { onSubmit(evt, `${username}:${password}`, AuthMethod.BASIC, rememberMe); }, - [onSubmit, username, password, rememberMe] + [onSubmit, username, password, rememberMe], ); // FIXME Patternfly Form component onSubmit is not triggered by Enter keydown when the Form contains @@ -79,7 +79,7 @@ export const BasicAuthForm: React.FC = ({ onSubmit }) => { handleSubmit(evt); } }, - [handleSubmit] + [handleSubmit], ); return ( diff --git a/src/app/Login/Login.tsx b/src/app/Login/Login.tsx index e6570aa2b5..cfec2b4fea 100644 --- a/src/app/Login/Login.tsx +++ b/src/app/Login/Login.tsx @@ -52,11 +52,11 @@ export const Login: React.FC = (_) => { if (!authSuccess) { notifications.danger('Authentication Failure', `${authMethod} authentication failed`); } - }) + }), ); evt.preventDefault(); }, - [addSubscription, context.login, notifications, setAuthMethod] + [addSubscription, context.login, notifications, setAuthMethod], ); React.useEffect(() => { diff --git a/src/app/Login/OpenShiftPlaceholderAuthForm.tsx b/src/app/Login/OpenShiftPlaceholderAuthForm.tsx index 6596ac1537..f84441aa42 100644 --- a/src/app/Login/OpenShiftPlaceholderAuthForm.tsx +++ b/src/app/Login/OpenShiftPlaceholderAuthForm.tsx @@ -36,7 +36,7 @@ export const OpenShiftPlaceholderAuthForm: React.FC = ({ onSubmit }) const errors = parts[1]; const missingCryostatPermissions = errors.find((error) => error.title.includes('401')) !== undefined; setShowPermissionDenied(sessionState === SessionState.NO_USER_SESSION && missingCryostatPermissions); - }) + }), ); }, [addSubscription, notifications, context.login, setShowPermissionDenied]); @@ -45,7 +45,7 @@ export const OpenShiftPlaceholderAuthForm: React.FC = ({ onSubmit }) // Triggers a redirect to OpenShift Container Platform login page onSubmit(evt, 'anInvalidToken', AuthMethod.BEARER, true); }, - [onSubmit] + [onSubmit], ); const permissionDenied = ( diff --git a/src/app/Modal/DeleteWarningModal.tsx b/src/app/Modal/DeleteWarningModal.tsx index e35438ba17..4878c9fe60 100644 --- a/src/app/Modal/DeleteWarningModal.tsx +++ b/src/app/Modal/DeleteWarningModal.tsx @@ -48,7 +48,7 @@ export const DeleteWarningModal: React.FC = ({ context.settings.setDeletionDialogsEnabledFor(realWarningType.id, false); } }, - [context.settings, onAccept, onClose, doNotAsk, realWarningType] + [context.settings, onAccept, onClose, doNotAsk, realWarningType], ); const onInnerClose = React.useCallback( @@ -56,7 +56,7 @@ export const DeleteWarningModal: React.FC = ({ ev && ev.stopPropagation(); onClose(); }, - [onClose] + [onClose], ); return ( diff --git a/src/app/Notifications/NotificationCenter.tsx b/src/app/Notifications/NotificationCenter.tsx index 8d2febc347..936a9dd549 100644 --- a/src/app/Notifications/NotificationCenter.tsx +++ b/src/app/Notifications/NotificationCenter.tsx @@ -79,7 +79,7 @@ export const NotificationCenter: React.FC = (props) => return category; }); }); - }) + }), ); }, [addSubscription, context, setDrawerCategories]); @@ -87,7 +87,7 @@ export const NotificationCenter: React.FC = (props) => addSubscription( context.unreadNotifications().subscribe((s) => { setTotalUnreadNotificationsCount(s.length); - }) + }), ); }, [addSubscription, context, context.unreadNotifications, setTotalUnreadNotificationsCount]); @@ -104,7 +104,7 @@ export const NotificationCenter: React.FC = (props) => }); }); }, - [setDrawerCategories] + [setDrawerCategories], ); const handleMarkAllRead = React.useCallback(() => { @@ -119,7 +119,7 @@ export const NotificationCenter: React.FC = (props) => (key?: string) => { context.setRead(key); }, - [context] + [context], ); const timestampToDateTimeString = (timestamp?: number): string => { diff --git a/src/app/Notifications/Notifications.tsx b/src/app/Notifications/Notifications.tsx index 871f9d24ef..f6105d506b 100644 --- a/src/app/Notifications/Notifications.tsx +++ b/src/app/Notifications/Notifications.tsx @@ -39,15 +39,15 @@ export class Notifications { this._drawerState$ .pipe( filter((v) => v), - concatMap(() => this._notifications$.pipe(first())) + concatMap(() => this._notifications$.pipe(first())), ) .subscribe((prev) => this._notifications$.next( prev.map((n) => ({ ...n, hidden: true, - })) - ) + })), + ), ); } @@ -111,9 +111,9 @@ export class Notifications { return this.notifications().pipe( map((a) => a.filter( - (n) => (this.isWsClientActivity(n) || this.isJvmDiscovery(n)) && !Notifications.isProblemNotification(n) - ) - ) + (n) => (this.isWsClientActivity(n) || this.isJvmDiscovery(n)) && !Notifications.isProblemNotification(n), + ), + ), ); } diff --git a/src/app/QuickStarts/QuickStartDrawer.tsx b/src/app/QuickStarts/QuickStartDrawer.tsx index 92cf94dde7..2800d167cc 100644 --- a/src/app/QuickStarts/QuickStartDrawer.tsx +++ b/src/app/QuickStarts/QuickStartDrawer.tsx @@ -54,7 +54,7 @@ export const GlobalQuickStartDrawer: React.FC = ({ if (s == SessionState.NO_USER_SESSION) { setActiveQuickStartID(''); } - }) + }), ); }, [addSubscription, context.login, setActiveQuickStartID]); diff --git a/src/app/QuickStarts/quickstarts/dashboard-quickstart.tsx b/src/app/QuickStarts/quickstarts/dashboard-quickstart.tsx index b4df8a49f4..8c03d25f0f 100644 --- a/src/app/QuickStarts/quickstarts/dashboard-quickstart.tsx +++ b/src/app/QuickStarts/quickstarts/dashboard-quickstart.tsx @@ -164,7 +164,7 @@ You can rename, delete and quickly switch between **Dashboard Layouts** for diff conclusion: conclusion( displayName, 'Dashboard', - `For more information about the new Dashboard and Dashboard Cards in [APP] ${build.version}, read our guides on the Cryostat documentation.` + `For more information about the new Dashboard and Dashboard Cards in [APP] ${build.version}, read our guides on the Cryostat documentation.`, ), type: { text: 'Introduction', diff --git a/src/app/QuickStarts/quickstarts/generic-quickstart.tsx b/src/app/QuickStarts/quickstarts/generic-quickstart.tsx index c414467f7c..4f79b24c30 100644 --- a/src/app/QuickStarts/quickstarts/generic-quickstart.tsx +++ b/src/app/QuickStarts/quickstarts/generic-quickstart.tsx @@ -141,7 +141,7 @@ world conclusion: conclusion( displayName, '[APP]', - `To learn more about [APP]'s extensive features and capabilities, please visit our website at ${build.documentationUrl}.` + `To learn more about [APP]'s extensive features and capabilities, please visit our website at ${build.documentationUrl}.`, ), nextQuickStart: ['start-a-recording-quickstart'], }, diff --git a/src/app/QuickStarts/quickstarts/start-a-recording.tsx b/src/app/QuickStarts/quickstarts/start-a-recording.tsx index bcf6c80f3d..cacd4e4eec 100644 --- a/src/app/QuickStarts/quickstarts/start-a-recording.tsx +++ b/src/app/QuickStarts/quickstarts/start-a-recording.tsx @@ -159,7 +159,7 @@ Archiving a recording will save the recording to [APP]'s archival storage, and w conclusion: conclusion( displayName, 'Start a recording', - `To learn more about [APP]'s extensive features and capabilities, please visit our website at ${build.documentationUrl}.` + `To learn more about [APP]'s extensive features and capabilities, please visit our website at ${build.documentationUrl}.`, ), type: { text: 'Introduction', diff --git a/src/app/RecordingMetadata/BulkEditLabels.tsx b/src/app/RecordingMetadata/BulkEditLabels.tsx index 6f7ee7eba7..20f773f738 100644 --- a/src/app/RecordingMetadata/BulkEditLabels.tsx +++ b/src/app/RecordingMetadata/BulkEditLabels.tsx @@ -55,7 +55,7 @@ export const BulkEditLabels: React.FC = (props) => { const getIdxFromRecording = React.useCallback( (r: Recording): number => (props.isTargetRecording ? (r as ActiveRecording).id : hashCode(r.name)), - [props.isTargetRecording] + [props.isTargetRecording], ); const handlePostUpdate = React.useCallback(() => { @@ -77,7 +77,7 @@ export const BulkEditLabels: React.FC = (props) => { }); if (props.directory) { tasks.push( - context.api.postRecordingMetadataFromPath(props.directory.jvmId, r.name, updatedLabels).pipe(first()) + context.api.postRecordingMetadataFromPath(props.directory.jvmId, r.name, updatedLabels).pipe(first()), ); } if (props.isTargetRecording) { @@ -93,7 +93,7 @@ export const BulkEditLabels: React.FC = (props) => { forkJoin(tasks).subscribe({ next: handlePostUpdate, error: handlePostUpdate, - }) + }), ); }, [ addSubscription, @@ -133,13 +133,13 @@ export const BulkEditLabels: React.FC = (props) => { allRecordingLabels.length > 0 ? allRecordingLabels.reduce( (prev, curr) => prev.filter((label) => includesLabel(curr, label)), - allRecordingLabels[0] + allRecordingLabels[0], ) : []; setLabels(updatedCommonLabels); }, - [recordings, getIdxFromRecording, props.checkedIndices] + [recordings, getIdxFromRecording, props.checkedIndices], ); /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -151,9 +151,9 @@ export const BulkEditLabels: React.FC = (props) => { observable = context.target.target().pipe( filter((target) => target !== NO_TARGET), concatMap((target) => - context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/recordings`) + context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/recordings`), ), - first() + first(), ); } else { observable = props.isUploadsTable @@ -171,11 +171,11 @@ export const BulkEditLabels: React.FC = (props) => { } } }`, - { filter: { sourceTarget: UPLOADS_SUBDIRECTORY } } + { filter: { sourceTarget: UPLOADS_SUBDIRECTORY } }, ) .pipe( map((v) => v.data.archivedRecordings.data as ArchivedRecording[]), - first() + first(), ) : context.target.target().pipe( filter((target) => target !== NO_TARGET), @@ -197,11 +197,11 @@ export const BulkEditLabels: React.FC = (props) => { } } }`, - { connectUrl: target.connectUrl } - ) + { connectUrl: target.connectUrl }, + ), ), map((v) => v.data.targetNodes[0].recordings.archived.data as ArchivedRecording[]), - first() + first(), ); } @@ -223,8 +223,8 @@ export const BulkEditLabels: React.FC = (props) => { spinnerAriaValueText: 'Saving', spinnerAriaLabel: 'saving-recording-labels', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); React.useEffect(() => { @@ -246,10 +246,10 @@ export const BulkEditLabels: React.FC = (props) => { } setRecordings((old) => old.map((o) => - o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o - ) + o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o, + ), ); - }) + }), ); }, [addSubscription, context.target, context.notificationChannel, setRecordings, props.isUploadsTable]); diff --git a/src/app/RecordingMetadata/LabelCell.tsx b/src/app/RecordingMetadata/LabelCell.tsx index cb13f6f100..7d1383548b 100644 --- a/src/app/RecordingMetadata/LabelCell.tsx +++ b/src/app/RecordingMetadata/LabelCell.tsx @@ -40,12 +40,12 @@ export const LabelCell: React.FC = (props) => { } return false; }, - [props.clickableOptions] + [props.clickableOptions], ); const getLabelColor = React.useCallback( (label: RecordingLabel) => (isLabelSelected(label) ? 'blue' : 'grey'), - [isLabelSelected] + [isLabelSelected], ); const onLabelSelectToggle = React.useCallback( (clickedLabel: RecordingLabel) => { @@ -57,7 +57,7 @@ export const LabelCell: React.FC = (props) => { }); } }, - [isLabelSelected, props.clickableOptions, props.target] + [isLabelSelected, props.clickableOptions, props.target], ); return ( @@ -75,7 +75,7 @@ export const LabelCell: React.FC = (props) => { - ) + ), ) ) : ( - diff --git a/src/app/RecordingMetadata/RecordingLabel.tsx b/src/app/RecordingMetadata/RecordingLabel.tsx index eae0a2deae..e3f59b754f 100644 --- a/src/app/RecordingMetadata/RecordingLabel.tsx +++ b/src/app/RecordingMetadata/RecordingLabel.tsx @@ -47,7 +47,7 @@ export const parseLabelsFromFile = (file: File): Observable => return labels; } throw new Error('No labels found in file'); - }) + }), ); }; diff --git a/src/app/RecordingMetadata/RecordingLabelFields.tsx b/src/app/RecordingMetadata/RecordingLabelFields.tsx index 33a262a575..9d3b2e0f47 100644 --- a/src/app/RecordingMetadata/RecordingLabelFields.tsx +++ b/src/app/RecordingMetadata/RecordingLabelFields.tsx @@ -68,7 +68,7 @@ export const RecordingLabelFields: React.FC = ({ setL updatedLabels[idx].key = key; setLabels(updatedLabels); }, - [props.labels, setLabels] + [props.labels, setLabels], ); const handleValueChange = React.useCallback( @@ -77,7 +77,7 @@ export const RecordingLabelFields: React.FC = ({ setL updatedLabels[idx].value = value; setLabels(updatedLabels); }, - [props.labels, setLabels] + [props.labels, setLabels], ); const handleAddLabelButtonClick = React.useCallback(() => { @@ -90,7 +90,7 @@ export const RecordingLabelFields: React.FC = ({ setL updated.splice(idx, 1); setLabels(updated); }, - [props.labels, setLabels] + [props.labels, setLabels], ); const isLabelValid = React.useCallback(matchesLabelSyntax, [matchesLabelSyntax]); @@ -105,7 +105,7 @@ export const RecordingLabelFields: React.FC = ({ setL } return props.labels.reduce( (prev, curr) => isLabelValid(curr) && !isDuplicateKey(curr.key, props.labels) && prev, - true + true, ); }, [props.labels, isLabelValid, isDuplicateKey]); @@ -145,8 +145,8 @@ export const RecordingLabelFields: React.FC = ({ setL catchError((_) => { setInvalidUploads((old) => old.concat([labelFile.name])); return of([]); - }) - ) + }), + ), ); } addSubscription( @@ -154,11 +154,11 @@ export const RecordingLabelFields: React.FC = ({ setL setLoading(false); const labels = labelArrays.reduce((acc, next) => acc.concat(next), []); setLabels([...props.labels, ...labels]); - }) + }), ); } }, - [setLabels, props.labels, addSubscription, setLoading] + [setLabels, props.labels, addSubscription, setLoading], ); const closeWarningPopover = React.useCallback(() => setInvalidUploads([]), [setInvalidUploads]); diff --git a/src/app/Recordings/ActiveRecordingsTable.tsx b/src/app/Recordings/ActiveRecordingsTable.tsx index ac3a4ead5c..11089bb56d 100644 --- a/src/app/Recordings/ActiveRecordingsTable.tsx +++ b/src/app/Recordings/ActiveRecordingsTable.tsx @@ -142,7 +142,7 @@ export const ActiveRecordingsTable: React.FC = (prop const targetRecordingFilters = useSelector((state: RootState) => { const filters = state.recordingFilters.list.filter( - (targetFilter: TargetRecordingFilters) => targetFilter.target === targetConnectURL + (targetFilter: TargetRecordingFilters) => targetFilter.target === targetConnectURL, ); return filters.length > 0 ? filters[0].active.filters : emptyActiveRecordingFilters; }) as RecordingFiltersCategories; @@ -156,7 +156,7 @@ export const ActiveRecordingsTable: React.FC = (prop setCheckedIndices((ci) => ci.filter((v) => v !== index)); } }, - [setCheckedIndices, setHeaderChecked] + [setCheckedIndices, setHeaderChecked], ); const handleHeaderCheck = React.useCallback( @@ -164,7 +164,7 @@ export const ActiveRecordingsTable: React.FC = (prop setHeaderChecked(checked); setCheckedIndices(checked ? filteredRecordings.map((r) => r.id) : []); }, - [setHeaderChecked, setCheckedIndices, filteredRecordings] + [setHeaderChecked, setCheckedIndices, filteredRecordings], ); const handleCreateRecording = React.useCallback(() => { @@ -182,7 +182,7 @@ export const ActiveRecordingsTable: React.FC = (prop setIsLoading(false); setErrorMessage(''); }, - [setRecordings, setIsLoading, setErrorMessage] + [setRecordings, setIsLoading, setErrorMessage], ); const handleError = React.useCallback( @@ -191,7 +191,7 @@ export const ActiveRecordingsTable: React.FC = (prop setErrorMessage(error.message); setRecordings([]); }, - [setIsLoading, setErrorMessage, setRecordings] + [setIsLoading, setErrorMessage, setRecordings], ); const refreshRecordingList = React.useCallback(() => { @@ -202,14 +202,14 @@ export const ActiveRecordingsTable: React.FC = (prop .pipe( filter((target) => target !== NO_TARGET), concatMap((target) => - context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/recordings`) + context.api.doGet(`targets/${encodeURIComponent(target.connectUrl)}/recordings`), ), - first() + first(), ) .subscribe({ next: handleRecordings, error: handleError, - }) + }), ); }, [addSubscription, context.target, context.api, setIsLoading, handleRecordings, handleError]); @@ -219,7 +219,7 @@ export const ActiveRecordingsTable: React.FC = (prop setTargetConnectURL(target.connectUrl); dispatch(recordingAddTargetIntent(target.connectUrl)); refreshRecordingList(); - }) + }), ); }, [addSubscription, context, context.target, refreshRecordingList, setTargetConnectURL, dispatch]); @@ -229,14 +229,14 @@ export const ActiveRecordingsTable: React.FC = (prop context.target.target(), merge( context.notificationChannel.messages(NotificationCategory.ActiveRecordingCreated), - context.notificationChannel.messages(NotificationCategory.SnapshotCreated) + context.notificationChannel.messages(NotificationCategory.SnapshotCreated), ), ]).subscribe(([currentTarget, event]) => { if (currentTarget.connectUrl != event.message.target) { return; } setRecordings((old) => old.concat([event.message.recording])); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRecordings]); @@ -246,7 +246,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.target.target(), merge( context.notificationChannel.messages(NotificationCategory.ActiveRecordingDeleted), - context.notificationChannel.messages(NotificationCategory.SnapshotDeleted) + context.notificationChannel.messages(NotificationCategory.SnapshotDeleted), ), ]).subscribe(([currentTarget, event]) => { if (currentTarget.connectUrl != event.message.target) { @@ -255,7 +255,7 @@ export const ActiveRecordingsTable: React.FC = (prop setRecordings((old) => old.filter((r) => r.name !== event.message.recording.name)); setCheckedIndices((old) => old.filter((idx) => idx !== event.message.recording.id)); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRecordings, setCheckedIndices]); @@ -277,7 +277,7 @@ export const ActiveRecordingsTable: React.FC = (prop } return updated; }); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRecordings]); @@ -286,7 +286,7 @@ export const ActiveRecordingsTable: React.FC = (prop context.target.authFailure().subscribe(() => { setErrorMessage(authFailMessage); setRecordings([]); - }) + }), ); }, [context, context.target, setErrorMessage, addSubscription, setRecordings]); @@ -301,10 +301,10 @@ export const ActiveRecordingsTable: React.FC = (prop } setRecordings((old) => old.map((o) => - o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o - ) + o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o, + ), ); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRecordings]); @@ -316,8 +316,8 @@ export const ActiveRecordingsTable: React.FC = (prop direction: sortBy.direction ?? SortByDirection.asc, }, filterRecordings(recordings, targetRecordingFilters), - tableColumns - ) + tableColumns, + ), ); }, [sortBy, recordings, targetRecordingFilters, setFilteredRecordings]); @@ -338,7 +338,7 @@ export const ActiveRecordingsTable: React.FC = (prop } const id = window.setInterval( () => refreshRecordingList(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [refreshRecordingList, context, context.settings]); @@ -351,7 +351,7 @@ export const ActiveRecordingsTable: React.FC = (prop return newActionLoadings; }); }, - [setActionLoadings] + [setActionLoadings], ); const handleArchiveRecordings = React.useCallback(() => { @@ -367,7 +367,7 @@ export const ActiveRecordingsTable: React.FC = (prop forkJoin(tasks).subscribe({ next: () => handlePostActions('ARCHIVE'), error: () => handlePostActions('ARCHIVE'), - }) + }), ); }, [ filteredRecordings, @@ -394,7 +394,7 @@ export const ActiveRecordingsTable: React.FC = (prop forkJoin(tasks).subscribe({ next: () => handlePostActions('STOP'), error: () => handlePostActions('STOP'), - }) + }), ); }, [ filteredRecordings, @@ -419,7 +419,7 @@ export const ActiveRecordingsTable: React.FC = (prop forkJoin(tasks).subscribe({ next: () => handlePostActions('DELETE'), error: () => handlePostActions('DELETE'), - }) + }), ); }, [ filteredRecordings, @@ -447,7 +447,7 @@ export const ActiveRecordingsTable: React.FC = (prop dispatch(recordingAddFilterIntent(target, filterKey, filterValue, false)); } }, - [dispatch] + [dispatch], ); const toggleExpanded = React.useCallback( @@ -459,7 +459,7 @@ export const ActiveRecordingsTable: React.FC = (prop : [...expandedRows, id]; }); }, - [setExpandedRows] + [setExpandedRows], ); const RecordingsToolbar = React.useMemo( @@ -498,7 +498,7 @@ export const ActiveRecordingsTable: React.FC = (prop handleDeleteRecordings, actionLoadings, props.toolbarBreakReference, - ] + ], ); const LabelsPanel = React.useMemo( @@ -509,7 +509,7 @@ export const ActiveRecordingsTable: React.FC = (prop checkedIndices={checkedIndices} /> ), - [checkedIndices, setShowDetailsPanel] + [checkedIndices, setShowDetailsPanel], ); const columnConfig: ColumnConfig = React.useMemo( @@ -517,7 +517,7 @@ export const ActiveRecordingsTable: React.FC = (prop columns: tableColumns, onSort: getSortParams, }), - [getSortParams] + [getSortParams], ); return ( @@ -627,7 +627,7 @@ const ActiveRecordingsToolbar: React.FC = (props) isLoading: props.actionLoadings['DELETE'], }, }), - [props.actionLoadings] + [props.actionLoadings], ); const buttons = React.useMemo(() => { @@ -836,7 +836,7 @@ export const ActiveRecordingRow: React.FC = ({ const expandedRowId = React.useMemo( () => `active-table-row-${recording.name}-${recording.startTime}-exp`, - [recording] + [recording], ); const handleToggle = React.useCallback(() => toggleExpanded(expandedRowId), [expandedRowId, toggleExpanded]); @@ -849,14 +849,14 @@ export const ActiveRecordingRow: React.FC = ({ (checked: boolean) => { handleRowCheck(checked, index); }, - [index, handleRowCheck] + [index, handleRowCheck], ); const parentRow = React.useMemo(() => { const RecordingDuration = (props: { duration: number }) => { const str = React.useMemo( () => (props.duration === 0 ? 'Continuous' : `${props.duration / 1000}s`), - [props.duration] + [props.duration], ); return {str}; }; diff --git a/src/app/Recordings/ArchivedRecordingsTable.tsx b/src/app/Recordings/ArchivedRecordingsTable.tsx index c59af404cb..f666be980b 100644 --- a/src/app/Recordings/ArchivedRecordingsTable.tsx +++ b/src/app/Recordings/ArchivedRecordingsTable.tsx @@ -125,7 +125,7 @@ export const ArchivedRecordingsTable: React.FC = ( const targetRecordingFilters = useSelector((state: RootState) => { const filters = state.recordingFilters.list.filter( - (targetFilter: TargetRecordingFilters) => targetFilter.target === targetConnectURL + (targetFilter: TargetRecordingFilters) => targetFilter.target === targetConnectURL, ); return filters.length > 0 ? filters[0].archived.filters : emptyArchivedRecordingFilters; }) as RecordingFiltersCategories; @@ -135,7 +135,7 @@ export const ArchivedRecordingsTable: React.FC = ( setHeaderChecked(checked); setCheckedIndices(checked ? filteredRecordings.map((r) => hashCode(r.name)) : []); }, - [setHeaderChecked, setCheckedIndices, filteredRecordings] + [setHeaderChecked, setCheckedIndices, filteredRecordings], ); const handleRowCheck = React.useCallback( @@ -147,7 +147,7 @@ export const ArchivedRecordingsTable: React.FC = ( setCheckedIndices((ci) => ci.filter((v) => v !== index)); } }, - [setCheckedIndices, setHeaderChecked] + [setCheckedIndices, setHeaderChecked], ); const handleEditLabels = React.useCallback(() => { @@ -159,7 +159,7 @@ export const ArchivedRecordingsTable: React.FC = ( setRecordings(recordings); setIsLoading(false); }, - [setRecordings, setIsLoading] + [setRecordings, setIsLoading], ); const handleError = React.useCallback( @@ -168,7 +168,7 @@ export const ArchivedRecordingsTable: React.FC = ( setErrorMessage(error.message); setRecordings([]); }, - [setIsLoading, setErrorMessage, setRecordings] + [setIsLoading, setErrorMessage, setRecordings], ); const queryTargetRecordings = React.useCallback( @@ -189,10 +189,10 @@ export const ArchivedRecordingsTable: React.FC = ( } } }`, - { connectUrl } + { connectUrl }, ); }, - [context.api] + [context.api], ); const queryUploadedRecordings = React.useCallback(() => { @@ -211,7 +211,7 @@ export const ArchivedRecordingsTable: React.FC = ( } } }`, - { filter: { sourceTarget: UPLOADS_SUBDIRECTORY } } + { filter: { sourceTarget: UPLOADS_SUBDIRECTORY } }, ); }, [context.api]); @@ -226,7 +226,7 @@ export const ArchivedRecordingsTable: React.FC = ( .subscribe({ next: handleRecordings, error: handleError, - }) + }), ); } else { addSubscription( @@ -235,12 +235,12 @@ export const ArchivedRecordingsTable: React.FC = ( filter((target) => target !== NO_TARGET), first(), concatMap((target) => queryTargetRecordings(target.connectUrl)), - map((v) => v.data.archivedRecordings.data as ArchivedRecording[]) + map((v) => v.data.archivedRecordings.data as ArchivedRecording[]), ) .subscribe({ next: handleRecordings, error: handleError, - }) + }), ); } }, [ @@ -272,7 +272,7 @@ export const ArchivedRecordingsTable: React.FC = ( dispatch(recordingAddFilterIntent(target, filterKey, filterValue, true)); } }, - [dispatch] + [dispatch], ); React.useEffect(() => { @@ -281,7 +281,7 @@ export const ArchivedRecordingsTable: React.FC = ( setTargetConnectURL(target.connectUrl); dispatch(recordingAddTargetIntent(target.connectUrl)); refreshRecordingList(); - }) + }), ); }, [addSubscription, refreshRecordingList, dispatch, setTargetConnectURL, propsTarget]); @@ -291,16 +291,16 @@ export const ArchivedRecordingsTable: React.FC = ( propsTarget, merge( context.notificationChannel.messages(NotificationCategory.ArchivedRecordingCreated), - context.notificationChannel.messages(NotificationCategory.ActiveRecordingSaved) + context.notificationChannel.messages(NotificationCategory.ActiveRecordingSaved), ), ]).subscribe(([currentTarget, event]) => { if (currentTarget.connectUrl != event.message.target) { return; } setRecordings((old) => - old.filter((r) => r.name !== event.message.recording.name).concat(event.message.recording) + old.filter((r) => r.name !== event.message.recording.name).concat(event.message.recording), ); - }) + }), ); }, [addSubscription, context.notificationChannel, setRecordings, propsTarget]); @@ -315,7 +315,7 @@ export const ArchivedRecordingsTable: React.FC = ( } setRecordings((old) => old.filter((r) => r.name !== event.message.recording.name)); setCheckedIndices((old) => old.filter((idx) => idx !== hashCode(event.message.recording.name))); - }) + }), ); }, [addSubscription, context.notificationChannel, setRecordings, setCheckedIndices, propsTarget]); @@ -330,10 +330,10 @@ export const ArchivedRecordingsTable: React.FC = ( } setRecordings((old) => old.map((o) => - o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o - ) + o.name == event.message.recordingName ? { ...o, metadata: { labels: event.message.metadata.labels } } : o, + ), ); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRecordings, propsTarget]); @@ -345,8 +345,8 @@ export const ArchivedRecordingsTable: React.FC = ( direction: sortBy.direction ?? SortByDirection.asc, }, filterRecordings(recordings, targetRecordingFilters), - tableColumns - ) + tableColumns, + ), ); }, [sortBy, recordings, targetRecordingFilters, setFilteredRecordings]); @@ -356,7 +356,7 @@ export const ArchivedRecordingsTable: React.FC = ( } const id = window.setInterval( () => refreshRecordingList(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context, context.settings, refreshRecordingList]); @@ -380,7 +380,7 @@ export const ArchivedRecordingsTable: React.FC = ( return newActionLoadings; }); }, - [setActionLoadings] + [setActionLoadings], ); const handleDeleteRecordings = React.useCallback(() => { @@ -408,9 +408,9 @@ export const ArchivedRecordingsTable: React.FC = ( forkJoin(tasks).subscribe({ next: () => handlePostActions('DELETE'), error: () => handlePostActions('DELETE'), - }) + }), ); - }) + }), ); } }, [ @@ -434,7 +434,7 @@ export const ArchivedRecordingsTable: React.FC = ( : [...expandedRows, id]; }); }, - [setExpandedRows] + [setExpandedRows], ); const RecordingsToolbar = React.useMemo( @@ -469,7 +469,7 @@ export const ArchivedRecordingsTable: React.FC = ( isUploadsTable, actionLoadings, toolbarBreakReference, - ] + ], ); const handleUploadModalClose = React.useCallback(() => { @@ -487,7 +487,7 @@ export const ArchivedRecordingsTable: React.FC = ( directoryRecordings={directoryRecordings} /> ), - [checkedIndices, setShowDetailsPanel, isUploadsTable, propsDirectory, directoryRecordings] + [checkedIndices, setShowDetailsPanel, isUploadsTable, propsDirectory, directoryRecordings], ); const totalArchiveSize = React.useMemo(() => { @@ -501,7 +501,7 @@ export const ArchivedRecordingsTable: React.FC = ( columns: tableColumns, onSort: getSortParams, }), - [getSortParams] + [getSortParams], ); return ( @@ -615,7 +615,7 @@ const ArchivedRecordingsToolbar: React.FC = (pro isLoading: props.actionLoadings['DELETE'], } as LoadingPropsType, }), - [props] + [props], ); const buttons = React.useMemo(() => { @@ -769,7 +769,7 @@ export const ArchivedRecordingRow: React.FC = ({ (checked: boolean) => { handleRowCheck(checked, index); }, - [index, handleRowCheck] + [index, handleRowCheck], ); const parentRow = React.useMemo(() => { diff --git a/src/app/Recordings/Filters/DatetimeFilter.tsx b/src/app/Recordings/Filters/DatetimeFilter.tsx index 78a6367cd2..4065e910d0 100644 --- a/src/app/Recordings/Filters/DatetimeFilter.tsx +++ b/src/app/Recordings/Filters/DatetimeFilter.tsx @@ -77,7 +77,7 @@ export const DateTimeFilter: React.FC = ({ onSubmit }) => { }); onPopoverDismiss(); }, - [setDatetimeInput, onPopoverDismiss, dayjs] + [setDatetimeInput, onPopoverDismiss, dayjs], ); const handleTextInput = React.useCallback( @@ -102,7 +102,7 @@ export const DateTimeFilter: React.FC = ({ onSubmit }) => { } }); }, - [setDatetimeInput, dayjs] + [setDatetimeInput, dayjs], ); return ( diff --git a/src/app/Recordings/Filters/DurationFilter.tsx b/src/app/Recordings/Filters/DurationFilter.tsx index 2e4a4acd8d..dbbc1abf8d 100644 --- a/src/app/Recordings/Filters/DurationFilter.tsx +++ b/src/app/Recordings/Filters/DurationFilter.tsx @@ -35,7 +35,7 @@ export const DurationFilter: React.FC = ({ (checked) => { onContinuousDurationSelect(checked); }, - [onContinuousDurationSelect] + [onContinuousDurationSelect], ); const handleEnterKey = React.useCallback( @@ -45,7 +45,7 @@ export const DurationFilter: React.FC = ({ } onDurationInput(duration); }, - [onDurationInput, duration] + [onDurationInput, duration], ); return ( diff --git a/src/app/Recordings/Filters/LabelFilter.tsx b/src/app/Recordings/Filters/LabelFilter.tsx index 470f05d282..10612a1af0 100644 --- a/src/app/Recordings/Filters/LabelFilter.tsx +++ b/src/app/Recordings/Filters/LabelFilter.tsx @@ -37,7 +37,7 @@ export const LabelFilter: React.FC = ({ recordings, filteredLa onSubmit(selection); } }, - [onSubmit, setIsExpanded] + [onSubmit, setIsExpanded], ); const labels = React.useMemo(() => { diff --git a/src/app/Recordings/Filters/NameFilter.tsx b/src/app/Recordings/Filters/NameFilter.tsx index eb2c42a560..432d9593b5 100644 --- a/src/app/Recordings/Filters/NameFilter.tsx +++ b/src/app/Recordings/Filters/NameFilter.tsx @@ -34,7 +34,7 @@ export const NameFilter: React.FC = ({ recordings, filteredName onSubmit(selection); } }, - [onSubmit, setIsExpanded] + [onSubmit, setIsExpanded], ); const nameOptions = React.useMemo(() => { diff --git a/src/app/Recordings/Filters/RecordingStateFilter.tsx b/src/app/Recordings/Filters/RecordingStateFilter.tsx index 4466064ddb..51c7d130ce 100644 --- a/src/app/Recordings/Filters/RecordingStateFilter.tsx +++ b/src/app/Recordings/Filters/RecordingStateFilter.tsx @@ -31,7 +31,7 @@ export const RecordingStateFilter: React.FC = ({ filt setIsOpen(false); onSelectToggle(selection); }, - [setIsOpen, onSelectToggle] + [setIsOpen, onSelectToggle], ); return ( diff --git a/src/app/Recordings/RecordingActions.tsx b/src/app/Recordings/RecordingActions.tsx index 42812960ad..f9c6d4cc4a 100644 --- a/src/app/Recordings/RecordingActions.tsx +++ b/src/app/Recordings/RecordingActions.tsx @@ -50,7 +50,7 @@ export const RecordingActions: React.FC = (props) => { context.api .grafanaDatasourceUrl() .pipe(first()) - .subscribe(() => setGrafanaEnabled(true)) + .subscribe(() => setGrafanaEnabled(true)), ); }, [context.api, setGrafanaEnabled, addSubscription]); @@ -68,7 +68,7 @@ export const RecordingActions: React.FC = (props) => { .pipe(first()) .subscribe((url) => window.open(url, '_blank')); } - }) + }), ); }, [addSubscription, notifications, props, context.api]); @@ -108,7 +108,7 @@ export const RecordingActions: React.FC = (props) => { setIsOpen(false); action.onClick(); }, - [setIsOpen] + [setIsOpen], ); return ( diff --git a/src/app/Recordings/RecordingFilters.tsx b/src/app/Recordings/RecordingFilters.tsx index 3d08d3eef1..db2f49654f 100644 --- a/src/app/Recordings/RecordingFilters.tsx +++ b/src/app/Recordings/RecordingFilters.tsx @@ -99,7 +99,7 @@ export const RecordingFilters: React.FC = ({ setIsCategoryDropdownOpen(false); dispatch(recordingUpdateCategoryIntent(target, category, isArchived)); }, - [dispatch, setIsCategoryDropdownOpen, target, isArchived] + [dispatch, setIsCategoryDropdownOpen, target, isArchived], ); const onDelete = React.useCallback( @@ -107,7 +107,7 @@ export const RecordingFilters: React.FC = ({ const value = typeof chip === 'string' ? chip : chip.key; updateFilters(target, { filterKey: category, filterValue: value, deleted: true }); }, - [updateFilters, target] + [updateFilters, target], ); const onDeleteGroup = React.useCallback( @@ -115,32 +115,32 @@ export const RecordingFilters: React.FC = ({ const category = typeof chip === 'string' ? chip : chip.key; updateFilters(target, { filterKey: category, deleted: true, deleteOptions: { all: true } }); }, - [updateFilters, target] + [updateFilters, target], ); const onNameInput = React.useCallback( (inputName) => updateFilters(target, { filterKey: currentCategory, filterValue: inputName }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onLabelInput = React.useCallback( (inputLabel) => updateFilters(target, { filterKey: currentCategory, filterValue: inputLabel }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onStartedBeforeInput = React.useCallback( (searchDate) => updateFilters(target, { filterKey: currentCategory, filterValue: searchDate }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onStartedAfterInput = React.useCallback( (searchDate) => updateFilters(target, { filterKey: currentCategory, filterValue: searchDate }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onDurationInput = React.useCallback( (duration) => updateFilters(target, { filterKey: currentCategory, filterValue: `${duration.toString()} s` }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const onRecordingStateSelectToggle = React.useCallback( @@ -148,12 +148,12 @@ export const RecordingFilters: React.FC = ({ const deleted = filters.State && filters.State.includes(searchState); updateFilters(target, { filterKey: currentCategory, filterValue: searchState, deleted: deleted }); }, - [updateFilters, currentCategory, target, filters.State] + [updateFilters, currentCategory, target, filters.State], ); const onContinuousDurationSelect = React.useCallback( (cont) => updateFilters(target, { filterKey: currentCategory, filterValue: 'continuous', deleted: !cont }), - [updateFilters, currentCategory, target] + [updateFilters, currentCategory, target], ); const categoryDropdown = React.useMemo(() => { @@ -212,7 +212,7 @@ export const RecordingFilters: React.FC = ({ onStartedBeforeInput, onContinuousDurationSelect, onDurationInput, - ] + ], ); return ( @@ -295,7 +295,7 @@ export const filterRecordings = (recordings: any[], filters: RecordingFiltersCat } if (filters.Label.length) { filtered = filtered.filter( - (r) => Object.entries(r.metadata.labels).filter(([k, v]) => filters.Label.includes(`${k}:${v}`)).length + (r) => Object.entries(r.metadata.labels).filter(([k, v]) => filters.Label.includes(`${k}:${v}`)).length, ); } diff --git a/src/app/Recordings/Recordings.tsx b/src/app/Recordings/Recordings.tsx index 6040ce5dd3..72dcd4ab77 100644 --- a/src/app/Recordings/Recordings.tsx +++ b/src/app/Recordings/Recordings.tsx @@ -49,7 +49,7 @@ export const Recordings: React.FC = ({ ...props }) => { const onTabSelect = React.useCallback( (_: React.MouseEvent, key: string | number) => switchTab(history, pathname, search, { tabKey: 'tab', tabValue: `${key}` }), - [history, pathname, search] + [history, pathname, search], ); const targetAsObs = React.useMemo(() => context.target.target(), [context.target]); diff --git a/src/app/Recordings/ReportFrame.tsx b/src/app/Recordings/ReportFrame.tsx index 3a084e2331..3614a2e803 100644 --- a/src/app/Recordings/ReportFrame.tsx +++ b/src/app/Recordings/ReportFrame.tsx @@ -52,7 +52,7 @@ export const ReportFrame: React.FC = (props) => { setReport(JSON.stringify(err)); } }, - }) + }), ); }, [addSubscription, context.reports, recording, isExpanded, setReport, props]); diff --git a/src/app/Rules/CreateRule.tsx b/src/app/Rules/CreateRule.tsx index dfd4972aa8..7ed1fe2f0e 100644 --- a/src/app/Rules/CreateRule.tsx +++ b/src/app/Rules/CreateRule.tsx @@ -99,7 +99,7 @@ const CreateRuleForm: React.FC = ({ ...props }) => { setNameValid(RuleNamePattern.test(name) ? ValidatedOptions.success : ValidatedOptions.error); setName(name); }, - [setNameValid, setName] + [setNameValid, setName], ); const eventSpecifierString = React.useMemo(() => { @@ -121,46 +121,46 @@ const CreateRuleForm: React.FC = ({ ...props }) => { type: templateType, }); }, - [setTemplate] + [setTemplate], ); const handleMaxAgeChange = React.useCallback((maxAge) => setMaxAge(Number(maxAge)), [setMaxAge]); const handleMaxAgeUnitChange = React.useCallback( (maxAgeUnit) => setMaxAgeUnits(Number(maxAgeUnit)), - [setMaxAgeUnits] + [setMaxAgeUnits], ); const handleMaxSizeChange = React.useCallback((maxSize) => setMaxSize(Number(maxSize)), [setMaxSize]); const handleMaxSizeUnitChange = React.useCallback( (maxSizeUnit) => setMaxSizeUnits(Number(maxSizeUnit)), - [setMaxSizeUnits] + [setMaxSizeUnits], ); const handleArchivalPeriodChange = React.useCallback( (archivalPeriod) => setArchivalPeriod(Number(archivalPeriod)), - [setArchivalPeriod] + [setArchivalPeriod], ); const handleArchivalPeriodUnitsChange = React.useCallback( (evt) => setArchivalPeriodUnits(Number(evt)), - [setArchivalPeriodUnits] + [setArchivalPeriodUnits], ); const handleInitialDelayChange = React.useCallback( (initialDelay) => setInitialDelay(Number(initialDelay)), - [setInitialDelay] + [setInitialDelay], ); const handleInitialDelayUnitsChanged = React.useCallback( (initialDelayUnit) => setInitialDelayUnits(Number(initialDelayUnit)), - [setInitialDelayUnits] + [setInitialDelayUnits], ); const handlePreservedArchivesChange = React.useCallback( (preservedArchives) => setPreservedArchives(Number(preservedArchives)), - [setPreservedArchives] + [setPreservedArchives], ); const handleSubmit = React.useCallback((): void => { @@ -192,7 +192,7 @@ const CreateRuleForm: React.FC = ({ ...props }) => { if (success) { history.push('/rules'); } - }) + }), ); }, [ setLoading, @@ -234,23 +234,23 @@ const CreateRuleForm: React.FC = ({ ...props }) => { 'v1', undefined, true, - true + true, ) .pipe( - catchError((_) => of([])) // Fail silently - ) - ) + catchError((_) => of([])), // Fail silently + ), + ), ).pipe( map((allTemplates) => { const allFiltered = allTemplates.filter((ts) => ts.length); return allFiltered.length ? allFiltered.reduce((acc, curr) => _.intersectionWith(acc, curr, _.isEqual)) : []; - }) + }), ), - of([]) - ) - ) + of([]), + ), + ), ) .subscribe((templates) => { setTemplates(templates); @@ -258,7 +258,7 @@ const CreateRuleForm: React.FC = ({ ...props }) => { const matched = templates.find((t) => t.name === old.name && t.type === old.type); return matched ? { name: matched.name, type: matched.type } : {}; }); - }) + }), ); }, [addSubscription, context.api]); @@ -279,10 +279,10 @@ const CreateRuleForm: React.FC = ({ ...props }) => { input ? context.api.matchTargetsWithExpr(input, targets).pipe( map((ts) => [ts, undefined]), - catchError((err) => of([[], err])) + catchError((err) => of([[], err])), ) - : of([undefined, undefined]) - ) + : of([undefined, undefined]), + ), ) .subscribe(([ts, err]) => { setEvaluating(false); @@ -293,10 +293,10 @@ const CreateRuleForm: React.FC = ({ ...props }) => { ? ValidatedOptions.default : ts.length ? ValidatedOptions.success - : ValidatedOptions.warning + : ValidatedOptions.warning, ); matchedTargets.next(ts || []); - }) + }), ); }, [ matchExprService, @@ -314,8 +314,8 @@ const CreateRuleForm: React.FC = ({ ...props }) => { spinnerAriaValueText: 'Creating', spinnerAriaLabel: 'creating-automated-rule', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); const selectedSpecifier = React.useMemo(() => { @@ -643,7 +643,7 @@ const Comp: React.FC = () => { path: '/rules', }, ], - [] + [], ); const gridStyles: React.CSSProperties = React.useMemo( @@ -651,7 +651,7 @@ const Comp: React.FC = () => { // viewportHeight - masterheadHeight - pageSectionPadding - breadcrumbHeight height: 'calc(100vh - 4.375rem - 48px - 1.5rem)', }), - [] + [], ); return ( diff --git a/src/app/Rules/Rules.tsx b/src/app/Rules/Rules.tsx index f426fa8bc7..4acd36d83a 100644 --- a/src/app/Rules/Rules.tsx +++ b/src/app/Rules/Rules.tsx @@ -180,7 +180,7 @@ export const Rules: React.FC = (_) => { }, columnIndex, }), - [sortBy, setSortBy] + [sortBy, setSortBy], ); const refreshRules = React.useCallback(() => { @@ -189,7 +189,7 @@ export const Rules: React.FC = (_) => { context.api.getRules().subscribe((rules) => { setRules(rules); setIsLoading(false); - }) + }), ); }, [setIsLoading, addSubscription, context.api, setRules]); @@ -201,7 +201,7 @@ export const Rules: React.FC = (_) => { addSubscription( context.notificationChannel .messages(NotificationCategory.RuleCreated) - .subscribe((v) => setRules((old) => old.concat(v.message))) + .subscribe((v) => setRules((old) => old.concat(v.message))), ); }, [addSubscription, context, context.notificationChannel, setRules]); @@ -209,7 +209,7 @@ export const Rules: React.FC = (_) => { addSubscription( context.notificationChannel .messages(NotificationCategory.RuleDeleted) - .subscribe((v) => setRules((old) => old.filter((o) => o.name != v.message.name))) + .subscribe((v) => setRules((old) => old.filter((o) => o.name != v.message.name))), ); }, [addSubscription, context, context.notificationChannel, setRules]); @@ -225,7 +225,7 @@ export const Rules: React.FC = (_) => { } return old; }); - }) + }), ); }, [addSubscription, context, context.notificationChannel, setRules]); @@ -235,7 +235,7 @@ export const Rules: React.FC = (_) => { } const id = window.setInterval( () => refreshRules(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshRules]); @@ -252,7 +252,7 @@ export const Rules: React.FC = (_) => { (rule: Rule, cleanRuleEnabled: boolean) => { addSubscription(context.api.updateRule({ ...rule, enabled: false }, cleanRuleEnabled).subscribe()); }, - [context.api, addSubscription] + [context.api, addSubscription], ); const handleToggle = React.useCallback( @@ -276,7 +276,7 @@ export const Rules: React.FC = (_) => { handleDisableRule, setRuleToWarn, setWarningModalOpen, - ] + ], ); const handleDelete = React.useCallback( @@ -285,10 +285,10 @@ export const Rules: React.FC = (_) => { context.api .deleteRule(rule.name, clean) .pipe(first()) - .subscribe(() => undefined /* do nothing - notification will handle updating state */) + .subscribe(() => undefined /* do nothing - notification will handle updating state */), ); }, - [addSubscription, context.api] + [addSubscription, context.api], ); const handleDeleteButton = React.useCallback( @@ -300,7 +300,7 @@ export const Rules: React.FC = (_) => { handleDelete(rule, cleanRuleEnabled); } }, - [context.settings, setWarningModalOpen, handleDelete, setRuleToWarn, cleanRuleEnabled] + [context.settings, setWarningModalOpen, handleDelete, setRuleToWarn, cleanRuleEnabled], ); const handleWarningModalAccept = React.useCallback(() => { @@ -336,7 +336,7 @@ export const Rules: React.FC = (_) => { }, ]; }, - [context.api, handleDeleteButton] + [context.api, handleDeleteButton], ); const handleUploadModalClose = React.useCallback(() => { @@ -350,7 +350,7 @@ export const Rules: React.FC = (_) => { direction: sortBy.direction ?? SortByDirection.asc, }, rules, - tableColumns + tableColumns, ); return sorted.map((r: Rule, index) => ( diff --git a/src/app/Rules/RulesUploadModal.tsx b/src/app/Rules/RulesUploadModal.tsx index 8770d58b25..120d9d788d 100644 --- a/src/app/Rules/RulesUploadModal.tsx +++ b/src/app/Rules/RulesUploadModal.tsx @@ -39,7 +39,7 @@ export const parseRule = (file: File): Observable => { } else { throw new Error('Automated rule content is invalid.'); } - }) + }), ); }; @@ -78,7 +78,7 @@ export const RuleUploadModal: React.FC = ({ onClose, ...pr parseRule(fileUpload.file).pipe( first(), concatMap((rule) => - context.api.uploadRule(rule, getProgressUpdateCallback(fileUpload.file.name), fileUpload.abortSignal) + context.api.uploadRule(rule, getProgressUpdateCallback(fileUpload.file.name), fileUpload.abortSignal), ), tap({ next: (_) => { @@ -88,8 +88,8 @@ export const RuleUploadModal: React.FC = ({ onClose, ...pr onSingleFailure(fileUpload.file.name, err); }, }), - catchError((_) => of(false)) - ) + catchError((_) => of(false)), + ), ); }); @@ -99,10 +99,10 @@ export const RuleUploadModal: React.FC = ({ onClose, ...pr .subscribe((oks) => { setUploading(false); setAllOks(oks.reduce((prev, curr, _) => prev && curr, true)); - }) + }), ); }, - [setUploading, context.api, addSubscription, setAllOks] + [setUploading, context.api, addSubscription, setAllOks], ); const handleSubmit = React.useCallback(() => { @@ -114,7 +114,7 @@ export const RuleUploadModal: React.FC = ({ onClose, ...pr setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -123,8 +123,8 @@ export const RuleUploadModal: React.FC = ({ onClose, ...pr spinnerAriaValueText: 'Submitting', spinnerAriaLabel: 'submitting-automated-rule', isLoading: uploading, - } as LoadingPropsType), - [uploading] + }) as LoadingPropsType, + [uploading], ); return ( diff --git a/src/app/SecurityPanel/CertificateUploadModal.tsx b/src/app/SecurityPanel/CertificateUploadModal.tsx index 22bf26ba79..24f8f76870 100644 --- a/src/app/SecurityPanel/CertificateUploadModal.tsx +++ b/src/app/SecurityPanel/CertificateUploadModal.tsx @@ -48,7 +48,7 @@ export const CertificateUploadModal: React.FC = ({ setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success')); setNumOfFiles(fileUploads.length); }, - [setNumOfFiles, setAllOks] + [setNumOfFiles, setAllOks], ); const handleClose = React.useCallback(() => { @@ -75,7 +75,7 @@ export const CertificateUploadModal: React.FC = ({ .uploadSSLCertificate( fileUpload.file, getProgressUpdateCallback(fileUpload.file.name), - fileUpload.abortSignal + fileUpload.abortSignal, ) .pipe( tap({ @@ -86,8 +86,8 @@ export const CertificateUploadModal: React.FC = ({ onSingleFailure(fileUpload.file.name, err); }, }), - catchError((_) => of(false)) - ) + catchError((_) => of(false)), + ), ); }); @@ -97,10 +97,10 @@ export const CertificateUploadModal: React.FC = ({ .subscribe((oks) => { setUploading(false); setAllOks(oks.reduce((prev, curr, _) => prev && curr, true)); - }) + }), ); }, - [setUploading, context.api, addSubscriptions, setAllOks] + [setUploading, context.api, addSubscriptions, setAllOks], ); const submitButtonLoadingProps = React.useMemo( @@ -109,8 +109,8 @@ export const CertificateUploadModal: React.FC = ({ spinnerAriaValueText: 'Submitting', spinnerAriaLabel: 'submitting-ssl-certificates', isLoading: uploading, - } as LoadingPropsType), - [uploading] + }) as LoadingPropsType, + [uploading], ); return ( diff --git a/src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx b/src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx index 2694a1a92d..e18583313e 100644 --- a/src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx +++ b/src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx @@ -138,10 +138,10 @@ export const AuthForm: React.FC = ({ onDismiss, onPropsSave, prog if (ok) { onPropsSave(); } - }) + }), ); }, - [addSubscription, onPropsSave, context.api, matchExpressionInput, setSaving] + [addSubscription, onPropsSave, context.api, matchExpressionInput, setSaving], ); React.useEffect(() => { @@ -160,10 +160,10 @@ export const AuthForm: React.FC = ({ onDismiss, onPropsSave, prog input ? context.api.matchTargetsWithExpr(input, targets).pipe( map((ts) => [ts, undefined]), - catchError((err) => of([[], err])) + catchError((err) => of([[], err])), ) - : of([undefined, undefined]) - ) + : of([undefined, undefined]), + ), ) .subscribe(([ts, err]) => { setEvaluating(false); @@ -174,9 +174,9 @@ export const AuthForm: React.FC = ({ onDismiss, onPropsSave, prog ? ValidatedOptions.default : ts.length ? ValidatedOptions.success - : ValidatedOptions.warning + : ValidatedOptions.warning, ); - }) + }), ); }, [ matchExprService, @@ -199,9 +199,9 @@ export const AuthForm: React.FC = ({ onDismiss, onPropsSave, prog interval(16) .pipe( map(() => testPool.size > 0), - distinctUntilChanged() + distinctUntilChanged(), ) - .subscribe(setIsDisabled) + .subscribe(setIsDisabled), ); }, [testPool, setIsDisabled, addSubscription]); @@ -282,7 +282,7 @@ export const FormHelper: React.FC = ({ ...props }) => { const handleTabChange = React.useCallback( (_: React.MouseEvent, key: string | number) => setActiveTab(`${key}` as _SupportedTab), - [setActiveTab] + [setActiveTab], ); return ( diff --git a/src/app/SecurityPanel/Credentials/CredentialTestTable.tsx b/src/app/SecurityPanel/Credentials/CredentialTestTable.tsx index 815fb93278..0248ac9a3e 100644 --- a/src/app/SecurityPanel/Credentials/CredentialTestTable.tsx +++ b/src/app/SecurityPanel/Credentials/CredentialTestTable.tsx @@ -98,13 +98,13 @@ export const CredentialTestTable: React.FC = ({ ...pro .pipe( tap(() => setLoading(true)), switchMap(([input, targets]) => - input ? context.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of([]) - ) + input ? context.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of([]), + ), ) .subscribe((ts) => { setLoading(false); setMatchedTargets(ts); - }) + }), ); }, [matchExprService, context.api, context.targets, setMatchedTargets, setLoading, addSubscription]); @@ -115,7 +115,7 @@ export const CredentialTestTable: React.FC = ({ ...pro direction: sortBy.direction ?? SortByDirection.asc, }, matchedTargets, - tableColumns + tableColumns, ).map((t) => ); }, [matchedTargets, filters, searchText, sortBy]); @@ -245,7 +245,7 @@ export const CredentialTestRow: React.FC = ({ ? CredentialTestState.NA : CredentialTestState.INVALID, }); - }) + }), ); }, [setStatus, addSubscription, context.api, target, credential, isEmptyCredential, loading, testPool]); @@ -362,7 +362,7 @@ const StatusFilter: React.FC = ({ onChange, filters, ...props const old = filters; onChange && onChange(old.includes(value) ? old.filter((v) => v !== value) : [...old, value]); }, - [onChange, filters] + [onChange, filters], ); return ( diff --git a/src/app/SecurityPanel/Credentials/MatchedTargetsTable.tsx b/src/app/SecurityPanel/Credentials/MatchedTargetsTable.tsx index 7e1df3c251..e93613fc2d 100644 --- a/src/app/SecurityPanel/Credentials/MatchedTargetsTable.tsx +++ b/src/app/SecurityPanel/Credentials/MatchedTargetsTable.tsx @@ -68,7 +68,7 @@ export const MatchedTargetsTable: React.FC = ({ id, ma context.api.getCredential(id).subscribe((v) => { setTargets(v.targets); setIsLoading(false); - }) + }), ); }, [addSubscription, setIsLoading, context.api, setTargets, id]); @@ -89,7 +89,7 @@ export const MatchedTargetsTable: React.FC = ({ id, ma } else if (evt.kind === 'LOST') { setTargets((old) => old.filter((o) => !_.isEqual(o, target))); } - }) + }), ); }, [addSubscription, context, context.notificationChannel, setTargets, matchExpression]); @@ -100,7 +100,7 @@ export const MatchedTargetsTable: React.FC = ({ id, ma direction: sortBy.direction ?? SortByDirection.asc, }, targets, - tableColumns + tableColumns, ).map((target, idx) => { return ( diff --git a/src/app/SecurityPanel/Credentials/StoreCredentials.tsx b/src/app/SecurityPanel/Credentials/StoreCredentials.tsx index 45a1881e2b..d79dc9e710 100644 --- a/src/app/SecurityPanel/Credentials/StoreCredentials.tsx +++ b/src/app/SecurityPanel/Credentials/StoreCredentials.tsx @@ -74,10 +74,10 @@ const reducer = (state: State, action) => { case Actions.HANDLE_REFRESH: { const credentials: StoredCredential[] = action.payload.credentials; const updatedCheckedCredentials = state.checkedCredentials.filter((cred) => - includesCredential(credentials, cred) + includesCredential(credentials, cred), ); const updatedExpandedCredentials = state.expandedCredentials.filter((cred) => - includesCredential(credentials, cred) + includesCredential(credentials, cred), ); return { @@ -135,7 +135,7 @@ const reducer = (state: State, action) => { case Actions.HANDLE_NO_MATCH_ROW_CHECK: { const noMatch = action.payload.noMatch; const checkedCredentials = state.credentials.filter(({ numMatchingTargets }) => - noMatch ? numMatchingTargets === 0 : numMatchingTargets > 0 + noMatch ? numMatchingTargets === 0 : numMatchingTargets > 0, ); return { ...state, @@ -196,7 +196,7 @@ export const StoreCredentials = () => { context.api.getCredentials().subscribe((credentials: StoredCredential[]) => { dispatch({ type: Actions.HANDLE_REFRESH, payload: { credentials: credentials } }); setIsLoading(false); - }) + }), ); }, [addSubscription, context.api, setIsLoading]); @@ -210,7 +210,7 @@ export const StoreCredentials = () => { } const id = window.setInterval( () => refreshStoredCredentialsAndCounts(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.target, context.settings, refreshStoredCredentialsAndCounts]); @@ -219,7 +219,7 @@ export const StoreCredentials = () => { addSubscription( context.notificationChannel.messages(NotificationCategory.CredentialsStored).subscribe((v) => { dispatch({ type: Actions.HANDLE_CREDENTIALS_STORED_NOTIFICATION, payload: { credential: v.message } }); - }) + }), ); }, [addSubscription, context, context.notificationChannel]); @@ -228,8 +228,8 @@ export const StoreCredentials = () => { context.notificationChannel .messages(NotificationCategory.CredentialsDeleted) .subscribe((v) => - dispatch({ type: Actions.HANDLE_CREDENTIALS_DELETED_NOTIFICATION, payload: { credential: v.message } }) - ) + dispatch({ type: Actions.HANDLE_CREDENTIALS_DELETED_NOTIFICATION, payload: { credential: v.message } }), + ), ); }, [addSubscription, context, context.notificationChannel]); @@ -237,7 +237,7 @@ export const StoreCredentials = () => { addSubscription( context.notificationChannel .messages(NotificationCategory.TargetJvmDiscovery) - .subscribe((_) => refreshStoredCredentialsAndCounts()) + .subscribe((_) => refreshStoredCredentialsAndCounts()), ); }, [addSubscription, refreshStoredCredentialsAndCounts, context, context.notificationChannel, context.api]); @@ -245,12 +245,12 @@ export const StoreCredentials = () => { (checked: boolean) => { dispatch({ type: Actions.HANDLE_HEADER_CHECK, payload: { checked: checked } }); }, - [dispatch] + [dispatch], ); const handleDeleteCredentials = React.useCallback(() => { addSubscription( - forkJoin(state.checkedCredentials.map((credential) => context.api.deleteCredentials(credential.id))).subscribe() + forkJoin(state.checkedCredentials.map((credential) => context.api.deleteCredentials(credential.id))).subscribe(), ); }, [state.checkedCredentials, context.api, addSubscription]); diff --git a/src/app/SecurityPanel/Credentials/utils.tsx b/src/app/SecurityPanel/Credentials/utils.tsx index 12572ebcf5..32c266ed9d 100644 --- a/src/app/SecurityPanel/Credentials/utils.tsx +++ b/src/app/SecurityPanel/Credentials/utils.tsx @@ -32,7 +32,7 @@ export const TestPoolContext = React.createContext(new Set()); export const useAuthCredential = ( ignoreEmit?: boolean, - debounceMs = 50 + debounceMs = 50, ): [AuthCredential, (credential: AuthCredential) => void] => { const [credential$, setCredential$] = React.useState({ username: '', password: '' }); const authCredentialContext = React.useContext(CredentialContext); @@ -49,7 +49,7 @@ export const useAuthCredential = ( (credential: AuthCredential) => { authCredentialContext.set(credential); }, - [authCredentialContext] + [authCredentialContext], ); return [credential$, setCredential]; diff --git a/src/app/Settings/AutoRefresh.tsx b/src/app/Settings/AutoRefresh.tsx index bc8056384b..422254a109 100644 --- a/src/app/Settings/AutoRefresh.tsx +++ b/src/app/Settings/AutoRefresh.tsx @@ -45,7 +45,7 @@ const Component = () => { setState((state) => ({ ...state, autoRefreshEnabled })); context.settings.setAutoRefreshEnabled(autoRefreshEnabled); }, - [setState, context.settings] + [setState, context.settings], ); const handleAutoRefreshPeriodChange = React.useCallback( @@ -53,7 +53,7 @@ const Component = () => { setState((state) => ({ ...state, autoRefreshPeriod })); context.settings.setAutoRefreshPeriod(autoRefreshPeriod); }, - [setState, context.settings] + [setState, context.settings], ); const handleAutoRefreshUnitScalarChange = React.useCallback( @@ -61,7 +61,7 @@ const Component = () => { setState((state) => ({ ...state, autoRefreshUnits })); context.settings.setAutoRefreshUnits(autoRefreshUnits); }, - [setState, context.settings] + [setState, context.settings], ); return ( diff --git a/src/app/Settings/ChartCardsConfig.tsx b/src/app/Settings/ChartCardsConfig.tsx index bba21c2d46..fbb24c111f 100644 --- a/src/app/Settings/ChartCardsConfig.tsx +++ b/src/app/Settings/ChartCardsConfig.tsx @@ -39,7 +39,7 @@ const Component = () => { return value; }); }, - [setMinRefresh, context.settings] + [setMinRefresh, context.settings], ); const handleVisibleStep = React.useCallback( @@ -48,7 +48,7 @@ const Component = () => { context.settings.setChartControllerConfig({ minRefresh: v }); setMinRefresh(v); }, - [minRefresh, context.settings] + [minRefresh, context.settings], ); return ( diff --git a/src/app/Settings/CredentialsStorage.tsx b/src/app/Settings/CredentialsStorage.tsx index 7604ca91dc..258e3a7fc9 100644 --- a/src/app/Settings/CredentialsStorage.tsx +++ b/src/app/Settings/CredentialsStorage.tsx @@ -63,7 +63,7 @@ const Component = () => { setExpanded(false); saveToLocalStorage('CREDENTIAL_LOCATION', selection.value); }, - [setSelection, setExpanded] + [setSelection, setExpanded], ); React.useEffect(() => { diff --git a/src/app/Settings/DatetimeControl.tsx b/src/app/Settings/DatetimeControl.tsx index 533596121b..4bacfea472 100644 --- a/src/app/Settings/DatetimeControl.tsx +++ b/src/app/Settings/DatetimeControl.tsx @@ -39,7 +39,7 @@ const Component = () => { }, }); }, - [context.settings, datetimeFormat, setDateLocaleOpen] + [context.settings, datetimeFormat, setDateLocaleOpen], ); const handleTimezoneSelect = React.useCallback( @@ -52,7 +52,7 @@ const Component = () => { }, }); }, - [context.settings, datetimeFormat] + [context.settings, datetimeFormat], ); const dateLocaleOptions = React.useMemo( @@ -70,7 +70,7 @@ const Component = () => { {locale.name} )), - [] + [], ); const handleDateLocaleFilter = React.useCallback( @@ -80,10 +80,10 @@ const Component = () => { } const matchExp = new RegExp(value, 'i'); return dateLocaleOptions.filter( - (opt) => matchExp.test(opt.props.value.name) || matchExp.test(opt.props.description) + (opt) => matchExp.test(opt.props.value.name) || matchExp.test(opt.props.description), ); }, - [dateLocaleOptions] + [dateLocaleOptions], ); return ( diff --git a/src/app/Settings/DeletionDialogControl.tsx b/src/app/Settings/DeletionDialogControl.tsx index 3867ebdf0f..5ab2f523b4 100644 --- a/src/app/Settings/DeletionDialogControl.tsx +++ b/src/app/Settings/DeletionDialogControl.tsx @@ -41,7 +41,7 @@ const Component = () => { context.settings.setDeletionDialogsEnabled(state); setState(new Map(state)); }, - [state, setState, context.settings] + [state, setState, context.settings], ); const handleCheckAll = React.useCallback( @@ -51,7 +51,7 @@ const Component = () => { context.settings.setDeletionDialogsEnabled(newState); setState(newState); }, - [context.settings, setState, state] + [context.settings, setState, state], ); const allChecked = React.useMemo(() => { diff --git a/src/app/Settings/FeatureLevels.tsx b/src/app/Settings/FeatureLevels.tsx index c53fd6b8ff..37b0a2be39 100644 --- a/src/app/Settings/FeatureLevels.tsx +++ b/src/app/Settings/FeatureLevels.tsx @@ -43,7 +43,7 @@ const Component = () => { context.settings.setFeatureLevel(v.value); setOpen(false); }, - [setState, setOpen, context.settings] + [setState, setOpen, context.settings], ); return ( diff --git a/src/app/Settings/Language.tsx b/src/app/Settings/Language.tsx index 2209deaee8..c06fc3bf80 100644 --- a/src/app/Settings/Language.tsx +++ b/src/app/Settings/Language.tsx @@ -32,7 +32,7 @@ const Component = () => { i18n.changeLanguage(v); setOpen(false); }, - [i18n, setOpen] + [i18n, setOpen], ); React.useEffect(() => { diff --git a/src/app/Settings/NotificationControl.tsx b/src/app/Settings/NotificationControl.tsx index 5e32282699..5acd3aec60 100644 --- a/src/app/Settings/NotificationControl.tsx +++ b/src/app/Settings/NotificationControl.tsx @@ -51,7 +51,7 @@ const Component = () => { context.settings.setNotificationsEnabled(state); setState(new Map(state)); }, - [state, setState, context.settings] + [state, setState, context.settings], ); const handleCheckAll = React.useCallback( @@ -61,7 +61,7 @@ const Component = () => { context.settings.setNotificationsEnabled(newState); setState(newState); }, - [context.settings, setState, state] + [context.settings, setState, state], ); const handleChange = React.useCallback( @@ -74,7 +74,7 @@ const Component = () => { } context.settings.setVisibleNotificationCount(value); }, - [visibleNotificationsCount, context.settings] + [visibleNotificationsCount, context.settings], ); const handleVisibleStep = React.useCallback( @@ -82,7 +82,7 @@ const Component = () => { const v = visibleNotificationsCount + delta; context.settings.setVisibleNotificationCount(v); }, - [visibleNotificationsCount, context.settings] + [visibleNotificationsCount, context.settings], ); const allChecked = React.useMemo(() => { diff --git a/src/app/Settings/Settings.tsx b/src/app/Settings/Settings.tsx index 238c56566d..ac422d5cbf 100644 --- a/src/app/Settings/Settings.tsx +++ b/src/app/Settings/Settings.tsx @@ -107,9 +107,9 @@ export const Settings: React.FC = (_) => { disabled: c.disabled, orderInGroup: c.orderInGroup || -1, featureLevel: c.featureLevel || FeatureLevel.PRODUCTION, - } as _TransformedUserSetting) + }) as _TransformedUserSetting, ), - [t, loggedIn] + [t, loggedIn], ); const history = useHistory(); @@ -121,15 +121,15 @@ export const Settings: React.FC = (_) => { search, 'tab', Object.values(SettingTab).map((v) => tabAsParam(v)), - tabAsParam(SettingTab.GENERAL) - ) + tabAsParam(SettingTab.GENERAL), + ), ); }, [search]); const onTabSelect = React.useCallback( (_: React.MouseEvent, key: string | number) => switchTab(history, pathname, search, { tabKey: 'tab', tabValue: `${tabAsParam(key as SettingTab)}` }), - [history, pathname, search] + [history, pathname, search], ); const settingGroups = React.useMemo(() => { diff --git a/src/app/Settings/Theme.tsx b/src/app/Settings/Theme.tsx index 14af1d6528..cee090a847 100644 --- a/src/app/Settings/Theme.tsx +++ b/src/app/Settings/Theme.tsx @@ -33,7 +33,7 @@ const Component = () => { context.settings.setThemeSetting(v as ThemeSetting); setOpen(false); }, - [context.settings, setOpen] + [context.settings, setOpen], ); return ( diff --git a/src/app/Settings/WebSocketDebounce.tsx b/src/app/Settings/WebSocketDebounce.tsx index bd892c9642..efb95238a6 100644 --- a/src/app/Settings/WebSocketDebounce.tsx +++ b/src/app/Settings/WebSocketDebounce.tsx @@ -75,7 +75,7 @@ const Component = () => { return { ...state, webSocketDebounceMs: next }; }); }, - [setState, context.settings] + [setState, context.settings], ); return ( diff --git a/src/app/Shared/FeatureFlag/FeatureFlag.tsx b/src/app/Shared/FeatureFlag/FeatureFlag.tsx index 9a9b1c7a06..1ac2febdbc 100644 --- a/src/app/Shared/FeatureFlag/FeatureFlag.tsx +++ b/src/app/Shared/FeatureFlag/FeatureFlag.tsx @@ -52,7 +52,7 @@ export interface FeatureFlagProps { export const FeatureFlag: React.FC = ({ level, strict, children }) => { const levels = React.useMemo( () => (strict ? [level] : [...Array.from({ length: level + 1 }, (_, i) => i)]), - [strict, level] + [strict, level], ); const component = React.useCallback((_) => <>{children}, [children]); diff --git a/src/app/Shared/FileUploads.tsx b/src/app/Shared/FileUploads.tsx index 17bdb40565..5eaca7d178 100644 --- a/src/app/Shared/FileUploads.tsx +++ b/src/app/Shared/FileUploads.tsx @@ -98,14 +98,14 @@ export const MultiFileUpload: React.FC = ({ ({ file: f, abortSignal: new Subject(), - } as FUpload) + }) as FUpload, ), ]; onFilesChange && onFilesChange(newFileUploads); return newFileUploads; }); }, - [setFileUploads, onFilesChange] + [setFileUploads, onFilesChange], ); const handleFileReject = React.useCallback( @@ -121,7 +121,7 @@ export const MultiFileUpload: React.FC = ({ } }); }, - [notifications, dzAccept] + [notifications, dzAccept], ); const handleFileRemove = React.useCallback( @@ -137,7 +137,7 @@ export const MultiFileUpload: React.FC = ({ }); } }, - [fileUploads, setFileUploads, onFilesChange] + [fileUploads, setFileUploads, onFilesChange], ); const getProgressUpdateCallback = React.useCallback( @@ -161,7 +161,7 @@ export const MultiFileUpload: React.FC = ({ }); }; }, - [setFileUploads] + [setFileUploads], ); const onSingleFailure = React.useCallback( @@ -184,7 +184,7 @@ export const MultiFileUpload: React.FC = ({ return old; }); }, - [setFileUploads] + [setFileUploads], ); const onSingleSuccess = React.useCallback( @@ -207,7 +207,7 @@ export const MultiFileUpload: React.FC = ({ return old; }); }, - [setFileUploads] + [setFileUploads], ); const handleSubmit = React.useCallback(() => { @@ -222,7 +222,7 @@ export const MultiFileUpload: React.FC = ({ error: undefined, progress: f.progress?.progressVariant === 'success' ? f.progress : undefined, helperText: f.progress?.progressVariant === 'success' ? 'Already uploaded' : undefined, - } as FUpload) + }) as FUpload, ); return newFileUploads; }); diff --git a/src/app/Shared/MatchExpression/MatchExpressionVisualizer.tsx b/src/app/Shared/MatchExpression/MatchExpressionVisualizer.tsx index 85545b222c..63f4a4ddbb 100644 --- a/src/app/Shared/MatchExpression/MatchExpressionVisualizer.tsx +++ b/src/app/Shared/MatchExpression/MatchExpressionVisualizer.tsx @@ -102,7 +102,7 @@ const LayoutRadioGroup: React.FC = ({ onChange, ...props isGraph: false, }, ], - [] + [], ); React.useEffect(() => onChange(isGraph), [isGraph, onChange]); @@ -168,7 +168,7 @@ const GraphView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, .. }; saveToLocalStorage('MATCH_EXPRES_VIS_GRAPH_POSITIONS', saved); } - }, 200) + }, 200), ); _newVisualization.addEventListener( @@ -184,7 +184,7 @@ const GraphView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, .. })); saveToLocalStorage('MATCH_EXPRES_VIS_NODE_POSITIONS', savedPos); } - }, 200) + }, 200), ); return _newVisualization; @@ -244,7 +244,7 @@ const GraphView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, .. if (!graphData.id || !graphData.x || !graphData.y) { visualization.getGraph().fit(); } - }) + }), ); return () => clearTimeout(_id); }, [_transformedData, targetNodes, visualization]); @@ -315,7 +315,7 @@ const ListView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, ... return [...old, id]; }); }, - [setExpanded] + [setExpanded], ); React.useEffect(() => { @@ -327,13 +327,13 @@ const ListView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, ... .pipe( tap(() => setLoading(true)), switchMap(([input, targets]) => - input ? context.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of([]) - ) + input ? context.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of([]), + ), ) .subscribe((ts) => { setLoading(false); setMatchedTargets(ts); - }) + }), ); }, [matchExprService, context.api, context.targets, setMatchedTargets, setLoading, addSubscription]); diff --git a/src/app/Shared/MatchExpression/utils.tsx b/src/app/Shared/MatchExpression/utils.tsx index a9718533f6..dc06febc10 100644 --- a/src/app/Shared/MatchExpression/utils.tsx +++ b/src/app/Shared/MatchExpression/utils.tsx @@ -58,7 +58,7 @@ export const componentFactory: ComponentFactory = (kind: ModelKind, type: string return withPanZoom()(GraphComponent); case ModelKind.node: return withDragNode(nodeDragSourceSpec('node', false, false))( - withSelection({ multiSelect: false, controlled: true })(CustomNode) + withSelection({ multiSelect: false, controlled: true })(CustomNode), ); case ModelKind.edge: return DefaultEdge; @@ -82,7 +82,7 @@ const DEFAULT_NODE_DIAMETER = 50; const DEFAULT_NODE_PADDINGS = [0, 35]; export const transformData = ( - targets: TargetNode[] + targets: TargetNode[], ): { nodes: NodeModel[]; edges: EdgeModel[]; diff --git a/src/app/Shared/Redux/Configurations/DashboardConfigSlice.tsx b/src/app/Shared/Redux/Configurations/DashboardConfigSlice.tsx index 50dbc41c5c..663f33cfc0 100644 --- a/src/app/Shared/Redux/Configurations/DashboardConfigSlice.tsx +++ b/src/app/Shared/Redux/Configurations/DashboardConfigSlice.tsx @@ -123,7 +123,7 @@ export const dashboardConfigAddCardIntent = createAction( span, props, } as DashboardAddConfigActionPayload, - }) + }), ); export const dashboardConfigDeleteCardIntent = createAction(DashboardConfigAction.CARD_REMOVE, (idx: number) => ({ @@ -139,7 +139,7 @@ export const dashboardConfigResizeCardIntent = createAction( idx, span, } as DashboardResizeConfigActionPayload, - }) + }), ); export const dashboardConfigReorderCardIntent = createAction( @@ -150,7 +150,7 @@ export const dashboardConfigReorderCardIntent = createAction( nextOrder, swap, } as DashboardOrderConfigActionPayload, - }) + }), ); export const dashboardConfigFirstRunIntent = createAction(DashboardConfigAction.FIRST_RUN, () => ({ @@ -163,7 +163,7 @@ export const dashboardConfigCreateLayoutIntent = createAction( payload: { layout, } as DashboardAddLayoutActionPayload, - }) + }), ); export const dashboardConfigDeleteLayoutIntent = createAction(DashboardConfigAction.LAYOUT_REMOVE, (name: string) => ({ @@ -179,7 +179,7 @@ export const dashboardConfigRenameLayoutIntent = createAction( oldName, newName, } as DashboardRenameLayoutActionPayload, - }) + }), ); export const dashboardConfigReplaceLayoutIntent = createAction( @@ -188,7 +188,7 @@ export const dashboardConfigReplaceLayoutIntent = createAction( payload: { newLayoutName: name, } as DashboardReplaceLayoutActionPayload, - }) + }), ); export const dashboardConfigFavoriteLayoutIntent = createAction( @@ -197,7 +197,7 @@ export const dashboardConfigFavoriteLayoutIntent = createAction( payload: { newLayoutName: name, } as DashboardReplaceLayoutActionPayload, - }) + }), ); export const dashboardConfigCreateTemplateIntent = createAction( @@ -206,7 +206,7 @@ export const dashboardConfigCreateTemplateIntent = createAction( payload: { template, } as DashboardAddTemplateActionPayload, - }) + }), ); export const dashboardConfigDeleteTemplateIntent = createAction( @@ -215,7 +215,7 @@ export const dashboardConfigDeleteTemplateIntent = createAction( payload: { name, } as DashboardDeleteTemplateActionPayload, - }) + }), ); export const dashboardConfigTemplateHistoryPushIntent = createAction( @@ -224,14 +224,14 @@ export const dashboardConfigTemplateHistoryPushIntent = createAction( payload: { template, } as DashboardHistoryPushTemplateActionPayload, - }) + }), ); export const dashboardConfigTemplateHistoryClearIntent = createAction( DashboardConfigAction.TEMPLATE_HISTORY_CLEAR, () => ({ payload: {} as DashboardHistoryClearTemplateActionPayload, - }) + }), ); export const dashboardConfigClearLayoutIntent = createAction(DashboardConfigAction.LAYOUT_CLEAR, () => ({ diff --git a/src/app/Shared/Redux/Configurations/TopologyConfigSlice.tsx b/src/app/Shared/Redux/Configurations/TopologyConfigSlice.tsx index eabcf5e1e7..e8221ee21e 100644 --- a/src/app/Shared/Redux/Configurations/TopologyConfigSlice.tsx +++ b/src/app/Shared/Redux/Configurations/TopologyConfigSlice.tsx @@ -61,7 +61,7 @@ export const topologyConfigSetViewModeIntent = createAction( payload: { viewMode, } as TopologySetViewModeActionPayload, - }) + }), ); export const topologyDisplayOptionsSetIntent = createAction( @@ -72,7 +72,7 @@ export const topologyDisplayOptionsSetIntent = createAction( key, value, } as TopologySetDisplayOptionsActionPayload, - }) + }), ); export interface TopologyConfig { @@ -103,7 +103,7 @@ export const showOptions: [string, string][] = Object.keys(defaultTopologyConfig export const groupingOptions: [string, string][] = Object.keys(defaultTopologyConfig.displayOptions.groupings).map( (k) => { return [getDisplayFieldName(k), k]; - } + }, ); const INITIAL_STATE: TopologyConfig = getPersistedState('TOPOLOGY_CONFIG', _version, defaultTopologyConfig); @@ -132,7 +132,7 @@ export const topologyConfigReducer: ReducerWithInitialState = cr } } }); - } + }, ); export default topologyConfigReducer; diff --git a/src/app/Shared/Redux/Filters/AutomatedAnalysisFilterSlice.tsx b/src/app/Shared/Redux/Filters/AutomatedAnalysisFilterSlice.tsx index 899c2f69c3..0a0d6c6acb 100644 --- a/src/app/Shared/Redux/Filters/AutomatedAnalysisFilterSlice.tsx +++ b/src/app/Shared/Redux/Filters/AutomatedAnalysisFilterSlice.tsx @@ -59,7 +59,7 @@ export const automatedAnalysisAddGlobalFilterIntent = createAction( category: category, filter: filter, }, - }) + }), ); export const automatedAnalysisAddFilterIntent = createAction( @@ -70,7 +70,7 @@ export const automatedAnalysisAddFilterIntent = createAction( category: category, filter: filter, } as AutomatedAnalysisFilterActionPayload, - }) + }), ); export const automatedAnalysisDeleteFilterIntent = createAction( @@ -81,7 +81,7 @@ export const automatedAnalysisDeleteFilterIntent = createAction( category: category, filter: filter, } as AutomatedAnalysisFilterActionPayload, - }) + }), ); export const automatedAnalysisDeleteCategoryFiltersIntent = createAction( @@ -91,7 +91,7 @@ export const automatedAnalysisDeleteCategoryFiltersIntent = createAction( target: target, category: category, } as AutomatedAnalysisFilterActionPayload, - }) + }), ); export const automatedAnalysisDeleteAllFiltersIntent = createAction( @@ -100,7 +100,7 @@ export const automatedAnalysisDeleteAllFiltersIntent = createAction( payload: { target: target, } as Pick, - }) + }), ); export const automatedAnalysisUpdateCategoryIntent = createAction( @@ -110,7 +110,7 @@ export const automatedAnalysisUpdateCategoryIntent = createAction( target: target, category: category, } as Pick, - }) + }), ); export const automatedAnalysisAddTargetIntent = createAction( @@ -119,7 +119,7 @@ export const automatedAnalysisAddTargetIntent = createAction( payload: { target: target, } as Pick, - }) + }), ); export const automatedAnalysisDeleteTargetIntent = createAction( @@ -128,7 +128,7 @@ export const automatedAnalysisDeleteTargetIntent = createAction( payload: { target: target, } as Pick, - }) + }), ); export interface AutomatedAnalysisFilters { @@ -147,7 +147,7 @@ export interface TargetAutomatedAnalysisFilters { export const createOrUpdateAutomatedAnalysisGlobalFilter = ( old: AutomatedAnalysisGlobalFiltersCategories, - { filterValue, filterKey } + { filterValue, filterKey }, ): AutomatedAnalysisGlobalFiltersCategories => { const newFilters = { ...old }; newFilters[filterKey] = filterValue; @@ -156,7 +156,7 @@ export const createOrUpdateAutomatedAnalysisGlobalFilter = ( export const createOrUpdateAutomatedAnalysisFilter = ( old: AutomatedAnalysisFiltersCategories, - { filterValue, filterKey, deleted = false, deleteOptions }: UpdateFilterOptions + { filterValue, filterKey, deleted = false, deleteOptions }: UpdateFilterOptions, ): AutomatedAnalysisFiltersCategories => { let newFilterValues: unknown[]; @@ -181,14 +181,14 @@ export const createOrUpdateAutomatedAnalysisFilter = ( }; export const getAutomatedAnalysisGlobalFilter = ( - state: WritableDraft<{ globalFilters: TargetAutomatedAnalysisGlobalFilters }> + state: WritableDraft<{ globalFilters: TargetAutomatedAnalysisGlobalFilters }>, ) => { return state.globalFilters; }; export const getAutomatedAnalysisFilter = ( state: WritableDraft<{ targetFilters: TargetAutomatedAnalysisFilters[] }>, - target: string + target: string, ): TargetAutomatedAnalysisFilters => { const targetFilter = state.targetFilters.filter((targetFilters) => targetFilters.target === target); return targetFilter.length > 0 ? targetFilter[0] : createEmptyAutomatedAnalysisFilters(target); @@ -199,7 +199,7 @@ export const createEmptyAutomatedAnalysisFilters = (target: string) => target: target, selectedCategory: 'Name', filters: emptyAutomatedAnalysisFilters, - } as TargetAutomatedAnalysisFilters); + }) as TargetAutomatedAnalysisFilters; export const deleteAllAutomatedAnalysisFilters = (automatedAnalysisFilter: TargetAutomatedAnalysisFilters) => { return { @@ -239,7 +239,7 @@ export const automatedAnalysisFilterReducer = createReducer(INITIAL_STATE, (buil }), }; state.targetFilters = state.targetFilters.filter( - (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target + (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target, ); state.targetFilters.push(newAutomatedAnalysisFilter); }) @@ -257,7 +257,7 @@ export const automatedAnalysisFilterReducer = createReducer(INITIAL_STATE, (buil }; state.targetFilters = state.targetFilters.filter( - (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target + (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target, ); state.targetFilters.push(newAutomatedAnalysisFilter); }) @@ -274,7 +274,7 @@ export const automatedAnalysisFilterReducer = createReducer(INITIAL_STATE, (buil }), }; state.targetFilters = state.targetFilters.filter( - (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target + (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target, ); state.targetFilters.push(newAutomatedAnalysisFilter); }) @@ -282,7 +282,7 @@ export const automatedAnalysisFilterReducer = createReducer(INITIAL_STATE, (buil const oldAutomatedAnalysisFilter = getAutomatedAnalysisFilter(state, payload.target); const newAutomatedAnalysisFilter = deleteAllAutomatedAnalysisFilters(oldAutomatedAnalysisFilter); state.targetFilters = state.targetFilters.filter( - (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target + (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target, ); state.targetFilters.push(newAutomatedAnalysisFilter); }) @@ -293,7 +293,7 @@ export const automatedAnalysisFilterReducer = createReducer(INITIAL_STATE, (buil newAutomatedAnalysisFilter.selectedCategory = payload.category; state.targetFilters = state.targetFilters.filter( - (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target + (targetFilters) => targetFilters.target !== newAutomatedAnalysisFilter.target, ); state.targetFilters.push(newAutomatedAnalysisFilter); }) diff --git a/src/app/Shared/Redux/Filters/RecordingFilterSlice.tsx b/src/app/Shared/Redux/Filters/RecordingFilterSlice.tsx index a1ccdaff9f..f90845b499 100644 --- a/src/app/Shared/Redux/Filters/RecordingFilterSlice.tsx +++ b/src/app/Shared/Redux/Filters/RecordingFilterSlice.tsx @@ -69,7 +69,7 @@ export const recordingAddFilterIntent = createAction( filter: filter, isArchived: isArchived, } as RecordingFilterActionPayload, - }) + }), ); export const recordingDeleteFilterIntent = createAction( @@ -81,7 +81,7 @@ export const recordingDeleteFilterIntent = createAction( filter: filter, isArchived: isArchived, } as RecordingFilterActionPayload, - }) + }), ); export const recordingDeleteCategoryFiltersIntent = createAction( @@ -92,7 +92,7 @@ export const recordingDeleteCategoryFiltersIntent = createAction( category: category, isArchived: isArchived, } as RecordingFilterActionPayload, - }) + }), ); export const recordingDeleteAllFiltersIntent = createAction( @@ -102,7 +102,7 @@ export const recordingDeleteAllFiltersIntent = createAction( target: target, isArchived: isArchived, } as Pick, - }) + }), ); export const recordingUpdateCategoryIntent = createAction( @@ -113,7 +113,7 @@ export const recordingUpdateCategoryIntent = createAction( category: category, isArchived: isArchived, } as RecordingFilterActionPayload, - }) + }), ); export const recordingAddTargetIntent = createAction(RecordingFilterAction.TARGET_ADD, (target: string) => ({ @@ -144,7 +144,7 @@ export interface TargetRecordingFilters { export const createOrUpdateRecordingFilter = ( old: RecordingFiltersCategories, - { filterValue, filterKey, deleted = false, deleteOptions }: UpdateFilterOptions + { filterValue, filterKey, deleted = false, deleteOptions }: UpdateFilterOptions, ): RecordingFiltersCategories => { let newFilterValues: unknown[]; if (!old[filterKey]) { @@ -169,7 +169,7 @@ export const createOrUpdateRecordingFilter = ( export const getTargetRecordingFilter = ( state: WritableDraft<{ list: TargetRecordingFilters[] }>, - target: string + target: string, ): TargetRecordingFilters => { const targetFilter = state.list.filter((targetFilters) => targetFilters.target === target); return targetFilter.length > 0 ? targetFilter[0] : createEmptyTargetRecordingFilters(target); @@ -186,7 +186,7 @@ export const createEmptyTargetRecordingFilters = (target: string) => selectedCategory: 'Name', filters: emptyArchivedRecordingFilters, }, - } as TargetRecordingFilters); + }) as TargetRecordingFilters; export const deleteAllTargetRecordingFilters = (targetRecordingFilter: TargetRecordingFilters, isArchived: boolean) => { if (isArchived) { diff --git a/src/app/Shared/Redux/Filters/TopologyFilterSlice.tsx b/src/app/Shared/Redux/Filters/TopologyFilterSlice.tsx index 1560b10177..79fc739dbd 100644 --- a/src/app/Shared/Redux/Filters/TopologyFilterSlice.tsx +++ b/src/app/Shared/Redux/Filters/TopologyFilterSlice.tsx @@ -38,7 +38,7 @@ export const topologyUpdateCategoryTypeIntent = createAction( payload: { isGroup, }, - }) + }), ); export const topologyUpdateCategoryIntent = createAction( @@ -48,7 +48,7 @@ export const topologyUpdateCategoryIntent = createAction( isGroup, category, }, - }) + }), ); export const topologyAddFilterIntent = createAction( @@ -60,7 +60,7 @@ export const topologyAddFilterIntent = createAction( category, value, }, - }) + }), ); export const topologyDeleteFilterIntent = createAction( @@ -72,7 +72,7 @@ export const topologyDeleteFilterIntent = createAction( category, value, }, - }) + }), ); export const topologyDeleteAllFiltersIntent = createAction(TopologyFilterAction.FILTER_DELETE_ALL, () => ({ @@ -87,7 +87,7 @@ export const topologyDeleteCategoryFiltersIntent = createAction( nodeType, category, }, - }) + }), ); export interface TopologyFilters { @@ -228,7 +228,7 @@ export const topologyFilterReducer: ReducerWithInitialState = c filters: defaultEmptyTargetFilters, }; }); - } + }, ); export default topologyFilterReducer; diff --git a/src/app/Shared/SelectTemplateSelectorForm.tsx b/src/app/Shared/SelectTemplateSelectorForm.tsx index 866bfc6ed4..2fd06de038 100644 --- a/src/app/Shared/SelectTemplateSelectorForm.tsx +++ b/src/app/Shared/SelectTemplateSelectorForm.tsx @@ -66,7 +66,7 @@ export const SelectTemplateSelectorForm: React.FC (sessionState === SessionState.USER_SESSION ? this.doGet('recordings') : EMPTY)) + concatMap((sessionState) => (sessionState === SessionState.USER_SESSION ? this.doGet('recordings') : EMPTY)), ) .subscribe({ next: () => { @@ -95,10 +95,10 @@ export class ApiService { }); const getDatasourceURL: Observable = fromFetch( - `${this.login.authority}/api/v1/grafana_datasource_url` + `${this.login.authority}/api/v1/grafana_datasource_url`, ).pipe(concatMap((resp) => from(resp.json()))); const getDashboardURL: Observable = fromFetch( - `${this.login.authority}/api/v1/grafana_dashboard_url` + `${this.login.authority}/api/v1/grafana_dashboard_url`, ).pipe(concatMap((resp) => from(resp.json()))); const health: Observable = fromFetch(`${this.login.authority}/health`).pipe( tap((resp: Response) => { @@ -108,7 +108,7 @@ export class ApiService { } }), concatMap((resp: Response) => from(resp.json())), - shareReplay() + shareReplay(), ); health .pipe( @@ -151,9 +151,9 @@ export class ApiService { })); } return forkJoin( - toFetch as [Observable, Observable] + toFetch as [Observable, Observable], ); - }) + }), ) .subscribe({ next: (parts) => { @@ -175,7 +175,7 @@ export class ApiService { target: Target, credentials?: { username?: string; password?: string }, storeCredentials = false, - dryrun = false + dryrun = false, ): Observable<{ status: number; body: object }> { const form = new window.FormData(); form.append('connectUrl', target.connectUrl); @@ -193,18 +193,18 @@ export class ApiService { }, new URLSearchParams({ storeCredentials: `${storeCredentials}`, dryrun: `${dryrun}` }), true, - true + true, ).pipe( first(), concatMap((resp) => resp.json().then((body) => ({ status: resp.status, body: body as object }))), catchError((err: Error) => { if (isHttpError(err)) { return from( - err.httpResponse.json().then((body) => ({ status: err.httpResponse.status, body: body as object })) + err.httpResponse.json().then((body) => ({ status: err.httpResponse.status, body: body as object })), ); } return of({ status: 0, body: { data: { reason: err.message } } }); // Status 0 -> request is not completed - }) + }), ); } @@ -214,14 +214,14 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError(() => of(false)), - first() + first(), ); } uploadRule( rule: Rule, onUploadProgress?: (progress: string | number) => void, - abortSignal?: Observable + abortSignal?: Observable, ): Observable { window.onbeforeunload = (event: BeforeUnloadEvent) => event.preventDefault(); @@ -243,7 +243,7 @@ export class ApiService { next: () => (window.onbeforeunload = null), error: () => (window.onbeforeunload = null), }), - first() + first(), ); } @@ -257,7 +257,7 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError((_) => of(false)), - first() + first(), ); } @@ -272,10 +272,10 @@ export class ApiService { body: JSON.stringify(rule), headers, }, - new URLSearchParams({ clean: String(clean) }) + new URLSearchParams({ clean: String(clean) }), ).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -286,10 +286,10 @@ export class ApiService { { method: 'DELETE', }, - new URLSearchParams({ clean: String(clean) }) + new URLSearchParams({ clean: String(clean) }), ).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -343,9 +343,9 @@ export class ApiService { return of(undefined); } }), - first() - ) - ) + first(), + ), + ), ); } @@ -359,15 +359,15 @@ export class ApiService { if (resp.status == 202) { this.notifications.warning( 'Snapshot Failed to Create', - 'The recording is not readable for reasons, such as, unavailability of active and non-snapshot source recordings from where the event data is read.' + 'The recording is not readable for reasons, such as, unavailability of active and non-snapshot source recordings from where the event data is read.', ); } }), map((resp) => resp.status == 200), catchError((_) => of(false)), - first() - ) - ) + first(), + ), + ), ); } @@ -380,9 +380,9 @@ export class ApiService { concatMap((resp) => resp.json() as Promise), map((response) => response.data.result), catchError((_) => of(undefined)), - first() - ) - ) + first(), + ), + ), ); } @@ -399,12 +399,12 @@ export class ApiService { { method: 'PATCH', body: 'SAVE', - } + }, ).pipe( map((resp) => resp.ok), - first() - ) - ) + first(), + ), + ), ); } @@ -417,12 +417,12 @@ export class ApiService { { method: 'PATCH', body: 'STOP', - } + }, ).pipe( map((resp) => resp.ok), - first() - ) - ) + first(), + ), + ), ); } @@ -434,12 +434,12 @@ export class ApiService { `targets/${encodeURIComponent(target.connectUrl)}/recordings/${encodeURIComponent(recordingName)}`, { method: 'DELETE', - } + }, ).pipe( map((resp) => resp.ok), - first() - ) - ) + first(), + ), + ), ); } @@ -449,10 +449,10 @@ export class ApiService { `recordings/${encodeURIComponent(connectUrl)}/${encodeURIComponent(recordingName)}`, { method: 'DELETE', - } + }, ).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -464,12 +464,12 @@ export class ApiService { `targets/${encodeURIComponent(target.connectUrl)}/recordings/${encodeURIComponent(recordingName)}/upload`, { method: 'POST', - } + }, ).pipe( map((resp) => resp.ok), - first() - ) - ) + first(), + ), + ), ); } @@ -481,12 +481,12 @@ export class ApiService { `recordings/${encodeURIComponent(target.connectUrl)}/${encodeURIComponent(recordingName)}/upload`, { method: 'POST', - } + }, ).pipe( map((resp) => resp.ok), - first() - ) - ) + first(), + ), + ), ); } @@ -497,7 +497,7 @@ export class ApiService { method: 'POST', }).pipe( map((resp) => resp.ok), - first() + first(), ); } deleteArchivedRecordingFromPath(jvmId: string, recordingName: string): Observable { @@ -506,7 +506,7 @@ export class ApiService { method: 'DELETE', }).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -526,10 +526,10 @@ export class ApiService { { method: 'POST', body: this.transformAndStringifyToRawLabels(labels), - } + }, ).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -537,7 +537,7 @@ export class ApiService { return this.getActiveProbes(true).pipe( concatMap((_) => of(true)), catchError((_) => of(false)), - first() + first(), ); } @@ -547,14 +547,14 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError(() => of(false)), - first() + first(), ); } addCustomEventTemplate( file: File, onUploadProgress?: (progress: string | number) => void, - abortSignal?: Observable + abortSignal?: Observable, ): Observable { window.onbeforeunload = (event: BeforeUnloadEvent) => event.preventDefault(); @@ -576,7 +576,7 @@ export class ApiService { next: () => (window.onbeforeunload = null), error: () => (window.onbeforeunload = null), }), - first() + first(), ); } @@ -588,9 +588,9 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError(() => of(false)), - first() - ) - ) + first(), + ), + ), ); } @@ -602,28 +602,28 @@ export class ApiService { `targets/${encodeURIComponent(target.connectUrl)}/probes/${encodeURIComponent(templateName)}`, { method: 'POST', - } + }, ).pipe( tap((resp) => { if (resp.status == 400) { this.notifications.warning( 'Failed to insert Probes', - 'The probes failed to be injected. Check that the agent is present in the same container as the target JVM and the target is running with -javaagent:/path/to/agent' + 'The probes failed to be injected. Check that the agent is present in the same container as the target JVM and the target is running with -javaagent:/path/to/agent', ); } }), map((resp) => resp.ok), catchError((_) => of(false)), - first() - ) - ) + first(), + ), + ), ); } addCustomProbeTemplate( file: File, onUploadProgress?: (progress: string | number) => void, - abortSignal?: Observable + abortSignal?: Observable, ): Observable { window.onbeforeunload = (event: BeforeUnloadEvent) => event.preventDefault(); @@ -645,7 +645,7 @@ export class ApiService { next: () => (window.onbeforeunload = null), error: () => (window.onbeforeunload = null), }), - first() + first(), ); } @@ -655,7 +655,7 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError(() => of(false)), - first() + first(), ); } @@ -676,12 +676,12 @@ export class ApiService { apiVersion: ApiVersion = 'v1', params?: URLSearchParams, suppressNotifications?: boolean, - skipStatusCheck?: boolean + skipStatusCheck?: boolean, ): Observable { return this.sendRequest(apiVersion, path, { method: 'GET' }, params, suppressNotifications, skipStatusCheck).pipe( map((resp) => resp.json()), concatMap(from), - first() + first(), ); } @@ -689,7 +689,7 @@ export class ApiService { return this.sendRequest('v2', 'probes', { method: 'GET' }).pipe( concatMap((resp) => resp.json()), map((response: ProbeTemplateResponse) => response.data.result), - first() + first(), ); } @@ -703,20 +703,20 @@ export class ApiService { method: 'GET', }, undefined, - suppressNotifications + suppressNotifications, ).pipe( concatMap((resp) => resp.json()), map((response: EventProbesResponse) => response.data.result), - first() - ) - ) + first(), + ), + ), ); } getActiveProbesForTarget( target: Target, suppressNotifications = false, - skipStatusCheck = false + skipStatusCheck = false, ): Observable { return this.sendRequest( 'v2', @@ -726,11 +726,11 @@ export class ApiService { }, undefined, suppressNotifications, - skipStatusCheck + skipStatusCheck, ).pipe( concatMap((resp) => resp.json()), map((response: EventProbesResponse) => response.data.result), - first() + first(), ); } @@ -738,7 +738,7 @@ export class ApiService { query: string, variables?: unknown, suppressNotifications?: boolean, - skipStatusCheck?: boolean + skipStatusCheck?: boolean, ): Observable { const headers = new Headers(); headers.set('Content-Type', 'application/json'); @@ -755,11 +755,11 @@ export class ApiService { }, undefined, suppressNotifications, - skipStatusCheck + skipStatusCheck, ).pipe( map((resp) => resp.json()), concatMap(from), - first() + first(), ); } @@ -776,7 +776,7 @@ export class ApiService { }) .pipe( concatMap((resp) => resp.json()), - map((response: AssetJwtResponse) => response.data.result.resourceUrl) + map((response: AssetJwtResponse) => response.data.result.resourceUrl), ) .subscribe((resourceUrl) => { this.downloadFile(resourceUrl, `${recording.name}.report.html`, false); @@ -796,13 +796,13 @@ export class ApiService { }) .pipe( concatMap((resp) => resp.json()), - map((response: AssetJwtResponse) => response.data.result.resourceUrl) + map((response: AssetJwtResponse) => response.data.result.resourceUrl), ) .subscribe((resourceUrl) => { this.downloadFile(resourceUrl, recording.name + (recording.name.endsWith('.jfr') ? '' : '.jfr')); this.downloadFile( createBlobURL(JSON.stringify(recording.metadata), 'application/json'), // Blob for metadata - recording.name.replace(/\.jfr$/, '') + '.metadata.json' + recording.name.replace(/\.jfr$/, '') + '.metadata.json', ); }); } @@ -815,9 +815,9 @@ export class ApiService { map( (target) => `${this.login.authority}/api/v2.1/targets/${encodeURIComponent( - target.connectUrl - )}/templates/${encodeURIComponent(template.name)}/type/${encodeURIComponent(template.type)}` - ) + target.connectUrl, + )}/templates/${encodeURIComponent(template.name)}/type/${encodeURIComponent(template.type)}`, + ), ) .subscribe((resource) => { const body = new window.FormData(); @@ -828,7 +828,7 @@ export class ApiService { }) .pipe( concatMap((resp) => resp.json()), - map((response: AssetJwtResponse) => response.data.result.resourceUrl) + map((response: AssetJwtResponse) => response.data.result.resourceUrl), ) .subscribe((resourceUrl) => { this.downloadFile(resourceUrl, `${template.name}.jfc`); @@ -840,7 +840,7 @@ export class ApiService { this.doGet('rules/' + name, 'v2') .pipe( first(), - map((resp) => resp.data.result) + map((resp) => resp.data.result), ) .subscribe((rule) => { const filename = `${rule.name}.json`; @@ -855,7 +855,7 @@ export class ApiService { file: File, labels: object, onUploadProgress?: (progress: number) => void, - abortSignal?: Observable + abortSignal?: Observable, ): Observable { window.onbeforeunload = (event: BeforeUnloadEvent) => event.preventDefault(); @@ -884,14 +884,14 @@ export class ApiService { next: () => (window.onbeforeunload = null), error: () => (window.onbeforeunload = null), }), - first() + first(), ); } uploadSSLCertificate( file: File, onUploadProgress?: (progress: number) => void, - abortSignal?: Observable + abortSignal?: Observable, ): Observable { window.onbeforeunload = (event: BeforeUnloadEvent) => event.preventDefault(); @@ -913,7 +913,7 @@ export class ApiService { next: () => (window.onbeforeunload = null), error: () => (window.onbeforeunload = null), }), - first() + first(), ); } @@ -939,10 +939,10 @@ export class ApiService { } } }`, - { connectUrl: target.connectUrl, recordingName, labels: this.stringifyRecordingLabels(labels) } - ) + { connectUrl: target.connectUrl, recordingName, labels: this.stringifyRecordingLabels(labels) }, + ), ), - map((v) => v.data.targetNodes[0].recordings.archived as ArchivedRecording[]) + map((v) => v.data.targetNodes[0].recordings.archived as ArchivedRecording[]), ); } @@ -960,7 +960,7 @@ export class ApiService { } } }`, - { connectUrl: UPLOADS_SUBDIRECTORY, recordingName, labels: this.stringifyRecordingLabels(labels) } + { connectUrl: UPLOADS_SUBDIRECTORY, recordingName, labels: this.stringifyRecordingLabels(labels) }, ).pipe(map((v) => v.data.archivedRecordings.data as ArchivedRecording[])); } @@ -986,10 +986,10 @@ export class ApiService { } } }`, - { connectUrl: target.connectUrl, recordingName, labels: this.stringifyRecordingLabels(labels) } - ) + { connectUrl: target.connectUrl, recordingName, labels: this.stringifyRecordingLabels(labels) }, + ), ), - map((v) => v.data.targetNodes[0].recordings.active as ActiveRecording[]) + map((v) => v.data.targetNodes[0].recordings.active as ActiveRecording[]), ); } @@ -1005,7 +1005,7 @@ export class ApiService { }).pipe( map((resp) => resp.ok), catchError((_) => of(false)), - first() + first(), ); } @@ -1015,7 +1015,7 @@ export class ApiService { }).pipe( concatMap((resp) => resp.json()), map((response: CredentialResponse) => response.data.result), - first() + first(), ); } @@ -1028,11 +1028,11 @@ export class ApiService { }, undefined, suppressNotifications, - skipStatusCheck + skipStatusCheck, ).pipe( concatMap((resp) => resp.json()), map((response: CredentialsResponse) => response.data.result), - first() + first(), ); } @@ -1041,7 +1041,7 @@ export class ApiService { method: 'DELETE', }).pipe( map((resp) => resp.ok), - first() + first(), ); } @@ -1054,11 +1054,11 @@ export class ApiService { }, undefined, suppressNotifications, - skipStatusCheck + skipStatusCheck, ).pipe( concatMap((resp) => resp.json()), map((response: RulesResponse) => response.data.result), - first() + first(), ); } @@ -1068,7 +1068,7 @@ export class ApiService { }).pipe( concatMap((resp) => resp.json()), map((body: DiscoveryResponse) => body.data.result), - first() + first(), ); } @@ -1091,11 +1091,11 @@ export class ApiService { }, undefined, true, - true + true, ).pipe( first(), concatMap((resp: Response) => resp.json()), - map((body): Target[] => body.data.result.targets || []) + map((body): Target[] => body.data.result.targets || []), ); } @@ -1103,7 +1103,7 @@ export class ApiService { return this.matchTargetsWithExpr(matchExpression, [target]).pipe( first(), map((ts) => includesTarget(ts, target)), - catchError((_) => of(false)) + catchError((_) => of(false)), ); } @@ -1129,17 +1129,17 @@ export class ApiService { { groupFilter: { id: group.id }, recordingFilter: filter, - } + }, ).pipe( first(), map((body) => body.data.environmentNodes[0].descendantTargets.reduce( (acc: Partial[], curr) => acc.concat(curr.recordings?.active?.data || []), - [] as Partial[] - ) + [] as Partial[], + ), ), catchError((_) => of([])), - map((recs: Partial[]) => recs.length > 0) // At least one + map((recs: Partial[]) => recs.length > 0), // At least one ); } @@ -1162,7 +1162,7 @@ export class ApiService { recordingFilter: filter, }, true, - true + true, ).pipe( map((resp) => { const nodes = resp.data.targetNodes; @@ -1172,13 +1172,13 @@ export class ApiService { const count = nodes[0].recordings.active.aggregate.count; return count > 0; }), - catchError((_) => of(false)) + catchError((_) => of(false)), ); } checkCredentialForTarget( target: Target, - credentials: { username: string; password: string } + credentials: { username: string; password: string }, ): Observable< | { error: Error; @@ -1196,7 +1196,7 @@ export class ApiService { { method: 'POST', body }, undefined, true, - true + true, ).pipe( first(), concatMap((resp) => resp.json()), @@ -1226,7 +1226,7 @@ export class ApiService { .then((detail) => ({ error: new Error(detail), severeLevel: ValidatedOptions.error })); } return of({ error: err, severeLevel: ValidatedOptions.error }); - }) + }), ); } @@ -1240,7 +1240,7 @@ export class ApiService { } } }`, - { connectUrl: target.connectUrl } + { connectUrl: target.connectUrl }, ).pipe( map((resp) => { const nodes = resp.data.targetNodes; @@ -1249,7 +1249,7 @@ export class ApiService { } return nodes[0]?.mbeanMetrics; }), - catchError((_) => of({})) + catchError((_) => of({})), ); } @@ -1272,7 +1272,7 @@ export class ApiService { }`, { connectUrl: target.connectUrl }, true, - true + true, ).pipe(map((v) => v.data.archivedRecordings.data as ArchivedRecording[])); } @@ -1282,7 +1282,7 @@ export class ApiService { 'v1', undefined, true, - true + true, ); } @@ -1292,7 +1292,7 @@ export class ApiService { 'v1', undefined, true, - true + true, ); } @@ -1302,7 +1302,7 @@ export class ApiService { 'v1', undefined, true, - true + true, ); } @@ -1345,7 +1345,7 @@ export class ApiService { config?: RequestInit, params?: URLSearchParams, suppressNotifications = false, - skipStatusCheck = false + skipStatusCheck = false, ): Observable { const req = () => this.login.getHeaders().pipe( @@ -1375,7 +1375,7 @@ export class ApiService { throw err; } return this.handleError(err, req, suppressNotifications); - }) + }), ); return req(); } @@ -1412,7 +1412,7 @@ export class ApiService { { method = 'GET', body, headers = {}, listeners, abortSignal }: XMLHttpRequestConfig, params?: URLSearchParams, suppressNotifications = false, - skipStatusCheck = false + skipStatusCheck = false, ): Observable { const req = () => this.login.getHeaders().pipe( @@ -1467,7 +1467,7 @@ export class ApiService { // Send request xhr.send(body); - }) + }), ); }), map((resp) => { @@ -1479,7 +1479,7 @@ export class ApiService { throw err; } return this.handleLegacyError(err, req, suppressNotifications); - }) + }), ); return req(); } @@ -1487,7 +1487,7 @@ export class ApiService { private handleLegacyError( error: Error, retry: () => Observable, - suppressNotifications = false + suppressNotifications = false, ): ObservableInput { if (isXMLHttpError(error)) { if (error.xmlHttpResponse.status === 427) { diff --git a/src/app/Shared/Services/Login.service.tsx b/src/app/Shared/Services/Login.service.tsx index 57909aa2c9..54c4ed0173 100644 --- a/src/app/Shared/Services/Login.service.tsx +++ b/src/app/Shared/Services/Login.service.tsx @@ -50,7 +50,7 @@ export class LoginService { constructor( private readonly target: TargetService, private readonly authCredentials: AuthCredentials, - private readonly settings: SettingsService + private readonly settings: SettingsService, ) { this.authority = process.env.CRYOSTAT_AUTHORITY || ''; this.token.next(this.getCacheItem(this.TOKEN_KEY)); @@ -112,7 +112,7 @@ export class LoginService { window.console.error(JSON.stringify(e, Object.getOwnPropertyNames(e))); this.authMethod.complete(); return of(false); - }) + }), ); } @@ -136,11 +136,11 @@ export class LoginService { this.getAuthMethod(), this.target.target().pipe( map((target) => target.connectUrl), - concatMap((connect) => this.authCredentials.getCredential(connect)) + concatMap((connect) => this.authCredentials.getCredential(connect)), ), ]).pipe( map((parts: [string, AuthMethod, Credential | undefined]) => this.getAuthHeaders(parts[0], parts[1], parts[2])), - first() + first(), ); } @@ -201,13 +201,13 @@ export class LoginService { this.resetSessionState(); this.resetAuthMethod(); this.navigateToLoginPage(); - }) + }), ); }), catchError((e: Error): ObservableInput => { window.console.error(JSON.stringify(e, Object.getOwnPropertyNames(e))); return of(false); - }) + }), ); } @@ -262,7 +262,7 @@ export class LoginService { form.submit(); return true; - }) + }), ); } diff --git a/src/app/Shared/Services/NotificationChannel.service.tsx b/src/app/Shared/Services/NotificationChannel.service.tsx index 9884747e1f..68f7d594e9 100644 --- a/src/app/Shared/Services/NotificationChannel.service.tsx +++ b/src/app/Shared/Services/NotificationChannel.service.tsx @@ -305,7 +305,10 @@ export class NotificationChannel { private readonly _messages = new Subject(); private readonly _ready = new BehaviorSubject({ ready: false }); - constructor(private readonly notifications: Notifications, private readonly login: LoginService) { + constructor( + private readonly notifications: Notifications, + private readonly login: LoginService, + ) { messageKeys.forEach((value, key) => { if (!value || !value.body || !value.variant) { return; @@ -347,7 +350,7 @@ export class NotificationChannel { const body: string = await resp.text(); throw new Error(resp.status + ' ' + body); } - }) + }), ); combineLatest([ diff --git a/src/app/Shared/Services/Report.service.tsx b/src/app/Shared/Services/Report.service.tsx index 25c21135af..463ccc3c44 100644 --- a/src/app/Shared/Services/Report.service.tsx +++ b/src/app/Shared/Services/Report.service.tsx @@ -22,7 +22,10 @@ import { isActiveRecording, RecordingState, Recording } from './Api.service'; import { LoginService } from './Login.service'; export class ReportService { - constructor(private login: LoginService, private notifications: Notifications) {} + constructor( + private login: LoginService, + private notifications: Notifications, + ) {} report(recording: Recording): Observable { if (!recording.reportUrl) { @@ -39,7 +42,7 @@ export class ReportService { mode: 'cors', credentials: 'include', headers, - }) + }), ), concatMap((resp) => { if (resp.ok) { @@ -83,7 +86,7 @@ export class ReportService { this.notifications.danger(err.name, err.message); } }, - }) + }), ); } @@ -107,7 +110,7 @@ export class ReportService { resp .text() .then(JSON.parse) - .then((obj) => Object.values(obj) as RuleEvaluation[]) + .then((obj) => Object.values(obj) as RuleEvaluation[]), ); } else { const ge: GenerationError = { @@ -147,7 +150,7 @@ export class ReportService { this.notifications.danger(err.name, err.message); } }, - }) + }), ); } diff --git a/src/app/Shared/Services/Settings.service.tsx b/src/app/Shared/Services/Settings.service.tsx index 2ae7169f73..b8d3997d53 100644 --- a/src/app/Shared/Services/Settings.service.tsx +++ b/src/app/Shared/Services/Settings.service.tsx @@ -36,7 +36,7 @@ export enum FeatureLevel { } export const automatedAnalysisConfigToRecordingAttributes = ( - config: AutomatedAnalysisRecordingConfig + config: AutomatedAnalysisRecordingConfig, ): RecordingAttributes => { return { name: automatedAnalysisRecordingName, @@ -57,15 +57,15 @@ export const automatedAnalysisConfigToRecordingAttributes = ( }; export class SettingsService { private readonly _featureLevel$ = new BehaviorSubject( - getFromLocalStorage('FEATURE_LEVEL', FeatureLevel.PRODUCTION) + getFromLocalStorage('FEATURE_LEVEL', FeatureLevel.PRODUCTION), ); private readonly _visibleNotificationsCount$ = new BehaviorSubject( - getFromLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', 5) + getFromLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', 5), ); private readonly _datetimeFormat$ = new BehaviorSubject( - getFromLocalStorage('DATETIME_FORMAT', defaultDatetimeFormat) + getFromLocalStorage('DATETIME_FORMAT', defaultDatetimeFormat), ); private readonly _theme$ = new BehaviorSubject(getFromLocalStorage('THEME', ThemeSetting.AUTO)); @@ -73,7 +73,7 @@ export class SettingsService { constructor() { this._featureLevel$.subscribe((featureLevel: FeatureLevel) => saveToLocalStorage('FEATURE_LEVEL', featureLevel)); this._visibleNotificationsCount$.subscribe((count: number) => - saveToLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', count) + saveToLocalStorage('VISIBLE_NOTIFICATIONS_COUNT', count), ); this._datetimeFormat$.subscribe((format: DatetimeFormat) => saveToLocalStorage('DATETIME_FORMAT', format)); this._theme$.subscribe((theme: ThemeSetting) => saveToLocalStorage('THEME', theme)); @@ -133,7 +133,7 @@ export class SettingsService { } automatedAnalysisRecordingConfig( - defaultConfig = defaultAutomatedAnalysisRecordingConfig + defaultConfig = defaultAutomatedAnalysisRecordingConfig, ): AutomatedAnalysisRecordingConfig { return getFromLocalStorage('AUTOMATED_ANALYSIS_RECORDING_CONFIG', defaultConfig); } diff --git a/src/app/Shared/Services/Targets.service.tsx b/src/app/Shared/Services/Targets.service.tsx index 20cf7dad54..5ce661d930 100644 --- a/src/app/Shared/Services/Targets.service.tsx +++ b/src/app/Shared/Services/Targets.service.tsx @@ -35,7 +35,7 @@ export class TargetsService { private readonly api: ApiService, private readonly notifications: Notifications, login: LoginService, - notificationChannel: NotificationChannel + notificationChannel: NotificationChannel, ) { login .getSessionState() @@ -75,7 +75,7 @@ export class TargetsService { catchError((err) => { this.notifications.danger('Target List Update Failed', JSON.stringify(err)); return of(undefined); - }) + }), ); } diff --git a/src/app/Shared/TargetSelect.tsx b/src/app/Shared/TargetSelect.tsx index 76bc0b0f0d..a22f6b1fac 100644 --- a/src/app/Shared/TargetSelect.tsx +++ b/src/app/Shared/TargetSelect.tsx @@ -62,7 +62,7 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. context.targets.queryForTargets().subscribe(() => { // Reset loading and context.targets.targets will emit setLoading(false); - }) + }), ); }, [addSubscription, context.targets, setLoading]); @@ -73,7 +73,7 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. onSelect && onSelect(toSelect); setSelected(toSelect); }, - [setDropdownOpen, onSelect, setSelected] + [setDropdownOpen, onSelect, setSelected], ); React.useEffect(() => { @@ -86,7 +86,7 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. } const id = window.setInterval( () => _refreshTargetList(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, _refreshTargetList]); @@ -124,7 +124,7 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. ))} )) - .sort((a, b) => `${a.props['label']}`.localeCompare(`${b.props['label']}`)) + .sort((a, b) => `${a.props['label']}`.localeCompare(`${b.props['label']}`)), ); return options; }, [targets]); @@ -140,13 +140,13 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. .map((grp) => React.cloneElement(grp, { children: grp.props.children.filter( - (option) => matchExp.test(option.props.value.connectUrl) || matchExp.test(option.props.value.alias) + (option) => matchExp.test(option.props.value.connectUrl) || matchExp.test(option.props.value.alias), ), - }) + }), ) .filter((grp) => grp.props.children.length > 0); }, - [selectOptions] + [selectOptions], ); const cardHeaderProps = React.useMemo( @@ -162,7 +162,7 @@ export const TargetSelect: React.FC = ({ onSelect, simple, .. 'aria-expanded': isExpanded, }, }, - [simple, onExpand, isExpanded] + [simple, onExpand, isExpanded], ); return ( diff --git a/src/app/TargetView/TargetContextSelector.tsx b/src/app/TargetView/TargetContextSelector.tsx index 711e733bf7..7265c705f4 100644 --- a/src/app/TargetView/TargetContextSelector.tsx +++ b/src/app/TargetView/TargetContextSelector.tsx @@ -42,7 +42,7 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN context.target.setTarget(toSelect); } }, - [setIsTargetOpen, selectedTarget, context.target] + [setIsTargetOpen, selectedTarget, context.target], ); React.useEffect(() => { @@ -54,7 +54,7 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN // NO_TARGET will clear storage saveToLocalStorage('TARGET', target.connectUrl); } - }) + }), ); }, [addSubscription, context.target, setSelectedTarget]); @@ -89,7 +89,7 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN } const id = window.setInterval( () => refreshTargetList(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, refreshTargetList]); @@ -173,11 +173,11 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN const { target } = option.props.value; return matchExp.test(target.connectUrl) || matchExp.test(target.alias); }), - }) + }), ) .filter((grp) => grp.props.children.length > 0); }, - [selectOptions, noOptions] + [selectOptions, noOptions], ); const handleFavorite = React.useCallback( @@ -188,12 +188,12 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN return toUpdate; }); }, - [setFavorites] + [setFavorites], ); const selectionPrefix = React.useMemo( () => (selectedTarget !== NO_TARGET ? Target: : undefined), - [selectedTarget] + [selectedTarget], ); const selectFooter = React.useMemo( @@ -202,7 +202,7 @@ export const TargetContextSelector: React.FC<{ className?: string }> = ({ classN ), - [] + [], ); return ( diff --git a/src/app/TargetView/TargetView.tsx b/src/app/TargetView/TargetView.tsx index 7475dccc76..cbe1bcf719 100644 --- a/src/app/TargetView/TargetView.tsx +++ b/src/app/TargetView/TargetView.tsx @@ -40,9 +40,9 @@ export const TargetView: React.FC = (props) => { .target() .pipe( map((target) => target !== NO_TARGET), - distinctUntilChanged() + distinctUntilChanged(), ) - .subscribe(setHasSelection) + .subscribe(setHasSelection), ); }, [context.target, addSubscription, setHasSelection]); diff --git a/src/app/Topology/Actions/CreateTarget.tsx b/src/app/Topology/Actions/CreateTarget.tsx index 3e4633958b..67b80a82a8 100644 --- a/src/app/Topology/Actions/CreateTarget.tsx +++ b/src/app/Topology/Actions/CreateTarget.tsx @@ -103,8 +103,8 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props spinnerAriaValueText: 'Creating', spinnerAriaLabel: 'creating-custom-target', isLoading: loading, - } as LoadingPropsType), - [loading] + }) as LoadingPropsType, + [loading], ); const toggleCredentialForm = React.useCallback( @@ -117,12 +117,12 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props return [...old, toggleId]; } }), - [setExpandedSections] + [setExpandedSections], ); const resetTestState = React.useCallback( () => setValidation({ option: ValidatedOptions.default, errorMessage: '' }), - [setValidation] + [setValidation], ); const handleConnectUrlChange = React.useCallback( @@ -139,7 +139,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props })); resetTestState(); }, - [setFormData, resetTestState] + [setFormData, resetTestState], ); const handleAliasChange = React.useCallback( @@ -147,7 +147,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props setFormData((old) => ({ ...old, alias })); resetTestState(); }, - [setFormData, resetTestState] + [setFormData, resetTestState], ); const handleUsernameChange = React.useCallback( @@ -155,7 +155,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props setFormData((old) => ({ ...old, username })); resetTestState(); }, - [setFormData, resetTestState] + [setFormData, resetTestState], ); const handlePasswordChange = React.useCallback( @@ -163,7 +163,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props setFormData((old) => ({ ...old, password })); resetTestState(); }, - [setFormData, resetTestState] + [setFormData, resetTestState], ); const handleSubmit = React.useCallback(() => { @@ -178,7 +178,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props alias: alias.trim() || connectUrl, }, credentials, - locationKey === Locations.BACKEND.key + locationKey === Locations.BACKEND.key, ) .subscribe(({ status, body }) => { setLoading(false); @@ -191,7 +191,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props errorMessage: body['data']['reason'], }); } - }) + }), ); }, [setLoading, setValidation, addSubscription, context.api, connectUrl, alias, history, credentials]); @@ -208,7 +208,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props }, credentials, false, - true + true, ) .subscribe(({ status, body }) => { setTesting(false); @@ -217,7 +217,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props option: option, errorMessage: option !== ValidatedOptions.success ? body['data']['reason'] : '', }); - }) + }), ); setTesting(true); resetTestState(); @@ -245,7 +245,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props if (discoveredTargets.length) { setExample(discoveredTargets[0].connectUrl); } - }) + }), ); }, [addSubscription, context.targets, setExample]); @@ -266,7 +266,7 @@ export const CreateTarget: React.FC = ({ prefilled, ..._props sm: 12 as gridSpans, } as Record<'xl2' | 'xl' | 'lg' | 'md' | 'sm', gridSpans>, ], - [] + [], ); return ( @@ -445,7 +445,7 @@ export const SampleNodeDonut: React.FC = ({ }) => { const _transformedTarget = React.useMemo( () => ({ connectUrl: target.connectUrl, alias: target.alias.trim() || target.connectUrl }), - [target] + [target], ); const _actionEnabled = React.useMemo(() => isValidTargetConnectURL(target.connectUrl), [target]); @@ -499,7 +499,7 @@ export const SampleNodeDonut: React.FC = ({
{testing ? : Cryostat Logo} diff --git a/src/app/Topology/Actions/NodeActions.tsx b/src/app/Topology/Actions/NodeActions.tsx index 952008cecb..847dff5691 100644 --- a/src/app/Topology/Actions/NodeActions.tsx +++ b/src/app/Topology/Actions/NodeActions.tsx @@ -69,7 +69,7 @@ export const ContextMenuItem: React.FC = ({ e.stopPropagation(); onClick && onClick(element, { history, services, notifications }); }, - [onClick, history, services, notifications, element] + [onClick, history, services, notifications, element], ); React.useEffect(() => { @@ -80,9 +80,9 @@ export const ContextMenuItem: React.FC = ({ switchMap((element) => { setDisabled(true); return isDisabled(element, { services, notifications, history }); - }) + }), ) - .subscribe(setDisabled) + .subscribe(setDisabled), ); } }, [addSubscription, elementSubj, isDisabled, setDisabled, services, notifications, history]); @@ -142,13 +142,13 @@ const isQuickRecordingExist = (group: EnvironmentNode, { services }: ActionUtils services.api.groupHasRecording(group, { name: QUICK_RECORDING_NAME }), services.notificationChannel.messages(NotificationCategory.ActiveRecordingCreated).pipe( filter(filterFn), - map((_) => true) + map((_) => true), ), services.notificationChannel.messages(NotificationCategory.ActiveRecordingDeleted).pipe( filter(filterFn), debounceTime(500), - map((_) => services.api.groupHasRecording(group, { name: QUICK_RECORDING_NAME })) - ) + map((_) => services.api.groupHasRecording(group, { name: QUICK_RECORDING_NAME })), + ), ); }; @@ -257,7 +257,7 @@ export const nodeActions: NodeAction[] = [ ]), }, false, - true + true, ) .subscribe((body) => { notifyGroupActionErrors('GROUP_START_RECORDING', group, body, notifications); @@ -296,7 +296,7 @@ export const nodeActions: NodeAction[] = [ recordingFilter: { name: QUICK_RECORDING_NAME }, }, false, - true + true, ) .subscribe((body) => { notifyGroupActionErrors('GROUP_ARCHIVE_RECORDING', group, body, notifications); @@ -339,7 +339,7 @@ export const nodeActions: NodeAction[] = [ recordingFilter: { name: QUICK_RECORDING_NAME }, }, false, - true + true, ) .subscribe((body) => { notifyGroupActionErrors('GROUP_STOP_RECORDING', group, body, notifications); @@ -383,7 +383,7 @@ export const nodeActions: NodeAction[] = [ recordingFilter: { name: QUICK_RECORDING_NAME }, }, false, - true + true, ) .subscribe((body) => { notifyGroupActionErrors('GROUP_DELETE_RECORDING', group, body, notifications); @@ -414,7 +414,7 @@ export const notifyGroupActionErrors = ( >, group: EnvironmentNode, { errors, data }: GroupActionResponse, - notifications: Notifications + notifications: Notifications, ): void => { if (errors) { const actionVerb = type diff --git a/src/app/Topology/Actions/QuickSearchPanel.tsx b/src/app/Topology/Actions/QuickSearchPanel.tsx index 11e022d65b..39a816d41f 100644 --- a/src/app/Topology/Actions/QuickSearchPanel.tsx +++ b/src/app/Topology/Actions/QuickSearchPanel.tsx @@ -123,14 +123,14 @@ export const QuickSearchPanel: React.FC = ({ ...props }) const handleTabChange = React.useCallback( (_, eventKey: string | number) => setActiveTab(`${eventKey}`), - [setActiveTab] + [setActiveTab], ); const handleSearch = React.useCallback( (input: string) => { setSearchText(input); }, - [setSearchText] + [setSearchText], ); const filteredQuicksearches = React.useMemo(() => { @@ -294,7 +294,7 @@ export const QuickSearchFlyoutMenu: React.FC = ({ is const filteredQuicksearches = React.useMemo( () => quickSearches.filter((qs) => activeLevel <= qs.featureLevel), - [activeLevel] + [activeLevel], ); const items = React.useMemo(() => { diff --git a/src/app/Topology/GraphView/CustomGroup.tsx b/src/app/Topology/GraphView/CustomGroup.tsx index fc7842f8bf..9103e40fba 100644 --- a/src/app/Topology/GraphView/CustomGroup.tsx +++ b/src/app/Topology/GraphView/CustomGroup.tsx @@ -74,7 +74,7 @@ const CustomGroup: React.FC = ({ const collapsedContent = React.useMemo( () => {renderIcon(collapsedWidth, collapsedHeight)}, - [collapsedWidth, collapsedHeight] + [collapsedWidth, collapsedHeight], ); React.useEffect(() => { @@ -104,7 +104,7 @@ const CustomGroup: React.FC = ({ contextMenuOpen: contextMenuOpen, onContextMenu: onContextMenu, } as React.ComponentProps, - element.isCollapsed() ? collapsedContent : null + element.isCollapsed() ? collapsedContent : null, )} ); diff --git a/src/app/Topology/GraphView/CustomNode.tsx b/src/app/Topology/GraphView/CustomNode.tsx index 8f02f1e5b8..f9144f007f 100644 --- a/src/app/Topology/GraphView/CustomNode.tsx +++ b/src/app/Topology/GraphView/CustomNode.tsx @@ -111,7 +111,7 @@ const CustomNode: React.FC = ({ addSubscription( matchedTargetSvc .pipe(map((ts) => (ts ? includesTarget(ts, data.target) : graphId === TOPOLOGY_GRAPH_ID))) - .subscribe(setMatched) + .subscribe(setMatched), ); }, [graphId, addSubscription, setMatched, matchedTargetSvc, data.target]); diff --git a/src/app/Topology/GraphView/NodeDecorator.tsx b/src/app/Topology/GraphView/NodeDecorator.tsx index f76e0b52a1..b945ae68c0 100644 --- a/src/app/Topology/GraphView/NodeDecorator.tsx +++ b/src/app/Topology/GraphView/NodeDecorator.tsx @@ -51,7 +51,7 @@ export const ActiveRecordingDecorator: React.FC = ({ element, qu const runningRecs = React.useMemo( () => recordings.filter((rec) => rec.state === RecordingState.RUNNING), - [recordings] + [recordings], ); const iconConfig = React.useMemo(() => { diff --git a/src/app/Topology/GraphView/TopologyGraphView.tsx b/src/app/Topology/GraphView/TopologyGraphView.tsx index 66a18a7839..d93c4bbf1f 100644 --- a/src/app/Topology/GraphView/TopologyGraphView.tsx +++ b/src/app/Topology/GraphView/TopologyGraphView.tsx @@ -92,14 +92,14 @@ export const TopologyGraphView: React.FC = ({ transformC const discoveryTree = React.useContext(DiscoveryTreeContext); const _transformData = React.useMemo( () => transformData(discoveryTree, transformConfig, filters), - [discoveryTree, transformConfig, filters] + [discoveryTree, transformConfig, filters], ); const exceedLimit = React.useMemo(() => _transformData.nodes.length > MAX_NODE_LIMIT, [_transformData]); const isEmptyGraph = React.useMemo( () => !_transformData.nodes.some((node) => node.type === 'node'), - [_transformData] + [_transformData], ); const _createVisualization = React.useCallback(() => { @@ -132,7 +132,7 @@ export const TopologyGraphView: React.FC = ({ transformC }; saveToLocalStorage('TOPOLOGY_GRAPH_POSITONS', saved); } - }, 200) + }, 200), ); _newVisualization.addEventListener( @@ -148,7 +148,7 @@ export const TopologyGraphView: React.FC = ({ transformC })); saveToLocalStorage('TOPOLOGY_NODE_POSITIONS', savedPos); } - }, 200) + }, 200), ); return _newVisualization; }, [setSelectedIds, setSelectedEntity]); @@ -225,7 +225,7 @@ export const TopologyGraphView: React.FC = ({ transformC // Visualize surface needs time to intialize. // Workaround: find drawer body which is already ready and tightly wraps the surface. const container: HTMLElement | null = document.querySelector( - '#topology__visualization-container .pf-c-drawer__content' + '#topology__visualization-container .pf-c-drawer__content', ); if (container) { container.addEventListener('contextmenu', showMenu); @@ -240,7 +240,7 @@ export const TopologyGraphView: React.FC = ({ transformC ), - [handleDrawerClose, selectedEntity] + [handleDrawerClose, selectedEntity], ); return ( diff --git a/src/app/Topology/GraphView/UtilsFactory.tsx b/src/app/Topology/GraphView/UtilsFactory.tsx index cb4bbadd71..0ca62c9ea6 100644 --- a/src/app/Topology/GraphView/UtilsFactory.tsx +++ b/src/app/Topology/GraphView/UtilsFactory.tsx @@ -73,7 +73,7 @@ export const RESOURCE_NAME_TRUNCATE_LENGTH = 20; const _buildFullNodeModel = ( node: EnvironmentNode | TargetNode, expandMode = true, - filters?: TopologyFilters + filters?: TopologyFilters, ): NodeModel[] => { if (isTargetNode(node)) { if (!isTargetNodeFiltered(node, filters?.targetFilters.filters)) { @@ -212,7 +212,7 @@ export const _transformDataFull = (root: EnvironmentNode, expandMode = true, fil export const transformData = ( universe: EnvironmentNode, { showOnlyTopGroup = false, expandMode = true }: TransformConfig = {}, - filters?: TopologyFilters + filters?: TopologyFilters, ): { nodes: NodeModel[]; edges: EdgeModel[]; @@ -245,8 +245,8 @@ export const componentFactory: ComponentFactory = (kind: ModelKind, type: string case 'group': return withContextMenu(actionFactory)( withDragNode(nodeDragSourceSpec('group', false, false))( - withSelection({ multiSelect: false, controlled: true })(CustomGroup) - ) + withSelection({ multiSelect: false, controlled: true })(CustomGroup), + ), ); default: switch (kind) { @@ -255,8 +255,8 @@ export const componentFactory: ComponentFactory = (kind: ModelKind, type: string case ModelKind.node: return withContextMenu(actionFactory)( withDragNode(nodeDragSourceSpec('node', false, false))( - withSelection({ multiSelect: false, controlled: true })(CustomNode) - ) + withSelection({ multiSelect: false, controlled: true })(CustomNode), + ), ); case ModelKind.edge: return DefaultEdge; @@ -304,7 +304,7 @@ export const ensureGraphVisible = (visualization: Visualization) => { } return [closestNode, closestDistance]; }, - [nodes[0], nodeDistanceToBounds(nodes[0], graphBounds)] + [nodes[0], nodeDistanceToBounds(nodes[0], graphBounds)], ); graph.panIntoView(toPanNode); diff --git a/src/app/Topology/ListView/TopologyListView.tsx b/src/app/Topology/ListView/TopologyListView.tsx index debf00dbd6..5d1f034cdb 100644 --- a/src/app/Topology/ListView/TopologyListView.tsx +++ b/src/app/Topology/ListView/TopologyListView.tsx @@ -45,7 +45,7 @@ export const TopologyListView: React.FC = ({ transformCon const _treeViewData: TreeViewDataItem[] = React.useMemo( () => transformData(discoveryTree, transformConfig, filters, matchedTargets), - [discoveryTree, transformConfig, filters, matchedTargets] + [discoveryTree, transformConfig, filters, matchedTargets], ); const isEmptyList = React.useMemo(() => !_treeViewData.length, [_treeViewData]); @@ -55,10 +55,10 @@ export const TopologyListView: React.FC = ({ transformCon combineLatest([matchExprService.searchExpression(), tSubject.asObservable()]) .pipe( switchMap(([input, ts]) => - input ? svcContext.api.matchTargetsWithExpr(input, ts).pipe(catchError((_) => of([]))) : of(undefined) - ) + input ? svcContext.api.matchTargetsWithExpr(input, ts).pipe(catchError((_) => of([]))) : of(undefined), + ), ) - .subscribe(setMatchedTargets) + .subscribe(setMatchedTargets), ); }, [svcContext.api, matchExprService, tSubject, addSubscription, setMatchedTargets]); diff --git a/src/app/Topology/ListView/UtilsFactory.tsx b/src/app/Topology/ListView/UtilsFactory.tsx index 62588cfbe4..31cee8ddd9 100644 --- a/src/app/Topology/ListView/UtilsFactory.tsx +++ b/src/app/Topology/ListView/UtilsFactory.tsx @@ -34,7 +34,7 @@ import { EnvironmentNode, isTargetNode, NodeType, TargetNode } from '../typings' const _transformDataGroupedByTopLevel = ( universe: EnvironmentNode, filters?: TopologyFilters, - includeOnlyTargets?: Target[] + includeOnlyTargets?: Target[], ): TreeViewDataItem[] => { return universe.children .filter((realm: EnvironmentNode) => isGroupNodeFiltered(realm, filters?.groupFilters.filters)) @@ -56,7 +56,7 @@ const _transformDataGroupedByTopLevel = ( .filter( (child: TargetNode) => isTargetNodeFiltered(child, filters?.targetFilters.filters) && - (!includeOnlyTargets || includesTarget(includeOnlyTargets, child.target)) + (!includeOnlyTargets || includesTarget(includeOnlyTargets, child.target)), ) .map((child: TargetNode) => ({ id: `${child.name}-wrapper`, @@ -109,7 +109,7 @@ const _buildFullData = ( node: EnvironmentNode | TargetNode, expandMode = true, filters?: TopologyFilters, - includeOnlyTargets?: Target[] + includeOnlyTargets?: Target[], ): TreeViewDataItem[] => { if (isTargetNode(node)) { if ( @@ -149,7 +149,7 @@ const _buildFullData = ( const INIT: TreeViewDataItem[] = []; const children = node.children.reduce( (prev, curr) => prev.concat(_buildFullData(curr, expandMode, filters, includeOnlyTargets)), - INIT + INIT, ); // Do show empty or filtered-out groups @@ -204,7 +204,7 @@ const _transformDataFull = ( root: EnvironmentNode, expandMode = true, filters?: TopologyFilters, - includeOnlyTargets?: Target[] + includeOnlyTargets?: Target[], ): TreeViewDataItem[] => { const _transformedRoot = _buildFullData(root, expandMode, filters, includeOnlyTargets)[0]; return _transformedRoot && _transformedRoot.children ? _transformedRoot.children : []; @@ -214,7 +214,7 @@ export const transformData = ( universe: EnvironmentNode, { showOnlyTopGroup = false, expandMode = true }: TransformConfig = {}, filters?: TopologyFilters, - includeOnlyTargets?: Target[] + includeOnlyTargets?: Target[], ): TreeViewDataItem[] => { return showOnlyTopGroup ? _transformDataGroupedByTopLevel(universe, filters, includeOnlyTargets) diff --git a/src/app/Topology/Shared/Entity/EntityDetails.tsx b/src/app/Topology/Shared/Entity/EntityDetails.tsx index b87fd4a1b7..a311911da4 100644 --- a/src/app/Topology/Shared/Entity/EntityDetails.tsx +++ b/src/app/Topology/Shared/Entity/EntityDetails.tsx @@ -175,7 +175,7 @@ export const TargetDetails: React.FC<{ helperDescription: constructHelperDescription( 'Connection Nickname (same as Connection URL if not specified).', 'Target', - ['alias'] + ['alias'], ), content: serviceRef.alias, }, @@ -211,7 +211,7 @@ export const TargetDetails: React.FC<{ helperDescription: constructHelperDescription( 'Map of string keys and values that can be used to organize and categorize targets.', 'Target', - ['labels'] + ['labels'], ), content: , }, @@ -222,7 +222,7 @@ export const TargetDetails: React.FC<{ helperDescription: constructHelperDescription( 'Annotations is an unstructured key value map stored with a target that may be set by external tools.', 'Target', - ['annotations'] + ['annotations'], ), content: , }, @@ -279,13 +279,13 @@ const MBeanDetails: React.FC<{ } } }`, - { connectUrl } + { connectUrl }, ) .pipe( map((resp) => resp.data.targetNodes[0].mbeanMetrics || {}), - catchError((_) => of({})) + catchError((_) => of({})), ) - .subscribe(setMbeanMetrics) + .subscribe(setMbeanMetrics), ); } }, [isExpanded, addSubscription, connectUrl, context.api, setMbeanMetrics]); @@ -299,7 +299,9 @@ const MBeanDetails: React.FC<{ helperDescription: 'The time when this JVM process started.', content: (mbeanMetrics?.runtime?.startTime || 0) > 0 ? ( - dayjs(mbeanMetrics?.runtime?.startTime).tz(dateTimeFormat.timeZone.full).format('LLLL') + dayjs(mbeanMetrics?.runtime?.startTime) + .tz(dateTimeFormat.timeZone.full) + .format('LLLL') ) : ( ), @@ -388,9 +390,9 @@ export const TargetResources: React.FC<{ targetNode: TargetNode }> = ({ targetNo .doGet(`targets/${encodeURIComponent(target.connectUrl)}/probes`, 'v2', undefined, true, true) .pipe( concatMap(() => of(true)), - catchError(() => of(false)) + catchError(() => of(false)), ) - .subscribe(setAgentDetected) + .subscribe(setAgentDetected), ); }, [addSubscription, context.api, setAgentDetected, target]); @@ -409,7 +411,7 @@ export const TargetResources: React.FC<{ targetNode: TargetNode }> = ({ targetNo rowData: TargetRelatedResourceTypeAsArray, }, ], - [agentDetected] + [agentDetected], ); return ( @@ -455,7 +457,7 @@ export const TargetResourceItem: React.FC<{ const switchTarget = React.useCallback( () => services.target.setTarget(targetNode.target), - [targetNode.target, services.target] + [targetNode.target, services.target], ); const ExpandedComponent = React.useMemo(() => { diff --git a/src/app/Topology/Shared/Entity/utils.tsx b/src/app/Topology/Shared/Entity/utils.tsx index 7a9752bd3e..02183e7e87 100644 --- a/src/app/Topology/Shared/Entity/utils.tsx +++ b/src/app/Topology/Shared/Entity/utils.tsx @@ -103,7 +103,7 @@ export const isOwnedResource = (resourceType: TargetOwnedResourceType | TargetRe export const getTargetOwnedResources = ( resourceType: TargetOwnedResourceType | TargetRelatedResourceType, { target }: TargetNode, - apiService: ApiService + apiService: ApiService, ): Observable => { switch (resourceType) { case 'activeRecordings': @@ -120,25 +120,25 @@ export const getTargetOwnedResources = ( return apiService.getRules(true, true).pipe( concatMap((rules) => { const tasks = rules.map((r) => - apiService.isTargetMatched(r.matchExpression, target).pipe(map((ok) => (ok ? [r] : []))) + apiService.isTargetMatched(r.matchExpression, target).pipe(map((ok) => (ok ? [r] : []))), ); return forkJoin(tasks).pipe( defaultIfEmpty([[] as Rule[]]), - map((rules) => rules.reduce((prev, curr) => prev.concat(curr))) + map((rules) => rules.reduce((prev, curr) => prev.concat(curr))), ); - }) + }), ); case 'credentials': return apiService.getCredentials(true, true).pipe( concatMap((credentials) => { const tasks = credentials.map((crd) => - apiService.isTargetMatched(crd.matchExpression, target).pipe(map((ok) => (ok ? [crd] : []))) + apiService.isTargetMatched(crd.matchExpression, target).pipe(map((ok) => (ok ? [crd] : []))), ); return forkJoin(tasks).pipe( defaultIfEmpty([[] as StoredCredential[]]), - map((credentials) => credentials.reduce((prev, curr) => prev.concat(curr))) + map((credentials) => credentials.reduce((prev, curr) => prev.concat(curr))), ); - }) + }), ); default: throw new Error(`Unsupported resource: ${resourceType}`); @@ -194,13 +194,13 @@ export const getResourceRemovedEvents = (resourceType: TargetOwnedResourceType | export type PatchFn = ( arr: ResourceTypes[], eventData: NotificationMessage, - removed?: boolean + removed?: boolean, ) => Observable; export const getResourceListPatchFn = ( resourceType: TargetOwnedResourceType | TargetRelatedResourceType, { target }: TargetNode, - apiService: ApiService + apiService: ApiService, ): PatchFn => { switch (resourceType) { case 'activeRecordings': @@ -246,7 +246,7 @@ export const getResourceListPatchFn = ( return newArr; } return arr; - }) + }), ); }; case 'credentials': @@ -263,7 +263,7 @@ export const getResourceListPatchFn = ( return newArr; } return arr; - }) + }), ); }; default: @@ -273,7 +273,7 @@ export const getResourceListPatchFn = ( // TODO: Revisit when updating to react-router v6 export const getLinkPropsForTargetResource = ( - resourceType: TargetOwnedResourceType | TargetRelatedResourceType + resourceType: TargetOwnedResourceType | TargetRelatedResourceType, ): React.ComponentProps => { switch (resourceType) { case 'activeRecordings': @@ -311,7 +311,7 @@ export const ActiveRecDetail: React.FC<{ resources: ActiveRecording[] }> = ({ re items: resources.filter((rec) => rec.state === RecordingState.STOPPED), }, ], - [resources] + [resources], ); return ( @@ -348,7 +348,7 @@ export const Nothing: React.FC<{ resources: ResourceTypes[] }> = () => { }; export const getExpandedResourceDetails = ( - resourceType: TargetOwnedResourceType | TargetRelatedResourceType + resourceType: TargetOwnedResourceType | TargetRelatedResourceType, ): React.FC<{ resources: ResourceTypes[] }> => { switch (resourceType) { case 'activeRecordings': @@ -364,7 +364,7 @@ export const getConnectUrlFromEvent = (event: NotificationMessage): string | und export const useResources = ( targetNode: TargetNode, - resourceType: TargetOwnedResourceType | TargetRelatedResourceType + resourceType: TargetOwnedResourceType | TargetRelatedResourceType, ): { resources: R[]; error?: Error; loading?: boolean } => { const { api, notificationChannel, settings } = React.useContext(ServiceContext); const addSubscription = useSubscriptions(); @@ -390,23 +390,23 @@ export const useResources = ( of({ resources: [], error: err, - }) - ) + }), + ), ); if (!settings.autoRefreshEnabled()) { return resourceObs; } return merge( resourceObs, - interval(settings.autoRefreshPeriod() * settings.autoRefreshUnits()).pipe(concatMap(() => resourceObs)) + interval(settings.autoRefreshPeriod() * settings.autoRefreshUnits()).pipe(concatMap(() => resourceObs)), ); - }) + }), ) .subscribe(({ resources, error }) => { setLoading(false); setError(error); setResources(resources); - }) + }), ); }, [addSubscription, setLoading, setError, setResources, api, settings, targetSubject, resourceType]); @@ -426,8 +426,8 @@ export const useResources = ( targetSubject .pipe( switchMap((tn) => - combineLatest([of(tn), merge(...categories.map((cat) => notificationChannel.messages(cat)))]) - ) + combineLatest([of(tn), merge(...categories.map((cat) => notificationChannel.messages(cat)))]), + ), ) .subscribe(([targetNode, event]) => { const extractedUrl = getConnectUrlFromEvent(event); @@ -448,12 +448,12 @@ export const useResources = ( setLoading(false); setError(error); }, - }) + }), ); return old; }); } - }) + }), ); }); }, [addSubscription, setLoading, api, targetSubject, resourceType, notificationChannel, setResources, setError]); diff --git a/src/app/Topology/Shared/utils.tsx b/src/app/Topology/Shared/utils.tsx index 9274600e9d..7f3c39ad61 100644 --- a/src/app/Topology/Shared/utils.tsx +++ b/src/app/Topology/Shared/utils.tsx @@ -42,7 +42,7 @@ export const getAllLeaves = (root: EnvironmentNode | TargetNode): TargetNode[] = export const flattenTree = ( node: EnvironmentNode | TargetNode, - includeUniverse?: boolean + includeUniverse?: boolean, ): (EnvironmentNode | TargetNode)[] => { if (isTargetNode(node)) { return [node]; @@ -114,7 +114,7 @@ export const getStatusTargetNode = (node: TargetNode | EnvironmentNode): [NodeSt export const actionFactory = ( element: GraphElement | ListElement, variant: MenuItemVariant = 'contextMenuItem', - actionFilter = (_: NodeAction) => true + actionFilter = (_: NodeAction) => true, ) => { const data: TargetNode = element.getData(); const isGroup = !isTargetNode(data); @@ -161,7 +161,7 @@ export const COLLAPSE_EXEMPTS = [NodeType.NAMESPACE, NodeType.REALM, NodeType.UN // For searching export const isGroupNodeFiltered = ( groupNode: EnvironmentNode, - filters?: TopologyFilters['groupFilters']['filters'] + filters?: TopologyFilters['groupFilters']['filters'], ) => { if (!filters || !filters[groupNode.nodeType]) { return true; @@ -201,7 +201,7 @@ export const isTargetNodeFiltered = ({ target }: TargetNode, filters?: TopologyF matched = matched && [...Object.entries(annotations?.cryostat || {}), ...Object.entries(annotations?.platform || {})].filter( - ([k, v]) => filters.Annotation.includes(`${k}=${v}`) + ([k, v]) => filters.Annotation.includes(`${k}=${v}`), ).length > 0; } return matched; @@ -243,12 +243,12 @@ export const useMatchedTargetsSvcSource = (): BehaviorSubject - input ? svc.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of(undefined) - ) + input ? svc.api.matchTargetsWithExpr(input, targets).pipe(catchError((_) => of([]))) : of(undefined), + ), ) .subscribe((ts) => { matchedTargetsSvcRef.current.next(ts); - }) + }), ); }, [svc.targets, svc.api, matchExprService, addSubscription]); diff --git a/src/app/Topology/Toolbar/DisplayOptions.tsx b/src/app/Topology/Toolbar/DisplayOptions.tsx index 8108a298fe..0e2e04dd6b 100644 --- a/src/app/Topology/Toolbar/DisplayOptions.tsx +++ b/src/app/Topology/Toolbar/DisplayOptions.tsx @@ -40,7 +40,7 @@ export const DisplayOptions: React.FC = ({ dispatch(topologyDisplayOptionsSetIntent(group, key, checked)); }; }, - [dispatch] + [dispatch], ); const checkBoxContents = React.useMemo((): [string, JSX.Element][] => { diff --git a/src/app/Topology/Toolbar/HelpButton.tsx b/src/app/Topology/Toolbar/HelpButton.tsx index c705337ee3..c0101d760a 100644 --- a/src/app/Topology/Toolbar/HelpButton.tsx +++ b/src/app/Topology/Toolbar/HelpButton.tsx @@ -39,7 +39,7 @@ export const HelpButton: React.FC = ({ visualization, ...props to fit to the screen. ), - [onClick] + [onClick], ); return ( diff --git a/src/app/Topology/Toolbar/TopologyFilterChips.tsx b/src/app/Topology/Toolbar/TopologyFilterChips.tsx index 7a39fa9169..9e2d94a9ea 100644 --- a/src/app/Topology/Toolbar/TopologyFilterChips.tsx +++ b/src/app/Topology/Toolbar/TopologyFilterChips.tsx @@ -64,7 +64,7 @@ export const TopologyFilterChips: React.FC = ({ classN }); } }, - [] + [], ); const groupChips = React.useMemo(() => generateChip(groupFilters, true), [groupFilters, generateChip]); @@ -101,7 +101,7 @@ export const TopologyFilterChip: React.FC = ({ (value: string) => { dispatch(topologyDeleteFilterIntent(isGroupCategory, nodeType, category, value)); }, - [dispatch, isGroupCategory, nodeType, category] + [dispatch, isGroupCategory, nodeType, category], ); const handleDeleteChipGroup = React.useCallback(() => { diff --git a/src/app/Topology/Toolbar/TopologyFilters.tsx b/src/app/Topology/Toolbar/TopologyFilters.tsx index 324c5fce72..6f477020b8 100644 --- a/src/app/Topology/Toolbar/TopologyFilters.tsx +++ b/src/app/Topology/Toolbar/TopologyFilters.tsx @@ -76,14 +76,14 @@ export const TopologyFilterCategorySelect: React.FC<{ isDisabled?: boolean }> = dispatch(topologyUpdateCategoryIntent(isGroup, category)); } }, - [dispatch, isGroup] + [dispatch, isGroup], ); const handleCategoryTypeChange = React.useCallback( (isChecked: boolean) => { dispatch(topologyUpdateCategoryTypeIntent(isChecked)); }, - [dispatch] + [dispatch], ); const selected = React.useMemo(() => { @@ -156,7 +156,7 @@ export const TopologyFilter: React.FC<{ isDisabled?: boolean }> = ({ isDisabled, const groupNodeTypes = React.useMemo( () => getUniqueNodeTypes(flattenedTree.filter((n) => !isTargetNode(n))), - [flattenedTree] + [flattenedTree], ); const generateOnSelect = React.useCallback( @@ -165,7 +165,7 @@ export const TopologyFilter: React.FC<{ isDisabled?: boolean }> = ({ isDisabled, dispatch(topologyAddFilterIntent(isGroup, nodeType, category, value)); }; }, - [dispatch] + [dispatch], ); const groupInputs = React.useMemo(() => { @@ -189,8 +189,8 @@ export const TopologyFilter: React.FC<{ isDisabled?: boolean }> = ({ isDisabled, return !criteria || !criteria.includes(val); } return true; - }) - ) + }), + ), ), })) .filter((group) => group.options && group.options.length); // Do show show empty groups @@ -260,8 +260,8 @@ export const TopologyFilter: React.FC<{ isDisabled?: boolean }> = ({ isDisabled, .filter((val) => { const criteria: string[] = targetFilters.filters[cat]; return !criteria || !criteria.includes(val); - }) - ) + }), + ), ); const selectOptions = options.map((opt) => { diff --git a/src/app/Topology/Toolbar/TopologyToolbar.tsx b/src/app/Topology/Toolbar/TopologyToolbar.tsx index 08ba6042b5..7566e4ef3b 100644 --- a/src/app/Topology/Toolbar/TopologyToolbar.tsx +++ b/src/app/Topology/Toolbar/TopologyToolbar.tsx @@ -79,7 +79,7 @@ export const TopologyToolbar: React.FC = ({ variant, visua ), - [isGraphView, toggleView, t] + [isGraphView, toggleView, t], ); const shortcuts = React.useMemo(() => { diff --git a/src/app/Topology/Topology.tsx b/src/app/Topology/Topology.tsx index 5c19d03ecc..f7485249a4 100644 --- a/src/app/Topology/Topology.tsx +++ b/src/app/Topology/Topology.tsx @@ -44,7 +44,7 @@ export const Topology: React.FC = ({ ..._props }) => { const { groupings } = displayOptions; const transformConfig = React.useMemo( () => ({ showOnlyTopGroup: groupings.realmOnly, expandMode: !groupings.collapseSingles }), - [groupings] + [groupings], ); const [discoveryTree, setDiscoveryTree] = React.useState(DEFAULT_EMPTY_UNIVERSE); @@ -68,10 +68,10 @@ export const Topology: React.FC = ({ ..._props }) => { error: (err) => { setError(err); }, - }) + }), ); }, - [addSubscription, context.api, setDiscoveryTree, setError] + [addSubscription, context.api, setDiscoveryTree, setError], ); React.useEffect(() => { @@ -79,7 +79,7 @@ export const Topology: React.FC = ({ ..._props }) => { // Credentials will trigger modifed target event if any context.notificationChannel .messages(NotificationCategory.TargetJvmDiscovery) - .subscribe((_) => _refreshDiscoveryTree()) + .subscribe((_) => _refreshDiscoveryTree()), ); }, [addSubscription, context.notificationChannel, _refreshDiscoveryTree]); @@ -93,7 +93,7 @@ export const Topology: React.FC = ({ ..._props }) => { } const id = window.setInterval( () => _refreshDiscoveryTree(), - context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits() + context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(), ); return () => window.clearInterval(id); }, [context.settings, _refreshDiscoveryTree]); diff --git a/src/app/utils/fakeData.ts b/src/app/utils/fakeData.ts index 0fe4ea6f84..d4a0127486 100644 --- a/src/app/utils/fakeData.ts +++ b/src/app/utils/fakeData.ts @@ -146,7 +146,7 @@ class FakeSetting extends SettingsService { chartControllerConfig( _defaultConfig = { minRefresh: 0.1, - } + }, ): ChartControllerConfig { return { minRefresh: 0.1, @@ -245,7 +245,7 @@ class FakeApiService extends ApiService { getActiveProbesForTarget( _target: Target, _suppressNotifications?: boolean, - _skipStatusCheck?: boolean + _skipStatusCheck?: boolean, ): Observable { return of([]); } @@ -265,7 +265,7 @@ class FakeApiService extends ApiService { _query: string, _variables?: unknown, _suppressNotifications?: boolean | undefined, - _skipStatusCheck?: boolean | undefined + _skipStatusCheck?: boolean | undefined, ): Observable { return of({ data: { @@ -312,7 +312,7 @@ export const fakeChartContext = { fakeServices.api, fakeServices.target, fakeServices.notificationChannel, - fakeServices.settings + fakeServices.settings, ), mbeanController: new MBeanMetricsChartController(fakeServices.api, fakeServices.target, fakeServices.settings), }; diff --git a/src/app/utils/useDayjs.ts b/src/app/utils/useDayjs.ts index 92d4748bad..3d837f546a 100644 --- a/src/app/utils/useDayjs.ts +++ b/src/app/utils/useDayjs.ts @@ -46,13 +46,13 @@ export function useDayjs(): [typeof dayjs, DatetimeFormat] { .catch((err) => { console.warn(err); return f; - }) + }), ); } else { console.warn(`${f.dateLocale.name} (${f.dateLocale.key}) is not supported.`); return of(f); } - }) + }), ) .subscribe(setDatetimeContext), ]); diff --git a/src/app/utils/useSetState.ts b/src/app/utils/useSetState.ts index 30c2e12ac1..8a12f3aa62 100644 --- a/src/app/utils/useSetState.ts +++ b/src/app/utils/useSetState.ts @@ -17,7 +17,7 @@ import { useCallback, useState } from 'react'; // taken from streamich.github.io/react-use const useSetState = ( - initialState: T = {} as T + initialState: T = {} as T, ): [T, (patch: Partial | ((prevState: T) => Partial)) => void] => { const [state, set] = useState(initialState); const setState = useCallback((patch) => { diff --git a/src/app/utils/useSort.ts b/src/app/utils/useSort.ts index d9be9849fa..a0ccc3fd54 100644 --- a/src/app/utils/useSort.ts +++ b/src/app/utils/useSort.ts @@ -29,7 +29,7 @@ export const useSort = (): [ISortBy, (columnIndex: number) => ThProps['sort']] = }, columnIndex, }), - [sortBy, setSortBy] + [sortBy, setSortBy], ); return [sortBy, getSortParams]; }; diff --git a/src/app/utils/useTheme.ts b/src/app/utils/useTheme.ts index eb3e69955b..011c7b2fa1 100644 --- a/src/app/utils/useTheme.ts +++ b/src/app/utils/useTheme.ts @@ -33,7 +33,7 @@ export function useTheme(): [ThemeType, ThemeSetting] { setTheme( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? ThemeSetting.DARK - : ThemeSetting.LIGHT + : ThemeSetting.LIGHT, ); } else { setTheme(theme); diff --git a/src/app/utils/utils.ts b/src/app/utils/utils.ts index 8ef96e2789..01ea6f1446 100644 --- a/src/app/utils/utils.ts +++ b/src/app/utils/utils.ts @@ -229,7 +229,7 @@ export const switchTab = ( history: ReturnType, pathname: string, search: string, - { tabKey, tabValue }: TabConfig + { tabKey, tabValue }: TabConfig, ) => { const query = new URLSearchParams(search); query.set(tabKey, tabValue); diff --git a/src/i18n/datetime.ts b/src/i18n/datetime.ts index 3833af50b4..96cc142b8b 100644 --- a/src/i18n/datetime.ts +++ b/src/i18n/datetime.ts @@ -92,7 +92,7 @@ export const supportedTimezones = () => ({ full: tname, short: dayjs().tz(tname).format('z'), // Get abbreviation - } as Timezone) + }) as Timezone, ); export const getTimezone = (short: string): Timezone | undefined => { diff --git a/src/itest/util.ts b/src/itest/util.ts index 31f0ef753f..57231e0385 100644 --- a/src/itest/util.ts +++ b/src/itest/util.ts @@ -83,7 +83,7 @@ export class Cryostat { const targetSelect = await this.driver.wait(until.elementLocated(By.css(`[aria-label="Options menu"]`))); await targetSelect.click(); const targetOption = await this.driver.wait( - until.elementLocated(By.xpath(`//*[contains(text(), '${targetName}')]`)) + until.elementLocated(By.xpath(`//*[contains(text(), '${targetName}')]`)), ); await targetOption.click(); } @@ -97,12 +97,12 @@ export class Cryostat { async getLatestNotification(): Promise { const latestNotification = await this.driver.wait( - until.elementLocated(By.className('pf-c-alert-group pf-m-toast')) + until.elementLocated(By.className('pf-c-alert-group pf-m-toast')), ); return { title: await getDirectTextContent( this.driver, - await latestNotification.findElement(By.css('li:last-of-type .pf-c-alert__title')) + await latestNotification.findElement(By.css('li:last-of-type .pf-c-alert__title')), ), description: await latestNotification.findElement(By.css('li:last-of-type .pf-c-alert__description')).getText(), }; @@ -124,7 +124,7 @@ async function getDirectTextContent(driver: WebDriver, el: WebElement): Promise< } return ret; `, - el + el, ); } diff --git a/src/mirage/index.ts b/src/mirage/index.ts index f4f257c513..1047695c69 100644 --- a/src/mirage/index.ts +++ b/src/mirage/index.ts @@ -43,7 +43,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { message: { '127.0.0.1': 'accepted', }, - }) + }), ); }); }); @@ -91,12 +91,12 @@ export const startMirage = ({ environment = 'development' } = {}) => { username: environment, }, }, - } + }, ); }); this.post( 'api/v2.1/auth/token', - () => new Response(400, {}, 'Resource downloads are not supported in this demo') + () => new Response(400, {}, 'Resource downloads are not supported in this demo'), ); this.post('api/v2/targets', (schema, request) => { const attrs = request.requestBody as any; @@ -119,7 +119,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { serverTime: +Date.now(), }, message: { event: { serviceRef: target, kind: 'FOUND' } }, - }) + }), ); return { data: { @@ -206,7 +206,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { // id will generated by Mirage (i.e. increment intergers) downloadUrl: '', reportUrl: `beta/reports/${encodeURIComponent(request.params.targetId)}/${encodeURIComponent( - attrs.get('recordingName') + attrs.get('recordingName'), )}`, name: attrs.get('recordingName'), state: 'RUNNING', @@ -235,7 +235,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { target: request.params.targetId, recording, }, - }) + }), ); return recording; }); @@ -385,7 +385,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { topic: 'jvm_information', description: 'Summary:\nThe recording does not seem to contain passwords in the application arguments.', }, - } + }, ); }); this.get('api/v1/targets/:targetId/recordingOptions', () => []); @@ -501,7 +501,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { return new Response( 400, {}, - `${JSON.stringify(request.url)} (query: '${name}') currently unsupported in demo` + `${JSON.stringify(request.url)} (query: '${name}') currently unsupported in demo`, ); } let data = {}; @@ -590,7 +590,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { labels, }, }, - }) + }), ); break; } @@ -637,7 +637,7 @@ export const startMirage = ({ environment = 'development' } = {}) => { labels, }, }, - }) + }), ); break; } diff --git a/src/test/About/About.test.tsx b/src/test/About/About.test.tsx index bf8411d22d..84346cc5f5 100644 --- a/src/test/About/About.test.tsx +++ b/src/test/About/About.test.tsx @@ -64,7 +64,7 @@ describe('', () => { renderDefault( - + , ); expect(screen.getByText('About')).toBeInTheDocument(); diff --git a/src/test/Agent/AgentLiveProbes.test.tsx b/src/test/Agent/AgentLiveProbes.test.tsx index dd498a6faf..2e6674fb36 100644 --- a/src/test/Agent/AgentLiveProbes.test.tsx +++ b/src/test/Agent/AgentLiveProbes.test.tsx @@ -124,7 +124,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Archives/AllArchivedRecordingsTable.test.tsx b/src/test/Archives/AllArchivedRecordingsTable.test.tsx index 81fe80301b..bb0f049a1b 100644 --- a/src/test/Archives/AllArchivedRecordingsTable.test.tsx +++ b/src/test/Archives/AllArchivedRecordingsTable.test.tsx @@ -168,7 +168,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Archives/AllTargetsArchivedRecordingsTable.test.tsx b/src/test/Archives/AllTargetsArchivedRecordingsTable.test.tsx index 8d6bfa8266..c25b4c39a4 100644 --- a/src/test/Archives/AllTargetsArchivedRecordingsTable.test.tsx +++ b/src/test/Archives/AllTargetsArchivedRecordingsTable.test.tsx @@ -213,7 +213,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Archives/Archives.test.tsx b/src/test/Archives/Archives.test.tsx index dc340bdf31..870d23d269 100644 --- a/src/test/Archives/Archives.test.tsx +++ b/src/test/Archives/Archives.test.tsx @@ -129,7 +129,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Common.tsx b/src/test/Common.tsx index fa74b75a6c..38089ca24b 100644 --- a/src/test/Common.tsx +++ b/src/test/Common.tsx @@ -43,7 +43,7 @@ export const renderDefault = ( user = userEvent.setup(), // Create a default user session notifications = NotificationsInstance, ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return {children}; @@ -59,7 +59,7 @@ export const renderWithReduxStore = ( user = userEvent.setup(), // Create a default user session notifications = NotificationsInstance, ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -78,7 +78,7 @@ export const renderWithServiceContext = ( notifications = NotificationsInstance, user = userEvent.setup(), // Create a default user session ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -97,7 +97,7 @@ export const renderWithRouter = ( user = userEvent.setup(), // Create a default user session notifications = NotificationsInstance, ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -118,7 +118,7 @@ export const renderWithServiceContextAndReduxStore = ( notifications = NotificationsInstance, user = userEvent.setup(), // Create a default user session ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -140,7 +140,7 @@ export const renderWithServiceContextAndRouter = ( user = userEvent.setup(), // Create a default user session history = createMemoryHistory({ initialEntries: ['/'] }), ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -164,7 +164,7 @@ export const renderWithServiceContextAndReduxStoreWithRouter = ( user = userEvent.setup(), // Create a default user session history = createMemoryHistory({ initialEntries: ['/'] }), ...renderOptions - } = {} + } = {}, ) => { const Wrapper = ({ children }: PropsWithChildren) => { return ( @@ -184,7 +184,7 @@ export const renderWithProvidersAndRedux = ( ui: React.ReactElement, /* eslint-disable @typescript-eslint/no-explicit-any */ providers: ProviderInstance[], - { preloadedState = {}, store = setupStore(preloadedState), user = userEvent.setup(), ...renderOptions } = {} + { preloadedState = {}, store = setupStore(preloadedState), user = userEvent.setup(), ...renderOptions } = {}, ) => { if (providers.length < 1) { throw new Error('At least one provider must be specified'); diff --git a/src/test/CreateRecording/CustomRecordingForm.test.tsx b/src/test/CreateRecording/CustomRecordingForm.test.tsx index 60925447b8..169a22a491 100644 --- a/src/test/CreateRecording/CustomRecordingForm.test.tsx +++ b/src/test/CreateRecording/CustomRecordingForm.test.tsx @@ -89,7 +89,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/CreateRecording/SnapshotRecordingForm.test.tsx b/src/test/CreateRecording/SnapshotRecordingForm.test.tsx index 63bc2a0695..2b15fa5c78 100644 --- a/src/test/CreateRecording/SnapshotRecordingForm.test.tsx +++ b/src/test/CreateRecording/SnapshotRecordingForm.test.tsx @@ -57,7 +57,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.test.tsx b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.test.tsx index 1b257c2083..bece18fa3c 100644 --- a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.test.tsx @@ -208,12 +208,12 @@ describe('', () => { expect(screen.queryByLabelText(testT('AutomatedAnalysisCard.TOOLBAR.LABEL'))).not.toBeInTheDocument(); // Toolbar await user.click( - screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.CREATE_RECORDING.LABEL') }) + screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.CREATE_RECORDING.LABEL') }), ); expect(requestSpy).toHaveBeenCalledTimes(1); expect(requestSpy).toBeCalledWith( - automatedAnalysisConfigToRecordingAttributes(defaultAutomatedAnalysisRecordingConfig) + automatedAnalysisConfigToRecordingAttributes(defaultAutomatedAnalysisRecordingConfig), ); }); @@ -249,12 +249,12 @@ describe('', () => { expect( screen.queryByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.CREATE_RECORDING.LABEL'), - }) + }), ).not.toBeInTheDocument(); expect( screen.queryByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.OPEN_SETTINGS.LABEL'), - }) + }), ).not.toBeInTheDocument(); mockEvaluations.forEach((evaluation) => { @@ -295,18 +295,18 @@ describe('', () => { expect(screen.getByText(`Archived report name=${mockArchivedRecording.name}`)).toBeInTheDocument(); // Archived report name expect( - screen.getByText(testT('AutomatedAnalysisCard.STALE_REPORT.TEXT', { count: 1, units: 'day' })) + screen.getByText(testT('AutomatedAnalysisCard.STALE_REPORT.TEXT', { count: 1, units: 'day' })), ).toBeInTheDocument(); // Last updated text expect( screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.CREATE_RECORDING.LABEL'), - }) + }), ).toBeInTheDocument(); expect( screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.OPEN_SETTINGS.LABEL'), - }) + }), ).toBeInTheDocument(); mockEvaluations.forEach((evaluation) => { @@ -362,12 +362,12 @@ describe('', () => { expect( screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.CREATE_RECORDING.LABEL'), - }) + }), ).toBeInTheDocument(); expect( screen.getByRole('button', { name: testT('AutomatedAnalysisConfigDrawer.INPUT_GROUP.OPEN_SETTINGS.LABEL'), - }) + }), ).toBeInTheDocument(); mockCachedReport.report.forEach((evaluation) => { diff --git a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.test.tsx b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.test.tsx index 2bad950ae9..0f3eeac33f 100644 --- a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.test.tsx @@ -71,7 +71,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.test.tsx b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.test.tsx index f8c0341d7c..f3e4b26379 100644 --- a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.test.tsx @@ -50,7 +50,7 @@ describe('', () => { isContentAbove={false} onCreate={() => undefined} onError={() => undefined} - /> + />, ); expect(screen.getByText(/drawer content/i)).toBeInTheDocument(); @@ -71,7 +71,7 @@ describe('', () => { isContentAbove={false} onCreate={() => undefined} onError={() => undefined} - /> + />, ); expect(screen.getByText(/drawer content/i)).toBeInTheDocument(); @@ -92,7 +92,7 @@ describe('', () => { isContentAbove={false} onCreate={onCreateFunction} onError={() => undefined} - /> + />, ); const createRecording = screen.getByRole('button', { diff --git a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.test.tsx b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.test.tsx index 23777ba50c..12c3f103e1 100644 --- a/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.test.tsx @@ -87,7 +87,7 @@ describe('', () => { await user.click( screen.getByRole('button', { name: /edit/i, - }) + }), ); // Edit button const templateSelect = screen.getByLabelText('Template *'); // Template select @@ -124,7 +124,7 @@ describe('', () => { await user.click( screen.getByRole('button', { name: /edit/i, - }) + }), ); const templateSelect = screen.getByRole('combobox', { @@ -161,7 +161,7 @@ describe('', () => { await user.click( screen.getByRole('button', { name: testT('AutomatedAnalysisConfigForm.SAVE_CHANGES'), - }) + }), ); expect(setConfigRequestSpy).toHaveBeenCalledWith(config); }); diff --git a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.test.tsx b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.test.tsx index 036bb1ca65..92b9b0495b 100644 --- a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.test.tsx @@ -80,7 +80,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onNameInput} filteredNames={emptyFilteredNames} - /> + />, ); const nameInput = screen.getByLabelText('Filter by name...'); expect(nameInput).toBeInTheDocument(); @@ -105,7 +105,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onNameInput} filteredNames={emptyFilteredNames} - /> + />, ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); expect(dropDownArrow).toBeInTheDocument(); @@ -130,7 +130,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onNameInput} filteredNames={emptyFilteredNames} - /> + />, ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); @@ -160,7 +160,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onNameInput} filteredNames={emptyFilteredNames} - /> + />, ); const nameInput = screen.getByLabelText('Filter by name...'); @@ -190,7 +190,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onNameInput} filteredNames={filteredNames} - /> + />, ); const nameInput = screen.getByLabelText('Filter by name...'); @@ -215,7 +215,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={submitNameInput} filteredNames={emptyFilteredNames} - /> + />, ); const nameInput = screen.getByLabelText('Filter by name...'); diff --git a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.test.tsx b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.test.tsx index 73b0bad851..97600fa7d9 100644 --- a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.test.tsx @@ -76,7 +76,7 @@ describe('', () => { expect(sliderValue).toHaveValue(100); expect( - document.getElementsByClassName('automated-analysis-score-filter-slider-critical').item(0) + document.getElementsByClassName('automated-analysis-score-filter-slider-critical').item(0), ).toBeInTheDocument(); expect(screen.getByText(onlyShowingText(100))).toBeInTheDocument(); @@ -90,7 +90,7 @@ describe('', () => { await user.keyboard('{Enter}'); expect(sliderValue).toHaveValue(50); expect( - document.getElementsByClassName('automated-analysis-score-filter-slider-warning').item(0) + document.getElementsByClassName('automated-analysis-score-filter-slider-warning').item(0), ).toBeInTheDocument(); expect(screen.getByText(onlyShowingText(50))).toBeInTheDocument(); @@ -98,7 +98,7 @@ describe('', () => { await user.keyboard('{Enter}'); expect(sliderValue).toHaveValue(100); expect( - document.getElementsByClassName('automated-analysis-score-filter-slider-critical').item(0) + document.getElementsByClassName('automated-analysis-score-filter-slider-critical').item(0), ).toBeInTheDocument(); expect(screen.getByText(onlyShowingText(100))).toBeInTheDocument(); }); diff --git a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.test.tsx b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.test.tsx index ca455ab489..048be213bb 100644 --- a/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.test.tsx +++ b/src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.test.tsx @@ -80,7 +80,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onTopicInput} filteredTopics={emptyFilteredTopics} - /> + />, ); const nameInput = screen.getByLabelText('Filter by topic...'); expect(nameInput).toBeInTheDocument(); @@ -105,7 +105,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onTopicInput} filteredTopics={emptyFilteredTopics} - /> + />, ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); expect(dropDownArrow).toBeInTheDocument(); @@ -130,7 +130,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onTopicInput} filteredTopics={emptyFilteredTopics} - /> + />, ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); @@ -160,7 +160,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onTopicInput} filteredTopics={emptyFilteredTopics} - /> + />, ); const nameInput = screen.getByLabelText('Filter by topic...'); @@ -190,7 +190,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={onTopicInput} filteredTopics={filteredTopics} - /> + />, ); const nameInput = screen.getByLabelText('Filter by topic...'); @@ -215,7 +215,7 @@ describe('', () => { evaluations={mockCategorizedEvaluations} onSubmit={submitNameInput} filteredTopics={emptyFilteredTopics} - /> + />, ); const nameInput = screen.getByLabelText('Filter by topic...'); diff --git a/src/test/Dashboard/Charts/jfr/JFRMetricsChartCard.test.tsx b/src/test/Dashboard/Charts/jfr/JFRMetricsChartCard.test.tsx index abc9309341..9b6292b637 100644 --- a/src/test/Dashboard/Charts/jfr/JFRMetricsChartCard.test.tsx +++ b/src/test/Dashboard/Charts/jfr/JFRMetricsChartCard.test.tsx @@ -53,12 +53,12 @@ const mockJfrController = new JFRMetricsChartController( defaultServices.api, defaultServices.target, defaultServices.notificationChannel, - defaultServices.settings + defaultServices.settings, ); const mockMbeanController = new MBeanMetricsChartController( defaultServices.api, defaultServices.target, - defaultServices.settings + defaultServices.settings, ); const mockChartContext = { jfrController: mockJfrController, @@ -83,7 +83,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -103,7 +103,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -123,7 +123,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -137,7 +137,7 @@ describe('', () => { expect(screen.getByText('CPU Load (last 120s, every 10s)')).toBeInTheDocument(); expect(screen.getByText('No source recording')).toBeInTheDocument(); expect( - screen.getByText((s) => s.includes('Metrics cards display data taken from running flight recordings')) + screen.getByText((s) => s.includes('Metrics cards display data taken from running flight recordings')), ).toBeInTheDocument(); expect(screen.getByRole('button', { name: /create/i })).toBeInTheDocument(); }); @@ -146,7 +146,7 @@ describe('', () => { jest.spyOn(mockJfrController, 'attach').mockReturnValue(of(ControllerState.NO_DATA)); const { user } = renderChartCard( - + , ); expect(history.location.pathname).toBe('/'); @@ -178,7 +178,7 @@ describe('', () => { jest.spyOn(mockJfrController, 'attach').mockReturnValue(of(ControllerState.READY)); const { container } = renderChartCard( - + , ); const iframe = container.querySelector('iframe'); @@ -206,7 +206,7 @@ const renderChartCard = ( store = setupStore(preloadState), user = userEvent.setup(), ...renderOptions - } = {} + } = {}, ) => { return renderWithProvidersAndRedux( ui, @@ -228,6 +228,6 @@ const renderChartCard = ( store, user, ...renderOptions, - } + }, ); }; diff --git a/src/test/Dashboard/Charts/mbean/MBeanMetricsChartCard.test.tsx b/src/test/Dashboard/Charts/mbean/MBeanMetricsChartCard.test.tsx index 9c241c18d8..fa52174071 100644 --- a/src/test/Dashboard/Charts/mbean/MBeanMetricsChartCard.test.tsx +++ b/src/test/Dashboard/Charts/mbean/MBeanMetricsChartCard.test.tsx @@ -46,12 +46,12 @@ const mockJfrController = new JFRMetricsChartController( defaultServices.api, defaultServices.target, defaultServices.notificationChannel, - defaultServices.settings + defaultServices.settings, ); const mockMbeanController = new MBeanMetricsChartController( defaultServices.api, defaultServices.target, - defaultServices.settings + defaultServices.settings, ); const mockChartContext = { jfrController: mockJfrController, @@ -134,7 +134,7 @@ describe('', () => { /> - + , ); }); expect(tree.toJSON()).toMatchSnapshot('with-content'); @@ -163,7 +163,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot('loading-view'); diff --git a/src/test/Dashboard/Dashboard.test.tsx b/src/test/Dashboard/Dashboard.test.tsx index 5cb9987c90..7fd146f8ab 100644 --- a/src/test/Dashboard/Dashboard.test.tsx +++ b/src/test/Dashboard/Dashboard.test.tsx @@ -69,7 +69,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Dashboard/DashboardLayoutToolbar.test.tsx b/src/test/Dashboard/DashboardLayoutToolbar.test.tsx index cdf8e828a4..bf810295b1 100644 --- a/src/test/Dashboard/DashboardLayoutToolbar.test.tsx +++ b/src/test/Dashboard/DashboardLayoutToolbar.test.tsx @@ -35,7 +35,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/DateTimePicker/DateTimePicker.test.tsx b/src/test/DateTimePicker/DateTimePicker.test.tsx index 6b1705957f..d5341f3953 100644 --- a/src/test/DateTimePicker/DateTimePicker.test.tsx +++ b/src/test/DateTimePicker/DateTimePicker.test.tsx @@ -39,7 +39,7 @@ describe('', () => { it('should show date tab as default', async () => { renderWithServiceContext( - + , ); const dateTab = screen.getByRole('tab', { name: testT('DATE', { ns: 'common' }) }); @@ -50,7 +50,7 @@ describe('', () => { it('should render currently selected date in calendar', async () => { renderWithServiceContext( - + , ); const selectedDate = screen.getByLabelText('14 September 2022'); @@ -60,7 +60,7 @@ describe('', () => { it('should render currently selected datetime', async () => { renderWithServiceContext( - + , ); const display = screen.getByLabelText(testT('DateTimePicker.ARIA_LABELS.DISPLAY_SELECTED_DATETIME')); @@ -75,7 +75,7 @@ describe('', () => { it('should switch to time tab when a date is selected', async () => { const { user } = renderWithServiceContext( - + , ); const selectedDate = screen.getByLabelText('14 September 2022'); @@ -92,7 +92,7 @@ describe('', () => { it('should update selected datetime when date or time is seleted', async () => { const { user } = renderWithServiceContext( - + , ); const selectedDate = screen.getByLabelText('13 September 2022'); expect(selectedDate).toBeInTheDocument(); @@ -102,7 +102,7 @@ describe('', () => { // Switched to time now const mInput = within(screen.getByLabelText(testT('MINUTE', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_MINUTE_VALUE') + testT('TimeSpinner.INPUT_MINUTE_VALUE'), ); expect(mInput).toBeInTheDocument(); expect(mInput).toBeVisible(); @@ -117,7 +117,7 @@ describe('', () => { it('should submit when select button is clicked', async () => { const { user } = renderWithServiceContext( - + , ); const submitButton = screen.getByText(testT('SELECT', { ns: 'common' })); @@ -132,7 +132,7 @@ describe('', () => { it('shoud dismiss the modal when cancel button is clicked', async () => { const { user } = renderWithServiceContext( - + , ); const dismissButton = screen.getByText(testT('CANCEL', { ns: 'common' })); diff --git a/src/test/DateTimePicker/TimePicker.test.tsx b/src/test/DateTimePicker/TimePicker.test.tsx index 7d067600d5..32c3bfd37a 100644 --- a/src/test/DateTimePicker/TimePicker.test.tsx +++ b/src/test/DateTimePicker/TimePicker.test.tsx @@ -56,7 +56,7 @@ describe('', () => { onHourSelect={onHourSelect} onMinuteSelect={onMinuteSelect} onSecondSelect={onSecondSelect} - /> + />, ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -69,7 +69,7 @@ describe('', () => { onHourSelect={onHourSelect} onMinuteSelect={onMinuteSelect} onSecondSelect={onSecondSelect} - /> + />, ); const switchenable24h = screen.getByLabelText(testT('TimePicker.24HOUR')); @@ -80,21 +80,21 @@ describe('', () => { await user.click(switchenable24h); const hInput = within(screen.getByLabelText(testT('HOUR', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_HOUR12_VALUE') + testT('TimeSpinner.INPUT_HOUR12_VALUE'), ); expect(hInput).toBeInTheDocument(); expect(hInput).toBeVisible(); expect(hInput.getAttribute('value')).toBe(format2Digit(mockSelectedIn12hr.hour12)); const mInput = within(screen.getByLabelText(testT('MINUTE', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_MINUTE_VALUE') + testT('TimeSpinner.INPUT_MINUTE_VALUE'), ); expect(mInput).toBeInTheDocument(); expect(mInput).toBeVisible(); expect(mInput.getAttribute('value')).toBe(format2Digit(mockSelectedIn12hr.minute)); const sInput = within(screen.getByLabelText(testT('SECOND', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_SECOND_VALUE') + testT('TimeSpinner.INPUT_SECOND_VALUE'), ); expect(sInput).toBeInTheDocument(); expect(sInput).toBeVisible(); @@ -113,11 +113,11 @@ describe('', () => { onHourSelect={onHourSelect} onMinuteSelect={onMinuteSelect} onSecondSelect={onSecondSelect} - /> + />, ); const upHour = within(screen.getByLabelText(testT('HOUR', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INCREMENT_HOUR24_VALUE') + testT('TimeSpinner.INCREMENT_HOUR24_VALUE'), ); expect(upHour).toBeInTheDocument(); expect(upHour).toBeVisible(); @@ -128,7 +128,7 @@ describe('', () => { expect(onHourSelect).toHaveBeenCalledWith(14); const downHour = within(screen.getByLabelText(testT('HOUR', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.DECREMENT_HOUR24_VALUE') + testT('TimeSpinner.DECREMENT_HOUR24_VALUE'), ); expect(downHour).toBeInTheDocument(); expect(downHour).toBeVisible(); @@ -139,7 +139,7 @@ describe('', () => { expect(onHourSelect).toHaveBeenLastCalledWith(12); const upMinute = within(screen.getByLabelText(testT('MINUTE', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INCREMENT_MINUTE_VALUE') + testT('TimeSpinner.INCREMENT_MINUTE_VALUE'), ); expect(upMinute).toBeInTheDocument(); expect(upMinute).toBeVisible(); @@ -150,7 +150,7 @@ describe('', () => { expect(onMinuteSelect).toHaveBeenCalledWith(12); const downMinute = within(screen.getByLabelText(testT('MINUTE', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.DECREMENT_MINUTE_VALUE') + testT('TimeSpinner.DECREMENT_MINUTE_VALUE'), ); expect(downMinute).toBeInTheDocument(); expect(downMinute).toBeVisible(); @@ -161,7 +161,7 @@ describe('', () => { expect(onMinuteSelect).toHaveBeenCalledWith(10); const upSecond = within(screen.getByLabelText(testT('SECOND', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INCREMENT_SECOND_VALUE') + testT('TimeSpinner.INCREMENT_SECOND_VALUE'), ); expect(upSecond).toBeInTheDocument(); expect(upSecond).toBeVisible(); @@ -172,7 +172,7 @@ describe('', () => { expect(onSecondSelect).toHaveBeenCalledWith(12); const downSecond = within(screen.getByLabelText(testT('SECOND', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.DECREMENT_SECOND_VALUE') + testT('TimeSpinner.DECREMENT_SECOND_VALUE'), ); expect(downSecond).toBeInTheDocument(); expect(downSecond).toBeVisible(); @@ -190,11 +190,11 @@ describe('', () => { onHourSelect={onHourSelect} onMinuteSelect={onMinuteSelect} onSecondSelect={onSecondSelect} - /> + />, ); const hInput = within(screen.getByLabelText(testT('HOUR', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_HOUR24_VALUE') + testT('TimeSpinner.INPUT_HOUR24_VALUE'), ); expect(hInput).toBeInTheDocument(); expect(hInput).toBeVisible(); @@ -204,7 +204,7 @@ describe('', () => { expect(onHourSelect).toHaveBeenLastCalledWith(1); const mInput = within(screen.getByLabelText(testT('MINUTE', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_MINUTE_VALUE') + testT('TimeSpinner.INPUT_MINUTE_VALUE'), ); expect(mInput).toBeInTheDocument(); expect(mInput).toBeVisible(); @@ -214,7 +214,7 @@ describe('', () => { expect(onHourSelect).toHaveBeenLastCalledWith(1); const sInput = within(screen.getByLabelText(testT('SECOND', { ns: 'common' }))).getByLabelText( - testT('TimeSpinner.INPUT_SECOND_VALUE') + testT('TimeSpinner.INPUT_SECOND_VALUE'), ); expect(sInput).toBeInTheDocument(); expect(sInput).toBeVisible(); diff --git a/src/test/DateTimePicker/TimezonePicker.test.tsx b/src/test/DateTimePicker/TimezonePicker.test.tsx index 8efaecfbd5..a0959b4834 100644 --- a/src/test/DateTimePicker/TimezonePicker.test.tsx +++ b/src/test/DateTimePicker/TimezonePicker.test.tsx @@ -36,7 +36,7 @@ describe('', () => { renderDefault(); const displaySelected = screen.getByText( - `(UTC${dayjs().tz(supportedTimezones()[0].full).format('Z')}) ${supportedTimezones()[0].full}` + `(UTC${dayjs().tz(supportedTimezones()[0].full).format('Z')}) ${supportedTimezones()[0].full}`, ); expect(displaySelected).toBeInTheDocument(); expect(displaySelected).toBeVisible(); @@ -44,7 +44,7 @@ describe('', () => { it('should show correct timezone options', async () => { const { user } = renderDefault( - + , ); const optionMenu = screen.getByLabelText('Options menu'); @@ -78,7 +78,7 @@ describe('', () => { it('should show correct timezone options in compact mode', async () => { const { user } = renderDefault( - + , ); const optionMenu = screen.getByLabelText('Options menu'); @@ -107,7 +107,7 @@ describe('', () => { it('should select a timezone when an option is clicked', async () => { const { user } = renderDefault( - + , ); const optionMenu = screen.getByLabelText('Options menu'); diff --git a/src/test/Events/EventTemplates.test.tsx b/src/test/Events/EventTemplates.test.tsx index f44bdb2c38..850879a52b 100644 --- a/src/test/Events/EventTemplates.test.tsx +++ b/src/test/Events/EventTemplates.test.tsx @@ -109,7 +109,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Events/EventTypes.test.tsx b/src/test/Events/EventTypes.test.tsx index 7525314d7b..994fda0967 100644 --- a/src/test/Events/EventTypes.test.tsx +++ b/src/test/Events/EventTypes.test.tsx @@ -51,7 +51,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/RecordingMetadata/BulkEditLabels.test.tsx b/src/test/RecordingMetadata/BulkEditLabels.test.tsx index 5cab7ac3ae..8d12a60760 100644 --- a/src/test/RecordingMetadata/BulkEditLabels.test.tsx +++ b/src/test/RecordingMetadata/BulkEditLabels.test.tsx @@ -127,7 +127,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -163,7 +163,7 @@ describe('', () => { it('should display editable labels form when in edit mode', async () => { const { user } = renderWithServiceContext( - + , ); const editButton = screen.getByRole('button', { name: 'Edit Labels' }); @@ -223,7 +223,7 @@ describe('', () => { it('should return to read-only view when edited labels are cancelled', async () => { const { user } = renderWithServiceContext( - + , ); let editButton = screen.getByRole('button', { name: 'Edit Labels' }); @@ -269,7 +269,7 @@ describe('', () => { .spyOn(defaultServices.api, 'postTargetRecordingMetadata') .mockReturnValue(of([mockActiveRecording])); const { user } = renderWithServiceContext( - + , ); const editButton = screen.getByRole('button', { name: 'Edit Labels' }); @@ -312,7 +312,7 @@ describe('', () => { .spyOn(defaultServices.api, 'postRecordingMetadata') .mockReturnValue(of([mockArchivedRecording])); const { user } = renderWithServiceContext( - + , ); const editButton = screen.getByRole('button', { name: 'Edit Labels' }); diff --git a/src/test/RecordingMetadata/ClickableLabel.test.tsx b/src/test/RecordingMetadata/ClickableLabel.test.tsx index 923aa59394..fc02712b74 100644 --- a/src/test/RecordingMetadata/ClickableLabel.test.tsx +++ b/src/test/RecordingMetadata/ClickableLabel.test.tsx @@ -41,7 +41,7 @@ describe('', () => { let tree; await act(async () => { tree = renderer.create( - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -69,7 +69,7 @@ describe('', () => { it('should display hover effect when hovered and is selected', async () => { const { user } = renderDefault( - + , ); const label = screen.getByLabelText(mockLabelAsString); @@ -88,7 +88,7 @@ describe('', () => { it('should display hover effect when hovered and is not selected', async () => { const { user } = renderDefault( - + , ); const label = screen.getByLabelText(mockLabelAsString); @@ -107,7 +107,7 @@ describe('', () => { it('should update label filters when clicked', async () => { const { user } = renderDefault( - + , ); const label = screen.getByLabelText(mockLabelAsString); diff --git a/src/test/RecordingMetadata/LabelCell.test.tsx b/src/test/RecordingMetadata/LabelCell.test.tsx index e122d6e60b..f13f1b19d8 100644 --- a/src/test/RecordingMetadata/LabelCell.test.tsx +++ b/src/test/RecordingMetadata/LabelCell.test.tsx @@ -62,7 +62,7 @@ describe('', () => { target={mockFooTarget.connectUrl} labels={mockLabelList} clickableOptions={{ labelFilters: [], updateFilters: onUpdateLabels }} - /> + />, ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -90,7 +90,7 @@ describe('', () => { target={mockFooTarget.connectUrl} labels={mockLabelList} clickableOptions={{ labelFilters: [], updateFilters: onUpdateLabels }} - /> + />, ); let count = 0; diff --git a/src/test/RecordingMetadata/RecordingLabelFields.test.tsx b/src/test/RecordingMetadata/RecordingLabelFields.test.tsx index 2c7a9eea9d..7f3c84f9b4 100644 --- a/src/test/RecordingMetadata/RecordingLabelFields.test.tsx +++ b/src/test/RecordingMetadata/RecordingLabelFields.test.tsx @@ -30,10 +30,10 @@ const mockMetadataFileName = 'mock.metadata.json'; const mockMetadataFile = new File( [JSON.stringify({ labels: { ...mockUploadedRecordingLabels } })], mockMetadataFileName, - { type: 'json' } + { type: 'json' }, ); mockMetadataFile.text = jest.fn( - () => new Promise((resolve, _) => resolve(JSON.stringify({ labels: { ...mockUploadedRecordingLabels } }))) + () => new Promise((resolve, _) => resolve(JSON.stringify({ labels: { ...mockUploadedRecordingLabels } }))), ); describe('', () => { diff --git a/src/test/Recordings/ActiveRecordingsTable.test.tsx b/src/test/Recordings/ActiveRecordingsTable.test.tsx index c5023e5b43..b9b041dcb3 100644 --- a/src/test/Recordings/ActiveRecordingsTable.test.tsx +++ b/src/test/Recordings/ActiveRecordingsTable.test.tsx @@ -195,7 +195,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); ['Create', 'Edit Labels', 'Stop', 'Delete'].map((text) => { @@ -234,7 +234,7 @@ describe('', () => { expect(toolTip).toBeVisible(); const duration = screen.getByText( - mockRecording.continuous || mockRecording.duration === 0 ? 'Continuous' : `${mockRecording.duration / 1000}s` + mockRecording.continuous || mockRecording.duration === 0 ? 'Continuous' : `${mockRecording.duration / 1000}s`, ); expect(duration).toBeInTheDocument(); expect(duration).toBeVisible(); @@ -295,7 +295,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.getByText('Create')).toBeInTheDocument(); @@ -311,7 +311,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await user.click(screen.getByText('Create')); @@ -325,7 +325,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -345,7 +345,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -365,7 +365,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -381,7 +381,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -411,7 +411,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); diff --git a/src/test/Recordings/ArchivedRecordingsTable.test.tsx b/src/test/Recordings/ArchivedRecordingsTable.test.tsx index f50ce87e15..4e156f1812 100644 --- a/src/test/Recordings/ArchivedRecordingsTable.test.tsx +++ b/src/test/Recordings/ArchivedRecordingsTable.test.tsx @@ -51,7 +51,7 @@ const mockMetadataFileName = 'mock.metadata.json'; const mockMetadataFile = new File( [JSON.stringify({ labels: { ...mockUploadedRecordingLabels } })], mockMetadataFileName, - { type: 'json' } + { type: 'json' }, ); mockMetadataFile.text = jest.fn(() => Promise.resolve(JSON.stringify({ labels: { ...mockUploadedRecordingLabels } }))); @@ -193,7 +193,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); ['Delete', 'Edit Labels'].map((text) => { @@ -244,7 +244,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.getByText('someRecording')).toBeInTheDocument(); expect(screen.getByText('anotherRecording')).toBeInTheDocument(); @@ -256,7 +256,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.getByText('someLabel: someUpdatedValue')).toBeInTheDocument(); expect(screen.queryByText('someLabel: someValue')).not.toBeInTheDocument(); @@ -268,7 +268,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.queryByText('someRecording')).not.toBeInTheDocument(); }); @@ -284,7 +284,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.getByText('Delete')).toBeInTheDocument(); @@ -302,7 +302,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -323,7 +323,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -357,7 +357,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const checkboxes = screen.getAllByRole('checkbox'); @@ -378,7 +378,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await tlr.act(async () => { @@ -398,7 +398,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await tlr.act(async () => { @@ -417,7 +417,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await tlr.act(async () => { @@ -441,7 +441,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); expect(screen.getByText('someRecording')).toBeInTheDocument(); @@ -466,7 +466,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await user.click(screen.getByLabelText('upload-recording')); @@ -526,7 +526,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await user.click(screen.getByLabelText('upload-recording')); @@ -595,7 +595,7 @@ describe('', () => { mockFileUpload, { someLabel: 'someValue' }, expect.any(Function), - expect.any(Subject) + expect.any(Subject), ); expect(within(modal).queryByText('Submit')).not.toBeInTheDocument(); @@ -614,7 +614,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await user.click(screen.getByLabelText('upload-recording')); @@ -681,7 +681,7 @@ describe('', () => { mockFileUpload, mockUploadedRecordingLabels, expect.any(Function), - expect.any(Subject) + expect.any(Subject), ); expect(within(modal).queryByText('Submit')).not.toBeInTheDocument(); @@ -698,7 +698,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); await user.click(screen.getByLabelText('upload-recording')); @@ -771,7 +771,7 @@ describe('', () => { { preloadState: preloadedState, history: history, - } + }, ); const failTitle = screen.getByText('Error retrieving recordings'); diff --git a/src/test/Recordings/Filters/DurationFilter.test.tsx b/src/test/Recordings/Filters/DurationFilter.test.tsx index 545d789cf7..a288075aef 100644 --- a/src/test/Recordings/Filters/DurationFilter.test.tsx +++ b/src/test/Recordings/Filters/DurationFilter.test.tsx @@ -63,7 +63,7 @@ describe('', () => { durations={emptyFilteredDuration} onContinuousDurationSelect={onContinuousSelect} onDurationInput={onDurationInput} - /> + />, ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -75,7 +75,7 @@ describe('', () => { durations={filteredDurationsWithCont} onContinuousDurationSelect={onContinuousSelect} onDurationInput={onDurationInput} - /> + />, ); const checkBox = screen.getByRole('checkbox', { name: 'Continuous' }); @@ -90,7 +90,7 @@ describe('', () => { durations={filteredDurationsWithoutCont} onContinuousDurationSelect={onContinuousSelect} onDurationInput={onDurationInput} - /> + />, ); const checkBox = screen.getByRole('checkbox', { name: 'Continuous' }); @@ -109,7 +109,7 @@ describe('', () => { durations={filteredDurationsWithoutCont} onContinuousDurationSelect={submitContinuous} onDurationInput={onDurationInput} - /> + />, ); const checkBox = screen.getByRole('checkbox', { name: 'Continuous' }); @@ -135,7 +135,7 @@ describe('', () => { durations={filteredDurationsWithCont} onContinuousDurationSelect={submitContinuous} onDurationInput={onDurationInput} - /> + />, ); const checkBox = screen.getByRole('checkbox', { name: 'Continuous' }); @@ -160,7 +160,7 @@ describe('', () => { durations={emptyFilteredDuration} onContinuousDurationSelect={onContinuousSelect} onDurationInput={submitDuration} - /> + />, ); const durationInput = screen.getByLabelText('duration filter'); @@ -188,7 +188,7 @@ describe('', () => { durations={emptyFilteredDuration} onContinuousDurationSelect={onContinuousSelect} onDurationInput={submitDuration} - /> + />, ); const durationInput = screen.getByLabelText('duration filter'); diff --git a/src/test/Recordings/Filters/LabelFilter.test.tsx b/src/test/Recordings/Filters/LabelFilter.test.tsx index cbf12f80d9..5e7d7e8a21 100644 --- a/src/test/Recordings/Filters/LabelFilter.test.tsx +++ b/src/test/Recordings/Filters/LabelFilter.test.tsx @@ -74,7 +74,7 @@ describe('', () => { let tree; await act(async () => { tree = renderer.create( - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -82,7 +82,7 @@ describe('', () => { it('display label selections when text input is clicked', async () => { const { user } = renderDefault( - + , ); const labelInput = screen.getByLabelText('Filter by label...'); expect(labelInput).toBeInTheDocument(); @@ -103,7 +103,7 @@ describe('', () => { it('display label selections when dropdown arrow is clicked', async () => { const { user } = renderDefault( - + , ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); @@ -125,7 +125,7 @@ describe('', () => { it('should close selection menu when toggled with dropdown arrow', async () => { const { user } = renderDefault( - + , ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); @@ -151,7 +151,7 @@ describe('', () => { it('should close selection menu when toggled with text input', async () => { const { user } = renderDefault( - + , ); const labelInput = screen.getByLabelText('Filter by label...'); expect(labelInput).toBeInTheDocument(); @@ -176,7 +176,7 @@ describe('', () => { it('should not display selected labels', async () => { const { user } = renderDefault( - + , ); const labelInput = screen.getByLabelText('Filter by label...'); expect(labelInput).toBeInTheDocument(); @@ -196,7 +196,7 @@ describe('', () => { const submitLabelInput = jest.fn((labelInput) => emptyFilteredLabels.push(labelInput)); const { user } = renderDefault( - + , ); const labelInput = screen.getByLabelText('Filter by label...'); expect(labelInput).toBeInTheDocument(); diff --git a/src/test/Recordings/Filters/NameFilter.test.tsx b/src/test/Recordings/Filters/NameFilter.test.tsx index 95789d7c1e..a1036e10ad 100644 --- a/src/test/Recordings/Filters/NameFilter.test.tsx +++ b/src/test/Recordings/Filters/NameFilter.test.tsx @@ -60,7 +60,7 @@ describe('', () => { let tree; await act(async () => { tree = renderer.create( - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -68,7 +68,7 @@ describe('', () => { it('display name selections when text input is clicked', async () => { const { user } = renderDefault( - + , ); const nameInput = screen.getByLabelText('Filter by name...'); expect(nameInput).toBeInTheDocument(); @@ -89,7 +89,7 @@ describe('', () => { it('display name selections when dropdown arrow is clicked', async () => { const { user } = renderDefault( - + , ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); expect(dropDownArrow).toBeInTheDocument(); @@ -110,7 +110,7 @@ describe('', () => { it('should close selection menu when toggled with dropdown arrow', async () => { const { user } = renderDefault( - + , ); const dropDownArrow = screen.getByRole('button', { name: 'Options menu' }); @@ -136,7 +136,7 @@ describe('', () => { it('should close selection menu when toggled with text input', async () => { const { user } = renderDefault( - + , ); const nameInput = screen.getByLabelText('Filter by name...'); @@ -162,7 +162,7 @@ describe('', () => { it('should not display selected names', async () => { const { user } = renderDefault( - + , ); const nameInput = screen.getByLabelText('Filter by name...'); @@ -183,7 +183,7 @@ describe('', () => { const submitNameInput = jest.fn((nameInput) => emptyFilteredNames.push(nameInput)); const { user } = renderDefault( - + , ); const nameInput = screen.getByLabelText('Filter by name...'); diff --git a/src/test/Recordings/Filters/RecordingStateFilter.test.tsx b/src/test/Recordings/Filters/RecordingStateFilter.test.tsx index 5bd9ff715e..667a4b918b 100644 --- a/src/test/Recordings/Filters/RecordingStateFilter.test.tsx +++ b/src/test/Recordings/Filters/RecordingStateFilter.test.tsx @@ -63,7 +63,7 @@ describe('', () => { let tree; await act(async () => { tree = renderer.create( - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -71,7 +71,7 @@ describe('', () => { it('should display state selections when dropdown is clicked', async () => { const { user } = renderDefault( - + , ); const stateDropDown = screen.getByRole('button', { name: 'Options menu' }); @@ -93,7 +93,7 @@ describe('', () => { it('should close state selections when dropdown is toggled', async () => { const { user } = renderDefault( - + , ); const stateDropDown = screen.getByRole('button', { name: 'Options menu' }); @@ -119,7 +119,7 @@ describe('', () => { it('should display filtered states as checked', async () => { const { user } = renderDefault( - + , ); const stateDropDown = screen.getByRole('button', { name: 'Options menu' }); @@ -154,7 +154,7 @@ describe('', () => { }); const { user } = renderDefault( - + , ); const stateDropDown = screen.getByRole('button', { name: 'Options menu' }); @@ -195,7 +195,7 @@ describe('', () => { }); const { user } = renderDefault( - + , ); const stateDropDown = screen.getByRole('button', { name: 'Options menu' }); diff --git a/src/test/Recordings/RecordingFilters.test.tsx b/src/test/Recordings/RecordingFilters.test.tsx index f130b5090d..73b45c347b 100644 --- a/src/test/Recordings/RecordingFilters.test.tsx +++ b/src/test/Recordings/RecordingFilters.test.tsx @@ -158,7 +158,7 @@ describe('', () => { , { preloadState: preloadedState, - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -186,7 +186,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -214,7 +214,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -254,7 +254,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -302,7 +302,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -340,7 +340,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); const categoryDropDown = screen.getByLabelText('Category Dropdown'); @@ -393,7 +393,7 @@ describe('', () => { { preloadState: preloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); // Label group @@ -456,7 +456,7 @@ describe('', () => { { preloadState: emptyPreloadedState, user: userEvent.setup({ advanceTimers: jest.advanceTimersByTime }), - } + }, ); activeCategoryOptions.forEach((category) => { diff --git a/src/test/Recordings/RecordingLabelsPanel.test.tsx b/src/test/Recordings/RecordingLabelsPanel.test.tsx index ec7f1bbd21..3eeba484a1 100644 --- a/src/test/Recordings/RecordingLabelsPanel.test.tsx +++ b/src/test/Recordings/RecordingLabelsPanel.test.tsx @@ -66,7 +66,7 @@ describe('', () => { tree = renderer.create( } /> - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); @@ -76,7 +76,7 @@ describe('', () => { renderDefault( } /> - + , ); expect(screen.getByText('Bulk Edit Labels')).toBeInTheDocument(); expect(screen.getAllByLabelText('Resize').length).toBe(1); diff --git a/src/test/Recordings/Recordings.test.tsx b/src/test/Recordings/Recordings.test.tsx index d7f4e5200e..a7cb4ba178 100644 --- a/src/test/Recordings/Recordings.test.tsx +++ b/src/test/Recordings/Recordings.test.tsx @@ -137,7 +137,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Recordings/RecordingsTable.test.tsx b/src/test/Recordings/RecordingsTable.test.tsx index 1eb2ad073e..3134b7ab3f 100644 --- a/src/test/Recordings/RecordingsTable.test.tsx +++ b/src/test/Recordings/RecordingsTable.test.tsx @@ -88,7 +88,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); expect(screen.getByText('Fake Button')).toBeInTheDocument(); @@ -108,7 +108,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); expect(screen.getByLabelText('Test Table')).toBeInTheDocument(); @@ -134,7 +134,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); const table = screen.getByLabelText('Test Table'); @@ -157,7 +157,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); expect(screen.getByText('some error')).toBeInTheDocument(); @@ -177,7 +177,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); const spinner = screen.getByRole('progressbar'); @@ -198,7 +198,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); expect(screen.getByText(`No ${fakeTableTitle}`)).toBeInTheDocument(); @@ -218,7 +218,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); const headerCheckAll = screen.getByLabelText('Select all rows'); @@ -241,7 +241,7 @@ describe('', () => { onHeaderCheck={mockHeaderCheckCallback} > {fakeTableRows} - + , ); const headerCheckAll = screen.getByLabelText('Select all rows'); diff --git a/src/test/Rules/Rules.test.tsx b/src/test/Rules/Rules.test.tsx index 2097b3c5c5..e38b6803e3 100644 --- a/src/test/Rules/Rules.test.tsx +++ b/src/test/Rules/Rules.test.tsx @@ -123,7 +123,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/SecurityPanel/Credentials/StoreCredentials.test.tsx b/src/test/SecurityPanel/Credentials/StoreCredentials.test.tsx index 0e36bde8c8..ea2642d506 100644 --- a/src/test/SecurityPanel/Credentials/StoreCredentials.test.tsx +++ b/src/test/SecurityPanel/Credentials/StoreCredentials.test.tsx @@ -134,12 +134,18 @@ const apiRequestSpy = jest .mockReturnValueOnce(of([mockCredential, mockAnotherCredential])) // decrements the correct count and updates the correct nested table when a lost target notification is received .mockReturnValueOnce( - of([mockCredential, { ...mockAnotherCredential, numMatchingTargets: mockAnotherCredential.numMatchingTargets - 1 }]) + of([ + mockCredential, + { ...mockAnotherCredential, numMatchingTargets: mockAnotherCredential.numMatchingTargets - 1 }, + ]), ) .mockReturnValueOnce(of([mockCredential, mockAnotherCredential])) // increments the correct count and updates the correct nested table when a found target notification is received .mockReturnValueOnce( - of([mockCredential, { ...mockAnotherCredential, numMatchingTargets: mockAnotherCredential.numMatchingTargets + 1 }]) + of([ + mockCredential, + { ...mockAnotherCredential, numMatchingTargets: mockAnotherCredential.numMatchingTargets + 1 }, + ]), ) .mockReturnValueOnce(of([])) // opens the auth modal when Add is clicked @@ -163,7 +169,7 @@ jest of({ ...mockAnotherMatchedCredentialResponse, targets: mockAnotherMatchedCredentialResponse.targets.concat(mockYetAnotherMatchingTarget), - }) + }), ) .mockReturnValue(throwError(() => new Error('Too many calls'))); @@ -226,7 +232,7 @@ describe('', () => { const otherTargets = targets.filter((t) => t.connectUrl !== mockTarget.connectUrl); otherTargets.forEach(({ alias, connectUrl }) => - expect(screen.queryByText(`${alias} (${connectUrl})`)).not.toBeInTheDocument() + expect(screen.queryByText(`${alias} (${connectUrl})`)).not.toBeInTheDocument(), ); await user.click(expandButtons[1]); @@ -272,7 +278,7 @@ describe('', () => { expect(screen.getByText(`${mockTarget.alias} (${mockTarget.connectUrl})`)).toBeInTheDocument(); expect( - screen.queryByText(`${mockYetAnotherMatchingTarget.alias} (${mockYetAnotherMatchingTarget.connectUrl})`) + screen.queryByText(`${mockYetAnotherMatchingTarget.alias} (${mockYetAnotherMatchingTarget.connectUrl})`), ).not.toBeInTheDocument(); await user.click(expandButtons[1]); diff --git a/src/test/Settings/AutoRefresh.test.tsx b/src/test/Settings/AutoRefresh.test.tsx index d49ba7e9ee..85db2c5660 100644 --- a/src/test/Settings/AutoRefresh.test.tsx +++ b/src/test/Settings/AutoRefresh.test.tsx @@ -40,7 +40,7 @@ describe('', () => { tree = renderer.create( {React.createElement(AutoRefresh.content, null)} - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Settings/AutomatedAnalysisConfig.test.tsx b/src/test/Settings/AutomatedAnalysisConfig.test.tsx index f8dfde0773..0a44e386f8 100644 --- a/src/test/Settings/AutomatedAnalysisConfig.test.tsx +++ b/src/test/Settings/AutomatedAnalysisConfig.test.tsx @@ -40,7 +40,7 @@ describe('', () => { tree = renderer.create( {React.createElement(AutomatedAnalysisConfig.content, null)} - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Settings/DeletionDialogControl.test.tsx b/src/test/Settings/DeletionDialogControl.test.tsx index 7ef0cd09ee..2aac51564c 100644 --- a/src/test/Settings/DeletionDialogControl.test.tsx +++ b/src/test/Settings/DeletionDialogControl.test.tsx @@ -42,7 +42,7 @@ describe('', () => { tree = renderer.create( {React.createElement(DeletionDialogControl.content, null)} - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Settings/NotificationControl.test.tsx b/src/test/Settings/NotificationControl.test.tsx index 5551c7f388..a776d46cad 100644 --- a/src/test/Settings/NotificationControl.test.tsx +++ b/src/test/Settings/NotificationControl.test.tsx @@ -51,7 +51,7 @@ describe('', () => { tree = renderer.create( {React.createElement(NotificationControl.content, null)} - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Settings/Settings.test.tsx b/src/test/Settings/Settings.test.tsx index 4998c4da44..d878ef0147 100644 --- a/src/test/Settings/Settings.test.tsx +++ b/src/test/Settings/Settings.test.tsx @@ -159,7 +159,7 @@ describe('', () => { - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Settings/WebSocketDebounce.test.tsx b/src/test/Settings/WebSocketDebounce.test.tsx index ff378eee81..c726972447 100644 --- a/src/test/Settings/WebSocketDebounce.test.tsx +++ b/src/test/Settings/WebSocketDebounce.test.tsx @@ -38,7 +38,7 @@ describe('', () => { tree = renderer.create( {React.createElement(WebSocketDebounce.content, null)} - + , ); }); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/src/test/Shared/Services/Login.service.test.tsx b/src/test/Shared/Services/Login.service.test.tsx index a2755e9605..f571c9d54c 100644 --- a/src/test/Shared/Services/Login.service.test.tsx +++ b/src/test/Shared/Services/Login.service.test.tsx @@ -184,7 +184,7 @@ describe('Login.service', () => { new Headers({ 'X-Location': 'https://oauth-server.example.com/logout', 'access-control-expose-headers': 'Location', - }) + }), ); authRedirectResp = createResponse( 302, @@ -202,7 +202,7 @@ describe('Login.service', () => { data: { result: undefined, }, - } + }, ); // Submit is unimplemented in JSDOM submitSpy = jest.spyOn(HTMLFormElement.prototype, 'submit').mockImplementation(); @@ -269,7 +269,7 @@ describe('Login.service', () => { expect(rawInput).toBeInstanceOf(HTMLInputElement); const input = rawInput as HTMLInputElement; expect(input.value).toEqual( - '/oauth/authorize?client_id=system%3Aserviceaccount%3Amy-namespace%3Amy-cryostat&response_type=token&response_mode=fragment&scope=user%3Acheck-access+role%3Acryostat-operator-oauth-client%3Amy-namespace' + '/oauth/authorize?client_id=system%3Aserviceaccount%3Amy-namespace%3Amy-cryostat&response_type=token&response_mode=fragment&scope=user%3Acheck-access+role%3Acryostat-operator-oauth-client%3Amy-namespace', ); expect(input.name).toEqual('then'); expect(input.type).toEqual('hidden'); @@ -311,7 +311,7 @@ describe('Login.service', () => { new Headers({ 'X-Location': 'https://oauth-server.example.com/logout', 'access-control-expose-headers': 'Location', - }) + }), ); mockFromFetch.mockReturnValueOnce(of(badLogoutResp)).mockReturnValueOnce(of(authRedirectResp)); }); @@ -320,7 +320,7 @@ describe('Login.service', () => { const result = await firstValueFrom(svc.setLoggedOut()); expect(result).toBeFalsy(); expect(logSpy).toHaveBeenCalledWith( - expect.stringContaining('"message":"Could not find OAuth logout endpoint"') + expect.stringContaining('"message":"Could not find OAuth logout endpoint"'), ); }); }); @@ -332,7 +332,7 @@ describe('Login.service', () => { true, new Headers({ 'access-control-expose-headers': 'Location', - }) + }), ); mockFromFetch.mockReturnValueOnce(of(badLogoutResp)).mockReturnValueOnce(of(authRedirectResp)); }); @@ -341,7 +341,7 @@ describe('Login.service', () => { const result = await firstValueFrom(svc.setLoggedOut()); expect(result).toBeFalsy(); expect(logSpy).toHaveBeenCalledWith( - expect.stringContaining('"message":"Could not find OAuth logout endpoint"') + expect.stringContaining('"message":"Could not find OAuth logout endpoint"'), ); }); }); @@ -364,7 +364,7 @@ describe('Login.service', () => { data: { result: undefined, }, - } + }, ); mockFromFetch.mockReturnValueOnce(of(logoutResp)).mockReturnValueOnce(of(badAuthRedirectResp)); }); @@ -373,7 +373,7 @@ describe('Login.service', () => { const result = await firstValueFrom(svc.setLoggedOut()); expect(result).toBeFalsy(); expect(logSpy).toHaveBeenCalledWith( - expect.stringContaining('"message":"Could not find OAuth login endpoint"') + expect.stringContaining('"message":"Could not find OAuth login endpoint"'), ); }); }); @@ -394,7 +394,7 @@ describe('Login.service', () => { data: { result: undefined, }, - } + }, ); mockFromFetch.mockReturnValueOnce(of(logoutResp)).mockReturnValueOnce(of(badAuthRedirectResp)); }); @@ -403,7 +403,7 @@ describe('Login.service', () => { const result = await firstValueFrom(svc.setLoggedOut()); expect(result).toBeFalsy(); expect(logSpy).toHaveBeenCalledWith( - expect.stringContaining('"message":"Could not find OAuth login endpoint"') + expect.stringContaining('"message":"Could not find OAuth login endpoint"'), ); }); });