diff --git a/app/client/src/actions/pageActions.tsx b/app/client/src/actions/pageActions.tsx index 22cfe873e309..462cbb1aeb40 100644 --- a/app/client/src/actions/pageActions.tsx +++ b/app/client/src/actions/pageActions.tsx @@ -73,7 +73,7 @@ export interface FetchPublishedPageActionPayload { export interface FetchPublishedPageResourcesPayload { pageId: string; - basePageId: string; + applicationId: string; } export const fetchPublishedPageAction = ( @@ -297,14 +297,14 @@ export const clonePageSuccess = ({ // Fetches resources required for published page, currently only used for fetching actions // In future we can reuse this for fetching other page level resources in published mode -export const fetchPublishedPageResources = ({ - basePageId, - pageId, -}: FetchPublishedPageResourcesPayload): ReduxAction => ({ +export const fetchPublishedPageResourcesAction = ( + pageId: string, + applicationId: string, +): ReduxAction => ({ type: ReduxActionTypes.FETCH_PUBLISHED_PAGE_RESOURCES_INIT, payload: { pageId, - basePageId, + applicationId, }, }); diff --git a/app/client/src/ce/constants/ReduxActionConstants.tsx b/app/client/src/ce/constants/ReduxActionConstants.tsx index 2f6381de77f7..1e94ce4336cf 100644 --- a/app/client/src/ce/constants/ReduxActionConstants.tsx +++ b/app/client/src/ce/constants/ReduxActionConstants.tsx @@ -981,8 +981,6 @@ const AppViewActionTypes = { SET_APP_VIEWER_HEADER_HEIGHT: "SET_APP_VIEWER_HEADER_HEIGHT", SET_APP_SIDEBAR_PINNED: "SET_APP_SIDEBAR_PINNED", FETCH_PUBLISHED_PAGE_RESOURCES_INIT: "FETCH_PUBLISHED_PAGE_RESOURCES_INIT", - FETCH_PUBLISHED_PAGE_RESOURCES_SUCCESS: - "FETCH_PUBLISHED_PAGE_RESOURCES_SUCCESS", }; const AppViewActionErrorTypes = { diff --git a/app/client/src/ce/sagas/PageSagas.tsx b/app/client/src/ce/sagas/PageSagas.tsx index aeee2a7b60c4..2f7003b7754a 100644 --- a/app/client/src/ce/sagas/PageSagas.tsx +++ b/app/client/src/ce/sagas/PageSagas.tsx @@ -395,9 +395,9 @@ export function* fetchPublishedPageResourcesSaga( action: ReduxAction, ) { try { - const { basePageId, pageId } = action.payload; + const { applicationId, pageId } = action.payload; - const params = { defaultPageId: basePageId }; + const params = { defaultPageId: pageId }; const initConsolidatedApiResponse: ApiResponse = yield ConsolidatedPageLoadApi.getConsolidatedPageLoadDataView(params); @@ -420,11 +420,8 @@ export function* fetchPublishedPageResourcesSaga( ); // NOTE: fetchActionsForView is used here to update publishedActions in redux store and not to fetch actions again - yield put(fetchActionsForView({ applicationId: "", publishedActions })); + yield put(fetchActionsForView({ applicationId, publishedActions })); yield put(fetchAllPageEntityCompletion([executePageLoadActions()])); - yield put({ - type: ReduxActionTypes.FETCH_PUBLISHED_PAGE_RESOURCES_SUCCESS, - }); } } catch (error) { yield put({ diff --git a/app/client/src/pages/AppViewer/index.tsx b/app/client/src/pages/AppViewer/index.tsx index abe1ebbf3884..f17badca3c58 100644 --- a/app/client/src/pages/AppViewer/index.tsx +++ b/app/client/src/pages/AppViewer/index.tsx @@ -28,7 +28,7 @@ import { useSelector } from "react-redux"; import BrandingBadge from "./BrandingBadge"; import { setAppViewHeaderHeight } from "actions/appViewActions"; import { CANVAS_SELECTOR } from "constants/WidgetConstants"; -import { fetchPublishedPageResources } from "actions/pageActions"; +import { fetchPublishedPageResourcesAction } from "actions/pageActions"; import usePrevious from "utils/hooks/usePrevious"; import { getIsBranchUpdated } from "../utils"; import { APP_MODE } from "entities/App"; @@ -162,11 +162,9 @@ function AppViewer(props: Props) { )?.pageId; if (pageId) { + // Used for fetching page resources dispatch( - fetchPublishedPageResources({ - basePageId, - pageId, - }), + fetchPublishedPageResourcesAction(basePageId, baseApplicationId), ); } } diff --git a/app/client/src/reducers/uiReducers/appViewReducer.tsx b/app/client/src/reducers/uiReducers/appViewReducer.tsx index 05ffcdbfcad3..1d3671392f24 100644 --- a/app/client/src/reducers/uiReducers/appViewReducer.tsx +++ b/app/client/src/reducers/uiReducers/appViewReducer.tsx @@ -26,11 +26,6 @@ const appViewReducer = createReducer(initialState, { [ReduxActionTypes.FETCH_PUBLISHED_PAGE_INIT]: (state: AppViewReduxState) => { return { ...state, isFetchingPage: true }; }, - [ReduxActionTypes.FETCH_PUBLISHED_PAGE_RESOURCES_INIT]: ( - state: AppViewReduxState, - ) => { - return { ...state, isFetchingPage: true }; - }, [ReduxActionErrorTypes.FETCH_PUBLISHED_PAGE_ERROR]: ( state: AppViewReduxState, ) => { @@ -49,14 +44,6 @@ const appViewReducer = createReducer(initialState, { isFetchingPage: false, }; }, - [ReduxActionTypes.FETCH_PUBLISHED_PAGE_RESOURCES_SUCCESS]: ( - state: AppViewReduxState, - ) => { - return { - ...state, - isFetchingPage: false, - }; - }, [ReduxActionTypes.SET_APP_VIEWER_HEADER_HEIGHT]: ( state: AppViewReduxState, action: ReduxAction,