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 #12635 - dashboard category should not show archived #12638

Merged
merged 3 commits into from
Mar 10, 2023

Conversation

snipe
Copy link
Owner

@snipe snipe commented Mar 8, 2023

This fixed #12635, where the number of assets by category was not reflecting the Admin Settings > General > Show Archived in Lists setting.

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

what-the-diff bot commented Mar 8, 2023

  • Added a new method to the Category model called showableAssets()
  • Updated CategoriesController index function to use this new method instead of assets(). This allows us to override the Admin Setting for showing archived items in lists, which is useful when using API integrations that may need access to those records.
  • Fixed an issue where we were not counting correctly on category view pages (view/categories/view) and dashboard page (resources/views/dashboard). We were previously calling AssetsForShow(), but should have been calling count() directly since it's already being filtered by default based on settings within Asset::scopeAssetsForShow().

Signed-off-by: snipe <snipe@snipe.net>
@snipe snipe merged commit d1d89f8 into develop Mar 10, 2023
@snipe snipe deleted the fixes/dashboard_category_count_with_show_archived branch March 10, 2023 22:19
@Mulder0571
Copy link

I'm sorry I am not sure If we are supposed to something on our end, but I don't see any changes to our Snipe? Still showing the incorrect number in the categories section until you click the link.

@snipe
Copy link
Owner Author

snipe commented Mar 15, 2023

@Mulder0571 you'd want to run the upgrade script if you're self-hosted. If you're hosted by us, just shoot us an email at support@snipeitapp.com and ask for an upgrade to latest (make sure you mention your hosted subdomain so we know who you are 😄 )

@Mulder0571
Copy link

Mulder0571 commented Mar 15, 2023 via email

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