-
Notifications
You must be signed in to change notification settings - Fork 10
Get Dataset Versions Summaries use case #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
23c5595
chore: rename to DatasetVersionSummaryInfo
g-saracca bfd73c9
feat: rename use case + docs
g-saracca 33ce816
test: unit cases
g-saracca 200ee4d
Merge develop into feat/260-get-dataset-versions-use-case
g-saracca 8ca12ec
tests: increase testTimeout for local direct upload tests to pass
g-saracca fb690f9
tests: use PR image dataverse version
g-saracca 424e2d5
feat: export types and rename some
g-saracca 83519d7
chore: update solr version
g-saracca 772028c
chore: use dataverse image tag from PR
g-saracca 3c9d262
chore: update dataverse image registry and tag to use docker.io and u…
g-saracca 3020d48
pr requested changes
g-saracca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,36 @@ | ||
| export interface DatasetVersionSummaryInfo { | ||
| id: number | ||
| versionNumber: string | ||
| summary?: DatasetVersionSummary | DatasetVersionSummaryStringValues | ||
| contributors: string | ||
| publishedOn?: string | ||
| } | ||
|
|
||
| export type DatasetVersionSummary = { | ||
| [key: string]: SummaryUpdates | SummaryUpdatesWithFields | FilesSummaryUpdates | boolean | ||
| } | ||
|
|
||
| interface SummaryUpdates { | ||
| added: number | ||
| deleted: number | ||
| changed: number | ||
| } | ||
|
|
||
| interface SummaryUpdatesWithFields { | ||
| [key: string]: SummaryUpdates | ||
| } | ||
|
|
||
| interface FilesSummaryUpdates { | ||
| added: number | ||
| removed: number | ||
| replaced: number | ||
| changedFileMetaData: number | ||
| changedVariableMetadata: number | ||
| } | ||
|
|
||
| export enum DatasetVersionSummaryStringValues { | ||
| firstPublished = 'firstPublished', | ||
| firstDraft = 'firstDraft', | ||
| versionDeaccessioned = 'versionDeaccessioned', | ||
| previousVersionDeaccessioned = 'previousVersionDeaccessioned' | ||
| } |
This file contains hidden or 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
22 changes: 22 additions & 0 deletions
22
src/datasets/domain/useCases/GetDatasetVersionsSummaries.ts
This file contains hidden or 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,22 @@ | ||
| import { UseCase } from '../../../core/domain/useCases/UseCase' | ||
| import { DatasetVersionSummaryInfo } from '../models/DatasetVersionSummaryInfo' | ||
| import { IDatasetsRepository } from '../repositories/IDatasetsRepository' | ||
|
|
||
| export class GetDatasetVersionsSummaries implements UseCase<DatasetVersionSummaryInfo[]> { | ||
| private datasetsRepository: IDatasetsRepository | ||
|
|
||
| constructor(datasetsRepository: IDatasetsRepository) { | ||
| this.datasetsRepository = datasetsRepository | ||
| } | ||
|
|
||
| /** | ||
| * Returns a list of versions for a given dataset including a summary of differences between consecutive versions where available. | ||
| * Draft versions will only be available to users who have permission to view unpublished drafts. | ||
| * | ||
| * @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers). | ||
| * @returns {Promise<DatasetVersionSummaryInfo[]>} - An array of DatasetVersionSummaryInfo. | ||
| */ | ||
| async execute(datasetId: number | string): Promise<DatasetVersionSummaryInfo[]> { | ||
| return await this.datasetsRepository.getDatasetVersionsSummaries(datasetId) | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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,6 +1,6 @@ | ||
| POSTGRES_VERSION=13 | ||
| DATAVERSE_DB_USER=dataverse | ||
| SOLR_VERSION=9.3.0 | ||
| SOLR_VERSION=9.8.0 | ||
| DATAVERSE_IMAGE_REGISTRY=docker.io | ||
| DATAVERSE_IMAGE_TAG=unstable | ||
| DATAVERSE_BOOTSTRAP_TIMEOUT=5m |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.