Skip to content

Commit 5e83267

Browse files
author
dante
committed
Merge branch 'feature/2504' of github.com:ProcessMaker/processmaker into feature/2504
2 parents f3f4e71 + 55cf58e commit 5e83267

5 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎ProcessMaker/Http/Controllers/Api/ScriptController.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ public function preview(Request $request, Script $script)
185185
* ),
186186
* )
187187
*/
188-
public function execute(Request $request, Script $script)
188+
public function execute(Request $request, $script)
189189
{
190+
$script = is_numeric($script) ? Script::find($script) : Script::where('key', $script)->first();
190191
$data = json_decode($request->get('data'), true) ?: [];
191192
$config = json_decode($request->get('config'), true) ?: [];
192-
$watcher = json_decode($request->get('watcher'), true) ?: [];
193+
$watcher = $request->get('watcher');
193194
$code = $script->code;
194195

195196
ExecuteScript::dispatch($script, $request->user(), $code, $data, $watcher, $config);

‎ProcessMaker/Jobs/ExecuteScript.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function __construct(Script $script, User $current_user, $code, array $da
4242
$this->current_user = $current_user;
4343
$this->code = $code;
4444
$this->data = $data;
45+
$this->configuration = $configuration;
4546
$this->watcher = $watcher;
4647
$this->configuration = $configuration;
4748
}

‎resources/js/tasks/components/TaskForm.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<vue-form-renderer @submit="submit" v-model="formData" :config="screen" :computed="computed" :custom-css="customCss" @update="onUpdate" />
2+
<vue-form-renderer @submit="submit" v-model="formData" :config="screen" :computed="computed" :custom-css="customCss" :watchers="watchers" @update="onUpdate" />
33
</template>
44

55
<script>
@@ -14,7 +14,7 @@ export default {
1414
VueFormRenderer
1515
},
1616
mixins: [ProcessRequestChannel],
17-
props: ["processId", "instanceId", "tokenId", "screen", "data", "computed", "customCss", "listenProcessEvents"],
17+
props: ["processId", "instanceId", "tokenId", "screen", "data", "computed", "customCss", "watchers", "listenProcessEvents"],
1818
data() {
1919
return {
2020
formData: this.data

‎resources/lang/en.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
" overdue ": " overdue ",
33
" pending": " pending",
44
":user has completed the task :task_name": ":user has completed the task :task_name",
5+
"{{variable}} is running.": "{{variable}} is running.",
56
"? Any services using it will no longer have access.": "? Any services using it will no longer have access.",
67
"[Select Active Process]": "[Select Active Process]",
78
"# Processes": "# Processes",
@@ -653,6 +654,7 @@
653654
"Should records be editable/removable and can new records be added": "Should records be editable/removable and can new records be added",
654655
"Should the checkbox be checked by default": "Should the checkbox be checked by default",
655656
"Show in Json Format": "Show in Json Format",
657+
"Something has gone wrong.": "Something has gone wrong.",
656658
"Something went wrong. Try refreshing the application": "Something went wrong. Try refreshing the application",
657659
"Sorry, this request doesn't contain any information.": "Sorry, this request doesn't contain any information.",
658660
"Sorry! API failed to load": "Sorry! API failed to load",
@@ -800,6 +802,7 @@
800802
"This Request is currently in progress.": "This Request is currently in progress.",
801803
"This screen has validation errors.": "This screen has validation errors.",
802804
"This screen will be populated once the Request is completed.": "This screen will be populated once the Request is completed.",
805+
"This window will automatically close when complete.": "This window will automatically close when complete.",
803806
"Time expression": "Time expression",
804807
"Time when the task will due (hours)": "Time when the task will due (hours)",
805808
"Time Zone": "Time Zone",
@@ -820,6 +823,7 @@
820823
"Unable to import": "Unable to import",
821824
"Unauthorized - ProcessMaker": "Unauthorized - ProcessMaker",
822825
"Undo": "Undo",
826+
"Unfortunately this screen has had an issue. We've notified the administrator.": "Unfortunately this screen has had an issue. We've notified the administrator.",
823827
"Unread Notifications": "Unread Notifications",
824828
"Update Group Successfully": "Update Group Successfully",
825829
"Upload Avatar": "Upload Avatar",

‎resources/views/tasks/edit.blade.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class="nav-link">{{__('Data')}}</a></li>
5959
:screen="{{json_encode($task->getScreen()->config)}}"
6060
:computed="{{json_encode($task->getScreen()->computed)}}"
6161
:custom-css="{{json_encode(strval($task->getScreen()->custom_css))}}"
62+
:watchers="{{json_encode($task->getScreen()->watchers)}}"
6263
:data="{{$task->processRequest->data ? json_encode($task->processRequest->data) : '{}'}}">
6364
</task-screen>
6465
@else
@@ -90,6 +91,7 @@ class="nav-link">{{__('Data')}}</a></li>
9091
:screen="{{json_encode($screenInterstitial->config)}}"
9192
:computed="{{json_encode($screenInterstitial->computed)}}"
9293
:custom-css="{{json_encode(strval($screenInterstitial->custom_css))}}"
94+
:watchers="{{json_encode($screenInterstitial->watchers)}}"
9395
:data="{{$task->processRequest->data ? json_encode($task->processRequest->data) : '{}'}}"
9496
@activity-assigned="redirectToNextAssignedTask"
9597
@process-completed="redirectWhenProcessCompleted"
@@ -232,8 +234,8 @@ class="d-inline-flex pull-left align-items-center"
232234
@section('js')
233235
<script>
234236
window.ProcessMaker.EventBus.$on("screen-renderer-init", (screen) => {
235-
if (screen.watchers) {
236-
screen.watchers.api.execute = @json(route('api.scripts.execute', ['script' => 'script_id']));
237+
if (screen.watchers_config) {
238+
screen.watchers_config.api.execute = @json(route('api.scripts.execute', ['script' => 'script_id']));
237239
} else {
238240
console.warn('Screen builder version does not have watchers');
239241
}

0 commit comments

Comments
 (0)