Skip to content

Commit

Permalink
Merge pull request #395 from NYPL/hold-pages
Browse files Browse the repository at this point in the history
Hold pages
  • Loading branch information
dgcohen authored Nov 19, 2024
2 parents 931c537 + 7e9abd8 commit d4e6280
Show file tree
Hide file tree
Showing 35 changed files with 1,675 additions and 56 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
push:
branches:
- qa
- SCC-4218/move-rc-from-travis-to-github-actions

permissions:
id-token: write
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/deploy_train.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Deploys to research-catalog-train
name: deploy train

on:
push:
branches:
- train
- set-up-train-env
- hold-pages

permissions:
id-token: write
contents: read

env:
AWS_DEFAULT_REGION: us-east-1
LOCAL_TAG_NAME: research-catalog:${{ github.ref_name }}-${{ github.run_number }}
ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:train-latest

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::946183545209:role/GithubActionsDeployerRole
aws-region: us-east-1

- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build and push Docker image to Amazon ECR
run: |
docker build --build-arg NEXT_PUBLIC_APP_ENV=qa --tag $LOCAL_TAG_NAME .
docker tag $LOCAL_TAG_NAME $ECR_URL
# Re-tag last latest image just in case
MANIFEST=$(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="train-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest')
aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="train-previous" || true
aws ecr put-image --repository-name research-catalog --image-tag "train-previous" --image-manifest "$MANIFEST" || true
docker push $ECR_URL
- name: Update ECS service
run: |
aws ecs update-service --cluster research-catalog-train --service research-catalog-train --force-new-deployment
24 changes: 16 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Holding location filters to refine search and advanced search panels
- "Go back" button to advanced search

## Updated
### Added

- Add server side delivery location fetch and location utils (SCC-3759)
- Add holding location filters to refine search and advanced search panels
- Add go back button to advanced search

### Updated

- Better handling of bibs with no titles in SearchResultsBib model
- Moved closedLocations from environment variables to appConfig (SCC-3759)
- Better handling of bibs with no titles in SearchResultsBib model
- Create reusable save/cancel button group
- Extract checkbox groups from refine search and advanced search
- Fetch delivery locations and pass to radios in hold request page (SCC-3759)

## [1.3.5] 2024-10-23

Expand All @@ -27,18 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Call number search scope to search dropdown options [(SCC-4260)](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4260)
- Search tip per search scope [(SCC-4263)](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4263)

### Added

- Add server side delivery location fetch and location utils (SCC-3759)
### Fixed

### Updated
- Fix 500 error caused by assumption in buildHoldingDetails that location field will be present in the bib holdings returned from discovery (SCC-4314)

- Moved closedLocations from environment variables to appConfig (SCC-3759)
### [1.3.4] Hotfix 2024-10-17

### Fixed

### [1.3.4] Hotfix 2024-10-17

- Fix 500 error caused by assumption in buildHoldingDetails that location field will be present in the bib holdings returned from discovery (SCC-4314)

## [1.3.3] 2024-10-10
Expand Down Expand Up @@ -83,6 +88,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update error message in Item Filter Year to include new error message prefix from the DS.
- Integrate view_all query param on client side and remove batched fetch (SCC-4287)
- Replaced travis with github actions (SCC-4218)
- Sentence case and rearrange search options (SCC-4260)
- Call number search scope to search dropdown options [(SCC-4260)](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4260)
- Search tip per search scope [(SCC-4263)](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4263)

## [1.2.4] 2024-08-29

Expand Down
217 changes: 217 additions & 0 deletions __test__/fixtures/bibFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11805,3 +11805,220 @@ export const bibWithSubjectHeadings = {
],
},
}

export const bibWithSingleAeonItem = {
resource: {
"@context":
"http://discovery-api-qa.nypl.org/api/v0.1/discovery/context_all.jsonld",
"@type": ["nypl:Item", "nypl:Resource"],
"@id": "res:b21086080",
buildingLocationIds: ["rc"],
carrierType: [
{
"@id": "carriertypes:nc",
prefLabel: "volume",
},
],
contributorLiteral: ["Street & Smith, publisher."],
createdString: [1939],
createdYear: 1939,
dateEndString: [1941],
dateEndYear: 1941,
dateStartYear: 1939,
dateString: [1939],
dimensions: ["24 cm"],
extent: ["v. : ill. ;"],
genreForm: ["Fantasy fiction.", "Horror fiction.", "Periodicals."],
idOclc: [20989396],
identifier: [
{
"@type": "bf:ShelfMark",
"@value": "ReCAP 16-24063",
},
{
"@type": "nypl:Bnumber",
"@value": 21086080,
},
{
"@type": "nypl:Oclc",
"@value": 20989396,
},
{
"@type": "bf:Identifier",
"@value": "(OCoLC)20989396",
},
],
issuance: [
{
"@id": "urn:biblevel:s",
prefLabel: "serial",
},
],
itemAggregations: [
{
"@type": "nypl:Aggregation",
"@id": "res:location",
id: "location",
field: "location",
values: [
{
value: "loc:rcmr2",
count: 1,
label: "Offsite",
},
],
},
{
"@type": "nypl:Aggregation",
"@id": "res:format",
id: "format",
field: "format",
values: [
{
value: "Text",
count: 1,
label: "Text",
},
],
},
{
"@type": "nypl:Aggregation",
"@id": "res:status",
id: "status",
field: "status",
values: [
{
value: "status:a",
count: 1,
label: "Available",
},
],
},
],
items: [
{
"@id": "res:i34439033",
"@type": ["bf:Item"],
accessMessage: [
{
"@id": "accessMessage:1",
prefLabel: "Use in library",
},
],
aeonUrl: [
"https://specialcollections.nypl.org/aeon/Aeon.dll?Action=10&CallNumber=ReCAP+16-24063+&Date=1939&Form=30&Genre=serial&ItemInfo1=Use+in+library&ItemInfo3=https%3A%2F%2Fcatalog.nypl.org%2Frecord%3Db21086080&ItemISxN=i344390330&ItemNumber=33433117357388&ItemPlace=New+York&ItemPublisher=Street+%26+Smith%2C+1939-1941.&ItemVolume=Avon+science+fiction+-+Wonder+stories&Location=ReCAP&ReferenceNumber=b210860807&Site=SASRB&SubLocation=rcmr2&Title=Street+%26+Smith%27s+Unknown.",
],
catalogItemType: [
{
"@id": "catalogItemType:3",
prefLabel: "serial",
},
],
eddRequestable: false,
enumerationChronology: ["Avon science fiction - Wonder stories"],
formatLiteral: ["Text"],
holdingLocation: [
{
"@id": "loc:rcmr2",
prefLabel: "Offsite",
endpoint: null,
},
],
idBarcode: [33433117357388],
identifier: [
{
"@type": "bf:ShelfMark",
"@value": "ReCAP 16-24063 Avon science fiction - Wonder stories",
},
{
"@type": "bf:Barcode",
"@value": 33433117357388,
},
],
owner: [
{
"@id": "orgs:1000",
prefLabel: "Stephen A. Schwarzman Building",
},
],
physRequestable: false,
physicalLocation: ["ReCAP 16-24063 "],
recapCustomerCode: ["NQ"],
requestable: [true],
shelfMark: ["ReCAP 16-24063 Avon science fiction - Wonder stories"],
specRequestable: true,
status: [
{
"@id": "status:a",
prefLabel: "Available",
},
],
uri: "i34439033",
idNyplSourceId: {
"@type": "SierraNypl",
"@value": 34439033,
},
},
],
language: [
{
"@id": "lang:eng",
prefLabel: "English",
},
],
lccClassification: ["PZ1.Z9 U5"],
materialType: [
{
"@id": "resourcetypes:txt",
prefLabel: "Text",
},
],
mediaType: [
{
"@id": "mediatypes:n",
prefLabel: "unmediated",
},
],
note: [
{
noteType: "Source of Description",
"@type": "bf:Note",
prefLabel: "Description based on: v. 4 n. 4 (Dec. 1940).",
},
{
noteType: "Source of Description",
"@type": "bf:Note",
prefLabel: "Latest issue consulted: v. 5 n. 2 (Aug. 1941).",
},
],
numCheckinCardItems: 0,
numElectronicResources: 0,
numItemDatesParsed: 0,
numItemVolumesParsed: 0,
numItemsMatched: 1,
numItemsTotal: 1,
nyplSource: ["sierra-nypl"],
placeOfPublication: ["New York"],
publicationStatement: ["New York : Street & Smith, 1939-1941."],
publisherLiteral: ["Street & Smith"],
serialPublicationDates: [
"Began with Mar. 1939; ceased with Aug. 1941 issue. Cf. Pulp magazine quick reference guide.",
],
shelfMark: ["ReCAP 16-24063"],
subjectLiteral: [
"Fantasy fiction -- Periodicals.",
"Horror tales -- Periodicals.",
],
title: ["Street & Smith's Unknown."],
titleAlt: ["Unknown"],
titleDisplay: ["Street & Smith's Unknown."],
type: ["nypl:Item"],
updatedAt: 1712871163628,
uri: "b21086080",
updatedAtDate: "2024-04-11T21:32:43.628Z",
hasItemVolumes: false,
hasItemDates: false,
electronicResources: [],
subjectHeadings: null,
},
}
27 changes: 27 additions & 0 deletions __test__/pages/hold/confirmation.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import HoldConfirmationPage from "../../../pages/hold/confirmation/[id]"
import { render, screen } from "../../../src/utils/testUtils"

describe("Hold Confirmation page", () => {
describe("Hold Confirmation page UI", () => {
beforeEach(() => {
render(<HoldConfirmationPage />)
})

it("renders an H2", () => {
expect(screen.getAllByRole("heading", { level: 2 })[0]).toHaveTextContent(
"Request for on-site use"
)
})

it("renders a success banner", () => {
expect(screen.getAllByRole("heading", { level: 2 })[1]).toHaveTextContent(
"Request successful"
)
})
it("renders a faq accordion", () => {
expect(screen.getByRole("heading", { level: 3 })).toHaveTextContent(
"Frequently asked questions"
)
})
})
})
Loading

0 comments on commit d4e6280

Please sign in to comment.