-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from danskernesdigitalebibliotek/DDFBRA-253-a-…
…user-sees-material-types-in-singular Material types in singular
- Loading branch information
Showing
14 changed files
with
147 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import { | ||
getWorkMaterialTypes, | ||
translateMaterialTypesForRender, | ||
} from "@/components/pages/workPageLayout/helper" | ||
import { ManifestationWorkPageFragment } from "@/lib/graphql/generated/fbi/graphql" | ||
|
||
export const getSeriesInfo = (manifestation: ManifestationWorkPageFragment) => { | ||
return manifestation.series.map( | ||
series => `${series.numberInSeries ? series.numberInSeries + " i " : ""}${series.title}` | ||
) | ||
} | ||
|
||
export const getTranslatedMaterialTypes = (manifestation: ManifestationWorkPageFragment) => { | ||
return getWorkMaterialTypes(manifestation.materialTypes) | ||
.map(materialType => { | ||
return translateMaterialTypesForRender({ | ||
value: materialType.code, | ||
render: materialType.display, | ||
}) | ||
}) | ||
.map(item => item.render) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
ManifestationDetailsFragment, | ||
WorkFullWorkPageFragment, | ||
} from "@/lib/graphql/generated/fbi/graphql" | ||
|
||
export const displayCreators = ( | ||
creators: WorkFullWorkPageFragment["creators"] | ManifestationDetailsFragment["contributors"], | ||
amount: number | ||
) => { | ||
return creators.reduce((acc, creator, index) => { | ||
// We shorten to max <amount> creators | ||
if (index === amount) { | ||
return acc + ", et. al" | ||
} | ||
// We don't want to show one person twice | ||
if (index > amount || acc.includes(creator.display)) { | ||
return acc | ||
} | ||
return acc + (index > 0 ? ", " : "") + creator.display | ||
}, "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters