-
Notifications
You must be signed in to change notification settings - Fork 16
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 #248 from IQSS/feature/230-add-dataset-info-to-hom…
…e-page 230 - Add dataset card info to Home page
- Loading branch information
Showing
37 changed files
with
564 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
export interface DatasetPreview { | ||
persistentId: string | ||
title: string | ||
import { DatasetLabel, DatasetVersion } from './Dataset' | ||
|
||
export class DatasetPreview { | ||
constructor( | ||
public persistentId: string, | ||
public title: string, | ||
public version: DatasetVersion, | ||
public citation: string, | ||
public labels: DatasetLabel[], | ||
public isDeaccessioned: boolean, | ||
public releaseOrCreateDate: Date, | ||
public description: string, | ||
public thumbnail?: string | ||
) {} | ||
|
||
get abbreviatedDescription(): string { | ||
if (this.description.length > 280) { | ||
return `${this.description.substring(0, 280)}...` | ||
} | ||
return this.description | ||
} | ||
} |
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
21 changes: 0 additions & 21 deletions
21
src/sections/dataset/dataset-citation/CitationThumbnail.tsx
This file was deleted.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
src/sections/dataset/dataset-citation/DatasetCitationTooltip.tsx
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,24 @@ | ||
import { DatasetPublishingStatus } from '../../../dataset/domain/models/Dataset' | ||
import { useTranslation } from 'react-i18next' | ||
import { QuestionMarkTooltip } from '@iqss/dataverse-design-system' | ||
|
||
interface DatasetCitationTooltipProps { | ||
status: DatasetPublishingStatus | ||
} | ||
|
||
export function DatasetCitationTooltip({ status }: DatasetCitationTooltipProps) { | ||
const { t } = useTranslation('dataset') | ||
|
||
if (status !== DatasetPublishingStatus.RELEASED) { | ||
return ( | ||
<> | ||
{' '} | ||
<QuestionMarkTooltip | ||
placement={'top'} | ||
message={t(`citation.status.${status}.description`)} | ||
/> | ||
</> | ||
) | ||
} | ||
return <></> | ||
} |
8 changes: 2 additions & 6 deletions
8
...ns/dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileDate.tsx
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module"; | ||
|
||
.icon { | ||
color: $dv-info-border-color; | ||
line-height: 1.1; | ||
} |
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,10 @@ | ||
import styles from './DatasetIcon.module.scss' | ||
import { Icon, IconName } from '@iqss/dataverse-design-system' | ||
|
||
export function DatasetIcon() { | ||
return ( | ||
<div className={styles.icon}> | ||
<Icon name={IconName.DATASET} /> | ||
</div> | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
src/sections/dataset/dataset-thumbnail/DatasetThumbnail.module.scss
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,6 @@ | ||
.preview-image { | ||
width: 100%; | ||
max-width: 140px; | ||
height: auto; | ||
max-height: 140px; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/sections/dataset/dataset-thumbnail/DatasetThumbnail.tsx
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,16 @@ | ||
import styles from './DatasetThumbnail.module.scss' | ||
import { DatasetIcon } from '../dataset-icon/DatasetIcon' | ||
|
||
interface DatasetThumbnailProps { | ||
thumbnail?: string | ||
title: string | ||
isDeaccessioned?: boolean | ||
} | ||
|
||
export function DatasetThumbnail({ thumbnail, title, isDeaccessioned }: DatasetThumbnailProps) { | ||
if (thumbnail && !isDeaccessioned) { | ||
return <img className={styles['preview-image']} src={thumbnail} alt={title} /> | ||
} | ||
|
||
return <DatasetIcon /> | ||
} |
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,12 +1,13 @@ | ||
@import "node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module"; | ||
|
||
.container { | ||
padding:15px; | ||
min-height: calc(100vh + 100px); | ||
padding:15px; | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
} | ||
|
||
.empty-message-container { | ||
padding: .5em 1em; | ||
background: $dv-warning-box-color; | ||
} | ||
} |
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
Oops, something went wrong.