Add functionality to show/hide based on role, any/all roles

Created on 30 May 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

Problem/Motivation

There are two scenarios that we'd like to address when using this module:
1. Sometimes we want to show a paragraph for all roles EXCEPT one or two. With a large number of roles this becomes cumbersome with the checkbox list.
2. Sometimes we want to show a paragraph if it has ALL roles selected, not just any.

Proposed resolution

For 1, taking a cue from the Menu Per Role β†’ , implement a hide role option.
For 2, add an option to specify for either if Any or All roles should be present. (Any is the default)

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States earthday47 New York

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

Comments & Activities

  • Issue created by @earthday47
  • @earthday47 opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States earthday47 New York

    Patch version of the merge request at this point (as this feature may change a bit in the future).

  • earthday47, thanx for suggestions.

    For 1, taking a cue from the Menu Per Role, implement a hide role option.

    To be honest, this solution seems redundant to me. Instead of making the form bigger - better to add additional checbox "Select all" wich will checked/unchecked available roles. In this case if you have 50 roles and 2 of them shouldn't see the paragraph - you click "Select all" and uncheck needed roles:

    For 2, add an option to specify for either if Any or All roles should be present. (Any is the default)

    Agree. And also as in previous point - in order not to inflate the form, it is better to make it a separate checkbox instead of a radio.

    This is a significant feature upgrade, so it will go into version 2 of the module. The branch is already created, I am also connecting to this development.

    It will also need to update the tests and write updates for a smooth transition from version 1 to 2.

  • Issue was unassigned.
  • Status changed to Fixed over 1 year ago
  • New features added to 2.x version of module.
    Feel free to open new tickets with suggestions.

  • πŸ‡ΊπŸ‡ΈUnited States earthday47 New York

    @fromme thanks for the merge! Yeah select all is a better experience, my form in the patch is overwhelming (site I'm using this on has 20+ roles)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024