-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
167 - Upload of branding and upload of partners #340
Conversation
1. upload-branding will update the medic DB's branding document with: Title, resources (logo and favicon) and attachments. 2. upload-partners will update the medic DB's partners document with: resources (parner name and partner image) and attachments. Additionally will add support to include as attachment the files with extension: ".icon"
…oading branding and partners.
Hi @garethbowen, since branding and partners are separate documents in the DB, I thought on making two separate commands as well. |
If you can also update this documentation upon completion of this ticket, it would be appreciated! |
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.
Awesome!
The main change is a refactor to reduce code duplication - reach out in Slack if you want to talk through the options here.
We should also add both of these to the list of defaultActions
in /src/lib/main.js so they run by default.
…upload-partners.js and upload-resources.js to a reusable library called upload-configuration-docs.js. Additionally adds the unit test from the mentioned files.
…om/medic/medic-conf into 167-upload-branding
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.
Awesome work! I love the reuse.
One comment about the linting configuration and then it'll be good to go!
…ead operator by the Object.assign
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.
Great work!
Actually, I just noticed reviewing the documentation that you changed the format of the |
Hi @garethbowen I could add any of the following options, but it would add some ugly noise in the code that I'd like to avoid if it's possible to announce the breaking change (maybe in conjunction with a node upgrade 🙂). Option 1:
Option 2:
Resources mapping
|
I'm strongly against breaking backwards compatibility. Even if we announce it there's a chance someone will miss it, and even if they don't it's annoying for every app builder! Option 3 would be for each implementation to pass in the doc JSON rather than the path to the JSON so each caller has to parse the file but they can pass a subset of the file if they like. Option 4 would be to pass an optional mapping function to turn the JSON file into the expected CouchDB doc, eg: return uploadConfigurationDocs(configurationPath, directoryPath, 'resources', file => file.resources); By default no mapping would be applied. I like Option 4 - what do you think? |
…nt when uploading settings
Hi @garethbowen I proceeded with option 4, added unit test and also manually tested that resources is working as before. |
Thanks! Looks good. |
…om/medic/medic-conf into 167-upload-branding � Conflicts: � README.md
Description
This PR will add two new commands:
upload-branding
will update the medic DB's branding document with: Title, resources (logo and favicon) and attachments.upload-partners
will update the medic DB's partners document with: resources (parner name and partner image) and attachments.Additionally will add support to include as attachment the files with extension: ".icon"
#167
Code review items
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.