Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/client/src/actions/pageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface FetchPublishedPageActionPayload {

export interface FetchPublishedPageResourcesPayload {
pageId: string;
basePageId: string;
applicationId: string;
}

export const fetchPublishedPageAction = (
Expand Down Expand Up @@ -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<FetchPublishedPageResourcesPayload> => ({
export const fetchPublishedPageResourcesAction = (
pageId: string,
applicationId: string,
): ReduxAction<FetchPublishedPageResourcesPayload> => ({
type: ReduxActionTypes.FETCH_PUBLISHED_PAGE_RESOURCES_INIT,
payload: {
pageId,
basePageId,
applicationId,
},
});

Expand Down
2 changes: 0 additions & 2 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
9 changes: 3 additions & 6 deletions app/client/src/ce/sagas/PageSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ export function* fetchPublishedPageResourcesSaga(
action: ReduxAction<FetchPublishedPageResourcesPayload>,
) {
try {
const { basePageId, pageId } = action.payload;
const { applicationId, pageId } = action.payload;

const params = { defaultPageId: basePageId };
const params = { defaultPageId: pageId };
const initConsolidatedApiResponse: ApiResponse<InitConsolidatedApi> =
yield ConsolidatedPageLoadApi.getConsolidatedPageLoadDataView(params);

Expand All @@ -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({
Expand Down
8 changes: 3 additions & 5 deletions app/client/src/pages/AppViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -162,11 +162,9 @@ function AppViewer(props: Props) {
)?.pageId;

if (pageId) {
// Used for fetching page resources
dispatch(
fetchPublishedPageResources({
basePageId,
pageId,
}),
fetchPublishedPageResourcesAction(basePageId, baseApplicationId),
);
}
}
Expand Down
13 changes: 0 additions & 13 deletions app/client/src/reducers/uiReducers/appViewReducer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) => {
Expand All @@ -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<number>,
Expand Down