Skip to content

Generic Vue Alert Component

Zack Cuddy requested to merge 197113-vue-alert into master

What does this MR do?

Closes #197113 (closed)

This MR adds a generic wrapper of GlAlert so that our backend HAML files have a way to access a more flexible Flash message.

Testing outside of Unit Testing

I am not quite sure how to properly show that this component works outside adding it into a file temporarily for demonstration. Here is the extra code I added to get the screenshot below:

Add to top of /ee/app/views/admin/geo/nodes/index.html.haml

- if true
  .js-vue-alert{ data: { variant: 'tip', 
    message: 'This GitLab instance is licensed at the Core tier. Geo is only available for users who have at least a Premium license.',
    primary_button_text: 'Manage your license',
    primary_button_link: admin_license_path,
    dismissible: true.to_s } }

Add a new file ee/app/assets/javascripts/pages/admin/geo/index.js

import initVueAlerts from '~/vue_alerts';

initVueAlerts();

Screenshots

Example of the Alert: Alert_with_Component

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #197113 (closed) cc: @nfriend

Edited by Zack Cuddy

Merge request reports