Commit 81daed71 authored by Phil Hughes's avatar Phil Hughes Committed by Igor Drozdov

Rename the WIP filter to draft in the filtered search bar

This renames the WIP option to draft in the filtered search
It also allows for URL's with wip in them to map directly to draft.

https://gitlab.com/gitlab-org/gitlab/-/issues/227414
parent b8f5c54d
import { __ } from '~/locale';
export default IssuableTokenKeys => {
const wipToken = {
formattedKey: __('WIP'),
key: 'wip',
type: 'string',
param: '',
symbol: '',
icon: 'admin',
tag: __('Yes or No'),
lowercaseValueOnSubmit: true,
uppercaseTokenName: true,
capitalizeTokenValue: true,
const draftToken = {
token: {
formattedKey: __('Draft'),
key: 'draft',
type: 'string',
param: '',
symbol: '',
icon: 'admin',
tag: __('Yes or No'),
lowercaseValueOnSubmit: true,
capitalizeTokenValue: true,
},
conditions: [
{
url: 'wip=yes',
// eslint-disable-next-line @gitlab/require-i18n-strings
replacementUrl: 'draft=yes',
tokenKey: 'draft',
value: __('Yes'),
operator: '=',
},
{
url: 'wip=no',
// eslint-disable-next-line @gitlab/require-i18n-strings
replacementUrl: 'draft=no',
tokenKey: 'draft',
value: __('No'),
operator: '=',
},
{
url: 'not[wip]=yes',
replacementUrl: 'not[draft]=yes',
tokenKey: 'draft',
value: __('Yes'),
operator: '!=',
},
{
url: 'not[wip]=no',
replacementUrl: 'not[draft]=no',
tokenKey: 'draft',
value: __('No'),
operator: '!=',
},
],
};
IssuableTokenKeys.tokenKeys.push(wipToken);
IssuableTokenKeys.tokenKeysWithAlternative.push(wipToken);
IssuableTokenKeys.tokenKeys.push(draftToken.token);
IssuableTokenKeys.tokenKeysWithAlternative.push(draftToken.token);
IssuableTokenKeys.conditions.push(...draftToken.conditions);
const targetBranchToken = {
formattedKey: __('Target-Branch'),
......
......@@ -106,7 +106,7 @@ export default class AvailableDropdownMappings {
gl: DropdownEmoji,
element: this.container.querySelector('#js-dropdown-my-reaction'),
},
wip: {
draft: {
reference: null,
gl: DropdownNonUser,
element: this.container.querySelector('#js-dropdown-wip'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment