Angular MARC Editor Part 1 -- Flat Text Editor

Bug #1834665 reported by Bill Erickson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned
3.3
Fix Released
Wishlist
Unassigned

Bug Description

Evergreen 3.3

In my continuing push to make the Angular staff catalog a viable alternative to the TPAC-driven catalog, I have started a branch to implement the flat-text editor portion of the MARC editor interface in Angular.

What I have so far:

Catalog MARC edit tab now shows a record source selector, delete/undelete/save buttons and 2 sub-tabs, one for the Enriched editor and one for the Flat Text editor. The Enriched editor tab directs the user back to the AngJS version (consistent w/ the current behavior). The Flat Text tab displays the standard flat text editor.

Under the covers the code leverages the existing marcrecord.js MARC21 library (miker++). I made a copy of this file, ported the jquery-dependent code to vanilla JS so jquery would no longer be required, and removed some not-yet-needed code (for now, anyway, to limit the amount of porting required). I added this copy of the file to the Angular build setup so it would be optimized for --prod builds. I did not port it to Typescript -- it's a pretty big chunk of code -- though that option is still on the table.

Branch for review on its way.

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

Working branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1834665-ang-marc-flat-editor

Code works as advertised. Will add release notes after confirming no glaring problems or omissions.

As it stands, the editor component only works for bib records, but teaching it about authority records is on my radar and should be fairly straightforward.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Hey Bill -- this is looking good. Is it okay if the Cataloging Working Group takes a look at this branch in its July 9th meeting?

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

Hi Jane, of course, please share it. I don't plan on making any more code changes unless something needs fixing.

tags: added: pullrequest
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Added pullrequest. Targeted 3.3 as well, consistent w/ other Angular catalog branches.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for your work on this, Bill! We had a chance to look at this in the Cataloging Working Group, and we had some feedback:

1) Your branch uses ‡ as the subfield delimiter, but the existing flat text editor uses $. The CWG has a strong preference to keep using $, since that's available on a lot more keyboards. :-)

2) A long-standing issue for catalogers that use MarcEdit a lot: MarcEdit uses 2 spaces between the MARC tag and delimiters, e.g.:

=245 10$aPacific seaweeds :$ba guide to common seaweeds of the West Coast /$cLouis D. Druehl and Bridgette E. Clarkston.

The Evergreen flat text editor only uses one, e.g.:

=245 10$aPacific seaweeds

It would be nice if we could copy/paste between the two more easily!

3) A general observation: a common workflow for catalogers is to troubleshoot format icons. It would be helpful if the flat text editor offered a preview of which format icon(s) will be displayed. Otherwise, it leads to an awkward workflow of going to the flat text editor, then clicking the view in catalog button (which is a totally different view), and alternating between the two tabs.

4) It would also be helpful to have access to the cover image within the Angular catalog, rather than having to go out to the OPAC view.

5) My own observation: it would be nice to have a toast message that pops up when a record saves successfully.

Revision history for this message
Mike Rylander (mrylander) wrote :

Hi Jane, thanks for testing Bill's branch. A couple thoughts...

Re (1), there are a few ways that the delimiter can be overridden, but the (arguably) "best" way is to pass a delimiter to the new record constructor (the internal one, implemented via the MARC21.Record class) in the calling code. We could either embed that desire directly in Open-ILS/src/eg2/src/app/staff/share/marc-edit/marcrecord.ts or allow users of the wrapper to supply, say, a second constructor argument that can override the default delimiter. We can also forcibly set the default text format delimiter by setting MARC21.Record.delimiter to $ before loading records via the TypeScript wrapper.

Re (2), for historical consideration, we use one space rather than two because when the flat text editor was created we intentionally wanted to maintain compatibility with the output of the as_formatted() method from the MARC::Record Perl module. The ability to take the output of as_formatted() and pass it to the Javascript implementation was seen as important because we use MARC::Record internally on the server side, and it makes shipping flat text to the client simpler.

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

Thanks, Jane. Thanks, Mike.

1. An oversight on my part. I'll fix that.
2. I'll leave it as-is for now, pending further input.
3./4. seem like good general improvements, so I'll look at those too.
5. Doh! I left some TODO items in the code for toasts. Gotta have those.

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

Issues noted above addressed in commits to my working branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1834665-ang-marc-flat-editor

I added the format icons/labels and jacket image to the record summary so that they are not limited to the MARC Editor tab. Formats display along the top and the jacket displays along the left, but the jacket only display when the summary is expanded (otherwise it wouldn't fit).

Note the format icons cannot be "previewed" in the MARC editor before a record is saved, since the data requires record ingest. When modifying formats, a save (which automatically refreshes the display within the Angular catalog) is still required.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Galen Charlton (gmc) wrote :

I suggest spinning off compatibility with MarcEdit's flavor of the breaker format to a separate bug. I think it's a good idea, but to avoid compatibility issues, I think we should support being able to paste in both the one-space and two-space variations.

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

Created bug #1838561 for MarcEdit breaker support.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Ooh, thanks, Bill. The new record summary is really stylish!

The $ delimiter isn't quite working for me:
1) Open up a record in the flat text editor
2) Make some trivial little change.
3) Click Save.
4) Notice that the fields save with the dollar signs in them! The record summary has all sorts of $ in it, and the field winds up looking like this in the biblio.record_entry.marc field in the database:

<datafield tag="245" ind1="0" ind2="3"><subfield code="a">$aLe concerto /$cGuy Ferchault</subfield>

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

Thanks, Jane! The delimiter issue was an oversight on my part -- I missed one of the declarations.

Fixed and rebased branch pushed:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1834665-ang-marc-flat-editor-2

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Works well for me. Signoff branch here: user/sandbergja/lp1834665-ang-marc-flat-editor-signoff

Thanks for porting this interface, Bill!

tags: added: signedoff
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Jane. Merged to 3.3+.

Changed in evergreen:
status: New → Fix Committed
assignee: Bill Erickson (berick) → 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.