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
143a5c6d
Commit
143a5c6d
authored
Nov 03, 2021
by
Simon Knox
Committed by
Vitaly Slobodin
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Start iteration button to manual cadences
parent
8f92de9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
29 deletions
+92
-29
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
...ascripts/iterations/components/iteration_cadence_form.vue
+57
-22
ee/spec/features/boards/scoped_issue_board_spec.rb
ee/spec/features/boards/scoped_issue_board_spec.rb
+1
-0
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
...tend/iterations/components/iteration_cadence_form_spec.js
+25
-4
locale/gitlab.pot
locale/gitlab.pot
+9
-3
No files found.
ee/app/assets/javascripts/iterations/components/iteration_cadence_form.vue
View file @
143a5c6d
...
@@ -56,6 +56,7 @@ const i18n = Object.freeze({
...
@@ -56,6 +56,7 @@ const i18n = Object.freeze({
title
:
s__
(
'
Iterations|New iteration cadence
'
),
title
:
s__
(
'
Iterations|New iteration cadence
'
),
save
:
s__
(
'
Iterations|Create cadence
'
),
save
:
s__
(
'
Iterations|Create cadence
'
),
},
},
createAndStartIteration
:
s__
(
'
Iterations|Create cadence and start iteration
'
),
cancel
:
__
(
'
Cancel
'
),
cancel
:
__
(
'
Cancel
'
),
requiredField
:
__
(
'
This field is required.
'
),
requiredField
:
__
(
'
This field is required.
'
),
});
});
...
@@ -123,6 +124,9 @@ export default {
...
@@ -123,6 +124,9 @@ export default {
page
()
{
page
()
{
return
this
.
isEdit
?
'
edit
'
:
'
new
'
;
return
this
.
isEdit
?
'
edit
'
:
'
new
'
;
},
},
showStartIteration
()
{
return
!
this
.
isEdit
&&
!
this
.
automatic
;
},
mutation
()
{
mutation
()
{
return
this
.
isEdit
?
updateCadence
:
createCadence
;
return
this
.
isEdit
?
updateCadence
:
createCadence
;
},
},
...
@@ -222,20 +226,49 @@ export default {
...
@@ -222,20 +226,49 @@ export default {
this
.
durationInWeeks
=
0
;
this
.
durationInWeeks
=
0
;
}
}
},
},
saveAndCreateIteration
()
{
return
this
.
save
()
.
then
((
cadenceId
)
=>
{
this
.
$router
.
push
({
name
:
'
newIteration
'
,
params
:
{
cadenceId
}
});
})
.
catch
((
error
)
=>
{
this
.
errorMessage
=
error
??
s__
(
'
Iterations|Unable to save cadence. Please try again.
'
);
});
},
saveAndViewList
()
{
return
this
.
save
()
.
then
((
cadenceId
)
=>
{
this
.
$router
.
push
({
name
:
'
index
'
,
query
:
{
createdCadenceId
:
getIdFromGraphQLId
(
cadenceId
)
},
});
})
.
catch
((
error
)
=>
{
this
.
errorMessage
=
error
??
s__
(
'
Iterations|Unable to save cadence. Please try again.
'
);
});
},
save
()
{
save
()
{
this
.
validateAllFields
();
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
validateAllFields
();
if
(
!
this
.
valid
)
{
if
(
!
this
.
valid
)
{
return
null
;
return
reject
(
new
Error
(
s__
(
'
Iterations|Cadence configuration is invalid.
'
)))
;
}
}
this
.
loading
=
true
;
return
resolve
();
return
this
.
createCadence
();
})
.
then
(()
=>
{
this
.
loading
=
true
;
return
this
.
saveCadence
();
})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
},
},
cancel
()
{
cancel
()
{
this
.
$router
.
push
({
name
:
'
index
'
});
this
.
$router
.
push
({
name
:
'
index
'
});
},
},
creat
eCadence
()
{
sav
eCadence
()
{
return
this
.
$apollo
return
this
.
$apollo
.
mutate
({
.
mutate
({
mutation
:
this
.
mutation
,
mutation
:
this
.
mutation
,
...
@@ -244,27 +277,17 @@ export default {
...
@@ -244,27 +277,17 @@ export default {
.
then
(({
data
,
errors
:
topLevelErrors
=
[]
}
=
{})
=>
{
.
then
(({
data
,
errors
:
topLevelErrors
=
[]
}
=
{})
=>
{
if
(
topLevelErrors
.
length
>
0
)
{
if
(
topLevelErrors
.
length
>
0
)
{
this
.
errorMessage
=
topLevelErrors
[
0
].
message
;
this
.
errorMessage
=
topLevelErrors
[
0
].
message
;
return
;
return
null
;
}
}
const
{
iterationCadence
,
errors
}
=
data
?.
result
||
{};
const
{
iterationCadence
,
errors
}
=
data
?.
result
||
{};
if
(
errors
?.
length
>
0
)
{
if
(
errors
?.
length
>
0
)
{
[
this
.
errorMessage
]
=
errors
;
[
this
.
errorMessage
]
=
errors
;
return
;
return
null
;
}
}
this
.
$router
.
push
({
return
getIdFromGraphQLId
(
iterationCadence
.
id
);
name
:
'
index
'
,
query
:
{
createdCadenceId
:
getIdFromGraphQLId
(
iterationCadence
.
id
)
},
});
})
.
catch
((
e
)
=>
{
this
.
errorMessage
=
__
(
'
Unable to save cadence. Please try again
'
);
throw
e
;
})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
});
},
},
},
},
...
@@ -414,16 +437,28 @@ export default {
...
@@ -414,16 +437,28 @@ export default {
/>
/>
</gl-form-group>
</gl-form-group>
<div
class=
"form-actions gl-display-flex"
>
<div
class=
"form-actions gl-display-flex
gl-flex-wrap
"
>
<gl-button
<gl-button
:loading=
"loading"
:loading=
"loading"
data-testid=
"save-cadence"
data-testid=
"save-cadence"
variant=
"confirm"
variant=
"confirm"
data-qa-selector=
"save_iteration_cadence_button"
data-qa-selector=
"save_iteration_cadence_button"
@
click=
"save"
@
click=
"save
AndViewList
"
>
>
{{
i18n
[
page
].
save
}}
{{
i18n
[
page
].
save
}}
</gl-button>
</gl-button>
<gl-button
v-if=
"showStartIteration"
:loading=
"loading"
class=
"gl-ml-3"
data-testid=
"save-cadence-create-iteration"
variant=
"confirm"
category=
"secondary"
data-qa-selector=
"save_cadence_start_iteration_button"
@
click=
"saveAndCreateIteration"
>
{{
i18n
.
createAndStartIteration
}}
</gl-button>
<gl-button
class=
"gl-ml-3"
data-testid=
"cancel-create-cadence"
@
click=
"cancel"
>
<gl-button
class=
"gl-ml-3"
data-testid=
"cancel-create-cadence"
@
click=
"cancel"
>
{{
i18n
.
cancel
}}
{{
i18n
.
cancel
}}
</gl-button>
</gl-button>
...
...
ee/spec/features/boards/scoped_issue_board_spec.rb
View file @
143a5c6d
...
@@ -286,6 +286,7 @@ RSpec.describe 'Scoped issue boards', :js do
...
@@ -286,6 +286,7 @@ RSpec.describe 'Scoped issue boards', :js do
update_board_scope
(
'current_iteration'
,
true
)
update_board_scope
(
'current_iteration'
,
true
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
0
)
expect
(
page
).
not_to
have_selector
(
'.gl-alert-body'
)
expect
(
page
).
not_to
have_selector
(
'.gl-alert-body'
)
end
end
end
end
...
...
ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js
View file @
143a5c6d
...
@@ -111,6 +111,7 @@ describe('Iteration cadence form', () => {
...
@@ -111,6 +111,7 @@ describe('Iteration cadence form', () => {
];
];
const
findSaveButton
=
()
=>
wrapper
.
findByTestId
(
'
save-cadence
'
);
const
findSaveButton
=
()
=>
wrapper
.
findByTestId
(
'
save-cadence
'
);
const
findSaveAndStartButton
=
()
=>
wrapper
.
findByTestId
(
'
save-cadence-create-iteration
'
);
const
findCancelButton
=
()
=>
wrapper
.
findByTestId
(
'
cancel-create-cadence
'
);
const
findCancelButton
=
()
=>
wrapper
.
findByTestId
(
'
cancel-create-cadence
'
);
const
clickSave
=
()
=>
findSaveButton
().
vm
.
$emit
(
'
click
'
);
const
clickSave
=
()
=>
findSaveButton
().
vm
.
$emit
(
'
click
'
);
const
clickCancel
=
()
=>
findCancelButton
().
vm
.
$emit
(
'
click
'
);
const
clickCancel
=
()
=>
findCancelButton
().
vm
.
$emit
(
'
click
'
);
...
@@ -135,7 +136,7 @@ describe('Iteration cadence form', () => {
...
@@ -135,7 +136,7 @@ describe('Iteration cadence form', () => {
const
durationInWeeks
=
2
;
const
durationInWeeks
=
2
;
const
iterationsInAdvance
=
6
;
const
iterationsInAdvance
=
6
;
it
(
'
triggers mutation with form data
'
,
()
=>
{
it
(
'
triggers mutation with form data
'
,
async
()
=>
{
setTitle
(
title
);
setTitle
(
title
);
setStartDate
(
startDate
);
setStartDate
(
startDate
);
setDuration
(
durationInWeeks
);
setDuration
(
durationInWeeks
);
...
@@ -143,6 +144,8 @@ describe('Iteration cadence form', () => {
...
@@ -143,6 +144,8 @@ describe('Iteration cadence form', () => {
clickSave
();
clickSave
();
await
nextTick
();
expect
(
findError
().
exists
()).
toBe
(
false
);
expect
(
findError
().
exists
()).
toBe
(
false
);
expect
(
resolverMock
).
toHaveBeenCalledWith
({
expect
(
resolverMock
).
toHaveBeenCalledWith
({
input
:
{
input
:
{
...
@@ -196,14 +199,18 @@ describe('Iteration cadence form', () => {
...
@@ -196,14 +199,18 @@ describe('Iteration cadence form', () => {
expect
(
findSaveButton
().
props
(
'
loading
'
)).
toBe
(
false
);
expect
(
findSaveButton
().
props
(
'
loading
'
)).
toBe
(
false
);
});
});
it
(
'
does not show the Create cadence and start iteration button
'
,
async
()
=>
{
expect
(
findSaveAndStartButton
().
exists
()).
toBe
(
false
);
});
});
});
describe
(
'
automated scheduling disabled
'
,
()
=>
{
describe
(
'
automated scheduling disabled
'
,
()
=>
{
it
(
'
disables future iterations and duration in weeks
'
,
async
()
=>
{
beforeEach
(
()
=>
{
setAutomaticValue
(
false
);
setAutomaticValue
(
false
);
});
await
nextTick
();
it
(
'
disables future iterations and duration in weeks
'
,
()
=>
{
expect
(
findFutureIterations
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findFutureIterations
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findFutureIterations
().
attributes
(
'
required
'
)).
toBeUndefined
();
expect
(
findFutureIterations
().
attributes
(
'
required
'
)).
toBeUndefined
();
expect
(
findDuration
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findDuration
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
...
@@ -226,6 +233,8 @@ describe('Iteration cadence form', () => {
...
@@ -226,6 +233,8 @@ describe('Iteration cadence form', () => {
clickSave
();
clickSave
();
await
nextTick
();
expect
(
resolverMock
).
toHaveBeenCalledWith
({
expect
(
resolverMock
).
toHaveBeenCalledWith
({
input
:
{
input
:
{
groupPath
,
groupPath
,
...
@@ -239,6 +248,10 @@ describe('Iteration cadence form', () => {
...
@@ -239,6 +248,10 @@ describe('Iteration cadence form', () => {
},
},
});
});
});
});
it
(
'
shows the Create cadence and start iteration button
'
,
()
=>
{
expect
(
findSaveAndStartButton
().
exists
()).
toBe
(
true
);
});
});
});
});
});
...
@@ -288,5 +301,13 @@ describe('Iteration cadence form', () => {
...
@@ -288,5 +301,13 @@ describe('Iteration cadence form', () => {
expect
(
findDuration
().
element
.
value
).
toBe
(
iterationCadence
.
durationInWeeks
);
expect
(
findDuration
().
element
.
value
).
toBe
(
iterationCadence
.
durationInWeeks
);
expect
(
findDescription
().
element
.
value
).
toBe
(
iterationCadence
.
description
);
expect
(
findDescription
().
element
.
value
).
toBe
(
iterationCadence
.
description
);
});
});
it
(
'
does not show the Create cadence and start iteration button
'
,
async
()
=>
{
setAutomaticValue
(
false
);
await
nextTick
();
expect
(
findSaveAndStartButton
().
exists
()).
toBe
(
false
);
});
});
});
});
});
locale/gitlab.pot
View file @
143a5c6d
...
@@ -19307,6 +19307,9 @@ msgstr ""
...
@@ -19307,6 +19307,9 @@ msgstr ""
msgid "Iterations|Automated scheduling"
msgid "Iterations|Automated scheduling"
msgstr ""
msgstr ""
msgid "Iterations|Cadence configuration is invalid."
msgstr ""
msgid "Iterations|Cadence name"
msgid "Iterations|Cadence name"
msgstr ""
msgstr ""
...
@@ -19316,6 +19319,9 @@ msgstr ""
...
@@ -19316,6 +19319,9 @@ msgstr ""
msgid "Iterations|Create cadence"
msgid "Iterations|Create cadence"
msgstr ""
msgstr ""
msgid "Iterations|Create cadence and start iteration"
msgstr ""
msgid "Iterations|Create iteration"
msgid "Iterations|Create iteration"
msgstr ""
msgstr ""
...
@@ -19415,6 +19421,9 @@ msgstr ""
...
@@ -19415,6 +19421,9 @@ msgstr ""
msgid "Iterations|Unable to find iteration."
msgid "Iterations|Unable to find iteration."
msgstr ""
msgstr ""
msgid "Iterations|Unable to save cadence. Please try again."
msgstr ""
msgid "Iteration|Dates cannot overlap with other existing Iterations within this group"
msgid "Iteration|Dates cannot overlap with other existing Iterations within this group"
msgstr ""
msgstr ""
...
@@ -36538,9 +36547,6 @@ msgstr ""
...
@@ -36538,9 +36547,6 @@ msgstr ""
msgid "Unable to load the merge request widget. Try reloading the page."
msgid "Unable to load the merge request widget. Try reloading the page."
msgstr ""
msgstr ""
msgid "Unable to save cadence. Please try again"
msgstr ""
msgid "Unable to save iteration. Please try again"
msgid "Unable to save iteration. Please try again"
msgstr ""
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