diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts index 22372bc5520a..3bcd85eb110d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts @@ -150,7 +150,7 @@ describe( agHelper.GetNClick(buttongroupwidgetlocators.menu); agHelper.GetNClick(buttongroupwidgetlocators.menuSettingInPropPane, 0); propPane.TogglePropertyState("Disabled", "On"); - propPane.TogglePropertyState("Visible", "On", "updateLayout", false); + propPane.TogglePropertyState("Visible", "On", "updateLayout"); agHelper.GetNClick(propPane._goBackToProperty); deployMode.DeployApp(); agHelper.ClickButton("More"); diff --git a/app/client/src/ce/actions/applicationActions.ts b/app/client/src/ce/actions/applicationActions.ts index bb8147038959..e1c32f5c9e1b 100644 --- a/app/client/src/ce/actions/applicationActions.ts +++ b/app/client/src/ce/actions/applicationActions.ts @@ -220,9 +220,18 @@ export const setIsReconnectingDatasourcesModalOpen = (payload: { payload, }); -export const setWorkspaceIdForImport = (workspaceId?: string) => ({ +export const setWorkspaceIdForImport = ({ + editorId = "", + workspaceId, +}: { + editorId: string; + workspaceId?: string; +}) => ({ type: ReduxActionTypes.SET_WORKSPACE_ID_FOR_IMPORT, - payload: workspaceId, + payload: { + workspaceId, + editorId, + }, }); export const setPageIdForImport = (pageId?: string) => ({ diff --git a/app/client/src/ce/actions/environmentAction.ts b/app/client/src/ce/actions/environmentAction.ts index ff48d6d74760..cf28077c36d7 100644 --- a/app/client/src/ce/actions/environmentAction.ts +++ b/app/client/src/ce/actions/environmentAction.ts @@ -8,10 +8,15 @@ export const setCurrentEditingEnvironmentID = (currentEditingId: string) => ({ }); // Redux action to fetch environments -export const fetchingEnvironmentConfigs = ( - workspaceId: string, +export const fetchingEnvironmentConfigs = ({ + editorId, fetchDatasourceMeta = false, -) => ({ + workspaceId, +}: { + editorId: string; + fetchDatasourceMeta: boolean; + workspaceId: string; +}) => ({ type: "", - payload: { workspaceId, fetchDatasourceMeta }, + payload: { workspaceId, editorId, fetchDatasourceMeta }, }); diff --git a/app/client/src/ce/components/SwitchEnvironment/index.tsx b/app/client/src/ce/components/SwitchEnvironment/index.tsx index 138c7df6c0ce..86c89bb4edbe 100644 --- a/app/client/src/ce/components/SwitchEnvironment/index.tsx +++ b/app/client/src/ce/components/SwitchEnvironment/index.tsx @@ -14,7 +14,6 @@ import { } from "@appsmith/selectors/rampSelectors"; import { isDatasourceInViewMode } from "selectors/ui"; import { matchDatasourcePath, matchSAASGsheetsPath } from "constants/routes"; -import { useLocation } from "react-router"; import { RAMP_NAME, RampFeature, @@ -48,6 +47,8 @@ const StyledIcon = styled(Icon)` interface Props { viewMode?: boolean; + editorId: string; + onChangeEnv?: () => void; } interface EnvironmentType { @@ -74,7 +75,8 @@ const TooltipLink = styled(Link)` `; export default function SwitchEnvironment({}: Props) { - const [diableSwitchEnvironment, setDiableSwitchEnvironment] = useState(false); + const [disableSwitchEnvironment, setDisableSwitchEnvironment] = + useState(false); // Fetching feature flags from the store and checking if the feature is enabled const showRampSelector = showProductRamps(RAMP_NAME.MULTIPLE_ENV, true); const canShowRamp = useSelector(showRampSelector); @@ -83,14 +85,14 @@ export default function SwitchEnvironment({}: Props) { feature: RampFeature.MultipleEnv, }); const rampLink = useSelector(rampLinkSelector); - const location = useLocation(); + //listen to url change and disable switch environment if datasource page is open useEffect(() => { - setDiableSwitchEnvironment( + setDisableSwitchEnvironment( !!matchDatasourcePath(window.location.pathname) || !!matchSAASGsheetsPath(window.location.pathname), ); - }, [location.pathname]); + }, [window.location.pathname]); //URL for datasource edit and review page is same //this parameter helps us to differentiate between the two. const isDatasourceViewMode = useSelector(isDatasourceInViewMode); @@ -125,7 +127,7 @@ export default function SwitchEnvironment({}: Props) { return (