Skip to content

feature/FOUR-18630 #7438

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

Merged
merged 2 commits into from
Oct 1, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Facades\Auth;
use ProcessMaker\Events\ScreenBuilderStarting;
use ProcessMaker\Helpers\MobileHelper;
use ProcessMaker\Http\Controllers\Api\UserConfigurationController;
use ProcessMaker\Http\Controllers\Controller;
use ProcessMaker\Managers\ScreenBuilderManager;
use ProcessMaker\Models\Bookmark;
Expand Down Expand Up @@ -46,7 +47,7 @@ public function index(Request $request, Process $process = null)

return view('processes-catalogue.mobile', compact('title', 'process', 'currentUser', 'manager'));
}

return view('processes-catalogue.index', compact('process', 'currentUser', 'manager'));
$userConfiguration = (new UserConfigurationController())->index()['ui_configuration'];
return view('processes-catalogue.index', compact('process', 'currentUser', 'manager', 'userConfiguration'));
}
}
3 changes: 3 additions & 0 deletions ProcessMaker/Http/Controllers/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use ProcessMaker\Filters\SaveSession;
use ProcessMaker\Helpers\DefaultColumns;
use ProcessMaker\Helpers\MobileHelper;
use ProcessMaker\Http\Controllers\Api\UserConfigurationController;
use ProcessMaker\Http\Controllers\Controller;
use ProcessMaker\Managers\DataManager;
use ProcessMaker\Managers\ScreenBuilderManager;
Expand Down Expand Up @@ -193,6 +194,7 @@ public function show(ProcessRequest $request, Media $mediaItems)
}

UserResourceView::setViewed(Auth::user(), $request);
$userConfiguration = (new UserConfigurationController())->index();

return view('requests.show', compact(
'request',
Expand All @@ -208,6 +210,7 @@ public function show(ProcessRequest $request, Media $mediaItems)
'isProcessManager',
'eligibleRollbackTask',
'errorTask',
'userConfiguration',
));
}

Expand Down
3 changes: 3 additions & 0 deletions ProcessMaker/Http/Controllers/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use ProcessMaker\Helpers\DefaultColumns;
use ProcessMaker\Helpers\MobileHelper;
use ProcessMaker\Http\Controllers\Api\ProcessRequestController;
use ProcessMaker\Http\Controllers\Api\UserConfigurationController;
use ProcessMaker\Jobs\MarkNotificationAsRead;
use ProcessMaker\Managers\DataManager;
use ProcessMaker\Managers\ScreenBuilderManager;
Expand Down Expand Up @@ -140,6 +141,7 @@ public function edit(ProcessRequestToken $task, string $preview = '')
'timezone',
'datetime_format',
]);
$userConfiguration = (new UserConfigurationController())->index();

return view('tasks.edit', [
'task' => $task,
Expand All @@ -153,6 +155,7 @@ public function edit(ProcessRequestToken $task, string $preview = '')
'currentUser' => $currentUser,
'screenFields' => $screenFields,
'taskDraftsEnabled' => $taskDraftsEnabled,
'userConfiguration' => $userConfiguration,
]);
}
}
Expand Down
24 changes: 22 additions & 2 deletions resources/js/processes-catalogue/components/ProcessesCatalogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
components: {
MenuCatologue, CatalogueEmpty, Breadcrumbs,
},
props: ["currentUserId", "process", "currentUser"],
props: ["currentUserId", "process", "currentUser", "userConfig"],
data() {
return {
showMenu: false,
Expand Down Expand Up @@ -103,7 +103,9 @@ export default {
categoryCount: 0,
hideLaunchpad: true,
currentWidth: 0,
mobileApp: window.ProcessMaker.mobileApp
mobileApp: window.ProcessMaker.mobileApp,
userConfiguration: this.userConfig,
urlConfiguration: "users/configuration",
};
},
mounted() {
Expand All @@ -118,6 +120,7 @@ export default {
this.$root.$on('filter-categories', (filter) => {
this.filterCategories(filter);
});
this.defineUserConfiguration();
},
watch: {
category: {
Expand All @@ -136,9 +139,26 @@ export default {
}
},
methods: {
defineUserConfiguration() {
this.showMenu = this.userConfiguration.launchpad.isMenuCollapse;
},
hideMenu() {
this.showMenu = !this.showMenu;
this.$root.$emit("sizeChanged", !this.showMenu);
this.updateUserConfiguration();
},
updateUserConfiguration() {
this.userConfiguration.launchpad.isMenuCollapse = this.showMenu;
ProcessMaker.apiClient
.put(
this.urlConfiguration,
{
ui_configuration: this.userConfiguration,
},
)
.catch((error) => {
console.error("Error", error);
});
},
/**
* Add new page of categories
Expand Down
1 change: 1 addition & 0 deletions resources/views/processes-catalogue/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:process="{{$process ?? 0}}"
:current-user-id="{{ \Auth::user()->id }}"
:current-user="{{ \Auth::user() }}"
:user-config="{{$userConfiguration ?? []}}"
>
</processes-catalogue>
</div>
Expand Down
21 changes: 21 additions & 0 deletions resources/views/requests/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ class="btn btn-outline-info btn-block"
showTree: false,
showInfo: true,
showMenu: true,
userConfiguration: @json($userConfiguration),
urlConfiguration:'users/configuration',
};
},
computed: {
Expand Down Expand Up @@ -649,9 +651,27 @@ classStatusCard() {
},
},
methods: {
defineUserConfiguration() {
this.userConfiguration = JSON.parse(this.userConfiguration.ui_configuration);
this.showMenu = this.userConfiguration.requests.isMenuCollapse;
},
hideMenu() {
this.showMenu = !this.showMenu;
this.$root.$emit("sizeChanged", !this.showMenu);
this.updateUserConfiguration();
},
updateUserConfiguration() {
this.userConfiguration.requests.isMenuCollapse = this.showMenu;
ProcessMaker.apiClient
.put(
this.urlConfiguration,
{
ui_configuration: this.userConfiguration,
}
)
.catch((error) => {
console.error("Error", error);
});
},
switchTab(tab) {
this.activeTab = tab;
Expand Down Expand Up @@ -850,6 +870,7 @@ classStatusCard() {
this.listenRequestUpdates();
this.cleanScreenButtons();
this.editJsonData();
this.defineUserConfiguration();
},
});
</script>
Expand Down
21 changes: 21 additions & 0 deletions resources/views/tasks/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ class="multiselect__tag-icon"></i>
userHasInteracted: false,
caseTitle: "",
showMenu: true,
userConfiguration: @json($userConfiguration),
urlConfiguration:'users/configuration',
},
watch: {
task: {
Expand Down Expand Up @@ -526,9 +528,27 @@ class="multiselect__tag-icon"></i>
},
},
methods: {
defineUserConfiguration() {
this.userConfiguration = JSON.parse(this.userConfiguration.ui_configuration);
this.showMenu = this.userConfiguration.tasks.isMenuCollapse;
},
hideMenu() {
this.showMenu = !this.showMenu;
this.$root.$emit("sizeChanged", !this.showMenu);
this.updateUserConfiguration();
},
updateUserConfiguration() {
this.userConfiguration.tasks.isMenuCollapse = this.showMenu;
ProcessMaker.apiClient
.put(
this.urlConfiguration,
{
ui_configuration: this.userConfiguration,
}
)
.catch((error) => {
console.error("Error", error);
});
},
createRule() {
window.location.href = '/tasks/rules/new?' +
Expand Down Expand Up @@ -777,6 +797,7 @@ class="multiselect__tag-icon"></i>
interactionListener.addEventListener('keydown', (event) => {
this.sendUserHasInteracted();
});
this.defineUserConfiguration();
}
});
window.ProcessMaker.breadcrumbs.taskTitle = @json($task->element_name);
Expand Down
Loading