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

Fixed #14114 - correctly sort related fields for labels #14162

Merged
merged 4 commits into from
Jan 24, 2024
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jan 24, 2024

Previously, if you selected multiple assets that were sorted in your list view, the labels would crash if you were sorting on something that wasn't directly on the assets table (category, model, location, status label, etc) with the error of

Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status_label' in 'order clause' (SQL: select * from `assets` where `id` in (68, 66) and `assets`.`deleted_at` is null order by `status_label` desc)

since assets.status_label isn't a field, and we have to reach through assets.status_id -> status_labels.id to find out the name of the status label an asset has (and the same goes for company, category, etc). We already have those query scopes set up, since they're the same ones the API and listings pages use, so this implements them here as well.

This fixes RB-17764 and sc-24511, and is related to #14114.

Copy link

what-the-diff bot commented Jan 24, 2024

PR Summary

  • Enhanced Sorting Functionality in Bulk Assets Management.
    • Enhanced the bulk assets controller with the ability to sort columns. This provides users with greater flexibility when viewing their asset data.
  • Updated Hidden Input Values for Sort Order.
    • Amended the hidden values in the assets bulk actions code, which means the system now remembers the user's preferred sort order for more personalized and efficient data browsing.
  • Optimized JavaScript code for user-friendly browsing.
    • The JavaScript code has been updated so it now organizes data based on the user's saved browsing preferences. This means a more seamless, user-centric browsing experience.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

One question but looks good 👍🏾

app/Http/Controllers/Assets/BulkAssetsController.php Outdated Show resolved Hide resolved
Signed-off-by: snipe <[email protected]>
@snipe snipe merged commit 57a8630 into develop Jan 24, 2024
8 checks passed
@snipe snipe deleted the bug/sc-24511 branch January 24, 2024 21:37
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