diff --git a/app/client/src/ce/selectors/modulesSelector.ts b/app/client/src/ce/selectors/modulesSelector.ts index 359d327ad5..82ad037603 100644 --- a/app/client/src/ce/selectors/modulesSelector.ts +++ b/app/client/src/ce/selectors/modulesSelector.ts @@ -16,3 +16,6 @@ export const showUIModulesList = (state: DefaultRootState) => false; export const getActionsInCurrentModule = (state: DefaultRootState) => []; export const getJSCollectionsInCurrentModule = (state: DefaultRootState) => []; + +export const getModuleInstanceActions = (state: DefaultRootState) => []; +export const getModuleInstanceJSCollections = (state: DefaultRootState) => []; diff --git a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/index.tsx b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/index.tsx index eadd5fc1d6..b2a2a1157e 100644 --- a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/index.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/index.tsx @@ -5,10 +5,15 @@ import { getCodeFromMoustache, isValueValidURL } from "../utils"; import { getFieldFromValue } from "../helpers"; import { useSelector } from "react-redux"; import { getDataTreeForActionCreator } from "sagas/selectors"; +import { useLocation } from "react-router"; +import { getIDETypeByUrl } from "ee/entities/IDE/utils"; +import { IDE_TYPE } from "ee/IDE/Interfaces/IDETypes"; function FieldGroup(props: FieldGroupProps) { const { isChainedAction = false, ...otherProps } = props; const dataTree = useSelector(getDataTreeForActionCreator); + const location = useLocation(); + const ideType = getIDETypeByUrl(location.pathname); const NAVIGATE_TO_TAB_SWITCHER: Array = [ { @@ -42,9 +47,18 @@ function FieldGroup(props: FieldGroupProps) { }, ]; - const [activeTabNavigateTo, setActiveTabNavigateTo] = useState( - NAVIGATE_TO_TAB_SWITCHER[isValueValidURL(props.value) ? 1 : 0], - ); + const defaultNavigateToTab = + ideType === IDE_TYPE.UIPackage + ? NAVIGATE_TO_TAB_SWITCHER[1] + : NAVIGATE_TO_TAB_SWITCHER[isValueValidURL(props.value) ? 1 : 0]; + + const navigateToSwitches = + ideType === IDE_TYPE.UIPackage + ? [NAVIGATE_TO_TAB_SWITCHER[1]] + : NAVIGATE_TO_TAB_SWITCHER; + + const [activeTabNavigateTo, setActiveTabNavigateTo] = + useState(defaultNavigateToTab); const [activeTabApiAndQueryCallback, setActiveTabApiAndQueryCallback] = useState(apiAndQueryCallbackTabSwitches[0]); @@ -69,7 +83,7 @@ function FieldGroup(props: FieldGroupProps) { activeNavigateToTab: activeTabNavigateTo, activeTabApiAndQueryCallback: activeTabApiAndQueryCallback, apiAndQueryCallbackTabSwitches: apiAndQueryCallbackTabSwitches, - navigateToSwitches: NAVIGATE_TO_TAB_SWITCHER, + navigateToSwitches, })}