diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/views/shared | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/views/shared')
46 files changed, 410 insertions, 497 deletions
diff --git a/app/views/shared/_allow_request_access.html.haml b/app/views/shared/_allow_request_access.html.haml index ca09fd39dc1..608a0ca37d9 100644 --- a/app/views/shared/_allow_request_access.html.haml +++ b/app/views/shared/_allow_request_access.html.haml @@ -1,6 +1,3 @@ -- label_class = local_assigns.fetch(:bold_label, false) ? 'font-weight-bold' : '' - = form.gitlab_ui_checkbox_component :request_access_enabled, _('Allow users to request access (if visibility is public or internal)'), - label_options: { class: label_class }, checkbox_options: { data: { qa_selector: 'request_access_checkbox' } } diff --git a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml index 35a3835a522..fdd4dfba616 100644 --- a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml +++ b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml @@ -1,9 +1,7 @@ - if show_auto_devops_implicitly_enabled_banner?(project, current_user) - = render 'shared/global_alert', - variant: :info, - alert_class: 'qa-auto-devops-banner auto-devops-implicitly-enabled-banner', + = render Pajamas::AlertComponent.new(alert_class: 'qa-auto-devops-banner auto-devops-implicitly-enabled-banner', close_button_class: 'hide-auto-devops-implicitly-enabled-banner', - close_button_data: { project_id: project.id } do + close_button_data: { project_id: project.id }) do .gl-alert-body = s_("AutoDevOps|The Auto DevOps pipeline has been enabled and will be used if no alternative CI configuration file is found.") - unless Gitlab.config.registry.enabled diff --git a/app/views/shared/_broadcast_message.html.haml b/app/views/shared/_broadcast_message.html.haml index 7aaae3a88f3..ab6423e9ade 100644 --- a/app/views/shared/_broadcast_message.html.haml +++ b/app/views/shared/_broadcast_message.html.haml @@ -1,12 +1,29 @@ -- is_banner = message.broadcast_type == 'banner' +- icon_name = 'bullhorn' +- dismissable = message.dismissable? +- preview = local_assigns.fetch(:preview, false) -%div{ class: "broadcast-message #{'alert-warning' if is_banner} broadcast-#{message.broadcast_type}-message #{opts[:preview] && 'preview'} js-broadcast-notification-#{message.id} gl-display-flex", - style: broadcast_message_style(message), dir: 'auto' } - .gl-flex-grow-1.gl-text-right.gl-pr-3 - = sprite_icon('bullhorn', css_class: 'vertical-align-text-top') - %div{ class: !fluid_layout && 'container-limited' } - = render_broadcast_message(message) - .gl-flex-grow-1.gl-flex-basis-0.gl-text-right - - if (message.notification? || message.dismissable?) && opts[:preview].blank? +- unless message.notification? + .gl-broadcast-message.broadcast-banner-message{ role: "alert", class: "js-broadcast-notification-#{message.id} #{message.theme}" } + .gl-broadcast-message-content + .gl-broadcast-message-icon + = sprite_icon(icon_name) + .gl-broadcast-message-text.js-broadcast-message-preview + - if message.message.present? + = render_broadcast_message(message) + - else + = yield + - if dismissable && !preview + %button.btn.gl-close-btn-color-inherit.gl-broadcast-message-dismiss.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-dismiss-current-broadcast-notification{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } } + = sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! gl-text-white") +- else + - notification_class = "js-broadcast-notification-#{message.id}" + - notification_class << ' preview' if preview + .broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class } + = sprite_icon(icon_name, css_class: 'vertical-align-text-top') + - if message.message.present? + = render_broadcast_message(message) + - else + = yield + - if !preview %button.js-dismiss-current-broadcast-notification.btn.btn-link.gl-button{ 'aria-label' => _('Close'), :type => 'button', data: { id: message.id, expire_date: message.ends_at.iso8601 } } - = sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! #{is_banner ? 'gl-text-white' : 'gl-text-gray-700'}") + = sprite_icon('close', size: 16, css_class: "gl-icon gl-mx-3! gl-text-gray-700") diff --git a/app/views/shared/_global_alert.html.haml b/app/views/shared/_global_alert.html.haml deleted file mode 100644 index cb7ad32e474..00000000000 --- a/app/views/shared/_global_alert.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- icons = { info: 'information-o', warning: 'warning', success: 'check-circle', danger: 'error', tip: 'bulb' } - -- title = local_assigns.fetch(:title, nil) -- variant = local_assigns.fetch(:variant, :info) -- dismissible = local_assigns.fetch(:dismissible, true) -- alert_class = local_assigns.fetch(:alert_class, nil) -- alert_data = local_assigns.fetch(:alert_data, nil) -- close_button_class = local_assigns.fetch(:close_button_class, nil) -- close_button_data = local_assigns.fetch(:close_button_data, nil) -- icon = icons[variant] - -%div{ role: 'alert', class: ['gl-alert', "gl-alert-#{variant}", alert_class], data: alert_data } - = sprite_icon(icon, css_class: "gl-alert-icon#{' gl-alert-icon-no-title' if title.nil?}") - - if dismissible - %button.btn.gl-dismiss-btn.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-close{ type: 'button', aria: { label: _('Dismiss') }, class: close_button_class, data: close_button_data } - = sprite_icon('close') - .gl-alert-content{ role: 'alert' } - - if title - %h4.gl-alert-title - = title - = yield diff --git a/app/views/shared/_import_form.html.haml b/app/views/shared/_import_form.html.haml index 3ab2b969b75..850d58920db 100644 --- a/app/views/shared/_import_form.html.haml +++ b/app/views/shared/_import_form.html.haml @@ -8,11 +8,10 @@ = _('Git repository URL') = f.text_field :import_url, value: import_url.sanitized_url, autocomplete: 'off', class: 'form-control gl-form-input', placeholder: 'https://gitlab.company.com/group/project.git', required: true - = render 'shared/global_alert', - variant: :danger, + = render Pajamas::AlertComponent.new(variant: :danger, alert_class: 'gl-mt-3 js-import-url-error hide', dismissible: false, - close_button_class: 'js-close-2fa-enabled-success-alert' do + close_button_class: 'js-close-2fa-enabled-success-alert') do .gl-alert-body = s_('Import|There is not a valid Git repository at this URL. If your HTTP repository is not publicly accessible, verify your credentials.') .row diff --git a/app/views/shared/_milestones_sort_dropdown.html.haml b/app/views/shared/_milestones_sort_dropdown.html.haml index 29c01343358..1c6eb7aa96b 100644 --- a/app/views/shared/_milestones_sort_dropdown.html.haml +++ b/app/views/shared/_milestones_sort_dropdown.html.haml @@ -1,22 +1,4 @@ -.dropdown.inline.gl-ml-3 - %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } } - %span.light - - if @sort.present? - = milestone_sort_options_hash[@sort] - - else - = sort_title_due_date_soon - = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort - %li - = link_to page_filter_path(sort: sort_value_due_date_soon) do - = sort_title_due_date_soon - = link_to page_filter_path(sort: sort_value_due_date_later) do - = sort_title_due_date_later - = link_to page_filter_path(sort: sort_value_start_date_soon) do - = sort_title_start_date_soon - = link_to page_filter_path(sort: sort_value_start_date_later) do - = sort_title_start_date_later - = link_to page_filter_path(sort: sort_value_name) do - = sort_title_name_asc - = link_to page_filter_path(sort: sort_value_name_desc) do - = sort_title_name_desc +- milestones_sort_options = milestones_sort_options_hash.map { |value, text| { value: value, text: text, href: page_filter_path(sort: value) } } + +%div{ data: {testid: 'milestone_sort_by_dropdown'} } + = gl_redirect_listbox_tag milestones_sort_options, @sort, class: 'gl-ml-3' diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml index d1e1a8a819d..195bd15f840 100644 --- a/app/views/shared/_no_password.html.haml +++ b/app/views/shared/_no_password.html.haml @@ -1,8 +1,7 @@ - if show_no_password_message? - = render 'shared/global_alert', - variant: :warning, + = render Pajamas::AlertComponent.new(variant: :warning, alert_class: 'js-no-password-message', - close_button_class: 'js-hide-no-password-message' do + close_button_class: 'js-hide-no-password-message') do .gl-alert-body = no_password_message .gl-alert-actions diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index 20dc1b41970..d30679b4305 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -1,8 +1,7 @@ - if show_no_ssh_key_message? - = render 'shared/global_alert', - variant: :warning, + = render Pajamas::AlertComponent.new(variant: :warning, alert_class: 'js-no-ssh-message', - close_button_class: 'js-hide-no-ssh-message' do + close_button_class: 'js-hide-no-ssh-message') do .gl-alert-body = s_("MissingSSHKeyWarningLink|You can't push or pull repositories using SSH until you add an SSH key to your profile.") .gl-alert-actions diff --git a/app/views/shared/_outdated_browser.html.haml b/app/views/shared/_outdated_browser.html.haml index f5a32050a79..76fb34985c0 100644 --- a/app/views/shared/_outdated_browser.html.haml +++ b/app/views/shared/_outdated_browser.html.haml @@ -1,6 +1,5 @@ - if outdated_browser? - .gl-alert.gl-alert-danger.outdated-browser{ :role => "alert" } - = sprite_icon('error', css_class: "gl-alert-icon gl-alert-icon-no-title gl-icon") + = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false) do .gl-alert-body = s_('OutdatedBrowser|GitLab may not work properly, because you are using an outdated web browser.') %br diff --git a/app/views/shared/_project_limit.html.haml b/app/views/shared/_project_limit.html.haml index 90612ba623f..7e1874f3416 100644 --- a/app/views/shared/_project_limit.html.haml +++ b/app/views/shared/_project_limit.html.haml @@ -1,8 +1,7 @@ - if cookies[:hide_project_limit_message].blank? && !current_user.hide_project_limit && !current_user.can_create_project? && current_user.projects_limit > 0 - = render 'shared/global_alert', - variant: :warning, + = render Pajamas::AlertComponent.new(variant: :warning, dismissible: false, - alert_class: 'project-limit-message' do + alert_class: 'project-limit-message') do .gl-alert-body = _("You won't be able to create new projects because you have reached your project limit.") .gl-alert-actions diff --git a/app/views/shared/_prometheus_configuration_banner.html.haml b/app/views/shared/_prometheus_configuration_banner.html.haml new file mode 100644 index 00000000000..2d948cf28a6 --- /dev/null +++ b/app/views/shared/_prometheus_configuration_banner.html.haml @@ -0,0 +1,27 @@ +- header_tag = local_assigns.fetch(:header_tag) +- info_well_classes = local_assigns.fetch(:info_well_classes, '') +- integration = local_assigns.fetch(:integration) + += content_tag(header_tag, s_('PrometheusService|Prometheus cluster integration')) + +- if integration.manual_configuration? + .info-well{ class: info_well_classes } + = s_('PrometheusService|To use a Prometheus installed on a cluster, deactivate the manual configuration.') +- else + .container-fluid + .row + - if integration.prometheus_available? + .col-sm-2 + .svg-container + = image_tag 'illustrations/monitoring/getting_started.svg' + .col-sm-10 + %p.text-success.gl-mt-3 + = s_('PrometheusService|You have a cluster with the Prometheus integration enabled.') + = link_to s_('PrometheusService|Manage clusters'), project_clusters_path(project), class: 'btn gl-button btn-default' + - else + .col-sm-2 + = image_tag 'illustrations/monitoring/loading.svg' + .col-sm-10 + %p.gl-mt-3 + = s_('PrometheusService|Configure GitLab to query a Prometheus installed in one of your clusters.') + = link_to s_('PrometheusService|Manage clusters'), project_clusters_path(project), class: 'btn gl-button btn-confirm' diff --git a/app/views/shared/_service_ping_consent.html.haml b/app/views/shared/_service_ping_consent.html.haml index 9cdff35ead2..96f015c7a4b 100644 --- a/app/views/shared/_service_ping_consent.html.haml +++ b/app/views/shared/_service_ping_consent.html.haml @@ -1,7 +1,5 @@ - if session[:ask_for_usage_stats_consent] - = render 'shared/global_alert', - variant: :info, - alert_class: 'service-ping-consent-message' do + = render Pajamas::AlertComponent.new(alert_class: 'service-ping-consent-message') do .gl-alert-body - docs_link = link_to _('collect usage information'), help_page_path('user/admin_area/settings/usage_statistics.md'), class: 'gl-link' - settings_link = link_to _('your settings'), metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), class: 'gl-link' diff --git a/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml b/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml index f21acd26ada..2294c44d49f 100644 --- a/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml +++ b/app/views/shared/_two_factor_auth_recovery_settings_check.html.haml @@ -1,8 +1,9 @@ -= render 'shared/global_alert', - variant: :warning, += render Pajamas::AlertComponent.new(variant: :warning, alert_class: 'js-recovery-settings-callout gl-mt-5', - alert_data: { feature_id: Users::CalloutsHelper::TWO_FACTOR_AUTH_RECOVERY_SETTINGS_CHECK, dismiss_endpoint: callouts_path, defer_links: 'true' }, - close_button_data: { testid: 'close-account-recovery-regular-check-callout' } do + alert_data: { feature_id: Users::CalloutsHelper::TWO_FACTOR_AUTH_RECOVERY_SETTINGS_CHECK, + dismiss_endpoint: callouts_path, + defer_links: 'true' }, + close_button_data: { testid: 'close-account-recovery-regular-check-callout' }) do .gl-alert-body = s_('Profiles|Ensure you have two-factor authentication recovery codes stored in a safe place.') = link_to _('Learn more.'), help_page_path('user/profile/account/two_factor_authentication', anchor: 'recovery-codes'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/access_tokens/_form.html.haml b/app/views/shared/access_tokens/_form.html.haml index 0b68cfe65e5..d4106ba4e5d 100644 --- a/app/views/shared/access_tokens/_form.html.haml +++ b/app/views/shared/access_tokens/_form.html.haml @@ -10,7 +10,7 @@ %p.profile-settings-content = _("Enter the name of your application, and we'll return a unique %{type}.") % { type: type } -= form_for token, as: prefix, url: path, method: :post, html: { class: 'js-requires-input' } do |f| += gitlab_ui_form_for token, as: prefix, url: path, method: :post, html: { class: 'js-requires-input' } do |f| = form_errors(token) @@ -42,7 +42,7 @@ %p.text-secondary#select_scope_help_text = s_('Tokens|Scopes set the permission levels granted to the token.') = link_to _("Learn more."), help_path, target: '_blank', rel: 'noopener noreferrer' - = render 'shared/tokens/scopes_form', prefix: prefix, token: token, scopes: scopes + = render 'shared/tokens/scopes_form', prefix: prefix, token: token, scopes: scopes, f: f - if prefix == :personal_access_token && Feature.enabled?(:personal_access_tokens_scoped_to_projects, current_user) .js-access-tokens-projects diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml index 98752345074..c070baf02b1 100644 --- a/app/views/shared/boards/_show.html.haml +++ b/app/views/shared/boards/_show.html.haml @@ -16,6 +16,4 @@ - page_title("#{board.name}", _("Boards")) - add_page_specific_style 'page_bundles/boards' -= render 'shared/issuable/search_bar', type: :boards, board: board - #js-issuable-board-app{ data: board_data } diff --git a/app/views/shared/boards/_switcher.html.haml b/app/views/shared/boards/_switcher.html.haml deleted file mode 100644 index c667b3a4626..00000000000 --- a/app/views/shared/boards/_switcher.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -- parent = board.resource_parent -- milestone_filter_opts = { format: :json } -- milestone_filter_opts = milestone_filter_opts.merge(only_group_milestones: true) if board.group_board? -- weights = Gitlab.ee? ? ([Issue::WEIGHT_ANY] + Issue.weight_options) : [] - -#js-multiple-boards-switcher.inline.boards-switcher{ data: { milestone_path: milestones_filter_path(milestone_filter_opts), - board_base_url: board_base_url, - has_missing_boards: (!multiple_boards_available? && current_board_parent.boards.size > 1).to_s, - can_admin_board: can?(current_user, :admin_issue_board, parent).to_s, - multiple_issue_boards_available: parent.multiple_issue_boards_available?.to_s, - scoped_issue_board_feature_enabled: Gitlab.ee? && parent.feature_available?(:scoped_issue_board) ? 'true' : 'false', - weights: weights.to_json } } diff --git a/app/views/shared/deploy_keys/_form.html.haml b/app/views/shared/deploy_keys/_form.html.haml index bf2514f8b0d..b60d433bafa 100644 --- a/app/views/shared/deploy_keys/_form.html.haml +++ b/app/views/shared/deploy_keys/_form.html.haml @@ -27,8 +27,5 @@ .form-group .col-form-label.col-sm-2 .col-sm-10 - = deploy_keys_project_form.label :can_push do - = deploy_keys_project_form.check_box :can_push - %strong= _('Grant write permissions to this key') - %p.light.gl-mb-0 - = _('Allow this key to push to this repository') + = 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') 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 8da48a7936a..c9edf09b350 100644 --- a/app/views/shared/deploy_keys/_project_group_form.html.haml +++ b/app/views/shared/deploy_keys/_project_group_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project.namespace, @project, @deploy_keys.new_key], url: namespace_project_deploy_keys_path, html: { class: "js-requires-input container" } do |f| += gitlab_ui_form_for [@project.namespace, @project, @deploy_keys.new_key], url: namespace_project_deploy_keys_path, html: { class: "js-requires-input container" } do |f| = form_errors(@deploy_keys.new_key) .form-group.row = f.label :title, class: "label-bold" @@ -13,12 +13,8 @@ = f.fields_for :deploy_keys_projects do |deploy_keys_project_form| .form-group.row - = deploy_keys_project_form.label :can_push do - = deploy_keys_project_form.check_box :can_push - %strong= _('Grant write permissions to this key') - .form-group.row - %p.light.gl-mb-0 - = _('Allow this key to push to this repository') + = 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.submit _("Add key"), class: "btn gl-button btn-confirm", data: { qa_selector: "add_deploy_key_button"} diff --git a/app/views/shared/doorkeeper/applications/_form.html.haml b/app/views/shared/doorkeeper/applications/_form.html.haml index adfd7ea98b7..c1650405776 100644 --- a/app/views/shared/doorkeeper/applications/_form.html.haml +++ b/app/views/shared/doorkeeper/applications/_form.html.haml @@ -1,4 +1,4 @@ -= form_for @application, url: url, html: { role: 'form', class: 'doorkeeper-app-form' } do |f| += gitlab_ui_form_for @application, url: url, html: { role: 'form', class: 'doorkeeper-app-form' } do |f| = form_errors(@application) .form-group @@ -12,22 +12,19 @@ %span.form-text.text-muted = _('Use one line per URI') - .form-group.form-check - = f.check_box :confidential, class: 'form-check-input' - = f.label :confidential, class: 'label-bold form-check-label' - %span.form-text.text-muted - = _('Enable only for confidential applications exclusively used by a trusted backend server that can securely store the client secret. Do not enable for native-mobile, single-page, or other JavaScript applications because they cannot keep the client secret confidential.') + .form-group + = f.gitlab_ui_checkbox_component :confidential, _('Confidential'), + help_text: _('Enable only for confidential applications exclusively used by a trusted backend server that can securely store the client secret. Do not enable for native-mobile, single-page, or other JavaScript applications because they cannot keep the client secret confidential.') - .form-group.form-check - = f.check_box :expire_access_tokens, class: 'form-check-input' - = f.label :expire_access_tokens, class: 'label-bold form-check-label' - %span.form-text.text-muted - = _('Enable access tokens to expire after 2 hours. If disabled, tokens do not expire.') - = link_to _('Learn more.'), help_page_path('integration/oauth_provider.md', anchor: 'expiring-access-tokens'), target: '_blank', rel: 'noopener noreferrer' + .form-group + - help_text = _('Enable access tokens to expire after 2 hours. If disabled, tokens do not expire.') + - help_link = link_to _('Learn more.'), help_page_path('integration/oauth_provider.md', anchor: 'expiring-access-tokens'), target: '_blank', rel: 'noopener noreferrer' + = f.gitlab_ui_checkbox_component :expire_access_tokens, _('Expire access tokens'), + help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link } .form-group = f.label :scopes, class: 'label-bold' - = render 'shared/tokens/scopes_form', prefix: 'doorkeeper_application', token: @application, scopes: @scopes + = 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" diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 6b571794625..fb410274859 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -47,7 +47,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-display-inline-flex gl-vertical-align-middle', show_label: 'true' } } + .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' } } %hr %p.gl-text-center.gl-mb-0 %strong diff --git a/app/views/shared/empty_states/_milestones.html.haml b/app/views/shared/empty_states/_milestones.html.haml index c22869fb7e6..fb69e75370e 100644 --- a/app/views/shared/empty_states/_milestones.html.haml +++ b/app/views/shared/empty_states/_milestones.html.haml @@ -1,7 +1,13 @@ +- learn_more_path = local_assigns.fetch(:learn_more_path, help_page_path('user/project/milestones/index')) +- learn_more_link = link_to _('Learn more.'), learn_more_path + .row.empty-state .col-12 .svg-content = image_tag 'illustrations/milestone_burndown_chart.svg' .col-12 .text-content - %h4.text-center= _('No milestones to show') + %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 } + = yield diff --git a/app/views/shared/empty_states/_milestones_tab.html.haml b/app/views/shared/empty_states/_milestones_tab.html.haml new file mode 100644 index 00000000000..f6760b0a3f4 --- /dev/null +++ b/app/views/shared/empty_states/_milestones_tab.html.haml @@ -0,0 +1,17 @@ +- learn_more_path = local_assigns.fetch(:learn_more_path, help_page_path('user/project/milestones/index')) +- learn_more_link = link_to _('Learn more.'), learn_more_path +- closed_tab_selected = params[:state] == 'closed' + +.row.empty-state + .col-12 + .svg-content + = image_tag 'illustrations/milestone_burndown_chart.svg' + .col-12 + .text-content + - if closed_tab_selected + %h4.text-center= s_('Milestones|There are no closed milestones') + - else + %h4.text-center= s_('Milestones|There are no open milestones') + %p.state-description + = 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/errors/_gitaly_unavailable.html.haml b/app/views/shared/errors/_gitaly_unavailable.html.haml index 366d4585435..e99c41f2496 100644 --- a/app/views/shared/errors/_gitaly_unavailable.html.haml +++ b/app/views/shared/errors/_gitaly_unavailable.html.haml @@ -1,7 +1,6 @@ -= render 'shared/global_alert', - alert_class: 'gl-my-5', += render Pajamas::AlertComponent.new(alert_class: 'gl-my-5', variant: :danger, dismissible: false, - title: reason do + title: reason) do .gl-alert-body = s_('The git server, Gitaly, is not available at this time. Please contact your administrator.') diff --git a/app/views/shared/groups/_dropdown.html.haml b/app/views/shared/groups/_dropdown.html.haml index 75c34102935..80edce8e7c4 100644 --- a/app/views/shared/groups/_dropdown.html.haml +++ b/app/views/shared/groups/_dropdown.html.haml @@ -1,26 +1,5 @@ - options_hash = local_assigns.fetch(:options_hash, groups_sort_options_hash) -- show_archive_options = local_assigns.fetch(:show_archive_options, false) +- groups_sort_options = options_hash.map { |value, title| { value: value, text: title, href: filter_groups_path(sort: value) } } -.dropdown.inline.js-group-filter-dropdown-wrap.gl-mr-3 - %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } - %span.dropdown-label - = options_hash[project_list_sort_by] - = 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") - - options_hash.each do |value, title| - %li.js-filter-sort-order - = link_to filter_groups_path(sort: value), class: ("is-active" if project_list_sort_by == value) do - = title - - if show_archive_options - %li.divider - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - = _("Hide archived projects") - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - = _("Show archived projects") - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - = _("Show archived projects only") +%div{ data: { testid: 'group_sort_by_dropdown' } } + = gl_redirect_listbox_tag groups_sort_options, project_list_sort_by, data: { right: true } diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index 95590d6e515..ce04e24b09f 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -10,14 +10,11 @@ %hr - if hook_log.internal_error_message.present? - .gl-alert-container - .gl-alert.gl-alert-danger - .gl-alert-container - = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') - .gl-alert-content - %h4.gl-alert-title= _('Internal error occurred while delivering this webhook.') - .gl-alert-body - = _('Error: %{error}') % { error: hook_log.internal_error_message } + = render Pajamas::AlertComponent.new(title: _('Internal error occurred while delivering this webhook.'), + variant: :danger, + dismissible: false) do + .gl-alert-body + = _('Error: %{error}') % { error: hook_log.internal_error_message } %h4= _('Response') = render partial: 'shared/hook_logs/status_label', locals: { hook_log: hook_log } diff --git a/app/views/shared/integrations/edit.html.haml b/app/views/shared/integrations/edit.html.haml index f2a31400698..0ae0eea59d8 100644 --- a/app/views/shared/integrations/edit.html.haml +++ b/app/views/shared/integrations/edit.html.haml @@ -3,7 +3,7 @@ - page_title @integration.title, _('Integrations') - @content_class = 'limit-container-width' unless fluid_layout -%h3.page-title +%h2.gl-mb-4 = @integration.title = render 'shared/integrations/tabs', integration: @integration, active_tab: 'edit' do diff --git a/app/views/shared/issuable/_assignees.html.haml b/app/views/shared/issuable/_assignees.html.haml index e6d722cb08d..73f1e35f03f 100644 --- a/app/views/shared/issuable/_assignees.html.haml +++ b/app/views/shared/issuable/_assignees.html.haml @@ -7,7 +7,7 @@ = render 'shared/issuable/merge_request_assignees', issuable: issuable, count: render_count - else - issuable.assignees.take(render_count).each do |assignee| # rubocop: disable CodeReuse/ActiveRecord - = link_to_member(@project, assignee, name: false, title: s_("MrList|Assigned to %{name}, go to their profile.") % { name: assignee.name}) + = link_to_member(@project, assignee, name: false, title: s_("MrList|Assigned to %{name}") % { name: assignee.name}) - if more_assignees_count > 0 %span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old', qa_selector: 'avatar_counter_content' }, title: _("+%{more_assignees_count} more assignees") % { more_assignees_count: more_assignees_count} } diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 3f6e7a6fb32..e0d5f738273 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -6,10 +6,9 @@ = form_errors(issuable) - if @conflict - = render 'shared/global_alert', - variant: :danger, + = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false, - alert_class: 'gl-mb-5' do + alert_class: 'gl-mb-5') do .gl-alert-body Someone edited the #{issuable.class.model_name.human.downcase} the same time you did. Please check out diff --git a/app/views/shared/issuable/_label_page_create.html.haml b/app/views/shared/issuable/_label_page_create.html.haml index 6a58acf8c05..7ab82362e85 100644 --- a/app/views/shared/issuable/_label_page_create.html.haml +++ b/app/views/shared/issuable/_label_page_create.html.haml @@ -6,7 +6,7 @@ .dropdown-page-two.dropdown-new-label = dropdown_title(create_label_title(subject), options: { back: true, close: show_close }) = dropdown_content do - = render 'shared/global_alert', variant: :danger, alert_class: 'js-label-error gl-mb-3', dismissible: false + = render Pajamas::AlertComponent.new(variant: :danger, alert_class: 'js-label-error gl-mb-3', dismissible: false) %input#new_label_name.default-dropdown-input{ type: "text", placeholder: _('Name new label') } .suggest-colors.suggest-colors-dropdown = render_suggested_colors diff --git a/app/views/shared/issuable/_merge_request_assignees.html.haml b/app/views/shared/issuable/_merge_request_assignees.html.haml index 13dc6ae4abb..6c7a2496ec6 100644 --- a/app/views/shared/issuable/_merge_request_assignees.html.haml +++ b/app/views/shared/issuable/_merge_request_assignees.html.haml @@ -1,6 +1,6 @@ - issuable.merge_request_assignees.take(count).each do |merge_request_assignee| # rubocop: disable CodeReuse/ActiveRecord - assignee = merge_request_assignee.assignee - - assignee_tooltip = ( merge_request_assignee.attention_requested? ? s_("MrList|Attention requested from assignee %{name}, go to their profile.") : s_("MrList|Assigned to %{name}, go to their profile.") ) % { name: assignee.name} + - assignee_tooltip = ( merge_request_assignee.attention_requested? ? s_("MrList|Attention requested from assignee %{name}") : s_("MrList|Assigned to %{name}") ) % { name: assignee.name} = link_to_member(@project, assignee, name: false, title: assignee_tooltip, extra_class: "gl-flex-direction-row-reverse") do - if merge_request_assignee.attention_requested? diff --git a/app/views/shared/issuable/_merge_request_reviewers.html.haml b/app/views/shared/issuable/_merge_request_reviewers.html.haml index df5c69e309f..8dd74e12aff 100644 --- a/app/views/shared/issuable/_merge_request_reviewers.html.haml +++ b/app/views/shared/issuable/_merge_request_reviewers.html.haml @@ -1,6 +1,6 @@ - issuable.merge_request_reviewers.take(count).each do |merge_request_reviewer| # rubocop: disable CodeReuse/ActiveRecord - reviewer = merge_request_reviewer.reviewer - - reviewer_tooltip = ( merge_request_reviewer.attention_requested? ? s_("MrList|Attention requested from reviewer %{name}, go to their profile.") : s_("MrList|Review requested from %{name}, go to their profile.") ) % { name: reviewer.name} + - reviewer_tooltip = ( merge_request_reviewer.attention_requested? ? s_("MrList|Attention requested from reviewer %{name}") : s_("MrList|Review requested from %{name}") ) % { name: reviewer.name} = link_to_member(@project, reviewer, name: false, title: reviewer_tooltip, extra_class: "gl-flex-direction-row-reverse") do - if merge_request_reviewer.attention_requested? diff --git a/app/views/shared/issuable/_reviewers.html.haml b/app/views/shared/issuable/_reviewers.html.haml index 0bb0faa0bb8..4af2cb00859 100644 --- a/app/views/shared/issuable/_reviewers.html.haml +++ b/app/views/shared/issuable/_reviewers.html.haml @@ -7,7 +7,7 @@ = render 'shared/issuable/merge_request_reviewers', issuable: issuable, count: render_count - else - issuable.reviewers.take(render_count).each do |reviewer| # rubocop: disable CodeReuse/ActiveRecord - = link_to_member(@project, reviewer, name: false, title: s_("MrList|Review requested from %{name}, go to their profile.") % { name: reviewer.name}) + = link_to_member(@project, reviewer, name: false, title: s_("MrList|Review requested from %{name}") % { name: reviewer.name}) - if more_reviewers_count > 0 %span{ class: 'avatar-counter has-tooltip', data: { container: 'body', placement: 'bottom', 'line-type' => 'old' }, title: _("+%{more_reviewers_count} more reviewers") % { more_reviewers_count: more_reviewers_count} } diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 37a79a50fb1..7fdf8ea7796 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -1,22 +1,12 @@ - type = local_assigns.fetch(:type) -- board = local_assigns.fetch(:board, nil) - show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true) - disable_target_branch = local_assigns.fetch(:disable_target_branch, false) - placeholder = local_assigns[:placeholder] || _('Search or filter results...') - block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : '' -- is_epic_board = board&.to_type == "EpicBoard" - -- if is_epic_board - - user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent) -- elsif board - - user_can_admin_list = can?(current_user, :admin_issue_board_list, board.resource_parent) .issues-filters .issues-details-filters.filtered-search-block.d-flex.flex-column.flex-lg-row{ class: block_css_class } .d-flex.flex-column.flex-md-row.flex-grow-1.mb-lg-0.mb-md-2.mb-sm-0.w-100 - - if type == :boards - = render "shared/boards/switcher", board: board - .js-new-board{ data: { multiple_issue_boards_available: parent.multiple_issue_boards_available?.to_s, can_admin_board: can?(current_user, :admin_issue_board, parent).to_s, } } = form_tag page_filter_path, method: :get, class: 'filter-form js-filter-form w-100' do - if params[:search].present? = hidden_field_tag :search, params[:search] @@ -25,201 +15,188 @@ - checkbox_id = 'check-all-issues' %label.gl-sr-only{ for: checkbox_id }= _('Select all') = check_box_tag checkbox_id, nil, false, class: "check-all-issues left" - - if is_epic_board - #js-board-filtered-search{ data: { full_path: @group&.full_path } } - - elsif board - #js-issue-board-filtered-search - - else - .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row - .filtered-search-box - - if type != :boards - - text = tag.span(sprite_icon('history'), class: "d-md-none") + tag.span(_('Recent searches'), class: "d-none d-md-inline") - = dropdown_tag(text, - options: { wrapper_class: "filtered-search-history-dropdown-wrapper", - toggle_class: "gl-button btn btn-default filtered-search-history-dropdown-toggle-button", - dropdown_class: "filtered-search-history-dropdown", - content_class: "filtered-search-history-dropdown-content" }) do - .js-filtered-search-history-dropdown{ data: { full_path: search_history_storage_prefix } } - .filtered-search-box-input-container.droplab-dropdown - .scroll-container - %ul.tokens-container.list-unstyled - %li.input-token - %input.form-control.filtered-search{ search_filter_input_options(type, placeholder) } - #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item{ data: {hint: "#{'{{hint}}'}", tag: "#{'{{tag}}'}", action: "#{'{{hint === \'search\' ? \'submit\' : \'\' }}'}" } } - %button.gl-button.btn.btn-link{ type: 'button' } - -# Encapsulate static class name `{{icon}}` inside #{} to bypass - -# haml lint's ClassAttributeWithStaticValue - %svg - %use{ 'xlink:href': "#{'{{icon}}'}" } - %span.js-filter-hint - {{formattedKey}} - #js-dropdown-operator.filtered-search-input-dropdown-menu.dropdown-menu - %ul.filter-dropdown{ data: { dropdown: true, dynamic: true } } - %li.filter-dropdown-item{ data: { value: "{{ title }}" } } - %button.gl-button.btn.btn-link{ type: 'button' } - {{ title }} - %span.btn-helptext - {{ help }} - #js-dropdown-author.filtered-search-input-dropdown-menu.dropdown-menu + .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row + .filtered-search-box + - if type != :boards + - text = tag.span(sprite_icon('history'), class: "d-md-none") + tag.span(_('Recent searches'), class: "d-none d-md-inline") + = dropdown_tag(text, + options: { wrapper_class: "filtered-search-history-dropdown-wrapper", + toggle_class: "gl-button btn btn-default filtered-search-history-dropdown-toggle-button", + dropdown_class: "filtered-search-history-dropdown", + content_class: "filtered-search-history-dropdown-content" }) do + .js-filtered-search-history-dropdown{ data: { full_path: search_history_storage_prefix } } + .filtered-search-box-input-container.droplab-dropdown + .scroll-container + %ul.tokens-container.list-unstyled + %li.input-token + %input.form-control.filtered-search{ search_filter_input_options(type, placeholder) } + #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item{ data: {hint: "#{'{{hint}}'}", tag: "#{'{{tag}}'}", action: "#{'{{hint === \'search\' ? \'submit\' : \'\' }}'}" } } + %button.gl-button.btn.btn-link{ type: 'button' } + -# Encapsulate static class name `{{icon}}` inside #{} to bypass + -# haml lint's ClassAttributeWithStaticValue + %svg + %use{ 'xlink:href': "#{'{{icon}}'}" } + %span.js-filter-hint + {{formattedKey}} + #js-dropdown-operator.filtered-search-input-dropdown-menu.dropdown-menu + %ul.filter-dropdown{ data: { dropdown: true, dynamic: true } } + %li.filter-dropdown-item{ data: { value: "{{ title }}" } } + %button.gl-button.btn.btn-link{ type: 'button' } + {{ title }} + %span.btn-helptext + {{ help }} + #js-dropdown-author.filtered-search-input-dropdown-menu.dropdown-menu + - if current_user + %ul{ data: { dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: current_user + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: User.new(username: '{{username}}', name: '{{name}}'), + avatar: { lazy: true, url: '{{avatar_url}}' } + #js-dropdown-assignee.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore - if current_user - %ul{ data: { dropdown: true } } - = render 'shared/issuable/user_dropdown_item', - user: current_user - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } = render 'shared/issuable/user_dropdown_item', - user: User.new(username: '{{username}}', name: '{{name}}'), - avatar: { lazy: true, url: '{{avatar_url}}' } - #js-dropdown-assignee.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.divider.droplab-item-ignore - - if current_user - = render 'shared/issuable/user_dropdown_item', - user: current_user - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + user: current_user + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: User.new(username: '{{username}}', name: '{{name}}'), + avatar: { lazy: true, url: '{{avatar_url}}' } + #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + - if current_user = render 'shared/issuable/user_dropdown_item', - user: User.new(username: '{{username}}', name: '{{name}}'), - avatar: { lazy: true, url: '{{avatar_url}}' } - #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.divider.droplab-item-ignore - - if current_user + user: current_user + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: User.new(username: '{{username}}', name: '{{name}}'), + avatar: { lazy: true, url: '{{avatar_url}}' } + - if Feature.enabled?(:mr_attention_requests, default_enabled: :yaml) + #js-dropdown-attention-requested.filtered-search-input-dropdown-menu.dropdown-menu + - if current_user + %ul{ data: { dropdown: true } } = render 'shared/issuable/user_dropdown_item', user: current_user %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } = render 'shared/issuable/user_dropdown_item', user: User.new(username: '{{username}}', name: '{{name}}'), avatar: { lazy: true, url: '{{avatar_url}}' } - - if Feature.enabled?(:mr_attention_requests, default_enabled: :yaml) - #js-dropdown-attention-requested.filtered-search-input-dropdown-menu.dropdown-menu - - if current_user - %ul{ data: { dropdown: true } } - = render 'shared/issuable/user_dropdown_item', - user: current_user - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - = render 'shared/issuable/user_dropdown_item', - user: User.new(username: '{{username}}', name: '{{name}}'), - avatar: { lazy: true, url: '{{avatar_url}}' } - = render_if_exists 'shared/issuable/approver_dropdown' - = render_if_exists 'shared/issuable/approved_by_dropdown' - #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.filter-dropdown-item{ data: { value: 'Upcoming' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Upcoming') - %li.filter-dropdown-item{ data: { value: 'Started' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Started') - %li.divider.droplab-item-ignore - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item - %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } + = render_if_exists 'shared/issuable/approver_dropdown' + = render_if_exists 'shared/issuable/approved_by_dropdown' + #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.filter-dropdown-item{ data: { value: 'Upcoming' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Upcoming') + %li.filter-dropdown-item{ data: { value: 'Started' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Started') + %li.divider.droplab-item-ignore + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } + {{title}} + = render_if_exists 'shared/issuable/filter_iteration', type: type + #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } + {{title}} + #js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item + %button.gl-button.btn.btn-link{ type: 'button' } + %span.dropdown-label-box{ style: 'background: {{color}}' } + %span.label-title.js-data-value {{title}} - = render_if_exists 'shared/issuable/filter_iteration', type: type - #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.divider.droplab-item-ignore - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item - %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } - {{title}} - #js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.divider.droplab-item-ignore - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item - %button.gl-button.btn.btn-link{ type: 'button' } - %span.dropdown-label-box{ style: 'background: {{color}}' } - %span.label-title.js-data-value - {{title}} - #js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu - %ul{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'None' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('None') - %li.filter-dropdown-item{ data: { value: 'Any' } } - %button.gl-button.btn.btn-link{ type: 'button' } - = _('Any') - %li.divider.droplab-item-ignore - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item - %button.gl-button.btn.btn-link{ type: 'button' } - %gl-emoji - %span.js-data-value.gl-ml-3 - {{name}} - #js-dropdown-wip.filtered-search-input-dropdown-menu.dropdown-menu - %ul.filter-dropdown{ data: { dropdown: true } } - %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } } - %button.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 } } - %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') - - unless disable_target_branch - #js-dropdown-target-branch.filtered-search-input-dropdown-menu.dropdown-menu - %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } - %li.filter-dropdown-item - %button.gl-button.btn.btn-link.js-data-value.monospace - {{title}} - #js-dropdown-environment.filtered-search-input-dropdown-menu.dropdown-menu + #js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.gl-button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item + %button.gl-button.btn.btn-link{ type: 'button' } + %gl-emoji + %span.js-data-value.gl-ml-3 + {{name}} + #js-dropdown-wip.filtered-search-input-dropdown-menu.dropdown-menu + %ul.filter-dropdown{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } } + %button.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 } } + %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') + - unless disable_target_branch + #js-dropdown-target-branch.filtered-search-input-dropdown-menu.dropdown-menu %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item - %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } + %button.gl-button.btn.btn-link.js-data-value.monospace {{title}} + #js-dropdown-environment.filtered-search-input-dropdown-menu.dropdown-menu + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + %li.filter-dropdown-item + %button.gl-button.btn.btn-link.js-data-value{ type: 'button' } + {{title}} - = render_if_exists 'shared/issuable/filter_weight', type: type + = render_if_exists 'shared/issuable/filter_weight', type: type - = render_if_exists 'shared/issuable/filter_epic', type: type + = render_if_exists 'shared/issuable/filter_epic', type: type - %button.clear-search.hidden{ type: 'button' } - = sprite_icon('close', size: 16, css_class: 'clear-search-icon') + %button.clear-search.hidden{ 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 == :boards - #js-board-labels-toggle - - if current_user - #js-board-epics-swimlanes-toggle - .js-board-config{ data: { can_admin_list: user_can_admin_list.to_s, has_scope: board.scoped?.to_s } } - - if user_can_admin_list - .js-create-column-trigger{ data: board_list_data } - #js-toggle-focus-btn - - elsif type != :productivity_analytics && show_sorting_dropdown + - if type != :productivity_analytics && show_sorting_dropdown = render 'shared/issuable/sort_dropdown' diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 37d31515307..b99294f504c 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -97,7 +97,7 @@ - if issuable_sidebar.dig(:current_user, :can_move) .block.js-sidebar-move-issue-block .sidebar-collapsed-icon{ data: { toggle: 'tooltip', placement: 'left', container: 'body', boundary: 'viewport' }, title: _('Move issue') } - = custom_icon('icon_arrow_right') + = sprite_icon('long-arrow') .dropdown.sidebar-move-issue-dropdown.hide-collapsed %button.gl-button.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue{ type: 'button', data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } } diff --git a/app/views/shared/issuable/form/_contribution.html.haml b/app/views/shared/issuable/form/_contribution.html.haml index dc6abfd2c9e..c9dda22de46 100644 --- a/app/views/shared/issuable/form/_contribution.html.haml +++ b/app/views/shared/issuable/form/_contribution.html.haml @@ -1,5 +1,7 @@ - issuable = local_assigns.fetch(:issuable) - form = local_assigns.fetch(:form) +- contribution_help_link = help_page_path('user/project/merge_requests/allow_collaboration') +- contribution_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: contribution_help_link } - return unless issuable.is_a?(MergeRequest) - return unless issuable.for_fork? @@ -8,13 +10,10 @@ %hr .form-group.row - %label.col-form-label.col-sm-2 + %label.col-form-label.col-sm-2.pt-sm-0 = _('Contribution') .col-sm-10 - .form-check.gl-mt-2 - = form.check_box :allow_collaboration, disabled: !issuable.can_allow_collaboration?(current_user), class: 'form-check-input' - = form.label :allow_collaboration, class: 'form-check-label' do - = _('Allow commits from members who can merge to the target branch.') - = link_to 'About this feature', help_page_path('user/project/merge_requests/allow_collaboration'), target: '_blank', rel: 'noopener noreferrer nofollow' - .form-text.text-muted - = allow_collaboration_unavailable_reason(issuable) + = form.gitlab_ui_checkbox_component :allow_collaboration, + _('Allow commits from members who can merge to the target branch. %{link_start}About this feature.%{link_end}').html_safe % { link_start: contribution_help_link_start, link_end: '</a>'.html_safe }, + checkbox_options: { disabled: !issuable.can_allow_collaboration?(current_user) }, + help_text: allow_collaboration_unavailable_reason(issuable) diff --git a/app/views/shared/issuable/form/_metadata.html.haml b/app/views/shared/issuable/form/_metadata.html.haml index 34720576526..e941eaadbc9 100644 --- a/app/views/shared/issuable/form/_metadata.html.haml +++ b/app/views/shared/issuable/form/_metadata.html.haml @@ -17,10 +17,8 @@ - if issuable.respond_to?(:confidential) && can?(current_user, :set_confidentiality, issuable) .form-group.row .offset-sm-2.col-sm-10 - .form-check - = form.check_box :confidential, class: 'form-check-input' - = form.label :confidential, class: 'form-check-label' do - #{_('This issue is confidential and should only be visible to team members with at least Reporter access.')} + = form.gitlab_ui_checkbox_component :confidential, + _('This issue is confidential and should only be visible to team members with at least Reporter access.') - if can?(current_user, :"set_#{issuable.to_ability_name}_metadata", issuable) %hr diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml index 1babc6885c2..7276175db59 100644 --- a/app/views/shared/issue_type/_details_content.html.haml +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -1,8 +1,8 @@ - related_branches_path = related_branches_project_issue_path(@project, issuable) - api_awards_path = local_assigns.fetch(:api_awards_path, nil) -.issue-details.issuable-details - .detail-page-description.content-block +.issue-details.issuable-details.js-issue-details + .detail-page-description.content-block.js-detail-page-description #js-issuable-app{ data: { initial: issuable_initial_data(issuable).to_json, full_path: @project.full_path } } .title-container %h1.title= markdown_field(issuable, :title) @@ -12,6 +12,7 @@ = edited_time_ago_with_tooltip(issuable, placement: 'bottom', html_class: 'issue-edited-ago js-issue-edited-ago') + .js-issue-widgets = render 'shared/issue_type/sentry_stack_trace', issuable: issuable = render 'projects/issues/design_management' @@ -28,8 +29,9 @@ #related-branches{ data: { url: related_branches_path } } -# This element is filled in using JavaScript. - = render 'shared/issue_type/emoji_block', issuable: issuable, api_awards_path: api_awards_path + .js-issue-widgets + = render 'shared/issue_type/emoji_block', issuable: issuable, api_awards_path: api_awards_path - = render 'projects/issues/discussion' + = render 'projects/issues/discussion' = render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @issue.assignees diff --git a/app/views/shared/milestones/_milestone_complete_alert.html.haml b/app/views/shared/milestones/_milestone_complete_alert.html.haml index 5b05fdb6019..4685a93a343 100644 --- a/app/views/shared/milestones/_milestone_complete_alert.html.haml +++ b/app/views/shared/milestones/_milestone_complete_alert.html.haml @@ -1,9 +1,8 @@ - milestone = local_assigns[:milestone] - if milestone.complete? && milestone.active? - = render 'shared/global_alert', - variant: :success, + = render Pajamas::AlertComponent.new(variant: :success, alert_data: { testid: 'all-issues-closed-alert' }, - dismissible: false do + dismissible: false) do .gl-alert-body = yield diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index 6fae6a15567..c39dc561801 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -37,8 +37,8 @@ - css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil = render "shared/projects/project", project: project, skip_namespace: skip_namespace, avatar: avatar, stars: stars, css_class: css_class, use_creator_avatar: use_creator_avatar, - forks: project.forking_enabled?, show_last_commit_as_description: show_last_commit_as_description, user: user, - merge_requests: project.merge_requests_enabled?, issues: project.issues_enabled?, + forks: project.forking_enabled?, show_last_commit_as_description: show_last_commit_as_description, + user: user, merge_requests: able_to_see_merge_requests?(project, user), issues: able_to_see_issues?(project, user), pipeline_status: pipeline_status, compact_mode: compact_mode = paginate_collection(projects, remote: remote) unless skip_pagination - else diff --git a/app/views/shared/runners/_runner_type_alert.html.haml b/app/views/shared/runners/_runner_type_alert.html.haml index e0cc1e924d8..365cee5fadc 100644 --- a/app/views/shared/runners/_runner_type_alert.html.haml +++ b/app/views/shared/runners/_runner_type_alert.html.haml @@ -1,20 +1,16 @@ -.gl-alert.gl-alert-info.gl-my-5 - = sprite_icon('information-o', css_class: 'gl-alert-icon') - - if runner.instance_type? - %h4.gl-alert-title - = s_('Runners|This runner is available to all groups and projects in your GitLab instance.') - .gl-alert-body - = s_('Runners|Shared runners are available to every project in a GitLab instance. If you want a runner to build only specific projects, restrict the project in the table below. After you restrict a runner to a project, you cannot change it back to a shared runner.') - = link_to _('Learn more.'), help_page_path('ci/runners/runners_scope', anchor: 'shared-runners'), target: '_blank', rel: 'noopener noreferrer' - - elsif runner.group_type? - %h4.gl-alert-title - = s_('Runners|This runner is available to all projects and subgroups in a group.') +- alert_class = 'gl-mb-5' + +- if runner.group_type? + = render Pajamas::AlertComponent.new(alert_class: alert_class, + title: s_('Runners|This runner is available to all projects and subgroups in a group.'), + dismissible: false) do .gl-alert-body = s_('Runners|Use Group runners when you want all projects in a group to have access to a set of runners.') = link_to _('Learn more.'), help_page_path('ci/runners/runners_scope', anchor: 'group-runners'), target: '_blank', rel: 'noopener noreferrer' - - else - %h4.gl-alert-title - = s_('Runners|This runner is associated with specific projects.') +- else + = render Pajamas::AlertComponent.new(alert_class: alert_class, + title: s_('Runners|This runner is associated with specific projects.'), + dismissible: false) do .gl-alert-body = s_('Runners|You can set up a specific runner to be used by multiple projects but you cannot make this a shared runner.') = link_to _('Learn more.'), help_page_path('ci/runners/runners_scope', anchor: 'specific-runners'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/shared/tokens/_scopes_form.html.haml b/app/views/shared/tokens/_scopes_form.html.haml index 33e95446bd7..010376464f1 100644 --- a/app/views/shared/tokens/_scopes_form.html.haml +++ b/app/views/shared/tokens/_scopes_form.html.haml @@ -1,9 +1,14 @@ - scopes = local_assigns.fetch(:scopes) - prefix = local_assigns.fetch(:prefix) - token = local_assigns.fetch(:token) +- f = local_assigns.fetch(:f) -- scopes.each do |scope| - %fieldset.form-group.form-check - = check_box_tag "#{prefix}[scopes][]", scope, token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}", class: "form-check-input", data: { qa_selector: "#{scope}_checkbox" } - = label_tag "#{prefix}_scopes_#{scope}", scope, class: 'label-bold form-check-label' - .text-secondary= t scope, scope: scope_description(prefix) +%fieldset + - scopes.each do |scope| + - help_text = t scope, scope: scope_description(prefix) + = f.gitlab_ui_checkbox_component :scopes, scope, + help_text: help_text, + checkbox_options: { checked: token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}", multiple: true, data: { qa_selector: "#{scope}_checkbox" } }, + checked_value: scope, + unchecked_value: nil, + label_options: { data: { qa_selector: "#{scope}_label" } } diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index 5650f08b2a9..afe72767b9a 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -14,92 +14,67 @@ = s_('Webhooks|Used to validate received payloads. Sent with the request in the %{code_start}X-Gitlab-Token HTTP%{code_end} header.').html_safe % { code_start: code_start, code_end: code_end } .form-group = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' - %ul.list-unstyled.gl-ml-6 - %li - = form.check_box :push_events, class: 'form-check-input' - = form.label :push_events, class: 'list-label form-check-label gl-ml-1 gl-mb-3' do - %strong= s_('Webhooks|Push events') - = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' - %p.text-muted.gl-ml-1 + %ul.list-unstyled + %li.gl-pb-5 + = 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.') - %li - = form.check_box :tag_push_events, class: 'form-check-input' - = form.label :tag_push_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Tag push events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A new tag is pushed to the repository.') - %li - = form.check_box :note_events, class: 'form-check-input' - = form.label :note_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Comments') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A comment is added to an issue.') - %li - = form.check_box :confidential_note_events, class: 'form-check-input' - = form.label :confidential_note_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential comments') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A comment is added to a confidential issue.') - %li - = form.check_box :issues_events, class: 'form-check-input' - = form.label :issues_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Issues events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|An issue is created, updated, closed, or reopened.') - %li - = form.check_box :confidential_issues_events, class: 'form-check-input' - = form.label :confidential_issues_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential issues events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :tag_push_events, + s_('Webhooks|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'), + 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'), + 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'), + 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'), + 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 - = form.check_box :merge_requests_events, class: 'form-check-input' - = form.label :merge_requests_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Merge request events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A merge request is created, updated, or merged.') - %li - = form.check_box :job_events, class: 'form-check-input' - = form.label :job_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Job events') - %p.text-muted.gl-ml-1 - = s_("Webhooks|A job's status changes.") - %li - = form.check_box :pipeline_events, class: 'form-check-input' - = form.label :pipeline_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Pipeline events') - %p.text-muted.gl-ml-1 - = s_("Webhooks|A pipeline's status changes.") - %li - = form.check_box :wiki_page_events, class: 'form-check-input' - = form.label :wiki_page_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Wiki page events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A wiki page is created or updated.') - %li - = form.check_box :deployment_events, class: 'form-check-input' - = form.label :deployment_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Deployment events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') - %li - = form.check_box :feature_flag_events, class: 'form-check-input' - = form.label :feature_flag_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Feature flag events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A feature flag is turned on or off.') - %li - = form.check_box :releases_events, class: 'form-check-input' - = form.label :releases_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Releases events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A release is created or updated.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :merge_requests_events, + s_('Webhooks|Merge request 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'), + help_text: s_("Webhooks|A job's status changes.") + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :pipeline_events, + s_('Webhooks|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'), + 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'), + 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'), + 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'), + 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' - .form-check - = form.check_box :enable_ssl_verification, class: 'form-check-input' - = form.label :enable_ssl_verification, class: 'form-check-label gl-ml-1' do - %strong= s_('Webhooks|Enable SSL verification') + %ul.list-unstyled + %li + = form.gitlab_ui_checkbox_component :enable_ssl_verification, s_('Webhooks|Enable SSL verification') diff --git a/app/views/shared/web_hooks/_hook_errors.html.haml b/app/views/shared/web_hooks/_hook_errors.html.haml index 03f373783f8..a100a620cea 100644 --- a/app/views/shared/web_hooks/_hook_errors.html.haml +++ b/app/views/shared/web_hooks/_hook_errors.html.haml @@ -10,17 +10,13 @@ limit: hook.rate_limit, support_link_start: link_start % { url: support_path }, support_link_end: link_end } - = render 'shared/global_alert', - title: s_('Webhooks|Webhook was automatically disabled'), - variant: :danger, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook was automatically disabled'), + variant: :danger) do .gl-alert-body = s_('Webhooks|The webhook was triggered more than %{limit} times per minute and is now disabled. To re-enable this webhook, fix the problems shown in %{strong_start}Recent events%{strong_end}, then re-test your settings. %{support_link_start}Contact Support%{support_link_end} if you need help re-enabling your webhook.').html_safe % placeholders - elsif hook.permanently_disabled? - = render 'shared/global_alert', - title: s_('Webhooks|Webhook failed to connect'), - variant: :danger, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook failed to connect'), + variant: :danger) do .gl-alert-body = s_('Webhooks|The webhook failed to connect, and is disabled. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % { strong_start: strong_start, strong_end: strong_end } - elsif hook.temporarily_disabled? @@ -30,9 +26,7 @@ retry_time: time_interval_in_words(hook.disabled_until - Time.now), help_link_start: link_start % { url: help_path }, help_link_end: link_end } - = render 'shared/global_alert', - title: s_('Webhooks|Webhook fails to connect'), - variant: :warning, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook fails to connect'), + variant: :warning) do .gl-alert-body = s_('Webhooks|The webhook %{help_link_start}failed to connect%{help_link_end}, and will retry in %{retry_time}. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % placeholders diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index e121725b9af..34bedbd928a 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -3,4 +3,4 @@ .gl-mt-3 = form_errors(@page, truncate: :title) -#js-wiki-form{ data: { page_info: page_info.to_json, format_options: Wiki::MARKUPS.to_json } } +#js-wiki-form{ data: { page_info: page_info.to_json, format_options: wiki_markup_hash_by_name_id.to_json } } diff --git a/app/views/shared/wikis/_main_links.html.haml b/app/views/shared/wikis/_main_links.html.haml index 02794950895..c1fd8c48c60 100644 --- a/app/views/shared/wikis/_main_links.html.haml +++ b/app/views/shared/wikis/_main_links.html.haml @@ -1,5 +1,5 @@ - if @page&.persisted? - = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button", role: "button", data: { qa_selector: 'page_history_button' } do + = link_to wiki_page_path(@wiki, @page, action: :history), class: "btn gl-button btn-default", role: "button", data: { qa_selector: 'page_history_button' } do = s_("Wiki|Page history") - if can?(current_user, :create_wiki, @wiki.container) = link_to wiki_path(@wiki, action: :new), class: "btn gl-button btn-confirm-secondary", role: "button", data: { qa_selector: 'new_page_button' } do diff --git a/app/views/shared/wikis/show.html.haml b/app/views/shared/wikis/show.html.haml index e6980aae3e1..6591e8fae7b 100644 --- a/app/views/shared/wikis/show.html.haml +++ b/app/views/shared/wikis/show.html.haml @@ -26,6 +26,7 @@ %div - if can?(current_user, :create_wiki, @wiki.container) && @page.latest? && @valid_encoding = link_to sprite_icon('pencil', css_class: 'gl-icon'), wiki_page_path(@wiki, @page, action: :edit), title: 'Edit', role: "button", class: 'btn gl-button btn-icon btn-default js-wiki-edit', data: { qa_selector: 'edit_page_button', testid: 'wiki_edit_button' } - = render 'shared/wikis/wiki_content' + + .js-async-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content', tracking_context: wiki_page_tracking_context(@page).to_json, get_wiki_content_url: wiki_page_render_api_endpoint(@page) } } = render 'shared/wikis/sidebar' |