Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
1119f65
chore: adding apis for git
Dec 5, 2024
2900b65
fix: review changes
Dec 5, 2024
0d1fa18
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 5, 2024
146238c
fix: fixing enum imports
Dec 5, 2024
e72e02f
chore: changing named export to default export
Dec 6, 2024
54b5d93
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 6, 2024
a1b608b
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 6, 2024
0bb662f
fix: adding saga for commit and connect
Dec 7, 2024
d7e6c79
chore: adding global profile and config redux slice
Dec 7, 2024
02e128b
chore: adding saga for git profile update
Dec 7, 2024
3218b3a
chore: adding fetch branches saga
Dec 7, 2024
f9c4030
chore: adding fetch and update local profile
Dec 7, 2024
adafd14
fix: fixing connectsaga
Dec 7, 2024
488b346
fix: review changes
Dec 8, 2024
942193d
chore: adding branch based sagas
Dec 9, 2024
e9167f2
fix: moving things around
Dec 9, 2024
d024160
chore: adding ctx
Dec 9, 2024
ef34582
chore: expanding context provider and making contextaware comps
Dec 9, 2024
c3d9a31
fix: remove gittest
Dec 9, 2024
fa8c461
chore: adding init sagas
Dec 10, 2024
9b1414e
fix: test fixes
Dec 10, 2024
2de337e
fix: review changes
Dec 10, 2024
40f057e
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
Dec 10, 2024
826dbf8
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 10, 2024
3a47055
chore: adding autocommit to saga
Dec 10, 2024
ca19474
fix: adding relevant selectors for quick git actions
Dec 10, 2024
3a2a045
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 11, 2024
59f91f4
fix: resolving conflict errors
Dec 11, 2024
e1eb35a
fix: review changes
Dec 11, 2024
3c4a4c2
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
Dec 11, 2024
fbcf6ae
fix: fixing test cases
Dec 11, 2024
56cbaef
fix: fixing more test cases
Dec 11, 2024
f8545b4
fix: changing AxiosResponse to AxiosPromise
Dec 11, 2024
65e9ea6
fix: fixing build and naming issues
Dec 11, 2024
2b7c3d2
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 11, 2024
f613ae1
fix: remove expect error
Dec 11, 2024
adddd08
chore: adding git ops modal
Dec 11, 2024
c6343d3
fix: arranging dumb components in a better fashion
Dec 11, 2024
c5c9585
fix: adding conflicterror and conflicterrormodal
Dec 11, 2024
c5b8cf3
fix: adding pull sagas
Dec 11, 2024
bcef9f5
chore: adding deploy tab
Dec 11, 2024
0e84fb8
chore: adding merge tab
Dec 11, 2024
c88bc0b
fix: review changes
Dec 12, 2024
885446c
Merge branch 'chore/git-mod-6' of github.com:appsmithorg/appsmith int…
Dec 12, 2024
e106d43
fix: better handling of ctx values
Dec 12, 2024
005a655
fix: minor fixes to merge comp
Dec 12, 2024
ba6ac37
chore: adding skeleton for status
Dec 12, 2024
54ac997
chore: adding status component and transformer
Dec 12, 2024
8c310af
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 12, 2024
523296b
fix: adding autocommit statusbar
Dec 12, 2024
8745497
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 12, 2024
9d57e5a
chore: adding git settings modal
Dec 12, 2024
44167c0
chore: wip - git settings modal
Dec 13, 2024
f698d26
fix: fixing error handling
Dec 13, 2024
245cb9b
chore: minor changes in error handling
Dec 13, 2024
cc35140
chore: review fixes
Dec 13, 2024
1b1da07
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
8dc482f
fix: review comments
Dec 13, 2024
e70f659
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
801b06b
chore: minor fixes for build failures
Dec 13, 2024
b4f8925
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
ec461fd
chore: review fixes
Dec 13, 2024
7f54647
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
Dec 13, 2024
b997ada
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
a569b22
chore: shifting fixes from ee to ee
Dec 13, 2024
f715c2a
fix: minor fixes
Dec 13, 2024
1273fc6
chore: adding initial state
Dec 13, 2024
0be3210
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 13, 2024
2953823
chore: renaming files
Dec 13, 2024
2be8c89
fix: minor
Dec 13, 2024
e1588c9
chore: fixes build issue
Dec 13, 2024
008f857
chore: adding branch protection
Dec 13, 2024
fe620bd
chore: adding local profile
Dec 13, 2024
d8dca7f
fix: issue with localprofile
Dec 13, 2024
e23819b
chore: adding general tab
Dec 14, 2024
a7f5832
chore: added disconnect modal
Dec 14, 2024
7b48aa2
chore: adding disable autocommit modal
Dec 14, 2024
57aa219
chore: adding disconnect and toggle autocommit saga
Dec 14, 2024
612c35a
chore: adding base for CD
Dec 14, 2024
ee50685
chore: moving things around
Dec 14, 2024
e20e0a2
chore: adding minor fixes
Dec 14, 2024
b16bf38
chore: adding connect first draft
Dec 15, 2024
34f7a00
chore: adding logic for connect modal
Dec 15, 2024
a71a664
chore: adding fixes
Dec 15, 2024
5e40b10
chore: review comment fix
Dec 15, 2024
3921112
chore: adding branch popup
Dec 15, 2024
9071d0e
chore: wip ce-ee split
Dec 16, 2024
6314fe2
chore: additional ee files
Dec 16, 2024
8d077c8
chore: wip more ce-ee split
Dec 16, 2024
56f05cf
chore: removing old ee folder
Dec 16, 2024
24d5e1c
Merge branch 'chore/git-mod-8' of github.com:appsmithorg/appsmith int…
Dec 16, 2024
546fd66
chore: conflict errors
Dec 16, 2024
bbbee85
chore: fix branch list
Dec 16, 2024
52b5c4f
chore: adding ff
Dec 16, 2024
f789c5a
chore: unlicensed cd
Dec 16, 2024
062e19a
Merge branch 'chore/git-mod-8' of github.com:appsmithorg/appsmith int…
Dec 16, 2024
a6529bc
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 16, 2024
bc6b90e
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 17, 2024
243f299
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 17, 2024
5d758ca
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 17, 2024
34d96b4
chore: fixing typo
Dec 17, 2024
4831434
chore: adding integration behind feature flag
Dec 17, 2024
df628d7
chore: mod flag for components and selectors
Dec 17, 2024
c100cc2
chore: introducing artfactdef for better state mgmt
Dec 17, 2024
64c8a84
chore: moving selectors
Dec 18, 2024
41e8b6f
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 23, 2024
b407de1
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 23, 2024
e724bcb
chore: typo error
Dec 23, 2024
469a675
chore: fix action dispatch call
Dec 23, 2024
7478804
chore: renaming files and types more consistently
Dec 23, 2024
bc06f26
chore: fixing connect and import flow
Dec 23, 2024
2730e4a
chore: integrating git profile
Dec 23, 2024
022ac38
chore: rm console
Dec 23, 2024
a38be13
chore: adding import modal on cta
Dec 23, 2024
35ff365
feat: integrating with deploy btn
Dec 23, 2024
1d6177f
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 23, 2024
1498ddc
chore: fix git import modal
Dec 23, 2024
bda63a5
chore: putting gitapplicationProvider in better places
Dec 23, 2024
a0a3d29
chore: fix connect issue
Dec 23, 2024
1f55194
chore: minor fixes
Dec 23, 2024
a9a65c3
chore: minor fixes for disconnect flow
Dec 23, 2024
ad48cd9
chore: passing unit tests
Dec 24, 2024
e7c116c
chore: fixing connect flow
Dec 24, 2024
a6926c9
chore: fixing unit tests
Dec 24, 2024
a2e48c9
chore: build failure
Dec 24, 2024
741d1f0
chore: fixing unit test with mock
Dec 24, 2024
10a4325
chore: fixing status comp
Dec 24, 2024
5c46d32
fix: fixing when ff is off
Dec 24, 2024
4b18bae
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 24, 2024
0b57fae
chore: fix typo
Dec 24, 2024
059417b
chore: fixing unit tests
Dec 24, 2024
9eaa84c
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 25, 2024
e678dd9
chore: cytest fix
Dec 25, 2024
5fd6853
chore: fixing cypress tests
Dec 25, 2024
358b659
chore: fixing selectors for repetition
Dec 27, 2024
83579a9
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 27, 2024
19f3ca0
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Dec 28, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,10 @@ const ContentTypeRaw = importSvg(
async () => import("../__assets__/icons/ads/content-type-raw.svg"),
);

const CloudIconV2 = importSvg(
async () => import("../__assets__/icons/ads/cloudy-line.svg"),
);

const NotionIcon = importSvg(
async () => import("../__assets__/icons/ads/notion.svg"),
);
Expand Down Expand Up @@ -1225,6 +1229,7 @@ const ICON_LOOKUP = {
"close-modal": CloseLineIcon,
"close-x": CloseLineIcon,
"cloud-off-line": CloudOfflineIcon,
"cloud-v2": CloudIconV2,
"collapse-control": CollapseIcon,
"column-freeze": ColumnFreeze,
"column-unfreeze": SubtractIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const blockAirgappedRoutes = (config: InternalAxiosRequestConfig) => {

const addGitBranchHeader = (config: InternalAxiosRequestConfig) => {
const state = store.getState();
// ! git mod - not sure how to replace this, we could directly read state if required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your git folder where you have API requests; why not create an HOC for the Api class that injects branch as header. IIRC the config property that .get .post accept has an option to pass additional headers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ideally want to remove this from the interceptor logic and pass it with the api explicitly. But not tampering this right now

const branch = getCurrentGitBranch(state) || getQueryParamsObject().branch;

return _addGitBranchHeader(config, { branch });
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const FEATURE_FLAG = {
"release_table_html_column_type_enabled",
release_gs_all_sheets_options_enabled:
"release_gs_all_sheets_options_enabled",
release_git_modularisation_enabled: "release_git_modularisation_enabled",
ab_premium_datasources_view_enabled: "ab_premium_datasources_view_enabled",
kill_session_recordings_enabled: "kill_session_recordings_enabled",
config_mask_session_recordings_enabled:
Expand Down Expand Up @@ -95,6 +96,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
release_evaluation_scope_cache: false,
release_table_html_column_type_enabled: false,
release_gs_all_sheets_options_enabled: false,
release_git_modularisation_enabled: false,
ab_premium_datasources_view_enabled: false,
kill_session_recordings_enabled: false,
config_user_session_recordings_enabled: true,
Expand Down
27 changes: 21 additions & 6 deletions app/client/src/ce/navigation/FocusStrategy/AppIDEFocusStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { all, select, take } from "redux-saga/effects";
import type { FocusPath, FocusStrategy } from "sagas/FocusRetentionSaga";
import type { AppsmithLocationState } from "utils/history";
import { NavigationMethod } from "utils/history";
import { getCurrentGitBranch } from "selectors/gitSyncSelectors";
import type { FocusEntityInfo } from "navigation/FocusEntity";
import {
FocusEntity,
Expand All @@ -18,6 +17,7 @@ import {
widgetListURL,
} from "ee/RouteBuilder";
import AppIDEFocusElements from "../FocusElements/AppIDE";
import { selectGitApplicationCurrentBranch } from "selectors/gitModSelectors";

function shouldSetState(
prevPath: string,
Expand Down Expand Up @@ -86,8 +86,17 @@ const isPageChange = (prevPath: string, currentPath: string) => {
);
};

export const createEditorFocusInfoKey = (basePageId: string, branch?: string) =>
`EDITOR_STATE.${basePageId}#${branch}`;
export const createEditorFocusInfoKey = (
basePageId: string,
branch: string | null = null,
) => {
const r = branch
? `EDITOR_STATE.${basePageId}#${branch}`
: `EDITOR_STATE.${basePageId}`;

return r;
};

export const createEditorFocusInfo = (basePageId: string, branch?: string) => ({
key: createEditorFocusInfoKey(basePageId, branch),
entityInfo: {
Expand All @@ -109,7 +118,9 @@ export const AppIDEFocusStrategy: FocusStrategy = {
return [];
}

const branch: string | undefined = yield select(getCurrentGitBranch);
const branch: string | undefined = yield select(
selectGitApplicationCurrentBranch,
);
const entities: Array<{ entityInfo: FocusEntityInfo; key: string }> = [];
const prevEntityInfo = identifyEntityFromPath(previousPath);
const currentEntityInfo = identifyEntityFromPath(currentPath);
Expand All @@ -136,7 +147,9 @@ export const AppIDEFocusStrategy: FocusStrategy = {
return entities;
},
*getEntitiesForStore(path: string, currentPath: string) {
const branch: string | undefined = yield select(getCurrentGitBranch);
const branch: string | undefined = yield select(
selectGitApplicationCurrentBranch,
);
const entities: Array<FocusPath> = [];
const currentFocusEntityInfo = identifyEntityFromPath(currentPath);
const prevFocusEntityInfo = identifyEntityFromPath(path);
Expand Down Expand Up @@ -179,7 +192,9 @@ export const AppIDEFocusStrategy: FocusStrategy = {
appState: EditorState.EDITOR,
params: prevFocusEntityInfo.params,
},
key: `EDITOR_STATE.${prevFocusEntityInfo.params.basePageId}#${branch}`,
key: branch
? `EDITOR_STATE.${prevFocusEntityInfo.params.basePageId}#${branch}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch can either be undefined or null. With the old implementation - when branch is not present it would return either EDITOR_STATE.pageid.undefined or EDITOR_STATE.pageid.null. This creates issues. So, I have modified the logic to ignore branch totally when it is either undefined or null

: `EDITOR_STATE.${prevFocusEntityInfo.params.basePageId}`,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import CreateNewAppsOption from "./CreateNewAppsOption";
import { BrowserRouter as Router } from "react-router-dom";
import { unitTestBaseMockStore } from "layoutSystems/common/dropTarget/unitTestUtils";

jest.mock("selectors/gitModSelectors", () => ({
selectCombinedPreviewMode: jest.fn(() => false),
}));

const defaultStoreState = {
...unitTestBaseMockStore,
tenant: {
Expand Down
12 changes: 10 additions & 2 deletions app/client/src/ce/pages/Applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ import { MOBILE_MAX_WIDTH } from "constants/AppConstants";
import { Indices } from "constants/Layers";
import ImportModal from "pages/common/ImportModal";
import SharedUserList from "pages/common/SharedUserList";
import GitSyncModal from "pages/Editor/gitSync/GitSyncModal";
import ReconnectDatasourceModal from "pages/Editor/gitSync/ReconnectDatasourceModal";
import RepoLimitExceededErrorModal from "pages/Editor/gitSync/RepoLimitExceededErrorModal";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
Expand All @@ -133,6 +132,15 @@ import { getAssetUrl } from "ee/utils/airgapHelpers";
import { ASSETS_CDN_URL } from "constants/ThirdPartyConstants";
import { LayoutSystemTypes } from "layoutSystems/types";
import { getIsAnvilLayoutEnabled } from "layoutSystems/anvil/integrations/selectors";
import OldGitSyncModal from "pages/Editor/gitSync/GitSyncModal";
import { useGitModEnabled } from "pages/Editor/gitSync/hooks/modHooks";
import { GitImportModal as NewGitImportModal } from "git";

function GitImportModal() {
const isGitModEnabled = useGitModEnabled();

return isGitModEnabled ? <NewGitImportModal /> : <OldGitSyncModal isImport />;
}

export const { cloudHosting } = getAppsmithConfigs();

Expand Down Expand Up @@ -955,7 +963,7 @@ export function ApplicationsSection(props: any) {
isMobile={isMobile}
>
{workspacesListComponent}
<GitSyncModal isImport />
<GitImportModal />
<ReconnectDatasourceModal />
</ApplicationContainer>
);
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/ce/pages/Editor/IDE/MainPane/useRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import DataSourceEditor from "pages/Editor/DataSourceEditor";
import DatasourceBlankState from "pages/Editor/DataSourceEditor/DatasourceBlankState";
import type { RouteProps } from "react-router";
import { useSelector } from "react-redux";
import { combinedPreviewModeSelector } from "selectors/editorSelectors";
import { lazy, Suspense } from "react";
import React from "react";

import { retryPromise } from "utils/AppsmithUtils";
import Skeleton from "widgets/Skeleton";
import { selectCombinedPreviewMode } from "selectors/gitModSelectors";

const FirstTimeUserOnboardingChecklist = lazy(async () =>
retryPromise(
Expand Down Expand Up @@ -67,7 +67,7 @@ export interface RouteReturnType extends RouteProps {
*/

function useRoutes(path: string): RouteReturnType[] {
const isPreviewMode = useSelector(combinedPreviewModeSelector);
const isPreviewMode = useSelector(selectCombinedPreviewMode);

return [
{
Expand Down
7 changes: 7 additions & 0 deletions app/client/src/ce/reducers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ import type { ActiveField } from "reducers/uiReducers/activeFieldEditorReducer";
import type { SelectedWorkspaceReduxState } from "ee/reducers/uiReducers/selectedWorkspaceReducer";
import type { ConsolidatedPageLoadState } from "reducers/uiReducers/consolidatedPageLoadReducer";
import type { BuildingBlocksReduxState } from "reducers/uiReducers/buildingBlockReducer";
import type { GitArtifactRootReduxState, GitGlobalReduxState } from "git";
import { gitReducer } from "git/store";

export const reducerObject = {
entities: entityReducer,
Expand All @@ -86,6 +88,7 @@ export const reducerObject = {
settings: SettingsReducer,
tenant: tenantReducer,
linting: lintErrorReducer,
git: gitReducer,
};

export interface AppState {
Expand Down Expand Up @@ -176,4 +179,8 @@ export interface AppState {
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tenant: TenantReduxState<any>;
git: {
global: GitGlobalReduxState;
artifacts: GitArtifactRootReduxState;
};
}
16 changes: 16 additions & 0 deletions app/client/src/ce/reducers/uiReducers/applicationsReducer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
import produce from "immer";
import { isEmpty } from "lodash";
import type { ApplicationPayload } from "entities/Application";
import { gitConnectSuccess, type GitConnectSuccessPayload } from "git";
import type { PayloadAction } from "@reduxjs/toolkit";

export const initialState: ApplicationsReduxState = {
isSavingAppName: false,
Expand Down Expand Up @@ -744,6 +746,20 @@ export const handlers = {
isSavingNavigationSetting: false,
};
},
// git
[gitConnectSuccess.type]: (
state: ApplicationsReduxState,
action: PayloadAction<GitConnectSuccessPayload>,
) => {
return {
...state,
currentApplication: {
...state.currentApplication,
gitApplicationMetadata:
action.payload.responseData.gitApplicationMetadata,
},
};
},
Comment on lines +750 to +762
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to do this in the applicationsReducer?

Copy link
Contributor Author

@brayn003 brayn003 Dec 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do the same thing with old implementation as well. Didn't want to change it too much. Will revisit later

};

const applicationsReducer = createReducer(initialState, handlers);
Expand Down
14 changes: 9 additions & 5 deletions app/client/src/ce/sagas/PageSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import {
import { IncorrectBindingError, validateResponse } from "sagas/ErrorSagas";
import type { ApiResponse } from "api/ApiResponses";
import {
combinedPreviewModeSelector,
getCurrentApplicationId,
getCurrentLayoutId,
getCurrentPageId,
Expand Down Expand Up @@ -128,7 +127,6 @@ import { getPageList } from "ee/selectors/entitiesSelector";
import { setPreviewModeAction } from "actions/editorActions";
import { SelectionRequestType } from "sagas/WidgetSelectUtils";
import { toast } from "@appsmith/ads";
import { getCurrentGitBranch } from "selectors/gitSyncSelectors";
import type { MainCanvasReduxState } from "reducers/uiReducers/mainCanvasReducer";
import { UserCancelledActionExecutionError } from "sagas/ActionExecution/errorUtils";
import { getInstanceId } from "ee/selectors/tenantSelectors";
Expand All @@ -150,6 +148,10 @@ import { getIsAnvilLayout } from "layoutSystems/anvil/integrations/selectors";
import { convertToBasePageIdSelector } from "selectors/pageListSelectors";
import type { Page } from "entities/Page";
import { ConsolidatedPageLoadApi } from "api";
import {
selectCombinedPreviewMode,
selectGitApplicationCurrentBranch,
} from "selectors/gitModSelectors";

export const checkIfMigrationIsNeeded = (
fetchPageResponse?: FetchPageResponse,
Expand All @@ -172,7 +174,9 @@ export function* refreshTheApp() {
const currentPageId: string = yield select(getCurrentPageId);
const defaultBasePageId: string = yield select(getDefaultBasePageId);
const pagesList: Page[] = yield select(getPageList);
const gitBranch: string = yield select(getCurrentGitBranch);
const gitBranch: string | undefined = yield select(
selectGitApplicationCurrentBranch,
);

const isCurrentPageIdInList =
pagesList.filter((page) => page.pageId === currentPageId).length > 0;
Expand Down Expand Up @@ -637,7 +641,7 @@ export function* saveLayoutSaga(action: ReduxAction<{ isRetry?: boolean }>) {
try {
const currentPageId: string = yield select(getCurrentPageId);
const currentPage: Page = yield select(getPageById(currentPageId));
const isPreviewMode: boolean = yield select(combinedPreviewModeSelector);
const isPreviewMode: boolean = yield select(selectCombinedPreviewMode);

const appMode: APP_MODE | undefined = yield select(getAppMode);

Expand Down Expand Up @@ -1401,7 +1405,7 @@ export function* setCanvasCardsStateSaga(action: ReduxAction<string>) {
}

export function* setPreviewModeInitSaga(action: ReduxAction<boolean>) {
const isPreviewMode: boolean = yield select(combinedPreviewModeSelector);
const isPreviewMode: boolean = yield select(selectCombinedPreviewMode);

if (action.payload) {
// we animate out elements and then move to the canvas
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/ce/sagas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import sendSideBySideWidgetHoverAnalyticsEventSaga from "sagas/AnalyticsSaga";

/* Sagas that are registered by a module that is designed to be independent of the core platform */
import ternSagas from "sagas/TernSaga";
import gitSagas from "git/sagas";

export const sagas = [
initSagas,
Expand Down Expand Up @@ -106,4 +107,5 @@ export const sagas = [
ternSagas,
ideSagas,
sendSideBySideWidgetHoverAnalyticsEventSaga,
gitSagas,
];
Loading