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
43893175
Commit
43893175
authored
Jul 09, 2021
by
Simon Knox
Committed by
Kushal Pandya
Jul 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix query to create iteration in cadence
parent
5226c013
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
17 deletions
+77
-17
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
...ascripts/iterations/components/iteration_cadence_form.vue
+4
-3
ee/app/assets/javascripts/iterations/components/iteration_cadence_list_item.vue
...pts/iterations/components/iteration_cadence_list_item.vue
+6
-1
ee/app/assets/javascripts/iterations/components/iteration_cadences_list.vue
...scripts/iterations/components/iteration_cadences_list.vue
+1
-0
ee/app/assets/javascripts/iterations/components/iteration_form.vue
...sets/javascripts/iterations/components/iteration_form.vue
+4
-2
ee/app/assets/javascripts/iterations/queries/iteration_cadences_list.query.graphql
.../iterations/queries/iteration_cadences_list.query.graphql
+1
-0
ee/app/assets/javascripts/iterations/queries/iteration_create.mutation.graphql
...ipts/iterations/queries/iteration_create.mutation.graphql
+1
-0
ee/spec/features/groups/iterations/user_creates_iteration_in_cadence_spec.rb
...oups/iterations/user_creates_iteration_in_cadence_spec.rb
+42
-0
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
...tend/iterations/components/iteration_cadence_form_spec.js
+7
-5
ee/spec/frontend/iterations/components/iteration_cadences_list_spec.js
...end/iterations/components/iteration_cadences_list_spec.js
+3
-0
ee/spec/frontend/iterations/components/iteration_form_spec.js
...pec/frontend/iterations/components/iteration_form_spec.js
+8
-6
No files found.
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
View file @
43893175
...
...
@@ -200,7 +200,7 @@ export default {
if
(
this
.
automatic
)
{
return
true
;
}
const
requiredFieldsForAutomatedScheduling
=
[
'
iterationsInAdvance
'
];
const
requiredFieldsForAutomatedScheduling
=
[
'
iterationsInAdvance
'
,
'
durationInWeeks
'
];
return
!
requiredFieldsForAutomatedScheduling
.
includes
(
field
);
})
.
forEach
((
field
)
=>
{
...
...
@@ -216,6 +216,7 @@ export default {
this
.
clearValidation
();
if
(
!
value
)
{
this
.
iterationsInAdvance
=
0
;
this
.
durationInWeeks
=
0
;
}
},
save
()
{
...
...
@@ -353,9 +354,9 @@ export default {
v-model.number=
"durationInWeeks"
:options=
"$options.availableDurations"
class=
"gl-form-input-md"
required
:required=
"automatic"
data-qa-selector=
"iteration_cadence_name_field"
:disabled=
"loadingCadence"
:disabled=
"loadingCadence
|| !automatic
"
@
change=
"validate('durationInWeeks')"
/>
</gl-form-group>
...
...
ee/app/assets/javascripts/iterations/components/iteration_cadence_list_item.vue
View file @
43893175
...
...
@@ -62,6 +62,11 @@ export default {
type
:
String
,
required
:
true
,
},
automatic
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
durationInWeeks
:
{
type
:
Number
,
required
:
false
,
...
...
@@ -212,7 +217,7 @@ export default {
text-sr-only
no-caret
>
<gl-dropdown-item
v-if=
"!
durationInWeeks
"
:to=
"newIteration"
>
<gl-dropdown-item
v-if=
"!
automatic
"
:to=
"newIteration"
>
{{
s__
(
'
Iterations|Add iteration
'
)
}}
</gl-dropdown-item>
...
...
ee/app/assets/javascripts/iterations/components/iteration_cadences_list.vue
View file @
43893175
...
...
@@ -156,6 +156,7 @@ export default {
:key=
"cadence.id"
:cadence-id=
"cadence.id"
:duration-in-weeks=
"cadence.durationInWeeks"
:automatic=
"cadence.automatic"
:title=
"cadence.title"
:iteration-state=
"state"
@
delete-cadence=
"deleteCadence"
...
...
ee/app/assets/javascripts/iterations/components/iteration_form.vue
View file @
43893175
...
...
@@ -99,9 +99,11 @@ export default {
.
mutate
({
mutation
:
createIteration
,
variables
:
{
input
:
{
...
this
.
variables
,
iterationsCadenceId
:
convertToGraphQLId
(
'
Iterations::Cadence
'
,
this
.
cadenceId
),
},
},
})
.
then
(({
data
})
=>
{
const
{
iteration
,
errors
}
=
data
.
iterationCreate
;
...
...
ee/app/assets/javascripts/iterations/queries/iteration_cadences_list.query.graphql
View file @
43893175
...
...
@@ -19,6 +19,7 @@ query IterationCadences(
id
title
durationInWeeks
automatic
}
pageInfo
{
...
PageInfo
...
...
ee/app/assets/javascripts/iterations/queries/iteration_create.mutation.graphql
View file @
43893175
mutation
createIteration
(
$input
:
iterationCreateInput
!)
{
iterationCreate
(
input
:
$input
)
{
iteration
{
id
title
description
descriptionHtml
...
...
ee/spec/features/groups/iterations/user_creates_iteration_in_cadence_spec.rb
0 → 100644
View file @
43893175
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'User creates iteration in a cadence'
,
:js
do
let_it_be
(
:now
)
{
Time
.
now
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:group_member
,
:maintainer
,
user:
create
(
:user
),
group:
group
).
user
}
let_it_be
(
:cadence
)
{
create
(
:iterations_cadence
,
group:
group
,
automatic:
false
,
duration_in_weeks:
0
)
}
before
do
stub_licensed_features
(
iterations:
true
)
sign_in
(
user
)
visit
new_group_iteration_cadence_iteration_path
(
group
,
iteration_cadence_id:
cadence
.
id
)
end
it
'prefills fields and allows updating all values'
do
title
=
'Iteration title'
desc
=
'Iteration desc'
start_date
=
now
+
4
.
days
due_date
=
now
+
5
.
days
fill_in
(
'Title'
,
with:
title
)
fill_in
(
'Description'
,
with:
desc
)
fill_in
(
'Start date'
,
with:
start_date
.
strftime
(
'%Y-%m-%d'
))
fill_in
(
'Due date'
,
with:
due_date
.
strftime
(
'%Y-%m-%d'
))
click_button
(
'Create iteration'
)
wait_for_requests
iteration
=
Iteration
.
last
aggregate_failures
do
expect
(
page
).
to
have_content
(
title
)
expect
(
page
).
to
have_content
(
desc
)
expect
(
page
).
to
have_content
(
start_date
.
strftime
(
'%b %-d, %Y'
))
expect
(
page
).
to
have_content
(
due_date
.
strftime
(
'%b %-d, %Y'
))
expect
(
page
).
to
have_current_path
(
group_iteration_cadence_iteration_path
(
group
,
iteration_cadence_id:
cadence
.
id
,
id:
iteration
.
id
))
end
end
end
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
View file @
43893175
...
...
@@ -193,20 +193,23 @@ describe('Iteration cadence form', () => {
});
describe
(
'
automated scheduling disabled
'
,
()
=>
{
it
(
'
disables future iterations
'
,
async
()
=>
{
it
(
'
disables future iterations
and duration in weeks
'
,
async
()
=>
{
setAutomaticValue
(
false
);
await
nextTick
();
expect
(
findFutureIterations
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findFutureIterations
().
attributes
(
'
required
'
)).
toBeUndefined
();
expect
(
findDuration
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findDuration
().
attributes
(
'
required
'
)).
toBeUndefined
();
});
it
(
'
sets future iterations to 0
'
,
async
()
=>
{
it
(
'
sets future iterations
and cadence duration
to 0
'
,
async
()
=>
{
const
title
=
'
Iteration 5
'
;
const
startDate
=
'
2020-05-05
'
;
const
durationInWeeks
=
2
;
setFutureIterations
(
10
);
setDuration
(
2
);
setAutomaticValue
(
false
);
...
...
@@ -214,7 +217,6 @@ describe('Iteration cadence form', () => {
setTitle
(
title
);
setStartDate
(
startDate
);
setDuration
(
durationInWeeks
);
clickSave
();
...
...
@@ -224,7 +226,7 @@ describe('Iteration cadence form', () => {
title
,
automatic
:
false
,
startDate
,
durationInWeeks
,
durationInWeeks
:
0
,
iterationsInAdvance
:
0
,
description
:
''
,
active
:
true
,
...
...
ee/spec/frontend/iterations/components/iteration_cadences_list_spec.js
View file @
43893175
...
...
@@ -34,16 +34,19 @@ describe('Iteration cadences list', () => {
id
:
'
gid://gitlab/Iterations::Cadence/561
'
,
title
:
'
A eligendi molestias temporibus maiores architecto ut facilis autem.
'
,
durationInWeeks
:
3
,
automatic
:
true
,
},
{
id
:
'
gid://gitlab/Iterations::Cadence/392
'
,
title
:
'
A quam repellat omnis eum veritatis voluptas voluptatem consequuntur est.
'
,
durationInWeeks
:
4
,
automatic
:
true
,
},
{
id
:
'
gid://gitlab/Iterations::Cadence/152
'
,
title
:
'
A repudiandae ut eligendi quae et ducimus porro nam sint perferendis.
'
,
durationInWeeks
:
1
,
automatic
:
true
,
},
];
...
...
ee/spec/frontend/iterations/components/iteration_form_spec.js
View file @
43893175
...
...
@@ -120,12 +120,14 @@ describe('Iteration Form', () => {
await
clickSave
();
expect
(
resolverMock
).
toHaveBeenCalledWith
({
input
:
{
groupPath
,
title
,
description
,
iterationsCadenceId
:
convertToGraphQLId
(
'
Iterations::Cadence
'
,
cadenceId
),
startDate
,
dueDate
,
},
});
});
...
...
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