diff options
Diffstat (limited to 'app/assets/javascripts/search/sidebar/constants/state_filter_data.js')
-rw-r--r-- | app/assets/javascripts/search/sidebar/constants/state_filter_data.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app/assets/javascripts/search/sidebar/constants/state_filter_data.js b/app/assets/javascripts/search/sidebar/constants/state_filter_data.js new file mode 100644 index 00000000000..7c9a029ffe4 --- /dev/null +++ b/app/assets/javascripts/search/sidebar/constants/state_filter_data.js @@ -0,0 +1,42 @@ +import { __ } from '~/locale'; + +const header = __('Status'); + +const filters = { + ANY: { + label: __('Any'), + value: 'all', + }, + OPEN: { + label: __('Open'), + value: 'opened', + }, + CLOSED: { + label: __('Closed'), + value: 'closed', + }, + MERGED: { + label: __('Merged'), + value: 'merged', + }, +}; + +const scopes = { + ISSUES: 'issues', + MERGE_REQUESTS: 'merge_requests', +}; + +const filterByScope = { + [scopes.ISSUES]: [filters.ANY, filters.OPEN, filters.CLOSED], + [scopes.MERGE_REQUESTS]: [filters.ANY, filters.OPEN, filters.MERGED, filters.CLOSED], +}; + +const filterParam = 'state'; + +export const stateFilterData = { + header, + filters, + scopes, + filterByScope, + filterParam, +}; |