Skip to content

Update policy list empty state message

Alexander Turinske requested to merge 13632-update-empty-state-message into master

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
Screen_Shot_2022-08-23_at_1.11.27_PM Screen_Shot_2022-08-23_at_1.11.52_PM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Navigate to a project => Security & Compliance => Policies
  2. Verify the message of the empty state
  3. Link a policy project
  4. Verify the message of the empty state has changed
  5. Link to a different project
  6. Verify the message of the empty state has not changed
  7. Unlink the policy project
  8. 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.

Related to https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/13632+

Edited by Alexander Turinske

Merge request reports