Skip to content

Commit

Permalink
merge latest from develop, resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Apr 15, 2024
2 parents 762f6b3 + 9addf4d commit 83a93d4
Show file tree
Hide file tree
Showing 46 changed files with 624 additions and 221 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_DATAVERSE_BACKEND_URL=http://localhost:8000
VITE_DATAVERSE_BACKEND_URL=http://localhost:8000
STORYBOOK_CHROMATIC_BUILD=false
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ We changed the citation block to be white with a colored border, to make the tex

We have introduced an update to the breadcrumb navigation UI. Unlike in the original JSF application, where breadcrumbs
did not reflect the user's current location within the site, our new SPA design now includes this feature in the breadcrumbs.
Additionally, we have aligned with best practices by positioning all breadcrumbs at the top, before anything else in the UI.

This update gives users a clear indication of their current position within the application's hierarchy.

Expand Down
79 changes: 4 additions & 75 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 @@ -13,7 +13,7 @@
},
"dependencies": {
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.0.0-pr132.dd49caf",
"@iqss/dataverse-client-javascript": "2.0.0-pr134.0d63f4b",
"@iqss/dataverse-design-system": "*",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@tanstack/react-table": "8.9.2",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/en/createDataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"content": "After adding the dataset, click the Edit Dataset button to add more metadata."
},
"requiredFields": "Asterisks indicate required fields",
"validationAlert": {
"title": "Validation Error",
"content": "Required fields were missed or there was a validation error. Please scroll down to see details."
},
"datasetForm": {
"fields": {
"title": {
Expand Down
4 changes: 4 additions & 0 deletions public/locales/en/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
"heading": "Success!",
"alertText": "This dataset draft has been deleted."
},
"datasetCreated": {
"heading": "Success!",
"alertText": "This dataset has been created."
},
"metadataUpdated": {
"heading": "Success!",
"alertText": "The metadata for this dataset has been updated."
Expand Down
1 change: 1 addition & 0 deletions src/alert/domain/models/Alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum AlertMessageKey {
TERMS_UPDATED = 'termsUpdated',
THUMBNAIL_UPDATED = 'thumbnailUpdated',
DATASET_DELETED = 'datasetDeleted',
DATASET_CREATED = 'datasetCreated',
PUBLISH_IN_PROGRESS = 'publishInProgress'
}

Expand Down
9 changes: 9 additions & 0 deletions src/collection/domain/models/Collection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { UpwardHierarchyNode } from '../../../shared/hierarchy/domain/models/UpwardHierarchyNode'

export interface Collection {
id: string
name: string
hierarchy: UpwardHierarchyNode
description?: string
affiliation?: string
}
5 changes: 5 additions & 0 deletions src/collection/domain/repositories/CollectionRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Collection } from '../models/Collection'

export interface CollectionRepository {
getById: (id: string) => Promise<Collection>
}
11 changes: 11 additions & 0 deletions src/collection/domain/useCases/getCollectionById.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Collection } from '../models/Collection'
import { CollectionRepository } from '../repositories/CollectionRepository'

export async function getCollectionById(
collectionRepository: CollectionRepository,
id: string
): Promise<Collection | undefined> {
return collectionRepository.getById(id).catch((error: Error) => {
throw new Error(error.message)
})
}
41 changes: 41 additions & 0 deletions src/collection/infrastructure/mappers/JSCollectionMapper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {
Collection as JSCollection,
DvObjectOwnerNode as JSUpwardHierarchyNode
} from '@iqss/dataverse-client-javascript'
import { Collection } from '../../domain/models/Collection'
import {
DvObjectType,
UpwardHierarchyNode
} from '../../../shared/hierarchy/domain/models/UpwardHierarchyNode'
import { JSUpwardHierarchyNodeMapper } from '../../../shared/hierarchy/infrastructure/mappers/JSUpwardHierarchyNodeMapper'

export class JSCollectionMapper {
static toCollection(jsCollection: JSCollection): Collection {
return {
id: jsCollection.alias,
name: jsCollection.name,
description: jsCollection.description,
affiliation: jsCollection.affiliation,
hierarchy: JSCollectionMapper.toHierarchy(
jsCollection.name,
jsCollection.alias,
jsCollection.isPartOf
)
}
}

static toHierarchy(
name: string,
id: string,
jsUpwardHierarchyNode: JSUpwardHierarchyNode
): UpwardHierarchyNode {
return new UpwardHierarchyNode(
name,
DvObjectType.COLLECTION,
id,
undefined,
undefined,
JSUpwardHierarchyNodeMapper.toUpwardHierarchyNode(jsUpwardHierarchyNode)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { CollectionRepository } from '../../domain/repositories/CollectionRepository'
import { Collection } from '../../domain/models/Collection'
import { getCollection } from '@iqss/dataverse-client-javascript'
import { JSCollectionMapper } from '../mappers/JSCollectionMapper'

export class CollectionJSDataverseRepository implements CollectionRepository {
getById(id: string): Promise<Collection> {
return getCollection
.execute(id)
.then((jsCollection) => JSCollectionMapper.toCollection(jsCollection))
}
}
9 changes: 9 additions & 0 deletions src/sections/collection/Collection.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
@import 'node_modules/bootstrap/scss/functions';
@import 'node_modules/bootstrap/scss/variables';
@import "node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module";

.container {
display: flex;
justify-content: flex-end;
margin-bottom: $spacer;
}

.header {
margin-bottom: $spacer;
}

.subtext {
color: $dv-subtext-color;
}
Loading

0 comments on commit 83a93d4

Please sign in to comment.