-
Notifications
You must be signed in to change notification settings - Fork 12
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
Helper functions to create ActivityInfo form and field schemas #32
Comments
|
for uploading a NEW form (that doesn't exist in ActivityInfo yet), be able to grab a data.frame (imported into R as CSV or Excel, etc.) and then run it through a function to create a ActivityInfo schema structure from which we can use to upload into ActivityInfo: either via the EDIT: the above separated out into a separate issue, #44 as it ties into separate improvements to |
some kind of function to inspect all possible field types available in ActivityInfo (quantity, FREE_TEXT, Date, etc.) |
it'll be nice to get the database schema into a data.frame format as well so that updates to the database schema can also be handled via data.frames , similar to #33 |
of course it's more difficult to do this for the DB schema since it has several very distinct elements (tables, roles, users as their own list-of-lists) so maybe helper functions to extract these specific bits of a db schema would be helpful:
|
Great example! Thanks! |
Checklist
Helper functions to extract elements of the database schema and turn into a nicie data.frame similar to form schema method:
Form schema helpers: be able to build a form schema from the ground-up
Ideal workflow:
|
At the moment, the following branch Added are:
Text, Barcode, and Serial Code Form field functions (constructor and validation):
Added s3 generics for some chaining when creating and modifying forms and their fields. Here is an example from an actual test:
|
One thing we try to do is harmonize verbs, both in the user interface in
the code base.
Can you change createDatabase() to addDatabase() ?
…On Tue, Jan 31, 2023 at 2:33 PM Nicolas Dickinson ***@***.***> wrote:
At the moment, the following branch
https://github.com/bedatadriven/activityinfo-R/tree/version-4.32 can be
tested. I will add more form fields and the other help functions now but
the main work has been done.
Added are:
createDatabase();
deleteDatabase();
formFieldSchema();
asFormFieldSchema();
validateFormFieldSchema();
formSchema();
asFormSchema();
validateFormSchema()
deleteForm();
addForm()
Text, Barcode, and Serial Code Form field functions (constructor and
validation):
barcodeFieldSchema()
textFieldSchema()
serialNumberFieldSchema()
validateBarcodeFieldSchema()
validateTextFieldSchema()
validateSerialNumberFieldSchema()
Added s3 generics for some chaining when creating and modifying forms and
their fields.
Updated and improved tests and documentation
Here is an example from an actual test:
dbTest <- createDatabase("Another test database on the fly!")
fmSchm <- formSchema(databaseId = dbTest$databaseId, label = paste0("R form with multiple fields test ", cuid()))
fmSchm <- fmSchm |>
addFormField(barcodeFieldSchema(label = "A barcode field")) |>
addFormField(textFieldSchema(label = "A text field")) |>
addFormField(serialNumberFieldSchema(label = "A serial number field"))
dbMetadata <- addForm(databaseId = databaseId, schema = fmSchm)
fmSchm2 <- getFormSchema(formId = fmSchm$id)
deleteForm(databaseId = databaseId, formId = fmSchm2$id)
result <- deleteDatabase(databaseId = dbTest$databaseId)
—
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADO5Q5DQLYDEJKPX4XAMV3WVEIDXANCNFSM6AAAAAASLDBRJA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Alexander Bertram
Executive Director
ActivityInfo <https://www.activityinfo.org/> - BeDataDriven BV
<http://www.bedatadriven.com/>
Email: ***@***.***
Mobile/Whatsapp: +31647205388
Timezone: GMT+1
---------------------------------------
Join the ActivityInfo community <https://activityinfo.org>!
Follow ActivityInfo on LinkedIn
<https://www.linkedin.com/showcase/activityinfo> & @twitter
<https://twitter.com/activityinfo>
Skype: akbertram
Binckhorstlaan 36, unit C3.56, 2516 BE The Hague, The Netherlands
|
This was brought up in the most recent
ActivityInfo with R webinar
, some helper function for users to set up the structure of the ActivityInfo form schema when using theaddForm()
function, kind of like thepermissions()
helper function we have forupdateUserRole()
? This same helper function can be applied toupdateFormSchema()
.Can also extend this for setting up the structure of Database schema as well and then updating the database schema/tree? Somewhat related, I also remember seeing a
createDatabase()
function in an older webinar from 2018, but its not in the current R package anymore.The text was updated successfully, but these errors were encountered: