From 1461c225dd6ade7254cf288bde1138dcc35fd9ff Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Fri, 22 Nov 2024 12:44:29 -0400 Subject: [PATCH 01/20] saving progress --- ProcessMaker/Http/Controllers/HomeController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ProcessMaker/Http/Controllers/HomeController.php b/ProcessMaker/Http/Controllers/HomeController.php index df81ab10f9..cdc7ea6a11 100644 --- a/ProcessMaker/Http/Controllers/HomeController.php +++ b/ProcessMaker/Http/Controllers/HomeController.php @@ -14,10 +14,15 @@ public function index(Request $request) if (Auth::check()) { // Redirect to home dynamic only if the package was enable if (hasPackage('package-dynamic-ui')) { - $user = \Auth::user(); - $homePage = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user); + $user = Auth::user(); + $customDashboardExists = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::where('type', 'DASHBOARD') + ->count() > 0; - return redirect($homePage); + if ($customDashboardExists) { + $homePage = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user); + + return redirect($homePage); + } } // Redirect to the default view From e52e94aa126362917ffc779c2e5bf1a24229e95f Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Wed, 11 Dec 2024 16:12:51 -0400 Subject: [PATCH 02/20] Ready for PR --- ProcessMaker/Http/Controllers/HomeController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProcessMaker/Http/Controllers/HomeController.php b/ProcessMaker/Http/Controllers/HomeController.php index cdc7ea6a11..67a7b264d7 100644 --- a/ProcessMaker/Http/Controllers/HomeController.php +++ b/ProcessMaker/Http/Controllers/HomeController.php @@ -15,7 +15,10 @@ public function index(Request $request) // Redirect to home dynamic only if the package was enable if (hasPackage('package-dynamic-ui')) { $user = Auth::user(); + + // Check if there is at least one custom dashboard per user $customDashboardExists = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::where('type', 'DASHBOARD') + ->where('assignable_id', $user->id) ->count() > 0; if ($customDashboardExists) { @@ -26,7 +29,7 @@ public function index(Request $request) } // Redirect to the default view - return redirect('/requests'); + return redirect('/tasks'); } } From 5c25ad780efda4685069a822e309ec8f9669f931 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Mon, 16 Dec 2024 10:24:31 -0400 Subject: [PATCH 03/20] Ready for PR based on epic/20297 --- .../Api/UserConfigurationController.php | 4 + .../Http/Controllers/TaskController.php | 4 +- resources/js/tasks/index.js | 10 +- resources/js/tasks/mixins/TasksMixin.js | 185 ++++++++++++++ resources/views/tasks/index.blade.php | 225 +++++++++++++++++- tests/Feature/Api/UserConfigurationTest.php | 4 + 6 files changed, 426 insertions(+), 6 deletions(-) create mode 100644 resources/js/tasks/mixins/TasksMixin.js diff --git a/ProcessMaker/Http/Controllers/Api/UserConfigurationController.php b/ProcessMaker/Http/Controllers/Api/UserConfigurationController.php index 64ea095fd1..d325c1636b 100644 --- a/ProcessMaker/Http/Controllers/Api/UserConfigurationController.php +++ b/ProcessMaker/Http/Controllers/Api/UserConfigurationController.php @@ -25,6 +25,9 @@ class UserConfigurationController extends Controller 'tasks' => [ 'isMenuCollapse' => true, ], + 'tasks_inbox' => [ + 'isMenuCollapse' => false, + ], ]; public function index() @@ -54,6 +57,7 @@ public function store(Request $request) 'ui_configuration.cases' => 'required|array', 'ui_configuration.requests' => 'required|array', 'ui_configuration.tasks' => 'required|array', + 'ui_configuration.tasks_inbox' => 'required|array', ]); $uiConfiguration = json_encode($request->input('ui_configuration')); diff --git a/ProcessMaker/Http/Controllers/TaskController.php b/ProcessMaker/Http/Controllers/TaskController.php index fa4c945454..a86b34332a 100755 --- a/ProcessMaker/Http/Controllers/TaskController.php +++ b/ProcessMaker/Http/Controllers/TaskController.php @@ -58,7 +58,9 @@ public function index() $taskDraftsEnabled = TaskDraft::draftsEnabled(); - return view('tasks.index', compact('title', 'userFilter', 'defaultColumns', 'taskDraftsEnabled')); + $userConfiguration = (new UserConfigurationController())->index()['ui_configuration']; + + return view('tasks.index', compact('title', 'userFilter', 'defaultColumns', 'taskDraftsEnabled', 'userConfiguration')); } public function edit(ProcessRequestToken $task, string $preview = '') diff --git a/resources/js/tasks/index.js b/resources/js/tasks/index.js index 41ad99016b..ecea920a86 100644 --- a/resources/js/tasks/index.js +++ b/resources/js/tasks/index.js @@ -2,12 +2,18 @@ import Vue from "vue"; import TasksList from "./components/TasksList"; import TasksListCounter from "./components/TasksListCounter.vue"; import setDefaultAdvancedFilterStatus from "../common/setDefaultAdvancedFilterStatus"; +import ParticipantHomeScreen from './components/ParticipantHomeScreen.vue'; Vue.component("TasksList", TasksList); +Vue.component('participant-home-screen', ParticipantHomeScreen); new Vue({ el: "#tasks", data: { + showOldTaskScreen: false, + userConfiguration: window.ProcessMaker.userConfiguration, + urlConfiguration: "users/configuration", + showMenu: true, columns: window.Processmaker.defaultColumns || null, filter: "", pmql: "", @@ -62,7 +68,9 @@ new Vue({ if (!window.location.search.includes("filter_user_recommendation")) { this.$nextTick(() => { - this.$refs.taskList.fetch(); + if (this.$refs.taskList) { + this.$refs.taskList.fetch(); + } }); } }, diff --git a/resources/js/tasks/mixins/TasksMixin.js b/resources/js/tasks/mixins/TasksMixin.js new file mode 100644 index 0000000000..579443296a --- /dev/null +++ b/resources/js/tasks/mixins/TasksMixin.js @@ -0,0 +1,185 @@ +export default { + data() { + return { + showOldTaskScreen: false, + urlConfiguration: "users/configuration", + showMenu: false, + columns: window.Processmaker.defaultColumns || null, + filter: "", + pmql: "", + urlPmql: "", + filtersPmql: "", + fullPmql: "", + status: [], + inOverdueMessage: "", + additions: [], + priorityField: "is_priority", + draftField: "draft", + isDataLoading: false, + inbox: true, + priority: false, + draft: false, + tab: "inbox", + inboxCount: null, + draftCount: null, + priorityCount: null, + priorityFilter: [ + { + "subject": { + "type": "Field", + "value": "is_priority" + }, + "operator": "=", + "value": true, + "_column_field": "is_priority", + "_column_label": "Priority", + "_hide_badge": true + } + ], + draftFilter: [ + { + "subject": { + "type": "Relationship", + "value": "draft.id" + }, + "operator": ">", + "value": 0, + "_column_field": "draft", + "_column_label": "Draft", + "_hide_badge": true + } + ], + } + }, + computed: { + effectiveSavedsearchDefaultsEditRoute() { + return this.savedsearchDefaultsEditRoute || window.ProcessMaker.savedsearchDefaultsEditRoute + } + }, + methods: { + defineUserConfiguration() { + this.localUserConfiguration = JSON.parse(window.ProcessMaker.userConfiguration || '{}'); + if (this.localUserConfiguration.tasks_inbox) { + this.showMenu = this.localUserConfiguration.tasks_inbox.isMenuCollapse; + } else { + this.showMenu = false; + this.localUserConfiguration.tasks_inbox = { + isMenuCollapse: false + }; + } + }, + hideMenu() { + this.showMenu = !this.showMenu; + this.updateUserConfiguration(); + }, + updateUserConfiguration() { + this.localUserConfiguration.tasks_inbox.isMenuCollapse = this.showMenu; + ProcessMaker.apiClient + .put( + this.urlConfiguration, + { + ui_configuration: this.localUserConfiguration, + }, + ) + .catch((error) => { + console.error("Error", error); + }); + }, + switchTab(tab) { + this.tab = tab; + const taskListComponent = this.$refs.taskList; + taskListComponent.advancedFilter[this.priorityField] = []; + taskListComponent.advancedFilter[this.draftField] = []; + switch (tab) { + case "priority": + taskListComponent.advancedFilter["is_priority"] = this.priorityFilter; + break; + case "draft": + taskListComponent.advancedFilter["draft"] = this.draftFilter; + break; + } + taskListComponent.markStyleWhenColumnSetAFilter(); + taskListComponent.storeFilterConfiguration(); + taskListComponent.fetch(true); + }, + dataLoading(value) { + this.isDataLoading = value; + }, + onFetchTask() { + this.inbox = true; + this.priority = this.draft = false; + let filters = window.ProcessMaker.advanced_filter?.filters; + if (!Array.isArray(filters)) { + filters = []; + } + filters.forEach((item) => { + if (item._column_field === "is_priority") { + this.priority = true; + this.inbox = this.draft = false; + } + if (item._column_field === "draft") { + this.draft = true; + this.inbox = this.priority = false; + } + }); + }, + handleTabCount(value) { + if (this.tab === "inbox") { + this.inboxCount = value; + } + if (this.tab === "draft") { + this.draftCount = value; + } + if (this.tab === "priority") { + this.priorityCount = value; + } + }, + onFiltersPmqlChange(value) { + this.filtersPmql = value[0]; + this.fullPmql = this.getFullPmql(); + }, + onNLQConversion(query) { + this.onChange(query); + this.onSearch(); + }, + onChange(query) { + this.pmql = query; + this.fullPmql = this.getFullPmql(); + }, + onSearch() { + if (this.$refs.taskList) { + this.$refs.taskList.fetch(true); + } + }, + onInboxRules() { + window.location.href = "/tasks/rules"; + }, + setInOverdueMessage(inOverdue) { + let inOverdueMessage = ''; + if (inOverdue) { + const taskText = (inOverdue > 1) ? this.$t("Tasks").toLowerCase() : this.$t("Task").toLowerCase(); + inOverdueMessage = this.$t("You have {{ inOverDue }} overdue {{ taskText }} pending", {inOverDue: inOverdue, taskText}); + } + this.inOverdueMessage = inOverdueMessage; + }, + getFullPmql() { + let fullPmqlString = ""; + + if (this.filtersPmql && this.filtersPmql !== "") { + fullPmqlString = this.filtersPmql; + } + + if (fullPmqlString !== "" && this.pmql && this.pmql !== "") { + fullPmqlString = `${fullPmqlString} AND ${this.pmql}`; + } + + if (fullPmqlString === "" && this.pmql && this.pmql !== "") { + fullPmqlString = this.pmql; + } + + return fullPmqlString; + } + // ... resto de métodos compartidos + } + } + \ No newline at end of file diff --git a/resources/views/tasks/index.blade.php b/resources/views/tasks/index.blade.php index cc3082c845..fca117a22c 100644 --- a/resources/views/tasks/index.blade.php +++ b/resources/views/tasks/index.blade.php @@ -14,8 +14,11 @@ __($title) => null, ]]) @endsection + @section('content') -
+
+
+
-
-
+ +
+ +
+ @endsection @section('js') @@ -174,7 +197,7 @@ class="ml-md-2" window.ProcessMaker.taskDraftsEnabled = @json($taskDraftsEnabled); window.ProcessMaker.advanced_filter = @json($userFilter); window.Processmaker.defaultColumns = @json($defaultColumns); - + window.ProcessMaker.userConfiguration = @json($userConfiguration ?? []); window.sessionStorage.setItem('elementDestinationURL', window.location.href); @@ -258,4 +281,198 @@ class="ml-md-2" max-width: 450px; } + @endsection diff --git a/tests/Feature/Api/UserConfigurationTest.php b/tests/Feature/Api/UserConfigurationTest.php index 0a2b4a0c8d..f1442ae047 100644 --- a/tests/Feature/Api/UserConfigurationTest.php +++ b/tests/Feature/Api/UserConfigurationTest.php @@ -55,6 +55,9 @@ public function testStoreUserConfigurationAndGetNewValues() 'tasks' => [ 'isMenuCollapse' => false, ], + 'tasks_inbox' => [ + 'isMenuCollapse' => false, + ], ]; $response = $this->apiCall('PUT', self::API_TEST_URL, ['ui_configuration' => $values]); @@ -74,6 +77,7 @@ public function testStoreUserConfigurationAndGetNewValues() $this->assertEquals($uiConfig->cases->isMenuCollapse, $values['cases']['isMenuCollapse']); $this->assertEquals($uiConfig->requests->isMenuCollapse, $values['requests']['isMenuCollapse']); $this->assertEquals($uiConfig->tasks->isMenuCollapse, $values['tasks']['isMenuCollapse']); + $this->assertEquals($uiConfig->tasks_inbox->isMenuCollapse, $values['tasks_inbox']['isMenuCollapse']); } /** From 4a8e7bfdefee707cff43175826bb1386fb30c100 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Mon, 16 Dec 2024 10:57:44 -0400 Subject: [PATCH 04/20] Adding new component ParticipantHomeScren.vue --- .../components/ParticipantHomeScreen.vue | 488 ++++++++++++++++++ 1 file changed, 488 insertions(+) create mode 100644 resources/js/tasks/components/ParticipantHomeScreen.vue diff --git a/resources/js/tasks/components/ParticipantHomeScreen.vue b/resources/js/tasks/components/ParticipantHomeScreen.vue new file mode 100644 index 0000000000..b8007396de --- /dev/null +++ b/resources/js/tasks/components/ParticipantHomeScreen.vue @@ -0,0 +1,488 @@ + + + + + + + From 365842a152b4be4f08f481ee5156d86d7b291bb7 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Mon, 16 Dec 2024 14:56:18 -0400 Subject: [PATCH 05/20] Applying Code Styles, removing unused comments and fixing test unit --- .../Http/Controllers/TaskController.php | 2 +- .../components/ParticipantHomeScreen.vue | 967 +++++++++--------- resources/js/tasks/mixins/TasksMixin.js | 364 +++---- resources/views/tasks/index.blade.php | 674 ++++++------ tests/Feature/Api/UserConfigurationTest.php | 5 +- 5 files changed, 1020 insertions(+), 992 deletions(-) diff --git a/ProcessMaker/Http/Controllers/TaskController.php b/ProcessMaker/Http/Controllers/TaskController.php index a86b34332a..63c2fb474b 100755 --- a/ProcessMaker/Http/Controllers/TaskController.php +++ b/ProcessMaker/Http/Controllers/TaskController.php @@ -58,7 +58,7 @@ public function index() $taskDraftsEnabled = TaskDraft::draftsEnabled(); - $userConfiguration = (new UserConfigurationController())->index()['ui_configuration']; + $userConfiguration = (new UserConfigurationController())->index()['ui_configuration'] ?? []; return view('tasks.index', compact('title', 'userFilter', 'defaultColumns', 'taskDraftsEnabled', 'userConfiguration')); } diff --git a/resources/js/tasks/components/ParticipantHomeScreen.vue b/resources/js/tasks/components/ParticipantHomeScreen.vue index b8007396de..cc12f71978 100644 --- a/resources/js/tasks/components/ParticipantHomeScreen.vue +++ b/resources/js/tasks/components/ParticipantHomeScreen.vue @@ -1,488 +1,533 @@ - - - - - - + @media (max-width: 639px) { + display: flex; + } +} + +.menu-title { + color: #556271; + font-size: 22px; + font-style: normal; + font-weight: 600; + line-height: 46.08px; + letter-spacing: -0.44px; + display: block; + width: 92%; + margin-left: 15px; + + @media (max-width: 639px) { + display: none; + } +} +.processes-info { + width: 100%; + margin-right: 0px; + overflow-x: hidden; + @media (max-width: 639px) { + padding-left: 0; + } +} + diff --git a/resources/js/tasks/mixins/TasksMixin.js b/resources/js/tasks/mixins/TasksMixin.js index 579443296a..ad96cc0a3e 100644 --- a/resources/js/tasks/mixins/TasksMixin.js +++ b/resources/js/tasks/mixins/TasksMixin.js @@ -1,185 +1,191 @@ export default { - data() { - return { - showOldTaskScreen: false, - urlConfiguration: "users/configuration", - showMenu: false, - columns: window.Processmaker.defaultColumns || null, - filter: "", - pmql: "", - urlPmql: "", - filtersPmql: "", - fullPmql: "", - status: [], - inOverdueMessage: "", - additions: [], - priorityField: "is_priority", - draftField: "draft", - isDataLoading: false, - inbox: true, - priority: false, - draft: false, - tab: "inbox", - inboxCount: null, - draftCount: null, - priorityCount: null, - priorityFilter: [ - { - "subject": { - "type": "Field", - "value": "is_priority" - }, - "operator": "=", - "value": true, - "_column_field": "is_priority", - "_column_label": "Priority", - "_hide_badge": true - } - ], - draftFilter: [ - { - "subject": { - "type": "Relationship", - "value": "draft.id" - }, - "operator": ">", - "value": 0, - "_column_field": "draft", - "_column_label": "Draft", - "_hide_badge": true - } - ], + data() { + return { + showOldTaskScreen: false, + urlConfiguration: "users/configuration", + showMenu: false, + columns: window.Processmaker.defaultColumns || null, + filter: "", + pmql: "", + urlPmql: "", + filtersPmql: "", + fullPmql: "", + status: [], + inOverdueMessage: "", + additions: [], + priorityField: "is_priority", + draftField: "draft", + isDataLoading: false, + inbox: true, + priority: false, + draft: false, + tab: "inbox", + inboxCount: null, + draftCount: null, + priorityCount: null, + priorityFilter: [ + { + subject: { + type: "Field", + value: "is_priority", + }, + operator: "=", + value: true, + _column_field: "is_priority", + _column_label: "Priority", + _hide_badge: true, + }, + ], + draftFilter: [ + { + subject: { + type: "Relationship", + value: "draft.id", + }, + operator: ">", + value: 0, + _column_field: "draft", + _column_label: "Draft", + _hide_badge: true, + }, + ], + }; + }, + computed: { + effectiveSavedsearchDefaultsEditRoute() { + return ( + this.savedsearchDefaultsEditRoute || + window.ProcessMaker.savedsearchDefaultsEditRoute + ); + }, + }, + methods: { + defineUserConfiguration() { + this.localUserConfiguration = JSON.parse( + window.ProcessMaker.userConfiguration || "{}" + ); + if (this.localUserConfiguration.tasks_inbox) { + this.showMenu = this.localUserConfiguration.tasks_inbox.isMenuCollapse; + } else { + this.showMenu = false; + this.localUserConfiguration.tasks_inbox = { + isMenuCollapse: false, + }; } }, - computed: { - effectiveSavedsearchDefaultsEditRoute() { - return this.savedsearchDefaultsEditRoute || window.ProcessMaker.savedsearchDefaultsEditRoute + hideMenu() { + this.showMenu = !this.showMenu; + this.updateUserConfiguration(); + }, + updateUserConfiguration() { + this.localUserConfiguration.tasks_inbox.isMenuCollapse = this.showMenu; + ProcessMaker.apiClient + .put(this.urlConfiguration, { + ui_configuration: this.localUserConfiguration, + }) + .catch((error) => { + console.error("Error", error); + }); + }, + switchTab(tab) { + this.tab = tab; + const taskListComponent = this.$refs.taskList; + taskListComponent.advancedFilter[this.priorityField] = []; + taskListComponent.advancedFilter[this.draftField] = []; + switch (tab) { + case "priority": + taskListComponent.advancedFilter["is_priority"] = this.priorityFilter; + break; + case "draft": + taskListComponent.advancedFilter["draft"] = this.draftFilter; + break; } + taskListComponent.markStyleWhenColumnSetAFilter(); + taskListComponent.storeFilterConfiguration(); + taskListComponent.fetch(true); }, - methods: { - defineUserConfiguration() { - this.localUserConfiguration = JSON.parse(window.ProcessMaker.userConfiguration || '{}'); - if (this.localUserConfiguration.tasks_inbox) { - this.showMenu = this.localUserConfiguration.tasks_inbox.isMenuCollapse; - } else { - this.showMenu = false; - this.localUserConfiguration.tasks_inbox = { - isMenuCollapse: false - }; - } - }, - hideMenu() { - this.showMenu = !this.showMenu; - this.updateUserConfiguration(); - }, - updateUserConfiguration() { - this.localUserConfiguration.tasks_inbox.isMenuCollapse = this.showMenu; - ProcessMaker.apiClient - .put( - this.urlConfiguration, - { - ui_configuration: this.localUserConfiguration, - }, - ) - .catch((error) => { - console.error("Error", error); - }); - }, - switchTab(tab) { - this.tab = tab; - const taskListComponent = this.$refs.taskList; - taskListComponent.advancedFilter[this.priorityField] = []; - taskListComponent.advancedFilter[this.draftField] = []; - switch (tab) { - case "priority": - taskListComponent.advancedFilter["is_priority"] = this.priorityFilter; - break; - case "draft": - taskListComponent.advancedFilter["draft"] = this.draftFilter; - break; - } - taskListComponent.markStyleWhenColumnSetAFilter(); - taskListComponent.storeFilterConfiguration(); - taskListComponent.fetch(true); - }, - dataLoading(value) { - this.isDataLoading = value; - }, - onFetchTask() { - this.inbox = true; - this.priority = this.draft = false; - let filters = window.ProcessMaker.advanced_filter?.filters; - if (!Array.isArray(filters)) { - filters = []; - } - filters.forEach((item) => { - if (item._column_field === "is_priority") { - this.priority = true; - this.inbox = this.draft = false; - } - if (item._column_field === "draft") { - this.draft = true; - this.inbox = this.priority = false; - } - }); - }, - handleTabCount(value) { - if (this.tab === "inbox") { - this.inboxCount = value; - } - if (this.tab === "draft") { - this.draftCount = value; - } - if (this.tab === "priority") { - this.priorityCount = value; - } - }, - onFiltersPmqlChange(value) { - this.filtersPmql = value[0]; - this.fullPmql = this.getFullPmql(); - }, - onNLQConversion(query) { - this.onChange(query); - this.onSearch(); - }, - onChange(query) { - this.pmql = query; - this.fullPmql = this.getFullPmql(); - }, - onSearch() { - if (this.$refs.taskList) { - this.$refs.taskList.fetch(true); - } - }, - onInboxRules() { - window.location.href = "/tasks/rules"; - }, - setInOverdueMessage(inOverdue) { - let inOverdueMessage = ''; - if (inOverdue) { - const taskText = (inOverdue > 1) ? this.$t("Tasks").toLowerCase() : this.$t("Task").toLowerCase(); - inOverdueMessage = this.$t("You have {{ inOverDue }} overdue {{ taskText }} pending", {inOverDue: inOverdue, taskText}); - } - this.inOverdueMessage = inOverdueMessage; - }, - getFullPmql() { - let fullPmqlString = ""; - - if (this.filtersPmql && this.filtersPmql !== "") { - fullPmqlString = this.filtersPmql; - } - - if (fullPmqlString !== "" && this.pmql && this.pmql !== "") { - fullPmqlString = `${fullPmqlString} AND ${this.pmql}`; - } - - if (fullPmqlString === "" && this.pmql && this.pmql !== "") { - fullPmqlString = this.pmql; - } - - return fullPmqlString; + dataLoading(value) { + this.isDataLoading = value; + }, + onFetchTask() { + this.inbox = true; + this.priority = this.draft = false; + let filters = window.ProcessMaker.advanced_filter?.filters; + if (!Array.isArray(filters)) { + filters = []; + } + filters.forEach((item) => { + if (item._column_field === "is_priority") { + this.priority = true; + this.inbox = this.draft = false; + } + if (item._column_field === "draft") { + this.draft = true; + this.inbox = this.priority = false; } - // ... resto de métodos compartidos - } - } - \ No newline at end of file + }); + }, + handleTabCount(value) { + if (this.tab === "inbox") { + this.inboxCount = value; + } + if (this.tab === "draft") { + this.draftCount = value; + } + if (this.tab === "priority") { + this.priorityCount = value; + } + }, + onFiltersPmqlChange(value) { + this.filtersPmql = value[0]; + this.fullPmql = this.getFullPmql(); + }, + onNLQConversion(query) { + this.onChange(query); + this.onSearch(); + }, + onChange(query) { + this.pmql = query; + this.fullPmql = this.getFullPmql(); + }, + onSearch() { + if (this.$refs.taskList) { + this.$refs.taskList.fetch(true); + } + }, + onInboxRules() { + window.location.href = "/tasks/rules"; + }, + setInOverdueMessage(inOverdue) { + let inOverdueMessage = ""; + if (inOverdue) { + const taskText = + inOverdue > 1 + ? this.$t("Tasks").toLowerCase() + : this.$t("Task").toLowerCase(); + inOverdueMessage = this.$t( + "You have {{ inOverDue }} overdue {{ taskText }} pending", + { inOverDue: inOverdue, taskText } + ); + } + this.inOverdueMessage = inOverdueMessage; + }, + getFullPmql() { + let fullPmqlString = ""; + + if (this.filtersPmql && this.filtersPmql !== "") { + fullPmqlString = this.filtersPmql; + } + + if (fullPmqlString !== "" && this.pmql && this.pmql !== "") { + fullPmqlString = `${fullPmqlString} AND ${this.pmql}`; + } + + if (fullPmqlString === "" && this.pmql && this.pmql !== "") { + fullPmqlString = this.pmql; + } + + return fullPmqlString; + }, + }, +}; diff --git a/resources/views/tasks/index.blade.php b/resources/views/tasks/index.blade.php index fca117a22c..41cb76000e 100644 --- a/resources/views/tasks/index.blade.php +++ b/resources/views/tasks/index.blade.php @@ -1,7 +1,7 @@ @extends('layouts.layout') @section('title') - {{__($title)}} + {{ __($title) }} @endsection @section('sidebar') @@ -9,198 +9,157 @@ @endsection @section('breadcrumbs') - @include('shared.breadcrumbs', ['routes' => [ - __('Tasks') => route('tasks.index'), - __($title) => null, - ]]) + @include('shared.breadcrumbs', [ + 'routes' => [ + __('Tasks') => route('tasks.index'), + __($title) => null, + ], + ]) @endsection @section('content') -
-
-
-
-
- - @{{ inOverdueMessage }} - -
-
+
+
+
+
+
+ + @{{ inOverdueMessage }} + +
+
-
-
- - -
-
-
-
-
-
-
-
+
+ +
-
-
-
- -
-
@endsection @section('js') - + @endsection @section('css') @@ -245,14 +204,17 @@ class="ml-md-2" min-height: 25px; border-radius: 50%; } + .task-nav { border-bottom: 0 !important; } + .task-nav-link.active { color: #1572C2 !important; font-weight: 700; font-size: 15px; } + .task-nav-link { color: #556271; font-weight: 400; @@ -260,219 +222,231 @@ class="ml-md-2" border-top-left-radius: 5px !important; border-top-right-radius: 5px !important; } + .task-list-body { border-radius: 5px; } + .task-inbox-rules { - width: max-content; + width: max-content; } + .task-inbox-rules-content { - display: flex; - justify-content: space-between; - padding: 15px; + display: flex; + justify-content: space-between; + padding: 15px; } + .task-inbox-rules-content-text { - width: 310px; - padding-left: 10px; + width: 310px; + padding-left: 10px; } @endsection diff --git a/tests/Feature/Api/UserConfigurationTest.php b/tests/Feature/Api/UserConfigurationTest.php index f1442ae047..95fdce0acc 100644 --- a/tests/Feature/Api/UserConfigurationTest.php +++ b/tests/Feature/Api/UserConfigurationTest.php @@ -90,7 +90,7 @@ public function testStoreUserConfigurationWithInvalidValues() // Validate the header status code $response->assertStatus(422); - $this->assertEquals('The Ui configuration field is required. (and 4 more errors)', $response->json()['message']); + $this->assertEquals('The Ui configuration field is required. (and 5 more errors)', $response->json()['message']); // An incomplete ui_configuration $values = [ @@ -103,6 +103,9 @@ public function testStoreUserConfigurationWithInvalidValues() 'tasks' => [ 'isMenuCollapse' => false, ], + 'tasks_inbox' => [ + 'isMenuCollapse' => false, + ], ]; $response = $this->apiCall('PUT', self::API_TEST_URL, ['ui_configuration' => $values]); // Validate the header status code From 99f1b5fbe4f2abd2af39c55bd8f70539e004542d Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 17 Dec 2024 16:22:38 -0400 Subject: [PATCH 06/20] Adding new component ProcessesDashboardsMenu.vue --- .../components/ParticipantHomeScreen.vue | 9 ++- .../components/ProcessesDashboardsMenu.vue | 78 +++++++++++++++++++ 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 resources/js/tasks/components/ProcessesDashboardsMenu.vue diff --git a/resources/js/tasks/components/ParticipantHomeScreen.vue b/resources/js/tasks/components/ParticipantHomeScreen.vue index cc12f71978..b39973bdeb 100644 --- a/resources/js/tasks/components/ParticipantHomeScreen.vue +++ b/resources/js/tasks/components/ParticipantHomeScreen.vue @@ -15,7 +15,7 @@ > {{ $t("Inbox") }} -

New Menu Processes Here

+
@@ -27,7 +27,7 @@
-
+
@@ -215,12 +215,14 @@ import ListMixin from "./ListMixin"; import TasksMixin from "../mixins/TasksMixin"; import TasksList from "./TasksList.vue"; +import ProcessesDashboardsMenu from "./ProcessesDashboardsMenu.vue"; export default { name: "ParticipantHomeScreen", mixins: [TasksMixin, ListMixin], components: { TasksList, + ProcessesDashboardsMenu, }, props: { taskDraftsEnabled: { @@ -517,12 +519,13 @@ export default { display: block; width: 92%; margin-left: 15px; + text-align: left; @media (max-width: 639px) { display: none; } } -.processes-info { +.home-screen-inbox { width: 100%; margin-right: 0px; overflow-x: hidden; diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue new file mode 100644 index 0000000000..4f495925e0 --- /dev/null +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -0,0 +1,78 @@ + + + + + From bc2ce9941432b046223d4ee63279ab6a9970dbbe Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 17 Dec 2024 18:26:48 -0400 Subject: [PATCH 07/20] saving progress 2 --- .../components/ParticipantHomeScreen.vue | 350 +++++++++--------- .../js/tasks/components/ProcesoBrowser.vue | 19 + .../components/ProcessesDashboardsMenu.vue | 27 +- resources/js/tasks/router.js | 24 ++ webpack.mix.js | 1 + 5 files changed, 245 insertions(+), 176 deletions(-) create mode 100644 resources/js/tasks/components/ProcesoBrowser.vue create mode 100644 resources/js/tasks/router.js diff --git a/resources/js/tasks/components/ParticipantHomeScreen.vue b/resources/js/tasks/components/ParticipantHomeScreen.vue index b39973bdeb..9d0d97ad8f 100644 --- a/resources/js/tasks/components/ParticipantHomeScreen.vue +++ b/resources/js/tasks/components/ParticipantHomeScreen.vue @@ -15,7 +15,9 @@ > {{ $t("Inbox") }} - +
@@ -28,185 +30,193 @@
-
-
-
- - {{ inOverdueMessage }} - + +
+
+
+
+ + {{ inOverdueMessage }} + +
-
-
-
- - -
-
-
- +
-
+
+

router-view Dashboard 1

+
@@ -216,6 +226,7 @@ import ListMixin from "./ListMixin"; import TasksMixin from "../mixins/TasksMixin"; import TasksList from "./TasksList.vue"; import ProcessesDashboardsMenu from "./ProcessesDashboardsMenu.vue"; +import router from "../router"; export default { name: "ParticipantHomeScreen", @@ -224,6 +235,7 @@ export default { TasksList, ProcessesDashboardsMenu, }, + router, props: { taskDraftsEnabled: { type: Boolean, @@ -255,6 +267,7 @@ export default { showMenu: false, urlConfiguration: "users/configuration", localUserConfiguration: {}, + selectedProcess: "inbox", }; }, mounted() { @@ -265,6 +278,11 @@ export default { } }); }, + methods: { + processDashboardSelected(item) { + this.selectedProcess = item; + }, + }, }; diff --git a/resources/js/tasks/components/ProcesoBrowser.vue b/resources/js/tasks/components/ProcesoBrowser.vue new file mode 100644 index 0000000000..44fb7ed296 --- /dev/null +++ b/resources/js/tasks/components/ProcesoBrowser.vue @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index 4f495925e0..2a57bddf1f 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -3,10 +3,16 @@
@@ -27,19 +33,19 @@ export default { }, methods: { - openParticipantProcess(item) { - this.$emit('processParticipantSelected', item); + openProcessDashboard(item) { + if (item === 'process1') { + const router = this.$router || this.$root.$router; + router.push({ + path: '/', + query: { parametro: '1' } + }); + } + this.$emit('processDashboardSelected', item); }, - processTask(action) { - this.$emit('process-task', { - taskId: this.selectedTask.id, - action: action - }); - } } } - + diff --git a/resources/js/tasks/router.js b/resources/js/tasks/router.js new file mode 100644 index 0000000000..a3f0763807 --- /dev/null +++ b/resources/js/tasks/router.js @@ -0,0 +1,24 @@ +import Vue from "vue"; +import VueRouter from "vue-router"; +import ProcesoBrowser from "./components/ProcesoBrowser"; + +Vue.use(VueRouter); + +const router = new VueRouter({ + mode: "history", + base: "/tasks", + routes: [ + { + name: "proceso-browser", + path: "/", + component: ProcesoBrowser, + props(route) { + return { + procesoId: route.query.parametro || null + }; + } + } + ] +}); + +export default router; \ No newline at end of file diff --git a/webpack.mix.js b/webpack.mix.js index ef6c05502a..96d065d9c7 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -131,6 +131,7 @@ mix .js("resources/js/tasks/index.js", "public/js/tasks/index.js") .js("resources/js/tasks/mobile.js", "public/js/tasks/mobile.js") .js("resources/js/tasks/show.js", "public/js/tasks/show.js") + .js("resources/js/tasks/router.js", "public/js/tasks/router.js") .js("resources/js/notifications/index.js", "public/js/notifications/index.js") .js('resources/js/inbox-rules/index.js', 'public/js/inbox-rules') From 88c162ddb0520b96bfb6b3e9b7bebfb73b4a64fd Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 17 Dec 2024 18:49:12 -0400 Subject: [PATCH 08/20] Saving progress 3 --- .../components/ProcessesDashboardsMenu.vue | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index 2a57bddf1f..b05c83c740 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -1,18 +1,30 @@ @@ -36,10 +48,16 @@ export default { openProcessDashboard(item) { if (item === 'process1') { const router = this.$router || this.$root.$router; - router.push({ - path: '/', - query: { parametro: '1' } - }); + if (router.currentRoute.query.parametro !== '1') { + router.push({ + path: '/', + query: { parametro: '1' } + }).catch(err => { + if (err.name !== 'NavigationDuplicated') { + throw err; + } + }); + } } this.$emit('processDashboardSelected', item); }, From c569423de285d5adbac9a51026e67f64ed5ecba3 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 17 Dec 2024 18:58:36 -0400 Subject: [PATCH 09/20] Saving progress 4 --- .../components/ProcessesDashboardsMenu.vue | 119 +++++++++++------- 1 file changed, 73 insertions(+), 46 deletions(-) diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index b05c83c740..0fce0a2a26 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -1,29 +1,34 @@ diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index df1c54e470..0f720ac62f 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -76,18 +76,31 @@ export default { methods: { openProcessDashboard(id, type) { const router = this.$router || this.$root.$router; - const query = { [type]: id.toString() }; - - router - .push({ - name: type === "process" ? "process-browser" : "dashboard", - query: query, - }) - .catch((err) => { - if (err.name !== "NavigationDuplicated") { - throw err; - } - }); + + if (type === 'process') { + router + .push({ + name: "process-browser", + params: { processId: id.toString() } + }) + .catch((err) => { + if (err.name !== "NavigationDuplicated") { + throw err; + } + }); + } else { + // Para dashboards mantener la lógica actual + router + .push({ + name: "dashboard", + query: { dashboard: id.toString() } + }) + .catch((err) => { + if (err.name !== "NavigationDuplicated") { + throw err; + } + }); + } this.$emit("processDashboardSelected", { id, type }); }, diff --git a/resources/js/tasks/router.js b/resources/js/tasks/router.js index 4ec89cfa1d..211b427740 100644 --- a/resources/js/tasks/router.js +++ b/resources/js/tasks/router.js @@ -2,6 +2,7 @@ import Vue from "vue"; import VueRouter from "vue-router"; import ProcessBrowser from "./components/ProcessBrowser.vue"; import DashboardViewer from "./components/DashboardViewer.vue"; +import Process from "../processes-catalogue/components/Process"; Vue.use(VueRouter); @@ -10,11 +11,12 @@ const router = new VueRouter({ base: "/tasks", routes: [ { - path: "", + path: "/:processId?", name: "process-browser", - component: ProcessBrowser, + component: Process, props: route => ({ - processId: route.query.process || null + processId: parseInt(route.params.processId) || null, + process: null }) }, { From 233026a9dac344e1bd3f9a76d1c330fabdd4d76b Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Thu, 19 Dec 2024 11:43:43 -0400 Subject: [PATCH 16/20] modifying router.js to call tasks/process/{id} and tasks/dashboard/{id} --- .../components/ProcessesDashboardsMenu.vue | 54 +------------------ resources/js/tasks/router.js | 6 +-- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index 0f720ac62f..eab9f1e78d 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -52,17 +52,6 @@ export default { pmql: `user_id=${window.ProcessMaker.user.id}`, processesList: [], labelIcon: "Default Icon", - // processesList: [ - // { id: 1, name: "Process 1" }, - // { id: 2, name: "Process 2" }, - // { id: 3, name: "Process 3" }, - // { id: 4, name: "Process 4" }, - // { id: 5, name: "Process 5" }, - // { id: 6, name: "Process 6" }, - // { id: 7, name: "Process 7" }, - // { id: 8, name: "Process 8" }, - // { id: 9, name: "Process 9" }, - // ], dashboards: [ { id: 1, name: "Dashboard 1" }, { id: 2, name: "Dashboard 2" }, @@ -89,11 +78,10 @@ export default { } }); } else { - // Para dashboards mantener la lógica actual router .push({ name: "dashboard", - query: { dashboard: id.toString() } + params: { dashboardId: id.toString() } }) .catch((err) => { if (err.name !== "NavigationDuplicated") { @@ -123,46 +111,6 @@ export default { * Build URL for Process Cards */ buildURL() { - // if (this.categoryId === 'all_processes') { - // return "process_bookmarks/processes?" - // + `&page=${this.currentPage}` - // + `&per_page=${this.perPage}` - // + `&pmql=${encodeURIComponent(this.pmql)}` - // + "&bookmark=true" - // + "&launchpad=true" - // + "&cat_status=ACTIVE" - // + "&order_by=name&order_direction=asc"; - // } - // if (this.categoryId === 'bookmarks') { - // return `process_bookmarks?page=${this.currentPage}` - // + `&per_page=${this.perPage}` - // + `&pmql=${encodeURIComponent(this.pmql)}` - // + "&bookmark=true" - // + "&launchpad=true" - // + "&order_by=name&order_direction=asc"; - // } - // if (this.categoryId === 'all_templates') { - // return `templates/process?page=${this.currentPage}` - // + `&per_page=${this.perPage}` - // + `&filter=${encodeURIComponent(this.filter)}` - // + `&order_by=name` - // + `&order_direction=asc` - // + `&include=user,categories,category`; - // } - // return `process_bookmarks/processes?page=${this.currentPage}` - // + `&per_page=${this.perPage}` - // + `&category=${this.categoryId}` - // + `&pmql=${encodeURIComponent(this.pmql)}` - // + "&bookmark=true" - // + "&launchpad=true" - // + "&order_by=name&order_direction=asc"; - // return `process_bookmarks/processes?page=1` - // + `&per_page=10` - // + `&category=all_processes` - // + `&pmql=${encodeURIComponent(this.pmql)}` - // + "&bookmark=true" - // + "&launchpad=true" - // + "&order_by=name&order_direction=asc"; return `process_bookmarks/processes?page=1` + `&per_page=100` + `&pmql=${encodeURIComponent(this.pmql)}` diff --git a/resources/js/tasks/router.js b/resources/js/tasks/router.js index 211b427740..49b599d3d0 100644 --- a/resources/js/tasks/router.js +++ b/resources/js/tasks/router.js @@ -11,7 +11,7 @@ const router = new VueRouter({ base: "/tasks", routes: [ { - path: "/:processId?", + path: "/process/:processId", name: "process-browser", component: Process, props: route => ({ @@ -20,11 +20,11 @@ const router = new VueRouter({ }) }, { - path: "", + path: "/dashboard/:dashboardId", name: "dashboard", component: DashboardViewer, props: route => ({ - dashboardId: route.query.dashboard || null + dashboardId: route.params.dashboardId || null }) } ] From cb22d9a688c4c847383562448a8d881bd111c83c Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Fri, 20 Dec 2024 12:06:17 -0400 Subject: [PATCH 17/20] Saving progress Left Pane working, Process rendered ok in new Container --- resources/js/processes-catalogue/components/Process.vue | 4 +++- .../processes-catalogue/components/ProcessCollapseInfo.vue | 3 ++- .../processes-catalogue/components/ProcessHeaderStart.vue | 6 +++++- resources/js/processes-catalogue/components/ProcessInfo.vue | 4 ++-- .../js/processes-catalogue/components/ProcessScreen.vue | 3 ++- .../processes-catalogue/components/mixins/ProcessesMixin.js | 3 ++- resources/js/tasks/components/ProcessesDashboardsMenu.vue | 5 +---- resources/js/tasks/router.js | 3 ++- resources/views/tasks/index.blade.php | 5 +++++ 9 files changed, 24 insertions(+), 12 deletions(-) diff --git a/resources/js/processes-catalogue/components/Process.vue b/resources/js/processes-catalogue/components/Process.vue index 3c72323ca5..1096491bcc 100644 --- a/resources/js/processes-catalogue/components/Process.vue +++ b/resources/js/processes-catalogue/components/Process.vue @@ -25,11 +25,13 @@
@@ -44,7 +46,7 @@ import ProcessDescription from "./optionsMenu/ProcessDescription.vue"; import ProcessCounter from "./optionsMenu/ProcessCounter.vue"; export default { - props: ["process", "processId"], + props: ["process", "processId", "ellipsisPermission"], components: { ProcessInfo, ProcessScreen, MiniPieChart, Bookmark, ProcessDescription, ProcessCounter }, diff --git a/resources/js/processes-catalogue/components/ProcessCollapseInfo.vue b/resources/js/processes-catalogue/components/ProcessCollapseInfo.vue index 6dd2ef0f41..5439cf254a 100644 --- a/resources/js/processes-catalogue/components/ProcessCollapseInfo.vue +++ b/resources/js/processes-catalogue/components/ProcessCollapseInfo.vue @@ -3,6 +3,7 @@
+ :permission="$root.permission || ellipsisPermission" />
@@ -62,6 +62,10 @@ export default { enableCollapse: { type: Boolean, default: true + }, + ellipsisPermission: { + type: Array, + default: () => [] } }, data() { diff --git a/resources/js/processes-catalogue/components/ProcessInfo.vue b/resources/js/processes-catalogue/components/ProcessInfo.vue index b16fc7b969..77669f2ab6 100644 --- a/resources/js/processes-catalogue/components/ProcessInfo.vue +++ b/resources/js/processes-catalogue/components/ProcessInfo.vue @@ -4,6 +4,7 @@ v-show="hideLaunchpad" :process="process" :current-user-id="currentUserId" + :ellipsis-permission="ellipsisPermission" @goBackCategory="$emit('goBackCategory')" /> { this.firstImage = pos + 1; }); - }, computed: { }, diff --git a/resources/js/processes-catalogue/components/ProcessScreen.vue b/resources/js/processes-catalogue/components/ProcessScreen.vue index 1b6870cbfe..1431c6f40f 100644 --- a/resources/js/processes-catalogue/components/ProcessScreen.vue +++ b/resources/js/processes-catalogue/components/ProcessScreen.vue @@ -2,6 +2,7 @@
permissionsNeeded.includes(permission)); + const permissions = (this.$root && this.$root.permission) ? this.$root.permission : this.ellipsisPermission || []; + this.showEllipsis = permissions.some((permission) => permissionsNeeded.includes(permission)); }, /** * Return a process cards from process info diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index eab9f1e78d..cf7756336e 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -95,16 +95,13 @@ export default { loadProcesses(callback, message) { if(message === 'bookmark') { this.processesList = []; - //this.page = 1; } - //this.loading = true; const url = this.buildURL(); console.log("url PDM", url); ProcessMaker.apiClient .get(url) .then((response) => { this.processesList = this.processesList.concat(response.data.data); - console.log("this.processesList PDM", this.processesList); }); }, /** @@ -148,7 +145,7 @@ export default { .buttons-list { display: flex; flex-direction: column; - height: 250px; + height: 350px; overflow-y: auto; } diff --git a/resources/js/tasks/router.js b/resources/js/tasks/router.js index 49b599d3d0..d3205bf8f2 100644 --- a/resources/js/tasks/router.js +++ b/resources/js/tasks/router.js @@ -16,7 +16,8 @@ const router = new VueRouter({ component: Process, props: route => ({ processId: parseInt(route.params.processId) || null, - process: null + process: null, + ellipsisPermission: window.ProcessMaker.ellipsisPermission }) }, { diff --git a/resources/views/tasks/index.blade.php b/resources/views/tasks/index.blade.php index 41cb76000e..d2319e5ab7 100644 --- a/resources/views/tasks/index.blade.php +++ b/resources/views/tasks/index.blade.php @@ -159,6 +159,11 @@ window.ProcessMaker.userConfiguration = @json($userConfiguration ?? []); window.sessionStorage.setItem('elementDestinationURL', window.location.href); + @endsection From b5ef068c9cf68192c20063431ce71ed06394f5de Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Mon, 6 Jan 2025 17:45:24 -0400 Subject: [PATCH 18/20] improvements on loadProcess method --- .../components/ProcessesDashboardsMenu.vue | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/resources/js/tasks/components/ProcessesDashboardsMenu.vue b/resources/js/tasks/components/ProcessesDashboardsMenu.vue index cf7756336e..208137bdf5 100644 --- a/resources/js/tasks/components/ProcessesDashboardsMenu.vue +++ b/resources/js/tasks/components/ProcessesDashboardsMenu.vue @@ -92,12 +92,9 @@ export default { this.$emit("processDashboardSelected", { id, type }); }, - loadProcesses(callback, message) { - if(message === 'bookmark') { - this.processesList = []; - } + loadProcesses() { const url = this.buildURL(); - console.log("url PDM", url); + ProcessMaker.apiClient .get(url) .then((response) => { @@ -108,13 +105,12 @@ export default { * Build URL for Process Cards */ buildURL() { - return `process_bookmarks/processes?page=1` - + `&per_page=100` - + `&pmql=${encodeURIComponent(this.pmql)}` - + "&bookmark=true" - + "&launchpad=true" - + "&order_by=name&order_direction=asc" - + `&include=user,categories,category`; + return `process_bookmarks/processes? + &pmql=${encodeURIComponent(this.pmql)} + &bookmark=true + &launchpad=true + &order_by=name&order_direction=asc + &include=user,categories,category`; }, getIconProcess(process) { let icon = "Default Icon"; From 421e022633d8d70f85ac039e4aa83c05d191d431 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 7 Jan 2025 14:36:05 -0400 Subject: [PATCH 19/20] Ready for PR --- .../components/ParticipantHomeScreen.vue | 49 +++++++++++-------- .../components/ProcessesDashboardsMenu.vue | 25 ++++------ resources/js/tasks/router.js | 20 ++++---- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/resources/js/tasks/components/ParticipantHomeScreen.vue b/resources/js/tasks/components/ParticipantHomeScreen.vue index dcbc6a4435..e48e15bd2a 100644 --- a/resources/js/tasks/components/ParticipantHomeScreen.vue +++ b/resources/js/tasks/components/ParticipantHomeScreen.vue @@ -5,16 +5,9 @@ :class="{ 'menu-open': showMenu }" > -
-
-