diff options
Diffstat (limited to 'app/views/shared')
35 files changed, 113 insertions, 140 deletions
diff --git a/app/views/shared/_confirm_modal.html.haml b/app/views/shared/_confirm_modal.html.haml deleted file mode 100644 index 4cb3f6d1739..00000000000 --- a/app/views/shared/_confirm_modal.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -#modal-confirm-danger.modal.qa-confirm-modal{ tabindex: -1 } - .modal-dialog - .modal-content - .modal-header - %h3.page-title= _('Confirmation required') - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": "true" } × - - .modal-body - %p.text-danger.js-confirm-text - - %p - %span.js-warning-text= _('This action can lead to data loss. To prevent accidental actions we ask you to confirm your intention.') - %br - - phrase_code = '<code class="js-legacy-confirm-danger-match">%{phrase_name}</code>'.html_safe % { phrase_name: phrase } - = _('Please type %{phrase_code} to proceed or close this modal to cancel.').html_safe % { phrase_code: phrase_code } - - .form-group - = text_field_tag 'confirm_name_input', '', class: 'form-control js-legacy-confirm-danger-input qa-confirm-input' - .form-actions - = submit_tag _('Confirm'), class: "gl-button btn btn-danger js-legacy-confirm-danger-submit qa-confirm-button" diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_integration_settings.html.haml index adacaeadfab..93606ca0aba 100644 --- a/app/views/shared/_service_settings.html.haml +++ b/app/views/shared/_integration_settings.html.haml @@ -1,6 +1,6 @@ = form_errors(integration) -.service-settings +%div{ data: { testid: "integration-settings-form" } } - if @default_integration .js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group, project: @project) } .js-vue-integration-settings{ data: integration_form_data(integration, group: @group, project: @project) } diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index e4ef0a52eba..9428813f6b0 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -10,18 +10,18 @@ = render "shared/label_row", label: label, force_priority: force_priority %ul.label-actions-list - if can?(current_user, :admin_label, @project) - %li.inline.js-toggle-priority{ data: { url: remove_priority_project_label_path(@project, label), + %li.gl-display-inline-block.js-toggle-priority.gl-ml-3{ data: { url: remove_priority_project_label_path(@project, label), dom_id: dom_id(label), type: label.type } } - %button.add-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip.gl-ml-3{ title: _('Prioritize'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Prioritize label') } + %button.add-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip{ title: _('Prioritize'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Prioritize label') } = sprite_icon('star-o') - %button.remove-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip.gl-ml-3{ title: _('Remove priority'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Deprioritize label') } + %button.remove-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip{ title: _('Remove priority'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Deprioritize label') } = sprite_icon('star') - if can?(current_user, :admin_label, label) - %li.inline + %li.gl-display-inline-block = link_to label.edit_path, class: 'btn gl-button btn-default-tertiary btn-sm edit has-tooltip', title: _('Edit'), data: { placement: 'bottom' }, aria_label: _('Edit') do = sprite_icon('pencil') - if can?(current_user, :admin_label, label) - %li.inline + %li.gl-display-inline-block .dropdown %button{ type: 'button', class: 'btn gl-button btn-default-tertiary btn-sm js-label-options-dropdown', data: { toggle: 'dropdown' }, aria_label: _('Label actions dropdown') } = sprite_icon('ellipsis_v') @@ -41,23 +41,23 @@ %button.text-danger.js-delete-label-modal-button{ type: 'button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } } = _('Delete') - if current_user - %li.inline.label-subscription + %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3 - if label.can_subscribe_to_label_in_different_levels? - %button.js-unsubscribe-button.gl-button.label-subscribe-button.btn.btn-default.gl-ml-3{ class: ('hidden' if status.unsubscribed?), data: { url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } - %span= _('Unsubscribe') + %button.js-unsubscribe-button.gl-button.btn.btn-default.gl-w-full{ class: ('hidden' if status.unsubscribed?), data: { url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } + %span.gl-button-text= _('Unsubscribe') .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } - %button.gl-button.label-subscribe-button.btn.btn-default.gl-ml-3{ data: { toggle: 'dropdown' } } - %span + %button.gl-button.btn.btn-default.gl-w-full{ data: { toggle: 'dropdown' } } + %span.gl-button-text = _('Subscribe') = sprite_icon('chevron-down') .dropdown-menu.dropdown-open-left %ul %li - %button.js-subscribe-button.label-subscribe-button.gl-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } - %span= _('Subscribe at project level') + %button.js-subscribe-button{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } + %span.gl-button-text= _('Subscribe at project level') %li - %button.js-subscribe-button.js-group-level.label-subscribe-button.gl-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } - %span= _('Subscribe at group level') + %button.js-subscribe-button.js-group-level{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } + %span.gl-button-text= _('Subscribe at group level') - else - %button.gl-button.js-subscribe-button.label-subscribe-button.btn.btn-default.gl-ml-3{ data: { status: status, url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } - %span= label_subscription_toggle_button_text(label, @project) + %button.gl-button.js-subscribe-button.btn.btn-default.gl-w-full{ data: { status: status, url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } + %span.gl-button-text= label_subscription_toggle_button_text(label, @project) diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml index d5f4add2796..08003346d09 100644 --- a/app/views/shared/_new_project_item_select.html.haml +++ b/app/views/shared/_new_project_item_select.html.haml @@ -1,6 +1,6 @@ - if any_projects?(@projects) .project-item-select-holder.btn-group.gl-ml-auto.gl-mr-auto.gl-relative.gl-overflow-hidden{ class: 'gl-display-flex!' } - %a.btn.gl-button.btn-confirm.new-project-item-link.block-truncated.qa-new-project-item-link{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] }, class: "gl-m-0!" } + %a.btn.gl-button.btn-confirm.js-new-project-item-link.block-truncated.qa-new-project-item-link{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] }, class: "gl-m-0!" } = loading_icon(color: 'light') = project_select_tag :project_path, class: "project-item-select gl-absolute! gl-visibility-hidden", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path], with_shared: local_assigns[:with_shared], include_projects_in_subgroups: local_assigns[:include_projects_in_subgroups] }, with_feature_enabled: local_assigns[:with_feature_enabled] %button.btn.dropdown-toggle.btn-confirm.btn-md.gl-button.gl-dropdown-toggle.dropdown-toggle-split.new-project-item-select-button.qa-new-project-item-select-button.gl-p-0.gl-w-100{ class: "gl-m-0!", 'aria-label': _('Toggle project select') } diff --git a/app/views/shared/_old_visibility_level.html.haml b/app/views/shared/_old_visibility_level.html.haml index 8a9cc7ab8a2..104c722ee65 100644 --- a/app/views/shared/_old_visibility_level.html.haml +++ b/app/views/shared/_old_visibility_level.html.haml @@ -1,6 +1,6 @@ .form-group.row .col-sm-2.col-form-label = _('Visibility level') - = link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), target: '_blank', rel: 'noopener noreferrer' .col-sm-10 = render 'shared/visibility_level', f: f, visibility_level: visibility_level, can_change_visibility_level: can_change_visibility_level, form_model: form_model, with_label: with_label diff --git a/app/views/shared/_registration_features_discovery_message.html.haml b/app/views/shared/_registration_features_discovery_message.html.haml index 8bcd826d8c0..8a16d36b836 100644 --- a/app/views/shared/_registration_features_discovery_message.html.haml +++ b/app/views/shared/_registration_features_discovery_message.html.haml @@ -1,9 +1,9 @@ -- license = local_assigns.fetch(:license) +- feature_title = local_assigns.fetch(:feature_title, s_('RegistrationFeatures|use this feature')) - registration_features_docs_path = help_page_path('development/service_ping/index.md', anchor: 'registration-features-program') - service_ping_settings_path = metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings') %div - %span= s_('RegistrationFeatures|Want to use this feature for free?') - - if license.present? + %span= sprintf(s_('RegistrationFeatures|Want to %{feature_title} for free?'), { feature_title: feature_title }) + - if Gitlab.ee? = link_to s_('RegistrationFeatures|Enable Service Ping and register for this feature.'), service_ping_settings_path - = sprintf(s_('RegistrationFeatures|Read more about the %{linkStart}Registration Features Program%{linkEnd}.') , { linkStart: "<a href=\"#{registration_features_docs_path}\" target=\"_blank\">", linkEnd: "</a>", }).html_safe + = sprintf(s_('RegistrationFeatures|Read more about the %{linkStart}%{label}%{linkEnd}.') , { linkStart: "<a href=\"#{registration_features_docs_path}\" target=\"_blank\">", label: s_('RegistrationFeatures|Registration Features Program'), linkEnd: "</a>" }).html_safe diff --git a/app/views/shared/_web_ide_button.html.haml b/app/views/shared/_web_ide_button.html.haml index f9c6afcbc32..82af52cdd59 100644 --- a/app/views/shared/_web_ide_button.html.haml +++ b/app/views/shared/_web_ide_button.html.haml @@ -6,5 +6,3 @@ = render 'shared/confirm_fork_modal', fork_path: fork_and_edit_path(@project, @ref, @path), type: 'edit' - if show_web_ide_button? = render 'shared/confirm_fork_modal', fork_path: ide_fork_and_edit_path(@project, @ref, @path), type: 'webide' -- if show_gitpod_button? - = render 'shared/gitpod/enable_gitpod_modal' diff --git a/app/views/shared/access_tokens/_form.html.haml b/app/views/shared/access_tokens/_form.html.haml index 6435475a9a3..a52b7236137 100644 --- a/app/views/shared/access_tokens/_form.html.haml +++ b/app/views/shared/access_tokens/_form.html.haml @@ -1,7 +1,7 @@ - title = local_assigns.fetch(:title, _('Add a %{type}') % { type: type }) - prefix = local_assigns.fetch(:prefix, :personal_access_token) - help_path = local_assigns.fetch(:help_path) -- project = local_assigns.fetch(:project, false) +- resource = local_assigns.fetch(:resource, false) - access_levels = local_assigns.fetch(:access_levels, false) - default_access_level = local_assigns.fetch(:default_access_level, false) @@ -32,12 +32,12 @@ .js-access-tokens-expires-at = f.text_field :expires_at, class: 'datepicker gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', data: { js_name: 'expiresAt' } - - if project + - if resource .row .form-group.col-md-6 = label_tag :access_level, _("Select a role"), class: "label-bold" .select-wrapper - = select_tag :"#{prefix}[access_level]", options_for_select(access_levels, default_access_level), class: "form-control project-access-select select-control", data: { qa_selector: 'access_token_access_level' } + = select_tag :"#{prefix}[access_level]", options_for_select(access_levels, default_access_level), class: "form-control select-control", data: { qa_selector: 'access_token_access_level' } = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") .form-group @@ -45,7 +45,7 @@ = s_('Tokens|Select scopes') %p.text-secondary#select_scope_help_text = s_('Tokens|Scopes set the permission levels granted to the token.') - = link_to "Learn more.", help_path, target: '_blank' + = link_to _("Learn more."), help_path, target: '_blank', rel: 'noopener noreferrer' = render 'shared/tokens/scopes_form', prefix: prefix, token: token, scopes: scopes - if prefix == :personal_access_token && Feature.enabled?(:personal_access_tokens_scoped_to_projects, current_user) diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml index c096044e439..aa579b4a672 100644 --- a/app/views/shared/access_tokens/_table.html.haml +++ b/app/views/shared/access_tokens/_table.html.haml @@ -1,7 +1,7 @@ - no_active_tokens_message = local_assigns.fetch(:no_active_tokens_message, _('This user has no active %{type}.') % { type: type_plural }) - impersonation = local_assigns.fetch(:impersonation, false) -- project = local_assigns.fetch(:project, false) -- personal = !impersonation && !project +- resource = local_assigns.fetch(:resource, false) +- personal = !impersonation && !resource %hr @@ -28,9 +28,9 @@ %th= s_('AccessTokens|Created') %th = _('Last Used') - = link_to sprite_icon('question-o'), help_page_path('user/profile/personal_access_tokens.md', anchor: 'view-the-last-time-a-token-was-used'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/profile/personal_access_tokens.md', anchor: 'view-the-last-time-a-token-was-used'), target: '_blank', rel: 'noopener noreferrer' %th= _('Expires') - - if project + - if resource %th= _('Role') %th %tbody @@ -54,8 +54,8 @@ = time_ago_with_tooltip(token.expires_at) - else %span.token-never-expires-label= _('Never') - - if project - %td= project.project_member(token.user).human_access + - if resource + %td= resource.member(token.user).human_access %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: "gl-button btn btn-danger btn-sm float-right qa-revoke-button #{'btn-danger-secondary' unless token.expires?}", data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } - else .settings-message.text-center diff --git a/app/views/shared/empty_states/_deploy_keys.html.haml b/app/views/shared/empty_states/_deploy_keys.html.haml deleted file mode 100644 index 6c615de9c56..00000000000 --- a/app/views/shared/empty_states/_deploy_keys.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.empty-state.gl-display-flex.gl-flex-direction-column.gl-flex-wrap.gl-text-center - .gl-flex-grow-0.gl-flex-shrink-0 - .svg-250.svg-content - = image_tag 'illustrations/empty-state/empty-deploy-keys-lg.svg' - .gl-flex-grow-0.gl-flex-shrink-0 - .text-content.gl-mx-auto.gl-my-0.gl-p-5 - %h4.h4= _('Deploy Keys') - %p= _('Deploy keys grant read/write access to all repositories in your instance') - = link_to _('New deploy key'), new_admin_deploy_key_path, class: 'gl-button btn btn-confirm btn-md' diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 9842457a2eb..6b571794625 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -42,7 +42,7 @@ - if has_button .text-center - if project_select_button - = render 'shared/new_project_item_select', path: 'issues/new', label: _('New issue'), type: :issues, with_feature_enabled: 'issues' + = render 'shared/new_project_item_select', path: 'issues/new', label: _('issue'), type: :issues, with_feature_enabled: 'issues' - elsif show_new_issue_link?(@project) = link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link' diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index 72db4d4c846..d0c4fb2432c 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -40,6 +40,6 @@ - if has_button .text-center - if project_select_button - = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _('New merge request'), type: :merge_requests, with_feature_enabled: 'merge_requests' + = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _('merge request'), type: :merge_requests, with_feature_enabled: 'merge_requests' - else = link_to _('New merge request'), button_path, class: 'gl-button btn btn-confirm', title: _('New merge request'), id: 'new_merge_request_link' diff --git a/app/views/shared/empty_states/_wikis.html.haml b/app/views/shared/empty_states/_wikis.html.haml index 917ef666e85..c3120774826 100644 --- a/app/views/shared/empty_states/_wikis.html.haml +++ b/app/views/shared/empty_states/_wikis.html.haml @@ -13,7 +13,7 @@ = create_link - if show_enable_confluence_integration?(@wiki.container) = link_to s_('WikiEmpty|Enable the Confluence Wiki integration'), - edit_project_service_path(@project, :confluence), + edit_project_integration_path(@project, :confluence), class: 'btn gl-button', title: s_('WikiEmpty|Enable the Confluence Wiki integration') - elsif @project && can?(current_user, :read_issue, @project) diff --git a/app/views/shared/gitpod/_enable_gitpod_modal.html.haml b/app/views/shared/gitpod/_enable_gitpod_modal.html.haml deleted file mode 100644 index 6a8ff98a09e..00000000000 --- a/app/views/shared/gitpod/_enable_gitpod_modal.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -#modal-enable-gitpod.modal.qa-enable-gitpod-modal - .modal-dialog - .modal-content - .modal-header - %h3.page-title= _('Enable Gitpod?') - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": "true" } × - .modal-body.p-3 - %p= (_("To use Gitpod you must first enable the feature in the integrations section of your %{user_prefs}.") % { user_prefs: link_to(_('user preferences'), profile_preferences_path(anchor: 'gitpod')) }).html_safe - .modal-footer - = link_to _('Cancel'), '#', class: "gl-button btn btn-default btn-cancel", "data-dismiss" => "modal" - = link_to _('Enable Gitpod'), profile_path(user: { gitpod_enabled: true}), class: 'gl-button btn btn-confirm', method: :put diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index ab6875a09f7..d358340814c 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -2,8 +2,7 @@ %h4 POST = hook_log.url - %span.badge.gl-badge.badge-pill.badge-muted.sm.gl-ml-3 - = hook_log.trigger.singularize.titleize + = gl_badge_tag hook_log.trigger.singularize.titleize, { size: :sm }, { class: 'gl-ml-3' } %p = _('Completed in %{duration_seconds} seconds (%{relative_time})').html_safe % { duration_seconds: number_with_precision(hook_log.execution_duration, precision: 2), relative_time: time_ago_with_tooltip(hook_log.created_at) } diff --git a/app/views/shared/hook_logs/_recent_deliveries_table.html.haml b/app/views/shared/hook_logs/_recent_deliveries_table.html.haml index 31ef8560781..3c91c2f6ab4 100644 --- a/app/views/shared/hook_logs/_recent_deliveries_table.html.haml +++ b/app/views/shared/hook_logs/_recent_deliveries_table.html.haml @@ -13,8 +13,7 @@ %td = render partial: 'shared/hook_logs/status_label', locals: { hook_log: hook_log } %td.d-none.d-sm-table-cell - %span.badge.badge-pill.gl-badge.badge-muted.sm - = hook_log.trigger.singularize.titleize + = gl_badge_tag hook_log.trigger.singularize.titleize, { size: :sm } %td #{number_with_precision(hook_log.execution_duration, precision: 2)} sec %td diff --git a/app/views/shared/hook_logs/_status_label.html.haml b/app/views/shared/hook_logs/_status_label.html.haml index b930074303c..6f82dc280f3 100644 --- a/app/views/shared/hook_logs/_status_label.html.haml +++ b/app/views/shared/hook_logs/_status_label.html.haml @@ -1,3 +1,4 @@ -- label_status = hook_log.success? ? 'badge-success' : 'badge-danger' -%span{ class: "badge badge-pill gl-badge sm #{label_status}" } - = hook_log.internal_error? ? _('Error') : hook_log.response_status +- badge_variant = hook_log.success? ? :success : :danger +- badge_text = hook_log.internal_error? ? _('Error') : hook_log.response_status + += gl_badge_tag badge_text, { variant: badge_variant, size: :sm } diff --git a/app/views/shared/integrations/_form.html.haml b/app/views/shared/integrations/_form.html.haml index 89c127408e1..e2457bc0632 100644 --- a/app/views/shared/integrations/_form.html.haml +++ b/app/views/shared/integrations/_form.html.haml @@ -1,4 +1,4 @@ - integration = local_assigns.fetch(:integration) -= form_for integration, as: :service, url: scoped_integration_path(integration, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration, group: @group) } } do |form| - = render 'shared/service_settings', form: form, integration: integration += form_for integration, as: :service, url: scoped_integration_path(integration, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration, group: @group), testid: 'integration-form' } } do |form| + = render 'shared/integration_settings', form: form, integration: integration diff --git a/app/views/shared/integrations/edit.html.haml b/app/views/shared/integrations/edit.html.haml index acb0c7ee52e..4ceaedc2a69 100644 --- a/app/views/shared/integrations/edit.html.haml +++ b/app/views/shared/integrations/edit.html.haml @@ -7,4 +7,7 @@ = @integration.title = render 'shared/integrations/tabs', integration: @integration, active_tab: 'edit' do - = render 'shared/integrations/form', integration: @integration + - if vue_integration_form_enabled? + = render 'shared/integration_settings', integration: @integration + - else + = render 'shared/integrations/form', integration: @integration diff --git a/app/views/shared/integrations/overrides.html.haml b/app/views/shared/integrations/overrides.html.haml index b8585fdef1f..4619675cfef 100644 --- a/app/views/shared/integrations/overrides.html.haml +++ b/app/views/shared/integrations/overrides.html.haml @@ -6,5 +6,4 @@ %h3.page-title = @integration.title -= render 'shared/integrations/tabs', integration: @integration, active_tab: 'overrides' do - .js-vue-integration-overrides{ data: integration_overrides_data(@integration) } +.js-vue-integration-overrides{ data: integration_overrides_data(@integration, project: @project, group: @group) } diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 4024c5b77f6..16301789b65 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -64,9 +64,9 @@ for this project. - if issuable.new_record? - = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button' } + = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button', track_experiment: 'promote_mr_approvals_in_free', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else - = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2' + = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2', data: { track_experiment: 'promote_mr_approvals_in_free', 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' diff --git a/app/views/shared/issuable/_label_page_create.html.haml b/app/views/shared/issuable/_label_page_create.html.haml index cf7e6cf8365..84cdf129cb2 100644 --- a/app/views/shared/issuable/_label_page_create.html.haml +++ b/app/views/shared/issuable/_label_page_create.html.haml @@ -6,7 +6,10 @@ .dropdown-page-two.dropdown-new-label = dropdown_title(create_label_title(subject), options: { back: true, close: show_close }) = dropdown_content do - .dropdown-labels-error.js-label-error + .js-label-error.gl-alert.gl-alert-danger.gl-mb-3 + .gl-alert-container + = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + .gl-alert-content %input#new_label_name.default-dropdown-input{ type: "text", placeholder: _('Name new label') } .suggest-colors.suggest-colors-dropdown = render_suggested_colors diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index e097852216c..3975748ba57 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -5,6 +5,11 @@ - placeholder = local_assigns[:placeholder] || _('Search or filter results...') - block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : '' - is_epic_board = board&.to_type == "EpicBoard" +- if @group.present? + - ff_resource = @group +- else + - ff_resource = board&.resource_parent&.group + - if is_epic_board - user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent) - elsif board @@ -26,7 +31,7 @@ = check_box_tag checkbox_id, nil, false, class: "check-all-issues left" - if is_epic_board #js-board-filtered-search{ data: { full_path: @group&.full_path } } - - elsif Feature.enabled?(:issue_boards_filtered_search, board&.resource_parent) && board + - elsif Feature.enabled?(:issue_boards_filtered_search, ff_resource) && board #js-issue-board-filtered-search - else .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index 7233e671caa..76feb4d1613 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -25,7 +25,7 @@ = check_box_tag 'merge_request[squash]', '1', issuable_squash_option?(issuable, project), class: 'form-check-input' = label_tag 'merge_request[squash]', class: 'form-check-label' do Squash commits when merge request is accepted. - = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' - if project.squash_always? .gl-text-gray-400 = _('Required in this project.') diff --git a/app/views/shared/labels/_form.html.haml b/app/views/shared/labels/_form.html.haml index 6f65dbe4811..29f6dc02749 100644 --- a/app/views/shared/labels/_form.html.haml +++ b/app/views/shared/labels/_form.html.haml @@ -5,30 +5,35 @@ .col-sm-2.col-form-label = f.label :title .col-sm-10 - = f.text_field :title, class: "form-control js-label-title qa-label-title", required: true, autofocus: true + = f.text_field :title, class: "gl-form-input form-control js-label-title qa-label-title", required: true, autofocus: true = render_if_exists 'shared/labels/create_label_help_text' .form-group.row .col-sm-2.col-form-label = f.label :description .col-sm-10 - = f.text_field :description, class: "form-control js-quick-submit qa-label-description" + = f.text_field :description, class: "gl-form-input form-control js-quick-submit qa-label-description" .form-group.row .col-sm-2.col-form-label - = f.label :color, "Background color" + = f.label :color, _("Background color") .col-sm-10 .input-group .input-group-prepend .input-group-text.label-color-preview - = f.text_field :color, class: "form-control qa-label-color" + = f.text_field :color, class: "gl-form-input form-control qa-label-color" .form-text.text-muted - Choose any color. + = _('Choose any color.') %br - Or you can choose one of the suggested colors below + = _("Or you can choose one of the suggested colors below") = render_suggested_colors - .form-actions + .gl-display-flex.gl-justify-content-space-between.gl-p-5.gl-bg-gray-10.gl-border-t-solid.gl-border-t-gray-100.gl-border-t-1 + %div + - if @label.persisted? + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm js-save-button' + - else + = f.submit _('Create label'), class: 'btn gl-button btn-confirm js-save-button qa-label-create-button' + = link_to _('Cancel'), back_path, class: 'btn gl-button btn-default btn-cancel' - if @label.persisted? - = f.submit _('Save changes'), class: 'btn gl-button btn-confirm js-save-button' - - else - = f.submit 'Create label', class: 'btn gl-button btn-confirm js-save-button qa-label-create-button' - = link_to _('Cancel'), back_path, class: 'btn gl-button btn-default btn-cancel' + - presented_label = @label.present + %button.btn.btn-danger.gl-button.btn-danger-secondary.js-delete-label-modal-button{ type: 'button', data: { label_name: presented_label.name, subject_name: presented_label.subject_name, destroy_path: presented_label.destroy_path } } + %span.gl-button-text= _('Delete') diff --git a/app/views/shared/members/_badge.html.haml b/app/views/shared/members/_badge.html.haml index 5f925ff0cad..e7bd055fe5d 100644 --- a/app/views/shared/members/_badge.html.haml +++ b/app/views/shared/members/_badge.html.haml @@ -1,4 +1,4 @@ -- type ||= 'info' +- variant ||= :info %span.px-1.py-1 - %span{ class: "badge badge-pill gl-badge sm badge-#{type}" }= yield + = gl_badge_tag yield, variant: variant, size: :sm diff --git a/app/views/shared/members/_blocked_badge.html.haml b/app/views/shared/members/_blocked_badge.html.haml index 95335ebe74d..6795128279f 100644 --- a/app/views/shared/members/_blocked_badge.html.haml +++ b/app/views/shared/members/_blocked_badge.html.haml @@ -1,3 +1,3 @@ - if user.blocked? - = render 'shared/members/badge', type: 'danger' do + = render 'shared/members/badge', variant: :danger do = _("Blocked") diff --git a/app/views/shared/members/_its_you_badge.html.haml b/app/views/shared/members/_its_you_badge.html.haml index b53ffd8032d..4442e57f86e 100644 --- a/app/views/shared/members/_its_you_badge.html.haml +++ b/app/views/shared/members/_its_you_badge.html.haml @@ -1,3 +1,3 @@ - if user == current_user - = render 'shared/members/badge', type: 'success' do + = render 'shared/members/badge', variant: :success do = _("It's you") diff --git a/app/views/shared/members/_two_factor_auth_badge.html.haml b/app/views/shared/members/_two_factor_auth_badge.html.haml index 34850c135d6..f1cb7a5bd85 100644 --- a/app/views/shared/members/_two_factor_auth_badge.html.haml +++ b/app/views/shared/members/_two_factor_auth_badge.html.haml @@ -1,3 +1,3 @@ - if user.two_factor_enabled? - = render 'shared/members/badge', type: 'info' do + = render 'shared/members/badge', variant: :info do = _("2FA") diff --git a/app/views/shared/nav/_sidebar_menu.html.haml b/app/views/shared/nav/_sidebar_menu.html.haml index 4c4ceb9ea70..bc0648c14e0 100644 --- a/app/views/shared/nav/_sidebar_menu.html.haml +++ b/app/views/shared/nav/_sidebar_menu.html.haml @@ -13,7 +13,7 @@ %span.nav-item-name{ **sidebar_menu.title_html_options } = sidebar_menu.title - if sidebar_menu.has_pill? - %span.badge.badge-pill.count{ **sidebar_menu.pill_html_options } + = gl_badge_tag({ variant: :info, size: :sm }, { class: "count #{sidebar_menu.pill_html_options[:class]}" }) do = number_with_delimiter(sidebar_menu.pill_count) = render partial: 'shared/nav/sidebar_submenu', locals: { sidebar_menu: sidebar_menu } diff --git a/app/views/shared/notes/_hints.html.haml b/app/views/shared/notes/_hints.html.haml index 6231f817704..6c8b2a9e5bb 100644 --- a/app/views/shared/notes/_hints.html.haml +++ b/app/views/shared/notes/_hints.html.haml @@ -2,10 +2,10 @@ - supports_file_upload = local_assigns.fetch(:supports_file_upload, true) .comment-toolbar.clearfix .toolbar-text - = link_to _('Markdown'), help_page_path('user/markdown'), target: '_blank' + = link_to _('Markdown'), help_page_path('user/markdown'), target: '_blank', rel: 'noopener noreferrer' - if supports_quick_actions and - = link_to _('quick actions'), help_page_path('user/project/quick_actions'), target: '_blank' + = link_to _('quick actions'), help_page_path('user/project/quick_actions'), target: '_blank', rel: 'noopener noreferrer' are - else is diff --git a/app/views/shared/runners/_shared_runners_description.html.haml b/app/views/shared/runners/_shared_runners_description.html.haml index e2b57a7fd73..2779901ca0c 100644 --- a/app/views/shared/runners/_shared_runners_description.html.haml +++ b/app/views/shared/runners/_shared_runners_description.html.haml @@ -1,5 +1,5 @@ -# "MaxBuilds" is a runner configuration keyword so it must not be translated. -- link = link_to 'MaxBuilds', 'https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section', target: '_blank' +- link = link_to 'MaxBuilds', 'https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section', target: '_blank', rel: 'noopener noreferrer' %h4 = _('Shared runners') diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index 18912bf149f..5650f08b2a9 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -4,12 +4,14 @@ = form.label :url, s_('Webhooks|URL'), class: 'label-bold' = form.text_field :url, class: 'form-control gl-form-input', placeholder: 'http://example.com/trigger-ci.json' %p.form-text.text-muted - = s_('Webhooks|URL must be percent-encoded if neccessary.') + = s_('Webhooks|URL must be percent-encoded if it contains one or more special characters.') .form-group = form.label :token, s_('Webhooks|Secret token'), class: 'label-bold' = form.text_field :token, class: 'form-control gl-form-input', placeholder: '' %p.form-text.text-muted - = s_('Webhooks|Use this token to validate received payloads. It is sent with the request in the X-Gitlab-Token HTTP header.') + - code_start = '<code>'.html_safe + - code_end = '</code>'.html_safe + = s_('Webhooks|Used to validate received payloads. Sent with the request in the %{code_start}X-Gitlab-Token HTTP%{code_end} header.').html_safe % { code_start: code_start, code_end: code_end } .form-group = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' %ul.list-unstyled.gl-ml-6 @@ -19,37 +21,37 @@ %strong= s_('Webhooks|Push events') = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered by a push to the repository') + = s_('Webhooks|Push to the repository.') %li = form.check_box :tag_push_events, class: 'form-check-input' = form.label :tag_push_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Tag push events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a new tag is pushed to the repository') + = s_('Webhooks|A new tag is pushed to the repository.') %li = form.check_box :note_events, class: 'form-check-input' = form.label :note_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Comments') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when someone adds a comment') + = s_('Webhooks|A comment is added to an issue.') %li = form.check_box :confidential_note_events, class: 'form-check-input' = form.label :confidential_note_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Confidential comments') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when someone adds a comment on a confidential issue') + = s_('Webhooks|A comment is added to a confidential issue.') %li = form.check_box :issues_events, class: 'form-check-input' = form.label :issues_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Issues events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when an issue is created, updated, closed, or reopened') + = s_('Webhooks|An issue is created, updated, closed, or reopened.') %li = form.check_box :confidential_issues_events, class: 'form-check-input' = form.label :confidential_issues_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Confidential issues events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a confidential issue is created, updated, closed, or reopened') + = s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') - if @group = render_if_exists 'groups/hooks/member_events', form: form = render_if_exists 'groups/hooks/subgroup_events', form: form @@ -58,43 +60,43 @@ = form.label :merge_requests_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Merge request events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a merge request is created, updated, or merged') + = s_('Webhooks|A merge request is created, updated, or merged.') %li = form.check_box :job_events, class: 'form-check-input' = form.label :job_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Job events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when the job status changes') + = s_("Webhooks|A job's status changes.") %li = form.check_box :pipeline_events, class: 'form-check-input' = form.label :pipeline_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Pipeline events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when the pipeline status changes') + = s_("Webhooks|A pipeline's status changes.") %li = form.check_box :wiki_page_events, class: 'form-check-input' = form.label :wiki_page_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Wiki page events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a wiki page is created or updated') + = s_('Webhooks|A wiki page is created or updated.') %li = form.check_box :deployment_events, class: 'form-check-input' = form.label :deployment_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Deployment events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a deployment starts, finishes, fails, or is canceled') + = s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') %li = form.check_box :feature_flag_events, class: 'form-check-input' = form.label :feature_flag_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Feature flag events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a feature flag is turned on or off') + = s_('Webhooks|A feature flag is turned on or off.') %li = form.check_box :releases_events, class: 'form-check-input' = form.label :releases_events, class: 'list-label form-check-label gl-ml-1' do %strong= s_('Webhooks|Releases events') %p.text-muted.gl-ml-1 - = s_('Webhooks|URL is triggered when a release is created or updated') + = s_('Webhooks|A release is created or updated.') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' .form-check diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml index 45baa7e2184..c5a03ef4dc1 100644 --- a/app/views/shared/web_hooks/_hook.html.haml +++ b/app/views/shared/web_hooks/_hook.html.haml @@ -1,22 +1,23 @@ +- sslStatus = hook.enable_ssl_verification ? _('enabled') : _('disabled') +- sslBadgeText = _('SSL Verification:') + ' ' + sslStatus + %li .row .col-md-8.col-lg-7 %strong.light-header = hook.url - if hook.rate_limited? - %span.gl-badge.badge-danger.badge-pill.sm= _('Disabled') + = gl_badge_tag(_('Disabled'), variant: :danger, size: :sm) - elsif hook.permanently_disabled? - %span.gl-badge.badge-danger.badge-pill.sm= s_('Webhooks|Failed to connect') + = gl_badge_tag(s_('Webhooks|Failed to connect'), variant: :danger, size: :sm) - elsif hook.temporarily_disabled? - %span.gl-badge.badge-warning.badge-pill.sm= s_('Webhooks|Fails to connect') + = gl_badge_tag(s_('Webhooks|Fails to connect'), variant: :warning, size: :sm) %div - hook.class.triggers.each_value do |trigger| - if hook.public_send(trigger) - %span.gl-badge.badge-muted.badge-pill.sm.gl-mt-2.deploy-project-label= trigger.to_s.titleize - %span.gl-badge.badge-muted.badge-pill.sm.gl-mt-2 - = _('SSL Verification:') - = hook.enable_ssl_verification ? _('enabled') : _('disabled') + = gl_badge_tag(trigger.to_s.titleize, size: :sm) + = gl_badge_tag(sslBadgeText, size: :sm) .col-md-4.col-lg-5.text-right-md.gl-mt-2 %span>= render 'shared/web_hooks/test_button', hook: hook, button_class: 'btn-sm btn-default gl-mr-3' diff --git a/app/views/shared/web_hooks/_index.html.haml b/app/views/shared/web_hooks/_index.html.haml index f1eef5d7f0f..5d07b0f95ab 100644 --- a/app/views/shared/web_hooks/_index.html.haml +++ b/app/views/shared/web_hooks/_index.html.haml @@ -11,4 +11,4 @@ = render 'shared/web_hooks/hook', hook: hook - else %p.text-center.gl-mt-3.gl-mb-3 - = _('No webhooks found, add one in the form above.') + = _('No webhooks enabled. Select trigger events above.') |