-
Notifications
You must be signed in to change notification settings - Fork 30
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
#114 Add support for default and overridden settings #152
Conversation
While the intent of this PR is the same as defined above, the implementation has been refined upon further discussion. The overarching goal is to have an overridable settings definition structure. Rather than confusing things with the various configuration and settings documents, we will be moving forward with the following documents:
|
Revisiting this with fresh eyes, it occurred to me our proposed solutions have been very couchapp influenced. What I think we might need is to stop thinking about Documents and think more how best to implement Singletons for Settings and distinguishing Environment Variables as something different. That said, we have an immediate need to be able to push updates to Views and cannot do so because doing so would overwrite customizations to A settings pattern using Singleton Classes includes:
What this means for our current implementation is that the default docs in Some things we would need to do to implement this:
|
@mfinholt I opened a new ticket detailing my proposal in from the last comment. I think the title of the ticket capture the essence but I also added an "Important differences" section which I think is worth a read. Define Group settings defaults in Singleton Classes as opposed to in CouchApp docs and extract out Environment Variables API #249 |
Priority is on v3. Closing. |
Now when calling
Tangerine.settings.get('foo')
, if there is afoo
property in theconfiguration
document, that property will be returned. This PR does this by overriding the sync method for theSettings
Class. OnSettings.fetch()
, the sync method will get called and it will first get the settings doc, then get the configuration doc, apply configuration doc over settings doc, and then finish.Still to do is to include the configuration doc when compiling an APK and then port this from client to editor so it behaves the same way.