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 {
...
@@ -34,6 +34,7 @@ export default {
search
,
search
,
milestoneTitle
,
milestoneTitle
,
types
,
types
,
weight
,
}
=
this
.
filterParams
;
}
=
this
.
filterParams
;
let
notParams
=
{};
let
notParams
=
{};
...
@@ -45,6 +46,7 @@ export default {
...
@@ -45,6 +46,7 @@ export default {
'
not[assignee_username]
'
:
this
.
filterParams
.
not
.
assigneeUsername
,
'
not[assignee_username]
'
:
this
.
filterParams
.
not
.
assigneeUsername
,
'
not[types]
'
:
this
.
filterParams
.
not
.
types
,
'
not[types]
'
:
this
.
filterParams
.
not
.
types
,
'
not[milestone_title]
'
:
this
.
filterParams
.
not
.
milestoneTitle
,
'
not[milestone_title]
'
:
this
.
filterParams
.
not
.
milestoneTitle
,
'
not[weight]
'
:
this
.
filterParams
.
not
.
weight
,
},
},
undefined
,
undefined
,
);
);
...
@@ -58,6 +60,7 @@ export default {
...
@@ -58,6 +60,7 @@ export default {
milestone_title
:
milestoneTitle
,
milestone_title
:
milestoneTitle
,
search
,
search
,
types
,
types
,
weight
,
};
};
},
},
},
},
...
@@ -82,6 +85,7 @@ export default {
...
@@ -82,6 +85,7 @@ export default {
search
,
search
,
milestoneTitle
,
milestoneTitle
,
types
,
types
,
weight
,
}
=
this
.
filterParams
;
}
=
this
.
filterParams
;
const
filteredSearchValue
=
[];
const
filteredSearchValue
=
[];
...
@@ -122,6 +126,13 @@ export default {
...
@@ -122,6 +126,13 @@ export default {
});
});
}
}
if
(
weight
)
{
filteredSearchValue
.
push
({
type
:
'
weight
'
,
value
:
{
data
:
weight
,
operator
:
'
=
'
},
});
}
if
(
this
.
filterParams
[
'
not[authorUsername]
'
])
{
if
(
this
.
filterParams
[
'
not[authorUsername]
'
])
{
filteredSearchValue
.
push
({
filteredSearchValue
.
push
({
type
:
'
author_username
'
,
type
:
'
author_username
'
,
...
@@ -136,6 +147,13 @@ export default {
...
@@ -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]
'
])
{
if
(
this
.
filterParams
[
'
not[assigneeUsername]
'
])
{
filteredSearchValue
.
push
({
filteredSearchValue
.
push
({
type
:
'
assignee_username
'
,
type
:
'
assignee_username
'
,
...
@@ -195,6 +213,9 @@ export default {
...
@@ -195,6 +213,9 @@ export default {
case
'
milestone_title
'
:
case
'
milestone_title
'
:
filterParams
.
milestoneTitle
=
filter
.
value
.
data
;
filterParams
.
milestoneTitle
=
filter
.
value
.
data
;
break
;
break
;
case
'
weight
'
:
filterParams
.
weight
=
filter
.
value
.
data
;
break
;
case
'
filtered-search-term
'
:
case
'
filtered-search-term
'
:
if
(
filter
.
value
.
data
)
plainText
.
push
(
filter
.
value
.
data
);
if
(
filter
.
value
.
data
)
plainText
.
push
(
filter
.
value
.
data
);
break
;
break
;
...
...
app/assets/javascripts/boards/components/issue_board_filtered_search.vue
View file @
1495c665
...
@@ -9,6 +9,7 @@ import { __ } from '~/locale';
...
@@ -9,6 +9,7 @@ import { __ } from '~/locale';
import
AuthorToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/author_token.vue
'
;
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
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
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
{
export
default
{
types
:
{
types
:
{
...
@@ -24,6 +25,7 @@ export default {
...
@@ -24,6 +25,7 @@ export default {
incident
:
__
(
'
Incident
'
),
incident
:
__
(
'
Incident
'
),
issue
:
__
(
'
Issue
'
),
issue
:
__
(
'
Issue
'
),
milestone
:
__
(
'
Milestone
'
),
milestone
:
__
(
'
Milestone
'
),
weight
:
__
(
'
Weight
'
),
is
:
__
(
'
is
'
),
is
:
__
(
'
is
'
),
isNot
:
__
(
'
is not
'
),
isNot
:
__
(
'
is not
'
),
},
},
...
@@ -50,6 +52,7 @@ export default {
...
@@ -50,6 +52,7 @@ export default {
incident
,
incident
,
type
,
type
,
milestone
,
milestone
,
weight
,
}
=
this
.
$options
.
i18n
;
}
=
this
.
$options
.
i18n
;
const
{
types
}
=
this
.
$options
;
const
{
types
}
=
this
.
$options
;
const
{
fetchAuthors
,
fetchLabels
}
=
issueBoardFilters
(
const
{
fetchAuthors
,
fetchLabels
}
=
issueBoardFilters
(
...
@@ -121,6 +124,13 @@ export default {
...
@@ -121,6 +124,13 @@ export default {
defaultMilestones
:
[],
// todo: https://gitlab.com/gitlab-org/gitlab/-/issues/337044#note_640010094
defaultMilestones
:
[],
// todo: https://gitlab.com/gitlab-org/gitlab/-/issues/337044#note_640010094
fetchMilestones
:
this
.
fetchMilestones
,
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 = {
...
@@ -110,6 +110,7 @@ export const FilterFields = {
'
releaseTag
'
,
'
releaseTag
'
,
'
search
'
,
'
search
'
,
'
types
'
,
'
types
'
,
'
weight
'
,
],
],
};
};
...
...
spec/frontend/boards/components/board_filtered_search_spec.js
View file @
1495c665
...
@@ -117,6 +117,7 @@ describe('BoardFilteredSearch', () => {
...
@@ -117,6 +117,7 @@ describe('BoardFilteredSearch', () => {
{
type
:
'
label_name
'
,
value
:
{
data
:
'
label2
'
,
operator
:
'
=
'
}
},
{
type
:
'
label_name
'
,
value
:
{
data
:
'
label2
'
,
operator
:
'
=
'
}
},
{
type
:
'
milestone_title
'
,
value
:
{
data
:
'
New Milestone
'
,
operator
:
'
=
'
}
},
{
type
:
'
milestone_title
'
,
value
:
{
data
:
'
New Milestone
'
,
operator
:
'
=
'
}
},
{
type
:
'
types
'
,
value
:
{
data
:
'
INCIDENT
'
,
operator
:
'
=
'
}
},
{
type
:
'
types
'
,
value
:
{
data
:
'
INCIDENT
'
,
operator
:
'
=
'
}
},
{
type
:
'
weight
'
,
value
:
{
data
:
'
2
'
,
operator
:
'
=
'
}
},
];
];
jest
.
spyOn
(
urlUtility
,
'
updateHistory
'
);
jest
.
spyOn
(
urlUtility
,
'
updateHistory
'
);
findFilteredSearch
().
vm
.
$emit
(
'
onFilter
'
,
mockFilters
);
findFilteredSearch
().
vm
.
$emit
(
'
onFilter
'
,
mockFilters
);
...
@@ -125,7 +126,7 @@ describe('BoardFilteredSearch', () => {
...
@@ -125,7 +126,7 @@ describe('BoardFilteredSearch', () => {
title
:
''
,
title
:
''
,
replace
:
true
,
replace
:
true
,
url
:
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';
...
@@ -10,6 +10,7 @@ import { __ } from '~/locale';
import
AuthorToken
from
'
~/vue_shared/components/filtered_search_bar/tokens/author_token.vue
'
;
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
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
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
=
{
export
const
boardObj
=
{
id
:
1
,
id
:
1
,
...
@@ -607,4 +608,11 @@ export const mockTokens = (fetchLabels, fetchAuthors, fetchMilestones) => [
...
@@ -607,4 +608,11 @@ export const mockTokens = (fetchLabels, fetchAuthors, fetchMilestones) => [
defaultMilestones
:
[],
defaultMilestones
:
[],
fetchMilestones
,
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