Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions resources/js/components/requests/card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ export default {
.then(response => {
this.spin = 0;
let instance = response.data;
let url = '/requests';
if (this.$cookies.get("isMobile") === "true") {
window.location = "/requests/mobile/" + instance.id;
} else {
window.location = `/requests/${instance.id}?fromTriggerStartEvent=`;
url = '/requests/mobile';
}
window.location = `${url}/${instance.id}?fromTriggerStartEvent=`;
}).catch((err) => {
this.disabled = false;
const data = err.response.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
task: null,
currentUserId: null,
formData: {},
importingProcess: false,
};
},
methods: {
Expand Down Expand Up @@ -86,9 +87,9 @@ export default {
this.task = task;
},
completed() {
if (this.shouldImportProcessTemplate) {
if (!this.importingProcess && this.shouldImportProcessTemplate) {
this.importProcessTemplate();
} else {
} else if (!this.shouldImportProcessTemplate) {
this.showHelperProcess = false;
this.$bvModal.hide("processWizard");
}
Expand All @@ -103,15 +104,17 @@ export default {
});
},
importProcessTemplate() {
this.importingProcess = true;
ProcessMaker.apiClient.post(`template/create/process/${this.template.process_template_id}`, {
name: this.template.name,
description: this.template.description,
version: "1.0.0", // TODO: Wizards should have a versions property
version: "1.0.0",
process_category_id: this.template.process.process_category_id,
projects: null,
wizardTemplateUuid: this.template.uuid,
helperProcessRequestId: this.task.process_request_id,
}).then((response) => {
this.importingProcess = false;
if (response.data?.existingAssets) {
this.handleExistingAssets(response.data);
} else {
Expand Down
18 changes: 13 additions & 5 deletions resources/views/processes/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
</div>
@endcan
@can('create-processes')
<select-template-modal
:type="__('Process')"
:count-categories="@json($config->countCategories)"
<select-template-modal
:type="__('Process')"
:count-categories="@json($config->countCategories)"
:package-ai="{{ hasPackage('package-ai') ? '1' : '0' }}"
is-projects-installed="{{\ProcessMaker\PackageHelper::isPackageInstalled(\ProcessMaker\PackageHelper::PM_PACKAGE_PROJECTS)}}"
>
Expand All @@ -36,7 +36,15 @@
@endcan
</div>
</div>

@php
$permissions = \Auth::user()->hasPermissionsFor(
'processes',
'process-templates',
'pm-blocks',
'projects',
'additional-asset-actions'
);
@endphp
<div class="container-fluid">
<processes-listing
ref="processListing"
Expand All @@ -45,7 +53,7 @@
status="{{ $config->status }}"
v-on:edit="edit"
v-on:reload="reload"
:permission="{{ \Auth::user()->hasPermissionsFor('processes', 'process-templates', 'pm-blocks', 'projects') }}"
:permission="{{ $permissions }}"
:current-user-id="{{ \Auth::user()->id }}"
is-documenter-installed="{{\ProcessMaker\PackageHelper::isPmPackageProcessDocumenterInstalled()}}"
></processes-listing>
Expand Down
1 change: 0 additions & 1 deletion resources/views/tasks/editMobile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ class="card border-0"
.put("tasks/" + taskId, {status:"COMPLETED", data: this.formData})
.then(() => {
window.ProcessMaker.alert(message, 'success', 5, true);
window.location = "/tasks";
})
.catch(error => {
// If there are errors, the user will be redirected to the request page
Expand Down