diff options
Diffstat (limited to 'app/views')
190 files changed, 868 insertions, 1378 deletions
diff --git a/app/views/admin/application_settings/_account_and_limit.html.haml b/app/views/admin/application_settings/_account_and_limit.html.haml index 65882491575..e46a88b2217 100644 --- a/app/views/admin/application_settings/_account_and_limit.html.haml +++ b/app/views/admin/application_settings/_account_and_limit.html.haml @@ -52,8 +52,7 @@ = f.text_field :user_default_internal_regex, placeholder: _('Regex pattern'), class: 'form-control gl-form-input gl-mt-2' .help-block = _('Specify an email address regex pattern to identify default internal users.') - = link_to _('Learn more'), help_page_path('user/permissions', anchor: 'setting-new-users-to-external'), - target: '_blank' + = link_to _('Learn more'), help_page_path('user/permissions', anchor: 'setting-new-users-to-external'), target: '_blank', rel: 'noopener noreferrer' - unless Gitlab.com? .form-group = f.label :deactivate_dormant_users, _('Dormant users'), class: 'label-bold' @@ -63,7 +62,7 @@ = _('Deactivate dormant users after 90 days of inactivity') .help-block = _('Users can reactivate their account by signing in.') - = link_to _('Learn more'), help_page_path('user/admin_area/moderate_users', anchor: 'automatically-deactivate-dormant-users'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/admin_area/moderate_users', anchor: 'automatically-deactivate-dormant-users'), target: '_blank', rel: 'noopener noreferrer' .form-group = f.label :personal_access_token_prefix, _('Personal Access Token prefix'), class: 'label-light' = f.text_field :personal_access_token_prefix, placeholder: _('Maximum 20 characters'), class: 'form-control gl-form-input' diff --git a/app/views/admin/application_settings/_ci_cd.html.haml b/app/views/admin/application_settings/_ci_cd.html.haml index 8026ec4702b..41698f9720b 100644 --- a/app/views/admin/application_settings/_ci_cd.html.haml +++ b/app/views/admin/application_settings/_ci_cd.html.haml @@ -9,13 +9,13 @@ = s_('CICD|Default to Auto DevOps pipeline for all projects') .form-text.text-muted = s_('CICD|The Auto DevOps pipeline runs by default in all projects with no CI/CD configuration file.') - = link_to _('What is Auto DevOps?'), help_page_path('topics/autodevops/index.md'), target: '_blank' + = link_to _('What is Auto DevOps?'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer' .form-group = f.label :auto_devops_domain, s_('AdminSettings|Auto DevOps domain'), class: 'label-bold' = f.text_field :auto_devops_domain, class: 'form-control gl-form-input', placeholder: 'example.com' .form-text.text-muted = s_("AdminSettings|The default domain to use for Auto Review Apps and Auto Deploy stages in all projects.") - = link_to _('Learn more.'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-review-apps'), target: '_blank' + = link_to _('Learn more.'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-review-apps'), target: '_blank', rel: 'noopener noreferrer' .form-group .form-check @@ -68,7 +68,7 @@ = f.text_field :default_ci_config_path, class: 'form-control gl-form-input', placeholder: '.gitlab-ci.yml' %p.form-text.text-muted = _("The default CI/CD configuration file and path for new projects.").html_safe - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank', rel: 'noopener noreferrer' .form-group .form-check = f.check_box :suggest_pipeline_enabled, class: 'form-check-input' diff --git a/app/views/admin/application_settings/_email.html.haml b/app/views/admin/application_settings/_email.html.haml index 073c0bf619d..0ab462a3fa8 100644 --- a/app/views/admin/application_settings/_email.html.haml +++ b/app/views/admin/application_settings/_email.html.haml @@ -20,7 +20,7 @@ = f.label :commit_email_hostname, _('Custom hostname (for private commit emails)'), class: 'label-bold' = f.text_field :commit_email_hostname, class: 'form-control gl-form-input' .form-text.text-muted - - commit_email_hostname_docs_link = link_to _('Learn more'), help_page_path('user/admin_area/settings/email.md', anchor: 'custom-hostname-for-private-commit-emails'), target: '_blank' + - commit_email_hostname_docs_link = link_to _('Learn more'), help_page_path('user/admin_area/settings/email.md', anchor: 'custom-hostname-for-private-commit-emails'), target: '_blank', rel: 'noopener noreferrer' = _("Hostname used in private commit emails. %{learn_more}").html_safe % { learn_more: commit_email_hostname_docs_link } = render_if_exists 'admin/application_settings/email_additional_text_setting', form: f diff --git a/app/views/admin/application_settings/_external_authorization_service_form.html.haml b/app/views/admin/application_settings/_external_authorization_service_form.html.haml index 23484eaec32..4fb10d48540 100644 --- a/app/views/admin/application_settings/_external_authorization_service_form.html.haml +++ b/app/views/admin/application_settings/_external_authorization_service_form.html.haml @@ -1,11 +1,12 @@ %section.settings.as-external-auth.no-animate#js-external-auth-settings{ class: ('expanded' if expanded) } .settings-header %h4 - = _('External authentication') + = s_('ExternalAuthorization|External authorization') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded ? 'Collapse' : 'Expand' %p - = _('External Classification Policy Authorization') + = s_('ExternalAuthorization|External classification policy authorization.') + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/external_authorization'), target: '_blank', rel: 'noopener noreferrer' .settings-content = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-external-auth-settings'), html: { class: 'fieldset-form', id: 'external-auth-settings' } do |f| @@ -16,35 +17,37 @@ .form-check = f.check_box :external_authorization_service_enabled, class: 'form-check-input' = f.label :external_authorization_service_enabled, class: 'form-check-label' do - = _('Enable classification control using an external service') + = s_('ExternalAuthorization|Enable classification control using an external service') %span.form-text.text-muted = external_authorization_description - = link_to sprite_icon('question-o'), help_page_path('user/admin_area/settings/external_authorization') .form-group - = f.label :external_authorization_service_url, _('Service URL'), class: 'label-bold' + = f.label :external_authorization_service_url, s_('ExternalAuthorization|Service URL'), class: 'label-bold' = f.text_field :external_authorization_service_url, class: 'form-control gl-form-input' %span.form-text.text-muted = external_authorization_url_help_text .form-group - = f.label :external_authorization_service_timeout, _('External authorization request timeout'), class: 'label-bold' + = f.label :external_authorization_service_timeout, s_('ExternalAuthorization|External authorization request timeout (seconds)'), class: 'label-bold' = f.number_field :external_authorization_service_timeout, class: 'form-control gl-form-input', min: 0.001, max: 10, step: 0.001 %span.form-text.text-muted = external_authorization_timeout_help_text - = f.label :external_auth_client_cert, _('Client authentication certificate'), class: 'label-bold' + .form-group + = f.label :external_auth_client_cert, s_('ExternalAuthorization|Client authorization certificate'), class: 'label-bold' = f.text_area :external_auth_client_cert, class: 'form-control gl-form-input' %span.form-text.text-muted = external_authorization_client_certificate_help_text .form-group - = f.label :external_auth_client_key, _('Client authentication key'), class: 'label-bold' + = f.label :external_auth_client_key, s_('ExternalAuthorization|Client authorization key'), class: 'label-bold' = f.text_area :external_auth_client_key, class: 'form-control gl-form-input' %span.form-text.text-muted = external_authorization_client_key_help_text .form-group - = f.label :external_auth_client_key_pass, _('Client authentication key password'), class: 'label-bold' + = f.label :external_auth_client_key_pass, s_('ExternalAuthorization|Client authorization key password (optional)'), class: 'label-bold' = f.password_field :external_auth_client_key_pass, class: 'form-control gl-form-input' %span.form-text.text-muted = external_authorization_client_pass_help_text .form-group - = f.label :external_authorization_service_default_label, _('Default classification label'), class: 'label-bold' + = f.label :external_authorization_service_default_label, s_('ExternalAuthorization|Default classification label'), class: 'label-bold' = f.text_field :external_authorization_service_default_label, class: 'form-control gl-form-input' + %span.form-text.text-muted + = external_authorization_client_url_help_text = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/_floc.html.haml b/app/views/admin/application_settings/_floc.html.haml index 52833b5cfc2..66259926064 100644 --- a/app/views/admin/application_settings/_floc.html.haml +++ b/app/views/admin/application_settings/_floc.html.haml @@ -8,7 +8,7 @@ = expanded ? _('Collapse') : _('Expand') %p = s_('FloC|Configure whether you want to participate in FloC.').html_safe - = link_to sprite_icon('question-o'), 'https://github.com/WICG/floc', target: '_blank', class: 'has-tooltip', title: _('More information') + = link_to sprite_icon('question-o'), 'https://github.com/WICG/floc', target: '_blank', rel: 'noopener noreferrer', class: 'has-tooltip', title: _('More information') .settings-content = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-floc-settings'), html: { class: 'fieldset-form', id: 'floc-settings' } do |f| diff --git a/app/views/admin/application_settings/_localization.html.haml b/app/views/admin/application_settings/_localization.html.haml index 5c8f3379fce..d0bb6a78ed6 100644 --- a/app/views/admin/application_settings/_localization.html.haml +++ b/app/views/admin/application_settings/_localization.html.haml @@ -7,7 +7,7 @@ = f.select :first_day_of_week, first_day_of_week_choices, {}, class: 'form-control' .form-text.text-muted = _('Default first day of the week in calendars and date pickers.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/index.md', anchor: 'default-first-day-of-the-week'), target: '_blank' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/index.md', anchor: 'default-first-day-of-the-week'), target: '_blank', rel: 'noopener noreferrer' .form-group = f.label :time_tracking, _('Time tracking'), class: 'label-bold' @@ -17,7 +17,7 @@ = _('Limit display of time tracking units to hours.') .form-text.text-muted = _('Display time tracking in issues in total hours only.') - = link_to _('What is time tracking?'), help_page_path('user/project/time_tracking.md'), target: '_blank' + = link_to _('What is time tracking?'), help_page_path('user/project/time_tracking.md'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/_outbound.html.haml b/app/views/admin/application_settings/_outbound.html.haml index 142a3fbfbd0..9a31fdd7fdf 100644 --- a/app/views/admin/application_settings/_outbound.html.haml +++ b/app/views/admin/application_settings/_outbound.html.haml @@ -6,25 +6,26 @@ .form-check = f.check_box :allow_local_requests_from_web_hooks_and_services, class: 'form-check-input', data: { qa_selector: 'allow_requests_from_services_checkbox' } = f.label :allow_local_requests_from_web_hooks_and_services, class: 'form-check-label' do - = _('Allow requests to the local network from web hooks and services') + = s_('OutboundRequests|Allow requests to the local network from web hooks and services') .form-check = f.check_box :allow_local_requests_from_system_hooks, class: 'form-check-input' = f.label :allow_local_requests_from_system_hooks, class: 'form-check-label' do - = _('Allow requests to the local network from system hooks') + = s_('OutboundRequests|Allow requests to the local network from system hooks') .form-group = f.label :outbound_local_requests_allowlist_raw, class: 'label-bold' do - = _('Local IP addresses and domain names that hooks and services may access.') - = f.text_area :outbound_local_requests_allowlist_raw, placeholder: "example.com, 192.168.1.1", class: 'form-control gl-form-input', rows: 8 + = s_('OutboundRequests|Local IP addresses and domain names that hooks and services may access') + = f.text_area :outbound_local_requests_allowlist_raw, placeholder: "example.com, 192.168.1.1, xn--itlab-j1a.com", class: 'form-control gl-form-input', rows: 8 %span.form-text.text-muted - = _('Requests to these domain(s)/address(es) on the local network will be allowed when local requests from hooks and services are not allowed. IP ranges such as 1:0:0:0:0:0:0:0/124 or 127.0.0.0/28 are supported. Domain wildcards are not supported currently. Use comma, semicolon, or newline to separate multiple entries. The allowlist can hold a maximum of 1000 entries. Domains should use IDNA encoding. Ex: example.com, 192.168.1.1, 127.0.0.0/28, xn--itlab-j1a.com.') + = s_('OutboundRequests|Requests to these domains and IP addresses are accessible to both system hooks and web hooks even when local requests are not allowed. IP ranges such as 1:0:0:0:0:0:0:0/124 and 127.0.0.0/28 are supported. Domain wildcards are not supported. To separate entries use commas, semicolons, or newlines. The allowlist can hold a maximum of 1000 entries. Domains must be IDNA encoded.') + = link_to _('Learn more.'), help_page_path('security/webhooks.md', anchor: 'allowlist-for-local-requests'), target: '_blank', rel: 'noopener noreferrer' .form-group .form-check = f.check_box :dns_rebinding_protection_enabled, class: 'form-check-input' = f.label :dns_rebinding_protection_enabled, class: 'form-check-label' do - = _('Enforce DNS rebinding attack protection') + = s_('OutboundRequests|Enforce DNS rebinding attack protection') %span.form-text.text-muted - = _('Resolves IP addresses once and uses them to submit requests') + = s_('OutboundRequests|Resolve IP addresses once and uses them to submit requests.') = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_prometheus.html.haml b/app/views/admin/application_settings/_prometheus.html.haml index 59690fdee8b..08befa59952 100644 --- a/app/views/admin/application_settings/_prometheus.html.haml +++ b/app/views/admin/application_settings/_prometheus.html.haml @@ -9,7 +9,7 @@ = _("Enable health and performance metrics endpoint") .form-text.text-muted = _('Enable a Prometheus endpoint that exposes health and performance statistics. The Health Check menu item appears in the Monitoring section of the Admin Area. Restart required.') - = link_to _('Learn More.'), help_page_path('administration/monitoring/prometheus/gitlab_metrics.md'), target: '_blank' + = link_to _('Learn More.'), help_page_path('administration/monitoring/prometheus/gitlab_metrics.md'), target: '_blank', rel: 'noopener noreferrer' - unless Gitlab::Metrics.metrics_folder_present? .form-text.text-muted %strong.cred= _("WARNING:") diff --git a/app/views/admin/application_settings/_registry.html.haml b/app/views/admin/application_settings/_registry.html.haml index 78d4e8c8cc3..b55c2f05300 100644 --- a/app/views/admin/application_settings/_registry.html.haml +++ b/app/views/admin/application_settings/_registry.html.haml @@ -10,10 +10,10 @@ = f.check_box :container_expiration_policies_enable_historic_entries, class: 'form-check-input' = f.label :container_expiration_policies_enable_historic_entries, class: 'form-check-label' do = _("Enable container expiration and retention policies for projects created earlier than GitLab 12.7.") - = link_to sprite_icon('question-o'), help_page_path('user/packages/container_registry/index', anchor: 'cleanup-policy') + = link_to sprite_icon('question-o'), help_page_path('user/packages/container_registry/reduce_container_registry_storage', anchor: 'cleanup-policy') .form-text.text-muted = _("Existing projects will be able to use expiration policies. Avoid enabling this if an external Container Registry is being used, as there is a performance risk if many images exist on one project.") - = link_to sprite_icon('question-o'), help_page_path('user/packages/container_registry/index', anchor: 'use-with-external-container-registries') + = link_to sprite_icon('question-o'), help_page_path('user/packages/container_registry/reduce_container_registry_storage', anchor: 'use-with-external-container-registries') - if container_registry_expiration_policies_throttling? .form-group = f.label :container_registry_delete_tags_service_timeout, _('Cleanup policy maximum processing time (seconds)'), class: 'label-bold' diff --git a/app/views/admin/application_settings/_runner_registrars_form.html.haml b/app/views/admin/application_settings/_runner_registrars_form.html.haml index b7ab896533b..08b3d173d20 100644 --- a/app/views/admin/application_settings/_runner_registrars_form.html.haml +++ b/app/views/admin/application_settings/_runner_registrars_form.html.haml @@ -11,6 +11,6 @@ = s_("Runners|Members of the %{type} can register runners") % { type: type } %span.form-text.gl-text-gray-600 = _('If no options are selected, only administrators can register runners.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'runner-registration'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'prevent-users-from-registering-runners'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/_sourcegraph.html.haml b/app/views/admin/application_settings/_sourcegraph.html.haml index d87ded09a2b..b92cf7b156a 100644 --- a/app/views/admin/application_settings/_sourcegraph.html.haml +++ b/app/views/admin/application_settings/_sourcegraph.html.haml @@ -12,7 +12,7 @@ - link_end = "#{sprite_icon('external-link', size: 12, css_class: 'ml-1 vertical-align-center')}</a>".html_safe = s_('SourcegraphAdmin|Enable code intelligence powered by %{link_start}Sourcegraph%{link_end} on your GitLab instance\'s code views and merge requests.').html_safe % { link_start: link_start, link_end: link_end } %span - = link_to s_('SourcegraphAdmin|More information'), help_page_path('integration/sourcegraph.md'), target: '_blank' + = link_to s_('SourcegraphAdmin|More information'), help_page_path('integration/sourcegraph.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content diff --git a/app/views/admin/application_settings/_spam.html.haml b/app/views/admin/application_settings/_spam.html.haml index 53ca4d4aa79..27113fddb27 100644 --- a/app/views/admin/application_settings/_spam.html.haml +++ b/app/views/admin/application_settings/_spam.html.haml @@ -27,7 +27,7 @@ = f.text_field :recaptcha_site_key, class: 'form-control gl-form-input' .form-text.text-muted = _("Generate site and private keys at") - %a{ href: 'http://www.google.com/recaptcha', target: 'blank' } http://www.google.com/recaptcha + %a{ href: 'http://www.google.com/recaptcha', target: 'blank', rel: 'noopener noreferrer' } http://www.google.com/recaptcha .form-group = f.label :recaptcha_private_key, _('reCAPTCHA private key'), class: 'label-bold' @@ -65,7 +65,7 @@ = f.text_field :akismet_api_key, class: 'form-control gl-form-input' .form-text.text-muted Generate API key at - %a{ href: 'http://www.akismet.com', target: 'blank' } http://www.akismet.com + %a{ href: 'http://www.akismet.com', target: 'blank', rel: 'noopener noreferrer' } http://www.akismet.com %h5 = _('IP address restrictions') diff --git a/app/views/admin/application_settings/_third_party_offers.html.haml b/app/views/admin/application_settings/_third_party_offers.html.haml index 9a34400092e..231c45ec46c 100644 --- a/app/views/admin/application_settings/_third_party_offers.html.haml +++ b/app/views/admin/application_settings/_third_party_offers.html.haml @@ -2,11 +2,11 @@ %section.settings.as-third-party-offers.no-animate#js-third-party-offers-settings{ class: ('expanded' if expanded) } .settings-header %h4 - = _('Third-party offers') + = _('Customer experience improvement and third-party offers') %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded ? _('Collapse') : _('Expand') %p - = _('Control whether to display third-party offers in GitLab.') + = _('Control whether to display customer experience improvement content and third-party offers in GitLab.') .settings-content = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-third-party-offers-settings'), html: { class: 'fieldset-form', id: 'third-party-offers-settings' } do |f| = form_errors(@application_setting) if expanded @@ -15,6 +15,6 @@ .form-group .form-check = f.check_box :hide_third_party_offers, class: 'form-check-input' - = f.label :hide_third_party_offers, _('Do not display offers from third parties'), class: 'form-check-label' + = f.label :hide_third_party_offers, _('Do not display content for customer experience improvement and offers from third parties'), class: 'form-check-label' = f.submit _('Save changes'), class: "gl-button btn btn-confirm" diff --git a/app/views/admin/application_settings/appearances/_form.html.haml b/app/views/admin/application_settings/appearances/_form.html.haml index 3bd16e4c344..0f7f0109a54 100644 --- a/app/views/admin/application_settings/appearances/_form.html.haml +++ b/app/views/admin/application_settings/appearances/_form.html.haml @@ -20,7 +20,7 @@ %hr = f.hidden_field :header_logo_cache = f.file_field :header_logo, class: "", accept: 'image/*' - .hint + .form-text.text-muted = _('Maximum file size is 1MB. Pages are optimized for a 28px tall header logo') %hr .row @@ -39,7 +39,7 @@ %hr = f.hidden_field :favicon_cache = f.file_field :favicon, class: '', accept: 'image/*' - .hint + .form-text.text-muted = _("Maximum file size is 1 MB. Image size must be 32 x 32 pixels. Allowed image formats are %{favicon_extension_whitelist}.") % { favicon_extension_whitelist: favicon_extension_whitelist } %br = _("Images with incorrect dimensions are not resized automatically, and may result in unexpected behavior.") @@ -58,7 +58,7 @@ .form-group = f.label :description, class: 'col-form-label label-bold' = f.text_area :description, class: "form-control gl-form-input", rows: 10 - .hint + .form-text.text-muted = parsed_with_gfm .form-group = f.label :logo, class: 'col-form-label label-bold pt-0' @@ -71,7 +71,7 @@ %hr = f.hidden_field :logo_cache = f.file_field :logo, class: "", accept: 'image/*' - .hint + .form-text.text-muted = _('Maximum file size is 1MB. Pages are optimized for a 640x360 px logo.') %hr @@ -84,7 +84,7 @@ = f.label :new_project_guidelines, class: 'col-form-label label-bold' %p = f.text_area :new_project_guidelines, class: "form-control gl-form-input", rows: 10 - .hint + .form-text.text-muted = parsed_with_gfm %hr @@ -97,7 +97,7 @@ = f.label :profile_image_guidelines, class: 'col-form-label label-bold' %p = f.text_area :profile_image_guidelines, class: "form-control gl-form-input", rows: 10 - .hint + .form-text.text-muted = parsed_with_gfm .gl-mt-3.gl-mb-3 diff --git a/app/views/admin/application_settings/appearances/_system_header_footer_form.html.haml b/app/views/admin/application_settings/appearances/_system_header_footer_form.html.haml index 4571d34a497..1ce79e61ac6 100644 --- a/app/views/admin/application_settings/appearances/_system_header_footer_form.html.haml +++ b/app/views/admin/application_settings/appearances/_system_header_footer_form.html.haml @@ -19,7 +19,7 @@ = form.label :email_header_and_footer_enabled, class: 'label-bold' do = _('Enable header and footer in emails') - .hint + .form-text.text-muted = _('Add header and footer to emails. Please note that color settings will only be applied within the application interface') .form-group.js-toggle-colors-container diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index 53ba626760b..9eef4bc2a37 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -118,3 +118,4 @@ = render 'admin/application_settings/snowplow' = render 'admin/application_settings/eks' = render 'admin/application_settings/floc' += render_if_exists 'admin/application_settings/license_file' diff --git a/app/views/admin/application_settings/network.html.haml b/app/views/admin/application_settings/network.html.haml index 61a2f97764f..242d0c364f4 100644 --- a/app/views/admin/application_settings/network.html.haml +++ b/app/views/admin/application_settings/network.html.haml @@ -75,11 +75,13 @@ %section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'outbound_requests_content' } } .settings-header %h4 - = _('Outbound requests') + = s_('OutboundRequests|Outbound requests') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Allow requests to the local network from hooks and services.') + = s_('OutboundRequests|Allow requests to the local network from hooks and services.') + = link_to _('Learn more.'), help_page_path('security/webhooks.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'outbound' diff --git a/app/views/admin/background_migrations/_migration.html.haml b/app/views/admin/background_migrations/_migration.html.haml index 4a7c0083bc7..b6077bc54d6 100644 --- a/app/views/admin/background_migrations/_migration.html.haml +++ b/app/views/admin/background_migrations/_migration.html.haml @@ -7,7 +7,7 @@ - else = _('Unknown') %td{ role: 'cell', data: { label: _('Status') } } - %span.badge.badge-pill.gl-badge.sm{ class: batched_migration_status_badge_class_name(migration) }= migration.status.humanize + = gl_badge_tag migration.status.humanize, { size: :sm, variant: batched_migration_status_badge_variant(migration) } %td{ role: 'cell', data: { label: _('Action') } } - if migration.active? = button_to pause_admin_background_migration_path(migration), diff --git a/app/views/admin/background_migrations/index.html.haml b/app/views/admin/background_migrations/index.html.haml index 9ccbdfb5f20..13ac511f1b4 100644 --- a/app/views/admin/background_migrations/index.html.haml +++ b/app/views/admin/background_migrations/index.html.haml @@ -8,18 +8,15 @@ %li.nav-item{ role: 'presentation' } %a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path, class: (active_tab_classes if @current_tab == 'queued'), role: 'tab' } = _('Queued') - %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm - = limited_counter_with_delimiter(@relations_by_tab['queued']) + = gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['queued']) %li.nav-item{ role: 'presentation' } %a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path(tab: 'failed'), class: (active_tab_classes if @current_tab == 'failed'), role: 'tab' } = _('Failed') - %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm - = limited_counter_with_delimiter(@relations_by_tab['failed']) + = gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['failed']) %li.nav-item{ role: 'presentation' } %a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path(tab: 'finished'), class: (active_tab_classes if @current_tab == 'finished'), role: 'tab' } = _('Finished') - %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm - = limited_counter_with_delimiter(@relations_by_tab['finished']) + = gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['finished']) .tab-content.gl-tab-content .tab-pane.active{ role: 'tabpanel' } diff --git a/app/views/admin/cohorts/_cohorts_table.html.haml b/app/views/admin/cohorts/_cohorts_table.html.haml index a92cfb5851a..4e2292a9f67 100644 --- a/app/views/admin/cohorts/_cohorts_table.html.haml +++ b/app/views/admin/cohorts/_cohorts_table.html.haml @@ -2,7 +2,7 @@ .bs-callout.clearfix %p = s_("Cohorts|User cohorts are shown for the last %{months_included} months. Only users with activity are counted in the 'New users' column; inactive users are counted separately.") % { months_included: @cohorts[:months_included] } - = link_to sprite_icon('question-o'), help_page_path('user/admin_area/user_cohorts', anchor: 'cohorts'), title: 'About this feature', target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/admin_area/user_cohorts', anchor: 'cohorts'), title: 'About this feature', target: '_blank', rel: 'noopener noreferrer' .table-holder.d-xl-table %table.table diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 801b903395a..85b6ebfc63a 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -118,9 +118,9 @@ .gl-card-body %h4 = s_('AdminArea|Components') - - if Gitlab::CurrentSettings.version_check_enabled + - if show_version_check? .float-right - = version_status_badge + .js-gitlab-version-check{ data: { "size": "lg" } } = link_to(sprite_icon('question'), "https://gitlab.com/gitlab-org/gitlab/-/blob/master/CHANGELOG.md", class: 'gl-ml-2', target: '_blank', rel: 'noopener noreferrer') %p = link_to _('GitLab'), general_admin_application_settings_path diff --git a/app/views/admin/deploy_keys/index.html.haml b/app/views/admin/deploy_keys/index.html.haml index ba4abdc02e4..de2a737faa1 100644 --- a/app/views/admin/deploy_keys/index.html.haml +++ b/app/views/admin/deploy_keys/index.html.haml @@ -1,44 +1,3 @@ - page_title _('Deploy Keys') -- if Feature.enabled?(:admin_deploy_keys_vue, default_enabled: :yaml) - #js-admin-deploy-keys-table{ data: admin_deploy_keys_data } -- else - - if @deploy_keys.any? - %h3.page-title.deploy-keys-title - = _('Public deploy keys (%{deploy_keys_count})') % { deploy_keys_count: @deploy_keys.load.size } - = link_to _('New deploy key'), new_admin_deploy_key_path, class: 'float-right btn gl-button btn-confirm btn-md gl-button' - %table.table.b-table.gl-table.b-table-stacked-lg{ data: { testid: 'deploy-keys-list' } } - %thead - %tr - %th= _('Title') - %th= _('Fingerprint') - %th= _('Projects with write access') - %th= _('Created') - %th.gl-lg-w-1px.gl-white-space-nowrap - %span.gl-sr-only - = _('Actions') - %tbody - - @deploy_keys.each do |deploy_key| - %tr - %td{ data: { label: _('Title') } } - %div - = deploy_key.title - %td{ data: { label: _('Fingerprint') } } - %div - %code= deploy_key.fingerprint - %td{ data: { label: _('Projects with write access') } } - %div - - deploy_key.projects_with_write_access.each do |project| - = link_to project.full_name, admin_project_path(project), class: 'gl-display-block' - %td{ data: { label: _('Created') } } - %div - = time_ago_with_tooltip(deploy_key.created_at) - %td.gl-lg-w-1px.gl-white-space-nowrap{ data: { label: _('Actions') } } - %div - = link_to edit_admin_deploy_key_path(deploy_key), class: 'btn btn-default btn-md gl-button btn-icon gl-mr-3', aria: { label: _('Edit deploy key') } do - = sprite_icon('pencil', css_class: 'gl-button-icon') - = link_to admin_deploy_key_path(deploy_key), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn btn-danger btn-md gl-button btn-icon', aria: { label: _('Remove deploy key') } do - = sprite_icon('remove', css_class: 'gl-button-icon') - - - else - = render 'shared/empty_states/deploy_keys' +#js-admin-deploy-keys-table{ data: admin_deploy_keys_data } diff --git a/app/views/admin/groups/_group.html.haml b/app/views/admin/groups/_group.html.haml index bbc65850794..0c2280a2f63 100644 --- a/app/views/admin/groups/_group.html.haml +++ b/app/views/admin/groups/_group.html.haml @@ -15,8 +15,7 @@ = markdown_field(group, :description) .stats.gl-text-gray-500.gl-flex-shrink-0.gl-display-none.gl-sm-display-flex - %span.badge.badge-muted.badge-pill.gl-badge.sm - = storage_counter(group.storage_size) + = gl_badge_tag storage_counter(group.storage_size), size: :sm = render_if_exists 'admin/namespace_plan_badge', namespace: group, css_class: 'gl-ml-5 gl-mr-0' = render_if_exists 'admin/groups/marked_for_deletion_badge', group: group, css_class: 'gl-ml-5' diff --git a/app/views/admin/labels/_form.html.haml b/app/views/admin/labels/_form.html.haml deleted file mode 100644 index abf380474e4..00000000000 --- a/app/views/admin/labels/_form.html.haml +++ /dev/null @@ -1,31 +0,0 @@ -= form_for [:admin, @label], html: { class: 'label-form js-requires-input' } do |f| - = form_errors(@label) - - .form-group.row - .col-sm-2.col-form-label - = f.label :title - .col-sm-10 - = f.text_field :title, class: "form-control gl-form-input", required: true - .form-group.row - .col-sm-2.col-form-label - = f.label :description - .col-sm-10 - = f.text_field :description, class: "form-control gl-form-input js-quick-submit" - .form-group.row - .col-sm-2.col-form-label - = f.label :color, _("Background color") - .col-sm-10 - .input-group - .input-group-prepend - .input-group-text.label-color-preview - = f.text_field :color, class: "form-control gl-form-input" - .form-text.text-muted - = _('Choose any color.') - %br - = _("Or you can choose one of the suggested colors below") - - = render_suggested_colors - - .form-actions - = f.submit _('Save'), class: 'btn gl-button btn-confirm js-save-button' - = link_to _("Cancel"), admin_labels_path, class: 'btn gl-button btn-default btn-cancel' diff --git a/app/views/admin/labels/edit.html.haml b/app/views/admin/labels/edit.html.haml index 652ed095d00..44dd2b6a646 100644 --- a/app/views/admin/labels/edit.html.haml +++ b/app/views/admin/labels/edit.html.haml @@ -4,4 +4,4 @@ %h3.page-title = _('Edit Label') %hr -= render 'form' += render 'shared/labels/form', url: admin_label_path(@label), back_path: admin_labels_path diff --git a/app/views/admin/labels/new.html.haml b/app/views/admin/labels/new.html.haml index 20103fb8a29..5166bdb4d20 100644 --- a/app/views/admin/labels/new.html.haml +++ b/app/views/admin/labels/new.html.haml @@ -2,4 +2,4 @@ %h3.page-title = _('New Label') %hr -= render 'form' += render 'shared/labels/form', url: admin_labels_path, back_path: admin_labels_path diff --git a/app/views/admin/runners/edit.html.haml b/app/views/admin/runners/edit.html.haml new file mode 100644 index 00000000000..0257983016c --- /dev/null +++ b/app/views/admin/runners/edit.html.haml @@ -0,0 +1,99 @@ +- add_page_specific_style 'page_bundles/ci_status' + +- runner_name = "##{@runner.id} (#{@runner.short_sha})" +- if Feature.enabled?(:runner_read_only_admin_view) + - breadcrumb_title _('Edit') + - page_title _('Edit'), runner_name + - add_to_breadcrumbs _('Runners'), admin_runners_path + - add_to_breadcrumbs runner_name, admin_runner_path(@runner) +- else + - breadcrumb_title runner_name + - page_title runner_name + +#js-admin-runner-edit{ data: {runner_id: @runner.id} } + +.row + .col-md-6 + %h4= _('Restrict projects for this runner') + - if @runner.runner_projects.any? + %table.table{ data: { testid: 'assigned-projects' } } + %thead + %tr + %th= _('Assigned projects') + - @runner.runner_projects.each do |runner_project| + - project = runner_project.project + - if project + %tr + %td + .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 + .gl-alert-body + %strong + = project.full_name + .gl-alert-actions + = link_to _('Disable'), admin_namespace_project_runner_project_path(project.namespace, project, runner_project), method: :delete, class: 'btn gl-alert-action btn-confirm btn-md gl-button' + + %table.table{ data: { testid: 'unassigned-projects' } } + %thead + %tr + %th= _('Project') + %th + + %tr + %td + = form_tag edit_admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do + .input-group + = search_field_tag :search, params[:search], class: 'form-control gl-form-input', spellcheck: false + .input-group-append + = submit_tag _('Search'), class: 'gl-button btn btn-default' + + %td + - @projects.each do |project| + %tr + %td + = project.full_name + %td + .float-right + = form_for project.runner_projects.new, url: admin_namespace_project_runner_projects_path(project.namespace, project), method: :post do |f| + = f.hidden_field :runner_id, value: @runner.id + = f.submit _('Enable'), aria: { label: s_('Runners|Change to project runner') }, class: 'gl-button btn btn-sm', data: { confirm: (s_('Runners|You are about to change this instance runner to a project runner. This operation is not reversible. Are you sure you want to continue?') if @runner.instance_type?), confirm_btn_variant: 'danger' } + = paginate_without_count @projects + + .col-md-6 + %h4= _('Recent jobs served by this runner') + %table.table.ci-table.runner-builds + %thead + %tr + %th= _('Job') + %th= _('Status') + %th= _('Project') + %th= _('Commit') + %th= _('Finished at') + + - @builds.each do |build| + - project = build.project + %tr.build + %td.id + - if project + = link_to project_job_path(project, build) do + %strong ##{build.id} + - else + %strong ##{build.id} + + %td.status + = render 'ci/status/badge', status: build.detailed_status(current_user) + + %td.status + - if project + = project.full_name + + %td.build-link + - if project + = link_to pipeline_path(build.pipeline) do + %strong= build.pipeline.short_sha + + %td.timestamp + - if build.finished_at + %span= time_ago_with_tooltip build.finished_at diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index 808b2bb4f8e..7b4390ae463 100644 --- a/app/views/admin/runners/show.html.haml +++ b/app/views/admin/runners/show.html.haml @@ -1,93 +1,8 @@ - add_page_specific_style 'page_bundles/ci_status' -- breadcrumb_title @runner.short_sha -- page_title "##{@runner.id} (#{@runner.short_sha})" +- title = "##{@runner.id} (#{@runner.short_sha})" +- breadcrumb_title title +- page_title title - add_to_breadcrumbs _('Runners'), admin_runners_path -#js-runner-details{ data: {runner_id: @runner.id} } - -.row - .col-md-6 - %h4= _('Restrict projects for this runner') - - if @runner.runner_projects.any? - %table.table{ data: { testid: 'assigned-projects' } } - %thead - %tr - %th= _('Assigned projects') - - @runner.runner_projects.each do |runner_project| - - project = runner_project.project - - if project - %tr - %td - .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 - .gl-alert-body - %strong - = project.full_name - .gl-alert-actions - = link_to _('Disable'), admin_namespace_project_runner_project_path(project.namespace, project, runner_project), method: :delete, class: 'btn gl-alert-action btn-confirm btn-md gl-button' - - %table.table{ data: { testid: 'unassigned-projects' } } - %thead - %tr - %th= _('Project') - %th - - %tr - %td - = form_tag admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do - .input-group - = search_field_tag :search, params[:search], class: 'form-control gl-form-input', spellcheck: false - .input-group-append - = submit_tag _('Search'), class: 'gl-button btn btn-default' - - %td - - @projects.each do |project| - %tr - %td - = project.full_name - %td - .float-right - = form_for project.runner_projects.new, url: admin_namespace_project_runner_projects_path(project.namespace, project), method: :post do |f| - = f.hidden_field :runner_id, value: @runner.id - = f.submit _('Enable'), class: 'gl-button btn btn-sm', data: { confirm: (s_('Runners|You are about to change this instance runner to a project runner. This operation is not reversible. Are you sure you want to continue?') if @runner.instance_type?) } - = paginate_without_count @projects - - .col-md-6 - %h4= _('Recent jobs served by this runner') - %table.table.ci-table.runner-builds - %thead - %tr - %th= _('Job') - %th= _('Status') - %th= _('Project') - %th= _('Commit') - %th= _('Finished at') - - - @builds.each do |build| - - project = build.project - %tr.build - %td.id - - if project - = link_to project_job_path(project, build) do - %strong ##{build.id} - - else - %strong ##{build.id} - - %td.status - = render 'ci/status/badge', status: build.detailed_status(current_user) - - %td.status - - if project - = project.full_name - - %td.build-link - - if project - = link_to pipeline_path(build.pipeline) do - %strong= build.pipeline.short_sha - - %td.timestamp - - if build.finished_at - %span= time_ago_with_tooltip build.finished_at +-# Empty view in development behind feature flag runner_read_only_admin_view diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml index bafb2085589..ca14d898d79 100644 --- a/app/views/admin/users/_head.html.haml +++ b/app/views/admin/users/_head.html.haml @@ -3,23 +3,26 @@ %h3.page-title.gl-m-0 = @user.name - if @user.blocked_pending_approval? - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Pending approval)') - elsif @user.banned? - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Banned)') - elsif @user.blocked? - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Blocked)') - if @user.internal? - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Internal)') - if @user.admin - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Admin)') - if @user.deactivated? - %span.cred + %span.gl-text-red-500 = s_('AdminUsers|(Deactivated)') + - if @user.access_locked? + %span.gl-text-red-500 + = s_('AdminUsers|(Locked)') = render_if_exists 'admin/users/auditor_user_badge' = render_if_exists 'admin/users/gma_user_badge' diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index e62e4cfa192..5edd5403d49 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -1,3 +1,11 @@ +- if registration_features_can_be_prompted? + = render 'shared/global_alert', + variant: :tip, + alert_class: 'gl-my-5', + dismissible: false do + .gl-alert-body + = render 'shared/registration_features_discovery_message', feature_title: s_('RegistrationFeatures|send emails to users') + .top-area.scrolling-tabs-container.inner-page-scroll-tabs .fade-left = sprite_icon('chevron-lg-left', size: 12) @@ -51,7 +59,7 @@ = hidden_field_tag :sort, @sort = sprite_icon('search', css_class: 'search-icon') = button_tag s_('AdminUsers|Search users') if Rails.env.test? - .dropdown.user-sort-dropdown + .dropdown.gl-ml-3 = label_tag 'Sort by', nil, class: 'label-bold' - toggle_text = @sort.present? ? users_sort_options_hash[@sort] : sort_title_name = dropdown_toggle(toggle_text, { toggle: 'dropdown' }) diff --git a/app/views/admin/users/projects.html.haml b/app/views/admin/users/projects.html.haml index b47ed38f65f..f51ac40df4f 100644 --- a/app/views/admin/users/projects.html.haml +++ b/app/views/admin/users/projects.html.haml @@ -5,7 +5,7 @@ - if @user.groups.any? .card - .card-header= _('Group projects') + .card-header= _('Groups') %ul.hover-list - @user.group_members.includes(:source).each do |group_member| # rubocop: disable CodeReuse/ActiveRecord - group = group_member.group diff --git a/app/views/ci/runner/_how_to_setup_runner.html.haml b/app/views/ci/runner/_how_to_setup_runner.html.haml index 24048a8b328..c872ee481ad 100644 --- a/app/views/ci/runner/_how_to_setup_runner.html.haml +++ b/app/views/ci/runner/_how_to_setup_runner.html.haml @@ -1,4 +1,4 @@ -- link = link_to _("Install GitLab Runner and ensure it's running."), 'https://docs.gitlab.com/runner/install/', target: '_blank' +- link = link_to _("Install GitLab Runner and ensure it's running."), 'https://docs.gitlab.com/runner/install/', target: '_blank', rel: 'noopener noreferrer' .gl-mb-3 %h5= _("Set up a %{type} Runner for a project") % { type: type } %ol diff --git a/app/views/clusters/clusters/_advanced_settings.html.haml b/app/views/clusters/clusters/_advanced_settings.html.haml index c84b3a923ca..59c8fe04b09 100644 --- a/app/views/clusters/clusters/_advanced_settings.html.haml +++ b/app/views/clusters/clusters/_advanced_settings.html.haml @@ -23,7 +23,7 @@ placeholder: _('Select project'), idAttribute: 'id', data: { order_by: 'last_activity_at', idattribute: 'id', simple_filter: true, allow_clear: true, include_groups: false, include_projects_in_subgroups: true, group_id: group_id, user_id: user_id }, value: @cluster.management_project_id) .text-muted = html_escape(s_('ClusterIntegration|A cluster management project can be used to run deployment jobs with Kubernetes %{code_open}cluster-admin%{code_close} privileges.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - = link_to _('More information'), help_page_path('user/clusters/management_project.md'), target: '_blank' + = link_to _('More information'), help_page_path('user/clusters/management_project.md'), target: '_blank', rel: 'noopener noreferrer' = field.submit _('Save changes'), class: 'btn gl-button btn-confirm' .sub-section.form-group diff --git a/app/views/clusters/clusters/_integrations.html.haml b/app/views/clusters/clusters/_integrations.html.haml index f136091dad5..c670dafb947 100644 --- a/app/views/clusters/clusters/_integrations.html.haml +++ b/app/views/clusters/clusters/_integrations.html.haml @@ -1,7 +1,7 @@ .settings.expanded.border-0.m-0 %p = s_('ClusterIntegration|Integrations allow you to use applications installed in your cluster as part of your GitLab workflow.') - = link_to _('Learn more'), help_page_path('user/clusters/integrations.md'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/clusters/integrations.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content#integrations-settings-section - if can?(current_user, :admin_cluster, @cluster) .sub-section.form-group diff --git a/app/views/clusters/clusters/_namespace.html.haml b/app/views/clusters/clusters/_namespace.html.haml index 6412972e195..cedece5ad93 100644 --- a/app/views/clusters/clusters/_namespace.html.haml +++ b/app/views/clusters/clusters/_namespace.html.haml @@ -1,6 +1,6 @@ - managed_namespace_help_text = s_('ClusterIntegration|Set a prefix for your namespaces. If not set, defaults to your project path. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') - non_managed_namespace_help_text = s_('ClusterIntegration|The namespace associated with your project. This will be used for deploy boards, logs, and Web terminals.') -- managed_namespace_help_link = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank' +- managed_namespace_help_link = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' .js-namespace-prefixed = platform_field.text_field :namespace, diff --git a/app/views/clusters/clusters/_provider_details_form.html.haml b/app/views/clusters/clusters/_provider_details_form.html.haml index fe3d1998234..11277a83e3a 100644 --- a/app/views/clusters/clusters/_provider_details_form.html.haml +++ b/app/views/clusters/clusters/_provider_details_form.html.haml @@ -43,13 +43,13 @@ label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') - = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' .form-group = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') - = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' - if cluster.allow_user_defined_namespace? = render('clusters/clusters/namespace', platform_field: platform_field, field: field) diff --git a/app/views/clusters/clusters/gcp/_form.html.haml b/app/views/clusters/clusters/gcp/_form.html.haml index 173456926a5..c8105fd1152 100644 --- a/app/views/clusters/clusters/gcp/_form.html.haml +++ b/app/views/clusters/clusters/gcp/_form.html.haml @@ -67,20 +67,20 @@ label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster.') - = link_to _('More information'), help_page_path('user/project/clusters/add_gke_clusters.md', anchor: 'cloud-run-for-anthos'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/add_gke_clusters.md', anchor: 'cloud-run-for-anthos'), target: '_blank', rel: 'noopener noreferrer' .form-group = field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'), label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') - = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' .form-group = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') - = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' .form-group.js-gke-cluster-creation-submit-container = field.submit s_('ClusterIntegration|Create Kubernetes cluster'), diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index a6efe597f0c..bf654999f2f 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -36,7 +36,7 @@ = sprite_icon('close', css_class: 'gl-icon') .gl-alert-body = s_('ClusterApplicationsRemoved|One-click application management was removed in GitLab 14.0. Your applications are still installed in your cluster, and integrations continue working.') - = link_to _('More information.'), help_page_path("user/clusters/applications"), target: '_blank' + = link_to _('More information.'), help_page_path("user/clusters/applications"), target: '_blank', rel: 'noopener noreferrer' - if cluster_created?(@cluster) .js-toggle-container diff --git a/app/views/clusters/clusters/user/_form.html.haml b/app/views/clusters/clusters/user/_form.html.haml index e9b84952c15..29af79cee5f 100644 --- a/app/views/clusters/clusters/user/_form.html.haml +++ b/app/views/clusters/clusters/user/_form.html.haml @@ -1,7 +1,7 @@ - more_info_link = link_to _('More information'), help_page_path('user/project/clusters/add_remove_clusters.md', - anchor: 'add-existing-cluster'), target: '_blank' + anchor: 'add-existing-cluster'), target: '_blank', rel: 'noopener noreferrer' - rbac_help_link = link_to _('More information'), help_page_path('user/project/clusters/add_remove_clusters.md', - anchor: 'access-controls'), target: '_blank' + anchor: 'access-controls'), target: '_blank', rel: 'noopener noreferrer' - api_url_help_text = s_('ClusterIntegration|The URL used to access the Kubernetes API.') - ca_cert_help_text = s_('ClusterIntegration|The Kubernetes certificate used to authenticate to the cluster.') @@ -47,13 +47,13 @@ label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.') - = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer' .form-group = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' } .form-text.text-muted = s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.') - = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank' + = link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer' = field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field| - if @user_cluster.allow_user_defined_namespace? diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 5a7eb46771b..f0216253dad 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -11,7 +11,7 @@ - if current_user .page-title-controls - = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues + = render 'shared/new_project_item_select', path: 'issues/new', label: _("issue"), with_feature_enabled: 'issues', type: :issues .top-area = render 'shared/issuable/nav', type: :issues, display_count: !@no_filters_set diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index ae557b73620..90fb09ed909 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -9,7 +9,7 @@ - if current_user .page-title-controls.ml-0.mb-3.ml-sm-auto.mb-sm-0 - = render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", with_feature_enabled: 'merge_requests', type: :merge_requests + = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _("merge request"), with_feature_enabled: 'merge_requests', type: :merge_requests .top-area = render 'shared/issuable/nav', type: :merge_requests, display_count: !@no_filters_set diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index aa54a1e589e..f6dc62e1d44 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -6,26 +6,26 @@ - add_page_specific_style 'page_bundles/todos' .page-title-holder.d-flex.align-items-center - %h1.page-title= _('To-Do List') + %h1.page-title= _("To-Do List") - if current_user.todos.any? .top-area = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do = gl_tab_link_to todos_filter_path(state: 'pending'), item_active: params[:state].blank? || params[:state] == 'pending', class: "js-todos-pending" do = _("To Do") - = gl_tab_counter_badge number_with_delimiter(todos_pending_count) + = gl_tab_counter_badge(number_with_delimiter(todos_pending_count), { class: 'js-todos-badge' }) = gl_tab_link_to todos_filter_path(state: 'done'), item_active: params[:state] == 'done', class: "js-todos-done" do = _("Done") - = gl_tab_counter_badge number_with_delimiter(todos_done_count) + = gl_tab_counter_badge(number_with_delimiter(todos_done_count), { class: 'js-todos-badge' }) .nav-controls - if @allowed_todos.any?(&:pending?) .gl-mr-3 = link_to destroy_all_dashboard_todos_path(todos_filter_params), class: 'gl-button btn btn-default btn-loading align-items-center js-todos-mark-all', method: :delete, data: { href: destroy_all_dashboard_todos_path(todos_filter_params) } do - Mark all as done + = s_("Todos|Mark all as done") %span.gl-spinner.ml-1 = link_to bulk_restore_dashboard_todos_path, class: 'gl-button btn btn-default btn-loading align-items-center js-todos-undo-all hidden', method: :patch , data: { href: bulk_restore_dashboard_todos_path(todos_filter_params) } do - Undo mark all as done + = s_("Todos|Undo mark all as done") %span.gl-spinner.ml-1 .todos-filters @@ -35,28 +35,23 @@ .filter-item.gl-m-2 - if params[:group_id].present? = hidden_field_tag(:group_id, params[:group_id]) - = dropdown_tag(group_dropdown_label(params[:group_id], 'Group'), options: { toggle_class: 'js-group-search js-filter-submit gl-xs-w-full!', title: 'Filter by group', filter: true, filterInput: 'input#group-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-group js-filter-submit', - placeholder: 'Search groups', data: { default_label: 'Group', display: 'static' } }) + = dropdown_tag(group_dropdown_label(params[:group_id], _("Group")), options: { toggle_class: 'js-group-search js-filter-submit gl-xs-w-full!', title: s_("Todos|Filter by group"), filter: true, filterInput: 'input#group-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-group js-filter-submit', placeholder: _("Search groups"), data: { default_label: _("Group"), display: 'static' } }) .filter-item.gl-m-2 - if params[:project_id].present? = hidden_field_tag(:project_id, params[:project_id]) - = dropdown_tag(project_dropdown_label(params[:project_id], 'Project'), options: { toggle_class: 'js-project-search js-filter-submit gl-xs-w-full!', title: 'Filter by project', filter: true, filterInput: 'input#project-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', - placeholder: 'Search projects', data: { default_label: 'Project', display: 'static' } }) + = dropdown_tag(project_dropdown_label(params[:project_id], _("Project")), options: { toggle_class: 'js-project-search js-filter-submit gl-xs-w-full!', title: s_("Todos|Filter by project"), filter: true, filterInput: 'input#project-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', placeholder: _("Search projects"), data: { default_label: _("Project"), display: 'static' } }) .filter-item.gl-m-2 - if params[:author_id].present? = hidden_field_tag(:author_id, params[:author_id]) - = dropdown_tag(user_dropdown_label(params[:author_id], 'Author'), options: { toggle_class: 'js-user-search js-filter-submit js-author-search gl-xs-w-full!', title: 'Filter by author', filter: true, filterInput: 'input#author-search', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author js-filter-submit', - placeholder: 'Search authors', data: { any_user: 'Any Author', first_user: (current_user.username if current_user), project_id: (@project.id if @project), selected: params[:author_id], field_name: 'author_id', default_label: 'Author', todo_filter: true, todo_state_filter: params[:state] || 'pending' } }) + = dropdown_tag(user_dropdown_label(params[:author_id], _("Author")), options: { toggle_class: 'js-user-search js-filter-submit js-author-search gl-xs-w-full!', title: s_("Todos|Filter by author"), filter: true, filterInput: 'input#author-search', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author js-filter-submit', placeholder: _("Search authors"), data: { any_user: _("Any Author"), first_user: (current_user.username if current_user), project_id: (@project.id if @project), selected: params[:author_id], field_name: 'author_id', default_label: _("Author"), todo_filter: true, todo_state_filter: params[:state] || 'pending' } }) .filter-item.gl-m-2 - if params[:type].present? = hidden_field_tag(:type, params[:type]) - = dropdown_tag(todo_types_dropdown_label(params[:type], 'Type'), options: { toggle_class: 'js-type-search js-filter-submit gl-xs-w-full!', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit', - data: { data: todo_types_options, default_label: 'Type' } }) + = dropdown_tag(todo_types_dropdown_label(params[:type], _("Type")), options: { toggle_class: 'js-type-search js-filter-submit gl-xs-w-full!', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit', data: { data: todo_types_options, default_label: _("Type") } }) .filter-item.actions-filter.gl-m-2 - if params[:action_id].present? = hidden_field_tag(:action_id, params[:action_id]) - = dropdown_tag(todo_actions_dropdown_label(params[:action_id], 'Action'), options: { toggle_class: 'js-action-search js-filter-submit gl-xs-w-full!', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit', - data: { data: todo_actions_options, default_label: 'Action' } }) + = dropdown_tag(todo_actions_dropdown_label(params[:action_id], _("Action")), options: { toggle_class: 'js-action-search js-filter-submit gl-xs-w-full!', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit', data: { data: todo_actions_options, default_label: _("Action") } }) .filter-item.sort-filter.gl-mt-3.gl-sm-mt-0.gl-mb-0.gl-sm-mb-0 .dropdown %button.dropdown-menu-toggle.dropdown-menu-toggle-sort{ type: 'button', class: 'gl-xs-w-full!', 'data-toggle' => 'dropdown' } @@ -85,40 +80,30 @@ .js-nothing-here-container.empty-state.hidden .svg-content = image_tag 'illustrations/todos_all_done.svg' - .text-content - %h4.text-center - You're all done! + .text-content.gl-text-center + %h4 + = s_("Todos|You're all done!") - elsif current_user.todos.any? .col.todos-all-done.empty-state .svg-content.svg-250 = image_tag 'illustrations/todos_all_done.svg' - .text-content + .text-content.gl-text-center - if todos_filter_empty? - %h4.text-center + %h4 = Gitlab.config.gitlab.no_todos_messages.sample %p - Are you looking for things to do? Take a look at - = succeed "," do - %strong - = link_to "open issues", issues_dashboard_path - contribute to - %strong - = link_to "a merge request\,", merge_requests_dashboard_path - or mention someone in a comment to automatically assign them a new to-do item. + = (s_("Todos|Are you looking for things to do? Take a look at %{strongStart}%{openIssuesLinkStart}open issues%{openIssuesLinkEnd}%{strongEnd}, contribute to %{strongStart}%{mergeRequestLinkStart}a merge request%{mergeRequestLinkEnd}%{mergeRequestLinkEnd}%{strongEnd}, or mention someone in a comment to automatically assign them a new to-do item.") % { strongStart: '<strong>', strongEnd: '</strong>', openIssuesLinkStart: "<a href=\"#{issues_dashboard_path}\">", openIssuesLinkEnd: '</a>', mergeRequestLinkStart: "<a href=\"#{merge_requests_dashboard_path}\">", mergeRequestLinkEnd: '</a>' }).html_safe - else - %h4.text-center - Nothing is on your to-do list. Nice work! + %h4 + = s_("Todos|Nothing is on your to-do list. Nice work!") - else .col.empty-state .svg-content = image_tag 'illustrations/todos_empty.svg' - .text-content - %h4.text-center - Your To-Do List shows what to work on next + .text-content.gl-text-center + %h4 + = s_("Todos|Your To-Do List shows what to work on next") %p - When an issue or merge request is assigned to you, or when you receive a - %strong - @mention - in a comment, this automatically triggers a new item in your To-Do List. + = (s_("Todos|When an issue or merge request is assigned to you, or when you receive a %{strongStart}@mention%{strongEnd} in a comment, this automatically triggers a new item in your To-Do List.") % { strongStart: '<strong>', strongEnd: '</strong>' }).html_safe %p - It's how you always know what to work on next. + = s_("Todos|It's how you always know what to work on next.") diff --git a/app/views/devise/confirmations/almost_there.haml b/app/views/devise/confirmations/almost_there.haml index 892ef730884..1d46a43e5bd 100644 --- a/app/views/devise/confirmations/almost_there.haml +++ b/app/views/devise/confirmations/almost_there.haml @@ -2,7 +2,9 @@ - request_link_start = '<a href="%{new_user_confirmation_path}">'.html_safe % { new_user_confirmation_path: new_user_confirmation_path } - request_link_end = '</a>'.html_safe - content_for :page_specific_javascripts do + = render "layouts/google_tag_manager_head" = render "layouts/one_trust" += render "layouts/google_tag_manager_body" .well-confirmation.gl-text-center.gl-mb-6 %h1.gl-mt-0 diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 15143684b8b..982171b9e34 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -62,7 +62,7 @@ %div - if show_recaptcha_sign_up? = recaptcha_tags nonce: content_security_policy_nonce - .submit-container + .submit-container.gl-mt-5 = f.submit button_text, class: 'btn gl-button btn-confirm gl-display-block gl-w-full', data: { qa_selector: 'new_user_register_button' } = render 'devise/shared/terms_of_service_notice', button_text: button_text - if show_omniauth_providers && omniauth_providers_placement == :bottom diff --git a/app/views/devise/shared/_signup_omniauth_provider_list.haml b/app/views/devise/shared/_signup_omniauth_provider_list.haml index c24e8770f05..6688308cd71 100644 --- a/app/views/devise/shared/_signup_omniauth_provider_list.haml +++ b/app/views/devise/shared/_signup_omniauth_provider_list.haml @@ -2,7 +2,7 @@ = _("Create an account using:") .gl-display-flex.gl-justify-content-between.gl-flex-wrap - providers.each do |provider| - = link_to omniauth_authorize_path(:user, provider), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-3 js-oauth-login #{qa_class_for_provider(provider)}", id: "oauth-login-#{provider}" do + = link_to omniauth_authorize_path(:user, provider), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-3 js-oauth-login #{qa_class_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do - if provider_has_icon?(provider) = provider_image_tag(provider) %span.gl-button-text diff --git a/app/views/doorkeeper/authorizations/new.html.haml b/app/views/doorkeeper/authorizations/new.html.haml index f0e7a96f69f..bc69da5775f 100644 --- a/app/views/doorkeeper/authorizations/new.html.haml +++ b/app/views/doorkeeper/authorizations/new.html.haml @@ -1,14 +1,14 @@ %main{ :role => "main" } - .modal-dialog.modal-doorkeepr-auth - .modal-content.gl-shadow-none - .modal-header - %h3.page-title + .doorkeeper-authorize.gl-mx-auto.gl-mt-6 + .gl-border-gray-200.gl-border-1.gl-border-solid.gl-rounded-base + .gl-p-5.gl-border-b-gray-200.gl-border-b-1.gl-border-b-solid + %h4.gl-m-0 - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer') = _("Authorize %{link_to_client} to use your account?").html_safe % { link_to_client: link_to_client } - .modal-body + .gl-p-5 - if current_user.admin? - .text-warning + .gl-text-orange-500 %p = sprite_icon('warning-solid') = html_escape(_('You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution.')) % { client_name: tag.strong(@pre_auth.client.name) } @@ -27,25 +27,25 @@ - @pre_auth.scopes.each do |scope| %li %strong= t scope, scope: [:doorkeeper, :scopes] - .text-secondary= t scope, scope: [:doorkeeper, :scope_desc] - .form-actions.text-right - = form_tag oauth_authorization_path, method: :delete, class: 'inline' do - = hidden_field_tag :client_id, @pre_auth.client.uid - = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri - = hidden_field_tag :state, @pre_auth.state - = hidden_field_tag :response_type, @pre_auth.response_type - = hidden_field_tag :scope, @pre_auth.scope - = hidden_field_tag :nonce, @pre_auth.nonce - = hidden_field_tag :code_challenge, @pre_auth.code_challenge - = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method - = submit_tag _("Deny"), class: "gl-button btn btn-danger" - = form_tag oauth_authorization_path, method: :post, class: 'inline' do - = hidden_field_tag :client_id, @pre_auth.client.uid - = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri - = hidden_field_tag :state, @pre_auth.state - = hidden_field_tag :response_type, @pre_auth.response_type - = hidden_field_tag :scope, @pre_auth.scope - = hidden_field_tag :nonce, @pre_auth.nonce - = hidden_field_tag :code_challenge, @pre_auth.code_challenge - = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method - = submit_tag _("Authorize"), class: "gl-button btn btn-confirm gl-ml-3", data: { qa_selector: 'authorization_button' } + .gl-text-gray-500= t scope, scope: [:doorkeeper, :scope_desc] + .gl-p-5.gl-bg-gray-10.gl-border-t-gray-200.gl-border-t-1.gl-border-t-solid.gl-rounded-bottom-right-base.gl-rounded-bottom-left-base.gl-text-right + = form_tag oauth_authorization_path, method: :delete, class: 'inline' do + = hidden_field_tag :client_id, @pre_auth.client.uid + = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri + = hidden_field_tag :state, @pre_auth.state + = hidden_field_tag :response_type, @pre_auth.response_type + = hidden_field_tag :scope, @pre_auth.scope + = hidden_field_tag :nonce, @pre_auth.nonce + = hidden_field_tag :code_challenge, @pre_auth.code_challenge + = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method + = submit_tag _("Deny"), class: "btn btn-default gl-button" + = form_tag oauth_authorization_path, method: :post, class: 'inline' do + = hidden_field_tag :client_id, @pre_auth.client.uid + = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri + = hidden_field_tag :state, @pre_auth.state + = hidden_field_tag :response_type, @pre_auth.response_type + = hidden_field_tag :scope, @pre_auth.scope + = hidden_field_tag :nonce, @pre_auth.nonce + = hidden_field_tag :code_challenge, @pre_auth.code_challenge + = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method + = submit_tag _("Authorize"), class: "btn btn-danger gl-button gl-ml-3", data: { qa_selector: 'authorization_button' } diff --git a/app/views/graphiql/rails/editors/show.html.erb b/app/views/graphiql/rails/editors/show.html.erb deleted file mode 100644 index b8f82ae8323..00000000000 --- a/app/views/graphiql/rails/editors/show.html.erb +++ /dev/null @@ -1,99 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>GraphiQL</title> - <%= stylesheet_link_tag("graphiql/rails/application") %> - <%# TODO: This file was included to fix a CSP failure. Please remove when https://github.com/rmosolgo/graphiql-rails/pull/71 will be released %> - <%= javascript_include_tag("graphiql/rails/application", nonce: true) %> - </head> - <body> - <div id="graphiql-container"> - Loading... - </div> - <%= javascript_tag nonce: true do -%> - var parameters = {}; - - <% if GraphiQL::Rails.config.query_params %> - // Parse the search string to get url parameters. - var search = window.location.search; - search.substr(1).split('&').forEach(function (entry) { - var eq = entry.indexOf('='); - if (eq >= 0) { - parameters[decodeURIComponent(entry.slice(0, eq))] = - decodeURIComponent(entry.slice(eq + 1)); - } - }); - // if variables was provided, try to format it. - if (parameters.variables) { - try { - parameters.variables = - JSON.stringify(JSON.parse(parameters.variables), null, 2); - } catch (e) { - // Do nothing, we want to display the invalid JSON as a string, rather - // than present an error. - } - } - // When the query and variables string is edited, update the URL bar so - // that it can be easily shared - function onEditQuery(newQuery) { - parameters.query = newQuery; - updateURL(); - } - function onEditVariables(newVariables) { - parameters.variables = newVariables; - updateURL(); - } - function updateURL() { - var newSearch = '?' + Object.keys(parameters).map(function (key) { - return encodeURIComponent(key) + '=' + - encodeURIComponent(parameters[key]); - }).join('&'); - history.replaceState(null, null, newSearch); - } - <% end %> - - // Defines a GraphQL fetcher using the fetch API. - var graphQLEndpoint = "<%= graphql_endpoint_path %>"; - function graphQLFetcher(graphQLParams) { - return fetch(graphQLEndpoint, { - method: 'post', - headers: <%= raw JSON.pretty_generate(GraphiQL::Rails.config.resolve_headers(self)) %>, - body: JSON.stringify(graphQLParams), - credentials: 'include', - }).then(function(response) { - return response.text(); - }).then(function(text) { - try { - return JSON.parse(text); - } catch(error) { - return { - "message": "The server responded with invalid JSON, this is probably a server-side error", - "response": text, - }; - } - }) - } - - <% if GraphiQL::Rails.config.initial_query %> - var defaultQuery = "<%= GraphiQL::Rails.config.initial_query.gsub("\n", '\n').gsub('"', '\"').html_safe %>"; - <% else %> - var defaultQuery = undefined - <% end %> - - // Render <GraphiQL /> into the body. - ReactDOM.render( - React.createElement(GraphiQL, { - fetcher: graphQLFetcher, - defaultQuery: defaultQuery, - <% if GraphiQL::Rails.config.query_params %> - query: parameters.query, - variables: parameters.variables, - onEditQuery: onEditQuery, - onEditVariables: onEditVariables - <% end %> - }), - document.getElementById("graphiql-container") - ); - <% end -%> - </body> -</html> diff --git a/app/views/groups/_home_panel.html.haml b/app/views/groups/_home_panel.html.haml index e530d9c60b6..e5d67831c71 100644 --- a/app/views/groups/_home_panel.html.haml +++ b/app/views/groups/_home_panel.html.haml @@ -9,17 +9,18 @@ = group_icon(@group, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'logo') .d-flex.flex-column.flex-wrap.align-items-baseline .d-inline-flex.align-items-baseline - %h1.home-panel-title.gl-mt-3.gl-mb-2.gl-ml-3{ itemprop: 'name' } + %h1.home-panel-title.gl-mt-3.gl-mb-2{ itemprop: 'name' } = @group.name %span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) } = visibility_level_icon(@group.visibility_level, options: {class: 'icon'}) - .home-panel-metadata.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal + .home-panel-metadata.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { qa_selector: 'group_id_content' }, itemprop: 'identifier' } - if can?(current_user, :read_group, @group) - - button_class = "btn gl-button btn-sm btn-tertiary btn-default-tertiary home-panel-metadata" - - button_text = s_('GroupPage|Group ID: %{group_id}') % { group_id: @group.id } - = clipboard_button(title: s_('GroupPage|Copy group ID'), text: @group.id, hide_button_icon: true, button_text: button_text, class: button_class, qa_selector: 'group_id_content', itemprop: 'identifier') + %span.gl-display-inline-block.gl-vertical-align-middle + = s_("GroupPage|Group ID: %{group_id}") % { group_id: @group.id } + - button_class = "btn gl-button btn-sm btn-tertiary btn-default-tertiary home-panel-metadata" + = clipboard_button(title: s_('GroupPage|Copy group ID'), text: @group.id, class: button_class) - if current_user - %span.gl-ml-3 + %span.gl-ml-3.gl-mb-3 = render 'shared/members/access_request_links', source: @group .home-panel-buttons.col-md-12.col-lg-6 diff --git a/app/views/groups/_new_group_fields.html.haml b/app/views/groups/_new_group_fields.html.haml index 8ee7c91a938..fe2ee62d9be 100644 --- a/app/views/groups/_new_group_fields.html.haml +++ b/app/views/groups/_new_group_fields.html.haml @@ -7,14 +7,15 @@ = _('Visibility level') %p = _('Who will be able to see this group?') - = link_to _('View the documentation'), help_page_path("public_access/public_access"), target: '_blank' + = link_to _('View the documentation'), help_page_path("public_access/public_access"), target: '_blank', rel: 'noopener noreferrer' = render 'shared/visibility_level', f: f, visibility_level: default_group_visibility, can_change_visibility_level: true, form_model: @group, with_label: false - if Gitlab.config.mattermost.enabled .row = render 'create_chat_team', f: f -= render 'personalize', f: f +- unless Gitlab::CurrentSettings.current_application_settings.hide_third_party_offers? + = render 'personalize', f: f .row.js-invite-members-section .col-sm-4 diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 420771257c9..f3494149087 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -20,11 +20,11 @@ %section.settings.gs-permissions.no-animate#js-permissions-settings{ class: ('expanded' if expanded), data: { qa_selector: 'permission_lfs_2fa_content' } } .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only{ role: 'button' } - = _('Permissions, LFS, 2FA') + = _('Permissions and group features') %button.btn.gl-button.js-settings-toggle{ type: 'button' } = expanded ? _('Collapse') : _('Expand') %p - = _('Configure advanced permissions, Large File Storage, and two-factor authentication settings.') + = _('Configure advanced permissions, Large File Storage, two-factor authentication, and customer relations settings.') .settings-content = render 'groups/settings/permissions' @@ -60,4 +60,3 @@ = render_if_exists 'shared/groups/max_pages_size_setting' -= render 'shared/confirm_modal', phrase: @group.path diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 0c6776a6038..a9258a4e0d0 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -18,21 +18,11 @@ - if @can_bulk_update = render_if_exists 'shared/issuable/bulk_update_button', type: :issues - = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues, with_feature_enabled: 'issues', with_shared: false, include_projects_in_subgroups: true + = render 'shared/new_project_item_select', path: 'issues/new', label: _("issue"), type: :issues, with_feature_enabled: 'issues', with_shared: false, include_projects_in_subgroups: true = render 'shared/issuable/search_bar', type: :issues - if @can_bulk_update = render_if_exists 'shared/issuable/group_bulk_update_sidebar', group: @group, type: :issues - - if Feature.enabled?(:vue_issuables_list, @group) && @issues.to_a.any? - - if use_startup_call? - - add_page_startup_api_call(api_v4_groups_issues_path(id: @group.id, params: startup_call_params)) - .js-issuables-list{ data: { endpoint: expose_url(api_v4_groups_issues_path(id: @group.id)), - 'can-bulk-edit': @can_bulk_update.to_json, - 'empty-state-meta': { svg_path: image_path('illustrations/issues.svg') }, - 'sort-key': @sort, - type: 'issues', - 'scoped-labels-available': scoped_labels_available?(@group).to_json } } - - else - = render 'shared/issues', project_select_button: true + = render 'shared/issues', project_select_button: true diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index ad916e3aeec..011c76e5ae7 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -12,7 +12,7 @@ - if @can_bulk_update = render_if_exists 'shared/issuable/bulk_update_button', type: :merge_requests - = render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", type: :merge_requests, with_feature_enabled: 'merge_requests', with_shared: false, include_projects_in_subgroups: true + = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _("merge request"), type: :merge_requests, with_feature_enabled: 'merge_requests', with_shared: false, include_projects_in_subgroups: true = render 'shared/issuable/search_bar', type: :merge_requests diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index e55af71022e..750030601b7 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -6,7 +6,7 @@ .group-edit-container.gl-mt-5 - .js-new-group-creation{ data: { has_errors: @group.errors.any?.to_s } } + .js-new-group-creation{ data: { has_errors: @group.errors.any?.to_s }.merge(verification_for_group_creation_data) } .row{ 'v-cloak': true } #create-group-pane.tab-pane diff --git a/app/views/groups/packages/index.html.haml b/app/views/groups/packages/index.html.haml index d56a806f082..1c0627779ec 100644 --- a/app/views/groups/packages/index.html.haml +++ b/app/views/groups/packages/index.html.haml @@ -7,4 +7,7 @@ full_path: @group.full_path, endpoint: group_packages_path(@group), page_type: 'groups', - empty_list_illustration: image_path('illustrations/no-packages.svg'), } } + empty_list_illustration: image_path('illustrations/no-packages.svg'), + npm_instance_url: package_registry_instance_url(:npm), + project_list_url: '', + group_list_url: group_packages_path(@group) } } diff --git a/app/views/groups/runners/_group_runners.html.haml b/app/views/groups/runners/_group_runners.html.haml index e7cfc87ac88..876642474cd 100644 --- a/app/views/groups/runners/_group_runners.html.haml +++ b/app/views/groups/runners/_group_runners.html.haml @@ -25,5 +25,5 @@ %br - else = _('Please contact an admin to register runners.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'runner-registration'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'prevent-users-from-registering-runners'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/groups/runners/_runner.html.haml b/app/views/groups/runners/_runner.html.haml index a76701ea5d2..78ce5b3e110 100644 --- a/app/views/groups/runners/_runner.html.haml +++ b/app/views/groups/runners/_runner.html.haml @@ -3,17 +3,13 @@ .table-mobile-header{ role: 'rowheader' }= _('Type') .table-mobile-content - if runner.group_type? - %span.badge.badge-pill.gl-badge.sm.badge-success - = s_('Runners|group') + = gl_badge_tag s_('Runners|group'), variant: :success, size: :sm - else - %span.badge.badge-pill.gl-badge.sm.badge-info - = s_('Runners|specific') + = gl_badge_tag s_('Runners|specific'), variant: :info, size: :sm - if runner.locked? - %span.badge.badge-pill.gl-badge.sm.badge-warning - = s_('Runners|locked') + = gl_badge_tag s_('Runners|locked'), variant: :warning, size: :sm - unless runner.active? - %span.badge.badge-pill.gl-badge.sm.badge-danger - = s_('Runners|paused') + = gl_badge_tag s_('Runners|paused'), variant: :danger, size: :sm .table-section.section-30 .table-mobile-header{ role: 'rowheader' }= s_('Runners|Runner') @@ -50,8 +46,7 @@ .table-mobile-header{ role: 'rowheader' }= _('Tags') .table-mobile-content - runner.tags.map(&:name).sort.each do |tag| - %span.badge.badge-primary.str-truncated.has-tooltip{ title: tag } - = tag + = gl_badge_tag tag, { variant: :info }, { class: 'str-truncated has-tooltip', title: tag } .table-section.section-10 .table-mobile-header{ role: 'rowheader' }= _('Last contact') @@ -81,5 +76,5 @@ = sprite_icon('close', css_class: 'gl-icon') - else .btn-group - = link_to group_runner_path(@group, runner), method: :delete, class: 'gl-button btn btn-danger btn-icon has-tooltip', title: _('Remove'), ref: 'tooltip', aria: { label: _('Remove') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?') } do + = link_to group_runner_path(@group, runner), method: :delete, class: 'gl-button btn btn-danger btn-icon has-tooltip', title: _('Remove'), ref: 'tooltip', aria: { label: _('Remove') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?'), confirm_btn_variant: "danger" } do = sprite_icon('close', css_class: 'gl-icon') diff --git a/app/views/groups/settings/_ip_restriction_registration_features_cta.html.haml b/app/views/groups/settings/_ip_restriction_registration_features_cta.html.haml new file mode 100644 index 00000000000..3067220ea8f --- /dev/null +++ b/app/views/groups/settings/_ip_restriction_registration_features_cta.html.haml @@ -0,0 +1,8 @@ +- return unless registration_features_can_be_prompted? + +.form-group + = f.label :disabled_ip_restriction_ranges, class: 'label-bold' do + = _('Allow access to the following IP addresses') + = f.text_field :disabled_ip_restriction_ranges, value: '', class: 'form-control', disabled: true + %span.form-text.text-muted + = render 'shared/registration_features_discovery_message' diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml index eb38aa43881..d4b74665398 100644 --- a/app/views/groups/settings/_permissions.html.haml +++ b/app/views/groups/settings/_permissions.html.haml @@ -29,8 +29,9 @@ checkbox_options: { checked: @group.mentions_disabled? }, help_text: s_('GroupSettings|Prevents group members from being notified if the group is mentioned.') - = render 'groups/settings/project_access_token_creation', f: f, group: @group + = render 'groups/settings/resource_access_token_creation', f: f, group: @group = render_if_exists 'groups/settings/delayed_project_removal', f: f, group: @group + = render 'groups/settings/ip_restriction_registration_features_cta', f: f = render_if_exists 'groups/settings/ip_restriction', f: f, group: @group = render_if_exists 'groups/settings/allowed_email_domain', f: f, group: @group = render 'groups/settings/lfs', f: f @@ -41,4 +42,13 @@ = render 'groups/settings/two_factor_auth', f: f, group: @group = render_if_exists 'groups/personal_access_token_expiration_policy', f: f, group: @group = render 'groups/settings/membership', f: f, group: @group + + - if crm_feature_flag_enabled?(@group) + %h5= _('Customer relations') + .form-group.gl-mb-3 + = f.gitlab_ui_checkbox_component :crm_enabled, + s_('GroupSettings|Enable customer relations'), + checkbox_options: { checked: @group.crm_enabled? }, + help_text: s_('GroupSettings|Allows creating organizations and contacts and associating them with issues.') + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm gl-mt-3 js-dirty-submit', data: { qa_selector: 'save_permissions_changes_button' } diff --git a/app/views/groups/settings/_project_access_token_creation.html.haml b/app/views/groups/settings/_project_access_token_creation.html.haml deleted file mode 100644 index 948b25390ba..00000000000 --- a/app/views/groups/settings/_project_access_token_creation.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- return unless render_setting_to_allow_project_access_token_creation?(group) - -.form-group.gl-mb-3 - - project_access_tokens_link = help_page_path('user/project/settings/project_access_tokens') - - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: project_access_tokens_link } - = f.gitlab_ui_checkbox_component :resource_access_token_creation_allowed, - s_('GroupSettings|Allow project access token creation'), - checkbox_options: { checked: group.namespace_settings.resource_access_token_creation_allowed?, data: { qa_selector: 'resource_access_token_creation_allowed_checkbox' } }, - help_text: s_('GroupSettings|Users can create %{link_start}project access tokens%{link_end} for projects in this group.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } diff --git a/app/views/groups/settings/_resource_access_token_creation.html.haml b/app/views/groups/settings/_resource_access_token_creation.html.haml new file mode 100644 index 00000000000..160f8ae1e07 --- /dev/null +++ b/app/views/groups/settings/_resource_access_token_creation.html.haml @@ -0,0 +1,11 @@ +- return unless render_setting_to_allow_project_access_token_creation?(group) + +.form-group.gl-mb-3 + - project_access_tokens_link = help_page_path('user/project/settings/project_access_tokens') + - group_access_tokens_link = help_page_path('user/group/settings/group_access_tokens') + - link_start_project = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: project_access_tokens_link } + - link_start_group = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_access_tokens_link } + = f.gitlab_ui_checkbox_component :resource_access_token_creation_allowed, + s_('GroupSettings|Allow project and group access token creation'), + checkbox_options: { checked: group.namespace_settings.resource_access_token_creation_allowed?, data: { qa_selector: 'resource_access_token_creation_allowed_checkbox' } }, + help_text: s_('GroupSettings|Users can create %{link_start_project}project access tokens%{link_end} and %{link_start_group}group access tokens%{link_end} in this group.').html_safe % { link_start_project: link_start_project, link_start_group: link_start_group, link_end: '</a>'.html_safe } diff --git a/app/views/groups/settings/access_tokens/index.html.haml b/app/views/groups/settings/access_tokens/index.html.haml new file mode 100644 index 00000000000..16ea96f0b08 --- /dev/null +++ b/app/views/groups/settings/access_tokens/index.html.haml @@ -0,0 +1,50 @@ +- breadcrumb_title s_('AccessTokens|Access Tokens') +- page_title _('Group Access Tokens') +- type = _('group access token') +- type_plural = _('group access tokens') +- @content_class = 'limit-container-width' unless fluid_layout + +.row.gl-mt-3 + .col-lg-4 + %h4.gl-mt-0 + = page_title + %p + - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/group/settings/group_access_tokens') } + - if current_user.can?(:create_resource_access_tokens, @group) + = _('Generate group access tokens scoped to this group for your applications that need access to the GitLab API.') + %p + = _('You can also use group access tokens with Git to authenticate over HTTP(S). %{link_start}Learn more.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + - else + = _('Group access token creation is disabled in this group. You can still use and manage existing tokens. %{link_start}Learn more.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + %p + - root_group = @group.root_ancestor + - if current_user.can?(:admin_group, root_group) + - group_settings_link = edit_group_path(root_group) + - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_settings_link } + = _('You can enable group access token creation in %{link_start}group settings%{link_end}.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + + .col-lg-8 + - if @new_resource_access_token + = render 'shared/access_tokens/created_container', + type: type, + new_token_value: @new_resource_access_token + + - if current_user.can?(:create_resource_access_tokens, @group) + = render 'shared/access_tokens/form', + type: type, + path: group_settings_access_tokens_path(@group), + resource: @group, + token: @resource_access_token, + scopes: @scopes, + access_levels: GroupMember.access_level_roles, + default_access_level: Gitlab::Access::MAINTAINER, + prefix: :resource_access_token, + help_path: help_page_path('user/group/settings/group_access_tokens', anchor: 'scopes-for-a-group-access-token') + + = render 'shared/access_tokens/table', + active_tokens: @active_resource_access_tokens, + resource: @group, + type: type, + type_plural: type_plural, + revoke_route_helper: ->(token) { revoke_group_settings_access_token_path(id: token) }, + no_active_tokens_message: _('This group has no active access tokens.') diff --git a/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml b/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml index 32da444d058..12c0f15aff5 100644 --- a/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml +++ b/app/views/groups/settings/ci_cd/_auto_devops_form.html.haml @@ -11,5 +11,6 @@ = gl_badge_tag badge_for_auto_devops_scope(group), variant: :info .form-text.text-muted = s_('GroupSettings|The Auto DevOps pipeline runs if no alternative CI configuration file is found.') - = link_to _('Learn more.'), help_page_path('topics/autodevops/index.md'), target: '_blank' + = link_to _('Learn more.'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer' + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm gl-mt-5' diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index f81afd0a82e..3992cb527ed 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -4,12 +4,15 @@ = markdown_field(Gitlab::CurrentSettings.current_application_settings, :help_page_text) %hr -%h1 - = default_brand_title - - if user_signed_in? - %span= link_to_version - = version_status_badge - %hr +.gl-display-flex.gl-align-items-flex-end + %h1.gl-mt-5.gl-mb-3 + = default_brand_title + - if user_signed_in? + %span= link_to_version + - if show_version_check? + %span.gl-mt-5.gl-mb-3.gl-ml-3 + .js-gitlab-version-check{ data: { "size": "lg" } } +%hr - unless Gitlab::CurrentSettings.help_page_hide_commercial_content? %p.slead diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml index 509f5be8097..46d84d9f883 100644 --- a/app/views/layouts/_init_auto_complete.html.haml +++ b/app/views/layouts/_init_auto_complete.html.haml @@ -1,5 +1,5 @@ - object = @target_project || @project || @group -- noteable_type = @noteable.class if @noteable.present? +- noteable_type = @noteable_type || @noteable&.class - datasources = autocomplete_data_sources(object, noteable_type) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 69b8518ef33..d0a06c7d5bf 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -19,8 +19,18 @@ %span.gl-badge.gl-bg-green-500.gl-text-white.gl-rounded-pill.gl-font-weight-bold.gl-py-1 = _('Next') - .gl-display-none.gl-sm-display-block - = render "layouts/nav/top_nav" + - if current_user + .gl-display-none.gl-sm-display-block + = render "layouts/nav/top_nav" + - else + - experiment(:logged_out_marketing_header, actor: nil) do |e| + - e.candidate do + = render 'layouts/header/marketing_links' + - e.try(:trial_focused) do + = render 'layouts/header/marketing_links' + - e.control do + .gl-display-none.gl-sm-display-block + = render "layouts/nav/top_nav" .navbar-collapse.collapse %ul.nav.navbar-nav @@ -38,7 +48,7 @@ 'autocomplete-path' => search_autocomplete_path } } .gl-search-box-by-type = sprite_icon('search', css_class: 'gl-search-box-by-type-search-icon gl-icon') - %input{ type: "text", placeholder: _('Search or jump to...'), class: 'form-control gl-form-input gl-search-box-by-type-input', id: 'search', autocomplete: 'off' } + %input{ type: "text", placeholder: s_('GlobalSearch|Search GitLab'), class: 'form-control gl-form-input gl-search-box-by-type-input', id: 'search', autocomplete: 'off' } - else = render 'layouts/search' %li.nav-item{ class: 'd-none d-sm-inline-block d-lg-none' } @@ -104,6 +114,15 @@ = sprite_icon('chevron-down', css_class: 'caret-down') .dropdown-menu.dropdown-menu-right = render 'layouts/header/help_dropdown' + - unless current_user + - experiment(:logged_out_marketing_header, actor: nil) do |e| + - e.candidate do + %li.nav-item.gl-display-none.gl-sm-display-block + = render "layouts/nav/top_nav" + - e.try(:trial_focused) do + %li.nav-item.gl-display-none.gl-sm-display-block + = render "layouts/nav/top_nav" + - e.control {} - if header_link?(:user_dropdown) %li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_action: "click_dropdown", track_value: "", qa_selector: 'user_menu' }, class: ('mr-0' if has_impersonation_link) } = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do @@ -117,10 +136,23 @@ = link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: _('Stop impersonation'), aria: { label: _('Stop impersonation') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body', qa_selector: 'stop_impersonation_link' } do = sprite_icon('incognito', size: 18) - if header_link?(:sign_in) - %li.nav-item - %div - - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in') - = link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'gl-button btn btn-default btn-sign-in' + - experiment(:logged_out_marketing_header, actor: nil) do |e| + - e.candidate do + %li.nav-item.gl-display-none.gl-sm-display-block + = link_to _('Sign up now'), new_user_registration_path, class: 'gl-button btn btn-default btn-sign-in' + %li.nav-item.gl-display-none.gl-sm-display-block + = link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes') + = render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none' + - e.try(:trial_focused) do + %li.nav-item.gl-display-none.gl-sm-display-block + = link_to _('Get a free trial'), 'https://about.gitlab.com/free-trial/', class: 'gl-button btn btn-default btn-sign-in' + %li.nav-item.gl-display-none.gl-sm-display-block + = link_to _('Sign up'), new_user_registration_path + %li.nav-item.gl-display-none.gl-sm-display-block + = link_to _('Login'), new_session_path(:user, redirect_to_referer: 'yes') + = render 'layouts/header/sign_in_register_button', class: 'gl-sm-display-none' + - e.control do + = render 'layouts/header/sign_in_register_button' %button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: 'gl-border-none!', data: { testid: 'top-nav-responsive-toggle', qa_selector: 'mobile_navbar_button' } } %span.sr-only= _('Toggle navigation') diff --git a/app/views/layouts/header/_gitlab_version.html.haml b/app/views/layouts/header/_gitlab_version.html.haml new file mode 100644 index 00000000000..125fbaa084c --- /dev/null +++ b/app/views/layouts/header/_gitlab_version.html.haml @@ -0,0 +1,11 @@ +- return unless show_version_check? + +.gl-display-flex.gl-flex-direction-column.gl-px-4.gl-py-3 + %span + = s_("VersionCheck|Your GitLab Version") + = emoji_icon('rocket') + %span + %span.gl-font-sm.gl-text-gray-500 + #{Gitlab.version_info.major}.#{Gitlab.version_info.minor} + %span.gl-ml-2 + .js-gitlab-version-check{ data: { "size": "sm" } } diff --git a/app/views/layouts/header/_help_dropdown.html.haml b/app/views/layouts/header/_help_dropdown.html.haml index e2c7781da54..738bca2f2cc 100644 --- a/app/views/layouts/header/_help_dropdown.html.haml +++ b/app/views/layouts/header/_help_dropdown.html.haml @@ -1,5 +1,6 @@ %ul - if current_user_menu?(:help) + = render 'layouts/header/gitlab_version' = render 'layouts/header/whats_new_dropdown_item' %li = link_to _("Help"), help_path diff --git a/app/views/layouts/header/_marketing_links.html.haml b/app/views/layouts/header/_marketing_links.html.haml new file mode 100644 index 00000000000..24069de394d --- /dev/null +++ b/app/views/layouts/header/_marketing_links.html.haml @@ -0,0 +1,34 @@ +%ul.nav.navbar-sub-nav.gl-display-none.gl-lg-display-flex.gl-align-items-center + %li.dropdown.gl-mr-3 + %button{ type: "button", data: { toggle: "dropdown" } } + = s_('LoggedOutMarketingHeader|About GitLab') + = sprite_icon('chevron-down', css_class: 'caret-down') + .dropdown-menu + %ul + %li + = link_to 'https://about.gitlab.com/stages-devops-lifecycle/' do + = s_('LoggedOutMarketingHeader|GitLab: the DevOps platform') + %li + = link_to explore_root_path do + = s_('LoggedOutMarketingHeader|Explore GitLab') + %li + = link_to 'https://about.gitlab.com/install/' do + = s_('LoggedOutMarketingHeader|Install GitLab') + %li + = link_to 'https://about.gitlab.com/is-it-any-good/' do + = s_('LoggedOutMarketingHeader|How GitLab compares') + %li + = link_to 'https://about.gitlab.com/get-started/' do + = s_('LoggedOutMarketingHeader|Get started') + %li + = link_to 'https://docs.gitlab.com/' do + = s_('LoggedOutMarketingHeader|GitLab docs') + %li + = link_to 'https://about.gitlab.com/learn/' do + = s_('LoggedOutMarketingHeader|GitLab Learn') + %li.gl-mr-3 + = link_to 'https://about.gitlab.com/pricing/' do + = s_('LoggedOutMarketingHeader|Pricing') + %li.gl-mr-3 + = link_to 'https://about.gitlab.com/sales/' do + = s_('LoggedOutMarketingHeader|Talk to an expert') diff --git a/app/views/layouts/header/_sign_in_register_button.html.haml b/app/views/layouts/header/_sign_in_register_button.html.haml new file mode 100644 index 00000000000..992e8785251 --- /dev/null +++ b/app/views/layouts/header/_sign_in_register_button.html.haml @@ -0,0 +1,6 @@ +- top_class = local_assigns.fetch(:class, nil) + +%li.nav-item{ class: top_class } + %div + - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in') + = link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'gl-button btn btn-default btn-sign-in' diff --git a/app/views/notify/_note_email.html.haml b/app/views/notify/_note_email.html.haml index ae9c8554e73..ad0c873bf56 100644 --- a/app/views/notify/_note_email.html.haml +++ b/app/views/notify/_note_email.html.haml @@ -26,12 +26,10 @@ = stylesheet_link_tag 'mailers/highlighted_diff_email' %table - = render partial: "projects/diffs/line", + = render partial: "projects/diffs/email_line", collection: discussion.truncated_diff_lines(diff_limit: diff_limit), as: :line, - locals: { diff_file: discussion.diff_file, - plain: true, - email: true } + locals: { diff_file: discussion.diff_file } %div{ style: note_style } = markdown(note.note, pipeline: :email, author: note.author, current_user: @recipient, issuable_reference_expansion_enabled: true) diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml index 5c5520f4cb8..93806e6de8e 100644 --- a/app/views/notify/repository_push_email.html.haml +++ b/app/views/notify/repository_push_email.html.haml @@ -74,7 +74,7 @@ - blob = diff_file.blob - if blob && blob.readable_text? %table.code.white - = render partial: "projects/diffs/line", collection: diff_file.highlighted_diff_lines, as: :line, locals: { diff_file: diff_file, plain: true, email: true } + = render partial: "projects/diffs/email_line", collection: diff_file.highlighted_diff_lines, as: :line, locals: { diff_file: diff_file } - else No preview for this file type %br diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index 809dc3320ff..97056db6b74 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -55,7 +55,7 @@ %p = s_('Profiles|Changing your username can have unintended side effects.') = succeed '.' do - = link_to s_('Profiles|Learn more'), help_page_path('user/profile/index', anchor: 'change-your-username'), target: '_blank' + = link_to s_('Profiles|Learn more'), help_page_path('user/profile/index', anchor: 'change-your-username'), target: '_blank', rel: 'noopener noreferrer' .col-lg-8 - data = { initial_username: current_user.username, root_url: root_url, action_url: update_username_profile_path(format: :json) } #update-username{ data: data } diff --git a/app/views/profiles/chat_names/_chat_name.html.haml b/app/views/profiles/chat_names/_chat_name.html.haml index 24c25bc1ab2..3206fca6bcd 100644 --- a/app/views/profiles/chat_names/_chat_name.html.haml +++ b/app/views/profiles/chat_names/_chat_name.html.haml @@ -10,7 +10,7 @@ %td %strong - if can?(current_user, :admin_project, project) - = link_to integration.title, edit_project_service_path(project, integration) + = link_to integration.title, edit_project_integration_path(project, integration) - else = integration.title %td diff --git a/app/views/profiles/chat_names/index.html.haml b/app/views/profiles/chat_names/index.html.haml index 782850afcda..54c34228800 100644 --- a/app/views/profiles/chat_names/index.html.haml +++ b/app/views/profiles/chat_names/index.html.haml @@ -9,7 +9,8 @@ = _('You can see your chat accounts.') .col-lg-8 - %h5.gl-mt-0 Active chat names (#{@chat_names.size}) + %h5.gl-mt-0 + = sprintf(_('Active chat names (%{count})'), { count: @chat_names.size }) - if @chat_names.present? .table-responsive diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml index 0cfe65994da..fef55f5d384 100644 --- a/app/views/profiles/emails/index.html.haml +++ b/app/views/profiles/emails/index.html.haml @@ -37,23 +37,23 @@ %li = render partial: 'shared/email_with_badge', locals: { email: @primary_email, verified: current_user.confirmed? } %span.float-right - %span.badge.badge-muted.badge-pill.gl-badge.badge-success= s_('Profiles|Primary email') + = gl_badge_tag s_('Profiles|Primary email'), variant: :success - if @primary_email === current_user.commit_email_or_default - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Commit email') + = gl_badge_tag s_('Profiles|Commit email'), variant: :info - if @primary_email === current_user.public_email - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Public email') + = gl_badge_tag s_('Profiles|Public email'), variant: :info - if @primary_email === current_user.notification_email_or_default - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Default notification email') + = gl_badge_tag s_('Profiles|Default notification email'), variant: :info - @emails.reject(&:user_primary_email?).each do |email| %li{ data: { qa_selector: 'email_row_content' } } = render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? } %span.float-right - if email.email === current_user.commit_email_or_default - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Commit email') + = gl_badge_tag s_('Profiles|Commit email'), variant: :info - if email.email === current_user.public_email - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Public email') + = gl_badge_tag s_('Profiles|Public email'), variant: :info - if email.email === current_user.notification_email_or_default - %span.badge.badge-muted.badge-pill.gl-badge.badge-info= s_('Profiles|Notification email') + = gl_badge_tag s_('Profiles|Notification email'), variant: :info - unless email.confirmed? - confirm_title = "#{email.confirmation_sent_at ? _('Resend confirmation email') : _('Send confirmation email')}" = link_to confirm_title, resend_confirmation_instructions_profile_email_path(email), method: :put, class: 'gl-button btn btn-sm btn-warning gl-ml-3' diff --git a/app/views/profiles/gpg_keys/index.html.haml b/app/views/profiles/gpg_keys/index.html.haml index bf9c77cb3ec..91af6953ee1 100644 --- a/app/views/profiles/gpg_keys/index.html.haml +++ b/app/views/profiles/gpg_keys/index.html.haml @@ -12,7 +12,7 @@ = _('Add a GPG key') %p.profile-settings-content - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/repository/gpg_signed_commits/index.md') } - = _('Before you can add a GPG key you need to %{help_link_start}Generate it.%{help_link_end}'.html_safe) % {help_link_start: help_link_start, help_link_end: '</a>'.html_safe } + = _('Add a GPG key for secure access to GitLab. %{help_link_start}Learn more.%{help_link_end}').html_safe % {help_link_start: help_link_start, help_link_end: '</a>'.html_safe } = render 'form' %hr %h5 diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index 2b3109225a8..bebbe49a485 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -5,8 +5,8 @@ .form-group = f.label :key, s_('Profiles|Key'), class: 'label-bold' - %p= _("Paste your public SSH key, which is usually contained in the file '~/.ssh/id_ed25519.pub' or '~/.ssh/id_rsa.pub' and begins with 'ssh-ed25519' or 'ssh-rsa'. Do not paste your private SSH key, as that can compromise your identity.") - = f.text_area :key, class: "form-control gl-form-input js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, placeholder: s_('Profiles|Typically starts with "ssh-ed25519 …" or "ssh-rsa …"') + = f.text_area :key, class: "form-control gl-form-input js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, data: { supported_algorithms: Gitlab::SSHPublicKey.supported_algorithms } + %p.form-text.text-muted= s_('Profiles|Begins with %{ssh_key_algorithms}.') % { ssh_key_algorithms: ssh_key_allowed_algorithms } .form-row .col.form-group = f.label :title, _('Title'), class: 'label-bold' diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 584bd44e386..7d4c3b6115f 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -11,11 +11,8 @@ %h5.gl-mt-0 = _('Add an SSH key') %p.profile-settings-content - - generate_link_url = help_page_path("ssh/index", anchor: 'generate-an-ssh-key-pair') - - existing_link_url = help_page_path("ssh/index", anchor: 'see-if-you-have-an-existing-ssh-key-pair') - - generate_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: generate_link_url } - - existing_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: existing_link_url } - = _('To add an SSH key you need to %{generate_link_start}generate one%{link_end} or use an %{existing_link_start}existing key%{link_end}.').html_safe % { generate_link_start: generate_link_start, existing_link_start: existing_link_start, link_end: '</a>'.html_safe } + - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('ssh/index.md') } + = _('Add an SSH key for secure access to GitLab. %{help_link_start}Learn more.%{help_link_end}').html_safe % {help_link_start: help_link_start, help_link_end: '</a>'.html_safe } = render 'form' %hr %h5 diff --git a/app/views/profiles/personal_access_tokens/index.html.haml b/app/views/profiles/personal_access_tokens/index.html.haml index a8275576327..887d07f7a20 100644 --- a/app/views/profiles/personal_access_tokens/index.html.haml +++ b/app/views/profiles/personal_access_tokens/index.html.haml @@ -32,64 +32,5 @@ type_plural: type_plural, active_tokens: @active_personal_access_tokens, revoke_route_helper: ->(token) { revoke_profile_personal_access_token_path(token) } -- if Feature.enabled?(:hide_access_tokens, default_enabled: :yaml) - #js-tokens-app{ data: { tokens_data: tokens_app_data } } -- else - - unless Gitlab::CurrentSettings.disable_feed_token - .col-lg-12 - %hr - .row.gl-mt-3.js-search-settings-section - .col-lg-4.profile-settings-sidebar - %h4.gl-mt-0 - = s_('AccessTokens|Feed token') - %p - = s_('AccessTokens|Your feed token authenticates you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar. It is visible in those feed URLs.') - %p - = s_('AccessTokens|It cannot be used to access any other data.') - .col-lg-8.feed-token-reset - = label_tag :feed_token, s_('AccessTokens|Feed token'), class: 'label-bold' - = text_field_tag :feed_token, current_user.feed_token, class: 'form-control gl-form-input js-select-on-focus', readonly: true - %p.form-text.text-muted - - reset_link = link_to s_('AccessTokens|reset this token'), [:reset, :feed_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any RSS or calendar URLs currently in use will stop working.'), testid: :reset_feed_token_link } - - reset_message = s_('AccessTokens|Keep this token secret. Anyone who has it can read activity and issue RSS feeds or your calendar feed as if they were you. If that happens, %{link_reset_it}.') % { link_reset_it: reset_link } - = reset_message.html_safe - - if incoming_email_token_enabled? - .col-lg-12 - %hr - .row.gl-mt-3.js-search-settings-section - .col-lg-4.profile-settings-sidebar - %h4.gl-mt-0 - = s_('AccessTokens|Incoming email token') - %p - = s_('AccessTokens|Your incoming email token authenticates you when you create a new issue by email, and is included in your personal project-specific email addresses.') - %p - = s_('AccessTokens|It cannot be used to access any other data.') - .col-lg-8.incoming-email-token-reset - = label_tag :incoming_email_token, s_('AccessTokens|Incoming email token'), class: 'label-bold' - = text_field_tag :incoming_email_token, current_user.incoming_email_token, class: 'form-control gl-form-input js-select-on-focus', readonly: true - %p.form-text.text-muted - - reset_link = link_to s_('AccessTokens|reset this token'), [:reset, :incoming_email_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any issue email addresses currently in use will stop working.'), testid: :reset_email_token_link } - - reset_message = s_('AccessTokens|Keep this token secret. Anyone who has it can create issues as if they were you. If that happens, %{link_reset_it}.') % { link_reset_it: reset_link } - = reset_message.html_safe - - - if static_objects_external_storage_enabled? - .col-lg-12 - %hr - .row.gl-mt-3.js-search-settings-section - .col-lg-4 - %h4.gl-mt-0 - = s_('AccessTokens|Static object token') - %p - = s_('AccessTokens|Your static object token authenticates you when repository static objects (such as archives or blobs) are served from an external storage.') - %p - = s_('AccessTokens|It cannot be used to access any other data.') - .col-lg-8 - = label_tag :static_object_token, s_('AccessTokens|Static object token'), class: "label-bold" - = text_field_tag :static_object_token, current_user.static_object_token, class: 'form-control gl-form-input', readonly: true, onclick: 'this.select()' - %p.form-text.text-muted - - reset_link = url_for [:reset, :static_object_token, :profile] - - reset_link_start = '<a data-confirm="%{confirm}" rel="nofollow" data-method="put" href="%{url}">'.html_safe % { confirm: s_('AccessTokens|Are you sure?'), url: reset_link } - - reset_link_end = '</a>'.html_safe - - reset_message = s_('AccessTokens|Keep this token secret. Anyone who has it can access repository static objects as if they were you. If that ever happens, %{reset_link_start}reset this token%{reset_link_end}.') % { reset_link_start: reset_link_start, reset_link_end: reset_link_end } - = reset_message.html_safe +#js-tokens-app{ data: { tokens_data: tokens_app_data } } diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index e52a345bd86..48be2001c9c 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -2,7 +2,7 @@ - @content_class = "limit-container-width" unless fluid_layout - user_theme_id = Gitlab::Themes.for_user(@user).id - user_fields = { theme: user_theme_id, gitpod_enabled: @user.gitpod_enabled, sourcegraph_enabled: @user.sourcegraph_enabled }.to_json -- @themes = Gitlab::Themes::THEMES.to_json +- @themes = Gitlab::Themes::available_themes.to_json - data_attributes = { themes: @themes, integration_views: integration_views.to_json, user_fields: user_fields, body_classes: Gitlab::Themes.body_classes, profile_preferences_path: profile_preferences_path } - Gitlab::Themes.each do |theme| @@ -33,7 +33,7 @@ %p = s_('Preferences|This setting allows you to customize the appearance of the syntax.') = succeed '.' do - = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'syntax-highlighting-theme'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'syntax-highlighting-theme'), target: '_blank', rel: 'noopener noreferrer' .col-lg-8.syntax-theme - Gitlab::ColorSchemes.each do |scheme| = label_tag do @@ -51,7 +51,7 @@ %p = s_('Preferences|This setting allows you to customize the behavior of the system layout and default views.') = succeed '.' do - = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'behavior'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'behavior'), target: '_blank', rel: 'noopener noreferrer' .col-lg-8 .form-group = f.label :layout, class: 'label-bold' do @@ -94,8 +94,7 @@ = s_('Preferences|Surround text selection when typing quotes or brackets') .form-text.text-muted - supported_characters = %w(" ' ` \( [ { < * _).map {|char| "<code>#{char}</code>" }.join(', ') - - msg = "Preferences|When you type in a description or comment box, selected text is surrounded by the corresponding character after typing one of the following characters: #{supported_characters}." - = s_(msg).html_safe + = sprintf(s_( "Preferences|When you type in a description or comment box, selected text is surrounded by the corresponding character after typing one of the following characters: %{supported_characters}."), { supported_characters: supported_characters }).html_safe .form-group = f.label :tab_width, s_('Preferences|Tab width'), class: 'label-bold' @@ -116,7 +115,7 @@ %p = _('Customize language and region related settings.') = succeed '.' do - = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'localization'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'localization'), target: '_blank', rel: 'noopener noreferrer' .col-lg-8 .form-group = f.label :preferred_language, class: 'label-bold' do @@ -137,7 +136,7 @@ %p = s_('Preferences|Configure how dates and times display for you.') = succeed '.' do - = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'time-preferences'), target: '_blank' + = link_to _('Learn more'), help_page_path('user/profile/preferences', anchor: 'time-preferences'), target: '_blank', rel: 'noopener noreferrer' .col-lg-8 .form-group.form-check = f.check_box :time_display_relative, class: 'form-check-input' diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index f3993ad8c33..531e72b7cc2 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -97,19 +97,19 @@ = render 'profiles/name', form: f, user: @user = f.text_field :id, class: 'gl-form-input', readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' } - = f.text_field :pronouns, class: 'input-md gl-form-input', help: s_("Profiles|Enter your pronouns to let people know how to refer to you") - = f.text_field :pronunciation, class: 'input-md gl-form-input', help: s_("Profiles|Enter how your name is pronounced to help people address you correctly") + = f.text_field :pronouns, label: s_('Profiles|Pronouns'), class: 'input-md gl-form-input', help: s_("Profiles|Enter your pronouns to let people know how to refer to you") + = f.text_field :pronunciation, label: s_('Profiles|Pronunciation'), class: 'input-md gl-form-input', help: s_("Profiles|Enter how your name is pronounced to help people address you correctly") = render_if_exists 'profiles/extra_settings', form: f = render_if_exists 'profiles/email_settings', form: f = f.text_field :skype, class: 'input-md gl-form-input', placeholder: s_("Profiles|username") = f.text_field :linkedin, class: 'input-md gl-form-input', help: s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename") = f.text_field :twitter, class: 'input-md gl-form-input', placeholder: s_("Profiles|@username") - = f.text_field :website_url, class: 'input-lg gl-form-input', placeholder: s_("Profiles|https://website.com") + = f.text_field :website_url, label: s_('Profiles|Website url'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|https://website.com") - if @user.read_only_attribute?(:location) = f.text_field :location, class: 'gl-form-input', readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) } - else = f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|City, country") - = f.text_field :job_title, class: 'input-md gl-form-input' + = f.text_field :job_title, label: s_('Profiles|Job title'), class: 'input-md gl-form-input' = f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md gl-form-input', help: s_("Profiles|Who you represent or work for") = f.text_area :bio, class: 'gl-form-input', label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters") %hr @@ -142,10 +142,10 @@ %img.modal-profile-crop-image{ alt: s_("Profiles|Avatar cropper") } .crop-controls .btn-group - %button.btn.gl-button.btn-confirm{ data: { method: 'zoom', option: '-0.1' } } + %button.btn.gl-button.btn-default{ data: { method: 'zoom', option: '-0.1' } } %span = sprite_icon('search-minus') - %button.btn.gl-button.btn-confirm{ data: { method: 'zoom', option: '0.1' } } + %button.btn.gl-button.btn-default{ data: { method: 'zoom', option: '0.1' } } %span = sprite_icon('search-plus') .modal-footer diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 1f2c16324fb..7e8daea5651 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -10,18 +10,19 @@ = project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'image') .d-flex.flex-column.flex-wrap.align-items-baseline .d-inline-flex.align-items-baseline - %h1.home-panel-title.gl-mt-3.gl-mb-2.gl-font-size-h1.gl-line-height-24.gl-font-weight-bold.gl-ml-3{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' } + %h1.home-panel-title.gl-mt-3.gl-mb-2.gl-font-size-h1.gl-line-height-24.gl-font-weight-bold{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' } = @project.name %span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@project) } = visibility_level_icon(@project.visibility_level, options: { class: 'icon' }) = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project - .home-panel-metadata.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal + .home-panel-metadata.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { qa_selector: 'project_id_content' }, itemprop: 'identifier' } - if can?(current_user, :read_project, @project) - - button_class = "btn gl-button btn-sm btn-tertiary btn-default-tertiary home-panel-metadata" - - button_text = s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id } - = clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id, hide_button_icon: true, button_text: button_text, class: button_class, qa_selector: 'project_id_content', itemprop: 'identifier') + %span.gl-display-inline-block.gl-vertical-align-middle + = s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id } + - button_class = "btn gl-button btn-sm btn-tertiary btn-default-tertiary home-panel-metadata" + = clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id, class: button_class) - if current_user - %span.gl-display-inline-block.gl-vertical-align-middle.gl-ml-3 + %span.gl-ml-3.gl-mb-3 = render 'shared/members/access_request_links', source: @project .gl-mt-3.gl-pl-3.gl-w-full diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 81d9726fcdc..63f09a065df 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -8,22 +8,22 @@ .import-buttons - if gitlab_project_import_enabled? .import_gitlab_project.has-tooltip{ data: { container: 'body', qa_selector: 'gitlab_import_button' } } - = link_to new_import_gitlab_project_path, class: 'gl-button btn-default btn btn_import_gitlab_project', **tracking_attrs(track_label, 'click_button', 'gitlab_export') do + = link_to new_import_gitlab_project_path, class: 'gl-button btn-default btn btn_import_gitlab_project js-import-project-btn', data: { platform: 'gitlab_export', **tracking_attrs_data(track_label, 'click_button', 'gitlab_export') } do .gl-button-icon = sprite_icon('tanuki') = _("GitLab export") - if github_import_enabled? %div - = link_to new_import_github_path, class: 'gl-button btn-default btn js-import-github', **tracking_attrs(track_label, 'click_button', 'github') do + = link_to new_import_github_path, class: 'gl-button btn-default btn js-import-github js-import-project-btn', data: { platform: 'github', **tracking_attrs_data(track_label, 'click_button', 'github') } do .gl-button-icon = sprite_icon('github') GitHub - if bitbucket_import_enabled? %div - = link_to status_import_bitbucket_path, class: "gl-button btn-default btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}", - **tracking_attrs(track_label, 'click_button', 'bitbucket_cloud') do + = link_to status_import_bitbucket_path, class: "gl-button btn-default btn import_bitbucket js-import-project-btn #{'how_to_import_link' unless bitbucket_import_configured?}", + data: { platform: 'bitbucket_cloud', **tracking_attrs_data(track_label, 'click_button', 'bitbucket_cloud') } do .gl-button-icon = sprite_icon('bitbucket') Bitbucket Cloud @@ -31,15 +31,14 @@ = render 'projects/bitbucket_import_modal' - if bitbucket_server_import_enabled? %div - = link_to status_import_bitbucket_server_path, class: "gl-button btn-default btn import_bitbucket", **tracking_attrs(track_label, 'click_button', 'bitbucket_server') do + = link_to status_import_bitbucket_server_path, class: "gl-button btn-default btn import_bitbucket js-import-project-btn", data: { platform: 'bitbucket_server', **tracking_attrs_data(track_label, 'click_button', 'bitbucket_server') } do .gl-button-icon = sprite_icon('bitbucket') Bitbucket Server %div - if gitlab_import_enabled? %div - = link_to status_import_gitlab_path, class: "gl-button btn-default btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}", - **tracking_attrs(track_label, 'click_button', 'gitlab_com') do + = link_to status_import_gitlab_path, class: "gl-button btn-default btn import_gitlab js-import-project-btn #{'how_to_import_link' unless gitlab_import_configured?}", data: { platform: 'gitlab_com', **tracking_attrs_data(track_label, 'click_button', 'gitlab_com') } do .gl-button-icon = sprite_icon('tanuki') = _("GitLab.com") @@ -48,35 +47,35 @@ - if fogbugz_import_enabled? %div - = link_to new_import_fogbugz_path, class: 'gl-button btn-default btn import_fogbugz', **tracking_attrs(track_label, 'click_button', 'fogbugz') do + = link_to new_import_fogbugz_path, class: 'gl-button btn-default btn import_fogbugz js-import-project-btn', data: { platform: 'fogbugz', **tracking_attrs_data(track_label, 'click_button', 'fogbugz') } do .gl-button-icon = sprite_icon('bug') FogBugz - if gitea_import_enabled? %div - = link_to new_import_gitea_path, class: 'gl-button btn-default btn import_gitea', **tracking_attrs(track_label, 'click_button', 'gitea') do + = link_to new_import_gitea_path, class: 'gl-button btn-default btn import_gitea js-import-project-btn', data: { platform: 'gitea', **tracking_attrs_data(track_label, 'click_button', 'gitea') } do .gl-button-icon = custom_icon('gitea_logo') Gitea - if git_import_enabled? %div - %button.gl-button.btn-default.btn.btn-svg.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' }, **tracking_attrs(track_label, 'click_button', 'repo_url') } + %button.gl-button.btn-default.btn.btn-svg.js-toggle-button.js-import-git-toggle-button.js-import-project-btn{ type: "button", data: { platform: 'repo_url', toggle_open_class: 'active', **tracking_attrs_data(track_label, 'click_button', 'repo_url') } } .gl-button-icon = sprite_icon('link', css_class: 'gl-icon') = _('Repo by URL') - if manifest_import_enabled? %div - = link_to new_import_manifest_path, class: 'gl-button btn-default btn import_manifest', **tracking_attrs(track_label, 'click_button', 'manifest_file') do + = link_to new_import_manifest_path, class: 'gl-button btn-default btn import_manifest js-import-project-btn', data: { platform: 'manifest_file', **tracking_attrs_data(track_label, 'click_button', 'manifest_file') } do .gl-button-icon = sprite_icon('doc-text') Manifest file - if phabricator_import_enabled? %div - = link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "phabricator" } do + = link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator js-import-project-btn', data: { platform: 'phabricator', track_label: "#{track_label}", track_action: "click_button", track_property: "phabricator" } do .gl-button-icon = custom_icon('issues') = _("Phabricator Tasks") diff --git a/app/views/projects/_merge_request_merge_checks_settings.html.haml b/app/views/projects/_merge_request_merge_checks_settings.html.haml index fbc58283cbf..6b25c5ddaef 100644 --- a/app/views/projects/_merge_request_merge_checks_settings.html.haml +++ b/app/views/projects/_merge_request_merge_checks_settings.html.haml @@ -8,7 +8,7 @@ = form.label :only_allow_merge_if_pipeline_succeeds, class: 'form-check-label' do = s_('ProjectSettings|Pipelines must succeed') .text-secondary - - configuring_pipelines_for_merge_requests_help_link_url = help_page_path('ci/pipelines/merge_request_pipelines.md', anchor: 'configure-pipelines-for-merge-requests') + - configuring_pipelines_for_merge_requests_help_link_url = help_page_path('ci/pipelines/merge_request_pipelines.md', anchor: 'prerequisites') - configuring_pipelines_for_merge_requests_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configuring_pipelines_for_merge_requests_help_link_url } = s_('ProjectSettings|To enable this feature, configure pipelines. %{link_start}How to configure pipelines for merge requests?%{link_end}').html_safe % { link_start: configuring_pipelines_for_merge_requests_help_link_start, link_end: '</a>'.html_safe } .form-check.mb-2 diff --git a/app/views/projects/_merge_request_merge_commit_template.html.haml b/app/views/projects/_merge_request_merge_commit_template.html.haml index 869d2d5d9ec..1c023ae6ceb 100644 --- a/app/views/projects/_merge_request_merge_commit_template.html.haml +++ b/app/views/projects/_merge_request_merge_commit_template.html.haml @@ -3,15 +3,12 @@ .form-group %b= s_('ProjectSettings|Merge commit message template') %p.text-secondary - - configure_the_merge_commit_message_help_link_url = help_page_path('user/project/merge_requests/commit_templates.md') - - configure_the_merge_commit_message_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_merge_commit_message_help_link_url } - = s_('ProjectSettings|The commit message used when merging, if the merge method creates a merge commit. %{link_start}Learn more about syntax and variables.%{link_end}').html_safe % { link_start: configure_the_merge_commit_message_help_link_start, link_end: '</a>'.html_safe } + = s_('ProjectSettings|The commit message used when merging, if the merge method creates a merge commit.') .mb-2 - default_merge_commit_template = "Merge branch '%{source_branch}' into '%{target_branch}'\n\n%{title}\n\n%{issues}\n\nSee merge request %{reference}" = form.text_area :merge_commit_template, class: 'form-control gl-form-input', rows: 8, maxlength: 500, placeholder: default_merge_commit_template %p.form-text.text-muted = s_('ProjectSettings|Maximum 500 characters.') - = s_('ProjectSettings|Supported variables:') - - Gitlab::MergeRequests::CommitMessageGenerator::PLACEHOLDERS.keys.each do |placeholder| - %code - = "%{#{placeholder}}".html_safe + - configure_the_merge_commit_message_help_link_url = help_page_path('user/project/merge_requests/commit_templates.md') + - configure_the_merge_commit_message_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_merge_commit_message_help_link_url } + = s_('ProjectSettings|%{link_start}What variables can I use?%{link_end}').html_safe % { link_start: configure_the_merge_commit_message_help_link_start, link_end: '</a>'.html_safe } diff --git a/app/views/projects/_merge_request_merge_method_settings.html.haml b/app/views/projects/_merge_request_merge_method_settings.html.haml index 2d18285ba80..b0e3bda2b4f 100644 --- a/app/views/projects/_merge_request_merge_method_settings.html.haml +++ b/app/views/projects/_merge_request_merge_method_settings.html.haml @@ -31,3 +31,6 @@ = s_('ProjectSettings|Fast-forward merges only.') %br = s_('ProjectSettings|When there is a merge conflict, the user is given the option to rebase.') + %div + = s_('ProjectSettings|If merge trains are enabled, merging is only possible if the branch can be rebased without conflicts.') + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/merge_trains.md', anchor: 'enable-merge-trains'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/projects/_merge_request_merge_suggestions_settings.html.haml b/app/views/projects/_merge_request_merge_suggestions_settings.html.haml index 6e3c366da82..9ed21593203 100644 --- a/app/views/projects/_merge_request_merge_suggestions_settings.html.haml +++ b/app/views/projects/_merge_request_merge_suggestions_settings.html.haml @@ -3,13 +3,10 @@ .form-group %b= s_('ProjectSettings|Merge suggestions') %p.text-secondary - - configure_the_commit_message_for_applied_suggestions_help_link_url = help_page_path('user/project/merge_requests/reviews/suggestions.md', anchor: 'configure-the-commit-message-for-applied-suggestions') - - configure_the_commit_message_for_applied_suggestions_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_commit_message_for_applied_suggestions_help_link_url } - = s_('ProjectSettings|The commit message used when applying merge request suggestions. %{link_start}Learn more about suggestions.%{link_end}').html_safe % { link_start: configure_the_commit_message_for_applied_suggestions_help_link_start, link_end: '</a>'.html_safe } + = s_('ProjectSettings|The commit message used when applying merge request suggestions.') .mb-2 = form.text_field :suggestion_commit_message, class: 'form-control mb-2', placeholder: Gitlab::Suggestions::CommitMessage::DEFAULT_SUGGESTION_COMMIT_MESSAGE %p.form-text.text-muted - = s_('ProjectSettings|Supported variables:') - - Gitlab::Suggestions::CommitMessage::PLACEHOLDERS.keys.each do |placeholder| - %code - = "%{#{placeholder}}".html_safe + - configure_the_commit_message_for_applied_suggestions_help_link_url = help_page_path('user/project/merge_requests/reviews/suggestions.md', anchor: 'configure-the-commit-message-for-applied-suggestions') + - configure_the_commit_message_for_applied_suggestions_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_commit_message_for_applied_suggestions_help_link_url } + = s_('ProjectSettings|%{link_start}What variables can I use?%{link_end}').html_safe % { link_start: configure_the_commit_message_for_applied_suggestions_help_link_start, link_end: '</a>'.html_safe } diff --git a/app/views/projects/_merge_request_squash_commit_template.html.haml b/app/views/projects/_merge_request_squash_commit_template.html.haml index 81e4bbed166..be1d78154c6 100644 --- a/app/views/projects/_merge_request_squash_commit_template.html.haml +++ b/app/views/projects/_merge_request_squash_commit_template.html.haml @@ -3,14 +3,11 @@ .form-group %b= s_('ProjectSettings|Squash commit message template') %p.text-secondary - - configure_the_squash_commit_message_help_link_url = help_page_path('user/project/merge_requests/commit_templates.md') - - configure_the_squash_commit_message_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_squash_commit_message_help_link_url } - = s_('ProjectSettings|The commit message used when squashing commits. %{link_start}Learn more about syntax and variables.%{link_end}').html_safe % { link_start: configure_the_squash_commit_message_help_link_start, link_end: '</a>'.html_safe } + = s_('ProjectSettings|The commit message used when squashing commits.') .mb-2 = form.text_area :squash_commit_template, class: 'form-control gl-form-input', rows: 8, maxlength: 500, placeholder: '%{title}' %p.form-text.text-muted = s_('ProjectSettings|Maximum 500 characters.') - = s_('ProjectSettings|Supported variables:') - - Gitlab::MergeRequests::CommitMessageGenerator::PLACEHOLDERS.keys.each do |placeholder| - %code - = "%{#{placeholder}}".html_safe + - configure_the_squash_commit_message_help_link_url = help_page_path('user/project/merge_requests/commit_templates.md') + - configure_the_squash_commit_message_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: configure_the_squash_commit_message_help_link_url } + = s_('ProjectSettings|%{link_start}What variables can I use?%{link_end}').html_safe % { link_start: configure_the_squash_commit_message_help_link_start, link_end: '</a>'.html_safe } diff --git a/app/views/projects/_merge_request_squash_options_settings.html.haml b/app/views/projects/_merge_request_squash_options_settings.html.haml index 61ffd4814f1..bf3000f2b5e 100644 --- a/app/views/projects/_merge_request_squash_options_settings.html.haml +++ b/app/views/projects/_merge_request_squash_options_settings.html.haml @@ -5,9 +5,7 @@ %b= s_('ProjectSettings|Squash commits when merging') %p.text-secondary = s_('ProjectSettings|Set the default behavior of this option in merge requests. Changes to this are also applied to existing merge requests.') - = link_to "What is squashing?", - help_page_path('user/project/merge_requests/squash_and_merge.md'), - target: '_blank' + = link_to "What is squashing?", help_page_path('user/project/merge_requests/squash_and_merge.md'), target: '_blank', rel: 'noopener noreferrer' .form-check.gl-mb-2 = settings.radio_button :squash_option, :never, class: "form-check-input" diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index 6fc78003df4..0b5da84e4e3 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -15,23 +15,12 @@ .input-group.gl-flex-nowrap - if current_user.can_select_namespace? - namespace_id = namespace_id_from(params) - - if Feature.enabled?(:paginatable_namespace_drop_down_for_project_creation, current_user, default_enabled: :yaml) - .js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path, - namespace_id: namespace_id, - root_url: root_url, - track_label: track_label, - user_namespace_full_path: current_user.namespace.full_path, - user_namespace_id: current_user.namespace.id } } - - else - .input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url } - .input-group-text - = root_url - = f.select(:namespace_id, - namespaces_options_with_developer_maintainer_access(selected: namespace_id, - display_path: true, - extra_group: namespace_id), - {}, - { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }}) + .js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path, + namespace_id: namespace_id, + root_url: root_url, + track_label: track_label, + user_namespace_full_path: current_user.namespace.full_path, + user_namespace_id: current_user.namespace.id } } - else .input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' } .input-group-text.border-0 @@ -98,7 +87,7 @@ = check_box_tag 'project[initialize_with_sast]', '1', true, class: 'form-check-input', data: { qa_selector: 'initialize_with_sast_checkbox', track_experiment: e.name, track_label: track_label, track_action: 'activate_form_input', track_property: 'init_with_sast' } = label_tag 'project[initialize_with_sast]', class: 'form-check-label' do = s_('ProjectsNew|Enable Static Application Security Testing (SAST)') - %span.badge.badge-info.badge-pill.gl-badge.sm= _('Free') + = gl_badge_tag _('Free'), variant: :info, size: :sm .form-text.text-muted = s_('ProjectsNew|Analyze your source code for known security vulnerabilities.') = link_to _('Learn more.'), help_page_path('user/application_security/sast/index'), target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'followed', track_experiment: e.name } @@ -108,7 +97,7 @@ = check_box_tag 'project[initialize_with_sast]', '1', false, class: 'form-check-input', data: { qa_selector: 'initialize_with_sast_checkbox', track_experiment: e.name, track_label: track_label, track_action: 'activate_form_input', track_property: 'init_with_sast' } = label_tag 'project[initialize_with_sast]', class: 'form-check-label' do = s_('ProjectsNew|Enable Static Application Security Testing (SAST)') - %span.badge.badge-info.badge-pill.gl-badge.sm= _('Free') + = gl_badge_tag _('Free'), variant: :info, size: :sm .form-text.text-muted = s_('ProjectsNew|Analyze your source code for known security vulnerabilities.') = link_to _('Learn more.'), help_page_path('user/application_security/sast/index'), target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'followed', track_experiment: e.name } diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index be6efa310b9..f5e61c010cc 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -8,14 +8,11 @@ = link_to project_tree_path(@project, branch.name), class: 'item-title str-truncated-100 ref-name gl-ml-3 qa-branch-name' do = branch.name - if branch.name == @repository.root_ref - %span.badge.gl-badge.sm.badge-pill.badge-primary.gl-ml-2 default + = gl_badge_tag s_('DefaultBranchLabel|default'), { variant: :info, size: :sm }, { class: 'gl-ml-2' } - elsif merged - %span.badge.gl-badge.sm.badge-pill.badge-info.has-tooltip.gl-ml-2{ title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref } } - = s_('Branches|merged') - + = gl_badge_tag s_('Branches|merged'), { variant: :info, size: :sm }, { class: 'gl-ml-2', title: s_('Branches|Merged into %{default_branch}') % { default_branch: @repository.root_ref }, data: { toggle: 'tooltip', container: 'body' } } - if protected_branch?(@project, branch) - %span.badge.gl-badge.sm.badge-pill.badge-success.gl-ml-2 - = s_('Branches|protected') + = gl_badge_tag s_('Branches|protected'), { variant: :success, size: :sm }, { class: 'gl-ml-2' } = render_if_exists 'projects/branches/diverged_from_upstream', branch: branch @@ -48,38 +45,4 @@ = render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], class: 'gl-vertical-align-top' - - if Feature.enabled?(:delete_branch_confirmation_modals, @project, default_enabled: :yaml) - = render 'projects/branches/delete_branch_modal_button', project: @project, branch: branch, merged: merged - - - elsif can?(current_user, :push_code, @project) - - if branch.name == @project.repository.root_ref - - delete_default_branch_tooltip = s_('Branches|The default branch cannot be deleted') - %span.gl-display-inline-block.has-tooltip{ title: delete_default_branch_tooltip } - %button{ class: 'gl-button btn btn-default btn-icon disabled', disabled: true, 'aria-label' => delete_default_branch_tooltip } - = sprite_icon('remove', css_class: 'gl-button-icon gl-icon') - - elsif protected_branch?(@project, branch) - - if can?(current_user, :push_to_delete_protected_branch, @project) - - delete_protected_branch_tooltip = s_('Branches|Delete protected branch') - %button{ class: 'gl-button btn btn-default btn-icon has-tooltip', - title: delete_protected_branch_tooltip, - 'aria-label' => delete_protected_branch_tooltip, - data: { toggle: 'modal', - target: '#modal-delete-branch', - delete_path: project_branch_path(@project, branch.name), - branch_name: branch.name, - is_merged: ('true' if merged) } } - = sprite_icon('remove', css_class: 'gl-button-icon gl-icon') - - else - - delete_protected_branch_disabled_tooltip = s_('Branches|Only a project maintainer or owner can delete a protected branch') - %span.has-tooltip{ title: delete_protected_branch_disabled_tooltip } - %button{ class: 'gl-button btn btn-default btn-icon disabled', disabled: true, 'aria-label' => delete_protected_branch_disabled_tooltip, data: { testid: 'remove-protected-branch' } } - = sprite_icon('remove', css_class: 'gl-button-icon gl-icon') - - else - = link_to project_branch_path(@project, branch.name), - class: 'gl-button btn btn-default btn-icon js-remove-row qa-remove-btn js-ajax-loading-spinner has-tooltip', - title: s_('Branches|Delete branch'), - method: :delete, - data: { confirm: s_("Branches|Deleting the '%{branch_name}' branch cannot be undone. Are you sure?") % { branch_name: branch.name } }, - remote: true, - 'aria-label' => s_('Branches|Delete branch') do - = sprite_icon('remove', css_class: 'gl-button-icon gl-icon') + = render 'projects/branches/delete_branch_modal_button', project: @project, branch: branch, merged: merged diff --git a/app/views/projects/branches/_delete_protected_modal.html.haml b/app/views/projects/branches/_delete_protected_modal.html.haml deleted file mode 100644 index 2b45b4eddcc..00000000000 --- a/app/views/projects/branches/_delete_protected_modal.html.haml +++ /dev/null @@ -1,42 +0,0 @@ -#modal-delete-branch.modal{ tabindex: -1 } - .modal-dialog - .modal-content - .modal-header - %h3.page-title - - title_branch_name = capture do - %span.js-branch-name.ref-name>[branch name] - = s_("Branches|Delete protected branch '%{branch_name}'?").html_safe % { branch_name: title_branch_name } - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": "true" } × - - .modal-body - %p - - branch_name = capture do - %strong.js-branch-name.ref-name>[branch name] - = s_('Branches|You’re about to permanently delete the protected branch %{branch_name}.').html_safe % { branch_name: branch_name } - %p.js-not-merged - - default_branch = capture do - %span.ref-name= @repository.root_ref - = s_('Branches|This branch hasn’t been merged into %{default_branch}.').html_safe % { default_branch: default_branch } - = s_('Branches|To avoid data loss, consider merging this branch before deleting it.') - %p - - delete_protected_branch = capture do - %strong - = s_('Branches|Delete protected branch') - = s_('Branches|Once you confirm and press %{delete_protected_branch}, it cannot be undone or recovered.').html_safe % { delete_protected_branch: delete_protected_branch } - %p - - branch_name_confirmation = capture do - %kbd.js-branch-name [branch name] - %strong - = s_('Branches|To confirm, type %{branch_name_confirmation}:').html_safe % { branch_name_confirmation: branch_name_confirmation } - - .form-group - = text_field_tag 'delete_branch_input', '', class: 'form-control js-delete-branch-input' - - .modal-footer - %button.gl-button.btn.btn-default{ data: { dismiss: 'modal' } } Cancel - = link_to s_('Branches|Delete protected branch'), '', - class: "gl-button btn btn-danger js-delete-branch", - title: s_('Branches|Delete branch'), - method: :delete, - 'aria-label' => s_('Branches|Delete branch') diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index 1c543d47ecf..2121d15643c 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -50,7 +50,5 @@ .nothing-here-block = s_('Branches|No branches to show') -- if Feature.enabled?(:delete_branch_confirmation_modals, @project, default_enabled: :yaml) && can?(current_user, :push_code, @project) +- if can?(current_user, :push_code, @project) .js-delete-branch-modal -- elsif can?(current_user, :push_code, @project) - = render 'projects/branches/delete_protected_modal' diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml index 3cec7fd9eb8..c57b6dbe28c 100644 --- a/app/views/projects/buttons/_fork.html.haml +++ b/app/views/projects/buttons/_fork.html.haml @@ -1,7 +1,7 @@ - unless @project.empty_repo? - if current_user .count-badge.btn-group - - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 + - if current_user.already_forked?(@project) && current_user.forkable_namespaces.size < 2 = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: s_('ProjectOverview|Go to your fork'), class: 'gl-button btn btn-default btn-sm has-tooltip fork-btn' do = sprite_icon('fork', css_class: 'icon') %span= s_('ProjectOverview|Fork') diff --git a/app/views/projects/ci/pipeline_editor/show.html.haml b/app/views/projects/ci/pipeline_editor/show.html.haml index ce6f7553ab4..c4757ea9c26 100644 --- a/app/views/projects/ci/pipeline_editor/show.html.haml +++ b/app/views/projects/ci/pipeline_editor/show.html.haml @@ -1,3 +1,4 @@ +- @force_fluid_layout = true - add_page_specific_style 'page_bundles/pipelines' - page_title s_('Pipelines|Pipeline Editor') diff --git a/app/views/projects/commit/_limit_exceeded_message.html.haml b/app/views/projects/commit/_limit_exceeded_message.html.haml index 236418ecd0e..444e7d209f1 100644 --- a/app/views/projects/commit/_limit_exceeded_message.html.haml +++ b/app/views/projects/commit/_limit_exceeded_message.html.haml @@ -1,8 +1,5 @@ -.has-tooltip{ class: "limit-box limit-box-#{objects} gl-ml-2", data: { title: _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } } } - .limit-icon - - if objects == :branch - = sprite_icon('fork', size: 12) - - else - = sprite_icon('tag') - .limit-message - %span= _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- icon = objects == :branch ? 'fork' : 'tag' +- text = _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- tooltip_title = _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } + += gl_badge_tag(text, { variant: :danger, icon: icon }, { class: 'has-tooltip gl-ml-2', data: { title: tooltip_title } }) diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml index 0b8e5105bc0..d08ace98408 100644 --- a/app/views/projects/commit/branches.html.haml +++ b/app/views/projects/commit/branches.html.haml @@ -6,8 +6,9 @@ - if @branches.any? || @tags.any? || @tags_limit_exceeded %span - = link_to "#", class: "js-details-expand badge badge-gray ref-name" do - = sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle') + = gl_badge_tag(_("Expand"), + { variant: :info, icon: 'ellipsis_h', icon_only: true }, + { href: '#', class: 'js-details-expand gl-font-monospace' }) %span.js-details-content.hide = commit_branches_links(@project, @branches) - if @tags_limit_exceeded diff --git a/app/views/projects/default_branch/_show.html.haml b/app/views/projects/default_branch/_show.html.haml index e5f911d6f8b..f9d3af7aa36 100644 --- a/app/views/projects/default_branch/_show.html.haml +++ b/app/views/projects/default_branch/_show.html.haml @@ -26,6 +26,6 @@ %strong= _("Auto-close referenced issues on default branch") .form-text.text-muted = _("When merge requests and commits in the default branch close, any issues they reference also close.") - = link_to sprite_icon('question-o'), help_page_path('user/project/issues/managing_issues.md', anchor: 'closing-issues-automatically'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/project/issues/managing_issues.md', anchor: 'closing-issues-automatically'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index f18574c3ad5..504bbf3a304 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -27,8 +27,7 @@ = link_to deployment_path(deployment), class: 'build-link' do #{deployment.deployable.name} (##{deployment.deployable.id}) - else - .badge.badge-info.gl-cursor-help{ title: s_('Deployment|This deployment was created using the API') } - = s_('Deployment|API') + = gl_badge_tag s_('Deployment|API'), { variant: :info }, { class: 'gl-cursor-help', data: { toggle: 'tooltip' }, title: s_('Deployment|This deployment was created using the API') } .table-section.section-10{ role: 'gridcell' } .table-mobile-header{ role: 'rowheader' }= _("Created") diff --git a/app/views/projects/diffs/_email_line.html.haml b/app/views/projects/diffs/_email_line.html.haml new file mode 100644 index 00000000000..dfff143196c --- /dev/null +++ b/app/views/projects/diffs/_email_line.html.haml @@ -0,0 +1,21 @@ +-# This template is used when rendering diffs in email notifications +-# Called inside: app/views/notify/repository_push_email.html.haml +-# app/views/notify/_note_email.html.haml + +%tr.line_holder{ class: line.type } + - case line.type + - when 'match' + = diff_match_line line.old_pos, line.new_pos, text: line.text + - when 'old-nonewline', 'new-nonewline' + %td.old_line.diff-line-num + %td.new_line.diff-line-num + %td.line_content.match= line.text + - else + %td.old_line.diff-line-num{ class: line.type, data: { linenumber: line.old_pos } } + = diff_link_number(line.type, "new", line.old_pos) + + %td.new_line.diff-line-num{ class: line.type, data: { linenumber: line.new_pos } } + = diff_link_number(line.type, "old", line.new_pos) + + %td.line_content{ class: line.type }< + %pre= line.rich_text diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml index d1792826522..afca27c5430 100644 --- a/app/views/projects/diffs/_file_header.html.haml +++ b/app/views/projects/diffs/_file_header.html.haml @@ -36,5 +36,5 @@ #{diff_file.a_mode} → #{diff_file.b_mode} - if diff_file.stored_externally? && diff_file.external_storage == :lfs - %span.badge.label-lfs.gl-mr-2 LFS + = gl_badge_tag(_('LFS'), variant: :neutral) diff --git a/app/views/projects/diffs/_line.html.haml b/app/views/projects/diffs/_line.html.haml index de7f9eba158..330e2f564c9 100644 --- a/app/views/projects/diffs/_line.html.haml +++ b/app/views/projects/diffs/_line.html.haml @@ -1,3 +1,5 @@ +-# This file is deprecated in favour of inline rendering: +-# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57237 - plain = local_assigns.fetch(:plain, false) - discussions = local_assigns.fetch(:discussions, nil) - line_code = diff_file.line_code(line) diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index bf946b0ce73..6e7e0244721 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -4,10 +4,38 @@ %a.show-suppressed-diff.cursor-pointer.js-show-suppressed-diff= _("Changes suppressed. Click to show.") %table.text-file.diff-wrap-lines.code.code-commit.js-syntax-highlight.commit-diff{ data: diff_view_data, class: too_big ? 'hide' : '' } - = render partial: "projects/diffs/line", - collection: diff_file.highlighted_diff_lines, - as: :line, - locals: { diff_file: diff_file, discussions: @grouped_diff_discussions } + - if Feature.enabled?(:inline_haml_diff_line_rendering, @project, default_enabled: :yaml) + - diff_file.highlighted_diff_lines.each do |line| + - line_code = diff_file.line_code(line) + + %tr.line_holder{ class: line.type, id: line_code } + - case line.type + - when 'match' + = diff_match_line line.old_pos, line.new_pos, text: line.text + - when 'old-nonewline', 'new-nonewline' + %td.old_line.diff-line-num + %td.new_line.diff-line-num + %td.line_content.match= line.text + - else + %td.old_line.diff-line-num{ class: "#{line.type} js-avatar-container", data: { linenumber: line.old_pos } } + = add_diff_note_button(line_code, diff_file.position(line), line.type) + %a{ href: "##{line_code}", data: { linenumber: diff_link_number(line.type, "new", line.old_pos) } } + + %td.new_line.diff-line-num{ class: line.type, data: { linenumber: line.new_pos } } + %a{ href: "##{line_code}", data: { linenumber: diff_link_number(line.type, "old", line.new_pos) } } + + %td.line_content{ class: line.type }< + = diff_line_content(line.rich_text) + + - if line.discussable? && @grouped_diff_discussions.present? && @grouped_diff_discussions[line_code] + - line_discussions = @grouped_diff_discussions[line_code] + = render "discussions/diff_discussion", discussions: line_discussions, expanded: line_discussions.any?(&:expanded?) + + - else + = render partial: "projects/diffs/line", + collection: diff_file.highlighted_diff_lines, + as: :line, + locals: { diff_file: diff_file, discussions: @grouped_diff_discussions } - if !diff_file.new_file? && !diff_file.deleted_file? && diff_file.highlighted_diff_lines.any? - last_line = diff_file.highlighted_diff_lines.last diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 6421aef14cf..aa9a3ea61f7 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -2,6 +2,7 @@ - page_title _("General") - @content_class = "limit-container-width" unless fluid_layout - expanded = expanded_by_default? +- reduce_visibility_form_id = 'reduce-visibility-form' %section.settings.general-settings.no-animate.expanded#js-general-settings .settings-header @@ -17,13 +18,10 @@ %p= _('Choose visibility level, enable/disable project features and their permissions, disable email notifications, and show default award emoji.') .settings-content - = form_for @project, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f| + = form_for @project, html: { multipart: true, class: "sharing-permissions-form", id: reduce_visibility_form_id }, authenticity_token: true do |f| %input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' } %template.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data(@project).to_json.html_safe - .js-project-permissions-form - - if show_visibility_confirm_modal?(@project) - = render "visibility_modal" - = f.submit _('Save changes'), class: "btn gl-button btn-confirm #{('js-legacy-confirm-danger' if show_visibility_confirm_modal?(@project))}", data: { qa_selector: 'visibility_features_permissions_save_button', check_field_name: ("project[visibility_level]" if show_visibility_confirm_modal?(@project)), check_compare_value: @project.visibility_level } + .js-project-permissions-form{ data: visibility_confirm_modal_data(@project, reduce_visibility_form_id) } %section.rspec-merge-request-settings.settings.merge-requests-feature.no-animate#js-merge-request-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)], data: { qa_selector: 'merge_request_settings_content' } } .settings-header @@ -111,5 +109,3 @@ .gl-spinner.gl-spinner-md.align-text-bottom = _('Saving project.') %p= _('Please wait a moment, this page will automatically refresh when ready.') - -= render 'shared/confirm_modal', phrase: @project.path diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml index d6f421e8ad6..5330c3aa6d6 100644 --- a/app/views/projects/forks/index.html.haml +++ b/app/views/projects/forks/index.html.haml @@ -25,7 +25,7 @@ = forks_sort_direction_button(sort_value) - if current_user && can?(current_user, :fork_project, @project) - - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 + - if current_user.already_forked?(@project) && current_user.forkable_namespaces.size < 2 = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: _('Go to your fork'), class: 'btn gl-button btn-confirm gl-md-ml-3' do = sprite_icon('fork', size: 12) %span= _('Fork') diff --git a/app/views/projects/import/jira/show.html.haml b/app/views/projects/import/jira/show.html.haml index 29296ce23c9..1feae7baa02 100644 --- a/app/views/projects/import/jira/show.html.haml +++ b/app/views/projects/import/jira/show.html.haml @@ -1,6 +1,6 @@ .js-jira-import-root{ data: { project_path: @project.full_path, issues_path: project_issues_path(@project), - jira_integration_path: edit_project_service_path(@project, :jira), + jira_integration_path: edit_project_integration_path(@project, :jira), is_jira_configured: @project.jira_integration&.configured?.to_s, in_progress_illustration: image_path('illustrations/export-import.svg'), project_id: @project.id, diff --git a/app/views/projects/issues/_by_email_description.html.haml b/app/views/projects/issues/_by_email_description.html.haml index 0ff852352e1..aeed5fb69c9 100644 --- a/app/views/projects/issues/_by_email_description.html.haml +++ b/app/views/projects/issues/_by_email_description.html.haml @@ -1,6 +1,6 @@ The subject will be used as the title of the new issue, and the message will be the description. -= link_to 'Quick actions', help_page_path('user/project/quick_actions'), target: '_blank' += link_to 'Quick actions', help_page_path('user/project/quick_actions'), target: '_blank', rel: 'noopener noreferrer' and styling with -= link_to 'Markdown', help_page_path('user/markdown'), target: '_blank' += link_to 'Markdown', help_page_path('user/markdown'), target: '_blank', rel: 'noopener noreferrer' are supported. diff --git a/app/views/projects/issues/_design_management.html.haml b/app/views/projects/issues/_design_management.html.haml index a2ff9620c0c..c5ce0549816 100644 --- a/app/views/projects/issues/_design_management.html.haml +++ b/app/views/projects/issues/_design_management.html.haml @@ -8,7 +8,11 @@ - if @project.design_management_enabled? - add_page_startup_graphql_call('design_management/get_design_list', { fullPath: @project.full_path, iid: @issue.iid.to_s, atVersion: nil }) - add_page_startup_graphql_call('design_management/design_permissions', { fullPath: @project.full_path, iid: @issue.iid.to_s }) - .js-design-management{ data: { project_path: @project.full_path, issue_iid: @issue.iid, issue_path: project_issue_path(@project, @issue) } } + .js-design-management{ data: { project_path: @project.full_path, + issue_iid: @issue.iid, + issue_path: project_issue_path(@project, @issue), + register_path: new_user_registration_path(redirect_to_referer: 'yes'), + sign_in_path: new_session_path(:user, redirect_to_referer: 'yes') } } - else .gl-border-solid.gl-border-1.gl-border-gray-100.gl-rounded-base.gl-mt-5.gl-p-3.gl-text-center = enable_lfs_message diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 2dc21685057..4c96875ce42 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -1,4 +1,3 @@ --# DANGER: Any changes to this file need to be reflected in issuables_list/components/issuable.vue! %li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue), data: { labels: issue.label_ids, id: issue.id, qa_selector: 'issue_container', qa_issue_title: issue.title } } .issuable-info-container - if @can_bulk_update diff --git a/app/views/projects/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml index 1ab51df6d24..09b0b7a4d9b 100644 --- a/app/views/projects/issues/_issues.html.haml +++ b/app/views/projects/issues/_issues.html.haml @@ -1,25 +1,10 @@ -- is_project_overview = local_assigns.fetch(:is_project_overview, false) = render 'shared/alerts/positioning_disabled' if @sort == 'relative_position' -- if Feature.enabled?(:vue_issuables_list, @project) && !is_project_overview - - data_endpoint = local_assigns.fetch(:data_endpoint, expose_path(api_v4_projects_issues_path(id: @project.id))) - - default_empty_state_meta = { create_issue_path: new_project_issue_path(@project), svg_path: image_path('illustrations/issues.svg') } - - data_empty_state_meta = local_assigns.fetch(:data_empty_state_meta, default_empty_state_meta) - - type = local_assigns.fetch(:type, 'issues') - - if type == 'issues' && use_startup_call? - - add_page_startup_api_call(api_v4_projects_issues_path(id: @project.id, params: startup_call_params)) - .js-issuables-list{ data: { endpoint: data_endpoint, - 'empty-state-meta': data_empty_state_meta.to_json, - 'can-bulk-edit': @can_bulk_update.to_json, - 'sort-key': @sort, - type: type, - 'scoped-labels-available': scoped_labels_available?(@project).to_json } } -- else - - empty_state_path = local_assigns.fetch(:empty_state_path, 'shared/empty_states/issues') - %ul.content-list.issues-list.issuable-list{ class: issue_manual_ordering_class } - = render partial: "projects/issues/issue", collection: @issues - - if @issues.blank? - = render empty_state_path +%ul.content-list.issues-list.issuable-list{ class: issue_manual_ordering_class } + = render partial: "projects/issues/issue", collection: @issues + - if @issues.blank? + - empty_state_path = local_assigns.fetch(:empty_state_path, 'shared/empty_states/issues') + = render empty_state_path - - if @issues.present? - = paginate_collection @issues, total_pages: @total_pages +- if @issues.present? + = paginate_collection @issues, total_pages: @total_pages diff --git a/app/views/projects/issues/_service_desk_empty_state.html.haml b/app/views/projects/issues/_service_desk_empty_state.html.haml index afeb2a23ea2..3e0b80700fe 100644 --- a/app/views/projects/issues/_service_desk_empty_state.html.haml +++ b/app/views/projects/issues/_service_desk_empty_state.html.haml @@ -27,7 +27,11 @@ .svg-content = render 'shared/empty_states/icons/service_desk_setup.svg' .text-content - %h4= s_('ServiceDesk|Service Desk is enabled but not yet active') - %p - = s_("ServiceDesk|To activate Service Desk on this instance, an instance administrator must first set up incoming email.") - = link_to _('Learn more.'), help_page_path('administration/incoming_email', anchor: 'set-it-up') + - if can_edit_project_settings + %h4= s_('ServiceDesk|Service Desk is not supported') + %p + = s_("ServiceDesk|To enable Service Desk on this instance, an instance administrator must first set up incoming email.") + = link_to _('Learn more.'), help_page_path('administration/incoming_email', anchor: 'set-it-up') + - else + %h4= s_('ServiceDesk|Service Desk is not enabled') + %p= s_("ServiceDesk|For help setting up the Service Desk for your instance, please contact an administrator.") diff --git a/app/views/projects/issues/service_desk.html.haml b/app/views/projects/issues/service_desk.html.haml index b0d8791c566..fb5880f633a 100644 --- a/app/views/projects/issues/service_desk.html.haml +++ b/app/views/projects/issues/service_desk.html.haml @@ -7,9 +7,7 @@ - support_bot_attrs = { service_desk_enabled: @project.service_desk_enabled?, **UserSerializer.new.represent(User.support_bot) }.to_json -- data_endpoint = "#{expose_path(api_v4_projects_issues_path(id: @project.id))}?author_username=#{User.support_bot.username}" - -%div{ class: "js-service-desk-issues service-desk-issues", data: { support_bot: support_bot_attrs, service_desk_meta: service_desk_meta(@project) } } +.js-service-desk-issues.service-desk-issues{ data: { support_bot: support_bot_attrs } } .top-area = render 'shared/issuable/nav', type: :issues .nav-controls.d-block.d-sm-none @@ -20,12 +18,5 @@ - if Gitlab::ServiceDesk.supported? = render 'service_desk_info_content' - -# TODO Remove empty_state_path once vue_issuables_list FF is removed. - -# https://gitlab.com/gitlab-org/gitlab/-/issues/235652 - -# `empty_state_path` is used to render the empty state in the HAML version of issuables list. .issues-holder - = render 'projects/issues/issues', - empty_state_path: 'service_desk_empty_state', - data_endpoint: data_endpoint, - data_empty_state_meta: service_desk_meta(@project), - type: 'service_desk' + = render 'projects/issues/issues', empty_state_path: 'service_desk_empty_state' diff --git a/app/views/projects/jobs/show.html.haml b/app/views/projects/jobs/show.html.haml index 7af825b2819..fedc1291a92 100644 --- a/app/views/projects/jobs/show.html.haml +++ b/app/views/projects/jobs/show.html.haml @@ -10,4 +10,4 @@ - if @build.is_a? ::Ci::Build #js-job-page{ data: jobs_data } - else - #js-bridge-page{ data: bridge_data(@build) } + #js-bridge-page{ data: bridge_data(@build, @project) } diff --git a/app/views/projects/mattermosts/_no_teams.html.haml b/app/views/projects/mattermosts/_no_teams.html.haml index adef11f315a..1efec0c017c 100644 --- a/app/views/projects/mattermosts/_no_teams.html.haml +++ b/app/views/projects/mattermosts/_no_teams.html.haml @@ -15,4 +15,4 @@ and try again. %hr .clearfix - = link_to 'Go back', edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg float-right' + = link_to 'Go back', edit_project_integration_path(@project, @integration), class: 'gl-button btn btn-lg float-right' diff --git a/app/views/projects/mattermosts/_team_selection.html.haml b/app/views/projects/mattermosts/_team_selection.html.haml index 4832880eefc..d52d980c364 100644 --- a/app/views/projects/mattermosts/_team_selection.html.haml +++ b/app/views/projects/mattermosts/_team_selection.html.haml @@ -42,5 +42,5 @@ %hr .clearfix .float-right - = link_to _('Cancel'), edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg' + = link_to _('Cancel'), edit_project_integration_path(@project, @integration), class: 'gl-button btn btn-lg' = f.submit 'Install', class: 'gl-button btn btn-success btn-lg' diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index 0c8af873095..4e69dad2e12 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -1,24 +1,25 @@ -= cache_if(Feature.enabled?(:cached_mr_widget, @merge_request.project), [@merge_request.project, @merge_request, current_user], expires_in: 10.minutes) do - - artifacts_endpoint_placeholder = ':pipeline_artifacts_id' +- artifacts_endpoint_placeholder = ':pipeline_artifacts_id' - = javascript_tag do - :plain - window.gl = window.gl || {}; - window.gl.mrWidgetData = #{serialize_issuable(@merge_request, serializer: 'widget', issues_links: true)} += javascript_tag do + :plain + window.gl = window.gl || {}; + window.gl.mrWidgetData = #{serialize_issuable(@merge_request, serializer: 'widget', issues_links: true)} - window.gl.mrWidgetData.artifacts_endpoint = '#{downloadable_artifacts_project_pipeline_path(@project, artifacts_endpoint_placeholder, format: :json)}'; - window.gl.mrWidgetData.artifacts_endpoint_placeholder = '#{artifacts_endpoint_placeholder}'; - window.gl.mrWidgetData.squash_before_merge_help_path = '#{help_page_path("user/project/merge_requests/squash_and_merge")}'; - window.gl.mrWidgetData.ci_troubleshooting_docs_path = '#{help_page_path('ci/troubleshooting.md')}'; - window.gl.mrWidgetData.mr_troubleshooting_docs_path = '#{help_page_path('user/project/merge_requests/reviews/index.md', anchor: 'troubleshooting')}'; - window.gl.mrWidgetData.pipeline_must_succeed_docs_path = '#{help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds.md', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds')}'; - window.gl.mrWidgetData.security_approvals_help_page_path = '#{help_page_path('user/application_security/index.md', anchor: 'security-approvals-in-merge-requests')}'; - window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_compliance/index.md', anchor: 'policies')}'; - window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/approvals/rules.md', anchor: 'eligible-approvers')}'; - window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/approvals/index.md")}'; - window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}'; - window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; - window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; - window.gl.mrWidgetData.can_view_false_positive = '#{@merge_request.project.licensed_feature_available?(:sast_fp_reduction).to_s}'; + window.gl.mrWidgetData.artifacts_endpoint = '#{downloadable_artifacts_project_pipeline_path(@project, artifacts_endpoint_placeholder, format: :json)}'; + window.gl.mrWidgetData.artifacts_endpoint_placeholder = '#{artifacts_endpoint_placeholder}'; + window.gl.mrWidgetData.squash_before_merge_help_path = '#{help_page_path("user/project/merge_requests/squash_and_merge")}'; + window.gl.mrWidgetData.ci_troubleshooting_docs_path = '#{help_page_path('ci/troubleshooting.md')}'; + window.gl.mrWidgetData.mr_troubleshooting_docs_path = '#{help_page_path('user/project/merge_requests/reviews/index.md', anchor: 'troubleshooting')}'; + window.gl.mrWidgetData.pipeline_must_succeed_docs_path = '#{help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds.md', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds')}'; + window.gl.mrWidgetData.security_approvals_help_page_path = '#{help_page_path('user/application_security/index.md', anchor: 'security-approvals-in-merge-requests')}'; + window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_compliance/index.md', anchor: 'policies')}'; + window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/approvals/rules.md', anchor: 'eligible-approvers')}'; + window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/approvals/index.md")}'; + window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}'; + window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; + window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; + window.gl.mrWidgetData.can_view_false_positive = '#{@merge_request.project.licensed_feature_available?(:sast_fp_reduction).to_s}'; + window.gl.mrWidgetData.user_preferences_gitpod_path = '#{profile_preferences_path(anchor: 'user_gitpod_enabled')}'; + window.gl.mrWidgetData.user_profile_enable_gitpod_path = '#{profile_path(user: { gitpod_enabled: true })}'; - #js-vue-mr-widget.mr-widget +#js-vue-mr-widget.mr-widget diff --git a/app/views/projects/merge_requests/invalid.html.haml b/app/views/projects/merge_requests/invalid.html.haml index eb8de425f61..28fd0b83824 100644 --- a/app/views/projects/merge_requests/invalid.html.haml +++ b/app/views/projects/merge_requests/invalid.html.haml @@ -1,11 +1,8 @@ - page_title "#{@merge_request.title} (#{@merge_request.to_reference}", _("Merge requests") -- badge_start = '<span class="badge badge-pill gl-badge sm badge-info">'.html_safe -- badge_end = '</span>'.html_safe - - err_fork_project_removed = s_("MergeRequest|Can't show this merge request because the fork project was deleted.") -- err_source_branch = s_("MergeRequest|Can't show this merge request because the source branch %{badge_start}%{source_branch}%{badge_end} is missing from project %{badge_start}%{project_path}%{badge_end}. Close this merge request or update the source branch.") -- err_target_branch = s_("MergeRequest|Can't show this merge request because the target branch %{badge_start}%{target_branch}%{badge_end} is missing from project %{badge_start}%{project_path}%{badge_end}. Close this merge request or update the target branch.") +- err_source_branch = s_("MergeRequest|Can't show this merge request because the source branch %{branch_badge} is missing from project %{path_badge}. Close this merge request or update the source branch.") +- err_target_branch = s_("MergeRequest|Can't show this merge request because the target branch %{branch_badge} is missing from project %{path_badge}. Close this merge request or update the target branch.") - err_internal = s_("MergeRequest|Can't show this merge request because of an internal error. Contact your administrator.") .merge-request @@ -20,8 +17,8 @@ - if @merge_request.for_fork? && !@merge_request.source_project = err_fork_project_removed - elsif !@merge_request.source_branch_exists? - = err_source_branch.html_safe % { badge_start: badge_start, badge_end: badge_end, source_branch: @merge_request.source_branch, project_path: @merge_request.source_project_path } + = err_source_branch.html_safe % { branch_badge: gl_badge_tag(@merge_request.source_branch, variant: :info, size: :sm), path_badge: gl_badge_tag(@merge_request.source_project_path, variant: :info, size: :sm) } - elsif !@merge_request.target_branch_exists? - = err_target_branch.html_safe % { badge_start: badge_start, badge_end: badge_end, target_branch: @merge_request.target_branch, project_path: @merge_request.source_project_path } + = err_target_branch.html_safe % { branch_badge: gl_badge_tag(@merge_request.target_branch, variant: :info, size: :sm), path_badge: gl_badge_tag(@merge_request.source_project_path, variant: :info, size: :sm) } - else = err_internal diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index eb1c9712c52..a0e78b7570a 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -97,6 +97,4 @@ #js-review-bar = render 'projects/invite_members_modal', project: @project -- if Gitlab::CurrentSettings.gitpod_enabled && !current_user&.gitpod_enabled - = render 'shared/gitpod/enable_gitpod_modal' = render 'shared/web_ide_path' diff --git a/app/views/projects/mirrors/_authentication_method.html.haml b/app/views/projects/mirrors/_authentication_method.html.haml index 5f31ec4087e..e9e3645d7f2 100644 --- a/app/views/projects/mirrors/_authentication_method.html.haml +++ b/app/views/projects/mirrors/_authentication_method.html.haml @@ -6,7 +6,7 @@ .select-wrapper = f.select :auth_method, options_for_select(auth_options, mirror.auth_method), - {}, { class: "form-control gl-form-input select-control js-mirror-auth-type qa-authentication-method" } + {}, { class: "form-control gl-form-select select-control js-mirror-auth-type qa-authentication-method" } = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") = f.hidden_field :auth_method, value: "password", class: "js-hidden-mirror-auth-type" diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml index d253ab8e32b..b2fa735f76f 100644 --- a/app/views/projects/mirrors/_mirror_repos.html.haml +++ b/app/views/projects/mirrors/_mirror_repos.html.haml @@ -69,7 +69,7 @@ - if mirror.disabled? = render 'projects/mirrors/disabled_mirror_badge' - if mirror.last_error.present? - .badge.mirror-error-badge{ data: { toggle: 'tooltip', html: 'true', qa_selector: 'mirror_error_badge' }, title: html_escape(mirror.last_error.try(:strip)) }= _('Error') + = gl_badge_tag _('Error'), { variant: :danger }, { data: { toggle: 'tooltip', html: 'true', qa_selector: 'mirror_error_badge' }, title: html_escape(mirror.last_error.try(:strip)) } %td.gl-display-flex - if mirror_settings_enabled %button.js-delete-mirror.qa-delete-mirror.rspec-delete-mirror.btn.btn-icon.gl-button.btn-danger.gl-mr-3{ type: 'button', data: { mirror_id: mirror.id, toggle: 'tooltip', container: 'body' }, title: _('Remove') }= sprite_icon('remove') diff --git a/app/views/projects/mirrors/_mirror_repos_form.html.haml b/app/views/projects/mirrors/_mirror_repos_form.html.haml index dca01ebbe90..34b7c75debf 100644 --- a/app/views/projects/mirrors/_mirror_repos_form.html.haml +++ b/app/views/projects/mirrors/_mirror_repos_form.html.haml @@ -1,7 +1,7 @@ .form-group = label_tag :mirror_direction, _('Mirror direction'), class: 'label-light' .select-wrapper - = select_tag :mirror_direction, options_for_select([[_('Push'), 'push']]), class: 'form-control gl-form-input select-control js-mirror-direction qa-mirror-direction', disabled: true + = select_tag :mirror_direction, options_for_select([[_('Push'), 'push']]), class: 'form-control gl-form-select select-control js-mirror-direction qa-mirror-direction', disabled: true = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") = render partial: "projects/mirrors/mirror_repos_push", locals: { f: f } diff --git a/app/views/projects/packages/packages/index.html.haml b/app/views/projects/packages/packages/index.html.haml index c67b06218e2..4ab16f25dd2 100644 --- a/app/views/projects/packages/packages/index.html.haml +++ b/app/views/projects/packages/packages/index.html.haml @@ -7,4 +7,7 @@ full_path: @project.full_path, endpoint: project_packages_path(@project), page_type: 'projects', - empty_list_illustration: image_path('illustrations/no-packages.svg'), } } + empty_list_illustration: image_path('illustrations/no-packages.svg'), + npm_instance_url: package_registry_instance_url(:npm), + project_list_url: project_packages_path(@project), + group_list_url: '' } } diff --git a/app/views/projects/packages/packages/show.html.haml b/app/views/projects/packages/packages/show.html.haml deleted file mode 100644 index ebdc9e654f6..00000000000 --- a/app/views/projects/packages/packages/show.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- add_to_breadcrumbs _("Package Registry"), project_packages_path(@project) -- add_to_breadcrumbs @package.name, project_packages_path(@project) -- breadcrumb_title @package.version -- page_title _("Package Registry") -- @content_class = "limit-container-width" unless fluid_layout - -.row - .col-12 - #js-vue-packages-detail-new{ data: package_details_data(@project, @package) } diff --git a/app/views/projects/pages/_list.html.haml b/app/views/projects/pages/_list.html.haml index 40352e79175..4e9c77564da 100644 --- a/app/views/projects/pages/_list.html.haml +++ b/app/views/projects/pages/_list.html.haml @@ -15,11 +15,9 @@ = external_link(domain.url, domain.url) - if domain.certificate %div - %span.badge.badge-gray - = s_('GitLabPages|Certificate: %{subject}') % { subject: domain.pages_domain.subject } + = gl_badge_tag(s_('GitLabPages|Certificate: %{subject}') % { subject: domain.pages_domain.subject }) - if domain.expired? - %span.badge.badge-danger - = s_('GitLabPages|Expired') + = gl_badge_tag s_('GitLabPages|Expired'), variant: :danger %div = link_to s_('GitLabPages|Edit'), project_pages_domain_path(@project, domain), class: "btn gl-button btn-sm btn-grouped btn-confirm btn-inverted" = link_to s_('GitLabPages|Remove'), project_pages_domain_path(@project, domain), data: { confirm: s_('GitLabPages|Are you sure?')}, method: :delete, class: "btn gl-button btn-danger btn-sm btn-grouped" diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml index 0bfdee088b4..13a77dbf2fd 100644 --- a/app/views/projects/pipelines/_info.html.haml +++ b/app/views/projects/pipelines/_info.html.haml @@ -22,41 +22,25 @@ .icon-container = sprite_icon('flag') - if @pipeline.child? - %span.js-pipeline-child.badge.badge-pill.gl-badge.sm.badge-primary.has-tooltip{ title: s_("Pipelines|This is a child pipeline within the parent pipeline") } - = s_('Pipelines|Child pipeline') - = surround '(', ')' do - = link_to s_('Pipelines|parent'), pipeline_path(@pipeline.triggered_by_pipeline), class: 'text-white text-underline' + - text = sprintf(s_('Pipelines|Child pipeline (%{link_start}parent%{link_end})'), { link_start: "<a href='#{pipeline_path(@pipeline.triggered_by_pipeline)}' class='text-underline'>", link_end: "</a>"}).html_safe + = gl_badge_tag text, { variant: :info, size: :sm }, { class: 'js-pipeline-child has-tooltip', title: s_("Pipelines|This is a child pipeline within the parent pipeline") } - if @pipeline.latest? - %span.js-pipeline-url-latest.badge.badge-pill.gl-badge.sm.badge-success.has-tooltip{ title: _("Latest pipeline for the most recent commit on this branch") } - latest + = gl_badge_tag s_('Pipelines|latest'), { variant: :success, size: :sm }, { class: 'js-pipeline-url-latest has-tooltip', title: _("Latest pipeline for the most recent commit on this branch") } - if @pipeline.merge_train_pipeline? - %span.js-pipeline-url-train.badge.badge-pill.gl-badge.sm.badge-info.has-tooltip{ title: _("This is a merge train pipeline") } - train + = gl_badge_tag s_('Pipelines|train'), { variant: :info, size: :sm }, { class: 'js-pipeline-url-train has-tooltip', title: _("This is a merge train pipeline") } - if @pipeline.has_yaml_errors? - %span.js-pipeline-url-yaml.badge.badge-pill.gl-badge.sm.badge-danger.has-tooltip{ title: @pipeline.yaml_errors } - yaml invalid + = gl_badge_tag s_('Pipelines|yaml invalid'), { variant: :danger, size: :sm }, { class: 'js-pipeline-url-yaml has-tooltip', title: @pipeline.yaml_errors } - if @pipeline.failure_reason? - %span.js-pipeline-url-failure.badge.badge-pill.gl-badge.sm.badge-danger.has-tooltip{ title: @pipeline.failure_reason } - error + = gl_badge_tag s_('Pipelines|error'), { variant: :danger, size: :sm }, { class: 'js-pipeline-url-failure has-tooltip', title: @pipeline.failure_reason } - if @pipeline.auto_devops_source? - popover_title_text = html_escape(_('This pipeline makes use of a predefined CI/CD configuration enabled by %{b_open}Auto DevOps.%{b_close}')) % { b_open: '<b>'.html_safe, b_close: '</b>'.html_safe } - popover_content_url = help_page_path('topics/autodevops/index.md') - popover_content_text = _('Learn more about Auto DevOps') - %a.js-pipeline-url-autodevops.badge.badge-pill.gl-badge.sm.badge-info.autodevops-badge{ href: "#", tabindex: "0", role: "button", data: { container: "body", - toggle: "popover", - placement: "top", - html: "true", - triggers: "focus", - title: "<div class='gl-font-weight-normal gl-line-height-normal'>#{popover_title_text}</div>", - content: "<a href='#{popover_content_url}' target='_blank' rel='noopener noreferrer nofollow'>#{popover_content_text}</a>", - } } - Auto DevOps + = gl_badge_tag s_('Pipelines|Auto DevOps'), { variant: :info, size: :sm }, { class: 'js-pipeline-url-autodevops', href: "#", tabindex: "0", role: "button", data: { container: 'body', toggle: 'popover', placement: 'top', html: 'true', triggers: 'focus', title: "<div class='gl-font-weight-normal gl-line-height-normal'>#{popover_title_text}</div>", content: "<a href='#{popover_content_url}' target='_blank' rel='noopener noreferrer nofollow'>#{popover_content_text}</a>" } } - if @pipeline.detached_merge_request_pipeline? - %span.js-pipeline-url-mergerequest.badge.badge-pill.gl-badge.sm.badge-info.has-tooltip{ title: _('Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.') } - detached + = gl_badge_tag s_('Pipelines|detached'), { variant: :info, size: :sm }, { class: 'js-pipeline-url-mergerequest has-tooltip', title: _('Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.') } - if @pipeline.stuck? - %span.js-pipeline-url-stuck.badge.badge-pill.gl-badge.sm.badge-warning - stuck + = gl_badge_tag s_('Pipelines|stuck'), { variant: :warning, size: :sm }, { class: 'js-pipeline-url-stuck has-tooltip' } .well-segment.branch-info .icon-container.commit-icon diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index ac5d34bfd44..d654d0e04d7 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -1,3 +1,4 @@ +- @force_fluid_layout = true - add_to_breadcrumbs _('Pipelines'), project_pipelines_path(@project) - breadcrumb_title "##{@pipeline.id}" - page_title _('Pipeline') diff --git a/app/views/projects/prometheus/metrics/edit.html.haml b/app/views/projects/prometheus/metrics/edit.html.haml index d308824571e..146bf6b6853 100644 --- a/app/views/projects/prometheus/metrics/edit.html.haml +++ b/app/views/projects/prometheus/metrics/edit.html.haml @@ -1,6 +1,6 @@ - add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) -- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, ::Integrations::Prometheus) +- add_to_breadcrumbs "Prometheus", edit_project_integration_path(@project, ::Integrations::Prometheus) - breadcrumb_title s_('Metrics|Edit metric') - page_title @metric.title, s_('Metrics|Edit metric') = render 'form', project: @project, metric: @metric diff --git a/app/views/projects/prometheus/metrics/new.html.haml b/app/views/projects/prometheus/metrics/new.html.haml index 8415ec9ee41..ad8463d1804 100644 --- a/app/views/projects/prometheus/metrics/new.html.haml +++ b/app/views/projects/prometheus/metrics/new.html.haml @@ -1,6 +1,6 @@ - add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) -- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, ::Integrations::Prometheus) +- add_to_breadcrumbs "Prometheus", edit_project_integration_path(@project, ::Integrations::Prometheus) - breadcrumb_title s_('Metrics|New metric') - page_title s_('Metrics|New metric') = render 'form', project: @project, metric: @metric diff --git a/app/views/projects/protected_branches/shared/_branches_list.html.haml b/app/views/projects/protected_branches/shared/_branches_list.html.haml index b13117960dd..5964f2bfeda 100644 --- a/app/views/projects/protected_branches/shared/_branches_list.html.haml +++ b/app/views/projects/protected_branches/shared/_branches_list.html.haml @@ -1,7 +1,7 @@ .protected-branches-list.js-protected-branches-list.qa-protected-branches-list - if @protected_branches.empty? .card-header.bg-white - = s_("ProtectedBranch|Protected branch (%{protected_branches_count})") % { protected_branches_count: @protected_branches_count } + = s_("ProtectedBranch|Protected branch (%{protected_branches_count})") % { protected_branches_count: 0 } %p.settings-message.text-center = s_("ProtectedBranch|There are currently no protected branches, protect a branch with the form above.") - else diff --git a/app/views/projects/protected_branches/shared/_protected_branch.html.haml b/app/views/projects/protected_branches/shared/_protected_branch.html.haml index 02ec778b97c..f3bb2a66a4c 100644 --- a/app/views/projects/protected_branches/shared/_protected_branch.html.haml +++ b/app/views/projects/protected_branches/shared/_protected_branch.html.haml @@ -5,11 +5,11 @@ %span.ref-name= protected_branch.name - if @project.root_ref?(protected_branch.name) - %span.badge.gl-badge.badge-pill.badge-info.d-inline default + = gl_badge_tag s_('ProtectedBranch|default'), variant: :info %div - if protected_branch.wildcard? - - matching_branches = protected_branch.matching(repository.branches) + - matching_branches = protected_branch.matching(repository.branch_names) = link_to pluralize(matching_branches.count, "matching branch"), namespace_project_protected_branch_path(@project.namespace, @project, protected_branch) - elsif !protected_branch.commit %span.text-muted Branch was deleted. @@ -20,4 +20,4 @@ - if can_admin_project %td - = link_to 'Unprotect', [@project, protected_branch, { update_section: 'js-protected-branches-settings' }], disabled: local_assigns[:disabled], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn gl-button btn-warning" + = link_to s_('ProtectedBranch|Unprotect'), [@project, protected_branch, { update_section: 'js-protected-branches-settings' }], disabled: local_assigns[:disabled], data: { confirm: s_('ProtectedBranch|Branch will be writable for developers. Are you sure?') }, method: :delete, class: "btn gl-button btn-warning" diff --git a/app/views/projects/protected_tags/shared/_protected_tag.html.haml b/app/views/projects/protected_tags/shared/_protected_tag.html.haml index 70357f39e44..b312a09aadd 100644 --- a/app/views/projects/protected_tags/shared/_protected_tag.html.haml +++ b/app/views/projects/protected_tags/shared/_protected_tag.html.haml @@ -6,7 +6,7 @@ = gl_badge_tag s_('ProtectedTags|default'), variant: :info, class: 'gl-ml-2' %td - if protected_tag.wildcard? - - matching_tags = protected_tag.matching(repository.tags) + - matching_tags = protected_tag.matching(repository.tag_names) = link_to pluralize(matching_tags.count, "matching tag"), project_protected_tag_path(@project, protected_tag) - else - if commit = protected_tag.commit diff --git a/app/views/projects/protected_tags/shared/_tags_list.html.haml b/app/views/projects/protected_tags/shared/_tags_list.html.haml index f3cf4013898..5f3ea281278 100644 --- a/app/views/projects/protected_tags/shared/_tags_list.html.haml +++ b/app/views/projects/protected_tags/shared/_tags_list.html.haml @@ -1,7 +1,7 @@ .protected-tags-list.js-protected-tags-list - if @protected_tags.empty? .card-header - Protected tags (#{@protected_tags_count}) + Protected tags (0) %p.settings-message.text-center No tags are protected. - else diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 03927cd3bfa..3efe1fd2e82 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -12,7 +12,7 @@ "containers_error_image" => image_path('illustrations/docker-error-state.svg'), "repository_url" => escape_once(@project.container_registry_url), "registry_host_url_with_port" => escape_once(registry_config.host_port), - "expiration_policy_help_page_path" => help_page_path('user/packages/container_registry/index.md', anchor: 'cleanup-policy'), + "expiration_policy_help_page_path" => help_page_path('user/packages/container_registry/reduce_container_registry_storage', anchor: 'cleanup-policy'), "garbage_collection_help_page_path" => help_page_path('administration/packages/container_registry', anchor: 'container-registry-garbage-collection'), "run_cleanup_policies_help_page_path" => help_page_path('administration/packages/container_registry', anchor: 'run-the-cleanup-policy-now'), "project_path": @project.full_path, diff --git a/app/views/projects/runners/_group_runners.html.haml b/app/views/projects/runners/_group_runners.html.haml index 183e747afdd..c25fd7a7587 100644 --- a/app/views/projects/runners/_group_runners.html.haml +++ b/app/views/projects/runners/_group_runners.html.haml @@ -29,9 +29,9 @@ - if can?(current_user, :admin_group_runners, @project.group) - group_link = link_to _("group's CI/CD settings."), group_settings_ci_cd_path(@project.group) - = _('Group maintainers can register group runners in the %{link}').html_safe % { link: group_link } + = _('Group owners can register group runners in the %{link}').html_safe % { link: group_link } - else - = _('Ask your group maintainer to set up a group runner.') + = _('Ask your group owner to set up a group runner.') - else %h4.underlined-title diff --git a/app/views/projects/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml index 5e999b7afb3..1357846876e 100644 --- a/app/views/projects/runners/_specific_runners.html.haml +++ b/app/views/projects/runners/_specific_runners.html.haml @@ -17,7 +17,7 @@ group_path: '' } - else = _('Please contact an admin to register runners.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'runner-registration'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'prevent-users-from-registering-runners'), target: '_blank', rel: 'noopener noreferrer' %hr diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index dbc204ff9bf..419dd827e49 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -6,9 +6,12 @@ - if integration.operating? = sprite_icon('check', css_class: 'gl-text-green-500') -= form_for(integration, as: :service, url: scoped_integration_path(integration, project: @project, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, integration) } }) do |form| - = render 'shared/service_settings', form: form, integration: integration - %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referer } +- if vue_integration_form_enabled? + = render 'shared/integration_settings', integration: integration +- else + = form_for(integration, as: :service, url: scoped_integration_path(integration, project: @project, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_integration_path(@project, integration), testid: 'integration-form' } }) do |form| + = render 'shared/integration_settings', form: form, integration: integration + %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referer } - if lookup_context.template_exists?('show', "projects/services/#{integration.to_param}", true) %hr diff --git a/app/views/projects/settings/access_tokens/index.html.haml b/app/views/projects/settings/access_tokens/index.html.haml index 4e946050881..e4b027fcc44 100644 --- a/app/views/projects/settings/access_tokens/index.html.haml +++ b/app/views/projects/settings/access_tokens/index.html.haml @@ -5,7 +5,7 @@ - @content_class = 'limit-container-width' unless fluid_layout .row.gl-mt-3 - .col-lg-4.profile-settings-sidebar + .col-lg-4 %h4.gl-mt-0 = page_title %p @@ -24,26 +24,26 @@ = _('You can enable project access token creation in %{link_start}group settings%{link_end}.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } .col-lg-8 - - if @new_project_access_token + - if @new_resource_access_token = render 'shared/access_tokens/created_container', type: type, - new_token_value: @new_project_access_token + new_token_value: @new_resource_access_token - if current_user.can?(:create_resource_access_tokens, @project) = render 'shared/access_tokens/form', type: type, path: project_settings_access_tokens_path(@project), - project: @project, - token: @project_access_token, + resource: @project, + token: @resource_access_token, scopes: @scopes, access_levels: ProjectMember.access_level_roles, default_access_level: Gitlab::Access::MAINTAINER, - prefix: :project_access_token, + prefix: :resource_access_token, help_path: help_page_path('user/project/settings/project_access_tokens', anchor: 'scopes-for-a-project-access-token') = render 'shared/access_tokens/table', - active_tokens: @active_project_access_tokens, - project: @project, + active_tokens: @active_resource_access_tokens, + resource: @project, type: type, type_plural: type_plural, revoke_route_helper: ->(token) { revoke_namespace_project_settings_access_token_path(id: token) }, diff --git a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml index e200635ba82..43d34173af6 100644 --- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml +++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml @@ -26,7 +26,7 @@ = gl_badge_tag badge_for_auto_devops_scope(@project), { variant: :info }, { class: 'js-instance-default-badge'} .form-text.text-muted = s_('CICD|The Auto DevOps pipeline runs if no alternative CI configuration file is found.') - = link_to _('Learn more.'), help_page_path('topics/autodevops/index.md'), target: '_blank' + = link_to _('Learn more.'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer' .card-footer.js-extra-settings{ class: auto_devops_enabled || 'hidden' } - if @project.all_clusters.empty? %p.settings-message.text-center @@ -40,18 +40,18 @@ = form.radio_button :deploy_strategy, 'continuous', class: 'form-check-input' = form.label :deploy_strategy_continuous, class: 'form-check-label' do = s_('CICD|Continuous deployment to production') - = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-deploy'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-deploy'), target: '_blank', rel: 'noopener noreferrer' .form-check = form.radio_button :deploy_strategy, 'timed_incremental', class: 'form-check-input' = form.label :deploy_strategy_timed_incremental, class: 'form-check-label' do = s_('CICD|Continuous deployment to production using timed incremental rollout') - = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'timed-incremental-rollout-to-production'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'timed-incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' .form-check = form.radio_button :deploy_strategy, 'manual', class: 'form-check-input' = form.label :deploy_strategy_manual, class: 'form-check-label' do = s_('CICD|Automatic deployment to staging, manual deployment to production') - = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'incremental-rollout-to-production'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "btn gl-button btn-confirm gl-mt-5", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/projects/settings/ci_cd/_form.html.haml b/app/views/projects/settings/ci_cd/_form.html.haml index a91c12d01ad..d3cdfc4f7c9 100644 --- a/app/views/projects/settings/ci_cd/_form.html.haml +++ b/app/views/projects/settings/ci_cd/_form.html.haml @@ -10,7 +10,7 @@ %strong= _("Public pipelines") .form-text.text-muted = _("Allow public access to pipelines and job details, including output logs and artifacts.") - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'change-which-users-can-view-your-pipelines'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'change-which-users-can-view-your-pipelines'), target: '_blank', rel: 'noopener noreferrer' .form-group .form-check @@ -19,7 +19,7 @@ %strong= _("Auto-cancel redundant pipelines") .form-text.text-muted = _("New pipelines cause older pending or running pipelines on the same branch to be cancelled.") - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'auto-cancel-redundant-pipelines'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'auto-cancel-redundant-pipelines'), target: '_blank', rel: 'noopener noreferrer' .form-group .form-check @@ -29,14 +29,14 @@ %strong= _("Skip outdated deployment jobs") .form-text.text-muted = _("When a deployment job is successful, skip older deployment jobs that are still pending.") - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'skip-outdated-deployment-jobs'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'skip-outdated-deployment-jobs'), target: '_blank', rel: 'noopener noreferrer' .form-group = f.label :ci_config_path, _('CI/CD configuration file'), class: 'label-bold' = f.text_field :ci_config_path, class: 'form-control', placeholder: '.gitlab-ci.yml' %p.form-text.text-muted = html_escape(_("The name of the CI/CD configuration file. A path relative to the root directory is optional (for example %{code_open}my/path/.myfile.yml%{code_close}).")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank', rel: 'noopener noreferrer' %hr .form-group @@ -44,7 +44,7 @@ = _("Git strategy") %p = _("Choose which Git strategy to use when fetching the project.") - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'choose-the-default-git-strategy'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'choose-the-default-git-strategy'), target: '_blank', rel: 'noopener noreferrer' .form-check = f.radio_button :build_allow_git_fetch, 'false', { class: 'form-check-input' } = f.label :build_allow_git_fetch_false, class: 'form-check-label' do @@ -66,7 +66,7 @@ = form.number_field :default_git_depth, { class: 'form-control gl-form-input', min: 0, max: 1000 } %p.form-text.text-muted = html_escape(_('The number of changes to fetch from GitLab when cloning a repository. Lower values can speed up pipeline execution. Set to %{code_open}0%{code_close} or blank to fetch all branches and tags for each job')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'limit-the-number-of-changes-fetched-during-clone'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'limit-the-number-of-changes-fetched-during-clone'), target: '_blank', rel: 'noopener noreferrer' %hr .form-group @@ -74,7 +74,7 @@ = f.text_field :build_timeout_human_readable, class: 'form-control gl-form-input' %p.form-text.text-muted = html_escape(_('Jobs fail if they run longer than the timeout time. Input value is in seconds by default. Human readable input is also accepted, for example %{code_open}1 hour%{code_close}.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'set-a-limit-for-how-long-jobs-can-run'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'set-a-limit-for-how-long-jobs-can-run'), target: '_blank', rel: 'noopener noreferrer' - if can?(current_user, :update_max_artifacts_size, @project) .form-group @@ -82,7 +82,7 @@ = f.number_field :max_artifacts_size, class: 'form-control gl-form-input' %p.form-text.text-muted = _("The maximum file size in megabytes for individual job artifacts.") - = link_to sprite_icon('question-o'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size'), target: '_blank', rel: 'noopener noreferrer' .form-group = f.label :build_coverage_regex, _("Test coverage parsing"), class: 'label-bold' @@ -94,7 +94,7 @@ .input-group-text / %p.form-text.text-muted = html_escape(_('The regular expression used to find test coverage output in the job log. For example, use %{regex} for Simplecov (Ruby). Leave blank to disable.')) % { regex: '<code>\(\d+.\d+%\)</code>'.html_safe } - = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'add-test-coverage-results-to-a-merge-request'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'add-test-coverage-results-to-a-merge-request'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), class: "btn gl-button btn-confirm", data: { qa_selector: 'save_general_pipelines_changes_button' } diff --git a/app/views/projects/settings/packages_and_registries/show.html.haml b/app/views/projects/settings/packages_and_registries/show.html.haml index 626ddc20431..07910899aa0 100644 --- a/app/views/projects/settings/packages_and_registries/show.html.haml +++ b/app/views/projects/settings/packages_and_registries/show.html.haml @@ -10,6 +10,6 @@ is_admin: current_user&.admin.to_s, admin_settings_path: ci_cd_admin_application_settings_path(anchor: 'js-registry-settings'), enable_historic_entries: container_expiration_policies_historic_entry_enabled?(@project).to_s, - help_page_path: help_page_path('user/packages/container_registry/index', anchor: 'cleanup-policy'), + help_page_path: help_page_path('user/packages/container_registry/reduce_container_registry_storage', anchor: 'cleanup-policy'), show_cleanup_policy_on_alert: show_cleanup_policy_on_alert(@project).to_s, - tags_regex_help_page_path: help_page_path('user/packages/container_registry/index', anchor: 'regex-pattern-examples') } } + tags_regex_help_page_path: help_page_path('user/packages/container_registry/reduce_container_registry_storage', anchor: 'regex-pattern-examples') } } diff --git a/app/views/projects/starrers/index.html.haml b/app/views/projects/starrers/index.html.haml index 7c8314c157d..618c4c249a1 100644 --- a/app/views/projects/starrers/index.html.haml +++ b/app/views/projects/starrers/index.html.haml @@ -12,7 +12,7 @@ = search_field_tag :search, params[:search], { placeholder: _('Search'), class: 'form-control', spellcheck: false } %button.user-search-btn{ type: "submit", "aria-label" => _("Submit search") } = sprite_icon('search') - .dropdown.inline.user-sort-dropdown + .dropdown.inline.gl-ml-3 = dropdown_toggle(starrers_sort_options_hash[@sort], { toggle: 'dropdown' }) %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable %li.dropdown-header diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index 60cc043f813..202c0f22420 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -4,8 +4,9 @@ #js-repo-breadcrumb{ data: breadcrumb_data_attributes } +#js-blob-controls .tree-controls - .d-block.d-sm-flex.flex-wrap.align-items-start.gl-children-ml-sm-3< + .d-block.d-sm-flex.flex-wrap.align-items-start.gl-children-ml-sm-3.gl-first-child-ml-sm-0< = render_if_exists 'projects/tree/lock_link' #js-tree-history-link{ data: { history_link: project_commits_path(@project, @ref) } } diff --git a/app/views/projects/triggers/_index.html.haml b/app/views/projects/triggers/_index.html.haml index 85ecfe7a982..8b3d0ef17a4 100644 --- a/app/views/projects/triggers/_index.html.haml +++ b/app/views/projects/triggers/_index.html.haml @@ -45,6 +45,7 @@ %pre :plain curl -X POST \ + --fail \ -F token=TOKEN \ -F ref=REF_NAME \ #{builds_trigger_url(@project.id)} @@ -54,7 +55,7 @@ %pre :plain script: - - "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}" + - "curl -X POST --fail -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}" %h5.gl-mt-3 = _('Use webhook') @@ -73,6 +74,7 @@ %pre :plain curl -X POST \ + --fail \ -F token=TOKEN \ -F "ref=REF_NAME" \ -F "variables[RUN_NIGHTLY_BUILD]=true" \ diff --git a/app/views/registrations/welcome/show.html.haml b/app/views/registrations/welcome/show.html.haml index 65a1ffa3e46..ca2f225a2d8 100644 --- a/app/views/registrations/welcome/show.html.haml +++ b/app/views/registrations/welcome/show.html.haml @@ -2,6 +2,10 @@ - page_title _('Your profile') - add_page_specific_style 'page_bundles/signup' - gitlab_experience_text = _('To personalize your GitLab experience, we\'d like to know a bit more about you') +- content_for :page_specific_javascripts do + = render "layouts/google_tag_manager_head" + = render "layouts/one_trust" += render "layouts/google_tag_manager_body" .row.gl-flex-grow-1 .d-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-px-5.gl-pb-5 @@ -18,7 +22,7 @@ .row .form-group.col-sm-12 = f.label :role, _('Role'), class: 'label-bold' - = f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, {}, class: 'form-control js-user-role-dropdown', autofocus: true + = f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, { include_blank: _('Select a role') }, class: 'form-control js-user-role-dropdown', autofocus: true, required: true, data: { qa_selector: 'role_dropdown' } - if Feature.enabled?(:user_other_role_details) .row .form-group.col-sm-12.js-other-role-group.hidden diff --git a/app/views/sandbox/mermaid.html.erb b/app/views/sandbox/mermaid.html.erb new file mode 100644 index 00000000000..2d2391c8866 --- /dev/null +++ b/app/views/sandbox/mermaid.html.erb @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head> + <%= webpack_bundle_tag("sandboxed_mermaid") %> + </head> + <body> + <div id="app"></div> + </body> +</html> diff --git a/app/views/shared/_confirm_modal.html.haml b/app/views/shared/_confirm_modal.html.haml deleted file mode 100644 index 4cb3f6d1739..00000000000 --- a/app/views/shared/_confirm_modal.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -#modal-confirm-danger.modal.qa-confirm-modal{ tabindex: -1 } - .modal-dialog - .modal-content - .modal-header - %h3.page-title= _('Confirmation required') - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": "true" } × - - .modal-body - %p.text-danger.js-confirm-text - - %p - %span.js-warning-text= _('This action can lead to data loss. To prevent accidental actions we ask you to confirm your intention.') - %br - - phrase_code = '<code class="js-legacy-confirm-danger-match">%{phrase_name}</code>'.html_safe % { phrase_name: phrase } - = _('Please type %{phrase_code} to proceed or close this modal to cancel.').html_safe % { phrase_code: phrase_code } - - .form-group - = text_field_tag 'confirm_name_input', '', class: 'form-control js-legacy-confirm-danger-input qa-confirm-input' - .form-actions - = submit_tag _('Confirm'), class: "gl-button btn btn-danger js-legacy-confirm-danger-submit qa-confirm-button" diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_integration_settings.html.haml index adacaeadfab..93606ca0aba 100644 --- a/app/views/shared/_service_settings.html.haml +++ b/app/views/shared/_integration_settings.html.haml @@ -1,6 +1,6 @@ = form_errors(integration) -.service-settings +%div{ data: { testid: "integration-settings-form" } } - if @default_integration .js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group, project: @project) } .js-vue-integration-settings{ data: integration_form_data(integration, group: @group, project: @project) } diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index e4ef0a52eba..9428813f6b0 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -10,18 +10,18 @@ = render "shared/label_row", label: label, force_priority: force_priority %ul.label-actions-list - if can?(current_user, :admin_label, @project) - %li.inline.js-toggle-priority{ data: { url: remove_priority_project_label_path(@project, label), + %li.gl-display-inline-block.js-toggle-priority.gl-ml-3{ data: { url: remove_priority_project_label_path(@project, label), dom_id: dom_id(label), type: label.type } } - %button.add-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip.gl-ml-3{ title: _('Prioritize'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Prioritize label') } + %button.add-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip{ title: _('Prioritize'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Prioritize label') } = sprite_icon('star-o') - %button.remove-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip.gl-ml-3{ title: _('Remove priority'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Deprioritize label') } + %button.remove-priority.btn.gl-button.btn-default-tertiary.btn-sm.has-tooltip{ title: _('Remove priority'), type: 'button', data: { placement: 'bottom' }, aria_label: _('Deprioritize label') } = sprite_icon('star') - if can?(current_user, :admin_label, label) - %li.inline + %li.gl-display-inline-block = link_to label.edit_path, class: 'btn gl-button btn-default-tertiary btn-sm edit has-tooltip', title: _('Edit'), data: { placement: 'bottom' }, aria_label: _('Edit') do = sprite_icon('pencil') - if can?(current_user, :admin_label, label) - %li.inline + %li.gl-display-inline-block .dropdown %button{ type: 'button', class: 'btn gl-button btn-default-tertiary btn-sm js-label-options-dropdown', data: { toggle: 'dropdown' }, aria_label: _('Label actions dropdown') } = sprite_icon('ellipsis_v') @@ -41,23 +41,23 @@ %button.text-danger.js-delete-label-modal-button{ type: 'button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } } = _('Delete') - if current_user - %li.inline.label-subscription + %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3 - if label.can_subscribe_to_label_in_different_levels? - %button.js-unsubscribe-button.gl-button.label-subscribe-button.btn.btn-default.gl-ml-3{ class: ('hidden' if status.unsubscribed?), data: { url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } - %span= _('Unsubscribe') + %button.js-unsubscribe-button.gl-button.btn.btn-default.gl-w-full{ class: ('hidden' if status.unsubscribed?), data: { url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } + %span.gl-button-text= _('Unsubscribe') .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } - %button.gl-button.label-subscribe-button.btn.btn-default.gl-ml-3{ data: { toggle: 'dropdown' } } - %span + %button.gl-button.btn.btn-default.gl-w-full{ data: { toggle: 'dropdown' } } + %span.gl-button-text = _('Subscribe') = sprite_icon('chevron-down') .dropdown-menu.dropdown-open-left %ul %li - %button.js-subscribe-button.label-subscribe-button.gl-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } - %span= _('Subscribe at project level') + %button.js-subscribe-button{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } + %span.gl-button-text= _('Subscribe at project level') %li - %button.js-subscribe-button.js-group-level.label-subscribe-button.gl-button.btn.btn-default{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } - %span= _('Subscribe at group level') + %button.js-subscribe-button.js-group-level{ class: ('hidden' unless status.unsubscribed?), data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } + %span.gl-button-text= _('Subscribe at group level') - else - %button.gl-button.js-subscribe-button.label-subscribe-button.btn.btn-default.gl-ml-3{ data: { status: status, url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } - %span= label_subscription_toggle_button_text(label, @project) + %button.gl-button.js-subscribe-button.btn.btn-default.gl-w-full{ data: { status: status, url: toggle_subscription_path, toggle: 'tooltip' }, title: tooltip_title } + %span.gl-button-text= label_subscription_toggle_button_text(label, @project) diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml index d5f4add2796..08003346d09 100644 --- a/app/views/shared/_new_project_item_select.html.haml +++ b/app/views/shared/_new_project_item_select.html.haml @@ -1,6 +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.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!" } + %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!" } = loading_icon(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') } diff --git a/app/views/shared/_old_visibility_level.html.haml b/app/views/shared/_old_visibility_level.html.haml index 8a9cc7ab8a2..104c722ee65 100644 --- a/app/views/shared/_old_visibility_level.html.haml +++ b/app/views/shared/_old_visibility_level.html.haml @@ -1,6 +1,6 @@ .form-group.row .col-sm-2.col-form-label = _('Visibility level') - = link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), target: '_blank', rel: 'noopener noreferrer' .col-sm-10 = render 'shared/visibility_level', f: f, visibility_level: visibility_level, can_change_visibility_level: can_change_visibility_level, form_model: form_model, with_label: with_label diff --git a/app/views/shared/_registration_features_discovery_message.html.haml b/app/views/shared/_registration_features_discovery_message.html.haml index 8bcd826d8c0..8a16d36b836 100644 --- a/app/views/shared/_registration_features_discovery_message.html.haml +++ b/app/views/shared/_registration_features_discovery_message.html.haml @@ -1,9 +1,9 @@ -- license = local_assigns.fetch(:license) +- 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') - service_ping_settings_path = metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings') %div - %span= s_('RegistrationFeatures|Want to use this feature for free?') - - if license.present? + %span= sprintf(s_('RegistrationFeatures|Want to %{feature_title} for free?'), { feature_title: feature_title }) + - if Gitlab.ee? = link_to s_('RegistrationFeatures|Enable Service Ping and register for this feature.'), service_ping_settings_path - = sprintf(s_('RegistrationFeatures|Read more about the %{linkStart}Registration Features Program%{linkEnd}.') , { linkStart: "<a href=\"#{registration_features_docs_path}\" target=\"_blank\">", linkEnd: "</a>", }).html_safe + = sprintf(s_('RegistrationFeatures|Read more about the %{linkStart}%{label}%{linkEnd}.') , { linkStart: "<a href=\"#{registration_features_docs_path}\" target=\"_blank\">", label: s_('RegistrationFeatures|Registration Features Program'), linkEnd: "</a>" }).html_safe diff --git a/app/views/shared/_web_ide_button.html.haml b/app/views/shared/_web_ide_button.html.haml index f9c6afcbc32..82af52cdd59 100644 --- a/app/views/shared/_web_ide_button.html.haml +++ b/app/views/shared/_web_ide_button.html.haml @@ -6,5 +6,3 @@ = render 'shared/confirm_fork_modal', fork_path: fork_and_edit_path(@project, @ref, @path), type: 'edit' - if show_web_ide_button? = render 'shared/confirm_fork_modal', fork_path: ide_fork_and_edit_path(@project, @ref, @path), type: 'webide' -- if show_gitpod_button? - = render 'shared/gitpod/enable_gitpod_modal' diff --git a/app/views/shared/access_tokens/_form.html.haml b/app/views/shared/access_tokens/_form.html.haml index 6435475a9a3..a52b7236137 100644 --- a/app/views/shared/access_tokens/_form.html.haml +++ b/app/views/shared/access_tokens/_form.html.haml @@ -1,7 +1,7 @@ - title = local_assigns.fetch(:title, _('Add a %{type}') % { type: type }) - prefix = local_assigns.fetch(:prefix, :personal_access_token) - help_path = local_assigns.fetch(:help_path) -- project = local_assigns.fetch(:project, false) +- resource = local_assigns.fetch(:resource, false) - access_levels = local_assigns.fetch(:access_levels, false) - default_access_level = local_assigns.fetch(:default_access_level, false) @@ -32,12 +32,12 @@ .js-access-tokens-expires-at = f.text_field :expires_at, class: 'datepicker gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off', data: { js_name: 'expiresAt' } - - if project + - if resource .row .form-group.col-md-6 = label_tag :access_level, _("Select a role"), class: "label-bold" .select-wrapper - = select_tag :"#{prefix}[access_level]", options_for_select(access_levels, default_access_level), class: "form-control project-access-select select-control", data: { qa_selector: 'access_token_access_level' } + = select_tag :"#{prefix}[access_level]", options_for_select(access_levels, default_access_level), class: "form-control select-control", data: { qa_selector: 'access_token_access_level' } = sprite_icon('chevron-down', css_class: "gl-icon gl-absolute gl-top-3 gl-right-3 gl-text-gray-200") .form-group @@ -45,7 +45,7 @@ = s_('Tokens|Select scopes') %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' + = link_to _("Learn more."), help_path, target: '_blank', rel: 'noopener noreferrer' = render 'shared/tokens/scopes_form', prefix: prefix, token: token, scopes: scopes - if prefix == :personal_access_token && Feature.enabled?(:personal_access_tokens_scoped_to_projects, current_user) diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml index c096044e439..aa579b4a672 100644 --- a/app/views/shared/access_tokens/_table.html.haml +++ b/app/views/shared/access_tokens/_table.html.haml @@ -1,7 +1,7 @@ - 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) -- project = local_assigns.fetch(:project, false) -- personal = !impersonation && !project +- resource = local_assigns.fetch(:resource, false) +- personal = !impersonation && !resource %hr @@ -28,9 +28,9 @@ %th= s_('AccessTokens|Created') %th = _('Last Used') - = link_to sprite_icon('question-o'), help_page_path('user/profile/personal_access_tokens.md', anchor: 'view-the-last-time-a-token-was-used'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/profile/personal_access_tokens.md', anchor: 'view-the-last-time-a-token-was-used'), target: '_blank', rel: 'noopener noreferrer' %th= _('Expires') - - if project + - if resource %th= _('Role') %th %tbody @@ -54,8 +54,8 @@ = time_ago_with_tooltip(token.expires_at) - else %span.token-never-expires-label= _('Never') - - if project - %td= project.project_member(token.user).human_access + - if resource + %td= resource.member(token.user).human_access %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: "gl-button btn btn-danger btn-sm float-right qa-revoke-button #{'btn-danger-secondary' unless token.expires?}", data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } - else .settings-message.text-center diff --git a/app/views/shared/empty_states/_deploy_keys.html.haml b/app/views/shared/empty_states/_deploy_keys.html.haml deleted file mode 100644 index 6c615de9c56..00000000000 --- a/app/views/shared/empty_states/_deploy_keys.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.empty-state.gl-display-flex.gl-flex-direction-column.gl-flex-wrap.gl-text-center - .gl-flex-grow-0.gl-flex-shrink-0 - .svg-250.svg-content - = image_tag 'illustrations/empty-state/empty-deploy-keys-lg.svg' - .gl-flex-grow-0.gl-flex-shrink-0 - .text-content.gl-mx-auto.gl-my-0.gl-p-5 - %h4.h4= _('Deploy Keys') - %p= _('Deploy keys grant read/write access to all repositories in your instance') - = link_to _('New deploy key'), new_admin_deploy_key_path, class: 'gl-button btn btn-confirm btn-md' diff --git a/app/views/shared/empty_states/_issues.html.haml b/app/views/shared/empty_states/_issues.html.haml index 9842457a2eb..6b571794625 100644 --- a/app/views/shared/empty_states/_issues.html.haml +++ b/app/views/shared/empty_states/_issues.html.haml @@ -42,7 +42,7 @@ - if has_button .text-center - if project_select_button - = render 'shared/new_project_item_select', path: 'issues/new', label: _('New issue'), type: :issues, with_feature_enabled: 'issues' + = render 'shared/new_project_item_select', path: 'issues/new', label: _('issue'), type: :issues, with_feature_enabled: 'issues' - elsif show_new_issue_link?(@project) = link_to _('New issue'), button_path, class: 'gl-button btn btn-confirm', id: 'new_issue_link' diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index 72db4d4c846..d0c4fb2432c 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -40,6 +40,6 @@ - if has_button .text-center - if project_select_button - = render 'shared/new_project_item_select', path: 'merge_requests/new', label: _('New merge request'), type: :merge_requests, with_feature_enabled: 'merge_requests' + = 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' diff --git a/app/views/shared/empty_states/_wikis.html.haml b/app/views/shared/empty_states/_wikis.html.haml index 917ef666e85..c3120774826 100644 --- a/app/views/shared/empty_states/_wikis.html.haml +++ b/app/views/shared/empty_states/_wikis.html.haml @@ -13,7 +13,7 @@ = create_link - if show_enable_confluence_integration?(@wiki.container) = link_to s_('WikiEmpty|Enable the Confluence Wiki integration'), - edit_project_service_path(@project, :confluence), + edit_project_integration_path(@project, :confluence), class: 'btn gl-button', title: s_('WikiEmpty|Enable the Confluence Wiki integration') - elsif @project && can?(current_user, :read_issue, @project) diff --git a/app/views/shared/gitpod/_enable_gitpod_modal.html.haml b/app/views/shared/gitpod/_enable_gitpod_modal.html.haml deleted file mode 100644 index 6a8ff98a09e..00000000000 --- a/app/views/shared/gitpod/_enable_gitpod_modal.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -#modal-enable-gitpod.modal.qa-enable-gitpod-modal - .modal-dialog - .modal-content - .modal-header - %h3.page-title= _('Enable Gitpod?') - %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } - %span{ "aria-hidden": "true" } × - .modal-body.p-3 - %p= (_("To use Gitpod you must first enable the feature in the integrations section of your %{user_prefs}.") % { user_prefs: link_to(_('user preferences'), profile_preferences_path(anchor: 'gitpod')) }).html_safe - .modal-footer - = link_to _('Cancel'), '#', class: "gl-button btn btn-default btn-cancel", "data-dismiss" => "modal" - = link_to _('Enable Gitpod'), profile_path(user: { gitpod_enabled: true}), class: 'gl-button btn btn-confirm', method: :put diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml index ab6875a09f7..d358340814c 100644 --- a/app/views/shared/hook_logs/_content.html.haml +++ b/app/views/shared/hook_logs/_content.html.haml @@ -2,8 +2,7 @@ %h4 POST = hook_log.url - %span.badge.gl-badge.badge-pill.badge-muted.sm.gl-ml-3 - = hook_log.trigger.singularize.titleize + = gl_badge_tag hook_log.trigger.singularize.titleize, { size: :sm }, { class: 'gl-ml-3' } %p = _('Completed in %{duration_seconds} seconds (%{relative_time})').html_safe % { duration_seconds: number_with_precision(hook_log.execution_duration, precision: 2), relative_time: time_ago_with_tooltip(hook_log.created_at) } diff --git a/app/views/shared/hook_logs/_recent_deliveries_table.html.haml b/app/views/shared/hook_logs/_recent_deliveries_table.html.haml index 31ef8560781..3c91c2f6ab4 100644 --- a/app/views/shared/hook_logs/_recent_deliveries_table.html.haml +++ b/app/views/shared/hook_logs/_recent_deliveries_table.html.haml @@ -13,8 +13,7 @@ %td = render partial: 'shared/hook_logs/status_label', locals: { hook_log: hook_log } %td.d-none.d-sm-table-cell - %span.badge.badge-pill.gl-badge.badge-muted.sm - = hook_log.trigger.singularize.titleize + = gl_badge_tag hook_log.trigger.singularize.titleize, { size: :sm } %td #{number_with_precision(hook_log.execution_duration, precision: 2)} sec %td diff --git a/app/views/shared/hook_logs/_status_label.html.haml b/app/views/shared/hook_logs/_status_label.html.haml index b930074303c..6f82dc280f3 100644 --- a/app/views/shared/hook_logs/_status_label.html.haml +++ b/app/views/shared/hook_logs/_status_label.html.haml @@ -1,3 +1,4 @@ -- label_status = hook_log.success? ? 'badge-success' : 'badge-danger' -%span{ class: "badge badge-pill gl-badge sm #{label_status}" } - = hook_log.internal_error? ? _('Error') : hook_log.response_status +- badge_variant = hook_log.success? ? :success : :danger +- badge_text = hook_log.internal_error? ? _('Error') : hook_log.response_status + += gl_badge_tag badge_text, { variant: badge_variant, size: :sm } diff --git a/app/views/shared/integrations/_form.html.haml b/app/views/shared/integrations/_form.html.haml index 89c127408e1..e2457bc0632 100644 --- a/app/views/shared/integrations/_form.html.haml +++ b/app/views/shared/integrations/_form.html.haml @@ -1,4 +1,4 @@ - integration = local_assigns.fetch(:integration) -= form_for integration, as: :service, url: scoped_integration_path(integration, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration, group: @group) } } do |form| - = render 'shared/service_settings', form: form, integration: integration += form_for integration, as: :service, url: scoped_integration_path(integration, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration, group: @group), testid: 'integration-form' } } do |form| + = render 'shared/integration_settings', form: form, integration: integration diff --git a/app/views/shared/integrations/edit.html.haml b/app/views/shared/integrations/edit.html.haml index acb0c7ee52e..4ceaedc2a69 100644 --- a/app/views/shared/integrations/edit.html.haml +++ b/app/views/shared/integrations/edit.html.haml @@ -7,4 +7,7 @@ = @integration.title = render 'shared/integrations/tabs', integration: @integration, active_tab: 'edit' do - = render 'shared/integrations/form', integration: @integration + - if vue_integration_form_enabled? + = render 'shared/integration_settings', integration: @integration + - else + = render 'shared/integrations/form', integration: @integration diff --git a/app/views/shared/integrations/overrides.html.haml b/app/views/shared/integrations/overrides.html.haml index b8585fdef1f..4619675cfef 100644 --- a/app/views/shared/integrations/overrides.html.haml +++ b/app/views/shared/integrations/overrides.html.haml @@ -6,5 +6,4 @@ %h3.page-title = @integration.title -= render 'shared/integrations/tabs', integration: @integration, active_tab: 'overrides' do - .js-vue-integration-overrides{ data: integration_overrides_data(@integration) } +.js-vue-integration-overrides{ data: integration_overrides_data(@integration, project: @project, group: @group) } diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 4024c5b77f6..16301789b65 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -64,9 +64,9 @@ for this project. - if issuable.new_record? - = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button' } + = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button', track_experiment: 'promote_mr_approvals_in_free', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else - = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2' + = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2', data: { track_experiment: 'promote_mr_approvals_in_free', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - if issuable.new_record? = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default' diff --git a/app/views/shared/issuable/_label_page_create.html.haml b/app/views/shared/issuable/_label_page_create.html.haml index cf7e6cf8365..84cdf129cb2 100644 --- a/app/views/shared/issuable/_label_page_create.html.haml +++ b/app/views/shared/issuable/_label_page_create.html.haml @@ -6,7 +6,10 @@ .dropdown-page-two.dropdown-new-label = dropdown_title(create_label_title(subject), options: { back: true, close: show_close }) = dropdown_content do - .dropdown-labels-error.js-label-error + .js-label-error.gl-alert.gl-alert-danger.gl-mb-3 + .gl-alert-container + = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + .gl-alert-content %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/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index e097852216c..3975748ba57 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -5,6 +5,11 @@ - 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 @group.present? + - ff_resource = @group +- else + - ff_resource = board&.resource_parent&.group + - if is_epic_board - user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent) - elsif board @@ -26,7 +31,7 @@ = 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 Feature.enabled?(:issue_boards_filtered_search, board&.resource_parent) && board + - elsif Feature.enabled?(:issue_boards_filtered_search, ff_resource) && board #js-issue-board-filtered-search - else .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index 7233e671caa..76feb4d1613 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -25,7 +25,7 @@ = check_box_tag 'merge_request[squash]', '1', issuable_squash_option?(issuable, project), class: 'form-check-input' = label_tag 'merge_request[squash]', class: 'form-check-label' do Squash commits when merge request is accepted. - = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank' + = link_to sprite_icon('question-o'), help_page_path('user/project/merge_requests/squash_and_merge'), target: '_blank', rel: 'noopener noreferrer' - if project.squash_always? .gl-text-gray-400 = _('Required in this project.') diff --git a/app/views/shared/labels/_form.html.haml b/app/views/shared/labels/_form.html.haml index 6f65dbe4811..29f6dc02749 100644 --- a/app/views/shared/labels/_form.html.haml +++ b/app/views/shared/labels/_form.html.haml @@ -5,30 +5,35 @@ .col-sm-2.col-form-label = f.label :title .col-sm-10 - = f.text_field :title, class: "form-control js-label-title qa-label-title", required: true, autofocus: true + = f.text_field :title, class: "gl-form-input form-control js-label-title qa-label-title", required: true, autofocus: true = render_if_exists 'shared/labels/create_label_help_text' .form-group.row .col-sm-2.col-form-label = f.label :description .col-sm-10 - = f.text_field :description, class: "form-control js-quick-submit qa-label-description" + = f.text_field :description, class: "gl-form-input form-control js-quick-submit qa-label-description" .form-group.row .col-sm-2.col-form-label - = f.label :color, "Background color" + = f.label :color, _("Background color") .col-sm-10 .input-group .input-group-prepend .input-group-text.label-color-preview - = f.text_field :color, class: "form-control qa-label-color" + = f.text_field :color, class: "gl-form-input form-control qa-label-color" .form-text.text-muted - Choose any color. + = _('Choose any color.') %br - Or you can choose one of the suggested colors below + = _("Or you can choose one of the suggested colors below") = render_suggested_colors - .form-actions + .gl-display-flex.gl-justify-content-space-between.gl-p-5.gl-bg-gray-10.gl-border-t-solid.gl-border-t-gray-100.gl-border-t-1 + %div + - if @label.persisted? + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm js-save-button' + - else + = f.submit _('Create label'), class: 'btn gl-button btn-confirm js-save-button qa-label-create-button' + = link_to _('Cancel'), back_path, class: 'btn gl-button btn-default btn-cancel' - if @label.persisted? - = f.submit _('Save changes'), class: 'btn gl-button btn-confirm js-save-button' - - else - = f.submit 'Create label', class: 'btn gl-button btn-confirm js-save-button qa-label-create-button' - = link_to _('Cancel'), back_path, class: 'btn gl-button btn-default btn-cancel' + - presented_label = @label.present + %button.btn.btn-danger.gl-button.btn-danger-secondary.js-delete-label-modal-button{ type: 'button', data: { label_name: presented_label.name, subject_name: presented_label.subject_name, destroy_path: presented_label.destroy_path } } + %span.gl-button-text= _('Delete') diff --git a/app/views/shared/members/_badge.html.haml b/app/views/shared/members/_badge.html.haml index 5f925ff0cad..e7bd055fe5d 100644 --- a/app/views/shared/members/_badge.html.haml +++ b/app/views/shared/members/_badge.html.haml @@ -1,4 +1,4 @@ -- type ||= 'info' +- variant ||= :info %span.px-1.py-1 - %span{ class: "badge badge-pill gl-badge sm badge-#{type}" }= yield + = gl_badge_tag yield, variant: variant, size: :sm diff --git a/app/views/shared/members/_blocked_badge.html.haml b/app/views/shared/members/_blocked_badge.html.haml index 95335ebe74d..6795128279f 100644 --- a/app/views/shared/members/_blocked_badge.html.haml +++ b/app/views/shared/members/_blocked_badge.html.haml @@ -1,3 +1,3 @@ - if user.blocked? - = render 'shared/members/badge', type: 'danger' do + = render 'shared/members/badge', variant: :danger do = _("Blocked") diff --git a/app/views/shared/members/_its_you_badge.html.haml b/app/views/shared/members/_its_you_badge.html.haml index b53ffd8032d..4442e57f86e 100644 --- a/app/views/shared/members/_its_you_badge.html.haml +++ b/app/views/shared/members/_its_you_badge.html.haml @@ -1,3 +1,3 @@ - if user == current_user - = render 'shared/members/badge', type: 'success' do + = render 'shared/members/badge', variant: :success do = _("It's you") diff --git a/app/views/shared/members/_two_factor_auth_badge.html.haml b/app/views/shared/members/_two_factor_auth_badge.html.haml index 34850c135d6..f1cb7a5bd85 100644 --- a/app/views/shared/members/_two_factor_auth_badge.html.haml +++ b/app/views/shared/members/_two_factor_auth_badge.html.haml @@ -1,3 +1,3 @@ - if user.two_factor_enabled? - = render 'shared/members/badge', type: 'info' do + = render 'shared/members/badge', variant: :info do = _("2FA") diff --git a/app/views/shared/nav/_sidebar_menu.html.haml b/app/views/shared/nav/_sidebar_menu.html.haml index 4c4ceb9ea70..bc0648c14e0 100644 --- a/app/views/shared/nav/_sidebar_menu.html.haml +++ b/app/views/shared/nav/_sidebar_menu.html.haml @@ -13,7 +13,7 @@ %span.nav-item-name{ **sidebar_menu.title_html_options } = sidebar_menu.title - if sidebar_menu.has_pill? - %span.badge.badge-pill.count{ **sidebar_menu.pill_html_options } + = gl_badge_tag({ variant: :info, size: :sm }, { class: "count #{sidebar_menu.pill_html_options[:class]}" }) do = number_with_delimiter(sidebar_menu.pill_count) = render partial: 'shared/nav/sidebar_submenu', locals: { sidebar_menu: sidebar_menu } diff --git a/app/views/shared/notes/_hints.html.haml b/app/views/shared/notes/_hints.html.haml index 6231f817704..6c8b2a9e5bb 100644 --- a/app/views/shared/notes/_hints.html.haml +++ b/app/views/shared/notes/_hints.html.haml @@ -2,10 +2,10 @@ - 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' + = link_to _('Markdown'), help_page_path('user/markdown'), target: '_blank', rel: 'noopener noreferrer' - if supports_quick_actions and - = link_to _('quick actions'), help_page_path('user/project/quick_actions'), target: '_blank' + = link_to _('quick actions'), help_page_path('user/project/quick_actions'), target: '_blank', rel: 'noopener noreferrer' are - else is diff --git a/app/views/shared/runners/_shared_runners_description.html.haml b/app/views/shared/runners/_shared_runners_description.html.haml index e2b57a7fd73..2779901ca0c 100644 --- a/app/views/shared/runners/_shared_runners_description.html.haml +++ b/app/views/shared/runners/_shared_runners_description.html.haml @@ -1,5 +1,5 @@ -# "MaxBuilds" is a runner configuration keyword so it must not be translated. -- link = link_to 'MaxBuilds', 'https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section', target: '_blank' +- link = link_to 'MaxBuilds', 'https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section', target: '_blank', rel: 'noopener noreferrer' %h4 = _('Shared runners') diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index 18912bf149f..5650f08b2a9 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -4,12 +4,14 @@ = form.label :url, s_('Webhooks|URL'), class: 'label-bold' = form.text_field :url, class: 'form-control gl-form-input', placeholder: 'http://example.com/trigger-ci.json' %p.form-text.text-muted - = s_('Webhooks|URL must be percent-encoded if neccessary.') + = s_('Webhooks|URL must be percent-encoded if it contains one or more special characters.') .form-group = form.label :token, s_('Webhooks|Secret token'), class: 'label-bold' = form.text_field :token, class: 'form-control gl-form-input', placeholder: '' %p.form-text.text-muted - = s_('Webhooks|Use this token to validate received payloads. It is sent with the request in the X-Gitlab-Token HTTP header.') + - code_start = '<code>'.html_safe + - code_end = '</code>'.html_safe + = 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 @@ -19,37 +21,37 @@ %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 - = s_('Webhooks|URL is triggered by a push to the repository') + = 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|URL is triggered when a new tag is pushed to the repository') + = 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|URL is triggered when someone adds a comment') + = 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|URL is triggered when someone adds a comment on a confidential issue') + = 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|URL is triggered when an issue is created, updated, closed, or reopened') + = 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|URL is triggered when a confidential issue is created, updated, closed, or reopened') + = 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 @@ -58,43 +60,43 @@ = 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|URL is triggered when a merge request is created, updated, or merged') + = 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|URL is triggered when the job status changes') + = 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|URL is triggered when the pipeline status changes') + = 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|URL is triggered when a wiki page is created or updated') + = 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|URL is triggered when a deployment starts, finishes, fails, or is canceled') + = 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|URL is triggered when a feature flag is turned on or off') + = 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|URL is triggered when a release is created or updated') + = 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 diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml index 45baa7e2184..c5a03ef4dc1 100644 --- a/app/views/shared/web_hooks/_hook.html.haml +++ b/app/views/shared/web_hooks/_hook.html.haml @@ -1,22 +1,23 @@ +- sslStatus = hook.enable_ssl_verification ? _('enabled') : _('disabled') +- sslBadgeText = _('SSL Verification:') + ' ' + sslStatus + %li .row .col-md-8.col-lg-7 %strong.light-header = hook.url - if hook.rate_limited? - %span.gl-badge.badge-danger.badge-pill.sm= _('Disabled') + = gl_badge_tag(_('Disabled'), variant: :danger, size: :sm) - elsif hook.permanently_disabled? - %span.gl-badge.badge-danger.badge-pill.sm= s_('Webhooks|Failed to connect') + = gl_badge_tag(s_('Webhooks|Failed to connect'), variant: :danger, size: :sm) - elsif hook.temporarily_disabled? - %span.gl-badge.badge-warning.badge-pill.sm= s_('Webhooks|Fails to connect') + = gl_badge_tag(s_('Webhooks|Fails to connect'), variant: :warning, size: :sm) %div - hook.class.triggers.each_value do |trigger| - if hook.public_send(trigger) - %span.gl-badge.badge-muted.badge-pill.sm.gl-mt-2.deploy-project-label= trigger.to_s.titleize - %span.gl-badge.badge-muted.badge-pill.sm.gl-mt-2 - = _('SSL Verification:') - = hook.enable_ssl_verification ? _('enabled') : _('disabled') + = gl_badge_tag(trigger.to_s.titleize, size: :sm) + = gl_badge_tag(sslBadgeText, size: :sm) .col-md-4.col-lg-5.text-right-md.gl-mt-2 %span>= render 'shared/web_hooks/test_button', hook: hook, button_class: 'btn-sm btn-default gl-mr-3' diff --git a/app/views/shared/web_hooks/_index.html.haml b/app/views/shared/web_hooks/_index.html.haml index f1eef5d7f0f..5d07b0f95ab 100644 --- a/app/views/shared/web_hooks/_index.html.haml +++ b/app/views/shared/web_hooks/_index.html.haml @@ -11,4 +11,4 @@ = render 'shared/web_hooks/hook', hook: hook - else %p.text-center.gl-mt-3.gl-mb-3 - = _('No webhooks found, add one in the form above.') + = _('No webhooks enabled. Select trigger events above.') diff --git a/app/views/sherlock/file_samples/show.html.haml b/app/views/sherlock/file_samples/show.html.haml deleted file mode 100644 index b7e6f883667..00000000000 --- a/app/views/sherlock/file_samples/show.html.haml +++ /dev/null @@ -1,55 +0,0 @@ -- page_title t('sherlock.title'), t('sherlock.transaction'), - t('sherlock.file_sample') - -- header_title t('sherlock.title'), sherlock_transactions_path - -.row-content-block - .float-right - = link_to(sherlock_transaction_path(@transaction), class: 'btn gl-button') do - = sprite_icon('arrow-left') - = t('sherlock.transaction') - .oneline - = t('sherlock.file_sample') - = @file_sample.id - -.gl-mt-3 - %p - %span.light - #{t('sherlock.time')}: - %strong - = @file_sample.duration.round(2) - = t('sherlock.milliseconds') - %p - %span.light - #{t('sherlock.events')}: - %strong - = @file_sample.events - -%article.file-holder - .js-file-title.file-title - = sprite_icon("doc-text") - %strong - = @file_sample.file - .code.file-content.js-syntax-highlight - .line-numbers - %table.sherlock-line-samples-table.gl-mb-0 - %thead - %tr - %th= t('sherlock.line_capitalized') - %th= t('sherlock.events') - %th= t('sherlock.time') - %th= t('sherlock.percent') - %tbody - - @file_sample.line_samples.each_with_index do |sample, index| - %tr{ class: sample.majority_of?(@file_sample.duration) ? 'slow' : '' } - %td= index + 1 - %td= sample.events - %td - = sample.duration.round(2) - = t('sherlock.milliseconds') - %td - = sample.percentage_of(@file_sample.duration).round - = t('sherlock.percent') - - .sherlock-file-sample - = highlight(@file_sample.file, @file_sample.source) diff --git a/app/views/sherlock/queries/_backtrace.html.haml b/app/views/sherlock/queries/_backtrace.html.haml deleted file mode 100644 index 425113ba325..00000000000 --- a/app/views/sherlock/queries/_backtrace.html.haml +++ /dev/null @@ -1,31 +0,0 @@ -.gl-mt-3 - .card - .card-header - %strong - = t('sherlock.application_backtrace') - %ul.content-list - - @query.application_backtrace.each do |location| - %li - %strong - - if defined?(BetterErrors) - = link_to(location.path, BetterErrors.editor.url(location.path, location.line)) - - else - = location.path - %small.light - = t('sherlock.line') - = location.line - - .card - .card-header - %strong - = t('sherlock.full_backtrace') - %ul.content-list - - @query.backtrace.each do |location| - %li - - if location.application? - %strong= location.path - - else - = location.path - %small.light - = t('sherlock.line') - = location.line diff --git a/app/views/sherlock/queries/_general.html.haml b/app/views/sherlock/queries/_general.html.haml deleted file mode 100644 index a16314213c4..00000000000 --- a/app/views/sherlock/queries/_general.html.haml +++ /dev/null @@ -1,54 +0,0 @@ -.gl-mt-3 - .card - .card-header - %strong - = t('sherlock.general') - %ul.content-list - %li - %span.light - #{t('sherlock.time')}: - %strong - = @query.duration.round(4) - = t('sherlock.milliseconds') - %li - - frame = @query.last_application_frame - %span.light - #{t('sherlock.origin')}: - %strong - - if defined?(BetterErrors) - = link_to(frame.path, BetterErrors.editor.url(frame.path, frame.line)) - - else - = frame.path - %small.light - = t('sherlock.line') - = frame.line - - .card - .card-header - .float-right - %button.js-clipboard-trigger.gl-button.btn.btn-default.btn-sm{ title: t('sherlock.copy_to_clipboard'), type: :button } - = sprite_icon('copy-to-clipboard') - %pre.hidden - = @query.formatted_query - %strong - = t('sherlock.query') - %ul.content-list - %li - .code.js-syntax-highlight.sherlock-code - :preserve - #{highlight("#{@query.id}.sql", @query.formatted_query, language: 'sql')} - - .card - .card-header - .float-right - %button.js-clipboard-trigger.gl-button.btn.btn-default.btn-sm{ title: t('sherlock.copy_to_clipboard'), type: :button } - = sprite_icon('copy-to-clipboard') - %pre.hidden - = @query.explain - %strong - = t('sherlock.query_plan') - %ul.content-list - %li - .code.js-syntax-highlight.sherlock-code - %pre - %code= @query.explain diff --git a/app/views/sherlock/queries/show.html.haml b/app/views/sherlock/queries/show.html.haml deleted file mode 100644 index eea13d105d8..00000000000 --- a/app/views/sherlock/queries/show.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- page_title t('sherlock.title'), t('sherlock.transaction'), t('sherlock.query') -- header_title t('sherlock.title'), sherlock_transactions_path - -%ul.nav-links.nav.nav-tabs - %li.active - %a{ href: "#tab-general", data: { toggle: "tab" } } - = t('sherlock.general') - %li - %a{ href: "#tab-backtrace", data: { toggle: "tab" } } - = t('sherlock.backtrace') - -.row-content-block - .float-right - = link_to(sherlock_transaction_path(@transaction), class: 'btn gl-button btn-default') do - = sprite_icon('arrow-left') - = t('sherlock.transaction') - .oneline - = t('sherlock.query') - = @query.id - -.tab-content - .tab-pane.active#tab-general - = render(partial: 'general') - - .tab-pane#tab-backtrace - = render(partial: 'backtrace') diff --git a/app/views/sherlock/transactions/_file_samples.html.haml b/app/views/sherlock/transactions/_file_samples.html.haml deleted file mode 100644 index 110eb42f9ea..00000000000 --- a/app/views/sherlock/transactions/_file_samples.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -- if @transaction.file_samples.empty? - .nothing-here-block - = t('sherlock.no_file_samples') -- else - .table-holder - %table.table - %thead - %tr - %th= t('sherlock.time_inclusive') - %th= t('sherlock.count') - %th= t('sherlock.path') - %th - %tbody - - @transaction.sorted_file_samples.each do |sample| - %tr - %td - = sample.duration.round(2) - = t('sherlock.milliseconds') - %td= @transaction.view_counts.fetch(sample.file, 1) - %td= sample.relative_path - %td - = link_to(t('sherlock.view'), - sherlock_transaction_file_sample_path(@transaction, sample), - class: 'gl-button btn btn-sm') diff --git a/app/views/sherlock/transactions/_general.html.haml b/app/views/sherlock/transactions/_general.html.haml deleted file mode 100644 index 7cf6f27e1af..00000000000 --- a/app/views/sherlock/transactions/_general.html.haml +++ /dev/null @@ -1,38 +0,0 @@ -.gl-mt-3 - .card - .card-header - %strong - = t('sherlock.general') - %ul.content-list - %li - %span.light - #{t('sherlock.id')}: - %strong - = @transaction.id - %li - %span.light - #{t('sherlock.type')}: - %strong - = @transaction.type - %li - %span.light - #{t('sherlock.path')}: - %strong - = @transaction.path - %li - %span.light - #{t('sherlock.time')}: - %strong - = @transaction.duration.round(2) - = t('sherlock.seconds') - %li - %span.light - #{t('sherlock.query_time')} - %strong - = @transaction.query_duration.round(2) - = t('sherlock.seconds') - %li - %span.light - #{t('sherlock.finished_at')}: - %strong - = time_ago_with_tooltip @transaction.finished_at diff --git a/app/views/sherlock/transactions/_queries.html.haml b/app/views/sherlock/transactions/_queries.html.haml deleted file mode 100644 index afe23d61bcd..00000000000 --- a/app/views/sherlock/transactions/_queries.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -- if @transaction.queries.empty? - .nothing-here-block - = t('sherlock.no_queries') -- else - .table-holder - %table.table#sherlock-queries - %thead - %tr - %th= t('sherlock.time') - %th= t('sherlock.query') - %th - %tbody - - @transaction.sorted_queries.each do |query| - %tr - %td - = query.duration.round(2) - = t('sherlock.milliseconds') - %td - .code.js-syntax-highlight.sherlock-code - = highlight("#{query.id}.sql", query.formatted_query, language: 'sql') - %td - = link_to(t('sherlock.view'), - sherlock_transaction_query_path(@transaction, query), - class: 'gl-button btn btn-sm') diff --git a/app/views/sherlock/transactions/index.html.haml b/app/views/sherlock/transactions/index.html.haml deleted file mode 100644 index a2be6cae1e0..00000000000 --- a/app/views/sherlock/transactions/index.html.haml +++ /dev/null @@ -1,41 +0,0 @@ -- page_title t('sherlock.title') -- header_title t('sherlock.title'), sherlock_transactions_path - -.row-content-block - .float-right - = link_to(destroy_all_sherlock_transactions_path, - class: 'gl-button btn btn-danger', - method: :delete) do - = sprite_icon('remove') - = t('sherlock.delete_all_transactions') - .oneline= t('sherlock.introduction') - -- if @transactions.empty? - .nothing-here-block= t('sherlock.no_transactions') -- else - .table-holder - %table.table - %thead - %tr - %th= t('sherlock.type') - %th= t('sherlock.path') - %th= t('sherlock.time') - %th= t('sherlock.queries') - %th= t('sherlock.finished_at') - %th - %tbody - - @transactions.each do |trans| - %tr - %td= trans.type - %td - %span{ title: trans.path } - = truncate(trans.path, length: 70) - %td - = trans.duration.round(2) - = t('sherlock.seconds') - %td= trans.queries.length - %td - = time_ago_with_tooltip trans.finished_at - %td - = link_to(sherlock_transaction_path(trans), class: 'gl-button btn btn-sm') do - = t('sherlock.view') diff --git a/app/views/sherlock/transactions/show.html.haml b/app/views/sherlock/transactions/show.html.haml deleted file mode 100644 index 162b14f01e1..00000000000 --- a/app/views/sherlock/transactions/show.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -- page_title t('sherlock.title'), t('sherlock.transaction') -- header_title t('sherlock.title'), sherlock_transactions_path - -%ul.nav-links.nav.nav-tabs - %li.active - %a{ href: "#tab-general", data: { toggle: "tab" } } - = t('sherlock.general') - %li - %a{ href: "#tab-queries", data: { toggle: "tab" } } - = t('sherlock.queries') - %span.badge.badge-pill - #{@transaction.queries.length} - %li - %a{ href: "#tab-file-samples", data: { toggle: "tab" } } - = t('sherlock.file_samples') - %span.badge.badge-pill - #{@transaction.file_samples.length} - -.row-content-block - .float-right - = link_to(sherlock_transactions_path, class: 'gl-button btn') do - = sprite_icon('arrow-left', css_class: 'gl-mr-3') - = t('sherlock.all_transactions') - .oneline - = t('sherlock.transaction') - = @transaction.id - -.tab-content - .tab-pane.active#tab-general - = render(partial: 'general') - - .tab-pane#tab-queries - = render(partial: 'queries') - - .tab-pane#tab-file-samples - = render(partial: 'file_samples') diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index ca276519758..d5a1f3884c9 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -98,15 +98,15 @@ - unless @user.skype.blank? = render 'middle_dot_divider' do = link_to "skype:#{@user.skype}", class: 'gl-hover-text-decoration-none', title: "Skype" do - = sprite_icon('skype') + = sprite_icon('skype', css_class: 'skype-icon') - unless @user.linkedin.blank? = render 'middle_dot_divider' do = link_to linkedin_url(@user), class: 'gl-hover-text-decoration-none', title: "LinkedIn", target: '_blank', rel: 'noopener noreferrer nofollow' do - = sprite_icon('linkedin') + = sprite_icon('linkedin', css_class: 'linkedin-icon') - unless @user.twitter.blank? = render 'middle_dot_divider', breakpoint: 'sm' do = link_to twitter_url(@user), class: 'gl-hover-text-decoration-none', title: "Twitter", target: '_blank', rel: 'noopener noreferrer nofollow' do - = sprite_icon('twitter') + = sprite_icon('twitter', css_class: 'twitter-icon') - unless @user.website_url.blank? = render 'middle_dot_divider', stacking: true do - if Feature.enabled?(:security_auto_fix) && @user.bot? |