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
a399f495
Commit
a399f495
authored
Apr 21, 2021
by
Simon Knox
Committed by
Heinrich Lee Yu
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add boilerplate for iteration cadences form
parent
be405a39
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
135 additions
and
0 deletions
+135
-0
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
...ascripts/iterations/components/iteration_cadence_form.vue
+3
-0
ee/app/assets/javascripts/iterations/index.js
ee/app/assets/javascripts/iterations/index.js
+25
-0
ee/app/assets/javascripts/pages/groups/iteration_cadences/index.js
...sets/javascripts/pages/groups/iteration_cadences/index.js
+3
-0
ee/app/controllers/groups/iteration_cadences_controller.rb
ee/app/controllers/groups/iteration_cadences_controller.rb
+34
-0
ee/app/views/groups/iteration_cadences/edit.html.haml
ee/app/views/groups/iteration_cadences/edit.html.haml
+7
-0
ee/app/views/groups/iteration_cadences/new.html.haml
ee/app/views/groups/iteration_cadences/new.html.haml
+5
-0
ee/config/routes/group.rb
ee/config/routes/group.rb
+2
-0
ee/spec/controllers/groups/iteration_cadences_controller_spec.rb
.../controllers/groups/iteration_cadences_controller_spec.rb
+47
-0
locale/gitlab.pot
locale/gitlab.pot
+9
-0
No files found.
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
0 → 100644
View file @
a399f495
<
template
>
<div></div>
</
template
>
ee/app/assets/javascripts/iterations/index.js
View file @
a399f495
...
...
@@ -2,6 +2,7 @@ import Vue from 'vue';
import
VueApollo
from
'
vue-apollo
'
;
import
createDefaultClient
from
'
~/lib/graphql
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
IterationCadenceForm
from
'
./components/iteration_cadence_form.vue
'
;
import
IterationForm
from
'
./components/iteration_form.vue
'
;
import
IterationReport
from
'
./components/iteration_report.vue
'
;
import
Iterations
from
'
./components/iterations.vue
'
;
...
...
@@ -89,3 +90,27 @@ export function initIterationReport({ namespaceType, initiallyEditing } = {}) {
},
});
}
export
function
initCadenceForm
()
{
const
el
=
document
.
querySelector
(
'
.js-iteration-cadence-form
'
);
if
(
!
el
)
{
return
null
;
}
const
{
groupFullPath
:
groupPath
,
cadenceId
,
cadenceListPath
}
=
el
;
return
new
Vue
({
el
,
apolloProvider
,
render
(
createElement
)
{
return
createElement
(
IterationCadenceForm
,
{
props
:
{
groupPath
,
cadenceId
,
cadenceListPath
,
},
});
},
});
}
ee/app/assets/javascripts/pages/groups/iteration_cadences/index.js
0 → 100644
View file @
a399f495
import
{
initCadenceForm
}
from
'
ee/iterations
'
;
initCadenceForm
();
ee/app/controllers/groups/iteration_cadences_controller.rb
0 → 100644
View file @
a399f495
# frozen_string_literal: true
class
Groups::IterationCadencesController
<
Groups
::
ApplicationController
before_action
:check_cadences_available!
before_action
:authorize_show_cadence!
,
only:
[
:index
]
before_action
:authorize_admin_cadence!
,
only:
[
:edit
]
before_action
:authorize_create_cadence!
,
only:
[
:new
]
feature_category
:issue_tracking
def
new
;
end
def
edit
;
end
def
index
;
end
private
def
check_cadences_available!
render_404
unless
group
.
iteration_cadences_feature_flag_enabled?
end
def
authorize_admin_cadence!
render_404
unless
can?
(
current_user
,
:admin_iteration_cadence
,
group
)
end
def
authorize_create_cadence!
render_404
unless
can?
(
current_user
,
:create_iteration_cadence
,
group
)
end
def
authorize_show_cadence!
render_404
unless
can?
(
current_user
,
:read_iteration_cadence
,
group
)
end
end
ee/app/views/groups/iteration_cadences/edit.html.haml
0 → 100644
View file @
a399f495
-
add_to_breadcrumbs
_
(
"Iteration cadences"
),
group_iteration_cadences_path
(
@group
)
-
breadcrumb_title
params
[
:id
]
-
page_title
_
(
"Edit iteration cadence"
)
.js-iteration-cadence-form
{
data:
{
group_full_path:
@group
.
full_path
,
cadence_id:
params
[
:id
],
cadences_list_path:
group_iteration_cadences_path
(
@group
)
}
}
ee/app/views/groups/iteration_cadences/new.html.haml
0 → 100644
View file @
a399f495
-
add_to_breadcrumbs
_
(
"Iteration cadences"
),
group_iteration_cadences_path
(
@group
)
-
breadcrumb_title
_
(
"New"
)
-
page_title
_
(
"New iteration cadence"
)
.js-iteration-cadence-form
{
data:
{
group_full_path:
@group
.
full_path
,
cadences_list_path:
group_iteration_cadences_path
(
@group
)
}
}
ee/config/routes/group.rb
View file @
a399f495
...
...
@@ -124,6 +124,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
resources
:iterations
,
only:
[
:index
,
:new
,
:edit
,
:show
],
constraints:
{
id:
/\d+/
}
resources
:iteration_cadences
,
only:
[
:index
,
:new
,
:edit
],
path:
'cadences'
,
constraints:
{
id:
/\d+/
}
resources
:issues
,
only:
[]
do
collection
do
post
:bulk_update
...
...
ee/spec/controllers/groups/iteration_cadences_controller_spec.rb
0 → 100644
View file @
a399f495
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Groups
::
IterationCadencesController
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:group
)
{
create
(
:group
,
:private
)
}
let_it_be
(
:cadence
)
{
create
(
:iterations_cadence
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
stub_feature_flags
(
iteration_cadences:
feature_flag_available
)
group
.
add_user
(
user
,
role
)
unless
role
==
:none
sign_in
(
user
)
end
describe
'new'
do
subject
{
get
:new
,
params:
{
group_id:
group
}
}
where
(
:feature_flag_available
,
:role
,
:status
)
do
false
|
:developer
|
:not_found
true
|
:none
|
:not_found
true
|
:guest
|
:not_found
true
|
:developer
|
:success
end
with_them
do
it_behaves_like
'returning response status'
,
params
[
:status
]
end
end
describe
'edit'
do
subject
{
get
:edit
,
params:
{
group_id:
group
,
id:
cadence
}
}
where
(
:feature_flag_available
,
:role
,
:status
)
do
false
|
:developer
|
:not_found
true
|
:none
|
:not_found
true
|
:guest
|
:not_found
true
|
:developer
|
:success
end
with_them
do
it_behaves_like
'returning response status'
,
params
[
:status
]
end
end
end
locale/gitlab.pot
View file @
a399f495
...
...
@@ -11636,6 +11636,9 @@ msgstr ""
msgid "Edit iteration"
msgstr ""
msgid "Edit iteration cadence"
msgstr ""
msgid "Edit public deploy key"
msgstr ""
...
...
@@ -17842,6 +17845,9 @@ msgstr ""
msgid "Iteration"
msgstr ""
msgid "Iteration cadences"
msgstr ""
msgid "Iteration changed to"
msgstr ""
...
...
@@ -21226,6 +21232,9 @@ msgstr ""
msgid "New iteration"
msgstr ""
msgid "New iteration cadence"
msgstr ""
msgid "New iteration created"
msgstr ""
...
...
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