Commit 9c677757 authored by Sam Beckham's avatar Sam Beckham

Adds changes from @pedroms review

- Removes the snippet button helper
- Adds the `btn-icon` class to a bunch of places`
- Fixes the active state on the stl viewer
- Fixes styling on issue -> MR dropdown
- Fixes some banner styling
parent 50c96afc
......@@ -9,8 +9,8 @@ export default () => {
e.preventDefault();
document.querySelector('.js-material-changer.active').classList.remove('active');
target.classList.add('active');
document.querySelector('.js-material-changer.selected').classList.remove('selected');
target.classList.add('selected');
target.blur();
viewer.changeObjectMaterials(target.dataset.type);
......
......@@ -204,7 +204,6 @@
gl-emoji,
.award-control-icon {
vertical-align: middle;
font-size: 1.4em;
line-height: 0.5em;
}
......
......@@ -173,11 +173,10 @@ ul.related-merge-requests > li {
margin-top: 4px;
// override dropdown item styles
.btn.btn-success {
.btn.btn-confirm {
@include btn-default;
@include btn-green;
@include btn-blue;
border-style: solid;
border-width: 1px;
line-height: $line-height-base;
width: auto;
......
......@@ -11,16 +11,6 @@ module SnippetsHelper
end
end
def download_raw_snippet_button(snippet)
link_to(sprite_icon('download'),
gitlab_raw_snippet_path(snippet, inline: false),
target: '_blank',
rel: 'noopener noreferrer',
class: "gl-button btn btn-default btn-sm has-tooltip",
title: 'Download',
data: { container: 'body' })
end
# Return the path of a snippets index for a user or for a project
#
# @returns String, path to snippet index
......
......@@ -231,7 +231,7 @@ module SortingHelper
end
def sort_direction_button(reverse_url, reverse_sort, sort_value)
link_class = 'gl-button btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
link_class = 'gl-button btn btn-default btn-icon has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
icon = sort_direction_icon(sort_value)
url = reverse_url
......
......@@ -22,7 +22,7 @@ module WikiHelper
end
def wiki_sidebar_toggle_button
content_tag :button, class: 'gl-button btn btn-default sidebar-toggle js-sidebar-wiki-toggle', role: 'button', type: 'button' do
content_tag :button, class: 'gl-button btn btn-default btn-icon sidebar-toggle js-sidebar-wiki-toggle', role: 'button', type: 'button' do
sprite_icon('chevron-double-lg-left')
end
end
......@@ -61,7 +61,7 @@ module WikiHelper
def wiki_sort_controls(wiki, sort, direction)
sort ||= Wiki::TITLE_ORDER
link_class = 'gl-button btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
link_class = 'gl-button btn btn-default btn-icon has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort'
reversed_direction = direction == 'desc' ? 'asc' : 'desc'
icon_class = direction == 'desc' ? 'highest' : 'lowest'
......
......@@ -5,5 +5,5 @@
.btn-group
%button.gl-button.btn.btn-default.btn-sm.js-material-changer{ data: { type: 'wireframe' } }
Wireframe
%button.gl-button.btn.btn-default.btn-sm.active.js-material-changer{ data: { type: 'default' } }
%button.gl-button.btn.btn-default.btn-sm.selected.js-material-changer{ data: { type: 'default' } }
Solid
......@@ -21,7 +21,7 @@
#js-issuable-header-warnings
= issuable_meta(@merge_request, @project)
%a.gl-button.btn.btn-default.float-right.d-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
%a.gl-button.btn.btn-default.btn-icon.float-right.d-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
= sprite_icon('chevron-double-lg-left')
.detail-page-header-actions.js-issuable-actions
......@@ -50,4 +50,4 @@
- if can_update_merge_request && !are_close_and_open_buttons_hidden
= render 'projects/merge_requests/close_reopen_draft_report_toggle'
- elsif !@merge_request.merged?
= link_to _('Report abuse'), new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)), class: 'gl-display-none gl-md-display-block gl-button btn btn-default-secondary float-right gl-ml-3', title: _('Report abuse')
= link_to _('Report abuse'), new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)), class: 'gl-display-none gl-md-display-block gl-button btn btn-default float-right gl-ml-3', title: _('Report abuse')
......@@ -5,10 +5,10 @@
%span.js-clone-dropdown-label
= enabled_protocol_button(container, enabled_protocol)
- else
%a#clone-dropdown.input-group-text.gl-button.btn.btn-default.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } }
%a#clone-dropdown.input-group-text.gl-button.btn.btn-default.btn-icon.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } }
%span.js-clone-dropdown-label
= default_clone_protocol.upcase
= sprite_icon('chevron-down')
= sprite_icon('chevron-down', css_class: 'gl-icon')
%ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown
%li
= ssh_clone_button(container)
......
- return unless current_user&.can?(:export_user_permissions)
= link_to admin_user_permission_exports_path(format: :csv), { class: 'gl-button btn btn-default', data: { toggle: "tooltip", placement: "top", container: "body" }, title: s_("AdminUsers|Export permissions as CSV") } do
= link_to admin_user_permission_exports_path(format: :csv), { class: 'gl-button btn btn-default btn-icon', data: { toggle: "tooltip", placement: "top", container: "body" }, title: s_("AdminUsers|Export permissions as CSV") } do
.gl-button-icon
= sprite_icon('upload')
- if show_advanced_search_promotion?
.user-callout.promotion-callout.promotion-advanced-search.js-mr-approval-callout#promote_advanced_search{ data: { uid: 'promote_advanced_search_dismissed' } }
.bordered-box.content-block
%button.gl-button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => _('Dismiss merge request promotion') }
%button.btn.btn-default-tertiary.btn-icon.btn-sm.close.gl-banner-close.gl-button.js-close-callout{ type: 'button', 'aria-label' => _('Dismiss') }
= sprite_icon('close', size: 16, css_class: 'dismiss-icon')
.svg-container
= custom_icon('icon_search_avatar')
......
- if show_promotions? && show_callout?('promote_mr_features_dismissed') && !@project.feature_available?(:merge_request_approvers)
.user-callout.promotion-callout.append-bottom-20.js-mr-approval-callout#promote_mr_features{ data: { uid: 'promote_mr_features_dismissed' } }
.bordered-box.content-block
%button.gl-button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => _('Dismiss merge request promotion') }
%button.gl-button.btn.btn-default-tertiary.close.js-close-callout{ type: 'button', 'aria-label' => _('Dismiss merge request promotion') }
= sprite_icon('close', size: 16, css_class: 'dismiss-icon')
.user-callout-copy
%h4
......
- if show_promotions? && show_callout?('promote_repository_features_dismissed') && (!@project.feature_available?(:push_rules) || !@project.feature_available?(:repository_mirrors) || !@project.feature_available?(:protected_refs_for_users))
.user-callout.promotion-callout{ id: 'promote_repository_features', data: { uid: 'promote_repository_features_dismissed' } }
.bordered-box.content-block
%button.gl-button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss repository features promotion' }
%button.gl-button.btn.btn-default-tertiary.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss repository features promotion' }
= sprite_icon('close', size: 16, css_class: 'dismiss-icon')
.svg-container
= custom_icon('icon_push_rules')
......
......@@ -63,30 +63,6 @@ RSpec.describe SnippetsHelper do
end
end
describe '#download_raw_snippet_button' do
subject { download_raw_snippet_button(snippet) }
context 'with personal snippet' do
let(:snippet) { public_personal_snippet }
it 'returns the download button' do
expect(subject).to eq(download_link("/-/snippets/#{snippet.id}/raw"))
end
end
context 'with project snippet' do
let(:snippet) { public_project_snippet }
it 'returns the download button' do
expect(subject).to eq(download_link("/#{snippet.project.path_with_namespace}/-/snippets/#{snippet.id}/raw"))
end
end
def download_link(url)
"<a target=\"_blank\" rel=\"noopener noreferrer\" class=\"gl-button btn btn-default btn-sm has-tooltip\" title=\"Download\" data-container=\"body\" href=\"#{url}?inline=false\">#{sprite_icon('download')}</a>"
end
end
describe '#snippet_badge' do
let(:snippet) { build(:personal_snippet, visibility) }
......
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