2020-10-01 17:08:36 -04:00
import { property } from 'lodash' ;
import { s _ _ } from '~/locale' ;
export const ROLLOUT _STRATEGY _ALL _USERS = 'default' ;
export const ROLLOUT _STRATEGY _PERCENT _ROLLOUT = 'gradualRolloutUserId' ;
2020-10-13 11:08:53 -04:00
export const ROLLOUT _STRATEGY _FLEXIBLE _ROLLOUT = 'flexibleRollout' ;
2020-10-01 17:08:36 -04:00
export const ROLLOUT _STRATEGY _USER _ID = 'userWithId' ;
export const ROLLOUT _STRATEGY _GITLAB _USER _LIST = 'gitlabUserList' ;
export const PERCENT _ROLLOUT _GROUP _ID = 'default' ;
export const DEFAULT _PERCENT _ROLLOUT = '100' ;
export const ALL _ENVIRONMENTS _NAME = '*' ;
export const INTERNAL _ID _PREFIX = 'internal_' ;
export const fetchPercentageParams = property ( [ 'parameters' , 'percentage' ] ) ;
export const fetchUserIdParams = property ( [ 'parameters' , 'userIds' ] ) ;
export const NEW _VERSION _FLAG = 'new_version_flag' ;
export const LEGACY _FLAG = 'legacy_flag' ;
export const NEW _FLAG _ALERT = s _ _ (
'FeatureFlags|Feature Flags will look different in the next milestone. No action is needed, but you may notice the functionality was changed to improve the workflow.' ,
) ;
export const FEATURE _FLAG _SCOPE = 'featureFlags' ;
export const USER _LIST _SCOPE = 'userLists' ;
2020-10-05 14:08:51 -04:00
export const EMPTY _PARAMETERS = { parameters : { } , userListId : undefined } ;
export const STRATEGY _SELECTIONS = [
{
value : ROLLOUT _STRATEGY _ALL _USERS ,
text : s _ _ ( 'FeatureFlags|All users' ) ,
} ,
2020-10-13 11:08:53 -04:00
{
value : ROLLOUT _STRATEGY _FLEXIBLE _ROLLOUT ,
text : s _ _ ( 'FeatureFlags|Percent rollout' ) ,
} ,
2020-10-05 14:08:51 -04:00
{
value : ROLLOUT _STRATEGY _PERCENT _ROLLOUT ,
text : s _ _ ( 'FeatureFlags|Percent of users' ) ,
} ,
{
value : ROLLOUT _STRATEGY _USER _ID ,
text : s _ _ ( 'FeatureFlags|User IDs' ) ,
} ,
{
value : ROLLOUT _STRATEGY _GITLAB _USER _LIST ,
text : s _ _ ( 'FeatureFlags|User List' ) ,
} ,
] ;