Open jrchudy opened 3 months ago
We discussed changing the above workflow to the following for adding rows to an association table when the pair of foreign keys are a unique relation (1 association table entry for X main entity and Y leaf entity pair) and non-unique (N association table entries for X main entity and Y leaf entity pair):
Notes:
This feature changes the recordedit app workflow only in the entry/create
context, so where we add this configuration in the annotations doesn't need to be contextualized. This configuration should communicate when this feature should be turned, which foreign keys are affected by it, and other configurable details (like using initial values or cloned values when clicking "add more").
Proposed annotation changes:
association_picker
recordedit
or entry
in some way?foreign_key_pair
- the pair of foreignkey relationships that are used for prefill and loading the picker['fk_from_protocolauthor_to_person', 'fk_from_protocolauthor_to_protocol']
is_unique
- might not be necessary since our code can determine thisadd_more_clone
- whether add more will clone from an existing form or use the initial valuesundefined
, null
, or false
will use initial valuesnum_columns
- when we should trigger this pickerDo we want to be able to configure the heuristics used that show the modal when adding records from "add records" on record app?
add_more_clone
and num_columns
could be general configuration properties for modifying the heuristicsassociation_picker_recordedit
catalog
, schema
, or table
to configure the used heuristics
This issue focuses on association tables that are almost pure and binary. These association tables have 2 foreign keys and some static columns. A good example of this is the
Protocol_Author
table in atlas-d2k. We want to be able to create rows using the modal interface but also need a way to allow for setting values for these associated rows after selections have been made in the modal.To improve this workflow, we are considering changing what the
Add records
button does on record page for inbound foreign keys when certain criteria are met. If the association table has 5 or less static columns (non foreign key), we will trigger the following alternate workflow. Currently for adding protocol author associations, add records opensrecordedit
app with only 1 row and the "author" value is empty.Proposed workflow change:
Click "Add records"
A modal for selecting "Authors" will show
After clicking "Save" in the modal, recordedit app will open in a new tab with the selected authors filled in
After clicking "Save" in the modal, the workflow remains the same. The user will be shown the "resultset" view of recordedit app.
Notes:
The user can fill in any values for the "static" fields and the foreign key values for authors can still be changed. Once the user submits, the original record page on focus will refresh the values in the protocol author table.
The change here is to make a related table in record app have the pure and binary association picker before navigating to recordedit with filled in foreign key fields. The other features of record app will remain the same as if the related table is an inbound foreign key (see the image under point 1 above). This means the other actions in the section header will continue to be "Bulk edit" (editing the association table,
Protocol_Author
in the example) and "Explore" (showing the Protocol authors for this record in recordset). Meaning "Link records" and "Unlink records" won't be added as action buttons since those are only meant for pure and binary associations. Also means the buttons in the actions column for each individual row will remain "Edit" and "Delete" for the association table.Other Notes: