Commit fc575676 authored by Taurie Davis's avatar Taurie Davis Committed by Natalia Tepluhina

feat(badge): Migrate diff LFS badge to glbadge

Changelog: changed
parent e529ce9f
...@@ -3,6 +3,7 @@ import { ...@@ -3,6 +3,7 @@ import {
GlTooltipDirective, GlTooltipDirective,
GlSafeHtmlDirective, GlSafeHtmlDirective,
GlIcon, GlIcon,
GlBadge,
GlButton, GlButton,
GlButtonGroup, GlButtonGroup,
GlDropdown, GlDropdown,
...@@ -34,6 +35,7 @@ export default { ...@@ -34,6 +35,7 @@ export default {
GlIcon, GlIcon,
FileIcon, FileIcon,
DiffStats, DiffStats,
GlBadge,
GlButton, GlButton,
GlButtonGroup, GlButtonGroup,
GlDropdown, GlDropdown,
...@@ -349,7 +351,9 @@ export default { ...@@ -349,7 +351,9 @@ export default {
{{ diffFile.a_mode }}{{ diffFile.b_mode }} {{ diffFile.a_mode }}{{ diffFile.b_mode }}
</small> </small>
<span v-if="isUsingLfs" class="badge label label-lfs gl-mr-2"> {{ __('LFS') }} </span> <gl-badge v-if="isUsingLfs" variant="neutral" class="gl-mr-2" data-testid="label-lfs">{{
__('LFS')
}}</gl-badge>
</div> </div>
<div <div
......
...@@ -411,11 +411,6 @@ span.idiff { ...@@ -411,11 +411,6 @@ span.idiff {
margin-right: 1.5em; margin-right: 1.5em;
} }
.label-lfs {
color: $common-gray-light;
border: 1px solid $common-gray-light;
}
.preview-container { .preview-container {
overflow: auto; overflow: auto;
......
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
= number_to_human_size(blob.raw_size) = number_to_human_size(blob.raw_size)
- if blob.stored_externally? && blob.external_storage == :lfs - if blob.stored_externally? && blob.external_storage == :lfs
%span.badge.label-lfs.gl-mr-2 LFS = gl_badge_tag(_('LFS'), variant: :neutral)
...@@ -127,7 +127,7 @@ RSpec.describe 'Merge request > User creates image diff notes', :js do ...@@ -127,7 +127,7 @@ RSpec.describe 'Merge request > User creates image diff notes', :js do
visit diffs_project_merge_request_path(project, merge_request, view: view) visit diffs_project_merge_request_path(project, merge_request, view: view)
wait_for_requests wait_for_requests
expect(page.all('.diff-file span.label-lfs', visible: :all)).not_to be_empty expect(page.all('[data-testid="label-lfs"]', visible: :all)).not_to be_empty
end end
it_behaves_like 'creates image diff note' it_behaves_like 'creates image diff note'
......
...@@ -82,7 +82,7 @@ describe('DiffFileHeader component', () => { ...@@ -82,7 +82,7 @@ describe('DiffFileHeader component', () => {
const findExpandButton = () => wrapper.find({ ref: 'expandDiffToFullFileButton' }); const findExpandButton = () => wrapper.find({ ref: 'expandDiffToFullFileButton' });
const findFileActions = () => wrapper.find('.file-actions'); const findFileActions = () => wrapper.find('.file-actions');
const findModeChangedLine = () => wrapper.find({ ref: 'fileMode' }); const findModeChangedLine = () => wrapper.find({ ref: 'fileMode' });
const findLfsLabel = () => wrapper.find('.label-lfs'); const findLfsLabel = () => wrapper.find('[data-testid="label-lfs"]');
const findToggleDiscussionsButton = () => wrapper.find({ ref: 'toggleDiscussionsButton' }); const findToggleDiscussionsButton = () => wrapper.find({ ref: 'toggleDiscussionsButton' });
const findExternalLink = () => wrapper.find({ ref: 'externalLink' }); const findExternalLink = () => wrapper.find({ ref: 'externalLink' });
const findReplacedFileButton = () => wrapper.find({ ref: 'replacedFileButton' }); const findReplacedFileButton = () => wrapper.find({ ref: 'replacedFileButton' });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment