Skip to content

Commit

Permalink
Merge branch 'next' into bugfix/FOUR-17472
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancooley authored Aug 9, 2024
2 parents 8581384 + 5c2c9d2 commit 67c54d0
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 22 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,53 @@ jobs:
containers: [0, 1, 2, 3, 4]

steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Checkout screen builder
uses: actions/checkout@v4

- uses: actions-ecosystem/action-regex-match@v2
id: install-vfe
with:
text: ${{ github.event.pull_request.body }}
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: Setup node env 🏗
uses: actions/setup-node@master
with:
node-version: 20
check-latest: true
cache: 'npm'

- name: Install vue-form-elements dependencies
if: ${{ env.VFE_BRANCH != '' }}
working-directory: vue-form-elements
run: npm ci && npm run build-bundle

- name: Install dependencies 👨🏻‍💻
run: npm ci

- name: Link vue-form-elements
if: ${{ env.VFE_BRANCH != '' }}
run: npm link ./vue-form-elements

# - name: Run linter 👀
# run: npm run lint

Expand Down
2 changes: 1 addition & 1 deletion src/DataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ export default {
this.task.interstitial_screen['_interstitial'] = true;
this.screen = this.task.interstitial_screen;
}
if (this.task.bpmn_tag_name === 'manualTask') {
this.checkTaskStatus();
this.reload();
}
},
onUpdate(data) {
this.$emit('input', data);
Expand Down Expand Up @@ -688,7 +692,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) {
Expand Down
11 changes: 11 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ Vue.component("Required", {
template: '<div class="text-right"><small>* = Required</small></div>'
});

// Mock PmqlInput for test/standalone
Vue.component("PmqlInput", {
props: {
value: {
type: String,
default: ""
}
},
template: '<div>PMQL: {{ value }}</div>'
});

const store = new Vuex.Store({
modules: {
globalErrorsModule,
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/fixtures/select_list_dependent.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/specs/ComputedFieldsReadOnly.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]",
Expand Down Expand Up @@ -177,7 +179,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
Expand Down Expand Up @@ -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]",
Expand Down Expand Up @@ -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]", {
Expand Down
10 changes: 0 additions & 10 deletions tests/e2e/specs/FOUR-6721_RAOS_People2.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
8 changes: 3 additions & 5 deletions tests/e2e/specs/LoopSelectList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand All @@ -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);
});
});

0 comments on commit 67c54d0

Please sign in to comment.