Skip to content

Commit ac9352b

Browse files
committed
Merge branch 'develop' into TemplateUI
2 parents 8c4fe2c + 30d96a0 commit ac9352b

91 files changed

Lines changed: 1344 additions & 419 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
@@ -14,6 +14,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
1414
- Share button in File Page.
1515
- Link Collection and Link Dataset features.
1616
- Edit Terms Integration.
17+
- File upload now shows the remaining storage quota when upload limits are available.
1718
- 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.
1819
- Added Notifications tab in Account Page
1920
- Added runtime configuration options for homepage branding and support link.
@@ -27,6 +28,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
2728
- Changed the way we were handling DATE type metadata field validation to better match the backend validation and give users better error messages. For example, for an input like “foo AD”, we now show “Production Date is not a valid date. The AD year must be numeric.“. For an input like “99999 AD”, we now show “Production Date is not a valid date. The AD year cant be higher than 9999.“. For an input like “[-9999?], we now show “Production Date is not a valid date. The year in brackets cannot be negative.“, etc.
2829
- The SPA now fetches the runtime configuration from `config.js` on each load, allowing configurations without rebuilding the app. We don't use `.env` variables at build time anymore.
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.
31+
- 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.
3032
- Dataset page Terms tab title now depends on permissions: users with dataset update permission see `Terms and Guestbook`, and read-only users see `Terms`.
3133

3234
### Fixed

package-lock.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/design-system/src/lib/components/rich-text-editor/EditorActions.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export const EditorActions = ({ editor, disabled, locales }: EditorActionsProps)
148148

149149
const handleUndo = () => editor?.chain().focus().undo().run()
150150
const handleRedo = () => editor?.chain().focus().redo().run()
151+
const linkDialogTitle =
152+
locales?.linkDialog?.title ?? richTextEditorDefaultLocales.linkDialog?.title
153+
const imageDialogTitle =
154+
locales?.imageDialog?.title ?? richTextEditorDefaultLocales.imageDialog?.title
151155

152156
return (
153157
<>
@@ -378,11 +382,13 @@ export const EditorActions = ({ editor, disabled, locales }: EditorActionsProps)
378382
</div>
379383

380384
{/* Dialog for pasting a url to the link */}
381-
<Modal show={linkDialog.open} onHide={handleCloseLinkDialog} size="lg">
385+
<Modal
386+
show={linkDialog.open}
387+
onHide={handleCloseLinkDialog}
388+
size="lg"
389+
ariaLabel={linkDialogTitle}>
382390
<Modal.Header>
383-
<Modal.Title>
384-
{locales?.linkDialog?.title ?? richTextEditorDefaultLocales.linkDialog?.title}
385-
</Modal.Title>
391+
<Modal.Title>{linkDialogTitle}</Modal.Title>
386392
</Modal.Header>
387393
<Modal.Body>
388394
<Form.Group controlId="link-url" as={Col}>
@@ -416,11 +422,13 @@ export const EditorActions = ({ editor, disabled, locales }: EditorActionsProps)
416422
</Modal>
417423

418424
{/* Dialog for adding the url and alt text of the image */}
419-
<Modal show={imageDialog.open} onHide={handleCloseImageDialog} size="lg">
425+
<Modal
426+
show={imageDialog.open}
427+
onHide={handleCloseImageDialog}
428+
size="lg"
429+
ariaLabel={imageDialogTitle}>
420430
<Modal.Header>
421-
<Modal.Title>
422-
{locales?.imageDialog?.title ?? richTextEditorDefaultLocales.imageDialog?.title}
423-
</Modal.Title>
431+
<Modal.Title>{imageDialogTitle}</Modal.Title>
424432
</Modal.Header>
425433
<Modal.Body>
426434
<Form.Group controlId="image-url" as={Col}>

packages/design-system/src/lib/stories/modal/Modal.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const meta: Meta<typeof Modal> = {
2929

3030
function DefaultExample(size?: 'sm' | 'lg' | 'xl') {
3131
const [show, setShow] = useState(false)
32+
const modalTitle = 'Modal heading'
3233

3334
const handleClose = () => setShow(false)
3435
const handleShow = () => setShow(true)
@@ -37,9 +38,9 @@ function DefaultExample(size?: 'sm' | 'lg' | 'xl') {
3738
<>
3839
<Button onClick={handleShow}>Launch demo modal</Button>
3940

40-
<Modal show={show} onHide={handleClose} size={size}>
41+
<Modal show={show} onHide={handleClose} size={size} ariaLabel={modalTitle}>
4142
<Modal.Header>
42-
<Modal.Title>Modal heading</Modal.Title>
43+
<Modal.Title>{modalTitle}</Modal.Title>
4344
</Modal.Header>
4445
<Modal.Body>You are reading this text in a modal!</Modal.Body>
4546
<Modal.Footer>

packages/design-system/tests/component/modal/Modal.spec.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { Modal } from '../../../src/lib/components/modal/Modal'
33
describe('Modal', () => {
44
it('renders the modal with header, body and footer', () => {
55
const onHide = cy.stub()
6+
const modalTitle = 'Modal Title'
67
cy.mount(
7-
<Modal show onHide={onHide}>
8+
<Modal show onHide={onHide} ariaLabel={modalTitle}>
89
<Modal.Header>
9-
<Modal.Title>Modal Title</Modal.Title>
10+
<Modal.Title>{modalTitle}</Modal.Title>
1011
</Modal.Header>
1112
<Modal.Body>Modal Body</Modal.Body>
1213
<Modal.Footer>
@@ -25,10 +26,11 @@ describe('Modal', () => {
2526

2627
it('calls onHide when the close button is clicked', () => {
2728
const onHide = cy.stub().as('onHide')
29+
const modalTitle = 'Modal Title'
2830
cy.mount(
29-
<Modal show onHide={onHide}>
31+
<Modal show onHide={onHide} ariaLabel={modalTitle}>
3032
<Modal.Header>
31-
<Modal.Title>Modal Title</Modal.Title>
33+
<Modal.Title>{modalTitle}</Modal.Title>
3234
</Modal.Header>
3335
<Modal.Body>Modal Body</Modal.Body>
3436
</Modal>
@@ -40,10 +42,11 @@ describe('Modal', () => {
4042

4143
it('renders the modal with a custom size', () => {
4244
const onHide = cy.stub()
45+
const modalTitle = 'Modal Title'
4346
cy.mount(
44-
<Modal show onHide={onHide} size="sm">
47+
<Modal show onHide={onHide} size="sm" ariaLabel={modalTitle}>
4548
<Modal.Header>
46-
<Modal.Title>Modal Title</Modal.Title>
49+
<Modal.Title>{modalTitle}</Modal.Title>
4750
</Modal.Header>
4851
<Modal.Body>Modal Body</Modal.Body>
4952
</Modal>

public/locales/en/collection.json

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

public/locales/en/shared.json

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

public/locales/es/collection.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@
5252
"editCollection": {
5353
"edit": "Editar",
5454
"generalInfo": "Información general",
55-
"datasetTemplates": "Plantillas de conjuntos de datos",
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",
5661
"deleteCollection": "Eliminar colección"
5762
},
5863
"featuredItems": {

public/locales/es/shared.json

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

0 commit comments

Comments
 (0)