Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
- Dataset Templates Selector in the Create Dataset page.
- Metadata Export Dropdown to the metadata tab of Dataset Page and File Page.
- External Tools integration. All types supported: Explore, Configure, Preview and Query tools in Dataset and File pages. Still not showing external tools for Auxiliary Files as additional development is needed.
- Added the value entered by the user in the error messages for metadata field validation errors in EMAIL and URL type fields. For example, instead of showing "Point of Contact E-mail is not a valid email address.", we now show "Point of Contact E-mail foo is not a valid email address."

### Changed

- Standardize Node.js version to 22 across all environments (docker dev environment, CI, production).
- 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.

### Fixed

Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@dnd-kit/sortable": "8.0.0",
"@dnd-kit/utilities": "3.2.2",
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.0.0-alpha.67",
"@iqss/dataverse-client-javascript": "2.1.0-pr385.bb9affc",
"@iqss/dataverse-design-system": "*",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@tanstack/react-table": "8.9.2",
Expand Down
22 changes: 17 additions & 5 deletions public/locales/en/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,23 @@
"field": {
"required": "{{displayName}} is required",
"invalid": {
"url": "{{displayName}} is not a valid URL",
"email": "{{displayName}} is not a valid email",
"int": "{{displayName}} is not a valid integer",
"float": "{{displayName}} is not a valid float",
"date": "{{displayName}} is not a valid date. Please use the format {{dateFormat}}"
"url": "{{displayName}} {{value}} is not a valid URL.",
"email": "{{displayName}} {{value}} is not a valid email.",
"int": "{{displayName}} is not a valid integer.",
"float": "{{displayName}} is not a valid float.",
"date": {
"base": "{{displayName}} is not a valid date.",
"empty": "The date is empty.",
"adDigits": "The AD year must be numeric.",
"adRange": "The AD year cant be higher than 9999.",
"bracketNotNumeric": "The year in brackets must be numeric.",
"bracketNegative": "The year in brackets cannot be negative.",
"bracketRange": "The year in brackets is out of range.",
"invalidMonth": "The month is out of range.",
"invalidDay": "The day is out of range.",
"invalidTime": "The time is out of range.",
"unrecognized": "The date format is unrecognized."
}
}
},
"status": {
Expand Down
8 changes: 0 additions & 8 deletions src/metadata-block-info/domain/models/MetadataBlockInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ export const WatermarkMetadataFieldOptions = {
export type WatermarkMetadataField =
(typeof WatermarkMetadataFieldOptions)[keyof typeof WatermarkMetadataFieldOptions]

export const DateFormatsOptions = {
YYYY: 'YYYY',
YYYYMM: 'YYYY-MM',
YYYYMMDD: 'YYYY-MM-DD'
} as const

export type DateFormats = (typeof DateFormatsOptions)[keyof typeof DateFormatsOptions]

export interface MetadataBlockInfoDisplayFormat {
name: string
displayName: string
Expand Down
105 changes: 0 additions & 105 deletions src/metadata-block-info/domain/models/fieldValidations.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Alert, Button, Col, Form, Modal, Stack } from '@iqss/dataverse-design-s
import { useDataset } from '../DatasetContext'
import { Deaccessioned } from '@/dataset/domain/models/DatasetVersionSummaryInfo'
import { DatasetRepository } from '@/dataset/domain/repositories/DatasetRepository'
import { isValidURL } from '@/metadata-block-info/domain/models/fieldValidations'
import { Validator } from '@/shared/helpers/Validator'
import { useGetDatasetVersionsSummaries } from '../dataset-versions/useGetDatasetVersionsSummaries'
import { DeaccessionFormData } from './DeaccessionFormData'
import { ConfirmationModal } from './ConfirmationModal'
Expand Down Expand Up @@ -100,7 +100,7 @@ export function DeaccessionDatasetModal({
if (value.trim() === '') {
return true // Consider empty strings as valid
}
return isValidURL(value)
return Validator.isValidURL(value)
}

const handleCloseWithReset = () => {
Expand Down
Loading
Loading