diff options
Diffstat (limited to 'app/views/shared')
51 files changed, 509 insertions, 250 deletions
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 fdd4dfba616..d69f54608e9 100644 --- a/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml +++ b/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml @@ -1,12 +1,12 @@ - if show_auto_devops_implicitly_enabled_banner?(project, current_user) = 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 - .gl-alert-body + close_button_data: { project_id: project.id }) do |c| + = c.body do = 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 %div = _('Container registry is not enabled on this GitLab instance. Ask an administrator to enable it in order for Auto DevOps to work.') - .gl-alert-actions + = c.actions do = link_to _('Settings'), project_settings_ci_cd_path(project), class: 'alert-link btn gl-button btn-confirm' = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank', class: 'alert-link btn gl-button btn-default gl-ml-3' diff --git a/app/views/shared/_import_form.html.haml b/app/views/shared/_import_form.html.haml index 850d58920db..7248403d6c9 100644 --- a/app/views/shared/_import_form.html.haml +++ b/app/views/shared/_import_form.html.haml @@ -2,6 +2,19 @@ - import_url = Gitlab::UrlSanitizer.new(f.object.import_url) .import-url-data + .info-well.prepend-top-20 + .well-segment + %ul + %li + = html_escape(_('The repository must be accessible over %{code_open}http://%{code_close}, %{code_open}https://%{code_close} or %{code_open}git://%{code_close}.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + %li= html_escape(_('When using the %{code_open}http://%{code_close} or %{code_open}https://%{code_close} protocols, please provide the exact URL to the repository. HTTP redirects will not be followed.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + %li + = _('If your HTTP repository is not publicly accessible, add your credentials.') + %li + = import_will_timeout_message(ci_cd_only) + %li + = import_svn_message(ci_cd_only) + = render_if_exists 'shared/ci_cd_only_link', ci_cd_only: ci_cd_only .form-group = f.label :import_url, class: 'label-bold' do %span @@ -11,9 +24,10 @@ = 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 - .gl-alert-body + close_button_class: 'js-close-2fa-enabled-success-alert') do |c| + = c.body do = s_('Import|There is not a valid Git repository at this URL. If your HTTP repository is not publicly accessible, verify your credentials.') + = render_if_exists 'shared/ee/import_form', f: f, ci_cd_only: ci_cd_only .row .form-group.col-md-6 = f.label :import_url_user, class: 'label-bold' do @@ -26,19 +40,3 @@ %span = _('Password (optional)') = f.password_field :import_url_password, class: 'form-control gl-form-input', required: false, autocomplete: 'new-password' - - .info-well.prepend-top-20 - .well-segment - %ul - %li - = html_escape(_('The repository must be accessible over %{code_open}http://%{code_close}, %{code_open}https://%{code_close} or %{code_open}git://%{code_close}.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - %li= html_escape(_('When using the %{code_open}http://%{code_close} or %{code_open}https://%{code_close} protocols, please provide the exact URL to the repository. HTTP redirects will not be followed.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - %li - = _('If your HTTP repository is not publicly accessible, add your credentials.') - %li - = import_will_timeout_message(ci_cd_only) - %li - = import_svn_message(ci_cd_only) - = render_if_exists 'shared/ci_cd_only_link', ci_cd_only: ci_cd_only - -= render_if_exists 'shared/ee/import_form', f: f, ci_cd_only: ci_cd_only diff --git a/app/views/shared/_integration_settings.html.haml b/app/views/shared/_integration_settings.html.haml index 93606ca0aba..84710b2ecc7 100644 --- a/app/views/shared/_integration_settings.html.haml +++ b/app/views/shared/_integration_settings.html.haml @@ -6,8 +6,8 @@ .js-vue-integration-settings{ data: integration_form_data(integration, group: @group, project: @project) } .js-integration-help-html.gl-display-none -# All content below will be repositioned in Vue - - if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true) - = render "projects/services/#{integration.to_param}/help", integration: integration + - if lookup_context.template_exists?('help', "shared/integrations/#{integration.to_param}", true) + = render "shared/integrations/#{integration.to_param}/help", integration: integration - elsif integration.help.present? .info-well .well-segment diff --git a/app/views/shared/_logo.svg b/app/views/shared/_logo.svg index 0ef9de5fed6..83f6fe5c16c 100644 --- a/app/views/shared/_logo.svg +++ b/app/views/shared/_logo.svg @@ -1,9 +1,10 @@ -<svg width="24" height="24" class="tanuki-logo" viewBox="0 0 36 36"> - <path class="tanuki-shape tanuki-left-ear" fill="#e24329" d="M2 14l9.38 9v-9l-4-12.28c-.205-.632-1.176-.632-1.38 0z"/> - <path class="tanuki-shape tanuki-right-ear" fill="#e24329" d="M34 14l-9.38 9v-9l4-12.28c.205-.632 1.176-.632 1.38 0z"/> - <path class="tanuki-shape tanuki-nose" fill="#e24329" d="M18,34.38 3,14 33,14 Z"/> - <path class="tanuki-shape tanuki-left-eye" fill="#fc6d26" d="M18,34.38 11.38,14 2,14 6,25Z"/> - <path class="tanuki-shape tanuki-right-eye" fill="#fc6d26" d="M18,34.38 24.62,14 34,14 30,25Z"/> - <path class="tanuki-shape tanuki-left-cheek" fill="#fca326" d="M2 14L.1 20.16c-.18.565 0 1.2.5 1.56l17.42 12.66z"/> - <path class="tanuki-shape tanuki-right-cheek" fill="#fca326" d="M34 14l1.9 6.16c.18.565 0 1.2-.5 1.56L18 34.38z"/> +<svg class="tanuki-logo" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#E24329"/> + <path class="tanuki-shape right-cheek" d="m24.507 9.5-.034-.09a11.44 11.44 0 0 0-4.56 2.051l-7.447 5.632 4.742 3.584 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#FC6D26"/> + <path class="tanuki-shape chin" d="m7.707 20.677 2.56 1.935 1.555 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935-4.743-3.584-4.755 3.584Z" + fill="#FCA326"/> + <path class="tanuki-shape left-cheek" d="M5.01 11.461a11.43 11.43 0 0 0-4.56-2.05L.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 4.745-3.584-7.444-5.632Z" + fill="#FC6D26"/> </svg> diff --git a/app/views/shared/_logo_type.svg b/app/views/shared/_logo_type.svg deleted file mode 100644 index cb07e2634a9..00000000000 --- a/app/views/shared/_logo_type.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 617 169"><path d="M315.26 2.97h-21.8l.1 162.5h88.3v-20.1h-66.5l-.1-142.4M465.89 136.95c-5.5 5.7-14.6 11.4-27 11.4-16.6 0-23.3-8.2-23.3-18.9 0-16.1 11.2-23.8 35-23.8 4.5 0 11.7.5 15.4 1.2v30.1h-.1m-22.6-98.5c-17.6 0-33.8 6.2-46.4 16.7l7.7 13.4c8.9-5.2 19.8-10.4 35.5-10.4 17.9 0 25.8 9.2 25.8 24.6v7.9c-3.5-.7-10.7-1.2-15.1-1.2-38.2 0-57.6 13.4-57.6 41.4 0 25.1 15.4 37.7 38.7 37.7 15.7 0 30.8-7.2 36-18.9l4 15.9h15.4v-83.2c-.1-26.3-11.5-43.9-44-43.9M557.63 149.1c-8.2 0-15.4-1-20.8-3.5V70.5c7.4-6.2 16.6-10.7 28.3-10.7 21.1 0 29.2 14.9 29.2 39 0 34.2-13.1 50.3-36.7 50.3m9.2-110.6c-19.5 0-30 13.3-30 13.3v-21l-.1-27.8h-21.3l.1 158.5c10.7 4.5 25.3 6.9 41.2 6.9 40.7 0 60.3-26 60.3-70.9-.1-35.5-18.2-59-50.2-59M77.9 20.6c19.3 0 31.8 6.4 39.9 12.9l9.4-16.3C114.5 6 97.3 0 78.9 0 32.5 0 0 28.3 0 85.4c0 59.8 35.1 83.1 75.2 83.1 20.1 0 37.2-4.7 48.4-9.4l-.5-63.9V75.1H63.6v20.1h38l.5 48.5c-5 2.5-13.6 4.5-25.3 4.5-32.2 0-53.8-20.3-53.8-63-.1-43.5 22.2-64.6 54.9-64.6M231.43 2.95h-21.3l.1 27.3v94.3c0 26.3 11.4 43.9 43.9 43.9 4.5 0 8.9-.4 13.1-1.2v-19.1c-3.1.5-6.4.7-9.9.7-17.9 0-25.8-9.2-25.8-24.6v-65h35.7v-17.8h-35.7l-.1-38.5M155.96 165.47h21.3v-124h-21.3v124M155.96 24.37h21.3V3.07h-21.3v21.3"/></svg> diff --git a/app/views/shared/_logo_ukraine.svg b/app/views/shared/_logo_ukraine.svg deleted file mode 100644 index e2c2bb3855d..00000000000 --- a/app/views/shared/_logo_ukraine.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg width="24" height="24" class="tanuki-logo" viewBox="0 0 24 24"> - <path d="M4.89929534,0.3165 L7.56629534,8.5025 L16.3922953,8.5025 L19.0592953,0.3165 C19.1962953,-0.1055 19.8432953,-0.1055 19.9792953,0.3165 L23.9122953,12.6095 C23.9722953,12.7935 23.9722953,12.9895 23.9192953,13.1695 L0.0392953418,13.1695 C-0.0143874393,12.9863283 -0.0119492421,12.7912726 0.0462953418,12.6095 L3.97929534,0.3165 C4.11529534,-0.1055 4.76229534,-0.1055 4.89929534,0.3165 Z" id="Path" fill="#005BBB"></path> - <path d="M7.20329534,9.0025 L16.7552953,9.0025 L16.8682953,8.6575 L19.5182953,0.5185 L23.4362953,12.7615 C23.4961172,12.9376949 23.435535,13.1323657 23.2862953,13.2435 L23.2852953,13.2455 L11.9852953,21.4655 L11.9792953,21.4715 L0.673295342,13.2455 C0.522422013,13.1321007 0.462258936,12.9374792 0.522295342,12.7615 L4.43929534,0.5185 L7.09029534,8.6585 L7.20329534,9.0025 Z" id="Shape" stroke="#FFFFFF" opacity="0.32" stroke-linejoin="round"></path> - <path d="M0.0012953418,12.8575 C-0.0152229638,13.1685309 0.127095079,13.4667211 0.379295342,13.6495 L11.9792953,22.0895 L11.9862953,22.0845 L11.9922953,22.0895 L11.9872953,22.0835 L23.5792953,13.6495 C23.8319507,13.466647 23.9743476,13.1679148 23.9572953,12.8565 L0.0012953418,12.8565 L0.0012953418,12.8575 Z" id="Path" fill="#FFD500"></path> -</svg>
\ No newline at end of file diff --git a/app/views/shared/_logo_with_black_text.svg b/app/views/shared/_logo_with_black_text.svg new file mode 100644 index 00000000000..f5b0b70618b --- /dev/null +++ b/app/views/shared/_logo_with_black_text.svg @@ -0,0 +1,12 @@ +<svg class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path class="logo-text" d="M44.814 9.042h3.645c-.608-3.875-3.963-6.574-8.33-6.574-5.166 0-9.043 3.798-9.043 10.16 0 6.248 3.703 10.123 9.15 10.123 4.887 0 8.386-3.144 8.386-8.234v-2.37h-8.01v2.794h4.55c-.058 2.816-1.938 4.599-4.908 4.599-3.305 0-5.57-2.477-5.57-6.95 0-4.445 2.303-6.913 5.494-6.913 2.38 0 4.01 1.272 4.636 3.365Zm6.218 13.438h3.49V7.68h-3.49v14.8Zm1.76-17.151c1.109 0 2.014-.85 2.014-1.89s-.905-1.9-2.014-1.9c-1.109 0-2.024.849-2.024 1.9s.9 1.89 2.017 1.89h.007ZM64.971 7.68H62.05V4.126h-3.49v3.556h-2.1v2.699h2.1v8.233c-.018 2.786 2.007 4.16 4.628 4.079a7.089 7.089 0 0 0 2.055-.348l-.59-2.73a4.247 4.247 0 0 1-1.02.137c-.878 0-1.582-.309-1.582-1.717v-7.662h2.921V7.68Zm2.701 14.8h12.272v-2.998H71.25V2.737h-3.578V22.48Zm18.957.3c2.323 0 3.71-1.09 4.347-2.333h.115v2.033h3.36v-9.91c0-3.913-3.19-5.09-6.016-5.09-3.113 0-5.504 1.388-6.275 4.087l3.26.464c.345-1.013 1.329-1.88 3.04-1.88 1.62 0 2.506.829 2.506 2.285v.057c0 1.002-1.05 1.051-3.664 1.33-2.872.309-5.619 1.166-5.619 4.502-.01 2.912 2.12 4.455 4.946 4.455Zm1.147-2.56c-1.456 0-2.498-.666-2.498-1.948 0-1.34 1.167-1.899 2.72-2.121.917-.125 2.75-.357 3.2-.722v1.744c.01 1.643-1.321 3.042-3.422 3.042v.005Zm9.244 2.26h3.433v-2.332h.201c.551 1.08 1.698 2.593 4.244 2.593 3.489 0 6.102-2.768 6.102-7.644 0-4.936-2.69-7.616-6.112-7.616-2.613 0-3.702 1.57-4.234 2.641h-.147V2.737h-3.486V22.48Zm3.423-7.403c0-2.88 1.234-4.734 3.48-4.734 2.323 0 3.52 1.976 3.52 4.734 0 2.759-1.214 4.8-3.52 4.8-2.227 0-3.48-1.928-3.48-4.8Z" + fill="#171321"/> + <path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#E24329"/> + <path class="tanuki-shape right-cheek" d="m24.507 9.5-.034-.09a11.44 11.44 0 0 0-4.56 2.051l-7.447 5.632 4.742 3.584 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#FC6D26"/> + <path class="tanuki-shape chin" d="m7.707 20.677 2.56 1.935 1.555 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935-4.743-3.584-4.755 3.584Z" + fill="#FCA326"/> + <path class="tanuki-shape left-cheek" d="M5.01 11.461a11.43 11.43 0 0 0-4.56-2.05L.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 4.745-3.584-7.444-5.632Z" + fill="#FC6D26"/> +</svg> diff --git a/app/views/shared/_logo_with_white_text.svg b/app/views/shared/_logo_with_white_text.svg new file mode 100644 index 00000000000..d0067538058 --- /dev/null +++ b/app/views/shared/_logo_with_white_text.svg @@ -0,0 +1,12 @@ +<svg class="tanuki-logo" width="111" height="24" viewBox="0 0 111 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path class="logo-text" d="M44.814 9.042h3.645c-.608-3.875-3.963-6.574-8.33-6.574-5.166 0-9.043 3.798-9.043 10.16 0 6.248 3.703 10.123 9.15 10.123 4.887 0 8.386-3.144 8.386-8.234v-2.37h-8.01v2.794h4.55c-.058 2.816-1.938 4.599-4.908 4.599-3.305 0-5.57-2.477-5.57-6.95 0-4.445 2.303-6.913 5.494-6.913 2.38 0 4.01 1.272 4.636 3.365Zm6.218 13.438h3.49V7.68h-3.49v14.8Zm1.76-17.151c1.109 0 2.014-.85 2.014-1.89s-.905-1.9-2.014-1.9c-1.109 0-2.024.849-2.024 1.9s.9 1.89 2.017 1.89h.007ZM64.971 7.68H62.05V4.126h-3.49v3.556h-2.1v2.699h2.1v8.233c-.018 2.786 2.007 4.16 4.628 4.079a7.089 7.089 0 0 0 2.055-.348l-.59-2.73a4.247 4.247 0 0 1-1.02.137c-.878 0-1.582-.309-1.582-1.717v-7.662h2.921V7.68Zm2.701 14.8h12.272v-2.998H71.25V2.737h-3.578V22.48Zm18.957.3c2.323 0 3.71-1.09 4.347-2.333h.115v2.033h3.36v-9.91c0-3.913-3.19-5.09-6.016-5.09-3.113 0-5.504 1.388-6.275 4.087l3.26.464c.345-1.013 1.329-1.88 3.04-1.88 1.62 0 2.506.829 2.506 2.285v.057c0 1.002-1.05 1.051-3.664 1.33-2.872.309-5.619 1.166-5.619 4.502-.01 2.912 2.12 4.455 4.946 4.455Zm1.147-2.56c-1.456 0-2.498-.666-2.498-1.948 0-1.34 1.167-1.899 2.72-2.121.917-.125 2.75-.357 3.2-.722v1.744c.01 1.643-1.321 3.042-3.422 3.042v.005Zm9.244 2.26h3.433v-2.332h.201c.551 1.08 1.698 2.593 4.244 2.593 3.489 0 6.102-2.768 6.102-7.644 0-4.936-2.69-7.616-6.112-7.616-2.613 0-3.702 1.57-4.234 2.641h-.147V2.737h-3.486V22.48Zm3.423-7.403c0-2.88 1.234-4.734 3.48-4.734 2.323 0 3.52 1.976 3.52 4.734 0 2.759-1.214 4.8-3.52 4.8-2.227 0-3.48-1.928-3.48-4.8Z" + fill="#fff"/> + <path class="tanuki-shape tanuki" d="m24.507 9.5-.034-.09L21.082.562a.896.896 0 0 0-1.694.091l-2.29 7.01H7.825L5.535.653a.898.898 0 0 0-1.694-.09L.451 9.411.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#E24329"/> + <path class="tanuki-shape right-cheek" d="m24.507 9.5-.034-.09a11.44 11.44 0 0 0-4.56 2.051l-7.447 5.632 4.742 3.584 5.197-3.89.014-.01A6.297 6.297 0 0 0 24.507 9.5Z" + fill="#FC6D26"/> + <path class="tanuki-shape chin" d="m7.707 20.677 2.56 1.935 1.555 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935-4.743-3.584-4.755 3.584Z" + fill="#FCA326"/> + <path class="tanuki-shape left-cheek" d="M5.01 11.461a11.43 11.43 0 0 0-4.56-2.05L.416 9.5a6.297 6.297 0 0 0 2.09 7.278l.012.01.03.022 5.16 3.867 4.745-3.584-7.444-5.632Z" + fill="#FC6D26"/> +</svg> diff --git a/app/views/shared/_milestones_sort_dropdown.html.haml b/app/views/shared/_milestones_sort_dropdown.html.haml index 1c6eb7aa96b..b68022bfeda 100644 --- a/app/views/shared/_milestones_sort_dropdown.html.haml +++ b/app/views/shared/_milestones_sort_dropdown.html.haml @@ -1,4 +1,4 @@ - 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' + = gl_redirect_listbox_tag milestones_sort_options, @sort diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml index 74a397d7a03..821f1ede422 100644 --- a/app/views/shared/_new_project_item_select.html.haml +++ b/app/views/shared/_new_project_item_select.html.haml @@ -1,7 +1,6 @@ - if any_projects?(@projects) - .project-item-select-holder.btn-group.gl-ml-auto.gl-mr-auto.gl-relative.gl-overflow-hidden{ class: 'gl-display-flex!' } - %a.btn.gl-button.btn-confirm.js-new-project-item-link.block-truncated.qa-new-project-item-link{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] }, class: "gl-m-0!" } + .dropdown.b-dropdown.gl-new-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.qa-new-project-item-link{ 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] - %button.btn.dropdown-toggle.btn-confirm.btn-md.gl-button.gl-dropdown-toggle.dropdown-toggle-split.new-project-item-select-button.qa-new-project-item-select-button.gl-p-0.gl-w-100{ class: "gl-m-0!", 'aria-label': _('Toggle project select') } - = sprite_icon('chevron-down') + %button.btn.dropdown-toggle.btn-confirm.btn-md.gl-button.gl-dropdown-toggle.dropdown-toggle-split.new-project-item-select-button.qa-new-project-item-select-button{ 'aria-label': _('Toggle project select') } diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml index 195bd15f840..91cd91ec38b 100644 --- a/app/views/shared/_no_password.html.haml +++ b/app/views/shared/_no_password.html.haml @@ -1,9 +1,9 @@ - if show_no_password_message? = render Pajamas::AlertComponent.new(variant: :warning, alert_class: 'js-no-password-message', - close_button_class: 'js-hide-no-password-message') do - .gl-alert-body + close_button_class: 'js-hide-no-password-message') do |c| + = c.body do = no_password_message - .gl-alert-actions + = c.actions do = link_to _('Remind later'), '#', class: 'js-hide-no-password-message gl-alert-action btn btn-confirm btn-md gl-button' = link_to _("Don't show again"), profile_path(user: { hide_no_password: true }), method: :put, role: 'button', class: 'gl-alert-action btn btn-default btn-md gl-button' diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index d30679b4305..c4d8cb092dc 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -1,9 +1,9 @@ - if show_no_ssh_key_message? = render Pajamas::AlertComponent.new(variant: :warning, alert_class: 'js-no-ssh-message', - close_button_class: 'js-hide-no-ssh-message') do - .gl-alert-body + close_button_class: 'js-hide-no-ssh-message') do |c| + = c.body do = s_("MissingSSHKeyWarningLink|You can't push or pull repositories using SSH until you add an SSH key to your profile.") - .gl-alert-actions + = c.actions do = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "gl-alert-action btn btn-confirm btn-md gl-button" = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: { hide_no_ssh_key: true }), method: :put, role: 'button', class: 'gl-alert-action btn btn-default btn-md gl-button' diff --git a/app/views/shared/_outdated_browser.html.haml b/app/views/shared/_outdated_browser.html.haml index 76fb34985c0..0af378cb883 100644 --- a/app/views/shared/_outdated_browser.html.haml +++ b/app/views/shared/_outdated_browser.html.haml @@ -1,6 +1,6 @@ - if outdated_browser? - = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false) do - .gl-alert-body + = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false) do |c| + = c.body do = s_('OutdatedBrowser|GitLab may not work properly, because you are using an outdated web browser.') %br - browser_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('install/requirements', anchor: 'supported-web-browsers') } diff --git a/app/views/shared/_project_limit.html.haml b/app/views/shared/_project_limit.html.haml index 7e1874f3416..b630c829c76 100644 --- a/app/views/shared/_project_limit.html.haml +++ b/app/views/shared/_project_limit.html.haml @@ -1,9 +1,9 @@ - if cookies[:hide_project_limit_message].blank? && !current_user.hide_project_limit && !current_user.can_create_project? && current_user.projects_limit > 0 = render Pajamas::AlertComponent.new(variant: :warning, dismissible: false, - alert_class: 'project-limit-message') do - .gl-alert-body + alert_class: 'project-limit-message') do |c| + = c.body do = _("You won't be able to create new projects because you have reached your project limit.") - .gl-alert-actions + = c.actions do = link_to _('Remind later'), '#', class: 'alert-link hide-project-limit-message btn gl-button btn-confirm' = link_to _("Don't show again"), profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link btn gl-button btn-default gl-ml-3' diff --git a/app/views/shared/_registration_features_discovery_message.html.haml b/app/views/shared/_registration_features_discovery_message.html.haml index e5b1ad88a7f..053c511830c 100644 --- a/app/views/shared/_registration_features_discovery_message.html.haml +++ b/app/views/shared/_registration_features_discovery_message.html.haml @@ -1,5 +1,5 @@ - feature_title = local_assigns.fetch(:feature_title, s_('RegistrationFeatures|use this feature')) -- registration_features_docs_path = help_page_path('development/service_ping/index.md', anchor: 'registration-features-program') +- registration_features_docs_path = help_page_path('user/admin_area/settings/usage_statistics.md', anchor: 'registration-features-program') - registration_features_link_start = '<a href="%{url}" target="_blank">'.html_safe % { url: registration_features_docs_path } %div diff --git a/app/views/shared/_service_ping_consent.html.haml b/app/views/shared/_service_ping_consent.html.haml index 96f015c7a4b..8de7552c39a 100644 --- a/app/views/shared/_service_ping_consent.html.haml +++ b/app/views/shared/_service_ping_consent.html.haml @@ -1,10 +1,10 @@ - if session[:ask_for_usage_stats_consent] - = render Pajamas::AlertComponent.new(alert_class: 'service-ping-consent-message') do - .gl-alert-body + = render Pajamas::AlertComponent.new(alert_class: 'service-ping-consent-message') do |c| + = c.body do - 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' = s_('To help improve GitLab, we would like to periodically %{docs_link}. This can be changed at any time in %{settings_link}.').html_safe % { docs_link: docs_link, settings_link: settings_link } - .gl-alert-actions.gl-mt-3 + = c.actions do - send_service_data_path = admin_application_settings_path(application_setting: { version_check_enabled: 1, usage_ping_enabled: 1 }) - not_now_path = admin_application_settings_path(application_setting: { version_check_enabled: 0, usage_ping_enabled: 0 }) = link_to _("Send service data"), send_service_data_path, 'data-url' => admin_application_settings_path, method: :put, 'data-check-enabled': true, 'data-service-ping-enabled': true, class: 'js-service-ping-consent-action alert-link btn gl-button btn-info' 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 2294c44d49f..0899756d088 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 @@ -3,10 +3,10 @@ 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 + close_button_data: { testid: 'close-account-recovery-regular-check-callout' }) do |c| + = c.body do = 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' - .gl-alert-actions + = c.actions do = link_to profile_two_factor_auth_path, class: 'deferred-link btn gl-alert-action btn-confirm btn-md gl-button' do = s_('Profiles|Manage two-factor authentication') diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml index 7f7dafbe5b0..5ca9cf8d9a4 100644 --- a/app/views/shared/access_tokens/_table.html.haml +++ b/app/views/shared/access_tokens/_table.html.haml @@ -1,23 +1,16 @@ - no_active_tokens_message = local_assigns.fetch(:no_active_tokens_message, _('This user has no active %{type}.') % { type: type_plural }) - impersonation = local_assigns.fetch(:impersonation, false) - resource = local_assigns.fetch(:resource, false) -- personal = !impersonation && !resource %hr %h5 = _('Active %{type} (%{token_length})') % { type: type_plural, token_length: active_tokens.length } -- if personal && !personal_access_token_expiration_enforced? - %p.profile-settings-content - = _("Personal access tokens are not revoked upon expiration.") - if impersonation %p.profile-settings-content = _("To see all the user's personal access tokens you must impersonate them first.") -- if personal - = render_if_exists 'profiles/personal_access_tokens/token_expiry_notification', active_tokens: active_tokens - - if active_tokens.present? .table-responsive %table.table.active-tokens @@ -46,12 +39,8 @@ %span.token-never-used-label= _('Never') %td - if token.expires? - - if token.expired? || token.expired_but_not_enforced? - %span{ class: 'text-danger has-tooltip', title: _('Token valid until revoked') } - = _('Expired') - - else - %span{ class: ('text-warning' if token.expires_soon?) } - = time_ago_with_tooltip(token.expires_at) + %span{ class: ('text-warning' if token.expires_soon?) } + = time_ago_with_tooltip(token.expires_at) - else %span.token-never-expires-label= _('Never') - if resource diff --git a/app/views/shared/deploy_tokens/_form.html.haml b/app/views/shared/deploy_tokens/_form.html.haml index 7289121d9eb..2e04bbf3605 100644 --- a/app/views/shared/deploy_tokens/_form.html.haml +++ b/app/views/shared/deploy_tokens/_form.html.haml @@ -3,7 +3,7 @@ - group_deploy_tokens_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_deploy_tokens_help_link_url } = s_('DeployTokens|Create a new deploy token for all projects in this group. %{link_start}What are deploy tokens?%{link_end}').html_safe % { link_start: group_deploy_tokens_help_link_start, link_end: '</a>'.html_safe } -= form_for token, url: create_deploy_token_path(group_or_project, anchor: 'js-deploy-tokens'), method: :post, remote: Feature.enabled?(:ajax_new_deploy_token, group_or_project) do |f| += gitlab_ui_form_for token, url: create_deploy_token_path(group_or_project, anchor: 'js-deploy-tokens'), method: :post, remote: Feature.enabled?(:ajax_new_deploy_token, group_or_project) do |f| .form-group = f.label :name, class: 'label-bold' @@ -23,33 +23,15 @@ .form-group = f.label :scopes, _('Scopes (select at least one)'), class: 'label-bold' - %fieldset.form-group.form-check - = f.check_box :read_repository, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_repository_checkbox' } - = f.label :read_repository, 'read_repository', class: 'label-bold form-check-label' - .text-secondary - = s_('DeployTokens|Allows read-only access to the repository.') + = f.gitlab_ui_checkbox_component :read_repository, 'read_repository', help_text: s_('DeployTokens|Allows read-only access to the repository.'), checkbox_options: { data: { qa_selector: 'deploy_token_read_repository_checkbox' } } - if container_registry_enabled?(group_or_project) - %fieldset.form-group.form-check - = f.check_box :read_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_registry_checkbox' } - = f.label :read_registry, 'read_registry', class: 'label-bold form-check-label' - .text-secondary= s_('DeployTokens|Allows read-only access to registry images.') - - %fieldset.form-group.form-check - = f.check_box :write_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_write_registry_checkbox' } - = f.label :write_registry, 'write_registry', class: 'label-bold form-check-label' - .text-secondary= s_('DeployTokens|Allows write access to registry images.') + = f.gitlab_ui_checkbox_component :read_registry, 'read_registry', help_text: s_('DeployTokens|Allows read-only access to registry images.'), checkbox_options: { data: { qa_selector: 'deploy_token_read_registry_checkbox' } } + = f.gitlab_ui_checkbox_component :write_registry, 'write_registry', help_text: s_('DeployTokens|Allows write access to registry images.'), checkbox_options: { data: { qa_selector: 'deploy_token_write_registry_checkbox' } } - if packages_registry_enabled?(group_or_project) - %fieldset.form-group.form-check - = f.check_box :read_package_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_package_registry_checkbox' } - = f.label :read_package_registry, 'read_package_registry', class: 'label-bold form-check-label' - .text-secondary= s_('DeployTokens|Allows read-only access to the package registry.') - - %fieldset.form-group.form-check - = f.check_box :write_package_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_write_package_registry_checkbox' } - = f.label :write_package_registry, 'write_package_registry', class: 'label-bold form-check-label' - .text-secondary= s_('DeployTokens|Allows read and write access to the package registry.') + = f.gitlab_ui_checkbox_component :read_package_registry, 'read_package_registry', help_text: s_('DeployTokens|Allows read-only access to the package registry.'), checkbox_options: { data: { qa_selector: 'deploy_token_read_package_registry_checkbox' } } + = f.gitlab_ui_checkbox_component :write_package_registry, 'write_package_registry', help_text: s_('DeployTokens|Allows read and write access to the package registry.'), checkbox_options: { data: { qa_selector: 'deploy_token_write_package_registry_checkbox' } } .gl-mt-3 = f.submit s_('DeployTokens|Create deploy token'), class: 'btn gl-button btn-confirm', data: { qa_selector: 'create_deploy_token_button' } diff --git a/app/views/shared/doorkeeper/applications/_form.html.haml b/app/views/shared/doorkeeper/applications/_form.html.haml index c1650405776..b40e2630011 100644 --- a/app/views/shared/doorkeeper/applications/_form.html.haml +++ b/app/views/shared/doorkeeper/applications/_form.html.haml @@ -17,12 +17,6 @@ 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 - - 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, f: f diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index d0c4fb2432c..fe602db4393 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -10,7 +10,7 @@ .row.empty-state.merge-requests .col-12 .svg-content - = image_tag 'illustrations/merge_requests.svg' + = image_tag 'illustrations/merge_requests.svg', { auto_dark: true } .col-12 .text-content - if has_filter_bar_param? @@ -42,4 +42,4 @@ - if project_select_button = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _('merge request'), type: :merge_requests, with_feature_enabled: 'merge_requests' - else - = link_to _('New merge request'), button_path, class: 'gl-button btn btn-confirm', title: _('New merge request'), id: 'new_merge_request_link' + = link_to _('New merge request'), button_path, class: 'gl-button btn btn-confirm', title: _('New merge request'), id: 'new_merge_request_link', data: { qa_selector: "new_merge_request_button" } diff --git a/app/views/shared/errors/_gitaly_unavailable.html.haml b/app/views/shared/errors/_gitaly_unavailable.html.haml index e99c41f2496..c9d7920b9c2 100644 --- a/app/views/shared/errors/_gitaly_unavailable.html.haml +++ b/app/views/shared/errors/_gitaly_unavailable.html.haml @@ -1,6 +1,6 @@ = render Pajamas::AlertComponent.new(alert_class: 'gl-my-5', variant: :danger, dismissible: false, - title: reason) do - .gl-alert-body + title: reason) do |c| + = c.body do = s_('The git server, Gitaly, is not available at this time. Please contact your administrator.') diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index ce04e24b09f..932971402a2 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -12,8 +12,8 @@ - if hook_log.internal_error_message.present? = render Pajamas::AlertComponent.new(title: _('Internal error occurred while delivering this webhook.'), variant: :danger, - dismissible: false) do - .gl-alert-body + dismissible: false) do |c| + = c.body do = _('Error: %{error}') % { error: hook_log.internal_error_message } %h4= _('Response') diff --git a/app/views/shared/integrations/mattermost_slash_commands/_detailed_help.html.haml b/app/views/shared/integrations/mattermost_slash_commands/_detailed_help.html.haml new file mode 100644 index 00000000000..fec443738c3 --- /dev/null +++ b/app/views/shared/integrations/mattermost_slash_commands/_detailed_help.html.haml @@ -0,0 +1,98 @@ +- pretty_name = @project&.full_name ? html_escape(@project&.full_name) : '<' + _('project name') + '>' +- run_actions_text = html_escape(s_("ProjectService|Perform common operations on GitLab project: %{project_name}")) % { project_name: pretty_name } + +%p= s_("ProjectService|To configure this integration, you should:") +%ul.list-unstyled.indent-list + %li + 1. + = link_to 'https://docs.gitlab.com/ee/user/project/integrations/mattermost_slash_commands.html#enable-custom-slash-commands', target: '_blank', rel: 'noopener noreferrer nofollow' do + Enable custom slash commands + = sprite_icon('external-link') + on your Mattermost installation. + %li + 2. + = link_to 'https://docs.gitlab.com/ee/user/project/integrations/mattermost_slash_commands.html#create-a-slash-command', target: '_blank', rel: 'noopener noreferrer nofollow' do + Add a slash command + = sprite_icon('external-link') + in your Mattermost team with the options listed below. + %li + 3. Paste the token into the + %strong Token + field. + %li + 4. Select the + %strong Active + check box, then select + %strong Save changes + to start using GitLab inside Mattermost! + +%hr + +.help-form + .form-group + = label_tag :display_name, _('Display name'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :display_name, "GitLab / #{pretty_name}".html_safe, class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#display_name', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag :description, _('Description'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#description', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag nil, s_('MattermostService|Command trigger word'), class: 'col-12 col-form-label label-bold' + .col-12 + %p= s_('MattermostService|Fill in the word that works best for your team.') + %p + = s_('MattermostService|Suggestions:') + %code= 'gitlab' + - if @project + %code= @project.path # Path contains no spaces, but dashes + %code= @project.full_path + + .form-group + = label_tag :request_url, s_('MattermostService|Request URL'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :request_url, service_trigger_url(integration), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#request_url', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag nil, s_('MattermostService|Request method'), class: 'col-12 col-form-label label-bold' + .col-12 POST + + .form-group + = label_tag :response_username, s_('MattermostService|Response username'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :response_username, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#response_username', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag :response_icon, s_('MattermostService|Response icon'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :response_icon, asset_url('gitlab_logo.png'), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#response_icon', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag nil, _('Autocomplete'), class: 'col-12 col-form-label label-bold' + .col-12 Yes + + .form-group + = label_tag :autocomplete_hint, _('Autocomplete hint'), class: 'col-12 col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_hint', class: 'gl-button btn-default btn-icon input-group-text') + + .form-group + = label_tag :autocomplete_description, _('Autocomplete description'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_description', class: 'gl-button btn-default btn-icon input-group-text') diff --git a/app/views/shared/integrations/mattermost_slash_commands/_help.html.haml b/app/views/shared/integrations/mattermost_slash_commands/_help.html.haml new file mode 100644 index 00000000000..6ce1c65a8dc --- /dev/null +++ b/app/views/shared/integrations/mattermost_slash_commands/_help.html.haml @@ -0,0 +1,17 @@ +- enabled = Gitlab.config.mattermost.enabled + +.info-well + .well-segment + %p + = s_("MattermostService|Use this service to perform common tasks in your project by entering slash commands in Mattermost.") + = link_to help_page_path('user/project/integrations/mattermost_slash_commands.md'), target: '_blank' do + = _("How do I configure this integration?") + = sprite_icon('external-link') + %p.inline + = s_("MattermostService|After you configure the integration, view your new Mattermost commands by entering") + %kbd.inline /<trigger> help + - if !enabled && integration.project_level? + = render 'shared/integrations/mattermost_slash_commands/detailed_help', integration: integration + +- if enabled && integration.project_level? + = render 'shared/integrations/mattermost_slash_commands/installation_info', integration: integration diff --git a/app/views/shared/integrations/mattermost_slash_commands/_installation_info.html.haml b/app/views/shared/integrations/mattermost_slash_commands/_installation_info.html.haml new file mode 100644 index 00000000000..38adc69dd5e --- /dev/null +++ b/app/views/shared/integrations/mattermost_slash_commands/_installation_info.html.haml @@ -0,0 +1,7 @@ +.services-installation-info + - unless integration.activated? + .row + .col-sm-9.offset-sm-3 + = link_to new_project_mattermost_path(@project), class: 'btn gl-button btn-lg' do + = custom_icon('mattermost_logo', size: 15) + = s_("MattermostService|Add to Mattermost") diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml new file mode 100644 index 00000000000..896249c6163 --- /dev/null +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -0,0 +1,28 @@ +- project = local_assigns.fetch(:project) + +.col-lg-3 + %p + = s_('PrometheusService|Custom metrics require Prometheus installed on a cluster with environment scope "*" OR a manually configured Prometheus to be available.') + = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer" + +.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-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' } + .card-body + .flash-container.hidden + .flash-warning + .flash-text + .loading-metrics.js-loading-custom-metrics + %p.m-3 + = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner') + = s_('PrometheusService|Finding custom metrics...') + .empty-metrics.hidden.js-empty-custom-metrics + %p.text-tertiary.m-3.js-no-active-integration-text.hidden + = s_('PrometheusService|Enable Prometheus to define custom metrics, using either option above') + %p.text-tertiary.m-3.js-new-metric-text.hidden + = s_('PrometheusService|No custom metrics have been created. Create one using the button above') + %ul.list-unstyled.metrics-list.hidden.js-custom-metrics-list diff --git a/app/views/shared/integrations/prometheus/_help.html.haml b/app/views/shared/integrations/prometheus/_help.html.haml new file mode 100644 index 00000000000..f40d8638845 --- /dev/null +++ b/app/views/shared/integrations/prometheus/_help.html.haml @@ -0,0 +1,8 @@ +- if @project + = render 'shared/prometheus_configuration_banner', project: @project, integration: integration, header_tag: :h4 + %hr + +%h4.gl-mb-3 + = s_('PrometheusService|Manual configuration') +%p + = s_('PrometheusService|Auto configuration settings are used unless you override their values here.') diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml new file mode 100644 index 00000000000..8ee0ddfa1b1 --- /dev/null +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -0,0 +1,38 @@ +- project = local_assigns.fetch(:project) + += render 'shared/integrations/prometheus/custom_metrics', project: project, integration: integration + +.col-lg-3 + %p + = s_('PrometheusService|Common metrics are automatically monitored based on a library of metrics from popular exporters.') + = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus'), target: '_blank', rel: "noopener noreferrer" + +.col-lg-9 + .card.js-panel-monitored-metrics{ data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') } } + .card-header + %strong + = s_('PrometheusService|Common metrics') + = gl_badge_tag 0, nil, class: 'js-monitored-count' + .card-body + .loading-metrics.js-loading-metrics + %p.m-3 + = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner') + = s_('PrometheusService|Finding and configuring metrics...') + .empty-metrics.hidden.js-empty-metrics + %p.text-tertiary.m-3 + = s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics') + %ul.list-unstyled.metrics-list.hidden.js-metrics-list + + .card.hidden.js-panel-missing-env-vars + .card-header + = 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 + .flash-container + .flash-notice + .flash-text + = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "<code>$CI_ENVIRONMENT_SLUG</code>" }).html_safe + = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/dashboards/variables.md', anchor: 'query-variables') + %ul.list-unstyled.metrics-list.js-missing-var-metrics-list diff --git a/app/views/shared/integrations/prometheus/_show.html.haml b/app/views/shared/integrations/prometheus/_show.html.haml new file mode 100644 index 00000000000..0e133e66794 --- /dev/null +++ b/app/views/shared/integrations/prometheus/_show.html.haml @@ -0,0 +1,7 @@ +.row + .col-lg-3 + %h4.gl-mt-0 + = s_('PrometheusService|Metrics') + +.row.gl-mb-3.prometheus-metrics-monitoring.js-prometheus-metrics-monitoring + = render 'shared/integrations/prometheus/metrics', project: @project, integration: integration diff --git a/app/views/shared/integrations/slack/_help.haml b/app/views/shared/integrations/slack/_help.haml new file mode 100644 index 00000000000..c5fcd5ca5fe --- /dev/null +++ b/app/views/shared/integrations/slack/_help.haml @@ -0,0 +1,4 @@ +.info-well + .well-segment + %p= s_('SlackIntegration|Sends notifications about project events to Slack channels.') + = link_to _('How do I set up this service?'), help_page_path('user/project/integrations/slack') diff --git a/app/views/shared/integrations/slack_slash_commands/_help.html.haml b/app/views/shared/integrations/slack_slash_commands/_help.html.haml new file mode 100644 index 00000000000..fee0ca15808 --- /dev/null +++ b/app/views/shared/integrations/slack_slash_commands/_help.html.haml @@ -0,0 +1,93 @@ +- pretty_name = @project&.full_name ? html_escape(@project&.full_name) : '<' + _('project name') + '>' +- run_actions_text = html_escape_once(s_("ProjectService|Perform common operations on GitLab project: %{project_name}") % { project_name: pretty_name }) + +.info-well + .well-segment + %p + = s_("SlackService|Perform common operations in this project by entering slash commands in Slack.") + = link_to help_page_path('user/project/integrations/slack_slash_commands.md'), target: '_blank' do + = _("Learn more.") + = sprite_icon('external-link') + %p.inline + = s_("SlackService|After setup, get a list of available Slack slash commands by entering") + %kbd.inline /<command> help + - if integration.project_level? + %p= _("To set up this integration:") + %ul.list-unstyled.indent-list + %li + - slash_command_link_url = 'https://my.slack.com/services/new/slash-commands' + - slash_command_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: slash_command_link_url } + - slash_command_link_end = ' %{external_link_icon}</a>'.html_safe % { external_link_icon: sprite_icon('external-link') } + = html_escape(s_('SlackService|1. %{slash_command_link_start}Add a slash command%{slash_command_link_end} in your Slack team using this information:')) % { slash_command_link_start: slash_command_link_start, slash_command_link_end: slash_command_link_end } + + %hr + + .help-form + .form-group + = label_tag nil, _('Command'), class: 'col-12 col-form-label label-bold' + .col-12 + %p= s_('SlackService|Fill in the word that works best for your team.') + %p + = _("Suggestions:") + %code= 'gitlab' + %code= 'project' + - if @project + %code= @project.path # Path contains no spaces, but dashes + %code= @project.full_path + + .form-group + = label_tag :url, 'URL', class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :url, service_trigger_url(integration), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#url', class: 'input-group-text') + + .form-group + = label_tag nil, _('Method'), class: 'col-12 col-form-label label-bold' + .col-12 POST + + .form-group + = label_tag :customize_name, _('Customize name'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :customize_name, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#customize_name', class: 'input-group-text') + + .form-group + = label_tag nil, _('Customize icon'), class: 'col-12 col-form-label label-bold' + .col-12 + = image_tag(asset_url('slash-command-logo.png', skip_pipeline: true), width: 36, height: 36, class: 'mr-3') + = link_to(_('Download image'), asset_url('gitlab_logo.png'), class: 'gl-button btn btn-default btn-sm', target: '_blank', rel: 'noopener noreferrer') + + .form-group + = label_tag nil, _('Autocomplete'), class: 'col-12 col-form-label label-bold' + .col-12 Show this command in the autocomplete list + + .form-group + = label_tag :autocomplete_description, _('Autocomplete description'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_description, run_actions_text.html_safe, class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_description', class: 'input-group-text') + + .form-group + = label_tag :autocomplete_usage_hint, _('Autocomplete usage hint'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_usage_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_usage_hint', class: 'input-group-text') + + .form-group + = label_tag :descriptive_label, _('Descriptive label'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :descriptive_label, _('Perform common operations on GitLab project'), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#descriptive_label', class: 'input-group-text') + + %hr + + %ul.list-unstyled.indent-list + %li + = html_escape(s_("SlackService|2. Paste the token from Slack in the %{strong_open}Token%{strong_close} field below.")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + %li + = html_escape(s_("SlackService|3. Select the %{strong_open}Active%{strong_close} checkbox, select %{strong_open}Save changes%{strong_close}, and start using slash commands in Slack!")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } diff --git a/app/views/shared/issuable/_assignees.html.haml b/app/views/shared/issuable/_assignees.html.haml index 73f1e35f03f..112b0368a3a 100644 --- a/app/views/shared/issuable/_assignees.html.haml +++ b/app/views/shared/issuable/_assignees.html.haml @@ -3,7 +3,7 @@ - render_count = assignees_rendering_overflow ? max_render - 1 : max_render - more_assignees_count = issuable.assignees.size - render_count -- if issuable.instance_of?(MergeRequest) && Feature.enabled?(:mr_attention_requests, default_enabled: :yaml) +- if issuable.instance_of?(MergeRequest) && current_user&.mr_attention_requests_enabled? = render 'shared/issuable/merge_request_assignees', issuable: issuable, count: render_count - else - issuable.assignees.take(render_count).each do |assignee| # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index e0d5f738273..62e1a930ee6 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -8,8 +8,8 @@ - if @conflict = render Pajamas::AlertComponent.new(variant: :danger, dismissible: false, - alert_class: 'gl-mb-5') do - .gl-alert-body + alert_class: 'gl-mb-5') do |c| + = c.body do Someone edited the #{issuable.class.model_name.human.downcase} the same time you did. Please check out = link_to "the #{issuable.class.model_name.human.downcase}", polymorphic_path([@project, issuable]), target: "_blank", rel: 'noopener noreferrer' diff --git a/app/views/shared/issuable/_reviewers.html.haml b/app/views/shared/issuable/_reviewers.html.haml index 4af2cb00859..3bf923eb946 100644 --- a/app/views/shared/issuable/_reviewers.html.haml +++ b/app/views/shared/issuable/_reviewers.html.haml @@ -3,7 +3,7 @@ - render_count = reviewers_rendering_overflow ? max_render - 1 : max_render - more_reviewers_count = issuable.reviewers.size - render_count -- if issuable.instance_of?(MergeRequest) && Feature.enabled?(:mr_attention_requests, default_enabled: :yaml) +- if issuable.instance_of?(MergeRequest) && current_user&.mr_attention_requests_enabled? = render 'shared/issuable/merge_request_reviewers', issuable: issuable, count: render_count - else - issuable.reviewers.take(render_count).each do |reviewer| # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 7fdf8ea7796..6394e05ae24 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -88,7 +88,7 @@ = 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) + - if current_user&.mr_attention_requests_enabled? #js-dropdown-attention-requested.filtered-search-input-dropdown-menu.dropdown-menu - if current_user %ul{ data: { dropdown: true } } diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index b99294f504c..feffc7eb011 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -8,17 +8,25 @@ - add_page_startup_api_call "#{issuable_sidebar[:issuable_json_path]}?serializer=sidebar_extras" - reviewers = local_assigns.fetch(:reviewers, nil) - in_group_context_with_iterations = @project.group.present? && issuable_sidebar[:supports_iterations] +- is_merge_request = issuable_type === 'merge_request' +- moved_sidebar_enabled = moved_mr_sidebar_enabled? && is_merge_request -%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite', 'aria-label': issuable_type } - .issuable-sidebar - .issuable-sidebar-header.gl-py-3 - %a.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ role: "button", href: "#", "aria-label" => _('Toggle sidebar'), title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } } +%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: "#{sidebar_gutter_collapsed_class} #{'right-sidebar-merge-requests' if moved_sidebar_enabled}", 'aria-live' => 'polite', 'aria-label': issuable_type } + .issuable-sidebar{ class: "#{'is-merge-request' if moved_sidebar_enabled}" } + .issuable-sidebar-header{ class: "#{'gl-pb-2! gl-md-display-flex gl-justify-content-end gl-md-display-none!' if moved_sidebar_enabled}" } + %a.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ role: "button", class: "#{'gl-display-block' if moved_sidebar_enabled}", href: "#", "aria-label" => _('Toggle sidebar'), title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } } = sidebar_gutter_toggle_icon - - if signed_in + - if signed_in && !moved_sidebar_enabled .js-issuable-todo{ 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.qa-assignee-block + - if signed_in && moved_sidebar_enabled + .block.to-do + .title.hide-collapsed.gl-font-weight-bold.gl-display-flex.gl-align-items-center.gl-justify-content-space-between.gl-mt-2{ class: 'gl-mb-0!' } + = _('To-Do') + .js-issuable-todo{ data: { project_path: issuable_sidebar[:project_full_path], iid: issuable_sidebar[:iid], id: issuable_sidebar[:id] } } + + .block.assignee.qa-assignee-block{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}" } = render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in - if reviewers @@ -33,6 +41,8 @@ - if @project.group.present? = render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type + .js-sidebar-labels{ data: sidebar_labels_data(issuable_sidebar, @project) } + - if issuable_sidebar[:supports_milestone] .block.milestone{ :class => ("gl-border-b-0!" if in_group_context_with_iterations), data: { qa_selector: 'milestone_block', testid: 'sidebar-milestones' } } .js-milestone-select{ data: { can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } } @@ -43,7 +53,12 @@ - if issuable_sidebar[:show_crm_contacts] .block.contact - #js-issue-crm-contacts{ data: { issue_id: issuable_sidebar[:id] } } + #js-issue-crm-contacts{ data: { issue_id: issuable_sidebar[:id], group_issues_path: issues_group_path(@project.group) } } + + = render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar, can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] + + - if issuable_sidebar.has_key?(:due_date) + #js-due-date-entry-point - if issuable_sidebar[:supports_time_tracking] #issuable-time-tracker.block @@ -51,12 +66,6 @@ .title.hide-collapsed = _('Time tracking') = gl_loading_icon(inline: true) - - if issuable_sidebar.has_key?(:due_date) - #js-due-date-entry-point - - .js-sidebar-labels{ data: sidebar_labels_data(issuable_sidebar, @project) } - - = render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar, can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] - if issuable_sidebar[:supports_severity] #js-severity @@ -71,25 +80,23 @@ = render_if_exists 'shared/issuable/sidebar_cve_id_request', issuable_sidebar: issuable_sidebar - -# haml-lint:disable InlineJavaScript - %script#js-lock-issue-data{ type: "application/json" }= { is_locked: !!issuable_sidebar[:discussion_locked], is_editable: can_edit_issuable }.to_json.html_safe - #js-lock-entry-point + - if !moved_sidebar_enabled + #js-lock-entry-point + - if signed_in + .js-sidebar-subscriptions-entry-point .js-sidebar-participants-entry-point - - if signed_in - .js-sidebar-subscriptions-entry-point - .block.with-sub-blocks #js-reference-entry-point - - if issuable_type == 'merge_request' + - if issuable_type == 'merge_request' && !moved_sidebar_enabled .sub-block.js-sidebar-source-branch .sidebar-collapsed-icon.js-dont-change-state - = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') + = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') .gl-display-flex.gl-align-items-center.gl-justify-content-space-between.gl-mb-2.hide-collapsed %span.gl-overflow-hidden.gl-text-overflow-ellipsis.gl-white-space-nowrap = _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<span class='gl-font-monospace' data-testid='ref-name' title='#{html_escape(source_branch)}'>".html_safe, source_branch_close: "</span>".html_safe, source_branch: html_escape(source_branch) } - = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport') + = clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy') - if show_forwarding_email .block diff --git a/app/views/shared/issuable/_sort_dropdown.html.haml b/app/views/shared/issuable/_sort_dropdown.html.haml index f6d7ed6764d..e36c4cd6be0 100644 --- a/app/views/shared/issuable/_sort_dropdown.html.haml +++ b/app/views/shared/issuable/_sort_dropdown.html.haml @@ -1,26 +1,9 @@ -- sort_value = @sort -- sort_title = issuable_sort_option_title(sort_value) - viewing_issues = controller.controller_name == 'issues' || controller.action_name == 'issues' - viewing_merge_requests = controller.controller_name == 'merge_requests' +- items = issuable_sort_options(viewing_issues, viewing_merge_requests) +- selected = issuable_sort_option_overrides[@sort] || @sort -.dropdown.inline.gl-ml-3.issue-sort-dropdown +.gl-ml-3 .btn-group{ role: 'group' } - .btn-group{ role: 'group' } - %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'gl-button btn btn-default' } - = sort_title - = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort - %li - = sortable_item(sort_title_priority, page_filter_path(sort: sort_value_priority), sort_title) - = sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date), sort_title) - = sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated), sort_title) - = sortable_item(sort_title_milestone, page_filter_path(sort: sort_value_milestone), sort_title) - = sortable_item(sort_title_due_date, page_filter_path(sort: sort_value_due_date), sort_title) if viewing_issues - = sortable_item(sort_title_popularity, page_filter_path(sort: sort_value_popularity), sort_title) - = sortable_item(sort_title_label_priority, page_filter_path(sort: sort_value_label_priority), sort_title) - = sortable_item(sort_title_merged_date, page_filter_path(sort: sort_value_merged_date), sort_title) if viewing_merge_requests - = sortable_item(sort_title_closed_date, page_filter_path(sort: sort_value_closed_date), sort_title) if viewing_merge_requests - = sortable_item(sort_title_relative_position, page_filter_path(sort: sort_value_relative_position), sort_title) if viewing_issues - = sortable_item(sort_title_title, page_filter_path(sort: sort_value_title), sort_title) - = render_if_exists('shared/ee/issuable/sort_dropdown', viewing_issues: viewing_issues, sort_title: sort_title) - = issuable_sort_direction_button(sort_value) + = gl_redirect_listbox_tag(items, selected, data: { right: true }) + = issuable_sort_direction_button(@sort) diff --git a/app/views/shared/issuable/_status_box.html.haml b/app/views/shared/issuable/_status_box.html.haml index c0e972684d2..4fda1f11545 100644 --- a/app/views/shared/issuable/_status_box.html.haml +++ b/app/views/shared/issuable/_status_box.html.haml @@ -1,6 +1,10 @@ -- state_human_name, state_icon_name = state_name_with_icon(issuable) +- badge_text = state_name_with_icon(issuable)[0] +- badge_icon = state_name_with_icon(issuable)[1] +- badge_variant = issuable.open? ? :success : issuable.merged? ? :info : :danger +- badge_status_class = issuable.open? ? 'issuable-status-badge-open' : issuable.merged? ? 'issuable-status-badge-merged' : 'issuable-status-badge-closed' +- updated_mr_header_enabled = Feature.enabled?(:updated_mr_header, @project) && issuable.is_a?(MergeRequest) +- badge_classes = "js-mr-status-box issuable-status-badge gl-mr-3 #{badge_status_class} #{'gl-vertical-align-bottom' if updated_mr_header_enabled}" -.issuable-status-box.status-box.js-mr-status-box{ class: status_box_class(issuable), data: { project_path: issuable.project.path_with_namespace, iid: issuable.iid, state: issuable.state } } - = sprite_icon(state_icon_name, css_class: 'gl-display-block gl-sm-display-none!') - %span.gl-display-none.gl-sm-display-block - = state_human_name += gl_badge_tag({ variant: badge_variant, icon: badge_icon, icon_classes: 'gl-mr-0!' }, { class: badge_classes, data: { project_path: issuable.project.path_with_namespace, iid: issuable.iid, issuable_type: 'merge_request', state: issuable.state } }) do + %span.gl-display-none.gl-sm-display-block.gl-ml-2 + = badge_text diff --git a/app/views/shared/issue_type/_details_header.html.haml b/app/views/shared/issue_type/_details_header.html.haml index eca61819cca..08fba712d5e 100644 --- a/app/views/shared/issue_type/_details_header.html.haml +++ b/app/views/shared/issue_type/_details_header.html.haml @@ -1,17 +1,16 @@ -- link = issue_closed_link(@issue, current_user, css_class: 'text-white text-underline') +- link = issue_closed_link(@issue, current_user, css_class: 'text-underline gl-reset-color!') +- badge_classes = 'issuable-status-badge gl-mr-3' .detail-page-header .detail-page-header-body - .issuable-status-box.status-box.status-box-issue-closed{ class: issue_status_visibility(issuable, status_box: :closed) } - = sprite_icon('issue-close', css_class: 'gl-display-block gl-sm-display-none!') - .gl-display-none.gl-sm-display-block + = gl_badge_tag({ variant: :info, icon: 'issue-closed', icon_classes: 'gl-mr-0!' }, { class: "#{issue_status_visibility(issuable, status_box: :closed)} #{badge_classes} issuable-status-badge-closed" }) do + .gl-display-none.gl-sm-display-block.gl-ml-2 = issue_closed_text(issuable, current_user) - - if link - %span.text-white.gl-pl-2.gl-sm-display-none - = "(#{link})" - .issuable-status-box.status-box.status-box-open{ class: issue_status_visibility(issuable, status_box: :open) } - = sprite_icon('issue-open-m', css_class: 'gl-display-block gl-sm-display-none!') - %span.gl-display-none.gl-sm-display-block + - if link + %span.gl-pl-2.gl-sm-display-none + = "(#{link})" + = gl_badge_tag({ variant: :success, icon: 'issues', icon_classes: 'gl-mr-0!' }, { class: "#{issue_status_visibility(issuable, status_box: :open)} #{badge_classes} issuable-status-badge-open" }) do + %span.gl-display-none.gl-sm-display-block.gl-ml-2 = _('Open') .issuable-meta diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index 4e06b7902bd..45699808b6b 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -4,7 +4,7 @@ %li{ class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: custom_dom_id } .row - .col-sm-6 + .col-md-6 .gl-mb-2 %strong{ data: { qa_selector: "milestone_link", qa_milestone_title: milestone.title } } = link_to truncate(milestone.title, length: 100), milestone_path(milestone) @@ -33,18 +33,18 @@ %div = render('shared/milestone_expired', milestone: milestone) - if milestone.group_milestone? - = gl_badge_tag milestone.group.full_name, variant: :info + = gl_badge_tag milestone.group.full_name, { variant: :info }, { class: 'gl-white-space-normal gl-text-left' } - if milestone.project_milestone? - = gl_badge_tag milestone.project.full_name, variant: :muted + = gl_badge_tag milestone.project.full_name, { variant: :muted }, { class: 'gl-white-space-normal gl-text-left' } - .col-sm-4.milestone-progress + .col-md-4.milestone-progress = milestone_progress_bar(milestone) = link_to pluralize(milestone.total_issues_count, _('Issue')), issues_path - if milestone.merge_requests_enabled? · = link_to pluralize(milestone.total_merge_requests_count, _('Merge request')), merge_requests_path .float-lg-right.light #{milestone.percent_complete}% complete - .col-sm-2 + .col-md-2 .milestone-actions.d-flex.justify-content-sm-start.justify-content-md-end - if @project # if in milestones list on project level - if can_admin_group_milestones? diff --git a/app/views/shared/milestones/_milestone_complete_alert.html.haml b/app/views/shared/milestones/_milestone_complete_alert.html.haml index 4685a93a343..86f9193cc7a 100644 --- a/app/views/shared/milestones/_milestone_complete_alert.html.haml +++ b/app/views/shared/milestones/_milestone_complete_alert.html.haml @@ -3,6 +3,6 @@ - if milestone.complete? && milestone.active? = render Pajamas::AlertComponent.new(variant: :success, alert_data: { testid: 'all-issues-closed-alert' }, - dismissible: false) do - .gl-alert-body - = yield + dismissible: false) do |c| + = c.body do + = yield diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index a1e94172ec3..12026b89429 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -163,9 +163,9 @@ .block.reference .sidebar-collapsed-icon.js-dont-change-state = clipboard_button(text: milestone_ref, title: s_('MilestoneSidebar|Copy reference'), placement: "left", boundary: 'viewport') - .cross-project-reference.hide-collapsed - %span.gl-display-inline-block.gl-text-truncate + .gl-display-flex.gl-align-items-center.gl-justify-content-space-between.gl-mb-2.hide-collapsed + %span.gl-overflow-hidden.gl-text-overflow-ellipsis.gl-white-space-nowrap = s_('MilestoneSidebar|Reference:') %span{ title: milestone_ref } = milestone_ref - = clipboard_button(text: milestone_ref, title: s_('MilestoneSidebar|Copy reference'), placement: "left", boundary: 'viewport', class: 'btn-clipboard btn-transparent gl-float-right gl-bg-gray-10') + = clipboard_button(text: milestone_ref, title: s_('MilestoneSidebar|Copy reference'), placement: "left", boundary: 'viewport') diff --git a/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml index cfa87351689..d167ffb5582 100644 --- a/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml +++ b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml @@ -9,10 +9,7 @@ - lock_attribute = "lock_#{attribute}" -.gl-form-checkbox.custom-control.custom-checkbox - = form.check_box lock_attribute, checked: group.namespace_settings.public_send(lock_attribute), class: 'custom-control-input', data: { testid: 'enforce-for-all-subgroups-checkbox' } - = form.label lock_attribute, class: 'custom-control-label' do - %span - = yield.presence || s_('CascadingSettings|Enforce for all subgroups') - %p.help-text - = help_text += form.gitlab_ui_checkbox_component lock_attribute, + s_('CascadingSettings|Enforce for all subgroups'), + help_text: help_text, + checkbox_options: { checked: group.namespace_settings.public_send(lock_attribute), data: { testid: 'enforce-for-all-subgroups-checkbox' } } diff --git a/app/views/shared/notes/_hints.html.haml b/app/views/shared/notes/_hints.html.haml index 8a79a17b166..c845d4df7df 100644 --- a/app/views/shared/notes/_hints.html.haml +++ b/app/views/shared/notes/_hints.html.haml @@ -2,15 +2,12 @@ - supports_file_upload = local_assigns.fetch(:supports_file_upload, true) .comment-toolbar.clearfix .toolbar-text - = link_to _('Markdown'), help_page_path('user/markdown'), target: '_blank', rel: 'noopener noreferrer' + - markdownLinkStart = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/markdown') } + - quickActionsLinkStart = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/quick_actions') } - if supports_quick_actions - and - = link_to _('quick actions'), help_page_path('user/project/quick_actions'), target: '_blank', rel: 'noopener noreferrer' - are + = html_escape(s_('NoteToolbar|Supports %{markdownDocsLinkStart}Markdown%{markdownDocsLinkEnd}. For %{quickActionsDocsLinkStart}quick actions%{quickActionsDocsLinkEnd}, type %{keyboardStart}/%{keyboardEnd}.')) % { markdownDocsLinkStart: markdownLinkStart, markdownDocsLinkEnd: '</a>'.html_safe, quickActionsDocsLinkStart: quickActionsLinkStart, quickActionsDocsLinkEnd: '</a>'.html_safe, keyboardStart: '<kbd>'.html_safe, keyboardEnd: '</kbd>'.html_safe } - else - is - supported - + = html_escape(s_('MarkdownToolbar|Supports %{markdownDocsLinkStart}Markdown%{markdownDocsLinkEnd}')) % { markdownDocsLinkStart: markdownLinkStart, markdownDocsLinkEnd: '</a>'.html_safe } - if supports_file_upload %span.uploading-container %span.uploading-progress-container.hide diff --git a/app/views/shared/projects/_topics.html.haml b/app/views/shared/projects/_topics.html.haml index b7df369327c..e3895663033 100644 --- a/app/views/shared/projects/_topics.html.haml +++ b/app/views/shared/projects/_topics.html.haml @@ -7,25 +7,25 @@ = sprite_icon('tag', css_class: 'icon gl-relative gl-mr-2') - project.topics_to_show.each do |topic| - - explore_project_topic_path = topic_explore_projects_path(topic_name: topic) - - if topic.length > max_project_topic_length - %a.gl-mr-3.has-tooltip{ data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag truncate(topic, length: max_project_topic_length) + - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) + - if topic[:title].length > max_project_topic_length + %a.gl-mr-3.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) - else %a.gl-mr-3{ href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag topic + = gl_badge_tag topic[:title] - if project.has_extra_topics? - title = _('More topics') - content = capture do %span.gl-display-inline-flex.gl-flex-wrap - project.topics_not_shown.each do |topic| - - explore_project_topic_path = topic_explore_projects_path(topic_name: topic) - - if topic.length > max_project_topic_length - %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag truncate(topic, length: max_project_topic_length) + - explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name]) + - if topic[:title].length > max_project_topic_length + %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' } + = gl_badge_tag truncate(topic[:title], length: max_project_topic_length) - else %a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' } - = gl_badge_tag topic + = gl_badge_tag topic[:title] .text-nowrap{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } } = _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown } diff --git a/app/views/shared/runners/_form.html.haml b/app/views/shared/runners/_form.html.haml index 8d0069a7664..024b06fe97a 100644 --- a/app/views/shared/runners/_form.html.haml +++ b/app/views/shared/runners/_form.html.haml @@ -1,30 +1,22 @@ -= form_for runner, url: runner_form_url do |f| += gitlab_ui_form_for runner, url: runner_form_url do |f| = form_errors(runner) .form-group.row = label :active, _("Active"), class: 'col-form-label col-sm-2' .col-sm-10 - .form-check - = f.check_box :active, { class: 'form-check-input' } - %label.light{ for: :runner_active }= _("Paused runners don't accept new jobs") + = f.gitlab_ui_checkbox_component :active, _("Paused runners don't accept new jobs") .form-group.row = label :protected, _("Protected"), class: 'col-form-label col-sm-2' .col-sm-10 - .form-check - = f.check_box :access_level, { class: 'form-check-input' }, 'ref_protected', 'not_protected' - %label.light{ for: :runner_access_level }= _('This runner will only run on pipelines triggered on protected branches') + = f.gitlab_ui_checkbox_component :access_level, _('This runner will only run on pipelines triggered on protected branches'), checked_value: 'ref_protected', unchecked_value: 'not_protected' .form-group.row = label :run_untagged, _('Run untagged jobs'), class: 'col-form-label col-sm-2' .col-sm-10 - .form-check - = f.check_box :run_untagged, { class: 'form-check-input' } - %label.light{ for: :runner_run_untagged }= _('Indicates whether this runner can pick jobs without tags') + = f.gitlab_ui_checkbox_component :run_untagged, _('Indicates whether this runner can pick jobs without tags') - unless runner.group_type? .form-group.row = label :locked, _('Lock to current projects'), class: 'col-form-label col-sm-2' .col-sm-10 - .form-check - = f.check_box :locked, { class: 'form-check-input' } - %label.light{ for: :runner_locked }= _('When a runner is locked, it cannot be assigned to other projects') + = f.gitlab_ui_checkbox_component :locked, _('When a runner is locked, it cannot be assigned to other projects') .form-group.row = label_tag :ip_address, class: 'col-form-label col-sm-2' do = _('IP Address') diff --git a/app/views/shared/runners/_runner_type_alert.html.haml b/app/views/shared/runners/_runner_type_alert.html.haml index 365cee5fadc..4bf02b71109 100644 --- a/app/views/shared/runners/_runner_type_alert.html.haml +++ b/app/views/shared/runners/_runner_type_alert.html.haml @@ -3,14 +3,14 @@ - 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 + dismissible: false) do |c| + = c.body do = 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 = render Pajamas::AlertComponent.new(alert_class: alert_class, title: s_('Runners|This runner is associated with specific projects.'), - dismissible: false) do - .gl-alert-body + dismissible: false) do |c| + = c.body do = 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/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml index 4e373dda013..3cd70dab4d5 100644 --- a/app/views/shared/snippets/_snippet.html.haml +++ b/app/views/shared/snippets/_snippet.html.haml @@ -4,21 +4,20 @@ %li.snippet-row.py-3{ data: { qa_selector: 'snippet_link', qa_snippet_title: snippet.title } } = image_tag avatar_icon_for_user(snippet.author), class: "avatar s40 d-none d-sm-block", alt: '' - .title - = link_to gitlab_snippet_path(snippet) do - = snippet.title + = link_to gitlab_snippet_path(snippet), class: "title" do + = snippet.title - %ul.controls{ data: { qa_selector: 'snippet_file_count_content', qa_snippet_files: snippet.statistics&.file_count } } - %li - = snippet_file_count(snippet) - %li - = link_to gitlab_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if notes_count == 0) do - = sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom') - = notes_count - %li - %span.sr-only{ data: { qa_selector: 'snippet_visibility_content', qa_snippet_visibility: visibility_level_label(snippet.visibility_level) } } - = visibility_level_label(snippet.visibility_level) - = visibility_level_icon(snippet.visibility_level) + %ul.controls{ data: { qa_selector: 'snippet_file_count_content', qa_snippet_files: snippet.statistics&.file_count } } + %li + = snippet_file_count(snippet) + %li + = link_to gitlab_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if notes_count == 0) do + = sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom') + = notes_count + %li + %span.sr-only{ data: { qa_selector: 'snippet_visibility_content', qa_snippet_visibility: visibility_level_label(snippet.visibility_level) } } + = visibility_level_label(snippet.visibility_level) + = visibility_level_icon(snippet.visibility_level) .snippet-info #{snippet.to_reference} · diff --git a/app/views/shared/topics/_topic.html.haml b/app/views/shared/topics/_topic.html.haml index a47d4495777..ca1098511da 100644 --- a/app/views/shared/topics/_topic.html.haml +++ b/app/views/shared/topics/_topic.html.haml @@ -1,4 +1,4 @@ -- max_topic_name_length = 30 +- max_topic_title_length = 30 - detail_page_link = topic_explore_projects_path(topic_name: topic.name) .col-lg-3.col-md-4.col-sm-12 @@ -8,9 +8,9 @@ = link_to detail_page_link do = topic_icon(topic, class: "avatar s40") = link_to detail_page_link do - - if topic.name.length > max_topic_name_length - %h5.str-truncated.has-tooltip{ title: topic.name } - = truncate(topic.name, length: max_topic_name_length) + - if topic.title_or_name.length > max_topic_title_length + %h5.gl-str-truncated.has-tooltip{ title: topic.title_or_name } + = truncate(topic.title_or_name, length: max_topic_title_length) - else %h5 - = topic.name + = topic.title_or_name diff --git a/app/views/shared/web_hooks/_hook_errors.html.haml b/app/views/shared/web_hooks/_hook_errors.html.haml index a100a620cea..d95efe83e15 100644 --- a/app/views/shared/web_hooks/_hook_errors.html.haml +++ b/app/views/shared/web_hooks/_hook_errors.html.haml @@ -11,13 +11,13 @@ support_link_start: link_start % { url: support_path }, support_link_end: link_end } = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook was automatically disabled'), - variant: :danger) do - .gl-alert-body + variant: :danger) do |c| + = c.body do = 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 Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook failed to connect'), - variant: :danger) do - .gl-alert-body + variant: :danger) do |c| + = c.body do = 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? - help_path = help_page_path('user/project/integrations/webhooks', anchor: 'webhook-fails-or-multiple-webhook-requests-are-triggered') @@ -27,6 +27,6 @@ help_link_start: link_start % { url: help_path }, help_link_end: link_end } = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook fails to connect'), - variant: :warning) do - .gl-alert-body + variant: :warning) do |c| + = c.body do = 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 |