Commit a6e6bfa
authored
Frontend/feature flags (#1114)
### Requirements List
- **New .env variables:**
- `VUE_APP_ENV=local`
- `VUE_APP_STATSIG_KEY=<get from Statsig account: Settings -> Keys &
Environments -> Client API Keys>`
- **New dependencies**
- `yarn install --ignore-engines`
### Description List
- Added new env vars for app environment and Statsig key
- Updated the EnvConfig plugin to handle new env vars
- Updated README for new env vars + some general env var doc cleanup
- Added Statsig package dependencies
- Add a Statsig plugin to allow injecting the Statsig client into
components
- Initialize Statsig client in `main.ts`
- Handle Statsig user change in login & logout flows
- Don't allow Statsig init to block loading for more than 2 seconds
- Add a polling process to periodically refetch the Statsig gate config
from the server
- Add full examples of feature gate usage to the Styelguide example
components
- Inject feature checking Statsig client into some models
- Updated CSP Lambda with Statsig domains
- Fix some existing transient errors in the tests related to the
LicenseeList & Sorting components
### Testing List
- `yarn test:unit:all` should run without errors or warnings
- `yarn serve` should run without errors or warnings
- `yarn build` should run without errors or warnings
- For API configuration changes: CDK tests added/updated in
`backend/compact-connect/tests/unit/test_api.py`
- Code review
- Testing
- On launching the app in the browser, explore the dev tools Network tab
to ensure calls to Statsig domains are successful
- _Note that Statsig uses a variety of different root domains - seen in
the CSP Lambda updates_
- Navigate the app to make sure things are generally stable and there
are no indications of regressions or Statsig-related issues
- Navigate to the `/Styleguide` page and scroll to the bottom to see the
Example Feature Gates section
- All of the different flag evaluations should be in the expected
Enabled / Disabled state depending on the state of the flag(s) in
Statsig
- Go to the Statsig web console and update the toggle status of the
flag(s)
- Back in the Styleguide page, either:
- Wait for the Statsig refresh timer in App.ts, then navigate away and
back to the Styleguide page, or
- Refresh the Styleguide page
- Either case should result in the Styleguide flag evaluations being
updated to the new state (Enabled / Disabled)
Closes #1094
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- New Features
- Integrated feature flags and analytics; added Example Feature Gates to
the Style Guide.
- App initializes analytics and updates user periodically; clears
analytics user on logout.
- Added new translations for feature gate labels.
- Bug Fixes
- Improved sorting to avoid errors when no callback is provided.
- Style
- Minor UI refinements adding rr-block styling across forms, cards, and
confirmation views.
- Documentation
- Updated environment variable guidance and setup instructions.
- Tests
- Added tests for feature flags plugin and Example Feature Gates;
updated test helpers.
- Chores
- Updated CI/CD, deployment configs, CSP allowlist, and added analytics
dependencies.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 3e67b28 commit a6e6bfa
60 files changed
Lines changed: 1076 additions & 168 deletions
File tree
- .github/workflows
- backend/compact-connect-ui-app
- lambdas/nodejs
- cloudfront-csp
- test
- stacks/frontend_deployment_stack
- tests/resources/snapshots
- webroot
- src
- components
- App
- LicenseCard
- Licensee/LicenseeList
- Lists/Sorting
- MilitaryAffiliationInfoBlock
- PaymentProcessorConfig
- PrivilegeCard
- PrivilegePurchaseAcceptUI
- PrivilegePurchaseInformationConfirmation
- StyleGuide/ExampleFeatureGates
- UserAccount
- locales
- models
- CompactFeeConfig
- LicenseeUser
- Licensee
- License
- StaffUser
- User
- network
- exampleApi
- mocks
- pages
- LicensingDetail
- Logout
- StyleGuide
- plugins
- API
- EnvConfig
- Statsig
- store/styleguide
- tests/helpers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
246 | 258 | | |
247 | 259 | | |
248 | 260 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments