Update UX behavior when autopopulating allowlist entries
What does this MR do and why?
Implements the fifth item in #498125 (closed). Depends on !179212 (merged) being merged first.
This is developed under the authentication_logs_migration_for_allowlist feature flag.
This MR includes the following changes:
- Moving loading behavior to be page-level instead of modal-level
- Update copy text on modal
- Refetch Authorized groups and projects setting after auto-populating the allowlist
- Hide allowlist actions if there are no entries to be added/removed
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Implements #498125 (closed)
- Discussion: Update modal text and refetch job token setting after adding auth log entries
- UX Change Discussion: Update loading state behavior to be on page-level
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
| Screen_Recording_2025-02-27_at_12.59.59 | Screen_Recording_2025-02-27_at_12.28.38 |
Without Auth Log Entries
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Enable the feature flag.
Feature.enable(:authentication_logs_migration_for_allowlist) -
Create sample authorization log records in the rails console:
project = Project.first project2 = Project.second project3 = Project.third Ci::JobToken::Authorization.create(accessed_project: project, origin_project: project2, last_authorized_at: 1.day.ago) Ci::JobToken::Authorization.create(accessed_project: project, origin_project: project3, last_authorized_at: 1.day.ago) Ci::JobToken::Authorization.all Ci::JobToken::ProjectScopeLink.where(source_project: project) -
Visit the Job token permissions section of the CI/CD settings.
<path-to-project>/-/settings/ci_cd#js-token-access. -
Make sure that the Authorized groups and projects setting is set to
All groups and projects. -
In CI/CD job token allowlist click Add > All projects in authentication log > Add entries. The allowlist will refresh with the new entries.
-
Verify the following changes:
- Modal text is updated
- The loading state is moved to the page-level (in the table) instead of modal-level
-
Authorized groups and projects setting has been updated to
Only this project and any groups and projects in the allowlist
