Skip to content

Migrate admin push rules alert to Pajamas ViewComponent

What does this MR do and why?

Migrate admin push rules alert to Pajamas ViewComponent

Related to #325401 (closed)

Screenshots or screen recordings

Before After
image image

Snapshot before

<div class="gl-alert gl-alert-danger">
  <p>Some error</p>
</div>

Snapshot after

<div class="gl-alert gl-alert-danger gl-alert-not-dismissible" role="alert">
  <svg class="s16 gl-alert-icon gl-alert-icon-no-title" data-testid="error-icon"><use href="/assets/icons-f305926186cfc3bb530f27269d545937c385578ba62adb0088d74f0d2d02cb56.svg#error"></use></svg>
  <div class="gl-alert-content" role="alert">
    <div class="gl-alert-body">
      <p>Some error</p>
    </div>
  </div>
</div>

How to set up and validate locally

To make this work without extensive setup

  1. You need ultimate license on your local instance
  2. Go to http://gdk.test:3000/admin/push_rule
  3. You may trick the UI to create the following alert
-  - if @push_rule.errors.any?
+  - if true
+  - #if @push_rule.errors.any?
     .gl-alert.gl-alert-danger
-      - @push_rule.errors.full_messages.each do |msg|
+      - #@push_rule.errors.full_messages.each do |msg|
+      - ['Some error'].each do |msg|

Tests

Edited by Alper Akgun

Merge request reports