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
049a9dcd
Commit
049a9dcd
authored
Jan 14, 2022
by
Scott Stern
Committed by
Kushal Pandya
Jan 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add active state to milestones fetch in filtered search
parent
232c173b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
4 deletions
+40
-4
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+2
-0
app/assets/javascripts/boards/graphql/group_board_milestones.query.graphql
...ripts/boards/graphql/group_board_milestones.query.graphql
+2
-2
app/assets/javascripts/boards/graphql/project_board_milestones.query.graphql
...pts/boards/graphql/project_board_milestones.query.graphql
+2
-2
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+2
-0
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+32
-0
No files found.
app/assets/javascripts/boards/constants.js
View file @
049a9dcd
...
...
@@ -50,6 +50,8 @@ export const toggleFormEventPrefix = {
issue
:
'
toggle-issue-form-
'
,
};
export
const
active
=
'
active
'
;
export
const
inactiveId
=
0
;
export
const
ISSUABLE
=
'
issuable
'
;
...
...
app/assets/javascripts/boards/graphql/group_board_milestones.query.graphql
View file @
049a9dcd
query
GroupBoardMilestones
(
$fullPath
:
ID
!,
$searchTerm
:
String
)
{
query
GroupBoardMilestones
(
$fullPath
:
ID
!,
$searchTerm
:
String
,
$state
:
MilestoneStateEnum
)
{
group
(
fullPath
:
$fullPath
)
{
id
milestones
(
includeAncestors
:
true
,
searchTitle
:
$searchTerm
)
{
milestones
(
includeAncestors
:
true
,
searchTitle
:
$searchTerm
,
state
:
$state
)
{
nodes
{
id
title
...
...
app/assets/javascripts/boards/graphql/project_board_milestones.query.graphql
View file @
049a9dcd
query
ProjectBoardMilestones
(
$fullPath
:
ID
!,
$searchTerm
:
String
)
{
query
ProjectBoardMilestones
(
$fullPath
:
ID
!,
$searchTerm
:
String
,
$state
:
MilestoneStateEnum
)
{
project
(
fullPath
:
$fullPath
)
{
id
milestones
(
searchTitle
:
$searchTerm
,
includeAncestors
:
true
)
{
milestones
(
searchTitle
:
$searchTerm
,
includeAncestors
:
true
,
state
:
$state
)
{
nodes
{
id
title
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
049a9dcd
...
...
@@ -15,6 +15,7 @@ import {
FilterFields
,
ListTypeTitles
,
DraggableItemTypes
,
active
,
}
from
'
ee_else_ce/boards/constants
'
;
import
{
formatIssueInput
,
...
...
@@ -209,6 +210,7 @@ export default {
const
variables
=
{
fullPath
,
searchTerm
,
state
:
active
,
};
let
query
;
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
049a9dcd
...
...
@@ -29,6 +29,8 @@ import * as types from '~/boards/stores/mutation_types';
import
mutations
from
'
~/boards/stores/mutations
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
projectBoardMilestones
from
'
~/boards/graphql/project_board_milestones.query.graphql
'
;
import
groupBoardMilestones
from
'
~/boards/graphql/group_board_milestones.query.graphql
'
;
import
{
mockLists
,
mockListsById
,
...
...
@@ -308,6 +310,36 @@ describe('fetchMilestones', () => {
expect
(()
=>
actions
.
fetchMilestones
(
store
)).
toThrow
(
new
Error
(
'
Unknown board type
'
));
});
it
.
each
([
[
'
project
'
,
{
query
:
projectBoardMilestones
,
variables
:
{
fullPath
:
'
gitlab-org/gitlab
'
,
state
:
'
active
'
},
},
],
[
'
group
'
,
{
query
:
groupBoardMilestones
,
variables
:
{
fullPath
:
'
gitlab-org/gitlab
'
,
state
:
'
active
'
},
},
],
])(
'
when boardType is %s it calls fetchMilestones with the correct query and variables
'
,
(
boardType
,
variables
)
=>
{
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
const
store
=
createStore
();
store
.
state
.
boardType
=
boardType
;
actions
.
fetchMilestones
(
store
);
expect
(
gqlClient
.
query
).
toHaveBeenCalledWith
(
variables
);
},
);
it
(
'
sets milestonesLoading to true
'
,
async
()
=>
{
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
...
...
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