Skip to content

Commit

Permalink
feat: Add client-side feature flag for Follow+Notes functionality (#3440
Browse files Browse the repository at this point in the history
)

* feat: Add client-side feature flag for Follow+Notes functionality

Introduced a new client-side feature flag named followNotesEnabled as part of the implementation for the "Follow + Note" feature

- Implemented followNotesEnabled feature flag in index.js.

- Registered the flag with default true in deploy-config.js.

- Added flag to staging.tfvars and prod.tfvars with false default.

- Reformatted lines 16-17 in deploy-config.js for ESLint compliance.

* eslint fix

* terraform formatting fix
  • Loading branch information
sushilrajeeva authored Sep 5, 2024
1 parent 6ae0d5b commit 84782a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/client/public/deploy-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ window.APP_CONFIG.overrideFeatureFlag = (flagName, overrideValue) => {
}
overrides[flagName] = overrideValue;
window.sessionStorage.setItem(storageKey, JSON.stringify(overrides));
console.log('New feature flag overrides in page session:',
window.sessionStorage.getItem(storageKey));
// Reformatted according to common ESLint rules
/* eslint-disable no-console */
// console.log('New feature flag overrides in page session:', window.sessionStorage.getItem(storageKey));
console.log(`New feature flag overrides in page session: ${window.sessionStorage.getItem(storageKey)}`);
/* eslint-enable no-console */
};

// For local development only. Register feature flags for Staging and Production by
Expand All @@ -23,6 +26,7 @@ window.APP_CONFIG.featureFlags = {
newTerminologyEnabled: true,
newGrantsDetailPageEnabled: true,
shareTerminologyEnabled: true,
followNotesEnabled: true,
};

// Setting a GOOGLE_TAG_ID enables Google Analytics.
Expand Down
4 changes: 4 additions & 0 deletions packages/client/src/helpers/featureFlags/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ export function newGrantsDetailPageEnabled() {
export function shareTerminologyEnabled() {
return getFeatureFlags().shareTerminologyEnabled === true;
}

export function followNotesEnabled() {
return getFeatureFlags().followNotesEnabled === true;
}
1 change: 1 addition & 0 deletions terraform/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ website_feature_flags = {
newTerminologyEnabled = true,
newGrantsDetailPageEnabled = true,
shareTerminologyEnabled = true,
followNotesEnabled = false,
}

// Google Analytics Account ID: 233192355, Property ID: 321194851, Stream ID: 3802896350
Expand Down
1 change: 1 addition & 0 deletions terraform/staging.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ website_feature_flags = {
newTerminologyEnabled = true,
newGrantsDetailPageEnabled = true,
shareTerminologyEnabled = true,
followNotesEnabled = false,
}

// Google Analytics Account ID: 233192355, Property ID: 429910307, Stream ID: 7590745080
Expand Down

0 comments on commit 84782a8

Please sign in to comment.