diff options
Diffstat (limited to 'app/views/shared')
78 files changed, 501 insertions, 407 deletions
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index fd52f7f40d2..80b50f7a3de 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,14 +1,14 @@ -.git-clone-holder.js-git-clone-holder.input-group +.js-git-clone-holder.input-group.btn-group .input-group-prepend - if allowed_protocols_present? .input-group-text.clone-dropdown-btn.btn %span.js-clone-dropdown-label = enabled_protocol_button(container, enabled_protocol) - else - %a#clone-dropdown.input-group-text.btn.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } + %a#clone-dropdown.input-group-text.gl-button.btn.btn-default.btn-icon.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } %span.js-clone-dropdown-label = default_clone_protocol.upcase - = sprite_icon('chevron-down') + = sprite_icon('chevron-down', css_class: 'gl-icon') %ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown %li = ssh_clone_button(container) @@ -16,7 +16,7 @@ = http_clone_button(container) = render_if_exists 'shared/kerberos_clone_button', container: container - = text_field_tag :clone_url, default_url_to_repo(container), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') } + = text_field_tag :clone_url, default_url_to_repo(container), class: "js-select-on-focus btn gl-button", readonly: true, aria: { label: _('Repository clone URL') } .input-group-append - = clipboard_button(target: '#clone_url', title: _("Copy URL"), class: "input-group-text btn-default btn-clipboard") + = clipboard_button(target: '#clone_url', title: _("Copy URL"), class: "input-group-text gl-button btn-default btn-clipboard") diff --git a/app/views/shared/_confirm_fork_modal.html.haml b/app/views/shared/_confirm_fork_modal.html.haml index b692dffce37..265396d3d8b 100644 --- a/app/views/shared/_confirm_fork_modal.html.haml +++ b/app/views/shared/_confirm_fork_modal.html.haml @@ -8,5 +8,5 @@ .modal-body.p-3 %p= _("You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.") % { tag_start: '', tag_end: ''} .modal-footer - = link_to _('Cancel'), '#', class: "gl-button btn btn-default btn-cancel", "data-dismiss" => "modal" - = link_to _('Fork project'), fork_path, class: 'gl-button btn btn-confirm', data: { qa_selector: 'fork_project_button' }, method: :post + = link_to _('Cancel'), '#', class: "btn gl-button btn-default", "data-dismiss" => "modal" + = link_to _('Fork project'), fork_path, class: 'btn gl-button btn-confirm', data: { qa_selector: 'fork_project_button' }, method: :post diff --git a/app/views/shared/_confirm_modal.html.haml b/app/views/shared/_confirm_modal.html.haml index ecb462205b0..4e7e5c9d3ba 100644 --- a/app/views/shared/_confirm_modal.html.haml +++ b/app/views/shared/_confirm_modal.html.haml @@ -18,4 +18,4 @@ .form-group = text_field_tag 'confirm_name_input', '', class: 'form-control js-confirm-danger-input qa-confirm-input' .form-actions - = submit_tag _('Confirm'), class: "btn btn-danger js-confirm-danger-submit qa-confirm-button" + = submit_tag _('Confirm'), class: "gl-button btn btn-danger js-confirm-danger-submit qa-confirm-button" diff --git a/app/views/shared/_delete_label_modal.html.haml b/app/views/shared/_delete_label_modal.html.haml deleted file mode 100644 index 8d761e3b9c4..00000000000 --- a/app/views/shared/_delete_label_modal.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -.modal{ id: "modal-delete-label-#{label.id}", tabindex: -1 } - .modal-dialog - .modal-content - .modal-header - %h3.page-title= _('Delete label: %{label_name} ?') % { label_name: label.name } - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": true } × - - .modal-body - %p - = html_escape(_('%{label_name} %{span_open}will be permanently deleted from %{subject_name}. This cannot be undone.%{span_close}')) % { label_name: tag.strong(label.name), subject_name: label.subject_name, span_open: '<span>'.html_safe, span_close: '</span>'.html_safe } - - .modal-footer - %a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' }= _('Cancel') - - = link_to _('Delete label'), - label.destroy_path, - title: _('Delete'), - method: :delete, - class: 'gl-button btn btn-danger' diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index b1f53e4d0f6..f8ac3832a77 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -2,13 +2,11 @@ - offset = defined?(first_line_number) ? first_line_number : 1 .line-numbers - if blob.data.present? - - link_icon = sprite_icon('link', size: 12) - link = blob_link if defined?(blob_link) - blob.data.each_line.each_with_index do |_, index| - i = index + offset -# We're not using `link_to` because it is too slow once we get to thousands of lines. - %a.diff-line-num{ href: "#{link}#L#{i}", id: "L#{i}", 'data-line-number' => i } - = link_icon + %a.file-line-num.diff-line-num{ href: "#{link}#L#{i}", id: "L#{i}", 'data-line-number' => i } = i - highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil .blob-content{ data: { blob_id: blob.id, path: blob.path, highlight_line: highlight, qa_selector: 'file_content' } } diff --git a/app/views/shared/_file_picker_button.html.haml b/app/views/shared/_file_picker_button.html.haml index 9e6a7626d89..1d688e7f4b0 100644 --- a/app/views/shared/_file_picker_button.html.haml +++ b/app/views/shared/_file_picker_button.html.haml @@ -1,8 +1,8 @@ - classes = local_assigns.fetch(:classes, '') %span.js-filepicker - %button.gl-button.btn.js-filepicker-button{ type: 'button', class: classes }= _("Choose fileā¦") - %span.file_name.js-filepicker-filename= _("No file chosen") + %button.gl-button.btn.btn-default.js-filepicker-button{ type: 'button', class: classes }= _("Choose fileā¦") + %span.file_name.js-filepicker-filename= _("No file chosen.") = f.file_field field, class: "js-filepicker-input hidden" - if help_text.present? .form-text.text-muted= help_text diff --git a/app/views/shared/_flash_user_callout.html.haml b/app/views/shared/_flash_user_callout.html.haml index fe175195e66..d8032ac521d 100644 --- a/app/views/shared/_flash_user_callout.html.haml +++ b/app/views/shared/_flash_user_callout.html.haml @@ -6,6 +6,6 @@ %div{ class: "flash-#{flash_type}" } %div{ class: "#{(container_class unless fluid_layout)} #{(extra_flash_class unless @no_container)} #{@content_class}" } %span= message - %button.btn.btn-default.close.js-close{ type: 'button', + %button.btn.gl-button.btn-default.close.js-close{ type: 'button', 'aria-label' => _('Dismiss') } = sprite_icon('close', css_class: 'dismiss-icon') diff --git a/app/views/shared/_issuable_meta_data.html.haml b/app/views/shared/_issuable_meta_data.html.haml index 4b006bddbf6..6c3e15cbace 100644 --- a/app/views/shared/_issuable_meta_data.html.haml +++ b/app/views/shared/_issuable_meta_data.html.haml @@ -1,6 +1,7 @@ - note_count = @issuable_meta_data[issuable.id].user_notes_count - issue_votes = @issuable_meta_data[issuable.id] -- upvotes, downvotes = issue_votes.upvotes, issue_votes.downvotes +- upvotes = issue_votes.upvotes +- downvotes = issue_votes.downvotes - issuable_path = issuable_path(issuable, anchor: 'notes') - issuable_mr = @issuable_meta_data[issuable.id].merge_requests_count diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index 57575f89803..eb12e9d463c 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -3,4 +3,5 @@ = render partial: 'projects/issues/issue', collection: @issues = paginate @issues, theme: "gitlab" - else - = render 'shared/empty_states/issues' + - project_select_button = local_assigns.fetch(:project_select_button, false) + = render 'shared/empty_states/issues', project_select_button: project_select_button diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 95d7f075964..e4ef0a52eba 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -12,34 +12,34 @@ - if can?(current_user, :admin_label, @project) %li.inline.js-toggle-priority{ data: { url: remove_priority_project_label_path(@project, label), dom_id: dom_id(label), type: label.type } } - %button.label-action.add-priority.btn.btn-transparent.has-tooltip{ title: _('Prioritize'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Prioritize label') } + %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') } = sprite_icon('star-o') - %button.label-action.remove-priority.btn.btn-transparent.has-tooltip{ 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.gl-ml-3{ title: _('Remove priority'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Deprioritize label') } = sprite_icon('star') - if can?(current_user, :admin_label, label) %li.inline - = link_to label.edit_path, class: 'btn btn-transparent label-action edit has-tooltip', title: _('Edit'), data: { placement: 'bottom' }, aria_label: _('Edit') do + = 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 .dropdown - %button{ type: 'button', class: 'btn btn-transparent js-label-options-dropdown label-action', data: { toggle: 'dropdown' }, aria_label: _('Label actions 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') .dropdown-menu.dropdown-open-left %ul - if label.project_label? && label.project.group && can?(current_user, :admin_label, label.project.group) %li - %button.js-promote-project-label-button.btn.btn-transparent{ disabled: true, type: 'button', + %button.js-promote-project-label-button.gl-button.btn.btn-default-tertiary{ disabled: true, type: 'button', data: { url: promote_project_label_path(label.project, label), label_title: label.title, label_color: label.color, label_text_color: label.text_color, group_name: label.project.group.name } } = _('Promote to group label') - - if can?(current_user, :admin_label, label) - %li - %span{ data: { toggle: 'modal', target: "#modal-delete-label-#{label.id}" } } - %button.text-danger.remove-row{ type: 'button' }= _('Delete') + %li + %span + %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 - if label.can_subscribe_to_label_in_different_levels? @@ -53,13 +53,11 @@ .dropdown-menu.dropdown-open-left %ul %li - %button.js-subscribe-button.label-subscribe-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } + %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') %li - %button.js-subscribe-button.js-group-level.label-subscribe-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } + %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') - 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) - -= render 'shared/delete_label_modal', label: label diff --git a/app/views/shared/_milestone_expired.html.haml b/app/views/shared/_milestone_expired.html.haml index 171ae9d2c07..925344ab2f7 100644 --- a/app/views/shared/_milestone_expired.html.haml +++ b/app/views/shared/_milestone_expired.html.haml @@ -1,4 +1,4 @@ -- if milestone.expired? and not milestone.closed? +- if milestone.expired? && !milestone.closed? .gl-badge.badge-warning.badge-pill.gl-mb-2= _('Expired') - if milestone.upcoming? .gl-badge.badge-primary.badge-pill.gl-mb-2= _('Upcoming') diff --git a/app/views/shared/_mini_pipeline_graph.html.haml b/app/views/shared/_mini_pipeline_graph.html.haml deleted file mode 100644 index 172f3d85472..00000000000 --- a/app/views/shared/_mini_pipeline_graph.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -.stage-cell - - pipeline.legacy_stages.each do |stage| - - if stage.status - - detailed_status = stage.detailed_status(current_user) - - icon_status = "#{detailed_status.icon}_borderless" - - .stage-container.mt-0.ml-1.dropdown{ class: klass } - %button.mini-pipeline-graph-dropdown-toggle.has-tooltip.js-builds-dropdown-button{ class: "ci-status-icon-#{detailed_status.group}", type: 'button', data: { toggle: 'dropdown', title: "#{stage.name}: #{detailed_status.label}", placement: 'top', "stage-endpoint" => stage_ajax_project_pipeline_path(pipeline.project, pipeline, stage: stage.name) } } - = sprite_icon(icon_status) - - %ul.dropdown-menu.mini-pipeline-graph-dropdown-menu.js-builds-dropdown-container - %li.js-builds-dropdown-list.scrollable-menu - %ul - - %li.js-builds-dropdown-loading.hidden - .loading-container.text-center - %span.spinner{ 'aria-label': _('Loading') } diff --git a/app/views/shared/_mobile_clone_panel.html.haml b/app/views/shared/_mobile_clone_panel.html.haml index 3edfd502f13..8b7ef838d2b 100644 --- a/app/views/shared/_mobile_clone_panel.html.haml +++ b/app/views/shared/_mobile_clone_panel.html.haml @@ -3,8 +3,8 @@ - http_copy_label = _('Copy %{http_label} clone URL') % { http_label: gitlab_config.protocol.upcase } .btn-group.mobile-git-clone.js-mobile-git-clone.btn-block - = clipboard_button(button_text: default_clone_label, text: default_url_to_repo(project), hide_button_icon: true, class: "gl-button btn btn-confirm flex-fill input-group-text clone-dropdown-btn js-clone-dropdown-label") - %button.gl-button.btn.btn-confirm.btn-icon.dropdown-toggle.js-dropdown-toggle.flex-grow-0.d-flex-center.w-auto.ml-0{ type: "button", data: { toggle: "dropdown" } } + = clipboard_button(button_text: default_clone_label, text: default_url_to_repo(project), hide_button_icon: true, class: "gl-button btn-confirm flex-fill bold justify-content-center input-group-text clone-dropdown-btn js-clone-dropdown-label") + %button.btn.gl-button.btn-confirm.dropdown-toggle.js-dropdown-toggle.flex-grow-0.d-flex-center.w-auto.ml-0{ type: "button", data: { toggle: "dropdown" } } = sprite_icon("chevron-down", css_class: "dropdown-btn-icon icon") %ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown{ data: { dropdown: true } } - if ssh_enabled? diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml index f524747dea0..5c5fc714aea 100644 --- a/app/views/shared/_recaptcha_form.html.haml +++ b/app/views/shared/_recaptcha_form.html.haml @@ -20,4 +20,4 @@ - if has_submit .row-content-block.footer-block - = f.submit _("Submit %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'gl-button btn btn-confirm' + = f.submit _("Create %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'gl-button btn btn-confirm' diff --git a/app/views/shared/_search_settings.html.haml b/app/views/shared/_search_settings.html.haml index d689e9ae5c0..2974b2bf4d0 100644 --- a/app/views/shared/_search_settings.html.haml +++ b/app/views/shared/_search_settings.html.haml @@ -1,6 +1,5 @@ - container_class = local_assigns.fetch(:container_class, 'gl-mt-5') -- if Feature.enabled?(:search_settings_in_page, @project, default_enabled: false) - %div{ class: container_class } - .js-search-settings-app - %input.gl-form-input.form-control{ type: "text", placeholder: _("Search settings"), aria_label: _("Search settings"), disabled: true } +%div{ class: container_class } + .js-search-settings-app + %input.gl-form-input.form-control{ type: "text", placeholder: _("Search settings"), aria_label: _("Search settings"), disabled: true } diff --git a/app/views/shared/access_tokens/_form.html.haml b/app/views/shared/access_tokens/_form.html.haml index 9709ad8428e..88c24a27497 100644 --- a/app/views/shared/access_tokens/_form.html.haml +++ b/app/views/shared/access_tokens/_form.html.haml @@ -23,7 +23,7 @@ = render_if_exists 'personal_access_tokens/callout_max_personal_access_token_lifetime' .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' + = 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' } .form-group = f.label :scopes, _('Scopes'), class: 'label-bold' @@ -31,7 +31,7 @@ - if prefix == :personal_access_token && Feature.enabled?(:personal_access_tokens_scoped_to_projects, current_user) .js-access-tokens-projects - %input{ type: 'hidden', name: 'temporary-name', id: 'temporary-id' } + %input{ type: 'hidden', name: 'personal_access_token[projects]', id: 'personal_access_token_projects', data: { js_name: 'projects' } } .gl-mt-3 = f.submit _('Create %{type}') % { type: type }, class: 'gl-button btn btn-confirm', data: { qa_selector: 'create_token_button' } diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml index d7c74255578..2a2a1a911af 100644 --- a/app/views/shared/access_tokens/_table.html.haml +++ b/app/views/shared/access_tokens/_table.html.haml @@ -43,7 +43,7 @@ - else %span.token-never-expires-label= _('Never') %td= token.scopes.present? ? token.scopes.join(', ') : _('no scopes selected') - %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: 'gl-button btn btn-danger float-right qa-revoke-button', data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } + %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: 'gl-button btn btn-danger btn-sm float-right qa-revoke-button', data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } - else .settings-message.text-center = no_active_tokens_message diff --git a/app/views/shared/admin/_admin_note.html.haml b/app/views/shared/admin/_admin_note.html.haml new file mode 100644 index 00000000000..82407705885 --- /dev/null +++ b/app/views/shared/admin/_admin_note.html.haml @@ -0,0 +1,7 @@ +- if @group.admin_note.present? + - text = @group.admin_note.note + .card.border-info + .card-header.bg-info.gl-text-white + = s_('Admin|Admin notes') + .card-body + %p= text diff --git a/app/views/shared/admin/_admin_note_form.html.haml b/app/views/shared/admin/_admin_note_form.html.haml new file mode 100644 index 00000000000..0bc26f9120f --- /dev/null +++ b/app/views/shared/admin/_admin_note_form.html.haml @@ -0,0 +1,6 @@ +.form-group.row + = f.fields_for :admin_note do |an| + .col-sm-2.col-form-label.gl-text-right + = an.label :note, s_('Admin|Admin notes') + .col-sm-10 + = an.text_area :note, class: 'form-control' diff --git a/app/views/shared/blob/_markdown_buttons.html.haml b/app/views/shared/blob/_markdown_buttons.html.haml index 085206714c6..73f3d2a8fcd 100644 --- a/app/views/shared/blob/_markdown_buttons.html.haml +++ b/app/views/shared/blob/_markdown_buttons.html.haml @@ -1,4 +1,4 @@ -- modifier_key = client_js_flags[:isMac] ? 'ā' : s_('KeyboardKey|Ctrl+'); +- modifier_key = client_js_flags[:isMac] ? 'ā' : s_('KeyboardKey|Ctrl+') .md-header-toolbar.active = markdown_toolbar_button({ icon: "bold", diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml index 8c0893adaaa..bf70149812a 100644 --- a/app/views/shared/boards/_show.html.haml +++ b/app/views/shared/boards/_show.html.haml @@ -1,8 +1,5 @@ - board = local_assigns.fetch(:board, nil) - group = local_assigns.fetch(:group, false) --# TODO: Move group_id and can_admin_list to the board store - See: https://gitlab.com/gitlab-org/gitlab/-/issues/213082 -- can_admin_list = can?(current_user, :admin_issue_board_list, current_board_parent) == true - @no_breadcrumb_container = true - @no_container = true - @content_class = "issue-boards-content js-focus-mode-board" @@ -13,23 +10,8 @@ - page_title("#{board.name}", _("Boards")) - add_page_specific_style 'page_bundles/boards' -- content_for :page_specific_javascripts do - - %script#js-board-modal-filter{ type: "text/x-template" }= render "shared/issuable/search_bar", type: :boards_modal, show_sorting_dropdown: false - = render 'shared/issuable/search_bar', type: :boards, board: board #board-app.boards-app.position-relative{ "v-cloak" => "true", data: board_data, ":class" => "{ 'is-compact': detailIssueVisible }" } - %board-content{ "v-cloak" => "true", - "ref" => "board_content", - ":lists" => "state.lists", - ":can-admin-list" => can_admin_list, - ":disabled" => "disabled", - data: { qa_selector: "boards_list" } } + %board-content{ ":lists" => "state.lists", ":disabled" => "disabled" } = render "shared/boards/components/sidebar", group: group - %board-settings-sidebar{ ":can-admin-list" => can_admin_list } - - if @project - %board-add-issues-modal{ "new-issue-path" => new_project_issue_path(@project), - "milestone-path" => milestones_filter_dropdown_path, - "label-path" => labels_filter_path_with_defaults, - "empty-state-svg" => image_path('illustrations/issues.svg'), - ":project-id" => @project.id } + %board-settings-sidebar diff --git a/app/views/shared/boards/components/_sidebar.html.haml b/app/views/shared/boards/components/_sidebar.html.haml index 59dd571604b..8976e89b3d3 100644 --- a/app/views/shared/boards/components/_sidebar.html.haml +++ b/app/views/shared/boards/components/_sidebar.html.haml @@ -1,6 +1,6 @@ %board-sidebar{ "inline-template" => true, ":current-user" => (UserSerializer.new.represent(current_user) || {}).to_json } %transition{ name: "boards-sidebar-slide" } - %aside.right-sidebar.right-sidebar-expanded.issue-boards-sidebar{ "v-show" => "showSidebar", 'aria-label': s_('Boards|Board') } + %aside.right-sidebar.right-sidebar-expanded.boards-sidebar{ "v-show" => "showSidebar", 'aria-label': s_('Boards|Board'), 'data-testid': 'issue-boards-sidebar' } .issuable-sidebar .block.issuable-sidebar-header.position-relative %span.issuable-header-text.hide-collapsed.float-left diff --git a/app/views/shared/deploy_tokens/_form.html.haml b/app/views/shared/deploy_tokens/_form.html.haml index 2ddfcf43756..4d0858165a2 100644 --- a/app/views/shared/deploy_tokens/_form.html.haml +++ b/app/views/shared/deploy_tokens/_form.html.haml @@ -22,29 +22,29 @@ = f.label :scopes, _('Scopes [Select 1 or more]'), class: 'label-bold' %fieldset.form-group.form-check = f.check_box :read_repository, class: 'form-check-input qa-deploy-token-read-repository' - = label_tag ("deploy_token_read_repository"), 'read_repository', class: 'label-bold form-check-label' + = f.label :read_repository, 'read_repository', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows read-only access to the repository.') - if container_registry_enabled?(group_or_project) %fieldset.form-group.form-check = f.check_box :read_registry, class: 'form-check-input qa-deploy-token-read-registry' - = label_tag ("deploy_token_read_registry"), 'read_registry', class: 'label-bold form-check-label' + = f.label :read_registry, 'read_registry', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows read-only access to registry images.') %fieldset.form-group.form-check = f.check_box :write_registry, class: 'form-check-input' - = label_tag ("deploy_token_write_registry"), 'write_registry', class: 'label-bold form-check-label' + = f.label :write_registry, 'write_registry', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows write access to registry images.') - if packages_registry_enabled?(group_or_project) %fieldset.form-group.form-check = f.check_box :read_package_registry, class: 'form-check-input' - = label_tag ("deploy_token_read_package_registry"), 'read_package_registry', class: 'label-bold form-check-label' + = f.label :read_package_registry, 'read_package_registry', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows read access to the package registry.') %fieldset.form-group.form-check = f.check_box :write_package_registry, class: 'form-check-input' - = label_tag ("deploy_token_write_package_registry"), 'write_package_registry', class: 'label-bold form-check-label' + = f.label :write_package_registry, 'write_package_registry', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows write access to the package registry.') .gl-mt-3 diff --git a/app/views/shared/deploy_tokens/_revoke_modal.html.haml b/app/views/shared/deploy_tokens/_revoke_modal.html.haml deleted file mode 100644 index 2b31c675f74..00000000000 --- a/app/views/shared/deploy_tokens/_revoke_modal.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.modal{ id: "revoke-modal-#{token.id}", tabindex: -1 } - .modal-dialog - .modal-content - .modal-header - %h4.modal-title - = s_('DeployTokens|Revoke %{b_start}%{name}%{b_end}?').html_safe % { b_start: '<b>'.html_safe, name: token.name, b_end: '</b>'.html_safe } - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": true } × - .modal-body - %p - = s_('DeployTokens|You are about to revoke %{b_start}%{name}%{b_end}.').html_safe % { b_start: '<b>'.html_safe, name: token.name, b_end: '</b>'.html_safe } - = s_('DeployTokens|This action cannot be undone.') - .modal-footer.gl-flex-direction-row - %a{ href: '#', data: { dismiss: 'modal' }, class: 'gl-button btn btn-default' }= _('Cancel') - = link_to s_('DeployTokens|Revoke %{name}') % { name: token.name }, revoke_deploy_token_path(group_or_project, token), method: :put, class: 'gl-button btn btn-danger text-truncate' diff --git a/app/views/shared/deploy_tokens/_table.html.haml b/app/views/shared/deploy_tokens/_table.html.haml index ad3c53c4925..fe32fcf94d0 100644 --- a/app/views/shared/deploy_tokens/_table.html.haml +++ b/app/views/shared/deploy_tokens/_table.html.haml @@ -24,8 +24,9 @@ - else %span.token-never-expires-label= _('Never') %td= token.scopes.present? ? token.scopes.join(', ') : _('no scopes selected') - %td= link_to s_('DeployTokens|Revoke'), "#", class: "gl-button btn btn-danger float-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"} - = render 'shared/deploy_tokens/revoke_modal', token: token, group_or_project: group_or_project + %td + .js-deploy-token-revoke-button{ data: { button_class: 'float-right', token: token.to_json, revoke_path: revoke_deploy_token_path(group_or_project, token) } } + - else .settings-message.text-center = s_('DeployTokens|This %{entity_type} has no active Deploy Tokens.') % { entity_type: group_or_project.class.name.downcase } diff --git a/app/views/shared/doorkeeper/applications/_delete_form.html.haml b/app/views/shared/doorkeeper/applications/_delete_form.html.haml new file mode 100644 index 00000000000..caa553bc2ef --- /dev/null +++ b/app/views/shared/doorkeeper/applications/_delete_form.html.haml @@ -0,0 +1,10 @@ +- submit_btn_css ||= 'gl-button btn btn-danger btn-sm' += form_tag path do + %input{ :name => "_method", :type => "hidden", :value => "delete" } + - if defined? small + = button_tag type: "submit", class: "gl-button btn btn-danger btn-icon", data: { confirm: _("Are you sure?") } do + %span.sr-only + = _('Destroy') + = sprite_icon('remove') + - else + = submit_tag _('Destroy'), data: { confirm: _("Are you sure?") }, class: submit_btn_css diff --git a/app/views/shared/doorkeeper/applications/_form.html.haml b/app/views/shared/doorkeeper/applications/_form.html.haml new file mode 100644 index 00000000000..91a32b55542 --- /dev/null +++ b/app/views/shared/doorkeeper/applications/_form.html.haml @@ -0,0 +1,26 @@ += form_for @application, url: url, html: { role: 'form', class: 'doorkeeper-app-form' } do |f| + = form_errors(@application) + + .form-group + = f.label :name, class: 'label-bold' + = f.text_field :name, class: 'form-control gl-form-input', required: true + + .form-group + = f.label :redirect_uri, class: 'label-bold' + = f.text_area :redirect_uri, class: 'form-control gl-form-input gl-form-textarea', required: true + + %span.form-text.text-muted + = _('Use one line per URI') + + .form-group.form-check + = f.check_box :confidential, class: 'form-check-input' + = f.label :confidential, class: 'label-bold form-check-label' + %span.form-text.text-muted + = _('The application will be used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential.') + + .form-group + = f.label :scopes, class: 'label-bold' + = render 'shared/tokens/scopes_form', prefix: 'doorkeeper_application', token: @application, scopes: @scopes + + .gl-mt-3 + = f.submit _('Save application'), class: "gl-button btn btn-confirm" diff --git a/app/views/shared/doorkeeper/applications/_index.html.haml b/app/views/shared/doorkeeper/applications/_index.html.haml new file mode 100644 index 00000000000..8ccb4bcdbe0 --- /dev/null +++ b/app/views/shared/doorkeeper/applications/_index.html.haml @@ -0,0 +1,88 @@ +- @content_class = "limit-container-width" unless fluid_layout + +.row.gl-mt-3 + .col-lg-4.profile-settings-sidebar + %h4.gl-mt-0 + = page_title + %p + - if oauth_applications_enabled + - if oauth_authorized_applications_enabled + = _("Manage applications that can use GitLab as an OAuth provider, and applications that you've authorized to use your account.") + - else + = _("Manage applications that can use GitLab as an OAuth provider.") + - else + = _("Manage applications that you've authorized to use your account.") + .col-lg-8 + - if oauth_applications_enabled + %h5.gl-mt-0 + = _('Add new application') + = render 'shared/doorkeeper/applications/form', url: form_url + %hr + - else + .bs-callout.bs-callout-disabled + = _('Adding new applications is disabled in your GitLab instance. Please contact your GitLab administrator to get the permission') + - if oauth_applications_enabled + .oauth-applications + %h5 + = _("Your applications (%{size})") % { size: @applications.size } + - if @applications.any? + .table-responsive + %table.table + %thead + %tr + %th= _('Name') + %th= _('Callback URL') + %th= _('Clients') + %th.last-heading + %tbody + - @applications.each do |application| + %tr{ id: "application_#{application.id}" } + %td= link_to application.name, application_url.call(application) + %td + - application.redirect_uri.split.each do |uri| + %div= uri + %td= application.access_tokens.count + %td.gl-display-flex + = link_to edit_application_url.call(application), class: "gl-button btn btn-default btn-icon gl-mr-3" do + %span.sr-only + = _('Edit') + = sprite_icon('pencil') + = render 'shared/doorkeeper/applications/delete_form', path: application_url.call(application), small: true + - else + .settings-message.text-center + = _("You don't have any applications") + - if oauth_authorized_applications_enabled + .oauth-authorized-applications.prepend-top-20.gl-mb-3 + - if oauth_applications_enabled + %h5 + = _("Authorized applications (%{size})") % { size: @authorized_apps.size + @authorized_anonymous_tokens.size } + + - if @authorized_tokens.any? + .table-responsive + %table.table.table-striped + %thead + %tr + %th= _('Name') + %th= _('Authorized At') + %th= _('Scope') + %th + %tbody + - @authorized_apps.each do |app| + - token = app.authorized_tokens.order('created_at desc').first # rubocop: disable CodeReuse/ActiveRecord + %tr{ id: "application_#{app.id}" } + %td= app.name + %td= token.created_at + %td= token.scopes + %td= render 'doorkeeper/authorized_applications/delete_form', application: app + - @authorized_anonymous_tokens.each do |token| + %tr + %td + = _('Anonymous') + .form-text.text-muted + %em= _("Authorization was granted by entering your username and password in the application.") + %td= token.created_at + %td= token.scopes + %td= render 'doorkeeper/authorized_applications/delete_form', token: token + - else + .settings-message.text-center + = _("You don't have any authorized applications") diff --git a/app/views/shared/doorkeeper/applications/_show.html.haml b/app/views/shared/doorkeeper/applications/_show.html.haml new file mode 100644 index 00000000000..b690aa74ff0 --- /dev/null +++ b/app/views/shared/doorkeeper/applications/_show.html.haml @@ -0,0 +1,39 @@ +.table-holder.oauth-application-show + %table.table + %tr + %td + = _('Application ID') + %td + .clipboard-group + .input-group + %input.label.label-monospace.monospace{ id: "application_id", type: "text", autocomplete: 'off', value: @application.uid, readonly: true } + .input-group-append + = clipboard_button(target: '#application_id', title: _("Copy ID"), class: "gl-button btn btn-default") + %tr + %td + = _('Secret') + %td + .clipboard-group + .input-group + %input.label.label-monospace.monospace{ id: "secret", type: "text", autocomplete: 'off', value: @application.secret, readonly: true } + .input-group-append + = clipboard_button(target: '#secret', title: _("Copy secret"), class: "gl-button btn btn-default") + %tr + %td + = _('Callback URL') + %td + - @application.redirect_uri.split.each do |uri| + %div + %span.monospace= uri + + %tr + %td + = _('Confidential') + %td + = @application.confidential? ? _('Yes') : _('No') + + = render "shared/tokens/scopes_list", token: @application + +.form-actions + = link_to _('Edit'), edit_path, class: 'gl-button btn btn-confirm wide float-left' + = render 'shared/doorkeeper/applications/delete_form', path: delete_path, submit_btn_css: 'gl-button btn btn-danger gl-ml-3' diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 8ccf14463c7..13d9d71d58e 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -43,7 +43,7 @@ .text-center - if project_select_button = render 'shared/new_project_item_select', path: 'issues/new', label: _('New issue'), type: :issues, with_feature_enabled: 'issues' - - else + - elsif show_new_issue_link?(@project) = link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link' - if show_import_button @@ -53,7 +53,7 @@ %strong = s_('JiraService|Using Jira for issue tracking?') %p.gl-text-center.gl-mb-0 - - jira_docs_link_url = help_page_url('user/project/integrations/jira', anchor: 'view-jira-issues') + - jira_docs_link_url = help_page_url('integration/jira/issues', anchor: 'view-jira-issues') - jira_docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: jira_docs_link_url } = html_escape(s_('JiraService|%{jira_docs_link_start}Enable the Jira integration%{jira_docs_link_end} to view your Jira issues in GitLab.')) % { jira_docs_link_start: jira_docs_link_start.html_safe, jira_docs_link_end: '</a>'.html_safe } %p.gl-text-center.gl-mb-0.gl-text-gray-500 diff --git a/app/views/shared/empty_states/_profile_tabs.html.haml b/app/views/shared/empty_states/_profile_tabs.html.haml index 42a845846d1..c813fd691f1 100644 --- a/app/views/shared/empty_states/_profile_tabs.html.haml +++ b/app/views/shared/empty_states/_profile_tabs.html.haml @@ -6,7 +6,7 @@ .svg-content = image_tag illustration_path, size: '75' .text-content - - if user_profile? and current_user.present? and current_user.username == params[:username] + - if user_profile? && current_user.present? && current_user.username == params[:username] %h5= current_user_empty_message_header - if current_user_empty_message_description.present? diff --git a/app/views/shared/empty_states/_wikis.html.haml b/app/views/shared/empty_states/_wikis.html.haml index 0bddffa881a..917ef666e85 100644 --- a/app/views/shared/empty_states/_wikis.html.haml +++ b/app/views/shared/empty_states/_wikis.html.haml @@ -18,14 +18,14 @@ - elsif @project && can?(current_user, :read_issue, @project) - issues_link = link_to s_('WikiEmptyIssueMessage|issue tracker'), project_issues_path(@project) - - new_issue_link = link_to s_('WikiEmpty|Suggest wiki improvement'), new_project_issue_path(@project), class: 'btn gl-button btn-confirm', title: s_('WikiEmptyIssueMessage|Suggest wiki improvement') = render layout: layout_path, locals: { image_path: 'illustrations/wiki_logout_empty.svg' } do %h4 = messages.dig(:issuable, :title) %p.text-left = messages.dig(:issuable, :body).html_safe % { issues_link: issues_link } - = new_issue_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') - else = render layout: layout_path, locals: { image_path: 'illustrations/wiki_logout_empty.svg' } do diff --git a/app/views/shared/form_elements/_description.html.haml b/app/views/shared/form_elements/_description.html.haml index 7f4aed5d1f7..f8942dddfb4 100644 --- a/app/views/shared/form_elements/_description.html.haml +++ b/app/views/shared/form_elements/_description.html.haml @@ -1,7 +1,7 @@ - project = local_assigns.fetch(:project) - model = local_assigns.fetch(:model) - form = local_assigns.fetch(:form) -- placeholder = model.is_a?(MergeRequest) ? _('Describe the goal of the changes and what reviewers should be aware of.') : _('Write a comment or drag your files hereā¦') +- placeholder = model.is_a?(MergeRequest) ? _('Describe the goal of the changes and what reviewers should be aware of.') : _('Write a description or drag your files hereā¦') - supports_quick_actions = true - preview_url = preview_markdown_path(project, target_type: model.class.name) @@ -19,9 +19,10 @@ = render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do = render 'shared/zen', f: form, attr: :description, - classes: 'note-textarea qa-issuable-form-description rspec-issuable-form-description', + classes: 'note-textarea rspec-issuable-form-description', placeholder: placeholder, - supports_quick_actions: supports_quick_actions + supports_quick_actions: supports_quick_actions, + qa_selector: 'issuable_form_description' = render 'shared/notes/hints', supports_quick_actions: supports_quick_actions .clearfix .error-alert diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index 6b056e93460..51f44afe55e 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -24,7 +24,7 @@ %h5 Request headers: %pre - - hook_log.request_headers.each do |k,v| + - hook_log.request_headers.each do |k, v| <strong>#{k}:</strong> #{v} %br @@ -34,7 +34,7 @@ #{Gitlab::Json.pretty_generate(hook_log.request_data)} %h5 Response headers: %pre - - hook_log.response_headers.each do |k,v| + - hook_log.response_headers.each do |k, v| <strong>#{k}:</strong> #{v} %br diff --git a/app/views/shared/integrations/_index.html.haml b/app/views/shared/integrations/_index.html.haml index ccc2c448f69..39365280e71 100644 --- a/app/views/shared/integrations/_index.html.haml +++ b/app/views/shared/integrations/_index.html.haml @@ -1,27 +1 @@ -%table.table.b-table.gl-table{ role: 'table', 'aria-busy': false, 'aria-colcount': 4 } - %colgroup - %col - %col - %col.d-none.d-sm-table-column - %col{ width: 135 } - %thead{ role: 'rowgroup' } - %tr{ role: 'row' } - %th{ role: 'columnheader', scope: 'col', 'aria-colindex': 1 } - %th{ role: 'columnheader', scope: 'col', 'aria-colindex': 2 }= _('Integration') - %th.d-none.d-sm-block{ role: 'columnheader', scope: 'col', 'aria-colindex': 3 }= _('Description') - %th{ role: 'columnheader', scope: 'col', 'aria-colindex': 4 }= _('Last updated') - - %tbody{ role: 'rowgroup' } - - integrations.each do |integration| - - activated_label = (integration.activated? ? s_("ProjectService|%{service_title}: status on") : s_("ProjectService|%{service_title}: status off")) % { service_title: integration.title } - %tr{ role: 'row' } - %td{ role: 'cell', 'aria-colindex': 1, 'aria-label': activated_label, title: activated_label } - - if integration.operating? - = sprite_icon('check', css_class: 'gl-text-green-500') - %td{ role: 'cell', 'aria-colindex': 2 } - = link_to integration.title, scoped_edit_integration_path(integration), class: 'gl-font-weight-bold', data: { qa_selector: "#{integration.to_param}_link" } - %td.d-none.d-sm-table-cell{ role: 'cell', 'aria-colindex': 3 } - = integration.description - %td{ role: 'cell', 'aria-colindex': 4 } - - if integration.updated_at.present? - = time_ago_with_tooltip integration.updated_at +.js-integrations-list{ data: integration_list_data(integrations) } diff --git a/app/views/shared/issuable/_approved_by_dropdown.html.haml b/app/views/shared/issuable/_approved_by_dropdown.html.haml index 8014545ab85..c64d34d0da4 100644 --- a/app/views/shared/issuable/_approved_by_dropdown.html.haml +++ b/app/views/shared/issuable/_approved_by_dropdown.html.haml @@ -1,10 +1,10 @@ #js-dropdown-approved-by.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore - if current_user diff --git a/app/views/shared/issuable/_board_create_list_dropdown.html.haml b/app/views/shared/issuable/_board_create_list_dropdown.html.haml index 1a22a66d185..74b064648c0 100644 --- a/app/views/shared/issuable/_board_create_list_dropdown.html.haml +++ b/app/views/shared/issuable/_board_create_list_dropdown.html.haml @@ -1,5 +1,5 @@ .dropdown.gl-display-flex.gl-align-items-center.gl-ml-3#js-add-list - %button.gl-button.btn.btn-confirm.btn-confirm-secondary.js-new-board-list{ type: "button", data: board_list_data } + %button.gl-button.btn.btn-confirm.js-new-board-list{ type: "button", data: board_list_data } Add list .dropdown-menu.dropdown-extended-height.dropdown-menu-paging.dropdown-menu-right.dropdown-menu-issues-board-new.dropdown-menu-selectable.js-tab-container-labels = render partial: "shared/issuable/label_page_default", locals: { show_footer: true, show_create: true, show_boards_content: true, title: "Add list" } diff --git a/app/views/shared/issuable/_bulk_update_sidebar.html.haml b/app/views/shared/issuable/_bulk_update_sidebar.html.haml index b6fc1f4955b..bbbb728d048 100644 --- a/app/views/shared/issuable/_bulk_update_sidebar.html.haml +++ b/app/views/shared/issuable/_bulk_update_sidebar.html.haml @@ -6,7 +6,7 @@ = form_tag [:bulk_update, @project, type], method: :post, class: "bulk-update" do .block.issuable-sidebar-header .filter-item.inline.update-issues-btn.float-left - = button_tag _('Update all'), class: "gl-button btn update-selected-issues btn-info", disabled: true + = button_tag _('Update all'), class: "gl-button btn update-selected-issues btn-confirm", disabled: true = button_tag _('Cancel'), class: "gl-button btn btn-default js-bulk-update-menu-hide float-right" - if params[:state] != 'merged' .block diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 41b7d7e9e1b..de657e39453 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -62,26 +62,24 @@ - is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?) .row-content-block{ class: (is_footer ? "footer-block" : "middle-block") } - .float-right - - if issuable.new_record? - = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'gl-button btn btn-cancel' - - else - - if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project) - = link_to 'Delete', polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { confirm: "#{issuable.human_class_name} will be removed! Are you sure?" }, method: :delete, class: 'btn btn-danger btn-grouped' - = link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-grouped btn-default btn-cancel' - - %span.gl-mr-3 - - if issuable.new_record? - = form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm', data: { qa_selector: 'issuable_create_button' } - - else - = form.submit 'Save changes', class: 'gl-button btn btn-confirm' - - if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path) - .inline.gl-mt-3 + .gl-mb-5 Please review the %strong= link_to('contribution guidelines', guide_url) 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' } + - else + = form.submit 'Save changes', class: 'gl-button btn btn-confirm gl-mr-2' + + - if issuable.new_record? + = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default' + - else + = link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-default' + - if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project) + = link_to 'Delete', polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { confirm: _('%{issuableType} will be removed! Are you sure?') % { issuableType: issuable.human_class_name } }, method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary gl-float-right' + = render_if_exists 'shared/issuable/remove_approver' - if issuable.respond_to?(:issue_type) diff --git a/app/views/shared/issuable/_invite_members_trigger.html.haml b/app/views/shared/issuable/_invite_members_trigger.html.haml new file mode 100644 index 00000000000..5dd6ec0addf --- /dev/null +++ b/app/views/shared/issuable/_invite_members_trigger.html.haml @@ -0,0 +1,8 @@ +- return unless can_import_members? + +.js-invite-members-modal{ data: { id: project.id, + name: project.name, + is_project: 'true', + access_levels: ProjectMember.access_level_roles.to_json, + default_access_level: Gitlab::Access::GUEST, + help_link: help_page_url('user/permissions') } } diff --git a/app/views/shared/issuable/_nav.html.haml b/app/views/shared/issuable/_nav.html.haml index a3d6a2c8e04..cff50eef88b 100644 --- a/app/views/shared/issuable/_nav.html.haml +++ b/app/views/shared/issuable/_nav.html.haml @@ -1,6 +1,6 @@ - type = local_assigns.fetch(:type, :issues) - page_context_word = type.to_s.humanize(capitalize: false) -- display_count = local_assigns.fetch(:display_count, :true) +- display_count = local_assigns.fetch(:display_count, true) %ul.nav-links.issues-state-filters.mobile-separator.nav.nav-tabs %li{ class: active_when(params[:state] == 'opened') }> diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index f5b2868aa6c..1e340f033a1 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -3,15 +3,15 @@ - show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true) - disable_target_branch = local_assigns.fetch(:disable_target_branch, false) - placeholder = local_assigns[:placeholder] || _('Search or filter results...') -- is_not_boards_modal_or_productivity_analytics = type != :boards_modal && type != :productivity_analytics -- block_css_class = is_not_boards_modal_or_productivity_analytics ? 'row-content-block second-block' : '' -- if board && board.to_type == "EpicBoard" +- block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : '' +- is_epic_board = board&.to_type == "EpicBoard" +- if is_epic_board - user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent) - elsif board - user_can_admin_list = can?(current_user, :admin_issue_board_list, board.resource_parent) -.issues-filters{ class: ("w-100" if type == :boards_modal) } - .issues-details-filters.filtered-search-block.d-flex.flex-column.flex-lg-row{ class: block_css_class, "v-pre" => type == :boards_modal } +.issues-filters + .issues-details-filters.filtered-search-block.d-flex.flex-column.flex-lg-row{ class: block_css_class } .d-flex.flex-column.flex-md-row.flex-grow-1.mb-lg-0.mb-md-2.mb-sm-0.w-100 - if type == :boards = render "shared/boards/switcher", board: board @@ -21,16 +21,16 @@ - if @can_bulk_update .check-all-holder.d-none.d-sm-block.hidden = check_box_tag "check-all-issues", nil, false, class: "check-all-issues left" - - if Feature.enabled?(:boards_filtered_search, @group) + - if Feature.enabled?(:boards_filtered_search, @group) && is_epic_board #js-board-filtered-search - else .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row .filtered-search-box - - if type != :boards_modal && type != :boards + - if type != :boards - text = tag.span(sprite_icon('history'), class: "d-md-none") + tag.span(_('Recent searches'), class: "d-none d-md-inline") = dropdown_tag(text, options: { wrapper_class: "filtered-search-history-dropdown-wrapper", - toggle_class: "btn filtered-search-history-dropdown-toggle-button", + toggle_class: "gl-button btn btn-default filtered-search-history-dropdown-toggle-button", dropdown_class: "filtered-search-history-dropdown", content_class: "filtered-search-history-dropdown-content" }) do .js-filtered-search-history-dropdown{ data: { full_path: search_history_storage_prefix } } @@ -42,7 +42,7 @@ #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item{ data: {hint: "#{'{{hint}}'}", tag: "#{'{{tag}}'}", action: "#{'{{hint === \'search\' ? \'submit\' : \'\' }}'}" } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } -# Encapsulate static class name `{{icon}}` inside #{} to bypass -# haml lint's ClassAttributeWithStaticValue %svg @@ -52,7 +52,7 @@ #js-dropdown-operator.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dropdown: true, dynamic: true } } %li.filter-dropdown-item{ data: { value: "{{ title }}" } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } {{ title }} %span.btn-helptext {{ help }} @@ -68,10 +68,10 @@ #js-dropdown-assignee.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore - if current_user @@ -84,10 +84,10 @@ #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore - if current_user @@ -102,92 +102,92 @@ #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.filter-dropdown-item{ data: { value: 'Upcoming' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Upcoming') %li.filter-dropdown-item{ data: { value: 'Started' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Started') %li.divider.droplab-item-ignore %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link.js-data-value{ type: 'button' } + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } {{title}} = render_if_exists 'shared/issuable/filter_iteration', type: type #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link.js-data-value{ type: 'button' } + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } {{title}} #js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } %span.dropdown-label-box{ style: 'background: {{color}}' } %span.label-title.js-data-value {{title}} #js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('None') %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Any') %li.divider.droplab-item-ignore %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } %gl-emoji %span.js-data-value.gl-ml-3 {{name}} #js-dropdown-wip.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Yes') %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('No') #js-dropdown-confidential.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('Yes') %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } } - %button.btn.btn-link{ type: 'button' } + %button.gl-button.btn.btn-link{ type: 'button' } = _('No') - unless disable_target_branch #js-dropdown-target-branch.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link.js-data-value.monospace + %button.gl-button.btn.btn-link.js-data-value.monospace {{title}} #js-dropdown-environment.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.btn.btn-link.js-data-value{ type: 'button' } + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } {{title}} = render_if_exists 'shared/issuable/filter_weight', type: type @@ -207,8 +207,6 @@ .js-create-column-trigger{ data: board_list_data } - else = render 'shared/issuable/board_create_list_dropdown', board: board - - if @project - #js-add-issues-btn{ data: { can_admin_list: can?(current_user, :admin_issue_board_list, @project) } } #js-toggle-focus-btn - - elsif is_not_boards_modal_or_productivity_analytics && show_sorting_dropdown + - elsif type != :productivity_analytics && show_sorting_dropdown = render 'shared/issuable/sort_dropdown' diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 787d9db1192..fb2019bef15 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -34,7 +34,7 @@ - if issuable_sidebar[:supports_milestone] - milestone = issuable_sidebar[:milestone] || {} - .block.milestone{ class: 'gl-border-b-0!', data: { qa_selector: 'milestone_block' } } + .block.milestone{ :class => ("gl-border-b-0!" if issuable_sidebar[:supports_iterations]), data: { qa_selector: 'milestone_block' } } .sidebar-collapsed-icon.has-tooltip{ title: sidebar_milestone_tooltip_label(milestone), data: { container: 'body', html: 'true', placement: 'left', boundary: 'viewport' } } = sprite_icon('clock') %span.milestone-title.collapse-truncated-title @@ -70,41 +70,7 @@ = _('Time tracking') = loading_icon(css_class: 'gl-vertical-align-text-bottom') - if issuable_sidebar.has_key?(:due_date) - .block.due_date - .sidebar-collapsed-icon.has-tooltip{ data: { placement: 'left', container: 'body', html: 'true', boundary: 'viewport' }, title: sidebar_due_date_tooltip_label(issuable_sidebar[:due_date]) } - = sprite_icon('calendar') - %span.js-due-date-sidebar-value - = issuable_sidebar[:due_date].try(:to_s, :medium) || _('None') - .title.hide-collapsed - = _('Due date') - = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading') - - if can_edit_issuable - = link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { track_label: "right_sidebar", track_property: "due_date", track_event: "click_edit_button", track_value: "" } - .value.hide-collapsed - %span.value-content - - if issuable_sidebar[:due_date] - %span.bold= issuable_sidebar[:due_date].to_s(:medium) - - else - %span.no-value - = _('None') - - if can_edit_issuable - %span.no-value.js-remove-due-date-holder{ class: ("hidden" if issuable_sidebar[:due_date].nil?) } - \- - %a.js-remove-due-date{ href: "#", role: "button" } - = _('remove due date') - - if can_edit_issuable - .selectbox.hide-collapsed - = f.hidden_field :due_date, value: issuable_sidebar[:due_date].try(:strftime, 'yy-mm-dd') - .dropdown - %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable_type}[due_date]", ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], display: 'static' } } - %span.dropdown-toggle-text - = _('Due date') - = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") - .dropdown-menu.dropdown-menu-due-date - = dropdown_title(_('Due date')) - = dropdown_content do - .js-due-date-calendar - + #js-due-date-entry-point .js-sidebar-labels{ data: sidebar_labels_data(issuable_sidebar, @project) } @@ -133,12 +99,12 @@ .block.with-sub-blocks #js-reference-entry-point - if issuable_type == 'merge_request' - .sidebar-source-branch.sub-block + .sub-block.js-sidebar-source-branch .sidebar-collapsed-icon.dont-change-state = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') - .sidebar-mr-source-branch.hide-collapsed - %span - = _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<cite class='ref-name' title='#{html_escape(source_branch)}'>".html_safe, source_branch_close: "</cite>".html_safe, source_branch: html_escape(source_branch) } + .gl-display-flex.gl-align-items-center.gl-justify-content-space-between.gl-mb-2.hide-collapsed + %span.gl-overflow-hidden.gl-text-overflow-ellipsis.gl-white-space-nowrap + = _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<span class='gl-font-monospace' data-testid='ref-name' title='#{html_escape(source_branch)}'>".html_safe, source_branch_close: "</span>".html_safe, source_branch: html_escape(source_branch) } = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') - if show_forwarding_email diff --git a/app/views/shared/issuable/_sidebar_assignees.html.haml b/app/views/shared/issuable/_sidebar_assignees.html.haml index 26986c913f0..47e7ff0e4bc 100644 --- a/app/views/shared/issuable/_sidebar_assignees.html.haml +++ b/app/views/shared/issuable/_sidebar_assignees.html.haml @@ -1,6 +1,7 @@ - issuable_type = issuable_sidebar[:type] +- dropdown_options = assignees_dropdown_options(issuable_type) -#js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in } } +#js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in, max_assignees: dropdown_options[:data][:"max-select"], directly_invite_members: directly_invite_members?, indirectly_invite_members: indirectly_invite_members? } } .title.hide-collapsed = _('Assignee') = loading_icon(css_class: 'gl-vertical-align-text-bottom') @@ -29,7 +30,6 @@ null_user: true, display: 'static' } } - - dropdown_options = assignees_dropdown_options(issuable_type) - title = dropdown_options[:title] - options[:toggle_class] += ' js-multiselect js-save-user-data' - data = { field_name: "#{issuable_type}[assignee_ids][]" } @@ -53,10 +53,10 @@ %ul.dropdown-footer-list %li - if directly_invite_members? - = link_to invite_text, - project_project_members_path(@project), - title: invite_text, - data: { 'is-link': true, 'track-event': 'click_invite_members', 'track-label': track_label } + .js-invite-members-trigger{ data: { trigger_element: 'anchor', + display_text: invite_text, + event: 'click_invite_members', + label: track_label } } - else .js-invite-member-trigger{ data: { display_text: invite_text, event: 'click_invite_members_version_b', label: track_label } } - else diff --git a/app/views/shared/issuable/_sort_dropdown.html.haml b/app/views/shared/issuable/_sort_dropdown.html.haml index f60be3f3e4a..9e3caf62d77 100644 --- a/app/views/shared/issuable/_sort_dropdown.html.haml +++ b/app/views/shared/issuable/_sort_dropdown.html.haml @@ -5,7 +5,7 @@ .dropdown.inline.gl-ml-3.issue-sort-dropdown .btn-group{ role: 'group' } .btn-group{ role: 'group' } - %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } + %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'gl-button btn btn-default' } = sort_title = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort diff --git a/app/views/shared/issuable/_user_dropdown_item.html.haml b/app/views/shared/issuable/_user_dropdown_item.html.haml index 4a3547e9e70..b3bc7ba85ad 100644 --- a/app/views/shared/issuable/_user_dropdown_item.html.haml +++ b/app/views/shared/issuable/_user_dropdown_item.html.haml @@ -2,7 +2,7 @@ - avatar = local_assigns.fetch(:avatar, { }) %li.filter-dropdown-item{ class: ('js-current-user' if user == current_user) } - %button.btn.btn-link.dropdown-user{ type: :button } + %button.gl-button.btn.btn-link.dropdown-user{ type: :button } .avatar-container.s40 = user_avatar_without_link(user: user, lazy: avatar[:lazy], url: avatar[:url], size: 40, has_tooltip: false) .dropdown-user-details diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index 67bc4019a82..b5c5e2fa091 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -3,26 +3,30 @@ .form-group.row.gl-mb-0 = form.label :type, 'Type', class: 'col-form-label col-sm-2' .col-sm-10 - .issuable-form-select-holder.selectbox.form-group.gl-mb-0 - .dropdown.js-issuable-type-filter-dropdown-wrap - %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } - %span.dropdown-toggle-text.is-default - = issuable.issue_type.capitalize || _("Select type") - = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") - .dropdown-menu.dropdown-menu-selectable.dropdown-select - .dropdown-title.gl-display-flex - %span.gl-ml-auto - = _("Select type") - %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ type: 'button', "aria-label" => _('Close') } - = sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon') - .dropdown-content - %ul - %li.js-filter-issuable-type - = link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do - = _("Issue") - %li.js-filter-issuable-type{ data: { track: { event: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } } - = link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do - = _("Incident") + .gl-display-flex.gl-align-items-center + .issuable-form-select-holder.selectbox.form-group.gl-mb-0 + .dropdown.js-issuable-type-filter-dropdown-wrap + %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } + %span.dropdown-toggle-text.is-default + = issuable.issue_type.capitalize || _("Select type") + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") + .dropdown-menu.dropdown-menu-selectable.dropdown-select + .dropdown-title.gl-display-flex + %span.gl-ml-auto + = _("Select type") + %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ type: 'button', "aria-label" => _('Close') } + = sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon') + .dropdown-content + %ul + %li.js-filter-issuable-type + = link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do + = _("Issue") + %li.js-filter-issuable-type{ data: { track: { event: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } } + = link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do + = _("Incident") + + #js-type-popover + - if issuable.incident? %p.form-text.text-muted - incident_docs_url = help_page_path('operations/incident_management/incidents.md') diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml index 7c1ec332ba4..ceedb5e5c59 100644 --- a/app/views/shared/issue_type/_details_content.html.haml +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -1,4 +1,5 @@ - related_branches_path = related_branches_project_issue_path(@project, issuable) +- api_awards_path = local_assigns.fetch(:api_awards_path, nil) .issue-details.issuable-details .detail-page-description.content-block @@ -24,7 +25,7 @@ #related-branches{ data: { url: related_branches_path } } -# This element is filled in using JavaScript. - = render 'shared/issue_type/emoji_block', issuable: issuable + = render 'shared/issue_type/emoji_block', issuable: issuable, api_awards_path: api_awards_path = render 'projects/issues/discussion' diff --git a/app/views/shared/issue_type/_details_header.html.haml b/app/views/shared/issue_type/_details_header.html.haml index 7e150c544bd..36a68dfdaa7 100644 --- a/app/views/shared/issue_type/_details_header.html.haml +++ b/app/views/shared/issue_type/_details_header.html.haml @@ -1,7 +1,7 @@ .detail-page-header .detail-page-header-body .issuable-status-box.status-box.status-box-issue-closed{ class: issue_status_visibility(issuable, status_box: :closed) } - = sprite_icon('mobile-issue-close', css_class: 'gl-display-block gl-sm-display-none!') + = sprite_icon('issue-close', css_class: 'gl-display-block gl-sm-display-none!') .gl-display-none.gl-sm-display-block! = issue_closed_text(issuable, current_user) .issuable-status-box.status-box.status-box-open{ class: issue_status_visibility(issuable, status_box: :open) } @@ -13,7 +13,7 @@ #js-issuable-header-warnings = issuable_meta(issuable, @project) - %a.btn.gl-button.btn-default.float-right.gl-display-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" } + %a.btn.gl-button.btn-default.btn-icon.float-right.gl-display-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" } = sprite_icon('chevron-double-lg-left') .js-issue-header-actions{ data: issue_header_actions_data(@project, issuable, current_user) } diff --git a/app/views/shared/issue_type/_emoji_block.html.haml b/app/views/shared/issue_type/_emoji_block.html.haml index 42d149b2ab3..ca2749b6bf9 100644 --- a/app/views/shared/issue_type/_emoji_block.html.haml +++ b/app/views/shared/issue_type/_emoji_block.html.haml @@ -1,7 +1,9 @@ +- api_awards_path = local_assigns.fetch(:api_awards_path, nil) + .content-block.emoji-block.emoji-block-sticky .row.gl-m-0.gl-justify-content-space-between .js-noteable-awards - = render 'award_emoji/awards_block', awardable: issuable, inline: true + = render 'award_emoji/awards_block', awardable: issuable, inline: true, api_awards_path: api_awards_path .new-branch-col = render_if_exists "projects/issues/timeline_toggle", issuable: issuable #js-vue-sort-issue-discussions diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index 0ba3e539357..88e2a74d235 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -67,7 +67,7 @@ - if member.can_resend_invite? = link_to sprite_icon('paper-airplane'), polymorphic_path([:resend_invite, member]), method: :post, - class: 'btn btn-default align-self-center mr-sm-2', + class: 'gl-button btn btn-default align-self-center mr-sm-2', title: _('Resend invite') - if user != current_user && member.can_update? @@ -120,7 +120,7 @@ = sprite_icon('leave', css_class: 'gl-icon') = _('Leave') - else - %button{ data: { member_path: member_path(member.member), message: remove_member_message(member), is_access_request: member.request?.to_s, qa_selector: 'delete_member_button' }, + %button{ data: { member_path: member_path(member.member), member_type: member.type, message: remove_member_message(member), is_access_request: member.request?.to_s, qa_selector: 'delete_member_button' }, class: "js-remove-member-button btn gl-button btn-danger align-self-center m-0 #{'ml-sm-2 btn-icon' unless force_mobile_view}", title: remove_member_title(member) } %span{ class: ('d-block d-sm-none' unless force_mobile_view) } diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index f52bf1551f4..44934a12559 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -44,22 +44,22 @@ = link_to pluralize(milestone.total_issues_count, _('Issue')), issues_path - if milestone.merge_requests_enabled? · - = link_to pluralize(milestone.merge_requests_visible_to_user(current_user).size, _('Merge Request')), merge_requests_path + = link_to pluralize(milestone.total_merge_requests_count, _('Merge request')), merge_requests_path .float-lg-right.light #{milestone.percent_complete}% complete .col-sm-2 .milestone-actions.d-flex.justify-content-sm-start.justify-content-md-end - if @project # if in milestones list on project level - if can_admin_group_milestones? - %button.js-promote-project-milestone-button.btn.gl-button.btn-default-tertiary.btn-sm.btn-grouped.has-tooltip{ title: s_('Milestones|Promote to Group Milestone'), + %button.js-promote-project-milestone-button.btn.gl-button.btn-icon.btn-default-tertiary.btn-sm.has-tooltip{ title: s_('Milestones|Promote to Group Milestone'), disabled: true, type: 'button', data: { url: promote_project_milestone_path(milestone.project, milestone), milestone_title: milestone.title, group_name: @project.group.name } } - = sprite_icon('level-up', size: 14) + = sprite_icon('level-up', size: 14, css_class: 'gl-button-icon gl-icon') - 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 btn-grouped" + = link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm gl-ml-3" - else - = link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn gl-button btn-warning-secondary btn-sm btn-grouped btn-close" + = 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" diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index 661ace8feaa..0e54f1a7672 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -165,6 +165,6 @@ .cross-project-reference.hide-collapsed %span = s_('MilestoneSidebar|Reference:') - %cite{ title: milestone_ref } + %span{ title: milestone_ref } = milestone_ref = clipboard_button(text: milestone_ref, title: s_('MilestoneSidebar|Copy reference'), placement: "left", boundary: 'viewport') diff --git a/app/views/shared/milestones/_tabs.html.haml b/app/views/shared/milestones/_tabs.html.haml index 33e634c3e7b..3524a1b17ea 100644 --- a/app/views/shared/milestones/_tabs.html.haml +++ b/app/views/shared/milestones/_tabs.html.haml @@ -11,7 +11,7 @@ - if milestone.merge_requests_enabled? %li.nav-item = link_to '#tab-merge-requests', class: 'nav-link', data: { toggle: 'tab', endpoint: milestone_tab_path(milestone, 'merge_requests', show_project_name: show_project_name) } do - = _('Merge Requests') + = _('Merge requests') %span.badge.badge-pill= milestone.merge_requests_visible_to_user(current_user).size %li.nav-item = link_to '#tab-participants', class: 'nav-link', data: { toggle: 'tab', endpoint: milestone_tab_path(milestone, 'participants') } do diff --git a/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml new file mode 100644 index 00000000000..1e9aa4ec5ff --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml @@ -0,0 +1,14 @@ +- attribute = local_assigns.fetch(:attribute, nil) +- group = local_assigns.fetch(:group, nil) +- form = local_assigns.fetch(:form, nil) + +- return unless attribute && group && form && cascading_namespace_settings_enabled? +- return if group.namespace_settings.public_send("#{attribute}_locked?") + +- lock_attribute = "lock_#{attribute}" + +.gl-form-checkbox.custom-control.custom-checkbox + = form.check_box lock_attribute, checked: group.namespace_settings.public_send(lock_attribute), class: 'custom-control-input', data: { testid: 'enforce-for-all-subgroups-checkbox' } + = form.label lock_attribute, class: 'custom-control-label' do + %span= s_('CascadingSettings|Enforce for all subgroups') + %p.help-text= s_('CascadingSettings|Subgroups cannot change this setting.') diff --git a/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml b/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml new file mode 100644 index 00000000000..91458bf180b --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml @@ -0,0 +1 @@ +.js-cascading-settings-lock-popovers diff --git a/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml b/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml new file mode 100644 index 00000000000..6596ce2bc73 --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml @@ -0,0 +1,21 @@ +- attribute = local_assigns.fetch(:attribute, nil) +- group = local_assigns.fetch(:group, nil) +- form = local_assigns.fetch(:form, nil) +- settings_path_helper = local_assigns.fetch(:settings_path_helper, nil) +- help_text = local_assigns.fetch(:help_text, nil) + +- return unless attribute && group && form && settings_path_helper + +- setting_locked = group.namespace_settings.public_send("#{attribute}_locked?") + += form.label attribute, class: 'custom-control-label', aria: { disabled: setting_locked } do + %span.position-relative.gl-pr-6.gl-display-inline-flex + = yield + - if setting_locked + %button.position-absolute.gl-top-3.gl-right-0.gl-translate-y-n50.gl-cursor-default.btn.btn-default.btn-sm.gl-button.btn-default-tertiary.js-cascading-settings-lock-popover-target{ class: 'gl-p-1! gl-text-gray-600! gl-bg-transparent!', + type: 'button', + data: cascading_namespace_settings_popover_data(attribute, group, settings_path_helper) } + = sprite_icon('lock', size: 16) + - if help_text + %p.help-text + = help_text diff --git a/app/views/shared/nav/_scope_menu.html.haml b/app/views/shared/nav/_scope_menu.html.haml new file mode 100644 index 00000000000..270587f48a8 --- /dev/null +++ b/app/views/shared/nav/_scope_menu.html.haml @@ -0,0 +1,6 @@ +.context-header + = link_to scope_menu.link, **scope_menu.container_html_options do + .avatar-container.rect-avatar.s40.project-avatar + = source_icon(scope_menu.container, alt: scope_menu.title, class: 'avatar s40 avatar-tile', width: 40, height: 40) + .sidebar-context-title + = scope_menu.title diff --git a/app/views/shared/nav/_sidebar.html.haml b/app/views/shared/nav/_sidebar.html.haml new file mode 100644 index 00000000000..1c06fc9eebf --- /dev/null +++ b/app/views/shared/nav/_sidebar.html.haml @@ -0,0 +1,14 @@ +%aside.nav-sidebar{ class: ('sidebar-collapsed-desktop' if collapsed_sidebar?), **sidebar_tracking_attributes_by_object(sidebar.container), 'aria-label': sidebar.aria_label } + .nav-sidebar-inner-scroll + - if sidebar.scope_menu + = render partial: 'shared/nav/scope_menu', object: sidebar.scope_menu + - elsif sidebar.render_raw_scope_menu_partial + = render sidebar.render_raw_scope_menu_partial + + %ul.sidebar-top-level-items.qa-project-sidebar + - if sidebar.renderable_menus.any? + = render partial: 'shared/nav/sidebar_menu', collection: sidebar.renderable_menus + - if sidebar.render_raw_menus_partial + = render sidebar.render_raw_menus_partial + + = render 'shared/sidebar_toggle_button' diff --git a/app/views/shared/nav/_sidebar_menu.html.haml b/app/views/shared/nav/_sidebar_menu.html.haml new file mode 100644 index 00000000000..c6e86a90ba7 --- /dev/null +++ b/app/views/shared/nav/_sidebar_menu.html.haml @@ -0,0 +1,27 @@ += nav_link(**sidebar_menu.all_active_routes, html_options: sidebar_menu.nav_link_html_options) do + = link_to sidebar_menu.link, **sidebar_menu.container_html_options, data: { qa_selector: 'sidebar_menu_link', qa_menu_item: sidebar_menu.title } do + - if sidebar_menu.icon_or_image? + .nav-icon-container + - if sidebar_menu.image_path + = image_tag(sidebar_menu.image_path, **sidebar_menu.image_html_options) + - elsif sidebar_menu.sprite_icon + = sprite_icon(sidebar_menu.sprite_icon, **sidebar_menu.sprite_icon_html_options) + + %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 } + = number_with_delimiter(sidebar_menu.pill_count) + + %ul.sidebar-sub-level-items{ class: ('is-fly-out-only' unless sidebar_menu.has_items?) } + = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' } ) do + = link_to sidebar_menu.link, aria: { label: sidebar_menu.title } do + %strong.fly-out-top-item-name + = sidebar_menu.title + - if sidebar_menu.has_pill? + %span.badge.badge-pill.count.fly-out-badge{ **sidebar_menu.pill_html_options } + = number_with_delimiter(sidebar_menu.pill_count) + + - if sidebar_menu.has_renderable_items? + %li.divider.fly-out-top-item + = render partial: 'shared/nav/sidebar_menu_item', collection: sidebar_menu.renderable_items diff --git a/app/views/shared/nav/_sidebar_menu_item.html.haml b/app/views/shared/nav/_sidebar_menu_item.html.haml new file mode 100644 index 00000000000..0b0e4c7aec9 --- /dev/null +++ b/app/views/shared/nav/_sidebar_menu_item.html.haml @@ -0,0 +1,8 @@ += nav_link(**sidebar_menu_item.active_routes) do + = link_to sidebar_menu_item.link, **sidebar_menu_item.container_html_options, data: { qa_selector: 'sidebar_menu_item_link', qa_menu_item: sidebar_menu_item.title } do + %span + = sidebar_menu_item.title + - if sidebar_menu_item.sprite_icon + = sprite_icon(sidebar_menu_item.sprite_icon, **sidebar_menu_item.sprite_icon_html_options) + - if sidebar_menu_item.show_hint? + .js-feature-highlight{ **sidebar_menu_item.hint_html_options } diff --git a/app/views/shared/notes/_comment_button.html.haml b/app/views/shared/notes/_comment_button.html.haml index 4f1aa3a7b01..1129fed9c3b 100644 --- a/app/views/shared/notes/_comment_button.html.haml +++ b/app/views/shared/notes/_comment_button.html.haml @@ -1,15 +1,15 @@ - noteable_name = @note.noteable.human_class_name .float-left.btn-group.gl-mr-3.droplab-dropdown.comment-type-dropdown.js-comment-type-dropdown - %input.btn.gl-button.btn-success.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } } + %input.btn.gl-button.btn-confirm.js-comment-button.js-comment-submit-button{ type: 'submit', value: _('Comment'), data: { qa_selector: 'comment_button' } } - if @note.can_be_discussion_note? - = button_tag type: 'button', class: 'gl-button btn dropdown-toggle btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do + = button_tag type: 'button', class: 'gl-button btn dropdown-toggle btn-confirm js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do = sprite_icon('chevron-down') %ul#resolvable-comment-menu.dropdown-menu.dropdown-open-top{ data: { dropdown: true } } %li#comment.droplab-item-selected{ data: { value: '', 'submit-text' => _('Comment'), 'close-text' => _("Comment & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Comment & reopen %{noteable_name}") % { noteable_name: noteable_name } } } - %button.btn.gl-button.btn-transparent + %button.btn.gl-button.btn-default-tertiary = sprite_icon('check', css_class: 'icon') .description %strong= _("Comment") @@ -19,7 +19,7 @@ %li.divider.droplab-item-ignore %li#discussion{ data: { value: 'DiscussionNote', 'submit-text' => _('Start thread'), 'close-text' => _("Start thread & close %{noteable_name}") % { noteable_name: noteable_name }, 'reopen-text' => _("Start thread & reopen %{noteable_name}") % { noteable_name: noteable_name } } } - %button.btn.gl-button.btn-transparent + %button.btn.gl-button.btn-default-tertiary = sprite_icon('check', css_class: 'icon') .description %strong= _("Start thread") diff --git a/app/views/shared/notes/_note.html.haml b/app/views/shared/notes/_note.html.haml index f1352be28e3..6549c86ab29 100644 --- a/app/views/shared/notes/_note.html.haml +++ b/app/views/shared/notes/_note.html.haml @@ -69,7 +69,7 @@ .note-attachment - if note.attachment.image? = link_to note.attachment.url, target: '_blank' do - = image_tag note.attachment.url, class: 'note-image-attach' + = image_tag note.attachment.url, class: 'note-image-attach col-lg-4' .attachment = link_to note.attachment.url, target: '_blank' do = sprite_icon('paperclip') diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index a33cd7c3b53..7466f360f67 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -24,7 +24,7 @@ .avatar-container.s48.flex-grow-0.flex-shrink-0{ class: avatar_container_class } = link_to project_path(project), class: dom_class(project) do - if project.creator && use_creator_avatar - = image_tag avatar_icon_for_user(project.creator, 48), class: "avatar s48", alt:'' + = image_tag avatar_icon_for_user(project.creator, 48), class: "avatar s48", alt: '' - else = project_icon(project, alt: '', class: 'avatar project-avatar s48', width: 48, height: 48) .project-details.d-sm-flex.flex-sm-fill.align-items-center{ data: { qa_selector: 'project_content', qa_project_name: project.name } } @@ -90,7 +90,7 @@ - if show_merge_request_count?(disabled: !merge_requests, compact_mode: compact_mode) = link_to project_merge_requests_path(project), class: "d-none d-xl-flex align-items-center icon-wrapper merge-requests has-tooltip", - title: _('Merge Requests'), data: { container: 'body', placement: 'top' } do + title: _('Merge requests'), data: { container: 'body', placement: 'top' } do = sprite_icon('git-merge', size: 14, css_class: 'gl-mr-2') = number_with_delimiter(project.open_merge_requests_count) - if show_issue_count?(disabled: !issues, compact_mode: compact_mode) diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml index 6c3a6ce809f..8ec11d9cfbb 100644 --- a/app/views/shared/projects/_search_bar.html.haml +++ b/app/views/shared/projects/_search_bar.html.haml @@ -3,7 +3,7 @@ - flex_grow_and_shrink_xs = 'd-flex flex-xs-grow-1 flex-xs-shrink-1 flex-grow-0 flex-shrink-0' .filtered-search-block.row-content-block.bt-0 - .filtered-search-wrapper.d-flex.flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap + .filtered-search-wrapper.d-flex.gl-flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap - unless project_tab_filter == :starred .filtered-search-nav.mb-2.mb-lg-0{ class: flex_grow_and_shrink_xs } = render 'dashboard/projects/nav', project_tab_filter: project_tab_filter diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml index 3e810dc6f08..f3aeaacbdb1 100644 --- a/app/views/shared/projects/_sort_dropdown.html.haml +++ b/app/views/shared/projects/_sort_dropdown.html.haml @@ -3,7 +3,7 @@ .btn-group.w-100{ role: "group" } .btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" } - %button#sort-projects-dropdown.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } + %button#sort-projects-dropdown.gl-button.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } = toggle_text = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml index 75d6d88fbc3..6a362866f41 100644 --- a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml +++ b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml @@ -33,6 +33,6 @@ %p.small = _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence } -- if ::Feature.enabled?(:allow_force_push_to_protected_branches, @project) +- if ::Feature.enabled?(:allow_force_push_to_protected_branches, @project, default_enabled: :yaml) %td = render "shared/buttons/project_feature_toggle", is_checked: protected_branch.allow_force_push, label: s_("ProtectedBranch|Toggle allow force push"), class_list: "js-force-push-toggle project-feature-toggle", data: { qa_selector: 'force_push_toggle_button', qa_branch_name: protected_branch.name } diff --git a/app/views/shared/promotions/_promote_servicedesk.html.haml b/app/views/shared/promotions/_promote_servicedesk.html.haml index 3a5123acdeb..a2da23de2b9 100644 --- a/app/views/shared/promotions/_promote_servicedesk.html.haml +++ b/app/views/shared/promotions/_promote_servicedesk.html.haml @@ -1,6 +1,6 @@ .user-callout.promotion-callout.js-service-desk-callout#promote_service_desk{ data: { uid: 'promote_service_desk_dismissed' } } .bordered-box.content-block - %button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Service Desk promotion' } + %button.gl-button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss Service Desk promotion' } = sprite_icon('close', size: 16, css_class: 'dismiss-icon') .svg-container = custom_icon('icon_service_desk') diff --git a/app/views/shared/runners/_form.html.haml b/app/views/shared/runners/_form.html.haml index bb2aa93740e..8d0069a7664 100644 --- a/app/views/shared/runners/_form.html.haml +++ b/app/views/shared/runners/_form.html.haml @@ -59,4 +59,4 @@ .col-sm-10 = f.text_field :private_projects_minutes_cost_factor, class: 'form-control' .form-actions - = f.submit _('Save changes'), class: 'btn btn-success' + = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' diff --git a/app/views/shared/runners/_runner_type_alert.html.haml b/app/views/shared/runners/_runner_type_alert.html.haml new file mode 100644 index 00000000000..b83def8b802 --- /dev/null +++ b/app/views/shared/runners/_runner_type_alert.html.haml @@ -0,0 +1,20 @@ +.gl-alert.gl-alert-info.gl-my-5 + = sprite_icon('information-o', css_class: 'gl-alert-icon') + - if runner.instance_type? + %h4.gl-alert-title + = s_('Runners|This runner is available to all groups and projects in your GitLab instance.') + .gl-alert-body + = s_('Runners|Shared runners are available to every project in a GitLab instance. If you want a runner to build only specific projects, restrict the project in the table below. After you restrict a runner to a project, you cannot change it back to a shared runner.') + = link_to _('Learn more.'), help_page_path('ci/runners/README', anchor: 'shared-runners'), target: '_blank', rel: 'noopener noreferrer' + - elsif runner.group_type? + %h4.gl-alert-title + = s_('Runners|This runner is available to all projects and subgroups in a group.') + .gl-alert-body + = s_('Runners|Use Group runners when you want all projects in a group to have access to a set of runners.') + = link_to _('Learn more.'), help_page_path('ci/runners/README', anchor: 'group-runners'), target: '_blank', rel: 'noopener noreferrer' + - else + %h4.gl-alert-title + = s_('Runners|This runner is associated with specific projects.') + .gl-alert-body + = s_('Runners|You can set up a specific runner to be used by multiple projects but you cannot make this a shared runner.') + = link_to _('Learn more.'), help_page_path('ci/runners/README', anchor: 'specific-runners'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/runners/_runner_type_badge.html.haml b/app/views/shared/runners/_runner_type_badge.html.haml new file mode 100644 index 00000000000..e0318006f09 --- /dev/null +++ b/app/views/shared/runners/_runner_type_badge.html.haml @@ -0,0 +1,10 @@ + +- if runner.instance_type? + %span.badge.badge-pill.gl-badge.badge-success + = s_('Runners|shared') +- elsif runner.group_type? + %span.badge.badge-pill.gl-badge.badge-success + = s_('Runners|group') +- else + %span.badge.badge-pill.gl-badge.badge-info + = s_('Runners|specific') diff --git a/app/views/shared/runners/show.html.haml b/app/views/shared/runners/show.html.haml index 1af04b808bf..757ec870f79 100644 --- a/app/views/shared/runners/show.html.haml +++ b/app/views/shared/runners/show.html.haml @@ -1,17 +1,8 @@ - page_title "#{@runner.description} ##{@runner.id}", _("Runners") -%h3.page-title - = s_('Runners|Runner #%{id}' % { id: @runner.id }) - .float-right - - if @runner.instance_type? - %span.runner-state.runner-state-shared - = s_('Runners|Shared') - - elsif @runner.group_type? - %span.runner-state.runner-state-shared - = s_('Runners|Group') - - else - %span.runner-state.runner-state-specific - = s_('Runners|Specific') +%h2.page-title + = s_('Runners|Runner #%{runner_id}' % { runner_id: @runner.id }) + = render 'shared/runners/runner_type_badge', runner: @runner .table-holder %table.table diff --git a/app/views/shared/tokens/_scopes_form.html.haml b/app/views/shared/tokens/_scopes_form.html.haml index 82e32597c94..1c8e300fa8a 100644 --- a/app/views/shared/tokens/_scopes_form.html.haml +++ b/app/views/shared/tokens/_scopes_form.html.haml @@ -5,5 +5,5 @@ - scopes.each do |scope| %fieldset.form-group.form-check = check_box_tag "#{prefix}[scopes][]", scope, token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}", class: "form-check-input qa-#{scope}-radio" - = label_tag ("#{prefix}_scopes_#{scope}"), scope, class: 'label-bold form-check-label' + = label_tag "#{prefix}_scopes_#{scope}", scope, class: 'label-bold form-check-label' .text-secondary= t scope, scope: scope_description(prefix) diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml index 5437748a57e..abe23d0be78 100644 --- a/app/views/shared/web_hooks/_hook.html.haml +++ b/app/views/shared/web_hooks/_hook.html.haml @@ -11,6 +11,6 @@ = hook.enable_ssl_verification ? _('enabled') : _('disabled') .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 gl-mr-3' - %span>= link_to _('Edit'), edit_hook_path(hook), class: 'gl-button btn btn-sm gl-mr-3' - = link_to _('Delete'), destroy_hook_path(hook), data: { confirm: _('Are you sure?') }, method: :delete, class: 'gl-button btn btn-sm' + %span>= render 'shared/web_hooks/test_button', hook: hook, button_class: 'btn-sm btn-default gl-mr-3' + %span>= link_to _('Edit'), edit_hook_path(hook), class: 'btn gl-button btn-default btn-sm gl-mr-3' + = link_to _('Delete'), destroy_hook_path(hook), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn gl-button btn-default btn-sm' diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml index a683f75c779..3ffa45f01be 100644 --- a/app/views/shared/web_hooks/_test_button.html.haml +++ b/app/views/shared/web_hooks/_test_button.html.haml @@ -2,11 +2,12 @@ - hook = local_assigns.fetch(:hook) - triggers = hook.class.triggers -.hook-test-button.dropdown.inline> +.hook-test-button.dropdown.gl-new-dropdown.inline> %button.btn.gl-button{ 'data-toggle' => 'dropdown', class: button_class } = _('Test') = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' } - - triggers.each_value do |event| - %li - = link_to_test_hook(hook, event) + .gl-new-dropdown-inner + - triggers.each_value do |event| + %li.gl-new-dropdown-item + = link_to_test_hook(hook, event) diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index d91e3c73c49..e121725b9af 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -1,79 +1,6 @@ -- form_classes = %w[wiki-form common-note-form gl-mt-3 js-quick-submit] +- page_info = { last_commit_sha: @page.last_commit_sha, persisted: @page.persisted?, title: @page.title, content: @page.content || '', format: @page.format.to_s, uploads_path: uploads_path, path: wiki_page_path(@wiki, @page), wiki_path: wiki_path(@wiki), help_path: help_page_path('user/project/wiki/index'), markdown_help_path: help_page_path('user/markdown'), markdown_preview_path: wiki_page_path(@wiki, @page, action: :preview_markdown), create_path: wiki_path(@wiki, action: :create) } -- if @page.persisted? - - form_action = wiki_page_path(@wiki, @page) - - form_method = :put -- else - - form_action = wiki_path(@wiki, action: :create) - - form_method = :post - - form_classes << 'js-new-wiki-page' - -= form_for @page, url: form_action, method: form_method, - html: { class: form_classes }, - data: { uploads_path: uploads_path } do |f| +.gl-mt-3 = form_errors(@page, truncate: :title) - - if @page.persisted? - = f.hidden_field :last_commit_sha, value: @page.last_commit_sha - - .form-group.row - .col-sm-2.col-form-label= f.label :title, class: 'control-label-full-width' - .col-sm-10 - = f.text_field :title, class: 'form-control qa-wiki-title-textbox', value: @page.title, required: true, autofocus: !@page.persisted?, placeholder: s_('Wiki|Page title') - %span.gl-display-inline-block.gl-max-w-full.gl-mt-2.gl-text-gray-600 - = sprite_icon('bulb', size: 12, css_class: 'gl-mr-n1') - - if @page.persisted? - = s_("WikiEditPageTip|Tip: You can move this page by adding the path to the beginning of the title.") - = link_to sprite_icon('question-o'), help_page_path('user/project/wiki/index', anchor: 'moving-a-wiki-page'), - target: '_blank', rel: 'noopener noreferrer' - - else - = s_("WikiNewPageTip|Tip: You can specify the full path for the new file. We will automatically create any missing directories.") - = succeed '.' do - = link_to _('More information'), help_page_path('user/project/wiki/index', anchor: 'creating-a-new-wiki-page'), - target: '_blank', rel: 'noopener noreferrer' - .form-group.row - .col-sm-2.col-form-label= f.label :format, class: 'control-label-full-width' - .col-sm-10 - .select-wrapper - = f.select :format, options_for_select(Wiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control' - = sprite_icon('chevron-down', css_class: 'gl-absolute gl-top-3 gl-right-3 gl-text-gray-200') - - .form-group.row - .col-sm-2.col-form-label= f.label :content, class: 'control-label-full-width' - .col-sm-10 - = render layout: 'shared/md_preview', locals: { url: wiki_page_path(@wiki, @page, action: :preview_markdown) } do - = render 'shared/zen', f: f, attr: :content, classes: 'note-textarea qa-wiki-content-textarea', placeholder: s_("WikiPage|Write your content or drag files hereā¦"), autofocus: @page.persisted? - = render 'shared/notes/hints' - - .clearfix - .error-alert - - .form-text.gl-text-gray-600 - = succeed '.' do - - case @page.format.to_s - - when 'rdoc' - - link_example = '{Link title}[link:page-slug]' - - when 'asciidoc' - - link_example = 'link:page-slug[Link title]' - - when 'org' - - link_example = '[[page-slug]]' - - else - - link_example = '[Link Title](page-slug)' - = html_escape(s_('WikiMarkdownTip|To link to a (new) page, simply type %{link_example}')) % { link_example: tag.code(link_example, class: 'js-markup-link-example') } - = succeed '.' do - - markdown_link = link_to s_("WikiMarkdownDocs|documentation"), help_page_path('user/markdown', anchor: 'wiki-specific-markdown') - = (s_("WikiMarkdownDocs|More examples are in the %{docs_link}") % { docs_link: markdown_link }).html_safe - - .form-group.row - .col-sm-2.col-form-label= f.label :commit_message, class: 'control-label-full-width' - .col-sm-10= f.text_field :message, class: 'form-control qa-wiki-message-textbox', rows: 18, value: nil - - .form-actions - - if @page && @page.persisted? - = f.submit _("Save changes"), class: 'btn gl-button btn-confirm qa-save-changes-button js-wiki-btn-submit', disabled: 'true' - .float-right - = link_to _("Cancel"), wiki_page_path(@wiki, @page), class: 'btn gl-button btn-cancel btn-default' - - else - = f.submit s_("Wiki|Create page"), class: 'btn-confirm gl-button btn qa-create-page-button rspec-create-page-button js-wiki-btn-submit', disabled: 'true' - .float-right - = link_to _("Cancel"), wiki_path(@wiki), class: 'btn gl-button btn-cancel btn-default' +#js-wiki-form{ data: { page_info: page_info.to_json, format_options: Wiki::MARKUPS.to_json } } diff --git a/app/views/shared/wikis/history.html.haml b/app/views/shared/wikis/history.html.haml index b1dcd2cd400..079b9768730 100644 --- a/app/views/shared/wikis/history.html.haml +++ b/app/views/shared/wikis/history.html.haml @@ -28,7 +28,7 @@ %td = commit.author_name %td - %span.str-truncated-60 + .commit-content = link_to wiki_page_path(@wiki, @page, action: :diff, version_id: commit.id), { title: commit.message } do = commit.message %td diff --git a/app/views/shared/wikis/pages.html.haml b/app/views/shared/wikis/pages.html.haml index f5ba1c83de4..1889b6501c9 100644 --- a/app/views/shared/wikis/pages.html.haml +++ b/app/views/shared/wikis/pages.html.haml @@ -5,8 +5,6 @@ - add_page_specific_style 'page_bundles/wiki' .wiki-page-header.top-area.flex-column.flex-lg-row - - %h3.page-title.gl-flex-fill-1 = s_("Wiki|Wiki Pages") |