From a15f9cfead95886b008825b21d71db9bc83da91c Mon Sep 17 00:00:00 2001 From: Javier Molina Date: Wed, 1 May 2019 16:02:40 +1000 Subject: [PATCH 1/5] #24 Table sample --- .../conf/example_models/viewTableExample.json | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 grails-app/conf/example_models/viewTableExample.json diff --git a/grails-app/conf/example_models/viewTableExample.json b/grails-app/conf/example_models/viewTableExample.json new file mode 100644 index 00000000..d7717b98 --- /dev/null +++ b/grails-app/conf/example_models/viewTableExample.json @@ -0,0 +1,160 @@ +{ + "dataModel": [ + { + "dataType": "list", + "name": "adminActions", + "columns": [ + { + "dataType": "text", + "noTotal": "true", + "description": "The type of administration activity undertaken. Add more rows for different admin activities as required.", + "name": "adminActionType", + "constraints": [ + "Assess EOI applications and EOI site visits", + "Development / call for applications", + "Data analysis", + "Desktop information gathering", + "Develop monitoring protocols", + "Communications plan", + "Establish contractor agreements", + "Establish landholder agreements", + "Financial audits", + "Financial planning", + "GIS / spatial data", + "Meeting / meeting administration", + "Modelling", + "Order / purchase equipment, plants, seed, wire, posts etc", + "Partnership building", + "Prepare EOI process / criteria", + "Record Keeping", + "Site selection", + "Steering group / working group established", + "Submit project progress / annual / final report", + "Technical support", + "Update / submit Project MERI Plan", + "Works approvals", + "Other (specify in notes)" + ], + "validate": "required" + }, + { + "dataType": "number", + "description": "Number of people involved in the administration activity. An individual can be involved in more than one activity.", + "name": "numberInvolved" + }, + { + "dataType": "number", + "description": "The average number of hours per person spent on each administration activity", + "name": "hoursPerPerson" + }, + { + "dataType": "number", + "description": "The total estimated person hours spent on each administration activity.", + "computed": { + "operation": "times", + "dependents": [ + "numberInvolved", + "hoursPerPerson" + ] + }, + "name": "hoursActionTotal" + }, + { + "dataType": "text", + "description": "", + "name": "activityNotes" + } + ] + }, + { + "dataType": "number", + "description": "Aggregate total of hours spent undertaking administration activities.", + "primaryResult": "true", + "computed": { + "operation": "sum", + "dependents": { + "source": "hoursActionTotal", + "fromList": "adminActions" + } + }, + "name": "hoursAdminTotal" + }, + { + "dataType": "text", + "description": "", + "name": "notes" + } + ], + "modelName": "Table View Type Example", + "viewModel": [ + { + "items": [{ + "source": "Please list the numbers of people involved in undertaking each relevant type of administration activity and the average time spent per person:", + "computed": null, + "type": "literal" + }], + "type": "row" + }, + { + "footer": {"rows": [{"columns": [ + { + "colspan": 2, + "source": "", + "computed": null, + "type": "literal" + }, + { + "source": "Total time spent undertaking project administration activities (Hrs)", + "computed": null, + "type": "literal" + }, + { + "source": "hoursAdminTotal", + "computed": "{\"operation\":\"sum\",\"dependents\":{\"source\":\"hoursActionTotal\",\"fromList\":\"adminActions\"}}", + "type": "number" + } + ]}]}, + "source": "adminActions", + "columns": [ + { + "title": "Type of administration activity:", + "source": "adminActionType", + "width": "25%", + "computed": null, + "type": "selectOne" + }, + { + "title": "No. of people:", + "source": "numberInvolved", + "width": "10%", + "computed": null, + "type": "number" + }, + { + "title": "Ave. time per person (Hrs):", + "source": "hoursPerPerson", + "width": "10%", + "computed": null, + "type": "number" + }, + { + "title": "Ave. total time spent (Hrs):", + "source": "hoursActionTotal", + "width": "10%", + "computed": "{\"operation\":\"product\",\"dependents\":[\"numberInvolved\",\"hoursPerPerson\"]}", + "type": "number" + }, + { + "title": "Notes:", + "source": "activityNotes", + "width": "40%", + "computed": null, + "type": "textarea" + } + ], + "userAddedRows": true, + "class": "output-section", + "type": "table" + } + ] +} \ No newline at end of file From 4b10cc861354a62023e3a73e0b52674fa617ea9e Mon Sep 17 00:00:00 2001 From: Javier Molina Date: Tue, 7 May 2019 12:13:52 +1000 Subject: [PATCH 2/5] #24 Minor JSON formatting --- grails-app/conf/example_models/viewTableExample.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grails-app/conf/example_models/viewTableExample.json b/grails-app/conf/example_models/viewTableExample.json index d7717b98..216a0b4d 100644 --- a/grails-app/conf/example_models/viewTableExample.json +++ b/grails-app/conf/example_models/viewTableExample.json @@ -96,7 +96,9 @@ "type": "row" }, { - "footer": {"rows": [{"columns": [ + "footer": + {"rows": + [{"columns": [ { "colspan": 2, "source": "", From d486da86307597ce28ed23bf588aa836860e2fa9 Mon Sep 17 00:00:00 2001 From: Javier Molina Date: Tue, 7 May 2019 12:14:59 +1000 Subject: [PATCH 3/5] #24 textarea and readOnlyText samples added. --- .../viewReadonlyTextExample.json | 18 ++++++++++++++++++ .../example_models/viewTextareaExample.json | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 grails-app/conf/example_models/viewReadonlyTextExample.json create mode 100644 grails-app/conf/example_models/viewTextareaExample.json diff --git a/grails-app/conf/example_models/viewReadonlyTextExample.json b/grails-app/conf/example_models/viewReadonlyTextExample.json new file mode 100644 index 00000000..841c1a65 --- /dev/null +++ b/grails-app/conf/example_models/viewReadonlyTextExample.json @@ -0,0 +1,18 @@ +{ + "dataModel": [ + { + "dataType": "text", + "description": "", + "name": "notes", + "defaultValue": "Default Value" + } + ], + "modelName": "Readonly View Type Example", + "viewModel": [ + { + "title": "Notes:", + "source": "notes", + "type": "readonlyText" + } + ] +} \ No newline at end of file diff --git a/grails-app/conf/example_models/viewTextareaExample.json b/grails-app/conf/example_models/viewTextareaExample.json new file mode 100644 index 00000000..6ea449cd --- /dev/null +++ b/grails-app/conf/example_models/viewTextareaExample.json @@ -0,0 +1,18 @@ +{ + "dataModel": [ + { + "dataType": "text", + "description": "", + "name": "notes" + } + ], + "modelName": "Textarea View Type Example", + "viewModel": [ + { + "title": "Notes:", + "source": "notes", + "rows": "5", + "cols": "100", + "type": "textarea" + }] +} \ No newline at end of file From f4c0bb9f039cbd5c8ec199087f8a83f7e2497eab Mon Sep 17 00:00:00 2001 From: Javier Molina Date: Thu, 16 May 2019 14:48:54 +1000 Subject: [PATCH 4/5] #24 Adding example for selectOne view type --- .../example_models/viewSelectOneExample.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 grails-app/conf/example_models/viewSelectOneExample.json diff --git a/grails-app/conf/example_models/viewSelectOneExample.json b/grails-app/conf/example_models/viewSelectOneExample.json new file mode 100644 index 00000000..852341d9 --- /dev/null +++ b/grails-app/conf/example_models/viewSelectOneExample.json @@ -0,0 +1,23 @@ +{ + "dataModel": [ + { + "name": "textFieldWithConstraints", + "dataType": "text", + "description": "Description for textFieldWithConstraints", + "constraints": [ + "value1", + "value2", + "value3" + ], + "defaultValue": 1 + } + ], + "modelName": "SelectOne View Type Example", + "viewModel": [ + { + "source": "textFieldWithConstraints", + "type": "selectOne", + "preLabel": "selectOne control" + } + ] +} \ No newline at end of file From 284248100c4c66f6ae29c76eeacf93e30167dbda Mon Sep 17 00:00:00 2001 From: Javier Molina Date: Fri, 17 May 2019 16:07:07 +1000 Subject: [PATCH 5/5] #24 Added SelectMany View Type and stringList Data Type Example --- .../viewSelectManyDataStringListExample.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 grails-app/conf/example_models/viewSelectManyDataStringListExample.json diff --git a/grails-app/conf/example_models/viewSelectManyDataStringListExample.json b/grails-app/conf/example_models/viewSelectManyDataStringListExample.json new file mode 100644 index 00000000..4b1bd07c --- /dev/null +++ b/grails-app/conf/example_models/viewSelectManyDataStringListExample.json @@ -0,0 +1,23 @@ +{ + "dataModel": [ + { + "dataType": "stringList", + "name": "stringListField", + "description": "Description for stringListField", + "constraints": [ + "value1", + "value2", + "value3" + ] + } + ], + "modelName": "SelectMany View Type and stringList Data Type Example", + "viewModel": [ + { + "preLabel": "Description for stringListField", + "computed": null, + "source": "stringListField", + "type": "selectMany" + } + ] +} \ No newline at end of file