Princeton-CDH / pemm-scripts

scripts & tools for the Princeton Ethiopian Miracles of Mary project
Apache License 2.0
1 stars 0 forks source link

UI options for applying headers & validation #24

Closed thatbudakguy closed 4 years ago

thatbudakguy commented 4 years ago

changes

this PR refactors existing code:

it also adds code to the main entrypoint to create a "PEMM" custom menu with options to call functions that:

testing

to test this, you can follow the instructions in the README, which has been updated to reflect the new setup workflow. this will create a new sheet in your drive and install the menu & other code, but won't apply the schema or validation yet. you can proceed to import data from CSV or edit the sheet yourself, then choose one of the options from the "PEMM" dropdown menu.

notes

some functions can be slow - sheets will show a "Running script" note at the top; the function isn't finished running until this goes away.

the "PEMM" menu may also take a moment to appear after the user loads the spreadsheet; often you will get a "Running script" or similar dialog for a bit while the script runs that creates the menu.

actions like creating named ranges and data validation rules appear to already be idempotent in google sheets, so there's no drawback to running these functions multiple times (except that a new row of headers will be created each time).