Offer the Home dashboard as a default tag option - #1595
Merged
Conversation
In tags mode the taglist already renders the root tag (id 0) as a 'Home Dashboard' chip under the 0-dash slug, and tiles tagged only to the root carry tag-0-dash, so auto-selecting it on load works. The default_tag dropdown just never offered it because both the edit and display code paths filtered on id > 0. Move the option list into Setting::defaultTagOptions(), used by both paths, and put the root tag first followed by the pinned tags as before. Fixes #1589
list_value re-fetches the stored setting rather than reading the model attribute, so the test has to write the value to the DB.
|
Nice!! Thanks :) |
- Item::taglist() scope (home tag plus pinned tags) replaces the two identical closures in ItemController::dash and the hand-rolled copy in Setting::defaultTagOptions, which now needs one query and a pluck. - Fold the home-dashboard assertions into the existing dropdown test instead of duplicating its setup.
…dashboard # Conflicts: # tests/Feature/DashTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1589
What
With "treat tags as" = tags, the taglist already renders the root tag (id 0) as a Home Dashboard chip under the
0-dashslug, and tiles tagged only to the root carry thetag-0-dashclass, so the existing auto-select-on-load logic handles it fine. The Default tag setting simply never offered it: both the edit dropdown and the settings-list display filtered tags withid > 0.Fix
Setting::defaultTagOptions()builds the slug => title list used by both the edit dropdown and the list display (previously duplicated). The root tag comes first, then the pinned tags alphabetically as before.app.dashboardtranslation key, which both paths already run through__(), so it renders as "Home Dashboard" in the user's language.Tests
SettingsSeederTest: the dropdown offers0-dashwith the translated label, listed right after "none"; the list display shows the translated title when selected.DashTest: tags mode exposesdata-default-tag="0-dash"alongside the matching chip and tile class.