Skip to content

Commit

Permalink
fix: Enabled js mode by default for Table and Select widget form disp…
Browse files Browse the repository at this point in the history
…lay ui button (#39032)
  • Loading branch information
AmanAgarwal041 authored Feb 6, 2025
1 parent 4b20f9f commit 35ba3cc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe(
dataSources.AddSuggestedWidget(Widgets.Table);
debuggerHelper.AssertErrorCount(0);
table.WaitUntilTableLoad(0, 0, "v2");
propPane.AssertPropertiesDropDownCurrentValue("Table data", "Api1");
propPane.ValidatePropertyFieldValue("Table data", "{{Api1.data}}");

// Create another API so that it returns object response
apiPage.CreateAndFillApi(
Expand Down Expand Up @@ -108,9 +108,9 @@ describe(
);
debuggerHelper.AssertErrorCount(0);
table.WaitUntilTableLoad(0, 0, "v2");
propPane.AssertPropertiesDropDownCurrentValue(
propPane.ValidatePropertyFieldValue(
"Table data",
"ARRAY_RESPONSE",
"{{ARRAY_RESPONSE.data}}",
);

// Create API so that it returns object response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ if (CURRENT_REPO == REPO.CE) {
dataSources.EnterQuery(query);
dataSources.RunQuery();
dataSources.AddSuggestedWidget(Widgets.Table); //Binding to new table from schema explorer
propPane.AssertPropertiesDropDownCurrentValue("Table data", "Query6");
propPane.ValidatePropertyFieldValue("Table data", "{{Query6.data}}");

EditorNavigation.SelectEntityByName("Query6", EntityType.Query);
dataSources.AddSuggestedWidget(
Widgets.Table,
dataSources._addSuggestedExisting,
);
propPane.AssertPropertiesDropDownCurrentValue("Table data", "Query6");
propPane.ValidatePropertyFieldValue("Table data", "{{Query6.data}}");
});

//To add test for duplicate collection name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ function getWidgetProps(
props: {
[fieldName]: `{{${actionName}.${suggestedWidget.bindingQuery}}}`,
dynamicBindingPathList: [{ key: "tableData" }],
dynamicPropertyPathList:
suggestedWidget.bindingQuery === "data"
? []
: [{ key: "tableData" }],
dynamicPropertyPathList: [{ key: "tableData" }],
},
parentRowSpace: 10,
};
Expand Down
6 changes: 5 additions & 1 deletion app/client/src/sagas/SnipingModeSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export function* bindDataToWidgetSaga(
: oneClickBindingQuery;
let isDynamicPropertyPath = true;

if (bindingQuery === oneClickBindingQuery) {
if (
bindingQuery === oneClickBindingQuery &&
selectedWidget.type !== "TABLE_WIDGET_V2" &&
selectedWidget.type !== "SELECT_WIDGET"
) {
isDynamicPropertyPath = false;
}

Expand Down

0 comments on commit 35ba3cc

Please sign in to comment.