]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1851884: eg-fm-record-editor: avoid fetching all rows from linked table
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 28 Apr 2022 00:42:05 +0000 (20:42 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 29 Jun 2022 18:51:44 +0000 (14:51 -0400)
commitf2824b8457fa1e941053cdc7fa715ab21e6f58c9
tree8e9381045f1851efeb9eec3e9c9adc90018724ce
parent5380bfb11a3a38bac521ce8ef92216c13d46f3b9
LP#1851884: eg-fm-record-editor: avoid fetching all rows from linked table

This patch ensures that Angular FM record editor dialogs do
not attempt to fetch all rows from target table when constructing
a combobox for a linked field.

In particular, it makes the following changes:

* If a custom template for a field is supplied, use that by
  default rather than _also_ creating a data source for
  a combobox.
* Rather than creating its own data source for a linked field,
  the FM record editor now uses the IDL mode of eg-combobox. By doing
  this, we use eg-combobox's default data source, which limits
  record retrievals to 100 rows max. Also, empty-click is now
  enabled by default.
* When attempting to identify a selector for an IDL class, if
  the class doesn't define a selector and doesn't have a field named
  'name', but its primary key is a text field, use the primary
  key as the selector.

To test
-------
[1] Create a few thousand empty bib record buckets in your test database.
[2] Edit a carousel under Local Administration; note that it can
    take some time for the dialog to load.
[3] Apply the patch and repeat step 2. This time, the carousel edit modal
    should open instantly.
[4] Test various Angular record editor modals to confirm that they behave
    as expected. For example:

    * The allocate to fund dialog in Fund Administration, in particular
      to verify that only active funds show up.
    * The assign user to course modal, to verify that searching is done
      by course number, not name.
    * Filter Dialog Set editor under /eg2/en-US/staff/admin/local/config/filter_dialog_filter_set
      to verify that the drop down for the creator doesn't fetch
      all patrons. (Note that this is an artificial example).

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Open-ILS/src/eg2/src/app/core/idl.service.ts
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts