-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeatureFlagService.js
More file actions
99 lines (92 loc) · 3.12 KB
/
featureFlagService.js
File metadata and controls
99 lines (92 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
'use strict';
require('app')
.factory('featureFlags', featureFlags);
function featureFlags(
$localStorage
) {
var defaultFeatureFlags = {
ahaBranchUrlStep: false,
allowIsolatedUpdate: true,
autoDeployError: false,
autoIsolation: false,
autoIsolationSetup: false,
backup: false,
cardStatus: false,
composeDefaultBranch: false,
composeEditing: false,
composeInstance: true,
composeNav: true,
composeNewService: true,
composeHistory: true,
composeSSHKeys: false,
composeSSHAuthView: false,
composeTestingUpdate: false,
connections: false,
contingencyPlan: false,
demoAutoAddBranch: true,
demoPersonalOnly: false, // no more demos for orgs
demoOrgSelectUpdate: false, // updated org select for reduced github auth flow
demoNoOrgs: false, // simulates no orgs in the org select upate
demoPersistentAddTeam: false,
demoUrlPolling: true,
dockerCompose: true,
dockerfileMirroringMultiple: false,
editAnyInstance: false,
emptyFolder: false, // shows empty folder markup
envVars2: false, // new env vars
fullScreen: false, // toggles full screen
fullScreenToggle: false, // toggles the button that toggles full screen
hideBilling: false,
hideExplorer: false,
hostnameNotifications: false,
hostnameTool: false,
gitHubScope: false,
imAfraidOfTheDark: false, // toggles theme
intercomOnMigration: false, // adds intercom link to migration message
internalDebugging: false,
inviteFlows: false,
isPersonalAccount: false, // if account is a personal account
kubernetes: false,
multilineFnR: false,
multilineStartCmd: false,
multipleRepositoryContainers: false, // for adding multiple containers with the same repository
navListFilter: false,
nextPayment: false, // show the next payment date under payment summary
optionsInModal: false, // allows delete in modal
privateRegistry: true,
renameContainer: false,
saveToolbar: false,
teamManagement: false,
teamManagementAdvanced: false, // changes text from org to team in account menu
testingFeature: false,
testMenu: false, // show stubbed out test menu
themeToggle: false, // toggles the button that toggles theme
trial: false, // sets account to trial mode
undoDelete: false, // undo delete configuration
webhooks: false,
whitelistIpFiltering: false
};
var _featureFlags = {};
Object.keys(defaultFeatureFlags).forEach(function (key) {
_featureFlags[key] = defaultFeatureFlags[key];
});
if($localStorage.featureFlags){
Object.keys($localStorage.featureFlags).forEach(function (flag) {
_featureFlags[flag] = $localStorage.featureFlags[flag];
});
}
return {
reset: function () {
Object.keys(defaultFeatureFlags).forEach(function (key) {
_featureFlags[key] = defaultFeatureFlags[key];
});
return _featureFlags;
},
flags: _featureFlags,
changed: function () {
return !!Object.keys(defaultFeatureFlags).find(function (featureFlag) {
return defaultFeatureFlags[featureFlag] !== _featureFlags[featureFlag];
});
}
};
}