diff --git a/app/assets/stylesheets/page_bundles/commits.scss b/app/assets/stylesheets/page_bundles/commits.scss index 589cc7988f97123e9e3c74d80a674a58f3ace3f0..e43f99914f7b3586748c59cb3c60d463b2b0497f 100644 --- a/app/assets/stylesheets/page_bundles/commits.scss +++ b/app/assets/stylesheets/page_bundles/commits.scss @@ -4,10 +4,6 @@ + .commits-row { border-top: 1px solid var(--gray-50, $gray-50); } - - + .commits-empty { - display: none; - } } .add-review-item { diff --git a/app/assets/stylesheets/page_bundles/merge_request.scss b/app/assets/stylesheets/page_bundles/merge_request.scss index 68abb1c980f22a18523476066ced30a17c6032ff..4219bd25f916728debbe81ba643f4cb87ebf6b4e 100644 --- a/app/assets/stylesheets/page_bundles/merge_request.scss +++ b/app/assets/stylesheets/page_bundles/merge_request.scss @@ -60,19 +60,6 @@ $comparison-empty-state-height: 62px; min-height: $comparison-empty-state-height; } -.commits-empty { - text-align: center; - - h4 { - padding-top: 20px; - padding-bottom: 10px; - } - - svg { - width: 230px; - } -} - .nothing-here-block { img { width: 230px; diff --git a/app/views/projects/merge_requests/_commits.html.haml b/app/views/projects/merge_requests/_commits.html.haml index ee0ab984d6fb609b0541379998cf06cb88762200..b4d62a200d3351ab3afd5787a32dce2f0fad3985 100644 --- a/app/views/projects/merge_requests/_commits.html.haml +++ b/app/views/projects/merge_requests/_commits.html.haml @@ -1,13 +1,11 @@ - can_update_merge_request = can?(current_user, :update_merge_request, @merge_request) - if @commits.empty? && @context_commits.empty? - .commits-empty.mt-5 - = custom_icon ('illustration_no_commits') - %h4 - = _('There are no commits yet.') - - if can_update_merge_request - %p - = _('Push commits to the source branch or add previously merged commits to review them.') + = render Pajamas::EmptyStateComponent.new(svg_path: 'illustrations/empty-state/empty-commit-md.svg', + title: _('There are no commits yet')) do |c| + + - c.with_description do + %p= _('Push commits to the source branch or add previously merged commits to review them.') = render Pajamas::ButtonComponent.new(variant: 'confirm', button_options: { class: 'add-review-item-modal-trigger', data: { commits_empty: 'true', context_commits_empty: 'true' } }) do = _('Add previously merged commits') - else diff --git a/app/views/projects/merge_requests/creations/_new_submit.html.haml b/app/views/projects/merge_requests/creations/_new_submit.html.haml index 996928ba377815bebc9475888a664c57703b895c..2d0807b82f9613cda33578f79ef242f759d6d845 100644 --- a/app/views/projects/merge_requests/creations/_new_submit.html.haml +++ b/app/views/projects/merge_requests/creations/_new_submit.html.haml @@ -28,7 +28,7 @@ #diff-notes-app.tab-content #new.commits.tab-pane.active - .commits-empty.gl-text-left.gl-my-5.gl-text-gray-500 + .gl-text-left.gl-my-5.gl-text-gray-500 %p = _("There are no commits yet.") - else diff --git a/app/views/shared/icons/_illustration_no_commits.svg b/app/views/shared/icons/_illustration_no_commits.svg deleted file mode 100644 index 34f177d7efad10d30daaed2c3c5bdf3a4712d95f..0000000000000000000000000000000000000000 --- a/app/views/shared/icons/_illustration_no_commits.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ee/spec/frontend/security_configuration/corpus_management/__snapshots__/empty_state_spec.js.snap b/ee/spec/frontend/security_configuration/corpus_management/__snapshots__/empty_state_spec.js.snap index 636885b899a0ae57db863688ec2d42100523f3b5..2404ff380c0ad727a7d6c4f32725c0514a5570b2 100644 --- a/ee/spec/frontend/security_configuration/corpus_management/__snapshots__/empty_state_spec.js.snap +++ b/ee/spec/frontend/security_configuration/corpus_management/__snapshots__/empty_state_spec.js.snap @@ -11,7 +11,7 @@ exports[`EE - CorpusManagement - EmptyState should render correct content 1`] = alt="" class="gl-dark-invert-keep-hue gl-max-w-full" height="144" - src="/illustrations/no_commits.svg" + src="/illustrations/empty-state/empty-commit-md.svg" />