Skip to content

Commit

Permalink
Fix fallback to default. Readd defaults for cso, esra, rpt. (#155)
Browse files Browse the repository at this point in the history
* Fix fallbacks to default.

* Put back the two products defaults, they should work now.

* Add rpt.
  • Loading branch information
seeker25 authored Sep 19, 2023
1 parent c1abae5 commit 12028ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bc-registry",
"version": "2.1.6",
"version": "2.1.7",
"private": true,
"scripts": {
"dev": "nuxt",
Expand Down
6 changes: 4 additions & 2 deletions utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ declare const window: any
* Default flag values when LD is not available.
* NOTE: To disable dashboard tiles, you require an entry in here.
* Otherwise the tile will get disabled on the frontpage, but not under the dashboard section.
* These also don't seem to be working when you use a tool to block LaunchDarkly. This needs to be fixed in the future.
*/
const defaultFlagSet: LDFlagSet = {
'bcregistry-ui-bca-enabled': false,
'bcregistry-ui-bus-search-enabled': true,
'bcregistry-ui-bus-search-beta-chip': false,
'bcregistry-ui-bus-search-coming-soon-chip': false,
'bcregistry-ui-cso-enabled': true,
'bcregistry-ui-esra-enabled': true,
'bcregistry-ui-mhr-enabled': true,
'bcregistry-ui-nds-enabled': false,
'bcregistry-ui-ppr-new-chip': true,
'bcregistry-ui-rpt-new-chip': true,
'bcregistry-ui-rpt-enabled': true,
'bcregistry-ui-wills-new-chip': true,
'banner-text': ' ',
'whats-new': ' '
Expand Down Expand Up @@ -89,7 +91,7 @@ export async function updateLdUser (
* @returns the flag value/variation, or undefined if the flag is not found
*/
export function getFeatureFlag (name: string): any {
return ldClient ? ldClient.variation(name) : defaultFlagSet[name]
return ldClient ? ldClient.variation(name, defaultFlagSet[name]) : defaultFlagSet[name]
}

/**
Expand Down

0 comments on commit 12028ea

Please sign in to comment.