Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8fb9658
feat: view guestbook and download file with guestbook
ChengShi-1 Feb 27, 2026
1ac21f6
feat: add submit multiple files with guestbook
ChengShi-1 Mar 3, 2026
d256ae4
fix: dataset test error
ChengShi-1 Mar 4, 2026
3ceaf98
feat: tests
ChengShi-1 Mar 4, 2026
54f7a0e
feat: write storybook and more tests
ChengShi-1 Mar 4, 2026
18691cb
fix: test useGetDatasetVersionDiff.spec
ChengShi-1 Mar 5, 2026
9bf054e
fix: increase test coverage, and disable edit names and email in gues…
ChengShi-1 Mar 5, 2026
152cfcd
fix: remove .only
ChengShi-1 Mar 6, 2026
3a8f6a3
fix: increase test coverage
ChengShi-1 Mar 6, 2026
6faaeb4
fix: increase test coverage
ChengShi-1 Mar 6, 2026
9c59921
fix: optimize the structure
ChengShi-1 Mar 9, 2026
983268d
fix: tests failing
ChengShi-1 Mar 9, 2026
b67702a
add e2e test, update download modal
ChengShi-1 Mar 11, 2026
9e1b4bd
fix: test custom terms
ChengShi-1 Mar 11, 2026
b876d24
package.json update
ChengShi-1 Mar 11, 2026
e368ef0
feat: add clear selection to edit guestbook page
ChengShi-1 Mar 12, 2026
d14878d
fix: storybook and fix tests
ChengShi-1 Mar 13, 2026
6540c6f
update with js-dataverse
ChengShi-1 Mar 18, 2026
d5ae0cd
fix: e2e test file download
ChengShi-1 Mar 18, 2026
20f6131
fix: Copilot review
ChengShi-1 Mar 18, 2026
6261406
fix: test error
ChengShi-1 Mar 18, 2026
90c375e
fix: small fix on removing custom question url
ChengShi-1 Mar 19, 2026
6ece880
cherry pick the guestbook review
ChengShi-1 Mar 23, 2026
6bf616b
fix: use signedURL Download for no guestbook files
ChengShi-1 Mar 24, 2026
51318d3
fix: use e2e errpr
ChengShi-1 Mar 24, 2026
55cbbaf
fix: add format to download api
ChengShi-1 Mar 25, 2026
1a2d5e2
Merge branch 'develop' into 896-add-terms-of-use-and-guestbook-to-fil…
ChengShi-1 Mar 25, 2026
ec641f5
chore: remove console.log
ChengShi-1 Mar 25, 2026
6eef084
fix: change jsDatasetMapper downloadurls still back to persistenID
ChengShi-1 Mar 25, 2026
dba18f8
fix: Test errors on jsDatasetMapper downloadurls
ChengShi-1 Mar 25, 2026
c53bf6e
fix: update the guestbookID and other info to AccessFile component
ChengShi-1 Mar 25, 2026
5146f52
fix: duplicated text and close modal before error
ChengShi-1 Mar 26, 2026
4e93a2e
fix: dataset file download
ChengShi-1 Mar 30, 2026
78a5bbb
fix: Added an [enabled] prevent multiple calls of GetGuestbook and cl…
ChengShi-1 Mar 31, 2026
47cfd49
feat: disallow guestbook if it's a draft or edit permission
ChengShi-1 Apr 1, 2026
0a0a9f3
fix: flaky test in collectionItemPanel
ChengShi-1 Apr 1, 2026
87c3919
fix: permission has to change in tests
ChengShi-1 Apr 1, 2026
56c70ce
fix: one permission didn't change
ChengShi-1 Apr 2, 2026
03a1008
Merge branch 'develop' into 896-add-terms-of-use-and-guestbook-to-fil…
ChengShi-1 Apr 7, 2026
7c2b5e0
update js-dataverse to point to merged version
ekraffmiller Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 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 @@ -18,7 +18,7 @@
"@dnd-kit/sortable": "8.0.0",
"@dnd-kit/utilities": "3.2.2",
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.0.0-alpha.85",
"@iqss/dataverse-client-javascript": "2.1.0-pr429.199cf25",
"@iqss/dataverse-design-system": "*",
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency is pinned to a PR-specific build (2.1.0-pr429.f4e6bd4). This is risky for reproducible builds since PR build tags can be moved/removed, and it makes it harder to reason about what API surface is guaranteed. Prefer upgrading to a released semver version (or a stable pre-release) once the upstream change is merged, and document/track this temporary pin if it must remain for now.

Suggested change
"@iqss/dataverse-design-system": "*",
"@iqss/dataverse-design-system": "1.0.0",

Copilot uses AI. Check for mistakes.
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@tanstack/react-table": "8.9.2",
Expand Down
17 changes: 12 additions & 5 deletions public/locales/en/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
"requestAccessTip": "If checked, users can request access to the restricted files in this dataset.",
"requestAccessTrue": "Users may request access to files.",
"requestAccessFalse": "Users may not request access to files.",
"guestbookTitle": "Guestbook",
"guestbookTip": "User information (i.e., name, email, institution, and position) will be collected when files are downloaded.",
"guestbookDescription": "The following guestbook will prompt a user to provide additional information when downloading a file.",
"noGuestbookAssigned": "No guestbook is assigned to this dataset so users will not be prompted to provide any information when downloading files. To learn more about guestbooks, visit the <anchor>Dataset Guestbook</anchor> section of the User Guide.",
"guestbookPreviewButton": "Preview Guestbook",
"restrictedFilesTip": "The number of restricted files in this dataset.",
"dataAccessPlaceTip": "If the data is not only in Dataverse, list the location(s) where the data are currently stored.",
"originalArchiveTip": "Archive from which the data was obtained.",
Expand Down Expand Up @@ -347,7 +352,7 @@
"tabs": {
"datasetTerms": "Dataset Terms",
"restrictedFilesTerms": "Restricted Files + Terms of Access",
"guestBook": "GuestBook"
"guestbook": "Guestbook"
},
"datasetTerms": {
"title": "Dataset Terms",
Expand All @@ -361,10 +366,11 @@
"title": "Restricted Files + Terms of Access",
"description": "Set up access restrictions and terms for restricted files in this dataset."
},
"guestBook": {
"title": "GuestBook",
"description": "Select a guestbook to have a user provide additional information when downloading a file.",
"testGuestbook": "Test Guestbook",
"guestbook": {
"title": "Guestbook",
"description": "Select a guestbook to have a user provide additional information when downloading a file. To learn more about guestbooks, visit the <anchor>Dataset Guestbook</anchor> section of the User Guide.",
"clearSelection": "Clear Selection",
"noGuestbooksEnabled": "There are no guestbooks enabled in {{collectionName}}. To create a guestbook, return to {{collectionName}}, click the \"Edit\" button and select the \"Dataset Guestbooks\" option.",
"previewButton": "Preview Guestbook"
},
"unsavedChangesModal": {
Expand All @@ -373,6 +379,7 @@
"stay": "Stay on this page",
"leave": "Leave without saving"
},
"defaultGuestbookUpdateError": "An error occurred while updating the dataset guestbook. Please try again.",
"defaultLicenseUpdateError": "An error occurred while updating the dataset license. Please try again.",
"defaultTermsOfAccessUpdateError": "An error occurred while updating the dataset terms of access. Please try again."
}
Expand Down
12 changes: 12 additions & 0 deletions public/locales/en/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@
"helpText": "Share this file on your favorite social media networks."
}
},
"actions": {
"optionsMenu": {
"guestbookCollectModal": {
"submitError": "Something went wrong submitting guestbook responses. Try again later.",
"downloadError": "Something went wrong downloading the file. Try again later.",
"validation": {
"required": "This field is required.",
"invalidEmail": "Please enter a valid email address."
}
}
}
},
"deleteFileModal": {
"title": "Delete File",
"message": "The file will be deleted after you click on the Delete button.",
Expand Down
13 changes: 13 additions & 0 deletions public/locales/en/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
"title": "File Options",
"headers": {
"editOptions": "Edit Options"
},
"guestbookCollectModal": {
"title": "Dataset Guestbook",
"message": "A guestbook is assigned to this dataset. Users will be prompted to provide additional information when downloading files.",
"close": "Close",
"additionalQuestions": "Additional Questions",
"submitError": "Something went wrong submitting guestbook responses. Try again later.",
"downloadStarted": "Your download has started.",
"downloadError": "Something went wrong downloading the file. Try again later.",
"validation": {
"required": "This field is required.",
"invalidEmail": "Please enter a valid email address."
}
}
},
"alreadyDeletedAlert": {
Expand Down
33 changes: 33 additions & 0 deletions public/locales/en/guestbooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"title": "Dataset Guestbooks",
"errors": {
"getGuestbook": "Something went wrong getting the guestbook. Try again later."
},
"preview": {
"title": "Preview Guestbook",
"description": "Upon downloading files the guestbook asks for the following information.",
"guestbookNameLabel": "Guestbook Name",
"guestbookDataLabel": "Collected Data",
"guestbookDataTip": "User data collected by the guestbook.",
Comment on lines +10 to +11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a duplicate of the next two items (collectedDataLabel, collectedDataTip) can we remove them?

"collectedDataLabel": "Collected Data",
"collectedDataTip": "User data collected by the guestbook.",
"accountInformation": "Account Information",
"customQuestionsLabel": "Custom Questions",
"required": "Required",
"optional": "Optional"
},
"create": {
"fields": {
"dataCollected": {
"label": "Data Collected",
"help": "Dataverse account information that will be collected when a user downloads a file. Check the ones that will be required.",
"options": {
"name": "Name",
"email": "Email",
"institution": "Institution",
"position": "Position"
}
}
}
}
}
59 changes: 58 additions & 1 deletion public/locales/es/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"license": {
"title": "Licencia/Acuerdo de uso de datos",
"altTextPrefix": "Imagen de licencia para "
"altTextPrefix": "Imagen de licencia para ",
"description": "Este dataset se publicará bajo los términos especificados a continuación. Nuestras Normas de la comunidad, así como las buenas prácticas científicas, esperan que se otorgue el crédito adecuado mediante la cita."
},
"citation": {
"status": {
Expand Down Expand Up @@ -101,6 +102,10 @@
"heading": "¡Éxito!",
"alertText": "Los términos de este dataset han sido actualizados."
},
"licenseUpdated": {
"heading": "¡Éxito!",
"alertText": "La licencia de este dataset ha sido actualizada."
},
"thumbnailUpdated": {
"heading": "¡Éxito!",
"alertText": "Miniatura del dataset actualizada."
Expand Down Expand Up @@ -146,7 +151,10 @@
"licenseHelpText": "Nuestras <anchor>Normas de la comunidad</anchor> y las buenas prácticas científicas esperan que se den los créditos adecuados mediante la cita. Utiliza la cita de datos que se muestra en la página del dataset.",
"restrictedFiles": "Ficheros restringidos",
"termsOfAccess": "Términos de acceso para ficheros restringidos",
"termsOfAccessInfo": "Restringir limita el acceso a los ficheros publicados. Las personas que quieran usar los ficheros restringidos pueden solicitar acceso de forma predeterminada. Si desactivas la solicitud de acceso, debes añadir información sobre el acceso en el campo Términos de acceso. Consulta la Guía del usuario para obtener más información sobre la restricción de ficheros y el acceso a datasets.",
"termsOfAccessRequiredWhenRequestDisabled": "Añade información sobre los términos de acceso para los ficheros restringidos cuando la solicitud de acceso esté desactivada.",
"requestAccess": "Solicitar acceso",
"enableAccessRequest": "Habilitar solicitud de acceso",
"dataAccessPlace": "Lugar de acceso a los datos",
"originalArchive": "Fichero original",
"availabilityStatus": "Estado de disponibilidad",
Expand Down Expand Up @@ -175,6 +183,11 @@
"requestAccessTip": "Si está marcado, los usuarios pueden solicitar acceso a los ficheros restringidos en este dataset.",
"requestAccessTrue": "Los usuarios pueden solicitar acceso a los ficheros.",
"requestAccessFalse": "Los usuarios no pueden solicitar acceso a los ficheros.",
"guestbookTitle": "Libro de visitas",
"guestbookTip": "La información del usuario (por ejemplo, nombre, correo electrónico, institución y cargo) se recopilará cuando se descarguen los ficheros.",
"guestbookDescription": "El siguiente libro de visitas solicitará al usuario información adicional al descargar un fichero.",
"noGuestbookAssigned": "No hay un libro de visitas asignado a este dataset, por lo que no se pedirá a los usuarios que proporcionen información al descargar archivos. Para obtener más información sobre libros de visitas, visita la sección <anchor>Dataset Guestbook</anchor> de la Guía del usuario.",
"guestbookPreviewButton": "Vista previa del libro de visitas",
"restrictedFilesTip": "El número de ficheros restringidos en este dataset.",
"dataAccessPlaceTip": "Si los datos no están solo en Dataverse, enumera la(s) ubicación(es) donde los datos están actualmente almacenados.",
"originalArchiveTip": "Fichero del cual se obtuvieron los datos.",
Expand All @@ -184,6 +197,7 @@
"studyCompletionTip": "Relación de los datos recolectados con la cantidad de datos codificados y almacenados en el dataset. Debe proporcionarse información sobre por qué ciertos elementos de la información recolectada no fueron incluidos en el dataset o en un fichero de datos específico."
},
"publish": {
"title": "Publicar dataset",
"draftQuestion": "¿Seguro que quieres publicar este dataset? Una vez que lo hagas, debe permanecer publicado.",
"draftSubtext": "Esta versión del dataset se publicará con los siguientes términos:",
"previouslyReleasedQuestion": "¿Seguro que quieres volver a publicar este dataset?",
Expand Down Expand Up @@ -268,6 +282,8 @@
"datasetVersionSummary": {
"firstPublished": "Esta es la primera versión publicada.",
"firstDraft": "Esta es una versión borrador.",
"thisIsADraftVersion": "Esta es una versión borrador.",
"noVersionDifferences": "No hay diferencias entre versiones disponibles para esta versión.",
"versionDeaccessioned": "Motivo de despublicación: El artículo de investigación ha sido retractado.",
"previousVersionDeaccessioned": "Debido a que la versión anterior fue despublicada, no hay notas de diferencias disponibles para esta versión publicada.",
"citationMetadata": {
Expand Down Expand Up @@ -327,5 +343,46 @@
},
"contact": {
"tip": "Usa el botón de correo electrónico de arriba para contactar."
},
"editTerms": {
"pageTitle": "Editar términos del dataset",
"breadcrumbActionItem": "Editar términos del dataset y libro de visitas",
"infoAlert": {
"heading": "Editar términos del dataset",
"text": "Añade los términos de uso para este dataset para explicar cómo acceder y utilizar tus datos."
},
"tabs": {
"datasetTerms": "Términos del dataset",
"restrictedFilesTerms": "Ficheros restringidos + Términos de acceso",
"guestbook": "Libro de visitas"
},
"datasetTerms": {
"title": "Términos del dataset",
"description": "Configura la licencia y los términos personalizados para este dataset.",
"licenseRequired": "Selecciona una licencia para este dataset",
"customTermsRequired": "Los términos de uso son obligatorios.",
"customTermsLabel": "Términos personalizados del dataset",
"licenseDescription": "Este dataset se publicará bajo los términos especificados a continuación. Nuestras Normas de la comunidad, así como las buenas prácticas científicas, esperan que se otorgue el crédito adecuado mediante la cita."
},
"restrictedFilesTerms": {
"title": "Ficheros restringidos + Términos de acceso",
"description": "Configura las restricciones de acceso y los términos para los ficheros restringidos de este dataset."
},
"guestbook": {
"title": "Libro de visitas",
"description": "Selecciona un libro de visitas para que el usuario proporcione información adicional al descargar un fichero. Para obtener más información sobre libros de visitas, visita la sección <anchor>Dataset Guestbook</anchor> de la Guía del usuario.",
"clearSelection": "Borrar selección",
"noGuestbooksEnabled": "No hay libros de visitas habilitados en {{collectionName}}. Para crear uno, vuelve a {{collectionName}}, haz clic en el botón \"Editar\" y selecciona la opción \"Dataset Guestbooks\".",
"previewButton": "Vista previa del libro de visitas"
},
"unsavedChangesModal": {
"title": "Cambios sin guardar",
"message": "Tienes cambios sin guardar en esta pestaña. Si sales ahora, no se guardarán.",
"stay": "Permanecer en esta página",
"leave": "Salir sin guardar"
},
"defaultGuestbookUpdateError": "Ocurrió un error al actualizar el libro de visitas del dataset. Inténtalo de nuevo.",
"defaultLicenseUpdateError": "Ocurrió un error al actualizar la licencia del dataset. Inténtalo de nuevo.",
"defaultTermsOfAccessUpdateError": "Ocurrió un error al actualizar los términos de acceso del dataset. Inténtalo de nuevo."
}
}
12 changes: 12 additions & 0 deletions public/locales/es/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@
"helpText": "Comparte este fichero en tus redes sociales favoritas."
}
},
"actions": {
"optionsMenu": {
"guestbookCollectModal": {
"submitError": "Algo salió mal al enviar las respuestas del libro de visitas. Inténtalo de nuevo más tarde.",
"downloadError": "Algo salió mal al descargar el archivo. Inténtalo de nuevo más tarde.",
"validation": {
"required": "Este campo es obligatorio.",
"invalidEmail": "Por favor, ingresa un correo electrónico válido."
}
}
}
},
"deleteFileModal": {
"title": "Eliminar archivo",
"message": "El fichero se eliminará después de hacer clic en el botón Eliminar.",
Expand Down
13 changes: 13 additions & 0 deletions public/locales/es/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
"title": "Opciones de archivo",
"headers": {
"editOptions": "Opciones de edición"
},
"guestbookCollectModal": {
"title": "Libro de visitas del dataset",
"message": "Hay un libro de visitas asignado a este dataset. Se pedirá a los usuarios que proporcionen información adicional al descargar archivos.",
"close": "Cerrar",
"additionalQuestions": "Preguntas adicionales",
"submitError": "Algo salió mal al enviar las respuestas del libro de visitas. Inténtalo de nuevo más tarde.",
"downloadStarted": "Tu descarga ha comenzado.",
"downloadError": "Algo salió mal al descargar el archivo. Inténtalo de nuevo más tarde.",
"validation": {
"required": "Este campo es obligatorio.",
"invalidEmail": "Por favor, ingresa un correo electrónico válido."
}
}
},
"alreadyDeletedAlert": {
Expand Down
33 changes: 33 additions & 0 deletions public/locales/es/guestbooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"title": "Libros de visitas del dataset",
"errors": {
"getGuestbook": "Algo salió mal al obtener el libro de visitas. Inténtalo de nuevo más tarde."
},
"preview": {
"title": "Vista previa del libro de visitas",
"description": "Al descargar ficheros, el libro de visitas solicita la siguiente información.",
"guestbookNameLabel": "Nombre del libro de visitas",
"guestbookDataLabel": "Datos recopilados",
"guestbookDataTip": "Datos del usuario recopilados por el libro de visitas.",
"collectedDataLabel": "Datos recopilados",
"collectedDataTip": "Datos del usuario recopilados por el libro de visitas.",
"accountInformation": "Información de la cuenta",
"customQuestionsLabel": "Preguntas personalizadas",
"required": "Obligatorio",
"optional": "Opcional"
},
"create": {
"fields": {
"dataCollected": {
"label": "Datos recopilados",
"help": "Información de la cuenta de Dataverse que se recopilará cuando un usuario descargue un fichero. Marca las que serán obligatorias.",
"options": {
"name": "Nombre",
"email": "Correo electrónico",
"institution": "Institución",
"position": "Cargo"
}
}
}
}
}
28 changes: 28 additions & 0 deletions src/access/domain/repositories/AccessRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export type GuestbookAnswerDTO = {
id: number | string
value: string | string[]
}

export type GuestbookResponseDTO = {
guestbookResponse: {
name?: string
email?: string
institution?: string
position?: string
answers?: GuestbookAnswerDTO[]
}
}
export interface AccessRepository {
submitGuestbookForDatasetDownload: (
datasetId: number | string,
answers: GuestbookResponseDTO
) => Promise<string>
submitGuestbookForDatafileDownload: (
fileId: number | string,
answers: GuestbookResponseDTO
) => Promise<string>
submitGuestbookForDatafilesDownload: (
fileIds: Array<number>,
answers: GuestbookResponseDTO
) => Promise<string>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AccessRepository, GuestbookResponseDTO } from '../repositories/AccessRepository'

export function submitGuestbookForDatafileDownload(
accessRepository: AccessRepository,
fileId: number | string,
answers: GuestbookResponseDTO
): Promise<string> {
return accessRepository.submitGuestbookForDatafileDownload(fileId, answers)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AccessRepository, GuestbookResponseDTO } from '../repositories/AccessRepository'

export function submitGuestbookForDatafilesDownload(
accessRepository: AccessRepository,
fileIds: Array<number>,
answers: GuestbookResponseDTO
): Promise<string> {
return accessRepository.submitGuestbookForDatafilesDownload(fileIds, answers)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AccessRepository, GuestbookResponseDTO } from '../repositories/AccessRepository'

export function submitGuestbookForDatasetDownload(
accessRepository: AccessRepository,
datasetId: number | string,
answers: GuestbookResponseDTO
): Promise<string> {
return accessRepository.submitGuestbookForDatasetDownload(datasetId, answers)
}
Loading
Loading