Skip to content

Commit 03a1008

Browse files
committed
Merge branch 'develop' into 896-add-terms-of-use-and-guestbook-to-file-download
2 parents 56c70ce + c596859 commit 03a1008

123 files changed

Lines changed: 1985 additions & 1494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
1313
- Share button in File Page.
1414
- Link Collection and Link Dataset features.
1515
- Edit Terms Integration.
16+
- File upload now shows the remaining storage quota when upload limits are available.
1617
- With the addition of the new runtime configuration approach, we now support dynamic configuration for languages. If more than one language is configured, the Language Switcher will be shown in the header to allow users to change the language.
1718
- Added Notifications tab in Account Page
1819
- Added runtime configuration options for homepage branding and support link.
@@ -29,6 +30,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
2930
- Renamed dataset template fetch/create use cases and DTOs to `getTemplatesByCollectionId` and `CreateTemplateDTO` for API alignment, and added new `getTemplate` and `deleteTemplate` use cases for retrieving a single template by ID and deleting templates.
3031
- Added disclaimer text and custom popup text to Publish Dataset modal for better communication of the implications of publishing a dataset. The text can be configured through the runtime configuration.
3132
- Dataset page Terms tab title now depends on permissions: users with dataset update permission see `Terms and Guestbook`, and read-only users see `Terms`.
33+
- Avoided prop-drilling for collection repository, so used context to share epository instances.
3234

3335
### Fixed
3436

public/locales/en/collection.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
"editCollection": {
5353
"edit": "Edit",
5454
"generalInfo": "General Information",
55+
"themeAndWidgets": "Theme + Widgets",
56+
"permissions": "Permissions",
57+
"groups": "Groups",
58+
"datasetTemplates": "Dataset Templates",
59+
"datasetGuestbooks": "Dataset Guestbooks",
60+
"featuredDataverses": "Featured Dataverses",
5561
"deleteCollection": "Delete Collection"
5662
},
5763
"featuredItems": {

public/locales/en/shared.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@
220220
"selectFileMultiple": "Select files to add",
221221
"dragDropSingle": "Drag and drop file here.",
222222
"dragDropMultiple": "Drag and drop files and/or directories here.",
223+
"uploadWidgetHelp": "Select files or drag and drop into the upload widget. Maximum of {{maxFilesPerUpload}} files per upload.",
224+
"uploadWidgetMaxFilesHelp": "Maximum of {{maxFilesAvailableToUpload}} files available to upload.",
225+
"uploadWidgetStorageQuotaHelp": "Storage quota: {{storageQuotaRemaining}} remaining.",
223226
"cancelUpload": "Cancel upload",
224227
"uploadFailed": "There was an error uploading this file.",
225228
"loadingConfiguration": "Loading configuration",

public/locales/es/collection.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
"editCollection": {
5353
"edit": "Editar",
5454
"generalInfo": "Información general",
55+
"themeAndWidgets": "Tema + Widgets",
56+
"permissions": "Permisos",
57+
"groups": "Grupos",
58+
"datasetTemplates": "Plantillas de dataset",
59+
"datasetGuestbooks": "Libros de visitas de dataset",
60+
"featuredDataverses": "Dataverses destacados",
5561
"deleteCollection": "Eliminar colección"
5662
},
5763
"featuredItems": {

public/locales/es/shared.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@
220220
"selectFileMultiple": "Seleccionar ficheros para agregar",
221221
"dragDropSingle": "Arrastra y suelta el fichero aquí.",
222222
"dragDropMultiple": "Arrastra y suelta ficheros y/o directorios aquí.",
223+
"uploadWidgetHelp": "Selecciona ficheros o arrástralos y suéltalos en el widget de carga. Máximo de {{maxFilesPerUpload}} ficheros por carga.",
224+
"uploadWidgetMaxFilesHelp": "Máximo de {{maxFilesAvailableToUpload}} ficheros disponibles para cargar.",
225+
"uploadWidgetStorageQuotaHelp": "Cuota de almacenamiento: {{storageQuotaRemaining}} restantes.",
223226
"cancelUpload": "Cancelar carga",
224227
"uploadFailed": "Ocurrió un error al cargar este fichero.",
225228
"loadingConfiguration": "Cargando configuración",

src/alert/domain/models/Alert.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { type AlertVariant } from '@iqss/dataverse-design-system'
1+
import { ComponentProps } from 'react'
2+
import { Alert as DesignSystemAlert } from '@iqss/dataverse-design-system'
3+
4+
type AlertVariant = ComponentProps<typeof DesignSystemAlert>['variant']
25

36
export enum AlertMessageKey {
47
DRAFT_VERSION = 'draftVersion',
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface DatasetUploadLimits {
2+
numberOfFilesRemaining?: number
3+
storageQuotaRemaining?: number
4+
}

src/dataset/domain/repositories/DatasetRepository.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { FormattedCitation, CitationFormat } from '../models/DatasetCitation'
1111
import { DatasetLicenseUpdateRequest } from '../models/DatasetLicenseUpdateRequest'
1212
import { CollectionSummary } from '@/collection/domain/models/CollectionSummary'
1313
import { DatasetVersionPaginationInfo } from '../models/DatasetVersionPaginationInfo'
14+
import { DatasetUploadLimits } from '../models/DatasetUploadLimits'
1415

1516
export interface DatasetRepository {
1617
getByPersistentId: (
@@ -68,4 +69,5 @@ export interface DatasetRepository {
6869
link(datasetId: string | number, collectionIdOrAlias: string | number): Promise<void>
6970
unlink(datasetId: string | number, collectionIdOrAlias: string | number): Promise<void>
7071
getDatasetLinkedCollections: (datasetId: string | number) => Promise<CollectionSummary[]>
72+
getDatasetUploadLimits: (datasetId: string | number) => Promise<DatasetUploadLimits>
7173
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { DatasetRepository } from '../repositories/DatasetRepository'
2+
import { DatasetUploadLimits } from '../models/DatasetUploadLimits'
3+
4+
export async function getDatasetUploadLimits(
5+
datasetId: string | number,
6+
datasetRepository: DatasetRepository
7+
): Promise<DatasetUploadLimits> {
8+
return datasetRepository.getDatasetUploadLimits(datasetId)
9+
}

src/dataset/infrastructure/repositories/DatasetJSDataverseRepository.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ import {
4343
unlinkDataset,
4444
getDatasetLinkedCollections,
4545
updateTermsOfAccess,
46-
updateDatasetLicense
46+
updateDatasetLicense,
47+
getDatasetUploadLimits
4748
} from '@iqss/dataverse-client-javascript'
4849
import { JSDatasetMapper } from '../mappers/JSDatasetMapper'
4950
import { DatasetPaginationInfo } from '../../domain/models/DatasetPaginationInfo'
@@ -62,6 +63,7 @@ import { requireAppConfig } from '../../../config'
6263
import { AxiosResponse } from 'axios'
6364
import { JSDataverseReadErrorHandler } from '@/shared/helpers/JSDataverseReadErrorHandler'
6465
import { CollectionSummary } from '@/collection/domain/models/CollectionSummary'
66+
import { DatasetUploadLimits } from '@/dataset/domain/models/DatasetUploadLimits'
6567

6668
const includeDeaccessioned = true
6769

@@ -468,4 +470,8 @@ export class DatasetJSDataverseRepository implements DatasetRepository {
468470
updateTermsOfAccess(datasetId: string | number, termsOfAccess: TermsOfAccess): Promise<void> {
469471
return updateTermsOfAccess.execute(datasetId, termsOfAccess)
470472
}
473+
474+
getDatasetUploadLimits(datasetId: string | number): Promise<DatasetUploadLimits> {
475+
return getDatasetUploadLimits.execute(datasetId)
476+
}
471477
}

0 commit comments

Comments
 (0)