Migrate deprecated bs-callout to alert component in clusters banner
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 |
---|---|
![]() |
![]() |
How to set up and validate locally
- 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. - 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 )
- Create new cluster
Connect a cluster (deprecated)
with any values - Once you save this new cluster (click on
Add Kubernetes cluster
) you will be redirected to edit cluster page. - Check different messages on this page.
- To emulate and see these messages I used next approach. Assign current cluster instance to global
window
objectwindow.CurrentCluster = this;
here app/assets/javascripts/clusters/clusters_bundle.js#L34 to be able to call methods on it. - 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)