diff --git a/app/assets/javascripts/boards/components/board_filtered_search.vue b/app/assets/javascripts/boards/components/board_filtered_search.vue index 97f52f21e7fb56d2999f60cd2afce6d9c13a2503..ce86a4d3123a5cbf6d994820fdc0e94881714802 100644 --- a/app/assets/javascripts/boards/components/board_filtered_search.vue +++ b/app/assets/javascripts/boards/components/board_filtered_search.vue @@ -244,6 +244,13 @@ export default { }); } + if (this.filterParams['not[healthStatus]']) { + filteredSearchValue.push({ + type: TOKEN_TYPE_HEALTH, + value: { data: this.filterParams['not[healthStatus]'], operator: '!=' }, + }); + } + if (search) { filteredSearchValue.push(search); } @@ -285,6 +292,7 @@ export default { 'not[my_reaction_emoji]': this.filterParams.not.myReactionEmoji, 'not[iteration_id]': this.filterParams.not.iterationId, 'not[release_tag]': this.filterParams.not.releaseTag, + 'not[health_status]': this.filterParams.not.healthStatus, }, undefined, ); diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js index 49a953cad43b99c4258f44b7b3d78982c2b00b1b..33892f5386dc30179e1e8b526331eb8163894cac 100644 --- a/app/assets/javascripts/issues/list/constants.js +++ b/app/assets/javascripts/issues/list/constants.js @@ -360,14 +360,17 @@ export const filters = { }, [TOKEN_TYPE_HEALTH]: { [API_PARAM]: { - [NORMAL_FILTER]: 'healthStatus', - [SPECIAL_FILTER]: 'healthStatus', + [NORMAL_FILTER]: 'healthStatusFilter', + [SPECIAL_FILTER]: 'healthStatusFilter', }, [URL_PARAM]: { [OPERATOR_IS]: { [NORMAL_FILTER]: 'health_status', [SPECIAL_FILTER]: 'health_status', }, + [OPERATOR_NOT]: { + [NORMAL_FILTER]: 'not[health_status]', + }, }, }, [TOKEN_TYPE_CONTACT]: { diff --git a/app/assets/javascripts/issues/list/utils.js b/app/assets/javascripts/issues/list/utils.js index b566e08731cd7b78a750632b5301ef2458804ff0..03b0b3367fc69990c005af3061578b6d549a352c 100644 --- a/app/assets/javascripts/issues/list/utils.js +++ b/app/assets/javascripts/issues/list/utils.js @@ -13,6 +13,7 @@ import { TOKEN_TYPE_MILESTONE, TOKEN_TYPE_RELEASE, TOKEN_TYPE_TYPE, + TOKEN_TYPE_HEALTH, } from '~/vue_shared/components/filtered_search_bar/constants'; import { ALTERNATIVE_FILTER, @@ -267,8 +268,13 @@ const wildcardTokens = [TOKEN_TYPE_ITERATION, TOKEN_TYPE_MILESTONE, TOKEN_TYPE_R const isWildcardValue = (tokenType, value) => wildcardTokens.includes(tokenType) && specialFilterValues.includes(value); +const isHealthStatusSpecialFilter = (tokenType, value) => + tokenType === TOKEN_TYPE_HEALTH && specialFilterValues.includes(value); + const requiresUpperCaseValue = (tokenType, value) => - tokenType === TOKEN_TYPE_TYPE || isWildcardValue(tokenType, value); + tokenType === TOKEN_TYPE_TYPE || + isWildcardValue(tokenType, value) || + isHealthStatusSpecialFilter(tokenType, value); const formatData = (token) => { if (requiresUpperCaseValue(token.type, token.value.data)) { diff --git a/ee/app/assets/javascripts/boards/boards_util.js b/ee/app/assets/javascripts/boards/boards_util.js index f241833cbbe3ed3c52fffcefbf18617c15612e92..6c3a224e23200e78914f6a244b9ce72e2421f4b5 100644 --- a/ee/app/assets/javascripts/boards/boards_util.js +++ b/ee/app/assets/javascripts/boards/boards_util.js @@ -16,6 +16,7 @@ import { EPIC_LANE_BASE_HEIGHT, IterationFilterType, IterationIDs, + HealthStatusFilterType, MilestoneFilterType, MilestoneIDs, WeightFilterType, @@ -263,9 +264,17 @@ export const FiltersInfo = { weight: { negatedSupport: true, }, + // healthStatus is deprecated in favour of healthStatusFilter healthStatus: { - negatedSupport: false, + negatedSupport: true, remap: () => 'healthStatusFilter', + transform: (v) => + v === HealthStatusFilterType.any || v === HealthStatusFilterType.none ? v.toUpperCase() : v, + }, + healthStatusFilter: { + negatedSupport: true, + transform: (v) => + v === HealthStatusFilterType.any || v === HealthStatusFilterType.none ? v.toUpperCase() : v, }, }; diff --git a/ee/app/assets/javascripts/boards/components/issue_board_filtered_search.vue b/ee/app/assets/javascripts/boards/components/issue_board_filtered_search.vue index 85906412ef43c72cc1a283bfe322c4c02885cc4c..fcfbd0f0e5ff4f30321542df2f61298afe7feec3 100644 --- a/ee/app/assets/javascripts/boards/components/issue_board_filtered_search.vue +++ b/ee/app/assets/javascripts/boards/components/issue_board_filtered_search.vue @@ -8,7 +8,6 @@ import IssueBoardFilteredSearchFoss from '~/boards/components/issue_board_filter import { BoardType } from '~/boards/constants'; import { OPERATORS_IS_NOT, - OPERATORS_IS, TOKEN_TYPE_EPIC, TOKEN_TYPE_HEALTH, TOKEN_TYPE_ITERATION, @@ -87,9 +86,9 @@ export default { type: TOKEN_TYPE_HEALTH, title: TOKEN_TITLE_HEALTH, icon: 'status-health', - operators: OPERATORS_IS, + operators: OPERATORS_IS_NOT, token: HealthToken, - unique: true, + unique: false, }, ] : []), diff --git a/ee/app/assets/javascripts/boards/constants.js b/ee/app/assets/javascripts/boards/constants.js index 4385900ca13ae417894ecef7631fac9a47d54502..4af27c3104dbe3d7dedaafc8072d032f18613b00 100644 --- a/ee/app/assets/javascripts/boards/constants.js +++ b/ee/app/assets/javascripts/boards/constants.js @@ -43,6 +43,11 @@ export const IterationFilterType = { current: 'Current', }; +export const HealthStatusFilterType = { + any: 'Any', + none: 'None', +}; + export const IterationIDs = { NONE: 'gid://gitlab/Iteration/0', ANY: 'gid://gitlab/Iteration/-1', diff --git a/ee/app/assets/javascripts/issues/list/components/issues_list_app.vue b/ee/app/assets/javascripts/issues/list/components/issues_list_app.vue index 0c000f0fcbfcdef437ab97850f5f0338b6debf14..2eb22872604e02f08f98f2d187b05a21d4dfe80f 100644 --- a/ee/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/ee/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -3,7 +3,7 @@ import { ITEM_TYPE } from '~/groups/constants'; import IssuesListApp from '~/issues/list/components/issues_list_app.vue'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { - OPERATORS_IS, + OPERATORS_IS_NOT, TOKEN_TYPE_EPIC, TOKEN_TYPE_ITERATION, TOKEN_TYPE_WEIGHT, @@ -122,9 +122,9 @@ export default { type: TOKEN_TYPE_HEALTH, title: TOKEN_TITLE_HEALTH, icon: 'status-health', - operators: OPERATORS_IS, + operators: OPERATORS_IS_NOT, token: HealthToken, - unique: true, + unique: false, }); } diff --git a/ee/app/assets/javascripts/issues/list/queries/get_issues.query.graphql b/ee/app/assets/javascripts/issues/list/queries/get_issues.query.graphql index a0ab3a07353be8b6c3e6b8b5a574214ecf5cf3f4..06d1a8a40a7d3e7767d535a6ed6e22277c9619a0 100644 --- a/ee/app/assets/javascripts/issues/list/queries/get_issues.query.graphql +++ b/ee/app/assets/javascripts/issues/list/queries/get_issues.query.graphql @@ -26,7 +26,7 @@ query getIssuesEE( $iterationId: [ID] $iterationWildcardId: IterationWildcardId $weight: String - $healthStatus: HealthStatusFilter + $healthStatusFilter: HealthStatusFilter $crmContactId: String $crmOrganizationId: String $not: NegatedIssueFilterInput @@ -59,7 +59,7 @@ query getIssuesEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -105,7 +105,7 @@ query getIssuesEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not diff --git a/ee/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql b/ee/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql index 8b19cc5e79d618f40868360c72197da7ff906849..067ff8e2ad3b4205f5f17dfb91556ec2d614b12b 100644 --- a/ee/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql +++ b/ee/app/assets/javascripts/issues/list/queries/get_issues_counts.query.graphql @@ -18,7 +18,7 @@ query getIssuesCountEE( $iterationId: [ID] $iterationWildcardId: IterationWildcardId $weight: String - $healthStatus: HealthStatusFilter + $healthStatusFilter: HealthStatusFilter $crmContactId: String $crmOrganizationId: String $not: NegatedIssueFilterInput @@ -45,7 +45,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -72,7 +72,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -99,7 +99,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -130,7 +130,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -158,7 +158,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not @@ -186,7 +186,7 @@ query getIssuesCountEE( iterationId: $iterationId iterationWildcardId: $iterationWildcardId weight: $weight - healthStatusFilter: $healthStatus + healthStatusFilter: $healthStatusFilter crmContactId: $crmContactId crmOrganizationId: $crmOrganizationId not: $not diff --git a/ee/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js b/ee/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js index ad21674024615ab96c624bdf43d4e5da8d0ec3cc..024b27f505091d42435048e169b17e41f1bd4956 100644 --- a/ee/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js +++ b/ee/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js @@ -11,10 +11,7 @@ export const WEIGHT_TOKEN_SUGGESTIONS_SIZE = 21; export const DEFAULT_ITERATIONS = OPTIONS_NONE_ANY.concat(OPTION_CURRENT); export const DEFAULT_CADENCES = [OPTION_ANY, OPTION_CURRENT]; -export const DEFAULT_HEALTH_STATUSES = OPTIONS_NONE_ANY.map((opt) => ({ - ...opt, - value: opt.value.toUpperCase(), -})); +export const DEFAULT_HEALTH_STATUSES = OPTIONS_NONE_ANY; export const HEALTH_SUGGESTIONS = [ { title: __('On track'), value: 'onTrack' }, diff --git a/ee/spec/features/boards/board_filters_spec.rb b/ee/spec/features/boards/board_filters_spec.rb index 7bb6bb9839ed5d5193735e53c512cdbd44436995..20f0512035dff13a7e9bc8d53541c1d02b97144d 100644 --- a/ee/spec/features/boards/board_filters_spec.rb +++ b/ee/spec/features/boards/board_filters_spec.rb @@ -13,6 +13,10 @@ let_it_be(:iteration) { create(:iteration, iterations_cadence: create(:iterations_cadence, group: group)) } let_it_be(:issue) { create(:issue, project: project, weight: 2, health_status: :on_track, title: "Some title") } let_it_be(:issue_2) { create(:issue, project: project, iteration: iteration, weight: 3, title: "Other title") } + let_it_be(:issue_3) do + create(:issue, project: project, health_status: :at_risk, title: "Third issue") + end + let_it_be(:epic_issue1) { create(:epic_issue, epic: epic, issue: issue, relative_position: 1) } before do @@ -32,7 +36,7 @@ end it 'loads all the epics when opened and submit one as filter', :aggregate_failures do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) select_tokens('Epic', '=', epic.title, submit: true) @@ -50,7 +54,7 @@ end it 'loads all the iterations when opened and submit one as filter', :aggregate_failures do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) select_tokens('Iteration', '=', iteration.period, submit: true) @@ -67,7 +71,7 @@ end it 'loads all the weights when opened and submit one as filter', :aggregate_failures do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) select_tokens('Weight', '=', '2', submit: true) @@ -78,15 +82,21 @@ describe 'filters by health status' do it 'lists all health statuses' do - select_tokens('Health') + select_tokens('Health', '=') # 5 items need to be shown: None, Any, On track, Needs attention, At risk expect_suggestion_count(5) end + it 'lists all negated health statuses' do + select_tokens('Health', '!=') + # 3 items need to be shown: On track, Needs attention, At risk + expect_suggestion_count(3) + end + it 'loads only on track issues when opened and submit one as filter', :aggregate_failures do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) - select_tokens('Health', 'On track', submit: true) + select_tokens('Health', '=', 'On track', submit: true) expect_board_list_issue_count(1) expect_board_list_to_contain(issue) @@ -99,22 +109,39 @@ expect_board_list_to_not_contain(issue_2) end + it 'loads only issues with a health status that are not on track', :aggregate_failures do + expect_board_list_issue_count(3) + + select_tokens('Health', '!=', 'On track', 'Health', '=', 'Any', submit: true) + + expect_board_list_issue_count(1) + expect_board_list_to_contain(issue_3) + expect_board_list_to_not_contain(issue) + + page.refresh + + expect_board_list_issue_count(1) + expect_board_list_to_contain(issue_3) + expect_board_list_to_not_contain(issue) + end + it 'loads only issues that have no health status', :aggregate_failures do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) - select_tokens('Health', 'None', submit: true) + select_tokens('Health', '=', 'None', submit: true) expect_board_list_issue_count(1) expect_board_list_to_contain(issue_2) expect_board_list_to_not_contain(issue) + expect_board_list_to_not_contain(issue_3) end end describe 'combined filters' do it 'filters on multiple tokens' do - expect_board_list_issue_count(2) + expect_board_list_issue_count(3) - select_tokens('Health', 'On track', 'Weight', '=', '2', 'Epic', '=', epic.title) + select_tokens('Health', '=', 'On track', 'Weight', '=', '2', 'Epic', '=', epic.title) send_keys 'Some title', :enter expect_board_list_issue_count(1) @@ -122,7 +149,7 @@ visit_project_board - select_tokens('Health', 'None', 'Weight', '!=', '2', 'Epic', '=', 'None', 'Iteration', '=', iteration.period) + select_tokens('Health', '=', 'None', 'Weight', '!=', '2', 'Epic', '=', 'None', 'Iteration', '=', iteration.period) send_keys 'Other title', :enter expect_board_list_issue_count(1) diff --git a/ee/spec/features/issues/filtered_search/filter_issues_by_health_spec.rb b/ee/spec/features/issues/filtered_search/filter_issues_by_health_spec.rb index b661deb65833c8e7c49aa5e1fd1b0a6d54a45ea4..c784ab0adaef931c886780c55bd430951aea8393 100644 --- a/ee/spec/features/issues/filtered_search/filter_issues_by_health_spec.rb +++ b/ee/spec/features/issues/filtered_search/filter_issues_by_health_spec.rb @@ -60,17 +60,24 @@ def expect_issues_list_to_not_contain(issues) end describe 'behavior' do - it 'loads all the health statuses when opened' do - select_tokens 'Health' + it 'loads all the health statuses when opened for =' do + select_tokens 'Health', '=' # Expect Any, None, On track, Needs attention and At risk expect_suggestion_count 5 end + + it 'loads all the health statuses when opened for !=' do + select_tokens 'Health', '!=' + + # Expect On track, Needs attention and At risk + expect_suggestion_count 3 + end end describe 'only health' do it 'filter issues by searched health status' do - select_tokens 'Health', 'On track', submit: true + select_tokens 'Health', '=', 'On track', submit: true expect_issues_list_count(1) expect_issues_list_to_contain([issue1]) @@ -78,7 +85,7 @@ def expect_issues_list_to_not_contain(issues) end it 'filter issues by Any health status' do - select_tokens 'Health', 'Any', submit: true + select_tokens 'Health', '=', 'Any', submit: true expect_issues_list_count(2) expect_issues_list_to_contain([issue1, issue2]) @@ -86,17 +93,33 @@ def expect_issues_list_to_not_contain(issues) end it 'filter issues by None health status' do - select_tokens 'Health', 'None', submit: true + select_tokens 'Health', '=', 'None', submit: true expect_issues_list_count(1) expect_issues_list_to_contain([issue3]) expect_issues_list_to_not_contain([issue1, issue2]) end + + it 'filter issues by not on track health status' do + select_tokens 'Health', '!=', 'On track', submit: true + + expect_issues_list_count(2) + expect_issues_list_to_contain([issue2, issue3]) + expect_issues_list_to_not_contain([issue1]) + end + + it 'filter issues by any health status but not on track' do + select_tokens 'Health', '!=', 'On track', 'Health', '=', 'Any', submit: true + + expect_issues_list_count(1) + expect_issues_list_to_contain([issue2]) + expect_issues_list_to_not_contain([issue1, issue3]) + end end describe 'health with other filters' do it 'filters issues by searched health and text' do - select_tokens 'Health', 'At risk' + select_tokens 'Health', '=', 'At risk' send_keys 'bug', :enter expect_issues_list_count 1 @@ -106,7 +129,7 @@ def expect_issues_list_to_not_contain(issues) end it 'filters issues by searched health, author and text' do - select_tokens 'Health', 'At risk', 'Author', '=', user.username + select_tokens 'Health', '=', 'At risk', 'Author', '=', user.username send_keys 'bug', :enter expect_issues_list_count 1 @@ -116,7 +139,7 @@ def expect_issues_list_to_not_contain(issues) end it 'filters issues by searched health, author, assignee and text' do - select_tokens 'Health', 'At risk', 'Author', '=', user.username, 'Assignee', '=', user.username + select_tokens 'Health', '=', 'At risk', 'Author', '=', user.username, 'Assignee', '=', user.username send_keys 'bug', :enter expect_issues_list_count 1 @@ -126,7 +149,7 @@ def expect_issues_list_to_not_contain(issues) end it 'filters issues by searched health, author, assignee, label and text' do - select_tokens 'Health', 'At risk', 'Author', '=', user.username + select_tokens 'Health', '=', 'At risk', 'Author', '=', user.username select_tokens 'Assignee', '=', user.username, 'Label', '=', label.title send_keys 'bug', :enter @@ -137,7 +160,7 @@ def expect_issues_list_to_not_contain(issues) end it 'filters issues by searched health, milestone and text' do - select_tokens 'Health', 'At risk', 'Milestone', '=', milestone.title + select_tokens 'Health', '=', 'At risk', 'Milestone', '=', milestone.title send_keys 'bug', :enter expect_issues_list_count 1 @@ -145,5 +168,14 @@ def expect_issues_list_to_not_contain(issues) expect_issues_list_to_not_contain([issue1]) expect_search_term 'bug' end + + it 'filters issues by not on track, milestone and text' do + select_tokens 'Health', '!=', 'On track', 'Milestone', '=', milestone.title + send_keys 'bug', :enter + + expect_issues_list_count 1 + expect_issues_list_to_contain([issue2]) + expect_issues_list_to_not_contain([issue1, issue3]) + end end end diff --git a/ee/spec/frontend/boards/mock_data.js b/ee/spec/frontend/boards/mock_data.js index b0c553ed8aff4fb63dd946f04520601125aa7b09..101f3e8bc87919dff7657a552b392b0fe95f4509 100644 --- a/ee/spec/frontend/boards/mock_data.js +++ b/ee/spec/frontend/boards/mock_data.js @@ -609,7 +609,7 @@ export const mockTokens = ( icon: 'status-health', title: TOKEN_TITLE_HEALTH, token: HealthToken, - unique: true, - operators: OPERATORS_IS, + unique: false, + operators: OPERATORS_IS_NOT, }, ]; diff --git a/spec/frontend/boards/components/board_filtered_search_spec.js b/spec/frontend/boards/components/board_filtered_search_spec.js index e80c66f7fb8a3c960fb649636f218d3a2fd6ffab..4c0cc36889c48e062967a91d16c74a8ebf8b40d2 100644 --- a/spec/frontend/boards/components/board_filtered_search_spec.js +++ b/spec/frontend/boards/components/board_filtered_search_spec.js @@ -139,6 +139,7 @@ describe('BoardFilteredSearch', () => { { type: TOKEN_TYPE_ITERATION, value: { data: 'Any&3', operator: '=' } }, { type: TOKEN_TYPE_RELEASE, value: { data: 'v1.0.0', operator: '=' } }, { type: TOKEN_TYPE_HEALTH, value: { data: 'onTrack', operator: '=' } }, + { type: TOKEN_TYPE_HEALTH, value: { data: 'atRisk', operator: '!=' } }, ]; jest.spyOn(urlUtility, 'updateHistory'); findFilteredSearch().vm.$emit('onFilter', mockFilters); @@ -147,7 +148,7 @@ describe('BoardFilteredSearch', () => { title: '', replace: true, url: - 'http://test.host/?author_username=root&label_name[]=label&label_name[]=label%262&assignee_username=root&milestone_title=New%20Milestone&iteration_id=Any&iteration_cadence_id=3&types=INCIDENT&weight=2&release_tag=v1.0.0&health_status=onTrack', + 'http://test.host/?not[health_status]=atRisk&author_username=root&label_name[]=label&label_name[]=label%262&assignee_username=root&milestone_title=New%20Milestone&iteration_id=Any&iteration_cadence_id=3&types=INCIDENT&weight=2&release_tag=v1.0.0&health_status=onTrack', }); }); diff --git a/spec/frontend/issues/list/mock_data.js b/spec/frontend/issues/list/mock_data.js index 0690501dee94e7052d72e1865bd23168bf96997e..d9d45ca4e30621f02b8ff50bdb42040bc3487223 100644 --- a/spec/frontend/issues/list/mock_data.js +++ b/spec/frontend/issues/list/mock_data.js @@ -16,6 +16,7 @@ import { TOKEN_TYPE_RELEASE, TOKEN_TYPE_TYPE, TOKEN_TYPE_WEIGHT, + TOKEN_TYPE_HEALTH, } from '~/vue_shared/components/filtered_search_bar/constants'; export const getIssuesQueryResponse = { @@ -170,6 +171,8 @@ export const locationSearch = [ 'not[weight]=3', 'crm_contact_id=123', 'crm_organization_id=456', + 'health_status=atRisk', + 'not[health_status]=onTrack', ].join('&'); export const locationSearchWithSpecialValues = [ @@ -182,6 +185,7 @@ export const locationSearchWithSpecialValues = [ 'milestone_title=Upcoming', 'epic_id=None', 'weight=None', + 'health_status=None', ].join('&'); export const filteredTokens = [ @@ -225,6 +229,8 @@ export const filteredTokens = [ { type: TOKEN_TYPE_WEIGHT, value: { data: '3', operator: OPERATOR_NOT } }, { type: TOKEN_TYPE_CONTACT, value: { data: '123', operator: OPERATOR_IS } }, { type: TOKEN_TYPE_ORGANIZATION, value: { data: '456', operator: OPERATOR_IS } }, + { type: TOKEN_TYPE_HEALTH, value: { data: 'atRisk', operator: OPERATOR_IS } }, + { type: TOKEN_TYPE_HEALTH, value: { data: 'onTrack', operator: OPERATOR_NOT } }, { type: FILTERED_SEARCH_TERM, value: { data: 'find' } }, { type: FILTERED_SEARCH_TERM, value: { data: 'issues' } }, ]; @@ -239,6 +245,7 @@ export const filteredTokensWithSpecialValues = [ { type: TOKEN_TYPE_MILESTONE, value: { data: 'Upcoming', operator: OPERATOR_IS } }, { type: TOKEN_TYPE_EPIC, value: { data: 'None', operator: OPERATOR_IS } }, { type: TOKEN_TYPE_WEIGHT, value: { data: 'None', operator: OPERATOR_IS } }, + { type: TOKEN_TYPE_HEALTH, value: { data: 'None', operator: OPERATOR_IS } }, ]; export const apiParams = { @@ -255,6 +262,7 @@ export const apiParams = { weight: '1', crmContactId: '123', crmOrganizationId: '456', + healthStatusFilter: 'atRisk', not: { authorUsername: 'marge', assigneeUsernames: ['patty', 'selma'], @@ -266,6 +274,7 @@ export const apiParams = { iterationId: ['20', '42'], epicId: '34', weight: '3', + healthStatusFilter: 'onTrack', }, or: { authorUsernames: ['burns', 'smithers'], @@ -283,6 +292,7 @@ export const apiParamsWithSpecialValues = { milestoneWildcardId: 'UPCOMING', epicId: 'None', weight: 'None', + healthStatusFilter: 'NONE', }; export const urlParams = { @@ -311,6 +321,8 @@ export const urlParams = { 'not[weight]': '3', crm_contact_id: '123', crm_organization_id: '456', + health_status: 'atRisk', + 'not[health_status]': 'onTrack', }; export const urlParamsWithSpecialValues = { @@ -323,6 +335,7 @@ export const urlParamsWithSpecialValues = { milestone_title: 'Upcoming', epic_id: 'None', weight: 'None', + health_status: 'None', }; export const project1 = {