From 01e873a8dfd51720fcff22d359efda9893bc0a5e Mon Sep 17 00:00:00 2001 From: Yogi <6395788-yo@users.noreply.gitlab.com> Date: Sun, 24 Jan 2021 06:42:20 +0000 Subject: [PATCH 1/5] Apply new GitLab UI for buttons in blob header --- app/helpers/blob_helper.rb | 12 ++++++------ .../projects/blob/_header_file_locks_link.html.haml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index bca53dfb88a835..710396500de9a6 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-info 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-info 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/ee/app/views/projects/blob/_header_file_locks_link.html.haml b/ee/app/views/projects/blob/_header_file_locks_link.html.haml index 7c6bbc684deb27..0e10a52efe4f5d 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' }) -- GitLab From 808315092e699e5b4440ebf9b8dc134561b6d848 Mon Sep 17 00:00:00 2001 From: Yogi <6395788-yo@users.noreply.gitlab.com> Date: Sun, 24 Jan 2021 06:42:51 +0000 Subject: [PATCH 2/5] Add Changelog --- changelogs/unreleased/gl-button-file.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/gl-button-file.yml diff --git a/changelogs/unreleased/gl-button-file.yml b/changelogs/unreleased/gl-button-file.yml new file mode 100644 index 00000000000000..0b9a987d0855d2 --- /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: +author: +type: other -- GitLab From 151b15aac8fd67c288585d5f4c9a7eb87d5567dd Mon Sep 17 00:00:00 2001 From: Yogi <6395788-yo@users.noreply.gitlab.com> Date: Sun, 24 Jan 2021 06:43:49 +0000 Subject: [PATCH 3/5] Apply new GitLab UI for buttons in blob header environment --- app/helpers/commits_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 2eb959856a5e9a..74c01caab9cba3 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 -- GitLab From 0bdbce742d6995aeee2c85a3b725b90dae75c5b5 Mon Sep 17 00:00:00 2001 From: Yogi <6395788-yo@users.noreply.gitlab.com> Date: Sun, 24 Jan 2021 06:47:49 +0000 Subject: [PATCH 4/5] Update gl-button-file.yml --- changelogs/unreleased/gl-button-file.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelogs/unreleased/gl-button-file.yml b/changelogs/unreleased/gl-button-file.yml index 0b9a987d0855d2..c6f7613471eb96 100644 --- a/changelogs/unreleased/gl-button-file.yml +++ b/changelogs/unreleased/gl-button-file.yml @@ -1,5 +1,5 @@ --- title: Apply new GitLab UI for buttons in blob header -merge_request: -author: +merge_request: 52429 +author: Yogi (@yo) type: other -- GitLab From bd08eea09e9f37c5b7722f3dc1436c32f1df3689 Mon Sep 17 00:00:00 2001 From: Yogi <6395788-yo@users.noreply.gitlab.com> Date: Fri, 29 Jan 2021 03:18:52 +0000 Subject: [PATCH 5/5] Update blob_helper.rb --- app/helpers/blob_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 710396500de9a6..15ed241f7e46b4 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 gl-button btn-info 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 gl-button btn-info 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) -- GitLab