Manage guestbook page integration#992
Conversation
ekraffmiller
left a comment
There was a problem hiding this comment.
I've suggested some name changes to match the Guestbook js-dataverse use cases, will review again after checkbox logic is updated :)
| "position": "Cargo" | ||
| } | ||
| }, | ||
| "customQuestions": { |
There was a problem hiding this comment.
It looks like the Spanish translation is missing some keys that are in the English translation
| guestbookId: number, | ||
| enabled: boolean | ||
| ) => Promise<void> | ||
| downloadGuestbookResponsesByDataverseId: (dataverseId: number | string) => Promise<string> |
There was a problem hiding this comment.
Update to use collectionId
| downloadGuestbookResponsesByDataverseId: (dataverseId: number | string) => Promise<string> | |
| downloadGuestbookResponsesByCollectionId: (collectionId: number | string) => Promise<string> |
| ) => Promise<void> | ||
| downloadGuestbookResponsesByDataverseId: (dataverseId: number | string) => Promise<string> | ||
| downloadGuestbookResponsesOfAGuestbook: ( | ||
| dataverseId: number | string, |
There was a problem hiding this comment.
| dataverseId: number | string, | |
| collectionId: number | string, |
|
|
||
| export function downloadGuestbookResponsesByDataverseId( | ||
| guestbookRepository: GuestbookRepository, | ||
| dataverseId: number | string |
There was a problem hiding this comment.
| dataverseId: number | string | |
| collectionId: number | string |
|
|
||
| export function downloadGuestbookResponsesOfAGuestbook( | ||
| guestbookRepository: GuestbookRepository, | ||
| dataverseId: number | string, |
There was a problem hiding this comment.
| dataverseId: number | string, | |
| collectionId: number | string, |
| downloadGuestbookResponsesByDataverseId(dataverseId: number | string): Promise<string> { | ||
| return downloadGuestbookResponsesByDataverseId.execute(dataverseId) | ||
| } | ||
|
|
||
| downloadGuestbookResponsesOfAGuestbook( | ||
| dataverseId: number | string, | ||
| guestbookId: number | ||
| ): Promise<string> { | ||
| return downloadGuestbookResponsesOfAGuestbook.execute(dataverseId, guestbookId) |
There was a problem hiding this comment.
| downloadGuestbookResponsesByDataverseId(dataverseId: number | string): Promise<string> { | |
| return downloadGuestbookResponsesByDataverseId.execute(dataverseId) | |
| } | |
| downloadGuestbookResponsesOfAGuestbook( | |
| dataverseId: number | string, | |
| guestbookId: number | |
| ): Promise<string> { | |
| return downloadGuestbookResponsesOfAGuestbook.execute(dataverseId, guestbookId) | |
| downloadGuestbookResponsesByCollectionId(collectionId: number | string): Promise<string> { | |
| return downloadGuestbookResponsesByCollectionId.execute(collectionId) | |
| } | |
| downloadGuestbookResponsesOfAGuestbook( | |
| collectionId: number | string, | |
| guestbookId: number | |
| ): Promise<string> { | |
| return downloadGuestbookResponsesOfAGuestbook.execute(collectionId, guestbookId) |
| answers.push({ | ||
| id: resolveAnswerId(fieldName, question, guestbook), | ||
| value | ||
| value: question.type === 'textarea' ? value.split(/\r?\n/) : value |
There was a problem hiding this comment.
When the API is updated to take either a string or an array, we won't have to do this extra logic of converting the string to an array, but good to keep for now.
| } | ||
| ]) | ||
| const guestbooksGuideUrl = | ||
| 'https://guides.dataverse.org/en/6.9/user/dataverse-management.html#dataset-guestbooks' |
There was a problem hiding this comment.
| 'https://guides.dataverse.org/en/6.9/user/dataverse-management.html#dataset-guestbooks' | |
| 'https://guides.dataverse.org/en/latest/user/dataverse-management.html#dataset-guestbooks' |
|
|
||
| const generalInfoUrl = `/spa${RouteWithParams.EDIT_COLLECTION(collectionId)}` | ||
| const guestbooksGuideUrl = | ||
| 'https://guides.dataverse.org/en/6.9/user/dataverse-management.html#dataset-guestbooks' |
There was a problem hiding this comment.
| 'https://guides.dataverse.org/en/6.9/user/dataverse-management.html#dataset-guestbooks' | |
| 'https://guides.dataverse.org/en/latest/user/dataverse-management.html#dataset-guestbooks' |
| }) | ||
| const rootCollectionNames = collection?.hierarchy?.toArray().map((node) => node.name) ?? [] | ||
|
|
||
| const currentDataverseId = Number(collection?.id) || 1 |
There was a problem hiding this comment.
| const currentDataverseId = Number(collection?.id) || 1 | |
| const currentCollectionId = Number(collection?.id) || 1 |
What this PR does / why we need it:
Which issue(s) this PR closes:
Special notes for your reviewer:
use js-dataverse IQSS/dataverse-client-javascript#449
Suggestions on how to test this:
In collection page Edit => Dataset Guestbook, then you arrive the Manage Guestbook Page,

If there is no guestbook, it should show text to guide users and a Create Guestbook button.
If there is one or more guestbook, it should show a table with info just like JSF.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Create Dataset Guestbook



Is there a release notes or changelog update needed for this change?:
Yes
Additional documentation: