diff options
Diffstat (limited to 'app/views/admin')
25 files changed, 173 insertions, 137 deletions
diff --git a/app/views/admin/appearances/_form.html.haml b/app/views/admin/appearances/_form.html.haml index ad3795445d1..67ac9d1c7b8 100644 --- a/app/views/admin/appearances/_form.html.haml +++ b/app/views/admin/appearances/_form.html.haml @@ -19,7 +19,7 @@ = link_to 'Remove header logo', header_logos_admin_appearances_path, data: { confirm: "Header logo will be removed. Are you sure?"}, method: :delete, class: "btn gl-button btn-danger btn-danger-secondary btn-sm" %hr = f.hidden_field :header_logo_cache - = f.file_field :header_logo, class: "" + = f.file_field :header_logo, class: "", accept: 'image/*' .hint Maximum file size is 1MB. Pages are optimized for a 28px tall header logo %hr @@ -38,7 +38,7 @@ = link_to 'Remove favicon', favicon_admin_appearances_path, data: { confirm: "Favicon will be removed. Are you sure?"}, method: :delete, class: "btn gl-button btn-danger btn-danger-secondary btn-sm" %hr = f.hidden_field :favicon_cache - = f.file_field :favicon, class: '' + = f.file_field :favicon, class: '', accept: 'image/*' .hint Maximum file size is 1MB. Image size must be 32x32px. Allowed image formats are #{favicon_extension_whitelist}. %br @@ -70,7 +70,7 @@ = link_to 'Remove logo', logo_admin_appearances_path, data: { confirm: "Logo will be removed. Are you sure?"}, method: :delete, class: "btn gl-button btn-danger btn-danger-secondary btn-sm remove-logo" %hr = f.hidden_field :logo_cache - = f.file_field :logo, class: "" + = f.file_field :logo, class: "", accept: 'image/*' .hint Maximum file size is 1MB. Pages are optimized for a 640x360 px logo. 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 f46eb84ce8e..46155f3f670 100644 --- a/app/views/admin/application_settings/_account_and_limit.html.haml +++ b/app/views/admin/application_settings/_account_and_limit.html.haml @@ -52,6 +52,9 @@ = link_to _('More information'), help_page_path('user/permissions', anchor: 'setting-new-users-to-external'), target: '_blank' .form-group + = f.label :personal_access_token_prefix, _('Personal Access Token prefix'), class: 'label-light' + = f.text_field :personal_access_token_prefix, placeholder: _('Max 20 characters'), class: 'form-control' + .form-group = f.label :user_show_add_ssh_key_message, _('Prompt users to upload SSH keys'), class: 'label-bold' .form-check = f.check_box :user_show_add_ssh_key_message, class: 'form-check-input' diff --git a/app/views/admin/application_settings/_eks.html.haml b/app/views/admin/application_settings/_eks.html.haml index 5c0e544eaad..589d754be04 100644 --- a/app/views/admin/application_settings/_eks.html.haml +++ b/app/views/admin/application_settings/_eks.html.haml @@ -24,8 +24,13 @@ .form-group = f.label :eks_access_key_id, 'Access key ID', class: 'label-bold' = f.text_field :eks_access_key_id, class: 'form-control' + .form-text.text-muted + = _('AWS Access Key. Only required if not using role instance credentials') + .form-group = f.label :eks_secret_access_key, 'Secret access key', class: 'label-bold' = f.password_field :eks_secret_access_key, autocomplete: 'off', class: 'form-control' + .form-text.text-muted + = _('AWS Secret Access Key. Only required if not using role instance credentials') = f.submit 'Save changes', class: "gl-button btn btn-success" diff --git a/app/views/admin/application_settings/_ip_limits.html.haml b/app/views/admin/application_settings/_ip_limits.html.haml index c1565cf42e1..b06070d15d4 100644 --- a/app/views/admin/application_settings/_ip_limits.html.haml +++ b/app/views/admin/application_settings/_ip_limits.html.haml @@ -2,44 +2,52 @@ = form_errors(@application_setting) %fieldset + %h5 + = _('Unauthenticated request rate limit') .form-group .form-check = f.check_box :throttle_unauthenticated_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_unauthenticated_checkbox' } - = f.label :throttle_unauthenticated_enabled, class: 'form-check-label' do + = f.label :throttle_unauthenticated_enabled, class: 'form-check-label label-bold' do Enable unauthenticated request rate limit %span.form-text.text-muted Helps reduce request volume (e.g. from crawlers or abusive bots) .form-group - = f.label :throttle_unauthenticated_requests_per_period, 'Max requests per period per IP', class: 'label-bold' + = f.label :throttle_unauthenticated_requests_per_period, 'Max unauthenticated requests per period per IP', class: 'label-bold' = f.number_field :throttle_unauthenticated_requests_per_period, class: 'form-control' .form-group - = f.label :throttle_unauthenticated_period_in_seconds, 'Rate limit period in seconds', class: 'label-bold' + = f.label :throttle_unauthenticated_period_in_seconds, 'Unauthenticated rate limit period in seconds', class: 'label-bold' = f.number_field :throttle_unauthenticated_period_in_seconds, class: 'form-control' + %hr + %h5 + = _('Authenticated API request rate limit') .form-group .form-check = f.check_box :throttle_authenticated_api_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_api_checkbox' } - = f.label :throttle_authenticated_api_enabled, class: 'form-check-label' do + = f.label :throttle_authenticated_api_enabled, class: 'form-check-label label-bold' do Enable authenticated API request rate limit %span.form-text.text-muted Helps reduce request volume (e.g. from crawlers or abusive bots) .form-group - = f.label :throttle_authenticated_api_requests_per_period, 'Max requests per period per user', class: 'label-bold' + = f.label :throttle_authenticated_api_requests_per_period, 'Max authenticated API requests per period per user', class: 'label-bold' = f.number_field :throttle_authenticated_api_requests_per_period, class: 'form-control' .form-group - = f.label :throttle_authenticated_api_period_in_seconds, 'Rate limit period in seconds', class: 'label-bold' + = f.label :throttle_authenticated_api_period_in_seconds, 'Authenticated API rate limit period in seconds', class: 'label-bold' = f.number_field :throttle_authenticated_api_period_in_seconds, class: 'form-control' + %hr + %h5 + = _('Authenticated web request rate limit') .form-group .form-check = f.check_box :throttle_authenticated_web_enabled, class: 'form-check-input', data: { qa_selector: 'throttle_authenticated_web_checkbox' } - = f.label :throttle_authenticated_web_enabled, class: 'form-check-label' do + = f.label :throttle_authenticated_web_enabled, class: 'form-check-label label-bold' do Enable authenticated web request rate limit %span.form-text.text-muted Helps reduce request volume (e.g. from crawlers or abusive bots) .form-group - = f.label :throttle_authenticated_web_requests_per_period, 'Max requests per period per user', class: 'label-bold' + = f.label :throttle_authenticated_web_requests_per_period, 'Max authenticated web requests per period per user', class: 'label-bold' = f.number_field :throttle_authenticated_web_requests_per_period, class: 'form-control' .form-group - = f.label :throttle_authenticated_web_period_in_seconds, 'Rate limit period in seconds', class: 'label-bold' + = f.label :throttle_authenticated_web_period_in_seconds, 'Authenticated web rate limit period in seconds', class: 'label-bold' = f.number_field :throttle_authenticated_web_period_in_seconds, class: 'form-control' = f.submit 'Save changes', class: "gl-button btn btn-success", data: { qa_selector: 'save_changes_button' } diff --git a/app/views/admin/application_settings/_kroki.html.haml b/app/views/admin/application_settings/_kroki.html.haml new file mode 100644 index 00000000000..1547b28c651 --- /dev/null +++ b/app/views/admin/application_settings/_kroki.html.haml @@ -0,0 +1,25 @@ +- expanded = integration_expanded?('kroki_') +%section.settings.as-kroki.no-animate#js-kroki-settings{ class: ('expanded' if expanded) } + .settings-header + %h4 + = _('Kroki') + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded ? _('Collapse') : _('Expand') + %p + = _('Allow rendering of diagrams in AsciiDoc and Markdown documents using %{link}.').html_safe % { link: link_to('Kroki', 'https://kroki.io', target: '_blank') } + .settings-content + = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-kroki-settings'), html: { class: 'fieldset-form' } do |f| + = form_errors(@application_setting) if expanded + + %fieldset + .form-group + .form-check + = f.check_box :kroki_enabled, class: 'form-check-input' + = f.label :kroki_enabled, _('Enable Kroki'), class: 'form-check-label' + .form-group + = f.label :kroki_url, 'Kroki URL', class: 'label-bold' + = f.text_field :kroki_url, class: 'form-control', placeholder: 'http://your-kroki-instance:8000' + .form-text.text-muted + = (_('When Kroki is enabled, GitLab sends diagrams to an instance of Kroki to display them as images. You can use the free public cloud instance %{kroki_public_url} or you can %{install_link} on your own infrastructure. Once you\'ve installed Kroki, make sure to update the server URL to point to your instance.') % { kroki_public_url: '<code>https://kroki.io</code>', install_link: link_to('install Kroki', 'https://docs.kroki.io/kroki/setup/install/', target: '_blank') }).html_safe + + = f.submit _('Save changes'), class: "btn gl-button btn-success" diff --git a/app/views/admin/application_settings/_plantuml.html.haml b/app/views/admin/application_settings/_plantuml.html.haml index 30acb773424..77a310c73a8 100644 --- a/app/views/admin/application_settings/_plantuml.html.haml +++ b/app/views/admin/application_settings/_plantuml.html.haml @@ -18,7 +18,7 @@ = f.label :plantuml_enabled, _('Enable PlantUML'), class: 'form-check-label' .form-group = f.label :plantuml_url, 'PlantUML URL', class: 'label-bold' - = f.text_field :plantuml_url, class: 'form-control', placeholder: 'http://gitlab.your-plantuml-instance.com:8080' + = f.text_field :plantuml_url, class: 'form-control', placeholder: 'http://your-plantuml-instance:8080' .form-text.text-muted Allow rendering of = link_to "PlantUML", "http://plantuml.com" diff --git a/app/views/admin/application_settings/_signup.html.haml b/app/views/admin/application_settings/_signup.html.haml index c3deb8af99e..2f2d42e297e 100644 --- a/app/views/admin/application_settings/_signup.html.haml +++ b/app/views/admin/application_settings/_signup.html.haml @@ -11,7 +11,7 @@ = _("When enabled, any user visiting %{host} will be able to create an account.") % { host: "#{new_user_session_url(host: Gitlab.config.gitlab.host)}" } .form-group .form-check - = f.check_box :require_admin_approval_after_user_signup, class: 'form-check-input' + = f.check_box :require_admin_approval_after_user_signup, class: 'form-check-input', data: { qa_selector: 'require_admin_approval_after_user_signup_checkbox' } = f.label :require_admin_approval_after_user_signup, class: 'form-check-label' do = _('Require admin approval for new sign-ups') .form-text.text-muted @@ -77,4 +77,4 @@ = f.label :after_sign_up_text, class: 'label-bold' = f.text_area :after_sign_up_text, class: 'form-control', rows: 4 .form-text.text-muted Markdown enabled - = f.submit 'Save changes', class: "gl-button btn btn-success" + = f.submit 'Save changes', class: "gl-button btn btn-success", data: { qa_selector: 'save_changes_button' } 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 46d8a8ac9c7..709ce497132 100644 --- a/app/views/admin/application_settings/_visibility_and_access.html.haml +++ b/app/views/admin/application_settings/_visibility_and_access.html.haml @@ -66,4 +66,12 @@ .form-group = f.label field_name, "#{type.upcase} SSH keys", class: 'label-bold' = f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control' + + .form-group + %label.label-bold= s_('AdminSettings|Feed token') + .form-check + = f.check_box :disable_feed_token, class: 'form-check-input' + = f.label :disable_feed_token, class: 'form-check-label' do + = s_('AdminSettings|Disable feed token') + = f.submit _('Save changes'), class: "gl-button btn btn-success" diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index 5c3f68843a2..8f15dcac40a 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -35,7 +35,7 @@ .settings-content = render 'diff_limits' -%section.settings.as-signup.no-animate#js-signup-settings{ class: ('expanded' if expanded_by_default?) } +%section.settings.as-signup.no-animate#js-signup-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'sign_up_restrictions_settings_content' } } .settings-header %h4 = _('Sign-up restrictions') @@ -103,20 +103,10 @@ = s_('IDE|Allow live previews of JavaScript projects in the Web IDE using CodeSandbox Live Preview.') = f.submit _('Save changes'), class: "gl-button btn btn-success" -- if Feature.enabled?(:maintenance_mode) - %section.settings.no-animate#js-maintenance-mode-toggle{ class: ('expanded' if expanded_by_default?) } - .settings-header - %h4 - = _('Maintenance mode') - %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } - = expanded_by_default? ? _('Collapse') : _('Expand') - %p - = _('Prevent users from performing write operations on GitLab while performing maintenance.') - .settings-content - #js-maintenance-mode-settings - += render_if_exists 'admin/application_settings/maintenance_mode_settings_form' = render_if_exists 'admin/application_settings/elasticsearch_form' = render 'admin/application_settings/gitpod' += render 'admin/application_settings/kroki' = render 'admin/application_settings/plantuml' = render 'admin/application_settings/sourcegraph' = render_if_exists 'admin/application_settings/slack' 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 9f1b7195ab7..4959e596148 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -6,7 +6,7 @@ .settings-header %h4 = _('Metrics - Prometheus') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Enable and configure Prometheus metrics.') @@ -17,7 +17,7 @@ .settings-header %h4 = _('Metrics - Grafana') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Enable and configure Grafana.') @@ -28,7 +28,7 @@ .settings-header %h4 = _('Profiling - Performance bar') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Enable access to the Performance Bar for a given group.') @@ -42,7 +42,7 @@ .settings-header#usage-statistics %h4 = _('Usage statistics') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Enable or disable version check and usage ping.') diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 220a211cca6..8cc04392752 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -9,7 +9,7 @@ dismissible: true.to_s } } = notice[:message].html_safe -- if @license.present? && show_license_breakdown? +- if @license.present? .license-panel.gl-mt-5 = render_if_exists 'admin/licenses/summary' = render_if_exists 'admin/licenses/breakdown' diff --git a/app/views/admin/dev_ops_report/show.html.haml b/app/views/admin/dev_ops_report/show.html.haml index dc3bda3a994..75398f3aa21 100644 --- a/app/views/admin/dev_ops_report/show.html.haml +++ b/app/views/admin/dev_ops_report/show.html.haml @@ -3,7 +3,7 @@ .container .gl-mt-3 - - if Gitlab.ee? && Feature.enabled?(:devops_adoption_feature) && License.feature_available?(:devops_adoption) + - if Gitlab.ee? && Feature.enabled?(:devops_adoption_feature, default_enabled: true) && License.feature_available?(:devops_adoption) = render_if_exists 'admin/dev_ops_report/devops_tabs' - else = render 'report' diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml index 6174da14ac0..e4517dca6d0 100644 --- a/app/views/admin/groups/_form.html.haml +++ b/app/views/admin/groups/_form.html.haml @@ -1,6 +1,7 @@ = form_for [:admin, @group] do |f| = form_errors(@group) = render 'shared/group_form', f: f + = render 'shared/group_form_description', f: f = render_if_exists 'shared/old_repository_size_limit_setting', form: f, type: :group = render_if_exists 'admin/namespace_plan', f: f diff --git a/app/views/admin/hooks/_form.html.haml b/app/views/admin/hooks/_form.html.haml index 17bb054b869..5bc5404fada 100644 --- a/app/views/admin/hooks/_form.html.haml +++ b/app/views/admin/hooks/_form.html.haml @@ -18,28 +18,28 @@ .gl-mt-3 = form.check_box :repository_update_events, class: 'float-left' - .prepend-left-20 + .gl-ml-6 = form.label :repository_update_events, class: 'list-label' do %strong Repository update events %p.light This URL will be triggered when repository is updated %li = form.check_box :push_events, class: 'float-left' - .prepend-left-20 + .gl-ml-6 = form.label :push_events, class: 'list-label' do %strong Push events %p.light This URL will be triggered for each branch updated to the repository %li = form.check_box :tag_push_events, class: 'float-left' - .prepend-left-20 + .gl-ml-6 = form.label :tag_push_events, class: 'list-label' do %strong Tag push events %p.light This URL will be triggered when a new tag is pushed to the repository %li = form.check_box :merge_requests_events, class: 'float-left' - .prepend-left-20 + .gl-ml-6 = form.label :merge_requests_events, class: 'list-label' do %strong Merge request events %p.light diff --git a/app/views/admin/labels/index.html.haml b/app/views/admin/labels/index.html.haml index 76d37626fff..f204e620e9d 100644 --- a/app/views/admin/labels/index.html.haml +++ b/app/views/admin/labels/index.html.haml @@ -1,7 +1,7 @@ - page_title _("Labels") %div - = link_to new_admin_label_path, class: "float-right btn gl-button btn-nr btn-success" do + = link_to new_admin_label_path, class: "float-right btn gl-button btn-success" do = _('New label') %h3.page-title = _('Labels') diff --git a/app/views/admin/runners/_sort_dropdown.html.haml b/app/views/admin/runners/_sort_dropdown.html.haml index 3b3de042511..c6627ae0f27 100644 --- a/app/views/admin/runners/_sort_dropdown.html.haml +++ b/app/views/admin/runners/_sort_dropdown.html.haml @@ -3,7 +3,7 @@ .dropdown.inline.gl-ml-3 %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } = sorted_by - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %li = sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date), sorted_by) diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index 2c4befb1be2..06925964dc5 100644 --- a/app/views/admin/runners/show.html.haml +++ b/app/views/admin/runners/show.html.haml @@ -9,7 +9,7 @@ %span.runner-state.runner-state-specific Specific -- page_title _("Runners") +- page_title @runner.short_sha - add_to_breadcrumbs _("Runners"), admin_runners_path - breadcrumb_title "##{@runner.id}" @@ -39,17 +39,18 @@ %thead %tr %th Assigned projects - %th - @runner.runner_projects.each do |runner_project| - project = runner_project.project - if project - %tr.alert-info + %tr %td - %strong - = project.full_name - %td - .float-right - = link_to 'Disable', admin_namespace_project_runner_project_path(project.namespace, project, runner_project), method: :delete, class: 'gl-button btn btn-danger btn-sm' + .gl-alert.gl-alert-danger + = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + .gl-alert-body + %strong + = project.full_name + .gl-alert-actions + = link_to s_('Disable'), admin_namespace_project_runner_project_path(project.namespace, project, runner_project), method: :delete, class: 'btn gl-alert-action btn-info btn-md gl-button' %table.table.unassigned-projects %thead diff --git a/app/views/admin/users/_approve_user.html.haml b/app/views/admin/users/_approve_user.html.haml index b4d960d909c..f61c9fa4b80 100644 --- a/app/views/admin/users/_approve_user.html.haml +++ b/app/views/admin/users/_approve_user.html.haml @@ -4,4 +4,4 @@ .card-body = render partial: 'admin/users/user_approve_effects' %br - = link_to s_('AdminUsers|Approve user'), approve_admin_user_path(user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?') } + = link_to s_('AdminUsers|Approve user'), approve_admin_user_path(user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?'), qa_selector: 'approve_user_button' } diff --git a/app/views/admin/users/_modals.html.haml b/app/views/admin/users/_modals.html.haml index e56bbd06575..f6e7cefafe7 100644 --- a/app/views/admin/users/_modals.html.haml +++ b/app/views/admin/users/_modals.html.haml @@ -1,10 +1,5 @@ -#user-modal -#modal-texts.hidden{ "hidden": true, "aria-hidden": true } - %div{ data: { modal: "deactivate", - title: s_("AdminUsers|Deactivate User %{username}?"), - action: s_("AdminUsers|Deactivate") } } - = render partial: 'admin/users/user_deactivation_effects' - +#js-delete-user-modal +#js-modal-texts.hidden{ "hidden": true, "aria-hidden": true } %div{ data: { modal: "delete", title: s_("AdminUsers|Delete User %{username}?"), action: s_('AdminUsers|Delete user'), diff --git a/app/views/admin/users/_reject_pending_user.html.haml b/app/views/admin/users/_reject_pending_user.html.haml new file mode 100644 index 00000000000..17108427330 --- /dev/null +++ b/app/views/admin/users/_reject_pending_user.html.haml @@ -0,0 +1,7 @@ +.card.border-danger + .card-header.bg-danger.gl-text-white + = s_('AdminUsers|This user has requested access') + .card-body + = render partial: 'admin/users/user_reject_effects' + %br + = link_to s_('AdminUsers|Reject request'), reject_admin_user_path(user), method: :delete, class: "btn gl-button btn-danger", data: { confirm: s_('AdminUsers|Are you sure?') } diff --git a/app/views/admin/users/_user.html.haml b/app/views/admin/users/_user.html.haml index 679c4805280..31fd3aea94d 100644 --- a/app/views/admin/users/_user.html.haml +++ b/app/views/admin/users/_user.html.haml @@ -37,26 +37,25 @@ - elsif user.blocked? - if user.blocked_pending_approval? = link_to s_('AdminUsers|Approve'), approve_admin_user_path(user), method: :put - %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_block_data(user, user_block_effects) } - = s_('AdminUsers|Block') + = link_to s_('AdminUsers|Reject'), reject_admin_user_path(user), method: :delete - else - = link_to _('Unblock'), unblock_admin_user_path(user), method: :put + %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_unblock_data(user) } + = s_('AdminUsers|Unblock') - else %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_block_data(user, user_block_effects) } = s_('AdminUsers|Block') - if user.can_be_deactivated? %li - %button.btn.btn-default-tertiary{ data: { 'gl-modal-action': 'deactivate', - url: deactivate_admin_user_path(user), - username: sanitize_name(user.name) } } + %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_deactivation_data(user, user_deactivation_effects) } = s_('AdminUsers|Deactivate') - elsif user.deactivated? %li - = link_to _('Activate'), activate_admin_user_path(user), method: :put + %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_activation_data(user) } + = s_('AdminUsers|Activate') - if user.access_locked? %li = link_to _('Unlock'), unlock_admin_user_path(user), method: :put, data: { confirm: _('Are you sure?') } - - if can?(current_user, :destroy_user, user) + - if can?(current_user, :destroy_user, user) && !user.blocked_pending_approval? %li.divider - if user.can_be_removed? %li diff --git a/app/views/admin/users/_user_deactivation_effects.html.haml b/app/views/admin/users/_user_deactivation_effects.html.haml deleted file mode 100644 index dc3896e18c0..00000000000 --- a/app/views/admin/users/_user_deactivation_effects.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%p - = s_('AdminUsers|Deactivating a user has the following effects:') -%ul - %li - = s_('AdminUsers|The user will be logged out') - %li - = s_('AdminUsers|The user will not be able to access git repositories') - %li - = s_('AdminUsers|The user will not be able to access the API') - %li - = s_('AdminUsers|The user will not receive any notifications') - %li - = s_('AdminUsers|The user will not be able to use slash commands') - %li - = s_('AdminUsers|When the user logs back in, their account will reactivate as a fully active account') - %li - = s_('AdminUsers|Personal projects, group and user history will be left intact') - = render_if_exists 'admin/users/user_deactivation_effects_on_seats' diff --git a/app/views/admin/users/_user_reject_effects.html.haml b/app/views/admin/users/_user_reject_effects.html.haml new file mode 100644 index 00000000000..17b6862b0cc --- /dev/null +++ b/app/views/admin/users/_user_reject_effects.html.haml @@ -0,0 +1,10 @@ +%p + = s_('AdminUsers|Rejected users:') +%ul + %li + = s_('AdminUsers|Cannot sign in or access instance information') + %li + = s_('AdminUsers|Will be deleted') +%p + - link_start = '<a href="%{url}">'.html_safe % { url: help_page_path("user/profile/account/delete_account", anchor: "associated-records") } + = s_('AdminUsers|For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 2e179d2d845..b86abb893a9 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -31,7 +31,7 @@ = s_('AdminUsers|Blocked') %small.badge.badge-pill= limited_counter_with_delimiter(User.blocked) = nav_link(html_options: { class: "#{active_when(params[:filter] == 'blocked_pending_approval')} filter-blocked-pending-approval" }) do - = link_to admin_users_path(filter: "blocked_pending_approval") do + = link_to admin_users_path(filter: "blocked_pending_approval"), data: { qa_selector: 'pending_approval_tab' } do = s_('AdminUsers|Pending approval') %small.badge.badge-pill= limited_counter_with_delimiter(User.blocked_pending_approval) = nav_link(html_options: { class: active_when(params[:filter] == 'deactivated') }) do @@ -69,7 +69,11 @@ = link_to admin_users_path(sort: value, filter: params[:filter], search_query: params[:search_query]) do = title -- if @users.empty? +- if Feature.enabled?(:vue_admin_users) + #js-admin-users-app{ data: admin_users_data_attributes(@users) } + .gl-spinner-container.gl-my-7 + %span.gl-vertical-align-bottom.gl-spinner.gl-spinner-dark.gl-spinner-lg{ aria: { label: _('Loading') } } +- elsif @users.empty? .nothing-here-block.border-top-0 = s_('AdminUsers|No users found') - else diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 9c6f151a6b1..26f78ea4d6a 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -42,7 +42,7 @@ = sprite_icon('close', size: 16, css_class: 'gl-icon') %li %span.light ID: - %strong + %strong{ data: { qa_selector: 'user_id_content' } } = @user.id %li %span.light= _('Namespace ID:') @@ -158,24 +158,21 @@ .card-body = render partial: 'admin/users/user_activation_effects' %br - = link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' } + %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_activation_data(@user) } + = s_('AdminUsers|Activate user') - elsif @user.can_be_deactivated? .card.border-warning .card-header.bg-warning.text-white Deactivate this user .card-body - = render partial: 'admin/users/user_deactivation_effects' + = user_deactivation_effects %br - %button.btn.gl-button.btn-warning{ data: { 'gl-modal-action': 'deactivate', - content: 'You can always re-activate their account, their data will remain intact.', - url: deactivate_admin_user_path(@user), - username: sanitize_name(@user.name) } } + %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_deactivation_data(@user, s_('AdminUsers|You can always re-activate their account, their data will remain intact.')) } = s_('AdminUsers|Deactivate user') - - if @user.blocked? - if @user.blocked_pending_approval? = render 'admin/users/approve_user', user: @user - = render 'admin/users/block_user', user: @user + = render 'admin/users/reject_pending_user', user: @user - else .card.border-info .card-header.gl-bg-blue-500.gl-text-white @@ -186,7 +183,8 @@ %li Log in %li Access Git repositories %br - = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?') } + %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_unblock_data(@user) } + = s_('AdminUsers|Unblock user') - elsif !@user.internal? = render 'admin/users/block_user', user: @user @@ -198,52 +196,52 @@ %p This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account. %br = link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' } - - .card.border-danger - .card-header.bg-danger.text-white - = s_('AdminUsers|Delete user') - .card-body - - if @user.can_be_removed? && can?(current_user, :destroy_user, @user) - %p Deleting a user has the following effects: - = render 'users/deletion_guidance', user: @user - %br - %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete', - delete_user_url: admin_user_path(@user), - block_user_url: block_admin_user_path(@user), - username: sanitize_name(@user.name) } } - = s_('AdminUsers|Delete user') - - else - - if @user.solo_owned_groups.present? - %p - This user is currently an owner in these groups: - %strong= @user.solo_owned_groups.map(&:name).join(', ') + - if !@user.blocked_pending_approval? + .card.border-danger + .card-header.bg-danger.text-white + = s_('AdminUsers|Delete user') + .card-body + - if @user.can_be_removed? && can?(current_user, :destroy_user, @user) + %p Deleting a user has the following effects: + = render 'users/deletion_guidance', user: @user + %br + %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete', + delete_user_url: admin_user_path(@user), + block_user_url: block_admin_user_path(@user), + username: sanitize_name(@user.name) } } + = s_('AdminUsers|Delete user') + - else + - if @user.solo_owned_groups.present? + %p + This user is currently an owner in these groups: + %strong= @user.solo_owned_groups.map(&:name).join(', ') + %p + You must transfer ownership or delete these groups before you can delete this user. + - else + %p + You don't have access to delete this user. + + .card.border-danger + .card-header.bg-danger.text-white + = s_('AdminUsers|Delete user and contributions') + .card-body + - if can?(current_user, :destroy_user, @user) %p - You must transfer ownership or delete these groups before you can delete this user. + This option deletes the user and any contributions that + would usually be moved to the + = succeed "." do + = link_to "system ghost user", help_page_path("user/profile/account/delete_account") + As well as the user's personal projects, groups owned solely by + the user, and projects in them, will also be removed. Commits + to other projects are unaffected. + %br + %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions', + delete_user_url: admin_user_path(@user, hard_delete: true), + block_user_url: block_admin_user_path(@user), + username: @user.name } } + = s_('AdminUsers|Delete user and contributions') - else %p You don't have access to delete this user. - .card.border-danger - .card-header.bg-danger.text-white - = s_('AdminUsers|Delete user and contributions') - .card-body - - if can?(current_user, :destroy_user, @user) - %p - This option deletes the user and any contributions that - would usually be moved to the - = succeed "." do - = link_to "system ghost user", help_page_path("user/profile/account/delete_account") - As well as the user's personal projects, groups owned solely by - the user, and projects in them, will also be removed. Commits - to other projects are unaffected. - %br - %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions', - delete_user_url: admin_user_path(@user, hard_delete: true), - block_user_url: block_admin_user_path(@user), - username: @user.name } } - = s_('AdminUsers|Delete user and contributions') - - else - %p - You don't have access to delete this user. - = render partial: 'admin/users/modals' |