Skip to content

Commit 004ee82

Browse files
authored
Merge pull request #31845 from appsmithorg/cherry-pick/15-03-24
chore: cherry pick critical fixes
2 parents 35de20b + 635af92 commit 004ee82

File tree

6 files changed

+51
-20
lines changed

6 files changed

+51
-20
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/// <reference types="Cypress" />
2+
import {
3+
agHelper,
4+
entityExplorer,
5+
draggableWidgets,
6+
} from "../../../../../support/Objects/ObjectsCore";
7+
8+
describe(
9+
"Map chart Widget",
10+
{ tags: ["@tag.Widget", "@tag.Maps"] },
11+
function () {
12+
it("1.Drag two Map Widget and Verify the Map Widget is loading", () => {
13+
//Add map and verify
14+
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MAPCHART, 200, 200);
15+
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MAPCHART, 600, 200);
16+
agHelper.RefreshPage();
17+
agHelper.AssertElementLength(
18+
".t--draggable-mapchartwidget svg text:contains('Global Population')",
19+
2,
20+
);
21+
});
22+
},
23+
);

app/client/src/pages/Editor/gitSync/ReconnectDatasourceModal.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ import { getFetchedWorkspaces } from "@appsmith/selectors/workspaceSelectors";
7575
import { getApplicationsOfWorkspace } from "@appsmith/selectors/selectedWorkspaceSelectors";
7676
import useReconnectModalData from "@appsmith/pages/Editor/gitSync/useReconnectModalData";
7777
import { resetImportData } from "@appsmith/actions/workspaceActions";
78-
import history from "utils/history";
7978

8079
const Section = styled.div`
8180
display: flex;
@@ -439,6 +438,11 @@ function ReconnectDatasourceModal() {
439438
// If either the close button or the overlay was clicked close the modal
440439
if (shouldClose) {
441440
onClose();
441+
const isInsideApplication =
442+
window.location.pathname.split("/")[1] === "app";
443+
if (isInsideApplication && editorURL) {
444+
window.location.href = editorURL;
445+
}
442446
}
443447
}
444448
};
@@ -563,7 +567,10 @@ function ReconnectDatasourceModal() {
563567
const onSkipBtnClick = () => {
564568
AnalyticsUtil.logEvent("RECONNECTING_SKIP_TO_APPLICATION_BUTTON_CLICK");
565569
localStorage.setItem("importedAppPendingInfo", "null");
566-
editorURL && history.push(editorURL);
570+
if (editorURL) {
571+
// window location because history push changes routes shallowly and some side effects needed for page loading might not run
572+
window.location.href = editorURL;
573+
}
567574
onClose();
568575
};
569576

app/client/src/sagas/WidgetSelectionSagas.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ import type { FeatureFlags } from "@appsmith/entities/FeatureFlag";
6161
import { getWidgetSelectorByWidgetId } from "selectors/layoutSystemSelectors";
6262
import { getAppViewerPageIdFromPath } from "@appsmith/pages/Editor/Explorer/helpers";
6363
import AnalyticsUtil from "../utils/AnalyticsUtil";
64-
import {
65-
retrieveCodeWidgetNavigationUsed,
66-
storeCodeWidgetNavigationUsed,
67-
} from "../utils/storage";
6864

6965
// The following is computed to be used in the entity explorer
7066
// Every time a widget is selected, we need to expand widget entities
@@ -220,9 +216,6 @@ function* appendSelectedWidgetToUrlSaga(
220216
const isWidgetSelectionBlocked: boolean = yield select(
221217
getWidgetSelectionBlock,
222218
);
223-
const timesUsedCodeModeWidgetSelection: number = yield call(
224-
retrieveCodeWidgetNavigationUsed,
225-
);
226219
const appMode: APP_MODE = yield select(getAppMode);
227220
const viewMode = appMode === APP_MODE.PUBLISHED;
228221
if (isSnipingMode || viewMode) return;
@@ -243,12 +236,6 @@ function* appendSelectedWidgetToUrlSaga(
243236
});
244237
if (invokedBy === NavigationMethod.CanvasClick && isWidgetSelectionBlocked) {
245238
AnalyticsUtil.logEvent("CODE_MODE_WIDGET_SELECTION");
246-
if (timesUsedCodeModeWidgetSelection < 2) {
247-
yield call(
248-
storeCodeWidgetNavigationUsed,
249-
timesUsedCodeModeWidgetSelection + 1,
250-
);
251-
}
252239
}
253240
if (currentURL !== newUrl) {
254241
history.push(newUrl, { invokedBy });

app/client/src/selectors/ideSelectors.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { createSelector } from "reselect";
22
import { selectFeatureFlags } from "@appsmith/selectors/featureFlagsSelectors";
33
import type { AppState } from "@appsmith/reducers";
44
import { getPageActions } from "@appsmith/selectors/entitiesSelector";
5-
import { EditorEntityTab } from "@appsmith/entities/IDE/constants";
5+
import {
6+
EditorEntityTab,
7+
EditorViewMode,
8+
} from "@appsmith/entities/IDE/constants";
69

710
export const getIsSideBySideEnabled = createSelector(
811
selectFeatureFlags,
@@ -11,7 +14,16 @@ export const getIsSideBySideEnabled = createSelector(
1114
flags.rollout_side_by_side_enabled,
1215
);
1316

14-
export const getIDEViewMode = (state: AppState) => state.ui.ide.view;
17+
export const getIDEViewMode = createSelector(
18+
getIsSideBySideEnabled,
19+
(state) => state.ui.ide.view,
20+
(featureFlag, ideViewMode) => {
21+
if (featureFlag) {
22+
return ideViewMode;
23+
}
24+
return EditorViewMode.FullScreen;
25+
},
26+
);
1527

1628
export const getPagesActiveStatus = (state: AppState) =>
1729
state.ui.ide.pagesActive;

app/client/src/widgets/MapChartWidget/component/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react";
22
import styled from "styled-components";
33
import type { MapColorObject, MapTypes } from "../constants";
44
import type { MapData } from "./types";
5-
import { getChartOption, loadMap } from "./utilities";
5+
import { getChartOption, loadMapGenerator } from "./utilities";
66
import * as echarts from "echarts";
77
import countryDetails from "./countryDetails";
88
import clsx from "clsx";
@@ -27,6 +27,8 @@ const MapChartContainer = styled.div<{
2727
export default function EchartComponent(props: MapChartComponentProps) {
2828
const [isLoading, setIsLoading] = useState(false);
2929

30+
const loadMap = useMemo(loadMapGenerator, []);
31+
3032
const [key, setKey] = useState(0);
3133

3234
const { caption, colorRange, data, onDataPointClick, showLabels, type } =

app/client/src/widgets/MapChartWidget/component/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function getSpecialAreas(map: MapTypes): GeoSpecialAreas {
4343
/*
4444
* Function to load the map geojson file and register it with echarts
4545
*/
46-
export const loadMap = (() => {
46+
export const loadMapGenerator = () => {
4747
let abortController: AbortController | null = null;
4848

4949
return async (type: MapTypes) => {
@@ -85,7 +85,7 @@ export const loadMap = (() => {
8585
return Promise.resolve();
8686
}
8787
};
88-
})();
88+
};
8989

9090
function getProjection(type: string) {
9191
switch (type) {

0 commit comments

Comments
 (0)