diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index bca53dfb88a8353211b9bfbd2f4905f5bd866944..15ed241f7e46b4069d154a5a200d8eef0ce81032 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -64,7 +64,7 @@ def encode_ide_path(path) def edit_blob_button(project = @project, ref = @ref, path = @path, options = {}) return unless blob = readable_blob(options, path, project, ref) - common_classes = "btn btn-primary js-edit-blob gl-mr-3 #{options[:extra_class]}" + common_classes = "btn gl-button btn-confirm js-edit-blob gl-mr-3 #{options[:extra_class]}" data = { track_event: 'click_edit', track_label: 'Edit' } if Feature.enabled?(:web_ide_primary_edit, project.group) @@ -84,7 +84,7 @@ def edit_blob_button(project = @project, ref = @ref, path = @path, options = {}) def ide_edit_button(project = @project, ref = @ref, path = @path, blob:) return unless blob - common_classes = 'btn btn-primary ide-edit-button gl-mr-3' + common_classes = 'btn gl-button btn-confirm ide-edit-button gl-mr-3' data = { track_event: 'click_edit_ide', track_label: 'Web IDE' } unless Feature.enabled?(:web_ide_primary_edit, project.group) @@ -105,7 +105,7 @@ def modify_file_button(project = @project, ref = @ref, path = @path, blob:, labe return unless current_user return unless blob - common_classes = "btn btn-#{btn_class}" + common_classes = "btn gl-button btn-default btn-#{btn_class}" base_button = button_tag(label, class: "#{common_classes} disabled", disabled: true) if !on_top_of_branch?(project, ref) @@ -247,7 +247,7 @@ def copy_file_path_button(file_path) def copy_blob_source_button(blob) return unless blob.rendered_as_text?(ignore_errors: false) - clipboard_button(target: ".blob-content[data-blob-id='#{blob.id}'] > pre", class: "btn btn-sm js-copy-blob-source-btn", title: _("Copy file contents")) + clipboard_button(target: ".blob-content[data-blob-id='#{blob.id}'] > pre", class: "btn gl-button btn-default btn-sm js-copy-blob-source-btn", title: _("Copy file contents")) end def open_raw_blob_button(blob) @@ -257,7 +257,7 @@ def open_raw_blob_button(blob) title = _('Open raw') link_to sprite_icon('doc-code'), external_storage_url_or_path(blob_raw_path), - class: 'btn btn-sm has-tooltip', + class: 'btn gl-button btn-default btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', aria: { label: title }, @@ -272,7 +272,7 @@ def download_blob_button(blob) link_to sprite_icon('download'), external_storage_url_or_path(blob_raw_path(inline: false)), download: @path, - class: 'btn btn-sm has-tooltip', + class: 'btn gl-button btn-default btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', aria: { label: title }, diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 2eb959856a5e9a3f14c4caca8e56c5e7d8733bc2..74c01caab9cba362fe370b6d50c4807c39b1fbf9 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -177,7 +177,7 @@ def view_on_environment_button(commit_sha, diff_new_path, environment) external_url = environment.external_url_for(diff_new_path, commit_sha) return unless external_url - link_to(external_url, class: 'btn btn-file-option has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: "View on #{environment.formatted_external_url}", data: { container: 'body' }) do + link_to(external_url, class: 'btn gl-button btn-default btn-file-option has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: "View on #{environment.formatted_external_url}", data: { container: 'body' }) do sprite_icon('external-link') end end diff --git a/changelogs/unreleased/gl-button-file.yml b/changelogs/unreleased/gl-button-file.yml new file mode 100644 index 0000000000000000000000000000000000000000..c6f7613471eb96c68a4cbb1c4183c9f6074efe6d --- /dev/null +++ b/changelogs/unreleased/gl-button-file.yml @@ -0,0 +1,5 @@ +--- +title: Apply new GitLab UI for buttons in blob header +merge_request: 52429 +author: Yogi (@yo) +type: other diff --git a/ee/app/views/projects/blob/_header_file_locks_link.html.haml b/ee/app/views/projects/blob/_header_file_locks_link.html.haml index 7c6bbc684deb276e5d42d2bea8f81cbbd1529e24..0e10a52efe4f5d179f88b1f25b34acff67daa05e 100644 --- a/ee/app/views/projects/blob/_header_file_locks_link.html.haml +++ b/ee/app/views/projects/blob/_header_file_locks_link.html.haml @@ -1 +1 @@ -= lock_file_link(html_options: { class: 'btn btn-sm path-lock' }) += lock_file_link(html_options: { class: 'btn gl-button btn-default btn-sm path-lock' })