Migrate issuable form branch chooser alert to Pajamas ViewComponent
requested to merge 325394-migrate-to-pajamas-alertcomponent-viewcomponent-in-app-views-shared-issuable-form into master
What does this MR do and why?
Migrate issuable form branch chooser alert to Pajamas ViewComponent
Related to Migrate to Pajamas::AlertComponent ViewComponen... (#325394 - closed)
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
Snapshot before
<div class="gl-alert gl-alert-warning gl-alert-not-dismissible gl-max-content gl-mt-4">
<div class="gl-alert-container">
<div class="gl-alert-content" role="alert">
<svg class="s16 gl-icon gl-alert-icon gl-alert-icon-no-title" data-testid="warning-icon"><use href="/assets/icons-f305926186cfc3bb530f27269d545937c385578ba62adb0088d74f0d2d02cb56.svg#warning"></use></svg>
<div class="gl-alert-body">
<br>
Review the target project before submitting to avoid exposing private changes.
</div>
</div>
</div>
</div>
Snapshot after
<div class="gl-alert gl-alert-warning gl-alert-not-dismissible gl-max-content gl-mt-4" role="alert">
<svg class="s16 gl-alert-icon gl-alert-icon-no-title" data-testid="warning-icon"><use href="/assets/icons-f305926186cfc3bb530f27269d545937c385578ba62adb0088d74f0d2d02cb56.svg#warning"></use></svg>
<div class="gl-alert-content" role="alert">
<div class="gl-alert-body">
<br>
Review the target project before submitting to avoid exposing private changes.
</div>
</div>
</div>
How to set up and validate locally
- Go to and issue and create a new merge request on any project screen (http://gdk.test:3000/testg/testp/-/merge_requests/new?merge_request%5Bissue_iid%5D=1&merge_request%5Bsource_branch%5D=1-do-this&merge_request%5Btarget_branch%5D=main)
- On that screen, use the following diff
a/app/views/shared/issuable/form/_branch_chooser.html.haml
to show the alert
+- visibilityMismatchString = i18n["#{0}#{10}"]
+- if true #source_level < target_level
Edited by Alper Akgun