Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/four-11537: Process Launchpad - Start Web Entry Links #5732

Merged
merged 6 commits into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 23 additions & 3 deletions resources/js/processes-catalogue/components/ProcessOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</button>
<div class="dropdown-menu scrollable-menu p-3 pb-0 mt-2">
<p
class="font-weight-bold px-1"
class="font-weight-bold px-1 text-uppercase"
style="font-size: 14px"
>
{{ $t('Starting events') }}
Expand All @@ -28,8 +28,18 @@
{{ event.name }}
</p>
<button
v-if="event.webEntry"
type="button"
class="btn btn-outline-success border-0 p-1"
class="btn btn-outline-primary border-0 p-1 text-capitalize"
@click="copyLink(event.webEntry)"
>
<i class="fas fa-link p-1" />
{{ $t('Copy Link') }}
</button>
<button
v-else
type="button"
class="btn btn-outline-success border-0 p-1 text-capitalize"
@click="goToNewRequest(event.id)"
>
<i class="fas fa-play-circle p-1" />
Expand Down Expand Up @@ -61,6 +71,8 @@ export default {
const startEvents = this.process.start_events;
startEvents.forEach((event) => {
if (event.eventDefinitions.length === 0) {
const webEntry = JSON.parse(event.config).web_entry;
event.webEntry = webEntry;
this.processEvents.push(event);
}
});
Expand All @@ -70,7 +82,7 @@ export default {
*/
goToNewRequest(event) {
ProcessMaker.apiClient
.post(`/process_events/${this.processId}?event=${event}`)
.post(`/process_events/${this.process.id}?event=${event}`)
.then((response) => {
this.spin = 0;
let instance = response.data;
Expand All @@ -83,6 +95,14 @@ export default {
}
});
},
/**
* Copy WebEntry Link
*/
copyLink(webEntry) {
const link = webEntry.webentryRouteConfig.entryUrl;
navigator.clipboard.writeText(link);
ProcessMaker.alert(this.$t("Link copied"), "success");
},
},
};
</script>
Expand Down