Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
09f05997
Commit
09f05997
authored
Dec 18, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific code from ProjectsController
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
e515725c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
22 deletions
+16
-22
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+0
-8
ee/app/controllers/ee/projects_controller.rb
ee/app/controllers/ee/projects_controller.rb
+16
-14
No files found.
app/controllers/projects_controller.rb
View file @
09f05997
...
...
@@ -15,7 +15,6 @@ class ProjectsController < Projects::ApplicationController
before_action
:project
,
except:
[
:index
,
:new
,
:create
]
before_action
:repository
,
except:
[
:index
,
:new
,
:create
]
before_action
:assign_ref_vars
,
only:
[
:show
],
if: :repo_exists?
before_action
:assign_tree_vars
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
before_action
:tree
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
before_action
:lfs_blob_ids
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
before_action
:project_export_enabled
,
only:
[
:export
,
:download_export
,
:remove_export
,
:generate_new_export
]
...
...
@@ -411,13 +410,6 @@ class ProjectsController < Projects::ApplicationController
project
.
repository
.
root_ref
end
# ExtractsPath will set @id = project.path on the show route, but it has to be the
# branch name for the tree view to work correctly.
def
assign_tree_vars
@id
=
get_id
tree
end
def
project_view_files_allowed?
!
project
.
empty_repo?
&&
can?
(
current_user
,
:download_code
,
project
)
end
...
...
ee/app/controllers/ee/projects_controller.rb
View file @
09f05997
...
...
@@ -2,12 +2,28 @@
module
EE
module
ProjectsController
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
override
:project_params_attributes
def
project_params_attributes
super
+
project_params_ee
end
override
:custom_import_params
def
custom_import_params
custom_params
=
super
ci_cd_param
=
params
.
dig
(
:project
,
:ci_cd_only
)
||
params
[
:ci_cd_only
]
custom_params
[
:ci_cd_only
]
=
ci_cd_param
if
ci_cd_param
==
'true'
custom_params
end
override
:active_new_project_tab
def
active_new_project_tab
project_params
[
:ci_cd_only
]
==
'true'
?
'ci_cd_only'
:
super
end
private
def
project_params_ee
...
...
@@ -44,20 +60,6 @@ module EE
]
end
override
:custom_import_params
def
custom_import_params
custom_params
=
super
ci_cd_param
=
params
.
dig
(
:project
,
:ci_cd_only
)
||
params
[
:ci_cd_only
]
custom_params
[
:ci_cd_only
]
=
ci_cd_param
if
ci_cd_param
==
'true'
custom_params
end
override
:active_new_project_tab
def
active_new_project_tab
project_params
[
:ci_cd_only
]
==
'true'
?
'ci_cd_only'
:
super
end
def
allow_mirror_params?
if
@project
# rubocop:disable Gitlab/ModuleWithInstanceVariables
can?
(
current_user
,
:admin_mirror
,
@project
)
# rubocop:disable Gitlab/ModuleWithInstanceVariables
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment