diff options
Diffstat (limited to 'app/views/shared')
33 files changed, 137 insertions, 212 deletions
diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index c2b941c6106..93f919f01d9 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -1,13 +1,16 @@ -= render Pajamas::BannerComponent.new(button_text: s_('AutoDevOps|Enable in settings'), - button_link: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), - svg_path: 'illustrations/autodevops.svg', - banner_options: { class: 'js-autodevops-banner', data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }, - close_options: { 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box'), class: 'js-close-callout' }) do |c| - - c.title do - = s_('AutoDevOps|Auto DevOps') +- container = @no_breadcrumb_container ? 'container-fluid' : container_class - %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') +%div{ class: [container, @content_class, 'gl-pt-5!'] } + = render Pajamas::BannerComponent.new(button_text: s_('AutoDevOps|Enable in settings'), + button_link: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), + svg_path: 'illustrations/autodevops.svg', + banner_options: { class: 'js-autodevops-banner auto-devops-callout', data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }, + close_options: { 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box'), class: 'js-close-callout' }) do |c| + - c.title do + = s_('AutoDevOps|Auto DevOps') - %p - - link = link_to(s_('AutoDevOps|Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer') - = s_('AutoDevOps|Learn more in the %{link_to_documentation}').html_safe % { link_to_documentation: link } + %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') + + %p + - link = link_to(s_('AutoDevOps|Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer') + = s_('AutoDevOps|Learn more in the %{link_to_documentation}').html_safe % { link_to_documentation: link } diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index 73ace033dc6..a749d1037a1 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -1,16 +1,28 @@ +-# We're not using `link_to` in the line loop because it is too slow once we get to thousands of lines. + +- 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 + +- highlighted_blob = blob.present.highlight + #blob-content.file-content.code.js-syntax-highlight - - offset = defined?(first_line_number) ? first_line_number : 1 - - if Feature.enabled?(:file_line_blame) - - blame_path = project_blame_path(@project, tree_join(@ref, blob.path)) .line-numbers{ class: "gl-px-0!", data: { blame_path: blame_path } } - if blob.data.present? - - blob.data.each_line.each_with_index do |_, index| + - highlighted_blob.lines.count.times do |index| - i = index + offset - -# We're not using `link_to` because it is too slow once we get to thousands of lines. - %a.file-line-num.diff-line-num{ class: ("js-line-links" if Feature.enabled?(:file_line_blame)), href: "#L#{i}", id: "L#{i}", 'data-line-number' => i } + + %a.file-line-num.diff-line-num{ class: line_class, href: "#L#{i}", id: "L#{i}", 'data-line-number' => i } = i - - highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil + .blob-content{ data: { blob_id: blob.id, path: blob.path, highlight_line: highlight, qa_selector: 'file_content' } } %pre.code.highlight %code - = blob.present.highlight + = highlighted_blob diff --git a/app/views/shared/_ide_root.html.haml b/app/views/shared/_ide_root.html.haml new file mode 100644 index 00000000000..848ff1e5728 --- /dev/null +++ b/app/views/shared/_ide_root.html.haml @@ -0,0 +1,11 @@ +- data = local_assigns.fetch(:data) +- loading_text = local_assigns.fetch(:loading_text) + +-# Fix for iOS 13+, the height of the page is actually less than +-# 100vh because of the presence of the bottom bar +- @body_class = 'gl-max-h-full gl-fixed' + +#ide.gl--flex-center.gl-h-full{ data: data } + .gl-text-center + = gl_loading_icon(size: 'md') + %h2.clgray= loading_text diff --git a/app/views/shared/_issuable_meta_data.html.haml b/app/views/shared/_issuable_meta_data.html.haml index 01ab7bf9cd4..982d3b68792 100644 --- a/app/views/shared/_issuable_meta_data.html.haml +++ b/app/views/shared/_issuable_meta_data.html.haml @@ -6,23 +6,23 @@ - issuable_mr = @issuable_meta_data[issuable.id].merge_requests_count - if issuable_mr > 0 - %li.issuable-mr.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Related merge requests'), data: { testid: 'merge-requests' } } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Related merge requests'), data: { testid: 'merge-requests' } } = sprite_icon('merge-request', css_class: "gl-vertical-align-middle") = issuable_mr - if upvotes > 0 - %li.issuable-upvotes.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Upvotes') } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Upvotes'), data: { testid: 'issuable-upvotes' } } = sprite_icon('thumb-up', css_class: "gl-vertical-align-middle") = upvotes - if downvotes > 0 - %li.issuable-downvotes.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Downvotes') } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Downvotes'), data: { testid: 'issuable-downvotes' } } = sprite_icon('thumb-down', css_class: "gl-vertical-align-middle") = downvotes = render_if_exists 'shared/issuable/blocking_issues_count', issuable: issuable -%li.issuable-comments.gl-display-none.gl-sm-display-block - = link_to issuable_path, class: ['has-tooltip', ('no-comments' if note_count == 0)], title: _('Comments') do +%li.gl-display-none.gl-sm-display-block + = link_to issuable_path, class: ['has-tooltip', ('no-comments' if note_count == 0)], title: _('Comments'), data: { testid: 'issuable-comments' } do = sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom') = note_count diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 1645c2695b5..8a626f1620b 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -32,17 +32,17 @@ - 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 + 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 + 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 + = 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 @@ -51,11 +51,11 @@ .dropdown-menu.dropdown-open-left %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 + = 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 + = 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 + = 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) diff --git a/app/views/shared/_milestones_filter.html.haml b/app/views/shared/_milestones_filter.html.haml index ef41dc9bb79..0053f2fe444 100644 --- a/app/views/shared/_milestones_filter.html.haml +++ b/app/views/shared/_milestones_filter.html.haml @@ -1,6 +1,6 @@ - count_badge_classes = 'gl-display-none gl-sm-display-inline-flex' -= gl_tabs_nav( {class: 'gl-border-b-0 gl-flex-grow-1', data: { testid: 'milestones-filter' } } ) do += gl_tabs_nav({class: 'gl-border-b-0 gl-flex-grow-1', data: { testid: 'milestones-filter' } }) do = gl_tab_link_to milestones_filter_path(state: 'opened'), { item_active: params[:state].blank? || params[:state] == 'opened' } do = _('Open') = gl_tab_counter_badge counts[:opened], { class: count_badge_classes } diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml index 0bd5d1795d0..d080d8be8fe 100644 --- a/app/views/shared/_new_project_item_select.html.haml +++ b/app/views/shared/_new_project_item_select.html.haml @@ -1,5 +1,5 @@ - if any_projects?(@projects) - .dropdown.b-dropdown.gl-new-dropdown.btn-group.project-item-select-holder{ class: 'gl-display-inline-flex!' } + .dropdown.b-dropdown.gl-dropdown.btn-group.project-item-select-holder{ class: 'gl-display-inline-flex!' } %a.btn.gl-button.btn-confirm.split-content-button.js-new-project-item-link.block-truncated{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] } } = gl_loading_icon(inline: true, color: 'light') = project_select_tag :project_path, class: "project-item-select gl-absolute! gl-visibility-hidden", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path], with_shared: local_assigns[:with_shared], include_projects_in_subgroups: local_assigns[:include_projects_in_subgroups] }, with_feature_enabled: local_assigns[:with_feature_enabled] diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml index 20bf2141cc3..fa718a9c907 100644 --- a/app/views/shared/_ref_switcher.html.haml +++ b/app/views/shared/_ref_switcher.html.haml @@ -13,7 +13,7 @@ - @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, 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_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") diff --git a/app/views/shared/_web_ide_button.html.haml b/app/views/shared/_web_ide_button.html.haml index 83646a3c92e..aeaccdfa54b 100644 --- a/app/views/shared/_web_ide_button.html.haml +++ b/app/views/shared/_web_ide_button.html.haml @@ -2,4 +2,4 @@ - button_data = web_ide_button_data({ blob: blob }) - fork_options = fork_modal_options(@project, @ref, @path, blob) -.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json }, id: "js-#{type}-web-ide-link" } +.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json, web_ide_promo_popover_img: image_path('web-ide-promo-popover.svg') }, id: "js-#{type}-web-ide-link" } diff --git a/app/views/shared/builds/_tabs.html.haml b/app/views/shared/builds/_tabs.html.haml index 8e4b8d6d428..8f2b9fc06e3 100644 --- a/app/views/shared/builds/_tabs.html.haml +++ b/app/views/shared/builds/_tabs.html.haml @@ -1,6 +1,6 @@ - count_badge_classes = 'gl-display-none gl-sm-display-inline-flex' -= gl_tabs_nav( {class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1 gl-w-full nav gl-border-b-0', data: { testid: 'jobs-tabs' } } ) do += gl_tabs_nav({class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1 gl-w-full nav gl-border-b-0', data: { testid: 'jobs-tabs' } }) do = gl_tab_link_to build_path_proc.call(nil), { item_active: scope.nil? } do = _('All') = gl_tab_counter_badge(limited_counter_with_delimiter(all_builds), { class: count_badge_classes }) diff --git a/app/views/shared/empty_states/_milestones.html.haml b/app/views/shared/empty_states/_milestones.html.haml index fb69e75370e..0d7dbd1415b 100644 --- a/app/views/shared/empty_states/_milestones.html.haml +++ b/app/views/shared/empty_states/_milestones.html.haml @@ -6,7 +6,7 @@ .svg-content = image_tag 'illustrations/milestone_burndown_chart.svg' .col-12 - .text-content + .text-content.text-center %h4= s_('Milestones|Use milestones to track issues and merge requests over a fixed period of time') %p.state-description = s_('Milestones|Organize issues and merge requests into a cohesive group, and set optional start and due dates. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link } diff --git a/app/views/shared/empty_states/_milestones_tab.html.haml b/app/views/shared/empty_states/_milestones_tab.html.haml index f6760b0a3f4..52df30434b4 100644 --- a/app/views/shared/empty_states/_milestones_tab.html.haml +++ b/app/views/shared/empty_states/_milestones_tab.html.haml @@ -12,6 +12,6 @@ %h4.text-center= s_('Milestones|There are no closed milestones') - else %h4.text-center= s_('Milestones|There are no open milestones') - %p.state-description + %p.state-description.text-center = s_('Milestones|Create a milestone to better track your issues and merge requests. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link } = yield diff --git a/app/views/shared/file_hooks/_index.html.haml b/app/views/shared/file_hooks/_index.html.haml index d48e9f3d02e..16e89463a4b 100644 --- a/app/views/shared/file_hooks/_index.html.haml +++ b/app/views/shared/file_hooks/_index.html.haml @@ -11,15 +11,16 @@ .col-lg-8.gl-mb-3 - if file_hooks.any? - .card - .card-header + = render Pajamas::CardComponent.new do |c| + - c.header do = _('File Hooks (%{count})') % { count: file_hooks.count } - %ul.content-list - - file_hooks.each do |file| - %li - .monospace - = File.basename(file) - + - c.body do + %ul.content-list + - file_hooks.each do |file| + %li + .monospace + = File.basename(file) - else - .card.bg-light.text-center - .nothing-here-block= _('No file hooks found.') + = render Pajamas::CardComponent.new do |c| + - c.body do + .nothing-here-block= _('No file hooks found.') diff --git a/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml b/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml new file mode 100644 index 00000000000..9fe1400e877 --- /dev/null +++ b/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml @@ -0,0 +1,4 @@ +- return unless show_security_patch_upgrade_alert? + +#js-security-patch-upgrade-alert{ data: { "current_version": Gitlab.version_info } } +#js-security-patch-upgrade-alert-modal{ data: { "current_version": Gitlab.version_info, "version": gitlab_version_check.to_json } } diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index 896249c6163..dda84e0fb9e 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -6,12 +6,12 @@ = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { qa_selector: 'custom_metrics_container', active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } } + .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 %strong = s_('PrometheusService|Custom metrics') = gl_badge_tag 0, nil, class: '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', data: { qa_selector: 'new_metric_button' } + = 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 .flash-container.hidden .flash-warning diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml index 8ee0ddfa1b1..c74dbfd8b15 100644 --- a/app/views/shared/integrations/prometheus/_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -25,8 +25,8 @@ .card.hidden.js-panel-missing-env-vars .card-header - = 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' ) + = 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 diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index a325ad5f447..07cdbbece8c 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -62,9 +62,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}", class: 'gl-button btn btn-confirm 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', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else - = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2', 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/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 0fd128df997..39a123f4775 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -20,7 +20,7 @@ .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| - .block.assignee{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}", data: { qa_selector: 'assignee_block_container' } } + .block.assignee{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}", data: { qa_selector: 'assignee_block_container', testid: 'assignee-block-container' } } = render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in - if issuable_sidebar[:supports_severity] @@ -101,7 +101,7 @@ .sidebar-collapsed-icon{ data: { toggle: 'tooltip', placement: 'left', container: 'body', boundary: 'viewport' }, title: _('Move issue') } = sprite_icon('long-arrow') .dropdown.sidebar-move-issue-dropdown.hide-collapsed - = render Pajamas::ButtonComponent.new(block: true, button_options: { class: 'js-sidebar-dropdown-toggle js-move-issue', data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } } ) do + = render Pajamas::ButtonComponent.new(block: true, button_options: { class: 'js-sidebar-dropdown-toggle js-move-issue', data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } }) do = _('Move issue') .dropdown-menu.dropdown-menu-selectable.dropdown-extended-height = dropdown_title(_('Move issue')) diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index 51f49c7ca8e..0f6ef33d532 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -4,8 +4,8 @@ - no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty? - toggle_wip_link_start = '<a href="" class="js-toggle-wip">' - toggle_wip_link_end = '</a>' -- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe } ).html_safe -- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.' ) % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe } ).html_safe +- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe }).html_safe +- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe }).html_safe %div{ data: { testid: 'issue-title-input-field' } } = form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true, diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml index 8a9b71fd91e..42f6f7b71a3 100644 --- a/app/views/shared/issue_type/_details_content.html.haml +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -29,7 +29,7 @@ - if can?(current_user, :admin_feature_flags_issue_links, @project) = render_if_exists 'projects/issues/related_feature_flags' - - if can?(current_user, :download_code, @project) + - 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. diff --git a/app/views/shared/nav/_sidebar_submenu.html.haml b/app/views/shared/nav/_sidebar_submenu.html.haml index 344dafe7c0f..33b48470020 100644 --- a/app/views/shared/nav/_sidebar_submenu.html.haml +++ b/app/views/shared/nav/_sidebar_submenu.html.haml @@ -1,5 +1,5 @@ %ul.sidebar-sub-level-items{ class: ('is-fly-out-only' unless sidebar_menu.has_renderable_items?) } - = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' } ) do + = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' }) do %span.fly-out-top-item-container %strong.fly-out-top-item-name = sidebar_menu.title diff --git a/app/views/shared/projects/_dropdown.html.haml b/app/views/shared/projects/_dropdown.html.haml index 88ac03bf9e3..59f8bf0e875 100644 --- a/app/views/shared/projects/_dropdown.html.haml +++ b/app/views/shared/projects/_dropdown.html.haml @@ -1,5 +1,5 @@ - @sort ||= sort_value_latest_activity -.dropdown.js-project-filter-dropdown-wrap +.dropdown.js-project-filter-dropdown-wrap.gl-display-inline = dropdown_toggle(projects_sort_options_hash[@sort], { toggle: 'dropdown', display: 'static' }, { id: 'sort-projects-dropdown' }) %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable %li.dropdown-header diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index 908eb2428e8..40cd81ab3da 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -52,7 +52,7 @@ %span.user-access-role.gl-display-block.gl-m-0{ data: { qa_selector: 'user_role_content' } }= Gitlab::Access.human_access(access) - if !explore_projects_tab? - = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project + = 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 diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml deleted file mode 100644 index 5271a5fac09..00000000000 --- a/app/views/shared/projects/_search_bar.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- @sort ||= sort_value_latest_activity -- project_tab_filter = local_assigns.fetch(:project_tab_filter, "") -- flex_grow_and_shrink_xs = 'd-flex flex-xs-grow-1 flex-xs-shrink-1 flex-grow-0 flex-shrink-0' - -.filtered-search-block.row-content-block.bt-0 - .filtered-search-wrapper.d-flex.gl-flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap - - unless project_tab_filter == :starred - .filtered-search-nav.mb-2.mb-lg-0{ class: flex_grow_and_shrink_xs } - = render 'dashboard/projects/nav', project_tab_filter: project_tab_filter - .filtered-search.d-flex.flex-grow-1.flex-shrink-1.w-100.mb-2.mb-lg-0.ml-0{ class: project_tab_filter == :starred ? "extended-filtered-search-box mb-2 mb-lg-0" : "ml-sm-3" } - .btn-group.w-100{ role: "group" } - .btn-group.w-100{ role: "group" } - .filtered-search-box.m-0 - .filtered-search-box-input-container.pl-2 - = render 'shared/projects/search_form', admin_view: false, search_form_placeholder: _("Search projects...") - = render Pajamas::ButtonComponent.new(icon: 'search', icon_classes: 'search-icon', button_options: { type: 'submit', form: 'project-filter-form' }) - .filtered-search-dropdown.flex-row.align-items-center.mb-2.m-sm-0#filtered-search-visibility-dropdown{ class: flex_grow_and_shrink_xs } - .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold - %span - = _("Visibility") - = render 'explore/projects/filter', has_label: true - .filtered-search-dropdown.flex-row.align-items-center.m-sm-0#filtered-search-sorting-dropdown{ class: flex_grow_and_shrink_xs } - .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold - %span - = _("Sort by") - = render 'shared/projects/sort_dropdown' diff --git a/app/views/shared/projects/_search_form.html.haml b/app/views/shared/projects/_search_form.html.haml index e598343d698..07a6d5bec78 100644 --- a/app/views/shared/projects/_search_form.html.haml +++ b/app/views/shared/projects/_search_form.html.haml @@ -1,10 +1,9 @@ -- form_field_classes = local_assigns[:admin_view] || !Feature.enabled?(:project_list_filter_bar) ? 'input-short js-projects-list-filter' : 'gl-w-full! gl-pl-7 ' - placeholder = local_assigns[:search_form_placeholder] ? search_form_placeholder : _('Filter by name') = form_tag filter_projects_path, method: :get, class: 'project-filter-form', 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 #{form_field_classes}", + class: "project-filter-form-field form-control input-short js-projects-list-filter", spellcheck: false, id: 'project-filter-form-field', autofocus: local_assigns[:autofocus] @@ -24,4 +23,22 @@ - if params[:visibility_level].present? = hidden_field_tag :visibility_level, params[:visibility_level] + - if params[:language].present? + = hidden_field_tag :language, params[:language] + + - if Feature.enabled?(:project_language_search, current_user) + .dropdown.inline + = dropdown_toggle(search_language_placeholder, { toggle: 'dropdown', testid: 'project-language-dropdown' }) + %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable + %li + = link_to _('Any'), filter_projects_path(language: nil) + - programming_languages.each do |language| + %li + = link_to filter_projects_path(language: language.id), class: language_state_class(language) do + = language.name + + = submit_tag nil, class: 'gl-display-none!' + + = render 'shared/projects/dropdown' + = render_if_exists 'shared/projects/search_fields' diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml deleted file mode 100644 index f3aeaacbdb1..00000000000 --- a/app/views/shared/projects/_sort_dropdown.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -- @sort ||= sort_value_latest_activity -- toggle_text = projects_sort_option_titles[@sort] - -.btn-group.w-100{ role: "group" } - .btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" } - %button#sort-projects-dropdown.gl-button.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } - = toggle_text - = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable - %li.dropdown-header - = _("Sort by") - - projects_sort_options_hash.each do |value, title| - %li - = link_to title, filter_projects_path(sort: value), class: ("is-active" if toggle_text == title) - - %li.divider - %li - = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - = _("Hide archived projects") - %li - = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - = _("Show archived projects") - %li - = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - = _("Show archived projects only") - - - if current_user && @group && @group.shared_projects.present? - %li.divider - %li - = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do - = _("All projects") - %li - = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do - = _("Hide shared projects") - %li - = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do - = _("Hide group projects") - - = project_sort_direction_button(@sort) diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml deleted file mode 100644 index d10196a83cc..00000000000 --- a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -- merge_access_levels = protected_branch.merge_access_levels.for_role -- push_access_levels = protected_branch.push_access_levels.for_role - -- user_merge_access_levels = protected_branch.merge_access_levels.for_user -- user_push_access_levels = protected_branch.push_access_levels.for_user - -- group_merge_access_levels = protected_branch.merge_access_levels.for_group -- group_push_access_levels = protected_branch.push_access_levels.for_group - -%td.merge_access_levels-container - = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", merge_access_levels.first&.access_level - = dropdown_tag( (merge_access_levels.first&.humanize || 'Select') , - options: { toggle_class: 'js-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header', - data: { field_name: "allowed_to_merge_#{protected_branch.id}", preselected_items: access_levels_data(merge_access_levels) }}) - - if user_merge_access_levels.any? - %p.small - = _('The following %{user} can also merge into this branch: %{branch}') % { user: 'user'.pluralize(user_merge_access_levels.size), branch: user_merge_access_levels.map(&:humanize).to_sentence } - - - if group_merge_access_levels.any? - %p.small - = _('Members of %{group} can also merge into this branch: %{branch}') % { group: (group_merge_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_merge_access_levels.map(&:humanize).to_sentence } - -%td.push_access_levels-container - = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level - = dropdown_tag( (push_access_levels.first&.humanize || 'Select') , - options: { toggle_class: "js-allowed-to-push js-multiselect", dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header', - data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }}) - - if user_push_access_levels.any? - %p.small - = _('The following %{user} can also push to this branch: %{branch}') % { user: 'user'.pluralize(user_push_access_levels.size), branch: user_push_access_levels.map(&:humanize).to_sentence } - - - if group_push_access_levels.any? - %p.small - = _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence } - -%td - = render Pajamas::ToggleComponent.new(classes: 'js-force-push-toggle', - label: s_("ProtectedBranch|Toggle allowed to force push"), - is_checked: protected_branch.allow_force_push, - label_position: :hidden) diff --git a/app/views/shared/runners/_form.html.haml b/app/views/shared/runners/_form.html.haml index 024b06fe97a..f4b6c3c3a50 100644 --- a/app/views/shared/runners/_form.html.haml +++ b/app/views/shared/runners/_form.html.haml @@ -51,4 +51,4 @@ .col-sm-10 = f.text_field :private_projects_minutes_cost_factor, class: 'form-control' .form-actions - = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/shared/ssh_keys/_key_delete.html.haml b/app/views/shared/ssh_keys/_key_delete.html.haml index f8bb0e21f67..4b89b2a0cbf 100644 --- a/app/views/shared/ssh_keys/_key_delete.html.haml +++ b/app/views/shared/ssh_keys/_key_delete.html.haml @@ -1,9 +1,7 @@ -- title = _('Delete Key') -- aria = { label: title } +- icon = local_assigns[:icon] +- category = local_assigns[:category] || :primary -- if defined?(text) - = button_to text, '#', class: html_class, data: button_data, title: title, aria: aria -- else - = button_to '#', class: html_class, data: button_data, title: title, aria: aria do - %span.sr-only= _('Delete') - = sprite_icon('remove') +.gl-p-2 + = render Pajamas::ButtonComponent.new(variant: :danger, category: category, icon: ('remove' if icon), button_options: { class: 'js-confirm-modal-button', data: button_data }) do + - unless icon + = _('Delete') diff --git a/app/views/shared/topics/_search_form.html.haml b/app/views/shared/topics/_search_form.html.haml index 97343983b3c..2806b2865dd 100644 --- a/app/views/shared/topics/_search_form.html.haml +++ b/app/views/shared/topics/_search_form.html.haml @@ -1,6 +1,6 @@ = form_tag page_filter_path, method: :get, class: "topic-filter-form js-topic-filter-form", id: 'topic-filter-form' do |f| = search_field_tag :search, params[:search], - placeholder: s_('Filter by name'), + placeholder: _('Filter by name'), class: 'topic-filter-form-field form-control input-short', spellcheck: false, id: 'topic-filter-form-field', diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index ecb736dac4f..7eafd6ae092 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -1,13 +1,6 @@ = form_errors(hook) -- if Feature.enabled?(:webhook_form_mask_url) - .js-vue-webhook-form{ data: webhook_form_data(hook) } -- else - .form-group - = form.label :url, s_('Webhooks|URL'), class: 'label-bold' - = form.text_field :url, class: 'form-control gl-form-input', placeholder: 'http://example.com/trigger-ci.json' - %p.form-text.text-muted - = s_('Webhooks|URL must be percent-encoded if it contains one or more special characters.') +.js-vue-webhook-form{ data: webhook_form_data(hook) } .form-group = form.label :token, s_('Webhooks|Secret token'), class: 'label-bold' = form.password_field :token, value: hook.masked_token, autocomplete: 'new-password', class: 'form-control gl-form-input' @@ -19,66 +12,57 @@ = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' %ul.list-unstyled %li.gl-pb-5 - - if Feature.enabled?(:enhanced_webhook_support_regex) - - is_new_hook = hook.id.nil? - .js-vue-push-events{ data: { push_events: hook.push_events.to_s, strategy: hook.branch_filter_strategy, is_new_hook: is_new_hook.to_s, push_events_branch_filter: hook.push_events_branch_filter } } - - else - = form.gitlab_ui_checkbox_component :push_events, s_('Webhooks|Push events') - .gl-pl-6 - = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', - placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' - %p.form-text.text-muted.custom-control - = s_('Webhooks|Push to the repository.') + .js-vue-push-events{ data: { push_events: hook.push_events.to_s, strategy: hook.branch_filter_strategy, is_new_hook: hook.new_record?.to_s, push_events_branch_filter: hook.push_events_branch_filter } } %li.gl-pb-5 = form.gitlab_ui_checkbox_component :tag_push_events, - s_('Webhooks|Tag push events'), + integration_webhook_event_human_name(:tag_push_events), help_text: s_('Webhooks|A new tag is pushed to the repository.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :note_events, - s_('Webhooks|Comments'), + integration_webhook_event_human_name(:note_events), help_text: s_('Webhooks|A comment is added to an issue or merge request.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :confidential_note_events, - s_('Webhooks|Confidential comments'), + integration_webhook_event_human_name(:confidential_note_events), help_text: s_('Webhooks|A comment is added to a confidential issue.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :issues_events, - s_('Webhooks|Issues events'), + integration_webhook_event_human_name(:issues_events), help_text: s_('Webhooks|An issue is created, updated, closed, or reopened.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :confidential_issues_events, - s_('Webhooks|Confidential issues events'), + integration_webhook_event_human_name(:confidential_issues_events), help_text: s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') - if @group = render_if_exists 'groups/hooks/member_events', form: form = render_if_exists 'groups/hooks/subgroup_events', form: form %li.gl-pb-5 = form.gitlab_ui_checkbox_component :merge_requests_events, - s_('Webhooks|Merge request events'), + integration_webhook_event_human_name(:merge_requests_events), help_text: s_('Webhooks|A merge request is created, updated, or merged.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :job_events, - s_('Webhooks|Job events'), + integration_webhook_event_human_name(:job_events), help_text: s_("Webhooks|A job's status changes.") %li.gl-pb-5 = form.gitlab_ui_checkbox_component :pipeline_events, - s_('Webhooks|Pipeline events'), + integration_webhook_event_human_name(:pipeline_events), help_text: s_("Webhooks|A pipeline's status changes.") %li.gl-pb-5 = form.gitlab_ui_checkbox_component :wiki_page_events, - s_('Webhooks|Wiki page events'), + integration_webhook_event_human_name(:wiki_page_events), help_text: s_('Webhooks|A wiki page is created or updated.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :deployment_events, - s_('Webhooks|Deployment events'), + integration_webhook_event_human_name(:deployment_events), help_text: s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :feature_flag_events, - s_('Webhooks|Feature flag events'), + integration_webhook_event_human_name(:feature_flag_events), help_text: s_('Webhooks|A feature flag is turned on or off.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :releases_events, - s_('Webhooks|Releases events'), + integration_webhook_event_human_name(:releases_events), help_text: s_('Webhooks|A release is created or updated.') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml index 529ef47a2cf..c19b518acd6 100644 --- a/app/views/shared/web_hooks/_hook.html.haml +++ b/app/views/shared/web_hooks/_hook.html.haml @@ -16,7 +16,7 @@ %div - hook.class.triggers.each_value do |trigger| - if hook.public_send(trigger) - = gl_badge_tag(trigger.to_s.titleize, size: :sm) + = gl_badge_tag(integration_webhook_event_human_name(trigger), size: :sm) = gl_badge_tag(sslBadgeText, size: :sm) .col-md-4.col-lg-5.text-right-md.gl-mt-2 diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml index 3ffa45f01be..7a78a32fe87 100644 --- a/app/views/shared/web_hooks/_test_button.html.haml +++ b/app/views/shared/web_hooks/_test_button.html.haml @@ -2,12 +2,12 @@ - hook = local_assigns.fetch(:hook) - triggers = hook.class.triggers -.hook-test-button.dropdown.gl-new-dropdown.inline> +.hook-test-button.dropdown.gl-dropdown.inline> %button.btn.gl-button{ 'data-toggle' => 'dropdown', class: button_class } = _('Test') = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' } - .gl-new-dropdown-inner + .gl-dropdown-inner - triggers.each_value do |event| - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to_test_hook(hook, event) |