Conversation
Migration Safety CheckFound 1 potential issue: 20260304_201458_add_dev_mode.ts Warning (line 6): ALTER keyword detected - review for data loss sql`ALTER TABLE \`nac_widgets_config\` ADD \`dev_mode\` integer DEFAULT false NOT NULL;`,Review these patterns and add backup/restore logic if needed. See |
|
Preview deployment: https://nac-dev.preview.avy-fx.org |
Collaborator
Author
|
@busbyk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NAC_WIDGET_DEV_MODEenvironment variable to control thedevModevalue passed to NAC widget configs"true", overrides the production lock that currently forcesdevModetofalsenacWidgetsConfigglobal'sdevModefield when the env var is not setMotivation
Fixes #717
Currently,
devModeis always forced tofalsein production (getNACWidgetsConfig.ts), regardless of the admin panel setting. This makes it impossible to run a staging/preview deployment that uses the NAC staging widget URLs — useful fornwacus/app(AvyApp) development and testing custom data entered in staging.Changes
src/utilities/getNACWidgetsConfig.ts— CheckNAC_WIDGET_DEV_MODEenv var before falling back to the global config value. Remove the blanket production override so staging deployments can opt in..env.example— Document the newNAC_WIDGET_DEV_MODEvariable.How it works
Priority order for
devMode:NAC_WIDGET_DEV_MODEenv var ("true"→true,"false"→false)nacWidgetsConfig.devModeglobal value from admin panelfalseTest plan
devModerespects admin panel)NAC_WIDGET_DEV_MODE=trueand confirm widgets use the staging base URLNAC_WIDGET_DEV_MODE=falseand confirm it overrides an admin paneldevMode: truedevMode: false/api/[center]/nac-configendpoint returns the correctdevModevalue