angular: add automatic pcrud-based data sources to eg-combobox

Bug #1831785 reported by Galen Charlton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

This bug is for the following improvements to the Angular eg-combobox component:

This patch adds new idlClass and idlField attributes to eg-combobox to
enable it to automatically construct a pcrud-base data source. The
idlClass property specifies which table/class to use as the base
data source, while idlField specifies the label to display. If idlField
is not supplied, the label field defaults to "name".

It also adds an asyncSupportsEmptyTermClick option to specify that an
async data source (whether or not it is automatically built) is
expected to never return more than a couple hundred entries or so;
when supplied, it will allow fetching the entire contents of the
data source when the user clicks on the drop-down.

This is part of a project to prepare for converting some acquisitions interfaces to Angular. Work on this bug was sponsored by MassLNC, Georgia Public Library Service, Indiana State Library, CW MARS, and King County Library System.

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Wishlist
milestone: none → 3.4-beta1
Revision history for this message
Galen Charlton (gmc) wrote :

Patch(es) for this are available as part of the following branch:

working/collab/gmcharlt/angular-widget-improvements-2019-06
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/gmcharlt/angular-widget-improvements-2019-06

tags: added: angular pullrequest
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
tags: added: signedoff
Revision history for this message
Jane Sandberg (sandbergja) wrote :

This is so handy! Thanks for this feature, Jason, Galen, and Bill.

I have a signoff branch here: user/sandbergja/lp1831785_combobox_pcrud

Here's a link: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1831785_combobox_pcrud

I added a small follow up commit. It removes an empty else statement, and uses this syntax (which I find a bit more readable) in the sandbox:

idlClass="csp"

instead of this syntax:

[idlClass]="'csp'"

Changed in evergreen:
assignee: Jane Sandberg (sandbej) → nobody
tags: removed: signedoff
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
status: New → Confirmed
Revision history for this message
Mike Rylander (mrylander) wrote :

First, this is great, and will make simple interfaces much more usable.

Second, I have a thought about the default field. Instead of guessing "name" could we look up the selector attached to the pkey field? Failing that, I suppose "name" is as good a choice as any.

Thoughts?

Revision history for this message
Bill Erickson (berick) wrote :

Saw your comment right before merging... +1 to defaulting to the selector field. Adding a patch to do that now.

Revision history for this message
Bill Erickson (berick) wrote :

New branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1831785-combobox-pcrud

1. Sign-off for Jane's last commit.

2. Teach the PCRUD-driven combobox to use the IDL class' selector field as the sort and display field when no idlField value is provided.

3. Teach the async source to use the pkey field of the IDL class instead of assuming the 'id' field

4. Tweak the sandbox example to fetch data for a class which uses a selector not called "name" and a pkey not called "id".

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Very good change, thanks Mike and Bill.

Pushed to master! Thanks all!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Jane Sandberg (sandbej) → nobody
Galen Charlton (gmc)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.