Preselect Views by administrative tags

Created on 11 November 2017, over 7 years ago
Updated 20 January 2025, about 1 month ago

I would be helpful to be able to preselect not only by view but by administrative tag.

So one could be "frontend", and I only can select views with this administrative tag.

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany demonde

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States pingevt

    Looks like this might need a new patch against the development branch...

  • First commit to issue fork.
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks for bumping. To get this up to date would need to convert to merge request against latest dev + add test coverage. Thanks!

  • Pipeline finished with Failed
    about 1 month ago
    Total: 340s
    #401100
  • Pipeline finished with Success
    about 1 month ago
    Total: 271s
    #401107
  • Pipeline finished with Failed
    about 1 month ago
    Total: 304s
    #401975
  • Pipeline finished with Success
    about 1 month ago
    Total: 250s
    #401985
  • Pipeline finished with Failed
    about 1 month ago
    Total: 256s
    #401990
  • Pipeline finished with Failed
    about 1 month ago
    Total: 243s
    #401997
  • Pipeline finished with Failed
    about 1 month ago
    Total: 229s
    #401999
  • Pipeline finished with Failed
    about 1 month ago
    Total: 262s
    #402005
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 90s
    #402021
  • Pipeline finished with Success
    about 1 month ago
    Total: 260s
    #402024
  • πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

    In the merge request I've implemented the changes from the patch in #9 on a new branch created from the 8.x-2.x branch.

    In addition to implementing the patch, I've added the following improvements:

    1. Added a mechanism for presenting the views tags to the user configuring the field instead of having them enter a CSV.
    2. Added config schema, the data is stored as an unvalidateable sequence :puke: which is different from core views which stores these tags as an unvalidateable string (aside from primitive type checking obviously).
    3. Added a PHPUnit test
    4. Added a update function for updating the config schema.
  • Pipeline finished with Success
    about 1 month ago
    Total: 259s
    #402040
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks for all the work on this! I tested it out and have a couple bits of feedback:

    1. When I attempted with the default form display (autocomplete) it does not change anything. Looking further this actually seems like the Views Reference field type as a whole is ignored for Autocomplete, but I think we need to consider that as a follow-up (ie, "Preselect View Options" is already ignored there) as it can have wider implications for sites where the 'Preselect View Options' has already been ignored in autocomplete.
    2. I found the UX a bit confusing, as the 'Limit by Views tag(s)' is not actually limiting. I tagged Recent Content and Recent Comments core blocks with 'recent' then created a third View with Block display 'Other view' without tagging it. I ticked 'Other view' in 'Preselect View Options' then went to create a node with a Views Reference field with Select widget and saw all 3 views. So rather than 'Limit' its more like 'In addition to "Preselect View Options", automatically allow any Views with the following tags' (wording not sure of).

    So ultimately I think if we just reword things in (2), I think we are good to go?

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Added follow-up for my comment #1 πŸ› 'Preselect View Options' is ignored with the Autocomplete widget Active

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Actually exists already as πŸ› Preselect doesn't work with autocomplete field. Needs review

  • Pipeline finished with Canceled
    about 1 month ago
    Total: 30s
    #404016
  • Pipeline finished with Success
    about 1 month ago
    Total: 263s
    #404017
  • πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

    FYI I've created an issue on the User Guide project to add documentation for views administrative tags. https://www.drupal.org/project/user_guide/issues/3501820 ✨ Add help information about view meta data like tags and title and description etc. Active

  • πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

    Updated Issue Title

  • Pipeline finished with Success
    about 1 month ago
    Total: 376s
    #404053
  • πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

    I mostly agree with #15 and believe that I have addressed the interface issues. I think we should hash out whether this functionality should be a global setting or a widget setting over in πŸ› Preselect doesn't work with autocomplete field. Needs review . I've added a comment over there with my thoughts πŸ› Preselect doesn't work with autocomplete field. Needs review . Also, feel free to ignore any of my suggestions.

    When I attempted with the default form display (autocomplete) it does not change anything. Looking further this actually seems like the Views Reference field type as a whole is ignored for Autocomplete, but I think we need to consider that as a follow-up (ie, "Preselect View Options" is already ignored there) as it can have wider implications for sites where the 'Preselect View Options' has already been ignored in autocomplete.
    I found the UX a bit confusing, as the 'Limit by Views tag(s)' is not actually limiting. I tagged Recent Content and Recent Comments core blocks with 'recent' then created a third View with Block display 'Other view' without tagging it. I ticked 'Other view' in 'Preselect View Options' then went to create a node with a Views Reference field with Select widget and saw all 3 views. So rather than 'Limit' its more like 'In addition to "Preselect View Options", automatically allow any Views with the following tags' (wording not sure of).

Production build 0.71.5 2024