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 "toggle all" to column selector #14464

Merged
merged 6 commits into from Mar 20, 2024
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Mar 20, 2024

This is only partially implemented, since I'm not 100% sure if this is behavior we want. This adds a "toggle all" checkbox to the column selector, which could be super useful, but in making something "un-switchable" it pulls it from the column selector altogether. The exception here is ID, which is magical for bootstrap-table.

All_Assets____Snipe-IT_Demo-2 Screenshot 2024-03-20 at 12 14 27 PM
Screen.Recording.2024-03-20.at.11.32.40.AM.mov

I'm not sure if we want to pull those out of the column selector (even though it makes sense, since it's already on the page 100% of the time), but it makes ID un-hideable (unless you toggle all off and then back on, and unselect ID from the selector). It seems like it could be useful for some people, but could also potentially be disruptive. I'd be interested in feedback on this.

The only ones I'd expect to not be toggle able are things like name, asset tag, etc - things that are required by the system.

Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
Copy link

what-the-diff bot commented Mar 20, 2024

PR Summary

  • Disable "Switch" Functionality in Asset, Location, and User Data Tables
    The capability to switch views in the asset, location, and user data tables has been disabled. This was achieved through a modification in the AssetPresenter.php, LocationPresenter.php, and UserPresenter.php files, where 'switchable' => false was added to the dataTableLayout function.

  • Change User Data Table Avatar Title to Locale
    The title for Avatar in the user data table has been adjusted to reflect the locale settings. This change was implemented within the UserPresenter.php file, where 'title' => 'Avatar' was replaced with 'title' => trans('general.importer.avatar').

  • Add "Show All Columns" Functionality in Hardware, Locations, and User Tables
    A "Show All Columns" functionality has been added to the bootstrap table configurations in hardware/index.blade.php, locations/index.blade.php, and users/index.blade.php. This is characterized by the addition of data-show-columns-toggle-all="true" in these three files.

  • Standardize Export Options in Bootstrap Table Configuration
    The export options for the bootstrap table have been standardized across the system within the partials/bootstrap-table.blade.php file. exportOptions: export_options, was replaced with exportOptions: export_options,, ensuring that the export options remain consistent.

@snipe
Copy link
Owner Author

snipe commented Mar 20, 2024

(If we decide this is a path we want to go down, I will update this PR with additional toggles for the other listing pages. )

@spencerrlongg
Copy link
Collaborator

I'm a fan of this, I don't have any problem with them being pulled out of the menu. The ID issue is unfortunate but I think it's still intuitive enough that it's worth continuing with.

@snipe
Copy link
Owner Author

snipe commented Mar 20, 2024

Where I think this could get tricky - I would, for example, likely want to make the checkin/checkout button on the assets listing view a field that can't be hidden. It should, I'd think, always be visible. But I wonder if there isn't a scenario where people don't want that button. (I'd expect folks to just export or use a custom asset report in that scenario, but I also don't want to break stuff for people if they have a workflow I don't know about.)

@marcusmoore
Copy link
Collaborator

The ID issue is unfortunate but I think it's still intuitive enough that it's worth continuing with.

Agreed

I would, for example, likely want to make the checkin/checkout button on the assets listing view a field that can't be hidden. It should, I'd think, always be visible.

I think it would be ideal to always have those buttons showing but I don't think it should hold up implementing this.

A nice UX, that is probably outside of the scope of this PR, would be to have a way to go "back to defaults" to show the columns that appear by default when you first run the application. In trying this I toggled off all of the columns, then went "oh crap what did I normally see here?", and manually went through the list to turn on the ones I was used to seeing. But again, that's a "nice-to-have" and not necessary in my opinion.

Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
@snipe snipe merged commit de18e44 into develop Mar 20, 2024
8 checks passed
@snipe snipe deleted the features/toggle_all_columns branch March 20, 2024 21:30
@snipe
Copy link
Owner Author

snipe commented Mar 20, 2024

FYI, I handled this at the BS tables level instead. Same result, just means fewer things to change, since the BS tables code gets implemented everywhere.

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.

None yet

3 participants