-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35735 from dimagi/riese/esm_webapps_2
Converts web apps specs to ESM
- Loading branch information
Showing
20 changed files
with
2,809 additions
and
2,966 deletions.
There are no files selected for viewing
1,188 changes: 588 additions & 600 deletions
1,188
corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/entries_spec.js
Large diffs are not rendered by default.
Oops, something went wrong.
273 changes: 137 additions & 136 deletions
273
corehq/apps/cloudcare/static/cloudcare/js/form_entry/spec/fixtures.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,142 @@ | ||
import _ from "underscore"; | ||
|
||
hqDefine("cloudcare/js/form_entry/spec/fixtures", [ | ||
"underscore", | ||
], function ( | ||
_, | ||
) { | ||
return { | ||
textJSON: (options = {}) => (_.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "name", | ||
"binding": "/data/name", | ||
"question_id": "name", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "str", | ||
"style": null, | ||
"type": "question", | ||
"ix": "0", | ||
"choices": null, | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 1, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
})), | ||
|
||
selectJSON: (options = {}) => (_.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "choice", | ||
"binding": "/data/select", | ||
"question_id": "select", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "select", | ||
"style": null, | ||
"type": "question", | ||
"ix": "2", | ||
"choices": ["a", "b"], | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 2, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
})), | ||
export function textJSON(options = {}) { | ||
return _.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "name", | ||
"binding": "/data/name", | ||
"question_id": "name", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "str", | ||
"style": null, | ||
"type": "question", | ||
"ix": "0", | ||
"choices": null, | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 1, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
}); | ||
} | ||
|
||
labelJSON: (options = {}) => (_.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "Label", | ||
"binding": "/data/label", | ||
"question_id": "label", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "info", | ||
"style": {"raw": "minimal"}, | ||
"type": "question", | ||
"ix": "3", | ||
"choices": null, | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 9, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
})), | ||
export function selectJSON(options = {}) { | ||
return _.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "choice", | ||
"binding": "/data/select", | ||
"question_id": "select", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "select", | ||
"style": null, | ||
"type": "question", | ||
"ix": "2", | ||
"choices": ["a", "b"], | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 2, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
}); | ||
} | ||
|
||
groupJSON: (options = {}) => (_.defaults(options, { | ||
"type": "sub-group", | ||
"ix": "1", | ||
"exists": true, | ||
"caption": "Group", | ||
"children": [ | ||
{ | ||
"type": "sub-group", | ||
"exists": true, | ||
"ix": "1,2", | ||
"caption": "Sub Group", | ||
"children": [ | ||
{ | ||
"type": "question", | ||
"ix": "2,3", | ||
"datatype": "str", | ||
"answer": null, | ||
"children": [], | ||
}, | ||
{ | ||
"type": "question", | ||
"ix": "2,4", | ||
"datatype": "str", | ||
"answer": null, | ||
"children": [], | ||
}, | ||
], | ||
}, | ||
], | ||
})), | ||
|
||
noQuestionGroupJSON: () => ({ | ||
"type": "sub-group", | ||
"ix": "2", | ||
"exists": true, | ||
"children": [ | ||
{ | ||
"type": "sub-group", | ||
"ix": "2,2", | ||
"exists": true, | ||
"children": [], | ||
}, | ||
], | ||
}), | ||
export function labelJSON(options = {}) { | ||
return _.defaults(options, { | ||
"caption_audio": null, | ||
"caption_video": null, | ||
"caption_image": null, | ||
"caption_markdown": null, | ||
"caption": "Label", | ||
"binding": "/data/label", | ||
"question_id": "label", | ||
"required": 0, | ||
"relevant": 0, | ||
"answer": null, | ||
"datatype": "info", | ||
"style": {"raw": "minimal"}, | ||
"type": "question", | ||
"ix": "3", | ||
"choices": null, | ||
"repeatable": null, | ||
"exists": null, | ||
"header": null, | ||
"control": 9, | ||
"help": null, | ||
"help_image": null, | ||
"help_audio": null, | ||
"help_video": null, | ||
"hint": null, | ||
"output": null, | ||
"add-choice": null, | ||
}); | ||
} | ||
|
||
export function groupJSON(options = {}) { | ||
return _.defaults(options, { | ||
"type": "sub-group", | ||
"ix": "1", | ||
"exists": true, | ||
"caption": "Group", | ||
"children": [ | ||
{ | ||
"type": "sub-group", | ||
"exists": true, | ||
"ix": "1,2", | ||
"caption": "Sub Group", | ||
"children": [ | ||
{ | ||
"type": "question", | ||
"ix": "2,3", | ||
"datatype": "str", | ||
"answer": null, | ||
"children": [], | ||
}, | ||
{ | ||
"type": "question", | ||
"ix": "2,4", | ||
"datatype": "str", | ||
"answer": null, | ||
"children": [], | ||
}, | ||
], | ||
}, | ||
], | ||
}); | ||
} | ||
export function noQuestionGroupJSON() { | ||
return { | ||
"type": "sub-group", | ||
"ix": "2", | ||
"exists": true, | ||
"children": [ | ||
{ | ||
"type": "sub-group", | ||
"ix": "2,2", | ||
"exists": true, | ||
"children": [], | ||
}, | ||
], | ||
}; | ||
}); | ||
} |
Oops, something went wrong.