Skip to content

Search the whole grid when one permission is selected in non-granular mode#3

Open
mpmadhavig wants to merge 4 commits into
granular-console-scopes-basefrom
legacy-permissions-grid-search
Open

Search the whole grid when one permission is selected in non-granular mode#3
mpmadhavig wants to merge 4 commits into
granular-console-scopes-basefrom
legacy-permissions-grid-search

Conversation

@mpmadhavig

Copy link
Copy Markdown
Owner

Summary

Legacy (non-granular) console permission mode now lights up every row whose eligibility scopes the selection covers — the same "impact closure" behaviour granular mode already had. Selecting Edit or View on a single row now propagates to every other row backed by the same underlying management scopes.

Changes

  • create-console-role-wizard-permissions-form.tsx: added deriveLegacySelectedFromScopes and applyLegacySelectionChange — legacy counterparts of the granular derive/apply pair. Every legacy row change (checkbox, read/write toggle, accordion select-all) funnels through a shared setLegacyRowLevel helper so the closure fires uniformly. Fixed accordion select-all indeterminate state and wired it to the tenant checkbox.
  • console-role-permissions.tsx (role-edit view): removed the useEligibilityScopes flag so per-action feature scopes are always stripped from eligibility, keeping the edit view in lockstep with the wizard.
  • get-eligibility-scope-names.ts: added _view to the per-action feature scope suffix list. Without it, console:<feature>_view placeholders were being retained in eligibility checks and blocking coverage tests for collections whose write scope set implicitly depended on the view scope.
  • user-groups-edit.tsx: guarded useRequiredScopes against undefined.
  • console-settings.ts (i18n): reworded permissionsCount to be count-safe.

Test plan

  • With granular permissions disabled, select Edit/View on one row → every row sharing the same underlying management scopes lights up together.
  • Unchecking a row / downgrading write→read drops the marginal scopes without disturbing shared read scopes on other rows.
  • Accordion select-all still flips every row on/off; indeterminate state renders when only some rows are selected.
  • Granular mode behaviour is unchanged (_view strip also benefits granular's View column but no regression to existing paths).
  • Role-edit view (existing role) shows the same grid state as the wizard for the same underlying scopes.

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant