-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Custom DC] Fix Disappearing Stat Var bug on Map and Scatter tool #4251
Changes from 2 commits
41a1084
4d7e505
99a2646
47b699c
82ee5d3
3ee3aaf
4f95629
37c2d84
c3f0ddd
b9f299d
7d82bad
b8d0b08
1c59587
ccb096d
80d39e6
b6e69e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,10 +114,11 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element { | |
selectSV={(svDcid) => | ||
selectStatVar(dateCtx, statVar, display, placeInfo, svDcid) | ||
} | ||
numEntitiesExistence={Math.min( | ||
NUM_ENTITIES_EXISTENCE, | ||
samplePlaces.length | ||
)} | ||
numEntitiesExistence={ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you extract this logic to a function and add some comments explaining the isCustomDC vs NUM_ENTITIES_EXISTENCE check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. Extracted to a helper function and added an explaining comment. |
||
globalThis.isCustomDC | ||
? 1 | ||
: Math.min(NUM_ENTITIES_EXISTENCE, samplePlaces.length) | ||
} | ||
/> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this approach will require existing custom DC users to add this line in order to see the fix. is there a way we can push the fix to them requiring them to change any code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of setting a value in base.html, switched to using a config variable in app_env/*.py files, and setting globalThis on the tools pages themselves, instead of the template which could be overridden.