Skip to content

Commit

Permalink
Merge pull request #884 from danskernesdigitalebibliotek/release/2024…
Browse files Browse the repository at this point in the history
…-4-0

Release 2024.4.0
  • Loading branch information
kasperg authored Jan 22, 2024
2 parents ea795ff + ce1aef9 commit 78d8f3a
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 204 deletions.
115 changes: 59 additions & 56 deletions cypress/fixtures/material/open-order/fbi-api.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"data": {
"work": {
"workId": "work-of:870970-basis:135721719",
"workId": "work-of:870970-basis:44926407",
"titles": {
"full": [
"Restyle & restitch for little ones : 30 simple projects from preloved clothes"
"Duchess of Death : the unauthorized biography of Agatha Christie"
],
"original": []
},
"abstract": [
"30 sewing projects for creating stylish baby clothes, from newborns to two-year-olds, including trousers, dresses, sweaters, mittens, rompers and socks. The projects are accompanied by colourful, full-size patterns to help you make the most of your repurposed clothing."
"Summary: Utilizing over 5,000 previously unpublished letters, notes, and documents, the author tells how Christie's life was \"as full of romance, travel, wealth, and scandal as any mystery Christie ever crafted.\" -- from publisher description."
],
"creators": [
{
"display": "Linnea Larsson",
"display": "Richard Hack",
"__typename": "Person"
}
],
"series": [],
"seriesMembers": [],
"workYear": null,
"genreAndForm": ["snitmønstre", "vejledninger"],
"genreAndForm": ["biografier", "bibliografier"],
"manifestations": {
"all": [
{
"pid": "870970-basis:135721719",
"genreAndForm": ["snitmønstre", "vejledninger"],
"pid": "870970-basis:44926407",
"genreAndForm": ["biografier"],
"source": ["Bibliotekskatalog"],
"languages": {
"main": [
Expand All @@ -36,7 +36,7 @@
]
},
"titles": {
"main": ["Restyle & restitch for little ones"],
"main": ["Duchess of Death"],
"original": []
},
"fictionNonfiction": {
Expand All @@ -50,21 +50,21 @@
],
"creators": [
{
"display": "Linnea Larsson",
"display": "Richard Hack",
"__typename": "Person"
}
],
"publisher": ["Search"],
"publisher": ["JR Books"],
"identifiers": [
{
"value": "9781800921191"
"value": "9781906779832"
}
],
"contributors": [],
"edition": {
"summary": "2023",
"summary": "1. edition, 2010",
"publicationYear": {
"display": "2023"
"display": "2010"
}
},
"dateFirstEdition": null,
Expand All @@ -73,7 +73,7 @@
},
"physicalDescriptions": [
{
"numberOfPages": 124,
"numberOfPages": 325,
"playingTime": null
}
],
Expand All @@ -89,19 +89,19 @@
}
],
"shelfmark": {
"postfix": "Larsson",
"shelfmark": "64.62"
"postfix": "Hack",
"shelfmark": "99.4 Christie, Agatha"
},
"workYear": null,
"catalogueCodes": {
"nationalBibliography": [],
"otherCatalogues": ["OVE202314"]
"otherCatalogues": ["OVE999999"]
}
}
],
"latest": {
"pid": "870970-basis:135721719",
"genreAndForm": ["snitmønstre", "vejledninger"],
"pid": "870970-basis:44926407",
"genreAndForm": ["biografier"],
"source": ["Bibliotekskatalog"],
"languages": {
"main": [
Expand All @@ -112,7 +112,7 @@
]
},
"titles": {
"main": ["Restyle & restitch for little ones"],
"main": ["Duchess of Death"],
"original": []
},
"fictionNonfiction": {
Expand All @@ -126,21 +126,21 @@
],
"creators": [
{
"display": "Linnea Larsson",
"display": "Richard Hack",
"__typename": "Person"
}
],
"publisher": ["Search"],
"publisher": ["JR Books"],
"identifiers": [
{
"value": "9781800921191"
"value": "9781906779832"
}
],
"contributors": [],
"edition": {
"summary": "2023",
"summary": "1. edition, 2010",
"publicationYear": {
"display": "2023"
"display": "2010"
}
},
"dateFirstEdition": null,
Expand All @@ -149,7 +149,7 @@
},
"physicalDescriptions": [
{
"numberOfPages": 124,
"numberOfPages": 325,
"playingTime": null
}
],
Expand All @@ -165,18 +165,18 @@
}
],
"shelfmark": {
"postfix": "Larsson",
"shelfmark": "64.62"
"postfix": "Hack",
"shelfmark": "99.4 Christie, Agatha"
},
"workYear": null,
"catalogueCodes": {
"nationalBibliography": [],
"otherCatalogues": ["OVE202314"]
"otherCatalogues": ["OVE999999"]
}
},
"bestRepresentation": {
"pid": "870970-basis:135721719",
"genreAndForm": ["snitmønstre", "vejledninger"],
"pid": "870970-basis:44926407",
"genreAndForm": ["biografier"],
"source": ["Bibliotekskatalog"],
"languages": {
"main": [
Expand All @@ -187,7 +187,7 @@
]
},
"titles": {
"main": ["Restyle & restitch for little ones"],
"main": ["Duchess of Death"],
"original": []
},
"fictionNonfiction": {
Expand All @@ -201,21 +201,21 @@
],
"creators": [
{
"display": "Linnea Larsson",
"display": "Richard Hack",
"__typename": "Person"
}
],
"publisher": ["Search"],
"publisher": ["JR Books"],
"identifiers": [
{
"value": "9781800921191"
"value": "9781906779832"
}
],
"contributors": [],
"edition": {
"summary": "2023",
"summary": "1. edition, 2010",
"publicationYear": {
"display": "2023"
"display": "2010"
}
},
"dateFirstEdition": null,
Expand All @@ -224,7 +224,7 @@
},
"physicalDescriptions": [
{
"numberOfPages": 124,
"numberOfPages": 325,
"playingTime": null
}
],
Expand All @@ -240,13 +240,13 @@
}
],
"shelfmark": {
"postfix": "Larsson",
"shelfmark": "64.62"
"postfix": "Hack",
"shelfmark": "99.4 Christie, Agatha"
},
"workYear": null,
"catalogueCodes": {
"nationalBibliography": [],
"otherCatalogues": ["OVE202314"]
"otherCatalogues": ["OVE999999"]
}
}
},
Expand All @@ -264,42 +264,45 @@
"subjects": {
"all": [
{
"display": "syning"
"display": "forfattere"
},
{
"display": "børnetøj"
"display": "kriminalforfattere"
},
{
"display": "genbrug"
"display": "England"
},
{
"display": "genbrugstøj"
"display": "Authors, English -- 20th century -- Biography"
},
{
"display": "tekstiler"
"display": "Detective and mystery stories -- Authorship"
},
{
"display": "upcycling"
"display": "Agatha Christie (1890-1976)"
},
{
"display": "Agatha Christie"
},
{
"display": "1900-tallet"
}
],
"dbcVerified": [
{
"display": "syning"
},
{
"display": "børnetøj"
"display": "forfattere"
},
{
"display": "genbrug"
"display": "kriminalforfattere"
},
{
"display": "genbrugstøj"
"display": "England"
},
{
"display": "tekstiler"
"display": "Agatha Christie"
},
{
"display": "upcycling"
"display": "1900-tallet"
}
]
},
Expand All @@ -308,7 +311,7 @@
"code": "NONFICTION"
},
"dk5MainEntry": {
"display": "64.62 Syning af børnetøj"
"display": "99.4 Christie, Agatha"
},
"relations": {
"hasReview": [],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"prop-types": "Since we use former ddb-react components that depend on prop-types we keep this. Should be removed when usage of prop-types is deprecated."
},
"dependencies": {
"@danskernesdigitalebibliotek/dpl-design-system": "^2024.2.0-5f768839509efac19487828c1bf4d080c146bf47",
"@danskernesdigitalebibliotek/dpl-design-system": "^2024.4.0-174d424951b2cc03e92bd2522b707f59226e8f12",
"@reach/alert": "^0.17.0",
"@reach/dialog": "^0.18.0",
"@reduxjs/toolkit": "^1.9.7",
Expand Down
7 changes: 1 addition & 6 deletions src/apps/material/material.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,6 @@ export default {
defaultValue: "Order from another library:",
control: { type: "text" }
},
openOrderResponseIsReservedForYouText: {
name: "Reservation Success Title",
defaultValue: "is ordered to your library",
control: { type: "text" }
},
openOrderAuthenticationErrorText: {
name: "Open order authentication error text",
defaultValue: "Authentication error occurred",
Expand Down Expand Up @@ -903,5 +898,5 @@ Underverden.args = {

export const overbygningsMatriale = Template.bind({});
overbygningsMatriale.args = {
wid: "work-of:870970-basis:135721719"
wid: "work-of:870970-basis:44926407"
};
1 change: 0 additions & 1 deletion src/apps/material/material.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ interface MaterialEntryTextProps {
openOrderOrsErrorText: string;
openOrderOwnedOwnCatalogueText: string;
openOrderOwnedWrongMediumtypeText: string;
openOrderResponseIsReservedForYouText: string;
openOrderResponseTitleText: string;
openOrderServiceUnavailableText: string;
openOrderStatusOwnedAcceptedText: string;
Expand Down
21 changes: 20 additions & 1 deletion src/components/material/material-buttons/MaterialButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import * as React from "react";
import { FC } from "react";
import { AccessTypeCode } from "../../../core/dbc-gateway/generated/graphql";
import { getAllFaustIds } from "../../../core/utils/helpers/general";
import {
getAllFaustIds,
getManifestationType
} from "../../../core/utils/helpers/general";
import { ButtonSize } from "../../../core/utils/types/button";
import { Manifestation } from "../../../core/utils/types/entities";
import { hasCorrectAccess, hasCorrectAccessType, isArticle } from "./helper";
import { WorkId } from "../../../core/utils/types/ids";
import MaterialButtonsOnline from "./online/MaterialButtonsOnline";
import MaterialButtonsFindOnShelf from "./physical/MaterialButtonsFindOnShelf";
import MaterialButtonsPhysical from "./physical/MaterialButtonsPhysical";
import MaterialButtonReservableFromAnotherLibrary from "./physical/MaterialButtonReservableFromAnotherLibrary";
import useReservableFromAnotherLibrary from "../../../core/utils/useReservableFromAnotherLibrary";

export interface MaterialButtonsProps {
manifestations: Manifestation[];
Expand All @@ -29,6 +34,20 @@ const MaterialButtons: FC<MaterialButtonsProps> = ({
// We don't want to show physical buttons/find on shelf for articles because
// articles appear as a part of journal/periodical publications and can't be
// physically loaned for themseleves.

const reservablePidsFromAnotherLibrary =
useReservableFromAnotherLibrary(manifestations);

if (reservablePidsFromAnotherLibrary.length > 0) {
return (
<MaterialButtonReservableFromAnotherLibrary
size={size}
manifestationMaterialType={getManifestationType(manifestations)}
faustIds={faustIds}
/>
);
}

return (
<>
{hasCorrectAccessType(AccessTypeCode.Physical, manifestations) &&
Expand Down
Loading

0 comments on commit 78d8f3a

Please sign in to comment.