From 43a25d93ebdabea52f99b05e15b06250cd8f07d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 16:05:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-0-stable-ee --- app/views/shared/_auto_devops_callout.html.haml | 2 +- app/views/shared/_broadcast_message.html.haml | 4 + app/views/shared/_captcha_check.html.haml | 4 +- .../shared/_commit_message_container.html.haml | 25 +++-- app/views/shared/_file_highlight.html.haml | 10 +- app/views/shared/_file_picker_button.html.haml | 5 +- app/views/shared/_issues.html.haml | 8 -- app/views/shared/_label.html.haml | 101 +++++++++++---------- app/views/shared/_label_full_path.html.haml | 6 +- app/views/shared/_label_row.html.haml | 35 ++++--- app/views/shared/_md_preview.html.haml | 21 ++--- app/views/shared/_mobile_clone_panel.html.haml | 4 +- app/views/shared/_model_version_conflict.html.haml | 6 ++ app/views/shared/_new_commit_form.html.haml | 11 +-- app/views/shared/_ref_switcher.html.haml | 22 ----- .../shared/_remote_mirror_update_button.html.haml | 2 +- app/views/shared/_zen.html.haml | 1 + app/views/shared/blob/_markdown_buttons.html.haml | 70 +++++++------- app/views/shared/boards/_show.html.haml | 2 +- .../shared/dashboard/_no_filter_selected.html.haml | 8 -- app/views/shared/deploy_keys/_form.html.haml | 5 + .../deploy_keys/_project_group_form.html.haml | 4 + .../shared/doorkeeper/applications/_form.html.haml | 2 +- .../doorkeeper/applications/_index.html.haml | 2 +- .../shared/doorkeeper/applications/_show.html.haml | 15 ++- app/views/shared/empty_states/_issues.html.haml | 3 +- app/views/shared/empty_states/_labels.html.haml | 4 +- .../shared/empty_states/_merge_requests.html.haml | 4 +- .../shared/empty_states/_priority_labels.html.haml | 10 +- app/views/shared/empty_states/_snippets.html.haml | 4 +- app/views/shared/empty_states/_topics.html.haml | 4 +- app/views/shared/empty_states/_wikis.html.haml | 3 +- .../shared/form_elements/_description.html.haml | 24 ++--- app/views/shared/groups/_list.html.haml | 2 +- app/views/shared/hook_logs/_index.html.haml | 2 +- app/views/shared/icons/_mr_widget_empty_state.svg | 1 - ...slack_notifications_deprecation_alert.html.haml | 20 ++++ app/views/shared/integrations/edit.html.haml | 1 - app/views/shared/integrations/overrides.html.haml | 1 - .../prometheus/_custom_metrics.html.haml | 10 +- .../integrations/prometheus/_metrics.html.haml | 18 ++-- app/views/shared/issuable/_feed_buttons.html.haml | 12 ++- app/views/shared/issuable/_form.html.haml | 14 +-- .../shared/issuable/_label_dropdown.html.haml | 2 +- .../shared/issuable/_label_page_create.html.haml | 6 +- app/views/shared/issuable/_search_bar.html.haml | 11 ++- app/views/shared/issuable/_sidebar.html.haml | 35 +++---- .../issuable/_sidebar_user_dropdown.html.haml | 4 +- .../issuable/form/_default_templates.html.haml | 2 +- .../shared/issuable/form/_merge_params.html.haml | 29 +++--- app/views/shared/issuable/form/_metadata.html.haml | 15 +-- app/views/shared/issuable/form/_title.html.haml | 4 - .../shared/issuable/form/_type_selector.html.haml | 26 +----- .../shared/issue_type/_details_content.html.haml | 8 +- .../shared/issue_type/_details_header.html.haml | 4 +- app/views/shared/labels/_form.html.haml | 10 +- .../shared/milestones/_delete_button.html.haml | 8 +- app/views/shared/milestones/_description.html.haml | 4 +- app/views/shared/milestones/_form_dates.html.haml | 21 +++-- app/views/shared/milestones/_header.html.haml | 73 ++++++++++----- app/views/shared/milestones/_sidebar.html.haml | 2 +- app/views/shared/nav/_admin_scope_header.html.haml | 6 ++ .../shared/nav/_explore_scope_header.html.haml | 6 ++ .../nav/_user_settings_scope_header.html.haml | 4 + app/views/shared/notes/_edit_form.html.haml | 3 +- app/views/shared/notes/_hints.html.haml | 6 +- app/views/shared/notes/_note.html.haml | 2 +- app/views/shared/projects/_list.html.haml | 7 +- app/views/shared/projects/_project.html.haml | 23 +++-- app/views/shared/projects/_search_form.html.haml | 2 +- app/views/shared/projects/_topics.html.haml | 52 +++++------ app/views/shared/runners/_runner_details.html.haml | 5 +- app/views/shared/topics/_topic.html.haml | 5 +- app/views/shared/users/index.html.haml | 4 +- .../web_hooks/_web_hook_disabled_alert.html.haml | 2 +- .../shared/wikis/_sidebar_wiki_page.html.haml | 8 +- app/views/shared/wikis/_wiki_directory.html.haml | 10 +- app/views/shared/wikis/diff.html.haml | 2 +- app/views/shared/wikis/empty.html.haml | 10 +- 79 files changed, 484 insertions(+), 449 deletions(-) delete mode 100644 app/views/shared/_issues.html.haml create mode 100644 app/views/shared/_model_version_conflict.html.haml delete mode 100644 app/views/shared/_ref_switcher.html.haml delete mode 100644 app/views/shared/dashboard/_no_filter_selected.html.haml delete mode 100644 app/views/shared/icons/_mr_widget_empty_state.svg create mode 100644 app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml create mode 100644 app/views/shared/nav/_admin_scope_header.html.haml create mode 100644 app/views/shared/nav/_explore_scope_header.html.haml create mode 100644 app/views/shared/nav/_user_settings_scope_header.html.haml (limited to 'app/views/shared') diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index 93f919f01d9..c468b3a2001 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -1,4 +1,4 @@ -- container = @no_breadcrumb_container ? 'container-fluid' : container_class +- container = @no_top_bar_container ? 'container-fluid' : container_class %div{ class: [container, @content_class, 'gl-pt-5!'] } = render Pajamas::BannerComponent.new(button_text: s_('AutoDevOps|Enable in settings'), diff --git a/app/views/shared/_broadcast_message.html.haml b/app/views/shared/_broadcast_message.html.haml index 4d286713cef..a2fed883739 100644 --- a/app/views/shared/_broadcast_message.html.haml +++ b/app/views/shared/_broadcast_message.html.haml @@ -9,6 +9,8 @@ = sprite_icon(icon_name) .gl-broadcast-message-text.js-broadcast-message-preview - if message.message.present? + %h2.gl-sr-only + = s_("Admin message") = render_broadcast_message(message) - else = yield @@ -24,6 +26,8 @@ .broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class, data: { qa_selector: 'broadcast_notification_container' } } = sprite_icon(icon_name, css_class: 'vertical-align-text-top') - if message.message.present? + %h2.gl-sr-only + = s_("Admin message") = render_broadcast_message(message) - else = yield diff --git a/app/views/shared/_captcha_check.html.haml b/app/views/shared/_captcha_check.html.haml index a10ae655ea6..b3b2ae0d969 100644 --- a/app/views/shared/_captcha_check.html.haml +++ b/app/views/shared/_captcha_check.html.haml @@ -10,7 +10,7 @@ %p = _("We detected potential spam in the %{humanized_resource_name}. Please solve the reCAPTCHA to proceed.") % { humanized_resource_name: humanized_resource_name } -= form_for resource_name, method: method, html: { class: 'recaptcha-form js-recaptcha-form' } do |f| += gitlab_ui_form_for resource_name, method: method, html: { class: 'recaptcha-form js-recaptcha-form' } do |f| .recaptcha -# Create a hidden field for each param of the resource - params[resource_name].each do |field, value| @@ -34,4 +34,4 @@ = yield .row-content-block.footer-block - = f.submit _("Create %{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 }, pajamas_button: true diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml index 904854c3fb7..2b55d35cf1f 100644 --- a/app/views/shared/_commit_message_container.html.haml +++ b/app/views/shared/_commit_message_container.html.haml @@ -1,19 +1,18 @@ -.form-group.row.commit_message-group +.form-group.commit_message-group.gl-mt-5 - nonce = SecureRandom.hex - descriptions = local_assigns.slice(:message_with_description, :message_without_description) - = label_tag "commit_message-#{nonce}", class: 'col-form-label col-sm-2' do + = label_tag "commit_message-#{nonce}" do #{ _('Commit message') } - .col-sm-10 - .commit-message-container - .max-width-marker - = text_area_tag 'commit_message', - (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder]), - class: 'form-control gl-form-input js-commit-message', - placeholder: local_assigns[:placeholder], - data: descriptions, - 'data-qa-selector': 'commit_message_field', - required: true, rows: (local_assigns[:rows] || 3), - id: "commit_message-#{nonce}" + .commit-message-container + .max-width-marker + = text_area_tag 'commit_message', + (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder]), + class: 'form-control gl-form-input js-commit-message', + placeholder: local_assigns[:placeholder], + data: descriptions, + 'data-qa-selector': 'commit_message_field', + required: true, rows: (local_assigns[:rows] || 3), + id: "commit_message-#{nonce}" - if local_assigns[:hint] %p.hint = _('Try to keep the first line under 52 characters and the others under 72.') diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index a749d1037a1..9dfbad20726 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -2,14 +2,8 @@ - offset = defined?(first_line_number) ? first_line_number : 1 - highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil -- file_line_blame = Feature.enabled?(:file_line_blame) - -- if file_line_blame - - line_class = "js-line-links" - - blame_path = project_blame_path(@project, tree_join(@ref, blob.path)) -- else - - line_class = nil - - blame_path = nil +- line_class = "js-line-links" +- blame_path = project_blame_path(@project, tree_join(@ref, blob.path)) - highlighted_blob = blob.present.highlight diff --git a/app/views/shared/_file_picker_button.html.haml b/app/views/shared/_file_picker_button.html.haml index 8d76e9c1b7d..beb564f7c7c 100644 --- a/app/views/shared/_file_picker_button.html.haml +++ b/app/views/shared/_file_picker_button.html.haml @@ -1,9 +1,10 @@ - classes = local_assigns.fetch(:classes, '') +- mime_types = local_assigns.fetch(:mime_types, '') %span.js-filepicker = render Pajamas::ButtonComponent.new(button_options: { class: "js-filepicker-button #{classes}" }) do = _("Choose file…") - %span.file_name.js-filepicker-filename= _("No file chosen.") - = f.file_field field, class: "js-filepicker-input hidden" + %span.file_name.gl-ml-3.js-filepicker-filename= _("No file chosen.") + = f.file_field field, class: "js-filepicker-input hidden", accept: mime_types - if help_text.present? .form-text.text-muted= help_text diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml deleted file mode 100644 index 360a3f3eb89..00000000000 --- a/app/views/shared/_issues.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -= render 'shared/alerts/positioning_disabled' if @sort == 'relative_position' - -- if @issues.to_a.any? - %ul.content-list.issues-list.issuable-list{ class: issue_manual_ordering_class } - = render partial: 'projects/issues/issue', collection: @issues - = paginate @issues, theme: "gitlab" -- else - = render 'shared/empty_states/issues' diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 8a626f1620b..1aac7af443f 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -6,56 +6,59 @@ - toggle_subscription_path = toggle_subscription_label_path(label, @project) if current_user - tooltip_title = label_status_tooltip(label, status) if status -%li.label-list-item{ id: label_css_id, class: "gl-p-5 gl-border-b", data: { id: label.id } } - = render "shared/label_row", label: label, force_priority: force_priority - %ul.label-actions-list - - if can?(current_user, :admin_label, @project) - %li.gl-display-inline-block.js-toggle-priority.gl-ml-3{ data: { url: remove_priority_project_label_path(@project, label), - dom_id: dom_id(label), type: label.type } } - = render Pajamas::ButtonComponent.new(category: :tertiary, - icon: 'star', - button_options: { class: 'remove-priority has-tooltip', 'title': _('Remove priority'), 'aria_label': _('Deprioritize label'), data: { placement: 'bottom' } }) - = render Pajamas::ButtonComponent.new(category: :tertiary, - icon: 'star-o', - button_options: { class: 'add-priority has-tooltip', title: _('Prioritize'), aria_label: _('Prioritize label'), data: { placement: 'bottom' } }) - - if can?(current_user, :admin_label, label) - %li.gl-display-inline-block - = render Pajamas::ButtonComponent.new(href: label.edit_path, category: :tertiary, icon: 'pencil', button_options: { class: 'edit has-tooltip', 'title': _('Edit'), 'aria_label': _('Edit'), data: { placement: 'bottom' } }) - - if can?(current_user, :admin_label, label) - %li.gl-display-inline-block - .dropdown +%li.label-list-item.gl-list-style-none.gl-py-3{ id: label_css_id, data: { id: label.id } } + .label-content.gl-px-3.gl-py-2.gl-rounded-base{ class: "#{ 'gl-py-3' if force_priority }" } + = render "shared/label_row", label: label, force_priority: force_priority + %ul.label-actions-list + - if can?(current_user, :admin_label, @project) + %li.gl-display-inline-block.js-toggle-priority.gl-ml-3{ data: { url: remove_priority_project_label_path(@project, label), + dom_id: dom_id(label), type: label.type } } = render Pajamas::ButtonComponent.new(category: :tertiary, - icon: 'ellipsis_v', - button_options: { class: 'js-label-options-dropdown', 'aria_label': _('Label actions dropdown'), data: { toggle: 'dropdown' } }) - .dropdown-menu.dropdown-open-left - %ul - - if label.project_label? && label.project.group && can?(current_user, :admin_label, label.project.group) - %li - = render Pajamas::ButtonComponent.new(category: :tertiary, - button_options: { class: 'js-promote-project-label-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 } }) do - = _('Promote to group label') - %li - %span - = render Pajamas::ButtonComponent.new(category: :tertiary, - button_options: { class: 'text-danger js-delete-label-modal-button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } }) do - = _('Delete') - - if current_user - %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3 - - if label.can_subscribe_to_label_in_different_levels? - = render Pajamas::ButtonComponent.new(button_options: { class: "js-unsubscribe-button #{'hidden' if status.unsubscribed?}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do - = _('Unsubscribe') - .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } - = render Pajamas::ButtonComponent.new(button_options: { class: 'gl-w-full', data: { toggle: 'dropdown' } }) do - = _('Subscribe') - = sprite_icon('chevron-down') - .dropdown-menu.dropdown-open-left + size: :small, + icon: 'star', + button_options: { class: 'remove-priority has-tooltip', 'title': _('Remove priority'), 'aria_label': _('Deprioritize label'), data: { placement: 'bottom' } }) + = render Pajamas::ButtonComponent.new(category: :tertiary, + size: :small, + icon: 'star-o', + button_options: { class: 'add-priority has-tooltip', title: _('Prioritize'), aria_label: _('Prioritize label'), data: { placement: 'bottom' } }) + - if current_user + %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3.gl-mt-1 + - if label.can_subscribe_to_label_in_different_levels? + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "js-unsubscribe-button gl-w-full #{'hidden' if status.unsubscribed?}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do + = _('Unsubscribe') + .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "gl-w-full", data: { toggle: 'dropdown' } }) do + = _('Subscribe') + = sprite_icon('chevron-down') + .dropdown-menu.dropdown-menu-right + %ul + %li + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } }) do + = _('Subscribe at project level') + %li + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } }) do + = _('Subscribe at group level') + - else + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'js-subscribe-button gl-w-full', data: { status: status, url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do + = label_subscription_toggle_button_text(label, @project) + - if can?(current_user, :admin_label, label) + %li.gl-display-inline-block + .dropdown + = render Pajamas::ButtonComponent.new(category: :tertiary, + size: :small, + icon: 'ellipsis_v', + button_options: { class: 'js-label-options-dropdown gl-ml-3', 'aria_label': _('Label actions dropdown'), title: _('Label actions dropdown'), data: { toggle: 'dropdown' } }) + .dropdown-menu.dropdown-menu-right %ul %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } }) do - = _('Subscribe at project level') + = render Pajamas::ButtonComponent.new(category: :tertiary, href: label.edit_path, variant: :link) do + = _('Edit') + - if label.project_label? && label.project.group && can?(current_user, :admin_label, label.project.group) + %li + = render Pajamas::ButtonComponent.new(category: :tertiary, variant: :link, + button_options: { class: 'js-promote-project-label-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 } }) do + = _('Promote to group label') %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } }) do - = _('Subscribe at group level') - - else - = render Pajamas::ButtonComponent.new(button_options: { class: 'js-subscribe-button gl-w-full', data: { status: status, url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do - = label_subscription_toggle_button_text(label, @project) + = render Pajamas::ButtonComponent.new(category: :tertiary, variant: :link, + button_options: { class: 'text-danger js-delete-label-modal-button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } }) do + = _('Delete') diff --git a/app/views/shared/_label_full_path.html.haml b/app/views/shared/_label_full_path.html.haml index fd67bbbbd10..b9e5e979ce5 100644 --- a/app/views/shared/_label_full_path.html.haml +++ b/app/views/shared/_label_full_path.html.haml @@ -1,4 +1,8 @@ - full_path = label.subject_full_name -.label-badge.gl-bg-gray-50.gl-max-w-full.gl-text-truncate{ title: full_path } +.gl-font-sm.gl-font-weight-semibold.gl-text-secondary + - if label.project_label? + = sprite_icon('project', size: 12, css_class: 'gl-text-gray-600') + - else + = sprite_icon('group', size: 12, css_class: 'gl-text-gray-600') = full_path diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml index c351ea29c7c..19489981d94 100644 --- a/app/views/shared/_label_row.html.haml +++ b/app/views/shared/_label_row.html.haml @@ -3,28 +3,25 @@ - show_label_issues_link = subject_or_group_defined && show_label_issuables_link?(label, :issues) - show_label_merge_requests_link = subject_or_group_defined && show_label_issuables_link?(label, :merge_requests) -.label-name.gl-flex-shrink-0.gl-mt-2.gl-mr-5 +.label-name.gl-flex-shrink-0.gl-mr-5 = render_label(label, tooltip: false) -.label-description.gl-overflow-hidden.gl-w-full - .gl-display-flex.gl-align-items-stretch.gl-flex-wrap.gl-mt-2 - .gl-flex-basis-half.gl-flex-grow-1.gl-overflow-hidden.gl-mr-5 + - if show_labels_full_path?(@project, @group) + .gl-mt-2 + = render 'shared/label_full_path', label: label +.label-description.gl-w-full + .gl-display-flex.gl-align-items-stretch.gl-flex-wrap + .gl-flex-basis-half.gl-flex-grow-1.gl-mr-5 - if label.description.present? - = markdown_field(label, :description) - - elsif show_labels_full_path?(@project, @group) - = render 'shared/label_full_path', label: label + .gl-my-1 + = markdown_field(label, :description) %ul.label-links.gl-m-0.gl-p-0.gl-white-space-nowrap + - if force_priority + %li.js-priority-badge.inline.gl-mr-3.gl-mt-1 + .label-badge.gl-bg-blue-50= _('Prioritized') - if show_label_issues_link - %li.inline - = link_to_label(label, css_class: 'gl-text-blue-600!') { _('Issues') } + %li.inline.gl-my-1 + = link_to_label(label, css_class: 'gl-mr-5') { _('Issues') } - if show_label_merge_requests_link - · - %li.inline - = link_to_label(label, type: :merge_request, css_class: 'gl-text-blue-600!') { _('Merge requests') } + %li.inline.gl-my-1 + = link_to_label(label, type: :merge_request) { _('Merge requests') } = render_if_exists 'shared/label_row_epics_link', label: label - - if force_priority - · - %li.js-priority-badge.inline.gl-ml-3 - .label-badge.gl-bg-blue-50= _('Prioritized label') - - if label.description.present? && show_labels_full_path?(@project, @group) - .gl-mt-3 - = render 'shared/label_full_path', label: label diff --git a/app/views/shared/_md_preview.html.haml b/app/views/shared/_md_preview.html.haml index 2fff70cdc74..dd3a31f5a59 100644 --- a/app/views/shared/_md_preview.html.haml +++ b/app/views/shared/_md_preview.html.haml @@ -8,21 +8,18 @@ = _('Only project members can comment.') .md-area.position-relative - .md-header - = gl_tabs_nav({ class: 'clearfix nav-links'}) do - %li.md-header-tab.active - %button.js-md-write-button{ class: 'gl-py-3!' } - = _("Write") - %li.md-header-tab - %button.js-md-preview-button{ class: 'gl-py-3!' } - = _("Preview") - - %li.md-header-toolbar.active.gl-py-2 - = render 'shared/blob/markdown_buttons', show_fullscreen_button: true + .md-header.gl-bg-gray-50.gl-px-2.gl-rounded-base.gl-mx-2.gl-mt-2 + .gl-display-flex.gl-align-items-center.gl-flex-wrap.gl-justify-content-space-between + .md-header-toolbar.gl-display-flex.gl-py-2.gl-flex-wrap + = render 'shared/blob/markdown_buttons' + .switch-preview.gl-py-2.gl-display-flex.gl-align-items-center.gl-ml-auto + = render Pajamas::ButtonComponent.new(category: :tertiary, size: :small, button_options: { class: 'js-md-preview-button', value: 'preview' }) do + = _('Preview') + = render Pajamas::ButtonComponent.new(icon: 'maximize', category: :tertiary, size: :small, button_options: { 'tabindex': -1, 'aria-label': _("Go full screen"), class: 'has-tooltip js-zen-enter gl-ml-2', data: { container: 'body' } }) .md-write-holder = yield - .md.md-preview-holder.js-md-preview.hide{ data: { url: url } } + .md.md-preview-holder.gl-px-5.js-md-preview.hide{ data: { url: url } } .referenced-commands.hide - if referenced_users diff --git a/app/views/shared/_mobile_clone_panel.html.haml b/app/views/shared/_mobile_clone_panel.html.haml index 8b7ef838d2b..aa3043b8fd6 100644 --- a/app/views/shared/_mobile_clone_panel.html.haml +++ b/app/views/shared/_mobile_clone_panel.html.haml @@ -9,8 +9,8 @@ %ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown{ data: { dropdown: true } } - if ssh_enabled? %li - = dropdown_item_with_description(ssh_copy_label, project.ssh_url_to_repo, href: project.ssh_url_to_repo, data: { clone_type: 'ssh' }, default: true) + = dropdown_item_with_description(ssh_copy_label, ssh_clone_url_to_repo(project), href: ssh_clone_url_to_repo(project), data: { clone_type: 'ssh' }, default: true) - if http_enabled? %li - = dropdown_item_with_description(http_copy_label, project.http_url_to_repo, href: project.http_url_to_repo, data: { clone_type: 'http' }) + = dropdown_item_with_description(http_copy_label, http_clone_url_to_repo(project), href: http_clone_url_to_repo(project), data: { clone_type: 'http' }) = render_if_exists 'shared/mobile_kerberos_clone' diff --git a/app/views/shared/_model_version_conflict.html.haml b/app/views/shared/_model_version_conflict.html.haml new file mode 100644 index 00000000000..134dcf8db7f --- /dev/null +++ b/app/views/shared/_model_version_conflict.html.haml @@ -0,0 +1,6 @@ += render Pajamas::AlertComponent.new(variant: :danger, + dismissible: false, + alert_options: { class: 'gl-mb-5' }) do |c| + = c.body do + - link_to_model = link_to(model_name, link_path, target: '_blank', rel: 'noopener noreferrer') + = _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs.").html_safe % { model_name: model_name, link_to_model: link_to_model } diff --git a/app/views/shared/_new_commit_form.html.haml b/app/views/shared/_new_commit_form.html.haml index 14ea96f9669..bdc7156242d 100644 --- a/app/views/shared/_new_commit_form.html.haml +++ b/app/views/shared/_new_commit_form.html.haml @@ -8,13 +8,12 @@ = hidden_field_tag 'branch_name', ref, class: 'js-branch-name' - else - if can?(current_user, :push_code, @project) - .form-group.row.branch - = label_tag 'branch_name', _('Target Branch'), class: 'col-form-label col-sm-2' - .col-sm-10 - = text_field_tag 'branch_name', branch_name, required: true, class: "form-control gl-form-input js-branch-name ref-name" + .form-group.branch + = label_tag 'branch_name', _('Target Branch') + = text_field_tag 'branch_name', branch_name, required: true, class: "form-control gl-form-input js-branch-name ref-name" - .js-create-merge-request-container - = render 'shared/new_merge_request_checkbox' + .js-create-merge-request-container + = render 'shared/new_merge_request_checkbox' - elsif project.can_current_user_push_to_branch?(branch_name) = hidden_field_tag 'branch_name', branch_name - else diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml deleted file mode 100644 index fa718a9c907..00000000000 --- a/app/views/shared/_ref_switcher.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- return unless @project - -- ref = local_assigns.fetch(:ref, @ref) -- form_path = local_assigns.fetch(:form_path, switch_project_refs_path(@project)) -- dropdown_toggle_text = ref || @project.default_branch -- field_name = local_assigns.fetch(:field_name, 'ref') - -= form_tag form_path, method: :get, class: "project-refs-form" do - - if defined?(destination) - = hidden_field_tag :destination, destination - - if defined?(path) - = hidden_field_tag :path, path - - @options && @options.each do |key, value| - = hidden_field_tag key, value, id: nil - .dropdown - = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: ref, ref_type: @ref_type, refs_url: refs_project_path(@project, sort: 'updated_desc'), field_name: field_name, submit_form_on_click: true, visit: true, qa_selector: "branches_dropdown", testid: "branches-select" }, { toggle_class: "js-project-refs-dropdown" } - .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown.dropdown-menu-paging{ class: ("dropdown-menu-right" if local_assigns[:align_right]), data: { qa_selector: "branches_dropdown_content" } } - .dropdown-page-one - = dropdown_title _("Switch branch/tag") - = dropdown_filter _("Search branches and tags") - = dropdown_content - = dropdown_loading diff --git a/app/views/shared/_remote_mirror_update_button.html.haml b/app/views/shared/_remote_mirror_update_button.html.haml index 770d335a88b..bc80ebe3950 100644 --- a/app/views/shared/_remote_mirror_update_button.html.haml +++ b/app/views/shared/_remote_mirror_update_button.html.haml @@ -1,6 +1,6 @@ - if remote_mirror.update_in_progress? = render Pajamas::ButtonComponent.new(icon: 'retry', - button_options: { class: 'disabled', title: _('Updating'), data: { toggle: 'tooltip', container: 'body', qa_selector: 'updating_button' } }, + button_options: { class: 'disabled', title: _('Updating'), data: { toggle: 'tooltip', container: 'body' } }, icon_classes: 'spin') - elsif remote_mirror.enabled? = link_to update_now_project_mirror_path(@project, sync_remote: true), method: :post, class: "btn btn-icon gl-button rspec-update-now-button", data: { toggle: 'tooltip', container: 'body', qa_selector: 'update_now_button' }, title: _('Update now') do diff --git a/app/views/shared/_zen.html.haml b/app/views/shared/_zen.html.haml index 5a4efe7fe7f..05bee9e4d42 100644 --- a/app/views/shared/_zen.html.haml +++ b/app/views/shared/_zen.html.haml @@ -4,6 +4,7 @@ - supports_quick_actions = local_assigns.fetch(:supports_quick_actions, false) - qa_selector = local_assigns.fetch(:qa_selector, '') - autofocus = local_assigns.fetch(:autofocus, false) + .zen-backdrop - classes << ' js-gfm-input js-autosize markdown-area' - if defined?(f) && f diff --git a/app/views/shared/blob/_markdown_buttons.html.haml b/app/views/shared/blob/_markdown_buttons.html.haml index db53d78dadb..a3d3c1c8231 100644 --- a/app/views/shared/blob/_markdown_buttons.html.haml +++ b/app/views/shared/blob/_markdown_buttons.html.haml @@ -1,42 +1,44 @@ - modifier_key = client_js_flags[:isMac] ? '⌘' : s_('KeyboardKey|Ctrl+') - supports_file_upload = local_assigns.fetch(:supports_file_upload, true) -.md-header-toolbar.active - = markdown_toolbar_button({ icon: "bold", - data: { "md-tag" => "**", "md-shortcuts": '["mod+b"]' }, - title: sprintf(s_("MarkdownEditor|Add bold text (%{modifier_key}B)") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "bold", + css_class: 'gl-mr-3', + data: { "md-tag" => "**", "md-shortcuts": '["mod+b"]' }, + title: sprintf(s_("MarkdownEditor|Add bold text (%{modifier_key}B)") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "italic", - data: { "md-tag" => "_", "md-shortcuts": '["mod+i"]' }, - title: sprintf(s_("MarkdownEditor|Add italic text (%{modifier_key}I)") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "italic", + css_class: 'gl-mr-3', + data: { "md-tag" => "_", "md-shortcuts": '["mod+i"]' }, + title: sprintf(s_("MarkdownEditor|Add italic text (%{modifier_key}I)") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "strikethrough", - data: { "md-tag" => "~~", "md-shortcuts": '["mod+shift+x"]' }, - title: sprintf(s_("MarkdownEditor|Add strikethrough text (%{modifier_key}⇧X)") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "strikethrough", + css_class: 'gl-mr-3', + data: { "md-tag" => "~~", "md-shortcuts": '["mod+shift+x"]' }, + title: sprintf(s_("MarkdownEditor|Add strikethrough text (%{modifier_key}⇧X)") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "quote", data: { "md-tag" => "> ", "md-prepend" => true }, title: _("Insert a quote") }) - = markdown_toolbar_button({ icon: "code", data: { "md-tag" => "`", "md-block" => "```" }, title: _("Insert code") }) += markdown_toolbar_button({ icon: "quote", css_class: 'gl-mr-3', data: { "md-tag" => "> ", "md-prepend" => true }, title: _("Insert a quote") }) += markdown_toolbar_button({ icon: "code", css_class: 'gl-mr-3', data: { "md-tag" => "`", "md-block" => "```" }, title: _("Insert code") }) - = markdown_toolbar_button({ icon: "link", - data: { "md-tag" => "[{text}](url)", "md-select" => "url", "md-shortcuts": '["mod+k"]' }, - title: sprintf(s_("MarkdownEditor|Add a link (%{modifier_key}K)") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "link", + css_class: 'gl-mr-3', + data: { "md-tag" => "[{text}](url)", "md-select" => "url", "md-shortcuts": '["mod+k"]' }, + title: sprintf(s_("MarkdownEditor|Add a link (%{modifier_key}K)") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "list-bulleted", data: { "md-tag" => "- ", "md-prepend" => true }, title: _("Add a bullet list") }) - = markdown_toolbar_button({ icon: "list-numbered", data: { "md-tag" => "1. ", "md-prepend" => true }, title: _("Add a numbered list") }) - = markdown_toolbar_button({ icon: "list-task", data: { "md-tag" => "- [ ] ", "md-prepend" => true }, title: _("Add a checklist") }) - = markdown_toolbar_button({ icon: "list-indent", - data: { "md-command" => 'indentLines', "md-shortcuts": '["mod+]"]' }, - css_class: 'gl-display-none', - title: sprintf(s_("MarkdownEditor|Indent line (%{modifier_key}])") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "list-outdent", - data: { "md-command" => 'outdentLines', "md-shortcuts": '["mod+["]' }, - css_class: 'gl-display-none', - title: sprintf(s_("MarkdownEditor|Outdent line (%{modifier_key}[)") % { modifier_key: modifier_key }) }) - = markdown_toolbar_button({ icon: "details-block", - data: { "md-tag" => "
Click to expand\n{text}\n
", "md-prepend" => true, "md-select" => "Click to expand" }, - title: _("Add a collapsible section") }) - = markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| | |\n| | |", "md-prepend" => true }, title: _("Add a table") }) - - if supports_file_upload - = render Pajamas::ButtonComponent.new(icon: 'paperclip', category: :tertiary, button_options: { 'aria-label': _("Attach a file or image"), class: 'has-tooltip js-attach-file-button', data: { testid: 'button-attach-file', container: 'body' } }) - - if show_fullscreen_button - = render Pajamas::ButtonComponent.new(icon: 'maximize', category: :tertiary, button_options: { 'tabindex': -1, 'aria-label': _("Go full screen"), class: 'has-tooltip js-zen-enter', data: { container: 'body' } }) += markdown_toolbar_button({ icon: "list-bulleted", css_class: 'gl-mr-3', data: { "md-tag" => "- ", "md-prepend" => true }, title: _("Add a bullet list") }) += markdown_toolbar_button({ icon: "list-numbered", css_class: 'gl-mr-3', data: { "md-tag" => "1. ", "md-prepend" => true }, title: _("Add a numbered list") }) += markdown_toolbar_button({ icon: "list-task", css_class: 'gl-mr-3', data: { "md-tag" => "- [ ] ", "md-prepend" => true }, title: _("Add a checklist") }) += markdown_toolbar_button({ icon: "list-indent", + css_class: 'gl-display-none gl-mr-3', + data: { "md-command" => 'indentLines', "md-shortcuts": '["mod+]"]' }, + title: sprintf(s_("MarkdownEditor|Indent line (%{modifier_key}])") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "list-outdent", + css_class: 'gl-display-none gl-mr-3', + data: { "md-command" => 'outdentLines', "md-shortcuts": '["mod+["]' }, + title: sprintf(s_("MarkdownEditor|Outdent line (%{modifier_key}[)") % { modifier_key: modifier_key }) }) += markdown_toolbar_button({ icon: "details-block", + css_class: 'gl-mr-3', + data: { "md-tag" => "
Click to expand\n{text}\n
", "md-prepend" => true, "md-select" => "Click to expand" }, + title: _("Add a collapsible section") }) += markdown_toolbar_button({ icon: "table", css_class: 'gl-mr-3', data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| | |\n| | |", "md-prepend" => true }, title: _("Add a table") }) +- if supports_file_upload + = render Pajamas::ButtonComponent.new(icon: 'paperclip', category: :tertiary, size: :small, button_options: { 'aria-label': _("Attach a file or image"), class: 'has-tooltip js-attach-file-button gl-mr-3', data: { testid: 'button-attach-file', container: 'body' } }) diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml index c3835386d5a..e5aa4c58da1 100644 --- a/app/views/shared/boards/_show.html.haml +++ b/app/views/shared/boards/_show.html.haml @@ -1,5 +1,5 @@ - board = local_assigns.fetch(:board, nil) -- @no_breadcrumb_container = true +- @no_top_bar_container = true - @no_container = true - @content_wrapper_class = "#{@content_wrapper_class} gl-relative gl-pb-0" - @content_class = "issue-boards-content js-focus-mode-board" diff --git a/app/views/shared/dashboard/_no_filter_selected.html.haml b/app/views/shared/dashboard/_no_filter_selected.html.haml deleted file mode 100644 index 48c844d93e8..00000000000 --- a/app/views/shared/dashboard/_no_filter_selected.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.row.empty-state.text-center - .col-12 - .svg-130.gl-mt-3 - = image_tag 'illustrations/issue-dashboard_results-without-filter.svg' - .col-12 - .text-content - %h4 - = _("Please select at least one filter to see results") diff --git a/app/views/shared/deploy_keys/_form.html.haml b/app/views/shared/deploy_keys/_form.html.haml index 93f31629ca7..584d0758c76 100644 --- a/app/views/shared/deploy_keys/_form.html.haml +++ b/app/views/shared/deploy_keys/_form.html.haml @@ -27,6 +27,11 @@ .col-sm-10 = form.text_field :fingerprint, class: 'form-control gl-form-input', readonly: 'readonly' +.form-group + .col-sm-10 + = form.label :expires_at, _('Expiration date (optional)'), class: 'label-bold' + = form.text_field :expires_at, class: 'form-control gl-form-input', readonly: 'readonly' + - if deploy_keys_project.present? = form.fields_for :deploy_keys_projects, deploy_keys_project do |deploy_keys_project_form| .form-group diff --git a/app/views/shared/deploy_keys/_project_group_form.html.haml b/app/views/shared/deploy_keys/_project_group_form.html.haml index 11fa44fe282..c9e17b18264 100644 --- a/app/views/shared/deploy_keys/_project_group_form.html.haml +++ b/app/views/shared/deploy_keys/_project_group_form.html.haml @@ -15,6 +15,10 @@ .form-group.row = deploy_keys_project_form.gitlab_ui_checkbox_component :can_push, _('Grant write permissions to this key'), help_text: _('Allow this key to push to this repository') + .form-group.row + = f.label :expires_at, _('Expiration date (optional)'), class: 'label-bold' + = f.gitlab_ui_datepicker :expires_at, data: { qa_selector: 'deploy_key_expires_at_field' }, value: f.object.expires_at + %p.form-text.text-muted= ssh_key_expires_field_description .form-group.row = f.submit _("Add key"), data: { qa_selector: "add_deploy_key_button"}, pajamas_button: true diff --git a/app/views/shared/doorkeeper/applications/_form.html.haml b/app/views/shared/doorkeeper/applications/_form.html.haml index b40e2630011..628a34e1278 100644 --- a/app/views/shared/doorkeeper/applications/_form.html.haml +++ b/app/views/shared/doorkeeper/applications/_form.html.haml @@ -21,4 +21,4 @@ = render 'shared/tokens/scopes_form', prefix: 'doorkeeper_application', token: @application, scopes: @scopes, f: f .gl-mt-3 - = f.submit _('Save application'), class: "gl-button btn btn-confirm" + = f.submit _('Save application'), pajamas_button: true diff --git a/app/views/shared/doorkeeper/applications/_index.html.haml b/app/views/shared/doorkeeper/applications/_index.html.haml index 6a770a4fcb2..abfe3baf8b4 100644 --- a/app/views/shared/doorkeeper/applications/_index.html.haml +++ b/app/views/shared/doorkeeper/applications/_index.html.haml @@ -1,4 +1,4 @@ -- @content_class = "limit-container-width" unless fluid_layout +- @force_desktop_expanded_sidebar = true .row.gl-mt-3.js-search-settings-section .col-lg-4.profile-settings-sidebar diff --git a/app/views/shared/doorkeeper/applications/_show.html.haml b/app/views/shared/doorkeeper/applications/_show.html.haml index 5b0cff2c1c0..b9095e2a1a1 100644 --- a/app/views/shared/doorkeeper/applications/_show.html.haml +++ b/app/views/shared/doorkeeper/applications/_show.html.haml @@ -8,21 +8,15 @@ %td .clipboard-group .input-group - %input.label.label-monospace.monospace{ id: "application_id", type: "text", autocomplete: 'off', value: @application.uid, readonly: true } + %input.label.label-monospace.monospace{ id: "application_id", type: "text", autocomplete: 'off', value: @application.uid, readonly: true, data: { qa_selector: 'application_id_field' } } .input-group-append = clipboard_button(target: '#application_id', title: _("Copy ID"), class: "gl-button btn btn-default") %tr %td = _('Secret') %td - - if Feature.enabled?('hash_oauth_secrets') - - if @application.plaintext_secret - = clipboard_button(clipboard_text: @application.plaintext_secret, button_text: _('Copy'), title: _("Copy secret"), class: "btn btn-default btn-md gl-button") - %span= _('This is the only time the secret is accessible. Copy the secret and store it securely.') - - else - = _('The secret is only available when you first create the application.') - - else - = clipboard_button(clipboard_text: @application.secret, button_text: _('Copy'), title: _("Copy secret"), class: "btn btn-default btn-md gl-button") + #js-oauth-application-secret{ data: { initial_secret: @application.plaintext_secret, renew_path: renew_path } } + %tr %td = _('Callback URL') @@ -52,3 +46,6 @@ = link_to _('Continue'), index_path, class: 'btn btn-confirm btn-md gl-button gl-mr-3' = link_to _('Edit'), edit_path, class: 'btn btn-default btn-md gl-button' = render 'shared/doorkeeper/applications/delete_form', path: delete_path + +-# Create a hidden field to save the ID of application created += hidden_field_tag(:id_of_application, @application.id, data: { qa_selector: 'id_of_application_field' }) diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 37f7fbc0de5..1ab9e288a9e 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -4,7 +4,6 @@ - opened_issues_count = issuables_count_for_state(:issues, :opened) - is_opened_state = params[:state] == 'opened' - is_closed_state = params[:state] == 'closed' -- issuable_type = 'issues' - can_edit = can?(current_user, :admin_project, @project) .row.empty-state @@ -43,7 +42,7 @@ = link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link' - if show_import_button - .js-csv-import-export-buttons{ data: { show_import_button: 'true', issuable_type: issuable_type, import_csv_issues_path: import_csv_namespace_project_issues_path, can_edit: can_edit.to_s, project_import_jira_path: project_import_jira_path(@project), max_attachment_size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes), container_class: 'gl-w-full gl-sm-w-auto gl-sm-mr-3 gl-display-inline-flex gl-vertical-align-middle', show_label: 'true' } } + .js-csv-import-export-buttons{ data: { show_import_button: 'true', issuable_type: 'issue', import_csv_issues_path: import_csv_namespace_project_issues_path, can_edit: can_edit.to_s, project_import_jira_path: project_import_jira_path(@project), max_attachment_size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes) } } %hr %p.gl-text-center.gl-mb-0 %strong diff --git a/app/views/shared/empty_states/_labels.html.haml b/app/views/shared/empty_states/_labels.html.haml index e96fcd11cef..da88c139a6e 100644 --- a/app/views/shared/empty_states/_labels.html.haml +++ b/app/views/shared/empty_states/_labels.html.haml @@ -1,7 +1,7 @@ .row.empty-state.labels .col-12 - .svg-content{ data: { qa_selector: 'label_svg_content' } } - = image_tag 'illustrations/labels.svg' + .svg-content.svg-150{ data: { qa_selector: 'label_svg_content' } } + = image_tag 'illustrations/empty-state/empty-labels-md.svg' .col-12 .text-content %h4= _("Labels can be applied to issues and merge requests to categorize them.") diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index 8e4051fa335..94589996c3a 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -7,8 +7,8 @@ .row.empty-state.merge-requests .col-12 - .svg-content - = image_tag 'illustrations/merge_requests.svg', { auto_dark: true } + .svg-content.svg-150 + = image_tag 'illustrations/empty-state/empty-merge-requests-md.svg', { auto_dark: true } .col-12 .text-content - if has_filter_bar_param? diff --git a/app/views/shared/empty_states/_priority_labels.html.haml b/app/views/shared/empty_states/_priority_labels.html.haml index 3381c5f0c67..b24fa0b3bdb 100644 --- a/app/views/shared/empty_states/_priority_labels.html.haml +++ b/app/views/shared/empty_states/_priority_labels.html.haml @@ -1,6 +1,8 @@ -.text-center +.text-center.gl-mt-1.gl-mb-6 .svg-content{ data: { qa_selector: 'label_svg_content' } } - = image_tag 'illustrations/priority_labels.svg' + = image_tag 'illustrations/empty-state/empty-labels-starred-md.svg' - if can?(current_user, :admin_label, @project) - %p - = _("Star labels to start sorting by priority") + %div + = _("No prioritized labels yet!") + %div + = _("Star labels to start sorting by priority.") diff --git a/app/views/shared/empty_states/_snippets.html.haml b/app/views/shared/empty_states/_snippets.html.haml index e34166bac6c..87de756093d 100644 --- a/app/views/shared/empty_states/_snippets.html.haml +++ b/app/views/shared/empty_states/_snippets.html.haml @@ -2,8 +2,8 @@ .row.empty-state .col-12 - .svg-content{ data: { qa_selector: 'svg_content' } } - = image_tag 'illustrations/snippets_empty.svg' + .svg-content.svg-150{ data: { qa_selector: 'svg_content' } } + = image_tag 'illustrations/empty-state/empty-snippets-md.svg' .text-content.gl-text-center.gl-pt-0 - if current_user %h4 diff --git a/app/views/shared/empty_states/_topics.html.haml b/app/views/shared/empty_states/_topics.html.haml index 0283e852c7d..cd60d966d71 100644 --- a/app/views/shared/empty_states/_topics.html.haml +++ b/app/views/shared/empty_states/_topics.html.haml @@ -1,7 +1,7 @@ .row.empty-state .col-12 - .svg-content - = image_tag 'illustrations/labels.svg' + .svg-content.svg-150 + = image_tag 'illustrations/empty-state/empty-labels-md.svg' .text-content.gl-text-center.gl-pt-0! %h4= _('There are no topics to show.') %p= _('Add topics to projects to help users find them.') diff --git a/app/views/shared/empty_states/_wikis.html.haml b/app/views/shared/empty_states/_wikis.html.haml index 8304a2f18a0..57f1c9d381e 100644 --- a/app/views/shared/empty_states/_wikis.html.haml +++ b/app/views/shared/empty_states/_wikis.html.haml @@ -1,7 +1,8 @@ - layout_path = 'shared/empty_states/wikis_layout' - messages = wiki_empty_state_messages(@wiki) +- hide_create = local_assigns[:hide_create] -- if can?(current_user, :create_wiki, @wiki.container) +- if !hide_create && can?(current_user, :create_wiki, @wiki.container) - create_path = wiki_page_path(@wiki, params[:id], view: 'create') - create_link = link_to s_('WikiEmpty|Create your first page'), create_path, class: 'btn gl-button btn-confirm', title: s_('WikiEmpty|Create your first page'), data: { qa_selector: 'create_first_page_link' } diff --git a/app/views/shared/form_elements/_description.html.haml b/app/views/shared/form_elements/_description.html.haml index 2c46b2191c6..415849672b6 100644 --- a/app/views/shared/form_elements/_description.html.haml +++ b/app/views/shared/form_elements/_description.html.haml @@ -1,9 +1,9 @@ +- @gfm_form = true - 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 description or drag your files here…') - -- supports_quick_actions = true +- no_issuable_templates = issuable_templates(ref_project, model.to_ability_name).empty? - preview_url = preview_markdown_path(project, target_type: model.class.name) .form-group @@ -16,12 +16,14 @@ = render 'shared/form_elements/apply_template_warning', issuable: model - = render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do - = render 'shared/zen', f: form, attr: :description, - classes: 'note-textarea rspec-issuable-form-description', - placeholder: placeholder, - supports_quick_actions: supports_quick_actions, - qa_selector: 'issuable_form_description_field' - = render 'shared/notes/hints', supports_quick_actions: supports_quick_actions - .clearfix - .error-alert + .js-markdown-editor{ data: { render_markdown_path: preview_url, + markdown_docs_path: help_page_path('user/markdown'), + quick_actions_docs_path: help_page_path('user/project/quick_actions'), + qa_selector: 'issuable_form_description_field', + form_field_placeholder: placeholder, + form_field_classes: 'js-gfm-input markdown-area note-textarea rspec-issuable-form-description' } } + = form.hidden_field :description + + - if no_issuable_templates && can?(current_user, :push_code, model.project) + = render 'shared/issuable/form/default_templates' + diff --git a/app/views/shared/groups/_list.html.haml b/app/views/shared/groups/_list.html.haml index c5b39c7db08..550f079bf3b 100644 --- a/app/views/shared/groups/_list.html.haml +++ b/app/views/shared/groups/_list.html.haml @@ -1,4 +1,4 @@ -- illustration_path = 'illustrations/profile-page/groups.svg' +- illustration_path = 'illustrations/empty-state/empty-groups-md.svg' - current_user_empty_message_header = s_('UserProfile|You can create a group for several dependent projects.') - current_user_empty_message_description = s_('UserProfile|Groups are the best way to manage projects and members.') - primary_button_label = _('New group') diff --git a/app/views/shared/hook_logs/_index.html.haml b/app/views/shared/hook_logs/_index.html.haml index 6a46b0b3510..7dab14b95c1 100644 --- a/app/views/shared/hook_logs/_index.html.haml +++ b/app/views/shared/hook_logs/_index.html.haml @@ -1,4 +1,4 @@ -- docs_link_url = help_page_path('user/project/integrations/webhooks', anchor: 'troubleshoot-webhooks') +- docs_link_url = help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting') - link_start = ''.html_safe % { url: docs_link_url } - link_end = ''.html_safe diff --git a/app/views/shared/icons/_mr_widget_empty_state.svg b/app/views/shared/icons/_mr_widget_empty_state.svg deleted file mode 100644 index a75eee846c9..00000000000 --- a/app/views/shared/icons/_mr_widget_empty_state.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml new file mode 100644 index 00000000000..de4439a8fde --- /dev/null +++ b/app/views/shared/integrations/_slack_notifications_deprecation_alert.html.haml @@ -0,0 +1,20 @@ +- if Gitlab.com? + = render Pajamas::AlertComponent.new(title: _('Slack notifications integration is deprecated'), + variant: :warning, + dismissible: false, + alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| + = c.body do + - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') + - learn_more_link = ''.html_safe % { url: help_page_link } + + = html_escape(s_('The Slack notifications integration is deprecated and will be removed in a future release. To continue to receive notifications from Slack, use the GitLab for Slack app instead. %{learn_more_link_start}Learn more%{link_end}.')) % { learn_more_link_start: learn_more_link, link_end: ''.html_safe } +- else + = render Pajamas::AlertComponent.new(title: _('Slack notifications will be deprecated'), + variant: :warning, + dismissible: false, + alert_options: { class: 'gl-mt-5', data: { testid: "slack-notifications-deprecation" } }) do |c| + = c.body do + - help_page_link = help_page_url('user/project/integrations/gitlab_slack_application') + - learn_more_link = ''.html_safe % { url: help_page_link } + + = html_escape(s_('Slack notifications will be brought into the GitLab for Slack app so you can manage both integrations from one place. %{learn_more_link_start}Learn more%{link_end}.')) % { learn_more_link_start: learn_more_link, link_end: ''.html_safe } diff --git a/app/views/shared/integrations/edit.html.haml b/app/views/shared/integrations/edit.html.haml index 0ae0eea59d8..9d613d2ad94 100644 --- a/app/views/shared/integrations/edit.html.haml +++ b/app/views/shared/integrations/edit.html.haml @@ -1,7 +1,6 @@ - add_to_breadcrumbs _('Integrations'), scoped_integrations_path(project: @project, group: @group) - breadcrumb_title @integration.title - page_title @integration.title, _('Integrations') -- @content_class = 'limit-container-width' unless fluid_layout %h2.gl-mb-4 = @integration.title diff --git a/app/views/shared/integrations/overrides.html.haml b/app/views/shared/integrations/overrides.html.haml index a63053bde0a..c25527a605c 100644 --- a/app/views/shared/integrations/overrides.html.haml +++ b/app/views/shared/integrations/overrides.html.haml @@ -1,7 +1,6 @@ - add_to_breadcrumbs _('Integrations'), scoped_integrations_path(project: @project, group: @group) - breadcrumb_title @integration.title - page_title @integration.title, _('Integrations') -- @content_class = 'limit-container-width' unless fluid_layout %h1.page-title.gl-font-size-h-display = @integration.title diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index dda84e0fb9e..beeb328aedf 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -3,16 +3,16 @@ .col-lg-3 %p = s_('PrometheusService|Custom metrics require Prometheus installed on a cluster with environment scope "*" OR a manually configured Prometheus to be available.') - = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer" + = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } } - .card-header + = render Pajamas::CardComponent.new(header_options: { class: 'gl-display-flex gl-align-items-center' }, body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 custom-monitored-metrics js-panel-custom-monitored-metrics', data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } }) do |c| + - c.header do %strong = s_('PrometheusService|Custom metrics') - = gl_badge_tag 0, nil, class: 'js-custom-monitored-count' + = gl_badge_tag 0, nil, class: 'gl-ml-2 js-custom-monitored-count' = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden' - .card-body + - c.body do .flash-container.hidden .flash-warning .flash-text diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml index c74dbfd8b15..7cd4eeee5f8 100644 --- a/app/views/shared/integrations/prometheus/_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -8,12 +8,12 @@ = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.js-panel-monitored-metrics{ data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') } } - .card-header + = render Pajamas::CardComponent.new(body_options: { class: 'gl-p-0' }, card_options: { class: 'gl-mb-5 js-panel-monitored-metrics', data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') }}) do |c| + - c.header do %strong = s_('PrometheusService|Common metrics') - = gl_badge_tag 0, nil, class: 'js-monitored-count' - .card-body + = gl_badge_tag 0, nil, class: 'js-monitored-count' + - c.body do .loading-metrics.js-loading-metrics %p.m-3 = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner') @@ -23,16 +23,16 @@ = s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics') %ul.list-unstyled.metrics-list.hidden.js-metrics-list - .card.hidden.js-panel-missing-env-vars - .card-header + = render Pajamas::CardComponent.new(body_options: { class: 'hidden gl-p-0' }, card_options: { class: 'hidden js-panel-missing-env-vars' }) do |c| + - c.header do = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right') = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden') = s_('PrometheusService|Missing environment variable') = gl_badge_tag 0, nil, class: 'js-env-var-count' - .card-body.hidden + - c.body do .flash-container .flash-notice .flash-text - = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "$CI_ENVIRONMENT_SLUG" }).html_safe - = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/dashboards/variables.md', anchor: 'query-variables') + = html_escape(s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries.")) % { variable: "$CI_ENVIRONMENT_SLUG".html_safe } + = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md') %ul.list-unstyled.metrics-list.js-missing-var-metrics-list diff --git a/app/views/shared/issuable/_feed_buttons.html.haml b/app/views/shared/issuable/_feed_buttons.html.haml index 94b7fe14721..1a9bbac6f05 100644 --- a/app/views/shared/issuable/_feed_buttons.html.haml +++ b/app/views/shared/issuable/_feed_buttons.html.haml @@ -1,8 +1,10 @@ - show_calendar_button = local_assigns.fetch(:show_calendar_button, true) -= render Pajamas::ButtonComponent.new(href: safe_params.merge(rss_url_options), icon: 'rss', button_options: { class: 'has-tooltip', 'aria-label': _('Subscribe to RSS feed'), data: { container: 'body', testid: 'rss-feed-link' } }) do - = _('Subscribe to RSS feed') - - if show_calendar_button - = render Pajamas::ButtonComponent.new(href: safe_params.merge(calendar_url_options), icon: 'calendar', button_options: { class: 'has-tooltip', 'aria-label': _('Subscribe to calendar'), data: { container: 'body' } }) do - = _('Subscribe to calendar') + = link_to safe_params.merge(calendar_url_options), class: 'dropdown-item' do + .gl-dropdown-item-text-wrapper + = _("Subscribe to calendar") + += link_to safe_params.merge(rss_url_options), class: 'dropdown-item' do + .gl-dropdown-item-text-wrapper + = _("Subscribe to RSS feed") diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 07cdbbece8c..b6bd691213c 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -6,14 +6,8 @@ = form_errors(issuable) - if @conflict - = render Pajamas::AlertComponent.new(variant: :danger, - dismissible: false, - alert_options: { class: 'gl-mb-5' }) do |c| - = c.body do - Someone edited the #{issuable.class.model_name.human.downcase} the same time you did. - Please check out - = link_to "the #{issuable.class.model_name.human.downcase}", polymorphic_path([@project, issuable]), target: "_blank", rel: 'noopener noreferrer' - and make sure your changes will not unintentionally remove theirs + - model_name = _(issuable.class.model_name.human.downcase) + = render 'shared/model_version_conflict', model_name: model_name, link_path: polymorphic_path([@project, issuable]) = render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form @@ -62,9 +56,9 @@ = sanitize(html_escape(_('Please review the %{linkStart}contribution guidelines%{linkEnd} for this project.')) % { linkStart: contribution_guidelines_start, linkEnd: contribution_guidelines_end }) - if issuable.new_record? - = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", pajamas_button: true, class: 'gl-mr-2', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else - = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2 js-issuable-submit-button js-reset-autosave', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - if issuable.new_record? = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default js-reset-autosave' diff --git a/app/views/shared/issuable/_label_dropdown.html.haml b/app/views/shared/issuable/_label_dropdown.html.haml index af63839d7c1..3c4ee01d04f 100644 --- a/app/views/shared/issuable/_label_dropdown.html.haml +++ b/app/views/shared/issuable/_label_dropdown.html.haml @@ -26,7 +26,7 @@ - apply_is_default_styles = (selected.nil? || selected.empty?) && !no_default_styles %span.dropdown-toggle-text{ class: ("is-default" if apply_is_default_styles) } = multi_label_name(selected, label_name) - = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon") .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable.dropdown-extended-height = render partial: "shared/issuable/label_page_default", locals: { title: dropdown_title, show_footer: show_footer, show_create: show_create } - if show_create && project && can?(current_user, :admin_label, project) diff --git a/app/views/shared/issuable/_label_page_create.html.haml b/app/views/shared/issuable/_label_page_create.html.haml index eb3acd8e055..96167db80b4 100644 --- a/app/views/shared/issuable/_label_page_create.html.haml +++ b/app/views/shared/issuable/_label_page_create.html.haml @@ -10,9 +10,9 @@ %input#new_label_name.default-dropdown-input{ type: "text", placeholder: _('Name new label') } .suggest-colors.suggest-colors-dropdown = render_suggested_colors - .dropdown-label-color-input - .dropdown-label-color-preview.js-dropdown-label-color-preview - %input#new_label_color.default-dropdown-input{ type: "text", placeholder: _('Assign custom color like #FF0000') } + .dropdown-label-color-input.gl-display-flex + %input.dropdown-label-color-preview.js-dropdown-label-color-preview.gl-w-7.gl-h-7.gl-border-1.gl-border-solid.gl-border-gray-500.gl-rounded-top-right-none.gl-rounded-bottom-right-none{ class: "gl-border-r-0!", type: "color", placeholder: _('Select color') } + %input#new_label_color.default-dropdown-input.gl-rounded-top-left-none.gl-rounded-bottom-left-none{ type: "text", placeholder: _('Assign custom color like #FF0000') } - if show_add_list .dropdown-label-input{ class: add_list_class } %label diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 72940b64801..76678c48a86 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -162,6 +162,15 @@ %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } } %button.gl-button.btn.btn-link{ type: 'button' } = _('No') + - if ::Feature.enabled?(:mr_approved_filter, type: :ops) + #js-dropdown-approved.filtered-search-input-dropdown-menu.dropdown-menu + %ul.filter-dropdown{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Yes') + %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } } + %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 } } @@ -186,7 +195,7 @@ = render_if_exists 'shared/issuable/filter_epic', type: type - %button.clear-search.hidden{ type: 'button' } + %button.clear-search.hidden.gl-rounded-base{ type: 'button' } = sprite_icon('close', size: 16, css_class: 'clear-search-icon') .filter-dropdown-container.gl-display-flex.gl-flex-direction-column.gl-md-flex-direction-row.gl-align-items-flex-start - if type != :productivity_analytics && show_sorting_dropdown diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index f54354674e2..09162e6a349 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -9,14 +9,15 @@ - reviewers = local_assigns.fetch(:reviewers, nil) - in_group_context_with_iterations = @project.group.present? && issuable_sidebar[:supports_iterations] - is_merge_request = issuable_type === 'merge_request' -- moved_sidebar_enabled = moved_mr_sidebar_enabled? && is_merge_request +- moved_sidebar_enabled = moved_mr_sidebar_enabled? +- is_merge_request_with_flag = is_merge_request && moved_sidebar_enabled -%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: "#{sidebar_gutter_collapsed_class} #{'right-sidebar-merge-requests' if moved_sidebar_enabled}", 'aria-live' => 'polite', 'aria-label': issuable_type } - .issuable-sidebar{ class: "#{'is-merge-request' if moved_sidebar_enabled}" } - .issuable-sidebar-header{ class: "#{'gl-pb-2! gl-md-display-flex gl-justify-content-end gl-lg-display-none!' if moved_sidebar_enabled}" } +%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: "#{sidebar_gutter_collapsed_class(is_merge_request_with_flag)} #{'right-sidebar-merge-requests' if is_merge_request_with_flag}", 'aria-live' => 'polite', 'aria-label': issuable_type } + .issuable-sidebar{ class: "#{'is-merge-request' if is_merge_request_with_flag}" } + .issuable-sidebar-header{ class: "#{'gl-pb-2! gl-md-display-flex gl-justify-content-end gl-lg-display-none!' if is_merge_request_with_flag}" } %button.btn.gl-button.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ type: "reset", class: "gl-shadow-none! #{'gl-display-block' if moved_sidebar_enabled}", "aria-label" => _('Toggle sidebar'), title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } } = sidebar_gutter_toggle_icon - - if signed_in && !moved_sidebar_enabled + - if signed_in && !is_merge_request_with_flag .js-sidebar-todo-widget-root{ data: { project_path: issuable_sidebar[:project_full_path], iid: issuable_sidebar[:iid], id: issuable_sidebar[:id] } } = form_for issuable_type, url: issuable_sidebar[:issuable_json_path], remote: true, html: { class: 'issuable-context-form inline-update js-issuable-update' } do |f| @@ -81,19 +82,19 @@ .js-sidebar-participants-widget-root - .block.with-sub-blocks - - if !moved_sidebar_enabled + - if !moved_sidebar_enabled + .block.with-sub-blocks .js-sidebar-reference-widget-root - - if issuable_type == 'merge_request' && !moved_sidebar_enabled - .sub-block.js-sidebar-source-branch - .sidebar-collapsed-icon.js-dont-change-state - = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') - .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: "".html_safe, source_branch_close: "".html_safe, source_branch: html_escape(source_branch) } - = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') - - - if show_forwarding_email + - if is_merge_request && !moved_sidebar_enabled + .sub-block.js-sidebar-source-branch + .sidebar-collapsed-icon.js-dont-change-state + = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') + .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: "".html_safe, source_branch_close: "".html_safe, source_branch: html_escape(source_branch) } + = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') + + - if show_forwarding_email && !moved_sidebar_enabled .block .js-sidebar-copy-email-root - if issuable_sidebar.dig(:current_user, :can_move) diff --git a/app/views/shared/issuable/_sidebar_user_dropdown.html.haml b/app/views/shared/issuable/_sidebar_user_dropdown.html.haml index c058e7ebe3e..9bfdacc8cfd 100644 --- a/app/views/shared/issuable/_sidebar_user_dropdown.html.haml +++ b/app/views/shared/issuable/_sidebar_user_dropdown.html.haml @@ -14,8 +14,6 @@ %li .js-invite-members-trigger{ data: { trigger_element: 'anchor', display_text: _('Invite Members'), - event: 'click_invite_members', - trigger_source: local_assigns.fetch(:trigger_source), - label: data['track-label'] } } + trigger_source: local_assigns.fetch(:trigger_source) } } - else = dropdown_tag(data['dropdown-title'], options: options) diff --git a/app/views/shared/issuable/form/_default_templates.html.haml b/app/views/shared/issuable/form/_default_templates.html.haml index 50f30e58b35..2dda0049c09 100644 --- a/app/views/shared/issuable/form/_default_templates.html.haml +++ b/app/views/shared/issuable/form/_default_templates.html.haml @@ -1,4 +1,4 @@ -%p.form-text.text-muted +.gl-mt-3.gl-text-secondary - template_link_url = help_page_path('user/project/description_templates') - template_link_start = ''.html_safe % { url: template_link_url } = s_('Promotions|Add %{link_start} description templates %{link_end} to help your contributors to communicate effectively!').html_safe % { link_start: template_link_start, link_end: ''.html_safe } diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index 09086d3aa82..8e9793cdba5 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -9,22 +9,25 @@ %label = _('Merge options') - if issuable.can_remove_source_branch?(current_user) - .form-check.gl-mb-3 + .form-check.gl-pl-0 = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil - = check_box_tag 'merge_request[force_remove_source_branch]', '1', issuable.force_remove_source_branch?, class: 'form-check-input js-form-update' - = label_tag 'merge_request[force_remove_source_branch]', class: 'form-check-label' do - = _("Delete source branch when merge request is accepted.") + = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[force_remove_source_branch]', checked: issuable.force_remove_source_branch?, value: '1', checkbox_options: { class: 'js-form-update' }) do |c| + = c.label do + = _("Delete source branch when merge request is accepted.") + - if !project.squash_never? - .form-check + .form-check.gl-pl-0 - if project.squash_always? = hidden_field_tag 'merge_request[squash]', '1', id: nil - = check_box_tag 'merge_request[squash]', '1', project.squash_enabled_by_default?, class: 'form-check-input', disabled: 'true' + = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[squash]', checked: project.squash_enabled_by_default?, value: '1', checkbox_options: { class: 'js-form-update', disabled: true }) do |c| + = c.label do + = _("Squash commits when merge request is accepted.") + = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' + = c.help_text do + = _('Required in this project.') - else = hidden_field_tag 'merge_request[squash]', '0', id: nil - = check_box_tag 'merge_request[squash]', '1', issuable_squash_option?(issuable, project), class: 'form-check-input js-form-update' - = label_tag 'merge_request[squash]', class: 'form-check-label' do - = _("Squash commits when merge request is accepted.") - = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' - - if project.squash_always? - .gl-text-gray-400 - = _('Required in this project.') + = render Pajamas::CheckboxTagComponent.new(name: 'merge_request[squash]', checked: issuable_squash_option?(issuable, project), value: '1', checkbox_options: { class: 'js-form-update' }) do |c| + = c.label do + = _("Squash commits when merge request is accepted.") + = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/issuable/form/_metadata.html.haml b/app/views/shared/issuable/form/_metadata.html.haml index 9603178f7de..b27fd8ab7d2 100644 --- a/app/views/shared/issuable/form/_metadata.html.haml +++ b/app/views/shared/issuable/form/_metadata.html.haml @@ -37,12 +37,15 @@ .issuable-form-select-holder = render "shared/issuable/milestone_dropdown", selected: issuable.milestone, name: "#{issuable.class.model_name.param_key}[milestone_id]" - .form-group.row - = form.label :label_ids, _('Labels'), class: "col-12" - = form.hidden_field :label_ids, multiple: true, value: '' - .col-12 - .issuable-form-select-holder - = render "shared/issuable/label_dropdown", classes: ["js-issuable-form-dropdown"], selected: issuable.labels, data_options: { field_name: "#{issuable.class.model_name.param_key}[label_ids][]", show_any: false }, dropdown_title: "Select label" + - if Feature.enabled?(:visible_label_selection_on_metadata, project) + .js-issuable-form-label-selector{ data: issuable_label_selector_data(project, issuable) } + - else + .form-group.row + = form.label :label_ids, _('Labels'), class: "col-12" + = form.hidden_field :label_ids, multiple: true, value: '' + .col-12 + .issuable-form-select-holder + = render "shared/issuable/label_dropdown", classes: ["js-issuable-form-dropdown"], selected: issuable.labels, data_options: { field_name: "#{issuable.class.model_name.param_key}[label_ids][]", show_any: false }, dropdown_title: "Select label" = render_if_exists "shared/issuable/form/merge_request_blocks", issuable: issuable, form: form diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index 4d31baee25b..be836f4b8a9 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -1,6 +1,5 @@ - issuable = local_assigns.fetch(:issuable) - form = local_assigns.fetch(:form) -- no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty? %div{ data: { testid: 'issue-title-input-field' } } = form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true, @@ -13,6 +12,3 @@ = s_('MergeRequests|Mark as draft') = c.help_text do = s_('MergeRequests|Drafts cannot be merged until marked ready.') - - - if no_issuable_templates && can?(current_user, :push_code, issuable.project) - = render 'shared/issuable/form/default_templates' diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index a94ef70b2d5..0bcdcb9e963 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -5,30 +5,10 @@ = _('Type') #js-type-popover - .issuable-form-select-holder.selectbox.form-group.gl-mb-0.gl-display-block - .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{ data: { testid: 'issue-type-select-dropdown' } } - %ul - - if create_issue_type_allowed?(@project, :issue) - %li.js-filter-issuable-type - = link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do - #{sprite_icon(work_item_type_icon(:issue), css_class: 'gl-icon')} #{_('Issue')} - - if create_issue_type_allowed?(@project, :incident) - %li.js-filter-issuable-type{ data: { track: { action: "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 - #{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_('Incident')} + .issuable-form-select-holder.form-group.gl-mb-0.gl-display-block + #js-type-select{ data: issuable_type_selector_data(issuable) } - - if issuable.incident? + - if issuable.incident_type_issue? %p.form-text.text-muted - incident_docs_url = help_page_path('operations/incident_management/incidents.md') - incident_docs_start = format('', url: incident_docs_url) diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml index e1a9b30ef67..fdbe247c6ba 100644 --- a/app/views/shared/issue_type/_details_content.html.haml +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -2,7 +2,7 @@ - api_awards_path = local_assigns.fetch(:api_awards_path, nil) .issue-details.issuable-details.js-issue-details - .detail-page-description.content-block.js-detail-page-description.gl-pb-0.gl-border-none + .detail-page-description.content-block.js-detail-page-description.gl-pt-4.gl-pb-0.gl-border-none #js-issuable-app{ data: { initial: issuable_initial_data(issuable).to_json, issuable_id: issuable.id, full_path: @project.full_path, @@ -30,14 +30,14 @@ #js-related-merge-requests{ data: { endpoint: expose_path(api_v4_projects_issues_related_merge_requests_path(id: @project.id, issue_iid: issuable.iid)), project_namespace: @project.namespace.path, project_path: @project.path } } - - if can?(current_user, :admin_feature_flags_issue_links, @project) - = render_if_exists 'projects/issues/related_feature_flags' - - if can?(current_user, :read_code, @project) - add_page_startup_api_call related_branches_path #related-branches{ data: { url: related_branches_path } } -# This element is filled in using JavaScript. + - if can?(current_user, :admin_feature_flags_issue_links, @project) + = render_if_exists 'projects/issues/related_feature_flags' + .js-issue-widgets = 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 ccb501dae11..b6c0b73a83d 100644 --- a/app/views/shared/issue_type/_details_header.html.haml +++ b/app/views/shared/issue_type/_details_header.html.haml @@ -2,7 +2,7 @@ - badge_classes = 'issuable-status-badge gl-mr-3' .detail-page-header - .detail-page-header-body.gl-flex-wrap-wrap + .detail-page-header-body.gl-flex-wrap = gl_badge_tag({ variant: :info, icon: 'issue-closed', icon_classes: 'gl-mr-0!' }, { class: "#{issue_status_visibility(issuable, status_box: :closed)} #{badge_classes} issuable-status-badge-closed" }) do .gl-display-none.gl-sm-display-block.gl-ml-2 = issue_closed_text(issuable, current_user) @@ -19,4 +19,4 @@ %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) } + .js-issue-header-actions{ data: issue_header_actions_data(@project, issuable, current_user, @issuable_sidebar) } diff --git a/app/views/shared/labels/_form.html.haml b/app/views/shared/labels/_form.html.haml index 9ef4b9e084d..899b2ed832e 100644 --- a/app/views/shared/labels/_form.html.haml +++ b/app/views/shared/labels/_form.html.haml @@ -9,19 +9,17 @@ .form-group.row .col-12 - = f.label :description - = f.text_field :description, class: "gl-form-input form-control js-quick-submit", data: { qa_selector: 'label_description_field' } + = f.label :description, _("Description (optional)") + = f.text_area :description, class: "gl-form-input form-control js-quick-submit", rows: 4, data: { qa_selector: 'label_description_field' } .form-group.row .col-12 = f.label :color, _("Background color") .input-group .input-group-prepend - .input-group-text.label-color-preview   + %input.label-color-preview.gl-w-7.gl-h-full.gl-border-1.gl-border-solid.gl-border-gray-500.gl-border-r-0.gl-rounded-top-right-none.gl-rounded-bottom-right-none{ type: "color", placeholder: _('Select color') } = f.text_field :color, class: "gl-form-input form-control", data: { qa_selector: 'label_color_field' } .form-text.text-muted - = _('Choose any color.') - %br - = _("Or you can choose one of the suggested colors below") + = _('Select a color from the color picker or from the presets below.') = render_suggested_colors .gl-display-flex.gl-justify-content-space-between %div diff --git a/app/views/shared/milestones/_delete_button.html.haml b/app/views/shared/milestones/_delete_button.html.haml index 432d2efc36e..caab7710fa8 100644 --- a/app/views/shared/milestones/_delete_button.html.haml +++ b/app/views/shared/milestones/_delete_button.html.haml @@ -1,8 +1,6 @@ - milestone_url = @milestone.project_milestone? ? project_milestone_path(@project, @milestone) : group_milestone_path(@group, @milestone) -= render Pajamas::ButtonComponent.new(variant: :danger, - button_options: { class: 'js-delete-milestone-button btn-grouped', data: { milestone_id: @milestone.id, milestone_title: markdown_field(@milestone, :title), milestone_url: milestone_url, milestone_issue_count: @milestone.issues.count, milestone_merge_request_count: @milestone.merge_requests.count }, disabled: true }) do - = gl_loading_icon(inline: true, css_class: "gl-mr-2 js-loading-icon hidden") - = _('Delete') - +%button.gl-button.btn.btn-link.menu-item.js-delete-milestone-button{ data: { milestone_id: @milestone.id, milestone_title: markdown_field(@milestone, :title), milestone_url: milestone_url, milestone_issue_count: @milestone.issues.count, milestone_merge_request_count: @milestone.merge_requests.count }, disabled: true } + .gl-dropdown-item-text-wrapper.gl-text-red-500 + = _('Delete') #js-delete-milestone-modal diff --git a/app/views/shared/milestones/_description.html.haml b/app/views/shared/milestones/_description.html.haml index fc25c7e8f89..a63702661d0 100644 --- a/app/views/shared/milestones/_description.html.haml +++ b/app/views/shared/milestones/_description.html.haml @@ -1,4 +1,4 @@ -.detail-page-description.milestone-detail +.detail-page-description.milestone-detail.gl-py-4 %h2.gl-m-0{ data: { qa_selector: "milestone_title_content" } } = markdown_field(milestone, :title) .gl-font-sm.gl-text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { qa_selector: 'milestone_id_content' }, itemprop: 'identifier' } @@ -9,5 +9,5 @@ - if milestone.try(:description).present? %div{ data: { qa_selector: "milestone_description_content" } } - .description.md.gl-px-0.gl-pt-4.gl-border-1.gl-border-t-solid.gl-border-gray-100 + .description.md.gl-px-0.gl-pt-4 = markdown_field(milestone, :description) diff --git a/app/views/shared/milestones/_form_dates.html.haml b/app/views/shared/milestones/_form_dates.html.haml index 50e3e8e195c..3e75775bf73 100644 --- a/app/views/shared/milestones/_form_dates.html.haml +++ b/app/views/shared/milestones/_form_dates.html.haml @@ -1,11 +1,14 @@ -.form-group.row - .col-form-label.col-sm-2 +.gl-form-group + %div = f.label :start_date, _('Start Date') - .col-sm-4 - = f.gitlab_ui_datepicker :start_date, data: { qa_selector: "start_date_field" }, placeholder: _('Select start date'), autocomplete: 'off' - %a.inline.float-right.gl-mt-2.js-clear-start-date{ href: "#" }= _('Clear start date') - .col-form-label.col-sm-2 + %div + .issuable-form-select-holder + = f.gitlab_ui_datepicker :start_date, data: { qa_selector: "start_date_field" }, placeholder: _('Select start date'), autocomplete: 'off' + %a.gl-white-space-nowrap.gl-pl-4.js-clear-start-date{ href: "#" }= _('Clear start date') +.gl-form-group + %div = f.label :due_date, _('Due Date') - .col-sm-4 - = f.gitlab_ui_datepicker :due_date, data: { qa_selector: "due_date_field" }, placeholder: _('Select due date'), autocomplete: 'off' - %a.inline.float-right.gl-mt-2.js-clear-due-date{ href: "#" }= _('Clear due date') + %div + .issuable-form-select-holder + = f.gitlab_ui_datepicker :due_date, data: { qa_selector: "due_date_field" }, placeholder: _('Select due date'), autocomplete: 'off' + %a.gl-white-space-nowrap.gl-pl-4.js-clear-due-date{ href: "#" }= _('Clear due date') diff --git a/app/views/shared/milestones/_header.html.haml b/app/views/shared/milestones/_header.html.haml index 900c71675d9..3413d6ff399 100644 --- a/app/views/shared/milestones/_header.html.haml +++ b/app/views/shared/milestones/_header.html.haml @@ -1,30 +1,57 @@ -.detail-page-header.milestone-page-header - = gl_badge_tag milestone_status_string(milestone), { variant: milestone_badge_variant(milestone) }, { class: 'gl-mr-3' } +.detail-page-header + .detail-page-header-body.gl-flex-wrap + = gl_badge_tag milestone_status_string(milestone), { variant: milestone_badge_variant(milestone) }, { class: 'gl-mr-3' } - .header-text-content - %span.identifier - %strong - = _('Milestone') - - if milestone.due_date || milestone.start_date - = milestone_date_range(milestone) - - .milestone-buttons - - if can?(current_user, :admin_milestone, @group || @project) - = render Pajamas::ButtonComponent.new(href: edit_milestone_path(milestone), button_options: { class: 'btn-grouped' }) do - = _('Edit') - - - if milestone.project_milestone? && milestone.project.group - = render Pajamas::ButtonComponent.new(button_options: { class: 'js-promote-project-milestone-button btn-grouped', data: { milestone_title: milestone.title, group_name: milestone.project.group.name, url: promote_project_milestone_path(milestone.project, milestone) }, disabled: true }) do - = _('Promote') - #promote-milestone-modal + .header-text-content + %span.identifier + %strong + = _('Milestone') + - if milestone.due_date || milestone.start_date + = milestone_date_range(milestone) + = render Pajamas::ButtonComponent.new(icon: 'chevron-double-lg-left', button_options: { 'aria-label' => _('Toggle sidebar'), class: 'btn-grouped gl-float-right! gl-sm-display-none js-sidebar-toggle' }) + - if can?(current_user, :admin_milestone, @group || @project) + .milestone-buttons.detail-page-header-actions.gl-display-flex.gl-align-self-start - if milestone.active? - = render Pajamas::ButtonComponent.new(href: update_milestone_path(milestone, { state_event: :close }), method: :put, button_options: { class: 'btn-grouped btn-close' }) do + = render Pajamas::ButtonComponent.new(href: update_milestone_path(milestone, { state_event: :close }), method: :put, button_options: { class: 'btn-close gl-display-none gl-md-display-inline-block' }) do = _('Close milestone') - else - = render Pajamas::ButtonComponent.new(href: update_milestone_path(milestone, { state_event: :activate }), method: :put, button_options: { class: 'btn-grouped' }) do + = render Pajamas::ButtonComponent.new(href: update_milestone_path(milestone, { state_event: :activate }), method: :put, button_options: { class: 'gl-display-none gl-md-display-inline-block' }) do = _('Reopen milestone') - = render 'shared/milestones/delete_button' - - = render Pajamas::ButtonComponent.new(icon: 'chevron-double-lg-left', button_options: { 'aria-label' => _('Toggle sidebar'), class: 'btn-grouped gl-float-right! gl-sm-display-none js-sidebar-toggle' }) + .btn-group.gl-md-ml-3.gl-display-flex.dropdown.gl-dropdown.gl-md-w-auto.gl-w-full + = button_tag type: 'button', class: "btn dropdown-toggle btn-default btn-md gl-button gl-dropdown-toggle btn-default-tertiary dropdown-icon-only dropdown-toggle-no-caret has-tooltip gl-display-none! gl-md-display-inline-flex!", data: { toggle: 'dropdown', title: _('Milestone actions'), testid: 'milestone-actions', 'aria-label': _('Milestone actions') }, aria: { label: _('Milestone actions') } do + = sprite_icon "ellipsis_v", size: 16, css_class: "dropdown-icon gl-icon" + = button_tag type: 'button', class: "btn dropdown-toggle btn-default btn-md btn-block gl-button gl-dropdown-toggle gl-md-display-none!", data: { 'toggle' => 'dropdown' } do + %span.gl-dropdown-button-text= _('Milestone actions') + = sprite_icon "chevron-down", size: 16, css_class: "dropdown-icon gl-icon" + .dropdown-menu.dropdown-menu-right + .gl-dropdown-inner + .gl-dropdown-contents + %ul + %li.gl-dropdown-item + = link_to edit_milestone_path(milestone), class: 'menu-item' do + .gl-dropdown-item-text-wrapper + = _('Edit') + - if milestone.project_milestone? && milestone.project.group + %li.gl-dropdown-item + %button.gl-button.btn.btn-link.menu-item.js-promote-project-milestone-button{ data: { milestone_title: milestone.title, + group_name: milestone.project.group.name, + url: promote_project_milestone_path(milestone.project, milestone)}, + disabled: true, + type: 'button' } + .gl-dropdown-item-text-wrapper + = _('Promote') + #promote-milestone-modal + - if milestone.active? + %li.gl-dropdown-item{ class: "gl-md-display-none!" } + = link_to update_milestone_path(milestone, { state_event: :close }), method: :put, class: 'menu-item' do + .gl-dropdown-item-text-wrapper + = _('Close milestone') + - else + %li.gl-dropdown-item{ class: "gl-md-display-none!" } + = link_to update_milestone_path(milestone, { state_event: :activate }), method: :put, class: 'menu-item' do + .gl-dropdown-item-text-wrapper + = _('Reopen milestone') + %li.gl-dropdown-item + = render 'shared/milestones/delete_button' diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index cc1965945ac..5477b9395ea 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -1,7 +1,7 @@ - affix_offset = local_assigns.fetch(:affix_offset, "50") - project = local_assigns[:project] -%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => affix_offset, "spy" => "affix", "always-show-toggle" => true }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite', 'aria-label': _('Milestone') } +%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => affix_offset, "spy" => "affix", "always-show-toggle" => true }, class: sidebar_gutter_collapsed_class(false), 'aria-live' => 'polite', 'aria-label': _('Milestone') } .issuable-sidebar.milestone-sidebar .block.milestone-progress.issuable-sidebar-header %a.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ role: "button", href: "#", "aria-label" => s_('MilestoneSidebar|Toggle sidebar'), title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } } diff --git a/app/views/shared/nav/_admin_scope_header.html.haml b/app/views/shared/nav/_admin_scope_header.html.haml new file mode 100644 index 00000000000..3a18b3660d4 --- /dev/null +++ b/app/views/shared/nav/_admin_scope_header.html.haml @@ -0,0 +1,6 @@ +%li.context-header + = link_to admin_root_path, title: _('Admin Area'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do + %span.avatar-container.icon-avatar.rect-avatar.s32 + = sprite_icon('admin', size: 18) + %span.sidebar-context-title + = _('Admin Area') diff --git a/app/views/shared/nav/_explore_scope_header.html.haml b/app/views/shared/nav/_explore_scope_header.html.haml new file mode 100644 index 00000000000..da22d6dbcf2 --- /dev/null +++ b/app/views/shared/nav/_explore_scope_header.html.haml @@ -0,0 +1,6 @@ +%li.context-header + = link_to explore_root_url, title: _('Explore'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do + %span.avatar-container.icon-avatar.rect-avatar.s32 + = sprite_icon('compass', size: 18) + %span.sidebar-context-title + = _('Explore') diff --git a/app/views/shared/nav/_user_settings_scope_header.html.haml b/app/views/shared/nav/_user_settings_scope_header.html.haml new file mode 100644 index 00000000000..c1601822736 --- /dev/null +++ b/app/views/shared/nav/_user_settings_scope_header.html.haml @@ -0,0 +1,4 @@ +%li.context-header + = link_to profile_path, title: _('User Settings'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do + = render Pajamas::AvatarComponent.new(current_user, size: 32, alt: current_user.name, class: 'gl-mr-3 js-sidebar-user-avatar', avatar_options: { data: { testid: 'sidebar-user-avatar' } }) + %span.sidebar-context-title= _('User Settings') diff --git a/app/views/shared/notes/_edit_form.html.haml b/app/views/shared/notes/_edit_form.html.haml index cbf0b6f1051..72081856da6 100644 --- a/app/views/shared/notes/_edit_form.html.haml +++ b/app/views/shared/notes/_edit_form.html.haml @@ -9,6 +9,7 @@ .note-form-actions.clearfix .settings-message.note-edit-warning.js-finish-edit-warning = _("Finish editing this message first!") - = submit_tag _('Save comment'), class: 'gl-button btn btn-confirm js-comment-save-button', data: { qa_selector: 'save_comment_button' } + = render Pajamas::ButtonComponent.new(type: 'submit', variant: :confirm, button_options: { class: 'js-comment-save-button', data: { qa_selector: 'save_comment_button' } }) do + = _("Save comment") = render Pajamas::ButtonComponent.new(button_options: { class: 'note-edit-cancel' }) do = _("Cancel") diff --git a/app/views/shared/notes/_hints.html.haml b/app/views/shared/notes/_hints.html.haml index fb000b9aab1..d7d6e477ab1 100644 --- a/app/views/shared/notes/_hints.html.haml +++ b/app/views/shared/notes/_hints.html.haml @@ -1,7 +1,7 @@ - supports_quick_actions = local_assigns.fetch(:supports_quick_actions, false) - supports_file_upload = local_assigns.fetch(:supports_file_upload, true) -.comment-toolbar.clearfix - .toolbar-text +.comment-toolbar.gl-mx-2.gl-mb-2.gl-px-4.gl-bg-gray-10.gl-rounded-bottom-left-base.gl-rounded-bottom-right-base.clearfix + .toolbar-text.gl-font-sm - markdownLinkStart = ''.html_safe % { url: help_page_path('user/markdown') } - quickActionsLinkStart = ''.html_safe % { url: help_page_path('user/project/quick_actions') } - if supports_quick_actions @@ -9,7 +9,7 @@ - else = html_escape(s_('MarkdownToolbar|Supports %{markdownDocsLinkStart}Markdown%{markdownDocsLinkEnd}')) % { markdownDocsLinkStart: markdownLinkStart, markdownDocsLinkEnd: ''.html_safe } - if supports_file_upload - %span.uploading-container.gl-line-height-32 + %span.uploading-container.gl-line-height-32.gl-font-sm %span.uploading-progress-container.hide = sprite_icon('paperclip', css_class: 'gl-icon gl-vertical-align-text-bottom') %span.attaching-file-message diff --git a/app/views/shared/notes/_note.html.haml b/app/views/shared/notes/_note.html.haml index c552e94ac57..95e0beee5e0 100644 --- a/app/views/shared/notes/_note.html.haml +++ b/app/views/shared/notes/_note.html.haml @@ -12,7 +12,7 @@ note_id: note.id } } .timeline-entry-inner - if note.system - .timeline-icon + .gl-float-left.gl--flex-center.gl-rounded-full.gl-mt-n1.gl-ml-2.gl-w-6.gl-h-6.gl-bg-gray-50.gl-text-gray-600 = icon_for_system_note(note) - else .timeline-avatar.gl-float-left diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index 09d63347ed6..a2c831bfd1c 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -10,13 +10,12 @@ - skip_pagination = false unless local_assigns[:skip_pagination] == true - compact_mode = false unless local_assigns[:compact_mode] == true - css_classes = "#{'compact' if compact_mode} #{'explore' if explore_projects_tab?}" -- contributed_projects_illustration_path = 'illustrations/profile-page/contributed-projects.svg' - contributed_projects_current_user_empty_message_header = s_('UserProfile|Explore public groups to find projects to contribute to.') - contributed_projects_visitor_empty_message = s_('UserProfile|This user hasn\'t contributed to any projects') -- starred_projects_illustration_path = 'illustrations/starred_empty.svg' +- starred_projects_illustration_path = 'illustrations/empty-state/empty-projects-starred-md.svg' - starred_projects_current_user_empty_message_header = s_('UserProfile|Star projects to track their progress and show your appreciation.') - starred_projects_visitor_empty_message = s_('UserProfile|This user hasn\'t starred any projects') -- own_projects_illustration_path = 'illustrations/profile-page/personal-project.svg' +- own_projects_illustration_path = 'illustrations/empty-state/empty-projects-md.svg' - own_projects_current_user_empty_message_header = s_('UserProfile|You haven\'t created any personal projects.') - own_projects_current_user_empty_message_description = s_('UserProfile|Your projects can be available publicly, internally, or privately, at your choice.') - own_projects_visitor_empty_message = s_('UserProfile|There are no projects available to be displayed here.') @@ -43,7 +42,7 @@ = paginate_collection(projects, remote: remote) unless skip_pagination - else - if @contributed_projects - = render partial: 'shared/empty_states/profile_tabs', locals: { illustration_path: contributed_projects_illustration_path, + = render partial: 'shared/empty_states/profile_tabs', locals: { illustration_path: own_projects_illustration_path, current_user_empty_message_header: contributed_projects_current_user_empty_message_header, primary_button_label: new_project_button_label, primary_button_link: new_project_button_link, diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index 2adc7844a67..79a33316b1a 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -12,10 +12,9 @@ - cache_key = project_list_cache_key(project, pipeline_status: pipeline_status) - updated_tooltip = time_ago_with_tooltip(project.last_activity_date) - show_pipeline_status_icon = pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project) -- last_pipeline = project.last_pipeline if show_pipeline_status_icon +- last_pipeline = last_pipeline_from_status_cache(project) if show_pipeline_status_icon - css_controls_class = "with-pipeline-status" if show_pipeline_status_icon && last_pipeline.present? -- css_controls_container_class = compact_mode ? "" : "gl-lg-flex-direction-row gl-justify-content-space-between" -- css_metadata_classes = "gl-display-flex gl-align-items-center gl-mr-5 gl-reset-color! icon-wrapper has-tooltip" +- css_metadata_classes = "gl-display-flex gl-align-items-center gl-ml-5 gl-reset-color! icon-wrapper has-tooltip" %li.project-row = cache(cache_key) do @@ -28,7 +27,7 @@ = render Pajamas::AvatarComponent.new(project, size: 48, alt: '', class: 'gl-mr-5') .project-cell{ class: css_class } .project-details.gl-pr-9.gl-sm-pr-0.gl-w-full.gl-display-flex.gl-flex-direction-column{ data: { qa_selector: 'project_content', qa_project_name: project.name } } - .gl-display-flex.gl-align-items-center.gl-flex-wrap-wrap + .gl-display-flex.gl-align-items-center.gl-flex-wrap %h2.gl-font-base.gl-line-height-20.gl-my-0 = link_to project_path(project), class: 'text-plain gl-mr-3 js-prefetch-document' do %span.namespace-name.gl-font-weight-normal @@ -55,10 +54,10 @@ = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project, additional_classes: 'gl-ml-3!' - if show_last_commit_as_description - .description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2 + .description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2.gl-font-sm = link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message") - elsif project.description.present? - .description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2 + .description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2.gl-font-sm = markdown_field(project, :description) - if project.topics.any? @@ -71,7 +70,7 @@ .controls.gl-display-flex.gl-align-items-center - if show_pipeline_status_icon && last_pipeline.present? - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref) - %span.icon-wrapper.pipeline-status.gl-mr-5 + %span.icon-wrapper.pipeline-status = render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path = render_if_exists 'shared/projects/archived', project: project @@ -79,17 +78,17 @@ = link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' } do = sprite_icon('star-o', size: 14, css_class: 'gl-mr-2') = badge_count(project.star_count) - .updated-note.gl-ml-3.gl-sm-ml-0 + .updated-note.gl-font-sm.gl-ml-3.gl-sm-ml-0 %span = _('Updated') = updated_tooltip .project-cell{ class: "#{css_class} gl-xs-display-none!" } - .project-controls.gl-display-flex.gl-flex-direction-column.gl-w-full{ class: css_controls_container_class, data: { testid: 'project_controls'} } - .controls.gl-display-flex.gl-align-items-center{ class: css_controls_class } + .project-controls.gl-display-flex.gl-flex-direction-column.gl-align-items-flex-end.gl-w-full{ data: { testid: 'project_controls'} } + .controls.gl-display-flex.gl-align-items-center.gl-mb-2{ class: "#{css_controls_class} gl-pr-0!" } - if show_pipeline_status_icon && last_pipeline.present? - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref) - %span.icon-wrapper.pipeline-status.gl-mr-5 + %span.icon-wrapper.pipeline-status = render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path = render_if_exists 'shared/projects/archived', project: project @@ -109,7 +108,7 @@ = link_to project_issues_path(project), class: "#{css_metadata_classes} issues", title: _('Issues'), data: { container: 'body', placement: 'top' } do = sprite_icon('issues', size: 14, css_class: 'gl-mr-2') = badge_count(project.open_issues_count) - .updated-note.gl-white-space-nowrap.gl-justify-content-end + .updated-note.gl-font-sm.gl-white-space-nowrap.gl-justify-content-end %span = _('Updated') = updated_tooltip diff --git a/app/views/shared/projects/_search_form.html.haml b/app/views/shared/projects/_search_form.html.haml index 47e0e165276..72709b3ed2f 100644 --- a/app/views/shared/projects/_search_form.html.haml +++ b/app/views/shared/projects/_search_form.html.haml @@ -2,7 +2,7 @@ - admin_view ||= false - top_padding = admin_view ? 'gl-lg-pt-3' : '' -= form_tag filter_projects_path, method: :get, class: "project-filter-form gl-display-flex! gl-flex-wrap-wrap gl-w-full gl-gap-3 #{top_padding}", data: { qa_selector: 'project_filter_form_container' }, id: 'project-filter-form' do |f| += form_tag filter_projects_path, method: :get, class: "project-filter-form gl-display-flex! gl-flex-wrap gl-w-full gl-gap-3 #{top_padding}", data: { qa_selector: 'project_filter_form_container' }, id: 'project-filter-form' do |f| = search_field_tag :name, params[:name], placeholder: placeholder, class: "project-filter-form-field form-control input-short js-projects-list-filter gl-m-0!", diff --git a/app/views/shared/projects/_topics.html.haml b/app/views/shared/projects/_topics.html.haml index be513af4e3f..12246d1dcfa 100644 --- a/app/views/shared/projects/_topics.html.haml +++ b/app/views/shared/projects/_topics.html.haml @@ -1,31 +1,29 @@ -- cache_enabled = false unless local_assigns[:cache_enabled] == true - max_project_topic_length = 15 - if project.topics.present? - = cache_if(cache_enabled, [project, :topic_list], expires_in: 1.day) do - .gl-w-full.gl-display-inline-flex.gl-flex-wrap.gl-font-base.gl-font-weight-normal.gl-align-items-center.gl-mx-n2.gl-my-n2{ 'data-testid': 'project_topic_list' } - %span.gl-p-2.gl-text-gray-500 - = _('Topics') + ':' - - project.topics_to_show.each do |topic| - - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) - - if topic[:title].length > max_project_topic_length - %a.gl-p-2.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) - - else - %a.gl-p-2{ href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag topic[:title] + .gl-w-full.gl-display-inline-flex.gl-flex-wrap.gl-font-base.gl-font-weight-normal.gl-align-items-center.gl-mx-n2.gl-my-n2{ 'data-testid': 'project_topic_list' } + %span.gl-p-2.gl-text-gray-500 + = _('Topics') + ':' + - project.topics_to_show.each do |topic| + - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) + - if topic[:title].length > max_project_topic_length + %a.gl-p-2.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) + - else + %a.gl-p-2{ href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag topic[:title] - - if project.has_extra_topics? - - title = _('More topics') - - content = capture do - %span.gl-display-inline-flex.gl-flex-wrap - - project.topics_not_shown.each do |topic| - - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) - - if topic[:title].length > max_project_topic_length - %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) - - else - %a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag topic[:title] - .text-nowrap.gl-p-2{ role: 'button', tabindex: 0, data: { toggle: 'popover', triggers: 'focus hover', html: 'true', placement: 'top', title: title, content: content } } - = _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown } + - if project.has_extra_topics? + - title = _('More topics') + - content = capture do + %span.gl-display-inline-flex.gl-flex-wrap + - project.topics_not_shown.each do |topic| + - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) + - if topic[:title].length > max_project_topic_length + %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) + - else + %a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag topic[:title] + .text-nowrap.gl-p-2{ role: 'button', tabindex: 0, data: { toggle: 'popover', triggers: 'focus hover', html: 'true', placement: 'top', title: title, content: content } } + = _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown } diff --git a/app/views/shared/runners/_runner_details.html.haml b/app/views/shared/runners/_runner_details.html.haml index f6396168cb3..686cd1a081b 100644 --- a/app/views/shared/runners/_runner_details.html.haml +++ b/app/views/shared/runners/_runner_details.html.haml @@ -1,8 +1,5 @@ -- breadcrumb_title runner.short_sha -- page_title "##{runner.id} (#{runner.short_sha})" - %h1.page-title.gl-font-size-h-display - = s_('Runners|Runner #%{runner_id}' % { runner_id: runner.id }) + = s_('Runners|Runner #%{runner_id}') % { runner_id: runner.id } = render 'shared/runners/runner_type_badge', runner: runner .table-holder diff --git a/app/views/shared/topics/_topic.html.haml b/app/views/shared/topics/_topic.html.haml index 83d5ecdb833..9b9630733fd 100644 --- a/app/views/shared/topics/_topic.html.haml +++ b/app/views/shared/topics/_topic.html.haml @@ -5,9 +5,8 @@ = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }, body_options: { class: 'gl-display-flex gl-align-items-center' }) do |c| = c.body do - .avatar-container.rect-avatar.s40.gl-flex-shrink-0 - = link_to detail_page_link do - = topic_icon(topic, class: "avatar s40") + = link_to detail_page_link do + = render Pajamas::AvatarComponent.new(topic, size: 48, alt: '', class: 'gl-mr-3') = link_to detail_page_link do - if topic.title_or_name.length > max_topic_title_length %h5.gl-str-truncated.has-tooltip{ title: topic.title_or_name } diff --git a/app/views/shared/users/index.html.haml b/app/views/shared/users/index.html.haml index dd6b14d6be2..ef5552943df 100644 --- a/app/views/shared/users/index.html.haml +++ b/app/views/shared/users/index.html.haml @@ -1,7 +1,7 @@ -- followers_illustration_path = 'illustrations/starred_empty.svg' +- followers_illustration_path = 'illustrations/empty-state/empty-friends-md.svg' - followers_visitor_empty_message = s_('UserProfile|This user doesn\'t have any followers.') - followers_current_user_empty_message_header = s_('UserProfile|You do not have any followers.') -- following_illustration_path = 'illustrations/starred_empty.svg' +- following_illustration_path = 'illustrations/empty-state/empty-friends-md.svg' - following_visitor_empty_message = s_('UserProfile|This user isn\'t following other users.') - following_current_user_empty_message_header = s_('UserProfile|You are not following other users.') diff --git a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml index d9155b397b8..f8e2dc3d8dd 100644 --- a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml +++ b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml @@ -8,6 +8,6 @@ = c.body do = s_('Webhooks|A webhook in this project was automatically disabled after being retried multiple times.') = succeed '.' do - = link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshoot-webhooks'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer' = c.actions do = link_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'btn gl-alert-action btn-confirm gl-button' diff --git a/app/views/shared/wikis/_sidebar_wiki_page.html.haml b/app/views/shared/wikis/_sidebar_wiki_page.html.haml index 38a7e6fc813..2c5c3aa68a3 100644 --- a/app/views/shared/wikis/_sidebar_wiki_page.html.haml +++ b/app/views/shared/wikis/_sidebar_wiki_page.html.haml @@ -1,3 +1,7 @@ +- wiki_path = wiki_page_path(@wiki, wiki_page) + %li{ class: active_when(params[:id] == wiki_page.slug) } - = link_to wiki_page_path(@wiki, wiki_page), data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do - = wiki_page.human_title + .gl-relative.gl-display-flex.gl-align-items-center.js-wiki-list-toggle.wiki-list{ data: { testid: 'wiki-list' } } + = render Pajamas::ButtonComponent.new(icon: 'plus', href: "#{wiki_path}/{new_page_title}", button_options: { class: 'wiki-list-create-child-button gl-bg-transparent! gl-hover-bg-gray-50! gl-focus-bg-gray-50! gl-absolute gl-top-half gl-translate-y-n50 gl-cursor-pointer gl-right-3' }) + = link_to wiki_path, data: { qa_selector: 'wiki_page_link', qa_page_name: wiki_page.human_title } do + = wiki_page.human_title diff --git a/app/views/shared/wikis/_wiki_directory.html.haml b/app/views/shared/wikis/_wiki_directory.html.haml index 5c2233a4db2..6a066e0a838 100644 --- a/app/views/shared/wikis/_wiki_directory.html.haml +++ b/app/views/shared/wikis/_wiki_directory.html.haml @@ -1,6 +1,12 @@ +- wiki_path = wiki_page_path(@wiki, wiki_directory) + %li{ class: active_when(params[:id] == wiki_directory.slug), data: { qa_selector: 'wiki_directory_content' } } - = link_to wiki_page_path(@wiki, wiki_directory), data: { qa_selector: 'wiki_dir_page_link', qa_page_name: wiki_directory.title } do - = wiki_directory.title + .gl-relative.gl-display-flex.gl-align-items-center.js-wiki-list-toggle.wiki-list{ data: { testid: 'wiki-list' } }< + = sprite_icon('chevron-right', css_class: 'js-wiki-list-expand-button wiki-list-expand-button gl-mr-2 gl-cursor-pointer') + = sprite_icon('chevron-down', css_class: 'js-wiki-list-collapse-button wiki-list-collapse-button gl-mr-2 gl-cursor-pointer') + = render Pajamas::ButtonComponent.new(icon: 'plus', href: "#{wiki_path}/{new_page_title}", button_options: { class: 'wiki-list-create-child-button gl-bg-transparent! gl-hover-bg-gray-50! gl-focus-bg-gray-50! gl-absolute gl-top-half gl-translate-y-n50 gl-cursor-pointer gl-right-3' }) + = link_to wiki_path, data: { qa_selector: 'wiki_dir_page_link', qa_page_name: wiki_directory.title } do + = wiki_directory.title %ul - wiki_directory.entries.each do |entry| = render partial: entry.to_partial_path, object: entry, locals: { context: context } diff --git a/app/views/shared/wikis/diff.html.haml b/app/views/shared/wikis/diff.html.haml index c39739ac422..ee6c7f307a7 100644 --- a/app/views/shared/wikis/diff.html.haml +++ b/app/views/shared/wikis/diff.html.haml @@ -28,5 +28,5 @@ %pre.commit-description< = preserve(markdown_field(commit, :description)) -= render 'projects/diffs/diffs', diffs: @diffs += render 'projects/diffs/diffs', diffs: @diffs, diff_page_context: "is-wiki" = render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/empty.html.haml b/app/views/shared/wikis/empty.html.haml index c52ead74b4c..d30a37aaa3e 100644 --- a/app/views/shared/wikis/empty.html.haml +++ b/app/views/shared/wikis/empty.html.haml @@ -2,4 +2,12 @@ - @right_sidebar = false - add_page_specific_style 'page_bundles/wiki' -= render 'shared/empty_states/wikis' +- if @error.present? + = render Pajamas::AlertComponent.new(alert_options: { id: 'error_explanation', class: 'gl-mb-3'}, + dismissible: false, + variant: :danger) do |c| + = c.body do + %ul.gl-pl-4 + = @error + += render 'shared/empty_states/wikis', hide_create: @error.present? -- cgit v1.2.3