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

Release 2024.37.0 #1420

Merged
merged 51 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
44510dc
Add author name at the end of the find on shelf location string
Adamik10 Jun 14, 2024
dabf018
Merge pull request #1275 from danskernesdigitalebibliotek/add-author-…
Adamik10 Jun 17, 2024
b17a379
Show "1 (item) home" in find-on-shelf modal on mobile instead of "1"
Adamik10 Jun 17, 2024
ff9fdd8
Use the new find-on-shelf__location-header class in find on shelf list
Adamik10 Jun 17, 2024
a9237e6
Merge pull request #1283 from danskernesdigitalebibliotek/fix/find-on…
Adamik10 Jun 18, 2024
174607d
Merge pull request #1282 from danskernesdigitalebibliotek/add-home-to…
Adamik10 Jun 18, 2024
d9c0873
Introduce creatorsToStringLastNameFirst helper to invert creator names
Adamik10 Jun 18, 2024
e0a0dce
Show first name in last place in find on shelf modal material locations
Adamik10 Jun 18, 2024
cbdbc78
Orevent showing "undefined" on find on shelf modal as location
Adamik10 Jun 20, 2024
a0c5b68
Merge branch 'develop' into feature/find-on-shelf-changes
Adamik10 Aug 5, 2024
b6ea5c9
Add nameSort property on Creators in WorkMedium fragment
Adamik10 Aug 5, 2024
1e49604
Add nameSort prop on ManifestationsSimpleFields fragment & adjust code
Adamik10 Aug 5, 2024
f443233
Introduce capitalizeFirstLetters helper function
Adamik10 Aug 5, 2024
c5dfea0
Introduce flattenCreatorsLastNameFirst() helper & use in find on shelf
Adamik10 Aug 5, 2024
b5b7940
Update vitest snapshot with nameSort prop on "creators" entity
Adamik10 Aug 5, 2024
736ad62
Don't infer type in flattenCreatorsLastNameFirst() unnecessarily
Adamik10 Aug 27, 2024
8b7d177
Refactor MaterialSearchListResults component to use typed variable fo…
Adamik10 Aug 27, 2024
43e0a03
feat: Add getFindOnShelfLocationText helper function
Adamik10 Aug 27, 2024
a8f6cdd
Bump @types/react from 18.3.4 to 18.3.5
dependabot[bot] Sep 2, 2024
f8cd209
Bump postcss from 8.4.41 to 8.4.43
dependabot[bot] Sep 2, 2024
6ba2035
Bump @cypress/code-coverage from 3.12.45 to 3.12.46
dependabot[bot] Sep 2, 2024
1183e64
Bump @types/node from 20.16.1 to 20.16.3
dependabot[bot] Sep 2, 2024
198630d
chore: Update material.dev.tsx with irregular Faust IDs
Adamik10 Sep 2, 2024
1359a93
refactor: Update regular expression to allow hyphens and underscores …
Adamik10 Sep 2, 2024
262d7bb
refactor: Update skeleton loading styles in FavoritesList component
Adamik10 Sep 2, 2024
9d08f8b
Merge branch 'develop' into DDFBRA-23-huskeliste-brugere-far-fejlmedd…
Adamik10 Sep 2, 2024
539faa6
Merge branch 'develop' into feature/find-on-shelf-changes
Adamik10 Sep 3, 2024
ddae4e9
Refactor URL translation logic in MaterialButtonOnlineExternal component
Adamik10 Sep 5, 2024
1701b8d
Bump caniuse-lite from 1.0.30001655 to 1.0.30001658
dependabot[bot] Sep 9, 2024
ff100f0
Bump @cypress/code-coverage from 3.12.46 to 3.12.47
dependabot[bot] Sep 9, 2024
ca6b729
Bump eslint-plugin-import from 2.29.1 to 2.30.0
dependabot[bot] Sep 9, 2024
32a86c0
Bump @types/node from 20.16.3 to 20.16.5
dependabot[bot] Sep 9, 2024
6dab776
Bump cssnano from 7.0.5 to 7.0.6
dependabot[bot] Sep 9, 2024
c0f90c0
Bump eslint-plugin-react from 7.35.0 to 7.35.2
dependabot[bot] Sep 9, 2024
0e81824
Merge pull request #1410 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
a53a1fc
Merge pull request #1412 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
3f32af2
Merge pull request #1416 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
38fe360
Merge pull request #1417 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
13d2630
Merge pull request #1418 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
501aa1c
Bump concurrently from 8.2.2 to 9.0.0
dependabot[bot] Sep 9, 2024
800a259
Bump postcss from 8.4.43 to 8.4.45
dependabot[bot] Sep 9, 2024
7c860a4
Bump sass from 1.77.8 to 1.78.0
dependabot[bot] Sep 9, 2024
12c62d9
Merge pull request #1411 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
2e6a615
Merge pull request #1413 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
23cb1f4
Merge pull request #1414 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
e05fc50
Merge pull request #1415 from danskernesdigitalebibliotek/dependabot/…
kasperg Sep 9, 2024
c7518d0
Merge pull request #1365 from danskernesdigitalebibliotek/feature/fin…
Adamik10 Sep 9, 2024
4901097
Merge pull request #1405 from danskernesdigitalebibliotek/DDFBRA-23-h…
Adamik10 Sep 10, 2024
81435a4
Merge pull request #1408 from danskernesdigitalebibliotek/DDFBRA-41-p…
Adamik10 Sep 10, 2024
fe1e836
Use release 2024.37.0 of the design system
kasperg Sep 10, 2024
22a3df6
Merge pull request #1419 from danskernesdigitalebibliotek/release-202…
kasperg Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@babel/preset-typescript": "^7.24.7",
"@csstools/postcss-sass": "^5.1.1",
"@cypress/browserify-preprocessor": "^3.0.2",
"@cypress/code-coverage": "^3.12.46",
"@cypress/code-coverage": "^3.12.47",
"@graphql-codegen/add": "^3.1.1",
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/introspection": "^2.1.1",
Expand All @@ -75,7 +75,7 @@
"@testing-library/react": "^14.2.2",
"@testing-library/react-hooks": "^8.0.1",
"@tsconfig/create-react-app": "^1.0.2",
"@types/node": "^20.16.3",
"@types/node": "^20.16.5",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@types/react-flatpickr": "^3.8.11",
Expand All @@ -88,13 +88,13 @@
"babel-plugin-istanbul": "^7.0.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"caniuse-lite": "^1.0.30001655",
"caniuse-lite": "^1.0.30001658",
"change-case-all": "^2.1.0",
"chokidar-cli": "^3.0.0",
"concurrently": "^8.2.2",
"concurrently": "^9.0.0",
"core-js": "^3.38.1",
"css-loader": "^7.1.2",
"cssnano": "^7.0.5",
"cssnano": "^7.0.6",
"cypress": "^9.6.1",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
Expand All @@ -103,11 +103,11 @@
"eslint-config-prettier": "^9.1.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-webpack-plugin": "^4.2.0",
"glob": "^8.0.1",
Expand All @@ -117,13 +117,13 @@
"mutationobserver-shim": "^0.3.7",
"nyc": "^17.0.0",
"orval": "^6.26.0",
"postcss": "^8.4.43",
"postcss": "^8.4.45",
"postcss-cli": "^11.0.0",
"postcss-loader": "^8.1.1",
"postcss-scss": "^4.0.9",
"prettier": "^2.6.2",
"replace-in-file": "^6.3.2",
"sass": "^1.77.8",
"sass": "^1.78.0",
"source-map-support": "^0.5.21",
"style-loader": "^4.0.0",
"stylelint": "^15.11.0",
Expand All @@ -145,7 +145,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.36.0-b82b94df2d6d6d798fa5c695a2622133b60cd16d",
"@danskernesdigitalebibliotek/dpl-design-system": "^2024.37.0-d007a043185fe27649dc16ba7d4996eab9ee1caf",
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
Expand Down Expand Up @@ -176,6 +176,6 @@
"unfetch": "^4.2.0"
},
"peerDependencies": {
"postcss": "^8.4.43"
"postcss": "^8.4.45"
}
}
4 changes: 2 additions & 2 deletions src/apps/favorites-list/FavoritesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const FavoritesList: React.FC<FavoritesListProps> = ({ pageSize }) => {

const skeletonList = (
<>
<div className="ssc">
<div className="ssc-line w-10 my-32">&nbsp;</div>
<div className="ssc content-list">
<div className="ssc-line w-10 mt-32">&nbsp;</div>
</div>
<ul className="content-list">
{/*
Expand Down
4 changes: 3 additions & 1 deletion src/apps/material-search/MaterialSearchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { flattenCreators } from "../../core/utils/helpers/general";
import { useText } from "../../core/utils/text";
import useInfiniteScrollLoading from "./useInfiteScrollLoading";
import { SearchWithPaginationQuery } from "../../core/dbc-gateway/generated/graphql";
import { Work } from "../../core/utils/types/entities";

type MaterialSearchListResultsProps = {
data: SearchWithPaginationQuery["search"]["works"];
Expand Down Expand Up @@ -50,14 +51,15 @@ const MaterialSearchListResults: FC<MaterialSearchListResultsProps> = ({
}

if (!data || data.length === 0) return null;
const works = data as Work[];

return (
<div className="material-search-list" ref={containerRef}>
<div className="material-search-list__header">
{t("materialSearchAmountOfResultsText")}:<span>{hitCount}</span>
</div>
<ol className="material-search-list__results">
{data.map((work, index) => {
{works.map((work, index) => {
const authors = flattenCreators(work.creators);
const isLastItem = index === data.length - 1;

Expand Down
4 changes: 4 additions & 0 deletions src/apps/material/__snapshots__/helper.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ exports[`divideManifestationsByMaterialType > should divide manifestations by ma
{
"__typename": "Person",
"display": "Isaac Asimov",
"nameSort": "Asimov, Isaac",
},
],
"dateFirstEdition": null,
Expand Down Expand Up @@ -128,6 +129,7 @@ exports[`divideManifestationsByMaterialType > should divide manifestations by ma
{
"__typename": "Person",
"display": "Isaac Asimov",
"nameSort": "Asimov, Isaac",
},
],
"dateFirstEdition": null,
Expand Down Expand Up @@ -225,6 +227,7 @@ exports[`divideManifestationsByMaterialType > should divide manifestations by ma
{
"__typename": "Person",
"display": "Isaac Asimov",
"nameSort": "Asimov, Isaac",
},
{
"__typename": "Person",
Expand Down Expand Up @@ -323,6 +326,7 @@ exports[`divideManifestationsByMaterialType > should divide manifestations by ma
{
"__typename": "Person",
"display": "Isaac Asimov",
"nameSort": "Asimov, Isaac",
},
{
"__typename": "Person",
Expand Down
12 changes: 8 additions & 4 deletions src/apps/material/__vitest_data__/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default {
creators: [
{
display: "Isaac Asimov",
__typename: "Person"
__typename: "Person",
nameSort: "Asimov, Isaac"
},
{
display: "Tricia Reilly",
Expand Down Expand Up @@ -138,7 +139,8 @@ export default {
creators: [
{
display: "Isaac Asimov",
__typename: "Person"
__typename: "Person",
nameSort: "Asimov, Isaac"
}
],
publisher: [],
Expand Down Expand Up @@ -231,7 +233,8 @@ export default {
creators: [
{
display: "Isaac Asimov",
__typename: "Person"
__typename: "Person",
nameSort: "Asimov, Isaac"
},
{
display: "Scott Brick",
Expand Down Expand Up @@ -324,7 +327,8 @@ export default {
creators: [
{
display: "Isaac Asimov",
__typename: "Person"
__typename: "Person",
nameSort: "Asimov, Isaac"
}
],
publisher: ["Oxford University Press"],
Expand Down
9 changes: 7 additions & 2 deletions src/apps/material/material.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -958,11 +958,16 @@ digitalArticle.args = {
wid: "work-of:870971-tsart:36297484"
};

export const inLargeSameSeriesAndIrregularFaustId = Template.bind({});
inLargeSameSeriesAndIrregularFaustId.args = {
export const irregularFaustId1InLargeSameSeries = Template.bind({});
irregularFaustId1InLargeSameSeries.args = {
wid: "work-of:150086-netmusik:BIS-2067"
};

export const irregularFaustId2fairytale = Template.bind({});
irregularFaustId2fairytale.args = {
wid: "work-of:800010-katalog:99122572002205763__1"
};

export const journal = Template.bind({});
journal.args = {
wid: "work-of:870970-basis:01007556"
Expand Down
4 changes: 2 additions & 2 deletions src/components/autosuggest-material/autosuggest-material.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
flattenCreators,
getManifestationsPids
} from "../../core/utils/helpers/general";
import { WorkSmallFragment } from "../../core/dbc-gateway/generated/graphql";
import { WorkMediumFragment } from "../../core/dbc-gateway/generated/graphql";
import { getManifestationLanguageIsoCode } from "../../apps/material/helper";
import { Manifestation } from "../../core/utils/types/entities";

Expand Down Expand Up @@ -49,7 +49,7 @@ const AutosuggestMaterial: React.FC<AutosuggestMaterialProps> = ({
manifestations: { all: allManifestations, bestRepresentation }
} = work;
const authors = flattenCreators(
creators as WorkSmallFragment["creators"]
creators as WorkMediumFragment["creators"]
);

const manifestationLanguageIsoCode =
Expand Down
7 changes: 5 additions & 2 deletions src/components/find-on-shelf/FindOnShelfManifestationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import { getManifestationPublicationYear } from "../../core/utils/helpers/genera

export interface FindOnShelfManifestationListProps {
libraryBranchHoldings: ManifestationHoldings;
author: string;
}

const FindOnShelfManifestationList: FC<FindOnShelfManifestationListProps> = ({
libraryBranchHoldings
libraryBranchHoldings,
author
}) => {
const t = useText();

Expand All @@ -30,7 +32,7 @@ const FindOnShelfManifestationList: FC<FindOnShelfManifestationListProps> = ({
<span className="find-on-shelf__material-header" role="columnheader">
{t("findOnShelfModalListMaterialText")}
</span>
<span role="columnheader">
<span className="find-on-shelf__location-header" role="columnheader">
{t("findOnShelfModalListFindOnShelfText")}
</span>
<span
Expand All @@ -55,6 +57,7 @@ const FindOnShelfManifestationList: FC<FindOnShelfManifestationListProps> = ({
branchHolding.holding.materials
)}
key={branchHolding.holding.branch.branchId}
author={author}
/>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react";
import { FC } from "react";
import { useText } from "../../core/utils/text";
import { Manifestation } from "../../core/utils/types/entities";
import { getFindOnShelfLocationText } from "./helper";

export interface FindOnShelfManifestationListItemProps {
shelfmark: Manifestation["shelfmark"];
Expand All @@ -11,6 +12,7 @@ export interface FindOnShelfManifestationListItemProps {
title: string;
publicationYear: string | null;
numberAvailable: number;
author: string;
}

const FindOnShelfManifestationListItem: FC<
Expand All @@ -22,7 +24,8 @@ const FindOnShelfManifestationListItem: FC<
sublocation,
title,
publicationYear,
numberAvailable
numberAvailable,
author
}) => {
const t = useText();

Expand All @@ -45,11 +48,14 @@ const FindOnShelfManifestationListItem: FC<
</span>
<span role="cell">
{locationArray.length
? locationArray.join(" · ")
? getFindOnShelfLocationText(locationArray, author)
: t("findOnShelfModalNoLocationSpecifiedText")}
</span>
<span className="find-on-shelf__item-count-text" role="cell">
{numberAvailable}
{numberAvailable}{" "}
<span className="hide-on-desktop">
{t("findOnShelfModalListItemCountText")}
</span>
</span>
</li>
);
Expand Down
7 changes: 7 additions & 0 deletions src/components/find-on-shelf/FindOnShelfModalBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import {
useGetHoldings
} from "../../apps/material/helper";
import {
capitalizeFirstLetters,
convertPostIdToFaustId,
creatorsToString,
flattenCreators,
flattenCreatorsLastNameFirst,
getManifestationsPids
} from "../../core/utils/helpers/general";
import { useText } from "../../core/utils/text";
Expand Down Expand Up @@ -55,6 +57,10 @@ const FindOnShelfModalBody: FC<FindOnShelfModalBodyProps> = ({
config
});
const author = creatorsToString(flattenCreators(authors), t);
// Inverted author - last name, then first name is used in find on shelf modal.
const invertedAuthor = capitalizeFirstLetters(
creatorsToString(flattenCreatorsLastNameFirst(authors), t)
);
const title = workTitles.join(", ");
const isPeriodical = manifestations.some((manifestation) => {
return manifestation.materialTypes.some((materialType) => {
Expand Down Expand Up @@ -215,6 +221,7 @@ const FindOnShelfModalBody: FC<FindOnShelfModalBodyProps> = ({
>
<FindOnShelfManifestationList
libraryBranchHoldings={libraryBranch}
author={invertedAuthor}
/>
</Disclosure>
);
Expand Down
10 changes: 10 additions & 0 deletions src/components/find-on-shelf/helper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const getFindOnShelfLocationText = (
locationArray: (string | undefined)[],
author: string
) => {
return `${locationArray.join(" · ")}${
author && author !== "undefined" ? ` · ${author}` : ""
}`;
};

export default {};
6 changes: 4 additions & 2 deletions src/components/find-on-shelf/mocked-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const mockedManifestationData: Manifestation[] = [
creators: [
{
display: "Lucinda Riley",
__typename: "Person"
__typename: "Person",
nameSort: "Riley, Lucinda"
}
],
publisher: [""],
Expand Down Expand Up @@ -112,7 +113,8 @@ export const mockedManifestationData: Manifestation[] = [
creators: [
{
display: "Lucinda Riley",
__typename: "Person"
__typename: "Person",
nameSort: "Riley, Lucinda"
}
],
publisher: [""],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const MaterialButtonOnlineExternal: FC<MaterialButtonOnlineExternalProps> = ({

// Handle URL translation when data or error changes
useEffect(() => {
if (urlWasTranslated === false && !error && data?.data?.url) {
if (!urlWasTranslated && !error && data?.data?.url) {
setTranslatedUrl(new URL(data.data.url));
setUrlWasTranslated(true);
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/dbc-gateway/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fragment ManifestationsSimpleFields on Manifestation {
}
creators {
display
nameSort
__typename
}
publisher
Expand Down Expand Up @@ -260,6 +261,9 @@ fragment WorkMedium on Work {
display
}
}
creators {
nameSort
}
mainLanguages {
display
isoCode
Expand Down
Loading
Loading