Skip to content

Commit d681473

Browse files
authored
Merge branch 'develop' into 839-wrappers-break-when-entering-long-descriptions-without-spacing-on-datasets
2 parents a9d37a6 + a3f4b8b commit d681473

File tree

30 files changed

+172
-74
lines changed

30 files changed

+172
-74
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
1010

1111
### Changed
1212

13+
- Use of the new `sourceLastUpdateTime` query parameter from update dataset and file metadata endpoints to support optimistic concurrency control during editing operations. See [Edit Dataset Metadata](https://guides.dataverse.org/en/6.8/api/native-api.html#edit-dataset-metadata) and [Updating File Metadata](https://guides.dataverse.org/en/6.8/api/native-api.html#updating-file-metadata) guides for more details.
14+
1315
### Fixed
1416

1517
- Add word-break to items text to prevent layout issues when long descriptions without spaces are entered. (#839)
18+
- Show toast notification when API token is copied to clipboard.
1619

1720
### Removed
1821

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@dnd-kit/sortable": "8.0.0",
1919
"@dnd-kit/utilities": "3.2.2",
2020
"@faker-js/faker": "7.6.0",
21-
"@iqss/dataverse-client-javascript": "2.0.0-alpha.67",
21+
"@iqss/dataverse-client-javascript": "2.0.0-alpha.76",
2222
"@iqss/dataverse-design-system": "*",
2323
"@istanbuljs/nyc-config-typescript": "1.0.2",
2424
"@tanstack/react-table": "8.9.2",

public/locales/en/account.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"copyToClipboard": "Copy to Clipboard",
1414
"recreateToken": "Recreate Token",
1515
"revokeToken": "Revoke Token",
16-
"createToken": "Create Token"
16+
"createToken": "Create Token",
17+
"copiedToClipboard": "API token copied to clipboard."
1718
},
1819
"info": {
1920
"username": "Username",

src/dataset/domain/models/Dataset.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ export class DatasetVersion {
252252
public readonly isInReview: boolean,
253253
public readonly latestVersionPublishingStatus: DatasetPublishingStatus,
254254
public readonly someDatasetVersionHasBeenReleased: boolean,
255+
/**
256+
* The timestamp of the last update to this dataset version.
257+
* Format: ISO 8601 string (e.g., "2023-06-01T12:34:56Z").
258+
* Used for optimistic concurrency control to detect concurrent updates.
259+
*/
260+
public readonly lastUpdateTime: string,
255261
public readonly termsOfAccess?: TermsOfAccess,
256262
public readonly deaccessionNote?: string
257263
) {}
@@ -268,6 +274,7 @@ export class DatasetVersion {
268274
public readonly isInReview: boolean,
269275
public readonly latestVersionPublishingStatus: DatasetPublishingStatus,
270276
public readonly someDatasetVersionHasBeenReleased: boolean,
277+
public readonly lastUpdateTime: string,
271278
public readonly termsOfAccess?: TermsOfAccess,
272279
public readonly deaccessionNote?: string
273280
) {
@@ -336,6 +343,7 @@ export class DatasetVersion {
336343
this.isInReview,
337344
this.latestVersionPublishingStatus,
338345
this.someDatasetVersionHasBeenReleased,
346+
this.lastUpdateTime,
339347
this.termsOfAccess,
340348
this.deaccessionNote
341349
)

src/dataset/domain/repositories/DatasetRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface DatasetRepository {
3030
updateMetadata: (
3131
datasetId: string | number,
3232
datasetDTO: DatasetDTO,
33-
internalVersionNumber: number
33+
sourceLastUpdateTime?: string
3434
) => Promise<void>
3535
deaccession: (
3636
datasetId: string | number,

src/dataset/domain/useCases/updateDatasetMetadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export function updateDatasetMetadata(
55
datasetRepository: DatasetRepository,
66
datasetId: string | number,
77
updatedDataset: DatasetDTO,
8-
internalVersionNumber: number
8+
sourceLastUpdateTime?: string
99
): Promise<void> {
1010
return datasetRepository
11-
.updateMetadata(datasetId, updatedDataset, internalVersionNumber)
11+
.updateMetadata(datasetId, updatedDataset, sourceLastUpdateTime)
1212
.catch((error: Error) => {
1313
throw new Error(error.message)
1414
})

src/dataset/infrastructure/mappers/JSDatasetMapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class JSDatasetMapper {
5656
jsDataset.versionInfo,
5757
JSDatasetMapper.toDatasetTitle(jsDataset.metadataBlocks),
5858
jsDatasetCitation,
59+
jsDataset.versionInfo.lastUpdateTime,
5960
jsDataset.publicationDate,
6061
jsDataset.termsOfUse?.termsOfAccess,
6162
jsDataset.versionInfo.deaccessionNote as string

src/dataset/infrastructure/mappers/JSDatasetPreviewMapper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export class JSDatasetPreviewMapper {
1212
jsDatasetPreview.versionId,
1313
jsDatasetPreview.versionInfo,
1414
jsDatasetPreview.title,
15-
jsDatasetPreview.citation
15+
jsDatasetPreview.citation,
16+
jsDatasetPreview.versionInfo.lastUpdateTime
1617
),
1718
releaseOrCreateDate: JSDatasetPreviewMapper.toPreviewDate(jsDatasetPreview.versionInfo),
1819
description: jsDatasetPreview.description,

src/dataset/infrastructure/mappers/JSDatasetVersionMapper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export class JSDatasetVersionMapper {
1515
jsDatasetVersionInfo: JSDatasetVersionInfo,
1616
jsDatasetTitle: string,
1717
jsDatasetCitation: string,
18+
jsDatasetLastUpdateTime: string,
1819
jsDatasetPublicationDate?: string,
1920
jsDatasettermsOfAccess?: TermsOfAccess,
2021
jsDatasetDeaccessionedNote?: string
@@ -29,6 +30,7 @@ export class JSDatasetVersionMapper {
2930
false, // TODO Connect with dataset version isInReview
3031
this.toStatus(jsDatasetVersionInfo.state),
3132
this.toSomeDatasetVersionHasBeenReleased(jsDatasetVersionInfo, jsDatasetPublicationDate),
33+
jsDatasetLastUpdateTime,
3234
jsDatasettermsOfAccess,
3335
jsDatasetDeaccessionedNote
3436
)

0 commit comments

Comments
 (0)