From 089c9828b9f269e093ceac8679ba07d536684068 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 25 Jul 2024 11:42:10 -0700 Subject: [PATCH 1/8] Return mock values in the correct format --- src/DataProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataProvider.js b/src/DataProvider.js index dfbefe9b7..38c09ac2c 100644 --- a/src/DataProvider.js +++ b/src/DataProvider.js @@ -199,7 +199,7 @@ export default { !window.ProcessMaker.screen.cacheEnabled && !window.ProcessMaker.screen.cacheTimeout ) { - return this.postDataSource(dataSourceId, null, params); + return this.postDataSource(dataSourceId, null, params).then(r => [r, nonce]); } let url = `/requests/data_sources/${dataSourceId}/resources/${params.config.endpoint}/data`; url += this.authQueryString(); From 3cb692e7bf3f9766200b1c33095fcfa9d90d9994 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 25 Jul 2024 14:45:01 -0700 Subject: [PATCH 2/8] Data source options are no longer loaded on preview page --- tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js b/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js index 2bd2a7098..c2f6d0ddb 100644 --- a/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js +++ b/tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js @@ -343,11 +343,6 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { it("Test performance of RAOS 1.0.0 People Screen render complete and start to get data sources", () => { cy.loadFromJson("RAOS_1.0.0_-_People_2.json", 7); - // Wait screen configuration to load - cy.wait("@DataSourceOne"); - cy.wait("@DataSourceTwo"); - cy.wait("@DataSourceTwo"); - // set initial data to test the screen cy.setPreviewDataInput(initialData); @@ -384,11 +379,6 @@ describe("FOUR-6721 RAOS 1.0.0 Screens", () => { it("Test performance of RAOS 1.0.0 People Screen render complete and wait for all data sources to load", () => { cy.loadFromJson("RAOS_1.0.0_-_People_2.json", 7); - // Wait screen configuration to load - cy.wait("@DataSourceOne"); - cy.wait("@DataSourceTwo"); - cy.wait("@DataSourceTwo"); - // set initial data to test the screen cy.setPreviewDataInput(initialData); From 4d44d143b657f903ce646a7d51e72a60c51a3cc3 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 25 Jul 2024 16:56:09 -0700 Subject: [PATCH 3/8] Remove additional data source preview calls --- tests/e2e/specs/ComputedFieldsReadOnly.spec.js | 2 +- tests/e2e/specs/LoopSelectList.spec.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js index 66306853f..1d3219bd7 100644 --- a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js +++ b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js @@ -177,7 +177,7 @@ describe("Computed fields", () => { }); }); - it.only("The user should not be able to change a FormDatePicker assigned to a computed property", () => { + it("The user should not be able to change a FormDatePicker assigned to a computed property", () => { cy.visit("/"); cy.openAcordeon("collapse-1"); // Add an input field diff --git a/tests/e2e/specs/LoopSelectList.spec.js b/tests/e2e/specs/LoopSelectList.spec.js index e5d13df8e..2208395a4 100644 --- a/tests/e2e/specs/LoopSelectList.spec.js +++ b/tests/e2e/specs/LoopSelectList.spec.js @@ -85,14 +85,13 @@ describe("Select List Cache", () => { }); cy.loadFromJson("loop_select_list.json", 0); - cy.wait("@getDataSource"); // designer call cy.get("[data-cy=mode-preview]").click(); cy.wait("@getDataSource"); cy.wait("@getDataSource"); cy.wait("@getDataSource"); cy.wait("@getDataSource"); cy.wait("@getDataSource"); - cy.get("@getDataSource.all").should("have.length", 6); + cy.get("@getDataSource.all").should("have.length", 5); }); it("Cached - Verify number of service calls for loop that contains a multiselect list", () => { @@ -105,15 +104,14 @@ describe("Select List Cache", () => { }); cy.loadFromJson("loop_select_list.json", 0); - cy.wait("@getDataSource"); // get data source from designer cy.wait(5000); cy.get("[data-cy=mode-preview]").click(); cy.wait("@getDataSource"); - cy.get("@getDataSource.all").should("have.length", 2); + cy.get("@getDataSource.all").should("have.length", 1); // testing cacheTimeout cy.wait(5000); cy.get("[data-cy=mode-preview]").click(); cy.wait("@getDataSource"); - cy.get("@getDataSource.all").should("have.length", 3); + cy.get("@getDataSource.all").should("have.length", 2); }); }); From a959139a1c3a3313523cc8df78fb9951d6d96aca Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Jul 2024 10:27:51 -0700 Subject: [PATCH 4/8] Fix failing tests --- src/main.js | 11 +++++++++++ tests/e2e/fixtures/select_list_dependent.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 5766119d0..3d800b98c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,17 @@ Vue.component("Required", { template: '
* = Required
' }); +// Mock PmqlInput for test/standalone +Vue.component("PmqlInput", { + props: { + value: { + type: String, + default: "" + } + }, + template: '
PMQL: {{ value }}
' +}); + const store = new Vuex.Store({ modules: { globalErrorsModule, diff --git a/tests/e2e/fixtures/select_list_dependent.json b/tests/e2e/fixtures/select_list_dependent.json index 4fc8ebf4e..7640d1a8c 100644 --- a/tests/e2e/fixtures/select_list_dependent.json +++ b/tests/e2e/fixtures/select_list_dependent.json @@ -298,7 +298,7 @@ "jsonData": null, "renderAs": "dropdown", "editIndex": null, - "pmqlQuery": "data.country_id={{data.country}}", + "pmqlQuery": "data.country_id={{country}}", "dataSource": "dataConnector", "optionsList": [], "removeIndex": null, @@ -576,7 +576,7 @@ "jsonData": null, "renderAs": "dropdown", "editIndex": null, - "pmqlQuery": "data.city_id={{data.city}}", + "pmqlQuery": "data.city_id={{city}}", "dataSource": "dataConnector", "optionsList": [], "removeIndex": null, From c65ebcc502722c30192b0efc8a07ffa510a6b5bb Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Jul 2024 11:24:29 -0700 Subject: [PATCH 5/8] Fix tests --- tests/e2e/specs/ComputedFieldsReadOnly.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js index 1d3219bd7..72821ed72 100644 --- a/tests/e2e/specs/ComputedFieldsReadOnly.spec.js +++ b/tests/e2e/specs/ComputedFieldsReadOnly.spec.js @@ -3,6 +3,7 @@ import { waitUntilElementIsVisible } from "../support/utils"; describe("Computed fields", () => { it("The user should not be able to change a FormInput assigned to a computed property", () => { cy.visit("/"); + cy.openAcordeon("collapse-1"); // Add an input field cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { position: "bottom" @@ -143,6 +144,7 @@ describe("Computed fields", () => { it("The user should not be able to change a FormTextArea assigned to a computed property", () => { cy.visit("/"); + cy.openAcordeon("collapse-1"); // Add an input field cy.get("[data-cy=controls-FormTextArea]").drag( "[data-cy=screen-drop-zone]", @@ -218,6 +220,7 @@ describe("Computed fields", () => { it("The user should not be able to change a FormSelectList assigned to a computed property", () => { cy.visit("/"); + cy.openAcordeon("collapse-1"); // Add an input field cy.get("[data-cy=controls-FormSelectList]").drag( "[data-cy=screen-drop-zone]", @@ -272,6 +275,7 @@ describe("Computed fields", () => { it("The user should not be able to change an input assigned to a sub property of a computed property", () => { cy.visit("/"); + cy.openAcordeon("collapse-1"); // Add an input field cy.get("[data-cy=controls-FormInput]").drag("[data-cy=screen-drop-zone]", { From 5033c8b8df49ef29a5e23a6141cca2248ae7d1ea Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Jul 2024 14:28:24 -0700 Subject: [PATCH 6/8] Update ci.yml Update ci.yml Update ci.yml Update ci.yml --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68654bf18..57848d757 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,21 @@ jobs: steps: - name: Checkout 🛎 - uses: actions/checkout@master + uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex-match + with: + text: ${{ github.event.pull_request.body }} + regex: 'ci:vue-form-elements:(.*?)[\s\n\r]' + flags: 's' + + - name: debug + run: echo got '${{ steps.regex-match.outputs.group1 }}' + + - name: Checkout 🛎 + run: git clone --depth 1 -b ${{ steps.regex-match.outputs.group1 }} https://github.com/ProcessMaker/vue-form-elements + if: ${{ steps.regex-match.outputs.match != null }} - name: Setup node env 🏗 uses: actions/setup-node@master @@ -22,10 +36,19 @@ jobs: node-version: 20 check-latest: true cache: 'npm' + + - name: Install vue-form-elements dependencies + if: ${{ steps.regex-match.outputs.match != null }} + working-directory: vue-form-elements + run: npm ci && npm run build-bundle - name: Install dependencies 👨🏻‍💻 run: npm ci + - name: Link vue-form-elements + if: ${{ steps.regex-match.outputs.match != null }} + run: npm link ./vue-form-elements + # - name: Run linter 👀 # run: npm run lint From 32aeb51041415adbdeae5464df1045e0255cb76a Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 30 Jul 2024 17:51:10 -0700 Subject: [PATCH 7/8] Update ci.yml --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57848d757..463498d72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,23 +13,34 @@ jobs: containers: [0, 1, 2, 3, 4] steps: - - name: Checkout 🛎 + - name: Checkout screen builder uses: actions/checkout@v4 - uses: actions-ecosystem/action-regex-match@v2 - id: regex-match + id: install-vfe with: text: ${{ github.event.pull_request.body }} - regex: 'ci:vue-form-elements:(.*?)[\s\n\r]' - flags: 's' - - - name: debug - run: echo got '${{ steps.regex-match.outputs.group1 }}' + regex: 'ci:vue-form-elements:([^\s]+)' + + - name: set-vfe-branch + run: | + export VFE_BRANCH='' + if [[ ${{ contains(github.event.pull_request.body, 'ci:next') }} ]]; then + export VFE_BRANCH=next + fi + if [[ ${{ steps.install-vfe.outputs.match != '' }} ]]; then + export VFE_BRANCH=${{ steps.install-vfe.outputs.group1 }} + fi + echo "VFE_BRANCH=${VFE_BRANCH}" >> $GITHUB_ENV + + - name: Checkout vue-form-elements + if: ${{ env.VFE_BRANCH != '' }} + uses: actions/checkout@v4 + with: + repository: ProcessMaker/vue-form-elements + path: vue-form-elements + ref: ${{ env.VFE_BRANCH }} - - name: Checkout 🛎 - run: git clone --depth 1 -b ${{ steps.regex-match.outputs.group1 }} https://github.com/ProcessMaker/vue-form-elements - if: ${{ steps.regex-match.outputs.match != null }} - - name: Setup node env 🏗 uses: actions/setup-node@master with: @@ -38,7 +49,7 @@ jobs: cache: 'npm' - name: Install vue-form-elements dependencies - if: ${{ steps.regex-match.outputs.match != null }} + if: ${{ env.VFE_BRANCH != '' }} working-directory: vue-form-elements run: npm ci && npm run build-bundle @@ -46,7 +57,7 @@ jobs: run: npm ci - name: Link vue-form-elements - if: ${{ steps.regex-match.outputs.match != null }} + if: ${{ env.VFE_BRANCH != '' }} run: npm link ./vue-form-elements # - name: Run linter 👀 From 8b320ccea7e460c5d824816cc876c1c40cb3d4b1 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Thu, 1 Aug 2024 10:34:01 -0400 Subject: [PATCH 8/8] fix: add activity completed event check on process update --- src/components/task.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/task.vue b/src/components/task.vue index 507ae99ab..6c67e675b 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -688,7 +688,7 @@ export default { }, processUpdated: _.debounce(function(data) { if ( - data.event === "ACTIVITY_ACTIVATED" + ['ACTIVITY_ACTIVATED', 'ACTIVITY_COMPLETED'].includes(data.event) && data.elementType === 'task' ) { if (!this.task.elementDestination?.type) {