-
Notifications
You must be signed in to change notification settings - Fork 8
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
ref: Refactor task settings #375
Conversation
Visit the preview URL for this PR (updated for commit 32bcffb): https://ccv-honeycomb--pr375-ref-tasksettings-m7b73fyi.web.app (expires Wed, 20 Dec 2023 21:08:34 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4ace1dcea913a952d2a1af84b94a4421bf36e610 |
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.
I think this looks good! I'm not entirely sure what you mean by the "cascade" of settings. But I think having a single source of truth in a JSON is great, if you don't need to change the settings frequently.
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.
Also a fan of your description above! Agree with Galen 👍
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 looks good to me, though I'm not sure I have all the context required. Why are SETTINGS
and LANGUAGE
the caps and the rest of the imports from config camelCase
?
@broarr As of right now Some of the exports will be removed in v3.3 and I'd like to actually remove the |
The JSON will be the starting source of truth but the settings will be able to be configured on a study/participant level in Firebase. It's not implemented yet though. |
What's Changed
config.json
is renamedsettings.json
taskSettings
export is namedSETTINGS
Reasoning
Name Change
The
config.json
file holds configuration settings specific to the task. I think it's better to name assettings
since we have multiple configuration settings (language, environment variables, and this) - it's a bit more specific.This is one move towards that name change, and since they're just re-exports of the json I thought all caps was in order. Hence
LANGUAGE
andSETTINGS
.Removing Settings in JS
I decided to remove the cascading of trial settings from
main.js
. I do still want this cascading effect to take place but that situation is specific to task settings that are stored in Firebase. I think only one base/fallback settings in the main repo is okay and, if so, the separate JSON files is the better place for them.Reviewer Qs