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
1495c665
Commit
1495c665
authored
Aug 18, 2021
by
Scott Stern
Committed by
Natalia Tepluhina
Aug 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add weight token to issue board filtered search
parent
187fe7d4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
1 deletion
+42
-1
app/assets/javascripts/boards/components/board_filtered_search.vue
...s/javascripts/boards/components/board_filtered_search.vue
+21
-0
app/assets/javascripts/boards/components/issue_board_filtered_search.vue
...scripts/boards/components/issue_board_filtered_search.vue
+10
-0
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+1
-0
spec/frontend/boards/components/board_filtered_search_spec.js
.../frontend/boards/components/board_filtered_search_spec.js
+2
-1
spec/frontend/boards/mock_data.js
spec/frontend/boards/mock_data.js
+8
-0
No files found.
app/assets/javascripts/boards/components/board_filtered_search.vue
View file @
1495c665
...
...
@@ -34,6 +34,7 @@ export default {
search
,
milestoneTitle
,
types
,
weight
,
}
=
this
.
filterParams
;
let
notParams
=
{};
...
...
@@ -45,6 +46,7 @@ export default {
'
not[assignee_username]
'
:
this
.
filterParams
.
not
.
assigneeUsername
,
'
not[types]
'
:
this
.
filterParams
.
not
.
types
,
'
not[milestone_title]
'
:
this
.
filterParams
.
not
.
milestoneTitle
,
'
not[weight]
'
:
this
.
filterParams
.
not
.
weight
,
},
undefined
,
);
...
...
@@ -58,6 +60,7 @@ export default {
milestone_title
:
milestoneTitle
,
search
,
types
,
weight
,
};
},
},
...
...
@@ -82,6 +85,7 @@ export default {
search
,
milestoneTitle
,
types
,
weight
,
}
=
this
.
filterParams
;
const
filteredSearchValue
=
[];
...
...
@@ -122,6 +126,13 @@ export default {
});
}
if
(
weight
)
{
filteredSearchValue
.
push
({
type
:
'
weight
'
,
value
:
{
data
:
weight
,
operator
:
'
=
'
},
});
}
if
(
this
.
filterParams
[
'
not[authorUsername]
'
])
{
filteredSearchValue
.
push
({
type
:
'
author_username
'
,
...
...
@@ -136,6 +147,13 @@ export default {
});
}
if
(
this
.
filterParams
[
'
not[weight]
'
])
{
filteredSearchValue
.
push
({
type
:
'
weight
'
,
value
:
{
data
:
this
.
filterParams
[
'
not[weight]
'
],
operator
:
'
!=
'
},
});
}
if
(
this
.
filterParams
[
'
not[assigneeUsername]
'
])
{
filteredSearchValue
.
push
({
type
:
'
assignee_username
'
,
...
...
@@ -195,6 +213,9 @@ export default {
case
'
milestone_title
'
:
filterParams
.
milestoneTitle
=
filter
.
value
.
data
;
break
;
case
'
weight
'
:
filterParams
.
weight
=
filter
.
value
.
data
;
break
;
case
'
filtered-search-term
'
:
if
(
filter
.
value
.
data
)
plainText
.
push
(
filter
.
value
.
data
);
break
;
...
...
app/assets/javascripts/boards/components/issue_board_filtered_search.vue
View file @
1495c665
...
...
@@ -9,6 +9,7 @@ import { __ } from '~/locale';
import
AuthorToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/author_token.vue
'
;
import
LabelToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/label_token.vue
'
;
import
MilestoneToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/milestone_token.vue
'
;
import
WeightToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/weight_token.vue
'
;
export
default
{
types
:
{
...
...
@@ -24,6 +25,7 @@ export default {
incident
:
__
(
'
Incident
'
),
issue
:
__
(
'
Issue
'
),
milestone
:
__
(
'
Milestone
'
),
weight
:
__
(
'
Weight
'
),
is
:
__
(
'
is
'
),
isNot
:
__
(
'
is not
'
),
},
...
...
@@ -50,6 +52,7 @@ export default {
incident
,
type
,
milestone
,
weight
,
}
=
this
.
$options
.
i18n
;
const
{
types
}
=
this
.
$options
;
const
{
fetchAuthors
,
fetchLabels
}
=
issueBoardFilters
(
...
...
@@ -121,6 +124,13 @@ export default {
defaultMilestones
:
[],
// todo: https://gitlab.com/gitlab-org/gitlab/-/issues/337044#note_640010094
fetchMilestones
:
this
.
fetchMilestones
,
},
{
type
:
'
weight
'
,
title
:
weight
,
icon
:
'
weight
'
,
token
:
WeightToken
,
unique
:
true
,
},
];
},
},
...
...
app/assets/javascripts/boards/constants.js
View file @
1495c665
...
...
@@ -110,6 +110,7 @@ export const FilterFields = {
'
releaseTag
'
,
'
search
'
,
'
types
'
,
'
weight
'
,
],
};
...
...
spec/frontend/boards/components/board_filtered_search_spec.js
View file @
1495c665
...
...
@@ -117,6 +117,7 @@ describe('BoardFilteredSearch', () => {
{
type
:
'
label_name
'
,
value
:
{
data
:
'
label2
'
,
operator
:
'
=
'
}
},
{
type
:
'
milestone_title
'
,
value
:
{
data
:
'
New Milestone
'
,
operator
:
'
=
'
}
},
{
type
:
'
types
'
,
value
:
{
data
:
'
INCIDENT
'
,
operator
:
'
=
'
}
},
{
type
:
'
weight
'
,
value
:
{
data
:
'
2
'
,
operator
:
'
=
'
}
},
];
jest
.
spyOn
(
urlUtility
,
'
updateHistory
'
);
findFilteredSearch
().
vm
.
$emit
(
'
onFilter
'
,
mockFilters
);
...
...
@@ -125,7 +126,7 @@ describe('BoardFilteredSearch', () => {
title
:
''
,
replace
:
true
,
url
:
'
http://test.host/?author_username=root&label_name[]=label&label_name[]=label2&milestone_title=New+Milestone&types=INCIDENT
'
,
'
http://test.host/?author_username=root&label_name[]=label&label_name[]=label2&milestone_title=New+Milestone&types=INCIDENT
&weight=2
'
,
});
});
});
...
...
spec/frontend/boards/mock_data.js
View file @
1495c665
...
...
@@ -10,6 +10,7 @@ import { __ } from '~/locale';
import
AuthorToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/author_token.vue
'
;
import
LabelToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/label_token.vue
'
;
import
MilestoneToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/milestone_token.vue
'
;
import
WeightToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/weight_token.vue
'
;
export
const
boardObj
=
{
id
:
1
,
...
...
@@ -607,4 +608,11 @@ export const mockTokens = (fetchLabels, fetchAuthors, fetchMilestones) => [
defaultMilestones
:
[],
fetchMilestones
,
},
{
icon
:
'
weight
'
,
title
:
__
(
'
Weight
'
),
type
:
'
weight
'
,
token
:
WeightToken
,
unique
:
true
,
},
];
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