Skip to content

Migrate deprecated bs-callout to alert component in clusters banner

Taras Tadai requested to merge 440832-migrate-clusters-banner-to-alert into master

What does this MR do and why?

Migrate deprecated bs-callout to Pajamas::AlertComponent in app/views/clusters/clusters/_banner.html.haml

It's a part of Pajamas adoption project

Changed according to migration guide available in next epic: &5213

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

Before After
cluster_alerts_old cluster_alerts_new

How to set up and validate locally

  1. Allow to use clusters UI, I just remove(comment) render_404 unless clusterable.certificate_based_clusters_enabled? in app/controllers/clusters/clusters_controller.rb#L107 to skip check.
  2. Go to some group clusters: http://127.0.0.1:3000/groups/gitlab-org/-/clusters (Docs: https://docs.gitlab.com/ee/user/group/clusters/index.html )
  3. Create new cluster Connect a cluster (deprecated) with any values
  4. Once you save this new cluster (click on Add Kubernetes cluster) you will be redirected to edit cluster page.
  5. Check different messages on this page.
  6. To emulate and see these messages I used next approach. Assign current cluster instance to global window object window.CurrentCluster = this; here app/assets/javascripts/clusters/clusters_bundle.js#L34 to be able to call methods on it.
  7. Emulate banner message from the browser's dev console:
// show creating message
CurrentCluster.updateContainer(null, 'scheduled')

// show success message
CurrentCluster.isNewlyCreated = true;
CurrentCluster.updateContainer(null, 'created');

// show error message
CurrentCluster.updateContainer(null, 'errored', 'Test error')

// hide all
CurrentCluster.hideAll()

Related to #440832 (closed)

Merge request reports