diff --git a/apps/client/src/features/app-settings/panel/feature-settings-panel/custom-fields/CustomFieldForm.tsx b/apps/client/src/features/app-settings/panel/feature-settings-panel/custom-fields/CustomFieldForm.tsx index 21d79aa27..ee5a76d12 100644 --- a/apps/client/src/features/app-settings/panel/feature-settings-panel/custom-fields/CustomFieldForm.tsx +++ b/apps/client/src/features/app-settings/panel/feature-settings-panel/custom-fields/CustomFieldForm.tsx @@ -67,7 +67,7 @@ export default function CustomFieldForm(props: CustomFieldsFormProps) { return (
- Label + Label (only alphanumeric characters are allowed) {errors.label && {errors.label.message}} { + setImportFlow('none'); + setRundown(null); + setHasFile('none'); + setWorksheets(null); + setCustomFields(null); + setError(''); + }; + const isExcelFlow = importFlow === 'excel'; const isGSheetFlow = importFlow === 'gsheet'; const isAuthenticated = authenticationStatus === 'authenticated'; const showInput = importFlow === 'none'; - const showSuccess = importFlow === 'finished'; + const showCompleted = importFlow === 'finished'; const showAuth = isGSheetFlow && !isAuthenticated; const showImportMap = (isGSheetFlow && isAuthenticated) || (isExcelFlow && hasFile === 'done'); const showReview = rundown !== null && customFields !== null; @@ -189,10 +198,18 @@ export default function SourcesPanel() {
)} - {showSuccess && ( -
- Import successful -
@@ -200,6 +217,7 @@ export default function SourcesPanel() { {showAuth && } {showImportMap && !showReview && ( void; onSubmitExport: (importMap: ImportMap) => Promise; onSubmitImport: (importMap: ImportMap) => Promise; } export default function ImportMapForm(props: ImportMapFormProps) { - const { isSpreadsheet, onCancel, onSubmitExport, onSubmitImport } = props; + const { hasErrors, isSpreadsheet, onCancel, onSubmitExport, onSubmitImport } = props; const namedImportMap = getPersistedOptions(); const { revoke } = useGoogleSheet(); const { @@ -78,7 +79,7 @@ export default function ImportMapForm(props: ImportMapFormProps) { const isLoading = Boolean(loading); const canSubmitSpreadsheet = isSpreadsheet && !isLoading; const canSubmitGSheet = !isLoading; - const canSubmit = isValid && (canSubmitSpreadsheet || canSubmitGSheet); + const canSubmit = !hasErrors && isValid && (canSubmitSpreadsheet || canSubmitGSheet); return (