-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge latest from develop, resolve merge conflicts
- Loading branch information
Showing
46 changed files
with
624 additions
and
221 deletions.
There are no files selected for viewing
This file contains 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 +1,2 @@ | ||
VITE_DATAVERSE_BACKEND_URL=http://localhost:8000 | ||
VITE_DATAVERSE_BACKEND_URL=http://localhost:8000 | ||
STORYBOOK_CHROMATIC_BUILD=false |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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,9 @@ | ||
import { UpwardHierarchyNode } from '../../../shared/hierarchy/domain/models/UpwardHierarchyNode' | ||
|
||
export interface Collection { | ||
id: string | ||
name: string | ||
hierarchy: UpwardHierarchyNode | ||
description?: string | ||
affiliation?: string | ||
} |
This file contains 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,5 @@ | ||
import { Collection } from '../models/Collection' | ||
|
||
export interface CollectionRepository { | ||
getById: (id: string) => Promise<Collection> | ||
} |
This file contains 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,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
41
src/collection/infrastructure/mappers/JSCollectionMapper.ts
This file contains 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,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) | ||
) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/collection/infrastructure/repositories/CollectionJSDataverseRepository.ts
This file contains 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,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)) | ||
} | ||
} |
This file contains 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,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; | ||
} |
Oops, something went wrong.