Guestbook Edit and Guestbook Response Integration#1006
Open
ChengShi-1 wants to merge 13 commits into
Open
Conversation
3 tasks
…-responses-integration
Contributor
There was a problem hiding this comment.
Pull request overview
Adds full “modern” support for managing guestbooks beyond preview/download: users can now edit an existing guestbook, copy an existing guestbook into a prefilled create flow, and view guestbook responses in a dedicated responses page. This builds on the existing Manage Guestbooks integration by wiring navigation/routes, adding repositories/use-cases/hooks, and expanding component/e2e coverage.
Changes:
- Add guestbook Edit page flow (route + page + hook + repository support).
- Add Copy flow (Manage Guestbooks → Create page prefilled via navigation state + shared form extraction).
- Add Guestbook Responses page (route + page + hook + pagination/sorting + CSV download).
Reviewed changes
Copilot reviewed 50 out of 51 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e-integration/e2e/sections/templates/DatasetTemplates.spec.tsx | Updates template action label assertions from View → Preview. |
| tests/e2e-integration/e2e/sections/guestbooks/ManageGuestbooks.spec.ts | Replaces “not implemented” action checks with real edit flow e2e coverage. |
| tests/component/sections/templates/DatasetTemplates.spec.tsx | Aligns component tests with View → Preview label change. |
| tests/component/sections/guestbooks/view-responses/useGetGuestbookResponsesByGuestbookId.spec.tsx | Adds unit-style hook tests for fetching guestbook responses. |
| tests/component/sections/guestbooks/view-responses/GuestbookResponses.spec.tsx | Adds component tests for the Guestbook Responses page (sorting, pagination, download, error states). |
| tests/component/sections/guestbooks/ManageGuestbooks.spec.tsx | Adds navigation assertions for Copy and View Responses actions; updates Preview label assertions. |
| tests/component/sections/guestbooks/GuestbookActionButtons.spec.tsx | Expands action button behavior tests (copy/edit/view responses handlers + delete placeholder). |
| tests/component/sections/guestbooks/edit-guestbook/useEditGuestbook.spec.tsx | Adds hook tests for editing guestbooks and error formatting behavior. |
| tests/component/sections/guestbooks/edit-guestbook/EditGuestbook.spec.tsx | Adds Edit Guestbook page component tests (prefill, submit, error states). |
| tests/component/sections/guestbooks/createGuestbookRepositoryStub.ts | Updates repository stub to include editGuestbook. |
| tests/component/sections/guestbooks/create-guestbooks/CreateGuestbook.spec.tsx | Adds copy-prefill create test + CreateGuestbookButton navigation test + error/not-found coverage. |
| tests/component/sections/file/file-action-buttons/access-file-menu/AccessFileMenu.spec.tsx | Updates guestbook repository stubs for new editGuestbook method. |
| tests/component/sections/edit-dataset-terms/useRemoveDatasetGuestbook.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| tests/component/sections/edit-dataset-terms/useAssignDatasetGuestbook.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| tests/component/sections/edit-dataset-terms/EditGuestbook.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| tests/component/sections/edit-dataset-terms/EditDatasetTerms.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| tests/component/sections/dataset/dataset-guestbook/DatasetGuestbook.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| tests/component/sections/dataset/dataset-files/guestbook/DownloadWithTermsAndGuestbookModal.spec.tsx | Updates guestbook repository stub to include editGuestbook. |
| src/stories/shared-mock-repositories/guestbook/GuestbookMockRepository.ts | Updates storybook guestbook repository to new DTO + editGuestbook method. |
| src/sections/Route.enum.ts | Adds routes/helpers for guestbook edit and responses pages. |
| src/sections/guestbooks/view-responses/useGetGuestbookResponsesByGuestbookId.ts | Implements guestbook responses fetching hook with loading/error handling. |
| src/sections/guestbooks/view-responses/GuestbookResponsesFactory.tsx | Adds route factory wiring for responses page params parsing. |
| src/sections/guestbooks/view-responses/GuestbookResponses.tsx | Implements Guestbook Responses page UI (sorting, pagination, CSV download). |
| src/sections/guestbooks/useGetGuestbooksByCollectionId.tsx | Routes guestbook list loading through a domain use case wrapper. |
| src/sections/guestbooks/ManageGuestbooks.tsx | Wires Copy/Edit/View Responses actions to navigation routes. |
| src/sections/guestbooks/Guestbooks.module.scss | Adds styling for the responses page layout and table cells. |
| src/sections/guestbooks/guestbook-form/GuestbookForm.tsx | Extracts shared guestbook create/edit form (fields + custom questions editor). |
| src/sections/guestbooks/edit-guestbook/useEditGuestbook.ts | Adds edit hook with formatted WriteError handling + default error message. |
| src/sections/guestbooks/edit-guestbook/EditGuestbookFactory.tsx | Adds route factory wiring for edit page params parsing. |
| src/sections/guestbooks/edit-guestbook/EditGuestbook.tsx | Implements Edit Guestbook page (prefill + submit + navigation + alerts). |
| src/sections/guestbooks/create-guestbooks/useCreateGuestbook.ts | Switches create hook input type to shared GuestbookDTO. |
| src/sections/guestbooks/create-guestbooks/CreateGuestbook.tsx | Implements copy-prefill support via location.state + uses shared GuestbookForm. |
| src/sections/guestbooks/action-buttons/GuestbookActionButtons.tsx | Wires Copy/Edit/View Responses callbacks; adds disabled-guestbook Delete placeholder. |
| src/sections/dataset/dataset-files/files-table/file-actions/file-actions-cell/file-action-buttons/file-options-menu/DownloadWithTermsAndGuestbookModal.tsx | Narrows custom question id typing (number only). |
| src/sections/collection/collection-items-panel/items-list/collection-card/CollectionCard.module.scss | Updates link underline styling in collection cards. |
| src/router/routes.tsx | Adds lazy-loaded routes for guestbook edit and responses pages. |
| src/guestbooks/infrastructure/repositories/GuestbookJSDataverseRepository.ts | Adds editGuestbook support, normalizes customQuestions, and adopts shared GuestbookDTO. |
| src/guestbooks/domain/useCases/getGuestbooksByCollectionId.ts | Adds domain use-case wrapper for listing guestbooks. |
| src/guestbooks/domain/useCases/editGuestbook.ts | Adds domain use-case wrapper for editing guestbooks. |
| src/guestbooks/domain/useCases/DTOs/GuestbookDTO.ts | Introduces shared DTO used by create/edit flows. |
| src/guestbooks/domain/useCases/createGuestbook.ts | Switches create use case to shared GuestbookDTO. |
| src/guestbooks/domain/repositories/GuestbookRepository.ts | Updates repository contract: create uses GuestbookDTO; adds editGuestbook. |
| src/guestbooks/domain/models/GuestbookResponsesPaginationInfo.ts | Adds pagination model specialization for guestbook responses page. |
| src/guestbooks/domain/models/GuestbookResponse.ts | Adjusts response model field ordering; includes email earlier. |
| src/guestbooks/domain/models/Guestbook.ts | Narrows custom question/option id typing to number. |
| public/locales/es/guestbooks.json | Adds/updates guestbook strings for edit/responses/delete + changes View → Preview. |
| public/locales/en/guestbooks.json | Adds/updates guestbook strings for edit/responses/delete + changes View → Preview. |
| public/locales/en/datasetTemplates.json | Changes templates action label View → Preview. |
| package.json | Bumps @iqss/dataverse-client-javascript to 2.2.0-alpha.11. |
| package-lock.json | Locks @iqss/dataverse-client-javascript to 2.2.0-alpha.11. |
| CHANGELOG.md | Updates unreleased notes to mention edit/create guestbook pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Which issue(s) this PR closes:
Special notes for your reviewer:
It's based on
ManageGuestbookPRSuggestions on how to test this:
EDIT
COPY
VIEW RESPONSES
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
yes, attached screenshots above
Is there a release notes or changelog update needed for this change?:
Yes
Additional documentation: