Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table save row button onclick function #35412

Merged
merged 16 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
336caf3
fix: table save row button onclick function
AmanAgarwal041 Aug 5, 2024
264aa60
fix: limited test
AmanAgarwal041 Aug 5, 2024
a626541
fix: reverted limited test file
AmanAgarwal041 Aug 5, 2024
91ac7e0
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 5, 2024
d5aa0a7
fix: removed sleep
AmanAgarwal041 Aug 6, 2024
e876385
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 6, 2024
8daa475
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 6, 2024
8e8196f
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 6, 2024
aa1ef97
fix: the flakyness of the Select1_spec.ts
AmanAgarwal041 Aug 7, 2024
e2edb85
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 7, 2024
8f2966b
fix: the flakyness of the Select1_spec.ts
AmanAgarwal041 Aug 7, 2024
6a02827
fix: changed the logic to use CheckUncheck helper
AmanAgarwal041 Aug 7, 2024
14f989d
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 7, 2024
127057e
fix: limited test update
AmanAgarwal041 Aug 8, 2024
94fd6ec
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/35…
AmanAgarwal041 Aug 8, 2024
40a81cb
fix: use filterable from locators
AmanAgarwal041 Aug 8, 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 @@ -14,88 +14,78 @@ import EditorNavigation, {

const oneClickBinding = new OneClickBinding();

// TODO: Adds two rows on click of save row will debug and fix this in a different PR - Sangeeth
describe.skip("Table widget one click binding feature", () => {
it("1.should check that queries are created and bound to table widget properly", () => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 400);
describe(
"Table widget one click binding feature",
{ tags: ["@tag.Widget"] },
() => {
it("1.should check that queries are created and bound to table widget properly", () => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 400);

dataSources.CreateDataSource("MySql");
dataSources.CreateDataSource("MySql");

cy.get("@dsName").then((dsName) => {
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
cy.get("@dsName").then((dsName) => {
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);

oneClickBinding.ChooseAndAssertForm(`${dsName}`, dsName, "configs", {
searchableColumn: "configName",
oneClickBinding.ChooseAndAssertForm(`${dsName}`, dsName, "configs", {
searchableColumn: "configName",
});
});
});

agHelper.GetNClick(oneClickBindingLocator.connectData);

assertHelper.AssertNetworkStatus("@postExecute");

agHelper.Sleep(2000);

[
"id",
"configName",
"configJson",
"configVersion",
"updatedAt",
"updatedBy",
].forEach((column) => {
agHelper.AssertElementExist(table._headerCell(column));
});

agHelper.GetNClick(table._addNewRow, 0, true);

table.EditTableCell(0, 1, "One Click Config", false);

table.UpdateTableCell(0, 2, `{{}"key":"oneClick"}`);
table.UpdateTableCell(0, 3, 36);
table.UpdateTableCell(0, 4, "2023-07-03 15:30:00", false, true);
agHelper.GetNClick(oneClickBindingLocator.connectData);

agHelper.Sleep(2000);
assertHelper.AssertNetworkStatus("@postExecute");

agHelper.GetNClick(table._saveNewRow, 0, true);
[
"id",
"configName",
"configJson",
"configVersion",
"updatedAt",
"updatedBy",
].forEach((column) => {
agHelper.AssertElementExist(table._headerCell(column));
});

assertHelper.AssertNetworkStatus("@postExecute");
agHelper.GetNClick(table._addNewRow, 0, true);

agHelper.TypeText(table._searchInput, "One Click Config");
table.EditTableCell(0, 1, "One Click Config", false);

assertHelper.AssertNetworkStatus("@postExecute");
table.UpdateTableCell(0, 2, `{{}"key":"oneClick"}`);
table.UpdateTableCell(0, 3, 36);
table.UpdateTableCell(0, 4, "2023-07-03 15:30:00", false, true);

agHelper.AssertElementExist(table._bodyCell("One Click Config"));
agHelper.GetNClick(table._saveNewRow, 0, true);

agHelper.Sleep(1000);
assertHelper.AssertNetworkStatus("@postExecute");

table.EditTableCell(0, 1, "Bindings", false);
table.EditTableCell(0, 4, "2023-07-03 15:30:00", false);
agHelper.TypeText(table._searchInput, "One Click Config");

agHelper.Sleep(1000);
assertHelper.AssertNetworkStatus("@postExecute");

(cy as any).AssertTableRowSavable(6, 0);
agHelper.AssertElementExist(table._bodyCell("One Click Config"));

(cy as any).saveTableRow(6, 0);
table.EditTableCell(0, 1, "Bindings", false);
table.EditTableCell(0, 4, "2023-07-03 15:30:00", false);

assertHelper.AssertNetworkStatus("@postExecute");
(cy as any).AssertTableRowSavable(6, 0);

assertHelper.AssertNetworkStatus("@postExecute");
(cy as any).saveTableRow(6, 0);

agHelper.Sleep(500);
agHelper.ClearNType(table._searchInput, "Bindings");
assertHelper.AssertNetworkStatus("@postExecute");

assertHelper.AssertNetworkStatus("@postExecute");
assertHelper.AssertNetworkStatus("@postExecute");

agHelper.Sleep(2000);
agHelper.ClearNType(table._searchInput, "Bindings");

agHelper.AssertElementExist(table._bodyCell("Bindings"));
assertHelper.AssertNetworkStatus("@postExecute");

agHelper.ClearNType(table._searchInput, "One Click Config");
agHelper.AssertElementExist(table._bodyCell("Bindings"));

assertHelper.AssertNetworkStatus("@postExecute");
agHelper.ClearNType(table._searchInput, "One Click Config");

agHelper.Sleep(2000);
assertHelper.AssertNetworkStatus("@postExecute");

agHelper.AssertElementAbsence(table._bodyCell("One Click Config"));
});
});
agHelper.AssertElementAbsence(table._bodyCell("One Click Config"));
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ describe(
]}}
`,
);
cy.get(".t--property-control-filterable input").click({ force: true });
cy.get(_.locators._propertyControlInput("filterable")).click({
force: true,
});
cy.editTableSelectCell(0, 0);
cy.get(".select-popover-wrapper .bp3-input-group input").should("exist");
cy.get(".select-popover-wrapper .bp3-input-group input").type("1", {
Expand Down Expand Up @@ -363,6 +365,10 @@ describe(
PageLeftPane.switchSegment(PagePaneSegment.UI);
cy.openPropertyPane("tablewidgetv2");
cy.editColumn("step");
_.agHelper.CheckUncheck(
_.locators._propertyControlInput("filterable"),
true,
);
cy.get(".t--property-control-serversidefiltering input").click();
cy.updateCodeInput(
".t--property-pane-section-selectproperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ function AddNewRowBannerComponent(props: AddNewRowBannerType) {
className="t--save-new-row"
disabled={props.disabledAddNewRowSave || isDiscardLoading}
loading={isSaveLoading}
onClick={() => {
onClick={(event) => {
event.stopPropagation();
setIsSaveLoading(true);
props.onAddNewRowAction(AddNewRowActions.SAVE, () =>
setIsSaveLoading(false),
Expand Down
Loading