diff --git a/.github/workflows/ci-test-custom-script.yml b/.github/workflows/ci-test-custom-script.yml index ef8aea989ea..2062ecb29ce 100644 --- a/.github/workflows/ci-test-custom-script.yml +++ b/.github/workflows/ci-test-custom-script.yml @@ -197,6 +197,22 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: app/client/package.json + + - name: Check DB URL + if: steps.run_result.outputs.run_result != 'success' + run: | + db_url=$(grep -oP 'APPSMITH_DB_URL=\K[^ ]+' cicontainerlocal/stacks/configuration/docker.env || echo "") + if [[ -z "$db_url" ]]; then + echo "::error::APPSMITH_DB_URL not found in the environment file" + exit 1 + fi + if [[ $db_url == "postgresql"* ]]; then + echo "Database type: Postgres. Ensure PostgreSQL-specific configurations are in place." + elif [[ $db_url == "mongo"* ]]; then + echo "Database type: MongoDB. Verify MongoDB connection settings if issues arise." + else + echo "::warning::Unknown database type. Please verify the database configuration." + fi # actions/setup-node@v4 doesn’t work properly with Yarn 3 # when the project lives in a subdirectory: https://github.com/actions/setup-node/issues/488 diff --git a/.github/workflows/server-build.yml b/.github/workflows/server-build.yml index 0a74e1eb5a3..cf17da05bb5 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/server-build.yml @@ -72,6 +72,9 @@ jobs: - name: Figure out the PR number run: echo ${{ inputs.pr }} + + - name: Default database URL + run: echo "Is this a PG build? ${{ inputs.is-pg-build }}" - name: Print the Github event run: echo ${{ github.event_name }} diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index e3c21798e6a..bf55ec8a429 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -499,3 +499,32 @@ jobs: --header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \ --header 'Content-Type: application/json; charset=utf-8' \ --data-raw "$body" + + + notify-slack-for-pg: + needs: ci-test-result + runs-on: ubuntu-latest + + if: ( failure() && github.ref == 'refs/heads/pg' ) + + steps: + - name: Notify failure on workflow run and on Slack + run: | + set -o errexit + set -o nounset + set -o xtrace + + run_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}' + slack_message="🚨 TBP workflow failed in <$run_url|${{ vars.EDITION }} attempt ${{ github.run_attempt }} (run ${{ github.run_id }})>." + + # This is the ChannelId of the proj-postgres-sync channel. + body="$(jq -nc \ + --arg channel C07JMLWEXDJ \ + --arg text "$slack_message" \ + '$ARGS.named' + )" + curl -v https://slack.com/api/chat.postMessage \ + --fail-with-body \ + --header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \ + --header 'Content-Type: application/json; charset=utf-8' \ + --data-raw "$body" diff --git a/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts b/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts index 97f2d07f675..4b178cfd0c0 100644 --- a/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts +++ b/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts @@ -74,8 +74,10 @@ describe( it("2. Validate table navigation with Server Side pagination enabled with Default selected row", () => { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("pagination"); agHelper.AssertExistingToggleState("Server side pagination", "true"); + propPane.ExpandIfCollapsedSection("rowselection"); propPane .ValidatePropertyFieldValue("Default selected row", "0") .then(($selectedRow: any) => { @@ -114,6 +116,7 @@ describe( deployMode.NavigateBacktoEditor(); table.WaitUntilTableLoad(0, 0, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("pagination"); propPane.TogglePropertyState("Server side pagination", "Off"); deployMode.DeployApp(); table.WaitUntilTableLoad(0, 0, "v2"); @@ -122,10 +125,12 @@ describe( deployMode.NavigateBacktoEditor(); table.WaitUntilTableLoad(0, 0, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("pagination"); propPane.TogglePropertyState("Server side pagination", "On"); }); it("4. Change Default selected row in table and verify", () => { + propPane.ExpandIfCollapsedSection("rowselection"); propPane.UpdatePropertyFieldValue("Default selected row", "1"); deployMode.DeployApp(); table.WaitUntilTableLoad(0, 0, "v2"); @@ -140,6 +145,7 @@ describe( it("5. Verify Default search text in table as per 'Default search text' property set + Bug 12228", () => { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TypeTextIntoField("Default search text", "Bug"); deployMode.DeployApp(); table.AssertSearchText("Bug"); @@ -148,6 +154,7 @@ describe( deployMode.NavigateBacktoEditor(); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TypeTextIntoField("Default search text", "Quest", true, false); deployMode.DeployApp(); @@ -157,6 +164,7 @@ describe( table.WaitUntilTableLoad(0, 0, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TypeTextIntoField("Default search text", "Epic"); //Bug 12228 - Searching based on hidden column value should not be allowed deployMode.DeployApp(); table.AssertSearchText("Epic"); @@ -164,6 +172,7 @@ describe( deployMode.NavigateBacktoEditor(); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.RemoveText("defaultsearchtext"); agHelper.GetNClick(dataSources._refreshIcon, 0, true); table.WaitUntilTableLoad(0, 0, "v2"); @@ -171,6 +180,7 @@ describe( it("6. Validate Search table with Client Side Search enabled & disabled & onSearchTextChanged is set", () => { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.AssertExistingToggleState("Client side search", "true"); deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); @@ -188,6 +198,7 @@ describe( table.WaitUntilTableLoad(0, 1, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TogglePropertyState("Client side search", "Off"); deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); @@ -205,6 +216,7 @@ describe( deployMode.NavigateBacktoEditor(); table.WaitUntilTableLoad(0, 1, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TogglePropertyState("Client side search", "On"); propPane.EnterJSContext("onSearchTextChanged", ""); propPane.ToggleJSMode("onSearchTextChanged", false); @@ -224,6 +236,7 @@ describe( deployMode.NavigateBacktoEditor(); table.WaitUntilTableLoad(0, 1, "v2"); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("search\\&filters"); propPane.TogglePropertyState("Client side search", "Off"); deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts index 31f4b1c7feb..4271fef029d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts @@ -1,12 +1,7 @@ -import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; import { agHelper, locators, - entityExplorer, propPane, - draggableWidgets, - apiPage, - entityItems, homePage, assertHelper, } from "../../../../support/Objects/ObjectsCore"; @@ -15,12 +10,6 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; describe("Property Pane Suggestions", { tags: ["@tag.JS"] }, () => { - before(() => { - featureFlagIntercept({ - ab_learnability_ease_of_initial_use_enabled: true, - }); - }); - before(function () { agHelper.ClearLocalStorageCache(); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/InputWidget_TableV2_Sorting_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/InputWidget_TableV2_Sorting_spec.js index ba5b040609b..7fad7eb5d0f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/InputWidget_TableV2_Sorting_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/InputWidget_TableV2_Sorting_spec.js @@ -4,10 +4,7 @@ import EditorNavigation, { const publish = require("../../../../locators/publishWidgetspage.json"); const testdata = require("../../../../fixtures/testdata.json"); -import { - agHelper, - entityExplorer, -} from "../../../../support/Objects/ObjectsCore"; +import { agHelper, propPane } from "../../../../support/Objects/ObjectsCore"; describe( "Binding the Table and input Widget", @@ -32,7 +29,7 @@ describe( it("2. validation of data displayed in input widgets based on sorting", function () { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - + propPane.ExpandIfCollapsedSection("rowselection"); cy.testJsontext("defaultselectedrow", "0"); cy.get(".draggable-header").contains("id").click({ force: true }); cy.wait(1000); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js index d8d0a262ff3..490e40de6f9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js @@ -6,7 +6,6 @@ const commonlocators = require("../../../../locators/commonlocators.json"); const testdata = require("../../../../fixtures/testdata.json"); import apiPageLocators from "../../../../locators/ApiEditor"; import { - entityExplorer, apiPage, deployMode, propPane, @@ -91,6 +90,7 @@ describe( it("3. Table-Text, Validate Server Side Pagination of Paginate with Total v2 Records Count", function () { deployMode.NavigateBacktoEditor(); EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("pagination"); propPane.UpdatePropertyFieldValue("Total Records", "20"); deployMode.DeployApp(); cy.wait("@postExecute"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2Widget_selectedRow_Input_widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2Widget_selectedRow_Input_widget_spec.js index 5bec54443d4..6ba248fe1a6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2Widget_selectedRow_Input_widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2Widget_selectedRow_Input_widget_spec.js @@ -30,6 +30,7 @@ describe( it("2. validation of data displayed in input widgets based on selected row", function () { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + _.propPane.ExpandIfCollapsedSection("rowselection"); cy.testJsontext("defaultselectedrow", "2"); cy.readTableV2dataPublish("2", "0").then((tabData) => { const tabValue = tabData; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_ClientSide_Search_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_ClientSide_Search_spec.js index e3b110fbc9d..32232385039 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_ClientSide_Search_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_ClientSide_Search_spec.js @@ -20,6 +20,7 @@ describe( cy.readTableV2dataPublish("0", "0").then((tabData) => { expect(tabData).to.eq("#2"); }); + _.propPane.ExpandIfCollapsedSection("search\\&filters"); // Input onsearchtextchanged control cy.get(".t--property-control-onsearchtextchanged .t--js-toggle") .first() diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_DefaultSearch_Input_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_DefaultSearch_Input_spec.js index 457593fec0f..c21342e793f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_DefaultSearch_Input_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_DefaultSearch_Input_spec.js @@ -27,6 +27,7 @@ describe( ); // validation of data displayed in input widgets based on search value set EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + _.propPane.ExpandIfCollapsedSection("search\\&filters"); cy.get(".t--property-control-allowsearching input").click({ force: true, }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js index 03a7d1e93af..ef31811f782 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js @@ -30,6 +30,7 @@ describe( //Validate Table V2 with API data and then add a column EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); propPane.UpdatePropertyFieldValue("Table data", "{{Api1.data}}"); + propPane.ExpandIfCollapsedSection("pagination"); cy.CheckWidgetProperties(commonlocators.serverSidePaginationCheckbox); cy.get(`.t--widget-tablewidgetv2 .page-item`) .first() diff --git a/app/client/cypress/e2e/Regression/ClientSide/Binding/TextTableV2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Binding/TextTableV2_spec.js index e30b11a0315..b42f2840c89 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Binding/TextTableV2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Binding/TextTableV2_spec.js @@ -5,7 +5,6 @@ import EditorNavigation, { const commonlocators = require("../../../../locators/commonlocators.json"); const publish = require("../../../../locators/publishWidgetspage.json"); import { - entityExplorer, agHelper, deployMode, propPane, @@ -113,6 +112,7 @@ describe( EditorNavigation.SelectEntityByName("Table1", EntityType.Widget, {}, [ "Container3", ]); + propPane.ExpandIfCollapsedSection("rowselection"); cy.testJsontext("defaultselectedrow", "2"); cy.wait("@updateLayout"); cy.get(commonlocators.TableV2Row) diff --git a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/JsonForm_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/JsonForm_spec.ts index 6ecade61342..c20df368d0e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/JsonForm_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/DynamicHeight/JsonForm_spec.ts @@ -1,5 +1,4 @@ import { - entityExplorer, locators, agHelper, propPane, @@ -17,6 +16,7 @@ describe( agHelper.AddDsl("jsonFormDynamicHeightDsl"); EditorNavigation.SelectEntityByName("JSONForm1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("general"); agHelper .GetWidgetCSSHeight( locators._widgetInDeployed(draggableWidgets.JSONFORM), diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts index 85eb6edf6ec..0c101ae1460 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts @@ -4,24 +4,18 @@ import { dataSources, deployMode, draggableWidgets, - entityExplorer, gitSync, homePage, - jsEditor, locators, - propPane, table, } from "../../../../../../support/Objects/ObjectsCore"; -import EditorNavigation, { - EntityType, - PageLeftPane, -} from "../../../../../../support/Pages/EditorNavigation"; +import PageList from "../../../../../../support/Pages/PageList"; describe( "Import and validate older app (app created in older versions of Appsmith) from Gitea", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { tags: ["@tag.Git", "@tag.Sanity", "@tag.TedMigration"] }, function () { - let appRepoName = "TestMigration", + let appRepoName = "TED-migration-test-1", appName = "UpgradeAppToLatestVersion", keyId: any, workspaceName: any; @@ -41,68 +35,21 @@ describe( dataSources.ReconnectDSbyType("MongoDB"); dataSources.ReconnectDSbyType("MySQL"); dataSources.ReconnectDSbyType("PostgreSQL"); - agHelper.Sleep(3000); //for CI to reconnect successfully homePage.AssertNCloseImport(); - }); - - it("1. Validate merge status + Bug23822", () => { - PageLeftPane.assertPresence("ListingAndReviews"); - //Wait for the app to settle - agHelper.Sleep(3000); homePage.RenameApplication(appName); + PageList.assertPresence("ListingAndReviews"); + + // this logic will have to be removed after decimal issue with auto-commit is resolved assertHelper.AssertNetworkResponseData("gitStatus"); agHelper.AssertElementExist(gitSync._bottomBarCommit, 0, 30000); - agHelper.AssertText(gitSync._gitPullCount, "text", "4"); agHelper.GetNClick(gitSync._bottomBarCommit); agHelper.AssertElementVisibility(gitSync._gitSyncModal); - - //This is expected due to Canvas Splitting PR changes in v1.9.24 - agHelper.GetNAssertContains( - gitSync._gitStatusChanges, - /[0-9] page(|s) modified/, - ); - - // Commenting it as part of #28012 - to be added back later - // agHelper.GetNAssertElementText( - // gitSync._gitStatusChanges, - // "Application settings modified", - // "not.contain.text", - // ); - agHelper.GetNAssertElementText( - gitSync._gitStatusChanges, - "Theme modified", - "not.contain.text", - ); - agHelper.AssertContains(/[0-9] quer(y|ies) modified/, "not.exist"); - - // Commented out due to #25739 - to be fixed by dev later - // agHelper.GetNAssertElementText( - // gitSync._gitStatusChanges, - // "datasource modified", - // "not.contain.text", - // ); - - agHelper.AssertContains(/[0-9] JS Object(|s) modified/, "not.exist"); - - // Commenting it as part of #28012 - to be added back later - // agHelper.AssertContains(/[0-9] librar(y|ies) modified/, "not.exist"); - - // This assertions is commented out due to issue #https://github.com/appsmithorg/appsmith/issues/28563 - // Since we don't want this specific message appearing when we are just migrating the metadata, - // this assertion is not required. - // Slack conversation: https://theappsmith.slack.com/archives/C04HERDNZPA/p1698851532418569 - - // agHelper.GetNAssertElementText( - // gitSync._gitStatusChanges, - // "Some of the changes above are due to an improved file structure designed to reduce merge conflicts. You can safely commit them to your repository.", - // "contain.text", - // ); agHelper.GetNClick(gitSync._commitButton); assertHelper.AssertNetworkStatus("@commit", 201); gitSync.CloseGitSyncModal(); }); - it("2. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => { + it("1. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => { //Mongo CRUD page validation //Assert table data cy.latestDeployPreview(); @@ -112,7 +59,7 @@ describe( "listingAndReviews Data", ); agHelper.AssertElementVisibility(locators._widgetByName("data_table")); - table.WaitUntilTableLoad(0, 0, "v2"); + table.WaitUntilTableLoad(0, 0); //Filter & validate table data table.OpenNFilterTable("_id", "is exactly", "15665837"); @@ -131,7 +78,7 @@ describe( "countryFlags Data", ); agHelper.AssertElementVisibility(locators._widgetByName("data_table")); - table.WaitUntilTableLoad(0, 0, "v2"); + table.WaitUntilTableLoad(0, 0); //Filter & validate table data table.OpenNFilterTable("Country", "starts with", "Ba"); @@ -152,7 +99,7 @@ describe( "public_astronauts Data", ); agHelper.AssertElementVisibility(locators._widgetByName("data_table")); - table.WaitUntilTableLoad(0, 0, "v2"); + table.WaitUntilTableLoad(0, 0); //Filter & validate table data table.OpenNFilterTable("id", "is exactly", "196"); @@ -164,10 +111,8 @@ describe( //Update table data deployMode.EnterJSONInputValue("Statusid", "5", 0, true); deployMode.EnterJSONInputValue("Statusname", "Active", 0, true); - agHelper.Sleep(500); agHelper.ClickButton("Update"); - agHelper.Sleep(2000); //for CI update to be successful - table.WaitUntilTableLoad(0, 0, "v1"); + table.WaitUntilTableLoad(0, 0); //Validate updated values in table table.ReadTableRowColumnData(0, 3).then(($cellData) => { @@ -176,10 +121,9 @@ describe( table.ReadTableRowColumnData(0, 4).then(($cellData) => { expect($cellData).to.eq("Active"); }); - agHelper.Sleep(500); }); - it("3. Validate widgets & bindings", () => { + it("2. Validate widgets & bindings", () => { agHelper.GetNClickByContains(locators._deployedPage, "Widgets"); agHelper.AssertElementVisibility( locators._widgetInDeployed(draggableWidgets.AUDIO), @@ -194,22 +138,35 @@ describe( locators._widgetInDeployed(draggableWidgets.CHART), ); - //Button - agHelper.ClickButton("Alert button"); - agHelper.Sleep(500); - agHelper.WaitUntilToastDisappear( - "404 hit : invalidApi failed to execute", - ); - //Checkbox group agHelper.AssertElementVisibility( locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), ); - agHelper.GetNAssertElementText( + agHelper.GetNAssertContains( locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), - "Select AstronautUlf MerboldAndreas MogensenWubbo OckelsThomas ReiterAnil Menon", - "have.text", + "Select Astronaut", ); + agHelper.GetNAssertContains( + locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), + "Ulf Merbold", + ); + agHelper.GetNAssertContains( + locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), + "Andreas Mogensen", + ); + agHelper.GetNAssertContains( + locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), + "Wubbo Ockels", + ); + agHelper.GetNAssertContains( + locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), + "Thomas Reiter", + ); + agHelper.GetNAssertContains( + locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP), + "Anil Menon", + ); + agHelper .GetElement(locators._checkboxTypeByOption("Ulf Merbold")) .should("be.checked"); @@ -219,10 +176,8 @@ describe( agHelper .ScrollIntoView(locators._sliderThumb) .focus() - .type("{rightArrow}") - .wait(500); + .type("{rightArrow}"); - agHelper.Sleep(500); agHelper.WaitUntilToastDisappear("Category Value Changed!"); //Currency input @@ -261,51 +216,6 @@ describe( agHelper.WaitUntilToastDisappear("Delete customer successful!"); agHelper.ClickButton("Close"); agHelper.AssertElementAbsence(locators._modal); - agHelper.Sleep(2000); - }); - - it.skip("4. Edit JSObject & Check Updated Data ", () => { - deployMode.NavigateBacktoEditor(); - //Edit existing JS object - EditorNavigation.SelectEntityByName("users", EntityType.JSObject); - jsEditor.EditJSObj(`export default { - fun: async () => { - return await invalidApi.run().catch((e) => showAlert("404 hit : " + e.message)); - }, - myFun1: async () => { - //write code here - const data = JSON.stringify(await usersApi.run()) - return data - }, - myFun2: async () => { - //use async-await or promises - await this.myFun1() - return showAlert("myFun2 Data") - } - }`); - - //Update property field for button - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", `{{users.myFun2()}}`, true, false); - - //Drag n drop text widget & bind it to myFun1 - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT); - propPane.TypeTextIntoField("Text", `{{users.myFun1.data}}`); - agHelper.ValidateToastMessage( - "[users.myFun1] will be executed automatically on page load", - ); - - //Commit & push new changes - gitSync.CommitAndPush(); - cy.latestDeployPreview(); - - //Validate new response for button & text widget - agHelper.GetNClickByContains(locators._deployedPage, "Widgets"); - agHelper.ClickButton("Submit"); - agHelper.ValidateToastMessage("myFun2 Data"); - agHelper - .GetText(locators._widgetInDeployed(draggableWidgets.TEXT), "text") - .should("not.be.empty"); }); after(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSEnabledByDefaultExperiment_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSEnabledByDefaultExperiment_spec.ts index b1da841ffe3..45a89965b27 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSEnabledByDefaultExperiment_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/JSEnabledByDefaultExperiment_spec.ts @@ -1,5 +1,4 @@ import OneClickBindingLocator from "../../../../locators/OneClickBindingLocator"; -import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; import { agHelper, apiPage, @@ -23,10 +22,6 @@ describe( () => { let datasourceName: string; before(() => { - featureFlagIntercept({ - rollout_js_enabled_one_click_binding_enabled: true, - }); - dataSources.CreateDataSource("Postgres"); cy.get("@dsName").then((dsName) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js b/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js index fef8d63271a..2b1f045cc5b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js @@ -112,7 +112,7 @@ function testPreloadMetadata(viewOrEditMode) { (link) => (window.CDN_URL ?? "/") + link, ); - const requestsToCompare = unique( + const allRequestsDuringPageLoad = unique( jsRequests.filter( (link) => // Exclude link bundle requests. We don’t really care about being precise @@ -120,7 +120,7 @@ function testPreloadMetadata(viewOrEditMode) { !link.includes("-icons."), ), ); - const linksToCompare = unique( + const preloadLinks = unique( links.filter( (link) => // Exclude link bundle preloads. We don’t really care about being precise @@ -132,16 +132,11 @@ function testPreloadMetadata(viewOrEditMode) { ), ); - const actuallyLoadedFiles = `[${ - requestsToCompare.length - } items] ${requestsToCompare.sort().join(", ")}`; - const preloadedFiles = `[${linksToCompare.length} items] ${linksToCompare - .sort() - .join(", ")}`; - - // Comparing strings instead of deep-equalling arrays because this is the only way - // to see which chunks are actually missing: https://github.com/cypress-io/cypress/issues/4084 - cy.wrap(actuallyLoadedFiles).should("equal", preloadedFiles); + // check if req + const isSubset = preloadLinks.every((item) => + allRequestsDuringPageLoad.includes(item), + ); + expect(isSubset).to.be.true; }); } diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts index 490bc3c766c..510db43eef9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts @@ -15,13 +15,11 @@ import EditorNavigation, { } from "../../../../../support/Pages/EditorNavigation"; const ppt = - "https://ssz.sgp1.digitaloceanspaces.com/3ZEO2582C29EA0KKK2/ppt-on-population-pptxafa26c44-208f-46a3-89cc-8a5c020b6863.pptx"; -const pngImage = - "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8umIiCU_K6ac-xS-ni4y6SP7XAd8C7Ms3Q&usqp=CAU"; + "http://host.docker.internal:4200/ppt-on-population-pptxafa26c44-208f-46a3-89cc-8a5c020b6863.pptx"; +const pngImage = "https://www.appsmith.com/favicon.png"; const jpgImage = "https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg?itok=yG4bpfFs"; -const pdf = - "https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf"; +const pdf = "http://host.docker.internal:4200/sample-pdf-file.pdf"; describe( "DocumentViewer Widget Functionality", @@ -212,10 +210,7 @@ describe( agHelper.AssertElementExist( locators._widgetInDeployed("documentviewerwidget"), ); - agHelper.AssertContains( - "Current file type is not supported", - "not.exist", - ); + agHelper.AssertContains("Current file type is not supported"); deployMode.NavigateBacktoEditor(); //Should not show an jpg image file" EditorNavigation.SelectEntityByName("DocumentViewer1", EntityType.Widget); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts index 86cad0ac362..e15a1a5095f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts @@ -18,9 +18,9 @@ describe( { tags: ["@tag.Widget", "@tag.Modal"] }, function () { const image = (src: string) => 'img[src="' + src + '"]'; - const jpgImg = "https://jpeg.org/images/jpegsystems-home.jpg"; - const gifImg = - "https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/5eeea355389655.59822ff824b72.gif"; + const jpgImg = + "https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg"; + const gifImg = "https://docs.appsmith.com/img/multi-update-sql.gif"; it("1. Modal widget functionality", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts index 89f9b2db414..76fe42474d3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts @@ -30,33 +30,31 @@ describe( _.deployMode.DeployApp(); //_.table.SelectTableRow(1) - _.table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("1376499.jpg"); + expect($cellData).contains("cube-logo_S50__hLNq.jpeg"); }); _.table.ReadTableRowColumnData(1, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg", + ); }); _.table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("2117775.jpg"); + expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg"); }); _.table.ReadTableRowColumnData(3, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg", + ); }); _.table.AssertURLColumnNavigation( 0, 0, - "https://wallpaperaccess.com/full/1376499.jpg", + "https://docs.appsmith.com/img/cube-logo_S50__hLNq.jpeg", ); - // _.table.AssertURLColumnNavigation( - // 3, - // 0, - // "https://wallpaperaccess.com/full/812632.jpg", - // ); _.deployMode.NavigateBacktoEditor(); }); @@ -73,31 +71,30 @@ describe( _.deployMode.DeployApp(); _.table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("1376499.jpg"); + expect($cellData).contains("cube-logo_S50__hLNq.jpeg"); }); _.table.ReadTableRowColumnData(1, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg", + ); }); _.table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("2117775.jpg"); + expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg"); }); _.table.ReadTableRowColumnData(3, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg", + ); }); _.table.AssertURLColumnNavigation( 1, 0, - "https://wallpaperaccess.com/full/1688623.jpg", + "https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg", ); - // _.table.AssertURLColumnNavigation( - // 2, - // 0, - // "https://wallpaperaccess.com/full/2117775.jpg", - // ); _.deployMode.NavigateBacktoEditor(); }); @@ -114,31 +111,30 @@ describe( _.deployMode.DeployApp(); _.table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("1376499.jpg"); + expect($cellData).contains("cube-logo_S50__hLNq.jpeg"); }); _.table.ReadTableRowColumnData(1, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg", + ); }); _.table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("2117775.jpg"); + expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg"); }); _.table.ReadTableRowColumnData(3, 0).then(($cellData) => { - expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg"); + expect($cellData).to.eq( + "https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg", + ); }); _.table.AssertURLColumnNavigation( 0, 0, - "https://wallpaperaccess.com/full/1376499.jpg", + "https://docs.appsmith.com/img/cube-logo_S50__hLNq.jpeg", ); - // _.table.AssertURLColumnNavigation( - // 3, - // 0, - // "https://wallpaperaccess.com/full/812632.jpg", - // ); _.deployMode.NavigateBacktoEditor(); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js index d3e05b789db..6d641951891 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js @@ -3,6 +3,9 @@ import { propPane, table, } from "../../../../../support/Objects/ObjectsCore"; +import EditorNavigation, { + EntityType, +} from "../../../../../support/Pages/EditorNavigation"; const commonlocators = require("../../../../../locators/commonlocators.json"); describe( @@ -16,6 +19,7 @@ describe( it("1.1. should test that allow Add new row property is present", () => { cy.openPropertyPane("tablewidgetv2"); + propPane.ExpandIfCollapsedSection("addingarow"); cy.get(".t--property-control-allowaddingarow").should("exist"); cy.get(".t--property-control-allowaddingarow input").should("exist"); cy.get(".t--add-new-row").should("not.exist"); @@ -150,7 +154,12 @@ describe( it("1.7. should not hide the header section when add new row button is enabled and another header element is disabled", () => { cy.get(".t--discard-new-row").click({ force: true }); + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); //disable all header widgets for the table + propPane.ExpandIfCollapsedSection("general"); + propPane.ExpandIfCollapsedSection("addingarow"); + propPane.ExpandIfCollapsedSection("search\\&filters"); + propPane.ExpandIfCollapsedSection("pagination"); [ "Show pagination", "Allow searching", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_types_validation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_types_validation_spec.ts new file mode 100644 index 00000000000..0ce8bc321a3 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_types_validation_spec.ts @@ -0,0 +1,149 @@ +import { tableDateColumnTypes } from "../../../../../fixtures/tableDateColumnTypes"; +import { + agHelper, + entityExplorer, + propPane, + table, +} from "../../../../../support/Objects/ObjectsCore"; + +import EditorNavigation, { + EntityType, +} from "../../../../../support/Pages/EditorNavigation"; + +describe( + "Table widget date column type validation", + { tags: ["@tag.Widget", "@tag.Table"] }, + () => { + before(() => { + entityExplorer.DragNDropWidget("tablewidgetv2", 350, 500); + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ToggleJSMode("Table data", true); + propPane.UpdatePropertyFieldValue("Table data", tableDateColumnTypes); + table.EditColumn("unixs", "v2"); + }); + + beforeEach(() => { + propPane.NavigateBackToPropertyPane(false); + }); + + const setEditableDateFormats = (format: string) => { + // Update date format property + propPane.ToggleJSMode("Date format", true); + propPane.UpdatePropertyFieldValue("Date format", format); + + // Update display format property + propPane.ToggleJSMode("Display format", true); + propPane.UpdatePropertyFieldValue("Display format", "YYYY-MM-DD"); + + // Toggle editable + propPane.TogglePropertyState("Editable", "On"); + }; + + const clickAndValidateDateCell = (row: number, column: number) => { + // Click unix cell edit + table.ClickOnEditIcon(row, column); + + // Click on specific date within + agHelper.GetNClick( + `${table._dateInputPopover} [aria-label='${table.getFormattedTomorrowDates().verboseFormat}']`, + ); + + // Check that date is set in column + table + .ReadTableRowColumnData(row, column, "v2") + .then((val) => + expect(val).to.equal(table.getFormattedTomorrowDates().isoFormat), + ); + }; + + it("1. should allow inline editing of Unix Timestamp in seconds (unix/s)", () => { + table.ChangeColumnType("unixs", "Date"); + setEditableDateFormats("Epoch"); + clickAndValidateDateCell(0, 0); + }); + + it("2. should allow inline editing of Unix Timestamp in milliseconds (unix/ms)", () => { + table.ChangeColumnType("unixms", "Date"); + setEditableDateFormats("Milliseconds"); + clickAndValidateDateCell(0, 1); + }); + + it("3. should allow inline editing of date in YYYY-MM-DD format", () => { + table.EditColumn("yyyymmdd", "v2"); + setEditableDateFormats("YYYY-MM-DD"); + clickAndValidateDateCell(0, 2); + }); + + it("4. should allow inline editing of date in YYYY-MM-DD HH:mm format", () => { + table.EditColumn("yyyymmddhhmm", "v2"); + setEditableDateFormats("YYYY-MM-DD HH:mm"); + clickAndValidateDateCell(0, 3); + }); + + it("5. should allow inline editing of date in ISO 8601 format (YYYY-MM-DDTHH:mm:ss)", () => { + table.EditColumn("iso8601", "v2"); + setEditableDateFormats("YYYY-MM-DDTHH:mm:ss"); + clickAndValidateDateCell(0, 4); + }); + + it("6. should allow inline editing of date in YYYY-MM-DD HH:mm format", () => { + table.EditColumn("yyyymmddTHHmmss", "v2"); + setEditableDateFormats("YYYY-MM-DD HH:mm"); + clickAndValidateDateCell(0, 5); + }); + + it("7. should allow inline editing of date in 'do MMM yyyy' format", () => { + table.ChangeColumnType("yyyymmddhhmmss", "Date"); + setEditableDateFormats("YYYY-MM-DDTHH:mm:ss"); + clickAndValidateDateCell(0, 6); + }); + + it("8. should allow inline editing of date in DD/MM/YYYY format", () => { + table.ChangeColumnType("doMMMyyyy", "Date"); + setEditableDateFormats("Do MMM YYYY"); + clickAndValidateDateCell(0, 7); + }); + + it("9. should allow inline editing of date in DD/MM/YYYY HH:mm format", () => { + table.EditColumn("ddmmyyyy", "v2"); + setEditableDateFormats("DD/MM/YYYY"); + clickAndValidateDateCell(0, 8); + }); + + it("10. should allow inline editing of date in LLL (Month Day, Year Time) format", () => { + table.EditColumn("ddmmyyyyhhmm", "v2"); + setEditableDateFormats("DD/MM/YYYY HH:mm"); + clickAndValidateDateCell(0, 9); + }); + + it("11. should allow inline editing of date in LL (Month Day, Year) format", () => { + table.EditColumn("lll", "v2"); + setEditableDateFormats("LLL"); + clickAndValidateDateCell(0, 10); + }); + + it("12. should allow inline editing of date in 'D MMMM, YYYY' format", () => { + table.EditColumn("ll", "v2"); + setEditableDateFormats("LL"); + clickAndValidateDateCell(0, 11); + }); + + it("13. should allow inline editing of date in 'h:mm A D MMMM, YYYY' format", () => { + table.EditColumn("dmmmmyyyy", "v2"); + setEditableDateFormats("D MMMM, YYYY"); + clickAndValidateDateCell(0, 12); + }); + + it("14. should allow inline editing of date in MM-DD-YYYY format", () => { + table.EditColumn("hmmAdmmmmyyyy", "v2"); + setEditableDateFormats("H:mm A D MMMM, YYYY"); + clickAndValidateDateCell(0, 13); + }); + + it("15. should allow inline editing of date in DD-MM-YYYY format", () => { + table.EditColumn("mm1dd1yyyy", "v2"); + setEditableDateFormats("MM-DD-YYYY"); + clickAndValidateDateCell(0, 14); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js index 7a5d288e3b4..5431495adc5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js @@ -6,7 +6,6 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); const commonlocators = require("../../../../../locators/commonlocators.json"); import { agHelper, - entityExplorer, propPane, table, } from "../../../../../support/Objects/ObjectsCore"; @@ -26,6 +25,7 @@ describe( it("1. Check if the selectedRowIndices does not contain 2d array", function () { EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ExpandIfCollapsedSection("rowselection"); propPane.TogglePropertyState("Enable multi-row selection", "On"); //Enable Multi row select propPane.UpdatePropertyFieldValue("Default selected rows", "[1]"); //Change the value of default selected row diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index 40da3f138e3..5a27f59e1e0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -4,6 +4,7 @@ import { agHelper, table as tableHelper, propPane, + locators, } from "../../../../../support/Objects/ObjectsCore"; import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators"; @@ -148,10 +149,16 @@ describe( cy.editTableCell(0, 0); cy.enterTableCellValue(0, 0, "newValue"); cy.saveTableCellValue(0, 0); - cy.get(".t--widget-textwidget .bp3-ui-text").should( - "contain", - `[ { "index": 0, "updatedFields": { "step": "newValue" }, "allFields": { "step": "newValue", "task": "Drop a table", "status": "✅" } }]`, - ); + const exected = [ + { + index: 0, + updatedFields: { step: "newValue" }, + allFields: { step: "newValue", task: "Drop a table", status: "✅" }, + }, + ]; + agHelper + .GetText(locators._textWidget, "text") + .should((text) => expect(JSON.parse(text)).to.deep.equal(exected)); cy.openPropertyPane("textwidget"); cy.updateCodeInput( ".t--property-control-text", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts index 142401c067c..72c7b293966 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts @@ -22,6 +22,7 @@ describe( entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); //propPane.EnterJSContext("Table data", JSON.stringify(this.dataSet.TableInput)); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); table.AddSampleTableData(); //propPane.EnterJSContext("Table Data", JSON.stringify(this.dataSet.TableInput)); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts index c9a9ea98b72..91360c4cd24 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts @@ -16,6 +16,7 @@ describe( it("1. Verify Table Filter for 'empty'", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); table.AddSampleTableData(); propPane.UpdatePropertyFieldValue( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts index 1c733733fd7..552bdc4b1e5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts @@ -17,6 +17,7 @@ describe( entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); //propPane.EnterJSContext("Table data", JSON.stringify(this.dataSet.TableInput)); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); table.AddSampleTableData(); //propPane.EnterJSContext("Table Data", JSON.stringify(this.dataSet.TableInput)); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts index c431157de63..76bef07b7b0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts @@ -17,6 +17,7 @@ describe( it("1. Verify Full table data - download csv and download Excel", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); table.AddSampleTableData(); propPane.UpdatePropertyFieldValue( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts index 4bd11a80cd2..a62b58935c7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts @@ -28,6 +28,7 @@ describe( before(() => { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); propPane.EnterJSContext("Table data", JSON.stringify(data)); assertHelper.AssertNetworkStatus("@updateLayout"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js index a0ae9da141d..bf59c5bb5ba 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js @@ -12,6 +12,7 @@ describe( it("1. Test multi select column shows when enable Multirowselection is true", function () { cy.openPropertyPane("tablewidgetv2"); + _.propPane.ExpandIfCollapsedSection("rowselection"); cy.get(widgetsPage.toggleEnableMultirowselection) .first() .click({ force: true }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js index 0c73fae21be..13694c0c9e4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js @@ -62,6 +62,7 @@ describe( cy.moveToContentTab(); // Chage deat search text value to "data" cy.backFromPropertyPanel(); + propPane.ExpandIfCollapsedSection("search\\&filters"); cy.testJsontext("defaultsearchtext", "data"); deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); table.WaitForTableEmpty("v2"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js index 3e58e093fa5..afe576f7b45 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js @@ -53,6 +53,8 @@ describe( cy.get(commonlocators.editPropBackButton).click(); cy.openPropertyPane("tablewidgetv2"); // Confirm if isSortable is true + _.propPane.ExpandIfCollapsedSection("sorting"); + cy.get(commonlocators.isSortable).should("be.checked"); // Publish App _.deployMode.DeployApp(); @@ -124,6 +126,7 @@ describe( "Table data", `{{[{step: 1, task: 1}]}}`, ); + _.propPane.ExpandIfCollapsedSection("search\\&filters"); cy.get(".t--property-control-allowfiltering input").click(); cy.editColumn("step"); cy.get(".t--table-filter-toggle-btn").click(); @@ -237,6 +240,7 @@ describe( it("7. should check that adding cyclic dependency in the table doesn't crash the app", () => { //_.deployMode.NavigateBacktoEditor(); cy.openPropertyPane("tablewidgetv2"); + _.propPane.ExpandIfCollapsedSection("rowselection"); cy.updateCodeInput( ".t--property-control-defaultselectedrow", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js index 252617d0ab5..1a1b9e6aa83 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js @@ -35,6 +35,7 @@ describe( before(() => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TABLE); // turn on filtering for the table - it is disabled by default in this PR(#34593) + _.propPane.ExpandIfCollapsedSection("search\\&filters"); _.agHelper.GetNClick(".t--property-control-allowfiltering input"); _.propPane.EnterJSContext("Table data", tableData); cy.editColumn("completed"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js index 56a0f6cf12e..bec3425f26c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js @@ -41,6 +41,7 @@ describe( before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); propPane.EnterJSContext("Table data", tableData); cy.editColumn("completed"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts index 674f56e06e3..1d4f6fad616 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts @@ -35,6 +35,7 @@ describe( entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 300, 300); // turn on filtering for the table - it is disabled by default in this PR(#34593) + propPane.ExpandIfCollapsedSection("search\\&filters"); agHelper.GetNClick(".t--property-control-allowfiltering input"); // Create SQL data-source diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts index 4433da97b72..427fa103ece 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts @@ -62,7 +62,7 @@ const TABLE_DATA_2 = `[ "name": "Barty Crouch", "status": "APPROVED", "gender": "", - "avatar": "https://robohash.org/sednecessitatibuset.png?size=100x100&set=set1", + "avatar": "http://host.docker.internal:4200/clouddefaultImage.png", "email": "barty.crouch@gmail.com", "address": "St Petersberg #911 4th main", "createdAt": "2020-03-16T18:00:05.000Z", @@ -73,7 +73,7 @@ const TABLE_DATA_2 = `[ "name": "Jenelle Kibbys", "status": "APPROVED", "gender": "Female", - "avatar": "https://robohash.org/quiaasperiorespariatur.bmp?size=100x100&set=set1", + "avatar": "http://host.docker.internal:4200/453-200x300.jpg", "email": "jkibby1@hp.com", "address": "85 Tennessee Plaza", "createdAt": "2019-10-04T03:22:23.000Z", @@ -84,7 +84,7 @@ const TABLE_DATA_2 = `[ "name": "Demetre", "status": "APPROVED", "gender": "Male", - "avatar": "https://robohash.org/iustooptiocum.jpg?size=100x100&set=set1", + "avatar": "http://host.docker.internal:4200/clouddefaultImage.png", "email": "aaaa@bbb.com", "address": "262 Saint Paul Park", "createdAt": "2020-05-01T17:30:50.000Z", @@ -95,7 +95,7 @@ const TABLE_DATA_2 = `[ "name": "Tobin Shellibeer", "status": "APPROVED", "gender": "Male", - "avatar": "https://robohash.org/odioeumdolores.png?size=100x100&set=set1", + "avatar": "http://host.docker.internal:4200/453-200x300.jpg", "email": "tshellibeer9@ihg.com", "address": "4 Ridgeway Lane", "createdAt": "2019-11-27T06:09:41.000Z", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts index 2814f31c2ac..67d20b2511d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts @@ -170,7 +170,9 @@ describe( }); it("5. Verify Api binding", () => { - apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users"); + apiPage.CreateAndFillApi( + "http://host.docker.internal:5001/v1/dynamicrecords/getrecordsArray", + ); apiPage.RunAPI(); EditorNavigation.SelectEntityByName( "TreeSelect1", @@ -181,7 +183,7 @@ describe( propPane.MoveToTab("Content"); propPane.UpdatePropertyFieldValue( "Options", - `{{Api1.data.users.map((s)=>{return{"label":s.name,"value":s.name}})}}`, + `{{JSON.parse(Api1.data).map((item) => {return {"label":item.value, "value":item.abbr};})}}`, ); agHelper.GetNClick( `${locators._widgetInDeployed("singleselecttreewidget")}`, @@ -308,7 +310,7 @@ describe( propPane.ToggleJSMode("onOptionChange", true); propPane.UpdatePropertyFieldValue( "onOptionChange", - `{{download('http://host.docker.internal:4200/kiwi.svg', 'kiwi.svg', 'image/svg+xml').then(() => { + `{{download('http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg', 'flower.svg', 'image/svg+xml').then(() => { showAlert('Download Success', ''); });}}`, ); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts index 54ea1884ee1..9510055ae67 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts @@ -113,6 +113,7 @@ describe( agHelper.AssertElementExist(homePage._appEditIcon); agHelper.GetNClick(homePage._appEditIcon, 0, true); agHelper.AssertElementAbsence(locators._loading); + assertHelper.AssertNetworkStatus("@getConsolidatedData", 200, true); agHelper.GetNClick(inviteModal.locators._shareButton, 0, true); agHelper.GetNClick(homePage._sharePublicToggle, 0, true); agHelper.GetNClick(locators._dialogCloseButton, 0, true); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts index ecd353533fa..3acaf340054 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts @@ -4,7 +4,8 @@ describe( "Ensure XSS vulnerability are handled", { tags: ["@tag.Datasource"] }, () => { - const test_rest_api_url1 = "https://jsonplaceholder.typicode.com/users"; + const test_rest_api_url1 = + "http://host.docker.internal:5001/v1/mock-api?records=20"; it("1. Ensures xss scripts are not executed when an API is run.", () => { apiPage.CreateApi("FirstAPI"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts index b59b5fb9dd2..feff456776c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts @@ -1,5 +1,7 @@ import { agHelper, + apiPage, + dataManager, entityExplorer, jsEditor, propPane, @@ -76,18 +78,25 @@ describe("Tests fetch calls", { tags: ["@tag.JS"] }, () => { }); it("3. Tests if fetch works with store value", function () { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockGenderAge + + `{{this.params.person}}`, + "Gender_Age", + ); + apiPage.RunAPI(); entityExplorer.DragDropWidgetNVerify("buttonwidget", 500, 200); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "getUserID"); + propPane.TypeTextIntoField("Label", "getUserName"); propPane.EnterJSContext( "onClick", - `{{fetch('https://jsonplaceholder.typicode.com/todos/1') - .then(res => res.json()) - .then(json => storeValue('userId', json.userId)) - .then(() => showAlert("UserId: " + appsmith.store.userId))}}`, + `{{(async function(){ + const gender = await Gender_Age.run({ person: "sagar" }); + storeValue("Gender", gender); + showAlert("Your name is " + appsmith.store.Gender.name); + })()}}`, ); - agHelper.Sleep(2000); - agHelper.ClickButton("getUserID"); - agHelper.AssertContains("UserId: 1", "exist"); + + agHelper.ClickButton("getUserName"); + agHelper.AssertContains("Your name is sagar", "exist"); }); }); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts index 0414b93a840..bfda4a01b53 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts @@ -37,8 +37,8 @@ describe( cy.fixture("datasources").then((datasourceFormData: any) => { AppSidebar.navigate(AppSidebarButton.Editor); apiPage.CreateAndFillApi( - "https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json", - "Quotes", + "http://host.docker.internal:5001", + "AppsmithTed", 30000, ); apiPage.ToggleConfirmBeforeRunning(true); @@ -54,8 +54,8 @@ describe( `export default { callTrump: async () => { return WhatTrumpThinks.run()}, - callQuotes: () => { - return Quotes.run().then(()=> Quotes.data.quoteText);} + callAppsmithTed: () => { + return AppsmithTed.run()} }`, { paste: true, @@ -71,16 +71,16 @@ describe( jsName as string, EntityType.JSObject, ); - jsEditor.EnableDisableAsyncFuncSettings("callQuotes", false); //OnPageLoad made true once mapped with widget + jsEditor.EnableDisableAsyncFuncSettings("callAppsmithTed", false); //OnPageLoad made true once mapped with widget EditorNavigation.SelectEntityByName("Input1", EntityType.Widget); propPane.UpdatePropertyFieldValue( "Default value", - "{{" + jsObjName + ".callQuotes.data}}", + "{{" + jsObjName + ".callAppsmithTed.data}}", ); cy.get(locators._toastMsg) .children() - .should("contain", "Quotes") //Quotes api also since its .data is accessed in callQuotes() + .should("contain", "AppsmithTed") .and("contain", jsName as string) .and("contain", "will be executed automatically on page load"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts index 8da531365f6..d3c0632939b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts @@ -3,6 +3,7 @@ import { apiPage, assertHelper, dataManager, + dataSources, deployMode, entityExplorer, entityItems, @@ -53,22 +54,35 @@ describe( "RandomUser", ); + apiPage.RunAPI(); + agHelper.GetNClick(dataSources._queryResponse("JSON")); + apiPage.CreateAndFillApi( - "https://favqs.com/api/qotd", + "http://host.docker.internal:5001/v1/favqs/qotd", "InspiringQuotes", 30000, ); apiPage.EnterHeader("dependency", "{{RandomUser.data}}"); //via Params tab + apiPage.RunAPI(); + agHelper.GetNClick(dataSources._queryResponse("JSON")); apiPage.CreateAndFillApi( - "https://www.boredapi.com/api/activity", + "http://host.docker.internal:5001/v1/boredapi/activity", "Suggestions", 30000, ); - apiPage.EnterHeader("dependency", "{{InspiringQuotes.data}}"); + apiPage.EnterHeader("dependency", "{{InspiringQuotes.data.data}}"); + apiPage.RunAPI(); + agHelper.GetNClick(dataSources._queryResponse("JSON")); - apiPage.CreateAndFillApi("https://api.genderize.io", "Genderize", 30000); - apiPage.EnterParams("name", "{{RandomUser.data.results[0].name.first}}"); //via Params tab + apiPage.CreateAndFillApi( + "http://host.docker.internal:5001/v1/genderize/sampledata", + "Genderize", + 30000, + ); + apiPage.EnterParams("name", "{{RandomUser.data[0].name}}"); //via Params tab + apiPage.RunAPI(); + agHelper.GetNClick(dataSources._queryResponse("JSON")); //Adding dependency in right order matters! EditorNavigation.SelectEntityByName("Image1", EntityType.Widget); @@ -77,19 +91,19 @@ describe( EditorNavigation.SelectEntityByName("Image2", EntityType.Widget); propPane.UpdatePropertyFieldValue( "Image", - `{{RandomUser.data.results[0].picture.large}}`, + `{{RandomUser.data[0].avatar}}`, ); EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); propPane.UpdatePropertyFieldValue( "Text", - `{{InspiringQuotes.data.quote.body}}\n--\n{{InspiringQuotes.data.quote.author}}\n`, + `{{InspiringQuotes.data.data.quote.body}}\n--\n{{InspiringQuotes.data.data.quote.author}}\n`, ); EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); propPane.UpdatePropertyFieldValue( "Text", - `Hi, here is {{RandomUser.data.results[0].name.first}} & I'm {{RandomUser.data.results[0].dob.age}}'yo\nI live in {{RandomUser.data.results[0].location.country}}\nMy Suggestion : {{Suggestions.data.activity}}\n\nI'm {{Genderize.data.gender}}`, + `Hi, here is {{RandomUser.data[0].name}} & I'm {{RandomUser.data[0].id}}'yo\nI live in {{RandomUser.data[0].address}}\nMy Suggestion : {{Suggestions.data.data.activity}}\n\nI'm {{Genderize.data.data.gender}}`, ); deployMode.DeployApp(locators._widgetInDeployed("textwidget"), false); @@ -99,32 +113,27 @@ describe( cy.get("@getConsolidatedData").then(($response: any) => { const respBody = JSON.stringify($response.response?.body); const { pageWithMigratedDsl } = JSON.parse(respBody)?.data; - const _randomFlora = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[0]; - const _randomUser = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[1]; - const _genderize = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[2]; - const _suggestions = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[3]; - - expect(JSON.parse(JSON.stringify(_randomFlora))[0]["name"]).to.eq( - "RandomFlora", - ); - expect(JSON.parse(JSON.stringify(_randomUser))[0]["name"]).to.eq( - "RandomUser", - ); - expect(JSON.parse(JSON.stringify(_genderize))[0]["name"]).to.be.oneOf([ - "Genderize", - "InspiringQuotes", - ]); - expect(JSON.parse(JSON.stringify(_genderize))[1]["name"]).to.be.oneOf([ - "Genderize", - "InspiringQuotes", - ]); - expect(JSON.parse(JSON.stringify(_suggestions))[0]["name"]).to.eq( - "Suggestions", - ); + + // Extract the layoutOnLoadActions array from the first layout + const layoutActions = + pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions; + + // Get individual actions from the array + const _randomFlora = layoutActions[0][0]; // RandomFlora is the first action in the first array + const _randomUser = layoutActions[1][0]; // RandomUser is the first action in the second array + const _inspiringQuotes = layoutActions[2][0]; // InspiringQuotes is the first action in the third array + const _genderize = layoutActions[3][0]; // Genderize is the first action in the fourth array + const _suggestions = layoutActions[4][0]; // Suggestions is the first action in the fifth array + + // Assertions for the API names + expect(_randomFlora.name).to.eq("RandomFlora"); + expect(_randomUser.name).to.eq("RandomUser"); + + // Check if the name is either 'Genderize' or 'InspiringQuotes' for this position + expect(_inspiringQuotes.name).to.eq("InspiringQuotes"); + expect(_genderize.name).to.eq("Genderize"); + + expect(_suggestions.name).to.eq("Suggestions"); }); deployMode.NavigateBacktoEditor(); @@ -141,7 +150,7 @@ describe( }); apiPage.CreateAndFillApi( - "https://api.genderize.io?name={{RandomUser.data.results[0].name.first}}", + "http://host.docker.internal:5001/v1/genderize/sampledata?name={{RandomUser.data[0].name}}", "Genderize", 30000, "GET", @@ -150,8 +159,10 @@ describe( ); apiPage.ValidateQueryParams({ key: "name", - value: "{{RandomUser.data.results[0].name.first}}", + value: "{{RandomUser.data[0].name}}", }); // verifies Bug 10055 + apiPage.RunAPI(); + agHelper.GetNClick(dataSources._queryResponse("JSON")); deployMode.DeployApp( locators._widgetInDeployed("textwidget"), @@ -164,32 +175,27 @@ describe( const respBody = JSON.stringify($response.response?.body); const { pageWithMigratedDsl } = JSON.parse(respBody)?.data; - const _randomFlora = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[0]; - const _randomUser = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[1]; - const _genderize = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[2]; - const _suggestions = - pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions[3]; - - expect(JSON.parse(JSON.stringify(_randomFlora))[0]["name"]).to.eq( - "RandomFlora", - ); - expect(JSON.parse(JSON.stringify(_randomUser))[0]["name"]).to.eq( - "RandomUser", - ); - expect(JSON.parse(JSON.stringify(_genderize))[0]["name"]).to.be.oneOf([ - "Genderize", - "InspiringQuotes", - ]); - expect(JSON.parse(JSON.stringify(_genderize))[1]["name"]).to.be.oneOf([ - "Genderize", - "InspiringQuotes", - ]); - expect(JSON.parse(JSON.stringify(_suggestions))[0]["name"]).to.eq( - "Suggestions", - ); + // Extract layoutOnLoadActions from the first layout + const layoutActions = + pageWithMigratedDsl.data.layouts[0].layoutOnLoadActions; + + // Get the individual actions + const _randomFlora = layoutActions[0][0]; // First item in the first array + const _randomUser = layoutActions[1][0]; // First item in the second array + const _inspiringQuotes = layoutActions[2][0]; // First item in the third array + const _genderize = layoutActions[3][0]; // First item in the fourth array + const _suggestions = layoutActions[4][0]; // First item in the fifth array + + // Assertions for the API names + expect(_randomFlora.name).to.eq("RandomFlora"); + expect(_randomUser.name).to.eq("RandomUser"); + + // Check if the name is either 'Genderize' or 'InspiringQuotes' for these positions + expect(_inspiringQuotes.name).to.eq("InspiringQuotes"); + expect(_genderize.name).to.eq("Genderize"); + + // Assertions for 'Suggestions' + expect(_suggestions.name).to.eq("Suggestions"); }); }); }, diff --git a/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts index 9f97d88433a..ce08c00a4f2 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts @@ -83,16 +83,16 @@ describe( ,rating NUMERIC(3,1) ,votes INTEGER ); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E1',1,1,1,'Simpsons Roasting on an Open Fire','The family is forced to spend all of their savings to get Bart''s new tattoo removed, and with no money for Christmas, Homer is forced to become a store Santa.','1989-12-17','https://m.media-amazon.com/images/M/MV5BZjJjMzMwOTctODk5ZC00NWM4LTgyNjAtNjNmN2I1OTc5OTAyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',8.1,5499); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E2',1,2,2,'Bart the Genius','Bart ends up at a school for gifted children after cheating on an IQ test.','1990-01-14','https://m.media-amazon.com/images/M/MV5BOTA0MTk3ZjktZGFhMi00ODcxLTlkYzgtZTJiMTQ5Y2I4MzhiXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.8,3456); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E3',1,3,3,'Homer''s Odyssey','After losing his job, Homer contemplates ending it all, until he discovers a new life path as a safety advocate.','1990-01-21','https://m.media-amazon.com/images/M/MV5BMzQ3M2M1YjQtNTkzNS00MDlhLWFiY2QtOWJiODZhNGJlZWMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.4,3034); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E4',1,4,4,'There''s No Disgrace Like Home','After being embarrassed by the rest of the family at a company picnic, Homer becomes obsessed with improving their behavior towards each other.','1990-01-28','https://m.media-amazon.com/images/M/MV5BOTZmNmE1NDUtMmRhOC00ZTYyLTkzMTEtOTM5YTgwMTc5YmMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.7,2978); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E5',1,5,5,'Bart the General','After being beaten up by Nelson Muntz one too many times, Bart turns to Grampa for help, and soon leads a rebellion against the school bully.','1990-02-04','https://m.media-amazon.com/images/M/MV5BMzk4ZDU2OTMtZjM0NC00ZWIyLWFmNmQtMjcyZGQ1OWE0ZWMyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',8.0,3023); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E6',1,6,6,'Moaning Lisa','A depressed Lisa''s spirit is lifted when she meets a jazz-man, Bleeding Gums Murphy.','1990-02-11','https://m.media-amazon.com/images/M/MV5BODI3ZmEzMmEtNjE2MS00MjMyLWI0MmEtMTdhMWE4YzUwMzkwXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.6,2903); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E7',1,7,7,'The Call of the Simpsons','Homer takes the family camping, but it soon becomes a misadventure when they lose their equipment and Homer is mistaken for Bigfoot.','1990-02-18','https://m.media-amazon.com/images/M/MV5BOTkxMzY3Y2QtMWMyMC00NDllLTkyMTctZTY4MDFjZGExYTc1XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.8,2807); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E8',1,8,8,'The Telltale Head','Bart gets more than he bargained for when he saws the head off a statue of the town''s founder.','1990-02-25','https://m.media-amazon.com/images/M/MV5BMzhhNTM3ZDYtYWQ3OS00NDU2LTk4MGEtOGZmMWUwODlmMjQyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.7,2733); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E9',1,9,9,'Life on the Fast Lane','Marge contemplates an affair with a handsome bowling instructor.','1990-03-18','https://m.media-amazon.com/images/M/MV5BNzcxYWExZWYtMzY1MC00YjhlLWFmZmUtOTQ3ODZhZTUwN2EzXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.5,2716); - INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E10',1,10,10,'Homer''s Night Out','After a photograph of Homer canoodling with an exotic dancer is distributed throughout Springfield, he finds himself kicked out of the house by Marge.','1990-03-25','https://m.media-amazon.com/images/M/MV5BMTQ4NzU0MjY1OF5BMl5BanBnXkFtZTgwNTE4NTQ2MjE@._V1_UX224_CR0,0,224,126_ALjpg',7.3,2624);`; + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E1',1,1,1,'Simpsons Roasting on an Open Fire','The family is forced to spend all of their savings to get Bart''s new tattoo removed, and with no money for Christmas, Homer is forced to become a store Santa.','1989-12-17','https://appsmith.com/images/M/MV5BZjJjMzMwOTctODk5ZC00NWM4LTgyNjAtNjNmN2I1OTc5OTAyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',8.1,5499); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E2',1,2,2,'Bart the Genius','Bart ends up at a school for gifted children after cheating on an IQ test.','1990-01-14','https://appsmith.com/images/M/MV5BOTA0MTk3ZjktZGFhMi00ODcxLTlkYzgtZTJiMTQ5Y2I4MzhiXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.8,3456); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E3',1,3,3,'Homer''s Odyssey','After losing his job, Homer contemplates ending it all, until he discovers a new life path as a safety advocate.','1990-01-21','https://appsmith.com/images/M/MV5BMzQ3M2M1YjQtNTkzNS00MDlhLWFiY2QtOWJiODZhNGJlZWMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.4,3034); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E4',1,4,4,'There''s No Disgrace Like Home','After being embarrassed by the rest of the family at a company picnic, Homer becomes obsessed with improving their behavior towards each other.','1990-01-28','https://appsmith.com/images/M/MV5BOTZmNmE1NDUtMmRhOC00ZTYyLTkzMTEtOTM5YTgwMTc5YmMxXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.7,2978); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E5',1,5,5,'Bart the General','After being beaten up by Nelson Muntz one too many times, Bart turns to Grampa for help, and soon leads a rebellion against the school bully.','1990-02-04','https://appsmith.com/images/M/MV5BMzk4ZDU2OTMtZjM0NC00ZWIyLWFmNmQtMjcyZGQ1OWE0ZWMyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',8.0,3023); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E6',1,6,6,'Moaning Lisa','A depressed Lisa''s spirit is lifted when she meets a jazz-man, Bleeding Gums Murphy.','1990-02-11','https://appsmith.com/images/M/MV5BODI3ZmEzMmEtNjE2MS00MjMyLWI0MmEtMTdhMWE4YzUwMzkwXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.6,2903); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E7',1,7,7,'The Call of the Simpsons','Homer takes the family camping, but it soon becomes a misadventure when they lose their equipment and Homer is mistaken for Bigfoot.','1990-02-18','https://appsmith.com/images/M/MV5BOTkxMzY3Y2QtMWMyMC00NDllLTkyMTctZTY4MDFjZGExYTc1XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.8,2807); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E8',1,8,8,'The Telltale Head','Bart gets more than he bargained for when he saws the head off a statue of the town''s founder.','1990-02-25','https://appsmith.com/images/M/MV5BMzhhNTM3ZDYtYWQ3OS00NDU2LTk4MGEtOGZmMWUwODlmMjQyXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.7,2733); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E9',1,9,9,'Life on the Fast Lane','Marge contemplates an affair with a handsome bowling instructor.','1990-03-18','https://appsmith.com/images/M/MV5BNzcxYWExZWYtMzY1MC00YjhlLWFmZmUtOTQ3ODZhZTUwN2EzXkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_UY126_UX224_ALjpg',7.5,2716); + INSERT INTO Simpsons(episode_id,season,episode,number_in_series,title,summary,air_date,episode_image,rating,votes) VALUES ('S1-E10',1,10,10,'Homer''s Night Out','After a photograph of Homer canoodling with an exotic dancer is distributed throughout Springfield, he finds himself kicked out of the house by Marge.','1990-03-25','https://appsmith.com/images/M/MV5BMTQ4NzU0MjY1OF5BMl5BanBnXkFtZTgwNTE4NTQ2MjE@._V1_UX224_CR0,0,224,126_ALjpg',7.3,2624);`; dataSources.EnterQuery(query); dataSources.RunQuery(); }); diff --git a/app/client/cypress/fixtures/TestDataSet1.json b/app/client/cypress/fixtures/TestDataSet1.json index cb390bc6c80..9032f9db78e 100644 --- a/app/client/cypress/fixtures/TestDataSet1.json +++ b/app/client/cypress/fixtures/TestDataSet1.json @@ -441,19 +441,19 @@ ], "TableURLColumnType": [ { - "image": "https://wallpaperaccess.com/full/1376499.jpg", + "image": "https://docs.appsmith.com/img/cube-logo_S50__hLNq.jpeg", "userName": "Michael Lawson" }, { - "image": "https://wallpaperaccess.com/full/1688623.jpg", + "image": "https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg", "userName": "Lindsay Ferguson" }, { - "image": "https://wallpaperaccess.com/full/2117775.jpg", + "image": "https://docs.appsmith.com/img/zapier-logo_odZ9wZQ3vY.jpeg", "userName": "Byron Fields" }, { - "image": "https://wallpaperaccess.com/full/812632.jpg", + "image": "https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg", "userName": "Toby William" } ], diff --git a/app/client/cypress/fixtures/datasources.json b/app/client/cypress/fixtures/datasources.json index e9a76ef161d..040f7503a69 100644 --- a/app/client/cypress/fixtures/datasources.json +++ b/app/client/cypress/fixtures/datasources.json @@ -83,7 +83,7 @@ "mockDatabaseUsername": "fakeapi", "mockDatabasePassword": "LimitedAccess123#", "readonly": "readonly", - "authenticatedApiUrl": "https://fakeapi.com", + "authenticatedApiUrl": "http://host.docker.internal:5001", "GraphqlApiUrl_TED": "http://host.docker.internal:4200/graphql", "GITEA_API_BASE_TED": "localhost", diff --git a/app/client/cypress/fixtures/gitImport.json b/app/client/cypress/fixtures/gitImport.json index 1e09e17ba44..0e23e769600 100644 --- a/app/client/cypress/fixtures/gitImport.json +++ b/app/client/cypress/fixtures/gitImport.json @@ -743,7 +743,7 @@ "userPermissions": [], "name": "DEFAULT_REST_DATASOURCE", "pluginId": "restapi-plugin", - "datasourceConfiguration": { "url": "hhttp://host.docker.internal:5001/v1/mock-api" }, + "datasourceConfiguration": { "url": "http://host.docker.internal:5001/v1/mock-api" }, "invalids": [], "messages": [], "isValid": true, diff --git a/app/client/cypress/fixtures/modalWidgetTestApp.json b/app/client/cypress/fixtures/modalWidgetTestApp.json index 93186b6d0f2..3b2f53cf18c 100644 --- a/app/client/cypress/fixtures/modalWidgetTestApp.json +++ b/app/client/cypress/fixtures/modalWidgetTestApp.json @@ -510,7 +510,7 @@ "leftColumn": 0.0, "defaultImage": "https://assets.appsmith.com/widgets/default.png", "key": "an3dz32jnz", - "image": "https://jpeg.org/images/jpegsystems-home.jpg", + "image": "https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg", "isDeprecated": false, "rightColumn": 16.0, "objectFit": "cover", @@ -1075,7 +1075,7 @@ "imageShape": "RECTANGLE", "leftColumn": 32.0, "dynamicBindingPathList": [{ "key": "borderRadius" }], - "defaultImage": "https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/5eeea355389655.59822ff824b72.gif", + "defaultImage": "https://docs.appsmith.com/img/multi-update-sql.gif", "key": "an3dz32jnz", "image": "", "isDeprecated": false, @@ -4225,7 +4225,7 @@ "leftColumn": 0.0, "defaultImage": "https://assets.appsmith.com/widgets/default.png", "key": "an3dz32jnz", - "image": "https://jpeg.org/images/jpegsystems-home.jpg", + "image": "https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg", "isDeprecated": false, "rightColumn": 16.0, "objectFit": "cover", @@ -4790,7 +4790,7 @@ "imageShape": "RECTANGLE", "leftColumn": 32.0, "dynamicBindingPathList": [{ "key": "borderRadius" }], - "defaultImage": "https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/5eeea355389655.59822ff824b72.gif", + "defaultImage": "https://docs.appsmith.com/img/multi-update-sql.gif", "key": "an3dz32jnz", "image": "", "isDeprecated": false, diff --git a/app/client/cypress/fixtures/onPageLoadActionsDsl.json b/app/client/cypress/fixtures/onPageLoadActionsDsl.json index fce6d97f48a..a79f4df7075 100644 --- a/app/client/cypress/fixtures/onPageLoadActionsDsl.json +++ b/app/client/cypress/fixtures/onPageLoadActionsDsl.json @@ -34,7 +34,7 @@ "imageShape": "RECTANGLE", "leftColumn": 8, "dynamicBindingPathList": [], - "defaultImage": "http://host.docker.internal:4200/clouddefaultImage.png", + "defaultImage": "https://www.appsmith.com/favicon.png", "key": "nyx7m0wdr7", "image": "", "rightColumn": 54, @@ -122,7 +122,7 @@ "imageShape": "RECTANGLE", "leftColumn": 8, "dynamicBindingPathList": [], - "defaultImage": "http://host.docker.internal:4200/clouddefaultImage.png", + "defaultImage": "https://www.appsmith.com/favicon.png", "key": "agtoehwrk0", "image": "", "rightColumn": 27, diff --git a/app/client/cypress/fixtures/tableDateColumnTypes.ts b/app/client/cypress/fixtures/tableDateColumnTypes.ts new file mode 100644 index 00000000000..614b36b5e11 --- /dev/null +++ b/app/client/cypress/fixtures/tableDateColumnTypes.ts @@ -0,0 +1,26 @@ +export const tableDateColumnTypes = ` +{{ + [ + { + "unixs": 1727212200, + "unixms": 1727212200000, + "yyyymmdd": "2024-09-25", + "yyyymmddhhmm": "2024-09-25 14:30", + iso8601: "2024-09-25T14:30:00.000Z", + "yyyymmddTHHmmss": "2024-09-25T14:30:00", + "yyyymmddhhmmss": "2024-09-25 02:30:00", + "doMMMyyyy": "25th Sep 2024", + "ddmmyyyy": "25/09/2024", + "ddmmyyyyhhmm": "25/09/2024 14:30", + lll: "September 25, 2024 2:30 PM", + ll: "September 25, 2024", + "dmmmmyyyy": "25 September, 2024", + "hmmAdmmmmyyyy": "2:30 PM 25 September, 2024", + "mm1dd1yyyy": "09-25-2024", + "dd1mm1yyyy": "25-09-2024", + "ddimmiyy": "25/09/24", + "mmddyy": "09/25/24", + }, + ] +}} +`; diff --git a/app/client/cypress/support/Objects/DataManager.ts b/app/client/cypress/support/Objects/DataManager.ts index a54e1162eb3..c4a27a021fb 100644 --- a/app/client/cypress/support/Objects/DataManager.ts +++ b/app/client/cypress/support/Objects/DataManager.ts @@ -97,15 +97,12 @@ export class DataManager { firestore_projectID: "appsmith-22e8b", firestore_serviceaccountkey: Cypress.env("FIRESTORE_PRIVATE_KEY"), - restapi_url: "https://my-json-server.typicode.com/typicode/demo/posts", - connection_type: "Replica set", - mockHostAddress: "fake_api.cvuydmurdlas.us-east-1.rds.amazonaws.com", mockDatabaseName: "fakeapi", mockDatabaseUsername: "fakeapi", mockDatabasePassword: "LimitedAccess123#", readonly: "readonly", - authenticatedApiUrl: "https://fakeapi.com", + authenticatedApiUrl: "http://host.docker.internal:5001", GraphqlApiUrl_TED: "http://host.docker.internal:4200/graphql", @@ -192,15 +189,12 @@ export class DataManager { firestore_projectID: "appsmith-dummy", firestore_serviceaccountkey: "dummy_service_creds_key", - restapi_url: "https://my-json-server.typicode.com/typicode/demo/posts", - connection_type: "Replica set", - mockHostAddress: "fake_api.cvuydmurdlas.us-east-1.rds.amazonaws.com", mockDatabaseName: "fakeapi", mockDatabaseUsername: "fakeapi", mockDatabasePassword: "LimitedAccess123#", readonly: "readonly", - authenticatedApiUrl: "https://fakeapi.com", + authenticatedApiUrl: "http://host.docker.internal:5001", GraphqlApiUrl_TED: "http://host.docker.internal:4200/graphql", diff --git a/app/client/cypress/support/Objects/FeatureFlags.ts b/app/client/cypress/support/Objects/FeatureFlags.ts index c7f4b58bdf6..7fdc78d1d58 100644 --- a/app/client/cypress/support/Objects/FeatureFlags.ts +++ b/app/client/cypress/support/Objects/FeatureFlags.ts @@ -4,7 +4,6 @@ import produce from "immer"; const defaultFlags = { release_side_by_side_ide_enabled: true, - ab_learnability_discoverability_collapse_all_except_data_enabled: false, // remove this flag from here when it's removed from code rollout_remove_feature_walkthrough_enabled: false, // remove this flag from here when it's removed from code }; diff --git a/app/client/cypress/support/Pages/PropertyPane.ts b/app/client/cypress/support/Pages/PropertyPane.ts index daf36e185d6..f826f788d26 100644 --- a/app/client/cypress/support/Pages/PropertyPane.ts +++ b/app/client/cypress/support/Pages/PropertyPane.ts @@ -686,4 +686,20 @@ export class PropertyPane { .GetElement(this._propertyToggle(propertyName)) .should(state === "enabled" ? "be.checked" : "not.be.checked"); } + + public ExpandIfCollapsedSection(sectionName: string) { + cy.get(`.t--property-pane-section-collapse-${sectionName}`) + .scrollIntoView() + .then(($element) => { + cy.wrap($element) + .siblings(".bp3-collapse") + .then(($sibling) => { + const siblingHeight = $sibling.height(); // Get the height of the sibling element + + if (!siblingHeight) { + $element.click(); + } + }); + }); + } } diff --git a/app/client/cypress/support/Pages/Table.ts b/app/client/cypress/support/Pages/Table.ts index d1439a58927..45dd2132ded 100644 --- a/app/client/cypress/support/Pages/Table.ts +++ b/app/client/cypress/support/Pages/Table.ts @@ -854,4 +854,38 @@ export class Table { this.agHelper.GetHoverNClick(selector, 1, true); verify && cy.get(selector).eq(1).should("be.disabled"); } + + /** + * Helper function to get formatted date strings for tomorrow's date. + * + * @returns {Object} An object containing: + * - verbose format (e.g., "Sat Sep 21 2024") + * - ISO date format (e.g., "2024-09-21") + */ + public getFormattedTomorrowDates() { + // Create a new Date object for today + const tomorrow = new Date(); + + // Set the date to tomorrow by adding 1 to today's date + tomorrow.setDate(tomorrow.getDate() + 1); + + // Format tomorrow's date in verbose form (e.g., "Sat Sep 21 2024") + const verboseFormat = tomorrow + .toLocaleDateString("en-US", { + weekday: "short", + year: "numeric", + month: "short", + day: "2-digit", + }) + .replace(/,/g, ""); // Remove commas from the formatted string + + // Format tomorrow's date in ISO form (e.g., "2024-09-21") + const isoFormat = tomorrow.toISOString().split("T")[0]; // Extract the date part only + + // Return both formatted date strings as an object + return { + verboseFormat, + isoFormat, + }; + } } diff --git a/app/client/cypress/support/e2e.js b/app/client/cypress/support/e2e.js index 166329ed8e0..a27600f20a2 100644 --- a/app/client/cypress/support/e2e.js +++ b/app/client/cypress/support/e2e.js @@ -141,8 +141,6 @@ before(function () { if (!Cypress.currentTest.titlePath[0].includes(WALKTHROUGH_TEST_PAGE)) { // Adding key FEATURE_WALKTHROUGH (which is used to check if the walkthrough is already shown to the user or not) for non walkthrough cypress tests (to not show walkthrough) addIndexedDBKey(FEATURE_WALKTHROUGH_INDEX_KEY, { - ab_ds_binding_enabled: true, - ab_ds_schema_enabled: true, binding_widget: true, }); } diff --git a/app/client/jest.config.js b/app/client/jest.config.js index abe29d26d8d..bc9bc713c12 100644 --- a/app/client/jest.config.js +++ b/app/client/jest.config.js @@ -5,7 +5,7 @@ const LOG_LEVELS = ["debug", "error"]; const CONFIG_LOG_LEVEL_INDEX = 1; module.exports = { - setupFiles: ["jest-canvas-mock"], + setupFiles: ["jest-canvas-mock", "/test/__mocks__/reactMarkdown.tsx"], roots: ["/src"], transform: { "^.+\\.(png|js|ts|tsx)$": "ts-jest", diff --git a/app/client/knip.json b/app/client/knip.json index c94a3f04bba..c371f805aba 100644 --- a/app/client/knip.json +++ b/app/client/knip.json @@ -1,4 +1,5 @@ { + "$schema": "https://unpkg.com/knip@5/schema.json", "entry": ["src/index.tsx"], "project": ["src/**/*.{tsx,ts,js}"], "ignore": [ @@ -13,6 +14,10 @@ "src/plugins/Linting/**", "src/ee/plugins/Linting/**", "src/ce/plugins/Linting/**", + "src/ce/sagas/EnvironmentSagas.ts", + "src/ce/utils/analyticsHelpers.ts", + "src/ce/utils/autocomplete/helpers.ts", + "src/ce/utils/workflowHelpers.ts", "src/workers/Evaluation/**", "src/widgets/ExternalWidget/component/script.js", "src/widgets/ListWidgetV2/widget/derived.js", @@ -20,5 +25,29 @@ "src/widgets/CustomWidget/component/appsmithConsole.js", "src/serviceWorker.ts", "src/ee/utils/serviceWorkerUtils.ts" + ], + "ignoreDependencies": [ + "craco-alias", + "craco-babel-loader", + "babel-plugin-lodash", + "@types/google.maps", + "@types/web", + "postcss-url", + "@types/dom-view-transitions", + "@types/jest", + "@sentry/webpack-plugin", + "compression-webpack-plugin", + "webpack-retry-chunk-load-plugin", + "lint-staged", + "ts-jest-mock-import-meta", + "cypress-log-to-output", + "cypress-repeat-pro", + "cypress-multi-reporters", + "@aws-sdk/client-s3", + "@aws-sdk/lib-storage", + "@octokit/rest", + "@faker-js/faker", + "pg", + "factory.ts" ] } diff --git a/app/client/package.json b/app/client/package.json index 6a6e80842c8..a8dbd768511 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -52,6 +52,7 @@ "@appsmith/ads-old": "workspace:^", "@appsmith/utils": "workspace:^", "@appsmith/wds": "workspace:^", + "@appsmith/wds-headless": "workspace:^", "@appsmith/wds-theming": "workspace:^", "@aws-sdk/client-s3": "^3.622.0", "@aws-sdk/lib-storage": "^3.622.0", @@ -61,19 +62,18 @@ "@blueprintjs/icons": "3.22.0", "@blueprintjs/popover2": "^0.5.0", "@blueprintjs/select": "^3.10.0", - "@design-system/storybook": "workspace:^", "@design-system/widgets-old": "workspace:^", "@floating-ui/dom": "^1.6.4", - "@fusioncharts/powercharts": "^3.16.0", + "@floating-ui/react": "^0.26.24", "@github/g-emoji-element": "^1.1.5", "@googlemaps/markerclusterer": "^2.0.14", "@googlemaps/react-wrapper": "^1.1.35", - "@loadable/component": "^5.15.3", "@manaflair/redux-batch": "^1.0.0", "@mantine/hooks": "^5.10.1", "@newrelic/browser-agent": "^1.255.0", - "@opentelemetry/auto-instrumentations-web": "0.40.0", + "@opentelemetry/api": "^1.9.0", "@opentelemetry/context-zone": "1.25.1", + "@opentelemetry/core": "^1.26.0", "@opentelemetry/exporter-metrics-otlp-http": "0.52.1", "@opentelemetry/exporter-trace-otlp-proto": "0.52.1", "@opentelemetry/instrumentation": "0.52.1", @@ -82,7 +82,10 @@ "@opentelemetry/sdk-trace-base": "1.25.1", "@opentelemetry/sdk-trace-web": "1.25.1", "@opentelemetry/semantic-conventions": "1.25.1", + "@react-spring/web": "^9.7.4", "@react-types/shared": "^3.23.0", + "@redux-saga/core": "1.1.3", + "@redux-saga/types": "1.2.1", "@sentry/react": "^6.2.4", "@shared/ast": "workspace:^", "@shared/dsl": "workspace:^", @@ -95,15 +98,16 @@ "@types/web": "^0.0.99", "@uppy/core": "^1.16.0", "@uppy/dashboard": "^1.16.0", - "@uppy/file-input": "^1.4.22", "@uppy/google-drive": "^1.5.22", "@uppy/image-editor": "^0.2.4", "@uppy/onedrive": "^1.1.22", "@uppy/react": "^1.11.2", "@uppy/url": "^1.5.16", + "@uppy/utils": "^6.0.2", "@uppy/webcam": "^1.8.4", "@welldone-software/why-did-you-render": "^4.2.5", - "algoliasearch": "^4.2.0", + "acorn": "8.10.0", + "acorn-walk": "8.2.0", "appsmith-icons": "workspace:^", "assert-never": "^1.2.1", "astring": "^1.7.5", @@ -113,14 +117,15 @@ "clsx": "^1.2.1", "codemirror": "^5.65.13", "codemirror-graphql": "^1.2.14", + "colorjs.io": "^0.5.2", "copy-to-clipboard": "^3.3.1", "core-js": "^3.9.1", "craco-alias": "^2.1.1", "craco-babel-loader": "^1.0.4", - "cssnano": "^6.0.1", "cypress-log-to-output": "^1.1.2", "cypress-repeat-pro": "^1.0.1", "d3-geo": "^3.1.0", + "date-fns": "2.30.0", "dayjs": "^1.10.6", "deep-diff": "^1.0.2", "downloadjs": "^1.4.7", @@ -133,18 +138,13 @@ "fusioncharts": "^3.18.0", "graphql": "^16.8.1", "history": "^4.10.1", - "http-proxy": "^1.18.1", "immer": "^9.0.6", - "instantsearch.css": "^7.4.2", "interweave": "^12.7.2", "interweave-autolink": "^4.4.2", - "jest-preview": "^0.3.1", - "js-beautify": "^1.14.0", "js-regex-pl": "^1.0.1", "js-sha256": "^0.9.0", "jshint": "^2.13.4", "klona": "^2.0.5", - "konva": "8.0.1", "libphonenumber-js": "^1.9.44", "linkedom": "^0.14.20", "localforage": "^1.7.3", @@ -153,7 +153,6 @@ "loglevel": "^1.7.1", "lottie-web": "^5.7.4", "mammoth": "^1.5.1", - "marked": "^4.0.18", "memoize-one": "^6.0.0", "micro-memoize": "^4.0.10", "microdiff": "^1.4.0", @@ -161,39 +160,31 @@ "moment-timezone": "^0.5.35", "nanoid": "^2.0.4", "node-forge": "^1.3.0", - "normalizr": "^3.3.0", "object-hash": "^3.0.0", + "openai": "^4.64.0", "path-to-regexp": "^6.3.0", "popper.js": "^1.15.0", "prismjs": "^1.27.0", "proxy-memoize": "^1.2.0", - "punycode": "^2.1.1", "rc-pagination": "^3.1.3", "rc-select": "^14.1.9", "rc-tree-select": "^5.4.0", - "re-reselect": "^3.4.0", "react": "^17.0.2", "react-append-to-body": "^2.0.26", - "react-beautiful-dnd": "^12.2.0", "react-custom-scrollbars": "^4.2.1", "react-device-detect": "^2.2.2", "react-dnd": "^9.3.4", "react-dnd-html5-backend": "^9.3.4", - "react-dnd-touch-backend": "^9.4.0", "react-documents": "^1.0.4", "react-dom": "^17.0.2", "react-full-screen": "^1.1.0", "react-google-recaptcha": "^2.1.0", "react-helmet": "^5.2.1", "react-hook-form": "^7.28.0", - "react-instantsearch-dom": "^6.4.0", "react-json-view": "^1.21.3", - "react-konva": "17.0.2-6", - "react-masonry-css": "^1.0.16", "react-media-recorder": "^1.6.1", "react-modal": "^3.15.1", "react-page-visibility": "^7.0.0", - "react-paginating": "^1.4.0", "react-player": "^2.3.1", "react-qr-barcode-scanner": "^1.0.6", "react-rating": "^2.0.5", @@ -202,9 +193,7 @@ "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-scripts": "^5.0.1", - "react-select": "^3.0.8", "react-spring": "^9.4.0", - "react-syntax-highlighter": "^15.5.0", "react-table": "^7.0.0", "react-table-sticky": "^1.1.3", "react-tabs": "^3.0.0", @@ -219,6 +208,7 @@ "redux-saga": "^1.1.3", "remixicon-react": "^1.0.0", "reselect": "^4.0.0", + "resize-observer-polyfill": "^1.5.1", "sass": "^1.70.0", "scroll-into-view-if-needed": "^2.2.26", "shallowequal": "^1.1.0", @@ -231,7 +221,7 @@ "tailwindcss": "^3.3.3", "tern": "^0.21.0", "tinycolor2": "^1.4.2", - "to-json-schema": "^0.2.5", + "tinymce": "^7.3.0", "toposort": "^2.0.2", "tslib": "^2.3.1", "typescript": "^5.5.4", @@ -239,7 +229,7 @@ "url-search-params-polyfill": "^8.0.0", "uuid": "^9.0.0", "validate-color": "^2.2.4", - "webfontloader": "^1.6.28", + "web-vitals": "3.5.2", "webpack-retry-chunk-load-plugin": "^3.1.1", "yjs": "^13.5.12", "zipcelx": "^1.6.2" @@ -252,14 +242,11 @@ ], "devDependencies": { "@appsmith/eslint-plugin": "workspace:^", - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-string-parser": "^7.19.4", "@craco/craco": "^7.0.0", "@cypress/grep": "^4.0.1", "@faker-js/faker": "^7.4.0", "@octokit/rest": "^20.0.1", "@peculiar/webcrypto": "^1.4.3", - "@redux-saga/testing-utils": "^1.1.5", "@sentry/webpack-plugin": "^1.18.9", "@simonsmith/cypress-image-snapshot": "^9.1.0", "@testing-library/jest-dom": "5.16.1", @@ -268,49 +255,39 @@ "@testing-library/user-event": "13.5.0", "@types/codemirror": "^0.0.96", "@types/deep-diff": "^1.0.0", - "@types/dom-mediacapture-record": "^1.0.11", "@types/dom-view-transitions": "^1.0.5", "@types/downloadjs": "^1.4.2", "@types/jest": "^27.4.1", - "@types/js-beautify": "^1.13.2", "@types/jshint": "^2.12.0", "@types/lodash": "^4.14.120", - "@types/marked": "^4.0.3", "@types/moment-timezone": "^0.5.10", "@types/nanoid": "^2.0.0", "@types/node": "^10.12.18", "@types/node-fetch": "^2.6.11", "@types/node-forge": "^0.10.0", "@types/object-hash": "^2.2.1", - "@types/pg": "^8.10.2", "@types/prismjs": "^1.16.1", "@types/react": "^17.0.2", - "@types/react-beautiful-dnd": "^11.0.4", "@types/react-custom-scrollbars": "^4.0.7", "@types/react-dom": "^17.0.2", "@types/react-google-recaptcha": "^2.1.1", "@types/react-helmet": "^5.0.14", - "@types/react-instantsearch-dom": "^6.3.0", + "@types/react-instantsearch-core": "^6.26.10", "@types/react-modal": "^3.13.1", "@types/react-redux": "^7.0.1", "@types/react-router-dom": "^5.1.2", - "@types/react-select": "^3.0.5", - "@types/react-syntax-highlighter": "^13.5.2", "@types/react-table": "^7.0.13", "@types/react-tabs": "^2.3.1", "@types/react-test-renderer": "^17.0.1", "@types/react-window": "^1.8.2", "@types/redux-form": "^8.1.9", "@types/redux-mock-store": "^1.0.2", - "@types/resize-observer-browser": "^0.1.5", "@types/showdown": "^1.9.4", "@types/styled-components": "^5.1.26", "@types/tern": "0.22.0", "@types/tinycolor2": "^1.4.2", - "@types/to-json-schema": "^0.2.1", "@types/toposort": "^2.0.3", "@types/uuid": "^9.0.5", - "@types/webfontloader": "1.6.33", "@types/zipcelx": "^1.5.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", @@ -337,7 +314,6 @@ "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-babel-module": "^5.3.2", "eslint-plugin-cypress": "^2.15.1", - "eslint-plugin-import": "^2.28.1", "eslint-plugin-jest": "^27.4.2", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.33.2", @@ -346,7 +322,6 @@ "eslint-plugin-sort-destructure-keys": "^1.5.0", "eslint-plugin-storybook": "^0.6.15", "eslint-plugin-testing-library": "^6.2.0", - "esm": "^3.2.25", "factory.ts": "^0.5.1", "husky": "^8.0.0", "jest": "^27.4.1", @@ -366,22 +341,17 @@ "postcss-modules-values": "^4.0.0", "postcss-nesting": "^12.0.1", "postcss-url": "^10.1.3", - "postinstall-postinstall": "^2.1.0", "prettier": "^3.0.3", "prop-types": "^15.8.1", "raw-loader": "^4.0.2", "react-is": "^16.12.0", "react-test-renderer": "^16.11.0", - "redux-devtools": "^3.5.0", "redux-devtools-extension": "^2.13.8", "redux-mock-store": "^1.5.4", "redux-saga-test-plan": "^4.0.6", "ts-jest": "29.1.0", "ts-jest-mock-import-meta": "^0.12.0", - "ts-loader": "^9.4.1", "ts-node": "^10.9.1", - "webpack-merge": "^5.8.0", - "workbox-webpack-plugin": "^6.5.3", "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz" }, "resolutions": { diff --git a/app/client/packages/ast/package.json b/app/client/packages/ast/package.json index 369e809026d..6afd7bf818a 100644 --- a/app/client/packages/ast/package.json +++ b/app/client/packages/ast/package.json @@ -13,7 +13,6 @@ "build": "rollup -c" }, "dependencies": { - "@babel/runtime": "^7.21.0", "@rollup/plugin-commonjs": "^22.0.0", "@types/escodegen": "^0.0.7", "@types/lodash": "^4.14.120", @@ -32,7 +31,6 @@ "unescape-js": "^1.1.4" }, "devDependencies": { - "@babel/preset-typescript": "^7.17.12", "@types/jest": "29.0.3", "@typescript-eslint/eslint-plugin": "^5.25.0", "@typescript-eslint/parser": "^5.25.0", diff --git a/app/client/packages/design-system/ads-old/package.json b/app/client/packages/design-system/ads-old/package.json index 1d9aa8be14f..364372136ce 100644 --- a/app/client/packages/design-system/ads-old/package.json +++ b/app/client/packages/design-system/ads-old/package.json @@ -14,21 +14,12 @@ ], "license": "Apache-2.0", "devDependencies": { - "@types/loadable__component": "^5.13.4", - "@types/react-form": "^4.0.2", - "@types/wait-on": "^5.2.0", - "concurrently": "^7.3.0", - "identity-obj-proxy": "3.0.0", - "react-toastify": "^5.5.0", - "wait-on": "^5.3.0" + "identity-obj-proxy": "3.0.0" }, "browserslist": [ ">0.2%", "not dead", "not ie <= 11", "not op_mini all" - ], - "dependencies": { - "emoji-mart": "3.0.1" - } + ] } diff --git a/app/client/packages/design-system/ads/package.json b/app/client/packages/design-system/ads/package.json index 582a1923017..f5cb8877c53 100644 --- a/app/client/packages/design-system/ads/package.json +++ b/app/client/packages/design-system/ads/package.json @@ -14,14 +14,7 @@ "license": "ISC", "devDependencies": { "@react-aria/focus": "^3.10.1", - "@react-types/button": "^3.7.0", - "@types/loadable__component": "^5.13.4", - "@types/react-datepicker": "^4.10.0", - "axe-core": "^4.7.2", - "concurrently": "^8.2.0", - "file-loader": "6.2.0", - "normalize.css": "^8.0.1", - "remark-gfm": "^3.0.1" + "@types/react-datepicker": "^4.10.0" }, "dependencies": { "@radix-ui/react-dialog": "^1.0.2", @@ -29,7 +22,6 @@ "@radix-ui/react-hover-card": "^1.0.7", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-tabs": "^1.0.2", - "@react-aria/button": "^3.7.0", "@react-aria/checkbox": "^3.7.1", "@react-aria/focus": "^3.10.1", "@react-aria/link": "^3.3.6", @@ -38,7 +30,9 @@ "@react-aria/textfield": "^3.8.1", "@react-stately/radio": "^3.6.2", "@react-stately/toggle": "^3.4.4", + "@react-types/textfield": "^3.9.6", "@xstyled/styled-components": "^3.8.0", + "@xstyled/system": "^3.8.1", "csstype": "^3.1.2", "date-fns": "^2.29.3", "overlayscrollbars": "^2.7.2", diff --git a/app/client/packages/design-system/headless/package.json b/app/client/packages/design-system/headless/package.json index c5df29d7016..65e8e381796 100644 --- a/app/client/packages/design-system/headless/package.json +++ b/app/client/packages/design-system/headless/package.json @@ -10,28 +10,16 @@ }, "dependencies": { "@floating-ui/react": "^0.24.0", - "@react-aria/button": "^3.7.0", - "@react-aria/checkbox": "^3.9.0", "@react-aria/focus": "^3.11.0", "@react-aria/interactions": "^3.14.0", - "@react-aria/menu": "^3.11.1", - "@react-aria/radio": "^3.6.1", - "@react-aria/switch": "^3.5.2", "@react-aria/textfield": "^3.11.0", "@react-aria/utils": "^3.16.0", - "@react-aria/visually-hidden": "^3.8.0", "@react-spectrum/utils": "^3.9.0", - "@react-stately/checkbox": "^3.4.1", - "@react-stately/collections": "^3.10.2", - "@react-stately/menu": "^3.5.6", - "@react-stately/radio": "^3.8.1", - "@react-stately/toggle": "^3.5.1", - "@react-types/button": "^3.7.1", - "@react-types/checkbox": "^3.4.3", + "@react-stately/utils": "^3.10.3", "@react-types/label": "^3.7.3", - "@react-types/menu": "^3.9.5", "@react-types/shared": "^3.23.1", - "classnames": "*" + "@react-types/textfield": "^3.9.6", + "react-aria-components": "^1.3.3" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" diff --git a/app/client/packages/design-system/theming/package.json b/app/client/packages/design-system/theming/package.json index 132ed9aeecf..36903599f13 100644 --- a/app/client/packages/design-system/theming/package.json +++ b/app/client/packages/design-system/theming/package.json @@ -16,7 +16,8 @@ "dependencies": { "@capsizecss/core": "^3.1.1", "@capsizecss/metrics": "^1.2.0", - "@emotion/sheet": "^1.2.2", + "@emotion/css": "^11.13.0", + "colorjs.io": "^0.5.2", "lodash": "*" } } diff --git a/app/client/packages/design-system/theming/src/token/src/tokensConfigs.json b/app/client/packages/design-system/theming/src/token/src/tokensConfigs.json index 2c6f2ec9a37..ae7264c8247 100644 --- a/app/client/packages/design-system/theming/src/token/src/tokensConfigs.json +++ b/app/client/packages/design-system/theming/src/token/src/tokensConfigs.json @@ -18,12 +18,12 @@ "userDensityRatio": 2.25 }, "innerSpacing": { - "V": 1.4, + "V": 1.2, "R": 2.25, "N": 2, "stepsUp": 8, "stepsDown": 0, - "userSizingRatio": 0.5, + "userSizingRatio": 1.35, "userDensityRatio": 2.5 }, "typography": { diff --git a/app/client/packages/design-system/widgets-old/package.json b/app/client/packages/design-system/widgets-old/package.json index 90d7c6dbf8a..0f24f640c8d 100644 --- a/app/client/packages/design-system/widgets-old/package.json +++ b/app/client/packages/design-system/widgets-old/package.json @@ -10,20 +10,8 @@ "prettier": "yarn g:prettier" }, "devDependencies": { - "@svgr/webpack": "5.5.0", - "@types/emoji-mart": "3.0.4", - "@types/loadable__component": "^5.13.4", - "@types/react-form": "^4.0.2", "@types/react-table": "*", - "@types/react-tabs": "*", - "concurrently": "^7.3.0", - "eslint-config-react": "^1.1.7", - "eslint-plugin-storybook": "^0.6.8", - "identity-obj-proxy": "3.0.0", - "playwright": "^1.25.1", - "postcss": "^8.4.31", - "postcss-import": "^14.1.0", - "tsconfig-paths-webpack-plugin": "^3.5.2" + "identity-obj-proxy": "3.0.0" }, "peerDependencies": { "@blueprintjs/core": "3.33.0", @@ -53,8 +41,5 @@ } } ] - }, - "dependencies": { - "emoji-mart": "3.0.1" } } diff --git a/app/client/packages/design-system/widgets/jest.config.js b/app/client/packages/design-system/widgets/jest.config.js index 59574a2a95b..08272cd0c57 100644 --- a/app/client/packages/design-system/widgets/jest.config.js +++ b/app/client/packages/design-system/widgets/jest.config.js @@ -1,6 +1,7 @@ module.exports = { preset: "ts-jest", roots: ["/src"], + setupFiles: ["../../../test/__mocks__/reactMarkdown.tsx"], testEnvironment: "jsdom", moduleNameMapper: { "\\.(css)$": "../../../test/__mocks__/styleMock.js", diff --git a/app/client/packages/design-system/widgets/package.json b/app/client/packages/design-system/widgets/package.json index b1267b65562..12607a4be39 100644 --- a/app/client/packages/design-system/widgets/package.json +++ b/app/client/packages/design-system/widgets/package.json @@ -11,23 +11,28 @@ "build:icons": "npx tsx ./src/scripts/build-icons.ts" }, "dependencies": { - "@appsmith/utils": "workspace:^", "@appsmith/wds-headless": "workspace:^", "@appsmith/wds-theming": "workspace:^", "@emotion/css": "^11.11.2", - "@react-aria/actiongroup": "^3.7.0", + "@floating-ui/react": "^0.26.24", + "@react-aria/focus": "^3.18.2", "@react-aria/utils": "^3.16.0", "@react-aria/visually-hidden": "^3.8.0", + "@react-spectrum/utils": "^3.11.10", + "@react-stately/collections": "^3.10.9", + "@react-stately/list": "^3.10.8", "@react-types/actiongroup": "^3.4.6", "@react-types/shared": "^3.23.1", "@tabler/icons-react": "^3.10.0", "clsx": "^2.0.0", - "colorjs.io": "^0.5.2", "lodash": "*", - "react-aria-components": "^1.2.1" + "react-aria-components": "^1.2.1", + "react-markdown": "^9.0.1", + "react-syntax-highlighter": "^15.5.0" }, "devDependencies": { "@types/fs-extra": "^11.0.4", + "@types/react-syntax-highlighter": "^15.5.13", "eslint-plugin-storybook": "^0.6.10" }, "peerDependencies": { diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/index.ts b/app/client/packages/design-system/widgets/src/components/AIChat/index.ts new file mode 100644 index 00000000000..3bd16e178a0 --- /dev/null +++ b/app/client/packages/design-system/widgets/src/components/AIChat/index.ts @@ -0,0 +1 @@ +export * from "./src"; diff --git a/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx b/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx new file mode 100644 index 00000000000..d6975d9750a --- /dev/null +++ b/app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx @@ -0,0 +1,81 @@ +import { Button, Text, TextArea } from "@appsmith/wds"; +import type { FormEvent, ForwardedRef, KeyboardEvent } from "react"; +import React, { forwardRef, useCallback } from "react"; +import { ChatTitle } from "./ChatTitle"; +import styles from "./styles.module.css"; +import { ThreadMessage } from "./ThreadMessage"; +import type { AIChatProps, ChatMessage } from "./types"; +import { UserAvatar } from "./UserAvatar"; + +const MIN_PROMPT_LENGTH = 3; + +const _AIChat = (props: AIChatProps, ref: ForwardedRef) => { + const { + // assistantName, + chatTitle, + isWaitingForResponse = false, + onPromptChange, + onSubmit, + prompt, + promptInputPlaceholder, + thread, + username, + ...rest + } = props; + + const handleFormSubmit = useCallback( + (event: FormEvent) => { + event.preventDefault(); + onSubmit?.(); + }, + [onSubmit], + ); + + const handlePromptInputKeyDown = useCallback( + (event: KeyboardEvent) => { + if (event.key === "Enter" && event.shiftKey) { + event.preventDefault(); + onSubmit?.(); + } + }, + [onSubmit], + ); + + return ( +
+
+ + +
+ + + {username} + +
+
+ +
    + {thread.map((message: ChatMessage) => ( + + ))} +
+ +
+