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
dc9c6864
Commit
dc9c6864
authored
Jan 22, 2021
by
Natalia Tepluhina
Committed by
Nicolò Maria Mezzopera
Jan 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scope milestones on swimlane boards to project and its ancestors [RUN AS-IF-FOSS]
parent
1d7c653b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
20 deletions
+17
-20
app/assets/javascripts/boards/components/sidebar/board_sidebar_milestone_select.vue
...rds/components/sidebar/board_sidebar_milestone_select.vue
+5
-7
app/assets/javascripts/boards/graphql/project_milestones.query.graphql
...vascripts/boards/graphql/project_milestones.query.graphql
+3
-3
changelogs/unreleased/295626-when-epic-swimlanes-are-enabled-milestones-are-incorrectly-scoped-.yml
...mlanes-are-enabled-milestones-are-incorrectly-scoped-.yml
+5
-0
spec/frontend/boards/components/sidebar/board_sidebar_milestone_select_spec.js
...components/sidebar/board_sidebar_milestone_select_spec.js
+4
-10
No files found.
app/assets/javascripts/boards/components/sidebar/board_sidebar_milestone_select.vue
View file @
dc9c6864
...
...
@@ -8,9 +8,8 @@ import {
GlDropdownDivider
,
GlLoadingIcon
,
}
from
'
@gitlab/ui
'
;
import
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
BoardEditableItem
from
'
~/boards/components/sidebar/board_editable_item.vue
'
;
import
groupMilestones
from
'
../../graphql/group
_milestones.query.graphql
'
;
import
projectMilestones
from
'
../../graphql/project
_milestones.query.graphql
'
;
import
createFlash
from
'
~/flash
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
...
...
@@ -34,22 +33,21 @@ export default {
},
apollo
:
{
milestones
:
{
fetchPolicy
:
fetchPolicies
.
CACHE_AND_NETWORK
,
query
:
groupMilestones
,
query
:
projectMilestones
,
debounce
:
250
,
skip
()
{
return
!
this
.
edit
;
},
variables
()
{
return
{
fullPath
:
this
.
groupFull
Path
,
fullPath
:
this
.
project
Path
,
searchTitle
:
this
.
searchTitle
,
state
:
'
active
'
,
include
Descendant
s
:
true
,
include
Ancestor
s
:
true
,
};
},
update
(
data
)
{
const
edges
=
data
?.
group
?.
milestones
?.
edges
??
[];
const
edges
=
data
?.
project
?.
milestones
?.
edges
??
[];
return
edges
.
map
((
item
)
=>
item
.
node
);
},
error
()
{
...
...
app/assets/javascripts/boards/graphql/
group
_milestones.query.graphql
→
app/assets/javascripts/boards/graphql/
project
_milestones.query.graphql
View file @
dc9c6864
query
groupMilestones
(
$fullPath
:
ID
!
$state
:
MilestoneStateEnum
$include
Descendant
s
:
Boolean
$include
Ancestor
s
:
Boolean
$searchTitle
:
String
)
{
group
(
fullPath
:
$fullPath
)
{
milestones
(
state
:
$state
,
include
Descendants
:
$includeDescendant
s
,
searchTitle
:
$searchTitle
)
{
project
(
fullPath
:
$fullPath
)
{
milestones
(
state
:
$state
,
include
Ancestors
:
$includeAncestor
s
,
searchTitle
:
$searchTitle
)
{
edges
{
node
{
id
...
...
changelogs/unreleased/295626-when-epic-swimlanes-are-enabled-milestones-are-incorrectly-scoped-.yml
0 → 100644
View file @
dc9c6864
---
title
:
Scope milestones on swimlane boards to project and its ancestors
merge_request
:
52199
author
:
type
:
fixed
spec/frontend/boards/components/sidebar/board_sidebar_milestone_select_spec.js
View file @
dc9c6864
...
...
@@ -20,7 +20,7 @@ describe('~/boards/components/sidebar/board_sidebar_milestone_select.vue', () =>
wrapper
=
null
;
});
const
createWrapper
=
({
milestone
=
null
}
=
{})
=>
{
const
createWrapper
=
({
milestone
=
null
,
loading
=
false
}
=
{})
=>
{
store
=
createStore
();
store
.
state
.
issues
=
{
[
TEST_ISSUE
.
id
]:
{
...
TEST_ISSUE
,
milestone
}
};
store
.
state
.
activeId
=
TEST_ISSUE
.
id
;
...
...
@@ -38,7 +38,7 @@ describe('~/boards/components/sidebar/board_sidebar_milestone_select.vue', () =>
},
mocks
:
{
$apollo
:
{
loading
:
false
,
loading
,
},
},
});
...
...
@@ -63,12 +63,7 @@ describe('~/boards/components/sidebar/board_sidebar_milestone_select.vue', () =>
});
it
(
'
shows loader while Apollo is loading
'
,
async
()
=>
{
createWrapper
({
milestone
:
TEST_MILESTONE
});
expect
(
findLoader
().
exists
()).
toBe
(
false
);
wrapper
.
vm
.
$apollo
.
loading
=
true
;
await
wrapper
.
vm
.
$nextTick
();
createWrapper
({
milestone
:
TEST_MILESTONE
,
loading
:
true
});
expect
(
findLoader
().
exists
()).
toBe
(
true
);
});
...
...
@@ -76,8 +71,7 @@ describe('~/boards/components/sidebar/board_sidebar_milestone_select.vue', () =>
it
(
'
shows message when error or no milestones found
'
,
async
()
=>
{
createWrapper
();
wrapper
.
setData
({
milestones
:
[]
});
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
setData
({
milestones
:
[]
});
expect
(
findNoMilestonesFoundItem
().
text
()).
toBe
(
'
No milestones found
'
);
});
...
...
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