Commit 588250c4 authored by Jeremy Elder's avatar Jeremy Elder Committed by Natalia Tepluhina

Migrate Bootstrap buttons

Migrating buttons in Vue and also HAML for parity
parent 066d6d4a
...@@ -70,34 +70,50 @@ export default { ...@@ -70,34 +70,50 @@ export default {
</span> </span>
<span class="uploading-error-container hide"> <span class="uploading-error-container hide">
<span class="uploading-error-icon"> <span class="uploading-error-icon">
<template> <gl-icon name="media" />
<gl-icon name="media" />
</template>
</span> </span>
<span class="uploading-error-message"></span> <span class="uploading-error-message"></span>
<gl-sprintf <gl-sprintf
:message=" :message="
__( __(
'%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}', '%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}.',
) )
" "
> >
<template #retryButton="{content}"> <template #retryButton="{content}">
<button class="retry-uploading-link" type="button">{{ content }}</button> <gl-button
variant="link"
category="primary"
class="retry-uploading-link gl-vertical-align-baseline"
>
{{ content }}
</gl-button>
</template> </template>
<template #newFileButton="{content}"> <template #newFileButton="{content}">
<button class="attach-new-file markdown-selector" type="button">{{ content }}</button> <gl-button
variant="link"
category="primary"
class="markdown-selector attach-new-file gl-vertical-align-baseline"
>
{{ content }}
</gl-button>
</template> </template>
</gl-sprintf> </gl-sprintf>
</span> </span>
<gl-button class="markdown-selector button-attach-file" variant="link"> <gl-button
<template> icon="media"
<gl-icon name="media" :size="16" /> variant="link"
</template> category="primary"
<span class="text-attach-file">{{ __('Attach a file') }}</span> class="markdown-selector button-attach-file gl-vertical-align-text-bottom"
>
{{ __('Attach a file') }}
</gl-button> </gl-button>
<gl-button class="btn btn-default btn-sm hide button-cancel-uploading-files" variant="link"> <gl-button
variant="link"
category="primary"
class="button-cancel-uploading-files gl-vertical-align-baseline hide"
>
{{ __('Cancel') }} {{ __('Cancel') }}
</gl-button> </gl-button>
</span> </span>
......
...@@ -450,31 +450,6 @@ table { ...@@ -450,31 +450,6 @@ table {
margin-right: 5px; margin-right: 5px;
} }
.attach-new-file,
.button-attach-file,
.retry-uploading-link {
color: $blue-600;
padding: 0;
background: none;
border: 0;
font-size: 14px;
line-height: 16px;
vertical-align: initial;
&:hover,
&:focus {
text-decoration: none;
.text-attach-file {
text-decoration: underline;
}
}
.gl-icon:not(:last-child) {
margin-right: 0;
}
}
.markdown-selector { .markdown-selector {
color: $blue-600; color: $blue-600;
} }
...@@ -23,13 +23,20 @@ ...@@ -23,13 +23,20 @@
= sprite_icon('media', css_class: 'gl-icon gl-vertical-align-text-bottom') = sprite_icon('media', css_class: 'gl-icon gl-vertical-align-text-bottom')
%span.uploading-error-message %span.uploading-error-message
-# Populated by app/assets/javascripts/dropzone_input.js -# Populated by app/assets/javascripts/dropzone_input.js
%button.retry-uploading-link{ type: 'button' }= _("Try again") %button.btn.gl-button.btn-link.gl-vertical-align-baseline.retry-uploading-link
or %span.gl-button-text
%button.attach-new-file.markdown-selector{ type: 'button' }= _("attach a new file") = _("Try again")
= _("or")
%button.btn.gl-button.btn-link.attach-new-file.markdown-selector.gl-vertical-align-baseline
%span.gl-button-text
= _("attach a new file")
= _(".")
%button.btn.markdown-selector.button-attach-file.btn-link{ type: 'button' } %button.btn.gl-button.btn-link.button-attach-file.markdown-selector.button-attach-file.gl-vertical-align-text-bottom
= sprite_icon('media') = sprite_icon('media')
%span.text-attach-file<> %span.gl-button-text
= _("Attach a file") = _("Attach a file")
%button.btn.btn-default.btn-sm.hide.button-cancel-uploading-files{ type: 'button' }= _("Cancel") %button.btn.gl-button.btn-link.button-cancel-uploading-files.gl-vertical-align-baseline.hide
%span.gl-button-text
= _("Cancel")
---
title: Migrate Bootstrap buttons to GitLab UI buttons for attach a file form actions
merge_request: 46041
author:
type: other
...@@ -737,7 +737,7 @@ msgstr[1] "" ...@@ -737,7 +737,7 @@ msgstr[1] ""
msgid "%{reportType} %{status} detected no vulnerabilities." msgid "%{reportType} %{status} detected no vulnerabilities."
msgstr "" msgstr ""
msgid "%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}" msgid "%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}."
msgstr "" msgstr ""
msgid "%{seconds}s" msgid "%{seconds}s"
...@@ -1047,6 +1047,9 @@ msgstr "" ...@@ -1047,6 +1047,9 @@ msgstr ""
msgid "- show less" msgid "- show less"
msgstr "" msgstr ""
msgid "."
msgstr ""
msgid "0 bytes" msgid "0 bytes"
msgstr "" msgstr ""
......
...@@ -58,8 +58,8 @@ RSpec.describe 'User uploads file to note' do ...@@ -58,8 +58,8 @@ RSpec.describe 'User uploads file to note' do
error_text = 'File is too big (0.06MiB). Max filesize: 0.01MiB.' error_text = 'File is too big (0.06MiB). Max filesize: 0.01MiB.'
expect(page).to have_selector('.uploading-error-message', visible: true, text: error_text) expect(page).to have_selector('.uploading-error-message', visible: true, text: error_text)
expect(page).to have_selector('.retry-uploading-link', visible: true, text: 'Try again') expect(page).to have_button('Try again', visible: true)
expect(page).to have_selector('.attach-new-file', visible: true, text: 'attach a new file') expect(page).to have_button('attach a new file', visible: true)
expect(page).not_to have_button('Attach a file') expect(page).not_to have_button('Attach a file')
end end
end end
......
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