diff --git a/.github/workflows/ci-debugging.yml b/.github/workflows/ci-debugging.yml deleted file mode 100644 index 74b496db418a..000000000000 --- a/.github/workflows/ci-debugging.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: CI Debugging - -on: - # This line enables manual triggering of this workflow. - workflow_dispatch: - inputs: - run_id: - description: "Run id to download artifacts:" - required: true - type: number - -jobs: - ci-debugger: - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - job: [0] - - # Service containers to run with this job. Required for running tests - services: - # Label used to access the service container - redis: - # Docker Hub image for Redis - image: redis - ports: - # Opens tcp port 6379 on the host and service container - - 6379:6379 - mongo: - image: mongo - ports: - - 27017:27017 - - steps: - - name: Set up Depot CLI - uses: depot/setup-action@v1 - - - name: Checkout the head commit of the branch - uses: actions/checkout@v4 - - - name: Download Docker image artifact - uses: dawidd6/action-download-artifact@v2 - with: - name: cicontainer - run_id: ${{ github.event.inputs.run_id }} - - - name: Load Docker image from tar file - run: | - gunzip cicontainer.tar.gz - docker load -i cicontainer.tar - - - name: Create folder - if: steps.run_result.outputs.run_result != 'success' - env: - APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }} - working-directory: "." - run: | - mkdir -p cicontainerlocal/stacks/configuration/ - - - name: Run docker image - if: steps.run_result.outputs.run_result != 'success' - env: - APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }} - working-directory: "." - run: | - sudo /etc/init.d/ssh stop ; - mkdir -p ~/git-server/keys - docker run --name test-event-driver -d -p 22:22 -p 5001:5001 -p 3306:3306 \ - -p 5433:5432 -p 28017:27017 -p 25:25 -p 4200:4200 -p 5000:5000 -p 3001:3000 --privileged --pid=host --ipc=host --volume /:/host -v ~/git-server/keys:/git-server/keys \ - appsmith/test-event-driver:latest - cd cicontainerlocal - docker run -d --name appsmith -p 80:80 \ - -v "$PWD/stacks:/appsmith-stacks" -e APPSMITH_LICENSE_KEY=$APPSMITH_LICENSE_KEY \ - -e APPSMITH_DISABLE_TELEMETRY=true \ - -e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \ - --add-host=host.docker.internal:host-gateway \ - cicontainer - - - name: Execute access to ci-debug.sh - if: steps.run_result.outputs.run_result != 'success' - working-directory: "." - run: | - chmod +x ci-debug.sh - - # Start tmate session for tunnelling - - name: Setup tmate session - if: steps.run_result.outputs.run_result != 'success' - uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/ci-test-custom-script.yml b/.github/workflows/ci-test-custom-script.yml index ffcaea802a40..0cd2c5065069 100644 --- a/.github/workflows/ci-test-custom-script.yml +++ b/.github/workflows/ci-test-custom-script.yml @@ -166,10 +166,8 @@ jobs: -e APPSMITH_JWT_SECRET=appsmith-cloud-services-jwt-secret-dummy-key \ -e APPSMITH_ENCRYPTION_SALT=encryption-salt \ -e APPSMITH_ENCRYPTION_PASSWORD=encryption-password \ - -e APPSMITH_CLOUD_SERVICES_URL=https://cs-dev.appsmith.com \ -e APPSMITH_CUSTOMER_PORTAL_URL=https://dev.appsmith.com \ -e APPSMITH_CLOUD_SERVICES_BASE_URL=https://cs-dev.appsmith.com \ - -e APPSMITH_CLOUD_SERVER_BASE_URL=https://release.app.appsmith.com \ -e AUTH0_ISSUER_URL=https://login.release-customer.appsmith.com/ \ -e AUTH0_CLIENT_ID=dummy-client-id \ -e AUTH0_CLIENT_SECRET=dummy-secret-id \ @@ -198,7 +196,7 @@ 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: | @@ -457,20 +455,20 @@ jobs: name: server-logs-${{ matrix.job }} path: app/server/server-logs.log overwrite: true - + - name: Collect docker log as file if: always() run: | docker logs appsmith >& app/server/docker-logs.log - - - name: Upload server docker logs bundle on failure + + - name: Upload server docker logs bundle on failure uses: actions/upload-artifact@v4 if: always() with: name: docker-logs-${{ matrix.job }} path: app/server/docker-logs.log overwrite: true - + # Set status = success - name: Save the status of the run run: | diff --git a/.github/workflows/ci-test-limited-with-count.yml b/.github/workflows/ci-test-limited-with-count.yml index b7786c07aa5a..23af3ad3e474 100644 --- a/.github/workflows/ci-test-limited-with-count.yml +++ b/.github/workflows/ci-test-limited-with-count.yml @@ -17,7 +17,7 @@ on: run_count: description: 'Number of times to repeat the test run' required: false - type: number + type: number default: 1 workflow_call: inputs: @@ -176,10 +176,8 @@ jobs: -e APPSMITH_JWT_SECRET=appsmith-cloud-services-jwt-secret-dummy-key \ -e APPSMITH_ENCRYPTION_SALT=encryption-salt \ -e APPSMITH_ENCRYPTION_PASSWORD=encryption-password \ - -e APPSMITH_CLOUD_SERVICES_URL=https://cs-dev.appsmith.com \ -e APPSMITH_CUSTOMER_PORTAL_URL=https://dev.appsmith.com \ -e APPSMITH_CLOUD_SERVICES_BASE_URL=https://cs-dev.appsmith.com \ - -e APPSMITH_CLOUD_SERVER_BASE_URL=https://release.app.appsmith.com \ -e AUTH0_ISSUER_URL=https://login.release-customer.appsmith.com/ \ -e AUTH0_CLIENT_ID=dummy-client-id \ -e AUTH0_CLIENT_SECRET=dummy-secret-id \ @@ -351,10 +349,10 @@ jobs: npx cypress-repeat-pro run -n ${{ inputs.run_count }} --force \ --spec ${{ env.specs_to_run }} \ --config-file "cypress_ci_custom.config.ts" - cat cy-repeat-summary.txt + cat cy-repeat-summary.txt # Define the path for the failure flag file FAILURE_FLAG_FILE="ci_test_status.txt" - + # Check for test results and store the status in the file if ! grep -q "Total Failed: 0" cy-repeat-summary.txt; then echo "ci_test_failed=true" > "$FAILURE_FLAG_FILE" @@ -362,7 +360,7 @@ jobs: echo "ci_test_failed=false" > "$FAILURE_FLAG_FILE" fi cat "$FAILURE_FLAG_FILE" - + - name: Trim number of cypress log files if: failure() run: | @@ -375,7 +373,7 @@ jobs: name: cypress-repeat-logs path: ${{ github.workspace }}/app/client/cy-repeat-summary.txt overwrite: true - + - name: Upload ci_test_status.txt artifact if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index b9cdeaf90f13..0407cc6440da 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -166,10 +166,8 @@ jobs: -e APPSMITH_JWT_SECRET=appsmith-cloud-services-jwt-secret-dummy-key \ -e APPSMITH_ENCRYPTION_SALT=encryption-salt \ -e APPSMITH_ENCRYPTION_PASSWORD=encryption-password \ - -e APPSMITH_CLOUD_SERVICES_URL=https://cs-dev.appsmith.com \ -e APPSMITH_CUSTOMER_PORTAL_URL=https://dev.appsmith.com \ -e APPSMITH_CLOUD_SERVICES_BASE_URL=https://cs-dev.appsmith.com \ - -e APPSMITH_CLOUD_SERVER_BASE_URL=https://release.app.appsmith.com \ -e AUTH0_ISSUER_URL=https://login.release-customer.appsmith.com/ \ -e AUTH0_CLIENT_ID=dummy-client-id \ -e AUTH0_CLIENT_SECRET=dummy-secret-id \ diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index e247382c9bcb..a801b59da560 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -72,13 +72,17 @@ jobs: with: files: "app/client/**" - #- name: Run step if any file(s) in the client folder change - # if: steps.changed-files-specific.outputs.any_changed == 'true' - # env: - # ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }} - # run: | - # echo "One or more files in the server folder has changed." - # echo "List all the files that have changed: $ALL_CHANGED_FILES" + # - name: Updating the client changed file variable + # id: changed-files-specific + # run: echo "any_changed=true" >> "$GITHUB_OUTPUT" + + - name: Run step if any file(s) in the client folder change + if: steps.changed-files-specific.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }} + run: | + echo "One or more files in the server folder has changed." + echo "List all the files that have changed: $ALL_CHANGED_FILES" - name: Check compliance if: inputs.pr != 0 && steps.changed-files-specific.outputs.any_changed == 'true' @@ -205,10 +209,11 @@ jobs: git config --global user.email "$gituseremail" git config --global user.name "$gituser" git clone https://$cachetoken@github.com/appsmithorg/cibuildcache.git - git lfs install if [ "$reponame" = "appsmith" ]; then export repodir="CE"; fi if [ "$reponame" = "appsmith-ee" ]; then export repodir="EE"; fi cd cibuildcache/$repodir/release/client + git lfs install + git lfs migrate import --everything --yes git lfs pull ./build.tar mv ./build.tar ../../../../../build.tar diff --git a/.github/workflows/server-build.yml b/.github/workflows/server-build.yml index 68c439738348..df1c1334ccab 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/server-build.yml @@ -107,6 +107,10 @@ jobs: files: "app/server/**" write_output_files: true + # - name: Updating the server changed file variable + # id: changed-files-specific + # run: echo "any_changed=true" >> "$GITHUB_OUTPUT" + - name: Run step if any file(s) in the server folder change if: steps.changed-files-specific.outputs.any_changed == 'true' run: | @@ -337,10 +341,11 @@ jobs: git config --global user.email "$gituseremail" git config --global user.name "$gituser" git clone https://$cachetoken@github.com/appsmithorg/cibuildcache.git - git lfs install if [ "$reponame" = "appsmith" ]; then export repodir="CE"; fi if [ "$reponame" = "appsmith-ee" ]; then export repodir="EE"; fi cd cibuildcache/$repodir/release/server + git lfs install + git lfs migrate import --everything --yes git lfs pull ./server.jar mv ./server.jar ../../../../../server.jar cd ../../../../../ diff --git a/.github/workflows/test-vulnerabilities-data.yml b/.github/workflows/test-vulnerabilities-data.yml index f0ad5395cf23..2d1f30a11b74 100644 --- a/.github/workflows/test-vulnerabilities-data.yml +++ b/.github/workflows/test-vulnerabilities-data.yml @@ -1,4 +1,7 @@ -name: Run Vulnerability Data Script with Parameters and Update PR +name: Run Vulnerability + +run-name: > + On Branch: ${{ github.ref_name }} with Image: ${{ inputs.image_name || 'appsmith/appsmith-ce:release' }} on: workflow_dispatch: diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28287_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28287_Spec.ts index 5a38feeaf456..3f92ef47c03a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28287_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28287_Spec.ts @@ -45,9 +45,9 @@ describe( EditorNavigation.SelectEntityByName(queryName, EntityType.Query); BottomPane.response.switchToResponseTab(); - + BottomPane.response.openResponseTypeMenu(); agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("TABLE"), + BottomPane.response.locators.responseTypeMenuItem("TABLE"), ); }); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts index 9608ee564cbd..0ed9a482eb3a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts @@ -79,7 +79,7 @@ describe( "public.users", ); dataSources.SelectTableFromPreviewSchemaList("public.users"); - dataSources.VerifyColumnSchemaOnQueryEditor("id", 1); + dataSources.VerifyColumnSchemaOnQueryEditor("id", 0); }, ); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImportRegularApp.ts b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImportRegularApp.ts new file mode 100644 index 000000000000..71edae318bd7 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImportRegularApp.ts @@ -0,0 +1,231 @@ +import { + agHelper, + entityExplorer, + homePage, + partialImportExport, + entityItems, + locators, + gitSync, + apiPage, +} from "../../../../support/Objects/ObjectsCore"; +import { PageLeftPane } from "../../../../support/Pages/EditorNavigation"; +import PageList from "../../../../support/Pages/PageList"; + +const fixtureName = "ImportExport.json"; + +describe( + "Partial import and export functionality", + { tags: ["@tag.ImportExport", "@tag.Git"] }, + () => { + before(() => { + agHelper.GenerateUUID(); + partialImportExport.OpenImportModal(); + homePage.ImportApp(`PartialImportExport/${fixtureName}`, "", true); + homePage.RenameApplication("ImportExport"); + entityExplorer.RenameEntityFromExplorer( + "Page1", + "Home", + false, + entityItems.Page, + ); + }); + + it("1. Should export all the selected elements and import it to new Page", () => { + partialImportExport.OpenExportModal(); + + // Export Widgets + partialImportExport.PartiallyExportFile( + 4, + partialImportExport.locators.export.modelContents.widgetsSection, + ["Table1", "Button1"], + ); + + // Export Queries + partialImportExport.OpenExportModal(); + partialImportExport.PartiallyExportFile( + 2, + partialImportExport.locators.export.modelContents.queriesSection, + ["Api1"], + ); + + PageList.AddNewPage("New blank page"); + partialImportExport.OpenImportModal(); + + // Import Widgets + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + // Import Queries + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialQueryExport.json", + "Queries", + ["Api1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + + PageLeftPane.switchSegment("Queries"); + agHelper.GetNClick(locators._entityItem); + apiPage.RunAPI(); + PageLeftPane.switchSegment("UI"); + agHelper.AssertElementExist(locators._rowData); + }); + + it("2. Should be able to import again in the same Page", () => { + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + + agHelper.AssertElementLength( + `${locators._widgetInDeployed("tablewidgetv2")}`, + 2, + ); + agHelper.AssertElementLength( + `${locators._widgetInDeployed("buttonwidget")}`, + 2, + ); + }); + + it("3. Should import the Page into new application", () => { + homePage.NavigateToHome(); + homePage.CreateNewApplication(); + + // Import Widgets + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + // Import Queries + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialQueryExport.json", + "Queries", + ["Api1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + + PageLeftPane.switchSegment("Queries"); + agHelper.GetNClick(locators._entityItem); + apiPage.RunAPI(); + PageLeftPane.switchSegment("UI"); + agHelper.AssertElementExist(locators._rowData); + }); + + it("4. Should import the Page into new workspace", () => { + homePage.CreateNewWorkspace("", true); + + homePage.CreateNewApplication(); + + // Import Widgets + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + // Import Queries + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialQueryExport.json", + "Queries", + ["Api1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + + PageLeftPane.switchSegment("Queries"); + agHelper.GetNClick(locators._entityItem); + apiPage.RunAPI(); + PageLeftPane.switchSegment("UI"); + agHelper.AssertElementExist(locators._rowData); + }); + + it("5. Import to Git branch", () => { + homePage.NavigateToHome(); + homePage.CreateNewApplication(); + gitSync.CreateNConnectToGit(); + gitSync.CreateGitBranch("New_Branch"); + gitSync.CreateGitBranch(); + + partialImportExport.OpenImportModal(); + + // Import Widgets + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + // Import Queries + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialQueryExport.json", + "Queries", + ["Api1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + + gitSync.CommitAndPush(); + gitSync.SwitchGitBranch("New_Branch"); + + // Import Widgets + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialWidgetExport.json", + "Widgets", + ["Table1", "Button1"], + ); + + // Import Queries + partialImportExport.OpenImportModal(); + partialImportExport.ImportPartiallyExportedFile( + "PartialQueryExport.json", + "Queries", + ["Api1"], + ); + + agHelper.selectAndValidateWidgetNameAndProperty({ + widgetName: "Table1", + propFieldName: "Table data", + valueToValidate: "{{Api1.data}}", + }); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js index 8f1a58ebc09f..ca00f7a9507b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js @@ -120,7 +120,7 @@ describe( //Cocktail DB cy.xpath("//img/parent::div") - .eq(2) + .eq(1) .find("img") .invoke("attr", "src") .then(($src) => { diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts index 01e4106a4457..7e833e24bcbe 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts @@ -30,32 +30,32 @@ describe( //Add HSET dataSources.CreateQueryAfterDSSaved(); dataSources.EnterQuery(hSetReceipe); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + dataSources.runQueryAndVerifyResponseViews(); //verify all views are returned! dataSources.AssertQueryTableResponse(0, "4"); //Success response for 4 keys inserted via above HSET! //Read only one key from above HSET dataSources.EnterQuery(hGetKeys); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + dataSources.runQueryAndVerifyResponseViews(); //verify all views are returned! dataSources.AssertQueryTableResponse(0, "Vegetable Stir Fry"); //Read more than one key from above HSET dataSources.EnterQuery(hMGet); - dataSources.RunQueryNVerifyResponseViews(2); + dataSources.runQueryAndVerifyResponseViews({ count: 2 }); //verify all views are returned! dataSources.AssertQueryTableResponse(0, "easy"); dataSources.AssertQueryTableResponse(1, "Vegetable Stir Fry"); //Update key value in HSET dataSources.EnterQuery(hUpdate); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + dataSources.runQueryAndVerifyResponseViews(); //verify all views are returned! //validate updated key dataSources.EnterQuery(getUpdatedKey); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryTableResponse(0, "medium"); //Get All keys from HSET dataSources.EnterQuery(getAll); - dataSources.RunQueryNVerifyResponseViews(8); //4 keys, 4 values + dataSources.runQueryAndVerifyResponseViews({ count: 8 }); //4 keys, 4 values dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { expect($cellData).to.be.oneOf([ "name", @@ -70,11 +70,11 @@ describe( //Ading one more key/value to HSET dataSources.EnterQuery(addNewKeyValue); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); //Verify new key/value also added to HSET dataSources.EnterQuery(getAll); - dataSources.RunQueryNVerifyResponseViews(10); //5 keys, 5 values + dataSources.runQueryAndVerifyResponseViews({ count: 10 }); //5 keys, 5 values dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { expect($cellData).to.be.oneOf([ "name", @@ -87,11 +87,11 @@ describe( //Deleting the Hash key dataSources.EnterQuery(deletehKey); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); //Verify Deletion is success dataSources.EnterQuery(hGetKeys); - dataSources.RunQueryNVerifyResponseViews(); //5 keys, 5 values + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryTableResponse(0, "null"); // Delete the query & datasource diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts index e19bc35a8463..e2a95ac3e399 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts @@ -166,7 +166,7 @@ describe( agHelper.FocusElement(locators._codeMirrorTextArea); //agHelper.VerifyEvaluatedValue(tableCreateQuery); //failing sometimes! - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertTableInVirtuosoList(dsName, "productlines"); agHelper.ActionContextMenuWithInPane({ @@ -282,7 +282,7 @@ describe( agHelper.FocusElement(locators._codeMirrorTextArea); //agHelper.VerifyEvaluatedValue(tableCreateQuery); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertTableInVirtuosoList(dsName, "Stores", false); }); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts index 7cc2f30a82c7..8cdcdb87118e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts @@ -68,7 +68,7 @@ describe( agHelper.FocusElement(locators._codeMirrorTextArea); //agHelper.VerifyEvaluatedValue(tableCreateQuery); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertTableInVirtuosoList(dsName, "Stores"); agHelper.ActionContextMenuWithInPane({ @@ -79,7 +79,7 @@ describe( it("2. Validate Select record from Postgress datasource & verify query response", () => { dataSources.CreateQueryForDS(dsName, "SELECT * FROM Stores LIMIT 10"); - dataSources.RunQueryNVerifyResponseViews(10); + dataSources.runQueryAndVerifyResponseViews({ count: 10 }); dataSources.AssertQueryTableResponse(5, "2112"); dataSources.AssertQueryTableResponse(6, "Mike's Liquors"); // Commenting this deletion of query to make the generate crud work on the new page instead of the current page @@ -375,7 +375,7 @@ describe( agHelper.FocusElement(locators._codeMirrorTextArea); //agHelper.VerifyEvaluatedValue(tableCreateQuery); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertTableInVirtuosoList(dsName, "Stores", false); agHelper.ActionContextMenuWithInPane({ diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts index 09a77eb14b2c..1124d1235f07 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts @@ -61,7 +61,7 @@ describe( agHelper.FocusElement(locators._codeMirrorTextArea); //agHelper.VerifyEvaluatedValue(tableCreateQuery); //failing sometimes! - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); }); it("2. Validate Select record from Postgress datasource & verify query response", () => { @@ -70,7 +70,7 @@ describe( "public.vessels", "Select", ); - dataSources.RunQueryNVerifyResponseViews(10); + dataSources.runQueryAndVerifyResponseViews({ count: 10 }); dataSources.AssertQueryTableResponse(0, "371681"); dataSources.AssertQueryTableResponse(6, "Passenger"); agHelper.ActionContextMenuWithInPane({ @@ -617,7 +617,7 @@ describe( dataSources.CreateQueryForDS(dsName, deleteTblQuery, "DropVessels"); agHelper.FocusElement(locators._codeMirrorTextArea); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertTableInVirtuosoList(dsName, "public.vessels", false); }); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts index d63fde861a2d..94425b929e34 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts @@ -259,7 +259,7 @@ describe( //Validating use of extention query = `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE EXTENSION IF NOT EXISTS "pgcrypto"`; dataSources.CreateQueryForDS(dsName, query, "verifyUUIDFunctions"); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryResponseHeaders(["affectedRows"]); dataSources.ReadQueryTableResponse(0).then(($cellData) => { expect($cellData).to.eq("0"); @@ -297,7 +297,7 @@ describe( //Validating Addition of new column taking default value form package method query = `ALTER TABLE uuidtype ADD COLUMN newUUID uuid DEFAULT uuid_generate_v4();`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryResponseHeaders(["affectedRows"]); dataSources.ReadQueryTableResponse(0).then(($cellData) => { expect($cellData).to.eq("0"); @@ -314,7 +314,7 @@ describe( //Validating altering the new column default value to generate id from pgcrypto package query = `ALTER TABLE uuidtype ALTER COLUMN newUUID SET DEFAULT gen_random_uuid();`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryResponseHeaders(["affectedRows"]); dataSources.ReadQueryTableResponse(0).then(($cellData) => { expect($cellData).to.eq("0"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts index 08fe4506112e..6583c23c8477 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts @@ -16,7 +16,6 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -import BottomPane from "../../../../support/Pages/IDE/BottomPane"; let dsName: any; @@ -333,7 +332,11 @@ describe( "Find", ); dataSources.ValidateNSelectDropdown("Command", "Find document(s)"); - dataSources.RunQueryNVerifyResponseViews(1, false); + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -352,7 +355,11 @@ describe( directInput: false, inputFieldName: "Query", }); - dataSources.RunQueryNVerifyResponseViews(1, false); + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -430,12 +437,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.n)), ).to.eq(3); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -467,12 +475,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.nModified)), ).to.eq(0); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -514,12 +523,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.nModified)), ).to.eq(2); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -556,12 +566,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.nModified)), ).to.eq(1); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -587,12 +598,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.n)), ).to.eq(0); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -620,12 +632,13 @@ describe( parseInt(JSON.stringify(resObj.response.body.data.body.n)), ).to.eq(1); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -657,12 +670,13 @@ describe( 2, ); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -682,12 +696,13 @@ describe( 7, ); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -719,12 +734,13 @@ describe( JSON.parse(JSON.stringify(resObj.response.body.data.body.values[1])), ).to.eql("51e062189c6ae665454e301d"); }); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("JSON"), - ); - agHelper.AssertElementVisibility( - BottomPane.response.getResponseTypeSelector("RAW"), - ); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -738,7 +754,12 @@ describe( "Aggregate", ); dataSources.ValidateNSelectDropdown("Command", "Aggregate"); - dataSources.RunQueryNVerifyResponseViews(7, false); + + dataSources.runQueryAndVerifyResponseViews({ + count: 7, + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -899,7 +920,12 @@ describe( "Find", ); dataSources.ValidateNSelectDropdown("Command", "Find document(s)"); - dataSources.RunQueryNVerifyResponseViews(4, false); + + dataSources.runQueryAndVerifyResponseViews({ + count: 4, + responseTypes: ["JSON", "RAW"], + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js index f1f7adcb0577..dcbd88e431d7 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js @@ -71,7 +71,7 @@ describe( dataSources.EnterQuery(`{"find": "listingAndReviews","limit": 10}`); agHelper.FocusElement(locators._codeMirrorTextArea); dataSources.RunQuery(); - BottomPane.response.validateRecordCount(10); + BottomPane.response.validateRecordCount({ count: 10, operator: "lte" }); cy.deleteQueryUsingContext(); }); @@ -93,7 +93,7 @@ describe( fieldValue: "listingAndReviews", }); dataSources.RunQuery(); - BottomPane.response.validateRecordCount(10); + BottomPane.response.validateRecordCount({ count: 10, operator: "lte" }); agHelper.EnterValue("{beds : {$lte: 2}}", { propFieldName: "", @@ -101,7 +101,7 @@ describe( inputFieldName: "Query", }); dataSources.RunQuery(); - BottomPane.response.validateRecordCount(10); + BottomPane.response.validateRecordCount({ count: 10, operator: "lte" }); agHelper.EnterValue("{number_of_reviews: -1}", { propFieldName: "", @@ -109,7 +109,7 @@ describe( inputFieldName: "Sort", }); //sort descending dataSources.RunQuery(); - BottomPane.response.validateRecordCount(10); + BottomPane.response.validateRecordCount({ count: 10, operator: "lte" }); agHelper.EnterValue("{house_rules: 1, description:1}", { propFieldName: "", @@ -131,7 +131,7 @@ describe( "Response is not as expected for Find commmand with multiple conditions", ); }); - BottomPane.response.validateRecordCount(5); + BottomPane.response.validateRecordCount({ count: 5, operator: "lte" }); agHelper.EnterValue("2", { propFieldName: "", @@ -145,7 +145,7 @@ describe( "Response is not as expected for Find commmand with multiple conditions", ); }); - BottomPane.response.validateRecordCount(5); + BottomPane.response.validateRecordCount({ count: 5, operator: "lte" }); cy.deleteQueryUsingContext(); }); @@ -433,7 +433,7 @@ describe( ); dataSources.RunQuery(); - BottomPane.response.validateRecordCount(3); + BottomPane.response.validateRecordCount({ count: 10, operator: "lte" }); dataSources.AssertTableInVirtuosoList(datasourceName, "NonAsciiTest"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js index 2bd496ead58f..4cd40d69e785 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js @@ -77,7 +77,11 @@ describe( "List files", ); - dataSources.RunQueryNVerifyResponseViews(100); + dataSources.runQueryAndVerifyResponseViews({ + count: 100, + operator: "gte", + }); + agHelper.ActionContextMenuWithInPane({ action: "Delete", entityType: entityItems.Query, @@ -191,8 +195,7 @@ describe( cy.typeValueNValidate(fileName, formControls.s3ListPrefix); dataSources.RunQuery({ toValidateResponse: false }); - BottomPane.response.switchResponseType("TABLE"); - BottomPane.response.switchResponseType("JSON"); + BottomPane.response.selectResponseResponseTypeFromMenu("JSON"); cy.wait("@postExecute").then(({ response }) => { expect(response.body.data.isExecutionSuccess).to.eq(true); diff --git a/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts index cbf69cdf90b9..5fc5d0bc4c0b 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts @@ -219,7 +219,7 @@ if (CURRENT_REPO == REPO.CE) { } INTO ${collectionName}`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryResponseHeaders([ "writesExecuted", "writesIgnored", @@ -232,7 +232,7 @@ if (CURRENT_REPO == REPO.CE) { FILTER place.type == "Natural" RETURN { country: doc.country, name: place.name }`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(5); //Verify all records are filtered + dataSources.runQueryAndVerifyResponseViews({ count: 5 }); //Verify all records are filtered dataSources.AssertQueryTableResponse(0, "Japan"); dataSources.AssertQueryTableResponse(1, "Mount Fuji"); dataSources.AssertQueryTableResponse(6, "Brazil"); //Widget binding is verified here @@ -265,7 +265,7 @@ if (CURRENT_REPO == REPO.CE) { } IN ${collectionName}`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(); + dataSources.runQueryAndVerifyResponseViews(); dataSources.createQueryWithDatasourceSchemaTemplate( dsName, @@ -276,7 +276,7 @@ if (CURRENT_REPO == REPO.CE) { FILTER document._key == "1" RETURN document`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); + dataSources.runQueryAndVerifyResponseViews(); dataSources.AssertQueryTableResponse(3, "Australia"); //Delete record from collection @@ -287,7 +287,7 @@ if (CURRENT_REPO == REPO.CE) { ); query = `REMOVE "1" in ${collectionName}`; dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); //Removing Australia + dataSources.runQueryAndVerifyResponseViews(); //Removing Australia //Verify no records return for the deleted key query = `FOR document IN ${collectionName} diff --git a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts index b1cd5d459fcf..11df7b8477e8 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts @@ -42,7 +42,11 @@ describe( 'SELECT * FROM public."users" LIMIT 10;', ); - dataSources.RunQueryNVerifyResponseViews(); //minimum 1 rows are expected + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + }); //minimum 1 rows are expected + AppSidebar.navigate(AppSidebarButton.Data); dataSources .getDatasourceListItemDescription(mockDBName) @@ -57,7 +61,11 @@ describe( expect(interception.request.body.source).to.equal("SELF"); }); - dataSources.RunQueryNVerifyResponseViews(); //minimum 1 rows are expected + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + }); //minimum 1 rows are expected + AppSidebar.navigate(AppSidebarButton.Data); dataSources .getDatasourceListItemDescription(mockDBName) @@ -81,6 +89,12 @@ describe( assertHelper.AssertNetworkStatus("@trigger"); dataSources.ValidateNSelectDropdown("Command", "Find document(s)"); + + dataSources.runQueryAndVerifyResponseViews({ + count: 1, + operator: "gte", + responseTypes: ["JSON", "RAW"], + }); }); }); }, diff --git a/app/client/cypress/fixtures/PartialImportExport/ImportExport.json b/app/client/cypress/fixtures/PartialImportExport/ImportExport.json new file mode 100644 index 000000000000..760d4e423535 --- /dev/null +++ b/app/client/cypress/fixtures/PartialImportExport/ImportExport.json @@ -0,0 +1 @@ +{"artifactJsonType":"APPLICATION","clientSchemaVersion":1,"serverSchemaVersion":11,"customJSLibList":[],"actionList":[{"id":"Home_Api1","pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Api1","datasource":{"userPermissions":[],"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":"http://host.docker.internal:5001"},"invalids":[],"messages":[],"isValid":true},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000,"paginationType":"NONE","path":"/v1/mock-api","headers":[],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[{"key":"records","value":"10"}],"body":"","bodyFormData":[],"httpMethod":"GET","httpVersion":"HTTP11","pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":[],"confirmBeforeExecute":false,"userPermissions":[]},"publishedAction":{"datasource":{"userPermissions":[],"messages":[],"isValid":true},"messages":[],"confirmBeforeExecute":false,"userPermissions":[]}}],"actionCollectionList":[{"id":"Home_JSObject1","unpublishedCollection":{"name":"JSObject1","pageId":"Home","pluginId":"js-plugin","pluginType":"JS","actions":[],"archivedActions":[],"body":"export default {\n\tgenPDF: () => {\n\t\tconst doc = new jspdf.jsPDF();\n\tdoc.text('Users', 20, 20);\n\t\tdoc.table(20, 30, Table1.tableData, Table1.columnOrder, {autoSize: true});\n\t\tdownload(doc.output(), 'users_list.pdf');\n\t}\n}","variables":[],"userPermissions":[]}},{"id":"Home_JSObject2","unpublishedCollection":{"name":"JSObject2","pageId":"Home","pluginId":"js-plugin","pluginType":"JS","actions":[],"archivedActions":[],"body":"export default {\n\tmyVar1: [],\n\tmyVar2: {},\n\tmyFun1 () {\n\t\tshowAlert(moment().daysInMonth().toString());\n\t},\n\tasync myFun2 () {\n\t\t//\tuse async-await or promises\n\t\t//\tawait storeValue('varName', 'hello world')\n\t}\n}","variables":[{"name":"myVar1","value":"[]"},{"name":"myVar2","value":"{}"}],"userPermissions":[]}}],"widgets":"{\"layoutSystemType\":\"FIXED\",\"widgets\":[{\"hierarchy\":4,\"list\":[{\"isVisible\":true,\"type\":\"TABLE_WIDGET_V2\",\"flexVerticalAlignment\":\"start\",\"responsiveBehavior\":\"fill\",\"minWidth\":450,\"canFreezeColumn\":true,\"columnUpdatedAt\":1732544015069,\"animateLoading\":true,\"defaultSelectedRowIndex\":0,\"defaultSelectedRowIndices\":[0],\"label\":\"Data\",\"widgetName\":\"Table1\",\"searchKey\":\"\",\"textSize\":\"0.875rem\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"totalRecordsCount\":0,\"defaultPageSize\":0,\"dynamicPropertyPathList\":[{\"key\":\"tableData\"}],\"borderColor\":\"#E0DEDE\",\"borderWidth\":\"1\",\"dynamicBindingPathList\":[{\"key\":\"accentColor\"},{\"key\":\"borderRadius\"},{\"key\":\"boxShadow\"},{\"key\":\"tableData\"},{\"key\":\"primaryColumns.address.computedValue\"},{\"key\":\"primaryColumns.avatar.computedValue\"},{\"key\":\"primaryColumns.email.computedValue\"},{\"key\":\"primaryColumns.gender.computedValue\"},{\"key\":\"primaryColumns.id.computedValue\"},{\"key\":\"primaryColumns.name.computedValue\"},{\"key\":\"primaryColumns.status.computedValue\"}],\"primaryColumns\":{\"address\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":0,\"width\":150,\"originalId\":\"address\",\"id\":\"address\",\"alias\":\"address\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"address\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"address\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"avatar\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":1,\"width\":150,\"originalId\":\"avatar\",\"id\":\"avatar\",\"alias\":\"avatar\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"avatar\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"avatar\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"email\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":2,\"width\":150,\"originalId\":\"email\",\"id\":\"email\",\"alias\":\"email\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"email\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"email\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"gender\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":3,\"width\":150,\"originalId\":\"gender\",\"id\":\"gender\",\"alias\":\"gender\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"gender\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"gender\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"id\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":4,\"width\":150,\"originalId\":\"id\",\"id\":\"id\",\"alias\":\"id\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"number\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"id\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"id\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"name\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":5,\"width\":150,\"originalId\":\"name\",\"id\":\"name\",\"alias\":\"name\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"name\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"name\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"},\"status\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":6,\"width\":150,\"originalId\":\"status\",\"id\":\"status\",\"alias\":\"status\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"text\",\"textSize\":\"0.875rem\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"status\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"status\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\"}},\"tableData\":\"{{Api1.data}}\",\"columnWidthMap\":{},\"columnOrder\":[\"address\",\"avatar\",\"email\",\"gender\",\"id\",\"name\",\"status\"],\"enableClientSideSearch\":true,\"isVisibleSearch\":true,\"isVisibleFilters\":false,\"isVisibleDownload\":true,\"isVisiblePagination\":true,\"isSortable\":true,\"delimiter\":\",\",\"version\":2,\"inlineEditingSaveOption\":\"ROW_LEVEL\",\"customIsLoading\":false,\"customIsLoadingValue\":\"\",\"key\":\"kf8hr71nup\",\"needsErrorInfo\":false,\"widgetId\":\"u35g21sru2\",\"renderMode\":\"CANVAS\",\"accentColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"{{appsmith.theme.boxShadow.appBoxShadow}}\",\"childStylesheet\":{\"button\":{\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"menuButton\":{\"menuColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"iconButton\":{\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"editActions\":{\"saveButtonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"saveBorderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"discardButtonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"discardBorderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\"}},\"isLoading\":false,\"parentColumnSpace\":8.65625,\"parentRowSpace\":10,\"leftColumn\":11,\"rightColumn\":45,\"topRow\":11,\"bottomRow\":39,\"mobileLeftColumn\":11,\"mobileRightColumn\":45,\"mobileTopRow\":11,\"mobileBottomRow\":39,\"parentId\":\"0\",\"dynamicTriggerPathList\":[]}],\"parentId\":\"0\",\"widgetId\":\"u35g21sru2\",\"widgetPositionInfo\":null},{\"hierarchy\":4,\"list\":[{\"isVisible\":true,\"type\":\"BUTTON_WIDGET\",\"animateLoading\":true,\"text\":\"Submit\",\"buttonVariant\":\"PRIMARY\",\"placement\":\"CENTER\",\"widgetName\":\"Button1\",\"isDisabled\":false,\"isDefaultClickDisabled\":true,\"disabledWhenInvalid\":false,\"resetFormOnClick\":false,\"recaptchaType\":\"V3\",\"version\":1,\"responsiveBehavior\":\"hug\",\"minWidth\":120,\"key\":\"q8mlo01tzz\",\"needsErrorInfo\":false,\"widgetId\":\"imzxuk30nh\",\"renderMode\":\"CANVAS\",\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\",\"isLoading\":false,\"parentColumnSpace\":8.65625,\"parentRowSpace\":10,\"leftColumn\":24,\"rightColumn\":40,\"topRow\":44,\"bottomRow\":48,\"mobileLeftColumn\":24,\"mobileRightColumn\":40,\"mobileTopRow\":44,\"mobileBottomRow\":48,\"parentId\":\"0\",\"dynamicBindingPathList\":[{\"key\":\"buttonColor\"},{\"key\":\"borderRadius\"}],\"onClick\":\"{{JSObject1.genPDF();}}\",\"dynamicTriggerPathList\":[{\"key\":\"onClick\"}]}],\"parentId\":\"0\",\"widgetId\":\"imzxuk30nh\",\"widgetPositionInfo\":null}],\"flexLayers\":[]}"} \ No newline at end of file diff --git a/app/client/cypress/fixtures/PartialImportExport/PartialQueryExport.json b/app/client/cypress/fixtures/PartialImportExport/PartialQueryExport.json new file mode 100644 index 000000000000..edbdb83a93c9 --- /dev/null +++ b/app/client/cypress/fixtures/PartialImportExport/PartialQueryExport.json @@ -0,0 +1 @@ +{"artifactJsonType":"APPLICATION","clientSchemaVersion":1,"serverSchemaVersion":11,"actionList":[{"id":"Home_Api1","pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Api1","fullyQualifiedName":"Api1","datasource":{"userPermissions":[],"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":"http://host.docker.internal:5001"},"invalids":[],"messages":[],"isValid":true},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000,"paginationType":"NONE","path":"/v1/mock-api","headers":[],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[{"key":"records","value":"10"}],"body":"","bodyFormData":[],"httpMethod":"GET","httpVersion":"HTTP11","pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":[],"confirmBeforeExecute":false,"userPermissions":[]},"publishedAction":{"name":"Api1","fullyQualifiedName":"Api1","datasource":{"userPermissions":[],"messages":[],"isValid":true},"pageId":"Home","messages":[],"confirmBeforeExecute":false,"userPermissions":[]}}],"widgets":""} \ No newline at end of file diff --git a/app/client/cypress/fixtures/PartialImportExport/PartialWidgetExport.json b/app/client/cypress/fixtures/PartialImportExport/PartialWidgetExport.json new file mode 100644 index 000000000000..13b3c9b5923b --- /dev/null +++ b/app/client/cypress/fixtures/PartialImportExport/PartialWidgetExport.json @@ -0,0 +1 @@ +{"artifactJsonType":"APPLICATION","clientSchemaVersion":1,"serverSchemaVersion":11,"widgets":"{\"layoutSystemType\":\"FIXED\",\"widgets\":[{\"hierarchy\":4,\"list\":[{\"boxShadow\":\"{{appsmith.theme.boxShadow.appBoxShadow}}\",\"borderColor\":\"#E0DEDE\",\"isVisibleDownload\":true,\"topRow\":1,\"isSortable\":true,\"type\":\"TABLE_WIDGET_V2\",\"inlineEditingSaveOption\":\"ROW_LEVEL\",\"animateLoading\":true,\"dynamicBindingPathList\":[{\"key\":\"accentColor\"},{\"key\":\"borderRadius\"},{\"key\":\"boxShadow\"},{\"key\":\"tableData\"},{\"key\":\"primaryColumns.rowIndex.computedValue\"},{\"key\":\"primaryColumns.Currency.computedValue\"}],\"leftColumn\":7,\"delimiter\":\",\",\"customIsLoadingValue\":\"\",\"defaultSelectedRowIndex\":0,\"flexVerticalAlignment\":\"start\",\"accentColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"isVisibleFilters\":false,\"isVisible\":true,\"enableClientSideSearch\":true,\"version\":2,\"totalRecordsCount\":0,\"isLoading\":false,\"childStylesheet\":{\"button\":{\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"menuButton\":{\"menuColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"iconButton\":{\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"boxShadow\":\"none\"},\"editActions\":{\"saveButtonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"saveBorderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"discardButtonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"discardBorderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\"}},\"customIsLoading\":false,\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"columnUpdatedAt\":1731311884410,\"defaultSelectedRowIndices\":[0],\"needsErrorInfo\":false,\"mobileBottomRow\":62,\"widgetName\":\"Table1\",\"defaultPageSize\":0,\"columnOrder\":[\"rowIndex\",\"Currency\"],\"dynamicPropertyPathList\":[{\"key\":\"tableData\"}],\"bottomRow\":34,\"columnWidthMap\":{},\"parentRowSpace\":10,\"mobileRightColumn\":41,\"parentColumnSpace\":30.5625,\"dynamicTriggerPathList\":[],\"borderWidth\":\"1\",\"primaryColumns\":{\"rowIndex\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":1,\"width\":150,\"originalId\":\"rowIndex\",\"id\":\"rowIndex\",\"alias\":\"rowIndex\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"number\",\"textColor\":\"\",\"textSize\":\"0.875rem\",\"fontStyle\":\"\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"rowIndex\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"rowIndex\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\",\"cellBackground\":\"\"},\"Currency\":{\"allowCellWrapping\":false,\"allowSameOptionsInNewRow\":true,\"index\":9,\"width\":150,\"originalId\":\"Currency\",\"id\":\"Currency\",\"alias\":\"Currency\",\"horizontalAlignment\":\"LEFT\",\"verticalAlignment\":\"CENTER\",\"columnType\":\"number\",\"textColor\":\"\",\"textSize\":\"0.875rem\",\"fontStyle\":\"\",\"enableFilter\":true,\"enableSort\":true,\"isVisible\":true,\"isDisabled\":false,\"isCellEditable\":false,\"isEditable\":false,\"isCellVisible\":true,\"isDerived\":false,\"label\":\"Currency\",\"isSaveVisible\":true,\"isDiscardVisible\":true,\"computedValue\":\"{{Table1.processedTableData.map((currentRow, currentIndex) => ( currentRow[\\\"Currency\\\"]))}}\",\"sticky\":\"\",\"validation\":{},\"currencyCode\":\"USD\",\"decimals\":0,\"thousandSeparator\":true,\"notation\":\"standard\",\"cellBackground\":\"\"}},\"key\":\"iwmm57yz9c\",\"canFreezeColumn\":true,\"rightColumn\":41,\"textSize\":\"0.875rem\",\"widgetId\":\"6auq1k5wf7\",\"minWidth\":450,\"tableData\":\"{{Api1.data}}\",\"label\":\"Data\",\"searchKey\":\"\",\"parentId\":\"0\",\"renderMode\":\"CANVAS\",\"mobileTopRow\":34,\"horizontalAlignment\":\"LEFT\",\"isVisibleSearch\":true,\"responsiveBehavior\":\"fill\",\"mobileLeftColumn\":7,\"isVisiblePagination\":true,\"verticalAlignment\":\"CENTER\"}],\"parentId\":\"0\",\"widgetId\":\"6auq1k5wf7\",\"widgetPositionInfo\":null},{\"hierarchy\":4,\"list\":[{\"resetFormOnClick\":false,\"needsErrorInfo\":false,\"boxShadow\":\"none\",\"mobileBottomRow\":79,\"widgetName\":\"Button1\",\"onClick\":\"{{JSObject1.genPDF();}}\",\"buttonColor\":\"{{appsmith.theme.colors.primaryColor}}\",\"topRow\":42,\"bottomRow\":46,\"parentRowSpace\":10,\"type\":\"BUTTON_WIDGET\",\"mobileRightColumn\":38,\"animateLoading\":true,\"parentColumnSpace\":30.5625,\"dynamicTriggerPathList\":[{\"key\":\"onClick\"}],\"leftColumn\":22,\"dynamicBindingPathList\":[{\"key\":\"buttonColor\"},{\"key\":\"borderRadius\"}],\"text\":\"Submit\",\"isDisabled\":false,\"key\":\"dlbj0skcwr\",\"rightColumn\":38,\"isDefaultClickDisabled\":true,\"widgetId\":\"vdsey2khz4\",\"minWidth\":120,\"isVisible\":true,\"recaptchaType\":\"V3\",\"version\":1,\"parentId\":\"0\",\"renderMode\":\"CANVAS\",\"isLoading\":false,\"mobileTopRow\":75,\"responsiveBehavior\":\"hug\",\"disabledWhenInvalid\":false,\"borderRadius\":\"{{appsmith.theme.borderRadius.appBorderRadius}}\",\"mobileLeftColumn\":22,\"buttonVariant\":\"PRIMARY\",\"placement\":\"CENTER\"}],\"parentId\":\"0\",\"widgetId\":\"vdsey2khz4\",\"widgetPositionInfo\":null}],\"flexLayers\":[]}"} \ No newline at end of file diff --git a/app/client/cypress/support/Objects/CommonLocators.ts b/app/client/cypress/support/Objects/CommonLocators.ts index 2200d6eb1815..f46d2733ff11 100644 --- a/app/client/cypress/support/Objects/CommonLocators.ts +++ b/app/client/cypress/support/Objects/CommonLocators.ts @@ -342,4 +342,6 @@ export class CommonLocators { _propertyCollapseBody = ".bp3-collapse-body"; _propertyCollapse = ".bp3-collapse"; _widgetBorder = ".t--draggable-tabswidget div div div"; + _entityItem = "[data-testid='t--entity-item-Api1']"; + _rowData = "[data-colindex='0'][data-rowindex='0']"; } diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index 059bf5413b88..663e087fa786 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -265,7 +265,7 @@ export class DataSources { "')]/ancestor::div[@class='form-config-top']/following-sibling::div//div[contains(@class, 'rc-select-multiple')]"; private _datasourceSchemaRefreshBtn = ".datasourceStructure-refresh"; private _datasourceStructureHeader = ".datasourceStructure-header"; - _datasourceSchemaColumn = ".t--datasource-column"; + _datasourceSchemaColumn = ".t--datasource-column .t--field-name"; _datasourceStructureSearchInput = ".datasourceStructure-search input"; _jsModeSortingControl = ".t--actionConfiguration\\.formData\\.sortBy\\.data"; public _queryEditorCollapsibleIcon = ".collapsible-icon"; @@ -296,7 +296,7 @@ export class DataSources { _imgFireStoreLogo = "//img[contains(@src, 'firestore.svg')]"; _dsVirtuosoElement = `div .t--schema-virtuoso-container`; private _dsVirtuosoList = `[data-test-id="virtuoso-item-list"]`; - private _dsSchemaContainer = `[data-testid="datasource-schema-container"]`; + private _dsSchemaContainer = `[data-testid="t--datasource-schema-container"]`; private _dsVirtuosoElementTable = (targetTableName: string) => `${this._dsSchemaEntityItem}[data-testid='t--entity-item-${targetTableName}']`; private _dsPageTabListItem = (buttonText: string) => @@ -1133,6 +1133,7 @@ export class DataSources { this.assertHelper.AssertNetworkStatus("@saveAction", 200); } + /** @deprecated */ public RunQueryNVerifyResponseViews( expectedRecordsCount = 1, tableCheck = true, @@ -1149,7 +1150,35 @@ export class DataSources { BottomPane.response.getResponseTypeSelector("RAW"), ); } - BottomPane.response.validateRecordCount(expectedRecordsCount); + } + + public runQueryAndVerifyResponseViews({ + count = 1, + operator = "eq", + responseTypes = ["TABLE", "JSON", "RAW"], + }: { + count?: number; + operator?: Parameters< + typeof BottomPane.response.validateRecordCount + >[0]["operator"]; + responseTypes?: ("TABLE" | "JSON" | "RAW")[]; + } = {}) { + this.RunQuery(); + + BottomPane.response.openResponseTypeMenu(); + + responseTypes.forEach((responseType) => { + this.agHelper.AssertElementVisibility( + BottomPane.response.locators.responseTypeMenuItem(responseType), + ); + }); + + BottomPane.response.closeResponseTypeMenu(); + + BottomPane.response.validateRecordCount({ + count, + operator, + }); } public CreateDataSource( diff --git a/app/client/cypress/support/Pages/IDE/BottomPane/Response.ts b/app/client/cypress/support/Pages/IDE/BottomPane/Response.ts index ca1db0fa7ca1..485559535a76 100644 --- a/app/client/cypress/support/Pages/IDE/BottomPane/Response.ts +++ b/app/client/cypress/support/Pages/IDE/BottomPane/Response.ts @@ -1,21 +1,85 @@ +type ComparisonOperator = "eq" | "gt" | "gte" | "lt" | "lte"; + +interface ValidationParams { + count: number; + operator?: ComparisonOperator; +} + class Response { - private ResponseTab = "//button[@data-testid='t--tab-RESPONSE_TAB']"; + public locators = { + responseTab: "[data-testid='t--tab-RESPONSE_TAB']", + responseDataContainer: "[data-testid='t--query-response-data-container']", + responseTypeMenuTrigger: "[data-testid='t--query-response-type-trigger']", + responseRecordCount: "[data-testid='t--query-response-record-count']", + + /** @deprecated */ + responseType(type: string): string { + return `//div[@data-testid='t--response-tab-segmented-control']//span[text()='${type}']`; + }, + + responseTypeMenuItem(type: string) { + return `[data-testid="t--query-response-type-menu-item"][data-value="${type}"]`; + }, + }; + + /** @deprecated: method will be deleted when segmented control in response pane is replaced */ + public getResponseTypeSelector = this.locators.responseType; + + /** @deprecated: method will be deleted when segmented control in response pane is replaced */ + public switchResponseType(type: string): void { + this.switchToResponseTab(); + cy.xpath(this.locators.responseType(type)).click({ force: true }); + } public switchToResponseTab(): void { - cy.xpath(this.ResponseTab).click({ force: true }); + cy.get(this.locators.responseTab).click({ force: true }); } - public getResponseTypeSelector(type: string): string { - return `//div[@data-testid='t--response-tab-segmented-control']//span[text()='${type}']`; + public openResponseTypeMenu() { + cy.get(this.locators.responseDataContainer).realHover(); + cy.get(this.locators.responseTypeMenuTrigger).click({ force: true }); } - public switchResponseType(type: string): void { + public selectResponseResponseTypeFromMenu(type: string): void { this.switchToResponseTab(); - cy.xpath(this.getResponseTypeSelector(type)).click({ force: true }); + this.openResponseTypeMenu(); + cy.get(this.locators.responseTypeMenuItem(type)).realClick(); } - // TODO: Implement this method when response UI is ready - public validateRecordCount(count: number): void {} + public closeResponseTypeMenu() { + cy.get(this.locators.responseTypeMenuTrigger).realClick(); + } + + public validateRecordCount({ + count, + operator = "eq", + }: ValidationParams): void { + cy.get(this.locators.responseRecordCount) + .invoke("text") + .then((text) => { + const extractedCount = parseInt(text.match(/\d+/)?.[0] || "0", 10); + + switch (operator) { + case "eq": + expect(extractedCount).to.equal(count); + break; + case "gt": + expect(extractedCount).to.be.greaterThan(count); + break; + case "gte": + expect(extractedCount).to.be.at.least(count); + break; + case "lt": + expect(extractedCount).to.be.lessThan(count); + break; + case "lte": + expect(extractedCount).to.be.at.most(count); + break; + default: + throw new Error(`Invalid comparison operator: ${operator}`); + } + }); + } } export { Response }; diff --git a/app/client/docker/templates/nginx-app.conf.template b/app/client/docker/templates/nginx-app.conf.template index e23bd86a1640..aa71c4314cfe 100644 --- a/app/client/docker/templates/nginx-app.conf.template +++ b/app/client/docker/templates/nginx-app.conf.template @@ -37,7 +37,6 @@ server { sub_filter __APPSMITH_VERSION_RELEASE_DATE__ '${APPSMITH_VERSION_RELEASE_DATE}'; sub_filter __APPSMITH_INTERCOM_APP_ID__ '${APPSMITH_INTERCOM_APP_ID}'; sub_filter __APPSMITH_MAIL_ENABLED__ '${APPSMITH_MAIL_ENABLED}'; - sub_filter __APPSMITH_CLOUD_SERVICES_BASE_URL__ '${APPSMITH_CLOUD_SERVICES_BASE_URL}'; sub_filter __APPSMITH_RECAPTCHA_SITE_KEY__ '${APPSMITH_RECAPTCHA_SITE_KEY}'; sub_filter __APPSMITH_DISABLE_INTERCOM__ '${APPSMITH_DISABLE_INTERCOM}'; sub_filter __APPSMITH_ZIPY_SDK_KEY__ '${APPSMITH_ZIPY_SDK_KEY}'; diff --git a/app/client/package.json b/app/client/package.json index f0e2adb9c8ba..f56c83dafbaa 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -218,7 +218,6 @@ "showdown": "^1.9.1", "simplebar-react": "^2.4.3", "smartlook-client": "^8.0.0", - "socket.io-client": "^4.5.4", "sql-formatter": "12.2.0", "styled-components": "^5.3.6", "tailwindcss": "^3.3.3", diff --git a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx index b4154a27d2d5..5a5ff05eb1e0 100644 --- a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx +++ b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx @@ -1072,6 +1072,18 @@ const InputCursorMoveIcon = importSvg( async () => import("../__assets__/icons/ads/input-cursor-move.svg"), ); +const ContentTypeTable = importSvg( + async () => import("../__assets__/icons/ads/content-type-table.svg"), +); + +const ContentTypeJson = importSvg( + async () => import("../__assets__/icons/ads/content-type-json.svg"), +); + +const ContentTypeRaw = importSvg( + async () => import("../__assets__/icons/ads/content-type-raw.svg"), +); + import PlayIconPNG from "../__assets__/icons/control/play-icon.png"; function PlayIconPNGWrapper() { @@ -1085,134 +1097,168 @@ function PlayIconPNGWrapper() { } const ICON_LOOKUP = { - "delete-control": DeleteIcon, - "move-control": MoveIcon, - "edit-control": EditIcon, - "view-control": ViewIcon, - "more-vertical-control": MoreVerticalIcon, - "more-horizontal-control": OverflowMenuIcon, - "js-toggle": JsToggleIcon, - "increase-control": IncreaseIcon, - "decrease-control": DecreaseIcon, - "draggable-control": DraggableIcon, - "drag-handle": DragHandleIcon, - "close-control": CloseIcon, - "close-circle-control": CloseCircleIcon, - "add-circle-control": AddCircleIcon, - "pick-my-location-selected-control": PickMyLocationSelectedIcon, - "settings-control": SettingsIcon, - "help-control": HelpIcon, - "play-video": PlayIconPNGWrapper, - "remove-control": RemoveIcon, - "drag-control": DragIcon, - "collapse-control": CollapseIcon, - "sort-control": SortIcon, - "edit-white": EditWhiteIcon, - "launch-control": LaunchIcon, - "back-control": BackIcon, - "show-column": EyeIcon, - "hide-column": EyeOffIcon, - "delete-column": DeleteColumnIcon, - "bold-font": BoldFontIcon, - underline: UnderlineIcon, - "italics-font": ItalicsFontIcon, - "center-align": CenterAlignIcon, - "left-align": LeftAlignIcon, - "right-align": RightAlignIcon, - "vertical-right": VerticalAlignRight, - "vertical-left": VerticalAlignLeft, - "vertical-top": VerticalAlignTop, - "vertical-bottom": VerticalAlignBottom, - "vertical-center": VerticalAlignCenter, - "copy-control": CopyIcon, - "copy2-control": Copy2Icon, - "cut-control": CutIcon, - "group-control": GroupIcon, - bullets: BulletsIcon, - "divider-cap-right": DividerCapRightIcon, - "divider-cap-left": DividerCapLeftIcon, - "divider-cap-all": DividerCapAllIcon, - "bind-data-control": TrendingFlat, - "icon-align-left": AlignLeftIcon, - "icon-align-right": AlignRightIcon, - "border-radius-sharp": BorderRadiusSharpIcon, - "border-radius-rounded": BorderRadiusRoundedIcon, - "border-radius-circle": BorderRadiusCircleIcon, - "box-shadow-none": BoxShadowNoneIcon, - "box-shadow-variant1": BoxShadowVariant1Icon, - "box-shadow-variant2": BoxShadowVariant2Icon, - "box-shadow-variant3": BoxShadowVariant3Icon, - "box-shadow-variant4": BoxShadowVariant4Icon, - "box-shadow-variant5": BoxShadowVariant5Icon, - "increase-control-v2": IncreaseV2Icon, - question: QuestionIcon, - "column-unfreeze": SubtractIcon, - "heading-one": HeadingOneIcon, - "heading-two": HeadingTwoIcon, - "heading-three": HeadingThreeIcon, - "gift-line": GiftLineIcon, - paragraph: ParagraphIcon, - "paragraph-two": ParagraphTwoIcon, + "account-box-line": AccountBoxLineIcon, "add-box-line": AddBoxLineIcon, + "add-circle-control": AddCircleIcon, + "add-line": AddLineIcon, "add-more": AddMoreIcon, "add-more-fill": AddMoreFillIcon, - "alert-line": AlertLineIcon, "alert-fill": AlertFillIcon, - "info-fill": InfoFillIcon, + "alert-line": AlertLineIcon, + "align-center": AlignCenter, + "align-left": AlignLeft, + "align-right": AlignRight, + "apps-line": AppsLineIcon, "arrow-down-s-fill": ArrowDownSFillIcon, + "arrow-down-s-line": ArrowDownSLineIcon, "arrow-forward": ArrowForwardIcon, "arrow-go-back": ArrowGoBackLineIcon, "arrow-left": ArrowLeft, + "arrow-left-line": ArrowLeftLineIcon, + "arrow-left-s-line": ArrowLeftSLineIcon, + "arrow-right-line": ArrowRightLineIcon, "arrow-right-s-fill": ArrowRightSFillIcon, + "arrow-right-s-line": ArrowRightSLineIcon, "arrow-right-up-line": ArrowRightUpLineIcon, "arrow-up-line": ArrowUpLineIcon, + "arrow-up-s-line": ArrowUpSLineIcon, + "back-control": BackIcon, + "bill-line": BillLineIcon, + "bind-data-control": TrendingFlat, + "binding-new": BindingIcon, + "bold-font": BoldFontIcon, "book-line": BookLineIcon, + "border-radius-circle": BorderRadiusCircleIcon, + "border-radius-rounded": BorderRadiusRoundedIcon, + "border-radius-sharp": BorderRadiusSharpIcon, + "box-3-line": Box3LineIcon, + "box-shadow-none": BoxShadowNoneIcon, + "box-shadow-variant1": BoxShadowVariant1Icon, + "box-shadow-variant2": BoxShadowVariant2Icon, + "box-shadow-variant3": BoxShadowVariant3Icon, + "box-shadow-variant4": BoxShadowVariant4Icon, + "box-shadow-variant5": BoxShadowVariant5Icon, + "braces-line": BracesLineIcon, "bug-line": BugLineIcon, "cap-dot": CapDotIcon, "cap-solid": CapSolidIcon, "card-context-menu": CardContextMenu, + "center-align": CenterAlignIcon, "chat-help": ChatIcon, + "chat-upload-line": ChatUploadLineIcon, "check-line": CheckLineIcon, "chevron-left": ChevronLeft, "chevron-right": ChevronRight, "close-circle": CloseCircleIcon, + "close-circle-control": CloseCircleIcon, + "close-circle-line": CloseCircleLineIcon, + "close-control": CloseIcon, + "close-line": CloseIcon, "close-modal": CloseLineIcon, "close-x": CloseLineIcon, "cloud-off-line": CloudOfflineIcon, + "collapse-control": CollapseIcon, + "column-freeze": ColumnFreeze, + "column-unfreeze": SubtractIcon, "comment-context-menu": CommentContextMenu, "compasses-line": CompassesLine, + "content-type-table": ContentTypeTable, + "content-type-json": ContentTypeJson, + "content-type-raw": ContentTypeRaw, "context-menu": ContextMenuIcon, + "contract-left-line": ContractLeft, + "contract-right-line": ContractRight, + "copy-control": CopyIcon, + "copy2-control": Copy2Icon, + "cut-control": CutIcon, + "dashboard-line": DashboardLineIcon, "database-2-line": Database2Line, + "datasource-v3": DatasourceV3Icon, + "datasources-2": Datasources2, + "decrease-control": DecreaseIcon, + "delete-bin-line": DeleteBinLineIcon, "delete-blank": DeleteBin7, + "delete-column": DeleteColumnIcon, + "delete-control": DeleteIcon, "delete-row": DeleteRowIcon, - "double-arrow-right": DoubleArrowRightIcon, + "divider-cap-all": DividerCapAllIcon, + "divider-cap-left": DividerCapLeftIcon, + "divider-cap-right": DividerCapRightIcon, "double-arrow-left": DoubleArrowLeftIcon, + "double-arrow-right": DoubleArrowRightIcon, "down-arrow": DownArrowIcon, "down-arrow-2": ArrowDownLineIcon, "download-line": DownloadLineIcon, + "drag-control": DragIcon, + "drag-handle": DragHandleIcon, + "draggable-control": DraggableIcon, + "edit-2-line": Edit2LineIcon, "edit-box-line": EditBoxLineIcon, + "edit-control": EditIcon, "edit-line": EditLineIcon, - "edit-2-line": Edit2LineIcon, "edit-underline": EditUnderlineIcon, + "edit-white": EditWhiteIcon, + "editor-v3": EditorV3Icon, + "enter-line": CornerDownLeftLineIcon, "expand-less": ExpandLess, "expand-more": ExpandMore, + "external-link-line": ExternalLinkIcon, "eye-off": EyeOff, "eye-on": EyeOn, + "file-add-line": FileAddLineIcon, + "file-copy-2-line": FileCopy2Line, "file-line": FileLine, "file-list-2-line": FileList2LineIcon, "file-list-line": FileListLineIcon, + "file-paper-2-line": FilePaper2LineIcon, "file-transfer": FileTransfer, - "fork-2": Fork2Icon, + "folder-download-line": FolderDownloadLineIcon, + "folder-line": FolderLineIcon, + "folder-reduce-line": FolderReduceLineIcon, "forbid-line": ForbidLineIcon, + "fork-2": Fork2Icon, + "gift-line": GiftLineIcon, "git-branch": GitBranchLineIcon, "git-commit": GitCommit, "git-pull-request": GitPullRequest, "git-repository": GitRepository, + "github-fill": GithubFillIcon, "global-line": GlobalLineIcon, + "google-colored": GoogleColoredIcon, + "google-fill": GoogleFillIcon, "group-2-line": Group2LineIcon, + "group-control": GroupIcon, "group-line": GroupLineIcon, + "h-line": HLineIcon, + "heading-one": HeadingOneIcon, + "heading-three": HeadingThreeIcon, + "heading-two": HeadingTwoIcon, + "help-control": HelpIcon, + "hide-column": EyeOffIcon, + "home-3-line": Home3LineIcon, + "icon-align-left": AlignLeftIcon, + "icon-align-right": AlignRightIcon, + "increase-control": IncreaseIcon, + "increase-control-v2": IncreaseV2Icon, + "info-fill": InfoFillIcon, + "input-cursor-move": InputCursorMoveIcon, "invite-user": InviteUserIcon, + "italics-font": ItalicsFontIcon, + "js-file": JSFile, + "js-function": JSFunction, + "js-icon-v2": JSIconV2, + "js-square-v3": JsSquareV3Icon, + "js-toggle": JsToggleIcon, + "js-toggle-v2": JsToggleV2, + "js-toggle-v2-bold": JsToggleV2Bold, + "js-yellow": JSYellowIcon, "key-2-line": Key2LineIcon, + "launch-control": LaunchIcon, + "layout-2-line": Layout2LineIcon, + "layout-5-line": Layout5LineIcon, + "layout-column-line": LayoutColumnLineIcon, + "layout-left-2-line": LayoutLeft2LineIcon, + "left-align": LeftAlignIcon, "left-arrow-2": LeftArrowIcon2, "lightbulb-flash-line": LightbulbFlashLine, "line-dashed": LineDashedIcon, @@ -1220,45 +1266,88 @@ const ICON_LOOKUP = { "link-2": Link2, "link-unlink": LinkUnlinkIcon, "links-line": LinksLineIcon, - "external-link-line": ExternalLinkIcon, + "loader-line": LoaderLineIcon, "lock-2-line": Lock2LineIcon, + "lock-fill": LockFillIcon, "lock-password-line": LockPasswordLineIcon, "lock-unlock-line": LockUnlockLineIcon, - "lock-fill": LockFillIcon, "magic-line": MagicLineIcon, "mail-check-line": MailCheckLineIcon, "mail-line": MailLineIcon, + "map-2-line": Map2LineIcon, "map-pin-2-line": MapPin2LineIcon, + "map-pin-5-line": MapPin5LineIcon, + "map-pin-user-line": MapPinUserLineIcon, + "maximize-v3": MaximizeV3Icon, + "menu-fold": MenuFoldLineIcon, + "menu-unfold": MenuUnfoldLineIcon, + "message-2-line": Message2LineIcon, + "minimize-v3": MinimizeV3Icon, + "money-dollar-circle-line": MoneyDollarCircleLineIcon, "more-2-fill": More2FillIcon, + "more-horizontal-control": OverflowMenuIcon, + "more-vertical-control": MoreVerticalIcon, + "move-control": MoveIcon, "news-paper": NewsPaperLine, + "no-action": ForbidTwoLineIcon, "no-response": NoResponseIcon, "oval-check": OvalCheck, "oval-check-fill": OvalCheckFill, + "packages-v3": PackagesV3Icon, + "page-line": PagesLineIcon, + "paragraph-two": ParagraphTwoIcon, "pencil-fill-icon": PencilFillIcon, + "pencil-line": PencilLineIcon, + "pick-my-location-selected-control": PickMyLocationSelectedIcon, "pin-3": Pin3, "play-circle-line": PlayCircleLineIcon, + "play-line": PlayLineIcon, + "play-video": PlayIconPNGWrapper, + "queries-line": QueriesLineIcon, + "queries-v3": QueriesV3Icon, + "query-main": QueryMain, "question-fill": QuestionFillIcon, "question-line": QuestionLineIcon, "question-mark": QuestionMarkIcon, "reaction-2": Reaction2, "read-pin": ReadPin, + "remove-control": RemoveIcon, + "restart-line": RestartLineIcon, + "right-align": RightAlignIcon, "right-arrow": RightArrowIcon, "right-arrow-2": RightArrowIcon2, "search-eye-line": SearchEyeLineIcon, + "search-line": SearchLineIcon, "send-button": SendButton, + "server-line": ServerLineIcon, "settings-2-line": Settings2LineIcon, + "settings-control": SettingsIcon, "settings-line": SettingsLineIcon, + "settings-v3": SettingsV3Icon, "share-2": ShareIcon2, "share-box": ShareBoxFillIcon, "share-box-line": ShareBoxLineIcon, "share-line": ShareLineIcon, + "show-column": EyeIcon, + "show-modal": ShowModalIcon, + "sip-line": SipLineIcon, + "skip-left-line": SkipLeftLineIcon, + "skip-right-line": SkipRightLineIcon, "sort-asc": SortAscIcon, + "sort-control": SortIcon, "sort-desc": SortDescIcon, "star-fill": StarFillIcon, "star-line": StarLineIcon, "subtract-line": SubtractLine, "swap-horizontal": ArrowLeftRightIcon, + "text-bold": BoldIcon, + "text-italic": ItalicIcon, + "text-underline": UnderLineIcon, + "thumb-down-line": ThumbDownLineIcon, + "thumb-up-line": ThumbUpLineIcon, "timer-2-line": Timer2LineIcon, + "timer-flash-line": TimerFlashLineIcon, + "timer-line": TimerLineIcon, "trash-outline": TrashOutline, "trending-flat": TrendingFlat, "unread-pin": UnreadPin, @@ -1274,104 +1363,27 @@ const ICON_LOOKUP = { "user-settings-line": UserSettingsLineIcon, "user-shared-line": UserSharedLineIcon, "user-unfollow-line": UserUnfollowLineIcon, - "view-all": RightArrowIcon, - "view-less": LeftArrowIcon, - "warning-line": WarningLineIcon, - "warning-triangle": WarningTriangleIcon, - "money-dollar-circle-line": MoneyDollarCircleLineIcon, - "js-toggle-v2": JsToggleV2, - "js-toggle-v2-bold": JsToggleV2Bold, - "query-main": QueryMain, - "js-icon-v2": JSIconV2, - "js-file": JSFile, - "js-function": JSFunction, - "datasources-2": Datasources2, - "arrow-left-line": ArrowLeftLineIcon, - "arrow-right-line": ArrowRightLineIcon, - "close-line": CloseIcon, - "close-circle-line": CloseCircleLineIcon, - "arrow-left-s-line": ArrowLeftSLineIcon, - "arrow-right-s-line": ArrowRightSLineIcon, - "arrow-up-s-line": ArrowUpSLineIcon, - "arrow-down-s-line": ArrowDownSLineIcon, - "account-box-line": AccountBoxLineIcon, - "add-line": AddLineIcon, - "search-line": SearchLineIcon, - "loader-line": LoaderLineIcon, - "delete-bin-line": DeleteBinLineIcon, - "align-center": AlignCenter, - "align-left": AlignLeft, - "align-right": AlignRight, - "column-freeze": ColumnFreeze, "vertical-align-bottom": VerticalBottom, "vertical-align-middle": VerticalMiddle, "vertical-align-top": VerticalTop, - "skip-right-line": SkipRightLineIcon, - "skip-left-line": SkipLeftLineIcon, - "contract-left-line": ContractLeft, - "contract-right-line": ContractRight, + "vertical-bottom": VerticalAlignBottom, + "vertical-center": VerticalAlignCenter, + "vertical-left": VerticalAlignLeft, + "vertical-right": VerticalAlignRight, + "vertical-top": VerticalAlignTop, + "view-all": RightArrowIcon, + "view-control": ViewIcon, + "view-less": LeftArrowIcon, "w-line": WLineIcon, - "h-line": HLineIcon, - "file-add-line": FileAddLineIcon, - "layout-2-line": Layout2LineIcon, - "page-line": PagesLineIcon, - "pencil-line": PencilLineIcon, - "server-line": ServerLineIcon, - "layout-column-line": LayoutColumnLineIcon, - "layout-left-2-line": LayoutLeft2LineIcon, - "text-bold": BoldIcon, - "text-italic": ItalicIcon, - "text-underline": UnderLineIcon, - "sip-line": SipLineIcon, - "no-action": ForbidTwoLineIcon, - "message-2-line": Message2LineIcon, - "folder-download-line": FolderDownloadLineIcon, - "restart-line": RestartLineIcon, - "folder-reduce-line": FolderReduceLineIcon, - "timer-flash-line": TimerFlashLineIcon, - "timer-line": TimerLineIcon, - "map-2-line": Map2LineIcon, - "map-pin-user-line": MapPinUserLineIcon, - "map-pin-5-line": MapPin5LineIcon, - "chat-upload-line": ChatUploadLineIcon, - "home-3-line": Home3LineIcon, - "show-modal": ShowModalIcon, - "folder-line": FolderLineIcon, - "google-colored": GoogleColoredIcon, - "google-fill": GoogleFillIcon, - "github-fill": GithubFillIcon, - "enter-line": CornerDownLeftLineIcon, - "play-line": PlayLineIcon, - "thumb-up-line": ThumbUpLineIcon, - "thumb-down-line": ThumbDownLineIcon, - "menu-fold": MenuFoldLineIcon, - "menu-unfold": MenuUnfoldLineIcon, - "layout-5-line": Layout5LineIcon, - "js-yellow": JSYellowIcon, - "binding-new": BindingIcon, - "bill-line": BillLineIcon, - "file-paper-2-line": FilePaper2LineIcon, - "file-copy-2-line": FileCopy2Line, - "box-3-line": Box3LineIcon, - "apps-line": AppsLineIcon, - "queries-line": QueriesLineIcon, - "braces-line": BracesLineIcon, - "dashboard-line": DashboardLineIcon, - "js-square-v3": JsSquareV3Icon, - "queries-v3": QueriesV3Icon, + "warning-line": WarningLineIcon, + "warning-triangle": WarningTriangleIcon, "widgets-v3": WidgetsV3Icon, - "datasource-v3": DatasourceV3Icon, - "editor-v3": EditorV3Icon, - "settings-v3": SettingsV3Icon, - "packages-v3": PackagesV3Icon, - "minimize-v3": MinimizeV3Icon, - "maximize-v3": MaximizeV3Icon, "workflows-mono": WorkflowsMonochromeIcon, - "input-cursor-move": InputCursorMoveIcon, billing: BillingIcon, binding: Binding, book: BookIcon, bug: BugIcon, + bullets: BulletsIcon, cancel: CancelIcon, chat: Chat, close: CloseIcon, @@ -1402,9 +1414,9 @@ const ICON_LOOKUP = { general: GeneralIcon, grid: GridLineIcon, guide: GuideIcon, - history: HistoryLineIcon, hamburger: HamburgerIcon, help: HelpIcon, + history: HistoryLineIcon, info: InfoIcon, js: JsIcon, key: KeyIcon, @@ -1418,14 +1430,17 @@ const ICON_LOOKUP = { member: UserHeartLineIcon, minimize: MinimizeIcon, minus: RemoveIcon, - module: ModuleIcon, mobile: MobileIcon, + module: ModuleIcon, open: OpenIcon, + package: PackageIcon, pantone: PantoneLineIcon, + paragraph: ParagraphIcon, pin: Pin, play: PlayIcon, plus: CreateNewIcon, query: QueryIcon, + question: QuestionIcon, reaction: Reaction, refresh: RefreshLineIcon, rocket: RocketIcon, @@ -1433,8 +1448,9 @@ const ICON_LOOKUP = { search: SearchIcon, setting: SettingIcon, share: ShareForwardIcon, - shine: ShineIcon, shield: Shield, + shine: ShineIcon, + slash: SlashIcon, snippet: Snippet, success: SuccessIcon, support: SupportIcon, @@ -1442,6 +1458,7 @@ const ICON_LOOKUP = { tablet: TabletIcon, tabletLandscape: TabletLandscapeIcon, trash: Trash, + underline: UnderlineIcon, unpin: Unpin, upArrow: UpArrow, upgrade: DvdLineIcon, @@ -1452,8 +1469,6 @@ const ICON_LOOKUP = { widget: WidgetIcon, workflows: WorkflowsIcon, workspace: WorkspaceIcon, - package: PackageIcon, - slash: SlashIcon, }; export const IconCollection = Object.keys(ICON_LOOKUP); diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/ListWithHeader.tsx b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/ListWithHeader.tsx new file mode 100644 index 000000000000..2f7f3041c58e --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/ListWithHeader.tsx @@ -0,0 +1,38 @@ +import React from "react"; +import { ListHeaderContainer } from "./styles"; +import { Text } from "../../Text"; +import { Flex } from "../../Flex"; + +interface Props { + headerText: string; + headerControls?: React.ReactNode; + maxHeight?: string; + headerClassName?: string; + children: React.ReactNode | React.ReactNode[]; +} + +export const ListWithHeader = (props: Props) => { + return ( + + + {props.headerText} + {props.headerControls} + + + {props.children} + + + ); +}; diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/index.ts b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/index.ts new file mode 100644 index 000000000000..cd175bbdf5e3 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/index.ts @@ -0,0 +1,2 @@ +export { ListItemContainer, ListHeaderContainer } from "./styles"; +export { ListWithHeader } from "./ListWithHeader"; diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/styles.ts b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/styles.ts new file mode 100644 index 000000000000..96172a7dc55b --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/styles.ts @@ -0,0 +1,23 @@ +import styled from "styled-components"; + +export const ListItemContainer = styled.div` + width: 100%; + + & .t--entity-item { + grid-template-columns: 0 auto 1fr auto auto auto auto auto; + height: 32px; + } +`; + +export const ListHeaderContainer = styled.div` + padding: var(--ads-v2-spaces-3); + padding-right: var(--ads-v2-spaces-2); + display: flex; + justify-content: space-between; + align-items: center; + height: 40px; + + span { + line-height: 20px; + } +`; diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/HeaderSwitcher.styles.ts b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/HeaderSwitcher.styles.ts new file mode 100644 index 000000000000..06309d2d20cf --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/HeaderSwitcher.styles.ts @@ -0,0 +1,20 @@ +import styled from "styled-components"; +import { PopoverContent } from "../../../Popover"; + +export const SwitchTrigger = styled.div<{ active: boolean }>` + display: flex; + border-radius: var(--ads-v2-border-radius); + background-color: ${(props) => + props.active ? `var(--ads-v2-color-bg-subtle)` : "unset"}; + cursor: pointer; + padding: var(--ads-v2-spaces-2); + + :hover { + background-color: var(--ads-v2-color-bg-subtle); + } +`; + +export const ContentContainer = styled(PopoverContent)` + padding: 0; + padding-bottom: 0.25em; +`; diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/IDEHeaderSwitcher.tsx b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/IDEHeaderSwitcher.tsx new file mode 100644 index 000000000000..22928a5f4994 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/IDEHeaderSwitcher.tsx @@ -0,0 +1,88 @@ +import React, { type ForwardedRef, useCallback } from "react"; +import { Flex } from "../../../Flex"; +import { Icon } from "../../../Icon"; +import { Popover, PopoverTrigger } from "../../../Popover"; +import { Text } from "../../../Text"; +import * as Styled from "./HeaderSwitcher.styles"; + +interface Props { + prefix: string; + title?: string; + titleTestId: string; + active: boolean; + setActive: (active: boolean) => void; + onClick?: React.MouseEventHandler; + className?: string; + children: React.ReactNode; +} + +export const IDEHeaderSwitcher = React.forwardRef( + (props: Props, ref: ForwardedRef) => { + const { + active, + children, + className, + onClick, + prefix, + setActive, + title, + titleTestId, + ...rest + } = props; + + const separator = title ? " /" : ""; + + const closeSwitcher = useCallback(() => { + return setActive(false); + }, [setActive]); + + return ( + + + + + {prefix + separator} + + + + {title} + + + + + + + {children} + + + ); + }, +); + +IDEHeaderSwitcher.displayName = "IDEHeaderSwitcher"; diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/index.ts b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/index.ts new file mode 100644 index 000000000000..1580b3834c63 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/HeaderSwitcher/index.ts @@ -0,0 +1 @@ +export { IDEHeaderSwitcher } from "./IDEHeaderSwitcher"; diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.constants.ts b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.constants.ts new file mode 100644 index 000000000000..6307b9c5b692 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.constants.ts @@ -0,0 +1,2 @@ +export const IDE_HEADER_HEIGHT = 40; +export const LOGO_WIDTH = 50; diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.mdx b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.mdx new file mode 100644 index 000000000000..37c3900615a3 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.mdx @@ -0,0 +1,28 @@ +import { Canvas, Meta } from "@storybook/blocks"; +import * as IDEHeaderStories from "./IDEHeader.stories"; + + + +# IDEHeader + +IDEHeader sets the stage for the IDE experience. It is the topmost section of the IDE that contains the Appsmith logo, the app name, and the user profile. + + + +## Anatomy + +### Left Section options + +The local title + +#### Header Title + +A title that is specific to the app state. It is displayed on the left side of the header. + + + +#### Header Dropdown + +A dropdown that allows the user to switch between different pages. + + diff --git a/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.stories.tsx b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.stories.tsx new file mode 100644 index 000000000000..6c709080dd52 --- /dev/null +++ b/app/client/packages/design-system/ads/src/Templates/IDEHeader/IDEHeader.stories.tsx @@ -0,0 +1,109 @@ +import React from "react"; +import type { Meta } from "@storybook/react"; +import { IDEHeader } from "./IDEHeader"; +import { IDEHeaderTitle } from "./IDEHeaderTitle"; +import { IDEHeaderSwitcher } from "./HeaderSwitcher"; +import { noop } from "lodash"; +import { Icon } from "../../Icon"; +import { Button } from "../../Button"; +import { List } from "../../List"; +import { Flex } from "../../Flex"; +import { Text } from "../../Text"; +import { ListHeaderContainer } from "../EntityExplorer/styles"; + +const meta: Meta = { + title: "ADS/Templates/IDEHeader", + component: IDEHeader, + parameters: { + layout: "fullscreen", + }, + decorators: [ + (Story: () => React.ReactNode) => ( +
{Story()}
+ ), + ], +}; + +export default meta; + +export const Default = () => ( + + }> + Left Content + + + Center Content + + + Right Content + + +); + +export const WithHeaderTitle = () => { + return ( + + }> + + + +
+ + +
+ + + ); +}; + +export const WithHeaderDropdown = () => { + const [open, setOpen] = React.useState(false); + + return ( + + }> + + + + Pages +