Skip to content

Commit

Permalink
Add default context for person forms
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jun 2, 2017
1 parent 4b7e973 commit f557feb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medic-configurer-beta",
"version": "1.0.42",
"version": "1.0.43",
"description": "Configure Medic Mobile deployments",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/fn/upload-contact-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ const uploadForms = require('../lib/upload-forms');
module.exports = (project, couchUrl, extras) => uploadForms(project, couchUrl, 'contact', {
id_prefix: 'contact:',
forms: extras,
default_context: { person:false, place:false },
});
3 changes: 2 additions & 1 deletion src/lib/upload-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = (project, couchUrl, subDirectory, options) => {
type: 'form',
internalId: internalId,
title: readTitleFrom(xml),
context: options.default_context,
};

const propertiesPath = `${formsDir}/${baseFileName}.properties.json`;
Expand Down Expand Up @@ -67,7 +68,7 @@ const readIdFrom = xml =>
const updateFromPropertiesFile = (doc, path) => {
if(fs.exists(path)) {
const properties = fs.readJson(path);
doc.context = properties.context;
if(typeof properties.context !== 'undefined') doc.context = properties.context;
doc.icon = properties.icon;

if(properties.internalId) {
Expand Down

0 comments on commit f557feb

Please sign in to comment.