informatics-isi-edu / chaise

An adaptive user interface for the Deriva platform.
https://www.isi.edu/isr/
Apache License 2.0
9 stars 6 forks source link

Improve multi-create workflow for almost pure and binary relationships #2416

Open jrchudy opened 3 months ago

jrchudy commented 3 months ago

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 opens recordedit app with only 1 row and the "author" value is empty.

Proposed workflow change:

  1. Click "Add records"

    image
  2. A modal for selecting "Authors" will show

    image
  3. After clicking "Save" in the modal, recordedit app will open in a new tab with the selected authors filled in

    image
  4. 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:

jrchudy commented 3 weeks 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):

  1. Start on record app like above and click "Add Records" image
  2. Recordedit is opened in a new tab with an association picker modal shown on top of the recordedit inputs on page load image
  3. After selections are made, click "Continue" to use those selections to fill in recordedit forms image
  4. More forms can be added using "Add more" which will show the association picker again a. in the case that the pair of foreign keys are a "unique" relation, this modal will show selected rows from step 2 as "greyed" out since they can't be chosen again image
  5. Click "Save" to add the new selections to the form image
  6. Finish filling in the forms and click submit. When closing the recordedit tab that should be showing the resultset view, the record app will refresh to show the added rows

Notes:

jrchudy commented 3 days ago

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:

Do we want to be able to configure the heuristics used that show the modal when adding records from "add records" on record app?