-
Notifications
You must be signed in to change notification settings - Fork 19
Collection Page - Cards tweaks #735
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7c11260
feat: dataset description full width
g-saracca b6608c3
feat: collection card layout tweaks
g-saracca 2aceb8b
feat: file card layout tweaks
g-saracca dec92b8
fix: dataset and file labels using publicationStatues property
g-saracca 67ddfb1
feat: tweak badges layout collection card
g-saracca 64956a7
fix: affiliation inlined with title link
g-saracca f54023f
feat: using js-dv PR version
g-saracca c6c071f
feat: show dataset card parent collection link
g-saracca 05cbefd
chore: use alpha latest js-dv version
g-saracca 98b673e
feat: add stories
g-saracca 31ebb0d
test: add more cases
g-saracca d2b5ad4
remove todo
g-saracca 6098f23
feat: pr comments
g-saracca bd7f4e7
fix: a11ty test
g-saracca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
39 changes: 22 additions & 17 deletions
39
...st/collection-card/CollectionCardInfo.tsx → ...st/collection-card/CollectionCardBody.tsx
This file contains hidden or 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,46 +1,51 @@ | ||
| import { Stack } from '@iqss/dataverse-design-system' | ||
| import { CollectionItemTypePreview } from '@/collection/domain/models/CollectionItemTypePreview' | ||
| import { LinkToPage } from '@/sections/shared/link-to-page/LinkToPage' | ||
| import { DvObjectType } from '@/shared/hierarchy/domain/models/UpwardHierarchyNode' | ||
| import { DateHelper } from '@/shared/helpers/DateHelper' | ||
| import { Route } from '@/sections/Route.enum' | ||
| import { LinkToPage } from '@/sections/shared/link-to-page/LinkToPage' | ||
| import { CollectionCardThumbnail } from './CollectionCardThumbnail' | ||
| import { DateHelper } from '@/shared/helpers/DateHelper' | ||
| import styles from './CollectionCard.module.scss' | ||
|
|
||
| interface CollectionCardInfoProps { | ||
| interface CollectionCardBodyProps { | ||
| collectionPreview: CollectionItemTypePreview | ||
| parentCollectionAlias?: string | ||
| } | ||
|
|
||
| export function CollectionCardInfo({ | ||
| export const CollectionCardBody = ({ | ||
| collectionPreview, | ||
| parentCollectionAlias | ||
| }: CollectionCardInfoProps) { | ||
| }: CollectionCardBodyProps) => { | ||
| const isStandingOnParentCollectionPage = | ||
| !!parentCollectionAlias && collectionPreview.parentCollectionAlias === parentCollectionAlias | ||
|
|
||
| return ( | ||
| <div className={styles['card-info-container']}> | ||
| <Stack gap={1}> | ||
| <div className={styles['date-link-wrapper']}> | ||
| <Stack direction="horizontal" gap={3} className={styles['card-body-container']}> | ||
| <CollectionCardThumbnail collectionPreview={collectionPreview} /> | ||
| <Stack direction="vertical" gap={1}> | ||
| <Stack direction="horizontal" gap={1}> | ||
| <time | ||
| dateTime={collectionPreview.releaseOrCreateDate.toLocaleDateString()} | ||
| className={styles.date}> | ||
| className={styles['release-or-create-date']}> | ||
| {DateHelper.toDisplayFormat(collectionPreview.releaseOrCreateDate)} | ||
| </time> | ||
| {!isStandingOnParentCollectionPage && ( | ||
| <LinkToPage | ||
| type={DvObjectType.COLLECTION} | ||
| page={Route.COLLECTIONS} | ||
| searchParams={{ id: collectionPreview.parentCollectionAlias?.toString() }}> | ||
| {collectionPreview.parentCollectionName} | ||
| </LinkToPage> | ||
| <span className={styles['link-to-collection-wrapper']}> | ||
| <span>- </span> | ||
| <LinkToPage | ||
| type={DvObjectType.COLLECTION} | ||
| page={Route.COLLECTIONS} | ||
| searchParams={{ id: collectionPreview.parentCollectionAlias?.toString() }}> | ||
| {collectionPreview.parentCollectionName} | ||
| </LinkToPage> | ||
| </span> | ||
| )} | ||
| </div> | ||
| </Stack> | ||
|
|
||
| {collectionPreview.description && ( | ||
| <p className={styles.description}>{collectionPreview.description}</p> | ||
| )} | ||
| </Stack> | ||
| </div> | ||
| </Stack> | ||
| ) | ||
| } |
This file contains hidden or 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 hidden or 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
23 changes: 8 additions & 15 deletions
23
src/sections/collection/collection-items-panel/items-list/dataset-card/DatasetCard.tsx
This file contains hidden or 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,33 +1,26 @@ | ||
| import { DatasetItemTypePreview } from '@/dataset/domain/models/DatasetItemTypePreview' | ||
| import { DatasetCardHeader } from './DatasetCardHeader' | ||
| import { DatasetCardThumbnail } from './DatasetCardThumbnail' | ||
| import { DatasetCardInfo } from './DatasetCardInfo' | ||
| import { DatasetCardBody } from './DatasetCardBody' | ||
| import styles from './DatasetCard.module.scss' | ||
|
|
||
| interface DatasetCardProps { | ||
| datasetPreview: DatasetItemTypePreview | ||
| parentCollectionAlias?: string | ||
| } | ||
|
|
||
| export function DatasetCard({ datasetPreview }: DatasetCardProps) { | ||
| export function DatasetCard({ datasetPreview, parentCollectionAlias }: DatasetCardProps) { | ||
| return ( | ||
| <article className={styles['card-main-container']} data-testid="dataset-card"> | ||
| <DatasetCardHeader | ||
| persistentId={datasetPreview.persistentId} | ||
| version={datasetPreview.version} | ||
| userRoles={datasetPreview.userRoles} | ||
| publicationStatuses={datasetPreview.publicationStatuses} | ||
| /> | ||
| <DatasetCardBody | ||
| datasetPreview={datasetPreview} | ||
| parentCollectionAlias={parentCollectionAlias} | ||
| /> | ||
| <div className={styles['thumbnail-and-info-wrapper']}> | ||
| <DatasetCardThumbnail | ||
| persistentId={datasetPreview.persistentId} | ||
| version={datasetPreview.version} | ||
| thumbnail={datasetPreview.thumbnail} | ||
| /> | ||
| <DatasetCardInfo | ||
| version={datasetPreview.version} | ||
| releaseOrCreateDate={datasetPreview.releaseOrCreateDate} | ||
| description={datasetPreview.description} | ||
| /> | ||
| </div> | ||
| </article> | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the solid border here for dataset card?


SPA ->
JSF ->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I've mentioned this in the PR description, what do you think about it? cc: @ekraffmiller