Skip to content

Commit

Permalink
Merge branch 'next' into epic/FOUR-18012
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjacornelius committed Oct 7, 2024
2 parents afc9ca0 + 3115ef5 commit c243363
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@processmaker/screen-builder",
"version": "2.99.0",
"version": "2.99.3",
"scripts": {
"dev": "VITE_COVERAGE=true vite",
"build": "vite build",
Expand Down Expand Up @@ -56,7 +56,7 @@
"@fortawesome/fontawesome-free": "^5.6.1",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@panter/vue-i18next": "^0.15.2",
"@processmaker/vue-form-elements": "0.59.0",
"@processmaker/vue-form-elements": "0.60.0",
"@processmaker/vue-multiselect": "2.3.0",
"@storybook/addon-essentials": "^7.6.13",
"@storybook/addon-interactions": "^7.6.13",
Expand Down Expand Up @@ -115,7 +115,7 @@
},
"peerDependencies": {
"@panter/vue-i18next": "^0.15.0",
"@processmaker/vue-form-elements": "0.59.0",
"@processmaker/vue-form-elements": "0.60.0",
"i18next": "^15.0.8",
"vue": "^2.6.12",
"vuex": "^3.1.1"
Expand Down
12 changes: 11 additions & 1 deletion src/DataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,26 @@ export default {
const hasIncludeScreen = params.match(/include=.*,screen,/);
const hasIncludeNested = params.match(/include=.*,nested,/);

// Extract screen_version from params.
const screenVersionMatch = params.match(/screen_version=([^&]+)/);
const screenVersion = screenVersionMatch ? screenVersionMatch[1] : null;

// remove params ?...
promises.push(
this.get(endpoint + params.replace(/,screen,|,nested,/g, ","))
);
// Get the screen from a separated cached endpoint
if (hasIncludeScreen) {
const screenEndpoint = `${(endpoint + params).replace(
let screenEndpoint = `${(endpoint + params).replace(
/\?.+$/,
""
)}/screen?include=screen${hasIncludeNested ? ",nested" : ""}`;

// Append screen_version only if screenVersion is not empty.
if (screenVersion) {
screenEndpoint += `&screen_version=${screenVersion}`;
}

promises.push(this.get(screenEndpoint));
}
// Await for both promises to resolve
Expand Down
10 changes: 9 additions & 1 deletion src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default {
initialRequestId: { type: Number, default: null },
initialProcessId: { type: Number, default: null },
initialNodeId: { type: String, default: null },
screenVersion: { type: Number, default: null },
userId: { type: Number, default: null },
csrfToken: { type: String, default: null },
value: { type: Object, default: () => {} },
Expand Down Expand Up @@ -265,7 +266,12 @@ export default {
return;
}
const url = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission,elementDestination`;
let url = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission,elementDestination`;
if (this.screenVersion) {
url += `&screen_version=${this.screenVersion}`;
}
// For Vocabularies
if (window.ProcessMaker && window.ProcessMaker.packages && window.ProcessMaker.packages.includes('package-vocabularies')) {
window.ProcessMaker.VocabulariesSchemaUrl = `vocabularies/task_schema/${this.taskId}`;
Expand Down Expand Up @@ -532,6 +538,7 @@ export default {
} else if (this.parentRequest && ['COMPLETED', 'CLOSED'].includes(this.task.process_request.status)) {
this.$emit('completed', this.getAllowedRequestId());
}
this.disabled = false;
});
},
emitIfTaskCompleted(requestId) {
Expand Down Expand Up @@ -994,6 +1001,7 @@ export default {
this.requestData = this.value;
this.loopContext = this.initialLoopContext;
this.loadTask(true);
this.setSelfService();
},
destroyed() {
this.unsubscribeSocketListeners();
Expand Down

0 comments on commit c243363

Please sign in to comment.