Skip to content

Added: Manager View functionality for viewing subordinates' assets #16578

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

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from

Conversation

lukaskraic
Copy link

This PR implements a feature that allows managers to view assets assigned to their direct and indirect subordinates in their account view. This is useful for managers who need to keep track of assets used by their team.

Features

  • Added a new setting to enable/disable Manager View in the admin settings
  • Extended User model with methods to retrieve all subordinates recursively
  • Modified ViewAssetsController to allow managers to view assets of subordinates
  • Added dropdown selectors to easily switch between viewing different subordinates' assets
  • Added appropriate language strings for the new feature

Implementation Details

  • Uses the existing manager-subordinate relationship to build a hierarchical view
  • Optimized to prevent N+1 queries by eager loading relationships
  • Includes proper access control to ensure managers can only view their subordinates' assets

snipe added 30 commits February 25, 2025 12:18
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	config/version.php
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	config/version.php
snipe and others added 16 commits March 4, 2025 23:30
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/mix-manifest.json
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	config/version.php
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
@lukaskraic lukaskraic requested a review from snipe as a code owner March 28, 2025 10:31
Copy link

welcome bot commented Mar 28, 2025

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link

what-the-diff bot commented Mar 28, 2025

PR Summary

  • Manager View Addition: We've incorporated a new feature that allows managers to oversee assets allocated to their team members, by integrating a 'manager_view_enabled' setting in the application.
  • SettingsController Update: The functionality to store this new 'manager_view_enabled' setting has been added to the postSettings method.
  • ViewAssetsController Enhancements: The feature also allows the option to select and view assets of a specific team member, and this change has been implemented in getIndex method.
  • User Model Amendments: Features to manage hierarchies have been added with the new methods getAllSubordinates and isManagerOf in the User Model.
  • Database Expansion: A new migration introduces the addition of 'manager_view_enabled' column in the settings database.
  • Language Translation Additions: Necessary language translations for the manager view feature have also been added to relevant language files.
  • Visual Interface Enhancements:
    • Changes in page layout templates enable a dropdown menu to select team members when manager view is active.
    • Settings view now includes an option to activate this manager view feature.
  • Service Provider Adjustments: We've fine-tuned the AppServiceProvider to share 'subordinates' and 'settings' data across the application if the user is logged in with the manager view turned on.

@snipe
Copy link
Member

snipe commented Apr 8, 2025

Looks like we have some conflicts and also this might need a pull and rebase, as I'm seeing an awful lot of my own commits here. Makes it kinda hard to see which bits you changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants