Update policy list empty state message
What does this MR do and why?
Describe in detail what your merge request does and why.
Update policy list empty state message
- update message to be different for when a policy project is not linked
- update tests
- refactor tests to be more readable and reuse strings
Previously if a security policy project was not linked, the message would still say "This project does not contain any security policies"; now there is a distinction in the message between a project being linked that does not have any policies and a project not being linked at all.
I did this by introducing the hasPolicyProject
flag, which is updated/emitted from the PolicyHeader when a user links/unlinks a policy project. hasPolicyProject is emitted from policy_header.vue
, up to policies_app.vue
, and then passed down to policies_list.vue
and then to no_policies_empty_state.vue
Changelog: added
EE: true
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Navigate to a project => Security & Compliance => Policies
- Verify the message of the empty state
- Link a policy project
- Verify the message of the empty state has changed
- Link to a different project
- Verify the message of the empty state has not changed
- Unlink the policy project
- Verify the message of the empty state has changed
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/13632+