Skip to content
Open
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
17 changes: 15 additions & 2 deletions src/components/inspectors/ElementDestination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
:error="getValidationErrorForURL(externalURL)"
data-cy="events-add-id"
:placeholder="urlPlaceholder"
:helper="$t('Determine the URL where the request will end')"
:helper="externalUrlHelperText"
data-test="external-url"
/>
<process-form-select
Expand Down Expand Up @@ -159,6 +159,9 @@ export default {

return this.$t('Select where to send users after this task. Any Non-default destination will disable the "Display Next Assigned Task" function.');
},
externalUrlHelperText() {
return this.$t('URL where the request will redirect. Supports Mustache:') + ' {{APP_URL}}, {{_request.id}}, {{_user.id}}, ' + this.$t('process variables.');
},
},
created() {
this.loadDashboardsDebounced = debounce((filter) => {
Expand All @@ -174,12 +177,22 @@ export default {
},
methods: {
getValidationErrorForURL(url) {
if (!url || !url.trim()) {
return '';
}
if (!this.isValidURL(url)) {
return this.$t('Must be a valid URL');
return this.$t('Must be a valid URL or Mustache expressions ({{APP_URL}}, {{_request.id}}, {{_user.id}}, process variables).');
}
return '';
},
isValidURL(string) {
if (!string || typeof string !== 'string') {
return true;
}
// Allow Mustache: same context as backend (APP_URL, _request, _user, process variables)
if (string.includes('{{')) {
return true;
}
try {
new URL(string);
return true;
Expand Down
Loading