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
7cf25997
Commit
7cf25997
authored
Jun 19, 2020
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add route and action for new releases form
parent
2f06dde1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
1 deletion
+17
-1
app/controllers/projects/releases_controller.rb
app/controllers/projects/releases_controller.rb
+1
-0
app/views/projects/releases/new.html.haml
app/views/projects/releases/new.html.haml
+1
-0
config/routes/project.rb
config/routes/project.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/controllers/projects/releases_controller_spec.rb
spec/controllers/projects/releases_controller_spec.rb
+11
-0
No files found.
app/controllers/projects/releases_controller.rb
View file @
7cf25997
...
@@ -13,6 +13,7 @@ class Projects::ReleasesController < Projects::ApplicationController
...
@@ -13,6 +13,7 @@ class Projects::ReleasesController < Projects::ApplicationController
push_frontend_feature_flag
(
:release_asset_link_type
,
project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:release_asset_link_type
,
project
,
default_enabled:
true
)
end
end
before_action
:authorize_update_release!
,
only:
%i[edit update]
before_action
:authorize_update_release!
,
only:
%i[edit update]
before_action
:authorize_create_release!
,
only: :new
def
index
def
index
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/views/projects/releases/new.html.haml
0 → 100644
View file @
7cf25997
-
page_title
s_
(
'Releases|New Release'
)
config/routes/project.rb
View file @
7cf25997
...
@@ -181,7 +181,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
...
@@ -181,7 +181,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
end
end
resources
:releases
,
only:
[
:index
,
:show
,
:edit
],
param: :tag
,
constraints:
{
tag:
%r{[^/]+}
}
do
resources
:releases
,
only:
[
:index
,
:
new
,
:
show
,
:edit
],
param: :tag
,
constraints:
{
tag:
%r{[^/]+}
}
do
member
do
member
do
get
:downloads
,
path:
'downloads/*filepath'
,
format:
false
get
:downloads
,
path:
'downloads/*filepath'
,
format:
false
scope
module: :releases
do
scope
module: :releases
do
...
...
locale/gitlab.pot
View file @
7cf25997
...
@@ -18749,6 +18749,9 @@ msgstr ""
...
@@ -18749,6 +18749,9 @@ msgstr ""
msgid "Releases documentation"
msgid "Releases documentation"
msgstr ""
msgstr ""
msgid "Releases|New Release"
msgstr ""
msgid "Release|Something went wrong while getting the release details"
msgid "Release|Something went wrong while getting the release details"
msgstr ""
msgstr ""
...
...
spec/controllers/projects/releases_controller_spec.rb
View file @
7cf25997
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Projects
::
ReleasesController
do
RSpec
.
describe
Projects
::
ReleasesController
do
include
AccessMatchersForController
let!
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
...
@@ -118,6 +120,15 @@ RSpec.describe Projects::ReleasesController do
...
@@ -118,6 +120,15 @@ RSpec.describe Projects::ReleasesController do
end
end
end
end
describe
'GET #new'
do
let
(
:request
)
do
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
end
it
{
expect
{
request
}.
to
be_denied_for
(
:reporter
).
of
(
project
)
}
it
{
expect
{
request
}.
to
be_allowed_for
(
:developer
).
of
(
project
)
}
end
describe
'GET #edit'
do
describe
'GET #edit'
do
subject
do
subject
do
get
:edit
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
tag:
tag
}
get
:edit
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
tag:
tag
}
...
...
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