diff --git a/.all-contributorsrc b/.all-contributorsrc
index e479120379..d8d34bb89a 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -297,6 +297,23 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "zegerhoogeboom",
+ "name": "Zeger Hoogeboom",
+ "avatar_url": "https://avatars.githubusercontent.com/u/5371096?v=4",
+ "profile": "https://github.com/zegerhoogeboom",
+ "contributions": [
+ "code"
+ ]
+ },
+ "login": "Devedunkey",
+ "name": "Young Yoo",
+ "avatar_url": "https://avatars.githubusercontent.com/u/29448764?v=4",
+ "profile": "https://github.com/Devedunkey",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/README.md b/README.md
index 0cf7af5197..44e181457f 100644
--- a/README.md
+++ b/README.md
@@ -139,6 +139,8 @@ The Appsmith platform is available under the [Apache License 2.0](https://www.ap
 vicky-primathon 💻 |
 devrk96 💻 |
 Tim Dillon 💻 |
+  Zeger Hoogeboom 💻 |
+  Young Yoo 💻 |
diff --git a/app/client/cypress/fixtures/ModalDsl.json b/app/client/cypress/fixtures/ModalDsl.json
new file mode 100644
index 0000000000..b7f974d981
--- /dev/null
+++ b/app/client/cypress/fixtures/ModalDsl.json
@@ -0,0 +1,129 @@
+
+{
+ "dsl": {
+ "widgetName": "MainContainer",
+ "backgroundColor": "none",
+ "rightColumn": 1224,
+ "snapColumns": 16,
+ "detachFromLayout": true,
+ "widgetId": "0",
+ "topRow": 0,
+ "bottomRow": 1280,
+ "containerStyle": "none",
+ "snapRows": 33,
+ "parentRowSpace": 1,
+ "type": "CANVAS_WIDGET",
+ "canExtend": true,
+ "version": 10,
+ "minHeight": 1292,
+ "parentColumnSpace": 1,
+ "dynamicBindingPathList": [],
+ "leftColumn": 0,
+ "children": [
+ {
+ "size": "MODAL_SMALL",
+ "canEscapeKeyClose": true,
+ "detachFromLayout": true,
+ "canOutsideClickClose": true,
+ "shouldScrollContents": true,
+ "widgetName": "Modal1",
+ "children": [
+ {
+ "isVisible": true,
+ "widgetName": "Canvas1",
+ "detachFromLayout": true,
+ "canExtend": true,
+ "isDisabled": false,
+ "shouldScrollContents": false,
+ "children": [
+ {
+ "isVisible": true,
+ "widgetName": "Icon1",
+ "iconName": "cross",
+ "iconSize": 24,
+ "color": "#040627",
+ "type": "ICON_WIDGET",
+ "isLoading": false,
+ "leftColumn": 14,
+ "rightColumn": 16,
+ "topRow": 0,
+ "bottomRow": 1,
+ "parentId": "yyyrxs383y",
+ "widgetId": "kxdvolusyp",
+ "onClick": "{{closeModal('Modal1')}}"
+ },
+ {
+ "isVisible": true,
+ "text": "Modal Title",
+ "textStyle": "HEADING",
+ "textAlign": "LEFT",
+ "widgetName": "Text1",
+ "type": "TEXT_WIDGET",
+ "isLoading": false,
+ "leftColumn": 0,
+ "rightColumn": 10,
+ "topRow": 0,
+ "bottomRow": 1,
+ "parentId": "yyyrxs383y",
+ "widgetId": "3fugqdtg8g"
+ },
+ {
+ "isVisible": true,
+ "text": "Cancel",
+ "buttonStyle": "SECONDARY_BUTTON",
+ "widgetName": "Button1",
+ "isDisabled": false,
+ "isDefaultClickDisabled": true,
+ "type": "BUTTON_WIDGET",
+ "isLoading": false,
+ "leftColumn": 9,
+ "rightColumn": 12,
+ "topRow": 4,
+ "bottomRow": 5,
+ "parentId": "yyyrxs383y",
+ "widgetId": "6cjfbnjfa4"
+ },
+ {
+ "isVisible": true,
+ "text": "Confirm",
+ "buttonStyle": "PRIMARY_BUTTON",
+ "widgetName": "Button2",
+ "isDisabled": false,
+ "isDefaultClickDisabled": true,
+ "type": "BUTTON_WIDGET",
+ "isLoading": false,
+ "leftColumn": 12,
+ "rightColumn": 16,
+ "topRow": 4,
+ "bottomRow": 5,
+ "parentId": "yyyrxs383y",
+ "widgetId": "3tmnukkm7m"
+ }
+ ],
+ "minHeight": 240,
+ "type": "CANVAS_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 1,
+ "parentRowSpace": 1,
+ "leftColumn": 0,
+ "rightColumn": 444,
+ "topRow": 0,
+ "bottomRow": 240,
+ "parentId": "287u6pannr",
+ "widgetId": "yyyrxs383y"
+ }
+ ],
+ "type": "MODAL_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 5,
+ "rightColumn": 11,
+ "topRow": 15,
+ "bottomRow": 21,
+ "parentId": "0",
+ "widgetId": "287u6pannr"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/client/cypress/fixtures/basicTabledsl.json b/app/client/cypress/fixtures/basicTabledsl.json
new file mode 100644
index 0000000000..7af5dc7a88
--- /dev/null
+++ b/app/client/cypress/fixtures/basicTabledsl.json
@@ -0,0 +1,42 @@
+{
+ "dsl": {
+ "widgetName": "MainContainer",
+ "backgroundColor": "none",
+ "rightColumn": 1224,
+ "snapColumns": 16,
+ "detachFromLayout": true,
+ "widgetId": "0",
+ "topRow": 0,
+ "bottomRow": 1280,
+ "containerStyle": "none",
+ "snapRows": 33,
+ "parentRowSpace": 1,
+ "type": "CANVAS_WIDGET",
+ "canExtend": true,
+ "version": 9,
+ "minHeight": 1292,
+ "parentColumnSpace": 1,
+ "dynamicBindingPathList": [],
+ "leftColumn": 0,
+ "children": [
+ {
+ "isVisible": true,
+ "label": "Data",
+ "widgetName": "Table1",
+ "searchKey": "",
+ "tableData": "[\n {\n \"id\": 2381224,\n \"email\": \"michael.lawson@reqres.in\",\n \"userName\": \"Michael Lawson\",\n \"productName\": \"Chicken Sandwich\",\n \"orderAmount\": 4.99\n },\n {\n \"id\": 2736212,\n \"email\": \"lindsay.ferguson@reqres.in\",\n \"userName\": \"Lindsay Ferguson\",\n \"productName\": \"Tuna Salad\",\n \"orderAmount\": 9.99\n },\n {\n \"id\": 6788734,\n \"email\": \"tobias.funke@reqres.in\",\n \"userName\": \"Tobias Funke\",\n \"productName\": \"Beef steak\",\n \"orderAmount\": 19.99\n }\n]",
+ "type": "TABLE_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 1,
+ "rightColumn": 9,
+ "topRow": 7,
+ "bottomRow": 14,
+ "parentId": "0",
+ "widgetId": "7miqot30xy",
+ "dynamicBindingPathList": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/client/cypress/fixtures/datePicker2dsl.json b/app/client/cypress/fixtures/datePicker2dsl.json
new file mode 100644
index 0000000000..ceb13dfb82
--- /dev/null
+++ b/app/client/cypress/fixtures/datePicker2dsl.json
@@ -0,0 +1,80 @@
+{
+ "dsl": {
+ "widgetName": "MainContainer",
+ "backgroundColor": "none",
+ "rightColumn": 1224,
+ "snapColumns": 16,
+ "detachFromLayout": true,
+ "widgetId": "0",
+ "topRow": 0,
+ "bottomRow": 1280,
+ "containerStyle": "none",
+ "snapRows": 33,
+ "parentRowSpace": 1,
+ "type": "CANVAS_WIDGET",
+ "canExtend": true,
+ "version": 9,
+ "minHeight": 1292,
+ "parentColumnSpace": 1,
+ "dynamicBindingPathList": [],
+ "leftColumn": 0,
+ "children": [
+ {
+ "isVisible": true,
+ "isDisabled": false,
+ "datePickerType": "DATE_PICKER",
+ "label": "",
+ "dateFormat": "DD/MM/YYYY HH:mm",
+ "widgetName": "DatePicker1",
+ "defaultDate": "2021-02-05T10:53:12.791Z",
+ "version": 2,
+ "type": "DATE_PICKER_WIDGET2",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 5,
+ "rightColumn": 10,
+ "topRow": 0,
+ "bottomRow": 1,
+ "parentId": "0",
+ "widgetId": "w4htilgv5t"
+ },
+ {
+ "isVisible": true,
+ "text": "Label",
+ "textStyle": "LABEL",
+ "textAlign": "LEFT",
+ "widgetName": "Text1",
+ "version": 1,
+ "type": "TEXT_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 1,
+ "rightColumn": 5,
+ "topRow": 3,
+ "bottomRow": 4,
+ "parentId": "0",
+ "widgetId": "voohxsv4t2"
+ },
+ {
+ "isVisible": true,
+ "text": "Label",
+ "textStyle": "LABEL",
+ "textAlign": "LEFT",
+ "widgetName": "Text2",
+ "version": 1,
+ "type": "TEXT_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 8,
+ "rightColumn": 12,
+ "topRow": 3,
+ "bottomRow": 4,
+ "parentId": "0",
+ "widgetId": "xif8wugzjv"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/client/cypress/fixtures/tabdsl.json b/app/client/cypress/fixtures/tabdsl.json
new file mode 100644
index 0000000000..83795bf2fd
--- /dev/null
+++ b/app/client/cypress/fixtures/tabdsl.json
@@ -0,0 +1,91 @@
+{
+ "dsl": {
+ "widgetName": "MainContainer",
+ "backgroundColor": "none",
+ "rightColumn": 1224,
+ "snapColumns": 16,
+ "detachFromLayout": true,
+ "widgetId": "0",
+ "topRow": 0,
+ "bottomRow": 1280,
+ "containerStyle": "none",
+ "snapRows": 33,
+ "parentRowSpace": 1,
+ "type": "CANVAS_WIDGET",
+ "canExtend": true,
+ "version": 8,
+ "minHeight": 1292,
+ "parentColumnSpace": 1,
+ "dynamicBindingPathList": [],
+ "leftColumn": 0,
+ "children": [
+ {
+ "isVisible": true,
+ "shouldScrollContents": false,
+ "widgetName": "Tabs1",
+ "tabs": [
+ {
+ "label": "Tab 1",
+ "id": "tab1",
+ "widgetId": "uxle0mrg8t"
+ },
+ {
+ "label": "Tab 2",
+ "id": "tab2",
+ "widgetId": "9hy1rmqb2f"
+ }
+ ],
+ "shouldShowTabs": true,
+ "defaultTab": "Tab 1",
+ "type": "TABS_WIDGET",
+ "isLoading": false,
+ "parentColumnSpace": 74,
+ "parentRowSpace": 40,
+ "leftColumn": 2,
+ "rightColumn": 10,
+ "topRow": 8,
+ "bottomRow": 15,
+ "parentId": "0",
+ "widgetId": "y6rla3dsd6",
+ "children": [
+ {
+ "type": "CANVAS_WIDGET",
+ "tabId": "tab1",
+ "tabName": "Tab 1",
+ "widgetId": "uxle0mrg8t",
+ "parentId": "y6rla3dsd6",
+ "detachFromLayout": true,
+ "children": [],
+ "parentRowSpace": 1,
+ "parentColumnSpace": 1,
+ "leftColumn": 0,
+ "rightColumn": 592,
+ "topRow": 0,
+ "bottomRow": 280,
+ "isLoading": false,
+ "widgetName": "Canvas1",
+ "renderMode": "CANVAS"
+ },
+ {
+ "type": "CANVAS_WIDGET",
+ "tabId": "tab2",
+ "tabName": "Tab 2",
+ "widgetId": "9hy1rmqb2f",
+ "parentId": "y6rla3dsd6",
+ "detachFromLayout": true,
+ "children": [],
+ "parentRowSpace": 1,
+ "parentColumnSpace": 1,
+ "leftColumn": 0,
+ "rightColumn": 592,
+ "topRow": 0,
+ "bottomRow": 280,
+ "isLoading": false,
+ "widgetName": "Canvas2",
+ "renderMode": "CANVAS"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/client/cypress/fixtures/testdata.json b/app/client/cypress/fixtures/testdata.json
index cd8432c8da..84d2a402ce 100644
--- a/app/client/cypress/fixtures/testdata.json
+++ b/app/client/cypress/fixtures/testdata.json
@@ -24,10 +24,10 @@
"Post": "POST",
"Delete": "DELETE",
"Patch": "PATCH",
- "methodput": "api/users/2",
- "methodpost": "api/users",
- "methodpatch": "api/users/2",
- "methoddelete": "1",
+ "methodput": "echo/put",
+ "methodpost": "echo/post",
+ "methodpatch": "echo/patch",
+ "methoddelete": "echo/delete",
"putAction": "//div[contains(@class, 't--dropdown-option')]//span[contains(text(),'PUT')]",
"postAction": "//div[contains(@class, 't--dropdown-option')]//span[contains(text(),'POST')]",
"patchAction": "//div[contains(@class, 't--dropdown-option')]//span[contains(text(),'PATCH')]",
@@ -97,7 +97,7 @@
"btoaInput": "{{btoa('A')",
"defaultInputBinding": "{{Input2.text",
"tabBinding": "{{Tabs1.selectedTab",
- "pageloadBinding": "{{PageLoadApi.data.data[1].id}}{{Input1.text}}",
+ "pageloadBinding": "{{PageLoadApi.data.users[1].id}}{{Input1.text}}",
"currentRowEmail": "{{currentRow.email}}",
"currentRowOrderAmt": "{{currentRow.orderAmount}}",
"momentDate": "{{moment()}}",
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/BindApi_withPageload_Input_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/BindApi_withPageload_Input_spec.js
index bd2f3eb8d1..4e38c8ccee 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/BindApi_withPageload_Input_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Binding/BindApi_withPageload_Input_spec.js
@@ -15,7 +15,7 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
it("Will load an api on load", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("PageLoadApi");
- cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
+ cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods);
cy.WaitAutoSave();
cy.get(apiwidget.settings).click({ force: true });
cy.get(apiwidget.onPageLoad).click({ force: true });
@@ -25,9 +25,7 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
it("Input widget updated with deafult data", function() {
cy.SearchEntityandOpen("Input1");
- cy.get(widgetsPage.defaultInput)
- .type(testdata.command)
- .type("3");
+ cy.get(widgetsPage.defaultInput).type("3");
cy.get(commonlocators.editPropCrossButton).click();
cy.wait("@updateLayout").should(
"have.nested.property",
@@ -53,13 +51,13 @@ describe("Binding the API with pageOnLoad and input Widgets", function() {
);
cy.PublishtheApp();
cy.get(publish.inputWidget + " " + "input")
- .last()
+ .first()
.invoke("attr", "value")
.should("contain", "3");
cy.get(publish.inputWidget + " " + "input")
.last()
.invoke("attr", "value")
- .should("contain", "2");
+ .should("contain", "23");
cy.get(publish.backToEditor)
.first()
.click();
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js
index 9683540943..3a1a83a28e 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/DatePicker_spec.js
@@ -63,45 +63,45 @@ describe("DatePicker Widget Functionality", function() {
);
});
- it("Datepicker min/max date validation", function() {
- cy.get(formWidgetsPage.defaultDate).click({ force: true });
- cy.SetDateToToday();
+ // it("Datepicker min/max date validation", function() {
+ // cy.get(formWidgetsPage.defaultDate).click({ force: true });
+ // cy.SetDateToToday();
- cy.get(formWidgetsPage.minDate)
- .first()
- .click();
- // eslint-disable-next-line cypress/no-unnecessary-waiting
- cy.wait(1000);
- cy.setDate(-1, "ddd MMM DD YYYY");
+ // cy.get(formWidgetsPage.minDate)
+ // .first()
+ // .click();
+ // // eslint-disable-next-line cypress/no-unnecessary-waiting
+ // cy.wait(1000);
+ // cy.setDate(-1, "ddd MMM DD YYYY");
- cy.get(formWidgetsPage.maxDate)
- .first()
- .click();
- // eslint-disable-next-line cypress/no-unnecessary-waiting
- cy.wait(1000);
- cy.setDate(1, "ddd MMM DD YYYY");
+ // cy.get(formWidgetsPage.maxDate)
+ // .first()
+ // .click();
+ // // eslint-disable-next-line cypress/no-unnecessary-waiting
+ // cy.wait(1000);
+ // cy.setDate(1, "ddd MMM DD YYYY");
- cy.PublishtheApp();
- cy.get(publishPage.datepickerWidget + " .bp3-input").click();
+ // cy.PublishtheApp();
+ // cy.get(publishPage.datepickerWidget + " .bp3-input").click();
- const minDate = Cypress.moment()
- .add(2, "days")
- .format("ddd MMM DD YYYY");
- const maxDate = Cypress.moment()
- .add(2, "days")
- .format("ddd MMM DD YYYY");
+ // const minDate = Cypress.moment()
+ // .add(2, "days")
+ // .format("ddd MMM DD YYYY");
+ // const maxDate = Cypress.moment()
+ // .add(2, "days")
+ // .format("ddd MMM DD YYYY");
- cy.get(`.DayPicker-Day[aria-label=\"${minDate}\"]`).should(
- "have.attr",
- "aria-disabled",
- "true",
- );
- cy.get(`.DayPicker-Day[aria-label=\"${maxDate}\"]`).should(
- "have.attr",
- "aria-disabled",
- "true",
- );
- });
+ // cy.get(`.DayPicker-Day[aria-label=\"${minDate}\"]`).should(
+ // "have.attr",
+ // "aria-disabled",
+ // "true",
+ // );
+ // cy.get(`.DayPicker-Day[aria-label=\"${maxDate}\"]`).should(
+ // "have.attr",
+ // "aria-disabled",
+ // "true",
+ // );
+ // });
// it("Datepicker default date validation", function() {
// cy.get(formWidgetsPage.defaultDate).click();
diff --git a/app/client/cypress/integration/Smoke_TestSuite/DisplayWidgets/Modal_spec.js b/app/client/cypress/integration/Smoke_TestSuite/DisplayWidgets/Modal_spec.js
new file mode 100644
index 0000000000..0fe1a010e7
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/DisplayWidgets/Modal_spec.js
@@ -0,0 +1,25 @@
+const dsl = require("../../../fixtures/ModalDsl.json");
+const publishPage = require("../../../locators/publishWidgetspage.json");
+const explorer = require("../../../locators/explorerlocators.json");
+
+describe("Modal Widget Functionality", function() {
+ beforeEach(() => {
+ cy.addDsl(dsl);
+ });
+
+ it("Add new Modal", () => {
+ cy.get(explorer.addWidget).click();
+ cy.dragAndDropToCanvas("modalwidget", { x: 300, y: -300 });
+ cy.get(".t--modal-widget").should("exist");
+ });
+
+ it("Open Existing Modal from created Widgets list", () => {
+ cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(Widgets)").click({
+ multiple: true,
+ });
+ cy.get(".bp3-icon-caret-right ~ .t--entity-name:contains(Modal1)").click({
+ multiple: true,
+ });
+ cy.get(".t--modal-widget").should("exist");
+ });
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Entity_Naming_conflict_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Entity_Naming_conflict_spec.js
new file mode 100644
index 0000000000..2bae6e5108
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Entity_Naming_conflict_spec.js
@@ -0,0 +1,28 @@
+const commonlocators = require("../../../locators/commonlocators.json");
+const Layoutpage = require("../../../locators/Layout.json");
+const widgetsPage = require("../../../locators/Widgets.json");
+const publish = require("../../../locators/publishWidgetspage.json");
+const dsl = require("../../../fixtures/basicTabledsl.json");
+const pages = require("../../../locators/Pages.json");
+const tabname = "UpdatedTab";
+
+describe("Tab widget test", function() {
+ const apiName = "Table1";
+ const tableName = "Table";
+ before(() => {
+ cy.addDsl(dsl);
+ });
+
+ it("Rename API with table widget name validation test", function() {
+ cy.log("Login Successful");
+ cy.NavigateToAPI_Panel();
+ cy.log("Navigation to API Panel screen successful");
+ cy.CreateApiAndValidateUniqueEntityName(apiName);
+ });
+
+ it("Rename Table widget with api name validation test", function() {
+ cy.GlobalSearchEntity("Table1");
+ cy.RenameEntity(tableName);
+ cy.validateMessage(tableName);
+ });
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js
new file mode 100644
index 0000000000..1180651253
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js
@@ -0,0 +1,70 @@
+const commonlocators = require("../../../locators/commonlocators.json");
+const Layoutpage = require("../../../locators/Layout.json");
+const widgetsPage = require("../../../locators/Widgets.json");
+const publish = require("../../../locators/publishWidgetspage.json");
+const dsl = require("../../../fixtures/tabdsl.json");
+const pages = require("../../../locators/Pages.json");
+const tabname = "UpdatedTab";
+
+describe("Tab widget test", function() {
+ const tabname = "UpdatedTab";
+ before(() => {
+ cy.addDsl(dsl);
+ });
+
+ it("Tab Widget Functionality To rename Tabs from entity explorer", function() {
+ cy.GlobalSearchEntity("Tab 1");
+ cy.RenameEntity(tabname);
+ });
+
+ it("Tab name validation in properties and widget ", function() {
+ cy.openPropertyPane("tabswidget");
+ cy.closePropertyPane();
+ cy.get(Layoutpage.tabWidget)
+ .contains(tabname)
+ .click({ force: true })
+ .should("be.visible");
+ });
+
+ it("Tab Widget Functionality To delete Tabs from entity explorer", function() {
+ cy.GlobalSearchEntity("Tab 2");
+ cy.RenameEntity(tabname);
+ cy.validateMessage(tabname);
+ cy.deleteEntity();
+ cy.get(commonlocators.entityExplorersearch).should("be.visible");
+ cy.get(commonlocators.entityExplorersearch)
+ .clear()
+ .type("Tab 2");
+ cy.get(
+ commonlocators.entitySearchResult.concat("Tab 2").concat("')"),
+ ).should("not.exist");
+ });
+
+ /* To be enabled once the bug is fixed
+ it("Publish app and check for the widget name", function() {
+ cy.PublishtheApp();
+ cy.get(publish.tabWidget)
+ .contains(tabname)
+ .click({ force: true })
+ .should("be.selected");
+ cy.get(publish.tabWidget)
+ .contains("Tab 2")
+ .click({ force: true })
+ .should("be.selected");
+ });
+
+ it("Tab Widget Functionality To Unchecked Visible Widget", function() {
+ cy.get(publish.backToEditor).click();
+ cy.openPropertyPane("tabswidget");
+ cy.closePropertyPane();
+ cy.get(Layoutpage.tabWidget)
+ .contains("Tab 2")
+ .click({ force: true })
+ .should("not.be.visible");
+ });
+ */
+});
+
+afterEach(() => {
+ // put your clean up code if any
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_Default_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_Default_spec.js
new file mode 100644
index 0000000000..82699162c7
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_Default_spec.js
@@ -0,0 +1,40 @@
+const commonlocators = require("../../../locators/commonlocators.json");
+const formWidgetsPage = require("../../../locators/FormWidgets.json");
+const dsl = require("../../../fixtures/datePicker2dsl.json");
+const publishPage = require("../../../locators/publishWidgetspage.json");
+const pages = require("../../../locators/Pages.json");
+
+describe("DatePicker Widget Property pane tests with js bindings", function() {
+ before(() => {
+ cy.addDsl(dsl);
+ });
+
+ it("Datepicker default date validation with js binding and default date", function() {
+ cy.openPropertyPane("datepickerwidget2");
+ cy.get(".t--property-control-defaultdate .bp3-input").clear();
+ cy.get(formWidgetsPage.toggleJsDefaultDate).click();
+ cy.testJsontext("defaultdate", "{{ moment().add(-1,'days') }}");
+ });
+
+ it("Text widgets binding with datepicker", function() {
+ cy.SearchEntityandOpen("Text1");
+ cy.testJsontext("text", "{{DatePicker1.formattedDate}}");
+ cy.closePropertyPane();
+ cy.SearchEntityandOpen("Text2");
+ cy.testJsontext("text", "{{DatePicker1.selectedDate}}");
+ cy.closePropertyPane();
+ });
+
+ it("Text widgets binding with datepicker", function() {
+ cy.openPropertyPane("datepickerwidget2");
+ cy.selectDateFormat("DD/MM/YYYY");
+ cy.assertDateFormat();
+ cy.closePropertyPane();
+ cy.assertDateFormat();
+ });
+ it("Datepicker default date validation with js binding", function() {
+ cy.PublishtheApp();
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ cy.wait(10000);
+ });
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_spec.js
new file mode 100644
index 0000000000..0f12096bb6
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_2_spec.js
@@ -0,0 +1,80 @@
+const commonlocators = require("../../../locators/commonlocators.json");
+const formWidgetsPage = require("../../../locators/FormWidgets.json");
+const dsl = require("../../../fixtures/datePicker2dsl.json");
+const publishPage = require("../../../locators/publishWidgetspage.json");
+const pages = require("../../../locators/Pages.json");
+
+describe("DatePicker Widget Property pane tests with js bindings", function() {
+ before(() => {
+ cy.addDsl(dsl);
+ });
+
+ it("Datepicker default date validation with js binding", function() {
+ cy.openPropertyPane("datepickerwidget2");
+ cy.get(".t--property-control-defaultdate .bp3-input").clear();
+ cy.get(formWidgetsPage.toggleJsDefaultDate).click();
+ cy.testJsontext("defaultdate", "{{moment().toISOString()}}");
+ cy.get(formWidgetsPage.toggleJsMinDate).click();
+ cy.testJsontext(
+ "mindate",
+ "{{moment().subtract(10, 'days').toISOString()}}",
+ );
+ cy.get(formWidgetsPage.toggleJsMaxDate).click();
+ cy.testJsontext("maxdate", "{{moment().add(10, 'days').toISOString()}}");
+ /*
+ cy.get(formWidgetsPage.datepickerWidget + " .bp3-input").should(
+ "contain.value",
+ "14/02/2021",
+ );
+ cy.PublishtheApp();
+ cy.get(publishPage.datepickerWidget + " .bp3-input").should(
+ "contain.value",
+ "14/02/2021",
+ );
+ */
+ });
+
+ it("Text widgets binding with datepicker", function() {
+ cy.SearchEntityandOpen("Text1");
+ cy.testJsontext("text", "{{DatePicker1.formattedDate}}");
+ cy.closePropertyPane();
+ cy.SearchEntityandOpen("Text2");
+ cy.testJsontext("text", "{{DatePicker1.selectedDate}}");
+ cy.closePropertyPane();
+ });
+
+ it("Text widgets binding with datepicker", function() {
+ cy.openPropertyPane("datepickerwidget2");
+ cy.selectDateFormat("YYYY-MM-DD");
+ cy.assertDateFormat();
+ cy.selectDateFormat("YYYY-MM-DD HH:mm");
+ cy.assertDateFormat();
+ cy.selectDateFormat("YYYY-MM-DDTHH:mm:ss.sssZ");
+ cy.assertDateFormat();
+ cy.selectDateFormat("DD/MM/YYYY");
+ cy.assertDateFormat();
+ cy.selectDateFormat("DD/MM/YYYY HH:mm");
+ cy.closePropertyPane();
+ cy.assertDateFormat();
+ });
+
+ it("Datepicker default date validation with strings", function() {
+ cy.openPropertyPane("datepickerwidget2");
+ cy.get(formWidgetsPage.toggleJsDefaultDate).click();
+ cy.get(".t--property-control-defaultdate .bp3-input").clear();
+ cy.get(".t--property-control-defaultdate .bp3-input").type("2020-02-01");
+ cy.closePropertyPane();
+ cy.openPropertyPane("datepickerwidget2");
+ cy.get(formWidgetsPage.toggleJsMinDate).click();
+ cy.get(".t--property-control-mindate .bp3-input").type("2020-01-01");
+ cy.get(formWidgetsPage.toggleJsMaxDate).click();
+ cy.get(".t--property-control-maxdate .bp3-input").type("2020-02-10");
+ cy.closePropertyPane();
+ });
+
+ it("Datepicker default date validation with js binding", function() {
+ cy.PublishtheApp();
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ cy.wait(10000);
+ });
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_Toggle_js_spec.js b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_Toggle_js_spec.js
new file mode 100644
index 0000000000..a581ad7d17
--- /dev/null
+++ b/app/client/cypress/integration/Smoke_TestSuite/FormWidgets/DatePicker_Toggle_js_spec.js
@@ -0,0 +1,47 @@
+const commonlocators = require("../../../locators/commonlocators.json");
+const formWidgetsPage = require("../../../locators/FormWidgets.json");
+const dsl = require("../../../fixtures/newFormDsl.json");
+const publishPage = require("../../../locators/publishWidgetspage.json");
+const pages = require("../../../locators/Pages.json");
+
+describe("DatePicker Widget Property pane tests with js bindings", function() {
+ before(() => {
+ cy.addDsl(dsl);
+ });
+
+ beforeEach(() => {
+ cy.openPropertyPane("datepickerwidget");
+ });
+
+ it("Datepicker default date validation with js binding", function() {
+ cy.get(".t--property-control-defaultdate .bp3-input").clear();
+ cy.get(formWidgetsPage.toggleJsDefaultDate).click();
+ cy.testJsontext(
+ "defaultdate",
+ "{{moment('14/02/2021', 'DD/MM/YYYY').format('DD/MM/YYYY')}}",
+ );
+ cy.get(formWidgetsPage.toggleJsMinDate).click();
+ cy.testJsontext(
+ "mindate",
+ "{{moment('12/02/2021', 'DD/MM/YYYY').format('DD/MM/YYYY')}}",
+ );
+ cy.get(formWidgetsPage.toggleJsMaxDate).click();
+ cy.testJsontext(
+ "maxdate",
+ "{{moment('17/02/2021', 'DD/MM/YYYY').format('DD/MM/YYYY')}}",
+ );
+ cy.get(formWidgetsPage.datepickerWidget + " .bp3-input").should(
+ "contain.value",
+ "14/02/2021",
+ );
+ cy.PublishtheApp();
+ cy.get(publishPage.datepickerWidget + " .bp3-input").should(
+ "contain.value",
+ "14/02/2021",
+ );
+ });
+
+ afterEach(() => {
+ cy.get(publishPage.backToEditor).click({ force: true });
+ });
+});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ActionExecution/Action_PageOnLoad_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ActionExecution/Action_PageOnLoad_spec.js
index 2dbc253e37..e8ae36ec3d 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ActionExecution/Action_PageOnLoad_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ActionExecution/Action_PageOnLoad_spec.js
@@ -1,5 +1,6 @@
const dsl = require("../../../../fixtures/tableWidgetDsl.json");
const commonlocators = require("../../../../locators/commonlocators.json");
+const testdata = require("../../../../fixtures/testdata.json");
describe("API Panel Test Functionality", function() {
before(() => {
@@ -8,7 +9,7 @@ describe("API Panel Test Functionality", function() {
it("Will load an api on load", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("PageLoadApi");
- cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
+ cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods);
cy.WaitAutoSave();
cy.get("li:contains('Settings')").click({ force: true });
cy.get("[data-cy=executeOnLoad]").click({ force: true });
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js
index 6e3cb4edd5..84030d93bb 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_All_Verb_spec.js
@@ -21,7 +21,7 @@ describe("API Panel Test Functionality", function() {
cy.log("Creation of FirstAPI Action successful");
cy.SelectAction(testdata.putAction);
cy.EnterSourceDetailsWithbody(
- testdata.baseUrl2,
+ testdata.baseUrl,
testdata.methodput,
testdata.headerKey,
testdata.headerValue,
@@ -35,7 +35,7 @@ describe("API Panel Test Functionality", function() {
.type(json, { force: true });
cy.WaitAutoSave();
cy.RunAPI();
- cy.validateRequest(testdata.baseUrl2, testdata.methodput, testdata.Put);
+ cy.validateRequest(testdata.baseUrl, testdata.methodput, testdata.Put);
});
cy.ResponseStatusCheck("200 OK");
cy.log("Response code check successful");
@@ -48,7 +48,7 @@ describe("API Panel Test Functionality", function() {
cy.log("Creation of FirstAPI Action successful");
cy.SelectAction(testdata.postAction);
cy.EnterSourceDetailsWithbody(
- testdata.baseUrl2,
+ testdata.baseUrl,
testdata.methodpost,
testdata.headerKey,
testdata.headerValue,
@@ -62,7 +62,7 @@ describe("API Panel Test Functionality", function() {
.type(json, { force: true });
cy.WaitAutoSave();
cy.RunAPI();
- cy.validateRequest(testdata.baseUrl2, testdata.methodpost, testdata.Post);
+ cy.validateRequest(testdata.baseUrl, testdata.methodpost, testdata.Post);
});
cy.ResponseStatusCheck("201 CREATED");
cy.log("Response code check successful");
@@ -75,7 +75,7 @@ describe("API Panel Test Functionality", function() {
cy.log("Creation of FirstAPI Action successful");
cy.SelectAction(testdata.patchAction);
cy.EnterSourceDetailsWithbody(
- testdata.baseUrl2,
+ testdata.baseUrl,
testdata.methodpatch,
testdata.headerKey,
testdata.headerValue,
@@ -90,7 +90,7 @@ describe("API Panel Test Functionality", function() {
cy.WaitAutoSave();
cy.RunAPI();
cy.validateRequest(
- testdata.baseUrl2,
+ testdata.baseUrl,
testdata.methodpatch,
testdata.Patch,
);
@@ -106,19 +106,19 @@ describe("API Panel Test Functionality", function() {
cy.log("Creation of FirstAPI Action successful");
cy.SelectAction(testdata.deleteAction);
cy.EnterSourceDetailsWithbody(
- testdata.baseUrl2,
- testdata.methodpatch,
+ testdata.baseUrl,
+ testdata.methoddelete,
testdata.headerKey,
testdata.headerValue,
);
cy.WaitAutoSave();
cy.RunAPI();
cy.validateRequest(
- testdata.baseUrl2,
- testdata.methodpatch,
+ testdata.baseUrl,
+ testdata.methoddelete,
testdata.Delete,
);
- cy.ResponseStatusCheck("204 NO_CONTENT");
+ cy.ResponseStatusCheck("200");
cy.log("Response code check successful");
});
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js
index 58c96969a1..b23b1b8fdb 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_CurlPOSTImport_spec.js
@@ -7,7 +7,7 @@ describe("Test curl import flow", function() {
cy.NavigateToApiEditor();
cy.get(ApiEditor.curlImage).click({ force: true });
cy.get("textarea").type(
- 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST https://reqres.in/api/users',
+ 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST https://mock-api.appsmith.com/echo/post',
{
force: true,
parseSpecialCharSequences: false,
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_Mustache_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_Mustache_spec.js
index 4a246430fb..f6b285006f 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_Mustache_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ApiPaneTests/API_Mustache_spec.js
@@ -11,12 +11,14 @@ describe("Moustache test Functionality", function() {
it("Moustache test Functionality", function() {
cy.openPropertyPane("textwidget");
cy.widgetText("Api", widgetsPage.textWidget, widgetsPage.textInputval);
- cy.testCodeMirror("/api/users/2");
+ cy.testCodeMirror("users");
cy.NavigateToAPI_Panel();
cy.log("Navigation to API Panel screen successful");
cy.CreateAPI("TestAPINew");
cy.log("Creation of API Action successful");
- cy.enterDatasourceAndPath(testdata.baseUrl2, testdata.moustacheMethod);
+ cy.enterDatasourceAndPath(testdata.baseUrl, testdata.moustacheMethod);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ cy.wait(300);
cy.RunAPI();
cy.ResponseStatusCheck(testdata.successStatusCode);
cy.log("Response code check successful");
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js
index 2a1486967d..778c6091c6 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/DatasourceForm_spec.js
@@ -1,8 +1,10 @@
+const testdata = require("../../../../fixtures/testdata.json");
+
describe("Datasource form related tests", function() {
it("Check whether the delete button has the right color", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("Testapi");
- cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
+ cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods);
cy.get(".t--store-as-datasource").click();
diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js
index b9d29746f3..b33c76418a 100644
--- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js
+++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiDatasource_spec.js
@@ -1,13 +1,15 @@
+const testdata = require("../../../../fixtures/testdata.json");
+
describe("Create a rest datasource", function() {
it("Create a rest datasource", function() {
cy.NavigateToAPI_Panel();
cy.CreateAPI("Testapi");
- cy.enterDatasourceAndPath("https://reqres.in/api/", "users");
+ cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods);
cy.get(".t--store-as-datasource").click();
cy.saveDatasource();
- cy.contains(".datasource-highlight", "https://reqres.in");
+ cy.contains(".datasource-highlight", "https://mock-api.appsmith.com");
cy.SaveAndRunAPI();
});
diff --git a/app/client/cypress/locators/FormWidgets.json b/app/client/cypress/locators/FormWidgets.json
index 673ae44d1a..84d613b30e 100644
--- a/app/client/cypress/locators/FormWidgets.json
+++ b/app/client/cypress/locators/FormWidgets.json
@@ -1,37 +1,36 @@
{
- "checkboxWidget": ".t--draggable-checkboxwidget",
- "dropdownWidget": ".t--draggable-dropdownwidget",
- "dropdownSelectionType": ".t--property-control-selectiontype",
- "radioWidget": ".t--draggable-radiogroupwidget",
- "radioOnSelectionChangeDropdown": ".t--property-control-onselectionchange",
- "nextDayBtn": ".DayPicker-Day[aria-selected='true'] + div.DayPicker-Day",
- "datepickerWidget": ".t--draggable-datepickerwidget",
- "defaultDate": ".t--property-control-defaultdate input",
- "minDate": ".t--property-control-mindate input",
- "maxDate": ".t--property-control-maxdate input",
- "filepickerWidget": ".t--draggable-filepickerwidget",
- "formWidget": ".t--draggable-formwidget",
- "richTextEditorWidget": ".t--draggable-richtexteditorwidget",
- "richEditorOnTextChange": ".t--property-control-ontextchange",
- "optionvalue": ".t--property-control-defaultselectedvalue .kDwnRc",
- "defselected": ".CodeMirror textarea",
- "dropdowninner": ".bp3-button > .bp3-button-text",
- "Textinput": ".t--property-control-options .CodeMirror-code",
- "labelvalue": ".t--draggable-dropdownwidget label",
- "dropdownInput": ".bp3-tag-input-values",
- "labelradio": ".t--draggable-radiogroupwidget label",
- "deleteradiovalue": ".t--property-control-options mask",
- "inputRadio": ".t--draggable-radiogroupwidget input",
- "defaultSelect": ".t--property-control-defaultselectedvalue .CodeMirror-code",
- "formInner": ".t--draggable-formwidget span.t--widget-name",
- "radioInput": ".t--draggable-radiogroupwidget span.t--widget-name",
- "radioAddButton": ".t--property-control-options button",
- "formD": "div[type='FORM_WIDGET']",
- "datepickerFooter": ".bp3-datepicker-footer span",
- "disableJs":".t--property-control-disable input[type='checkbox']",
- "switchWidget": ".t--draggable-switchwidget",
- "toggleJsDefaultDate": ".t--property-control-defaultdate .t--js-toggle",
- "toggleJsMinDate": ".t--property-control-mindate .t--js-toggle",
- "toggleJsMaxDate": ".t--property-control-maxdate .t--js-toggle"
-
- }
+ "checkboxWidget": ".t--draggable-checkboxwidget",
+ "dropdownWidget": ".t--draggable-dropdownwidget",
+ "dropdownSelectionType": ".t--property-control-selectiontype",
+ "radioWidget": ".t--draggable-radiogroupwidget",
+ "radioOnSelectionChangeDropdown": ".t--property-control-onselectionchange",
+ "nextDayBtn": ".DayPicker-Day[aria-selected='true'] + div.DayPicker-Day",
+ "datepickerWidget": ".t--draggable-datepickerwidget",
+ "defaultDate": ".t--property-control-defaultdate input",
+ "minDate": ".t--property-control-mindate input",
+ "maxDate": ".t--property-control-maxdate input",
+ "filepickerWidget": ".t--draggable-filepickerwidget",
+ "formWidget": ".t--draggable-formwidget",
+ "richTextEditorWidget": ".t--draggable-richtexteditorwidget",
+ "richEditorOnTextChange": ".t--property-control-ontextchange",
+ "optionvalue": ".t--property-control-defaultselectedvalue .kDwnRc",
+ "defselected": ".CodeMirror textarea",
+ "dropdowninner": ".bp3-button > .bp3-button-text",
+ "Textinput": ".t--property-control-options .CodeMirror-code",
+ "labelvalue": ".t--draggable-dropdownwidget label",
+ "dropdownInput": ".bp3-tag-input-values",
+ "labelradio": ".t--draggable-radiogroupwidget label",
+ "deleteradiovalue": ".t--property-control-options mask",
+ "inputRadio": ".t--draggable-radiogroupwidget input",
+ "defaultSelect": ".t--property-control-defaultselectedvalue .CodeMirror-code",
+ "formInner": ".t--draggable-formwidget span.t--widget-name",
+ "radioInput": ".t--draggable-radiogroupwidget span.t--widget-name",
+ "radioAddButton": ".t--property-control-options button",
+ "formD": "div[type='FORM_WIDGET']",
+ "datepickerFooter": ".bp3-datepicker-footer span",
+ "disableJs": ".t--property-control-disable input[type='checkbox']",
+ "switchWidget": ".t--draggable-switchwidget",
+ "toggleJsDefaultDate": ".t--property-control-defaultdate .t--js-toggle",
+ "toggleJsMinDate": ".t--property-control-mindate .t--js-toggle",
+ "toggleJsMaxDate": ".t--property-control-maxdate .t--js-toggle"
+}
diff --git a/app/client/cypress/locators/apiWidgetslocator.json b/app/client/cypress/locators/apiWidgetslocator.json
index f83ddfd316..2727f72efe 100644
--- a/app/client/cypress/locators/apiWidgetslocator.json
+++ b/app/client/cypress/locators/apiWidgetslocator.json
@@ -51,5 +51,6 @@
"propertyList": ".t--entity-property",
"actionlist": ".action div div",
"settings": "li:contains('Settings')",
- "onPageLoad": "[data-cy=executeOnLoad]"
+ "onPageLoad": "[data-cy=executeOnLoad]",
+ "renameEntity": ".single-select >div:contains('Edit Name')"
}
diff --git a/app/client/cypress/locators/explorerlocators.json b/app/client/cypress/locators/explorerlocators.json
index 23c42bc461..47b927f915 100644
--- a/app/client/cypress/locators/explorerlocators.json
+++ b/app/client/cypress/locators/explorerlocators.json
@@ -25,5 +25,6 @@
"addWidget":".widgets .t--entity-add-btn",
"dropHere":".appsmith_widget_0",
"closeWidgets":".t--close-widgets-sidebar",
- "addDBQueryEntity": ".dbqueries .t--entity-add-btn"
+ "addDBQueryEntity": ".dbqueries .t--entity-add-btn",
+ "editEntity": ".t--entity-name input"
}
\ No newline at end of file
diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js
index 4350a27197..3b193b59ba 100644
--- a/app/client/cypress/support/commands.js
+++ b/app/client/cypress/support/commands.js
@@ -690,6 +690,37 @@ Cypress.Commands.add("switchToAPIInputTab", () => {
.click({ force: true });
});
+Cypress.Commands.add("selectDateFormat", (value) => {
+ cy.get(".t--property-control-dateformat button")
+ .first()
+ .click({ force: true });
+ cy.get("ul.bp3-menu")
+ .children()
+ .contains(value)
+ .click();
+});
+
+Cypress.Commands.add("assertDateFormat", () => {
+ cy.get(".t--draggable-datepickerwidget2 input")
+ .first()
+ .invoke("attr", "value")
+ .then((text) => {
+ const firstTxt = text;
+ cy.log("date time : ", firstTxt);
+ cy.get(commonlocators.labelTextStyle)
+ .first()
+ .should("contain", firstTxt);
+ cy.get(commonlocators.labelTextStyle)
+ .last()
+ .invoke("text")
+ .then((text) => {
+ const secondText = text;
+ cy.log("date time : ", secondText);
+ expect(firstTxt).not.to.equal(secondText);
+ });
+ });
+});
+
Cypress.Commands.add("selectPaginationType", (option) => {
cy.xpath(option).click({ force: true });
});
@@ -825,6 +856,40 @@ Cypress.Commands.add("CopyAPIToHome", () => {
);
});
+Cypress.Commands.add("RenameEntity", (value) => {
+ cy.xpath(apiwidget.popover)
+ .last()
+ .click({ force: true });
+ cy.get(apiwidget.renameEntity).click({ force: true });
+ cy.wait(2000);
+ cy.get(explorer.editEntity)
+ .last()
+ .type(value, { force: true });
+ cy.wait(3000);
+});
+
+Cypress.Commands.add("CreateApiAndValidateUniqueEntityName", (apiname) => {
+ cy.get(apiwidget.createapi).click({ force: true });
+ cy.wait("@createNewApi");
+ cy.get(apiwidget.resourceUrl).should("be.visible");
+ cy.get(apiwidget.ApiName).click({ force: true });
+ cy.get(apiwidget.apiTxt)
+ .clear()
+ .type(apiname, { force: true })
+ .should("have.value", apiname);
+ cy.get(".t--nameOfApi .error-message").should(($x) => {
+ console.log($x);
+ expect($x).contain(apiname.concat(" is already being used."));
+ });
+});
+
+Cypress.Commands.add("validateMessage", (value) => {
+ cy.get(".bp3-popover-content").should(($x) => {
+ console.log($x);
+ expect($x).contain(value.concat(" is already being used."));
+ });
+});
+
Cypress.Commands.add("DeleteAPIFromSideBar", () => {
cy.deleteEntity();
cy.wait("@deleteAction").should(
diff --git a/app/client/src/components/designSystems/appsmith/TableComponent/CascadeFields.tsx b/app/client/src/components/designSystems/appsmith/TableComponent/CascadeFields.tsx
index 755573d9bc..5770579ccc 100644
--- a/app/client/src/components/designSystems/appsmith/TableComponent/CascadeFields.tsx
+++ b/app/client/src/components/designSystems/appsmith/TableComponent/CascadeFields.tsx
@@ -8,7 +8,7 @@ import { ControlIcons } from "icons/ControlIcons";
import { AnyStyledComponent } from "styled-components";
import { Skin } from "constants/DefaultTheme";
import AutoToolTipComponent from "components/designSystems/appsmith/TableComponent/AutoToolTipComponent";
-import DatePickerComponent from "components/designSystems/blueprint/DatePickerComponent";
+import DatePickerComponent from "components/designSystems/blueprint/DatePickerComponent2";
import {
OperatorTypes,
Condition,
diff --git a/app/client/src/components/designSystems/appsmith/TableComponent/index.tsx b/app/client/src/components/designSystems/appsmith/TableComponent/index.tsx
index e78bc71dfd..dbcf1239cf 100644
--- a/app/client/src/components/designSystems/appsmith/TableComponent/index.tsx
+++ b/app/client/src/components/designSystems/appsmith/TableComponent/index.tsx
@@ -163,7 +163,7 @@ const ReactTableComponent = (props: ReactTableComponentProps) => {
row: { original: Record; index: number },
isSelected: boolean,
) => {
- if (!isSelected || !!props.multiRowSelection) {
+ if (!isSelected || props.multiRowSelection || !props.multiRowSelection) {
props.onRowClick(row.original, row.index);
}
};
diff --git a/app/client/src/components/designSystems/blueprint/DatePickerComponent.tsx b/app/client/src/components/designSystems/blueprint/DatePickerComponent.tsx
index 4d1e95c631..e0fac3e121 100644
--- a/app/client/src/components/designSystems/blueprint/DatePickerComponent.tsx
+++ b/app/client/src/components/designSystems/blueprint/DatePickerComponent.tsx
@@ -1,6 +1,10 @@
import React from "react";
import styled from "styled-components";
-import { getBorderCSSShorthand, labelStyle } from "constants/DefaultTheme";
+import {
+ getBorderCSSShorthand,
+ labelStyle,
+ IntentColors,
+} from "constants/DefaultTheme";
import { ControlGroup, Classes, Label } from "@blueprintjs/core";
import { ComponentProps } from "components/designSystems/appsmith/BaseComponent";
import { DateInput } from "@blueprintjs/datetime";
@@ -11,24 +15,30 @@ import { WIDGET_PADDING } from "constants/WidgetConstants";
import { TimePrecision } from "@blueprintjs/datetime";
import { Colors } from "constants/Colors";
import { ISO_DATE_FORMAT } from "constants/WidgetValidation";
+import ErrorTooltip from "components/editorComponents/ErrorTooltip";
+import { DATE_WIDGET_DEFAULT_VALIDATION_ERROR } from "constants/messages";
-const StyledControlGroup = styled(ControlGroup)`
+const StyledControlGroup = styled(ControlGroup)<{ isValid: boolean }>`
&&& {
.${Classes.INPUT} {
box-shadow: none;
color: ${Colors.OXFORD_BLUE};
font-size: ${(props) => props.theme.fontSizes[3]}px;
border: ${(props) => getBorderCSSShorthand(props.theme.borders[2])};
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.GEYSER_LIGHT};
border-radius: 0;
width: 100%;
height: inherit;
align-items: center;
&:active {
- border-color: ${Colors.HIT_GRAY};
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.HIT_GRAY};
}
&:focus {
border: ${(props) => getBorderCSSShorthand(props.theme.borders[2])};
- border-color: #80bdff;
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : "#80bdff"};
outline: 0;
box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.25);
}
@@ -95,10 +105,17 @@ class DatePickerComponent extends React.Component<
.clone()
.set({ month: 11, date: 31, year: year + 20 })
.toDate();
-
+ const isValid = this.state.selectedDate
+ ? this.isValidDate(this.parseDate(this.state.selectedDate))
+ : true;
+ const value =
+ isValid && this.state.selectedDate
+ ? this.parseDate(this.state.selectedDate)
+ : null;
return (
{
e.stopPropagation();
}}
@@ -115,29 +132,58 @@ class DatePickerComponent extends React.Component<
)}
{
-
+
+
+
}
);
}
+ isValidDate = (date: Date): boolean => {
+ let isValid = true;
+ const dateFormat = this.props.dateFormat || ISO_DATE_FORMAT;
+ const parsedCurrentDate = moment(date);
+ if (this.props.minDate) {
+ const parsedMinDate = moment(this.props.minDate, dateFormat);
+ if (
+ this.props.minDate &&
+ parsedMinDate.isValid() &&
+ parsedCurrentDate.isBefore(parsedMinDate)
+ ) {
+ isValid = false;
+ }
+ }
+ if (this.props.maxDate) {
+ const parsedMaxDate = moment(this.props.maxDate, dateFormat);
+ if (
+ isValid &&
+ this.props.maxDate &&
+ parsedMaxDate.isValid() &&
+ parsedCurrentDate.isAfter(parsedMaxDate)
+ ) {
+ isValid = false;
+ }
+ }
+ return isValid;
+ };
+
formatDate = (date: Date): string => {
const dateFormat = this.props.dateFormat || ISO_DATE_FORMAT;
return moment(date).format(dateFormat);
@@ -165,9 +211,6 @@ class DatePickerComponent extends React.Component<
const date = selectedDate ? this.formatDate(selectedDate) : "";
this.setState({ selectedDate: date });
- // if date is null ( if date is cleared ), don't call onDateSelected
- if (!selectedDate) return false;
-
onDateSelected(date);
}
};
diff --git a/app/client/src/components/designSystems/blueprint/DatePickerComponent2.tsx b/app/client/src/components/designSystems/blueprint/DatePickerComponent2.tsx
new file mode 100644
index 0000000000..a3d2cb7178
--- /dev/null
+++ b/app/client/src/components/designSystems/blueprint/DatePickerComponent2.tsx
@@ -0,0 +1,236 @@
+import React from "react";
+import styled from "styled-components";
+import { labelStyle, IntentColors } from "constants/DefaultTheme";
+import { ControlGroup, Classes, Label } from "@blueprintjs/core";
+import { ComponentProps } from "components/designSystems/appsmith/BaseComponent";
+import { DateInput } from "@blueprintjs/datetime";
+import moment from "moment-timezone";
+import "../../../../node_modules/@blueprintjs/datetime/lib/css/blueprint-datetime.css";
+import { DatePickerType } from "widgets/DatePickerWidget";
+import { WIDGET_PADDING } from "constants/WidgetConstants";
+import { TimePrecision } from "@blueprintjs/datetime";
+import { Colors } from "constants/Colors";
+import { ISO_DATE_FORMAT } from "constants/WidgetValidation";
+import ErrorTooltip from "components/editorComponents/ErrorTooltip";
+import { DATE_WIDGET_DEFAULT_VALIDATION_ERROR } from "constants/messages";
+
+const StyledControlGroup = styled(ControlGroup)<{ isValid: boolean }>`
+ &&& {
+ .${Classes.INPUT} {
+ box-shadow: none;
+ border: 1px solid;
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.GEYSER_LIGHT};
+ border-radius: ${(props) => props.theme.radii[1]}px;
+ width: 100%;
+ height: inherit;
+ align-items: center;
+ &:active {
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.HIT_GRAY};
+ }
+ &:focus {
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.MYSTIC};
+ }
+ }
+ .${Classes.INPUT_GROUP} {
+ display: block;
+ margin: 0;
+ }
+ .${Classes.CONTROL_GROUP} {
+ justify-content: flex-start;
+ }
+ label {
+ ${labelStyle}
+ flex: 0 1 30%;
+ margin: 7px ${WIDGET_PADDING * 2}px 0 0;
+ text-align: right;
+ align-self: flex-start;
+ max-width: calc(30% - ${WIDGET_PADDING}px);
+ }
+ }
+ &&& {
+ input {
+ border: 1px solid;
+ border-color: ${(props) =>
+ !props.isValid ? IntentColors.danger : Colors.HIT_GRAY};
+ border-radius: ${(props) => props.theme.radii[1]}px;
+ box-shadow: none;
+ color: ${Colors.OXFORD_BLUE};
+ font-size: ${(props) => props.theme.fontSizes[3]}px;
+ }
+ }
+`;
+
+class DatePickerComponent extends React.Component<
+ DatePickerComponentProps,
+ DatePickerComponentState
+> {
+ constructor(props: DatePickerComponentProps) {
+ super(props);
+ this.state = {
+ selectedDate: props.selectedDate,
+ };
+ }
+
+ componentDidUpdate(prevProps: DatePickerComponentProps) {
+ if (
+ this.props.selectedDate !== this.state.selectedDate &&
+ !moment(this.props.selectedDate).isSame(
+ moment(prevProps.selectedDate),
+ "seconds",
+ )
+ ) {
+ this.setState({ selectedDate: this.props.selectedDate });
+ }
+ }
+
+ getValidDate = (date: string, format: string) => {
+ const _date = moment(date, format);
+ return _date.isValid() ? _date.toDate() : undefined;
+ };
+
+ render() {
+ const now = moment();
+ const year = now.get("year");
+ const minDate = this.props.minDate
+ ? new Date(this.props.minDate)
+ : now
+ .clone()
+ .set({ month: 0, date: 1, year: year - 100 })
+ .toDate();
+ const maxDate = this.props.maxDate
+ ? new Date(this.props.maxDate)
+ : now
+ .clone()
+ .set({ month: 11, date: 31, year: year + 20 })
+ .toDate();
+ const isValid = this.state.selectedDate
+ ? this.isValidDate(new Date(this.state.selectedDate))
+ : true;
+ const value =
+ isValid && this.state.selectedDate
+ ? new Date(this.state.selectedDate)
+ : null;
+ return (
+ {
+ e.stopPropagation();
+ }}
+ >
+ {this.props.label && (
+
+ )}
+ {
+
+
+
+ }
+
+ );
+ }
+
+ isValidDate = (date: Date): boolean => {
+ let isValid = true;
+ const parsedCurrentDate = moment(date);
+ if (this.props.minDate) {
+ const parsedMinDate = moment(this.props.minDate);
+ if (
+ this.props.minDate &&
+ parsedMinDate.isValid() &&
+ parsedCurrentDate.isBefore(parsedMinDate)
+ ) {
+ isValid = false;
+ }
+ }
+ if (this.props.maxDate) {
+ const parsedMaxDate = moment(this.props.maxDate);
+ if (
+ isValid &&
+ this.props.maxDate &&
+ parsedMaxDate.isValid() &&
+ parsedCurrentDate.isAfter(parsedMaxDate)
+ ) {
+ isValid = false;
+ }
+ }
+ return isValid;
+ };
+
+ formatDate = (date: Date): string => {
+ const dateFormat = this.props.dateFormat || ISO_DATE_FORMAT;
+ return moment(date).format(dateFormat);
+ };
+
+ parseDate = (dateStr: string): Date => {
+ const date = moment(dateStr);
+
+ if (date.isValid()) return moment(dateStr).toDate();
+ else return moment().toDate();
+ };
+
+ /**
+ * checks if selelectedDate is null or not,
+ * sets state and calls props onDateSelected
+ * if its null, don't call onDateSelected
+ *
+ * @param selectedDate
+ */
+ onDateSelected = (selectedDate: Date, isUserChange: boolean) => {
+ if (isUserChange) {
+ const { onDateSelected } = this.props;
+
+ const date = selectedDate ? selectedDate.toISOString() : "";
+ this.setState({ selectedDate: date });
+
+ onDateSelected(date);
+ }
+ };
+}
+
+interface DatePickerComponentProps extends ComponentProps {
+ label: string;
+ dateFormat: string;
+ enableTimePicker?: boolean;
+ selectedDate?: string;
+ minDate?: string;
+ maxDate?: string;
+ timezone?: string;
+ datePickerType: DatePickerType;
+ isDisabled: boolean;
+ onDateSelected: (selectedDate: string) => void;
+ isLoading: boolean;
+}
+
+interface DatePickerComponentState {
+ selectedDate?: string;
+}
+
+export default DatePickerComponent;
diff --git a/app/client/src/components/editorComponents/CodeEditor/styledComponents.ts b/app/client/src/components/editorComponents/CodeEditor/styledComponents.ts
index dce5b987ae..c239aa3cca 100644
--- a/app/client/src/components/editorComponents/CodeEditor/styledComponents.ts
+++ b/app/client/src/components/editorComponents/CodeEditor/styledComponents.ts
@@ -28,7 +28,7 @@ export const HintStyles = createGlobalStyle<{
max-height: 20em;
overflow-y: auto;
background: ${(props) =>
- props.theme.colors.codeMirror.background.defaultState};
+ props.editorTheme === EditorTheme.LIGHT ? "#FAFAFA" : "#262626"};
box-shadow: 0px 12px 28px -6px rgba(0, 0, 0, 0.32);
border-radius: 0px;
${(props) =>
@@ -37,7 +37,8 @@ export const HintStyles = createGlobalStyle<{
.CodeMirror-hint {
height: 24px;
- color: ${(props) => props.theme.colors.codeMirror.text};
+ color: ${(props) =>
+ props.editorTheme === EditorTheme.LIGHT ? "#090707" : "#FFFFFF"};
cursor: pointer;
display: flex;
width: 220px;
@@ -47,7 +48,7 @@ export const HintStyles = createGlobalStyle<{
letter-spacing: -0.24px;
&:hover {
background: ${(props) =>
- props.theme.colors.codeMirror.background.hoverState};
+ props.editorTheme === EditorTheme.LIGHT ? "#6A86CE" : "#157A96"};
border-radius: 0px;
color: #fff;
&:after {
@@ -69,7 +70,7 @@ export const HintStyles = createGlobalStyle<{
padding-left: ${(props) => props.theme.spaces[11]}px !important;
&:hover{
background: ${(props) =>
- props.theme.colors.codeMirror.background.hoverState};
+ props.editorTheme === EditorTheme.LIGHT ? "#6A86CE" : "#157A96"};
}
}
.CodeMirror-Tern-completion:before {
@@ -281,9 +282,7 @@ export const EditorWrapper = styled.div<{
? `border-bottom: 1px solid ${Colors.MERCURY}`
: `border: 1px solid ${Colors.MERCURY}`};
background: ${(props) =>
- props.isFocused || props.fill
- ? Colors.MERCURY
- : props.theme.colors.codeMirror.background.defaultState};
+ props.isFocused || props.fill ? Colors.MERCURY : "#FAFAFA"};
color: ${Colors.CHARCOAL};
& {
span.cm-operator {
@@ -303,9 +302,7 @@ export const EditorWrapper = styled.div<{
? `border-bottom: 1px solid ${Colors.NERO}`
: `border: 1px solid ${Colors.NERO}`};
background: ${(props) =>
- props.isFocused || props.fill
- ? Colors.NERO
- : props.theme.colors.codeMirror.background.defaultState};
+ props.isFocused || props.fill ? Colors.NERO : "#262626"};
color: ${Colors.LIGHT_GREY};
}
.cm-s-duotone-light .CodeMirror-linenumber,
diff --git a/app/client/src/components/propertyControls/DatePickerControl.tsx b/app/client/src/components/propertyControls/DatePickerControl.tsx
index 6796c3e736..259417ffa6 100644
--- a/app/client/src/components/propertyControls/DatePickerControl.tsx
+++ b/app/client/src/components/propertyControls/DatePickerControl.tsx
@@ -5,8 +5,6 @@ import moment from "moment-timezone";
import styled from "styled-components";
import { TimePrecision } from "@blueprintjs/datetime";
import { WidgetProps } from "widgets/BaseWidget";
-import { Toaster } from "components/ads/Toast";
-import { Variant } from "components/ads/common";
import { ISO_DATE_FORMAT } from "constants/WidgetValidation";
const DatePickerControlWrapper = styled.div<{ isValid: boolean }>`
@@ -63,18 +61,22 @@ class DatePickerControl extends BaseControl<
}
render() {
+ const version = this.props.widgetProperties.version;
const dateFormat =
- this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
+ version === 2
+ ? ISO_DATE_FORMAT
+ : this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
const isValid = this.state.selectedDate
? this.validateDate(moment(this.state.selectedDate, dateFormat).toDate())
: true;
- const maxDate =
- this.props.widgetProperties?.evaluatedValues?.maxDate ?? this.maxDate;
- const minDate =
- this.props.widgetProperties?.evaluatedValues?.minDate ?? this.minDate;
-
+ const value =
+ this.props.propertyValue && isValid
+ ? version === 2
+ ? new Date(this.props.propertyValue)
+ : this.parseDate(this.props.propertyValue)
+ : null;
return (
-
+
);
@@ -117,10 +105,13 @@ class DatePickerControl extends BaseControl<
*/
onDateSelected = (date: Date, isUserChange: boolean): void => {
if (isUserChange) {
- const selectedDate = date ? this.formatDate(date) : undefined;
+ const selectedDate = date
+ ? this.props.widgetProperties.version === 2
+ ? date.toISOString()
+ : this.formatDate(date)
+ : undefined;
const isValid = this.validateDate(date);
if (!isValid) return;
-
// if everything is ok, put date in state
this.setState({ selectedDate: selectedDate });
this.updateProperty(this.props.propertyName, selectedDate);
@@ -128,73 +119,14 @@ class DatePickerControl extends BaseControl<
};
/**
- * checks:
- * 1. if max date is greater than the default date
- * 2. if default date is in range of min and max date
+ * checks if date is of valid date format
*/
validateDate = (date: Date): boolean => {
const dateFormat =
- this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
- const parsedSelectedDate = moment(date, dateFormat);
- //validate defaultDate if both minDate and maxDate is already selected
- if (this.props.propertyName === "defaultDate") {
- if (
- parsedSelectedDate.isValid() &&
- this.props.widgetProperties?.evaluatedValues?.minDate &&
- this.props.widgetProperties?.evaluatedValues?.maxDate
- ) {
- const parsedMinDate = moment(
- this.props.widgetProperties.evaluatedValues.minDate,
- dateFormat,
- );
- const parsedMaxDate = moment(
- this.props.widgetProperties.evaluatedValues.maxDate,
- dateFormat,
- );
- if (
- parsedSelectedDate.isBefore(parsedMinDate) ||
- parsedSelectedDate.isAfter(parsedMaxDate)
- ) {
- return false;
- }
- }
- }
- if (this.props.widgetProperties?.evaluatedValues?.value) {
- const parsedWidgetDate = moment(
- this.props.widgetProperties.evaluatedValues.value,
- dateFormat,
- );
- // checking if widget date is after min date
- if (this.props.propertyName === "minDate") {
- if (
- parsedSelectedDate.isValid() &&
- parsedWidgetDate.isBefore(parsedSelectedDate)
- ) {
- Toaster.show({
- text: "Min date cannot be greater than current widget value.",
- variant: Variant.danger,
- });
-
- return false;
- }
- }
-
- // checking if widget date is before max date
- if (this.props.propertyName === "maxDate") {
- if (
- parsedSelectedDate.isValid() &&
- parsedWidgetDate.isAfter(parsedSelectedDate)
- ) {
- Toaster.show({
- text: "Max date cannot be less than current widget value.",
- variant: Variant.danger,
- });
-
- return false;
- }
- }
- }
- return true;
+ this.props.widgetProperties.version === 2
+ ? ISO_DATE_FORMAT
+ : this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
+ return date ? moment(date, dateFormat).isValid() : true;
};
formatDate = (date: Date): string => {
@@ -205,7 +137,9 @@ class DatePickerControl extends BaseControl<
parseDate = (dateStr: string): Date => {
const dateFormat =
- this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
+ this.props.widgetProperties.version === 2
+ ? ISO_DATE_FORMAT
+ : this.props.widgetProperties.dateFormat || ISO_DATE_FORMAT;
const date = moment(dateStr, dateFormat);
if (date.isValid()) return moment(dateStr, dateFormat).toDate();
diff --git a/app/client/src/constants/FieldExpectedValue.ts b/app/client/src/constants/FieldExpectedValue.ts
index 99580f40c3..eed49ad87e 100644
--- a/app/client/src/constants/FieldExpectedValue.ts
+++ b/app/client/src/constants/FieldExpectedValue.ts
@@ -24,6 +24,13 @@ const FIELD_VALUES: Record<
isDisabled: "boolean",
// onDateSelected: "Function Call",
},
+ DATE_PICKER_WIDGET2: {
+ defaultDate: "string", //TODO:Vicky validate this property
+ isRequired: "boolean",
+ isVisible: "boolean",
+ isDisabled: "boolean",
+ // onDateSelected: "Function Call",
+ },
TABLE_WIDGET: {
tableData: "Array