From c868fe5d4135ed1a00e5fb09bdaa2091d593cd92 Mon Sep 17 00:00:00 2001 From: regexowl Date: Wed, 6 Aug 2025 11:07:24 +0200 Subject: [PATCH] Wizard: Fix some lint warnings This resolves lint warnings in `Components/CreateImageWizard`, warnings in `/steps` and `/utilities` sub-directories still need addressing. --- .../CreateImageWizard/CreateImageWizard.tsx | 16 +++------------- .../CreateImageWizard/ImportImageWizard.tsx | 2 +- src/Components/CreateImageWizard/validators.ts | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Components/CreateImageWizard/CreateImageWizard.tsx b/src/Components/CreateImageWizard/CreateImageWizard.tsx index 1cd8ad5f..a2e529d3 100644 --- a/src/Components/CreateImageWizard/CreateImageWizard.tsx +++ b/src/Components/CreateImageWizard/CreateImageWizard.tsx @@ -80,8 +80,6 @@ import { selectAwsShareMethod, selectAwsSourceId, selectAzureResourceGroup, - selectAzureShareMethod, - selectAzureSource, selectAzureSubscriptionId, selectAzureTenantId, selectDistribution, @@ -263,11 +261,9 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => { const gcpShareMethod = useAppSelector(selectGcpShareMethod); const gcpEmail = useAppSelector(selectGcpEmail); // AZURE - const azureShareMethod = useAppSelector(selectAzureShareMethod); const azureTenantId = useAppSelector(selectAzureTenantId); const azureSubscriptionId = useAppSelector(selectAzureSubscriptionId); const azureResourceGroup = useAppSelector(selectAzureResourceGroup); - const azureSource = useAppSelector(selectAzureSource); // Registration const registrationValidation = useRegistrationValidation(); // Snapshots @@ -437,15 +433,9 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => { footer={ } diff --git a/src/Components/CreateImageWizard/ImportImageWizard.tsx b/src/Components/CreateImageWizard/ImportImageWizard.tsx index 786bce18..2905e83a 100644 --- a/src/Components/CreateImageWizard/ImportImageWizard.tsx +++ b/src/Components/CreateImageWizard/ImportImageWizard.tsx @@ -15,7 +15,7 @@ const ImportImageWizard = () => { const location = useLocation(); const addNotification = useAddNotification(); const locationState = location.state as { blueprint?: wizardState }; - const blueprint = locationState?.blueprint; + const blueprint = locationState.blueprint; useEffect(() => { if (blueprint) { dispatch(loadWizardState(blueprint)); diff --git a/src/Components/CreateImageWizard/validators.ts b/src/Components/CreateImageWizard/validators.ts index ad3c8dd4..b5e971b2 100644 --- a/src/Components/CreateImageWizard/validators.ts +++ b/src/Components/CreateImageWizard/validators.ts @@ -86,7 +86,7 @@ export const isSshKeyValid = (sshKey: string) => { export const getDuplicateMountPoints = (partitions: Partition[]): string[] => { const mountPointSet: Set = new Set(); const duplicates: string[] = []; - if (!partitions) { + if (partitions.length < 2) { return []; } for (const partition of partitions) {