diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 00:09:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 00:09:12 +0000 |
commit | 0b881f91159cc97ccb7328a2e52977a60ea83fbe (patch) | |
tree | d6b683cb935112aee47121f46e3c5dc84de24f2c /app | |
parent | 7671216b60e2796a050358ff808b4a0c2de3d22f (diff) | |
download | gitlab-ce-0b881f91159cc97ccb7328a2e52977a60ea83fbe.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
4 files changed, 12 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue index 574b63cf8a6..69fb2bb4524 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue @@ -1,5 +1,10 @@ <script> +import { GlLoadingIcon } from '@gitlab/ui'; + export default { + components: { + GlLoadingIcon, + }, props: { canEdit: { type: Boolean, @@ -13,7 +18,7 @@ export default { <div class="title hide-collapsed append-bottom-10"> {{ __('Labels') }} <template v-if="canEdit"> - <i aria-hidden="true" class="fa fa-spinner fa-spin block-loading" data-hidden="true"> </i> + <gl-loading-icon inline class="align-text-top block-loading" /> <button type="button" class="edit-link btn btn-blank float-right js-sidebar-dropdown-toggle" diff --git a/app/models/releases/link.rb b/app/models/releases/link.rb index 58c2b98e524..65be2a22958 100644 --- a/app/models/releases/link.rb +++ b/app/models/releases/link.rb @@ -6,8 +6,11 @@ module Releases belongs_to :release + FILEPATH_REGEX = /\A\/([\-\.\w]+\/?)*[\da-zA-Z]+\z/.freeze + validates :url, presence: true, addressable_url: { schemes: %w(http https ftp) }, uniqueness: { scope: :release } validates :name, presence: true, uniqueness: { scope: :release } + validates :filepath, uniqueness: { scope: :release }, format: { with: FILEPATH_REGEX }, allow_blank: true, length: { maximum: 128 } scope :sorted, -> { order(created_at: :desc) } diff --git a/app/policies/project_snippet_policy.rb b/app/policies/project_snippet_policy.rb index a38d9154102..869f4716298 100644 --- a/app/policies/project_snippet_policy.rb +++ b/app/policies/project_snippet_policy.rb @@ -31,7 +31,7 @@ class ProjectSnippetPolicy < BasePolicy ~can?(:read_all_resources)) end.prevent :read_snippet - rule { internal_snippet & ~is_author & ~admin }.policy do + rule { internal_snippet & ~is_author & ~admin & ~project.maintainer }.policy do prevent :update_snippet prevent :admin_snippet end @@ -42,7 +42,7 @@ class ProjectSnippetPolicy < BasePolicy prevent :admin_snippet end - rule { is_author | admin }.policy do + rule { is_author | admin | project.maintainer }.policy do enable :read_snippet enable :update_snippet enable :admin_snippet diff --git a/app/views/projects/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml index 548977d6a80..55c702b967f 100644 --- a/app/views/projects/runners/_runner.html.haml +++ b/app/views/projects/runners/_runner.html.haml @@ -3,7 +3,7 @@ = runner_status_icon(runner) - if @project_runners.include?(runner) - = link_to runner.short_sha, project_runner_path(@project, runner), class: 'commit-sha' + = link_to runner.short_sha.concat("..."), project_runner_path(@project, runner), class: 'commit-sha has-tooltip', title: _("Partial token for reference only") - if runner.locked? = icon('lock', class: 'has-tooltip', title: _('Locked to current projects')) |