diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/views | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/views')
277 files changed, 1238 insertions, 1076 deletions
diff --git a/app/views/abuse_reports/new.html.haml b/app/views/abuse_reports/new.html.haml index aaa85e81bd4..d5dfddef837 100644 --- a/app/views/abuse_reports/new.html.haml +++ b/app/views/abuse_reports/new.html.haml @@ -1,8 +1,8 @@ -- page_title _("Report abuse to admin") +- page_title _("Report abuse to administrator") %h1.page-title.gl-font-size-h-display - = _("Report abuse to admin") + = _("Report abuse to administrator") %p - = _("Please use this form to report to the admin users who create spam issues, comments or behave inappropriately.") + = _("Use this form to report to the administrator users who create spam issues, comments or behave inappropriately.") %p = _("A member of the abuse team will review your report as soon as possible.") %hr diff --git a/app/views/admin/abuse_reports/_abuse_report.html.haml b/app/views/admin/abuse_reports/_abuse_report.html.haml index 00e5650b551..eeedd58ec15 100644 --- a/app/views/admin/abuse_reports/_abuse_report.html.haml +++ b/app/views/admin/abuse_reports/_abuse_report.html.haml @@ -24,11 +24,13 @@ = markdown_field(abuse_report, :message) %td - if user - = link_to _('Remove user & report'), admin_abuse_report_path(abuse_report, remove_user: true), - data: { confirm: _("USER %{user} WILL BE REMOVED! Are you sure?") % { user: user.name }, confirm_btn_variant: "danger" }, aria: { label: _('Remove user & report') }, remote: true, method: :delete, class: "gl-button btn btn-block btn-danger js-remove-tr" + = render Pajamas::ButtonComponent.new(href: admin_abuse_report_path(abuse_report, remove_user: true), variant: :danger, block: true, button_options: { data: { confirm: _("USER %{user} WILL BE REMOVED! Are you sure?") % { user: user.name }, confirm_btn_variant: "danger", remote: true, method: :delete }, class: "js-remove-tr gl-mb-5" }) do + = _('Remove user & report') - if user && !user.blocked? - = link_to _('Block user'), block_admin_user_path(user), data: { confirm: _('USER WILL BE BLOCKED! Are you sure?') }, aria: { label: _('Block user') }, method: :put, class: "gl-button btn btn-default btn-block" + = render Pajamas::ButtonComponent.new(href: block_admin_user_path(user), block: true, button_options: { data: { confirm: _('USER WILL BE BLOCKED! Are you sure?'), method: :put }, class: "gl-mb-5" }) do + = _('Block user') - else - .gl-button.btn.btn-default.disabled.btn-block + = render Pajamas::ButtonComponent.new(href: block_admin_user_path(user), block: true, disabled: true, button_options: { data: { confirm: _('USER WILL BE BLOCKED! Are you sure?'), method: :put }, class: "gl-mb-5" }) do = _('Already blocked') - = link_to _('Remove report'), [:admin, abuse_report], remote: true, method: :delete, class: "gl-button btn btn-default btn-block btn-close js-remove-tr" + = render Pajamas::ButtonComponent.new(href: [:admin, abuse_report], block: true, button_options: { data: { remote: true, method: :delete }, class: "js-remove-tr" }) do + = _('Remove report') 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 0f7b10f822d..21f69f6700f 100644 --- a/app/views/admin/application_settings/_account_and_limit.html.haml +++ b/app/views/admin/application_settings/_account_and_limit.html.haml @@ -46,7 +46,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', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/external_users', anchor: 'set-a-new-user-to-external'), target: '_blank', rel: 'noopener noreferrer' - unless Gitlab.com? .form-group = f.label :deactivate_dormant_users, _('Dormant users'), class: 'label-bold' diff --git a/app/views/admin/application_settings/_ci_cd.html.haml b/app/views/admin/application_settings/_ci_cd.html.haml index f6635ad17ef..8fafa52cd4c 100644 --- a/app/views/admin/application_settings/_ci_cd.html.haml +++ b/app/views/admin/application_settings/_ci_cd.html.haml @@ -1,6 +1,6 @@ .settings-content = gitlab_ui_form_for @application_setting, url: ci_cd_admin_application_settings_path(anchor: 'js-ci-cd-settings'), html: { class: 'fieldset-form' } do |f| - = form_errors(@application_setting ) + = form_errors(@application_setting) %fieldset .form-group @@ -61,7 +61,7 @@ %h4 = s_('AdminSettings|CI/CD limits') %p - = s_('AdminSettings|Set limit to 0 to disable it.') + = s_('AdminSettings|By default, set a limit to 0 to have no limit.') .scrolling-tabs-container.inner-page-scroll-tabs - if @plans.size > 1 %ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs.gl-mb-5 @@ -94,10 +94,14 @@ .form-group = f.label :ci_needs_size_limit, s_('AdminSettings|Maximum number of DAG dependencies that a job can have') = f.number_field :ci_needs_size_limit, class: 'form-control gl-form-input' + .form-text.text-muted= s_('AdminSettings|This limit cannot be disabled. Set to 0 to block all DAG dependencies.') .form-group = f.label :ci_registered_group_runners, s_('AdminSettings|Maximum number of runners registered per group') = f.number_field :ci_registered_group_runners, class: 'form-control gl-form-input' .form-group = f.label :ci_registered_project_runners, s_('AdminSettings|Maximum number of runners registered per project') = f.number_field :ci_registered_project_runners, class: 'form-control gl-form-input' + .form-group + = f.label :pipeline_hierarchy_size, s_("AdminSettings|Maximum number of downstream pipelines in a pipeline's hierarchy tree") + = f.number_field :pipeline_hierarchy_size, class: 'form-control gl-form-input' = f.submit s_('AdminSettings|Save %{name} limits').html_safe % { name: plan.name.capitalize }, pajamas_button: true diff --git a/app/views/admin/application_settings/_default_branch.html.haml b/app/views/admin/application_settings/_default_branch.html.haml index 7be4bac02fd..67de5ffb2b9 100644 --- a/app/views/admin/application_settings/_default_branch.html.haml +++ b/app/views/admin/application_settings/_default_branch.html.haml @@ -8,7 +8,7 @@ = f.label :default_branch_name, _('Initial default branch name'), class: 'label-light' = f.text_field :default_branch_name, placeholder: Gitlab::DefaultBranch.value, class: 'form-control gl-form-input' %span.form-text.text-muted - = (s_("AdminSettings|If not specified at the group or instance level, the default is %{default_initial_branch_name}. Does not affect existing repositories.") % { default_initial_branch_name: fallback_branch_name } ).html_safe + = (s_("AdminSettings|If not specified at the group or instance level, the default is %{default_initial_branch_name}. Does not affect existing repositories.") % { default_initial_branch_name: fallback_branch_name }).html_safe = render 'shared/default_branch_protection', f: f diff --git a/app/views/admin/application_settings/_error_tracking.html.haml b/app/views/admin/application_settings/_error_tracking.html.haml index 5a8aba5784e..aa42cd99e89 100644 --- a/app/views/admin/application_settings/_error_tracking.html.haml +++ b/app/views/admin/application_settings/_error_tracking.html.haml @@ -37,4 +37,4 @@ = f.label :error_tracking_api_url, _('Opstrace endpoint for Error Tracking integration'), class: 'label-light' = f.text_field :error_tracking_api_url, class: 'form-control gl-form-input' - = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_git_lfs_limits.html.haml b/app/views/admin/application_settings/_git_lfs_limits.html.haml index b8970a5bcf1..638984ae97a 100644 --- a/app/views/admin/application_settings/_git_lfs_limits.html.haml +++ b/app/views/admin/application_settings/_git_lfs_limits.html.haml @@ -15,4 +15,4 @@ = f.label :throttle_authenticated_git_lfs_period_in_seconds, _('Authenticated Git LFS rate limit period in seconds'), class: 'gl-font-weight-bold' = f.number_field :throttle_authenticated_git_lfs_period_in_seconds, class: 'form-control gl-form-input' - = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), pajamas_button: true, data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_grafana.html.haml b/app/views/admin/application_settings/_grafana.html.haml index 7f305b9ad9c..e2a53106cec 100644 --- a/app/views/admin/application_settings/_grafana.html.haml +++ b/app/views/admin/application_settings/_grafana.html.haml @@ -11,4 +11,4 @@ = f.text_field :grafana_url, class: 'form-control gl-form-input', placeholder: '/-/grafana' %span.form-text.text-muted#support_help_block= _('URL of the Grafana instance to link to from the Metrics Dashboard menu item.') - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_kroki.html.haml b/app/views/admin/application_settings/_kroki.html.haml index 4f5a313d7b7..f1f6dd34401 100644 --- a/app/views/admin/application_settings/_kroki.html.haml +++ b/app/views/admin/application_settings/_kroki.html.haml @@ -24,7 +24,7 @@ - install_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: install_link_url } = html_escape(_('Use the public cloud instance URL (%{kroki_public_url}) or %{install_link_start}install Kroki%{install_link_end} on your own infrastructure and use your own instance URL.')) % { kroki_public_url: '<code>https://kroki.io</code>'.html_safe, install_link_start: install_link_start, install_link_end: '</a>'.html_safe } .form-group - = f.label :kroki_formats, 'Additional diagram formats', class: 'label-bold' + = f.label :kroki_formats, _('Additional diagram formats'), class: 'label-bold' .form-text.text-muted - container_link_url = 'https://docs.kroki.io/kroki/setup/install/#images' - container_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: container_link_url } diff --git a/app/views/admin/application_settings/_localization.html.haml b/app/views/admin/application_settings/_localization.html.haml index 90cb34395d8..9ec4afec484 100644 --- a/app/views/admin/application_settings/_localization.html.haml +++ b/app/views/admin/application_settings/_localization.html.haml @@ -15,5 +15,12 @@ - time_tracking_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: time_tracking_help_link } = f.gitlab_ui_checkbox_component :time_tracking_limit_to_hours, _('Limit display of time tracking units to hours.'), help_text: _('Display time tracking in issues in total hours only. %{link_start}What is time tracking?%{link_end}').html_safe % { link_start: time_tracking_help_link_start, link_end: '</a>'.html_safe } + .form-group + = f.label :default_preferred_language, class: 'label-bold' do + = _('Default language') + = f.select :default_preferred_language, default_preferred_language_choices, {}, class: 'gl-form-select custom-select' + .form-text.text-muted + = s_('Default language for users who are not logged in.') + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_mailgun.html.haml b/app/views/admin/application_settings/_mailgun.html.haml index 1604419869c..fb15f6e79a5 100644 --- a/app/views/admin/application_settings/_mailgun.html.haml +++ b/app/views/admin/application_settings/_mailgun.html.haml @@ -19,4 +19,4 @@ = f.label :mailgun_signing_key, _('Mailgun HTTP webhook signing key'), class: 'label-light' = f.text_field :mailgun_signing_key, class: 'form-control gl-form-input' - = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_outbound.html.haml b/app/views/admin/application_settings/_outbound.html.haml index 3505a3bf3ee..1821c8ef4bb 100644 --- a/app/views/admin/application_settings/_outbound.html.haml +++ b/app/views/admin/application_settings/_outbound.html.haml @@ -20,6 +20,6 @@ .form-group = f.gitlab_ui_checkbox_component :dns_rebinding_protection_enabled, s_('OutboundRequests|Enforce DNS rebinding attack protection'), - help_text: _('OutboundRequests|Resolve IP addresses once and uses them to submit requests.') + help_text: s_('OutboundRequests|Resolve IP addresses once and uses them to submit requests.') = f.submit _('Save changes'), pajamas_button: true, data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_performance_bar.html.haml b/app/views/admin/application_settings/_performance_bar.html.haml index d4f6d84ea74..c09ba01b7ed 100644 --- a/app/views/admin/application_settings/_performance_bar.html.haml +++ b/app/views/admin/application_settings/_performance_bar.html.haml @@ -4,7 +4,7 @@ %fieldset .form-group = f.gitlab_ui_checkbox_component :performance_bar_enabled, - s_("Allow non-administrators access to the performance bar"), + _("Allow non-administrators access to the performance bar"), checkbox_options: { data: { qa_selector: 'enable_performance_bar_checkbox' } } .form-group = f.label :performance_bar_allowed_group_path, _('Allow access to members of the following group'), class: 'label-bold' diff --git a/app/views/admin/application_settings/_plantuml.html.haml b/app/views/admin/application_settings/_plantuml.html.haml index 5c86ce8dbfb..42f289d87b2 100644 --- a/app/views/admin/application_settings/_plantuml.html.haml +++ b/app/views/admin/application_settings/_plantuml.html.haml @@ -22,4 +22,4 @@ .form-text.text-muted = _('The hostname of your PlantUML server.') - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_repository_check.html.haml b/app/views/admin/application_settings/_repository_check.html.haml index aaf76c5ff7a..332d3a94b92 100644 --- a/app/views/admin/application_settings/_repository_check.html.haml +++ b/app/views/admin/application_settings/_repository_check.html.haml @@ -19,28 +19,35 @@ %h4= _("Housekeeping") .form-group - help_text = _("Run housekeeping tasks to automatically optimize Git repositories. Disabling this option will cause performance to degenerate over time.") - - help_link = link_to s_('Learn more.'), help_page_path('administration/housekeeping.md', anchor: 'configure-push-based-maintenance'), target: '_blank', rel: 'noopener noreferrer' + - help_link = link_to _('Learn more.'), help_page_path('administration/housekeeping.md', anchor: 'configure-push-based-maintenance'), target: '_blank', rel: 'noopener noreferrer' = f.gitlab_ui_checkbox_component :housekeeping_enabled, _("Enable automatic repository housekeeping"), help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link } - .form-group - = f.label :housekeeping_incremental_repack_period, 'Incremental repack period', class: 'label-bold' - = f.number_field :housekeeping_incremental_repack_period, class: 'form-control gl-form-input' - .form-text.text-muted - = html_escape(s_('Number of Git pushes after which an incremental %{code_start}git repack%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } - .form-group - = f.label :housekeeping_full_repack_period, 'Full repack period', class: 'label-bold' - = f.number_field :housekeeping_full_repack_period, class: 'form-control gl-form-input' - .form-text.text-muted - = html_escape(s_('Number of Git pushes after which a full %{code_start}git repack%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } - .form-group - = f.label :housekeeping_gc_period, _('Git GC period'), class: 'label-bold' - = f.number_field :housekeeping_gc_period, class: 'form-control gl-form-input' - .form-text.text-muted - = html_escape(s_('Number of Git pushes after which %{code_start}git gc%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } + - if Feature.enabled?(:optimized_housekeeping) + .form-group + = f.label :housekeeping_incremental_repack_period, _('Optimize repository period'), class: 'label-bold' + = f.number_field :housekeeping_incremental_repack_period, class: 'form-control gl-form-input' + .form-text.text-muted + = _('Number of Git pushes after which Gitaly is asked to optimize a repository.') + - else + .form-group + = f.label :housekeeping_incremental_repack_period, 'Incremental repack period', class: 'label-bold' + = f.number_field :housekeeping_incremental_repack_period, class: 'form-control gl-form-input' + .form-text.text-muted + = html_escape(s_('Number of Git pushes after which an incremental %{code_start}git repack%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } + .form-group + = f.label :housekeeping_full_repack_period, 'Full repack period', class: 'label-bold' + = f.number_field :housekeeping_full_repack_period, class: 'form-control gl-form-input' + .form-text.text-muted + = html_escape(s_('Number of Git pushes after which a full %{code_start}git repack%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } + .form-group + = f.label :housekeeping_gc_period, _('Git GC period'), class: 'label-bold' + = f.number_field :housekeeping_gc_period, class: 'form-control gl-form-input' + .form-text.text-muted + = html_escape(s_('Number of Git pushes after which %{code_start}git gc%{code_end} is run.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } .sub-section %h4= s_("AdminSettings|Inactive project deletion") .js-inactive-project-deletion-form{ data: inactive_projects_deletion_data(@application_setting) } - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_repository_static_objects.html.haml b/app/views/admin/application_settings/_repository_static_objects.html.haml index d962d050ebc..b301ec15a0e 100644 --- a/app/views/admin/application_settings/_repository_static_objects.html.haml +++ b/app/views/admin/application_settings/_repository_static_objects.html.haml @@ -1,4 +1,4 @@ -= form_for @application_setting, url: repository_admin_application_settings_path(anchor: 'js-repository-static-objects-settings'), html: { class: 'fieldset-form' } do |f| += gitlab_ui_form_for @application_setting, url: repository_admin_application_settings_path(anchor: 'js-repository-static-objects-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) %fieldset @@ -15,4 +15,4 @@ %span.form-text.text-muted#static_objects_external_storage_auth_token_help_block = _('Secure token that identifies an external storage request.') - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_repository_storage.html.haml b/app/views/admin/application_settings/_repository_storage.html.haml index 12dd8816783..066d77c792b 100644 --- a/app/views/admin/application_settings/_repository_storage.html.haml +++ b/app/views/admin/application_settings/_repository_storage.html.haml @@ -20,7 +20,7 @@ - weights_link_url = help_page_path('administration/repository_storage_paths.md', anchor: 'configure-where-new-repositories-are-stored') - weights_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: weights_link_url } = html_escape(s_('Enter %{weights_link_start}weights%{weights_link_end} for storages for new repositories. Configured storages appear below.')) % { weights_link_start: weights_link_start, weights_link_end: '</a>'.html_safe } - = link_to s_('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer' .form-check = f.fields_for :repository_storages_weighted, storage_weights do |storage_form| - Gitlab.config.repositories.storages.each_key do |storage| 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 1d6051a06ea..08486a808bf 100644 --- a/app/views/admin/application_settings/_runner_registrars_form.html.haml +++ b/app/views/admin/application_settings/_runner_registrars_form.html.haml @@ -5,7 +5,7 @@ .gl-form-group %span.form-text.gl-mb-3.gl-mt-0 = _('If no options are selected, only administrators can register runners.') - = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'prevent-users-from-registering-runners'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'restrict-runner-registration-by-all-users-in-an-instance'), target: '_blank', rel: 'noopener noreferrer' = hidden_field_tag "application_setting[valid_runner_registrars][]", nil - ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES.each do |type| = f.gitlab_ui_checkbox_component :valid_runner_registrars, s_("Runners|Members of the %{type} can register runners") % { type: type }, @@ -13,4 +13,4 @@ checked_value: type, unchecked_value: nil - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_search_limits.html.haml b/app/views/admin/application_settings/_search_limits.html.haml index 945c9397f0d..396c263dd5d 100644 --- a/app/views/admin/application_settings/_search_limits.html.haml +++ b/app/views/admin/application_settings/_search_limits.html.haml @@ -1,4 +1,4 @@ -= form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-search-limits-settings'), html: { class: 'fieldset-form' } do |f| += gitlab_ui_form_for @application_setting, url: network_admin_application_settings_path(anchor: 'js-search-limits-settings'), html: { class: 'fieldset-form' } do |f| = form_errors(@application_setting) %fieldset @@ -13,4 +13,4 @@ = f.number_field :search_rate_limit_unauthenticated, class: 'form-control gl-form-input' - = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } + = f.submit _('Save changes'), data: { qa_selector: 'save_changes_button' }, pajamas_button: true diff --git a/app/views/admin/application_settings/_spam.html.haml b/app/views/admin/application_settings/_spam.html.haml index bb512940be2..96face44344 100644 --- a/app/views/admin/application_settings/_spam.html.haml +++ b/app/views/admin/application_settings/_spam.html.haml @@ -50,8 +50,7 @@ = f.label :akismet_api_key, _('Akismet API Key'), class: 'label-bold' = 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', rel: 'noopener noreferrer' } http://www.akismet.com + = _("Generate API key at %{site}").html_safe % { site: link_to('http://www.akismet.com', 'http://www.akismet.com', target: 'blank', ref: 'noopener noreferrer') } %h5 = _('IP address restrictions') @@ -86,4 +85,4 @@ = f.text_field :spam_check_api_key, class: 'form-control gl-form-input' .form-text.text-muted= _('The API key used by GitLab for accessing the Spam Check service endpoint.') - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_terminal.html.haml b/app/views/admin/application_settings/_terminal.html.haml index c53f63e124b..b07db09d06c 100644 --- a/app/views/admin/application_settings/_terminal.html.haml +++ b/app/views/admin/application_settings/_terminal.html.haml @@ -1,4 +1,4 @@ -= form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-terminal-settings'), html: { class: 'fieldset-form', id: 'terminal-settings' } do |f| += gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-terminal-settings'), html: { class: 'fieldset-form', id: 'terminal-settings' } do |f| = form_errors(@application_setting) %fieldset @@ -7,4 +7,4 @@ = f.number_field :terminal_max_session_time, class: 'form-control gl-form-input' .form-text.text-muted = _('Maximum time, in seconds, for a web terminal websocket connection. 0 for unlimited.') - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_terraform_limits.html.haml b/app/views/admin/application_settings/_terraform_limits.html.haml new file mode 100644 index 00000000000..bdb0ba5cc85 --- /dev/null +++ b/app/views/admin/application_settings/_terraform_limits.html.haml @@ -0,0 +1,11 @@ += gitlab_ui_form_for @application_setting, url: preferences_admin_application_settings_path(anchor: 'js-terraform-limits-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) + + %fieldset + .form-group + = f.label :max_terraform_state_size_bytes, s_('TerraformLimits|Terraform state size limit (bytes)'), class: 'label-bold' + = f.number_field :max_terraform_state_size_bytes, class: 'form-control gl-form-input' + .form-text.text-muted + = s_("TerraformLimits|Maximum file size (in bytes) of Terraform state files. Set to 0 for no limit.") + + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/application_settings/_visibility_and_access.html.haml b/app/views/admin/application_settings/_visibility_and_access.html.haml index 85bee72e863..9c8770b8998 100644 --- a/app/views/admin/application_settings/_visibility_and_access.html.haml +++ b/app/views/admin/application_settings/_visibility_and_access.html.haml @@ -36,10 +36,14 @@ = render_if_exists 'admin/application_settings/ldap_access_setting', form: f - .form-group + .form-group{ data: { testid: 'project-export' } } = f.label :project_export, s_('AdminSettings|Project export'), class: 'label-bold' = f.gitlab_ui_checkbox_component :project_export_enabled, s_('AdminSettings|Enabled') + .form-group{ data: { testid: 'bulk-import' } } + = f.label :bulk_import, s_('AdminSettings|Enable migrating GitLab groups and projects by direct transfer'), class: 'gl-font-weight-bold' + = f.gitlab_ui_checkbox_component :bulk_import_enabled, s_('AdminSettings|Enabled') + .form-group %label.label-bold= _('Enabled Git access protocols') = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') @@ -67,4 +71,4 @@ -# This is added for Jihu edition in https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/1112 = render_if_exists 'admin/application_settings/disable_download_button', f: f - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true 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 415606c055d..d7bb3a85f3a 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 @@ -20,7 +20,7 @@ label_options: { class: 'gl-font-weight-bold!' } .form-group.js-toggle-colors-container - %button.btn.gl-button.btn-link.js-toggle-colors-link{ type: 'button' } + = render Pajamas::ButtonComponent.new(variant: :link, button_options: { class: 'js-toggle-colors-link' }) do = _('Customize colors') .form-group.js-toggle-colors-container.hide = form.label :message_background_color, _('Background Color'), class: 'col-form-label label-bold' diff --git a/app/views/admin/application_settings/appearances/show.html.haml b/app/views/admin/application_settings/appearances/show.html.haml index 77a08913666..1e55190d53b 100644 --- a/app/views/admin/application_settings/appearances/show.html.haml +++ b/app/views/admin/application_settings/appearances/show.html.haml @@ -1,4 +1,5 @@ - page_title _("Appearance") - @content_class = "limit-container-width" unless fluid_layout +- add_page_specific_style 'page_bundles/settings' = render 'form' diff --git a/app/views/admin/application_settings/ci/_header.html.haml b/app/views/admin/application_settings/ci/_header.html.haml index 0adb6cbbcf0..79c07f491fc 100644 --- a/app/views/admin/application_settings/ci/_header.html.haml +++ b/app/views/admin/application_settings/ci/_header.html.haml @@ -8,12 +8,13 @@ %p = _('Variables store information, like passwords and secret keys, that you can use in job scripts. All projects on the instance can use these variables.') - = link_to s_('Learn more.'), help_page_path('ci/variables/index', anchor: 'add-a-cicd-variable-to-an-instance'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('ci/variables/index', anchor: 'add-a-cicd-variable-to-an-instance'), target: '_blank', rel: 'noopener noreferrer' %p = _('Variables can be:') %ul %li = html_escape(_('%{code_open}Protected:%{code_close} Only exposed to protected branches or protected tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + = link_to _('Learn more.'), help_page_path('ci/variables/index', anchor: 'protected-cicd-variables'), target: '_blank', rel: 'noopener noreferrer' %li = html_escape(_('%{code_open}Masked:%{code_close} Hidden in job logs. Must match masking requirements.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } = link_to _('Learn more.'), help_page_path('ci/variables/index', anchor: 'mask-a-cicd-variable'), target: '_blank', rel: 'noopener noreferrer' diff --git a/app/views/admin/application_settings/ci_cd.html.haml b/app/views/admin/application_settings/ci_cd.html.haml index b7244c45871..0414382a108 100644 --- a/app/views/admin/application_settings/ci_cd.html.haml +++ b/app/views/admin/application_settings/ci_cd.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("CI/CD") - page_title _("CI/CD") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.no-animate#js-ci-cd-variables{ class: ('expanded' if expanded_by_default?) } diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index 6d8428d1aa6..8c9d54cd5d8 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("General") - page_title _("General") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-visibility-access.no-animate#js-visibility-settings{ class: ('expanded' if expanded_by_default?) } @@ -124,4 +125,4 @@ = render 'admin/application_settings/eks' = render 'admin/application_settings/floc' = render_if_exists 'admin/application_settings/add_license' -= render 'admin/application_settings/jira_connect' if Feature.enabled?(:jira_connect_oauth_self_managed_setting, current_user) += render 'admin/application_settings/jira_connect' diff --git a/app/views/admin/application_settings/integrations.html.haml b/app/views/admin/application_settings/integrations.html.haml index d818c587b79..fd1ad5cd304 100644 --- a/app/views/admin/application_settings/integrations.html.haml +++ b/app/views/admin/application_settings/integrations.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title s_('Integrations|Instance-level integration management') - page_title s_('Integrations|Instance-level integration management') +- add_page_specific_style 'page_bundles/settings' - @content_class = 'limit-container-width' unless fluid_layout %h3= s_('Integrations|Instance-level integration management') diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml index b79b189e9cf..b5981578866 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -2,6 +2,7 @@ - breadcrumb_title _("Metrics and profiling") - page_title _("Metrics and profiling") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-prometheus.no-animate#js-prometheus-settings{ class: ('expanded' if expanded_by_default?) } @@ -23,7 +24,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Link to your Grafana instance.') - = link_to s_('Learn more.'), help_page_path('administration/monitoring/performance/grafana_configuration.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/monitoring/performance/grafana_configuration.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'grafana' @@ -36,7 +37,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Enable access to the performance bar for non-administrators in a given group.') - = link_to s_('Learn more.'), help_page_path('administration/monitoring/performance/performance_bar.md', anchor: 'enable-the-performance-bar-for-non-administrators'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/monitoring/performance/performance_bar.md', anchor: 'enable-the-performance-bar-for-non-administrators'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'performance_bar' diff --git a/app/views/admin/application_settings/network.html.haml b/app/views/admin/application_settings/network.html.haml index 485b3a9828b..779263b439f 100644 --- a/app/views/admin/application_settings/network.html.haml +++ b/app/views/admin/application_settings/network.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("Network") - page_title _("Network") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-performance.no-animate#js-performance-settings{ class: ('expanded' if expanded_by_default?) } diff --git a/app/views/admin/application_settings/preferences.html.haml b/app/views/admin/application_settings/preferences.html.haml index bd92f7d490c..dd6666542ca 100644 --- a/app/views/admin/application_settings/preferences.html.haml +++ b/app/views/admin/application_settings/preferences.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("Preferences") - page_title _("Preferences") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'email_content' } } @@ -32,7 +33,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Additional text for the sign-in and Help page.') - = link_to s_('Learn more.'), help_page_path('user/admin_area/settings/help_page.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/help_page.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'help_page' @@ -79,7 +80,7 @@ = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded_by_default? ? _('Collapse') : _('Expand') %p - = _('Configure the default first day of the week and time tracking units.') + = _('Configure the default first day of the week, time tracking units, and default language.') .settings-content = render 'localization' @@ -96,3 +97,15 @@ .settings-content = render 'sidekiq_job_limits' + +%section.settings.as-terraform-limits.no-animate#js-terraform-limits-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only + = s_('TerraformLimits|Terraform limits') + = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = s_('TerraformLimits|Limits for Terraform features') + = link_to s_('TerraformLimits|Learn more about Terraform limits.'), help_page_path('user/admin_area/settings/terraform_limits.md'), target: '_blank', rel: 'noopener noreferrer' + .settings-content + = render 'terraform_limits' diff --git a/app/views/admin/application_settings/reporting.html.haml b/app/views/admin/application_settings/reporting.html.haml index af9145bf1e7..3d803e95cd0 100644 --- a/app/views/admin/application_settings/reporting.html.haml +++ b/app/views/admin/application_settings/reporting.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("Reporting") - page_title _("Reporting") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-spam.no-animate#js-spam-settings{ class: ('expanded' if expanded_by_default?) } diff --git a/app/views/admin/application_settings/repository.html.haml b/app/views/admin/application_settings/repository.html.haml index 12063ea700b..50798ad476c 100644 --- a/app/views/admin/application_settings/repository.html.haml +++ b/app/views/admin/application_settings/repository.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("Repository") - page_title _("Repository") +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout %section.settings.as-default-branch-name.no-animate#js-default-branch-name{ class: ('expanded' if expanded_by_default?) } @@ -21,7 +22,7 @@ = expanded_by_default? ? 'Collapse' : 'Expand' %p = _('Configure repository mirroring.') - = link_to s_('Learn more.'), help_page_path('user/project/repository/mirror/index.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/project/repository/mirror/index.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render partial: 'repository_mirrors_form' @@ -33,7 +34,7 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Configure repository storage.') - = link_to s_('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'repository_storage' @@ -60,6 +61,6 @@ = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Serve repository static objects (for example, archives and blobs) from external storage.') - = link_to s_('Learn more.'), help_page_path('administration/static_objects_external_storage.md'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('administration/static_objects_external_storage.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'repository_static_objects' diff --git a/app/views/admin/application_settings/service_usage_data.html.haml b/app/views/admin/application_settings/service_usage_data.html.haml index 82b627e1805..d6860cc08ac 100644 --- a/app/views/admin/application_settings/service_usage_data.html.haml +++ b/app/views/admin/application_settings/service_usage_data.html.haml @@ -2,6 +2,7 @@ - breadcrumb_title name - page_title name +- add_page_specific_style 'page_bundles/settings' - @content_class = "limit-container-width" unless fluid_layout - payload_class = 'js-service-ping-payload' @@ -9,10 +10,10 @@ %h3= name - if @service_ping_data_present - = render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-preview-trigger gl-mr-2', data: { payload_selector: ".#{payload_class}" } } ) do + = render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-preview-trigger gl-mr-2', data: { payload_selector: ".#{payload_class}" } }) do = gl_loading_icon(css_class: 'js-spinner gl-display-none', inline: true) %span.js-text.gl-display-inline= _('Preview payload') - = render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-download-trigger gl-mr-2', data: { endpoint: usage_data_admin_application_settings_path(format: :json) } } ) do + = render Pajamas::ButtonComponent.new(button_options: { class: 'js-payload-download-trigger gl-mr-2', data: { endpoint: usage_data_admin_application_settings_path(format: :json) } }) do = gl_loading_icon(css_class: 'js-spinner gl-display-none', inline: true) %span.js-text.gl-display-inline= _('Download payload') %pre.js-syntax-highlight.code.highlight.gl-mt-2.gl-display-none{ class: payload_class, data: { endpoint: usage_data_admin_application_settings_path(format: :html) } } diff --git a/app/views/admin/applications/index.html.haml b/app/views/admin/applications/index.html.haml index b603c7e5f49..a92bad5e601 100644 --- a/app/views/admin/applications/index.html.haml +++ b/app/views/admin/applications/index.html.haml @@ -14,11 +14,13 @@ .gl-max-w-full.gl-m-auto %h1.h4.gl-font-size-h-display= s_('AdminArea|No applications found') - = link_to _('New application'), new_admin_application_path, class: 'btn gl-button btn-confirm' + = render Pajamas::ButtonComponent.new(href: new_admin_application_path, variant: :confirm) do + = s_('New application') - else %hr - %p= link_to _('New application'), new_admin_application_path, class: 'gl-button btn btn-confirm' + = render Pajamas::ButtonComponent.new(href: new_admin_application_path, variant: :confirm) do + = s_('New application') .table-responsive %table.b-table.gl-table.gl-w-full{ role: 'table' } diff --git a/app/views/admin/broadcast_messages/_form.html.haml b/app/views/admin/broadcast_messages/_form.html.haml index dfd3b87c674..4e05eb31010 100644 --- a/app/views/admin/broadcast_messages/_form.html.haml +++ b/app/views/admin/broadcast_messages/_form.html.haml @@ -17,14 +17,14 @@ = f.label :broadcast_type, _('Type') .col-sm-10 = f.select :broadcast_type, broadcast_type_options, {}, class: 'form-control js-broadcast-message-type' - .form-group.row.js-broadcast-message-background-color-form-group{ class: ('hidden' unless @broadcast_message.banner? ) } + .form-group.row.js-broadcast-message-background-color-form-group{ class: ('hidden' unless @broadcast_message.banner?) } .col-sm-2.col-form-label = f.label :theme, _("Theme") .col-sm-10 .input-group = f.select :theme, broadcast_theme_options, {}, class: 'form-control js-broadcast-message-theme' - .form-group.row.js-broadcast-message-dismissable-form-group{ class: ('hidden' unless @broadcast_message.banner? ) } + .form-group.row.js-broadcast-message-dismissable-form-group{ class: ('hidden' unless @broadcast_message.banner?) } .col-sm-2.col-form-label.pt-0 = f.label :starts_at, _("Dismissable") .col-sm-10 @@ -62,6 +62,6 @@ = f.datetime_select :ends_at, {}, class: 'form-control form-control-inline' .form-actions - if @broadcast_message.persisted? - = f.submit _("Update broadcast message"), class: "btn gl-button btn-confirm" + = f.submit _("Update broadcast message"), pajamas_button: true - else - = f.submit _("Add broadcast message"), class: "btn gl-button btn-confirm" + = f.submit _("Add broadcast message"), pajamas_button: true diff --git a/app/views/admin/broadcast_messages/edit.html.haml b/app/views/admin/broadcast_messages/edit.html.haml index 569aaa29cc4..28301833f7d 100644 --- a/app/views/admin/broadcast_messages/edit.html.haml +++ b/app/views/admin/broadcast_messages/edit.html.haml @@ -1,4 +1,19 @@ - breadcrumb_title _("Messages") - page_title _("Broadcast Messages") +- vue_app_enabled = Feature.enabled?(:vue_broadcast_messages, current_user) -= render 'form' +- if vue_app_enabled + #js-broadcast-message{ data: { + id: @broadcast_message.id, + message: @broadcast_message.message, + broadcast_type: @broadcast_message.broadcast_type, + theme: @broadcast_message.theme, + dismissable: @broadcast_message.dismissable.to_s, + target_access_levels: @broadcast_message.target_access_levels, + target_path: @broadcast_message.target_path, + starts_at: @broadcast_message.starts_at, + ends_at: @broadcast_message.ends_at, + target_access_level_options: target_access_level_options.to_json, + } } +- else + = render 'form' diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml index 7559365e49a..7a005f9c982 100644 --- a/app/views/admin/broadcast_messages/index.html.haml +++ b/app/views/admin/broadcast_messages/index.html.haml @@ -10,6 +10,7 @@ - if vue_app_enabled #js-broadcast-messages{ data: { page: params[:page] || 1, + target_access_level_options: target_access_level_options.to_json, messages_count: @broadcast_messages.total_count, messages: @broadcast_messages.map { |message| { id: message.id, diff --git a/app/views/admin/dashboard/_security_newsletter_callout.html.haml b/app/views/admin/dashboard/_security_newsletter_callout.html.haml index 76bfa347480..7495298936d 100644 --- a/app/views/admin/dashboard/_security_newsletter_callout.html.haml +++ b/app/views/admin/dashboard/_security_newsletter_callout.html.haml @@ -10,5 +10,5 @@ = c.body do = s_('AdminArea|Sign up for the GitLab Security Newsletter to get notified for security updates.') = c.actions do - = link_to 'https://about.gitlab.com/company/preference-center/', target: '_blank', rel: 'noreferrer noopener', class: 'deferred-link gl-alert-action btn-confirm btn-md gl-button' do + = render Pajamas::ButtonComponent.new(variant: :confirm, href: 'https://about.gitlab.com/company/preference-center/', target: '_blank', button_options: { class: 'deferred-link gl-alert-action', rel: 'noreferrer noopener' }) do = s_('AdminArea|Sign up for the GitLab newsletter') diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 886402139e9..27ae7d523b9 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -32,7 +32,8 @@ = sprite_icon('project', size: 16, css_class: 'gl-text-gray-700') %h3.gl-m-0.gl-ml-3= approximate_count_with_delimiters(@counts, Project) .gl-mt-3.text-uppercase= s_('AdminArea|Projects') - = link_to(s_('AdminArea|New project'), new_project_path, class: "btn gl-button btn-default") + = render Pajamas::ButtonComponent.new(href: new_project_path) do + = s_('AdminArea|New project') = c.footer do .d-flex.align-items-center = link_to(s_('AdminArea|View latest projects'), admin_projects_path(sort: 'created_desc')) @@ -55,7 +56,8 @@ .gl-mt-3.text-uppercase = s_('AdminArea|Users') = link_to(s_('AdminArea|Users statistics'), admin_dashboard_stats_path, class: "text-capitalize gl-ml-2") - = link_to(s_('AdminArea|New user'), new_admin_user_path, class: "btn gl-button btn-default") + = render Pajamas::ButtonComponent.new(href: new_admin_user_path) do + = s_('AdminArea|New user') = c.footer do .d-flex.align-items-center = link_to(s_('AdminArea|View latest users'), admin_users_path({ sort: 'created_desc' })) @@ -68,7 +70,8 @@ = sprite_icon('group', size: 16, css_class: 'gl-text-gray-700') %h3.gl-m-0.gl-ml-3= approximate_count_with_delimiters(@counts, Group) .gl-mt-3.text-uppercase= s_('AdminArea|Groups') - = link_to(s_('AdminArea|New group'), new_admin_group_path, class: "btn gl-button btn-default") + = render Pajamas::ButtonComponent.new(href: new_admin_group_path) do + = s_('AdminArea|New group') = c.footer do .d-flex.align-items-center = link_to(s_('AdminArea|View latest groups'), admin_groups_path(sort: 'created_desc')) @@ -122,7 +125,7 @@ = s_('AdminArea|Components') - if show_version_check? .float-right - .js-gitlab-version-check-badge{ data: { "size": "lg", "actionable": "true" } } + .js-gitlab-version-check-badge{ data: { "size": "lg", "actionable": "true", "version": gitlab_version_check.to_json } } = 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/edit.html.haml b/app/views/admin/deploy_keys/edit.html.haml index acdf503727d..b51ab3457d6 100644 --- a/app/views/admin/deploy_keys/edit.html.haml +++ b/app/views/admin/deploy_keys/edit.html.haml @@ -7,4 +7,5 @@ = render partial: 'shared/deploy_keys/form', locals: { form: f, deploy_key: @deploy_key } .form-actions = f.submit _('Save changes'), pajamas_button: true - = link_to _('Cancel'), admin_deploy_keys_path, class: 'btn gl-button btn-default btn-cancel' + = render Pajamas::ButtonComponent.new(href: admin_deploy_keys_path) do + = _('Cancel') diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml index 7adba0d023b..20ee8c9f310 100644 --- a/app/views/admin/groups/_form.html.haml +++ b/app/views/admin/groups/_form.html.haml @@ -36,9 +36,11 @@ = render 'shared/group_tips' .gl-mt-5 = f.submit _('Create group'), pajamas_button: true - = link_to _('Cancel'), admin_groups_path, class: "gl-button btn btn-default btn-cancel" + = render Pajamas::ButtonComponent.new(href: admin_groups_path) do + = _('Cancel') - else .gl-mt-5 = f.submit _('Save changes'), data: { qa_selector: 'save_changes_button' }, pajamas_button: true - = link_to _('Cancel'), admin_group_path(@group), class: "gl-button btn btn-cancel" + = render Pajamas::ButtonComponent.new(href: admin_group_path(@group)) do + = _('Cancel') diff --git a/app/views/admin/groups/_group.html.haml b/app/views/admin/groups/_group.html.haml index a1afb1ddbfa..f9ebda2bc21 100644 --- a/app/views/admin/groups/_group.html.haml +++ b/app/views/admin/groups/_group.html.haml @@ -31,5 +31,7 @@ = visibility_level_icon(group.visibility_level) .controls.gl-flex-shrink-0.gl-ml-5 - = link_to _('Edit'), admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn gl-button btn-default' - = link_to _('Delete'), [:admin, group], aria: { label: _('Remove') }, data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name }, confirm_btn_variant: 'danger' }, method: :delete, class: 'gl-button btn btn-danger' + = render Pajamas::ButtonComponent.new(href: admin_group_edit_path(group), button_options: { id: "edit_#{dom_id(group)}" }) do + = _('Edit') + = render Pajamas::ButtonComponent.new(href: [:admin, group], variant: :danger, button_options: { data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name }, confirm_btn_variant: 'danger', method: :delete } }) do + = _('Delete') diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 2ea5890be2c..2a49b9c5ad8 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -1,4 +1,5 @@ - page_title _("Groups") +- add_page_specific_style 'page_bundles/search' .top-area .gl-mt-3.gl-mb-3 @@ -9,7 +10,7 @@ = search_field_tag :name, params[:name].presence, class: "form-control search-text-input js-search-input", autofocus: true, spellcheck: false, placeholder: 'Search by name', data: { qa_selector: 'group_search_field' } = sprite_icon('search', css_class: 'search-icon') = render "shared/groups/dropdown", options_hash: admin_groups_sort_options_hash - = link_to new_admin_group_path, class: "gl-button btn btn-confirm" do + = render Pajamas::ButtonComponent.new(variant: :confirm, href: new_admin_group_path) do = _('New group') %ul.content-list = render @groups diff --git a/app/views/admin/hook_logs/show.html.haml b/app/views/admin/hook_logs/show.html.haml index 6fcaf2ea152..0ccde159905 100644 --- a/app/views/admin/hook_logs/show.html.haml +++ b/app/views/admin/hook_logs/show.html.haml @@ -5,8 +5,11 @@ %hr - if @hook_log.oversize? - = button_tag _("Resend Request"), class: "btn gl-button btn-default float-right gl-ml-3 has-tooltip", disabled: true, title: _("Request data is too large") + - tooltip = _("Request data is too large") + = render Pajamas::ButtonComponent.new(disabled: true, button_options: { class: 'gl-float-right gl-ml-3 has-tooltip', title: tooltip }) do + = _("Resend Request") - else - = link_to _("Resend Request"), retry_admin_hook_hook_log_path(@hook, @hook_log), method: :post, class: "btn gl-button btn-default float-right gl-ml-3" + = render Pajamas::ButtonComponent.new(href: retry_admin_hook_hook_log_path(@hook, @hook_log), method: :post, button_options: { class: 'gl-float-right gl-ml-3' }) do + = _("Resend Request") = render partial: 'shared/hook_logs/content', locals: { hook_log: @hook_log } diff --git a/app/views/admin/identities/_form.html.haml b/app/views/admin/identities/_form.html.haml index ba7687db9c7..ad78c677da1 100644 --- a/app/views/admin/identities/_form.html.haml +++ b/app/views/admin/identities/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [:admin, @user, @identity], html: { class: 'fieldset-form' } do |f| += gitlab_ui_form_for [:admin, @user, @identity], html: { class: 'fieldset-form' } do |f| = form_errors(@identity) .form-group.row @@ -14,5 +14,5 @@ = f.text_field :extern_uid, class: 'form-control', required: true .form-actions - = f.submit _('Save changes'), class: "gl-button btn btn-confirm" + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/admin/identities/_identity.html.haml b/app/views/admin/identities/_identity.html.haml index 3121cd2ae59..a24cd000464 100644 --- a/app/views/admin/identities/_identity.html.haml +++ b/app/views/admin/identities/_identity.html.haml @@ -14,11 +14,11 @@ icon: 'pencil', button_options: { title: _('Edit'), 'aria-label' => _('Edit'), - class: button_classes } ) + class: button_classes }) = render Pajamas::ButtonComponent.new(category: :tertiary, href: url_for([:admin, @user, identity]), icon: 'remove', button_options: { title: _('Delete'), 'aria-label' => _('Delete identity'), class: button_classes, - data: { method: :delete, confirm: _("Are you sure you want to remove this identity?") } } ) + data: { method: :delete, confirm: _("Are you sure you want to remove this identity?") } }) diff --git a/app/views/admin/labels/index.html.haml b/app/views/admin/labels/index.html.haml index 21b19236683..d6f2898a383 100644 --- a/app/views/admin/labels/index.html.haml +++ b/app/views/admin/labels/index.html.haml @@ -27,6 +27,5 @@ %p = s_('AdminLabels|They can be used to categorize issues and merge requests.') .gl-display-flex.gl-flex-wrap.gl-justify-content-center - = link_to new_admin_label_path, class: "btn gl-mb-3 btn-confirm btn-md gl-button gl-mx-2" do - %span.gl-button-text - = _('New label') + = render Pajamas::ButtonComponent.new(href: new_admin_label_path) do + = _('New label') diff --git a/app/views/admin/projects/_projects.html.haml b/app/views/admin/projects/_projects.html.haml index c7c30673d74..cf1bd2a8022 100644 --- a/app/views/admin/projects/_projects.html.haml +++ b/app/views/admin/projects/_projects.html.haml @@ -25,8 +25,8 @@ .controls.gl-flex-shrink-0.gl-ml-5 = render Pajamas::ButtonComponent.new(href: edit_project_path(project), button_options: { id: dom_id(project, :edit) }) do - = s_('Edit') - = render Pajamas::ButtonComponent.new(variant: :danger, button_options: { class: 'delete-project-button', data: { delete_project_url: admin_project_path(project), project_name: project.name } } ) do + = _('Edit') + = render Pajamas::ButtonComponent.new(variant: :danger, button_options: { class: 'delete-project-button', data: { delete_project_url: admin_project_path(project), project_name: project.name } }) do = s_('AdminProjects|Delete') = paginate @projects, theme: 'gitlab' diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index f23a688dd48..18cd3400c60 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,4 +1,5 @@ - page_title _('Projects') +- add_page_specific_style 'page_bundles/search' - params[:visibility_level] ||= [] .top-area @@ -20,10 +21,9 @@ - namespace = Namespace.find(params[:namespace_id]) - current_namespace = "#{namespace.kind}: #{namespace.full_path}" %button.dropdown-menu-toggle.btn.btn-default.btn-md.gl-button.js-namespace-select{ data: { show_any: 'true', field_name: 'namespace_id', placeholder: current_namespace, update_location: 'true' }, type: 'button' } - %span.gl-new-dropdown-button-text + %span.gl-dropdown-button-text = current_namespace - = render 'shared/projects/dropdown' = link_to new_project_path, class: 'gl-button btn btn-confirm' do = _('New Project') diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index a60c3996cf2..829e9f508e0 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -6,8 +6,7 @@ %h1.page-title.gl-font-size-h-display = _('Project: %{name}') % { name: @project.full_name } - = link_to edit_project_path(@project), class: "btn btn-default gl-button float-right" do - = sprite_icon('pencil', css_class: 'gl-icon gl-mr-2') + = render Pajamas::ButtonComponent.new(href: edit_project_path(@project), icon: 'pencil', button_options: { class: 'gl-float-right' }) do = _('Edit') %hr - if @project.last_repository_check_failed? @@ -143,7 +142,7 @@ .col-sm-9 - placeholder = _('Search for Namespace') %button.dropdown-menu-toggle.btn.btn-default.btn-md.gl-button.js-namespace-select{ data: { field_name: 'new_namespace_id', placeholder: placeholder }, type: 'button' } - %span.gl-new-dropdown-button-text + %span.gl-dropdown-button-text = placeholder .form-group.row diff --git a/app/views/admin/topics/_form.html.haml b/app/views/admin/topics/_form.html.haml index 9b9d97950cc..544310e312c 100644 --- a/app/views/admin/topics/_form.html.haml +++ b/app/views/admin/topics/_form.html.haml @@ -38,10 +38,13 @@ - if @topic.new_record? .form-actions - = f.submit _('Create topic'), class: "gl-button btn btn-confirm" - = link_to _('Cancel'), admin_topics_path, class: "gl-button btn btn-default btn-cancel" + = f.submit _('Create topic'), pajamas_button: true + = render Pajamas::ButtonComponent.new(href: admin_topics_path) do + = _('Cancel') - else .form-actions - = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' } - = link_to _('Cancel'), admin_topics_path, class: "gl-button btn btn-cancel" + = f.submit _('Save changes'), pajamas_button: true, data: { qa_selector: 'save_changes_button' } + = render Pajamas::ButtonComponent.new(href: admin_topics_path) do + = _('Cancel') + diff --git a/app/views/admin/topics/index.html.haml b/app/views/admin/topics/index.html.haml index 77823ed7058..2f39f27208e 100644 --- a/app/views/admin/topics/index.html.haml +++ b/app/views/admin/topics/index.html.haml @@ -9,7 +9,7 @@ = sprite_icon('search', css_class: 'search-icon') .gl-flex-grow-1 .js-merge-topics{ data: { path: merge_admin_topics_path } } - = link_to new_admin_topic_path, class: "gl-button btn btn-confirm gl-w-full gl-md-w-auto" do + = render Pajamas::ButtonComponent.new(href: new_admin_topic_path, variant: 'confirm') do = _('New topic') %ul.content-list = render partial: 'topic', collection: @topics diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 6809f147ef8..eb151b40a65 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -76,7 +76,9 @@ %div - if @user.new_record? = f.submit _('Create user'), pajamas_button: true - = link_to _('Cancel'), admin_users_path, class: "gl-button btn btn-default btn-cancel" + = render Pajamas::ButtonComponent.new(href: admin_users_path) do + = _('Cancel') - else = f.submit _('Save changes'), pajamas_button: true - = link_to _('Cancel'), admin_user_path(@user), class: "gl-button btn btn-default btn-cancel" + = render Pajamas::ButtonComponent.new(href: admin_user_path(@user)) do + = _('Cancel') diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml index 1fa7c9c8651..6b5ec62bc77 100644 --- a/app/views/admin/users/_head.html.haml +++ b/app/views/admin/users/_head.html.haml @@ -40,7 +40,8 @@ = render Pajamas::ButtonComponent.new(variant: :default, button_options: { class: 'js-confirm-modal-button', data: confirm_user_data(@user) }) do = _('Confirm user') .gl-p-2 - = link_to _('New identity'), new_admin_user_identity_path(@user), class: "btn btn-primary gl-button" + = render Pajamas::ButtonComponent.new(variant: :confirm, href: new_admin_user_identity_path(@user)) do + = _('New identity') = gl_tabs_nav do = gl_tab_link_to _("Account"), admin_user_path(@user) = gl_tab_link_to _("Groups and projects"), projects_admin_user_path(@user) diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index 6d85ff50fbe..96e6a264d8e 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -1,3 +1,5 @@ +- add_page_specific_style 'page_bundles/search' + - if registration_features_can_be_prompted? = render Pajamas::AlertComponent.new(variant: :tip, alert_options: { class: 'gl-my-5' }, 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 8f4cc41822b..cdf25a9348c 100644 --- a/app/views/ci/runner/_how_to_setup_runner.html.haml +++ b/app/views/ci/runner/_how_to_setup_runner.html.haml @@ -17,8 +17,7 @@ = clipboard_button(target: '#registration_token', title: _("Copy token")) .gl-mt-3.gl-mb-3 -= button_to _("Reset registration token"), reset_token_url, -method: :put, class: 'gl-button btn btn-default', -data: { confirm: _("Are you sure you want to reset the registration token?") } += render Pajamas::ButtonComponent.new(variant: :default, method: :put, href: reset_token_url, button_options: { id: 'Reset registration token', data: { confirm: _("Are you sure you want to reset the registration token?") } }) do + = _('Reset registration token') #js-install-runner diff --git a/app/views/ci/variables/_content.html.haml b/app/views/ci/variables/_content.html.haml index b597c2d442a..37043a207ff 100644 --- a/app/views/ci/variables/_content.html.haml +++ b/app/views/ci/variables/_content.html.haml @@ -1,10 +1,12 @@ -= _('Variables store information, like passwords and secret keys, that you can use in job scripts.') -= link_to s_('Learn more.'), help_page_path('ci/variables/index'), target: '_blank', rel: 'noopener noreferrer' += format(s_('CiVariables|Variables store information, like passwords and secret keys, that you can use in job scripts. Each %{entity} can define a maximum of %{limit} variables.'), entity: entity, limit: variable_limit).html_safe += link_to _('Learn more.'), help_page_path('ci/variables/index'), target: '_blank', rel: 'noopener noreferrer' %p - = _('Variables can be:') + = _('Variables can have several attributes.') + = link_to _('Learn more.'), help_page_path('ci/variables/index', anchor: 'add-a-cicd-variable-to-an-instance'), target: '_blank', rel: 'noopener noreferrer' %ul %li = html_escape(_('%{code_open}Protected:%{code_close} Only exposed to protected branches or protected tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } %li = html_escape(_('%{code_open}Masked:%{code_close} Hidden in job logs. Must match masking requirements.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - = link_to _('Learn more.'), help_page_path('ci/variables/index', anchor: 'mask-a-cicd-variable'), target: '_blank', rel: 'noopener noreferrer' + %li + = html_escape(_('%{code_open}Expanded:%{code_close} Variables with %{code_open}$%{code_close} will be treated as the start of a reference to another variable.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } diff --git a/app/views/ci/variables/_header.html.haml b/app/views/ci/variables/_header.html.haml index d6a9ce72d03..dfcf8f39533 100644 --- a/app/views/ci/variables/_header.html.haml +++ b/app/views/ci/variables/_header.html.haml @@ -7,4 +7,4 @@ = expanded ? _('Collapse') : _('Expand') %p - = render "ci/variables/content" + = render "ci/variables/content", entity: @entity, variable_limit: @variable_limit diff --git a/app/views/ci/variables/_index.html.haml b/app/views/ci/variables/_index.html.haml index 08865abbe86..fdbf5132d40 100644 --- a/app/views/ci/variables/_index.html.haml +++ b/app/views/ci/variables/_index.html.haml @@ -23,7 +23,7 @@ aws_tip_deploy_link: help_page_path('ci/cloud_deployment/index.md', anchor: 'deploy-your-application-to-ecs'), aws_tip_commands_link: help_page_path('ci/cloud_deployment/index.md', anchor: 'use-an-image-to-run-aws-commands'), aws_tip_learn_link: help_page_path('ci/cloud_deployment/index.md'), - contains_variable_reference_link: help_page_path('ci/variables/index', anchor: 'use-variables-in-other-variables'), + contains_variable_reference_link: help_page_path('ci/variables/index', anchor: 'expand-cicd-variables'), protected_environment_variables_link: help_page_path('ci/variables/index', anchor: 'protected-cicd-variables'), masked_environment_variables_link: help_page_path('ci/variables/index', anchor: 'mask-a-cicd-variable'), environment_scope_link: help_page_path('ci/environments/index', anchor: 'scope-environments-with-specs') } } diff --git a/app/views/ci/variables/_variable_row.html.haml b/app/views/ci/variables/_variable_row.html.haml index c5e518d8526..a710655aa20 100644 --- a/app/views/ci/variables/_variable_row.html.haml +++ b/app/views/ci/variables/_variable_row.html.haml @@ -33,5 +33,4 @@ %p.masking-validation-error.gl-field-error.hide = s_("CiVariables|Cannot use Masked Variable with current value") = link_to sprite_icon('question-o'), help_page_path('ci/variables/index', anchor: 'mask-a-cicd-variable'), target: '_blank', rel: 'noopener noreferrer' - %button.gl-button.btn.btn-default.btn-icon.js-row-remove-button.ci-variable-row-remove-button.table-section{ type: 'button', 'aria-label': s_('CiVariables|Remove variable row') } - = sprite_icon('close') + = render Pajamas::ButtonComponent.new(icon: 'close', button_options: { class: 'js-row-remove-button ci-variable-row-remove-button table-section', 'aria-label': s_('CiVariables|Remove variable row') }) diff --git a/app/views/clusters/clusters/_details.html.haml b/app/views/clusters/clusters/_details.html.haml index 3079e024369..34408a9adeb 100644 --- a/app/views/clusters/clusters/_details.html.haml +++ b/app/views/clusters/clusters/_details.html.haml @@ -4,8 +4,6 @@ %section.settings.no-animate{ class: ('expanded' if expanded) } .settings-header %h4= s_('ClusterIntegration|Provider details') - %button.btn.gl-button.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') %p= s_('ClusterIntegration|See and edit the details for your Kubernetes cluster') .settings-content = render 'provider_details_form', cluster: @cluster, platform: @cluster.platform_kubernetes, update_cluster_url_path: clusterable.cluster_path(@cluster) diff --git a/app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml b/app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml index c3b881df98d..af4c934fd72 100644 --- a/app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml +++ b/app/views/clusters/clusters/_gcp_signup_offer_banner.html.haml @@ -6,5 +6,5 @@ = c.body do = s_('ClusterIntegration|Every new Google Cloud Platform (GCP) account receives $300 in credit upon %{sign_up_link}. In partnership with Google, GitLab is able to offer an additional $200 for both new and existing GCP accounts to get started with GitLab\'s Google Kubernetes Engine Integration.').html_safe % { sign_up_link: link } = c.actions do - %a.gl-button.btn-confirm.text-decoration-none{ href: 'https://cloud.google.com/partners/partnercredit/?pcn_code=0014M00001h35gDQAQ#contact-form', target: '_blank', rel: 'noopener noreferrer' } + = render Pajamas::ButtonComponent.new(variant: :confirm, href: 'https://cloud.google.com/partners/partnercredit/?pcn_code=0014M00001h35gDQAQ#contact-form', target: '_blank', button_options: { rel: 'noopener noreferrer' }) do = s_("ClusterIntegration|Apply for credit") diff --git a/app/views/dashboard/_activities.html.haml b/app/views/dashboard/_activities.html.haml index 4edb0f324dc..8750b80ccfd 100644 --- a/app/views/dashboard/_activities.html.haml +++ b/app/views/dashboard/_activities.html.haml @@ -1,8 +1,7 @@ .nav-block.activities = render 'shared/event_filter' .controls - = link_to dashboard_projects_path(rss_url_options), class: 'btn gl-button btn-default btn-icon d-none d-sm-inline-flex has-tooltip', title: 'Subscribe' do - = sprite_icon('rss', css_class: 'gl-icon') + = render Pajamas::ButtonComponent.new(href: dashboard_projects_path(rss_url_options), icon: 'rss', button_options: { title: _('Subscribe'), aria: { label: _('Subscribe') }, class: 'gl-display-none gl-sm-display-inline-flex' }) .content_list .loading diff --git a/app/views/dashboard/_groups_head.html.haml b/app/views/dashboard/_groups_head.html.haml index 1c82b30ed8d..09e2e35c617 100644 --- a/app/views/dashboard/_groups_head.html.haml +++ b/app/views/dashboard/_groups_head.html.haml @@ -3,8 +3,8 @@ - if current_user.can_create_group? .page-title-controls - = link_to _("New group"), new_group_path, class: "gl-button btn btn-confirm", data: { qa_selector: "new_group_button", testid: "new-group-button" } - + = render Pajamas::ButtonComponent.new(href: new_group_path, variant: :confirm, button_options: { data: { qa_selector: "new_group_button", testid: "new-group-button" } }) do + = _("New group") .top-area = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do = gl_tab_link_to _("Your groups"), dashboard_groups_path diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml index 9c492a0da34..10e653fd427 100644 --- a/app/views/dashboard/_projects_head.html.haml +++ b/app/views/dashboard/_projects_head.html.haml @@ -1,6 +1,3 @@ -- project_tab_filter = local_assigns.fetch(:project_tab_filter, "") -- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar) - = content_for :flash_message do = render 'shared/project_limit' @@ -9,17 +6,13 @@ - if current_user.can_create_project? .page-title-controls - = link_to _("New project"), new_project_path, class: "gl-button btn btn-confirm", data: { qa_selector: 'new_project_button' } + = render Pajamas::ButtonComponent.new(href: new_project_path, variant: :confirm, button_options: { data: { qa_selector: 'new_project_button' } }) do + = _("New project") .top-area - .scrolling-tabs-container.inner-page-scroll-tabs.gl-flex-grow-1.gl-min-w-0.gl-w-full + .scrolling-tabs-container.inner-page-scroll-tabs.gl-flex-grow-1.gl-min-w-0 .fade-left= sprite_icon('chevron-lg-left', size: 12) .fade-right= sprite_icon('chevron-lg-right', size: 12) = render 'dashboard/projects_nav' - - unless feature_project_list_filter_bar - .nav-controls - = render 'shared/projects/search_form' - = render 'shared/projects/dropdown' -- if feature_project_list_filter_bar - .project-filters - = render 'shared/projects/search_bar', project_tab_filter: project_tab_filter + .nav-controls + = render 'shared/projects/search_form' diff --git a/app/views/dashboard/_projects_nav.html.haml b/app/views/dashboard/_projects_nav.html.haml index 29c820ddc58..7cbd2fb14ec 100644 --- a/app/views/dashboard/_projects_nav.html.haml +++ b/app/views/dashboard/_projects_nav.html.haml @@ -3,11 +3,11 @@ = gl_tabs_nav({ class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1 gl-w-full nav gl-tabs-nav' }) do = gl_tab_link_to dashboard_projects_path, { item_active: is_your_projects_path, class: 'shortcuts-activity', data: { placement: 'right' } } do - = _("Your projects") + = s_("ProjectList|Yours") = gl_tab_counter_badge(limited_counter_with_delimiter(@total_user_projects_count)) = gl_tab_link_to starred_dashboard_projects_path, { data: { placement: 'right' } } do - = _("Starred projects") + = s_("ProjectList|Starred") = gl_tab_counter_badge(limited_counter_with_delimiter(@total_starred_projects_count)) - = gl_tab_link_to _("Explore projects"), explore_root_path, { item_active: is_explore_projects_path, data: { placement: 'right' } } - = gl_tab_link_to _("Explore topics"), topics_explore_projects_path, { data: { placement: 'right' } } + = gl_tab_link_to s_("ProjectList|Explore"), explore_root_path, { item_active: is_explore_projects_path, data: { placement: 'right' } } + = gl_tab_link_to s_("ProjectList|Topics"), topics_explore_projects_path, { data: { placement: 'right' } } = render_if_exists "dashboard/removed_projects_tab" diff --git a/app/views/dashboard/_snippets_head.html.haml b/app/views/dashboard/_snippets_head.html.haml index be2124fdd7e..5a798c249d1 100644 --- a/app/views/dashboard/_snippets_head.html.haml +++ b/app/views/dashboard/_snippets_head.html.haml @@ -4,7 +4,8 @@ - if current_user && current_user.snippets.any? || @snippets.any? .page-title-controls - if can?(current_user, :create_snippet) - = link_to _("New snippet"), new_snippet_path, class: "gl-button btn btn-confirm", title: _("New snippet") + = render Pajamas::ButtonComponent.new(href: new_snippet_path, variant: :confirm, button_options: { title: _("New snippet") }) do + = _("New snippet") .top-area = gl_tabs_nav({ class: 'gl-border-0' }) do diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 79f6bfc866a..5293f685d06 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,6 +1,7 @@ - @hide_top_links = true - page_title _("Issues") - @breadcrumb_link = issues_dashboard_path(assignee_username: current_user.username) +- add_page_specific_style 'page_bundles/issuable_list' - add_page_specific_style 'page_bundles/dashboard' = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues") @@ -15,10 +16,7 @@ = render 'shared/new_project_item_select', path: 'issues/new', label: _("issue"), with_feature_enabled: 'issues', type: :issues - if ::Feature.enabled?(:vue_issues_dashboard) - .js-issues-dashboard{ data: { calendar_path: url_for(safe_params.merge(calendar_url_options)), - empty_state_svg_path: image_path('illustrations/issue-dashboard_results-without-filter.svg'), - is_signed_in: current_user.present?.to_s, - rss_path: url_for(safe_params.merge(rss_url_options)) } } + .js-issues-dashboard{ data: dashboard_issues_list_data(current_user) } - else .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 8a639d08a27..c921375edd1 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,6 +1,7 @@ - @hide_top_links = true - page_title _("Merge requests") - @breadcrumb_link = merge_requests_dashboard_path(assignee_username: current_user.username) +- add_page_specific_style 'page_bundles/issuable_list' = render_dashboard_ultimate_trial(current_user) diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml index 3e39872902d..45e3267813f 100644 --- a/app/views/dashboard/projects/_nav.html.haml +++ b/app/views/dashboard/projects/_nav.html.haml @@ -1,19 +1,4 @@ -- inactive_class = 'btn p-2' -- active_class = 'btn p-2 active' -- project_tab_filter = local_assigns.fetch(:project_tab_filter, "") -- is_explore_trending = project_tab_filter == :explore_trending -- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar) - -.nav-block{ class: ("w-100" if feature_project_list_filter_bar) } - - if feature_project_list_filter_bar - .btn-group.button-filter-group.d-flex.m-0.p-0 - - if project_tab_filter == :explore || is_explore_trending - = link_to s_('DashboardProjects|Trending'), trending_explore_projects_path, class: is_explore_trending ? active_class : inactive_class - = link_to s_('DashboardProjects|All'), explore_projects_path, class: is_explore_trending ? inactive_class : active_class - - else - = link_to s_('DashboardProjects|All'), dashboard_projects_path, class: params[:personal].present? ? inactive_class : active_class - = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), class: params[:personal].present? ? active_class : inactive_class - - else - = gl_tabs_nav do - = gl_tab_link_to s_('DashboardProjects|All'), dashboard_projects_path, { item_active: params[:personal].blank? } - = gl_tab_link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), { item_active: params[:personal].present? } +.nav-block + = gl_tabs_nav do + = gl_tab_link_to s_('DashboardProjects|All'), dashboard_projects_path, { item_active: params[:personal].blank? } + = gl_tab_link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), { item_active: params[:personal].present? } diff --git a/app/views/dashboard/projects/index.html.haml b/app/views/dashboard/projects/index.html.haml index 0d9257e659a..f427c347dd3 100644 --- a/app/views/dashboard/projects/index.html.haml +++ b/app/views/dashboard/projects/index.html.haml @@ -12,7 +12,7 @@ = render "projects/last_push" - if show_projects?(@projects, params) = render 'dashboard/projects_head' - = render 'nav' unless Feature.enabled?(:project_list_filter_bar) + = render 'nav' = render 'projects' - else = render "zero_authorized_projects" diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml index 47bc8f5c95b..9dfeaa3d07d 100644 --- a/app/views/dashboard/todos/_todo.html.haml +++ b/app/views/dashboard/todos/_todo.html.haml @@ -1,60 +1,66 @@ -%li.todo.gl-hover-border-blue-200.gl-hover-bg-blue-50.gl-hover-cursor-pointer{ class: "todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo), data: { url: todo_target_path(todo) } } - .gl-display-flex.gl-flex-direction-row - .todo-avatar.gl-display-none.gl-sm-display-inline-block - = author_avatar(todo, size: 40) - - .todo-item.flex-fill.gl-overflow-hidden.gl-overflow-x-auto.gl-align-self-center{ data: { qa_selector: "todo_item_container" } } - .todo-title.gl-mb-3.gl-md-mb-0 - - if todo_author_display?(todo) - = todo_target_state_pill(todo) - - %span.title-item.author-name.bold - - if todo.author - = link_to_author(todo, self_added: todo.self_added?) - - else - = _('(removed)') - - %span.title-item.action-name{ data: { qa_selector: "todo_action_name_content" } } - = todo_action_name(todo) - - %span.title-item.todo-label.todo-target-link +%li.todo.gl-hover-border-blue-200.gl-hover-bg-blue-50.gl-hover-cursor-pointer.gl-relative{ class: "todo-#{todo.done? ? 'done' : 'pending'}", id: dom_id(todo) } + .gl-display-flex.gl-flex-direction-column.gl-sm-flex-direction-row.gl-sm-align-items-center + .todo-item.gl-overflow-hidden.gl-overflow-x-auto.gl-align-self-center.gl-w-full{ data: { qa_selector: "todo_item_container" } } + .todo-title.gl-pt-2.gl-pb-3.gl-px-2.gl-md-mb-1.gl-font-sm.gl-text-gray-500 + + = todo_target_state_pill(todo) + + %span.todo-target-title{ data: { qa_selector: "todo_target_title_content" }, :id => dom_id(todo) + "_describer" } + = todo_target_title(todo) + + - if !todo.for_design? && !todo.member_access_requested? + · + + %span + = todo_parent_path(todo) + + %span.todo-label - if todo.target - = todo_target_link(todo) + = link_to todo_target_name(todo), todo_target_path(todo), class: 'todo-target-link gl-text-gray-500! gl-text-decoration-none!', :'aria-describedby' => dom_id(todo) + "_describer", :'aria-label' => todo_target_aria_label(todo) - else = _("(removed)") - %span.title-item.todo-target-title{ data: { qa_selector: "todo_target_title_content" } } - = todo_target_title(todo) - - %span.title-item.todo-project.todo-label - = s_('Todo|at %{todo_parent_path}').html_safe % { todo_parent_path: todo_parent_path(todo) } + .todo-body.gl-mb-2.gl-px-2.gl-display-flex.gl-align-items-flex-start.gl-lg-align-items-center + .todo-avatar.gl-display-none.gl-sm-display-inline-block + = author_avatar(todo, size: 24) + .todo-note + - if todo_author_display?(todo) + .author-name.bold.gl-display-inline + - if todo.author + = link_to_author(todo, self_added: todo.self_added?) + - else + = _('(removed)') - - if todo.self_assigned? - %span.title-item.action-name - = todo_self_addressing(todo) + %span.action-name{ data: { qa_selector: "todo_action_name_content" } }< + = todo_action_name(todo) + - if todo.note.present? + \: + - unless todo.note.present? || todo.self_assigned? + \. - %span.title-item - · + - if todo.self_assigned? + %span.action-name< + = todo_self_addressing(todo) + \. + - if todo.note.present? + %span.action-description.gl-font-style-italic< + = first_line_in_markdown(todo, :body, 100, is_todo: true, project: todo.project, group: todo.group) - %span.title-item.todo-timestamp - #{time_ago_with_tooltip(todo.created_at)} - = todo_due_date(todo) + .todo-timestamp.gl-white-space-nowrap.gl-sm-ml-3.gl-mt-2.gl-mb-2.gl-sm-my-0.gl-px-2.gl-sm-px-0 + %span.todo-timestamp.gl-font-sm.gl-text-gray-500 + = todo_due_date(todo) + #{time_ago_with_tooltip(todo.created_at)} - - if todo.note.present? - .todo-body - .todo-note.break-word - .md - = first_line_in_markdown(todo, :body, 150, project: todo.project, group: todo.group) - .todo-actions.gl-ml-3 + .todo-actions.gl-mr-4.gl-px-2.gl-sm-px-0.gl-sm-mx-0 - if todo.pending? - = link_to dashboard_todo_path(todo), method: :delete, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-done-todo', data: { href: dashboard_todo_path(todo) } do + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-done-todo has-tooltip', title: _('Mark as done')}, method: :delete, href: dashboard_todo_path(todo)), 'aria-label' => _('Mark as done') do = gl_loading_icon(inline: true) - = _('Done') - = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-undo-todo hidden', data: { href: restore_dashboard_todo_path(todo) } do + = sprite_icon('check', css_class: 'js-todo-button-icon') + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-undo-todo hidden has-tooltip', title: _('Undo')}, method: :patch, href: restore_dashboard_todo_path(todo)), 'aria-label' => _('Undo') do = gl_loading_icon(inline: true) - = _('Undo') + = sprite_icon('redo', css_class: 'js-todo-button-icon') - else - = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'gl-button gl-bg-gray-50 btn btn-default btn-loading d-flex align-items-center js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do + = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading btn-icon gl-display-flex js-add-todo has-tooltip', title: _('Add a to do')}, method: :patch, href: restore_dashboard_todo_path(todo)), 'aria-label' => _('Add a to do') do = gl_loading_icon(inline: true) - = _('Add a to do') + = sprite_icon('todo-add', css_class: 'js-todo-button-icon') diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index deb1ac9e360..c0bd3ee3f0d 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -5,6 +5,7 @@ = render_two_factor_auth_recovery_settings_check = render_dashboard_ultimate_trial(current_user) - add_page_specific_style 'page_bundles/todos' +- add_page_specific_style 'page_bundles/issuable' .page-title-holder.d-flex.align-items-center %h1.page-title.gl-font-size-h-display= _("To-Do List") diff --git a/app/views/devise/shared/_footer.html.haml b/app/views/devise/shared/_footer.html.haml index 10cfc07a719..0744faa148c 100644 --- a/app/views/devise/shared/_footer.html.haml +++ b/app/views/devise/shared/_footer.html.haml @@ -1,9 +1,10 @@ %hr.footer-fixed -.container.footer-container +.container.footer-container.gl-display-flex.gl-justify-content-space-between .footer-links - unless public_visibility_restricted? = link_to _("Explore"), explore_root_path = link_to _("Help"), help_path = link_to _("About GitLab"), "https://#{ApplicationHelper.promo_host}" = link_to _("Community forum"), ApplicationHelper.community_forum, target: '_blank', class: 'text-nowrap', rel: 'noopener noreferrer' + = render 'devise/shared/language_switcher' = footer_message diff --git a/app/views/devise/shared/_language_switcher.html.haml b/app/views/devise/shared/_language_switcher.html.haml new file mode 100644 index 00000000000..4c47e3efd0f --- /dev/null +++ b/app/views/devise/shared/_language_switcher.html.haml @@ -0,0 +1,3 @@ +- return unless ::Feature.enabled?(:preferred_language_switcher) + +.js-language-switcher{ data: { locales: ordered_selectable_locales.to_json } } diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index b9c9c99bf1a..a3a5fe690a7 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -44,7 +44,6 @@ .form-group = f.label :email, class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}" = f.email_field :email, - value: @invite_email, class: 'form-control gl-form-input middle js-validate-email', data: { qa_selector: 'new_user_email_field' }, required: true, diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index abaf169afd5..b9d50e48d05 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,14 +1,14 @@ = render 'devise/shared/tab_single', tab_title: _('Resend unlock instructions') .login-box .login-body - = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| + = gitlab_ui_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| .devise-errors = render "devise/shared/error_messages", resource: resource .form-group.gl-mb-6 = f.label :email = f.email_field :email, class: 'form-control', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', title: _('Please provide a valid email address.') .clearfix - = f.submit _('Resend unlock instructions'), class: 'gl-button btn btn-confirm' + = f.submit _('Resend unlock instructions'), pajamas_button: true, class: 'gl-w-full' .clearfix.prepend-top-20 = render 'devise/shared/sign_in_link' diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml index f02d30081b6..67a88f3d623 100644 --- a/app/views/explore/projects/_filter.html.haml +++ b/app/views/explore/projects/_filter.html.haml @@ -1,9 +1,7 @@ - has_label = local_assigns.fetch(:has_label, false) -- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar) -- klass = feature_project_list_filter_bar ? 'gl-ml-3 gl-display-flex gl-flex-grow-1 gl-flex-shrink-1' : 'gl-ml-3' - selected = projects_filter_selected(params[:visibility_level]) - if current_user - unless has_label %span.gl-float-left= _("Visibility:") - = gl_redirect_listbox_tag(projects_filter_items, selected, class: klass, data: { right: true }) + = gl_redirect_listbox_tag(projects_filter_items, selected, class: 'gl-ml-3', data: { right: true }) diff --git a/app/views/explore/projects/_nav.html.haml b/app/views/explore/projects/_nav.html.haml index 9d7a6f1ccfb..9119026320a 100644 --- a/app/views/explore/projects/_nav.html.haml +++ b/app/views/explore/projects/_nav.html.haml @@ -7,5 +7,4 @@ .nav-controls - unless current_user = render 'shared/projects/search_form' - = render 'shared/projects/dropdown' = render 'filter' diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml index ae59d9c728b..9585eb76912 100644 --- a/app/views/explore/projects/index.html.haml +++ b/app/views/explore/projects/index.html.haml @@ -10,5 +10,5 @@ - else = render 'explore/head' -= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user += render 'explore/projects/nav' = render 'projects', projects: @projects diff --git a/app/views/explore/projects/page_out_of_bounds.html.haml b/app/views/explore/projects/page_out_of_bounds.html.haml index c554cce3dc6..ef5ee2c679e 100644 --- a/app/views/explore/projects/page_out_of_bounds.html.haml +++ b/app/views/explore/projects/page_out_of_bounds.html.haml @@ -9,7 +9,7 @@ - else = render 'explore/head' -= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user += render 'explore/projects/nav' .nothing-here-block .svg-content @@ -18,4 +18,5 @@ %h5= _("Maximum page reached") %p= _("Sorry, you have exceeded the maximum browsable page number. Please use the API to explore further.") - = link_to _("Back to page %{number}") % { number: @max_page_number }, request.params.merge(page: @max_page_number), class: 'gl-button btn btn-inverted' + = render Pajamas::ButtonComponent.new(href: request.params.merge(page: @max_page_number)) do + = _("Back to page %{number}") % { number: @max_page_number } diff --git a/app/views/explore/projects/starred.html.haml b/app/views/explore/projects/starred.html.haml index a1f2fea5134..ec7eefea264 100644 --- a/app/views/explore/projects/starred.html.haml +++ b/app/views/explore/projects/starred.html.haml @@ -9,5 +9,5 @@ - else = render 'explore/head' -= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user += render 'explore/projects/nav' = render 'projects', projects: @projects diff --git a/app/views/explore/projects/topic.html.haml b/app/views/explore/projects/topic.html.haml index 76e59a49ed1..7b2c5683482 100644 --- a/app/views/explore/projects/topic.html.haml +++ b/app/views/explore/projects/topic.html.haml @@ -25,7 +25,6 @@ .top-area.gl-pt-2.gl-pb-2 .nav-controls = render 'shared/projects/search_form' - = render 'shared/projects/dropdown' = render 'filter' = render 'projects', projects: @projects diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml index e23f63b0064..8a92ec31b22 100644 --- a/app/views/explore/projects/trending.html.haml +++ b/app/views/explore/projects/trending.html.haml @@ -9,5 +9,5 @@ - else = render 'explore/head' -= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user += render 'explore/projects/nav' = render 'projects', projects: @projects diff --git a/app/views/groups/_activities.html.haml b/app/views/groups/_activities.html.haml index 0d6c3e74ce8..b62076c23f3 100644 --- a/app/views/groups/_activities.html.haml +++ b/app/views/groups/_activities.html.haml @@ -1,8 +1,7 @@ .nav-block.activities = render 'shared/event_filter', show_group_events: @group.supports_events? .controls - = link_to group_path(@group, rss_url_options), class: 'btn gl-button btn-default btn-icon d-none d-sm-inline-flex has-tooltip' , title: _('Subscribe') do - = sprite_icon('rss', css_class: 'gl-icon') + = render Pajamas::ButtonComponent.new(href: group_path(@group, rss_url_options), icon: 'rss', button_options: { class: 'd-none d-sm-inline-flex has-tooltip', title: _('Subscribe') }) .content_list .loading diff --git a/app/views/groups/_group_admin_settings.html.haml b/app/views/groups/_group_admin_settings.html.haml index 687a1fb32bf..0b26db64ffa 100644 --- a/app/views/groups/_group_admin_settings.html.haml +++ b/app/views/groups/_group_admin_settings.html.haml @@ -27,3 +27,13 @@ = f.text_field :two_factor_grace_period, class: 'form-control gl-form-input gl-form-input-sm' %small.form-text.text-gl-muted = _("Time (in hours) that users are allowed to skip forced configuration of two-factor authentication.") + +- if @group.namespace_settings.present? + .form-group.gl-form-group + %legend.col-form-label.col-form-label + = s_('Runners|Runner Registration') + - parent_disabled = Gitlab::CurrentSettings.valid_runner_registrars.exclude?('group') || !@group.all_ancestors_have_runner_registration_enabled? + = f.gitlab_ui_checkbox_component :runner_registration_enabled, + s_('Runners|New group runners can be registered'), + checkbox_options: { checked: @group.runner_registration_enabled && !parent_disabled, disabled: parent_disabled }, + help_text: s_('Runners|Existing runners are not affected. To permit runner registration for all groups, enable this setting in the Admin Area in Settings > CI/CD.').html_safe diff --git a/app/views/groups/_home_panel.html.haml b/app/views/groups/_home_panel.html.haml index a82a2e41508..1494990e427 100644 --- a/app/views/groups/_home_panel.html.haml +++ b/app/views/groups/_home_panel.html.haml @@ -3,16 +3,15 @@ - emails_disabled = @group.emails_disabled? .group-home-panel - .row.my-3 - .home-panel-title-row.col-md-12.col-lg-6.d-flex + .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-gap-3.gl-my-5 + .home-panel-title-row.gl-display-flex.gl-align-items-center .avatar-container.rect-avatar.s64.home-panel-avatar.gl-flex-shrink-0.float-none{ class: 'gl-mr-3!' } = 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-font-size-h1.gl-mt-3.gl-mb-2{ itemprop: 'name' } - = @group.name - %span.visibility-icon.gl-text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) } - = visibility_level_icon(@group.visibility_level, options: {class: 'icon'}) + %div + %h1.home-panel-title.gl-font-size-h1.gl-mt-3.gl-mb-2.gl-display-flex{ itemprop: 'name' } + = @group.name + %span.visibility-icon.gl-text-secondary.has-tooltip.gl-ml-2{ data: { container: 'body' }, title: visibility_icon_description(@group) } + = visibility_level_icon(@group.visibility_level, options: {class: 'icon'}) .home-panel-metadata.gl-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) %span.gl-display-inline-block.gl-vertical-align-middle @@ -22,24 +21,23 @@ %span.gl-ml-3.gl-mb-3 = render 'shared/members/access_request_links', source: @group - .home-panel-buttons.col-md-12.col-lg-6 - - if current_user - .gl-display-flex.gl-flex-wrap.gl-lg-justify-content-end.gl-mx-n2{ data: { testid: 'group-buttons' } } - - if current_user.admin? - = link_to [:admin, @group], class: 'btn btn-default gl-button btn-icon gl-mt-3 gl-mr-2', title: _('View group in admin area'), - data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = sprite_icon('admin') - - if @notification_setting - .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), group_id: @group.id, container_class: 'gl-mx-2 gl-mt-3 gl-vertical-align-top', no_flip: 'true' } } - - if can_create_subgroups - .gl-px-2.gl-sm-w-auto.gl-w-full - = link_to _("New subgroup"), - new_group_path(parent_id: @group.id, anchor: 'create-group-pane'), - class: "btn btn-default gl-button gl-mt-3 gl-sm-w-auto gl-w-full", - data: { qa_selector: 'new_subgroup_button' } - - if can_create_projects - .gl-px-2.gl-sm-w-auto.gl-w-full - = link_to _("New project"), new_project_path(namespace_id: @group.id), class: "btn btn-confirm gl-button gl-mt-3 gl-sm-w-auto gl-w-full", data: { qa_selector: 'new_project_button' } + - if current_user + .home-panel-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3{ data: { testid: 'group-buttons' } } + - if current_user.admin? + = link_to [:admin, @group], class: 'btn btn-default gl-button btn-icon', title: _('View group in admin area'), + data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do + = sprite_icon('admin') + - if @notification_setting + .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), group_id: @group.id, container_class: 'gl-vertical-align-top', no_flip: 'true' } } + - if can_create_subgroups + .gl-sm-w-auto.gl-w-full + = link_to _("New subgroup"), + new_group_path(parent_id: @group.id, anchor: 'create-group-pane'), + class: "btn btn-default gl-button gl-sm-w-auto gl-w-full", + data: { qa_selector: 'new_subgroup_button' } + - if can_create_projects + .gl-sm-w-auto.gl-w-full + = link_to _("New project"), new_project_path(namespace_id: @group.id), class: "btn btn-confirm gl-button gl-sm-w-auto gl-w-full", data: { qa_selector: 'new_project_button' } - if @group.description.present? .group-home-desc.mt-1 diff --git a/app/views/groups/_import_group_from_another_instance_panel.html.haml b/app/views/groups/_import_group_from_another_instance_panel.html.haml index d48bf0173a4..4a4bdfc6714 100644 --- a/app/views/groups/_import_group_from_another_instance_panel.html.haml +++ b/app/views/groups/_import_group_from_another_instance_panel.html.haml @@ -1,20 +1,39 @@ +- bulk_imports_disabled = !Gitlab::CurrentSettings.bulk_import_enabled? + = gitlab_ui_form_with url: configure_import_bulk_imports_path(namespace_id: params[:parent_id]), class: 'gl-show-field-errors' do |f| .gl-border-l-solid.gl-border-r-solid.gl-border-t-solid.gl-border-gray-100.gl-border-1.gl-p-5.gl-mt-4 .gl-display-flex.gl-align-items-center %h4.gl-display-flex = s_('GroupsNew|Import groups from another instance of GitLab') = link_to _('History'), history_import_bulk_imports_path, class: 'gl-link gl-ml-auto' - = render Pajamas::AlertComponent.new(dismissible: false, - variant: :warning) do |c| - = c.body do - - docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/group/import/index.md') } - - docs_link_end = '</a>'.html_safe - = s_('GroupsNew|Not all related objects are migrated. %{docs_link_start}More info%{docs_link_end}.').html_safe % { docs_link_start: docs_link_start, docs_link_end: docs_link_end } + + - if bulk_imports_disabled + = render Pajamas::AlertComponent.new(dismissible: false, variant: :tip) do |c| + = c.body do + = s_('GroupsNew|Importing groups by direct transfer is currently disabled.') + + - if current_user.admin? + - admin_link_start = '<a href="%{url}">'.html_safe % { url: general_admin_application_settings_path(anchor: 'js-visibility-settings') } + - admin_link_end = '</a>'.html_safe + + = s_('GroupsNew|Please %{admin_link_start}enable it in the Admin settings%{admin_link_end}.').html_safe % { admin_link_start: admin_link_start, admin_link_end: admin_link_end } + - else + = s_('GroupsNew|Please ask your Administrator to enable it in the Admin settings.') + + = s_('GroupsNew|Remember to enable it also on the instance you are migrating from.') + - else + = render Pajamas::AlertComponent.new(dismissible: false, + variant: :warning) do |c| + = c.body do + - docs_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/group/import/index.md') } + - docs_link_end = '</a>'.html_safe + = s_('GroupsNew|Not all related objects are migrated. %{docs_link_start}More info%{docs_link_end}.').html_safe % { docs_link_start: docs_link_start, docs_link_end: docs_link_end } + %p.gl-mt-3 - = s_('GroupsNew|Provide credentials for another instance of GitLab to import your groups directly.') + = s_('GroupsNew|Provide credentials for another instance of GitLab to import your groups directly.') .form-group.gl-display-flex.gl-flex-direction-column = f.label :bulk_import_gitlab_url, s_('GroupsNew|GitLab source URL'), for: 'import_gitlab_url' - = f.text_field :bulk_import_gitlab_url, placeholder: 'https://gitlab.example.com', class: 'gl-form-input col-xs-12 col-sm-8', + = f.text_field :bulk_import_gitlab_url, disabled: bulk_imports_disabled, placeholder: 'https://gitlab.example.com', class: 'gl-form-input col-xs-12 col-sm-8', required: true, title: s_('GroupsNew|Please fill in GitLab source URL.'), id: 'import_gitlab_url', @@ -24,12 +43,13 @@ .gl-font-weight-normal - pat_link_start = '<a href="%{url}" target="_blank">'.html_safe % { url: help_page_path('user/profile/personal_access_tokens') } - short_living_link_start = '<a href="%{url}" target="_blank">'.html_safe % { url: help_page_path('security/token_overview', anchor: 'security-considerations') } - = s_('GroupsNew|Create this in the %{pat_link_start}user settings%{pat_link_end} of the source GitLab instance. For %{short_living_link_start}security reasons%{short_living_link_end}, use a short expiration date when creating the token.').html_safe % { pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe, short_living_link_start: short_living_link_start, short_living_link_end: '</a>'.html_safe } + = s_('GroupsNew|Create a token with %{code_start}api%{code_end} and %{code_start}read_repository%{code_end} scopes in the %{pat_link_start}user settings%{pat_link_end} of the source GitLab instance. For %{short_living_link_start}security reasons%{short_living_link_end}, set a short expiration date for the token. Keep in mind that large migrations take more time.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe, pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe, short_living_link_start: short_living_link_start, short_living_link_end: '</a>'.html_safe } = f.text_field :bulk_import_gitlab_access_token, placeholder: s_('GroupsNew|e.g. h8d3f016698e...'), class: 'gl-form-input gl-mt-3 col-xs-12 col-sm-8', required: true, + disabled: bulk_imports_disabled, autocomplete: 'off', title: s_('GroupsNew|Please fill in your personal access token.'), id: 'import_gitlab_token', data: { qa_selector: 'import_gitlab_token' } .gl-border-gray-100.gl-border-solid.gl-border-1.gl-bg-gray-10.gl-p-5 - = f.submit s_('GroupsNew|Connect instance'), pajamas_button: true, data: { qa_selector: 'connect_instance_button' } + = f.submit s_('GroupsNew|Connect instance'), disabled: bulk_imports_disabled, pajamas_button: true, data: { qa_selector: 'connect_instance_button' } diff --git a/app/views/groups/_invite_groups_modal.html.haml b/app/views/groups/_invite_groups_modal.html.haml index 2e11f6cee4f..b8e40460a92 100644 --- a/app/views/groups/_invite_groups_modal.html.haml +++ b/app/views/groups/_invite_groups_modal.html.haml @@ -1,3 +1,3 @@ - return unless can_admin_group_member?(group) -.js-invite-groups-modal{ data: common_invite_group_modal_data(group, GroupMember, 'false') } +.js-invite-groups-modal{ data: { reload_page_on_submit: local_assigns.fetch(:reload_page_on_submit, false).to_s }.merge(common_invite_group_modal_data(group, GroupMember, 'false')) } diff --git a/app/views/groups/_invite_members_modal.html.haml b/app/views/groups/_invite_members_modal.html.haml index 786034fd2e7..bf0e8b627fd 100644 --- a/app/views/groups/_invite_members_modal.html.haml +++ b/app/views/groups/_invite_members_modal.html.haml @@ -2,4 +2,5 @@ .js-invite-members-modal{ data: { is_project: 'false', access_levels: GroupMember.access_level_roles.to_json, + reload_page_on_submit: local_assigns.fetch(:reload_page_on_submit, false).to_s, help_link: help_page_url('user/permissions') }.merge(common_invite_modal_dataset(group)).merge(users_filter_data(group)) } diff --git a/app/views/groups/_new_group_fields.html.haml b/app/views/groups/_new_group_fields.html.haml index 94b0b018084..95990e8937c 100644 --- a/app/views/groups/_new_group_fields.html.haml +++ b/app/views/groups/_new_group_fields.html.haml @@ -30,5 +30,7 @@ = recaptcha_tags nonce: content_security_policy_nonce .row .col-sm-12 - = f.submit submit_label, class: "btn gl-button btn-confirm", data: { qa_selector: 'create_group_button' } - = link_to _('Cancel'), dashboard_groups_path, class: 'btn gl-button btn-default btn-cancel' + = f.submit submit_label, pajamas_button: true, data: { qa_selector: 'create_group_button' } + = render Pajamas::ButtonComponent.new(href: dashboard_groups_path) do + = _('Cancel') + diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index bca1c874cc6..8763912438b 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -13,7 +13,7 @@ = _('Collapse') %p = _('Update your group name, description, avatar, and visibility.') - = link_to s_('Learn more about groups.'), help_page_path('user/group/index') + = link_to _('Learn more about groups.'), help_page_path('user/group/index') .settings-content = render 'groups/settings/general' diff --git a/app/views/groups/group_members/index.html.haml b/app/views/groups/group_members/index.html.haml index 4da70c8bf5d..298ed2c0806 100644 --- a/app/views/groups/group_members/index.html.haml +++ b/app/views/groups/group_members/index.html.haml @@ -15,8 +15,8 @@ classes: 'gl-md-w-auto gl-w-full gl-md-ml-3 gl-md-mt-0 gl-mt-3', trigger_source: 'group-members-page', display_text: _('Invite members') } } - = render 'groups/invite_groups_modal', group: @group - = render 'groups/invite_members_modal', group: @group + = render 'groups/invite_groups_modal', group: @group, reload_page_on_submit: true + = render 'groups/invite_members_modal', group: @group, reload_page_on_submit: true = render_if_exists 'groups/group_members/ldap_sync' diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 925e7d46f14..6faa4758d66 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -1,8 +1,9 @@ - page_title _('Issues') +- add_page_specific_style 'page_bundles/issuable_list' - add_page_specific_style 'page_bundles/issues_list' = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@group.name} issues") -.js-issues-list{ data: group_issues_list_data(@group, current_user) } +.js-issues-list-root{ data: group_issues_list_data(@group, current_user) } - if can?(current_user, :admin_issue, @group) && @group.licensed_feature_available?(:group_bulk_edit) = render_if_exists 'shared/issuable/group_bulk_update_sidebar', group: @group, type: :issues diff --git a/app/views/groups/labels/index.html.haml b/app/views/groups/labels/index.html.haml index 8187dda5471..a03c406acc6 100644 --- a/app/views/groups/labels/index.html.haml +++ b/app/views/groups/labels/index.html.haml @@ -11,7 +11,7 @@ .labels-container.gl-mt-5 - if @labels.any? .text-muted.gl-mb-5 - = _('Labels can be applied to %{features}. Group labels are available for any project within the group.') % { features: issuable_types.to_sentence } + = labels_function_introduction .other-labels %h4= _('Labels') %ul.manage-labels-list.js-other-labels diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index 6c4a8b53764..92f6c896e7b 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -1,6 +1,7 @@ - @can_bulk_update = can?(current_user, :admin_merge_request, @group) && @group.licensed_feature_available?(:group_bulk_edit) && issuables_count_for_state(:merge_requests, :all) > 0 - page_title _("Merge requests") +- add_page_specific_style 'page_bundles/issuable_list' .top-area = render 'shared/issuable/nav', type: :merge_requests diff --git a/app/views/groups/milestones/_form.html.haml b/app/views/groups/milestones/_form.html.haml index d4b1c3c27f1..a99d76f99a7 100644 --- a/app/views/groups/milestones/_form.html.haml +++ b/app/views/groups/milestones/_form.html.haml @@ -22,7 +22,9 @@ .form-actions - if @milestone.new_record? = f.submit _('Create milestone'), data: { qa_selector: "create_milestone_button" }, pajamas_button: true - = link_to _("Cancel"), group_milestones_path(@group), class: "btn gl-button btn-cancel" + = render Pajamas::ButtonComponent.new(href: group_milestones_path(@group)) do + = _("Cancel") - else = f.submit _('Update milestone'), pajamas_button: true - = link_to _("Cancel"), group_milestone_path(@group, @milestone), class: "btn gl-button btn-cancel" + = render Pajamas::ButtonComponent.new(href: group_milestone_path(@group, @milestone)) do + = _("Cancel") diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml index 50a1b474504..f49b69f821d 100644 --- a/app/views/groups/milestones/index.html.haml +++ b/app/views/groups/milestones/index.html.haml @@ -9,13 +9,14 @@ = render 'shared/milestones/search_form' = render 'shared/milestones_sort_dropdown' - if can?(current_user, :admin_milestone, @group) - = link_to _('New milestone'), new_group_milestone_path(@group), class: "btn gl-button btn-confirm gl-ml-3", data: { qa_selector: "new_group_milestone_link" } - + = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }, class: "gl-ml-3" }) do + = _('New milestone') - if @milestones.blank? = render 'shared/empty_states/milestones_tab', learn_more_path: help_page_path('user/project/milestones/index') do - if can?(current_user, :admin_milestone, @group) .text-center - = link_to _('New milestone'), new_group_milestone_path(@group), class: "btn gl-button btn-confirm", data: { qa_selector: "new_group_milestone_link" } + = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }}) do + = _('New milestone') - else .milestones %ul.content-list @@ -29,4 +30,5 @@ = render 'shared/empty_states/milestones', learn_more_path: help_page_path('user/project/milestones/index') do - if can?(current_user, :admin_milestone, @group) .text-center - = link_to _('New milestone'), new_group_milestone_path(@group), class: "btn gl-button btn-confirm", data: { qa_selector: "new_group_milestone_link" } + = render Pajamas::ButtonComponent.new(href: new_group_milestone_path(@group), variant: :confirm, button_options: { data: { qa_selector: "new_group_milestone_link" }}) do + = _('New milestone') diff --git a/app/views/groups/projects.html.haml b/app/views/groups/projects.html.haml index e7ae54a8879..cae347630ee 100644 --- a/app/views/groups/projects.html.haml +++ b/app/views/groups/projects.html.haml @@ -12,19 +12,19 @@ = _("New project") - c.body do %ul.content-list - - @projects.each do |project| - %li.project-row.gl-align-items-center{ class: 'gl-display-flex!' } + - @projects.each_with_index do |project, idx| + %li.project-row.gl-align-items-center{ class: 'gl-display-flex!', data: { qa_selector: 'project_row_container', qa_index: idx } } .avatar-container.rect-avatar.s40.gl-flex-shrink-0 = project_icon(project, alt: '', class: 'avatar project-avatar s40', width: 40, height: 40) .gl-min-w-0.gl-flex-grow-1 .title = link_to project_path(project), class: 'js-prefetch-document' do - %span.project-full-name - %span.namespace-name + %span.project-full-name{ data: { qa_selector: 'project_fullname_content' } } + %span.namespace-name{ data: { qa_selector: 'project_namespace_content' } } - if project.namespace = project.namespace.human_name \/ - %span.project-name + %span.project-name{ data: { qa_selector: 'project_name_content', qa_project_name: project.name } } = project.name %span{ class: visibility_level_color(project.visibility_level) } = visibility_level_icon(project.visibility_level) @@ -38,9 +38,9 @@ = render 'project_badges', project: project .controls.gl-flex-shrink-0.gl-ml-5 - = link_to _('Members'), project_project_members_path(project), id: dom_id(project, :edit), class: "btn gl-button" - = link_to _('Edit'), edit_project_path(project), id: dom_id(project, :edit), class: "btn gl-button" - = render 'delete_project_button', project: project + = link_to _('Members'), project_project_members_path(project), id: dom_id(project, :edit), class: "btn gl-button", data: { qa_selector: 'project_members_button' } + = link_to _('Edit'), edit_project_path(project), id: dom_id(project, :edit), class: "btn gl-button", data: { qa_selector: 'project_edit_button' } + = render 'delete_project_button', project: project, data: { qa_selector: 'project_delete_button' } - if @projects.blank? .nothing-here-block= _("This group has no projects yet") diff --git a/app/views/groups/registry/repositories/index.html.haml b/app/views/groups/registry/repositories/index.html.haml index 6060d697f52..efd2e53e100 100644 --- a/app/views/groups/registry/repositories/index.html.haml +++ b/app/views/groups/registry/repositories/index.html.haml @@ -1,6 +1,6 @@ - page_title _("Container Registry") - @content_class = "limit-container-width" unless fluid_layout -- add_page_startup_graphql_call('container_registry/get_container_repositories', { fullPath: @group.full_path, first: 10, name: nil, isGroupPage: true, sort: nil} ) +- add_page_startup_graphql_call('container_registry/get_container_repositories', { fullPath: @group.full_path, first: 10, name: nil, isGroupPage: true, sort: nil}) %section #js-container-registry{ data: { endpoint: group_container_registries_path(@group), @@ -12,7 +12,6 @@ "registry_host_url_with_port" => escape_once(registry_config.host_port), "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'), - "container_registry_importing_help_page_path" => help_page_path('user/packages/container_registry/index', anchor: 'tags-temporarily-cannot-be-marked-for-deletion'), "is_admin": current_user&.admin.to_s, is_group_page: "true", "group_path": @group.full_path, diff --git a/app/views/groups/runners/_settings.html.haml b/app/views/groups/runners/_settings.html.haml index 3e5ec3c26e2..24b2469c501 100644 --- a/app/views/groups/runners/_settings.html.haml +++ b/app/views/groups/runners/_settings.html.haml @@ -3,10 +3,3 @@ - if @group.licensed_feature_available?(:stale_runner_cleanup_for_namespace) .gl-mb-5 #stale-runner-cleanup-form{ data: { group_full_path: @group.full_path, stale_timeout_secs: ::Ci::Runner::STALE_TIMEOUT.to_i } } -= render Pajamas::BannerComponent.new(button_text: s_('Runners|Take me there!'), - button_link: group_runners_path(@group), - svg_path: 'illustrations/rocket-launch-md.svg', - close_options: { class: 'gl-display-none' }) do |c| - - c.title do - = s_('Runners|New group runners view') - %p= s_('Runners|The new view gives you more space and better visibility into your fleet of runners.') diff --git a/app/views/groups/runners/index.html.haml b/app/views/groups/runners/index.html.haml index 1146063969b..9ea83397348 100644 --- a/app/views/groups/runners/index.html.haml +++ b/app/views/groups/runners/index.html.haml @@ -1,3 +1,3 @@ - page_title s_('Runners|Runners') -#js-group-runners{ data: group_runners_data_attributes(@group).merge( { group_runners_limited_count: @group_runners_limited_count, registration_token: @group_runner_registration_token } ) } +#js-group-runners{ data: group_runners_data_attributes(@group).merge({ group_runners_limited_count: @group_runners_limited_count, registration_token: @group_runner_registration_token }) } diff --git a/app/views/groups/settings/_export.html.haml b/app/views/groups/settings/_export.html.haml index 66c1341fb15..5d79d0f8e79 100644 --- a/app/views/groups/settings/_export.html.haml +++ b/app/views/groups/settings/_export.html.haml @@ -25,10 +25,10 @@ %li= _('Runner tokens') %li= _('SAML discovery tokens') - if group.export_file_exists? - = link_to _('Download export'), download_export_group_path(group), - rel: 'nofollow', method: :get, class: 'btn gl-button btn-default', data: { qa_selector: 'download_export_link' } - = link_to _('Regenerate export'), export_group_path(group), - method: :post, class: 'btn gl-button btn-default', data: { qa_selector: 'regenerate_export_group_link' } + = render Pajamas::ButtonComponent.new(href: download_export_group_path(group), button_options: { rel: 'nofollow', data: { method: :get, qa_selector: 'download_export_link' } }) do + = _('Download export') + = render Pajamas::ButtonComponent.new(href: export_group_path(group), button_options: { data: { method: :post, qa_selector: 'regenerate_export_group_link' } }) do + = _('Regenerate export') - else - = link_to _('Export group'), export_group_path(group), - method: :post, class: 'btn gl-button btn-default', data: { qa_selector: 'export_group_link' } + = render Pajamas::ButtonComponent.new(href: export_group_path(group), button_options: { data: { method: :post, qa_selector: 'export_group_link' } }) do + = _('Export group') diff --git a/app/views/groups/settings/_general.html.haml b/app/views/groups/settings/_general.html.haml index be9d2c45885..658109fde64 100644 --- a/app/views/groups/settings/_general.html.haml +++ b/app/views/groups/settings/_general.html.haml @@ -32,4 +32,4 @@ = link_to s_('Groups|Remove avatar'), group_avatar_path(@group.to_param), aria: { label: s_('Groups|Remove avatar') }, data: { confirm: s_('Groups|Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'gl-button btn btn-danger-secondary' .form-group.gl-form-group = render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group - = f.submit s_('Groups|Save changes'), class: 'btn gl-button btn-confirm js-dirty-submit', data: { qa_selector: 'save_name_visibility_settings_button' } + = f.submit s_('Groups|Save changes'), pajamas_button: true, class: 'js-dirty-submit', data: { qa_selector: 'save_name_visibility_settings_button' } diff --git a/app/views/groups/settings/_git_access_protocols.html.haml b/app/views/groups/settings/_git_access_protocols.html.haml index df798db79ad..01e8536c7ad 100644 --- a/app/views/groups/settings/_git_access_protocols.html.haml +++ b/app/views/groups/settings/_git_access_protocols.html.haml @@ -1,6 +1,6 @@ - if group.root? && Feature.enabled?(:group_level_git_protocol_control, group) .form-group - = f.label s_('Enabled Git access protocols'), class: 'label-bold' + = f.label _('Enabled Git access protocols'), class: 'label-bold' = f.select :enabled_git_access_protocol, options_for_select(enabled_git_access_protocol_options_for_group, group.enabled_git_access_protocol), {}, class: 'form-control', data: { qa_selector: 'enabled_git_access_protocol_dropdown' }, disabled: !::Gitlab::CurrentSettings.enabled_git_access_protocol.blank? - if !::Gitlab::CurrentSettings.enabled_git_access_protocol.blank? .form-text.text-muted diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml index e35c0341ec0..a18789b52a3 100644 --- a/app/views/groups/settings/_permissions.html.haml +++ b/app/views/groups/settings/_permissions.html.haml @@ -52,4 +52,4 @@ checkbox_options: { checked: @group.crm_enabled? }, help_text: s_('GroupSettings|Organizations and contacts can be created and associated 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' } + = f.submit _('Save changes'), pajamas_button: true, class: 'gl-mt-3 js-dirty-submit', data: { qa_selector: 'save_permissions_changes_button' } diff --git a/app/views/groups/settings/_remove_button.html.haml b/app/views/groups/settings/_remove_button.html.haml index df978f3cb96..cb05076b39d 100644 --- a/app/views/groups/settings/_remove_button.html.haml +++ b/app/views/groups/settings/_remove_button.html.haml @@ -1,8 +1,8 @@ - remove_form_id = local_assigns.fetch(:remove_form_id, nil) -- if group.paid? +- if group.prevent_delete? = render Pajamas::AlertComponent.new(dismissible: false, alert_options: { class: 'gl-mb-5', data: { testid: 'group-has-linked-subscription-alert' }}) do |c| = c.body do - = html_escape(_("This group can't be removed because it is linked to a subscription. To remove this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe } + = html_escape(_("This group can't be removed because it is linked to a subscription. To remove this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/gitlab_com/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe } .js-confirm-danger{ data: group_settings_confirm_modal_data(group, remove_form_id) } diff --git a/app/views/groups/settings/_transfer.html.haml b/app/views/groups/settings/_transfer.html.haml index e01d703206c..3c76e8a864a 100644 --- a/app/views/groups/settings/_transfer.html.haml +++ b/app/views/groups/settings/_transfer.html.haml @@ -1,7 +1,7 @@ - form_id = "transfer-group-form" - initial_data = { button_text: s_('GroupSettings|Transfer group'), group_name: @group.name, group_id: @group.id, target_form_id: form_id, is_paid_group: group.paid?.to_s } -.sub-section +.sub-section{ data: { qa_selector: 'transfer_group_content' } } %h4.warning-title= s_('GroupSettings|Transfer group') %p= _('Transfer group to another parent group.') = form_for group, url: transfer_group_path(group), method: :put, html: { id: form_id, class: 'js-group-transfer-form' } do |f| @@ -15,5 +15,5 @@ - if group.paid? = render Pajamas::AlertComponent.new(dismissible: false, alert_options: { class: 'gl-mb-5' }) do |c| = c.body do - = html_escape(_("This group can't be transferred because it is linked to a subscription. To transfer this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe } + = html_escape(_("This group can't be transferred because it is linked to a subscription. To transfer this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/gitlab_com/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe } .js-transfer-group-form{ data: initial_data } diff --git a/app/views/groups/settings/applications/index.html.haml b/app/views/groups/settings/applications/index.html.haml index 96f834bd271..95bf2151bda 100644 --- a/app/views/groups/settings/applications/index.html.haml +++ b/app/views/groups/settings/applications/index.html.haml @@ -1,4 +1,5 @@ - page_title _("Group applications") +- add_page_specific_style 'page_bundles/settings' = render 'shared/doorkeeper/applications/index', oauth_applications_enabled: user_oauth_applications?, 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 a55ccd94974..06cb9893196 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 @@ -13,4 +13,4 @@ help_text: '%{help_text} %{learn_more_link}'.html_safe % { help_text: help_text, learn_more_link: learn_more_link }, checkbox_options: { checked: group.auto_devops_enabled? } - = f.submit _('Save changes'), class: 'btn gl-button btn-confirm gl-mt-5' + = f.submit _('Save changes'), class: 'gl-mt-5', pajamas_button: true diff --git a/app/views/groups/settings/ci_cd/_form.html.haml b/app/views/groups/settings/ci_cd/_form.html.haml index 89e353b94b0..d31d22c61be 100644 --- a/app/views/groups/settings/ci_cd/_form.html.haml +++ b/app/views/groups/settings/ci_cd/_form.html.haml @@ -7,5 +7,5 @@ = f.number_field :max_artifacts_size, class: 'form-control' %p.form-text.text-muted = _("The maximum file size in megabytes for individual job artifacts.") - = link_to s_('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size'), target: '_blank', rel: 'noopener noreferrer' = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/groups/settings/repository/_default_branch.html.haml b/app/views/groups/settings/repository/_default_branch.html.haml index 844a5f890a4..e8aa809a6ca 100644 --- a/app/views/groups/settings/repository/_default_branch.html.haml +++ b/app/views/groups/settings/repository/_default_branch.html.haml @@ -21,4 +21,4 @@ = render 'groups/settings/default_branch_protection', f: f, group: @group = f.hidden_field :redirect_target, value: "repository_settings" - = f.submit _('Save changes'), class: 'btn gl-button btn-confirm' + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/groups/usage_quotas/index.html.haml b/app/views/groups/usage_quotas/index.html.haml new file mode 100644 index 00000000000..a8c1071b876 --- /dev/null +++ b/app/views/groups/usage_quotas/index.html.haml @@ -0,0 +1,7 @@ +- page_title s_("UsageQuota|Usage") + +.gl-alert.gl-alert-no-icon.gl-alert-info.gl-mt-6 + %h2.gl-alert-title + Development + .gl-alert-content + Placeholder for usage quotas Vue app diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 8c74aac5ef5..b3f9d538e83 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -11,7 +11,7 @@ %span= link_to_version - if show_version_check? %span.gl-mt-5.gl-mb-3.gl-ml-3 - .js-gitlab-version-check-badge{ data: { "size": "lg", "actionable": "true" } } + .js-gitlab-version-check-badge{ data: { "size": "lg", "actionable": "true", "version": gitlab_version_check.to_json } } %hr - unless Gitlab::CurrentSettings.help_page_hide_commercial_content? diff --git a/app/views/ide/_show.html.haml b/app/views/ide/_show.html.haml index 95c15612adf..b18b5f1574b 100644 --- a/app/views/ide/_show.html.haml +++ b/app/views/ide/_show.html.haml @@ -1,13 +1,10 @@ -- @body_class = 'ide-layout' - page_title _('IDE') -- add_page_specific_style 'page_bundles/build' -- add_page_specific_style 'page_bundles/ide' +- unless use_new_web_ide? + - add_page_specific_style 'page_bundles/build' + - add_page_specific_style 'page_bundles/ide' -- content_for :prefetch_asset_tags do - - webpack_preload_asset_tag('monaco') + - content_for :prefetch_asset_tags do + - webpack_preload_asset_tag('monaco') -#ide.ide-loading{ data: ide_data } - .text-center - = gl_loading_icon(size: 'md') - %h2.clgray= _('Loading the GitLab IDE...') += render partial: 'shared/ide_root', locals: { data: ide_data, loading_text: _('Loading the GitLab IDE...') } diff --git a/app/views/import/_githubish_status.html.haml b/app/views/import/_githubish_status.html.haml index e92db09aaf1..4d2186a1352 100644 --- a/app/views/import/_githubish_status.html.haml +++ b/app/views/import/_githubish_status.html.haml @@ -4,6 +4,7 @@ - filterable = local_assigns.fetch(:filterable, true) - paginatable = local_assigns.fetch(:paginatable, false) - default_namespace_path = (local_assigns[:default_namespace] || current_user.namespace).full_path +- cancel_path = local_assigns.fetch(:cancel_path, nil) - provider_title = Gitlab::ImportSources.title(local_assigns.fetch(:provider)) - optional_stages = local_assigns.fetch(:optional_stages, []) @@ -13,11 +14,11 @@ #import-projects-mount-element{ data: { provider: provider, provider_title: provider_title, can_select_namespace: current_user.can_select_namespace?.to_s, ci_cd_only: has_ci_cd_only_params?.to_s, - namespaces_path: import_available_namespaces_path, repos_path: url_for([:status, :import, provider, { format: :json }]), jobs_path: url_for([:realtime_changes, :import, provider, { format: :json }]), default_target_namespace: default_namespace_path, import_path: url_for([:import, provider, { format: :json }]), + cancel_path: cancel_path, filterable: filterable.to_s, paginatable: paginatable.to_s, optional_stages: optional_stages.to_json }.merge(extra_data) } diff --git a/app/views/import/bulk_imports/status.html.haml b/app/views/import/bulk_imports/status.html.haml index 1c8de23f28f..e1547920708 100644 --- a/app/views/import/bulk_imports/status.html.haml +++ b/app/views/import/bulk_imports/status.html.haml @@ -3,7 +3,6 @@ - page_title _('Import groups') #import-groups-mount-element{ data: { status_path: status_import_bulk_imports_path(format: :json), - available_namespaces_path: import_available_namespaces_path(format: :json), default_target_namespace: @namespace&.id, create_bulk_import_path: import_bulk_imports_path(format: :json), jobs_path: realtime_changes_import_bulk_imports_path(format: :json), diff --git a/app/views/import/github/status.html.haml b/app/views/import/github/status.html.haml index 25afe9a7b1b..4a9f8be35c3 100644 --- a/app/views/import/github/status.html.haml +++ b/app/views/import/github/status.html.haml @@ -10,4 +10,5 @@ = render 'import/githubish_status', provider: 'github', paginatable: paginatable, default_namespace: @namespace, + cancel_path: cancel_import_github_path, optional_stages: Gitlab::GithubImport::Settings.stages_array diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml index 42a9d2c3136..079123e989e 100644 --- a/app/views/import/gitlab_projects/new.html.haml +++ b/app/views/import/gitlab_projects/new.html.haml @@ -21,5 +21,8 @@ = file_field_tag :file, class: '' .row .form-actions.col-sm-12 - = submit_tag _('Import project'), class: 'gl-button btn btn-confirm', data: { qa_selector: 'import_project_button' } - = link_to _('Cancel'), new_project_path, class: 'gl-button btn btn-default btn-cancel' + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { class: 'gl-mr-2', data: { qa_selector: 'import_project_button' }}) do + = _('Import project') + = render Pajamas::ButtonComponent.new(href: new_project_path) do + = _('Cancel') + diff --git a/app/views/import/manifest/_form.html.haml b/app/views/import/manifest/_form.html.haml index 096d2543502..a35e9ea3fcf 100644 --- a/app/views/import/manifest/_form.html.haml +++ b/app/views/import/manifest/_form.html.haml @@ -2,11 +2,14 @@ .form-group = label_tag :group_id, nil, class: 'label-bold' do = _('Group') - .input-group - .input-group-prepend.has-tooltip{ title: root_url } - .input-group-text - = root_url - = select_tag :group_id, namespaces_options(params[:namespace_id], display_path: true, groups_only: true), { class: 'select2 js-select-namespace' } + .input-group.gl-max-w-62 + - namespace_id = namespace_id_from(params) || current_user.manageable_groups(include_groups_with_developer_maintainer_access: true)&.first&.id + - namespace_full_path = GroupFinder.new(current_user).execute(id: namespace_id)&.full_path + .js-vue-new-project-url-select{ data: { namespace_full_path: namespace_full_path, + namespace_id: namespace_id , + input_id: 'group_id', + input_name: 'group_id', + root_url: root_url } } .form-text.text-muted = _('Choose the top-level group for your repository imports.') @@ -19,5 +22,8 @@ = link_to sprite_icon('question-o'), help_page_path('user/project/import/manifest') .gl-mb-3 - = submit_tag _('List available repositories'), class: 'gl-button btn btn-confirm' - = link_to _('Cancel'), new_project_path, class: 'gl-button btn btn-default btn-cancel' + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm) do + = _('List available repositories') + + = render Pajamas::ButtonComponent.new(href: new_project_path) do + = _('Cancel') diff --git a/app/views/import/shared/_new_project_form.html.haml b/app/views/import/shared/_new_project_form.html.haml index 16526382f42..6000612a285 100644 --- a/app/views/import/shared/_new_project_form.html.haml +++ b/app/views/import/shared/_new_project_form.html.haml @@ -2,20 +2,23 @@ .form-group.project-name.col-sm-12 = label_tag :name, _('Project name'), class: 'label-bold' = text_field_tag :name, @name, placeholder: "My awesome project", class: "js-project-name form-control gl-form-input input-lg", autofocus: true, required: true, aria: { required: true }, data: { qa_selector: 'project_name_field' } - .form-group.col-12.col-sm-6 + .form-group.col-12.col-sm-6.gl-pr-0 = label_tag :namespace_id, _('Project URL'), class: 'label-bold' - .form-group - .input-group.gl-flex-nowrap - - if current_user.can_select_namespace? - .input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url } - .input-group-text - = root_url - = select_tag :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), class: 'select2 js-select-namespace block-truncated' - - else - .input-group-prepend.static-namespace.has-tooltip{ title: user_url(current_user.username) + '/' } - .input-group-text.border-0 - #{user_url(current_user.username)}/ - = hidden_field_tag :namespace_id, current_user.namespace_id + .input-group.gl-flex-nowrap + - if current_user.can_select_namespace? + - namespace_id = namespace_id_from(params) + .js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path || current_user.namespace.full_path, + namespace_id: namespace_id || current_user.namespace_id, + input_id: 'namespace_id', + input_name: 'namespace_id', + root_url: root_url, + 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 + #{user_url(current_user.username)}/ + = hidden_field_tag :namespace_id, current_user.namespace_id + .gl-align-self-center.gl-pl-5 / .form-group.col-12.col-sm-6.project-path = label_tag :path, _('Project slug'), class: 'label-bold' = text_field_tag :path, @path, placeholder: "my-awesome-project", class: "js-path-name form-control gl-form-input", required: true, aria: { required: true }, data: { qa_selector: 'project_slug_field' } diff --git a/app/views/invites/show.html.haml b/app/views/invites/show.html.haml index c1ee12bb6c8..5f65405c8bc 100644 --- a/app/views/invites/show.html.haml +++ b/app/views/invites/show.html.haml @@ -17,8 +17,10 @@ = html_escape(_("You have been invited by %{link_to_inviter} to join %{source_name} %{strong_open}%{link_to_source}%{strong_close} as %{role}")) % { link_to_inviter: link_to_inviter, source_name: @invite_details[:title], strong_open: '<strong>'.html_safe, link_to_source: link_to_source, strong_close: '</strong>'.html_safe, role: @member.human_access } .actions - = link_to _("Accept invitation"), accept_invite_url(@token), method: :post, class: "btn gl-button btn-confirm" - = link_to _("Decline"), decline_invite_url(@token), method: :post, class: "btn gl-button btn-danger gl-ml-3" + = render Pajamas::ButtonComponent.new(variant: :confirm, method: :post, href: accept_invite_url(@token)) do + = _("Accept invitation") + = render Pajamas::ButtonComponent.new(variant: :danger, method: :post, href: decline_invite_url(@token), button_options: { class: 'gl-ml-3' }) do + = _("Decline") - else %p diff --git a/app/views/jira_connect/users/show.html.haml b/app/views/jira_connect/users/show.html.haml index 569c4587f14..5db6cb44ff6 100644 --- a/app/views/jira_connect/users/show.html.haml +++ b/app/views/jira_connect/users/show.html.haml @@ -11,7 +11,10 @@ = s_('JiraService|You can now close this window and%{br}return to the GitLab for Jira application.').html_safe % { br: '<br>'.html_safe } - if @jira_app_link - %p= link_to s_('Integrations|Return to GitLab for Jira'), @jira_app_link, class: 'gl-button btn btn-confirm' + %p + = render Pajamas::ButtonComponent.new(href: @jira_app_link, variant: :confirm) do + = s_('Integrations|Return to GitLab for Jira') + %p= link_to _('Sign out'), destroy_user_session_path, method: :post diff --git a/app/views/layouts/_google_tag_manager_head.html.haml b/app/views/layouts/_google_tag_manager_head.html.haml index 97e118aba93..21b9a604a35 100644 --- a/app/views/layouts/_google_tag_manager_head.html.haml +++ b/app/views/layouts/_google_tag_manager_head.html.haml @@ -20,6 +20,17 @@ 'wait_for_update': 500 }); + window.geofeed = (options) => { + dataLayer.push({ + 'event' : 'OneTrustCountryLoad', + 'oneTrustCountryId': options.country.toString() + }) + } + + const json = document.createElement('script'); + json.setAttribute('src', 'https://geolocation.onetrust.com/cookieconsentpub/v1/geo/location/geofeed'); + document.head.appendChild(json); + - if Feature.enabled?(:gtm_nonce, type: :ops) = javascript_tag nonce: content_security_policy_nonce do :plain diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 2ac926a7fc3..ea2f452b9e2 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -18,7 +18,13 @@ = favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png' - = render 'layouts/startup_css', { startup_filename: local_assigns.fetch(:startup_filename, nil) } + - if startup_css_enabled? + = render 'layouts/startup_css', { startup_filename: local_assigns.fetch(:startup_filename, nil) } + - else + - diffs_colors = user_diffs_colors + = stylesheet_link_tag "themes/#{user_application_theme_css_filename}" if user_application_theme_css_filename + = render 'layouts/diffs_colors_css', diffs_colors if diffs_colors.present? || request.path == profile_preferences_path + - if user_application_theme == 'gl-dark' %meta{ name: 'color-scheme', content: 'dark light' } = stylesheet_link_tag_defer "application_dark" @@ -31,16 +37,22 @@ = stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations'] = stylesheet_link_tag "test_environment", media: "all" if Rails.env.test? + = stylesheet_link_tag_defer "fonts" if use_new_fonts? + = stylesheet_link_tag_defer "highlight/themes/#{user_color_scheme}" - = render 'layouts/startup_css_activation' + - if startup_css_enabled? + = render 'layouts/startup_css_activation' = stylesheet_link_tag 'performance_bar' if performance_bar_enabled? = Gon::Base.render_data(nonce: content_security_policy_nonce) = render_if_exists 'layouts/header/translations' - = webpack_bundle_tag "sentry" if Gitlab.config.sentry.enabled + - if Feature.enabled?(:enable_new_sentry_clientside_integration, current_user) && Gitlab::CurrentSettings.sentry_enabled + = webpack_bundle_tag 'sentry' + - elsif Gitlab.config.sentry.enabled + = webpack_bundle_tag 'legacy_sentry' = webpack_bundle_tag 'performance_bar' if performance_bar_enabled? = yield :page_specific_javascripts diff --git a/app/views/layouts/_loading_hints.html.haml b/app/views/layouts/_loading_hints.html.haml index b3bb474ea43..b1d1447ae2a 100644 --- a/app/views/layouts/_loading_hints.html.haml +++ b/app/views/layouts/_loading_hints.html.haml @@ -13,3 +13,9 @@ = preload_link_tag(path_to_stylesheet("highlight/themes/#{user_color_scheme}"), crossorigin: css_crossorigin) - if Gitlab::Tracking.enabled? && Gitlab::Tracking.collector_hostname %link{ rel: 'preconnect', href: "https://#{Gitlab::Tracking.collector_hostname}", crossorigin: '' } + - if use_new_fonts? + -# Do not use preload_link_tag for fonts, to work around Firefox double-fetch bug. + -# See https://github.com/web-platform-tests/wpt/pull/36930 + %link{ rel: 'preload', href: font_path('gitlab-sans/GitLabSans.woff2'), as: 'font', crossorigin: css_crossorigin } + %link{ rel: 'preload', href: font_path('jetbrains-mono/JetBrainsMono.woff2'), as: 'font', crossorigin: css_crossorigin } + = preload_link_tag(path_to_stylesheet('fonts'), crossorigin: css_crossorigin) diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index d668399b408..bb1d051f71f 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -14,6 +14,7 @@ = dispensable_render "layouts/header/registration_enabled_callout" = dispensable_render "layouts/nav/classification_level_banner" = yield :flash_message + = dispensable_render "shared/gitlab_version/security_patch_upgrade_alert" = dispensable_render "shared/service_ping_consent" = dispensable_render_if_exists "layouts/header/ee_subscribable_banner" = dispensable_render_if_exists "layouts/header/seat_count_alert" diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml index 0350dc82e46..daf2c582de2 100644 --- a/app/views/layouts/_search.html.haml +++ b/app/views/layouts/_search.html.haml @@ -29,7 +29,7 @@ = hidden_field_tag :scope, search_context.scope = hidden_field_tag :search_code, search_context.code_search? - - ref = search_context.ref if can?(current_user, :download_code, search_context.project) + - ref = search_context.ref if can?(current_user, :read_code, search_context.project) = hidden_field_tag :snippets, search_context.for_snippets? = hidden_field_tag :repository_ref, ref = hidden_field_tag :nav_source, 'navbar' diff --git a/app/views/layouts/group_settings.html.haml b/app/views/layouts/group_settings.html.haml index c4e5e811280..60eeb9a4602 100644 --- a/app/views/layouts/group_settings.html.haml +++ b/app/views/layouts/group_settings.html.haml @@ -1,5 +1,6 @@ - page_title _("Settings") - nav "group" +- add_page_specific_style 'page_bundles/settings' - enable_search_settings locals: { container_class: 'gl-my-5' } = render template: "layouts/group" diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index 00e7a0567da..8363d424c1b 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -46,6 +46,10 @@ %li.d-md-none = link_to _("Switch to GitLab Next"), Gitlab::Saas.canary_toggle_com_url + - if Feature.enabled?(:super_sidebar_nav, current_user) + %li.divider + .js-new-nav-toggle{ data: { enabled: current_user.use_new_navigation.to_s, endpoint: profile_preferences_url} } + - if current_user_menu?(:sign_out) %li.divider %li diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 47d8f5a447f..558af352ae9 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -54,7 +54,7 @@ = sprite_icon('issues') - issues_count = assigned_issuables_count(:issues) = gl_badge_tag({ size: :sm, variant: :success }, { class: "gl-ml-n2 #{'gl-display-none' if issues_count == 0}", "aria-label": n_("%d assigned issue", "%d assigned issues", issues_count) % issues_count }) do - = number_with_delimiter(issues_count) + = assigned_open_issues_count_text - if header_link?(:merge_requests) = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter dropdown" }) do - top_level_link = assigned_mrs_dashboard_path @@ -119,12 +119,12 @@ = render 'layouts/header/current_user_dropdown' - if has_impersonation_link %li.nav-item.impersonation.ml-0 - = 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) + = render Pajamas::ButtonComponent.new(href: admin_impersonation_path, icon: 'incognito', button_options: { title: _('Stop impersonation'), class: 'impersonation-btn', aria: { label: _('Stop impersonation') }, data: { method: :delete, toggle: 'tooltip', placement: 'bottom', container: 'body', qa_selector: 'stop_impersonation_link' } }) - if header_link?(:sign_in) - if Gitlab.com? %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' + = render Pajamas::ButtonComponent.new(href: new_user_registration_path) do + = _('Sign up now') %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' diff --git a/app/views/layouts/header/_gitlab_version.html.haml b/app/views/layouts/header/_gitlab_version.html.haml index 2315caa5fe8..581d4d498e1 100644 --- a/app/views/layouts/header/_gitlab_version.html.haml +++ b/app/views/layouts/header/_gitlab_version.html.haml @@ -17,4 +17,4 @@ %span.gl-font-sm.gl-text-gray-500 #{Gitlab.version_info.major}.#{Gitlab.version_info.minor} %span.gl-ml-2 - .js-gitlab-version-check-badge{ data: { "size": "sm" } } + .js-gitlab-version-check-badge{ data: { "size": "sm", "version": gitlab_version_check.to_json } } diff --git a/app/views/layouts/header/_marketing_links.html.haml b/app/views/layouts/header/_marketing_links.html.haml index 24069de394d..c33229e4ec4 100644 --- a/app/views/layouts/header/_marketing_links.html.haml +++ b/app/views/layouts/header/_marketing_links.html.haml @@ -6,29 +6,29 @@ .dropdown-menu %ul %li - = link_to 'https://about.gitlab.com/stages-devops-lifecycle/' do + = link_to Gitlab::Utils.append_path(promo_url, '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 + = link_to Gitlab::Utils.append_path(promo_url, 'install') do = s_('LoggedOutMarketingHeader|Install GitLab') %li - = link_to 'https://about.gitlab.com/is-it-any-good/' do + = link_to Gitlab::Utils.append_path(promo_url, 'is-it-any-good') do = s_('LoggedOutMarketingHeader|How GitLab compares') %li - = link_to 'https://about.gitlab.com/get-started/' do + = link_to Gitlab::Utils.append_path(promo_url, 'get-started') do = s_('LoggedOutMarketingHeader|Get started') %li - = link_to 'https://docs.gitlab.com/' do + = link_to Gitlab::Saas::doc_url do = s_('LoggedOutMarketingHeader|GitLab docs') %li - = link_to 'https://about.gitlab.com/learn/' do + = link_to Gitlab::Utils.append_path(promo_url, 'learn') do = s_('LoggedOutMarketingHeader|GitLab Learn') %li.gl-mr-3 - = link_to 'https://about.gitlab.com/pricing/' do + = link_to Gitlab::Utils.append_path(promo_url, 'pricing') do = s_('LoggedOutMarketingHeader|Pricing') %li.gl-mr-3 - = link_to 'https://about.gitlab.com/sales/' do + = link_to Gitlab::Utils.append_path(promo_url, 'sales') do = s_('LoggedOutMarketingHeader|Talk to an expert') diff --git a/app/views/layouts/header/_registration_enabled_callout.html.haml b/app/views/layouts/header/_registration_enabled_callout.html.haml index dd3d14a5678..52c39fce961 100644 --- a/app/views/layouts/header/_registration_enabled_callout.html.haml +++ b/app/views/layouts/header/_registration_enabled_callout.html.haml @@ -1,17 +1,17 @@ - return unless show_registration_enabled_user_callout? -= render Pajamas::AlertComponent.new(title: _('Anyone can register for an account.'), += render Pajamas::AlertComponent.new(title: _('Check your sign-up restrictions'), variant: :warning, alert_options: { class: 'js-registration-enabled-callout', data: { feature_id: Users::CalloutsHelper::REGISTRATION_ENABLED_CALLOUT, dismiss_endpoint: callouts_path }}, close_button_options: { data: { testid: 'close-registration-enabled-callout' }}) do |c| = c.body do - = _('Only allow anyone to register for accounts on GitLab instances that you intend to be used by anyone. Allowing anyone to register makes GitLab instances more vulnerable.') + = _("Your GitLab instance allows anyone to register for an account, which is a security risk on public-facing GitLab instances. You should deactivate new sign ups if public users aren't expected to register for an account.") = c.actions do = link_to general_admin_application_settings_path(anchor: 'js-signup-settings'), class: 'btn gl-alert-action btn-confirm btn-md gl-button' do %span.gl-button-text - = _('Turn off') + = _('Deactivate') %button.btn.gl-alert-action.btn-default.btn-md.gl-button.js-close %span.gl-button-text = _('Acknowledge') diff --git a/app/views/layouts/header/_sign_in_register_button.html.haml b/app/views/layouts/header/_sign_in_register_button.html.haml index 992e8785251..cadb7cfe683 100644 --- a/app/views/layouts/header/_sign_in_register_button.html.haml +++ b/app/views/layouts/header/_sign_in_register_button.html.haml @@ -3,4 +3,5 @@ %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' + = render Pajamas::ButtonComponent.new(href: new_session_path(:user, redirect_to_referer: 'yes'), button_options: { class: 'btn-sign-in'}) do + = sign_in_text diff --git a/app/views/layouts/jira_connect.html.haml b/app/views/layouts/jira_connect.html.haml index 6acd7799875..80bbe578510 100644 --- a/app/views/layouts/jira_connect.html.haml +++ b/app/views/layouts/jira_connect.html.haml @@ -5,7 +5,7 @@ GitLab = yield :page_specific_styles - = javascript_include_tag 'https://connect-cdn.atl-paas.net/all.js' + = javascript_include_tag Gitlab.config.jira_connect.atlassian_js_url = Gon::Base.render_data(nonce: content_security_policy_nonce) = yield :head %body diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 8815dec5a6b..717175e8eb3 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -14,7 +14,7 @@ %span.nav-item-name = _('Overview') %ul.sidebar-sub-level-items - = nav_link(controller: %w[dashboard admin admin/projects users groups jobs runners gitaly_servers cohorts], html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: %w[dashboard admin admin/projects users groups jobs runners gitaly_servers cohorts], html_options: { class: "fly-out-top-item" }) do = link_to admin_root_path do %strong.fly-out-top-item-name = _('Overview') @@ -82,7 +82,7 @@ = _('Monitoring') %ul.sidebar-sub-level-items{ data: { qa_selector: 'admin_monitoring_submenu_content' } } - = nav_link(controller: admin_monitoring_nav_links, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: admin_monitoring_nav_links, html_options: { class: "fly-out-top-item" }) do = link_to admin_system_info_path do %strong.fly-out-top-item-name = _('Monitoring') @@ -117,7 +117,7 @@ %span.nav-item-name = _('Messages') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :broadcast_messages, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :broadcast_messages, html_options: { class: "fly-out-top-item" }) do = link_to admin_broadcast_messages_path do %strong.fly-out-top-item-name = _('Messages') @@ -129,7 +129,7 @@ %span.nav-item-name = _('System Hooks') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: [:hooks, :hook_logs], html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: [:hooks, :hook_logs], html_options: { class: "fly-out-top-item" }) do = link_to admin_hooks_path do %strong.fly-out-top-item-name = _('System Hooks') @@ -141,7 +141,7 @@ %span.nav-item-name = _('Applications') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :applications, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :applications, html_options: { class: "fly-out-top-item" }) do = link_to admin_applications_path do %strong.fly-out-top-item-name = _('Applications') @@ -154,7 +154,7 @@ = _('Abuse Reports') = gl_badge_tag number_with_delimiter(AbuseReport.count(:all)), variant: :info, size: :sm %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :abuse_reports, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :abuse_reports, html_options: { class: "fly-out-top-item" }) do = link_to admin_abuse_reports_path do %strong.fly-out-top-item-name = _('Abuse Reports') @@ -170,7 +170,7 @@ %span.nav-item-name = _('Kubernetes') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :clusters, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :clusters, html_options: { class: "fly-out-top-item" }) do = link_to admin_clusters_path do %strong.fly-out-top-item-name = _('Kubernetes') @@ -183,7 +183,7 @@ %span.nav-item-name = _('Spam Logs') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :spam_logs, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :spam_logs, html_options: { class: "fly-out-top-item" }) do = link_to admin_spam_logs_path do %strong.fly-out-top-item-name = _('Spam Logs') @@ -199,7 +199,7 @@ %span.nav-item-name = _('Deploy Keys') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :deploy_keys, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :deploy_keys, html_options: { class: "fly-out-top-item" }) do = link_to admin_deploy_keys_path do %strong.fly-out-top-item-name = _('Deploy Keys') @@ -213,7 +213,7 @@ %span.nav-item-name = _('Labels') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :labels, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :labels, html_options: { class: "fly-out-top-item" }) do = link_to admin_labels_path do %strong.fly-out-top-item-name = _('Labels') @@ -227,7 +227,7 @@ %ul.sidebar-sub-level-items{ data: { qa_selector: 'admin_settings_submenu_content' } } -# This active_nav_link check is also used in `app/views/layouts/admin.html.haml` - = nav_link(controller: [:application_settings, :integrations, :appearances], html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: [:application_settings, :integrations, :appearances], html_options: { class: "fly-out-top-item" }) do = link_to general_admin_application_settings_path do %strong.fly-out-top-item-name = _('Settings') @@ -273,7 +273,7 @@ = link_to network_admin_application_settings_path, title: _('Network'), data: { qa_selector: 'admin_settings_network_link' } do %span = _('Network') - = nav_link(controller: :appearances ) do + = nav_link(controller: :appearances) do = link_to admin_application_settings_appearances_path do %span = _('Appearance') diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index 0e3327935ca..e1978009114 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -12,7 +12,7 @@ %span.nav-item-name = _('Profile') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(path: 'profiles#show', html_options: { class: "fly-out-top-item" } ) do + = nav_link(path: 'profiles#show', html_options: { class: "fly-out-top-item" }) do = link_to profile_path do %strong.fly-out-top-item-name = _('Profile') @@ -23,7 +23,7 @@ %span.nav-item-name = _('Account') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: [:accounts, :two_factor_auths], html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: [:accounts, :two_factor_auths], html_options: { class: "fly-out-top-item" }) do = link_to profile_account_path do %strong.fly-out-top-item-name = _('Account') @@ -36,7 +36,7 @@ %span.nav-item-name = _('Applications') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: 'oauth/applications', html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: 'oauth/applications', html_options: { class: "fly-out-top-item" }) do = link_to applications_profile_path do %strong.fly-out-top-item-name = _('Applications') @@ -47,7 +47,7 @@ %span.nav-item-name = _('Chat') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :chat_names, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :chat_names, html_options: { class: "fly-out-top-item" }) do = link_to profile_chat_names_path do %strong.fly-out-top-item-name = _('Chat') @@ -59,7 +59,7 @@ %span.nav-item-name = _('Access Tokens') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :personal_access_tokens, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :personal_access_tokens, html_options: { class: "fly-out-top-item" }) do = link_to profile_personal_access_tokens_path do %strong.fly-out-top-item-name = _('Access Tokens') @@ -70,7 +70,7 @@ %span.nav-item-name = _('Emails') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :emails, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :emails, html_options: { class: "fly-out-top-item" }) do = link_to profile_emails_path do %strong.fly-out-top-item-name = _('Emails') @@ -82,7 +82,7 @@ %span.nav-item-name = _('Password') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :passwords, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :passwords, html_options: { class: "fly-out-top-item" }) do = link_to edit_profile_password_path do %strong.fly-out-top-item-name = _('Password') @@ -93,7 +93,7 @@ %span.nav-item-name = _('Notifications') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :notifications, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :notifications, html_options: { class: "fly-out-top-item" }) do = link_to profile_notifications_path do %strong.fly-out-top-item-name = _('Notifications') @@ -104,7 +104,7 @@ %span.nav-item-name = _('SSH Keys') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :keys, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :keys, html_options: { class: "fly-out-top-item" }) do = link_to profile_keys_path do %strong.fly-out-top-item-name = _('SSH Keys') @@ -115,7 +115,7 @@ %span.nav-item-name = _('GPG Keys') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :gpg_keys, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :gpg_keys, html_options: { class: "fly-out-top-item" }) do = link_to profile_gpg_keys_path do %strong.fly-out-top-item-name = _('GPG Keys') @@ -126,7 +126,7 @@ %span.nav-item-name = _('Preferences') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :preferences, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :preferences, html_options: { class: "fly-out-top-item" }) do = link_to profile_preferences_path do %strong.fly-out-top-item-name = _('Preferences') @@ -137,7 +137,7 @@ %span.nav-item-name = _('Active Sessions') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(controller: :active_sessions, html_options: { class: "fly-out-top-item" } ) do + = nav_link(controller: :active_sessions, html_options: { class: "fly-out-top-item" }) do = link_to profile_active_sessions_path do %strong.fly-out-top-item-name = _('Active Sessions') @@ -148,7 +148,7 @@ %span.nav-item-name = _('Authentication log') %ul.sidebar-sub-level-items.is-fly-out-only - = nav_link(path: 'profiles#audit_log', html_options: { class: "fly-out-top-item" } ) do + = nav_link(path: 'profiles#audit_log', html_options: { class: "fly-out-top-item" }) do = link_to audit_log_profile_path do %strong.fly-out-top-item-name = _('Authentication Log') diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index a06f9f8d6ef..67c3cd9cc54 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -1 +1 @@ -= render partial: 'shared/nav/sidebar', object: Sidebars::Projects::Panel.new(project_sidebar_context(@project, current_user, current_ref)) += render partial: 'shared/nav/sidebar', object: Sidebars::Projects::Panel.new(project_sidebar_context(@project, current_user, current_ref, ref_type: @ref_type)) diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml index 97d9f2fbc78..29e30c4434f 100644 --- a/app/views/layouts/project_settings.html.haml +++ b/app/views/layouts/project_settings.html.haml @@ -1,5 +1,6 @@ - page_title _("Settings") - nav "project" +- add_page_specific_style 'page_bundles/settings' - enable_search_settings locals: { container_class: 'gl-my-5' } diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml index dd4b9e45207..44c4b14e90d 100644 --- a/app/views/layouts/search.html.haml +++ b/app/views/layouts/search.html.haml @@ -1,4 +1,5 @@ - page_title _("Search") - header_title _("Search"), search_path +- add_page_specific_style 'page_bundles/search' = render template: "layouts/application" diff --git a/app/views/notify/_reassigned_issuable_email.html.haml b/app/views/notify/_reassigned_issuable_email.html.haml index 54e51e07c86..ead8e5d0a7e 100644 --- a/app/views/notify/_reassigned_issuable_email.html.haml +++ b/app/views/notify/_reassigned_issuable_email.html.haml @@ -1,4 +1,4 @@ -- to_names = content_tag(:strong, issuable.assignees.any? ? sanitize_name(issuable.assignee_list) : s_('Unassigned')) +- to_names = content_tag(:strong, issuable.assignees.any? ? sanitize_name(issuable.assignee_list) : _('Unassigned')) %p - if previous_assignees.any? diff --git a/app/views/notify/access_token_revoked_email.html.haml b/app/views/notify/access_token_revoked_email.html.haml index 4d9b9e14d14..ecd2b3e84b2 100644 --- a/app/views/notify/access_token_revoked_email.html.haml +++ b/app/views/notify/access_token_revoked_email.html.haml @@ -2,6 +2,8 @@ = _('Hi %{username}!') % { username: sanitize_name(@user.name) } %p = html_escape(_('A personal access token, named %{code_start}%{token_name}%{code_end}, has been revoked.')) % { code_start: '<code>'.html_safe, token_name: @token_name, code_end: '</code>'.html_safe } +- if @source == 'secret_detection' + = _('We found your token in a public project and have automatically revoked it to protect your account.') %p - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url } = html_escape(_('You can check your tokens or create a new one in your %{pat_link_start}personal access tokens settings%{pat_link_end}.')) % { pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe } diff --git a/app/views/notify/access_token_revoked_email.text.erb b/app/views/notify/access_token_revoked_email.text.erb index 17dd628d76c..a0623f96488 100644 --- a/app/views/notify/access_token_revoked_email.text.erb +++ b/app/views/notify/access_token_revoked_email.text.erb @@ -1,5 +1,9 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> <%= _('A personal access token, named %{token_name}, has been revoked.') % { token_name: @token_name } %> +<% if @source == 'secret_detection' %> + +<%= _('We found your token in a public project and have automatically revoked it to protect your account.') %> +<% end %> <%= _('You can check your tokens or create a new one in your personal access tokens settings %{pat_link}.') % { pat_link: @target_url } %> diff --git a/app/views/notify/autodevops_disabled_email.html.haml b/app/views/notify/autodevops_disabled_email.html.haml index bdf2a1136d3..d6812821966 100644 --- a/app/views/notify/autodevops_disabled_email.html.haml +++ b/app/views/notify/autodevops_disabled_email.html.haml @@ -11,7 +11,7 @@ - link_style = "color: #1b69b6; text-decoration:none;" - pipeline_link = link_to("\##{@pipeline.iid}", pipeline_url(@pipeline), style: link_style).html_safe - project_link = link_to(@project.name, project_url(@project), style: link_style).html_safe - - supported_langs_link = link_to(s_('Notify|currently supported languages'), 'https://docs.gitlab.com/ee/topics/autodevops/#currently-supported-languages', style: link_style ).html_safe + - supported_langs_link = link_to(s_('Notify|currently supported languages'), 'https://docs.gitlab.com/ee/topics/autodevops/#currently-supported-languages', style: link_style).html_safe - settings_link = link_to(s_('Notify|CI/CD project settings'), project_settings_ci_cd_url(@project), style: link_style).html_safe = s_('Notify|The Auto DevOps pipeline failed for pipeline %{pipeline_link} and has been disabled for %{project_link}. In order to use the Auto DevOps pipeline with your project, please review the %{supported_langs_link}, adjust your project accordingly, and turn on the Auto DevOps pipeline within your %{settings_link}.').html_safe % { pipeline_link: pipeline_link, project_link: project_link, supported_langs_link: supported_langs_link, settings_link: settings_link } diff --git a/app/views/notify/issue_moved_email.html.haml b/app/views/notify/issue_moved_email.html.haml index c77a863d1a4..666aa45540e 100644 --- a/app/views/notify/issue_moved_email.html.haml +++ b/app/views/notify/issue_moved_email.html.haml @@ -2,6 +2,6 @@ = s_('Notify|Issue was moved to another project.') - if @can_access_project %p - = sprintf(s_('Notify|New issue: %{project_issue_url}'), { project_issue_url: link_to(@new_issue.title, project_issue_url(@new_project, @new_issue)) } ).html_safe + = sprintf(s_('Notify|New issue: %{project_issue_url}'), { project_issue_url: link_to(@new_issue.title, project_issue_url(@new_project, @new_issue)) }).html_safe - else = s_("Notify|You don't have access to the project.") diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml index ee219914513..d493f9d5d98 100644 --- a/app/views/notify/repository_push_email.html.haml +++ b/app/views/notify/repository_push_email.html.haml @@ -60,7 +60,7 @@ - if diff_file.deleted_file? %strong< = diff_file.old_path - = s_('deleted') + = _('deleted') - elsif diff_file.renamed_file? %strong< = diff_file.old_path diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index cdd5a9ae7a1..bc0d615bb64 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -24,10 +24,12 @@ %p #{_('Status')}: #{current_user.two_factor_enabled? ? _('Enabled') : _('Disabled')} - if current_user.two_factor_enabled? - = link_to _('Manage two-factor authentication'), profile_two_factor_auth_path, class: 'gl-button btn btn-confirm' + = render Pajamas::ButtonComponent.new(variant: :confirm, href: profile_two_factor_auth_path) do + = _('Manage two-factor authentication') - else .gl-mb-3 - = link_to _('Enable two-factor authentication'), profile_two_factor_auth_path, class: 'gl-button btn btn-confirm', data: { qa_selector: 'enable_2fa_button' } + = render Pajamas::ButtonComponent.new(variant: :confirm, href: profile_two_factor_auth_path, button_options: { data: { qa_selector: 'enable_2fa_button' }}) do + = _('Enable two-factor authentication') .col-lg-12 %hr diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index e6d91543585..5c4ea7b2ecb 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -12,7 +12,11 @@ = f.label :title, s_('Profiles|Title'), class: 'label-bold' = f.text_field :title, class: "form-control gl-form-input input-lg", required: true, placeholder: s_('Profiles|Example: MacBook key'), data: { qa_selector: 'key_title_field' } %p.form-text.text-muted= s_('Profiles|Key titles are publicly visible.') - + .form-row + .col.form-group + = f.label :usage_type, s_('Profiles|Usage type') + .gl-md-form-input-lg + = f.select :usage_type, options_for_select(ssh_key_usage_types, :auth_and_signing), {}, { class: 'gl-form-select custom-select' } .form-row .col.form-group .js-access-tokens-expires-at{ data: {min_date: Date.tomorrow, max_date: max_date, default_date_offset: 365, description: ssh_key_expires_field_description } } diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index de4a19bdad7..219e7c4d2fe 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -25,7 +25,10 @@ %span.expires.gl-mr-3 = key.expired? ? s_('Profiles|Expired:') : s_('Profiles|Expires:') = key.expires_at ? key.expires_at.to_date : _('Never') + %span.last-used-at.gl-mr-3 + = s_('Profiles|Usage type:') + = ssh_key_usage_types.invert[key.usage_type] %span.key-created-at.gl-display-flex.gl-align-items-center - if key.can_delete? .gl-ml-3 - = render 'shared/ssh_keys/key_delete', html_class: "btn gl-button btn-icon btn-default js-confirm-modal-button", button_data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin)) + = render 'shared/ssh_keys/key_delete', icon: true, button_data: ssh_key_delete_modal_data(key, path_to_key(key, is_admin)) diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index 04fa1d96204..3c05502be57 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -10,6 +10,9 @@ %span.light= _('Title:') %strong= @key.title %li + %span.light= s_('Profiles|Usage type:') + %strong= ssh_key_usage_types.invert[@key.usage_type] + %li %span.light= _('Created on:') %strong= @key.created_at.to_s(:medium) %li @@ -39,4 +42,4 @@ .col-md-12 .float-right - if @key.can_delete? - = render 'shared/ssh_keys/key_delete', text: _('Delete'), html_class: "btn btn-danger gl-button delete-key js-confirm-modal-button", button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin)) + = render 'shared/ssh_keys/key_delete', button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin)) diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index a1d6ef3fec5..24ef9cf4dec 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -73,7 +73,7 @@ .form-group = f.label :layout, class: 'label-bold' do = s_('Preferences|Layout width') - = f.select :layout, layout_choices, {}, class: 'select2' + = f.select :layout, layout_choices, {}, class: 'gl-form-select custom-select' .form-text.text-muted = s_('Preferences|Choose between fixed (max. 1280px) and fluid (%{percentage}) application layout.').html_safe % { percentage: '100%' } .form-group @@ -88,7 +88,7 @@ .form-group = f.label :project_view, class: 'label-bold' do = s_('Preferences|Project overview content') - = f.select :project_view, project_view_choices, {}, class: 'select2' + = f.select :project_view, project_view_choices, {}, class: 'gl-form-select custom-select' .form-text.text-muted = s_('Preferences|Choose what content you want to see on a project’s overview page.') .form-group @@ -103,7 +103,7 @@ - supported_characters = %w(" ' ` ( [ { < * _).map { |char| "<code>#{char}</code>" }.join(', ') = f.gitlab_ui_checkbox_component :markdown_surround_selection, s_('Preferences|Surround text selection when typing quotes or brackets'), - help_text: 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 + help_text: 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.gitlab_ui_checkbox_component :markdown_automatic_lists, s_('Preferences|Automatically add new list items'), @@ -144,9 +144,24 @@ .form-group = f.label :first_day_of_week, class: 'label-bold' do = _('First day of the week') - = f.select :first_day_of_week, first_day_of_week_choices_with_default, {}, class: 'select2' + = f.select :first_day_of_week, first_day_of_week_choices_with_default, {}, class: 'gl-form-select custom-select' .col-sm-12 %hr + - if Feature.enabled?(:vscode_web_ide, current_user) + .row.js-preferences-form.js-search-settings-section + .col-lg-4.profile-settings-sidebar#web-ide + %h4.gl-mt-0 + = s_('Preferences|Web IDE') + %p + = s_('Preferences|The Web IDE Beta is the default Web IDE experience.') + = link_to _('Learn more'), help_page_path('user/project/web_ide_beta/index.md'), target: '_blank', rel: 'noopener noreferrer' + .col-lg-8 + .form-group + = f.gitlab_ui_checkbox_component :use_legacy_web_ide, + s_('Preferences|Opt out of the Web IDE Beta'), + help_text: s_('Preferences|The Web IDE remains available alongside the Beta.') + .col-sm-12 + %hr .row.js-preferences-form.js-search-settings-section .col-lg-4.profile-settings-sidebar#time-preferences %h4.gl-mt-0 diff --git a/app/views/projects/_files.html.haml b/app/views/projects/_files.html.haml index 51222784847..712d6fabf82 100644 --- a/app/views/projects/_files.html.haml +++ b/app/views/projects/_files.html.haml @@ -1,20 +1,23 @@ +- show_auto_devops_callout = show_auto_devops_callout?(@project) - is_project_overview = local_assigns.fetch(:is_project_overview, false) - ref = local_assigns.fetch(:ref) { current_ref } - project = local_assigns.fetch(:project) { @project } -- show_auto_devops_callout = show_auto_devops_callout?(@project) - add_page_startup_api_call logs_file_project_ref_path(@project, ref, @path, format: "json", offset: 0) - if readme_path = @project.repository.readme_path - add_page_startup_api_call project_blob_path(@project, tree_join(@ref, readme_path), viewer: "rich", format: "json") #tree-holder.tree-holder.clearfix.js-per-page{ data: { blame_per_page: Projects::BlameService::PER_PAGE } } - .nav-block.gl-display-flex.gl-xs-flex-direction-column.gl-align-items-stretch - = render 'projects/tree/tree_header', tree: @tree, is_project_overview: is_project_overview - .info-well.gl-display-none.gl-sm-display-flex.project-last-commit.gl-flex-direction-column #js-last-commit.gl-m-auto = gl_loading_icon(size: 'md') #js-code-owners + .nav-block.gl-display-flex.gl-xs-flex-direction-column.gl-align-items-stretch + = render 'projects/tree/tree_header', tree: @tree, is_project_overview: is_project_overview + + - if project.forked? && Feature.enabled?(:fork_divergence_counts, @project.fork_source) + = render 'projects/fork_info' + - if is_project_overview .project-buttons.gl-mb-5.js-show-on-project-root{ data: { qa_selector: 'project_buttons' } } = render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true diff --git a/app/views/projects/_flash_messages.html.haml b/app/views/projects/_flash_messages.html.haml index 7395495b537..2d9f7e49ddc 100644 --- a/app/views/projects/_flash_messages.html.haml +++ b/app/views/projects/_flash_messages.html.haml @@ -2,11 +2,13 @@ = content_for :flash_message do = render partial: 'deletion_failed', locals: { project: project } - - if current_user && can?(current_user, :download_code, project) + - if current_user && can?(current_user, :read_code, project) = render 'shared/no_ssh' = render 'shared/no_password' - unless project.empty_repo? = render 'shared/auto_devops_implicitly_enabled_banner', project: project + - if show_auto_devops_callout?(@project) + = render 'shared/auto_devops_callout' = render_if_exists 'projects/above_size_limit_warning', project: project = render_if_exists 'shared/shared_runners_minutes_limit', project: project, classes: [container_class, ("limit-container-width" unless fluid_layout)] = render_if_exists 'projects/terraform_banner', project: project diff --git a/app/views/projects/_fork_info.html.haml b/app/views/projects/_fork_info.html.haml new file mode 100644 index 00000000000..7fe30214e97 --- /dev/null +++ b/app/views/projects/_fork_info.html.haml @@ -0,0 +1,14 @@ +.info-well.gl-sm-display-flex.gl-flex-direction-column + .well-segment.gl-p-5.gl-w-full.gl-display-flex + .gl-icon.s32.gl-mt-4.gl-mr-4.gl-text-center + = sprite_icon('fork') + - source = visible_fork_source(@project) + - if source + %div + #{ s_('ForkedFromProjectPath|Forked from') } + = link_to source.full_name, project_path(source), data: { qa_selector: 'forked_from_link' } + .gl-text-secondary + = fork_divergence_message(::Projects::Forks::DivergenceCounts.new(@project, @ref).counts) + - else + .gl-py-4 + = s_('ForkedFromProjectPath|Forked from an inaccessible project') diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index a862b841008..dc426f2f6b7 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -4,17 +4,16 @@ - cache_enabled = Feature.enabled?(:cache_home_panel, @project, type: :development) .project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] } - .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3 - .home-panel-title-row.gl-display-flex + .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3.gl-gap-5 + .home-panel-title-row.gl-display-flex.gl-align-items-center %div{ class: 'avatar-container rect-avatar s64 home-panel-avatar gl-flex-shrink-0 gl-w-11 gl-h-11 gl-mr-3! float-none' } = 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{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' } - = @project.name - %span.visibility-icon.gl-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 + %div + %h1.home-panel-title.gl-font-size-h1.gl-mt-3.gl-mb-2.gl-display-flex{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' } + = @project.name + %span.visibility-icon.gl-text-secondary.has-tooltip.gl-ml-2{ 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, additional_classes: 'gl-align-self-center gl-ml-2' .home-panel-metadata.gl-font-sm.gl-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) %span.gl-display-inline-block.gl-vertical-align-middle @@ -25,22 +24,20 @@ = render 'shared/members/access_request_links', source: @project = cache_if(cache_enabled, [@project, @project.star_count, @project.forks_count, :buttons, current_user, @notification_setting], expires_in: 1.day) do - .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5 + .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3 - if current_user - if current_user.admin? - = link_to [:admin, @project], class: 'btn gl-button btn-icon gl-align-self-start gl-py-2! gl-mr-3', title: _('View project in admin area'), + = link_to [:admin, @project], class: 'btn btn-default gl-button btn-icon', title: _('View project in admin area'), data: {toggle: 'tooltip', placement: 'top', container: 'body'} do = sprite_icon('admin') - .gl-display-flex.gl-align-items-start.gl-mr-3 - - if @notification_setting - .js-vue-notification-dropdown{ data: { button_size: "small", disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), project_id: @project.id, no_flip: 'true' } } + - if @notification_setting + .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), project_id: @project.id, no_flip: 'true' } } - .count-buttons.gl-display-flex.gl-align-items-flex-start - = render 'projects/buttons/star' - = render 'projects/buttons/fork' + = render 'projects/buttons/star' + = render 'projects/buttons/fork' - - if can?(current_user, :download_code, @project) - = cache_if(cache_enabled, [@project, :download_code], expires_in: 1.minute) do + - if can?(current_user, :read_code, @project) + = cache_if(cache_enabled, [@project, :read_code], expires_in: 1.minute) do %nav.project-stats - if @project.empty_repo? = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors @@ -56,7 +53,7 @@ %button.btn.gl-button.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" } = _("Read more") - - if @project.forked? + - if @project.forked? && Feature.disabled?(:fork_divergence_counts, @project.fork_source) %p - source = visible_fork_source(@project) - if source diff --git a/app/views/projects/_invite_groups_modal.html.haml b/app/views/projects/_invite_groups_modal.html.haml index 40dc0009b24..101acd9149e 100644 --- a/app/views/projects/_invite_groups_modal.html.haml +++ b/app/views/projects/_invite_groups_modal.html.haml @@ -1,3 +1,3 @@ - return unless can_invite_members_for_project?(project) -.js-invite-groups-modal{ data: common_invite_group_modal_data(project, ProjectMember, 'true') } +.js-invite-groups-modal{ data: { reload_page_on_submit: local_assigns.fetch(:reload_page_on_submit, false).to_s }.merge(common_invite_group_modal_data(project, ProjectMember, 'true')) } diff --git a/app/views/projects/_invite_members_modal.html.haml b/app/views/projects/_invite_members_modal.html.haml index 16288f4357a..53f74a0f270 100644 --- a/app/views/projects/_invite_members_modal.html.haml +++ b/app/views/projects/_invite_members_modal.html.haml @@ -2,4 +2,5 @@ .js-invite-members-modal{ data: { is_project: 'true', access_levels: ProjectMember.permissible_access_level_roles(current_user, project).to_json, + reload_page_on_submit: local_assigns.fetch(:reload_page_on_submit, false).to_s, help_link: help_page_url('user/permissions') }.merge(common_invite_modal_dataset(project)).merge(users_filter_data(project.group)) } 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 8c12399fdbb..bb7a7731067 100644 --- a/app/views/projects/_merge_request_merge_checks_settings.html.haml +++ b/app/views/projects/_merge_request_merge_checks_settings.html.haml @@ -3,17 +3,6 @@ .form-group %b= s_('ProjectSettings|Merge checks') %p.text-secondary= s_('ProjectSettings|These checks must pass before merge requests can be merged.') - .builds-feature - = form.gitlab_ui_checkbox_component :only_allow_merge_if_pipeline_succeeds, - s_('ProjectSettings|Pipelines must succeed'), - help_text: s_("ProjectSettings|Merge requests can't be merged if the latest pipeline did not succeed or is still running.") - .gl-pl-6 - = form.gitlab_ui_checkbox_component :allow_merge_on_skipped_pipeline, - s_('ProjectSettings|Skipped pipelines are considered successful'), - help_text: s_('ProjectSettings|Introduces the risk of merging changes that do not pass the pipeline.'), - checkbox_options: { class: 'gl-pl-6' } + = render 'projects/merge_request_pipelines_and_threads_options', form: form, project: @project = render_if_exists 'projects/merge_request_merge_checks_status_checks', form: form, project: @project - = form.gitlab_ui_checkbox_component :only_allow_merge_if_all_discussions_are_resolved, - s_('ProjectSettings|All threads must be resolved'), - checkbox_options: { data: { qa_selector: 'allow_merge_if_all_discussions_are_resolved_checkbox' } } = render_if_exists 'projects/merge_request_merge_checks_jira_enforcement', form: form, project: @project diff --git a/app/views/projects/_merge_request_pipelines_and_threads_options.html.haml b/app/views/projects/_merge_request_pipelines_and_threads_options.html.haml new file mode 100644 index 00000000000..94f8d3cc4a3 --- /dev/null +++ b/app/views/projects/_merge_request_pipelines_and_threads_options.html.haml @@ -0,0 +1,13 @@ +- form = local_assigns.fetch(:form) + += form.gitlab_ui_checkbox_component :only_allow_merge_if_pipeline_succeeds, + s_('ProjectSettings|Pipelines must succeed'), + help_text: s_("ProjectSettings|Merge requests can't be merged if the latest pipeline did not succeed or is still running.") +.gl-pl-6 + = form.gitlab_ui_checkbox_component :allow_merge_on_skipped_pipeline, + s_('ProjectSettings|Skipped pipelines are considered successful'), + help_text: s_('ProjectSettings|Introduces the risk of merging changes that do not pass the pipeline.'), + checkbox_options: { class: 'gl-pl-6' } += form.gitlab_ui_checkbox_component :only_allow_merge_if_all_discussions_are_resolved, + s_('ProjectSettings|All threads must be resolved'), + checkbox_options: { data: { qa_selector: 'allow_merge_if_all_discussions_are_resolved_checkbox' } } diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index 0699e39b420..ec83782985b 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -10,6 +10,7 @@ = f.label :name, class: 'label-bold' do %span= _("Project name") = f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", data: { qa_selector: 'project_name', track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true } + #project_name_error.gl-field-error.hidden .form-group.project-path.col-sm-6.gl-pr-0 = f.label :namespace_id, class: 'label-bold' do %span= _('Project URL') @@ -18,6 +19,8 @@ - namespace_id = namespace_id_from(params) .js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path || @current_user_group&.full_path, namespace_id: namespace_id || @current_user_group&.id, + input_id: 'project_namespace_id', + input_name: 'project[namespace_id]', root_url: root_url, track_label: track_label, user_namespace_id: current_user.namespace.id } } diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index a907e175443..87a6b54d697 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -28,7 +28,8 @@ .file-buttons.gl-display-flex.gl-align-items-center.gl-justify-content-end - if is_markdown - = render 'shared/blob/markdown_buttons', show_fullscreen_button: false, supports_file_upload: false + - unless Feature.enabled?(:source_editor_toolbar, current_user) + = render 'shared/blob/markdown_buttons', show_fullscreen_button: false, supports_file_upload: false %span.soft-wrap-toggle = render Pajamas::ButtonComponent.new(icon: 'soft-unwrap', button_options: { class: 'no-wrap' }) do = _("No wrap") diff --git a/app/views/projects/blob/_template_selectors.html.haml b/app/views/projects/blob/_template_selectors.html.haml index 249c474587c..4fe68c1ce1a 100644 --- a/app/views/projects/blob/_template_selectors.html.haml +++ b/app/views/projects/blob/_template_selectors.html.haml @@ -4,12 +4,12 @@ - toggle_text = should_suggest_gitlab_ci_yml? ? '.gitlab-ci.yml' : 'Select a template type' = dropdown_tag(_(toggle_text), options: { toggle_class: 'js-template-type-selector', dropdown_class: 'dropdown-menu-selectable', data: { qa_selector: 'template_type_dropdown' } }) .license-selector.js-license-selector-wrap.js-template-selector-wrap.hidden - = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-license-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: licenses_for_select(@project), project: @project.name, fullname: @project.namespace.human_name, qa_selector: 'license_dropdown' } } ) + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-license-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: licenses_for_select(@project), project: @project.name, fullname: @project.namespace.human_name, qa_selector: 'license_dropdown' } }) .gitignore-selector.js-gitignore-selector-wrap.js-template-selector-wrap.hidden - = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitignore-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitignore_names(@project), qa_selector: 'gitignore_dropdown' } } ) + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitignore-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitignore_names(@project), qa_selector: 'gitignore_dropdown' } }) .metrics-dashboard-selector.js-metrics-dashboard-selector-wrap.js-template-selector-wrap.hidden - = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-metrics-dashboard-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: metrics_dashboard_ymls(@project), qa_selector: 'metrics_dashboard_dropdown' } } ) + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-metrics-dashboard-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: metrics_dashboard_ymls(@project), qa_selector: 'metrics_dashboard_dropdown' } }) #gitlab-ci-yml-selector.gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.js-template-selector-wrap.hidden - = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitlab-ci-yml-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls(@project), selected: params[:template], qa_selector: 'gitlab_ci_yml_dropdown' } } ) + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitlab-ci-yml-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls(@project), selected: params[:template], qa_selector: 'gitlab_ci_yml_dropdown' } }) .dockerfile-selector.js-dockerfile-selector-wrap.js-template-selector-wrap.hidden - = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-dockerfile-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: dockerfile_names(@project), qa_selector: 'dockerfile_dropdown' } } ) + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-dockerfile-selector', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: dockerfile_names(@project), qa_selector: 'dockerfile_dropdown' } }) diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index 63d0cf7145d..91efd5ef048 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -17,18 +17,12 @@ .form-text.text-muted.text-danger.js-branch-name-error .form-group.row = label_tag :ref, _('Create from'), class: 'col-form-label col-sm-2' - .col-sm-10.create-from - .dropdown - = hidden_field_tag :ref, default_ref - = button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide js-branch-select monospace', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do - .text-left.dropdown-toggle-text= default_ref - = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") - = render 'shared/ref_dropdown', dropdown_class: 'wide' + .col-sm-auto.create-from + .js-new-branch-ref-selector{ data: { project_id: @project.id, default_branch_name: default_ref, hidden_input_name: 'ref' } } .form-text.text-muted = _('Existing branch name, tag, or commit SHA') .form-actions = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { type: 'submit', class: 'gl-mr-3' }) do = _('Create branch') = link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' --# haml-lint:disable InlineJavaScript -%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe + diff --git a/app/views/projects/buttons/_clone.html.haml b/app/views/projects/buttons/_clone.html.haml index 34aecd31c57..a755cb9f5b0 100644 --- a/app/views/projects/buttons/_clone.html.haml +++ b/app/views/projects/buttons/_clone.html.haml @@ -27,28 +27,28 @@ = render_if_exists 'projects/buttons/geo' = render_if_exists 'projects/buttons/kerberos_clone_field' %li.divider.mt-2 - %li.pt-2.gl-new-dropdown-item + %li.pt-2.gl-dropdown-item %label.label-bold{ class: 'gl-px-4!' } = _('Open in your IDE') - if ssh_enabled? - escaped_ssh_url_to_repo = CGI.escape(project.ssh_url_to_repo) %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_ssh_url_to_repo } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Visual Studio Code (SSH)') - if http_enabled? - escaped_http_url_to_repo = CGI.escape(project.http_url_to_repo) %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_http_url_to_repo } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Visual Studio Code (HTTPS)') - if ssh_enabled? %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_ssh_url_to_repo } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('IntelliJ IDEA (SSH)') - if http_enabled? %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_http_url_to_repo } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('IntelliJ IDEA (HTTPS)') - if show_xcode_link?(@project) %a.dropdown-item.open-with-link{ href: xcode_uri_to_repo(@project) } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _("Xcode") diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml index 23dcb7f41e1..1fbc399c3ff 100644 --- a/app/views/projects/buttons/_download.html.haml +++ b/app/views/projects/buttons/_download.html.haml @@ -4,7 +4,7 @@ - if !project.empty_repo? && can?(current_user, :download_code, project) - archive_prefix = "#{project.path}-#{ref.tr('/', '-')}" - .project-action-button.dropdown.gl-new-dropdown.inline> + .project-action-button.dropdown.gl-dropdown.inline> %button.gl-button.btn.btn-default.dropdown-toggle.gl-dropdown-toggle.dropdown-icon-only.has-tooltip{ title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download'), 'data-display' => 'static', data: { qa_selector: 'download_source_code_button' } } = sprite_icon('download', css_class: 'gl-icon dropdown-icon') %span.sr-only= _('Select Archive Format') diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml index 3621853430d..97186149a9d 100644 --- a/app/views/projects/buttons/_fork.html.haml +++ b/app/views/projects/buttons/_fork.html.haml @@ -2,17 +2,17 @@ - if current_user .count-badge.btn-group - 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 + = 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 has-tooltip fork-btn' do = sprite_icon('fork', css_class: 'icon') %span= s_('ProjectOverview|Fork') - else - disabled_tooltip = fork_button_disabled_tooltip(@project) - - count_class = 'disabled' unless can?(current_user, :download_code, @project) + - count_class = 'disabled' unless can?(current_user, :read_code, @project) - button_class = 'disabled' if disabled_tooltip %span.btn-group{ class: ('has-tooltip' if disabled_tooltip), title: disabled_tooltip } - = link_to new_project_fork_path(@project), class: "gl-button btn btn-default btn-sm fork-btn #{button_class}" do + = link_to new_project_fork_path(@project), class: "gl-button btn btn-default fork-btn #{button_class}" do = sprite_icon('fork', css_class: 'icon') %span= s_('ProjectOverview|Fork') - = link_to project_forks_path(@project), title: n_(s_('ProjectOverview|Forks'), s_('ProjectOverview|Forks'), @project.forks_count), class: "gl-button btn btn-default btn-sm count has-tooltip fork-count #{count_class}" do + = link_to project_forks_path(@project), title: n_(s_('ProjectOverview|Forks'), s_('ProjectOverview|Forks'), @project.forks_count), class: "gl-button btn btn-default count has-tooltip fork-count #{count_class}" do = @project.forks_count diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index eaf906ad89f..d4dcfbdff54 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -3,15 +3,15 @@ - icon = starred ? 'star' : 'star-o' - button_text = starred ? s_('ProjectOverview|Unstar') : s_('ProjectOverview|Star') - button_text_classes = starred ? 'starred' : '' - .count-badge.d-inline-flex.align-item-stretch.gl-mr-3.btn-group - = render Pajamas::ButtonComponent.new(size: :small, icon: icon, button_text_classes: button_text_classes, button_options: { class: 'star-btn toggle-star', data: { endpoint: toggle_star_project_path(@project, :json) } }) do + .count-badge.d-inline-flex.align-item-stretch.btn-group + = render Pajamas::ButtonComponent.new(size: :medium, icon: icon, button_text_classes: button_text_classes, button_options: { class: 'star-btn toggle-star', data: { endpoint: toggle_star_project_path(@project, :json) } }) do - button_text - = link_to project_starrers_path(@project), title: n_(s_('ProjectOverview|Starrer'), s_('ProjectOverview|Starrers'), @project.star_count), class: 'gl-button btn btn-default btn-sm has-tooltip star-count count' do + = link_to project_starrers_path(@project), title: n_(s_('ProjectOverview|Starrer'), s_('ProjectOverview|Starrers'), @project.star_count), class: 'gl-button btn btn-default has-tooltip star-count count' do = @project.star_count - else - .count-badge.d-inline-flex.align-item-stretch.gl-mr-3.btn-group - = link_to new_user_session_path, class: 'gl-button btn btn-default btn-sm has-tooltip star-btn', title: s_('ProjectOverview|You must sign in to star a project') do + .count-badge.d-inline-flex.align-item-stretch.btn-group + = link_to new_user_session_path, class: 'gl-button btn btn-default has-tooltip star-btn', title: s_('ProjectOverview|You must sign in to star a project') do = sprite_icon('star-o', css_class: 'icon') %span= s_('ProjectOverview|Star') - = link_to project_starrers_path(@project), title: n_(s_('ProjectOverview|Starrer'), s_('ProjectOverview|Starrers'), @project.star_count), class: 'gl-button btn btn-default btn-sm has-tooltip star-count count' do + = link_to project_starrers_path(@project), title: n_(s_('ProjectOverview|Starrer'), s_('ProjectOverview|Starrers'), @project.star_count), class: 'gl-button btn btn-default has-tooltip star-count count' do = @project.star_count diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 6e202063900..079e24c6389 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -53,9 +53,7 @@ = ci_label_for_status(@last_pipeline.status) - if @last_pipeline.stages_count.nonzero? #{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), @last_pipeline.stages_count) } - .mr-widget-pipeline-graph - .stage-cell - .js-commit-pipeline-mini-graph{ data: { stages: @last_pipeline_stages.to_json.html_safe, full_path: @project.full_path, iid: @last_pipeline.iid, graphql_resource_etag: graphql_etag_pipeline_path(@last_pipeline) } } + .js-commit-pipeline-mini-graph{ data: { stages: @last_pipeline_stages.to_json.html_safe, full_path: @project.full_path, iid: @last_pipeline.iid, graphql_resource_etag: graphql_etag_pipeline_path(@last_pipeline) } } - if @last_pipeline.duration in = time_interval_in_words @last_pipeline.duration diff --git a/app/views/projects/commit/_signature.html.haml b/app/views/projects/commit/_signature.html.haml index 978d83bf2b4..c6f1e51049e 100644 --- a/app/views/projects/commit/_signature.html.haml +++ b/app/views/projects/commit/_signature.html.haml @@ -1,3 +1,3 @@ - if signature - - uri = "projects/commit/#{'x509/' if x509_signature?(signature)}" + - uri = "projects/commit/#{'x509/' if signature.x509?}" = render partial: "#{uri}#{signature.verification_status}_signature_badge", locals: { signature: signature } diff --git a/app/views/projects/commit/_signature_badge.html.haml b/app/views/projects/commit/_signature_badge.html.haml index fb30bfc2953..ad6b524c01b 100644 --- a/app/views/projects/commit/_signature_badge.html.haml +++ b/app/views/projects/commit/_signature_badge.html.haml @@ -17,18 +17,23 @@ - content = capture do - if show_user .clearfix - - uri_signature_badge_user = "projects/commit/#{'x509/' if x509_signature?(signature)}signature_badge_user" + - uri_signature_badge_user = "projects/commit/#{'x509/' if signature.x509?}signature_badge_user" = render partial: "#{uri_signature_badge_user}", locals: { signature: signature } - - if x509_signature?(signature) + - if signature.x509? = render partial: "projects/commit/x509/certificate_details", locals: { signature: signature } - = link_to(_('Learn more about X.509 signed commits'), help_page_path('user/project/repository/x509_signed_commits/index.md'), class: 'gpg-popover-help-link') + = link_to(_('Learn more about X.509 signed commits'), help_page_path('user/project/repository/x509_signed_commits/index.md'), class: 'gl-link gl-display-block') + - elsif ::Feature.enabled?(:ssh_commit_signatures, signature.project) && signature.ssh? + = _('SSH key fingerprint:') + %span.gl-font-monospace= signature.key&.fingerprint_sha256 || _('Unknown') + + = link_to(_('Learn about signing commits with SSH keys.'), help_page_path('user/project/repository/ssh_signed_commits/index.md'), class: 'gl-link gl-display-block') - else = _('GPG Key ID:') - %span.monospace= signature.gpg_key_primary_keyid + %span.gl-font-monospace= signature.gpg_key_primary_keyid - = link_to(_('Learn more about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gpg-popover-help-link gl-display-block') + = link_to(_('Learn more about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gl-link gl-display-block') %a{ role: 'button', tabindex: 0, class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } } = label diff --git a/app/views/projects/commit/_signature_badge_user.html.haml b/app/views/projects/commit/_signature_badge_user.html.haml index b20198e76db..656adef6a72 100644 --- a/app/views/projects/commit/_signature_badge_user.html.haml +++ b/app/views/projects/commit/_signature_badge_user.html.haml @@ -1,7 +1,4 @@ -- gpg_key = signature.gpg_key -- user = gpg_key&.user -- user_name = signature.gpg_key_user_name -- user_email = signature.gpg_key_user_email +- user = signature.signed_by_user - if user = link_to user_path(user), class: 'gpg-popover-user-link' do @@ -11,11 +8,14 @@ %div %strong= user.name %div= user.to_reference -- else - = mail_to user_email do - %div - = user_avatar_without_link(user_name: user_name, user_email: user_email, size: 32) +- elsif signature.gpg? # SSH signatures do not have an email embedded in them + - user_name = signature.gpg_key_user_name + - user_email = signature.gpg_key_user_email + - if user_name && user_email + = mail_to user_email do + %div + = user_avatar_without_link(user_name: user_name, user_email: user_email, size: 32) - %div - %strong= user_name - %div= user_email + %div + %strong= user_name + %div= user_email diff --git a/app/views/projects/commit/x509/_signature_badge_user.html.haml b/app/views/projects/commit/x509/_signature_badge_user.html.haml index f3d39b21ec2..da749172369 100644 --- a/app/views/projects/commit/x509/_signature_badge_user.html.haml +++ b/app/views/projects/commit/x509/_signature_badge_user.html.haml @@ -1,5 +1,5 @@ - user_email = signature.x509_certificate.email -- user = signature.user +- user = signature.signed_by_user - if user = link_to user_path(user), class: 'gpg-popover-user-link' do diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index b5ecc9b0193..b79f17ae7b3 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -15,7 +15,7 @@ %li.commits-row{ data: { day: day } } %ul.content-list.commit-list.flex-list - if Feature.enabled?(:cached_commits, project) - = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } + = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: ->(commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } - else = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request } @@ -29,7 +29,7 @@ %li.commits-row %ul.content-list.commit-list.flex-list - if Feature.enabled?(:cached_commits, project) - = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } + = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: ->(commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } - else = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request } diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index ae68a13929e..c129d978e7e 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -1,6 +1,7 @@ - breadcrumb_title _("Commits") - add_page_specific_style 'page_bundles/tree' - page_title _("Commits"), @ref + = content_for :meta_tags do = auto_discovery_link_tag(:atom, project_commits_path(@project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits") @@ -9,7 +10,7 @@ .nav-block .tree-ref-container .tree-ref-holder - = render 'shared/ref_switcher', destination: 'commits' + #js-project-commits-ref-switcher{ data: { "project-id" => @project.id, "ref" => @ref, "commits_path": project_commits_path(@project) } } %ul.breadcrumb.repo-breadcrumb = commits_breadcrumbs @@ -24,7 +25,7 @@ = _("Create merge request") .control - = form_tag(project_commits_path(@project, @id), method: :get, class: 'commits-search-form js-signature-container', data: { 'signatures-path' => namespace_project_signatures_path }) do + = form_tag(project_commits_path(@project, @id, ref_type: @ref_type), method: :get, class: 'commits-search-form js-signature-container', data: { 'signatures-path' => namespace_project_signatures_path(ref_type: @ref_type)}) do = search_field_tag :search, params[:search], { placeholder: _('Search by message'), id: 'commits-search', class: 'form-control gl-form-input input-short gl-mt-3 gl-sm-mt-0 gl-min-w-full', spellcheck: false } .control.d-none.d-md-block = link_to project_commits_path(@project, @id, rss_url_options), title: _("Commits feed"), class: 'btn gl-button btn-default btn-icon' do diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 11984a9d6f6..8ff6d348d95 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -34,7 +34,7 @@ - if load_diff_files_async - url = url_for(safe_params.merge(action: 'diff_files')) .js-diffs-batch{ data: { diff_files_path: url } } - = gl_loading_icon( size: "md", css_class: "gl-mt-4" ) + = gl_loading_icon(size: "md", css_class: "gl-mt-4") - else = render partial: 'projects/diffs/file', collection: diff_files, as: :diff_file, locals: { project: diffs.project, environment: environment, diff_page_context: diff_page_context } diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 6d60ef92d86..53b2af88511 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -8,28 +8,31 @@ #environments-detail-view{ data: { details: environments_detail_data_json(current_user, @project, @environment) } } #environments-detail-view-header - .environments-container - - if @deployments.blank? - .empty-state - .text-content - %h4.state-title - = _("You don't have any deployments right now.") - %p - = html_escape(_("Define environments in the deploy stage(s) in %{code_open}.gitlab-ci.yml%{code_close} to track deployments here.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } - .text-center - = link_to _("Read more"), help_page_path("ci/environments/index.md"), class: "gl-button btn btn-confirm" - - else - .table-holder.gl-overflow-visible - .ci-table.environments{ role: 'grid' } - .gl-responsive-table-row.table-row-header{ role: 'row' } - .table-section.section-15{ role: 'columnheader' }= _('Status') - .table-section.section-10{ role: 'columnheader' }= _('ID') - .table-section.section-10{ role: 'columnheader' }= _('Triggerer') - .table-section.section-25{ role: 'columnheader' }= _('Commit') - .table-section.section-10{ role: 'columnheader' }= _('Job') - .table-section.section-10{ role: 'columnheader' }= _('Created') - .table-section.section-10{ role: 'columnheader' }= _('Deployed') + - if Feature.enabled?(:environment_details_vue, @project) + #environment_details_page + - else + .environments-container + - if @deployments.blank? + .empty-state + .text-content + %h4.state-title + = _("You don't have any deployments right now.") + %p + = html_escape(_("Define environments in the deploy stage(s) in %{code_open}.gitlab-ci.yml%{code_close} to track deployments here.")) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe } + .text-center + = link_to _("Read more"), help_page_path("ci/environments/index.md"), class: "gl-button btn btn-confirm" + - else + .table-holder.gl-overflow-visible + .ci-table.environments{ role: 'grid' } + .gl-responsive-table-row.table-row-header{ role: 'row' } + .table-section.section-15{ role: 'columnheader' }= _('Status') + .table-section.section-10{ role: 'columnheader' }= _('ID') + .table-section.section-10{ role: 'columnheader' }= _('Triggerer') + .table-section.section-25{ role: 'columnheader' }= _('Commit') + .table-section.section-10{ role: 'columnheader' }= _('Job') + .table-section.section-10{ role: 'columnheader' }= _('Created') + .table-section.section-10{ role: 'columnheader' }= _('Deployed') - = render @deployments + = render @deployments - = paginate @deployments, theme: 'gitlab' + = paginate @deployments, theme: 'gitlab' diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml index c7639eec75d..a27f076d5dd 100644 --- a/app/views/projects/graphs/show.html.haml +++ b/app/views/projects/graphs/show.html.haml @@ -1,8 +1,14 @@ - page_title _('Contributors') +- if Feature.enabled?(:use_ref_type_parameter, @project) + - graph_path = project_graph_path(@project, current_ref, ref_type: @ref_type, format: :json) + - commits_path = project_commits_path(@project, current_ref, ref_type: @ref_type) +- else + - graph_path = project_graph_path(@project, current_ref, format: :json) + - commits_path = project_commits_path(@project, current_ref) .sub-header-block.gl-bg-gray-10.gl-p-5 .tree-ref-holder.gl-display-inline-block.gl-vertical-align-middle.gl-mr-3> = render 'shared/ref_switcher', destination: 'graphs' - = link_to s_('Commits|History'), project_commits_path(@project, current_ref), class: 'btn gl-button btn-default' + = link_to s_('Commits|History'), commits_path, class: 'btn gl-button btn-default' -.js-contributors-graph{ class: container_class, data: { project_graph_path: project_graph_path(@project, current_ref, format: :json), project_branch: current_ref, default_branch: @project.default_branch } } +.js-contributors-graph{ class: container_class, data: { project_graph_path: graph_path, project_branch: current_ref, default_branch: @project.default_branch } } diff --git a/app/views/projects/issuable/_show.html.haml b/app/views/projects/issuable/_show.html.haml index 0898e0ae52d..ec233bc9aff 100644 --- a/app/views/projects/issuable/_show.html.haml +++ b/app/views/projects/issuable/_show.html.haml @@ -3,6 +3,7 @@ - page_card_attributes issuable.card_attributes - if issuable.relocation_target - page_canonical_link issuable.relocation_target.present(current_user: current_user).web_url +- add_page_specific_style 'page_bundles/issuable' = render "projects/issues/service_desk/alert_moved_from_service_desk", issue: issuable diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index b730eb5072e..f8f57934303 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -1,13 +1,14 @@ - page_title _('Issues') +- add_page_specific_style 'page_bundles/issuable_list' - add_page_specific_style 'page_bundles/issues_list' = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@project.name} issues") -.js-jira-issues-import-status{ data: { can_edit: can?(current_user, :admin_project, @project).to_s, +.js-jira-issues-import-status-root{ data: { can_edit: can?(current_user, :admin_project, @project).to_s, is_jira_configured: @project.jira_integration.present?.to_s, issues_path: project_issues_path(@project), project_path: @project.full_path } } -.js-issues-list{ data: project_issues_list_data(@project, current_user) } +.js-issues-list-root{ data: project_issues_list_data(@project, current_user) } - if can?(current_user, :admin_issue, @project) = render 'shared/issuable/bulk_update_sidebar', type: :issues diff --git a/app/views/projects/issues/service_desk.html.haml b/app/views/projects/issues/service_desk.html.haml index 93cb5ddd7e2..3cc419716e5 100644 --- a/app/views/projects/issues/service_desk.html.haml +++ b/app/views/projects/issues/service_desk.html.haml @@ -1,7 +1,7 @@ - @can_bulk_update = false - page_title _("Service Desk") -- add_page_specific_style 'page_bundles/issues_list' +- add_page_specific_style 'page_bundles/issuable_list' - content_for :breadcrumbs_extra do = render "projects/issues/service_desk/nav_btns", show_export_button: false, show_rss_button: false diff --git a/app/views/projects/jobs/_table.html.haml b/app/views/projects/jobs/_table.html.haml index cd59eae1fb7..954c77a21f3 100644 --- a/app/views/projects/jobs/_table.html.haml +++ b/app/views/projects/jobs/_table.html.haml @@ -20,16 +20,16 @@ %table.table.ci-table.builds-page %thead %tr - %th Status - %th Name - %th Job - %th Pipeline + %th= _('Status') + %th= _('Name') + %th= _('Job') + %th= _('Pipeline') - if admin - %th Project - %th Runner - %th Stage - %th Duration - %th Coverage + %th= _('Project') + %th= _('Runner') + %th= _('Stage') + %th= _('Duration') + %th= _('Coverage') %th = render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: { commit_sha: true, ref: true, pipeline_link: true, stage: true, allow_retry: true, admin: admin } diff --git a/app/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml b/app/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml index 78fce3f7087..fb950611f81 100644 --- a/app/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml +++ b/app/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml @@ -1,53 +1,53 @@ - display_issuable_type = issuable_display_type(@merge_request) -.btn-group.gl-md-ml-3.gl-display-flex.dropdown.gl-new-dropdown.gl-md-w-auto.gl-w-full +.btn-group.gl-md-ml-3.gl-display-flex.dropdown.gl-dropdown.gl-md-w-auto.gl-w-full = button_tag type: 'button', class: "btn dropdown-toggle btn-default btn-md gl-button gl-dropdown-toggle btn-default-tertiary dropdown-icon-only dropdown-toggle-no-caret has-tooltip gl-display-none! gl-md-display-inline-flex!", data: { toggle: 'dropdown', title: _('Merge request actions'), testid: 'merge-request-actions', 'aria-label': _('Merge request actions') } do = sprite_icon "ellipsis_v", size: 16, css_class: "dropdown-icon gl-icon" = button_tag type: 'button', class: "btn dropdown-toggle btn-default btn-md btn-block gl-button gl-dropdown-toggle gl-md-display-none!", data: { 'toggle' => 'dropdown' } do - %span.gl-new-dropdown-button-text= _('Merge request actions') + %span.gl-dropdown-button-text= _('Merge request actions') = sprite_icon "chevron-down", size: 16, css_class: "dropdown-icon gl-icon" .dropdown-menu.dropdown-menu-right - .gl-new-dropdown-inner - .gl-new-dropdown-contents + .gl-dropdown-inner + .gl-dropdown-contents %ul - if current_user && moved_mr_sidebar_enabled? - %li.gl-new-dropdown-item.js-sidebar-subscriptions-widget-root - %li.gl-new-dropdown-divider + %li.gl-dropdown-item.js-sidebar-subscriptions-widget-root + %li.gl-dropdown-divider %hr.dropdown-divider - if can?(current_user, :update_merge_request, @merge_request) - %li.gl-new-dropdown-item{ class: "gl-md-display-none!" } + %li.gl-dropdown-item{ class: "gl-md-display-none!" } = link_to edit_project_merge_request_path(@project, @merge_request), class: 'dropdown-item' do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Edit') - if @merge_request.open? - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to toggle_draft_merge_request_path(@merge_request), method: :put, class: 'dropdown-item js-draft-toggle-button' do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = @merge_request.draft? ? _('Mark as ready') : _('Mark as draft') - %li.gl-new-dropdown-item.js-close-item + %li.gl-dropdown-item.js-close-item = link_to close_issuable_path(@merge_request), method: :put, class: 'dropdown-item' do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Close') = display_issuable_type - elsif !@merge_request.source_project_missing? && @merge_request.closed? - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to reopen_issuable_path(@merge_request), method: :put, class: 'dropdown-item' do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Reopen') = display_issuable_type - if moved_mr_sidebar_enabled? - %li.gl-new-dropdown-item.js-sidebar-lock-root - %li.gl-new-dropdown-item + %li.gl-dropdown-item.js-sidebar-lock-root + %li.gl-dropdown-item %button.dropdown-item.js-copy-reference{ type: "button", data: { 'clipboard-text': @merge_request.to_reference(full: true) } } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Copy reference') - unless current_controller?('conflicts') - unless issuable_author_is_current_user(@merge_request) - if moved_mr_sidebar_enabled? - %li.gl-new-dropdown-divider + %li.gl-dropdown-divider %hr.dropdown-divider - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)), class: 'dropdown-item' do - .gl-new-dropdown-item-text-wrapper - = _('Report abuse') + .gl-dropdown-item-text-wrapper + = _('Report abuse to administrator') diff --git a/app/views/projects/merge_requests/_code_dropdown.html.haml b/app/views/projects/merge_requests/_code_dropdown.html.haml index 5c7fe56095c..2ef89a7bf04 100644 --- a/app/views/projects/merge_requests/_code_dropdown.html.haml +++ b/app/views/projects/merge_requests/_code_dropdown.html.haml @@ -1,39 +1,39 @@ -.gl-md-ml-3.dropdown.gl-new-dropdown{ class: "gl-display-none! gl-md-display-flex!" } +.gl-md-ml-3.dropdown.gl-dropdown{ class: "gl-display-none! gl-md-display-flex!" } #js-check-out-modal{ data: how_merge_modal_data(@merge_request) } = button_tag type: 'button', class: "btn dropdown-toggle btn-confirm gl-button gl-dropdown-toggle", data: { toggle: 'dropdown', qa_selector: 'mr_code_dropdown' } do - %span.gl-new-dropdown-button-text= _('Code') + %span.gl-dropdown-button-text= _('Code') = sprite_icon "chevron-down", size: 16, css_class: "dropdown-icon gl-icon gl-ml-2 gl-mr-0!" .dropdown-menu.dropdown-menu-right - .gl-new-dropdown-inner - .gl-new-dropdown-contents + .gl-dropdown-inner + .gl-dropdown-contents %ul - %li.gl-new-dropdown-section-header + %li.gl-dropdown-section-header %header.dropdown-header = _('Review changes') - %li.gl-new-dropdown-item + %li.gl-dropdown-item %button.dropdown-item.js-check-out-modal-trigger{ type: 'button' } - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Check out branch') - if current_user - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to ide_merge_request_path(@merge_request), class: 'dropdown-item', target: '_blank', data: { qa_selector: 'open_in_web_ide_button' } do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Open in Web IDE') - if Gitlab::CurrentSettings.gitpod_enabled && current_user&.gitpod_enabled - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to "#{Gitlab::CurrentSettings.gitpod_url}##{merge_request_url(@merge_request)}", target: '_blank', class: 'dropdown-item' do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Open in Gitpod') - %li.gl-new-dropdown-divider + %li.gl-dropdown-divider %hr.dropdown-divider - %li.gl-new-dropdown-section-header + %li.gl-dropdown-section-header %header.dropdown-header = _('Download') - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to merge_request_path(@merge_request, format: :patch), class: 'dropdown-item', download: '', data: { qa_selector: 'download_email_patches_menu_item' } do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Email patches') - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to merge_request_path(@merge_request, format: :diff), class: 'dropdown-item', download: '', data: { qa_selector: 'download_plain_diff_menu_item' } do - .gl-new-dropdown-item-text-wrapper + .gl-dropdown-item-text-wrapper = _('Plain diff') diff --git a/app/views/projects/merge_requests/_page.html.haml b/app/views/projects/merge_requests/_page.html.haml new file mode 100644 index 00000000000..9d79352659c --- /dev/null +++ b/app/views/projects/merge_requests/_page.html.haml @@ -0,0 +1,114 @@ +- @gfm_form = true +- unless moved_mr_sidebar_enabled? + - @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}" +- add_to_breadcrumbs _("Merge requests"), project_merge_requests_path(@project) +- breadcrumb_title @merge_request.to_reference +- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge requests") +- page_description @merge_request.description_html +- page_card_attributes @merge_request.card_attributes +- suggest_changes_help_path = help_page_path('user/project/merge_requests/reviews/suggestions.md') +- mr_action = j(params[:tab].presence || 'show') +- add_page_specific_style 'page_bundles/issuable' +- add_page_specific_style 'page_bundles/design_management' +- add_page_specific_style 'page_bundles/merge_requests' +- add_page_specific_style 'page_bundles/pipelines' +- add_page_specific_style 'page_bundles/reports' +- add_page_specific_style 'page_bundles/ci_status' + +- add_page_startup_api_call @endpoint_metadata_url +- if mr_action == 'diffs' + - add_page_startup_api_call @endpoint_diff_batch_url + +.merge-request{ data: { mr_action: mr_action, url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } } + - if moved_mr_sidebar_enabled? + #js-merge-sticky-header{ data: { data: sticky_header_data.to_json } } + = render "projects/merge_requests/mr_title" + + .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } } + = render "projects/merge_requests/mr_box" + .merge-request-tabs-holder{ class: "#{'js-tabs-affix' unless ENV['RAILS_ENV'] == 'test'} #{'gl-static' if moved_mr_sidebar_enabled?}" } + .merge-request-tabs-container.gl-display-flex.gl-justify-content-space-between{ class: "#{'is-merge-request' if Feature.enabled?(:moved_mr_sidebar, @project) && !fluid_layout}" } + %ul.merge-request-tabs.nav-tabs.nav.nav-links.gl-display-flex.gl-flex-nowrap.gl-m-0.gl-p-0{ class: "#{'gl-w-full gl-lg-w-auto!' if Feature.enabled?(:moved_mr_sidebar, @project)}" } + = render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do + = tab_link_for @merge_request, :show, force_link: @commit.present? do + = _("Overview") + = gl_badge_tag @merge_request.related_notes.user.count, { size: :sm }, { class: 'js-discussions-count' } + - if @merge_request.source_project + = render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab", qa_selector: "commits_tab" do + = tab_link_for @merge_request, :commits do + = _("Commits") + = gl_badge_tag @commits_count, { size: :sm } + - if @project.builds_enabled? + = render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do + = tab_link_for @merge_request, :pipelines do + = _("Pipelines") + = gl_badge_tag @number_of_pipelines, { size: :sm }, { class: 'js-pipelines-mr-count' } + = render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab js-diffs-tab", id: "diffs-tab", qa_selector: "diffs_tab" do + = tab_link_for @merge_request, :diffs do + = _("Changes") + = gl_badge_tag @diffs_count, { size: :sm } + .d-flex.flex-wrap.align-items-center.justify-content-lg-end + #js-vue-discussion-counter{ data: { blocks_merge: @project.only_allow_merge_if_all_discussions_are_resolved?.to_s } } + - if moved_mr_sidebar_enabled? + - if !!@issuable_sidebar.dig(:current_user, :id) + .js-sidebar-todo-widget-root{ data: { project_path: @issuable_sidebar[:project_full_path], iid: @issuable_sidebar[:iid], id: @issuable_sidebar[:id] } } + .gl-ml-auto.gl-align-items-center.gl-display-none.gl-md-display-flex.gl-ml-3.js-expand-sidebar.gl-absolute.gl-right-5{ class: "gl-lg-display-none!" } + = render Pajamas::ButtonComponent.new(icon: 'chevron-double-lg-left', + button_options: { class: 'js-sidebar-toggle' }) do + = _('Expand') + .tab-content#diff-notes-app + #js-diff-file-finder + #js-code-navigation + = render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do + %div{ class: "#{'merge-request-overview' if moved_mr_sidebar_enabled?}" } + %section + .issuable-discussion.js-vue-notes-event + - if @merge_request.description.present? + .detail-page-description.gl-pb-0 + = render "projects/merge_requests/description" + = render "projects/merge_requests/awards_block" + = render "projects/merge_requests/widget" + - if mr_action === "show" + - add_page_startup_api_call Feature.enabled?(:paginated_mr_discussions, @project) ? discussions_path(@merge_request, per_page: 20) : discussions_path(@merge_request) + - add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json) + - add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json) + #js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request).to_json, + endpoint_metadata: @endpoint_metadata_url, + noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'), + noteable_type: 'MergeRequest', + notes_filters: UserPreference.notes_filters.to_json, + notes_filter_value: current_user&.notes_filter_for(@merge_request), + target_type: 'merge_request', + help_page_path: suggest_changes_help_path, + current_user_data: @current_user_data, + is_locked: @merge_request.discussion_locked.to_s } } + - if moved_mr_sidebar_enabled? + = render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch + + = render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do + -# This tab is always loaded via AJAX + = render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do + - if @project.builds_enabled? + = render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request) + - params = request.query_parameters.merge(diff_head: true) + = render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: diffs_tab_pane_data(@project, @merge_request, params) + + .mr-loading-status + .loading.hide + = gl_loading_icon(size: 'lg') + +- unless moved_mr_sidebar_enabled? + = render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch + +- if @merge_request.can_be_reverted?(current_user) + = render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit +- if @merge_request.can_be_cherry_picked? + = render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit + +#js-review-bar + +- if current_user && Feature.enabled?(:mr_experience_survey, current_user) + #js-mr-experience-survey{ data: { account_age: current_user.account_age_in_days } } + += render 'projects/invite_members_modal', project: @project += render 'shared/web_ide_path' diff --git a/app/views/projects/merge_requests/creations/_new_compare.html.haml b/app/views/projects/merge_requests/creations/_new_compare.html.haml index 17b1e5a757c..48334023cf0 100644 --- a/app/views/projects/merge_requests/creations/_new_compare.html.haml +++ b/app/views/projects/merge_requests/creations/_new_compare.html.haml @@ -1,7 +1,7 @@ %h1.page-title.gl-font-size-h-display = _('New merge request') -= form_for [@project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form js-requires-input" } do |f| += gitlab_ui_form_for [@project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form js-requires-input" } do |f| - if params[:nav_source].present? = hidden_field_tag(:nav_source, params[:nav_source]) .js-merge-request-new-compare.row{ 'data-source-branch-url': project_new_merge_request_branch_from_path(@source_project), 'data-target-branch-url': project_new_merge_request_branch_to_path(@source_project) } @@ -40,17 +40,20 @@ %h2.gl-font-size-h2 = _('Target branch') .clearfix - - projects = target_projects(@project) .merge-request-select.dropdown - = f.hidden_field :target_project_id - = dropdown_toggle f.object.target_project.full_path, { toggle: "dropdown", 'field-name': "#{f.object_name}[target_project_id]", disabled: @merge_request.persisted?, default_text: _("Select target project") }, { toggle_class: "js-compare-dropdown js-target-project" } - .dropdown-menu.dropdown-menu-selectable.dropdown-target-project - = dropdown_title(_("Select target project")) - = dropdown_filter(_("Search projects")) - = dropdown_content do - = render 'projects/merge_requests/dropdowns/project', - projects: projects, - selected: f.object.target_project_id + - if Feature.enabled?(:mr_compare_dropdowns, @project) + #js-target-project-dropdown{ data: { target_projects_path: project_new_merge_request_json_target_projects_path(@project), current_project: { value: f.object.target_project_id.to_s, text: f.object.target_project.full_path }.to_json } } + - else + - projects = target_projects(@project) + = f.hidden_field :target_project_id + = dropdown_toggle f.object.target_project.full_path, { toggle: "dropdown", 'field-name': "#{f.object_name}[target_project_id]", disabled: @merge_request.persisted?, default_text: _("Select target project") }, { toggle_class: "js-compare-dropdown js-target-project" } + .dropdown-menu.dropdown-menu-selectable.dropdown-target-project + = dropdown_title(_("Select target project")) + = dropdown_filter(_("Search projects")) + = dropdown_content do + = render 'projects/merge_requests/dropdowns/project', + projects: projects, + selected: f.object.target_project_id .merge-request-select.dropdown = f.hidden_field :target_branch = dropdown_toggle f.object.target_branch.presence || _("Select target branch"), { toggle: "dropdown", 'field-name': "#{f.object_name}[target_branch]", 'refs-url': refs_project_path(f.object.target_project), selected: f.object.target_branch, default_text: _("Select target branch") }, { toggle_class: "js-compare-dropdown js-target-branch monospace" } @@ -68,4 +71,4 @@ - if @merge_request.errors.any? = form_errors(@merge_request) - = f.submit _('Compare branches and continue'), class: "gl-button btn btn-confirm mr-compare-btn gl-mt-4", data: { qa_selector: "compare_branches_button" } + = f.submit _('Compare branches and continue'), data: { qa_selector: 'compare_branches_button' }, pajamas_button: true diff --git a/app/views/projects/merge_requests/diffs.html.haml b/app/views/projects/merge_requests/diffs.html.haml new file mode 100644 index 00000000000..1ef212ee5ce --- /dev/null +++ b/app/views/projects/merge_requests/diffs.html.haml @@ -0,0 +1 @@ += render 'page' diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index a3f40207d20..79da09c5205 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -5,6 +5,7 @@ - page_title _("Merge requests") - new_merge_request_email = @project.new_issuable_address(current_user, 'merge_request') +- add_page_specific_style 'page_bundles/issuable_list' = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@project.name} merge requests") diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index 203724fc1f1..1ef212ee5ce 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -1,113 +1 @@ -- @gfm_form = true -- unless moved_mr_sidebar_enabled? - - @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}" -- add_to_breadcrumbs _("Merge requests"), project_merge_requests_path(@project) -- breadcrumb_title @merge_request.to_reference -- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge requests") -- page_description @merge_request.description_html -- page_card_attributes @merge_request.card_attributes -- suggest_changes_help_path = help_page_path('user/project/merge_requests/reviews/suggestions.md') -- mr_action = j(params[:tab].presence || 'show') -- add_page_specific_style 'page_bundles/design_management' -- add_page_specific_style 'page_bundles/merge_requests' -- add_page_specific_style 'page_bundles/pipelines' -- add_page_specific_style 'page_bundles/reports' -- add_page_specific_style 'page_bundles/ci_status' - -- add_page_startup_api_call @endpoint_metadata_url -- if mr_action == 'diffs' - - add_page_startup_api_call @endpoint_diff_batch_url - -.merge-request{ data: { mr_action: mr_action, url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } } - - if moved_mr_sidebar_enabled? - #js-merge-sticky-header{ data: { data: sticky_header_data.to_json } } - = render "projects/merge_requests/mr_title" - - .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } } - = render "projects/merge_requests/mr_box" - .merge-request-tabs-holder{ class: "#{'js-tabs-affix' unless ENV['RAILS_ENV'] == 'test'} #{'gl-static' if moved_mr_sidebar_enabled?}" } - .merge-request-tabs-container.gl-display-flex.gl-justify-content-space-between{ class: "#{'is-merge-request' if Feature.enabled?(:moved_mr_sidebar, @project) && !fluid_layout}" } - %ul.merge-request-tabs.nav-tabs.nav.nav-links.gl-display-flex.gl-flex-nowrap.gl-m-0.gl-p-0{ class: "#{'gl-w-full gl-lg-w-auto!' if Feature.enabled?(:moved_mr_sidebar, @project)}" } - = render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do - = tab_link_for @merge_request, :show, force_link: @commit.present? do - = _("Overview") - = gl_badge_tag @merge_request.related_notes.user.count, { size: :sm } - - if @merge_request.source_project - = render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab", qa_selector: "commits_tab" do - = tab_link_for @merge_request, :commits do - = _("Commits") - = gl_badge_tag @commits_count, { size: :sm } - - if @project.builds_enabled? - = render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do - = tab_link_for @merge_request, :pipelines do - = _("Pipelines") - = gl_badge_tag @number_of_pipelines, { size: :sm }, { class: 'js-pipelines-mr-count' } - = render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab js-diffs-tab", id: "diffs-tab", qa_selector: "diffs_tab" do - = tab_link_for @merge_request, :diffs do - = _("Changes") - = gl_badge_tag @diffs_count, { size: :sm } - .d-flex.flex-wrap.align-items-center.justify-content-lg-end - #js-vue-discussion-counter{ data: { blocks_merge: @project.only_allow_merge_if_all_discussions_are_resolved?.to_s } } - - if moved_mr_sidebar_enabled? - - if !!@issuable_sidebar.dig(:current_user, :id) - .js-sidebar-todo-widget-root{ data: { project_path: @issuable_sidebar[:project_full_path], iid: @issuable_sidebar[:iid], id: @issuable_sidebar[:id] } } - .gl-ml-auto.gl-align-items-center.gl-display-none.gl-md-display-flex.gl-ml-3.js-expand-sidebar{ class: "gl-lg-display-none!" } - = render Pajamas::ButtonComponent.new(icon: 'chevron-double-lg-left', - button_options: { class: 'js-sidebar-toggle' }) do - = _('Expand') - .tab-content#diff-notes-app - #js-diff-file-finder - #js-code-navigation - = render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do - %div{ class: "#{'merge-request-overview' if moved_mr_sidebar_enabled?}" } - %section - .issuable-discussion.js-vue-notes-event - - if @merge_request.description.present? - .detail-page-description.gl-pb-0 - = render "projects/merge_requests/description" - = render "projects/merge_requests/awards_block" - = render "projects/merge_requests/widget" - - if mr_action === "show" - - add_page_startup_api_call Feature.enabled?(:paginated_mr_discussions, @project) ? discussions_path(@merge_request, per_page: 20) : discussions_path(@merge_request) - - add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json) - - add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json) - #js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request).to_json, - endpoint_metadata: @endpoint_metadata_url, - noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'), - noteable_type: 'MergeRequest', - notes_filters: UserPreference.notes_filters.to_json, - notes_filter_value: current_user&.notes_filter_for(@merge_request), - target_type: 'merge_request', - help_page_path: suggest_changes_help_path, - current_user_data: @current_user_data, - is_locked: @merge_request.discussion_locked.to_s } } - - if moved_mr_sidebar_enabled? - = render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch - - = render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do - -# This tab is always loaded via AJAX - = render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do - - if @project.builds_enabled? - = render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request) - - params = request.query_parameters.merge(diff_head: true) - = render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: diffs_tab_pane_data(@project, @merge_request, params) - - .mr-loading-status - .loading.hide - = gl_loading_icon(size: 'lg') - -- unless moved_mr_sidebar_enabled? - = render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch - -- if @merge_request.can_be_reverted?(current_user) - = render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit -- if @merge_request.can_be_cherry_picked? - = render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit - -#js-review-bar - -- if current_user && Feature.enabled?(:mr_experience_survey, current_user) - #js-mr-experience-survey{ data: { account_age: current_user.account_age_in_days } } - -= render 'projects/invite_members_modal', project: @project -= render 'shared/web_ide_path' += render 'page' diff --git a/app/views/projects/ml/candidates/show.html.haml b/app/views/projects/ml/candidates/show.html.haml new file mode 100644 index 00000000000..7fa98f69edf --- /dev/null +++ b/app/views/projects/ml/candidates/show.html.haml @@ -0,0 +1,7 @@ +- experiment = @candidate.experiment +- add_to_breadcrumbs _("Experiments"), project_ml_experiments_path(@project) +- add_to_breadcrumbs experiment.name, project_ml_experiment_path(@project, experiment.iid) +- breadcrumb_title "Candidate #{@candidate.iid}" +- data = candidate_as_data(@candidate) + +#js-show-ml-candidate{ data: { candidate: data } } diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 2a3171e9fd8..70bb97b7625 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,10 +1,11 @@ - breadcrumb_title _("Graph") - page_title _("Graph"), @ref +- network_path = Feature.enabled?(:use_ref_type_parameter) ? project_network_path(@project, @id, ref_type: @ref_type) : project_network_path(@project, @id) = render "head" .gl-mt-5 .project-network.gl-border-1.gl-border-solid.gl-border-gray-300 .controls.gl-bg-gray-50.gl-p-2.gl-font-base.gl-text-gray-400.gl-border-b-1.gl-border-b-solid.gl-border-b-gray-300 - = form_tag project_network_path(@project, @id), method: :get, class: 'form-inline network-form' do |f| + = form_tag network_path, method: :get, class: 'form-inline network-form' do |f| = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: _("Git revision"), class: 'search-input form-control gl-form-input input-mx-250 search-sha gl-mr-2' = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, icon: 'search') .inline.gl-ml-5 diff --git a/app/views/projects/notes/_more_actions_dropdown.html.haml b/app/views/projects/notes/_more_actions_dropdown.html.haml index 5f70e25f802..2351bd209a7 100644 --- a/app/views/projects/notes/_more_actions_dropdown.html.haml +++ b/app/views/projects/notes/_more_actions_dropdown.html.haml @@ -10,7 +10,7 @@ - unless is_current_user %li = link_to new_abuse_report_path(user_id: note.author.id, ref_url: noteable_note_url(note)) do - = _('Report abuse to admin') + = _('Report abuse to administrator') - if note_editable %li = link_to note_url(note), method: :delete, data: { confirm: _('Are you sure you want to delete this comment?'), confirm_btn_variant: 'danger', qa_selector: 'delete_comment_button' }, aria: { label: _('Delete comment') }, remote: true, class: 'js-note-delete' do diff --git a/app/views/projects/pages/_list.html.haml b/app/views/projects/pages/_list.html.haml index 16312da1353..32e67fdadb8 100644 --- a/app/views/projects/pages/_list.html.haml +++ b/app/views/projects/pages/_list.html.haml @@ -12,7 +12,7 @@ - if verification_enabled - tooltip, status = domain.unverified? ? [s_('GitLabPages|Unverified'), 'failed'] : [s_('GitLabPages|Verified'), 'success'] .domain-status.ci-status-icon.has-tooltip{ class: "gl-mr-5 ci-status-icon-#{status}", title: tooltip } - = sprite_icon("status_#{status}" ) + = sprite_icon("status_#{status}") .domain-name = external_link(domain.url, domain.url) - if domain.certificate diff --git a/app/views/projects/pages_domains/new.html.haml b/app/views/projects/pages_domains/new.html.haml index 6de8117df6b..c88255e23f9 100644 --- a/app/views/projects/pages_domains/new.html.haml +++ b/app/views/projects/pages_domains/new.html.haml @@ -4,9 +4,8 @@ = _("New Pages Domain") = render 'projects/pages_domains/helper_text' %div - = form_for [@project, domain_presenter], html: { class: 'fieldset-form' } do |f| + = gitlab_ui_form_for [@project, domain_presenter], html: { class: 'fieldset-form' } do |f| = render 'form', { f: f } - .form-actions - = f.submit _('Create New Domain'), class: "gl-button btn btn-confirm" - .float-right - = link_to _('Cancel'), project_pages_path(@project), class: 'gl-button btn btn-default btn-cancel' + .form-actions.gl-display-flex + = f.submit _('Create New Domain'), class: 'gl-mr-3', pajamas_button: true + = link_to _('Cancel'), project_pages_path(@project), class: 'gl-button btn btn-default btn-cancel' diff --git a/app/views/projects/pages_domains/show.html.haml b/app/views/projects/pages_domains/show.html.haml index 0edf75c9abc..5de5188ae6a 100644 --- a/app/views/projects/pages_domains/show.html.haml +++ b/app/views/projects/pages_domains/show.html.haml @@ -15,8 +15,8 @@ = _('Pages Domain') = render 'projects/pages_domains/helper_text' %div - = form_for [@project, domain_presenter], html: { class: 'fieldset-form' } do |f| + = gitlab_ui_form_for [@project, domain_presenter], html: { class: 'fieldset-form' } do |f| = render 'form', { f: f } - .form-actions.d-flex.justify-content-between - = f.submit _('Save Changes'), class: "gl-button btn btn-confirm" + .form-actions.gl-display-flex + = f.submit _('Save Changes'), class: 'gl-mr-3', pajamas_button: true = link_to _('Cancel'), project_pages_path(@project), class: 'gl-button btn btn-default btn-inverse' diff --git a/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml b/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml index 7b16564dfa2..0de31f59033 100644 --- a/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml +++ b/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml @@ -1,33 +1,38 @@ - if pipeline_schedule %tr.pipeline-schedule-table-row - %td - = pipeline_schedule.description - %td.branch-name-cell.gl-text-truncate - - if pipeline_schedule.for_tag? - = sprite_icon('tag', size: 12, css_class: 'gl-vertical-align-middle!' ) - - else - = sprite_icon('fork', size: 12, css_class: 'gl-vertical-align-middle!') - - if pipeline_schedule.ref.present? - = link_to pipeline_schedule.ref_for_display, project_ref_path(@project, pipeline_schedule.ref_for_display), class: "ref-name" - %td - - if pipeline_schedule.last_pipeline - .status-icon-container{ class: "ci-status-icon-#{pipeline_schedule.last_pipeline.status}" } - = link_to project_pipeline_path(@project, pipeline_schedule.last_pipeline.id) do - = ci_icon_for_status(pipeline_schedule.last_pipeline.status) - %span ##{pipeline_schedule.last_pipeline.id} - - else - = s_("PipelineSchedules|None") - %td.gl-text-gray-500{ 'data-testid': 'next-run-cell' } - - if pipeline_schedule.active? && pipeline_schedule.next_run_at - = time_ago_with_tooltip(pipeline_schedule.real_next_run) - - else - = s_("PipelineSchedules|Inactive") - %td - - if pipeline_schedule.owner - = render Pajamas::AvatarComponent.new(pipeline_schedule.owner, size: 24, class: "gl-mr-2") - = link_to user_path(pipeline_schedule.owner) do - = pipeline_schedule.owner&.name - %td + %td{ role: 'cell', data: { label: _('Description') } } + %div + = pipeline_schedule.description + %td.branch-name-cell.gl-text-truncate{ role: 'cell', data: { label: s_("PipelineSchedules|Target") } } + %div + - if pipeline_schedule.for_tag? + = sprite_icon('tag', size: 12, css_class: 'gl-vertical-align-middle!') + - else + = sprite_icon('fork', size: 12, css_class: 'gl-vertical-align-middle!') + - if pipeline_schedule.ref.present? + = link_to pipeline_schedule.ref_for_display, project_ref_path(@project, pipeline_schedule.ref_for_display), class: "ref-name" + %td{ role: 'cell', data: { label: _("Last Pipeline") } } + %div + - if pipeline_schedule.last_pipeline + .status-icon-container{ class: "ci-status-icon-#{pipeline_schedule.last_pipeline.status}" } + = link_to project_pipeline_path(@project, pipeline_schedule.last_pipeline.id) do + = ci_icon_for_status(pipeline_schedule.last_pipeline.status) + %span.gl-text-blue-500! ##{pipeline_schedule.last_pipeline.id} + - else + = s_("PipelineSchedules|None") + %td.gl-text-gray-500{ role: 'cell', data: { label: s_("PipelineSchedules|Next Run") }, 'data-testid': 'next-run-cell' } + %div + - if pipeline_schedule.active? && pipeline_schedule.next_run_at + = time_ago_with_tooltip(pipeline_schedule.real_next_run) + - else + = s_("PipelineSchedules|Inactive") + %td{ role: 'cell', data: { label: _("Owner") } } + %div + - if pipeline_schedule.owner + = render Pajamas::AvatarComponent.new(pipeline_schedule.owner, size: 24, class: "gl-mr-2") + = link_to user_path(pipeline_schedule.owner) do + = pipeline_schedule.owner&.name + %td{ role: 'cell', data: { label: _('Actions') } } .float-right.btn-group - if can?(current_user, :play_pipeline_schedule, pipeline_schedule) = link_to play_pipeline_schedule_path(pipeline_schedule), method: :post, title: _('Play'), class: 'btn gl-button btn-default btn-icon' do diff --git a/app/views/projects/pipeline_schedules/_table.html.haml b/app/views/projects/pipeline_schedules/_table.html.haml index d0c7ea77263..2f96ac6a534 100644 --- a/app/views/projects/pipeline_schedules/_table.html.haml +++ b/app/views/projects/pipeline_schedules/_table.html.haml @@ -1,12 +1,12 @@ .table-holder - %table.table.ci-table - %thead - %tr - %th= _("Description") - %th= s_("PipelineSchedules|Target") - %th= _("Last Pipeline") - %th= s_("PipelineSchedules|Next Run") - %th= _("Owner") - %th - + %table.table.ci-table.responsive-table.b-table.gl-table.b-table-stacked-md{ role: 'table' } + %thead{ role: 'rowgroup' } + %tr{ role: 'row' } + %th.table-th-transparent.border-bottom{ role: 'cell', style: 'width: 34%' }= _("Description") + %th.table-th-transparent.border-bottom{ role: 'cell' }= s_("PipelineSchedules|Target") + %th.table-th-transparent.border-bottom{ role: 'cell' }= _("Last Pipeline") + %th.table-th-transparent.border-bottom{ role: 'cell' }= s_("PipelineSchedules|Next Run") + %th.table-th-transparent.border-bottom{ role: 'cell' }= _("Owner") + %th.table-th-transparent.border-bottom{ role: 'cell' } + %tbody{ role: 'rowgroup' } = render partial: "pipeline_schedule", collection: @schedules diff --git a/app/views/projects/pipeline_schedules/index.html.haml b/app/views/projects/pipeline_schedules/index.html.haml index 47ad8cc826d..cb7cd631859 100644 --- a/app/views/projects/pipeline_schedules/index.html.haml +++ b/app/views/projects/pipeline_schedules/index.html.haml @@ -21,8 +21,7 @@ %ul.content-list = render partial: "table" - else - = render Pajamas::CardComponent.new(card_options: { class: 'bg-light gl-mt-3 gl-text-center' }) do |c| - - c.body do - = _("No schedules") + .nothing-here-block + = _("No schedules") #pipeline-take-ownership-modal diff --git a/app/views/projects/pipeline_schedules/new.html.haml b/app/views/projects/pipeline_schedules/new.html.haml index d3757d0e339..2d4ed5a9872 100644 --- a/app/views/projects/pipeline_schedules/new.html.haml +++ b/app/views/projects/pipeline_schedules/new.html.haml @@ -9,6 +9,6 @@ = _("Schedule a new pipeline") - if Feature.enabled?(:pipeline_schedules_vue, @project) - #pipeline-schedules-form-new{ data: { full_path: @project.full_path } } + #pipeline-schedules-form-new{ data: { full_path: @project.full_path, cron: @schedule.cron, daily_limit: @schedule.daily_limit, timezone_data: timezone_data.to_json, cron_timezone: @schedule.cron_timezone, project_id: @project.id, default_branch: @project.default_branch, settings_link: project_settings_ci_cd_path(@project), } } - else = render "form" diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml index 30cc7f94311..1a079324a0f 100644 --- a/app/views/projects/pipelines/_info.html.haml +++ b/app/views/projects/pipelines/_info.html.haml @@ -1,6 +1,7 @@ - if Feature.enabled?(:pipeline_name, @pipeline.project) && @pipeline.name - %h3 - = @pipeline.name + .gl-border-t.gl-p-5.gl-px-0 + %h3.gl-m-0.gl-text-body + = @pipeline.name - else .commit-box %h3.commit-title @@ -45,7 +46,7 @@ - popover_content_text = _('Learn more about 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? - = gl_badge_tag s_('Pipelines|merge request'), { variant: :info, size: :sm }, { class: 'js-pipeline-url-mergerequest has-tooltip', title: s_("Pipelines|This pipeline ran on the contents of this merge request's source branch, not the target branch.") } + = gl_badge_tag s_('Pipelines|merge request'), { variant: :info, size: :sm }, { class: 'js-pipeline-url-mergerequest has-tooltip', data: { qa_selector: 'merge_request_badge_tag' }, title: s_("Pipelines|This pipeline ran on the contents of this merge request's source branch, not the target branch.") } - if @pipeline.stuck? = gl_badge_tag s_('Pipelines|stuck'), { variant: :warning, size: :sm }, { class: 'js-pipeline-url-stuck has-tooltip' } diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml deleted file mode 100644 index e83547fd8f8..00000000000 --- a/app/views/projects/pipelines/_with_tabs.html.haml +++ /dev/null @@ -1,48 +0,0 @@ -- return if pipeline_has_errors - -.tabs-holder - %ul.pipelines-tabs.nav-links.no-top.no-bottom.mobile-separator.nav.nav-tabs - %li.js-pipeline-tab-link - = link_to project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-pipeline', action: 'pipelines', toggle: 'tab' }, class: 'pipeline-tab' do - = _('Pipeline') - %li.js-dag-tab-link - = link_to dag_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-dag', action: 'dag', toggle: 'tab' }, class: 'dag-tab' do - = _('Needs') - %li.js-builds-tab-link - = link_to builds_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-builds', action: 'builds', toggle: 'tab' }, class: 'builds-tab' do - = _('Jobs') - = gl_badge_tag @pipeline.total_size, { size: :sm }, { class: 'js-builds-counter' } - - if @pipeline.failed_builds.present? - %li.js-failures-tab-link - = link_to failures_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do - = _('Failed Jobs') - = gl_badge_tag @pipeline.failed_builds.count, { size: :sm }, { class: 'js-failures-counter' } - %li.js-tests-tab-link - = link_to test_report_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-tests', action: 'test_report', toggle: 'tab' }, class: 'test-tab' do - = s_('TestReports|Tests') - = gl_badge_tag @pipeline.test_report_summary.total[:count], { size: :sm }, { class: 'js-test-report-badge-counter' } - = render_if_exists "projects/pipelines/tabs_holder", pipeline: @pipeline, project: @project - -.tab-content - #js-tab-pipeline.tab-pane.gl-w-full - #js-pipeline-graph-vue - - #js-tab-builds.tab-pane - - if stages.present? - #js-pipeline-jobs-vue{ data: { full_path: @project.full_path, pipeline_iid: @pipeline.iid } } - - - if @pipeline.failed_builds.present? - #js-tab-failures.tab-pane - #js-pipeline-failed-jobs-vue{ data: { full_path: @project.full_path, pipeline_iid: @pipeline.iid, failed_jobs_summary_data: prepare_failed_jobs_summary_data(@pipeline.failed_builds) } } - - #js-tab-dag.tab-pane - #js-pipeline-dag-vue{ data: { pipeline_project_path: @project.full_path, pipeline_iid: @pipeline.iid, empty_svg_path: image_path('illustrations/empty-state/empty-dag-md.svg'), about_dag_doc_path: help_page_path('ci/directed_acyclic_graph/index.md'), dag_doc_path: help_page_path('ci/yaml/index.md', anchor: 'needs')} } - - #js-tab-tests.tab-pane - #js-pipeline-tests-detail{ data: { summary_endpoint: summary_project_pipeline_tests_path(@project, @pipeline, format: :json), - suite_endpoint: project_pipeline_test_path(@project, @pipeline, suite_name: 'suite', format: :json), - blob_path: project_blob_path(@project, @pipeline.sha), - has_test_report: @pipeline.complete_and_has_reports?(Ci::JobArtifact.of_report_type(:test)).to_s, - empty_state_image_path: image_path('illustrations/empty-state/empty-test-cases-lg.svg'), - artifacts_expired_image_path: image_path('illustrations/pipeline.svg') } } - = render_if_exists "projects/pipelines/tabs_content", pipeline: @pipeline, project: @project diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index 4531bb2d0a9..9b0a81a2f60 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -9,7 +9,7 @@ - add_page_startup_graphql_call('pipelines/get_pipeline_details', { projectPath: @project.full_path, iid: @pipeline.iid }) .js-pipeline-container{ data: { controller_action: "#{controller.action_name}" } } - #js-pipeline-header-vue.pipeline-header-container{ data: { full_path: @project.full_path, pipeline_iid: @pipeline.iid, pipeline_id: @pipeline.id, pipelines_path: project_pipelines_path(@project) } } + #js-pipeline-header-vue.pipeline-header-container{ data: { full_path: @project.full_path, graphql_resource_etag: graphql_etag_pipeline_path(@pipeline), pipeline_iid: @pipeline.iid, pipeline_id: @pipeline.id, pipelines_path: project_pipelines_path(@project) } } = render_if_exists 'projects/pipelines/cc_validation_required_alert', pipeline: @pipeline @@ -18,16 +18,10 @@ - if pipeline_has_errors .bs-callout.bs-callout-danger - %h4= _('Found errors in your %{gitlab_ci_yml}:') % { gitlab_ci_yml: '.gitlab-ci.yml' } + %h4= _('Unable to create pipeline') %ul - @pipeline.yaml_errors.split("\n").each do |error| %li= error - - lint_link_url = project_ci_pipeline_editor_path(@project, tab: "LINT_TAB") - - lint_link_start = '<a href="%{url}" class="gl-text-blue-500!">'.html_safe % { url: lint_link_url } - = s_('You can also test your %{gitlab_ci_yml} in %{lint_link_start}CI Lint%{lint_link_end}').html_safe % { gitlab_ci_yml: '.gitlab-ci.yml', lint_link_start: lint_link_start, lint_link_end: '</a>'.html_safe } - - if Feature.enabled?(:pipeline_tabs_vue, @project) - #js-pipeline-tabs{ data: js_pipeline_tabs_data(@project, @pipeline, @current_user) } - else - = render "projects/pipelines/with_tabs", pipeline: @pipeline, stages: @stages, pipeline_has_errors: pipeline_has_errors -.js-pipeline-details-vue{ data: { metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: @project.namespace, project_id: @project, format: :json), pipeline_project_path: @project.full_path, pipeline_iid: @pipeline.iid, graphql_resource_etag: graphql_etag_pipeline_path(@pipeline), pipeline_path: pipeline_path(@pipeline) } } + #js-pipeline-tabs{ data: js_pipeline_tabs_data(@project, @pipeline, @current_user) } diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index c7818602f52..4ac0e28d386 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -15,17 +15,17 @@ - invite_group_top_margin = '' - if can_admin_project_member?(@project) .js-import-project-members-trigger{ data: { classes: 'gl-md-w-auto gl-w-full' } } - .js-import-project-members-modal{ data: { project_id: @project.id, project_name: @project.name } } + .js-import-project-members-modal{ data: { project_id: @project.id, project_name: @project.name, reload_page_on_submit: true.to_s } } - invite_group_top_margin = 'gl-md-mt-0 gl-mt-3' - if @project.allowed_to_share_with_group? .js-invite-group-trigger{ data: { classes: "gl-md-w-auto gl-w-full gl-md-ml-3 #{invite_group_top_margin}", display_text: _('Invite a group') } } - = render 'projects/invite_groups_modal', project: @project + = render 'projects/invite_groups_modal', project: @project, reload_page_on_submit: true - if can_admin_project_member?(@project) .js-invite-members-trigger{ data: { variant: 'confirm', classes: 'gl-md-w-auto gl-w-full gl-md-ml-3 gl-md-mt-0 gl-mt-3', trigger_source: 'project-members-page', display_text: _('Invite members') } } - = render 'projects/invite_members_modal', project: @project + = render 'projects/invite_members_modal', project: @project, reload_page_on_submit: true - else - if project_can_be_shared? %h4 diff --git a/app/views/projects/protected_branches/_branches_list.html.haml b/app/views/projects/protected_branches/_branches_list.html.haml deleted file mode 100644 index 24d2b971472..00000000000 --- a/app/views/projects/protected_branches/_branches_list.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -- can_admin_project = can?(current_user, :admin_project, @project) - -= render layout: 'projects/protected_branches/shared/branches_list', locals: { can_admin_project: can_admin_project } do - = render partial: 'projects/protected_branches/protected_branch', collection: @protected_branches diff --git a/app/views/projects/protected_branches/_index.html.haml b/app/views/projects/protected_branches/_index.html.haml deleted file mode 100644 index 2b0a502fe4d..00000000000 --- a/app/views/projects/protected_branches/_index.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- content_for :create_protected_branch do - = render 'projects/protected_branches/create_protected_branch' - -- content_for :branches_list do - = render "projects/protected_branches/branches_list" - -= render 'projects/protected_branches/shared/index' diff --git a/app/views/projects/protected_branches/_protected_branch.html.haml b/app/views/projects/protected_branches/_protected_branch.html.haml deleted file mode 100644 index 366d7a7a2eb..00000000000 --- a/app/views/projects/protected_branches/_protected_branch.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -= render layout: 'projects/protected_branches/shared/protected_branch', locals: { protected_branch: protected_branch } do - = render_if_exists 'projects/protected_branches/update_protected_branch', protected_branch: protected_branch diff --git a/app/views/projects/protected_branches/_update_protected_branch.html.haml b/app/views/projects/protected_branches/_update_protected_branch.html.haml deleted file mode 100644 index b2ec98be056..00000000000 --- a/app/views/projects/protected_branches/_update_protected_branch.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render 'shared/projects/protected_branches/update_protected_branch', protected_branch: protected_branch diff --git a/app/views/projects/protected_tags/shared/_create_protected_tag.html.haml b/app/views/projects/protected_tags/shared/_create_protected_tag.html.haml index 9ea7f397c0a..1db1da5e428 100644 --- a/app/views/projects/protected_tags/shared/_create_protected_tag.html.haml +++ b/app/views/projects/protected_tags/shared/_create_protected_tag.html.haml @@ -1,4 +1,4 @@ -= form_for [@project, @protected_tag], html: { class: 'new-protected-tag js-new-protected-tag' } do |f| += gitlab_ui_form_for [@project, @protected_tag], html: { class: 'new-protected-tag js-new-protected-tag' } do |f| %input{ type: 'hidden', name: 'update_section', value: 'js-protected-tags-settings' } = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }) do |c| - c.header do @@ -20,4 +20,4 @@ = yield :create_access_levels - c.footer do - = f.submit _('Protect'), class: 'gl-button btn btn-confirm', disabled: true, data: { qa_selector: 'protect_tag_button' } + = f.submit _('Protect'), pajamas_button: true, disabled: true, data: { qa_selector: 'protect_tag_button' } diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index 51f0b6319a1..910aab6da72 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -1,6 +1,6 @@ - page_title _("Container Registry") - @content_class = "limit-container-width" unless fluid_layout -- add_page_startup_graphql_call('container_registry/get_container_repositories', { fullPath: @project.full_path, first: 10, name: nil, isGroupPage: false, sort: nil} ) +- add_page_startup_graphql_call('container_registry/get_container_repositories', { fullPath: @project.full_path, first: 10, name: nil, isGroupPage: false, sort: nil}) %section #js-container-registry{ data: { endpoint: project_container_registry_index_path(@project), @@ -15,7 +15,6 @@ "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'), - "container_registry_importing_help_page_path" => help_page_path('user/packages/container_registry/index', anchor: 'tags-temporarily-cannot-be-marked-for-deletion'), "project_path": @project.full_path, "gid_prefix": container_repository_gid_prefix, "is_admin": current_user&.admin.to_s, diff --git a/app/views/projects/runners/_group_runners.html.haml b/app/views/projects/runners/_group_runners.html.haml index 5acd6f95df4..d71bcd12e64 100644 --- a/app/views/projects/runners/_group_runners.html.haml +++ b/app/views/projects/runners/_group_runners.html.haml @@ -35,7 +35,9 @@ = _('Ask your group owner to set up a group runner.') - else - %h4.underlined-title - = _('Available group runners: %{runners}').html_safe % { runners: @group_runners.count } - %ul.bordered-list - = render partial: 'projects/runners/runner', collection: @group_runners, as: :runner + %div{ data: { testid: 'group-runners' } } + %h5.gl-mt-6.gl-mb-0 + = _('Available group runners: %{runners}') % { runners: @group_runners_count } + %ul.bordered-list + = render partial: 'projects/runners/runner', collection: @group_runners, as: :runner + = paginate @group_runners, theme: "gitlab", param_name: "group_runners_page", params: { expand_runners: true, anchor: 'js-runners-settings' } diff --git a/app/views/projects/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml index 18803bdd8f3..e517b37aae9 100644 --- a/app/views/projects/runners/_runner.html.haml +++ b/app/views/projects/runners/_runner.html.haml @@ -7,7 +7,7 @@ - else %span = "##{runner.id} (#{runner.short_sha})" - - if runner.locked? + - if runner.locked? && runner.project_type? %span.has-tooltip{ title: s_('Runners|Runner is locked and available for currently assigned projects only. Only administrators can change the assigned projects.') } = sprite_icon('lock') .gl-ml-2 diff --git a/app/views/projects/runners/_shared_runners.html.haml b/app/views/projects/runners/_shared_runners.html.haml index 4689e70d907..9e7bbd6cefe 100644 --- a/app/views/projects/runners/_shared_runners.html.haml +++ b/app/views/projects/runners/_shared_runners.html.haml @@ -5,6 +5,9 @@ - if @shared_runners_count == 0 = _('This GitLab instance does not provide any shared runners yet. Instance administrators can register shared runners in the admin area.') - else - %h5.gl-mt-6.gl-mb-0 #{_('Available shared runners:')} #{@shared_runners_count} - %ul.bordered-list.available-shared-runners - = render partial: 'projects/runners/runner', collection: @shared_runners, as: :runner + %div{ data: { testid: 'available-shared-runners' } } + %h5.gl-mt-6.gl-mb-0 + = s_('Runners|Available shared runners: %{count}') % {count: @shared_runners_count} + %ul.bordered-list + = render partial: 'projects/runners/runner', collection: @shared_runners, as: :runner + = paginate @shared_runners, theme: "gitlab", param_name: "shared_runners_page", params: { expand_runners: true, anchor: 'js-runners-settings' } diff --git a/app/views/projects/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml index 3634bacb6ec..f3a7037bdab 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: 'prevent-users-from-registering-runners'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more.'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'restrict-runner-registration-by-all-users-in-an-instance'), target: '_blank', rel: 'noopener noreferrer' %hr diff --git a/app/views/projects/settings/_general.html.haml b/app/views/projects/settings/_general.html.haml index 3a62c6f41cc..5f1dee39e25 100644 --- a/app/views/projects/settings/_general.html.haml +++ b/app/views/projects/settings/_general.html.haml @@ -1,5 +1,5 @@ - hidden_topics_field_id = 'project_topic_list_field' -= form_for [@project], html: { multipart: true, class: "edit-project js-general-settings-form" }, authenticity_token: true do |f| += gitlab_ui_form_for [@project], html: { multipart: true, class: "edit-project js-general-settings-form" }, authenticity_token: true do |f| %input{ name: 'update_section', type: 'hidden', value: 'js-general-settings' } %fieldset @@ -39,4 +39,4 @@ %hr = link_to _('Remove avatar'), project_avatar_path(@project), aria: { label: _('Remove avatar') }, data: { confirm: _('Avatar will be removed. Are you sure?'), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'gl-button btn btn-danger-secondary' - = f.submit _('Save changes'), class: "gl-button btn btn-confirm gl-mt-6", data: { qa_selector: 'save_naming_topics_avatar_button' } + = f.submit _('Save changes'), pajamas_button: true, class: "gl-mt-6", data: { qa_selector: 'save_naming_topics_avatar_button' } diff --git a/app/views/projects/settings/branch_rules/index.html.haml b/app/views/projects/settings/branch_rules/index.html.haml index 571a992a552..80a41bb579b 100644 --- a/app/views/projects/settings/branch_rules/index.html.haml +++ b/app/views/projects/settings/branch_rules/index.html.haml @@ -3,4 +3,4 @@ %h3.gl-mb-5= s_('BranchRules|Branch rules details') -#js-branch-rules{ data: { project_path: @project.full_path, protected_branches_path: project_settings_repository_path(@project, anchor: 'js-protected-branches-settings'), approval_rules_path: project_settings_merge_requests_path(@project, anchor: 'js-merge-request-approval-settings'), status_checks_path: project_settings_merge_requests_path(@project, anchor: 'js-merge-request-settings') } } +#js-branch-rules{ data: { project_path: @project.full_path, protected_branches_path: project_settings_repository_path(@project, anchor: 'js-protected-branches-settings'), approval_rules_path: project_settings_merge_requests_path(@project, anchor: 'js-merge-request-approval-settings'), status_checks_path: project_settings_merge_requests_path(@project, anchor: 'js-merge-request-settings'), branches_path: project_branches_path(@project) } } 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 5748b4b0330..86238a41f0b 100644 --- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml +++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml @@ -10,8 +10,8 @@ - base_domain_link_start = link_start % { url: base_domain_path } - help_link_continouos = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/stages.md', anchor: 'auto-deploy'), target: '_blank', rel: 'noopener noreferrer' -- help_link_timed = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'timed-incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' -- help_link_incremental = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/customize.md', anchor: 'incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' +- help_link_timed = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/cicd_variables.md', anchor: 'timed-incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' +- help_link_incremental = link_to sprite_icon('question-o'), help_page_path('topics/autodevops/cicd_variables.md', anchor: 'incremental-rollout-to-production'), target: '_blank', rel: 'noopener noreferrer' .row .col-lg-12 diff --git a/app/views/projects/settings/operations/_alert_management.html.haml b/app/views/projects/settings/operations/_alert_management.html.haml index d80f1e4597c..7433e81c11c 100644 --- a/app/views/projects/settings/operations/_alert_management.html.haml +++ b/app/views/projects/settings/operations/_alert_management.html.haml @@ -3,7 +3,7 @@ - add_page_specific_style 'page_bundles/alert_management_settings' - add_page_specific_style 'page_bundles/incident_management_list' -%section.settings.no-animate#js-alert-management-settings{ class: ('expanded' if expanded) } +%section.settings.no-animate#js-alert-management-settings{ class: ('expanded' if expanded), data: { qa_selector: 'alerts_settings_content' } } .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only = _('Alerts') diff --git a/app/views/projects/settings/repository/_protected_branches.html.haml b/app/views/projects/settings/repository/_protected_branches.html.haml index 31630828571..d2356b5df09 100644 --- a/app/views/projects/settings/repository/_protected_branches.html.haml +++ b/app/views/projects/settings/repository/_protected_branches.html.haml @@ -1,2 +1,2 @@ -= render "projects/protected_branches/index" += render "protected_branches/index" = render "projects/protected_tags/index" diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 77c44b792ab..5fa70c3af32 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -15,7 +15,7 @@ = render "home_panel" -- if can?(current_user, :download_code, @project) && @project.repository_languages.present? +- if can?(current_user, :read_code, @project) && @project.repository_languages.present? - add_page_startup_graphql_call('repository/path_last_commit', { projectPath: @project.full_path, ref: current_ref, path: current_route_path || "" }) = repository_languages_bar(@project.repository_languages) @@ -25,8 +25,5 @@ - view_path = @project.default_view -- if show_auto_devops_callout?(@project) - = render 'shared/auto_devops_callout' - %div{ class: project_child_container_class(view_path) } = render view_path, is_project_overview: true diff --git a/app/views/projects/starrers/index.html.haml b/app/views/projects/starrers/index.html.haml index fe8a6508dd7..23578652862 100644 --- a/app/views/projects/starrers/index.html.haml +++ b/app/views/projects/starrers/index.html.haml @@ -1,4 +1,5 @@ - page_title _("Starrers") +- add_page_specific_style 'page_bundles/users' .top-area.adjust .nav-text diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml index ed06c90efa8..2f8291d255f 100644 --- a/app/views/projects/tags/new.html.haml +++ b/app/views/projects/tags/new.html.haml @@ -2,7 +2,7 @@ - default_ref = params[:ref] || @project.default_branch - if @error - = render Pajamas::AlertComponent.new(variant: :danger, dismissible: true ) do |c| + = render Pajamas::AlertComponent.new(variant: :danger, dismissible: true) do |c| = c.body do = @error @@ -20,14 +20,9 @@ = label_tag :tag_name, nil = text_field_tag :tag_name, params[:tag_name], required: true, autofocus: true, class: 'form-control', data: { qa_selector: "tag_name_field" } .form-group.row - .col-sm-12.create-from + .col-sm-auto.create-from = label_tag :ref, 'Create from' - .dropdown - = hidden_field_tag :ref, default_ref - = button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide js-branch-select monospace', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do - .text-left.dropdown-toggle-text= default_ref - = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') - = render 'shared/ref_dropdown', dropdown_class: 'wide' + .js-new-tag-ref-selector{ data: { project_id: @project.id, default_branch_name: default_ref, hidden_input_name: 'ref' } } .form-text.text-muted = s_('TagsPage|Existing branch name, tag, or commit SHA') .form-group.row @@ -42,5 +37,4 @@ = s_('TagsPage|Create tag') = render Pajamas::ButtonComponent.new(href: project_tags_path(@project)) do = s_('TagsPage|Cancel') --# haml-lint:disable InlineJavaScript -%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe + diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index 29bdca1c876..fd807350245 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -2,7 +2,7 @@ .tree-ref-container.gl-display-flex.mb-2.mb-md-0 .tree-ref-holder - = render 'shared/ref_switcher', destination: 'tree', show_create: true + #js-tree-ref-switcher{ data: { project_id: @project.id, project_root_path: project_path(@project) } } #js-repo-breadcrumb{ data: breadcrumb_data_attributes } diff --git a/app/views/projects/triggers/_form.html.haml b/app/views/projects/triggers/_form.html.haml index b6b24a0c26a..b621f1ab3ed 100644 --- a/app/views/projects/triggers/_form.html.haml +++ b/app/views/projects/triggers/_form.html.haml @@ -6,6 +6,6 @@ %label.label-bold Token %p.form-control-plaintext= @trigger.token .form-group - = f.label :key, "Description", class: "label-bold" - = f.text_field :description, class: 'form-control gl-form-input', required: true, title: 'Trigger description is required.', placeholder: "Trigger description" + = f.label :key, s_("Trigger|Description"), class: "label-bold" + = f.text_field :description, class: 'form-control gl-form-input', required: true, title: 'Trigger description is required.', placeholder: s_("Trigger|Trigger description") = f.submit btn_text, pajamas_button: true diff --git a/app/views/protected_branches/_branches_list.html.haml b/app/views/protected_branches/_branches_list.html.haml new file mode 100644 index 00000000000..82eac348f16 --- /dev/null +++ b/app/views/protected_branches/_branches_list.html.haml @@ -0,0 +1,4 @@ +- can_admin_project = can?(current_user, :admin_project, @project) + += render layout: 'protected_branches/shared/branches_list', locals: { can_admin_project: can_admin_project } do + = render partial: 'protected_branches/protected_branch', collection: @protected_branches diff --git a/app/views/projects/protected_branches/_create_protected_branch.html.haml b/app/views/protected_branches/_create_protected_branch.html.haml index 76aadc3be28..22a49ba9c7e 100644 --- a/app/views/projects/protected_branches/_create_protected_branch.html.haml +++ b/app/views/protected_branches/_create_protected_branch.html.haml @@ -11,4 +11,4 @@ dropdown_class: 'dropdown-menu-selectable capitalize-header', dropdown_qa_selector: 'allowed_to_push_dropdown_content' , dropdown_testid: 'allowed-to-push-dropdown', data: { field_name: 'protected_branch[push_access_levels_attributes][0][access_level]', input_id: 'push_access_levels_attributes', qa_selector: 'allowed_to_push_dropdown' }}) -= render 'projects/protected_branches/shared/create_protected_branch' += render 'protected_branches/shared/create_protected_branch' diff --git a/app/views/protected_branches/_index.html.haml b/app/views/protected_branches/_index.html.haml new file mode 100644 index 00000000000..4beca4845b8 --- /dev/null +++ b/app/views/protected_branches/_index.html.haml @@ -0,0 +1,7 @@ +- content_for :create_protected_branch do + = render 'protected_branches/create_protected_branch' + +- content_for :branches_list do + = render "protected_branches/branches_list" + += render 'protected_branches/shared/index' diff --git a/app/views/protected_branches/_protected_branch.html.haml b/app/views/protected_branches/_protected_branch.html.haml new file mode 100644 index 00000000000..423d7f23eb5 --- /dev/null +++ b/app/views/protected_branches/_protected_branch.html.haml @@ -0,0 +1,2 @@ += render layout: 'protected_branches/shared/protected_branch', locals: { protected_branch: protected_branch } do + = render_if_exists 'protected_branches/update_protected_branch', protected_branch: protected_branch diff --git a/app/views/protected_branches/_update_protected_branch.html.haml b/app/views/protected_branches/_update_protected_branch.html.haml new file mode 100644 index 00000000000..a9290d9e0da --- /dev/null +++ b/app/views/protected_branches/_update_protected_branch.html.haml @@ -0,0 +1 @@ += render 'protected_branches/shared/update_protected_branch', protected_branch: protected_branch diff --git a/app/views/projects/protected_branches/shared/_branches_list.html.haml b/app/views/protected_branches/shared/_branches_list.html.haml index 64db51d5df2..d041f9c5b48 100644 --- a/app/views/projects/protected_branches/shared/_branches_list.html.haml +++ b/app/views/protected_branches/shared/_branches_list.html.haml @@ -28,7 +28,7 @@ %span.has-tooltip{ data: { container: 'body' }, title: s_('ProtectedBranch|Allow all users with push access to force push.'), 'aria-hidden': 'true' } = sprite_icon('question', size: 16, css_class: 'gl-text-gray-500') - = render_if_exists 'projects/protected_branches/ee/code_owner_approval_table_head' + = render_if_exists 'protected_branches/ee/code_owner_approval_table_head' - if can_admin_project %th diff --git a/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml b/app/views/protected_branches/shared/_create_protected_branch.html.haml index 770d79943b3..6b4a143df69 100644 --- a/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_create_protected_branch.html.haml @@ -8,7 +8,7 @@ .form-group.row = f.label :name, s_('ProtectedBranch|Branch:'), class: 'col-sm-12' .col-sm-12 - = render partial: "projects/protected_branches/shared/dropdown", locals: { f: f, toggle_classes: 'gl-w-full! gl-form-input-lg' } + = render partial: "protected_branches/shared/dropdown", locals: { f: f, toggle_classes: 'gl-w-full! gl-form-input-lg' } .form-text.text-muted - wildcards_url = help_page_url('user/project/protected_branches', anchor: 'configure-multiple-protected-branches-by-using-a-wildcard') - wildcards_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wildcards_url } @@ -30,6 +30,6 @@ - force_push_docs_url = help_page_url('topics/git/git_rebase', anchor: 'force-push') - force_push_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: force_push_docs_url } = (s_("ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}.") % { tag_start: force_push_link_start, tag_end: '</a>' }).html_safe - = render_if_exists 'projects/protected_branches/ee/code_owner_approval_form', f: f + = render_if_exists 'protected_branches/ee/code_owner_approval_form', f: f - c.footer do = f.submit s_('ProtectedBranch|Protect'), disabled: true, data: { qa_selector: 'protect_button' }, pajamas_button: true diff --git a/app/views/projects/protected_branches/shared/_dropdown.html.haml b/app/views/protected_branches/shared/_dropdown.html.haml index c5dbf8991cd..c5dbf8991cd 100644 --- a/app/views/projects/protected_branches/shared/_dropdown.html.haml +++ b/app/views/protected_branches/shared/_dropdown.html.haml diff --git a/app/views/projects/protected_branches/shared/_index.html.haml b/app/views/protected_branches/shared/_index.html.haml index c204508d355..c204508d355 100644 --- a/app/views/projects/protected_branches/shared/_index.html.haml +++ b/app/views/protected_branches/shared/_index.html.haml diff --git a/app/views/projects/protected_branches/shared/_matching_branch.html.haml b/app/views/protected_branches/shared/_matching_branch.html.haml index 1a2ec38fae9..1a2ec38fae9 100644 --- a/app/views/projects/protected_branches/shared/_matching_branch.html.haml +++ b/app/views/protected_branches/shared/_matching_branch.html.haml diff --git a/app/views/projects/protected_branches/shared/_protected_branch.html.haml b/app/views/protected_branches/shared/_protected_branch.html.haml index 098bd4a7eeb..5dea85aaa41 100644 --- a/app/views/projects/protected_branches/shared/_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_protected_branch.html.haml @@ -16,7 +16,7 @@ = yield - = render_if_exists 'projects/protected_branches/ee/code_owner_approval_table', protected_branch: protected_branch + = render_if_exists 'protected_branches/ee/code_owner_approval_table', protected_branch: protected_branch - if can_admin_project %td diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/protected_branches/shared/_update_protected_branch.html.haml index d10196a83cc..0244f9e2158 100644 --- a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_update_protected_branch.html.haml @@ -9,7 +9,7 @@ %td.merge_access_levels-container = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", merge_access_levels.first&.access_level - = dropdown_tag( (merge_access_levels.first&.humanize || 'Select') , + = dropdown_tag((merge_access_levels.first&.humanize || 'Select') , options: { toggle_class: 'js-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header', data: { field_name: "allowed_to_merge_#{protected_branch.id}", preselected_items: access_levels_data(merge_access_levels) }}) - if user_merge_access_levels.any? @@ -22,7 +22,7 @@ %td.push_access_levels-container = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level - = dropdown_tag( (push_access_levels.first&.humanize || 'Select') , + = dropdown_tag((push_access_levels.first&.humanize || 'Select') , options: { toggle_class: "js-allowed-to-push js-multiselect", dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header', data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }}) - if user_push_access_levels.any? diff --git a/app/views/projects/protected_branches/show.html.haml b/app/views/protected_branches/show.html.haml index c671757a603..e0bd392ae93 100644 --- a/app/views/projects/protected_branches/show.html.haml +++ b/app/views/protected_branches/show.html.haml @@ -19,7 +19,7 @@ %th Last commit %tbody - @matching_refs.each do |matching_branch| - = render partial: "projects/protected_branches/shared/matching_branch", object: matching_branch + = render partial: "protected_branches/shared/matching_branch", object: matching_branch - else %p.settings-message.text-center Couldn't find any matching branches. diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb index 557a39ee157..c5403caeafa 100644 --- a/app/views/pwa/manifest.json.erb +++ b/app/views/pwa/manifest.json.erb @@ -1,7 +1,7 @@ { - "name": "GitLab", - "short_name": "GitLab", - "description": "<%= _("The complete DevOps platform. One application with endless possibilities. Organizations rely on GitLab’s source code management, CI/CD, security, and more to deliver software rapidly.") %>", + "name": "<%= Appearance.current&.title.presence || _('GitLab') %>", + "short_name": "<%= Appearance.current&.short_title.presence || _('GitLab') %>", + "description": "<%= Appearance.current&.description.presence || _("The complete DevOps platform. One application with endless possibilities. Organizations rely on GitLab’s source code management, CI/CD, security, and more to deliver software rapidly.") %>", "start_url": "<%= explore_projects_path %>", "scope": "<%= root_path %>", "display": "browser", diff --git a/app/views/registrations/welcome/show.html.haml b/app/views/registrations/welcome/show.html.haml index 283659875ef..f4e9a597fe2 100644 --- a/app/views/registrations/welcome/show.html.haml +++ b/app/views/registrations/welcome/show.html.haml @@ -18,22 +18,24 @@ %p.gl-text-center= html_escape(_('%{gitlab_experience_text}. Don\'t worry, this information isn\'t shared outside of your self-managed GitLab instance.')) % { gitlab_experience_text: gitlab_experience_text } = gitlab_ui_form_for(current_user, url: users_sign_up_welcome_path(glm_tracking_params), - html: { class: 'card gl-w-full! gl-p-5 js-users-signup-welcome', + html: { class: 'gl-w-full! gl-p-5 js-users-signup-welcome', 'aria-live' => 'assertive', data: { testid: 'welcome-form' } }) do |f| - .devise-errors - = render 'devise/shared/error_messages', resource: current_user - .row - .form-group.col-sm-12 - = f.label :role, _('Role'), class: 'label-bold' - = 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' } - = render_if_exists "registrations/welcome/jobs_to_be_done", f: f - = render_if_exists "registrations/welcome/setup_for_company", f: f - = render_if_exists "registrations/welcome/joining_project" - = render 'devise/shared/email_opted_in', f: f - .row - .form-group.col-sm-12.gl-mb-0 - - if partial_exists? "registrations/welcome/button" - = render "registrations/welcome/button" - - else - = f.submit _('Get started!'), class: 'btn-confirm gl-button btn btn-block gl-mb-0 gl-p-3', data: { qa_selector: 'get_started_button' } + = render Pajamas::CardComponent.new do |c| + - c.body do + .devise-errors + = render 'devise/shared/error_messages', resource: current_user + .row + .form-group.col-sm-12 + = f.label :role, _('Role'), class: 'label-bold' + = 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' } + = render_if_exists "registrations/welcome/jobs_to_be_done", f: f + = render_if_exists "registrations/welcome/setup_for_company", f: f + = render_if_exists "registrations/welcome/joining_project" + = render 'devise/shared/email_opted_in', f: f + .row + .form-group.col-sm-12.gl-mb-0 + - if partial_exists? "registrations/welcome/button" + = render "registrations/welcome/button" + - else + = f.submit _('Get started!'), class: 'btn-confirm gl-button btn btn-block gl-mb-0 gl-p-3', data: { qa_selector: 'get_started_button' } diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml index c15afd7bd5b..3e483fe8cd2 100644 --- a/app/views/search/_category.html.haml +++ b/app/views/search/_category.html.haml @@ -23,7 +23,7 @@ = search_filter_link 'milestones', _("Milestones") = users - - elsif @show_snippets + - elsif @search_service.show_snippets? = search_filter_link 'snippet_titles', _("Titles and Descriptions"), search: { snippets: true, group_id: nil, project_id: nil } - else = search_filter_link 'projects', _("Projects"), data: { qa_selector: 'projects_tab' } diff --git a/app/views/search/results/_issuable.html.haml b/app/views/search/results/_issuable.html.haml index 36458a909fc..188ead4008e 100644 --- a/app/views/search/results/_issuable.html.haml +++ b/app/views/search/results/_issuable.html.haml @@ -13,7 +13,7 @@ = highlight_and_truncate_issuable(issuable, @search_term, @search_highlight) .col-sm-3.gl-mt-3.gl-sm-mt-0.gl-text-right - if issuable.respond_to?(:upvotes_count) && issuable.upvotes_count > 0 - %li.issuable-upvotes.gl-list-style-none + %li.gl-list-style-none %span.has-tooltip{ title: _('Upvotes') } = sprite_icon('thumb-up', css_class: "gl-vertical-align-middle") = issuable.upvotes_count diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index 9d812e77ad4..e1efa271d57 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -9,7 +9,7 @@ - project_attributes = @project&.attributes&.slice('id', 'namespace_id', 'name')&.merge(name_with_namespace: @project&.name_with_namespace) - if @search_results - - if @without_count + - if @search_service.without_count? - page_description(_("%{scope} results for term '%{term}'") % { scope: @scope, term: @search_term }) - else - page_description(_("%{count} %{scope} for term '%{term}'") % { count: @search_results.formatted_count(@scope), scope: @scope, term: @search_term }) @@ -20,7 +20,7 @@ = render_if_exists 'search/form_elasticsearch', attrs: { class: 'mb-2 mb-sm-0 align-self-center' } .gl-mt-3 - #js-search-topbar{ data: { "group-initial-data": group_attributes.to_json, "project-initial-data": project_attributes.to_json } } + #js-search-topbar{ data: { "group-initial-json": group_attributes.to_json, "project-initial-json": project_attributes.to_json, "elasticsearch-enabled": @elasticsearch_in_use.to_s, "default-branch-name": @project&.default_branch } } - if @search_term - if Feature.disabled?(:search_page_vertical_nav, current_user) = render 'search/category' diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index c2b941c6106..93f919f01d9 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -1,13 +1,16 @@ -= render Pajamas::BannerComponent.new(button_text: s_('AutoDevOps|Enable in settings'), - button_link: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), - svg_path: 'illustrations/autodevops.svg', - banner_options: { class: 'js-autodevops-banner', data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }, - close_options: { 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box'), class: 'js-close-callout' }) do |c| - - c.title do - = s_('AutoDevOps|Auto DevOps') +- container = @no_breadcrumb_container ? 'container-fluid' : container_class - %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') +%div{ class: [container, @content_class, 'gl-pt-5!'] } + = render Pajamas::BannerComponent.new(button_text: s_('AutoDevOps|Enable in settings'), + button_link: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'), + svg_path: 'illustrations/autodevops.svg', + banner_options: { class: 'js-autodevops-banner auto-devops-callout', data: { uid: 'auto_devops_settings_dismissed', project_path: project_path(@project) } }, + close_options: { 'aria-label' => s_('AutoDevOps|Dismiss Auto DevOps box'), class: 'js-close-callout' }) do |c| + - c.title do + = s_('AutoDevOps|Auto DevOps') - %p - - link = link_to(s_('AutoDevOps|Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer') - = s_('AutoDevOps|Learn more in the %{link_to_documentation}').html_safe % { link_to_documentation: link } + %p= s_('AutoDevOps|It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') + + %p + - link = link_to(s_('AutoDevOps|Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer') + = s_('AutoDevOps|Learn more in the %{link_to_documentation}').html_safe % { link_to_documentation: link } diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index 73ace033dc6..a749d1037a1 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -1,16 +1,28 @@ +-# We're not using `link_to` in the line loop because it is too slow once we get to thousands of lines. + +- offset = defined?(first_line_number) ? first_line_number : 1 +- highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil +- file_line_blame = Feature.enabled?(:file_line_blame) + +- if file_line_blame + - line_class = "js-line-links" + - blame_path = project_blame_path(@project, tree_join(@ref, blob.path)) +- else + - line_class = nil + - blame_path = nil + +- highlighted_blob = blob.present.highlight + #blob-content.file-content.code.js-syntax-highlight - - offset = defined?(first_line_number) ? first_line_number : 1 - - if Feature.enabled?(:file_line_blame) - - blame_path = project_blame_path(@project, tree_join(@ref, blob.path)) .line-numbers{ class: "gl-px-0!", data: { blame_path: blame_path } } - if blob.data.present? - - blob.data.each_line.each_with_index do |_, index| + - highlighted_blob.lines.count.times do |index| - i = index + offset - -# We're not using `link_to` because it is too slow once we get to thousands of lines. - %a.file-line-num.diff-line-num{ class: ("js-line-links" if Feature.enabled?(:file_line_blame)), href: "#L#{i}", id: "L#{i}", 'data-line-number' => i } + + %a.file-line-num.diff-line-num{ class: line_class, href: "#L#{i}", id: "L#{i}", 'data-line-number' => i } = i - - highlight = defined?(highlight_line) && highlight_line ? highlight_line - offset : nil + .blob-content{ data: { blob_id: blob.id, path: blob.path, highlight_line: highlight, qa_selector: 'file_content' } } %pre.code.highlight %code - = blob.present.highlight + = highlighted_blob diff --git a/app/views/shared/_ide_root.html.haml b/app/views/shared/_ide_root.html.haml new file mode 100644 index 00000000000..848ff1e5728 --- /dev/null +++ b/app/views/shared/_ide_root.html.haml @@ -0,0 +1,11 @@ +- data = local_assigns.fetch(:data) +- loading_text = local_assigns.fetch(:loading_text) + +-# Fix for iOS 13+, the height of the page is actually less than +-# 100vh because of the presence of the bottom bar +- @body_class = 'gl-max-h-full gl-fixed' + +#ide.gl--flex-center.gl-h-full{ data: data } + .gl-text-center + = gl_loading_icon(size: 'md') + %h2.clgray= loading_text diff --git a/app/views/shared/_issuable_meta_data.html.haml b/app/views/shared/_issuable_meta_data.html.haml index 01ab7bf9cd4..982d3b68792 100644 --- a/app/views/shared/_issuable_meta_data.html.haml +++ b/app/views/shared/_issuable_meta_data.html.haml @@ -6,23 +6,23 @@ - issuable_mr = @issuable_meta_data[issuable.id].merge_requests_count - if issuable_mr > 0 - %li.issuable-mr.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Related merge requests'), data: { testid: 'merge-requests' } } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Related merge requests'), data: { testid: 'merge-requests' } } = sprite_icon('merge-request', css_class: "gl-vertical-align-middle") = issuable_mr - if upvotes > 0 - %li.issuable-upvotes.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Upvotes') } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Upvotes'), data: { testid: 'issuable-upvotes' } } = sprite_icon('thumb-up', css_class: "gl-vertical-align-middle") = upvotes - if downvotes > 0 - %li.issuable-downvotes.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Downvotes') } + %li.gl-display-none.gl-sm-display-block.has-tooltip{ title: _('Downvotes'), data: { testid: 'issuable-downvotes' } } = sprite_icon('thumb-down', css_class: "gl-vertical-align-middle") = downvotes = render_if_exists 'shared/issuable/blocking_issues_count', issuable: issuable -%li.issuable-comments.gl-display-none.gl-sm-display-block - = link_to issuable_path, class: ['has-tooltip', ('no-comments' if note_count == 0)], title: _('Comments') do +%li.gl-display-none.gl-sm-display-block + = link_to issuable_path, class: ['has-tooltip', ('no-comments' if note_count == 0)], title: _('Comments'), data: { testid: 'issuable-comments' } do = sprite_icon('comments', css_class: 'gl-vertical-align-text-bottom') = note_count diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 1645c2695b5..8a626f1620b 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -32,17 +32,17 @@ - if label.project_label? && label.project.group && can?(current_user, :admin_label, label.project.group) %li = render Pajamas::ButtonComponent.new(category: :tertiary, - button_options: { class: 'js-promote-project-label-button', data: { url: promote_project_label_path(label.project, label), label_title: label.title, label_color: label.color, label_text_color: label.text_color, group_name: label.project.group.name } } ) do + button_options: { class: 'js-promote-project-label-button', data: { url: promote_project_label_path(label.project, label), label_title: label.title, label_color: label.color, label_text_color: label.text_color, group_name: label.project.group.name } }) do = _('Promote to group label') %li %span = render Pajamas::ButtonComponent.new(category: :tertiary, - button_options: { class: 'text-danger js-delete-label-modal-button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } } ) do + button_options: { class: 'text-danger js-delete-label-modal-button', data: { label_name: label.name, subject_name: label.subject_name, destroy_path: label.destroy_path } }) do = _('Delete') - if current_user %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3 - if label.can_subscribe_to_label_in_different_levels? - = render Pajamas::ButtonComponent.new(button_options: { class: "js-unsubscribe-button #{'hidden' if status.unsubscribed?}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title } ) do + = render Pajamas::ButtonComponent.new(button_options: { class: "js-unsubscribe-button #{'hidden' if status.unsubscribed?}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do = _('Unsubscribe') .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } = render Pajamas::ButtonComponent.new(button_options: { class: 'gl-w-full', data: { toggle: 'dropdown' } }) do @@ -51,11 +51,11 @@ .dropdown-menu.dropdown-open-left %ul %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } ) do + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } }) do = _('Subscribe at project level') %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } ) do + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } }) do = _('Subscribe at group level') - else - = render Pajamas::ButtonComponent.new(button_options: { class: 'js-subscribe-button gl-w-full', data: { status: status, url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title } ) do + = render Pajamas::ButtonComponent.new(button_options: { class: 'js-subscribe-button gl-w-full', data: { status: status, url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title }) do = label_subscription_toggle_button_text(label, @project) diff --git a/app/views/shared/_milestones_filter.html.haml b/app/views/shared/_milestones_filter.html.haml index ef41dc9bb79..0053f2fe444 100644 --- a/app/views/shared/_milestones_filter.html.haml +++ b/app/views/shared/_milestones_filter.html.haml @@ -1,6 +1,6 @@ - count_badge_classes = 'gl-display-none gl-sm-display-inline-flex' -= gl_tabs_nav( {class: 'gl-border-b-0 gl-flex-grow-1', data: { testid: 'milestones-filter' } } ) do += gl_tabs_nav({class: 'gl-border-b-0 gl-flex-grow-1', data: { testid: 'milestones-filter' } }) do = gl_tab_link_to milestones_filter_path(state: 'opened'), { item_active: params[:state].blank? || params[:state] == 'opened' } do = _('Open') = gl_tab_counter_badge counts[:opened], { class: count_badge_classes } diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml index 0bd5d1795d0..d080d8be8fe 100644 --- a/app/views/shared/_new_project_item_select.html.haml +++ b/app/views/shared/_new_project_item_select.html.haml @@ -1,5 +1,5 @@ - if any_projects?(@projects) - .dropdown.b-dropdown.gl-new-dropdown.btn-group.project-item-select-holder{ class: 'gl-display-inline-flex!' } + .dropdown.b-dropdown.gl-dropdown.btn-group.project-item-select-holder{ class: 'gl-display-inline-flex!' } %a.btn.gl-button.btn-confirm.split-content-button.js-new-project-item-link.block-truncated{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] } } = gl_loading_icon(inline: true, color: 'light') = project_select_tag :project_path, class: "project-item-select gl-absolute! gl-visibility-hidden", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path], with_shared: local_assigns[:with_shared], include_projects_in_subgroups: local_assigns[:include_projects_in_subgroups] }, with_feature_enabled: local_assigns[:with_feature_enabled] diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml index 20bf2141cc3..fa718a9c907 100644 --- a/app/views/shared/_ref_switcher.html.haml +++ b/app/views/shared/_ref_switcher.html.haml @@ -13,7 +13,7 @@ - @options && @options.each do |key, value| = hidden_field_tag key, value, id: nil .dropdown - = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: ref, refs_url: refs_project_path(@project, sort: 'updated_desc'), field_name: field_name, submit_form_on_click: true, visit: true, qa_selector: "branches_dropdown", testid: "branches-select" }, { toggle_class: "js-project-refs-dropdown" } + = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: ref, ref_type: @ref_type, refs_url: refs_project_path(@project, sort: 'updated_desc'), field_name: field_name, submit_form_on_click: true, visit: true, qa_selector: "branches_dropdown", testid: "branches-select" }, { toggle_class: "js-project-refs-dropdown" } .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown.dropdown-menu-paging{ class: ("dropdown-menu-right" if local_assigns[:align_right]), data: { qa_selector: "branches_dropdown_content" } } .dropdown-page-one = dropdown_title _("Switch branch/tag") diff --git a/app/views/shared/_web_ide_button.html.haml b/app/views/shared/_web_ide_button.html.haml index 83646a3c92e..aeaccdfa54b 100644 --- a/app/views/shared/_web_ide_button.html.haml +++ b/app/views/shared/_web_ide_button.html.haml @@ -2,4 +2,4 @@ - button_data = web_ide_button_data({ blob: blob }) - fork_options = fork_modal_options(@project, @ref, @path, blob) -.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json }, id: "js-#{type}-web-ide-link" } +.gl-display-inline-block{ data: { options: button_data.merge(fork_options).to_json, web_ide_promo_popover_img: image_path('web-ide-promo-popover.svg') }, id: "js-#{type}-web-ide-link" } diff --git a/app/views/shared/builds/_tabs.html.haml b/app/views/shared/builds/_tabs.html.haml index 8e4b8d6d428..8f2b9fc06e3 100644 --- a/app/views/shared/builds/_tabs.html.haml +++ b/app/views/shared/builds/_tabs.html.haml @@ -1,6 +1,6 @@ - count_badge_classes = 'gl-display-none gl-sm-display-inline-flex' -= gl_tabs_nav( {class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1 gl-w-full nav gl-border-b-0', data: { testid: 'jobs-tabs' } } ) do += gl_tabs_nav({class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1 gl-w-full nav gl-border-b-0', data: { testid: 'jobs-tabs' } }) do = gl_tab_link_to build_path_proc.call(nil), { item_active: scope.nil? } do = _('All') = gl_tab_counter_badge(limited_counter_with_delimiter(all_builds), { class: count_badge_classes }) diff --git a/app/views/shared/empty_states/_milestones.html.haml b/app/views/shared/empty_states/_milestones.html.haml index fb69e75370e..0d7dbd1415b 100644 --- a/app/views/shared/empty_states/_milestones.html.haml +++ b/app/views/shared/empty_states/_milestones.html.haml @@ -6,7 +6,7 @@ .svg-content = image_tag 'illustrations/milestone_burndown_chart.svg' .col-12 - .text-content + .text-content.text-center %h4= s_('Milestones|Use milestones to track issues and merge requests over a fixed period of time') %p.state-description = s_('Milestones|Organize issues and merge requests into a cohesive group, and set optional start and due dates. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link } diff --git a/app/views/shared/empty_states/_milestones_tab.html.haml b/app/views/shared/empty_states/_milestones_tab.html.haml index f6760b0a3f4..52df30434b4 100644 --- a/app/views/shared/empty_states/_milestones_tab.html.haml +++ b/app/views/shared/empty_states/_milestones_tab.html.haml @@ -12,6 +12,6 @@ %h4.text-center= s_('Milestones|There are no closed milestones') - else %h4.text-center= s_('Milestones|There are no open milestones') - %p.state-description + %p.state-description.text-center = s_('Milestones|Create a milestone to better track your issues and merge requests. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link } = yield diff --git a/app/views/shared/file_hooks/_index.html.haml b/app/views/shared/file_hooks/_index.html.haml index d48e9f3d02e..16e89463a4b 100644 --- a/app/views/shared/file_hooks/_index.html.haml +++ b/app/views/shared/file_hooks/_index.html.haml @@ -11,15 +11,16 @@ .col-lg-8.gl-mb-3 - if file_hooks.any? - .card - .card-header + = render Pajamas::CardComponent.new do |c| + - c.header do = _('File Hooks (%{count})') % { count: file_hooks.count } - %ul.content-list - - file_hooks.each do |file| - %li - .monospace - = File.basename(file) - + - c.body do + %ul.content-list + - file_hooks.each do |file| + %li + .monospace + = File.basename(file) - else - .card.bg-light.text-center - .nothing-here-block= _('No file hooks found.') + = render Pajamas::CardComponent.new do |c| + - c.body do + .nothing-here-block= _('No file hooks found.') diff --git a/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml b/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml new file mode 100644 index 00000000000..9fe1400e877 --- /dev/null +++ b/app/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml @@ -0,0 +1,4 @@ +- return unless show_security_patch_upgrade_alert? + +#js-security-patch-upgrade-alert{ data: { "current_version": Gitlab.version_info } } +#js-security-patch-upgrade-alert-modal{ data: { "current_version": Gitlab.version_info, "version": gitlab_version_check.to_json } } diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml index 896249c6163..dda84e0fb9e 100644 --- a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml @@ -6,12 +6,12 @@ = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { qa_selector: 'custom_metrics_container', active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } } + .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } } .card-header %strong = s_('PrometheusService|Custom metrics') = gl_badge_tag 0, nil, class: 'js-custom-monitored-count' - = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden', data: { qa_selector: 'new_metric_button' } + = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden' .card-body .flash-container.hidden .flash-warning diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml index 8ee0ddfa1b1..c74dbfd8b15 100644 --- a/app/views/shared/integrations/prometheus/_metrics.html.haml +++ b/app/views/shared/integrations/prometheus/_metrics.html.haml @@ -25,8 +25,8 @@ .card.hidden.js-panel-missing-env-vars .card-header - = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right' ) - = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden' ) + = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right') + = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden') = s_('PrometheusService|Missing environment variable') = gl_badge_tag 0, nil, class: 'js-env-var-count' .card-body.hidden diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index a325ad5f447..07cdbbece8c 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -62,9 +62,9 @@ = sanitize(html_escape(_('Please review the %{linkStart}contribution guidelines%{linkEnd} for this project.')) % { linkStart: contribution_guidelines_start, linkEnd: contribution_guidelines_end }) - if issuable.new_record? - = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + = form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", pajamas_button: true, class: 'gl-mr-2', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - else - = form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } + = form.submit _('Save changes'), pajamas_button: true, class: 'gl-mr-2', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 } - if issuable.new_record? = link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default js-reset-autosave' diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 0fd128df997..39a123f4775 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -20,7 +20,7 @@ .js-sidebar-todo-widget-root{ data: { project_path: issuable_sidebar[:project_full_path], iid: issuable_sidebar[:iid], id: issuable_sidebar[:id] } } = form_for issuable_type, url: issuable_sidebar[:issuable_json_path], remote: true, html: { class: 'issuable-context-form inline-update js-issuable-update' } do |f| - .block.assignee{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}", data: { qa_selector: 'assignee_block_container' } } + .block.assignee{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}", data: { qa_selector: 'assignee_block_container', testid: 'assignee-block-container' } } = render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in - if issuable_sidebar[:supports_severity] @@ -101,7 +101,7 @@ .sidebar-collapsed-icon{ data: { toggle: 'tooltip', placement: 'left', container: 'body', boundary: 'viewport' }, title: _('Move issue') } = sprite_icon('long-arrow') .dropdown.sidebar-move-issue-dropdown.hide-collapsed - = render Pajamas::ButtonComponent.new(block: true, button_options: { class: 'js-sidebar-dropdown-toggle js-move-issue', data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } } ) do + = render Pajamas::ButtonComponent.new(block: true, button_options: { class: 'js-sidebar-dropdown-toggle js-move-issue', data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_action: "click_button", track_value: "" } }) do = _('Move issue') .dropdown-menu.dropdown-menu-selectable.dropdown-extended-height = dropdown_title(_('Move issue')) diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index 51f49c7ca8e..0f6ef33d532 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -4,8 +4,8 @@ - no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty? - toggle_wip_link_start = '<a href="" class="js-toggle-wip">' - toggle_wip_link_end = '</a>' -- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe } ).html_safe -- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.' ) % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe } ).html_safe +- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe }).html_safe +- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe }).html_safe %div{ data: { testid: 'issue-title-input-field' } } = form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true, diff --git a/app/views/shared/issue_type/_details_content.html.haml b/app/views/shared/issue_type/_details_content.html.haml index 8a9b71fd91e..42f6f7b71a3 100644 --- a/app/views/shared/issue_type/_details_content.html.haml +++ b/app/views/shared/issue_type/_details_content.html.haml @@ -29,7 +29,7 @@ - if can?(current_user, :admin_feature_flags_issue_links, @project) = render_if_exists 'projects/issues/related_feature_flags' - - if can?(current_user, :download_code, @project) + - if can?(current_user, :read_code, @project) - add_page_startup_api_call related_branches_path #related-branches{ data: { url: related_branches_path } } -# This element is filled in using JavaScript. diff --git a/app/views/shared/nav/_sidebar_submenu.html.haml b/app/views/shared/nav/_sidebar_submenu.html.haml index 344dafe7c0f..33b48470020 100644 --- a/app/views/shared/nav/_sidebar_submenu.html.haml +++ b/app/views/shared/nav/_sidebar_submenu.html.haml @@ -1,5 +1,5 @@ %ul.sidebar-sub-level-items{ class: ('is-fly-out-only' unless sidebar_menu.has_renderable_items?) } - = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' } ) do + = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' }) do %span.fly-out-top-item-container %strong.fly-out-top-item-name = sidebar_menu.title diff --git a/app/views/shared/projects/_dropdown.html.haml b/app/views/shared/projects/_dropdown.html.haml index 88ac03bf9e3..59f8bf0e875 100644 --- a/app/views/shared/projects/_dropdown.html.haml +++ b/app/views/shared/projects/_dropdown.html.haml @@ -1,5 +1,5 @@ - @sort ||= sort_value_latest_activity -.dropdown.js-project-filter-dropdown-wrap +.dropdown.js-project-filter-dropdown-wrap.gl-display-inline = dropdown_toggle(projects_sort_options_hash[@sort], { toggle: 'dropdown', display: 'static' }, { id: 'sort-projects-dropdown' }) %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable %li.dropdown-header diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index 908eb2428e8..40cd81ab3da 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -52,7 +52,7 @@ %span.user-access-role.gl-display-block.gl-m-0{ data: { qa_selector: 'user_role_content' } }= Gitlab::Access.human_access(access) - if !explore_projects_tab? - = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project + = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project, additional_classes: 'gl-ml-3!' - if show_last_commit_as_description .description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2 diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml deleted file mode 100644 index 5271a5fac09..00000000000 --- a/app/views/shared/projects/_search_bar.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- @sort ||= sort_value_latest_activity -- project_tab_filter = local_assigns.fetch(:project_tab_filter, "") -- flex_grow_and_shrink_xs = 'd-flex flex-xs-grow-1 flex-xs-shrink-1 flex-grow-0 flex-shrink-0' - -.filtered-search-block.row-content-block.bt-0 - .filtered-search-wrapper.d-flex.gl-flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap - - unless project_tab_filter == :starred - .filtered-search-nav.mb-2.mb-lg-0{ class: flex_grow_and_shrink_xs } - = render 'dashboard/projects/nav', project_tab_filter: project_tab_filter - .filtered-search.d-flex.flex-grow-1.flex-shrink-1.w-100.mb-2.mb-lg-0.ml-0{ class: project_tab_filter == :starred ? "extended-filtered-search-box mb-2 mb-lg-0" : "ml-sm-3" } - .btn-group.w-100{ role: "group" } - .btn-group.w-100{ role: "group" } - .filtered-search-box.m-0 - .filtered-search-box-input-container.pl-2 - = render 'shared/projects/search_form', admin_view: false, search_form_placeholder: _("Search projects...") - = render Pajamas::ButtonComponent.new(icon: 'search', icon_classes: 'search-icon', button_options: { type: 'submit', form: 'project-filter-form' }) - .filtered-search-dropdown.flex-row.align-items-center.mb-2.m-sm-0#filtered-search-visibility-dropdown{ class: flex_grow_and_shrink_xs } - .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold - %span - = _("Visibility") - = render 'explore/projects/filter', has_label: true - .filtered-search-dropdown.flex-row.align-items-center.m-sm-0#filtered-search-sorting-dropdown{ class: flex_grow_and_shrink_xs } - .filtered-search-dropdown-label.p-0.pl-sm-3.font-weight-bold - %span - = _("Sort by") - = render 'shared/projects/sort_dropdown' diff --git a/app/views/shared/projects/_search_form.html.haml b/app/views/shared/projects/_search_form.html.haml index e598343d698..07a6d5bec78 100644 --- a/app/views/shared/projects/_search_form.html.haml +++ b/app/views/shared/projects/_search_form.html.haml @@ -1,10 +1,9 @@ -- form_field_classes = local_assigns[:admin_view] || !Feature.enabled?(:project_list_filter_bar) ? 'input-short js-projects-list-filter' : 'gl-w-full! gl-pl-7 ' - placeholder = local_assigns[:search_form_placeholder] ? search_form_placeholder : _('Filter by name') = form_tag filter_projects_path, method: :get, class: 'project-filter-form', data: { qa_selector: 'project_filter_form_container' }, id: 'project-filter-form' do |f| = search_field_tag :name, params[:name], placeholder: placeholder, - class: "project-filter-form-field form-control #{form_field_classes}", + class: "project-filter-form-field form-control input-short js-projects-list-filter", spellcheck: false, id: 'project-filter-form-field', autofocus: local_assigns[:autofocus] @@ -24,4 +23,22 @@ - if params[:visibility_level].present? = hidden_field_tag :visibility_level, params[:visibility_level] + - if params[:language].present? + = hidden_field_tag :language, params[:language] + + - if Feature.enabled?(:project_language_search, current_user) + .dropdown.inline + = dropdown_toggle(search_language_placeholder, { toggle: 'dropdown', testid: 'project-language-dropdown' }) + %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable + %li + = link_to _('Any'), filter_projects_path(language: nil) + - programming_languages.each do |language| + %li + = link_to filter_projects_path(language: language.id), class: language_state_class(language) do + = language.name + + = submit_tag nil, class: 'gl-display-none!' + + = render 'shared/projects/dropdown' + = render_if_exists 'shared/projects/search_fields' diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml deleted file mode 100644 index f3aeaacbdb1..00000000000 --- a/app/views/shared/projects/_sort_dropdown.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -- @sort ||= sort_value_latest_activity -- toggle_text = projects_sort_option_titles[@sort] - -.btn-group.w-100{ role: "group" } - .btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" } - %button#sort-projects-dropdown.gl-button.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } - = toggle_text - = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable - %li.dropdown-header - = _("Sort by") - - projects_sort_options_hash.each do |value, title| - %li - = link_to title, filter_projects_path(sort: value), class: ("is-active" if toggle_text == title) - - %li.divider - %li - = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - = _("Hide archived projects") - %li - = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - = _("Show archived projects") - %li - = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - = _("Show archived projects only") - - - if current_user && @group && @group.shared_projects.present? - %li.divider - %li - = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do - = _("All projects") - %li - = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do - = _("Hide shared projects") - %li - = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do - = _("Hide group projects") - - = project_sort_direction_button(@sort) diff --git a/app/views/shared/runners/_form.html.haml b/app/views/shared/runners/_form.html.haml index 024b06fe97a..f4b6c3c3a50 100644 --- a/app/views/shared/runners/_form.html.haml +++ b/app/views/shared/runners/_form.html.haml @@ -51,4 +51,4 @@ .col-sm-10 = f.text_field :private_projects_minutes_cost_factor, class: 'form-control' .form-actions - = f.submit _('Save changes'), class: 'gl-button btn btn-confirm' + = f.submit _('Save changes'), pajamas_button: true diff --git a/app/views/shared/ssh_keys/_key_delete.html.haml b/app/views/shared/ssh_keys/_key_delete.html.haml index f8bb0e21f67..4b89b2a0cbf 100644 --- a/app/views/shared/ssh_keys/_key_delete.html.haml +++ b/app/views/shared/ssh_keys/_key_delete.html.haml @@ -1,9 +1,7 @@ -- title = _('Delete Key') -- aria = { label: title } +- icon = local_assigns[:icon] +- category = local_assigns[:category] || :primary -- if defined?(text) - = button_to text, '#', class: html_class, data: button_data, title: title, aria: aria -- else - = button_to '#', class: html_class, data: button_data, title: title, aria: aria do - %span.sr-only= _('Delete') - = sprite_icon('remove') +.gl-p-2 + = render Pajamas::ButtonComponent.new(variant: :danger, category: category, icon: ('remove' if icon), button_options: { class: 'js-confirm-modal-button', data: button_data }) do + - unless icon + = _('Delete') diff --git a/app/views/shared/topics/_search_form.html.haml b/app/views/shared/topics/_search_form.html.haml index 97343983b3c..2806b2865dd 100644 --- a/app/views/shared/topics/_search_form.html.haml +++ b/app/views/shared/topics/_search_form.html.haml @@ -1,6 +1,6 @@ = form_tag page_filter_path, method: :get, class: "topic-filter-form js-topic-filter-form", id: 'topic-filter-form' do |f| = search_field_tag :search, params[:search], - placeholder: s_('Filter by name'), + placeholder: _('Filter by name'), class: 'topic-filter-form-field form-control input-short', spellcheck: false, id: 'topic-filter-form-field', diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index ecb736dac4f..7eafd6ae092 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -1,13 +1,6 @@ = form_errors(hook) -- if Feature.enabled?(:webhook_form_mask_url) - .js-vue-webhook-form{ data: webhook_form_data(hook) } -- else - .form-group - = form.label :url, s_('Webhooks|URL'), class: 'label-bold' - = form.text_field :url, class: 'form-control gl-form-input', placeholder: 'http://example.com/trigger-ci.json' - %p.form-text.text-muted - = s_('Webhooks|URL must be percent-encoded if it contains one or more special characters.') +.js-vue-webhook-form{ data: webhook_form_data(hook) } .form-group = form.label :token, s_('Webhooks|Secret token'), class: 'label-bold' = form.password_field :token, value: hook.masked_token, autocomplete: 'new-password', class: 'form-control gl-form-input' @@ -19,66 +12,57 @@ = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' %ul.list-unstyled %li.gl-pb-5 - - if Feature.enabled?(:enhanced_webhook_support_regex) - - is_new_hook = hook.id.nil? - .js-vue-push-events{ data: { push_events: hook.push_events.to_s, strategy: hook.branch_filter_strategy, is_new_hook: is_new_hook.to_s, push_events_branch_filter: hook.push_events_branch_filter } } - - else - = form.gitlab_ui_checkbox_component :push_events, s_('Webhooks|Push events') - .gl-pl-6 - = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', - placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' - %p.form-text.text-muted.custom-control - = s_('Webhooks|Push to the repository.') + .js-vue-push-events{ data: { push_events: hook.push_events.to_s, strategy: hook.branch_filter_strategy, is_new_hook: hook.new_record?.to_s, push_events_branch_filter: hook.push_events_branch_filter } } %li.gl-pb-5 = form.gitlab_ui_checkbox_component :tag_push_events, - s_('Webhooks|Tag push events'), + integration_webhook_event_human_name(:tag_push_events), help_text: s_('Webhooks|A new tag is pushed to the repository.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :note_events, - s_('Webhooks|Comments'), + integration_webhook_event_human_name(:note_events), help_text: s_('Webhooks|A comment is added to an issue or merge request.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :confidential_note_events, - s_('Webhooks|Confidential comments'), + integration_webhook_event_human_name(:confidential_note_events), help_text: s_('Webhooks|A comment is added to a confidential issue.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :issues_events, - s_('Webhooks|Issues events'), + integration_webhook_event_human_name(:issues_events), help_text: s_('Webhooks|An issue is created, updated, closed, or reopened.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :confidential_issues_events, - s_('Webhooks|Confidential issues events'), + integration_webhook_event_human_name(:confidential_issues_events), help_text: s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') - if @group = render_if_exists 'groups/hooks/member_events', form: form = render_if_exists 'groups/hooks/subgroup_events', form: form %li.gl-pb-5 = form.gitlab_ui_checkbox_component :merge_requests_events, - s_('Webhooks|Merge request events'), + integration_webhook_event_human_name(:merge_requests_events), help_text: s_('Webhooks|A merge request is created, updated, or merged.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :job_events, - s_('Webhooks|Job events'), + integration_webhook_event_human_name(:job_events), help_text: s_("Webhooks|A job's status changes.") %li.gl-pb-5 = form.gitlab_ui_checkbox_component :pipeline_events, - s_('Webhooks|Pipeline events'), + integration_webhook_event_human_name(:pipeline_events), help_text: s_("Webhooks|A pipeline's status changes.") %li.gl-pb-5 = form.gitlab_ui_checkbox_component :wiki_page_events, - s_('Webhooks|Wiki page events'), + integration_webhook_event_human_name(:wiki_page_events), help_text: s_('Webhooks|A wiki page is created or updated.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :deployment_events, - s_('Webhooks|Deployment events'), + integration_webhook_event_human_name(:deployment_events), help_text: s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :feature_flag_events, - s_('Webhooks|Feature flag events'), + integration_webhook_event_human_name(:feature_flag_events), help_text: s_('Webhooks|A feature flag is turned on or off.') %li.gl-pb-5 = form.gitlab_ui_checkbox_component :releases_events, - s_('Webhooks|Releases events'), + integration_webhook_event_human_name(:releases_events), help_text: s_('Webhooks|A release is created or updated.') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml index 529ef47a2cf..c19b518acd6 100644 --- a/app/views/shared/web_hooks/_hook.html.haml +++ b/app/views/shared/web_hooks/_hook.html.haml @@ -16,7 +16,7 @@ %div - hook.class.triggers.each_value do |trigger| - if hook.public_send(trigger) - = gl_badge_tag(trigger.to_s.titleize, size: :sm) + = gl_badge_tag(integration_webhook_event_human_name(trigger), size: :sm) = gl_badge_tag(sslBadgeText, size: :sm) .col-md-4.col-lg-5.text-right-md.gl-mt-2 diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml index 3ffa45f01be..7a78a32fe87 100644 --- a/app/views/shared/web_hooks/_test_button.html.haml +++ b/app/views/shared/web_hooks/_test_button.html.haml @@ -2,12 +2,12 @@ - hook = local_assigns.fetch(:hook) - triggers = hook.class.triggers -.hook-test-button.dropdown.gl-new-dropdown.inline> +.hook-test-button.dropdown.gl-dropdown.inline> %button.btn.gl-button{ 'data-toggle' => 'dropdown', class: button_class } = _('Test') = sprite_icon('chevron-down') %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' } - .gl-new-dropdown-inner + .gl-dropdown-inner - triggers.each_value do |event| - %li.gl-new-dropdown-item + %li.gl-dropdown-item = link_to_test_hook(hook, event) diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 7cef87ba19f..03ecf8cac22 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -25,7 +25,7 @@ - else = render Pajamas::ButtonComponent.new(href: new_abuse_report_path(user_id: @user.id, ref_url: request.referer), icon: 'error', - button_options: { class: 'gl-flex-grow-1 gl-mx-1 has-tooltip', title: s_('UserProfile|Report abuse'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' }}) + button_options: { class: 'gl-flex-grow-1 gl-mx-1 has-tooltip', title: _('Report abuse to administrator'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' }}) - verified_gpg_keys = @user.gpg_keys.select(&:verified?) - if verified_gpg_keys.any? = render Pajamas::ButtonComponent.new(href: user_gpg_keys_path, diff --git a/app/views/web_ide/remote_ide/index.html.haml b/app/views/web_ide/remote_ide/index.html.haml new file mode 100644 index 00000000000..f007794d056 --- /dev/null +++ b/app/views/web_ide/remote_ide/index.html.haml @@ -0,0 +1,5 @@ +- data = local_assigns.fetch(:data) + +- page_title _('Web IDE') + += render partial: 'shared/ide_root', locals: { data: data, loading_text: _('Connecting to the remote environment...') } |