From 1277a6f5396c41b06d795fb0f0bcdab89d73ddd2 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Tue, 25 Mar 2025 15:31:17 +0530 Subject: [PATCH] chore: update carbon integration modal (#39901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the CE PR for updating carbon integration modal /ok-to-test tags="@tag.Sanity" > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 6067489ccd5c50e6d558d6d50cb52705a1bffefd > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Tue, 25 Mar 2025 09:28:13 UTC ## Summary by CodeRabbit - **New Features** - Updated the saving indicator in the datasource editor to display a saving state only when the active plugin is in the process of saving. This refinement provides more accurate visual feedback on data saving actions. --- .../pages/Editor/DataSourceEditor/index.tsx | 2 +- .../Editor/SaaSEditor/DatasourceForm.tsx | 2 +- .../entityReducers/datasourceReducer.ts | 20 ++++++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/client/src/pages/Editor/DataSourceEditor/index.tsx b/app/client/src/pages/Editor/DataSourceEditor/index.tsx index d3c531ced9..0e4634cbd9 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/index.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/index.tsx @@ -1199,7 +1199,7 @@ const mapStateToProps = (state: AppState, props: any): ReduxStateProps => { formName, isInsideReconnectModal: props.isInsideReconnectModal ?? false, pluginId, - isSaving: datasources.loading, + isSaving: datasources.loading && datasources.loadingPluginId === pluginId, isDeleting: !!(datasource as Datasource)?.isDeleting, isPluginAuthorized: !!isPluginAuthorized, isTesting: datasources.isTesting, diff --git a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx index 575595a8fd..75e4dd88ec 100644 --- a/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx +++ b/app/client/src/pages/Editor/SaaSEditor/DatasourceForm.tsx @@ -858,7 +858,7 @@ const mapStateToProps = (state: AppState, props: any) => { datasourceButtonConfiguration, datasourceId, documentationLink: documentationLinks[pluginId], - isSaving: datasources.loading, + isSaving: datasources.loading && datasources.loadingPluginId === pluginId, isDeleting: !!datasource?.isDeleting, isTesting: datasources.isTesting, formData: formData, diff --git a/app/client/src/reducers/entityReducers/datasourceReducer.ts b/app/client/src/reducers/entityReducers/datasourceReducer.ts index f0c3d8f881..7118b1d17f 100644 --- a/app/client/src/reducers/entityReducers/datasourceReducer.ts +++ b/app/client/src/reducers/entityReducers/datasourceReducer.ts @@ -19,6 +19,8 @@ import { assign } from "lodash"; export interface DatasourceDataState { list: Datasource[]; loading: boolean; + // this prop tells which plugin is being loaded. Mainly used on the save button of datasource editor page. + loadingPluginId: string | null; loadingTokenForDatasourceId: string | null; isTesting: boolean; isListing: boolean; // fetching unconfigured datasource list @@ -49,6 +51,7 @@ export interface DatasourceDataState { const initialState: DatasourceDataState = { list: [], loading: false, + loadingPluginId: null, loadingTokenForDatasourceId: null, isTesting: false, isListing: false, @@ -118,8 +121,15 @@ const datasourceReducer = createReducer(initialState, { [ReduxActionTypes.FETCH_DATASOURCES_INIT]: (state: DatasourceDataState) => { return { ...state, loading: true }; }, - [ReduxActionTypes.CREATE_DATASOURCE_INIT]: (state: DatasourceDataState) => { - return { ...state, loading: true }; + [ReduxActionTypes.CREATE_DATASOURCE_INIT]: ( + state: DatasourceDataState, + action: ReduxAction<{ pluginId: string }>, + ) => { + return { + ...state, + loading: true, + loadingPluginId: action.payload.pluginId, + }; }, [ReduxActionTypes.CREATE_DATASOURCE_FROM_FORM_INIT]: ( state: DatasourceDataState, @@ -130,7 +140,11 @@ const datasourceReducer = createReducer(initialState, { state: DatasourceDataState, action: ReduxAction<{ loading?: boolean }>, ) => { - return { ...state, loading: !!action.payload.loading }; + return { + ...state, + loading: !!action.payload.loading, + loadingPluginId: null, + }; }, [ReduxActionTypes.UPDATE_DATASOURCE_INIT]: (state: DatasourceDataState) => { return { ...state, loading: true };