summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-10 09:09:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-10 09:09:54 +0000
commit895ab10efae5b66a3bc96955f33059ca5979825b (patch)
treefb75a761a5def87d40de95c5db323e56231b4790 /app
parent146abb4a88819f3625f1e42fb165bef63cb4eafb (diff)
downloadgitlab-ce-895ab10efae5b66a3bc96955f33059ca5979825b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/components/related_items_list.scss1
-rw-r--r--app/services/users/refresh_authorized_projects_service.rb17
-rw-r--r--app/views/admin/application_settings/_initial_branch_name.html.haml4
-rw-r--r--app/views/admin/application_settings/_repository_check.html.haml8
-rw-r--r--app/views/admin/application_settings/_repository_mirrors_form.html.haml3
-rw-r--r--app/views/admin/application_settings/_repository_static_objects.html.haml3
-rw-r--r--app/views/admin/application_settings/_repository_storage.html.haml4
-rw-r--r--app/views/projects/cleanup/_show.html.haml4
-rw-r--r--app/views/projects/default_branch/_show.html.haml3
-rw-r--r--app/views/projects/mirrors/_mirror_repos.html.haml2
-rw-r--r--app/views/projects/protected_tags/shared/_create_protected_tag.html.haml4
-rw-r--r--app/views/shared/deploy_keys/_project_group_form.html.haml4
-rw-r--r--app/views/shared/deploy_tokens/_form.html.haml2
13 files changed, 42 insertions, 17 deletions
diff --git a/app/assets/stylesheets/components/related_items_list.scss b/app/assets/stylesheets/components/related_items_list.scss
index 499aa6440da..39701b74fee 100644
--- a/app/assets/stylesheets/components/related_items_list.scss
+++ b/app/assets/stylesheets/components/related_items_list.scss
@@ -213,6 +213,7 @@ $item-remove-button-space: 42px;
margin-right: $gl-padding-4 / 2;
line-height: 0;
border-color: transparent;
+ background-color: transparent;
color: $gl-text-color-secondary;
.related-items-tree & {
diff --git a/app/services/users/refresh_authorized_projects_service.rb b/app/services/users/refresh_authorized_projects_service.rb
index 621266f00e1..d0939d5a542 100644
--- a/app/services/users/refresh_authorized_projects_service.rb
+++ b/app/services/users/refresh_authorized_projects_service.rb
@@ -53,7 +53,13 @@ module Users
current = current_authorizations_per_project
fresh = fresh_access_levels_per_project
- remove = current.each_with_object([]) do |(project_id, row), array|
+ # Delete projects that have more than one authorizations associated with
+ # the user. The correct authorization is added to the ``add`` array in the
+ # next stage.
+ remove = projects_with_duplicates
+ current.except!(*projects_with_duplicates)
+
+ remove |= current.each_with_object([]) do |(project_id, row), array|
# rows not in the new list or with a different access level should be
# removed.
if !fresh[project_id] || fresh[project_id] != row.access_level
@@ -106,7 +112,7 @@ module Users
end
def current_authorizations
- user.project_authorizations.select(:project_id, :access_level)
+ @current_authorizations ||= user.project_authorizations.select(:project_id, :access_level)
end
def fresh_authorizations
@@ -116,5 +122,12 @@ module Users
private
attr_reader :incorrect_auth_found_callback, :missing_auth_found_callback
+
+ def projects_with_duplicates
+ @projects_with_duplicates ||= current_authorizations
+ .group_by(&:project_id)
+ .select { |project_id, authorizations| authorizations.count > 1 }
+ .keys
+ end
end
end
diff --git a/app/views/admin/application_settings/_initial_branch_name.html.haml b/app/views/admin/application_settings/_initial_branch_name.html.haml
index e76374e88a8..acbf971e4b9 100644
--- a/app/views/admin/application_settings/_initial_branch_name.html.haml
+++ b/app/views/admin/application_settings/_initial_branch_name.html.haml
@@ -9,4 +9,6 @@
= f.text_field :default_branch_name, placeholder: 'master', class: 'form-control'
%span.form-text.text-muted
= (_("Changes affect new repositories only. If not specified, Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name } ).html_safe
- = f.submit _('Save changes'), class: 'gl-button btn-success'
+
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: 'gl-button btn-success'
diff --git a/app/views/admin/application_settings/_repository_check.html.haml b/app/views/admin/application_settings/_repository_check.html.haml
index 417916d8c25..6f9d3a889cd 100644
--- a/app/views/admin/application_settings/_repository_check.html.haml
+++ b/app/views/admin/application_settings/_repository_check.html.haml
@@ -14,9 +14,12 @@
%a{ href: 'https://git-scm.com/docs/git-fsck', target: 'blank' } 'git fsck'
in all project and wiki repositories to look for silent disk corruption issues.
.form-group
- = link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
.form-text.text-muted
If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database.
+ - clear_repository_checks_link = _('Clear all repository checks')
+ - clear_repository_checks_message = _('This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?')
+ .gl-display-flex.gl-justify-content-end
+ = link_to clear_repository_checks_link, clear_repository_check_states_admin_application_settings_path, data: { confirm: clear_repository_checks_message }, method: :put, class: "btn btn-sm btn-remove"
.sub-section
%h4 Housekeeping
@@ -53,4 +56,5 @@
.form-text.text-muted
Number of Git pushes after which 'git gc' is run.
- = f.submit 'Save changes', class: "btn btn-success"
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: "btn btn-success"
diff --git a/app/views/admin/application_settings/_repository_mirrors_form.html.haml b/app/views/admin/application_settings/_repository_mirrors_form.html.haml
index 8ec9b3c528a..3b1d1eceb9c 100644
--- a/app/views/admin/application_settings/_repository_mirrors_form.html.haml
+++ b/app/views/admin/application_settings/_repository_mirrors_form.html.haml
@@ -14,4 +14,5 @@
= render_if_exists 'admin/application_settings/mirror_settings', form: f
- = f.submit _('Save changes'), class: "btn btn-success"
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: "btn btn-success"
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 03aa48b2282..9bc751adc8b 100644
--- a/app/views/admin/application_settings/_repository_static_objects.html.haml
+++ b/app/views/admin/application_settings/_repository_static_objects.html.haml
@@ -15,4 +15,5 @@
%span.form-text.text-muted#static_objects_external_storage_auth_token_help_block
= _('A secure token that identifies an external storage request.')
- = f.submit _('Save changes'), class: "btn btn-success"
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: "btn btn-success"
diff --git a/app/views/admin/application_settings/_repository_storage.html.haml b/app/views/admin/application_settings/_repository_storage.html.haml
index ecae720cd49..ee55529621b 100644
--- a/app/views/admin/application_settings/_repository_storage.html.haml
+++ b/app/views/admin/application_settings/_repository_storage.html.haml
@@ -22,5 +22,5 @@
= f.text_field attribute[:name], class: 'form-text-input', value: attribute[:value]
= f.label attribute[:label], attribute[:label], class: 'label-bold form-check-label'
%br
-
- = f.submit _('Save changes'), class: "btn btn-success qa-save-changes-button"
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: "btn btn-success qa-save-changes-button"
diff --git a/app/views/projects/cleanup/_show.html.haml b/app/views/projects/cleanup/_show.html.haml
index 0ebca588002..f560127fefd 100644
--- a/app/views/projects/cleanup/_show.html.haml
+++ b/app/views/projects/cleanup/_show.html.haml
@@ -25,5 +25,7 @@
= f.file_field :bfg_object_map, class: "hidden js-object-map-input", required: true
.form-text.text-muted
= _("The maximum file size allowed is %{size}.") % { size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes) }
- = f.submit _('Start cleanup'), class: 'btn btn-success'
+
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Start cleanup'), class: 'btn btn-success'
diff --git a/app/views/projects/default_branch/_show.html.haml b/app/views/projects/default_branch/_show.html.haml
index f6693f7cc52..b78535bbe2f 100644
--- a/app/views/projects/default_branch/_show.html.haml
+++ b/app/views/projects/default_branch/_show.html.haml
@@ -28,4 +28,5 @@
= _("Issues referenced by merge requests and commits within the default branch will be closed automatically")
= link_to icon('question-circle'), help_page_path('user/project/issues/managing_issues.md', anchor: 'disabling-automatic-issue-closing'), target: '_blank'
- = f.submit 'Save changes', class: "btn btn-success"
+ .gl-display-flex.gl-justify-content-end
+ = f.submit _('Save changes'), class: "btn btn-success"
diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml
index 5c67d3d4373..e0ed85dcad7 100644
--- a/app/views/projects/mirrors/_mirror_repos.html.haml
+++ b/app/views/projects/mirrors/_mirror_repos.html.haml
@@ -32,7 +32,7 @@
= label_tag :only_protected_branches, _('Only mirror protected branches'), class: 'form-check-label'
= link_to icon('question-circle'), help_page_path('user/project/protected_branches'), target: '_blank'
- .panel-footer
+ .panel-footer.gl-display-flex.gl-justify-content-end
= f.submit _('Mirror repository'), class: 'btn btn-success js-mirror-submit qa-mirror-repository-button', name: :update_remote_mirror
- else
.gl-alert.gl-alert-info{ role: 'alert' }
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 b5005b7d3b5..dc7514badb6 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
@@ -24,5 +24,5 @@
.create_access_levels-container
= yield :create_access_levels
- .card-footer
- = f.submit 'Protect', class: 'btn-success btn', disabled: true, data: { qa_selector: 'protect_tag_button' }
+ .card-footer.gl-display-flex.gl-justify-content-end
+ = f.submit _('Protect'), class: 'btn-success btn', disabled: true, data: { qa_selector: 'protect_tag_button' }
diff --git a/app/views/shared/deploy_keys/_project_group_form.html.haml b/app/views/shared/deploy_keys/_project_group_form.html.haml
index a5694fce0fa..815967b0372 100644
--- a/app/views/shared/deploy_keys/_project_group_form.html.haml
+++ b/app/views/shared/deploy_keys/_project_group_form.html.haml
@@ -20,5 +20,5 @@
%p.light.gl-mb-0
= _('Allow this key to push to repository as well? (Default only allows pull access.)')
- .form-group.row
- = f.submit "Add key", class: "btn-success btn"
+ .form-group.row.gl-display-flex.gl-justify-content-end
+ = f.submit _("Add key"), class: "btn-success btn"
diff --git a/app/views/shared/deploy_tokens/_form.html.haml b/app/views/shared/deploy_tokens/_form.html.haml
index 8d74e12e943..1eda439c9a5 100644
--- a/app/views/shared/deploy_tokens/_form.html.haml
+++ b/app/views/shared/deploy_tokens/_form.html.haml
@@ -45,5 +45,5 @@
= label_tag ("deploy_token_write_package_registry"), 'write_package_registry', class: 'label-bold form-check-label'
.text-secondary= s_('DeployTokens|Allows write access to the package registry')
- .gl-mt-3
+ .gl-mt-3.gl-display-flex.gl-justify-content-end
= f.submit s_('DeployTokens|Create deploy token'), class: 'btn btn-success qa-create-deploy-token'