Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scc 4345/add record type #422

Merged
merged 11 commits into from
Dec 6, 2024
Merged

Scc 4345/add record type #422

merged 11 commits into from
Dec 6, 2024

Conversation

charmingduchess
Copy link
Contributor

  • update nypl core version to 2.22
  • add recordType with json LD namespace and nypl core label to resources bib response
  • add recordType to filters
  • add recrodType to search aggregations
    • I couldn't find where in the code to verify this in tests, but I did verify with a local invocation of the app.

@@ -280,6 +286,13 @@ class ResourceSerializer extends JsonLdItemSerializer {
}
}

ResourceSerializer.getFormattedRecordType = function (recordTypeId) {
return {
'@id': 'recordType:' + recordTypeId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the recordType: namespace here. 1) it's not a namespace we define anywhere, and 2) we're don't appear to be doing the same thing in the aggregation. So just drop the recordType:?

Alternatively, to make this more consistent and json-ld-ish:

  • add same namespace to the recordType aggregation values
  • ensure that when ?filters[recordType]= is used, we allow the namespace to be optionally used in ids, i.e. stripped, so that front-end doesn't need to remove it when filtering
  • add namespace definition to relevant context file ("recordType": "nypl:recordType")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i opt for the first! makes sense.

@@ -485,6 +498,10 @@ class AggregationSerializer extends JsonLdItemSerializer {
} else if (field === 'buildingLocation') {
// Build buildingLocation agg labels from nypl-core:
v.label = locations[v.value]?.label
} else if (field === 'recordType') {
console.log(v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@charmingduchess charmingduchess merged commit def2e6a into main Dec 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants