From bb64ac267e41f68fae96acec89c2bdcc4720a12b Mon Sep 17 00:00:00 2001 From: Cheng Shi Date: Fri, 20 Mar 2026 11:43:39 -0400 Subject: [PATCH 1/2] fix: e2e error on fileJsDataverseRepo --- .../files/FileJSDataverseRepository.spec.ts | 1 + tests/e2e-integration/shared/files/FileHelper.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts b/tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts index c169b047c..bf0f418a7 100644 --- a/tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts +++ b/tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts @@ -103,6 +103,7 @@ const fileExpectedData = (id: number, datasetPid: string): Omit Cypress.Blob.binaryStringToBlob(binary, 'image/jpeg')) } - static async download(id: number) { - cy.visit(`/file.xhtml?fileId=${id}`) - .get('#actionButtonBlock > div:nth-child(1) > div > button') - .click() - .get('#fileForm\\:j_idt274') - .click() - return Promise.resolve() + static download(id: number): Promise { + return new Cypress.Promise((resolve) => { + cy.visit(`/spa/files?id=${id}`) + cy.get(`#action-button-access-file-${id}`).click() + cy.findByTestId(`download-original-file-${id}`).click() + cy.then(() => resolve()) + }) } static async addLabel(id: number, labels: FileLabel[]) { From 856955aa9991b2573fecf4bb17eea89501ecdbc0 Mon Sep 17 00:00:00 2001 From: Cheng Shi Date: Fri, 20 Mar 2026 16:40:09 -0400 Subject: [PATCH 2/2] feat: add note to sign in page --- src/index.tsx | 42 +++++++++++++----------- src/keycloak-theme/login/i18n.ts | 11 ++++++- src/keycloak-theme/login/pages/Login.tsx | 5 ++- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 3c9bad5dc..90ffe98aa 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -11,31 +11,35 @@ const AppEntrypoint = lazy(() => import('./index.app')) const container = document.getElementById('root') as HTMLElement const root = createRoot(container) -const appConfigInit = initAppConfig() - -if (!appConfigInit.ok) { +if (window.kcContext) { root.render( - + + + ) } else { - const appConfig = requireAppConfig() + const appConfigInit = initAppConfig() - ApiConfig.init( - `${appConfig.backendUrl}/api/v1`, - DataverseApiAuthMechanism.BEARER_TOKEN, - undefined, - `${appConfig.oidc.localStorageKeyPrefix}token` - ) + if (!appConfigInit.ok) { + root.render( + + ) + } else { + const appConfig = requireAppConfig() - root.render( - - {window.kcContext ? ( - - ) : ( + ApiConfig.init( + `${appConfig.backendUrl}/api/v1`, + DataverseApiAuthMechanism.BEARER_TOKEN, + undefined, + `${appConfig.oidc.localStorageKeyPrefix}token` + ) + + root.render( + - )} - - ) + + ) + } } diff --git a/src/keycloak-theme/login/i18n.ts b/src/keycloak-theme/login/i18n.ts index 263ad3762..3d28ab996 100644 --- a/src/keycloak-theme/login/i18n.ts +++ b/src/keycloak-theme/login/i18n.ts @@ -3,7 +3,16 @@ import { i18nBuilder } from 'keycloakify/login' import type { ThemeName } from '../kc.gen' /** @see: https://docs.keycloakify.dev/features/i18n */ -const { useI18n, ofTypeI18n } = i18nBuilder.withThemeName().build() +const { useI18n, ofTypeI18n } = i18nBuilder + .withThemeName() + .withCustomTranslations({ + en: { + signInNoticeTitle: 'Note', + signInNoticeBody: + 'Please use your Username/Email or Institutional Account to sign in. Other identity providers(ORCID, GitHub, Microsoft and Google) are not supported for Dataverse SPA.' + } + }) + .build() type I18n = typeof ofTypeI18n diff --git a/src/keycloak-theme/login/pages/Login.tsx b/src/keycloak-theme/login/pages/Login.tsx index 67de4822a..3e3cb67cf 100644 --- a/src/keycloak-theme/login/pages/Login.tsx +++ b/src/keycloak-theme/login/pages/Login.tsx @@ -5,7 +5,7 @@ import { useIsPasswordRevealed } from 'keycloakify/tools/useIsPasswordRevealed' import type { PageProps } from 'keycloakify/login/pages/PageProps' import type { KcContext } from '../KcContext' import type { I18n } from '../i18n' -import { Button, Col, Form } from '@iqss/dataverse-design-system' +import { Alert, Button, Col, Form } from '@iqss/dataverse-design-system' import { EyeFill, EyeSlashFill, @@ -92,6 +92,9 @@ export default function Login(props: PageProps }> + + {msg('signInNoticeBody')} +
{realm.password && (