-
Notifications
You must be signed in to change notification settings - Fork 23
Manage guestbook page integration #992
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
16 commits
Select commit
Hold shift + click to select a range
42bae2e
feat: Manage and Create Guestbook
ChengShi-1 ca3da34
feat: collection page
ChengShi-1 0b92757
Merge Conflicts
ChengShi-1 9121485
feat: create guestbook integration
ChengShi-1 94b9ed2
action buttons of guestbook table
ChengShi-1 fa08491
feat: get usage and responses count and changelog update
ChengShi-1 56d3dd9
Merge branch 'develop' into ManageGuestbook
ChengShi-1 92c0d16
fix
ChengShi-1 aee49b2
improve test coverage
ChengShi-1 a9971bb
feat: add logic about inherited parent guestboos, and fix some edge c…
ChengShi-1 c324f70
fix: manage guestbook page
ChengShi-1 98c6cd4
fix: e2e test user permission
ChengShi-1 c9919f4
fix: accessibility flaky
ChengShi-1 a4a78a2
fix: make guestbooks enabled by default
ChengShi-1 7ccc5a5
Merge branch 'develop' into ManageGuestbook
ChengShi-1 8218c68
fix: unit test
ChengShi-1 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
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,32 @@ | ||
| export interface GuestbookResponse { | ||
| id: number | ||
| dataset: string | ||
| datasetPid: string | ||
| date: string | ||
| type: EventType | ||
| fileName?: string | ||
| fileId?: number | ||
| filePid?: string | ||
| userName: string | ||
| email?: string | ||
| institution?: string | ||
| position?: string | ||
| customQuestions?: GuestbookResponseCustomQuestion[] | ||
| } | ||
|
|
||
| export interface GuestbookResponseCustomQuestion { | ||
| question: string | ||
| response: string | ||
| } | ||
|
|
||
| export interface GuestbookResponseSubset { | ||
| guestbookResponses: GuestbookResponse[] | ||
| totalGuestbookResponseCount: number | ||
| } | ||
|
|
||
| export enum EventType { | ||
| ACCESS_REQUEST = 'AccessRequest', | ||
| DOWNLOAD = 'Download', | ||
| SUBSET = 'Subset', | ||
| EXPLORE = 'Explore' | ||
| } |
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,8 +1,33 @@ | ||
| import { type CreateGuestbookDTO } from '@iqss/dataverse-client-javascript' | ||
| import { Guestbook } from '../models/Guestbook' | ||
| import { GuestbookResponseSubset } from '../models/GuestbookResponse' | ||
|
|
||
| export interface GuestbookRepository { | ||
| createGuestbook: ( | ||
| collectionIdOrAlias: number | string, | ||
| guestbook: CreateGuestbookDTO | ||
| ) => Promise<number> | ||
| getGuestbook: (guestbookId: number) => Promise<Guestbook> | ||
| getGuestbooksByCollectionId: (collectionIdOrAlias: number | string) => Promise<Guestbook[]> | ||
| getGuestbooksByCollectionId: ( | ||
| collectionIdOrAlias: number | string, | ||
| includeStats?: boolean, | ||
| includeInherited?: boolean | ||
| ) => Promise<Guestbook[]> | ||
| getGuestbookResponsesByGuestbookId: ( | ||
| guestbookId: number, | ||
| limit?: number, | ||
| offset?: number | ||
| ) => Promise<GuestbookResponseSubset> | ||
| setGuestbookEnabled: ( | ||
| collectionIdOrAlias: number | string, | ||
| guestbookId: number, | ||
| enabled: boolean | ||
| ) => Promise<void> | ||
| downloadGuestbookResponsesByCollectionId: (collectionId: number | string) => Promise<string> | ||
| downloadGuestbookResponsesByGuestbookId: ( | ||
| collectionId: number | string, | ||
| guestbookId: number | ||
| ) => Promise<string> | ||
| assignDatasetGuestbook: (datasetId: number | string, guestbookId: number) => Promise<void> | ||
| removeDatasetGuestbook: (datasetId: number | string) => Promise<void> | ||
| } |
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,10 @@ | ||
| import { type CreateGuestbookDTO } from '@iqss/dataverse-client-javascript' | ||
| import { GuestbookRepository } from '../repositories/GuestbookRepository' | ||
|
|
||
| export function createGuestbook( | ||
| guestbookRepository: GuestbookRepository, | ||
| collectionIdOrAlias: number | string, | ||
| guestbook: CreateGuestbookDTO | ||
| ): Promise<number> { | ||
| return guestbookRepository.createGuestbook(collectionIdOrAlias, guestbook) | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/guestbooks/domain/useCases/downloadGuestbookResponsesByCollectionId.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,8 @@ | ||
| import { GuestbookRepository } from '../repositories/GuestbookRepository' | ||
|
|
||
| export function downloadGuestbookResponsesByCollectionId( | ||
| guestbookRepository: GuestbookRepository, | ||
| collectionId: number | string | ||
| ): Promise<string> { | ||
| return guestbookRepository.downloadGuestbookResponsesByCollectionId(collectionId) | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/guestbooks/domain/useCases/downloadGuestbookResponsesByGuestbookId.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,9 @@ | ||
| import { GuestbookRepository } from '../repositories/GuestbookRepository' | ||
|
|
||
| export function downloadGuestbookResponsesByGuestbookId( | ||
| guestbookRepository: GuestbookRepository, | ||
| collectionId: number | string, | ||
| guestbookId: number | ||
| ): Promise<string> { | ||
| return guestbookRepository.downloadGuestbookResponsesByGuestbookId(collectionId, guestbookId) | ||
| } |
11 changes: 11 additions & 0 deletions
11
src/guestbooks/domain/useCases/getGuestbookResponsesByGuestbookId.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,11 @@ | ||
| import { GuestbookResponseSubset } from '../models/GuestbookResponse' | ||
| import { GuestbookRepository } from '../repositories/GuestbookRepository' | ||
|
|
||
| export function getGuestbookResponsesByGuestbookId( | ||
| guestbookRepository: GuestbookRepository, | ||
| guestbookId: number, | ||
| limit?: number, | ||
| offset?: number | ||
| ): Promise<GuestbookResponseSubset> { | ||
| return guestbookRepository.getGuestbookResponsesByGuestbookId(guestbookId, limit, offset) | ||
| } |
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,10 @@ | ||
| import { GuestbookRepository } from '../repositories/GuestbookRepository' | ||
|
|
||
| export function setGuestbookEnabled( | ||
| guestbookRepository: GuestbookRepository, | ||
| collectionIdOrAlias: number | string, | ||
| guestbookId: number, | ||
| enabled: boolean | ||
| ): Promise<void> { | ||
| return guestbookRepository.setGuestbookEnabled(collectionIdOrAlias, guestbookId, enabled) | ||
| } |
Oops, something went wrong.
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.