From ec60358d52be0dc99f52db94dc95209f1486eac9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 1 Oct 2019 03:05:57 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/ide/.eslintrc.yml | 3 +++ app/models/lfs_object.rb | 8 +++++++- app/views/admin/labels/destroy.js.haml | 4 ++-- app/views/admin/labels/index.html.haml | 4 +--- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/ide/.eslintrc.yml (limited to 'app') diff --git a/app/assets/javascripts/ide/.eslintrc.yml b/app/assets/javascripts/ide/.eslintrc.yml new file mode 100644 index 00000000000..92b96d717be --- /dev/null +++ b/app/assets/javascripts/ide/.eslintrc.yml @@ -0,0 +1,3 @@ +rules: + # https://gitlab.com/gitlab-org/gitlab/issues/33024 + promise/no-nesting: off diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index f73aa2705b7..d31d6226559 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -24,7 +24,13 @@ class LfsObject < ApplicationRecord end def project_allowed_access?(project) - projects.exists?(project.lfs_storage_project.id) + if project.fork_network_member + lfs_objects_projects + .where("EXISTS(?)", project.fork_network.fork_network_members.select(1).where("fork_network_members.project_id = lfs_objects_projects.project_id")) + .exists? + else + lfs_objects_projects.where(project_id: project.id).exists? + end end def local_store? diff --git a/app/views/admin/labels/destroy.js.haml b/app/views/admin/labels/destroy.js.haml index 7a0dcbdd1c6..394d3c11f31 100644 --- a/app/views/admin/labels/destroy.js.haml +++ b/app/views/admin/labels/destroy.js.haml @@ -1,2 +1,2 @@ -- if @labels.size == 0 - $('.labels').load(document.URL + ' .card.bg-light').hide().fadeIn(1000) +- if @labels.size.zero? + $('.labels').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000) diff --git a/app/views/admin/labels/index.html.haml b/app/views/admin/labels/index.html.haml index 5a5b3d18c5f..38137f360fd 100644 --- a/app/views/admin/labels/index.html.haml +++ b/app/views/admin/labels/index.html.haml @@ -14,6 +14,4 @@ = paginate @labels, theme: 'gitlab' - else - .card.bg-light - .nothing-here-block= _('There are no labels yet') - + .nothing-here-block= _('There are no labels yet') -- cgit v1.2.3