Skip to content

Commit

Permalink
Merge pull request #1654 from ProcessMaker/bugfix/FOUR-17272
Browse files Browse the repository at this point in the history
FOUR-17272 tasks in a process without interstitial automatically skip to the next task
  • Loading branch information
ryancooley authored Jul 24, 2024
2 parents 6d8ab13 + c2a5f74 commit 21cecb6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/components/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export default {
*/
// eslint-disable-next-line consistent-return
async getDestinationUrl() {
const { elementDestination } = this.task || {};
const { elementDestination, allow_interstitial: allowInterstitial } = this.task || {};
if (!elementDestination) {
return null;
Expand All @@ -437,7 +437,7 @@ export default {
const response = await this.retryApiCall(() => this.getTasks(params));
const firstTask = response.data.data[0];
if (firstTask?.user_id === this.userId) {
if (allowInterstitial && firstTask?.user_id === this.userId) {
return `/tasks/${firstTask.id}/edit`;
}
Expand Down Expand Up @@ -487,6 +487,8 @@ export default {
this.nodeId = task.element_id;
} else if (this.parentRequest && ['COMPLETED', 'CLOSED'].includes(this.task.process_request.status)) {
this.$emit('completed', this.getAllowedRequestId());
} else if (!this.taskPreview) {
this.emitClosedEvent();
}
});
},
Expand Down Expand Up @@ -602,20 +604,14 @@ export default {
const queryParams = {
user_id: this.userId,
process_request_id: params.processRequestId,
page: params.page,
per_page: params.perPage,
status: params.status
page: params.page || 1,
per_page: params.perPage || 1,
status: params.status,
};
const queryString = Object.entries(queryParams)
.filter(([, value]) => value !== undefined && value !== null)
.map(
([key, value]) =>
`${encodeURIComponent(key)}=${encodeURIComponent(value)}`
)
.join("&");
const queryString = new URLSearchParams(queryParams).toString();
return window.ProcessMaker.apiClient.get(`tasks?${queryString}`);
return this.$dataProvider.getTasks(`?${queryString}`);
},
/**
* Parses a JSON string and returns the result.
Expand Down Expand Up @@ -690,9 +686,13 @@ export default {
data.event === "ACTIVITY_ACTIVATED"
&& data.elementType === 'task'
) {
this.taskId = data.tokenId;
if (!this.task.elementDestination?.type) {
this.taskId = data.taskId;
}
this.reload();
}
if (data.event === 'ACTIVITY_EXCEPTION') {
this.$emit('error', this.requestId);
}
Expand Down

0 comments on commit 21cecb6

Please sign in to comment.