Merged PR 1314: Implementing Feature Flags
Before submitting this PR, please make ensure you've completed the following: - [ ] Your code builds clean without any errors **or warnings**. - [ ] All unused code has been deleted. - [ ] All TODOs in the code base have an associated ticket in ADO. - [ ] Your squash commit to main has a short descriptive commit message. Describe your PR: Please find below Task Id's 1)TASK 3847 If submitting to the FrontEnd UI, include a screenshot of the change: Implementing Feature Flags Related work items: #3847
This commit is contained in:
Родитель
f3cf1db2a5
Коммит
aabb5422be
|
@ -0,0 +1,7 @@
|
|||
# FEATURE FLAGS SETUP
|
||||
|
||||
1. Install it from npm (npm i flagged).
|
||||
2. Import the FlagsProvider in your code and wrap your application around it.(import { FlagsProvider } from 'flagged’)
|
||||
3. The features prop you pass to FlagsProvider could be an array of strings or an object. If you decide to use an object you could also pass nested objects to group feature flags together(<FlagsProvider features={flags}>).
|
||||
4. Import the Feature in your code and wrap your application around it(import { Feature } from 'flagged').
|
||||
5. Pass the name of the feature you want to check for and a children value and it will not render the children if the feature is enabled..
|
|
@ -32,6 +32,7 @@
|
|||
"axios-cache-adapter": "2.7.3",
|
||||
"bingmaps": "2.0.3",
|
||||
"dayjs": "1.10.5",
|
||||
"flagged": "^2.0.1",
|
||||
"lodash": "4.17.21",
|
||||
"office-ui-fabric-react": "7.170.3",
|
||||
"react": "16.10",
|
||||
|
@ -10137,6 +10138,14 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/flagged": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/flagged/-/flagged-2.0.1.tgz",
|
||||
"integrity": "sha512-cKkJdbHruBbi4CAufayqDs1X6PYMKE+MZmG/3mYBPZw1M0dY+tA14tDTkg5+TISQwZ7tTIzwubFZNv4lm7XENw==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/flat-cache": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
|
||||
|
@ -27925,6 +27934,12 @@
|
|||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"flagged": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/flagged/-/flagged-2.0.1.tgz",
|
||||
"integrity": "sha512-cKkJdbHruBbi4CAufayqDs1X6PYMKE+MZmG/3mYBPZw1M0dY+tA14tDTkg5+TISQwZ7tTIzwubFZNv4lm7XENw==",
|
||||
"requires": {}
|
||||
},
|
||||
"flat-cache": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
"axios-cache-adapter": "2.7.3",
|
||||
"bingmaps": "2.0.3",
|
||||
"dayjs": "1.10.5",
|
||||
"flagged": "^2.0.1",
|
||||
"lodash": "4.17.21",
|
||||
"office-ui-fabric-react": "7.170.3",
|
||||
"react": "16.10",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
const flags = {
|
||||
vipOnly: true,
|
||||
adminOnly: true,
|
||||
};
|
||||
export default flags;
|
|
@ -5679,6 +5679,11 @@
|
|||
"locate-path" "^6.0.0"
|
||||
"path-exists" "^4.0.0"
|
||||
|
||||
"flagged@^2.0.1":
|
||||
"integrity" "sha512-cKkJdbHruBbi4CAufayqDs1X6PYMKE+MZmG/3mYBPZw1M0dY+tA14tDTkg5+TISQwZ7tTIzwubFZNv4lm7XENw=="
|
||||
"resolved" "https://registry.npmjs.org/flagged/-/flagged-2.0.1.tgz"
|
||||
"version" "2.0.1"
|
||||
|
||||
"flat-cache@^3.0.4":
|
||||
"integrity" "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg=="
|
||||
"resolved" "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz"
|
||||
|
@ -8915,7 +8920,7 @@
|
|||
"loose-envify" "^1.4.0"
|
||||
"prop-types" "^15.6.2"
|
||||
|
||||
"react@*", "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0", "react@^16.0.0", "react@^16.3.0", "react@^16.8.0", "react@^16.8.0 || ^17", "react@^17.0.1", "react@>= 16", "react@>=0.14.9", "react@>=15", "react@>=16.6.0", "react@>=16.8.0 <17.0.0", "react@>=16.8.0 <18.0.0", "react@16.10":
|
||||
"react@*", "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0", "react@^16.0.0", "react@^16.3.0", "react@^16.8.0", "react@^16.8.0 || ^17", "react@^17.0.1", "react@>= 16", "react@>=0.14.9", "react@>=15", "react@>=16", "react@>=16.6.0", "react@>=16.8.0 <17.0.0", "react@>=16.8.0 <18.0.0", "react@16.10":
|
||||
"integrity" "sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw=="
|
||||
"resolved" "https://registry.npmjs.org/react/-/react-16.10.2.tgz"
|
||||
"version" "16.10.2"
|
||||
|
|
Загрузка…
Ссылка в новой задаче