Skip to content

Commit

Permalink
Merge branch 'main' into qa
Browse files Browse the repository at this point in the history
* main: (53 commits)
  Add hasElectronicResouces getter
  Use standalone link type for eResources link
  Use standalone link type for eResources link
  Use standalone type for Link
  Use SearchResult type and cast in SearchResult test
  Add test for view all link
  Render the View All link for search results
  Add tests for correct label
  Add tests for correct label
  Add tests for correct label
  Add EDD component
  Add test for items with missing shelfMark and URI
  Add test for items with missing shelfMark and URI
  Making breadcrumb and subnav links have a white color focus ring for accessibility
  Making breadcrumb and subnav links have a white color focus ring for accessibility
  Add initial tests for getSortableShelfMark
  Add tests for formatShelfMarkForSort
  Sort items in the Bib class item preprocessor
  Add preprocessing functions for shelfMark in Item class and utils
  Removing from temp advance search page
  ...
  • Loading branch information
EdwinGuzman committed Dec 18, 2023
2 parents a50580f + 5764ef6 commit 695acbd
Show file tree
Hide file tree
Showing 33 changed files with 1,649 additions and 8,732 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"git.ignoreLimitWarning": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
99 changes: 99 additions & 0 deletions __test__/fixtures/itemFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,102 @@ export const itemNYPLReCAP = {
"@value": "10572546",
},
}

export const itemNoShelfMark = {
"@id": "res:i10572546",
"@type": ["bf:Item"],
accessMessage: [
{
"@id": "accessMessage:2",
prefLabel: "Request in advance",
},
],
catalogItemType: [
{
"@id": "catalogItemType:55",
prefLabel: "book, limited circ, MaRLI",
},
],
eddRequestable: true,
formatLiteral: ["Text"],
holdingLocation: [
{
"@id": "loc:rc2ma",
prefLabel: "Offsite",
},
],
idBarcode: ["33433077546822"],
owner: [
{
"@id": "orgs:1000",
prefLabel: "Stephen A. Schwarzman Building",
},
],
physRequestable: true,
physicalLocation: [
"VTI (Prezzolini, G. History of spaghetti eating and cooking for: spaghetti dinner)",
],
recapCustomerCode: ["NA"],
requestable: [true],
specRequestable: false,
status: [
{
"@id": "status:a",
prefLabel: "Available",
},
],
uri: "i10572546",
idNyplSourceId: {
"@type": "SierraNypl",
"@value": "10572546",
},
}

export const itemNoShelfMarkNoURI = {
"@id": "res:i10572546",
"@type": ["bf:Item"],
accessMessage: [
{
"@id": "accessMessage:2",
prefLabel: "Request in advance",
},
],
catalogItemType: [
{
"@id": "catalogItemType:55",
prefLabel: "book, limited circ, MaRLI",
},
],
eddRequestable: true,
formatLiteral: ["Text"],
holdingLocation: [
{
"@id": "loc:rc2ma",
prefLabel: "Offsite",
},
],
idBarcode: ["33433077546822"],
owner: [
{
"@id": "orgs:1000",
prefLabel: "Stephen A. Schwarzman Building",
},
],
physRequestable: true,
physicalLocation: [
"VTI (Prezzolini, G. History of spaghetti eating and cooking for: spaghetti dinner)",
],
recapCustomerCode: ["NA"],
requestable: [true],
specRequestable: false,
status: [
{
"@id": "status:a",
prefLabel: "Available",
},
],
idNyplSourceId: {
"@type": "SierraNypl",
"@value": "10572546",
},
}
240 changes: 239 additions & 1 deletion __test__/fixtures/searchResultElectronicResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const searchResultElectronicResources = {
electronicResources: [
{
title: "Access eNYPL",
url: "http://link.overdrive.com/?websiteId=37&titleId=5312492",
url: "https://link.overdrive.com/?websiteId=37&titleId=5312492",
prefLabel: "Access eNYPL",
},
],
Expand Down Expand Up @@ -114,3 +114,241 @@ export const searchResultElectronicResources = {
hasItemVolumes: false,
hasItemDates: false,
}

export const searchResultElectronicResourcesNoLabel = {
"@type": ["nypl:Item", "nypl:Resource"],
"@id": "res:b22133121",
carrierType: [
{
"@id": "carriertypes:nc",
prefLabel: "volume",
},
],
contributorLiteral: [
"Acosta, María",
"Gomez, Vanessa, 1984-",
"OverDrive, Inc.",
],
createdString: ["2019"],
createdYear: 2019,
creatorLiteral: ["Persico, Nicky"],
dateStartYear: 2019,
dateString: ["2019"],
description: [
"Un abogado en prácticas inexperto y un poco torpe se ve involucrado en la defensa de dos mujeres muy diferentes entre ellas por edad y clase social, unidas por el hecho de ser ambas víctimas de la violencia. A partir de aquí se desenmaraña, aderezado por intrigantes mezclas culinarias, un denso entramado de historias y personas que, entre el suspense y la gravedad, se adentra en el fenómeno del acoso y de la manipulación por medio de una sucesión de eventos destinados a revelar una realidad insospechable. En una encantadora Puglia, descripta de manera cuanto menos original, Nicky Persico guía al lector a través de un mundo de individuos peligrosos (enemigos invisibles ante los ojos de todo el mundo, y sin embargo envidiosos de la vida y la vitalidad de las víctimas que persiguen) proponiendo la receta que su protagonista ha ideado para transformar elementos triviales en filosofía de vida: los Spaghetti Paradiso.",
],
electronicResources: [
{
title: "Access eNYPL",
url: "https://link.overdrive.com/?websiteId=37&titleId=5312492",
},
],
extent: [
"1 online resource (1 sound file (06 hr., 55 min., 34 sec.)) : digital",
],
genreForm: ["Audiobooks.", "Fiction."],
idIsbn: ["9788835401155", "8835401151"],
idOclc: ["1144496190"],
identifier: [
{
"@type": "nypl:Bnumber",
"@value": "22133121",
},
{
"@type": "bf:Isbn",
"@value": "9788835401155",
},
{
"@type": "bf:Isbn",
"@value": "8835401151",
},
{
"@type": "nypl:Oclc",
"@value": "1144496190",
},
{
"@type": "nypl:Oclc",
"@value": "1144496190",
},
{
"@type": "bf:Identifier",
"@value": "(OCoLC)1144496190",
},
],
issuance: [
{
"@id": "urn:biblevel:m",
prefLabel: "monograph/item",
},
],
items: [],
language: [
{
"@id": "lang:spa",
prefLabel: "Spanish",
},
],
lccClassification: ["PQ4916.E778 S63 2019"],
materialType: [
{
"@id": "resourcetypes:aud",
prefLabel: "Audio",
},
],
mediaType: [
{
"@id": "mediatypes:n",
prefLabel: "unmediated",
},
],
numAvailable: 0,
numCheckinCardItems: 0,
numElectronicResources: 1,
numItemDatesParsed: 0,
numItemVolumesParsed: 0,
numItems: 0,
numItemsMatched: 0,
numItemsTotal: 0,
nyplSource: ["sierra-nypl"],
placeOfPublication: ["[Solon, Ohio]"],
publicationStatement: ["[Solon, Ohio] : Tektime, 2019."],
publisherLiteral: ["Tektime"],
subjectLiteral: [
"Sexual harassment of women -- Fiction.",
"Sexual harassment of women.",
"Puglia (Italy) -- Fiction.",
"Italy -- Puglia.",
],
title: ["Spaghetti paradiso"],
titleDisplay: [
"Spaghetti paradiso / Nicky Persico ; traducción por: María Acosta.",
],
type: ["nypl:Item"],
updatedAt: 1681346906709,
uri: "b22133121",
suppressed: false,
hasItemVolumes: false,
hasItemDates: false,
}

export const searchResultMultipleElectronicResources = {
"@type": ["nypl:Item", "nypl:Resource"],
"@id": "res:b22133121",
carrierType: [
{
"@id": "carriertypes:nc",
prefLabel: "volume",
},
],
contributorLiteral: [
"Acosta, María",
"Gomez, Vanessa, 1984-",
"OverDrive, Inc.",
],
createdString: ["2019"],
createdYear: 2019,
creatorLiteral: ["Persico, Nicky"],
dateStartYear: 2019,
dateString: ["2019"],
description: [
"Un abogado en prácticas inexperto y un poco torpe se ve involucrado en la defensa de dos mujeres muy diferentes entre ellas por edad y clase social, unidas por el hecho de ser ambas víctimas de la violencia. A partir de aquí se desenmaraña, aderezado por intrigantes mezclas culinarias, un denso entramado de historias y personas que, entre el suspense y la gravedad, se adentra en el fenómeno del acoso y de la manipulación por medio de una sucesión de eventos destinados a revelar una realidad insospechable. En una encantadora Puglia, descripta de manera cuanto menos original, Nicky Persico guía al lector a través de un mundo de individuos peligrosos (enemigos invisibles ante los ojos de todo el mundo, y sin embargo envidiosos de la vida y la vitalidad de las víctimas que persiguen) proponiendo la receta que su protagonista ha ideado para transformar elementos triviales en filosofía de vida: los Spaghetti Paradiso.",
],
electronicResources: [
{
title: "Electronic Resource 1",
url: "https://link.overdrive.com/?websiteId=37&titleId=5312493",
prefLabel: "Electronic Resource 1",
},
{
title: "Access eNYPL",
url: "https://link.overdrive.com/?websiteId=37&titleId=5312494",
prefLabel: "Electronic Resource 2",
},
],
extent: [
"1 online resource (1 sound file (06 hr., 55 min., 34 sec.)) : digital",
],
genreForm: ["Audiobooks.", "Fiction."],
idIsbn: ["9788835401155", "8835401151"],
idOclc: ["1144496190"],
identifier: [
{
"@type": "nypl:Bnumber",
"@value": "22133121",
},
{
"@type": "bf:Isbn",
"@value": "9788835401155",
},
{
"@type": "bf:Isbn",
"@value": "8835401151",
},
{
"@type": "nypl:Oclc",
"@value": "1144496190",
},
{
"@type": "nypl:Oclc",
"@value": "1144496190",
},
{
"@type": "bf:Identifier",
"@value": "(OCoLC)1144496190",
},
],
issuance: [
{
"@id": "urn:biblevel:m",
prefLabel: "monograph/item",
},
],
items: [],
language: [
{
"@id": "lang:spa",
prefLabel: "Spanish",
},
],
lccClassification: ["PQ4916.E778 S63 2019"],
materialType: [
{
"@id": "resourcetypes:aud",
prefLabel: "Audio",
},
],
mediaType: [
{
"@id": "mediatypes:n",
prefLabel: "unmediated",
},
],
numAvailable: 0,
numCheckinCardItems: 0,
numElectronicResources: 1,
numItemDatesParsed: 0,
numItemVolumesParsed: 0,
numItems: 0,
numItemsMatched: 0,
numItemsTotal: 0,
nyplSource: ["sierra-nypl"],
placeOfPublication: ["[Solon, Ohio]"],
publicationStatement: ["[Solon, Ohio] : Tektime, 2019."],
publisherLiteral: ["Tektime"],
subjectLiteral: [
"Sexual harassment of women -- Fiction.",
"Sexual harassment of women.",
"Puglia (Italy) -- Fiction.",
"Italy -- Puglia.",
],
title: ["Spaghetti paradiso"],
titleDisplay: [
"Spaghetti paradiso / Nicky Persico ; traducción por: María Acosta.",
],
type: ["nypl:Item"],
updatedAt: 1681346906709,
uri: "b22133121",
suppressed: false,
hasItemVolumes: false,
hasItemDates: false,
}
Loading

0 comments on commit 695acbd

Please sign in to comment.