From f5bd5762bf3822ccd098a3f87eb58b4d8a09b060 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Thu, 29 Jun 2023 20:17:52 +0100 Subject: [PATCH 1/8] Normalise classes to string --- ee/app/views/shared/promotions/_promote_issue_weights.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/app/views/shared/promotions/_promote_issue_weights.html.haml b/ee/app/views/shared/promotions/_promote_issue_weights.html.haml index 5d74c2dcc93e3a..dadb68e9c8fa0a 100644 --- a/ee/app/views/shared/promotions/_promote_issue_weights.html.haml +++ b/ee/app/views/shared/promotions/_promote_issue_weights.html.haml @@ -32,4 +32,4 @@ = s_('Promotions|Improve issues management with Issue weight and GitLab Enterprise Edition.') %div = render 'shared/promotions/promotion_link_project', short_form: true, target_blank: false, location: :issue_weights - = link_to s_("Promotions|Not now, thanks!"), '#', class: ['gl-button', 'btn', 'js-close', 'js-close-callout', 'gl-mt-3', 'js-close-session', 'tr-issue-weights-not-now-cta'] + = link_to s_("Promotions|Not now, thanks!"), '#', class: 'gl-button btn js-close js-close-callout gl-mt-3 js-close-session tr-issue-weights-not-now-cta' -- GitLab From 0b8313917a00a28ad2427e97895da5ece973f1cd Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Fri, 30 Jun 2023 11:35:05 +0100 Subject: [PATCH 2/8] Manually migrate unusual cases --- app/views/projects/_home_panel.html.haml | 4 +--- app/views/projects/buttons/_download_links.html.haml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 9cb5ec39de269e..591471388343e3 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -27,9 +27,7 @@ .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3 - if current_user - if current_user.admin? - = link_to [:admin, @project], class: 'btn btn-default gl-button btn-icon', title: _('View project in admin area'), - data: {toggle: 'tooltip', placement: 'top', container: 'body'} do - = sprite_icon('admin') + = link_button_to nil, [:admin, @project], icon: 'admin', title: _('View project in admin area'), data: {toggle: 'tooltip', placement: 'top', container: 'body'} - if @notification_setting .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), project_id: @project.id, no_flip: 'true' } } diff --git a/app/views/projects/buttons/_download_links.html.haml b/app/views/projects/buttons/_download_links.html.haml index d36aed44e18a05..31185fc153215e 100644 --- a/app/views/projects/buttons/_download_links.html.haml +++ b/app/views/projects/buttons/_download_links.html.haml @@ -1,4 +1,4 @@ .btn-group.ml-0.w-100 - Gitlab::Workhorse::ARCHIVE_FORMATS.each_with_index do |fmt, index| - archive_path = project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: fmt) - = link_to fmt, external_storage_url_or_path(archive_path), rel: 'nofollow', download: '', class: "gl-button btn btn-sm #{index == 0 ? 'btn-confirm' : 'btn-default'}" + = link_button_to fmt, external_storage_url_or_path(archive_path), rel: 'nofollow', download: '', variant: index == 0 ? :confirm : :default, size: :small -- GitLab From a2c6f197ca384c9ee4433dd3b5aab831b36fd9e0 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Fri, 30 Jun 2023 13:49:16 +0100 Subject: [PATCH 3/8] Migrate unusual case --- .../groups/saml_group_links/_saml_group_link.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ee/app/views/groups/saml_group_links/_saml_group_link.html.haml b/ee/app/views/groups/saml_group_links/_saml_group_link.html.haml index fc7a668de2cfd1..c94e68ccae8baa 100644 --- a/ee/app/views/groups/saml_group_links/_saml_group_link.html.haml +++ b/ee/app/views/groups/saml_group_links/_saml_group_link.html.haml @@ -1,9 +1,8 @@ %li .float-right - = link_to group_saml_group_link_path(group, saml_group_link), method: :delete, class: 'btn gl-button btn-danger btn-md', 'aria-label': _('Remove link'), - data: { confirm: s_('GroupSAML|Are you sure you want to remove the SAML group link?'), 'confirm-btn-variant': 'danger' } do - = sprite_icon('unlink', size: 12, css_class: 'gl-m-1!') - %span= _('Remove') + = link_button_to group_saml_group_link_path(group, saml_group_link), method: :delete, 'aria-label': _('Remove link'), + data: { confirm: s_('GroupSAML|Are you sure you want to remove the SAML group link?'), 'confirm-btn-variant': 'danger' }, variant: :danger, icon: 'unlink' do + = _('Remove') %strong= s_('GroupSAML|SAML Group Name: %{saml_group_name}') % { saml_group_name: saml_group_link.saml_group_name } .light -- GitLab From 11fe010e44bde7c69c87d828130e04e291509182 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Fri, 30 Jun 2023 16:37:44 +0100 Subject: [PATCH 4/8] Allow components to use link_button_to A later commit will update the templates of these components to use this helper method. --- app/components/pajamas/banner_component.rb | 2 +- ee/app/components/namespaces/storage/limit_alert_component.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/pajamas/banner_component.rb b/app/components/pajamas/banner_component.rb index 6082762f22cd9f..1a03f3fdd58078 100644 --- a/app/components/pajamas/banner_component.rb +++ b/app/components/pajamas/banner_component.rb @@ -49,7 +49,7 @@ def close_class end end - delegate :sprite_icon, to: :helpers + delegate :sprite_icon, :link_button_to, to: :helpers renders_one :title renders_one :illustration diff --git a/ee/app/components/namespaces/storage/limit_alert_component.rb b/ee/app/components/namespaces/storage/limit_alert_component.rb index b479f637ff630f..fb98ce1b9351ae 100644 --- a/ee/app/components/namespaces/storage/limit_alert_component.rb +++ b/ee/app/components/namespaces/storage/limit_alert_component.rb @@ -14,7 +14,9 @@ def initialize(context:, user:) private - delegate :sprite_icon, :usage_quotas_path, :buy_storage_path, :purchase_storage_url, :promo_url, to: :helpers + delegate :sprite_icon, :usage_quotas_path, :buy_storage_path, + :purchase_storage_url, :promo_url, :link_button_to, + to: :helpers attr_reader :context, :root_namespace, :user, :root_storage_size def render? -- GitLab From 026039b934f524413dd17abfa7ee4afc7fcb29ab Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Wed, 5 Jul 2023 13:37:22 +0100 Subject: [PATCH 5/8] Fix previously missed migration It seems this new RSS link button was added in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123674 was merged while the previous mass migration MR https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121772 was in review. --- app/views/explore/projects/topic.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/explore/projects/topic.html.haml b/app/views/explore/projects/topic.html.haml index bba0c1b9ca0c53..329e7cc161cec0 100644 --- a/app/views/explore/projects/topic.html.haml +++ b/app/views/explore/projects/topic.html.haml @@ -26,7 +26,6 @@ .nav-controls = render 'shared/projects/search_form' = render 'filter' - = link_to topic_explore_projects_path(@topic.name, rss_url_options), title: s_("Topics|Subscribe to the new projects feed"), class: 'btn gl-button btn-default btn-icon d-none d-sm-inline-flex has-tooltip' do - = sprite_icon('rss', css_class: 'gl-icon') + = link_button_to nil, topic_explore_projects_path(@topic.name, rss_url_options), title: s_("Topics|Subscribe to the new projects feed"), class: 'd-none d-sm-inline-flex has-tooltip', icon: 'rss' = render 'projects', projects: @projects -- GitLab From c149ff6c1ef1ac1f54c9e03e87ffc29806daa537 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Wed, 24 May 2023 20:26:52 +0100 Subject: [PATCH 6/8] Mass button migration Executed with: comby \ -config ~/dev/pajamas-adoption-scanner/comby/button-2.toml \ -custom-matcher ~/dev/pajamas-adoption-scanner/comby/haml.json \ -matcher .generic -in-place \ -f .haml Using the `button-migration` branch of the Pajamas Adoption Scanner: https://gitlab.com/gitlab-org/frontend/pajamas-adoption-scanner/-/commits/button-migration --- app/components/pajamas/banner_component.html.haml | 2 +- app/views/admin/applications/_form.html.haml | 2 +- app/views/admin/hooks/edit.html.haml | 2 +- app/views/admin/topics/_topic.html.haml | 4 ++-- app/views/admin/users/show.html.haml | 2 +- app/views/groups/settings/_general.html.haml | 2 +- app/views/invites/show.html.haml | 2 +- app/views/profiles/chat_names/_chat_name.html.haml | 2 +- app/views/profiles/emails/index.html.haml | 2 +- app/views/projects/_customize_workflow.html.haml | 2 +- app/views/projects/_new_project_fields.html.haml | 2 +- app/views/projects/_readme.html.haml | 2 +- app/views/projects/_wiki.html.haml | 2 +- app/views/projects/blob/_new_dir.html.haml | 2 +- app/views/projects/branches/new.html.haml | 2 +- app/views/projects/commit/_commit_box.html.haml | 2 +- app/views/projects/deploy_keys/edit.html.haml | 2 +- app/views/projects/diffs/_diffs.html.haml | 2 +- app/views/projects/forks/error.html.haml | 2 +- app/views/projects/hook_logs/show.html.haml | 2 +- app/views/projects/hooks/edit.html.haml | 2 +- .../service_desk/_service_desk_empty_state.html.haml | 2 +- .../service_desk/_service_desk_info_content.html.haml | 2 +- app/views/projects/mattermosts/_no_teams.html.haml | 2 +- app/views/projects/milestones/_form.html.haml | 4 ++-- app/views/projects/no_repo.html.haml | 2 +- app/views/projects/pages/_list.html.haml | 4 ++-- app/views/projects/pages_domains/_dns.html.haml | 2 +- .../pages_domains/_lets_encrypt_callout.html.haml | 2 +- app/views/projects/pages_domains/new.html.haml | 2 +- app/views/projects/pages_domains/show.html.haml | 2 +- app/views/projects/protected_tags/shared/_index.html.haml | 2 +- .../protected_tags/shared/_protected_tag.html.haml | 2 +- app/views/projects/runners/_runner.html.haml | 4 ++-- app/views/projects/settings/_general.html.haml | 2 +- app/views/projects/settings/slacks/edit.html.haml | 2 +- app/views/projects/snippets/index.html.haml | 2 +- .../protected_branches/shared/_protected_branch.html.haml | 2 +- app/views/sent_notifications/unsubscribe.html.haml | 2 +- .../_auto_devops_implicitly_enabled_banner.html.haml | 4 ++-- app/views/shared/_no_ssh.html.haml | 4 ++-- app/views/shared/_project_limit.html.haml | 4 ++-- .../shared/_prometheus_configuration_banner.html.haml | 4 ++-- app/views/shared/doorkeeper/applications/_show.html.haml | 4 ++-- app/views/shared/empty_states/_issues.html.haml | 8 ++++---- app/views/shared/empty_states/_labels.html.haml | 6 +++--- app/views/shared/empty_states/_merge_requests.html.haml | 6 +++--- app/views/shared/empty_states/_profile_tabs.html.haml | 4 ++-- app/views/shared/empty_states/_snippets.html.haml | 4 ++-- app/views/shared/empty_states/_wikis.html.haml | 4 ++-- .../_slack_integration_form.html.haml | 2 +- .../integrations/prometheus/_custom_metrics.html.haml | 2 +- .../integrations/slack_slash_commands/_help.html.haml | 2 +- app/views/shared/issuable/_form.html.haml | 6 +++--- app/views/shared/milestones/_milestone.html.haml | 4 ++-- .../shared/web_hooks/_web_hook_disabled_alert.html.haml | 2 +- .../namespaces/storage/limit_alert_component.html.haml | 4 ++-- .../application_settings/_elasticsearch_form.html.haml | 2 +- ee/app/views/admin/licenses/_summary.html.haml | 2 +- ee/app/views/groups/hook_logs/show.html.haml | 2 +- ee/app/views/groups/hooks/edit.html.haml | 2 +- .../domain_verification/_lets_encrypt_callout.html.haml | 2 +- .../groups/settings/domain_verification/new.html.haml | 2 +- .../groups/settings/domain_verification/show.html.haml | 2 +- .../header/_licensed_user_count_threshold.html.haml | 4 ++-- ee/app/views/layouts/header/_read_only_banner.html.haml | 2 +- ee/app/views/layouts/header/_seat_count_alert.html.haml | 2 +- .../_manual_quarterly_reconciliation_banner.html.haml | 4 ++-- .../shared/_namespace_user_cap_reached_alert.html.haml | 2 +- .../shared/_new_user_signups_cap_reached_alert.html.haml | 2 +- .../shared/_submit_license_usage_data_banner.html.haml | 4 ++-- .../shared/_ultimate_trial_callout_content.html.haml | 2 +- .../_resource_access_token.html.haml | 4 ++-- ee/app/views/shared/promotions/_promote_epics.html.haml | 2 +- .../shared/promotions/_promote_issue_weights.html.haml | 2 +- .../shared/promotions/_promote_mobile_devops.html.haml | 2 +- .../shared/promotions/_promotion_link_project.html.haml | 6 +++--- .../web_hooks/_group_web_hook_disabled_alert.html.haml | 2 +- 78 files changed, 107 insertions(+), 107 deletions(-) diff --git a/app/components/pajamas/banner_component.html.haml b/app/components/pajamas/banner_component.html.haml index 4fa2ed09cd3596..c2eeae2d8c94b8 100644 --- a/app/components/pajamas/banner_component.html.haml +++ b/app/components/pajamas/banner_component.html.haml @@ -14,7 +14,7 @@ - if primary_action? = primary_action - else - = link_to @button_text, @button_link, { **@button_options, class: 'btn btn-md btn-confirm gl-button js-close-callout' } + = link_button_to @button_text, @button_link, **@button_options, class: 'js-close-callout', variant: :confirm - actions.each do |action| = action diff --git a/app/views/admin/applications/_form.html.haml b/app/views/admin/applications/_form.html.haml index a8d5a45041d792..27622dfa0bbe78 100644 --- a/app/views/admin/applications/_form.html.haml +++ b/app/views/admin/applications/_form.html.haml @@ -32,4 +32,4 @@ .gl-mt-5 = f.submit _('Save application'), pajamas_button: true, data: { qa_selector: 'save_application_button' } - = link_to _('Cancel'), admin_applications_path, class: "gl-button btn btn-default btn-cancel" + = link_button_to _('Cancel'), admin_applications_path diff --git a/app/views/admin/hooks/edit.html.haml b/app/views/admin/hooks/edit.html.haml index b0e45f0a49fbfb..f362cc9efbf44e 100644 --- a/app/views/admin/hooks/edit.html.haml +++ b/app/views/admin/hooks/edit.html.haml @@ -12,7 +12,7 @@ %div = f.submit _('Save changes'), pajamas_button: true, class: 'gl-sm-mr-3' = render 'shared/web_hooks/test_button', hook: @hook - = link_to _('Delete'), admin_hook_path(@hook), method: :delete, class: 'btn gl-button btn-danger gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this webhook?'), confirm_btn_variant: 'danger' } + = link_button_to _('Delete'), admin_hook_path(@hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this webhook?'), confirm_btn_variant: 'danger' }, variant: :danger %hr diff --git a/app/views/admin/topics/_topic.html.haml b/app/views/admin/topics/_topic.html.haml index ce2b5ad793c4fa..3e8a023ec9f148 100644 --- a/app/views/admin/topics/_topic.html.haml +++ b/app/views/admin/topics/_topic.html.haml @@ -16,5 +16,5 @@ = number_with_delimiter(topic.total_projects_count) .controls.gl-flex-shrink-0.gl-ml-5 - = link_to _('Edit'), edit_admin_topic_path(topic), id: "edit_#{dom_id(topic)}", class: 'btn gl-button btn-default' - = link_to _('Remove'), admin_topic_path(topic), aria: { label: _('Remove') }, data: { confirm: _("Are you sure you want to remove %{topic_name}?") % { topic_name: title }, confirm_btn_variant: 'danger' }, method: :delete, class: 'gl-button btn btn-danger' + = link_button_to _('Edit'), edit_admin_topic_path(topic), id: "edit_#{dom_id(topic)}" + = link_button_to _('Remove'), admin_topic_path(topic), aria: { label: _('Remove') }, data: { confirm: _("Are you sure you want to remove %{topic_name}?") % { topic_name: title }, confirm_btn_variant: 'danger' }, method: :delete, variant: :danger diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 2fd477438e412a..a4ae29bed81d5f 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -57,7 +57,7 @@ %strong{ class: @user.two_factor_enabled? ? 'cgreen' : 'cred' } - if @user.two_factor_enabled? = _('Enabled') - = link_to _('Disable'), disable_two_factor_admin_user_path(@user), aria: { label: _('Disable') }, data: { confirm: _('Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :patch, class: 'btn gl-button btn-sm btn-danger float-right', title: _('Disable Two-factor Authentication') + = link_button_to _('Disable'), disable_two_factor_admin_user_path(@user), aria: { label: _('Disable') }, data: { confirm: _('Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :patch, class: 'float-right', title: _('Disable Two-factor Authentication'), variant: :danger, size: :small - else = _('Disabled') diff --git a/app/views/groups/settings/_general.html.haml b/app/views/groups/settings/_general.html.haml index 8c73fc955443b2..22ed6ea4403997 100644 --- a/app/views/groups/settings/_general.html.haml +++ b/app/views/groups/settings/_general.html.haml @@ -33,7 +33,7 @@ = render 'shared/choose_avatar_button', f: f - if @group.avatar? %hr - = link_to s_('Groups|Remove avatar'), group_avatar_path(@group.to_param), aria: { label: s_('Groups|Remove avatar') }, data: { confirm: s_('Groups|Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'gl-button btn btn-danger-secondary' + = link_button_to s_('Groups|Remove avatar'), group_avatar_path(@group.to_param), aria: { label: s_('Groups|Remove avatar') }, data: { confirm: s_('Groups|Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger, category: :secondary .form-group.gl-form-group = render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group = f.submit s_('Groups|Save changes'), pajamas_button: true, class: 'js-dirty-submit', data: { qa_selector: 'save_name_visibility_settings_button' } diff --git a/app/views/invites/show.html.haml b/app/views/invites/show.html.haml index 5f65405c8bc675..d368f013e6b558 100644 --- a/app/views/invites/show.html.haml +++ b/app/views/invites/show.html.haml @@ -6,7 +6,7 @@ %p = _("You are already a member of this %{member_source}.") % { member_source: @invite_details[:title] } .actions - = link_to _("Go to %{source_name}") % { source_name: @invite_details[:title] }, @invite_details[:url], class: "btn gl-button btn-confirm" + = link_button_to _("Go to %{source_name}") % { source_name: @invite_details[:title] }, @invite_details[:url], variant: :confirm - else %p diff --git a/app/views/profiles/chat_names/_chat_name.html.haml b/app/views/profiles/chat_names/_chat_name.html.haml index afc3894c23bb6f..0ac8ede3c62187 100644 --- a/app/views/profiles/chat_names/_chat_name.html.haml +++ b/app/views/profiles/chat_names/_chat_name.html.haml @@ -10,4 +10,4 @@ = _('Never') %td - = link_to _('Remove'), profile_chat_name_path(chat_name), method: :delete, class: 'gl-button btn btn-danger float-right', aria: { label: _('Remove') }, data: { confirm: _('Are you sure you want to remove this nickname?'), confirm_btn_variant: 'danger' } + = link_button_to _('Remove'), profile_chat_name_path(chat_name), method: :delete, class: 'float-right', aria: { label: _('Remove') }, data: { confirm: _('Are you sure you want to remove this nickname?'), confirm_btn_variant: 'danger' }, variant: :danger diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml index 41e061ebfee7a5..881ac7f2a7dcc6 100644 --- a/app/views/profiles/emails/index.html.haml +++ b/app/views/profiles/emails/index.html.haml @@ -59,6 +59,6 @@ .gl-display-flex.gl-justify-content-end.gl-align-items-flex-end.gl-flex-grow-1.gl-flex-wrap-reverse.gl-gap-3 - unless email.confirmed? - confirm_title = "#{email.confirmation_sent_at ? _('Resend confirmation email') : _('Send confirmation email')}" - = link_to confirm_title, resend_confirmation_instructions_profile_email_path(email), method: :put, class: 'gl-button btn btn-sm btn-default' + = link_button_to confirm_title, resend_confirmation_instructions_profile_email_path(email), method: :put, size: :small = link_button_to nil, profile_email_path(email), data: { confirm: _('Are you sure?'), qa_selector: 'delete_email_link'}, method: :delete, variant: :danger, size: :small, icon: 'remove', 'aria-label': _('Remove') diff --git a/app/views/projects/_customize_workflow.html.haml b/app/views/projects/_customize_workflow.html.haml index ded43a34b48e0f..da4b257f224aea 100644 --- a/app/views/projects/_customize_workflow.html.haml +++ b/app/views/projects/_customize_workflow.html.haml @@ -5,4 +5,4 @@ %p Get started with GitLab by enabling features that work best for your project. From issues and wikis, to merge requests and pipelines, GitLab can help manage your workflow from idea to production! - if can?(current_user, :admin_project, @project) - = link_to "Get started", edit_project_path(@project), class: "gl-button btn btn-confirm" + = link_button_to "Get started", edit_project_path(@project), variant: :confirm diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index 6049d1cc110712..983b80563589ec 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -98,4 +98,4 @@ -# this partial is from JiHu, see details in https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/675 = render_if_exists 'shared/other_project_options', f: f, visibility_level: visibility_level, track_label: track_label = f.submit _('Create project'), class: "js-create-project-button", data: { qa_selector: 'project_create_button', track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" }, pajamas_button: true -= link_to _('Cancel'), @parent_group || dashboard_groups_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "cancel", track_value: "" } += link_button_to _('Cancel'), @parent_group || dashboard_groups_path, data: { track_label: "#{track_label}", track_action: "click_button", track_property: "cancel", track_value: "" } diff --git a/app/views/projects/_readme.html.haml b/app/views/projects/_readme.html.haml index 85a53edc160f5e..c3d6639625657d 100644 --- a/app/views/projects/_readme.html.haml +++ b/app/views/projects/_readme.html.haml @@ -24,4 +24,4 @@ distributed with computer software, forming part of its documentation. GitLab will render it here instead of this message. %p - = link_to "Add Readme", @project.add_readme_path, class: 'gl-button btn btn-confirm' + = link_button_to "Add Readme", @project.add_readme_path, variant: :confirm diff --git a/app/views/projects/_wiki.html.haml b/app/views/projects/_wiki.html.haml index 45d0aee43326b0..e82e0972d8232f 100644 --- a/app/views/projects/_wiki.html.haml +++ b/app/views/projects/_wiki.html.haml @@ -14,4 +14,4 @@ - if can_create_wiki %p = _("Add a homepage to your wiki that contains information about your project and GitLab will display it here instead of this message.") - = link_to _("Create your first page"), wiki_path(@project.wiki) + '?view=create', class: "btn gl-button btn-confirm" + = link_button_to _("Create your first page"), wiki_path(@project.wiki) + '?view=create', variant: :confirm diff --git a/app/views/projects/blob/_new_dir.html.haml b/app/views/projects/blob/_new_dir.html.haml index 3ae7741d24d68a..f1da9154df9f25 100644 --- a/app/views/projects/blob/_new_dir.html.haml +++ b/app/views/projects/blob/_new_dir.html.haml @@ -16,6 +16,6 @@ .form-actions = submit_tag _("Create directory"), class: 'btn gl-button btn-confirm' - = link_to _('Cancel'), '#', class: "btn gl-button btn-default btn-cancel", "data-dismiss" => "modal" + = link_button_to _('Cancel'), '#', "data-dismiss" => "modal" = render 'shared/projects/edit_information' diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index 9fd9943fd26702..7f6a37fc2108b9 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -20,4 +20,4 @@ = _('Existing branch name, tag, or commit SHA') = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { type: 'submit', class: 'gl-mr-3' }) do = _('Create branch') - = link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), project_branches_path(@project) diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index c161e1c9d2a1ff..24d063d3b4d0af 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -19,7 +19,7 @@ #{time_ago_with_tooltip(@commit.committed_date)} #js-commit-comments-button{ data: { comments_count: @notes_count.to_i } } - = link_to _('Browse files'), project_tree_path(@project, @commit), class: "btn gl-button btn-default gl-mr-3 gl-xs-w-full gl-xs-mb-3" + = link_button_to _('Browse files'), project_tree_path(@project, @commit), class: 'gl-mr-3 gl-xs-w-full gl-xs-mb-3' #js-commit-options-dropdown{ data: commit_options_dropdown_data(@project, @commit) } .commit-box{ data: { project_path: project_path(@project) } } diff --git a/app/views/projects/deploy_keys/edit.html.haml b/app/views/projects/deploy_keys/edit.html.haml index 91444a0033476f..997443d5fa96a1 100644 --- a/app/views/projects/deploy_keys/edit.html.haml +++ b/app/views/projects/deploy_keys/edit.html.haml @@ -7,4 +7,4 @@ = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key } .form-actions = f.submit _('Save changes'), pajamas_button: true - = link_to _('Cancel'), project_settings_repository_path(@project), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), project_settings_repository_path(@project) diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 982ecbbae51d29..9193fc4ef25361 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -12,7 +12,7 @@ .files-changed-inner .inline-parallel-buttons.gl-display-none.gl-md-display-flex.gl-relative - if !diffs_expanded? && diff_files.any?(&:collapsed?) - = link_to _('Expand all'), url_for(safe_params.merge(expanded: 1, format: nil)), class: 'gl-button btn btn-default' + = link_button_to _('Expand all'), url_for(safe_params.merge(expanded: 1, format: nil)) - if show_whitespace_toggle - if current_controller?(:commit) = commit_diff_whitespace_link(diffs.project, @commit, class: 'd-none d-sm-inline-block') diff --git a/app/views/projects/forks/error.html.haml b/app/views/projects/forks/error.html.haml index cff5899b960a24..f589c8f9566e91 100644 --- a/app/views/projects/forks/error.html.haml +++ b/app/views/projects/forks/error.html.haml @@ -18,4 +18,4 @@ = error - c.with_actions do - = link_to _('Try to fork again'), new_project_fork_path(@project), title: _("Fork"), class: "btn gl-alert-action btn-info btn-md gl-button" + = link_button_to _('Try to fork again'), new_project_fork_path(@project), title: _("Fork"), class: 'gl-alert-action', variant: :confirm diff --git a/app/views/projects/hook_logs/show.html.haml b/app/views/projects/hook_logs/show.html.haml index 0f4dc4b5e325f2..30084e3310b5e0 100644 --- a/app/views/projects/hook_logs/show.html.haml +++ b/app/views/projects/hook_logs/show.html.haml @@ -9,6 +9,6 @@ - if @hook_log.oversize? = button_tag _("Resend Request"), class: "btn gl-button btn-default float-right gl-ml-3 has-tooltip", disabled: true, title: _("Request data is too large") - else - = link_to _("Resend Request"), @hook_log.present.retry_path, method: :post, class: "btn gl-button btn-default float-right gl-ml-3" + = link_button_to _("Resend Request"), @hook_log.present.retry_path, method: :post, class: 'float-right gl-ml-3' = render partial: 'shared/hook_logs/content', locals: { hook_log: @hook_log } diff --git a/app/views/projects/hooks/edit.html.haml b/app/views/projects/hooks/edit.html.haml index b410b6c07e1918..26ec09c76dba5a 100644 --- a/app/views/projects/hooks/edit.html.haml +++ b/app/views/projects/hooks/edit.html.haml @@ -12,7 +12,7 @@ %div = f.submit _('Save changes'), pajamas_button: true, class: 'gl-sm-mr-3' = render 'shared/web_hooks/test_button', hook: @hook - = link_to _('Delete'), project_hook_path(@project, @hook), method: :delete, class: 'btn gl-button btn-danger gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this project hook?'), confirm_btn_variant: 'danger' } + = link_button_to _('Delete'), project_hook_path(@project, @hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this project hook?'), confirm_btn_variant: 'danger' }, variant: :danger %hr diff --git a/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml b/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml index 855625368a9cdc..831bd107961a45 100644 --- a/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml +++ b/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml @@ -21,7 +21,7 @@ - if can_edit_project_settings && !service_desk_enabled .text-center - = link_to s_("ServiceDesk|Enable Service Desk"), edit_project_path(@project), class: 'gl-button btn btn-confirm' + = link_button_to s_("ServiceDesk|Enable Service Desk"), edit_project_path(@project), variant: :confirm - else .empty-state .svg-content diff --git a/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml b/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml index 95837748c7fb42..093a47e63be7fb 100644 --- a/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml +++ b/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml @@ -21,4 +21,4 @@ - if can_edit_project_settings && !service_desk_enabled .gl-mt-3 - = link_to s_("ServiceDesk|Enable Service Desk"), edit_project_path(@project), class: 'gl-button btn btn-confirm' + = link_button_to s_("ServiceDesk|Enable Service Desk"), edit_project_path(@project), variant: :confirm diff --git a/app/views/projects/mattermosts/_no_teams.html.haml b/app/views/projects/mattermosts/_no_teams.html.haml index 5886c0565b1dc5..c53e805fae1aba 100644 --- a/app/views/projects/mattermosts/_no_teams.html.haml +++ b/app/views/projects/mattermosts/_no_teams.html.haml @@ -9,4 +9,4 @@ and try again. %hr .clearfix - = link_to 'Go back', edit_project_settings_integration_path(@project, @integration), class: 'gl-button btn btn-lg float-right' + = link_button_to 'Go back', edit_project_settings_integration_path(@project, @integration), class: 'float-right' diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index be6f9ac83dc5c5..98389d95392e96 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -26,7 +26,7 @@ - if @milestone.new_record? = f.submit _('Create milestone'), data: { qa_selector: 'create_milestone_button' }, class: 'gl-mr-2', pajamas_button: true - = link_to _('Cancel'), project_milestones_path(@project), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), project_milestones_path(@project) - else = f.submit _('Save changes'), class: 'gl-mr-2', pajamas_button: true - = link_to _('Cancel'), project_milestone_path(@project, @milestone), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), project_milestone_path(@project, @milestone) diff --git a/app/views/projects/no_repo.html.haml b/app/views/projects/no_repo.html.haml index 5cc909741f6aa8..3abec75b971f3b 100644 --- a/app/views/projects/no_repo.html.haml +++ b/app/views/projects/no_repo.html.haml @@ -23,4 +23,4 @@ - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to _('Delete project'), project_path(@project), data: { confirm: remove_project_message(@project), confirm_btn_variant: 'danger' }, aria: { label: _('Delete project') }, method: :delete, class: "btn gl-button btn-danger float-right" + = link_button_to _('Delete project'), project_path(@project), data: { confirm: remove_project_message(@project), confirm_btn_variant: 'danger' }, aria: { label: _('Delete project') }, method: :delete, class: 'float-right', variant: :danger diff --git a/app/views/projects/pages/_list.html.haml b/app/views/projects/pages/_list.html.haml index 57371aa49f6ea7..38e15d02a3964e 100644 --- a/app/views/projects/pages/_list.html.haml +++ b/app/views/projects/pages/_list.html.haml @@ -26,8 +26,8 @@ - if domain.expired? = gl_badge_tag s_('GitLabPages|Expired'), variant: :danger %div - = link_to s_('GitLabPages|Edit'), project_pages_domain_path(@project, domain), class: "btn gl-button btn-sm btn-grouped btn-confirm btn-inverted" - = link_to s_('GitLabPages|Remove'), project_pages_domain_path(@project, domain), data: { confirm: s_('GitLabPages|Are you sure?'), 'confirm-btn-variant': 'danger'}, "aria-label": s_("GitLabPages|Remove domain"), method: :delete, class: "btn gl-button btn-danger btn-sm btn-grouped" + = link_button_to s_('GitLabPages|Edit'), project_pages_domain_path(@project, domain), class: 'btn-grouped', variant: :confirm, category: :secondary, size: :small + = link_button_to s_('GitLabPages|Remove'), project_pages_domain_path(@project, domain), data: { confirm: s_('GitLabPages|Are you sure?'), 'confirm-btn-variant': 'danger'}, "aria-label": s_("GitLabPages|Remove domain"), method: :delete, class: 'btn-grouped', variant: :danger, size: :small - if domain.needs_verification? %li.list-group-item.bs-callout-warning - details_link_start = "".html_safe diff --git a/app/views/projects/pages_domains/_dns.html.haml b/app/views/projects/pages_domains/_dns.html.haml index eff8f9298fd5e7..7c34c3ff6e1d1c 100644 --- a/app/views/projects/pages_domains/_dns.html.haml +++ b/app/views/projects/pages_domains/_dns.html.haml @@ -21,7 +21,7 @@ .gl-mb-3 - text, status = domain_presenter.unverified? ? [_('Unverified'), :danger] : [_('Verified'), :success] = gl_badge_tag text, variant: status - = link_to sprite_icon("redo"), verify_project_pages_domain_path(@project, domain_presenter), method: :post, class: "gl-ml-2 gl-button btn btn-sm btn-default has-tooltip", title: _("Retry verification") + = link_button_to sprite_icon("redo"), verify_project_pages_domain_path(@project, domain_presenter), method: :post, class: 'gl-ml-2 has-tooltip', title: _("Retry verification"), size: :small .input-group = text_field_tag :domain_verification, domain_presenter.verification_record, class: "monospace js-select-on-focus form-control", readonly: true .input-group-append diff --git a/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml b/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml index d6c213571f21c8..68b6884c4f56cd 100644 --- a/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml +++ b/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml @@ -9,7 +9,7 @@ = sprite_icon('warning-solid', css_class: ' mr-2 gl-text-orange-600') = _("Something went wrong while obtaining the Let's Encrypt certificate.") .row.mx-0.mt-3 - = link_to s_('GitLabPagesDomains|Retry'), retry_auto_ssl_project_pages_domain_path(@project, domain_presenter), class: "gl-button btn btn-default btn-sm btn-grouped", method: :post + = link_button_to s_('GitLabPagesDomains|Retry'), retry_auto_ssl_project_pages_domain_path(@project, domain_presenter), class: 'btn-grouped', method: :post, size: :small - elsif !domain_presenter.certificate_gitlab_provided? .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) } .row diff --git a/app/views/projects/pages_domains/new.html.haml b/app/views/projects/pages_domains/new.html.haml index c88255e23f975f..c58209f880634a 100644 --- a/app/views/projects/pages_domains/new.html.haml +++ b/app/views/projects/pages_domains/new.html.haml @@ -8,4 +8,4 @@ = render 'form', { f: f } .form-actions.gl-display-flex = f.submit _('Create New Domain'), class: 'gl-mr-3', pajamas_button: true - = link_to _('Cancel'), project_pages_path(@project), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), project_pages_path(@project) diff --git a/app/views/projects/pages_domains/show.html.haml b/app/views/projects/pages_domains/show.html.haml index b8de364babc04c..8a0d39b7a0ec59 100644 --- a/app/views/projects/pages_domains/show.html.haml +++ b/app/views/projects/pages_domains/show.html.haml @@ -10,4 +10,4 @@ = render 'form', { f: f } .form-actions.gl-display-flex = f.submit _('Save Changes'), class: 'gl-mr-3', pajamas_button: true - = link_to _('Cancel'), project_pages_path(@project), class: 'gl-button btn btn-default btn-inverse' + = link_button_to _('Cancel'), project_pages_path(@project), class: 'btn-inverse' diff --git a/app/views/projects/protected_tags/shared/_index.html.haml b/app/views/projects/protected_tags/shared/_index.html.haml index 11e09d843e0d1c..a016ccf865694a 100644 --- a/app/views/projects/protected_tags/shared/_index.html.haml +++ b/app/views/projects/protected_tags/shared/_index.html.haml @@ -8,7 +8,7 @@ = expanded ? _('Collapse') : _('Expand') %p = s_("ProtectedTag|Limit access to creating and updating tags.") - = link_to s_("ProtectedTag|What are protected tags?"), help_page_path("user/project/protected_tags") + = link_to s_("ProtectedTag|What are protected tags?"), help_page_path("user/project/protected_tags") .settings-content %p = s_("ProtectedTag|By default, protected tags restrict who can modify the tag.") diff --git a/app/views/projects/protected_tags/shared/_protected_tag.html.haml b/app/views/projects/protected_tags/shared/_protected_tag.html.haml index ed5b5b1794258e..4fe1c8bd3cb0c2 100644 --- a/app/views/projects/protected_tags/shared/_protected_tag.html.haml +++ b/app/views/projects/protected_tags/shared/_protected_tag.html.haml @@ -19,4 +19,4 @@ - if can? current_user, :admin_project, @project %td - = link_to 'Unprotect', [@project, protected_tag, { update_section: 'js-protected-tags-settings' }], aria: { label: s_('ProtectedTags|Unprotect tag') }, data: { confirm: 'Tag will be writable for developers. Are you sure?', confirm_btn_variant: 'danger' }, method: :delete, class: 'gl-button btn btn-danger-secondary' + = link_button_to 'Unprotect', [@project, protected_tag, { update_section: 'js-protected-tags-settings' }], aria: { label: s_('ProtectedTags|Unprotect tag') }, data: { confirm: 'Tag will be writable for developers. Are you sure?', confirm_btn_variant: 'danger' }, method: :delete, variant: :danger, category: :secondary diff --git a/app/views/projects/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml index 6d60370d2e05d9..12432cd3484c63 100644 --- a/app/views/projects/runners/_runner.html.haml +++ b/app/views/projects/runners/_runner.html.haml @@ -19,10 +19,10 @@ - else = link_button_to nil, resume_project_runner_path(@project, runner), method: :post, title: s_('Runners|Resume accepting jobs'), aria: { label: _('Resume') }, data: { toggle: 'tooltip', container: 'body' }, icon: 'play' - if runner.belongs_to_one_project? - = link_to _('Remove runner'), project_runner_path(@project, runner), aria: { label: _('Remove') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'btn gl-button btn-danger' + = link_button_to _('Remove runner'), project_runner_path(@project, runner), aria: { label: _('Remove') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger - else - runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord - = link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), aria: { label: _('Disable') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'btn gl-button btn-danger' + = link_button_to _('Disable for this project'), project_runner_project_path(@project, runner_project), aria: { label: _('Disable') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger - elsif runner.project_type? = form_for [@project, @project.runner_projects.new] do |f| = f.hidden_field :runner_id, value: runner.id diff --git a/app/views/projects/settings/_general.html.haml b/app/views/projects/settings/_general.html.haml index 847f9ad3e2ab79..f5c275827fcfa7 100644 --- a/app/views/projects/settings/_general.html.haml +++ b/app/views/projects/settings/_general.html.haml @@ -35,6 +35,6 @@ = render 'shared/choose_avatar_button', f: f - if @project.avatar? %hr - = link_to _('Remove avatar'), project_avatar_path(@project), aria: { label: _('Remove avatar') }, data: { confirm: _('Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'gl-button btn btn-danger-secondary' + = link_button_to _('Remove avatar'), project_avatar_path(@project), aria: { label: _('Remove avatar') }, data: { confirm: _('Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, variant: :danger, category: :secondary = f.submit _('Save changes'), pajamas_button: true, class: "gl-mt-6", data: { qa_selector: 'save_naming_topics_avatar_button' } diff --git a/app/views/projects/settings/slacks/edit.html.haml b/app/views/projects/settings/slacks/edit.html.haml index 867b90655e3d71..537ae767b1ddb4 100644 --- a/app/views/projects/settings/slacks/edit.html.haml +++ b/app/views/projects/settings/slacks/edit.html.haml @@ -17,4 +17,4 @@ .footer-block.row-content-block = form.submit _('Save changes'), pajamas_button: true   - = link_to _('Cancel'), edit_project_settings_integration_path(@project, @service), class: 'btn gl-button btn-cancel' + = link_button_to _('Cancel'), edit_project_settings_integration_path(@project, @service) diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml index 7c936c849d0851..ae9a8307eb936c 100644 --- a/app/views/projects/snippets/index.html.haml +++ b/app/views/projects/snippets/index.html.haml @@ -9,7 +9,7 @@ - if new_project_snippet_link.present? .nav-controls - = link_to _("New snippet"), new_project_snippet_link, class: "gl-button btn btn-confirm", title: _("New snippet") + = link_button_to _("New snippet"), new_project_snippet_link, title: _("New snippet"), variant: :confirm = render 'shared/snippets/list' - else diff --git a/app/views/protected_branches/shared/_protected_branch.html.haml b/app/views/protected_branches/shared/_protected_branch.html.haml index c2a5dd8a9b0991..69969b7f848559 100644 --- a/app/views/protected_branches/shared/_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_protected_branch.html.haml @@ -27,4 +27,4 @@ %span.has-tooltip{ data: { container: 'body' }, title: s_('ProtectedBranch|Inherited - This setting can be changed at the group level'), 'aria-hidden': 'true' } = sprite_icon 'lock' - else - = link_to s_('ProtectedBranch|Unprotect'), [protected_branch_entity, protected_branch, { update_section: 'js-protected-branches-settings' }], disabled: local_assigns[:disabled], aria: { label: s_('ProtectedBranch|Unprotect branch') }, data: { confirm: s_('ProtectedBranch|Branch will be writable for developers. Are you sure?'), confirm_btn_variant: 'danger' }, method: :delete, class: "btn gl-button btn-danger btn-sm" + = link_button_to s_('ProtectedBranch|Unprotect'), [protected_branch_entity, protected_branch, { update_section: 'js-protected-branches-settings' }], disabled: local_assigns[:disabled], aria: { label: s_('ProtectedBranch|Unprotect branch') }, data: { confirm: s_('ProtectedBranch|Branch will be writable for developers. Are you sure?'), confirm_btn_variant: 'danger' }, method: :delete, variant: :danger, size: :small diff --git a/app/views/sent_notifications/unsubscribe.html.haml b/app/views/sent_notifications/unsubscribe.html.haml index 03b030eb2575bf..16e4ff4d17f65e 100644 --- a/app/views/sent_notifications/unsubscribe.html.haml +++ b/app/views/sent_notifications/unsubscribe.html.haml @@ -16,4 +16,4 @@ %p = link_to _('Unsubscribe'), unsubscribe_sent_notification_path(@sent_notification, force: true), class: 'gl-button btn btn-confirm gl-mr-3' - = link_to _('Cancel'), new_user_session_path, class: 'gl-button btn gl-mr-3' + = link_button_to _('Cancel'), new_user_session_path, class: 'gl-mr-3' diff --git a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml index f4af3ea70d42fb..79a9bafc4f0bc5 100644 --- a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml +++ b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml @@ -8,5 +8,5 @@ %div = _('Container registry is not enabled on this GitLab instance. Ask an administrator to enable it in order for Auto DevOps to work.') - c.with_actions do - = link_to _('Settings'), project_settings_ci_cd_path(project), class: 'alert-link btn gl-button btn-confirm' - = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank', class: 'alert-link btn gl-button btn-default gl-ml-3' + = link_button_to _('Settings'), project_settings_ci_cd_path(project), class: 'alert-link', variant: :confirm + = link_button_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank', class: 'alert-link gl-ml-3' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index e9c0858e0908b1..a3f24da5d7cf95 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -5,5 +5,5 @@ - c.with_body do = s_("MissingSSHKeyWarningLink|You can't push or pull repositories using SSH until you add an SSH key to your profile.") - c.with_actions do - = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "gl-alert-action btn btn-confirm btn-md gl-button" - = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: { hide_no_ssh_key: true }), method: :put, role: 'button', class: 'gl-alert-action btn btn-default btn-md gl-button' + = link_button_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: 'gl-alert-action', variant: :confirm + = link_button_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: { hide_no_ssh_key: true }), method: :put, role: 'button', class: 'gl-alert-action' diff --git a/app/views/shared/_project_limit.html.haml b/app/views/shared/_project_limit.html.haml index ce49193e27bccc..a99db32c40eb0c 100644 --- a/app/views/shared/_project_limit.html.haml +++ b/app/views/shared/_project_limit.html.haml @@ -5,5 +5,5 @@ - c.with_body do = _("You won't be able to create new projects because you have reached your project limit.") - c.with_actions do - = link_to _('Remind later'), '#', class: 'alert-link hide-project-limit-message btn gl-button btn-confirm' - = link_to _("Don't show again"), profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link btn gl-button btn-default gl-ml-3' + = link_button_to _('Remind later'), '#', class: 'alert-link hide-project-limit-message', variant: :confirm + = link_button_to _("Don't show again"), profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link gl-ml-3' diff --git a/app/views/shared/_prometheus_configuration_banner.html.haml b/app/views/shared/_prometheus_configuration_banner.html.haml index 2d948cf28a63a5..7469260a9973b5 100644 --- a/app/views/shared/_prometheus_configuration_banner.html.haml +++ b/app/views/shared/_prometheus_configuration_banner.html.haml @@ -17,11 +17,11 @@ .col-sm-10 %p.text-success.gl-mt-3 = s_('PrometheusService|You have a cluster with the Prometheus integration enabled.') - = link_to s_('PrometheusService|Manage clusters'), project_clusters_path(project), class: 'btn gl-button btn-default' + = link_button_to s_('PrometheusService|Manage clusters'), project_clusters_path(project) - else .col-sm-2 = image_tag 'illustrations/monitoring/loading.svg' .col-sm-10 %p.gl-mt-3 = s_('PrometheusService|Configure GitLab to query a Prometheus installed in one of your clusters.') - = link_to s_('PrometheusService|Manage clusters'), project_clusters_path(project), class: 'btn gl-button btn-confirm' + = link_button_to s_('PrometheusService|Manage clusters'), project_clusters_path(project), variant: :confirm diff --git a/app/views/shared/doorkeeper/applications/_show.html.haml b/app/views/shared/doorkeeper/applications/_show.html.haml index b9095e2a1a1178..b075cece87775b 100644 --- a/app/views/shared/doorkeeper/applications/_show.html.haml +++ b/app/views/shared/doorkeeper/applications/_show.html.haml @@ -43,8 +43,8 @@ .form-actions.gl-display-flex.gl-justify-content-space-between %div - if @created - = link_to _('Continue'), index_path, class: 'btn btn-confirm btn-md gl-button gl-mr-3' - = link_to _('Edit'), edit_path, class: 'btn btn-default btn-md gl-button' + = link_button_to _('Continue'), index_path, class: 'gl-mr-3', variant: :confirm + = link_button_to _('Edit'), edit_path = render 'shared/doorkeeper/applications/delete_form', path: delete_path -# Create a hidden field to save the ID of application created diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 387a83873b5a05..a4ea98a0fb7120 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -19,7 +19,7 @@ = _("To widen your search, change or remove filters above") - if show_new_issue_link?(@project) .text-center - = link_to _("New issue"), new_project_issue_path(@project), class: "gl-button btn btn-confirm" + = link_button_to _("New issue"), new_project_issue_path(@project), variant: :confirm - elsif is_opened_state && opened_issues_count == 0 && closed_issues_count > 0 %h4.text-center = _("There are no open issues") @@ -27,7 +27,7 @@ = _("To keep this project going, create a new issue") - if show_new_issue_link?(@project) .text-center - = link_to _("New issue"), new_project_issue_path(@project), class: "gl-button btn btn-confirm" + = link_button_to _("New issue"), new_project_issue_path(@project), variant: :confirm - elsif is_closed_state && opened_issues_count > 0 && closed_issues_count == 0 %h4.text-center = _("There are no closed issues") @@ -39,7 +39,7 @@ - if button_path .text-center - if show_new_issue_link?(@project) - = link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link' + = link_button_to _('New issue'), button_path, id: 'new_issue_link', variant: :confirm - if show_import_button .js-csv-import-export-buttons{ data: { show_import_button: 'true', issuable_type: 'issue', import_csv_issues_path: import_csv_namespace_project_issues_path, can_edit: can_edit.to_s, project_import_jira_path: project_import_jira_path(@project), max_attachment_size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes) } } @@ -59,4 +59,4 @@ %p = _("The Issue Tracker is the place to add things that need to be improved or solved in a project. You can register or sign in to create issues for this project.") .text-center - = link_to _('Register / Sign In'), new_user_session_path, class: 'gl-button btn btn-confirm' + = link_button_to _('Register / Sign In'), new_user_session_path, variant: :confirm diff --git a/app/views/shared/empty_states/_labels.html.haml b/app/views/shared/empty_states/_labels.html.haml index da88c139a6e012..4d2127c016173b 100644 --- a/app/views/shared/empty_states/_labels.html.haml +++ b/app/views/shared/empty_states/_labels.html.haml @@ -8,7 +8,7 @@ %p= _("You can also star a label to make it a priority label.") .text-center - if can?(current_user, :admin_label, @project) - = link_to _('New label'), new_project_label_path(@project), class: 'btn gl-button btn-confirm', title: _('New label'), id: 'new_label_link' - = link_to _('Generate a default set of labels'), generate_project_labels_path(@project), method: :post, class: 'btn gl-button btn-confirm-secondary', title: _('Generate a default set of labels'), id: 'generate_labels_link' + = link_button_to _('New label'), new_project_label_path(@project), title: _('New label'), id: 'new_label_link', variant: :confirm + = link_button_to _('Generate a default set of labels'), generate_project_labels_path(@project), method: :post, title: _('Generate a default set of labels'), id: 'generate_labels_link', variant: :confirm, category: :secondary - if can?(current_user, :admin_label, @group) - = link_to _('New label'), new_group_label_path(@group), class: 'btn gl-button btn-confirm', title: _('New label'), id: 'new_label_link' + = link_button_to _('New label'), new_group_label_path(@group), title: _('New label'), id: 'new_label_link', variant: :confirm diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index 94589996c3a6d0..5b377818c6ea4b 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -18,7 +18,7 @@ = _("To widen your search, change or remove filters above") .text-center - if can_create_merge_request - = link_to _("New merge request"), button_path || project_new_merge_request_path(@project), class: "gl-button btn btn-confirm", title: _("New merge request") + = link_button_to _("New merge request"), button_path || project_new_merge_request_path(@project), title: _("New merge request"), variant: :confirm - elsif is_opened_state && opened_merged_count == 0 && closed_merged_count > 0 %h4.text-center = _("There are no open merge requests") @@ -26,7 +26,7 @@ = _("To keep this project going, create a new merge request") .text-center - if can_create_merge_request - = link_to _("New merge request"), button_path || project_new_merge_request_path(@project), class: "gl-button btn btn-confirm", title: _("New merge request") + = link_button_to _("New merge request"), button_path || project_new_merge_request_path(@project), title: _("New merge request"), variant: :confirm - elsif is_closed_state && opened_merged_count > 0 && closed_merged_count == 0 %h4.text-center = _("There are no closed merge requests") @@ -37,4 +37,4 @@ = _("Interested parties can even contribute by pushing commits if they want to.") - if button_path .text-center - = link_to _('New merge request'), button_path, class: 'gl-button btn btn-confirm', title: _('New merge request'), id: 'new_merge_request_link', data: { qa_selector: "new_merge_request_button" } + = link_button_to _('New merge request'), button_path, title: _('New merge request'), id: 'new_merge_request_link', data: { qa_selector: "new_merge_request_button" }, variant: :confirm diff --git a/app/views/shared/empty_states/_profile_tabs.html.haml b/app/views/shared/empty_states/_profile_tabs.html.haml index c813fd691f1709..ba5fbd9052805d 100644 --- a/app/views/shared/empty_states/_profile_tabs.html.haml +++ b/app/views/shared/empty_states/_profile_tabs.html.haml @@ -13,9 +13,9 @@ %p= current_user_empty_message_description - if secondary_button_link.present? - = link_to secondary_button_label, secondary_button_link, class: 'gl-button btn btn-confirm btn-inverted' + = link_button_to secondary_button_label, secondary_button_link, variant: :confirm, category: :secondary - if primary_button_link.present? - = link_to primary_button_label, primary_button_link, class: 'gl-button btn btn-confirm' + = link_button_to primary_button_label, primary_button_link, variant: :confirm - else %h5= visitor_empty_message diff --git a/app/views/shared/empty_states/_snippets.html.haml b/app/views/shared/empty_states/_snippets.html.haml index 87de756093d75d..6fe36d75453210 100644 --- a/app/views/shared/empty_states/_snippets.html.haml +++ b/app/views/shared/empty_states/_snippets.html.haml @@ -12,7 +12,7 @@ = s_('SnippetsEmptyState|Store, share, and embed small pieces of code and text.') .gl-mt-3< - if button_path - = link_to s_('SnippetsEmptyState|New snippet'), button_path, class: 'btn gl-button btn-confirm', title: s_('SnippetsEmptyState|New snippet'), id: 'new_snippet_link', data: { qa_selector: 'create_first_snippet_link' } - = link_to s_('SnippetsEmptyState|Documentation'), help_page_path('user/snippets.md'), class: 'btn gl-button btn-default', title: s_('SnippetsEmptyState|Documentation') + = link_button_to s_('SnippetsEmptyState|New snippet'), button_path, title: s_('SnippetsEmptyState|New snippet'), id: 'new_snippet_link', data: { qa_selector: 'create_first_snippet_link' }, variant: :confirm + = link_button_to s_('SnippetsEmptyState|Documentation'), help_page_path('user/snippets.md'), title: s_('SnippetsEmptyState|Documentation') - else %h4.gl-text-center= s_('SnippetsEmptyState|There are no snippets to show.') diff --git a/app/views/shared/empty_states/_wikis.html.haml b/app/views/shared/empty_states/_wikis.html.haml index 57f1c9d381e7a7..9e628a1f4099e3 100644 --- a/app/views/shared/empty_states/_wikis.html.haml +++ b/app/views/shared/empty_states/_wikis.html.haml @@ -4,7 +4,7 @@ - if !hide_create && can?(current_user, :create_wiki, @wiki.container) - create_path = wiki_page_path(@wiki, params[:id], view: 'create') - - create_link = link_to s_('WikiEmpty|Create your first page'), create_path, class: 'btn gl-button btn-confirm', title: s_('WikiEmpty|Create your first page'), data: { qa_selector: 'create_first_page_link' } + - create_link = link_button_to s_('WikiEmpty|Create your first page'), create_path, title: s_('WikiEmpty|Create your first page'), data: { qa_selector: 'create_first_page_link' }, variant: :confirm = render layout: layout_path, locals: { image_path: 'illustrations/wiki_login_empty.svg' } do %h4.text-left @@ -26,7 +26,7 @@ %p.text-left = messages.dig(:issuable, :body).html_safe % { issues_link: issues_link } - if show_new_issue_link?(@project) - = link_to s_('WikiEmpty|Suggest wiki improvement'), new_project_issue_path(@project), class: 'btn gl-button btn-confirm', title: s_('WikiEmptyIssueMessage|Suggest wiki improvement') + = link_button_to s_('WikiEmpty|Suggest wiki improvement'), new_project_issue_path(@project), title: s_('WikiEmptyIssueMessage|Suggest wiki improvement'), variant: :confirm - else = render layout: layout_path, locals: { image_path: 'illustrations/wiki_logout_empty.svg' } do diff --git a/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml b/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml index 5c9f77f8c12ee3..e6e7ec28807a78 100644 --- a/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml +++ b/app/views/shared/integrations/gitlab_slack_application/_slack_integration_form.html.haml @@ -22,7 +22,7 @@ %td{ class: 'gl-py-3!' } .controls - project = integration.project - = link_to _('Edit'), edit_project_settings_slack_path(project), class: 'btn gl-button btn-default' + = link_button_to _('Edit'), edit_project_settings_slack_path(project) = link_to sprite_icon('remove', css_class: 'gl-icon'), project_settings_slack_path(project), method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary', aria: { label: s_('SlackIntegration|Remove project') }, data: { confirm_btn_variant: "danger", confirm: s_('SlackIntegration|Are you sure you want to remove this project from the GitLab for Slack app?') } .gl-my-5 = render 'shared/integrations/gitlab_slack_application/slack_button', project: @project, label: s_('SlackIntegration|Reinstall GitLab for Slack app') diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index 0264196f60ca3b..a7a650aa95dd33 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -11,7 +11,7 @@ %strong = s_('PrometheusService|Custom metrics') = gl_badge_tag 0, nil, class: 'gl-ml-2 js-custom-monitored-count' - = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden' + = link_button_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'gl-ml-auto js-new-metric-button hidden', variant: :confirm - c.with_body do .flash-container.hidden .flash-warning diff --git a/app/views/shared/integrations/slack_slash_commands/_help.html.haml b/app/views/shared/integrations/slack_slash_commands/_help.html.haml index fee0ca15808db2..43a240fa6feec2 100644 --- a/app/views/shared/integrations/slack_slash_commands/_help.html.haml +++ b/app/views/shared/integrations/slack_slash_commands/_help.html.haml @@ -57,7 +57,7 @@ = label_tag nil, _('Customize icon'), class: 'col-12 col-form-label label-bold' .col-12 = image_tag(asset_url('slash-command-logo.png', skip_pipeline: true), width: 36, height: 36, class: 'mr-3') - = link_to(_('Download image'), asset_url('gitlab_logo.png'), class: 'gl-button btn btn-default btn-sm', target: '_blank', rel: 'noopener noreferrer') + = link_button_to _('Download image'), asset_url('gitlab_logo.png'), target: '_blank', rel: 'noopener noreferrer', size: :small .form-group = label_tag nil, _('Autocomplete'), class: 'col-12 col-form-label label-bold' diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index b6bd691213c5d7..42f035b99aa6ec 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -61,14 +61,14 @@ = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - if issuable.new_record? - = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default js-reset-autosave' + = link_button_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'js-reset-autosave' - else - = link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-default js-reset-autosave' + = link_button_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'js-reset-autosave' - if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project) - confirm_title = _('Delete %{issuableType}?') % { issuableType: issuable.human_class_name } - confirm_body = _('You’re about to permanently delete the %{issuableType} ‘%{strongOpen}%{issuableTitle}%{strongClose}’. To avoid data loss, consider %{strongOpen}closing this %{issuableType}%{strongClose} instead. Once deleted, it cannot be undone or recovered.') % { issuableType: issuable.human_class_name, issuableTitle: issuable.title, strongOpen: '', strongClose: '' } - confirm_primary_btn_text = _('Delete %{issuableType}') % { issuableType: issuable.human_class_name } - = link_to _('Delete'), polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { title: confirm_title, confirm: confirm_body, is_html_message: true, confirm_btn_variant: 'danger'}, method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary gl-float-right js-reset-autosave', "aria-label": confirm_primary_btn_text + = link_button_to _('Delete'), polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { title: confirm_title, confirm: confirm_body, is_html_message: true, confirm_btn_variant: 'danger'}, method: :delete, class: 'gl-float-right js-reset-autosave', "aria-label": confirm_primary_btn_text, variant: :danger, category: :secondary - if issuable.respond_to?(:issue_type) = form.hidden_field :issue_type diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index 01548325c83863..c36d3a8b92b254 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -52,6 +52,6 @@ = render Pajamas::ButtonComponent.new(icon: 'level-up', category: :tertiary, size: :small, button_options: { class: 'js-promote-project-milestone-button', title: s_('Milestones|Promote to Group Milestone'), disabled: true, data: { toggle: 'tooltip', container: 'body', url: promote_project_milestone_path(milestone.project, milestone), milestone_title: milestone.title, group_name: @project.group.name } }) - if can?(current_user, :admin_milestone, milestone) - if milestone.closed? - = link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm gl-ml-3" + = link_button_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: 'gl-ml-3', size: :small - else - = link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn gl-button btn-default btn-default-secondary btn-sm gl-ml-3" + = link_button_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: 'gl-ml-3', category: :secondary, size: :small diff --git a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml index cbbb2f51fd5ded..1580fc0bd6dbc0 100644 --- a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml +++ b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml @@ -10,4 +10,4 @@ = succeed '.' do = link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer' - c.with_actions do - = link_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'btn gl-alert-action btn-confirm gl-button' + = link_button_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'gl-alert-action', variant: :confirm diff --git a/ee/app/components/namespaces/storage/limit_alert_component.html.haml b/ee/app/components/namespaces/storage/limit_alert_component.html.haml index a9f0d3315552ac..1a2eb5f57e0290 100644 --- a/ee/app/components/namespaces/storage/limit_alert_component.html.haml +++ b/ee/app/components/namespaces/storage/limit_alert_component.html.haml @@ -17,6 +17,6 @@ - if purchase_link || usage_quotas_link = c.with_actions do - if purchase_link - = link_to(_('Purchase more storage'), purchase_link, class: "btn gl-alert-action btn-md gl-button btn-confirm") + = link_button_to _('Purchase more storage'), purchase_link, class: 'gl-alert-action', variant: :confirm - if usage_quotas_link - = link_to(_('View usage details'), usage_quotas_link, class: "btn gl-alert-action btn-md gl-button btn-default") + = link_button_to _('View usage details'), usage_quotas_link, class: 'gl-alert-action' diff --git a/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml b/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml index 04e90dada1aefd..50dbd52fa40ea9 100644 --- a/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml +++ b/ee/app/views/admin/application_settings/_elasticsearch_form.html.haml @@ -31,7 +31,7 @@ = link_to _('Learn more.'), help_page_path('integration/advanced_search/elasticsearch', anchor: 'advanced-search-migrations') - c.with_actions do - migration = Elastic::DataMigrationService.halted_migration - = link_to _('Retry migration'), admin_elasticsearch_retry_migration_path(version: migration.version), class: 'btn gl-alert-action btn-confirm gl-button', disabled: @last_elasticsearch_reindexing_task&.in_progress?, data: { confirm: _('Are you sure you want to retry this migration?') }, method: :post + = link_button_to _('Retry migration'), admin_elasticsearch_retry_migration_path(version: migration.version), class: 'gl-alert-action', disabled: @last_elasticsearch_reindexing_task&.in_progress?, data: { confirm: _('Are you sure you want to retry this migration?') }, method: :post, variant: :confirm .form-group - unless Gitlab::CurrentSettings.elasticsearch_indexing? diff --git a/ee/app/views/admin/licenses/_summary.html.haml b/ee/app/views/admin/licenses/_summary.html.haml index 9a3711e6bfa511..0e9fa892b1c425 100644 --- a/ee/app/views/admin/licenses/_summary.html.haml +++ b/ee/app/views/admin/licenses/_summary.html.haml @@ -15,4 +15,4 @@ %strong= @license.licensee_name = "(#{@license.licensee_email})" %div - = link_to _('View details'), admin_subscription_path, class: "gl-button btn btn-default" + = link_button_to _('View details'), admin_subscription_path diff --git a/ee/app/views/groups/hook_logs/show.html.haml b/ee/app/views/groups/hook_logs/show.html.haml index a3e35d668a9418..4ae550aa8f7d1e 100644 --- a/ee/app/views/groups/hook_logs/show.html.haml +++ b/ee/app/views/groups/hook_logs/show.html.haml @@ -9,6 +9,6 @@ - if @hook_log.oversize? = button_tag _("Resend Request"), class: "btn gl-button btn-default float-right gl-ml-3 has-tooltip", disabled: true, title: _("Request data is too large") - else - = link_to _("Resend Request"), @hook_log.present.retry_path, method: :post, class: "btn gl-button btn-default float-right gl-ml-3" + = link_button_to _("Resend Request"), @hook_log.present.retry_path, method: :post, class: 'float-right gl-ml-3' = render partial: 'shared/hook_logs/content', locals: { hook_log: @hook_log } diff --git a/ee/app/views/groups/hooks/edit.html.haml b/ee/app/views/groups/hooks/edit.html.haml index 2694f501b92506..a0fd6ff25db9d4 100644 --- a/ee/app/views/groups/hooks/edit.html.haml +++ b/ee/app/views/groups/hooks/edit.html.haml @@ -12,7 +12,7 @@ %div = f.submit _('Save changes'), pajamas_button: true, class: 'gl-sm-mr-3' = render 'shared/web_hooks/test_button', hook: @hook - = link_to _('Delete'), group_hook_path(@group, @hook), method: :delete, class: 'gl-button btn btn-danger gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this group hook?'), confirm_btn_variant: 'danger' } + = link_button_to _('Delete'), group_hook_path(@group, @hook), method: :delete, class: 'gl-float-right', aria: { label: s_('Webhooks|Delete webhook') }, data: { confirm: s_('Webhooks|Are you sure you want to delete this group hook?'), confirm_btn_variant: 'danger' }, variant: :danger %hr diff --git a/ee/app/views/groups/settings/domain_verification/_lets_encrypt_callout.html.haml b/ee/app/views/groups/settings/domain_verification/_lets_encrypt_callout.html.haml index 8c7e220e037da3..b6f368d9d055f2 100644 --- a/ee/app/views/groups/settings/domain_verification/_lets_encrypt_callout.html.haml +++ b/ee/app/views/groups/settings/domain_verification/_lets_encrypt_callout.html.haml @@ -7,7 +7,7 @@ = sprite_icon('warning-solid', css_class: 'gl-mr-2 gl-text-orange-600') = _("Something went wrong while obtaining the Let's Encrypt certificate.") .row.gl-mx-0.gl-mt-3 - = link_to _('Retry'), retry_auto_ssl_group_settings_domain_verification_path(group, domain_presenter), class: "gl-button btn btn-default btn-sm btn-grouped", method: :post + = link_button_to _('Retry'), retry_auto_ssl_group_settings_domain_verification_path(group, domain_presenter), class: 'btn-grouped', method: :post, size: :small - elsif !domain_presenter.certificate_gitlab_provided? .form-group.gl-form-group.js-shown-if-auto-ssl{ class: ("gl-display-none" unless auto_ssl_available_and_enabled) } .bs-callout.bs-callout-info.gl-mt-0 diff --git a/ee/app/views/groups/settings/domain_verification/new.html.haml b/ee/app/views/groups/settings/domain_verification/new.html.haml index 732b39350c2ace..965a6d7b14c46a 100644 --- a/ee/app/views/groups/settings/domain_verification/new.html.haml +++ b/ee/app/views/groups/settings/domain_verification/new.html.haml @@ -8,4 +8,4 @@ = gitlab_ui_form_for domain_presenter, url: group_settings_domain_verification_index_path(@group), html: { name: "domainForm", class: 'fieldset-form' } do |f| = render 'form', { f: f } = f.submit s_("DomainVerification|Add Domain"), class: 'gl-mr-3', pajamas_button: true - = link_to _('Cancel'), group_settings_domain_verification_index_path(@group), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), group_settings_domain_verification_index_path(@group) diff --git a/ee/app/views/groups/settings/domain_verification/show.html.haml b/ee/app/views/groups/settings/domain_verification/show.html.haml index 3e4cdd136a3753..16fc788a728919 100644 --- a/ee/app/views/groups/settings/domain_verification/show.html.haml +++ b/ee/app/views/groups/settings/domain_verification/show.html.haml @@ -8,4 +8,4 @@ = gitlab_ui_form_for domain_presenter, url: group_settings_domain_verification_path(@group, domain_presenter), html: { name: "domain-form", class: 'fieldset-form' } do |f| = render 'form', { f: f } = f.submit _('Save Changes'), class: 'gl-mr-3', pajamas_button: true - = link_to _('Cancel'), group_settings_domain_verification_index_path(@group), class: 'gl-button btn btn-default btn-cancel' + = link_button_to _('Cancel'), group_settings_domain_verification_index_path(@group) diff --git a/ee/app/views/layouts/header/_licensed_user_count_threshold.html.haml b/ee/app/views/layouts/header/_licensed_user_count_threshold.html.haml index 1d793a0964bc9f..7c165eb532b98f 100644 --- a/ee/app/views/layouts/header/_licensed_user_count_threshold.html.haml +++ b/ee/app/views/layouts/header/_licensed_user_count_threshold.html.haml @@ -6,5 +6,5 @@ - c.with_body do = _('Your instance has %{remaining_user_count} users remaining of the %{total_user_count} included in your subscription. You can add more users than the number included in your license, and we will include the overage in your next bill.') % { remaining_user_count: remaining_user_count, total_user_count: total_user_count } - c.with_actions do - = link_to _('View users statistics'), admin_users_path, class: 'btn gl-alert-action btn-confirm btn-md gl-button' - = link_to _('Contact support'), EE::CUSTOMER_LICENSE_SUPPORT_URL, rel: 'nofollow', class: 'btn gl-alert-action btn-confirm btn-md gl-button btn-confirm-secondary' + = link_button_to _('View users statistics'), admin_users_path, class: 'gl-alert-action', variant: :confirm + = link_button_to _('Contact support'), EE::CUSTOMER_LICENSE_SUPPORT_URL, rel: 'nofollow', class: 'gl-alert-action', variant: :confirm, category: :secondary diff --git a/ee/app/views/layouts/header/_read_only_banner.html.haml b/ee/app/views/layouts/header/_read_only_banner.html.haml index 0c48c1b26d89b0..9ed358d2fcfda8 100644 --- a/ee/app/views/layouts/header/_read_only_banner.html.haml +++ b/ee/app/views/layouts/header/_read_only_banner.html.haml @@ -17,4 +17,4 @@ = secondary_description - c.with_actions do - if ::Gitlab::Geo.primary_node.present? - = link_to s_('Geo|Go to the primary site'), ::Gitlab::Geo.primary_node_url, class: "btn gl-alert-action btn-default btn-md gl-button btn-default-secondary" + = link_button_to s_('Geo|Go to the primary site'), ::Gitlab::Geo.primary_node_url, class: 'gl-alert-action', category: :secondary diff --git a/ee/app/views/layouts/header/_seat_count_alert.html.haml b/ee/app/views/layouts/header/_seat_count_alert.html.haml index 6a466bcfb3d87c..5b45a0b3f6a0b0 100644 --- a/ee/app/views/layouts/header/_seat_count_alert.html.haml +++ b/ee/app/views/layouts/header/_seat_count_alert.html.haml @@ -12,4 +12,4 @@ = _('Even if you reach the number of seats in your subscription, you can continue to add users, and GitLab will bill you for the overage.') = link_to _('Learn more.'), help_page_path('subscriptions/quarterly_reconciliation'), target: '_blank', rel: 'noopener noreferrer' - c.with_actions do - = link_to _('View seat usage'), usage_quotas_path(namespace, anchor: 'seats-quota-tab'), class: 'btn gl-alert-action btn-confirm btn-md gl-button' + = link_button_to _('View seat usage'), usage_quotas_path(namespace, anchor: 'seats-quota-tab'), class: 'gl-alert-action', variant: :confirm diff --git a/ee/app/views/shared/_manual_quarterly_reconciliation_banner.html.haml b/ee/app/views/shared/_manual_quarterly_reconciliation_banner.html.haml index 66ae110585da21..23352eebe608e2 100644 --- a/ee/app/views/shared/_manual_quarterly_reconciliation_banner.html.haml +++ b/ee/app/views/shared/_manual_quarterly_reconciliation_banner.html.haml @@ -11,5 +11,5 @@ - c.with_body do = payload.body - c.with_actions do - = link_to s_('SubscriptionBanner|Export license usage file'), admin_license_usage_export_path(format: :csv), class: 'btn gl-alert-action gl-button btn-confirm' - = link_to s_('SubscriptionBanner|Add new license'), general_admin_application_settings_path, class: 'btn gl-alert-action gl-button btn-default' + = link_button_to s_('SubscriptionBanner|Export license usage file'), admin_license_usage_export_path(format: :csv), class: 'gl-alert-action', variant: :confirm + = link_button_to s_('SubscriptionBanner|Add new license'), general_admin_application_settings_path, class: 'gl-alert-action' diff --git a/ee/app/views/shared/_namespace_user_cap_reached_alert.html.haml b/ee/app/views/shared/_namespace_user_cap_reached_alert.html.haml index a4067bb2b5ad83..70bc6d63963853 100644 --- a/ee/app/views/shared/_namespace_user_cap_reached_alert.html.haml +++ b/ee/app/views/shared/_namespace_user_cap_reached_alert.html.haml @@ -18,4 +18,4 @@ - c.with_body do = s_('NamespaceUserCap|Pending users must be reviewed and approved by a group owner. Learn more about %{user_caps_link_start}user caps%{link_end} and %{users_pending_approval_link_start}users pending approval%{link_end}.').html_safe % { user_caps_link_start: user_caps_link_start, users_pending_approval_link_start: users_pending_approval_link_start, link_end: link_end } - c.with_actions do - = link_to(s_('NamespaceUserCap|View pending approvals'), pending_users_link, class: "btn gl-alert-action btn-md gl-button btn-confirm") + = link_button_to s_('NamespaceUserCap|View pending approvals'), pending_users_link, class: 'gl-alert-action', variant: :confirm diff --git a/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml b/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml index 10adf6d60cc5f7..f85b1147f3e9df 100644 --- a/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml +++ b/ee/app/views/shared/_new_user_signups_cap_reached_alert.html.haml @@ -15,4 +15,4 @@ = s_('Admin|Additional users must be reviewed and approved by a system administrator. Learn more about %{help_link_start}usage caps%{help_link_end}.').html_safe % { help_link_start: help_link_start, help_link_end: help_link_end } - if User.blocked_pending_approval.count > 0 - c.with_actions do - = link_to s_('Admin|View pending user approvals'), admin_users_path({ filter: 'blocked_pending_approval' }), class: 'btn gl-alert-action btn-confirm gl-button' + = link_button_to s_('Admin|View pending user approvals'), admin_users_path({ filter: 'blocked_pending_approval' }), class: 'gl-alert-action', variant: :confirm diff --git a/ee/app/views/shared/_submit_license_usage_data_banner.html.haml b/ee/app/views/shared/_submit_license_usage_data_banner.html.haml index 1a1bc079f72103..e55849a235ef1e 100644 --- a/ee/app/views/shared/_submit_license_usage_data_banner.html.haml +++ b/ee/app/views/shared/_submit_license_usage_data_banner.html.haml @@ -12,5 +12,5 @@ - c.with_body do = payload.body - c.with_actions do - = link_to s_('SubscriptionBanner|Export license usage file'), admin_license_usage_export_path(format: :csv), class: 'btn gl-alert-action gl-button btn-confirm' - = link_to s_('SubscriptionBanner|Upload new license'), general_admin_application_settings_path, class: 'btn gl-alert-action gl-button btn-default' + = link_button_to s_('SubscriptionBanner|Export license usage file'), admin_license_usage_export_path(format: :csv), class: 'gl-alert-action', variant: :confirm + = link_button_to s_('SubscriptionBanner|Upload new license'), general_admin_application_settings_path, class: 'gl-alert-action' diff --git a/ee/app/views/shared/_ultimate_trial_callout_content.html.haml b/ee/app/views/shared/_ultimate_trial_callout_content.html.haml index 6c0e2328997d1e..5ec994576fceaf 100644 --- a/ee/app/views/shared/_ultimate_trial_callout_content.html.haml +++ b/ee/app/views/shared/_ultimate_trial_callout_content.html.haml @@ -15,7 +15,7 @@ %p %span= _('Try all GitLab has to offer for 30 days.') %span.d-none.d-sm-inline= _('No credit card required.') - = link_to _('Start your free trial'), new_trial_path(glm_source: glm_source, glm_content: 'gold-callout'), class: "btn btn-confirm gl-button mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'click_button', track_label: 'start_your_trial', track_property: banner_title } + = link_button_to _('Start your free trial'), new_trial_path(glm_source: glm_source, glm_content: 'gold-callout'), class: "mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'click_button', track_label: 'start_your_trial', track_property: banner_title }, variant: :confirm - if is_dismissable = render Pajamas::ButtonComponent.new(category: :tertiary, icon: 'close', diff --git a/ee/app/views/shared/credentials_inventory/resource_access_tokens/_resource_access_token.html.haml b/ee/app/views/shared/credentials_inventory/resource_access_tokens/_resource_access_token.html.haml index 52ade78d0bc352..e63cccecc78877 100644 --- a/ee/app/views/shared/credentials_inventory/resource_access_tokens/_resource_access_token.html.haml +++ b/ee/app/views/shared/credentials_inventory/resource_access_tokens/_resource_access_token.html.haml @@ -44,6 +44,6 @@ .table-mobile-header{ role: 'rowheader' } .table-mobile-content - if project - = link_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: project.id, resource_type: 'Project'), method: :put, data: { confirm: _('Are you sure you want to revoke this project access token? This action cannot be undone.') }, class: 'btn btn-danger btn-danger-secondary btn-md btn-secondary gl-button' + = link_button_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: project.id, resource_type: 'Project'), method: :put, data: { confirm: _('Are you sure you want to revoke this project access token? This action cannot be undone.') }, variant: :danger, category: :secondary - else - = link_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: group.id, resource_type: 'Group'), method: :put, data: { confirm: _('Are you sure you want to revoke this group access token? This action cannot be undone.') }, class: 'btn btn-danger btn-danger-secondary btn-md btn-secondary gl-button' + = link_button_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: group.id, resource_type: 'Group'), method: :put, data: { confirm: _('Are you sure you want to revoke this group access token? This action cannot be undone.') }, variant: :danger, category: :secondary diff --git a/ee/app/views/shared/promotions/_promote_epics.html.haml b/ee/app/views/shared/promotions/_promote_epics.html.haml index da3550e9f2fc14..78262e5f2cfa9d 100644 --- a/ee/app/views/shared/promotions/_promote_epics.html.haml +++ b/ee/app/views/shared/promotions/_promote_epics.html.haml @@ -23,7 +23,7 @@ = link_to _('Read more'), help_page_url('user/group/epics/index'), class: 'btn-link', target: '_blank', rel: 'noopener noreferrer' .gl-flex-wrap = render 'shared/promotions/promotion_link_project', short_form: true, location: :epics - = link_to s_("Promotions|Don't show me this again"), '#', class: 'gl-button btn js-close js-close-callout gl-mt-2' + = link_button_to s_("Promotions|Don't show me this again"), '#', class: 'js-close js-close-callout gl-mt-2' .hide-collapsed = s_('Promotions|This feature is locked.') diff --git a/ee/app/views/shared/promotions/_promote_issue_weights.html.haml b/ee/app/views/shared/promotions/_promote_issue_weights.html.haml index dadb68e9c8fa0a..de728228ad4c9e 100644 --- a/ee/app/views/shared/promotions/_promote_issue_weights.html.haml +++ b/ee/app/views/shared/promotions/_promote_issue_weights.html.haml @@ -32,4 +32,4 @@ = s_('Promotions|Improve issues management with Issue weight and GitLab Enterprise Edition.') %div = render 'shared/promotions/promotion_link_project', short_form: true, target_blank: false, location: :issue_weights - = link_to s_("Promotions|Not now, thanks!"), '#', class: 'gl-button btn js-close js-close-callout gl-mt-3 js-close-session tr-issue-weights-not-now-cta' + = link_button_to s_("Promotions|Not now, thanks!"), '#', class: 'js-close js-close-callout gl-mt-3 js-close-session tr-issue-weights-not-now-cta' diff --git a/ee/app/views/shared/promotions/_promote_mobile_devops.html.haml b/ee/app/views/shared/promotions/_promote_mobile_devops.html.haml index 86802ed4bb34a1..2d5eec05591ed9 100644 --- a/ee/app/views/shared/promotions/_promote_mobile_devops.html.haml +++ b/ee/app/views/shared/promotions/_promote_mobile_devops.html.haml @@ -9,4 +9,4 @@ %p = s_('Promotions|Use GitLab Mobile DevOps to quickly build, sign, and release native and cross-platform mobile apps for Android and iOS using GitLab CI/CD.') - c.with_primary_action do - = link_to s_('Promotions|Get started with GitLab Mobile DevOps'), help_page_path('ci/mobile_devops.md'), class: 'gl-button btn btn-confirm gl-mb-3' + = link_button_to s_('Promotions|Get started with GitLab Mobile DevOps'), help_page_path('ci/mobile_devops.md'), class: 'gl-mb-3', variant: :confirm diff --git a/ee/app/views/shared/promotions/_promotion_link_project.html.haml b/ee/app/views/shared/promotions/_promotion_link_project.html.haml index 3846af917b496a..fefaf84f1c616d 100644 --- a/ee/app/views/shared/promotions/_promotion_link_project.html.haml +++ b/ee/app/views/shared/promotions/_promotion_link_project.html.haml @@ -5,7 +5,7 @@ -# EE:SaaS - namespace = @project&.namespace || @group - if can?(current_user, :admin_namespace, namespace) - = link_to s_('Promotions|Try it for free'), new_trial_registration_path(glm_source: glm_source, glm_content: location), class: 'btn gl-button btn-confirm promotion-trial-cta', target: target_blank ? '_blank' : '_self' + = link_button_to s_('Promotions|Try it for free'), new_trial_registration_path(glm_source: glm_source, glm_content: location), class: 'promotion-trial-cta', target: target_blank ?'_blank' : '_self', variant: :confirm - elsif namespace.is_a?(Group) %p= s_('Promotions|Contact an owner of group %{namespace_name} to upgrade the plan.') % { namespace_name: namespace.name } - else @@ -15,8 +15,8 @@ - elsif current_user&.admin? -# EE:Self Managed - if License.current&.expired? - = link_to (!short_form ? s_('Promotions|Buy GitLab Enterprise Edition') : s_('Promotions|Buy EE')), Gitlab::Saas.about_pricing_url, class: 'btn gl-button btn-confirm' + = link_button_to (!short_form ? s_('Promotions|Buy GitLab Enterprise Edition') : s_('Promotions|Buy EE')), Gitlab::Saas.about_pricing_url, variant: :confirm - else - = link_to s_('Promotions|Start GitLab Ultimate trial'), new_trial_url, class: 'gl-button btn btn-confirm gl-mb-3' + = link_button_to s_('Promotions|Start GitLab Ultimate trial'), new_trial_url, class: 'gl-mb-3', variant: :confirm - else %p= s_('Promotions|Contact your Administrator to upgrade your license.') diff --git a/ee/app/views/shared/web_hooks/_group_web_hook_disabled_alert.html.haml b/ee/app/views/shared/web_hooks/_group_web_hook_disabled_alert.html.haml index 1113e0f337ddc5..258acf745a80bd 100644 --- a/ee/app/views/shared/web_hooks/_group_web_hook_disabled_alert.html.haml +++ b/ee/app/views/shared/web_hooks/_group_web_hook_disabled_alert.html.haml @@ -10,4 +10,4 @@ = succeed '.' do = link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer' - c.with_actions do - = link_to s_('Webhooks|Go to webhooks'), group_hooks_path(@group, anchor: 'webhooks-index'), class: 'btn gl-alert-action btn-confirm gl-button' + = link_button_to s_('Webhooks|Go to webhooks'), group_hooks_path(@group, anchor: 'webhooks-index'), class: 'gl-alert-action', variant: :confirm -- GitLab From 0996abfbcf65ad13f8798194ea7161d4fe5c2216 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Fri, 30 Jun 2023 12:02:47 +0100 Subject: [PATCH 7/8] Remove unused styles Now all buttons here should be Pajamas-compliant, and so colour their icons correctly themselves. --- app/assets/stylesheets/page_bundles/project.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/assets/stylesheets/page_bundles/project.scss b/app/assets/stylesheets/page_bundles/project.scss index 68bf2fa0f822a5..8d8da10268a6d0 100644 --- a/app/assets/stylesheets/page_bundles/project.scss +++ b/app/assets/stylesheets/page_bundles/project.scss @@ -47,12 +47,6 @@ } .project-repo-buttons { - .btn { - svg { - fill: var(--gray-500, $gray-500); - } - } - .download-button { @include media-breakpoint-down(md) { margin-left: 0; -- GitLab From e20e19b536b5935b71c7f4670a0f72ee7e2ab908 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Wed, 5 Jul 2023 16:01:56 +0100 Subject: [PATCH 8/8] Remove redundant btn-inverse class --- app/views/projects/pages_domains/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/pages_domains/show.html.haml b/app/views/projects/pages_domains/show.html.haml index 8a0d39b7a0ec59..d34650d3f5a0cc 100644 --- a/app/views/projects/pages_domains/show.html.haml +++ b/app/views/projects/pages_domains/show.html.haml @@ -10,4 +10,4 @@ = render 'form', { f: f } .form-actions.gl-display-flex = f.submit _('Save Changes'), class: 'gl-mr-3', pajamas_button: true - = link_button_to _('Cancel'), project_pages_path(@project), class: 'btn-inverse' + = link_button_to _('Cancel'), project_pages_path(@project) -- GitLab