Skip to content
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

Added the ability to bulk print users #15534

Merged
merged 20 commits into from
Sep 25, 2024
Merged

Conversation

marcusmoore
Copy link
Collaborator

@marcusmoore marcusmoore commented Sep 20, 2024

Description

This PR allows printing all assigned items for multiple users via the bulk actions menu on the user index page.

new menu item


Here's what will be rendered in the browser:
example page


And bringing up the print dialog will put all of the users on a separate page:
print page


  • but ...should I update the column selector to do the same? It currently only affects the current table unless the page is refreshed:
    Column selection

Some additional details...

I updated the existing template, users.print, to accept multiple users and render them in a foreach on the front end.

When rendering multiple users I added a button to the top of the page to show and hide all of the EULAs on the page so they can be included in printing:
Show Hide EULAs


Partially addresses sc-18607


Type of change

  • New feature (non-breaking change which adds functionality)

Copy link

what-the-diff bot commented Sep 20, 2024

PR Summary

  • Improvement of the printInventory feature
    The printInventory function, found in our software's UsersController, has been enhanced. Now it loads related data from 'assets,' 'accessories,' 'consumables,' and 'licenses' in a single go. We also streamlined the way it displays data, making it easier to understand and read.

  • Introduction of printAllThings feature
    We've added a new function, printAllThings, also to the UsersController. This function aggregates data about all users and their connected data in one place, providing a comprehensive overview.

  • New access path print-all-things
    To make the new printAllThings function accessible, we've created a route titled print-all-things. Use this route to quickly gather all user-related data.

  • Creation of print-shell.blade.php template
    A new display template, print-shell.blade.php, has been created to visually present user data. This template includes all necessary styles and scripts for it to look good and work efficiently.

->withTrashed()
->findMany($request->input('ids'));

$users->each(fn($user) => $this->authorize('view', $user));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not positive about this since the top of the controller method has $this->authorize('update', User::class);...might end up in a place where the user has access to view users but not update them?

Or maybe I should make this $this->authorize('view', User::class);?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can start with $this->authorize('view', User::class); and add the stronger gates within that faux-router controller method.

@marcusmoore marcusmoore marked this pull request as ready for review September 24, 2024 00:19
@marcusmoore
Copy link
Collaborator Author

@snipe this is ready for a review. Please check out my question in the description noted with the ❓ and my review comment.

@snipe snipe merged commit 9b03f46 into snipe:develop Sep 25, 2024
9 checks passed
@marcusmoore marcusmoore deleted the bulk-print-users branch September 25, 2024 19:00
snipe added a commit that referenced this pull request Sep 25, 2024
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