Last active
May 31, 2017 15:53
-
-
Save krisleech/0b011b0da89f8dad588bf1a2d0eadf24 to your computer and use it in GitHub Desktop.
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
// GET /forms/edit-person-study-assignment?pk=ABC123 | |
// pk is a study reference | |
{ | |
id: "edit-person-study-assignment", | |
table: "study_assignments", | |
url: "/forms/{{ id }}", // default | |
method: "POST", // default | |
foreign_key: "study_id" // SELECT * FROM {{ table }} WHERE {{ foreign_key }}={{ pk }} LIMIT 1 | |
} |
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
// GET /forms/assign-person-to-study?pk=ABC123 | |
// pk is a study reference | |
{ | |
id: "assign-person-to-study", | |
inputs: ["pk"], // must be passed in URL (no need to really enforce this?) | |
table: "study_assignments", | |
url: "/forms/{{ id }}", // default | |
method: "POST", // default | |
ui: [ | |
{ | |
type: "field", | |
label: "Name", | |
validations: [ | |
{ required: true } | |
], | |
column: "person_id", | |
field_type: "select", | |
source: { sql: "SELECT * FROM people", label: "name", value: "id" } | |
}, | |
{ | |
type: "field", | |
label: "Acting Capacity", | |
validations: [ { required: true } ], | |
column: "acting_capacity_id", | |
field_type: "select", | |
source: { sql: "SELECT * FROM acting_capacities WHERE (FIXME)", label: "name", value: "id" } // FIXME: needs to not include acting capacities which have unique=true and are already assigned with no finished_at date. | |
}, | |
{ | |
type: "field", | |
labe: "Started", | |
field_type: "date", | |
date_picker: true , // default | |
input_mask: "dd/mm/YYYY", //default | |
column: "started_at", | |
validations: { required: true, not_future: true } | |
}, | |
{ | |
type: "field", | |
labe: "Finished", | |
field_type: "date", | |
date_picker: true , // default | |
input_mask: "dd/mm/YYYY", //default | |
column: "finished_at", | |
validations: { not_future: true } | |
} | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment