STORY: Lookups | Adding Code

Description

Description

Card originally written to update drop down for the Place of Origin component, so that corresponding codes are displayed in the drop down, and allow the cataloger to input a code for selecting a value.

A number of other components have similar requirements, so this card is being repurposed to apply a general rule for any such drop down.

 

INSTANCE

Immediate source of acquisition

 

Purpose:

The purpose of this story is to enhance the Place of Origin of the Work functionality, to provide an additional option for catalogers to complete their work.

Currently, the component displays a drop down list of countries based on a controlled list maintained by the Library of Congress: https://id.loc.gov/vocabulary/countries.html

Catalogers can either type in the name of the country, or select the value from the drop down.

This card adds a third option: selecting a value by typing the code associated with the country. MARVA supports this functionality today. The country code is appended in parenthesis alongside the country name. Doing so preserves displaying countries alphabetically by country name, while allowing the end user to type the country code as another way to select a value from the list.

image-20240610-210559.png

A JSON file (conveniently) associates country codes with display names: https://id.loc.gov/vocabulary/countries.json

To update and construct a new drop down table for the editor, the code will need to be extracted from the end of each value pointing to id.loc.gov, and appended within parenthesis to the corresponding country name.

image-20240610-210853.png

Once constructed, the end user will have the ability to type any either a country name, or a country code and the drop down list will narrow accordingly.

Environment

None

Potential Workaround

None

Attachments

25
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 05 Jul 2024, 10:10 AM
  • 02 Jul 2024, 04:31 PM
  • 02 Jul 2024, 04:31 PM

Checklist

hide

Activity

Show:

Tetiana KovalchukJuly 5, 2024 at 10:36 AM

Tested on qld env

Build version: #304

Test cases and evidences attached.

Some issues related to lookups but not to the scope of current story are created as defects and linked.

Tetiana KovalchukJuly 5, 2024 at 10:09 AM

Verified scenario with contentType mentioned by below.

Work1 -7100824613169816150 created through Linked Data Editor contains content -1049847018111136996.

Work2 7497293532765928992 created though Inventory contains the same content -1049847018111136996.

Tetiana KovalchukJuly 3, 2024 at 7:23 AM
Edited

this particular story says about adding codes for lookups on front-end. It doesn’t include any scenarios with rules for sending code to BE.

To me described scenario doesn’t look related and should be covered separately.

Siarhei KarolJuly 3, 2024 at 7:01 AM

I'll fix it as part of this ticket

Punnoose Kutty Jacob PullolickalJuly 2, 2024 at 4:31 PM
Edited

Hi

I realized that we overlooked one scenario when working on this ticket.

Let us take two Works, whose content type is ‘text’

  • Work #1: Created through linked data editor

  • Work #2: Created through MARC import (quick marc)

After this change, the structure of the graph will be as follows.

 

image-20240702-163048.png

 

This graph is incorrect as we have two category resources for content type “text”.

The correct graph should be as follows

 

image-20240702-163009.png

 

In order to create the correct graph, UI should not send the code to backend when making PUT & POST API request. The code should be used only for display purpose. Should we create a separate ticket for that? Or can we fix it as part of this ticket?

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Citation

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created June 10, 2024 at 8:46 PM
Updated July 23, 2024 at 5:27 PM
Resolved July 5, 2024 at 12:50 PM
TestRail: Cases
TestRail: Runs

Flag notifications