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
90c10f4d
Commit
90c10f4d
authored
Mar 14, 2016
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
parents
c07ef544
8e7661c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
CHANGELOG
CHANGELOG
+1
-0
app/controllers/concerns/continue_params.rb
app/controllers/concerns/continue_params.rb
+13
-0
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+2
-11
app/controllers/projects/imports_controller.rb
app/controllers/projects/imports_controller.rb
+2
-10
spec/controllers/projects/imports_controller_spec.rb
spec/controllers/projects/imports_controller_spec.rb
+2
-2
No files found.
CHANGELOG
View file @
90c10f4d
...
@@ -30,6 +30,7 @@ v 8.6.0 (unreleased)
...
@@ -30,6 +30,7 @@ v 8.6.0 (unreleased)
- Add main language of a project in the list of projects (Tiago Botelho)
- Add main language of a project in the list of projects (Tiago Botelho)
- Add ability to show archived projects on dashboard, explore and group pages
- Add ability to show archived projects on dashboard, explore and group pages
- Move group activity to separate page
- Move group activity to separate page
- Continue parameters are checked to ensure redirection goes to the same instance
v 8.5.5
v 8.5.5
- Ensure removing a project removes associated Todo entries
- Ensure removing a project removes associated Todo entries
...
...
app/controllers/concerns/continue_params.rb
0 → 100644
View file @
90c10f4d
module
ContinueParams
extend
ActiveSupport
::
Concern
def
continue_params
continue_params
=
params
[
:continue
]
return
nil
unless
continue_params
continue_params
=
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
return
unless
continue_params
[
:to
]
&&
continue_params
[
:to
].
start_with?
(
'/'
)
continue_params
end
end
app/controllers/projects/forks_controller.rb
View file @
90c10f4d
class
Projects::ForksController
<
Projects
::
ApplicationController
class
Projects::ForksController
<
Projects
::
ApplicationController
include
ContinueParams
# Authorize
# Authorize
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_download_code!
...
@@ -53,15 +55,4 @@ class Projects::ForksController < Projects::ApplicationController
...
@@ -53,15 +55,4 @@ class Projects::ForksController < Projects::ApplicationController
render
:error
render
:error
end
end
end
end
private
def
continue_params
continue_params
=
params
[
:continue
]
if
continue_params
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
else
nil
end
end
end
end
app/controllers/projects/imports_controller.rb
View file @
90c10f4d
class
Projects::ImportsController
<
Projects
::
ApplicationController
class
Projects::ImportsController
<
Projects
::
ApplicationController
include
ContinueParams
# Authorize
# Authorize
before_action
:authorize_admin_project!
before_action
:authorize_admin_project!
before_action
:require_no_repo
,
only:
[
:new
,
:create
]
before_action
:require_no_repo
,
only:
[
:new
,
:create
]
...
@@ -44,16 +46,6 @@ class Projects::ImportsController < Projects::ApplicationController
...
@@ -44,16 +46,6 @@ class Projects::ImportsController < Projects::ApplicationController
private
private
def
continue_params
continue_params
=
params
[
:continue
]
if
continue_params
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
else
nil
end
end
def
finished_notice
def
finished_notice
if
@project
.
forked?
if
@project
.
forked?
'The project was successfully forked.'
'The project was successfully forked.'
...
...
spec/controllers/projects/imports_controller_spec.rb
View file @
90c10f4d
...
@@ -19,7 +19,7 @@ describe Projects::ImportsController do
...
@@ -19,7 +19,7 @@ describe Projects::ImportsController do
end
end
it
'sets flash.now if params is present'
do
it
'sets flash.now if params is present'
do
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
continue:
{
notice_now:
'Started'
}
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
continue:
{
to:
'/'
,
notice_now:
'Started'
}
expect
(
flash
.
now
[
:notice
]).
to
eq
'Started'
expect
(
flash
.
now
[
:notice
]).
to
eq
'Started'
end
end
...
@@ -45,7 +45,7 @@ describe Projects::ImportsController do
...
@@ -45,7 +45,7 @@ describe Projects::ImportsController do
end
end
it
'sets flash.now if params is present'
do
it
'sets flash.now if params is present'
do
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
continue:
{
notice_now:
'In progress'
}
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
continue:
{
to:
'/'
,
notice_now:
'In progress'
}
expect
(
flash
.
now
[
:notice
]).
to
eq
'In progress'
expect
(
flash
.
now
[
:notice
]).
to
eq
'In progress'
end
end
...
...
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