Skip to content

Commit 4fd86aa

Browse files
authored
Merge pull request #38860 from appsmithorg/release
28/01 Daily promotion
2 parents da86a06 + 83ce2d6 commit 4fd86aa

File tree

17 files changed

+55
-183
lines changed

17 files changed

+55
-183
lines changed

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js

+1-32
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json");
77
import {
88
agHelper,
99
apiPage,
10+
entityExplorer,
1011
propPane,
1112
} from "../../../../../support/Objects/ObjectsCore";
1213

@@ -115,38 +116,6 @@ describe(
115116
// verify customColumn is visible in the table
116117
cy.get(".draggable-header:contains('CustomColumn')").should("be.visible");
117118
cy.closePropertyPane();
118-
cy.deleteColumn("customColumn1");
119-
});
120-
121-
it("5. Verify computed value with try-catch blocks handles missing nested properties", function () {
122-
cy.openPropertyPane("tablewidgetv2");
123-
124-
// Set table data with nested object and missing property
125-
propPane.UpdatePropertyFieldValue(
126-
"Table data",
127-
`{{[{"name": "Rahul", age: {value: 31}}, {"name": "Jacq", age: {}}, {"name": "John"}]}}`,
128-
);
129-
130-
cy.editColumn("age");
131-
propPane.UpdatePropertyFieldValue(
132-
"Computed value",
133-
"{{currentRow.age.value}}",
134-
);
135-
136-
cy.readTableV2data(0, 1).then((val) => {
137-
expect(val).to.equal("31");
138-
});
139-
140-
cy.readTableV2data(1, 1).then((val) => {
141-
expect(val).to.equal("");
142-
});
143-
144-
cy.readTableV2data(2, 1).then((val) => {
145-
expect(val).to.equal("");
146-
});
147-
148-
// Clean up
149-
cy.backFromPropertyPanel();
150119
});
151120
},
152121
);

app/client/packages/dsl/src/migrate/index.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ import { migrateTableServerSideFiltering } from "./migrations/086-migrate-table-
9191
import { migrateChartwidgetCustomEchartConfig } from "./migrations/087-migrate-chart-widget-customechartdata";
9292
import { migrateCustomWidgetDynamicHeight } from "./migrations/088-migrate-custom-widget-dynamic-height";
9393
import { migrateTableWidgetV2CurrentRowInValidationsBinding } from "./migrations/089-migrage-table-widget-v2-currentRow-binding";
94-
import { migrateTableWidgetV2ValidationTryCatch } from "./migrations/090-migrate-table-widget-v2-validation-try-catch";
9594
import type { DSLWidget } from "./types";
9695

97-
export const LATEST_DSL_VERSION = 92;
96+
export const LATEST_DSL_VERSION = 91;
9897

9998
export const calculateDynamicHeight = () => {
10099
const DEFAULT_GRID_ROW_HEIGHT = 10;
@@ -625,11 +624,6 @@ const migrateVersionedDSL = async (currentDSL: DSLWidget, newPage = false) => {
625624
* What we missed was that, the auto-commit does not handle clientVersion, which lead to this bug: https://github.com/appsmithorg/appsmith/issues/38511
626625
* We are bumping this version to make sure that the auto-commit will handle this version bump.
627626
*/
628-
currentDSL.version = 91;
629-
}
630-
631-
if (currentDSL.version === 91) {
632-
currentDSL = migrateTableWidgetV2ValidationTryCatch(currentDSL);
633627
currentDSL.version = LATEST_DSL_VERSION;
634628
}
635629

app/client/packages/dsl/src/migrate/migrations/090-migrate-table-widget-v2-validation-try-catch.ts

-46
This file was deleted.

app/client/packages/dsl/src/migrate/tests/DSLMigration.test.ts

-10
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ import * as m86 from "../migrations/086-migrate-table-server-side-filtering";
9090
import * as m87 from "../migrations/087-migrate-chart-widget-customechartdata";
9191
import * as m88 from "../migrations/088-migrate-custom-widget-dynamic-height";
9292
import * as m89 from "../migrations/089-migrage-table-widget-v2-currentRow-binding";
93-
import * as m91 from "../migrations/090-migrate-table-widget-v2-validation-try-catch";
9493

9594
interface Migration {
9695
functionLookup: {
@@ -935,15 +934,6 @@ const migrations: Migration[] = [
935934
functionLookup: [],
936935
version: 90,
937936
},
938-
{
939-
functionLookup: [
940-
{
941-
moduleObj: m91,
942-
functionName: "migrateTableWidgetV2ValidationTryCatch",
943-
},
944-
],
945-
version: 91,
946-
},
947937
];
948938

949939
const mockFnObj: Record<number, any> = {};

app/client/packages/dsl/src/migrate/tests/TableWidgetV2/DSLs/ValidationTryCatchDSLs.ts

-48
This file was deleted.

app/client/packages/dsl/src/migrate/tests/TableWidgetV2/ValidationTryCatch.test.ts

-15
This file was deleted.

app/client/src/PluginActionEditor/components/PluginActionResponse/PluginActionResponse.tsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useCallback, useEffect, useMemo } from "react";
22
import { IDEBottomView, ViewHideBehaviour } from "IDE";
3+
import { PluginType } from "entities/Plugin";
4+
import { getIsAnvilEnabledInCurrentApplication } from "layoutSystems/anvil/integrations/selectors";
35
import { ActionExecutionResizerHeight } from "./constants";
46
import EntityBottomTabs from "components/editorComponents/EntityBottomTabs";
57
import { useDispatch, useSelector } from "react-redux";
@@ -15,7 +17,8 @@ import { useDefaultTab } from "ee/PluginActionEditor/components/PluginActionResp
1517

1618
function PluginActionResponse() {
1719
const dispatch = useDispatch();
18-
const { actionResponse } = usePluginActionContext();
20+
const { actionResponse, plugin } = usePluginActionContext();
21+
const isAnvilEnabled = useSelector(getIsAnvilEnabledInCurrentApplication);
1922

2023
const tabs = usePluginActionResponseTabs();
2124

@@ -36,6 +39,9 @@ function PluginActionResponse() {
3639
// as for page load queries, query response is available and can be shown in response tab
3740
useEffect(
3841
function openResponseTabForPageLoadQueries() {
42+
// disable the opening of RESPONSE_TAB for the AI plugin in Anvil
43+
if (isAnvilEnabled && plugin.type === PluginType.AI) return;
44+
3945
// actionResponse and responseDisplayFormat is present only when query has response available
4046
if (
4147
!!responseDisplayFormat?.title &&
@@ -53,11 +59,16 @@ function PluginActionResponse() {
5359
responseDisplayFormat?.title,
5460
actionResponse?.isExecutionSuccess,
5561
dispatch,
62+
isAnvilEnabled,
63+
plugin.type,
5664
],
5765
);
5866

5967
useEffect(
6068
function openResponseTabOnError() {
69+
// disable the opening of RESPONSE_TAB for the AI plugin in Anvil
70+
if (isAnvilEnabled && plugin.type === PluginType.AI) return;
71+
6172
if (executionFailed) {
6273
dispatch(
6374
setPluginActionEditorDebuggerState({
@@ -67,7 +78,7 @@ function PluginActionResponse() {
6778
);
6879
}
6980
},
70-
[executionFailed, dispatch],
81+
[executionFailed, dispatch, isAnvilEnabled, plugin.type],
7182
);
7283

7384
useDefaultTab();

app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useCallback } from "react";
22
import { IDEToolbar } from "IDE";
33
import { Button, Menu, MenuContent, MenuTrigger, Tooltip } from "@appsmith/ads";
44
import { modText } from "utils/helpers";
5+
import { PluginType } from "../../entities/Plugin";
6+
import { getIsAnvilEnabledInCurrentApplication } from "../../layoutSystems/anvil/integrations/selectors";
57
import { usePluginActionContext } from "../PluginActionContext";
68
import {
79
useBlockExecution,
@@ -20,17 +22,21 @@ interface PluginActionToolbarProps {
2022
}
2123

2224
const PluginActionToolbar = (props: PluginActionToolbarProps) => {
23-
const { action } = usePluginActionContext();
25+
const { action, plugin } = usePluginActionContext();
2426
const { handleRunClick } = useHandleRunClick();
2527
const { callRunActionAnalytics } = useAnalyticsOnRunClick();
2628
const [isMenuOpen, toggleMenuOpen] = useToggle([false, true]);
2729
const blockExecution = useBlockExecution();
2830
const isRunning = useSelector(isActionRunning(action.id));
31+
const isAnvilEnabled = useSelector(getIsAnvilEnabledInCurrentApplication);
2932

3033
const onRunClick = useCallback(() => {
34+
const isSkipOpeningDebugger =
35+
isAnvilEnabled && plugin.type === PluginType.AI;
36+
3137
callRunActionAnalytics();
32-
handleRunClick();
33-
}, [callRunActionAnalytics, handleRunClick]);
38+
handleRunClick(isSkipOpeningDebugger);
39+
}, [callRunActionAnalytics, handleRunClick, isAnvilEnabled, plugin.type]);
3440

3541
return (
3642
<IDEToolbar>

app/client/src/PluginActionEditor/store/pluginEditorReducer.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,17 @@ export const handlers = {
103103
},
104104
[ReduxActionTypes.RUN_ACTION_REQUEST]: (
105105
state: PluginActionEditorState,
106-
action: ReduxAction<{ id: string }>,
106+
action: ReduxAction<{
107+
skipOpeningDebugger: boolean;
108+
id: string;
109+
}>,
107110
) => {
108111
set(state, ["isRunning", action.payload.id], true);
109-
set(state, ["debugger", "selectedTab"], DEBUGGER_TAB_KEYS.RESPONSE_TAB);
112+
113+
if (!action.payload.skipOpeningDebugger) {
114+
set(state, ["debugger", "selectedTab"], DEBUGGER_TAB_KEYS.RESPONSE_TAB);
115+
}
116+
110117
set(state, ["debugger", "open"], true);
111118
},
112119
[ReduxActionTypes.RUN_ACTION_CANCELLED]: (

app/client/src/ce/PluginActionEditor/hooks/useHandleRunClick.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { useCallback } from "react";
22
import { useDispatch } from "react-redux";
33
import { runAction } from "actions/pluginActionActions";
4-
import type { PaginationField } from "api/ActionAPI";
54
import { usePluginActionContext } from "PluginActionEditor/PluginActionContext";
65

76
function useHandleRunClick() {
87
const { action } = usePluginActionContext();
98
const dispatch = useDispatch();
109

1110
const handleRunClick = useCallback(
12-
(paginationField?: PaginationField) => {
13-
dispatch(runAction(action?.id ?? "", paginationField));
11+
(skipOpeningDebugger = false) => {
12+
dispatch(runAction(action?.id ?? "", undefined, skipOpeningDebugger));
1413
},
1514
[action.id, dispatch],
1615
);

app/client/src/components/propertyControls/TableComputeValue.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ function InputText(props: InputTextProp) {
100100

101101
class ComputeTablePropertyControlV2 extends BaseControl<ComputeTablePropertyControlPropsV2> {
102102
static getBindingPrefix(tableName: string) {
103-
return `{{${tableName}.processedTableData.map((currentRow, currentIndex) => { try { return ( `;
103+
return `{{${tableName}.processedTableData.map((currentRow, currentIndex) => ( `;
104104
}
105105

106-
static bindingSuffix = `); } catch (e) { return null; }})}}`;
106+
static bindingSuffix = `))}}`;
107107

108108
render() {
109109
const {

app/client/src/sagas/ActionExecution/PluginActionSaga.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ import {
129129
findDatatype,
130130
isTrueObject,
131131
} from "ee/workers/Evaluation/evaluationUtils";
132-
import type { Plugin } from "entities/Plugin";
132+
import { type Plugin, PluginType } from "entities/Plugin";
133+
import { getIsAnvilEnabledInCurrentApplication } from "../../layoutSystems/anvil/integrations/selectors";
133134
import { setDefaultActionDisplayFormat } from "./PluginActionSagaUtils";
134135
import { checkAndLogErrorsIfCyclicDependency } from "sagas/helper";
135136
import { toast } from "@appsmith/ads";
@@ -1120,6 +1121,9 @@ function* executePageLoadAction(
11201121
const datasourceId: string = (action?.datasource as any)?.id;
11211122
const datasource: Datasource = yield select(getDatasource, datasourceId);
11221123
const plugin: Plugin = yield select(getPlugin, action?.pluginId);
1124+
const isAnvilEnabled: boolean = yield select(
1125+
getIsAnvilEnabledInCurrentApplication,
1126+
);
11231127

11241128
AnalyticsUtil.logEvent("EXECUTE_ACTION", {
11251129
type: pageAction.pluginType,
@@ -1179,7 +1183,10 @@ function* executePageLoadAction(
11791183

11801184
// open response tab in debugger on exection of action on page load.
11811185
// Only if current page is the page on which the action is executed.
1182-
if (window.location.pathname.includes(pageAction.id))
1186+
if (
1187+
window.location.pathname.includes(pageAction.id) &&
1188+
!(isAnvilEnabled && pageAction.pluginType === PluginType.AI)
1189+
)
11831190
yield put(
11841191
setPluginActionEditorDebuggerState({
11851192
open: true,

app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/transformDataPureFn.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export const transformDataPureFn = (
1616
): tableData => {
1717
if (isArray(tableData)) {
1818
return tableData.map((row, rowIndex) => {
19-
const newRow: { [key: string]: unknown } = {};
19+
// TODO: Fix this the next time the file is edited
20+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21+
const newRow: { [key: string]: any } = {};
2022

2123
columns.forEach((column) => {
2224
const { alias } = column;

0 commit comments

Comments
 (0)