Skip to content

Commit 369d8ec

Browse files
committed
fix multi step, always use config props
1 parent 4c54dd6 commit 369d8ec

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

web-common/src/features/sources/modal/AddDataForm.svelte

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,23 @@
383383
enhance={paramsEnhance}
384384
onSubmit={paramsSubmit}
385385
>
386-
<GCSMultiStepForm
387-
properties={filteredParamsProperties}
388-
{paramsForm}
389-
paramsErrors={$paramsErrors}
390-
{onStringInputChange}
391-
{handleFileUpload}
392-
/>
386+
{#if connector.name === "gcs"}
387+
<GCSMultiStepForm
388+
properties={filteredParamsProperties}
389+
{paramsForm}
390+
paramsErrors={$paramsErrors}
391+
{onStringInputChange}
392+
{handleFileUpload}
393+
/>
394+
{:else}
395+
<FormRenderer
396+
properties={filteredParamsProperties}
397+
form={paramsForm}
398+
errors={$paramsErrors}
399+
{onStringInputChange}
400+
uploadFile={handleFileUpload}
401+
/>
402+
{/if}
393403
</AddDataFormSection>
394404
{:else}
395405
<!-- GCS Step 2: Source configuration -->

web-common/src/features/sources/modal/AddDataFormManager.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,18 @@ export class AddDataFormManager {
8989

9090
const isSourceForm = formType === "source";
9191
const isConnectorForm = formType === "connector";
92+
const isMultiStep = MULTI_STEP_CONNECTORS.includes(connector.name ?? "");
9293

9394
// Base properties
95+
// For multi-step connectors (e.g., gcs, azure), step 1 always configures the connector,
96+
// even when the overall formType is "source". So prefer configProperties here.
9497
this.properties =
95-
(isSourceForm
96-
? connector.sourceProperties
97-
: connector.configProperties?.filter((p) => p.key !== "dsn")) ?? [];
98+
(isMultiStep
99+
? connector.configProperties
100+
: isSourceForm
101+
? connector.sourceProperties
102+
: connector.configProperties
103+
)?.filter((p) => p.key !== "dsn") ?? [];
98104

99105
// Filter properties based on connector type
100106
this.filteredParamsProperties = (() => {

web-common/src/features/sources/modal/AddDataModal.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
});
7272
7373
function goToConnectorForm(connector: V1ConnectorDriver) {
74+
// Ensure multi-step connectors always start on the connector step
75+
resetConnectorStep();
7476
const state = {
7577
step: 2,
7678
selectedConnector: connector,

0 commit comments

Comments
 (0)