diff --git a/packages/console/src/pages/SignInExperience/utils/constants.ts b/packages/console/src/pages/SignInExperience/utils/constants.ts index 41fcc5b50..a86a3017e 100644 --- a/packages/console/src/pages/SignInExperience/utils/constants.ts +++ b/packages/console/src/pages/SignInExperience/utils/constants.ts @@ -6,10 +6,9 @@ import { conditionalArray } from '@silverhand/essentials'; import { isDevFeaturesEnabled } from '@/consts/env'; -export const hiddenLocalePhraseGroups: readonly LocalePhraseGroupKey[] = [ - 'demo_app', - ...conditionalArray(!isDevFeaturesEnabled && 'mfa'), -]; +export const hiddenLocalePhraseGroups: readonly LocalePhraseGroupKey[] = conditionalArray( + !isDevFeaturesEnabled && 'mfa' +); export const hiddenLocalePhrases: readonly LocalePhraseKey[] = [ ...conditionalArray( diff --git a/packages/core/src/oidc/init.ts b/packages/core/src/oidc/init.ts index e1c73dea4..027ddc39d 100644 --- a/packages/core/src/oidc/init.ts +++ b/packages/core/src/oidc/init.ts @@ -183,8 +183,7 @@ export default function initOidc( ); const appendParameters = (path: string) => { - // `notification` is for showing a text banner on the homepage - return isDemoApp ? path + `?notification=demo_app.notification&no_cache` : path; + return isDemoApp ? path + `?no_cache` : path; }; switch (prompt.name) { diff --git a/packages/experience/src/Layout/LandingPageLayout/index.tsx b/packages/experience/src/Layout/LandingPageLayout/index.tsx index 3c940f062..1ab8fc303 100644 --- a/packages/experience/src/Layout/LandingPageLayout/index.tsx +++ b/packages/experience/src/Layout/LandingPageLayout/index.tsx @@ -9,8 +9,6 @@ import PageMeta from '@/components/PageMeta'; import { layoutClassNames } from '@/utils/consts'; import { getBrandingLogoUrl } from '@/utils/logo'; -import AppNotification from '../../containers/AppNotification'; - import * as styles from './index.module.scss'; type Props = { @@ -44,7 +42,6 @@ const LandingPageLayout = ({ children, className, title }: Props) => { {children} {platform === 'web' &&
} - ); }; diff --git a/packages/experience/src/containers/AppNotification/index.module.scss b/packages/experience/src/containers/AppNotification/index.module.scss deleted file mode 100644 index 2ec3bef71..000000000 --- a/packages/experience/src/containers/AppNotification/index.module.scss +++ /dev/null @@ -1,24 +0,0 @@ -@use '@/scss/underscore' as _; - -.appNotification { - position: absolute; - max-width: 520px; -} - -:global(body.mobile) { - .appNotification { - top: _.unit(6); - left: _.unit(5); - right: _.unit(5); - margin: 0 auto; - } -} - -:global(body.desktop) { - .appNotification { - left: 50%; - transform: translate(-50%); - width: max-content; - max-width: calc(100% - 40px); - } -} diff --git a/packages/experience/src/containers/AppNotification/index.tsx b/packages/experience/src/containers/AppNotification/index.tsx deleted file mode 100644 index 1768e33ac..000000000 --- a/packages/experience/src/containers/AppNotification/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import type { Nullable } from '@silverhand/essentials'; -import { useState, useEffect, useCallback, useRef } from 'react'; -import { createPortal } from 'react-dom'; -import { Trans, useTranslation } from 'react-i18next'; - -import { AppNotification as Notification } from '@/components/Notification'; -import usePlatform from '@/hooks/use-platform'; -import { searchKeys } from '@/utils/search-parameters'; - -import * as styles from './index.module.scss'; - -const AppNotification = () => { - const { isMobile } = usePlatform(); - const [notification, setNotification] = useState>(null); - const [topOffset, setTopOffset] = useState(); - const eleRef = useRef(null); - const { t } = useTranslation(); - - const adjustNotificationPosition = useCallback(() => { - const mainEleOffsetTop = document.querySelector('main')?.offsetTop; - const elementHeight = eleRef.current?.offsetHeight; - - if (mainEleOffsetTop !== undefined && elementHeight) { - const topSpace = mainEleOffsetTop - elementHeight - 24; - setTopOffset(Math.max(32, topSpace)); - } - }, []); - - useEffect(() => { - setNotification(sessionStorage.getItem(searchKeys.notification)); - }, []); - - useEffect(() => { - if (!notification || isMobile) { - return; - } - - adjustNotificationPosition(); - - window.addEventListener('resize', adjustNotificationPosition); - - return () => { - window.removeEventListener('resize', adjustNotificationPosition); - }; - }, [adjustNotificationPosition, isMobile, notification]); - - const onClose = useCallback(() => { - setNotification(null); - }, []); - - if (!notification) { - return null; - } - - return createPortal( - {notification}} - style={isMobile ? undefined : { top: topOffset }} - onClose={onClose} - />, - document.body - ); -}; - -export default AppNotification; diff --git a/packages/experience/src/utils/search-parameters.ts b/packages/experience/src/utils/search-parameters.ts index 8292368a8..adbac828f 100644 --- a/packages/experience/src/utils/search-parameters.ts +++ b/packages/experience/src/utils/search-parameters.ts @@ -1,5 +1,4 @@ export const searchKeys = Object.freeze({ - notification: 'notification', noCache: 'no_cache', }); @@ -12,12 +11,6 @@ export const handleSearchParametersData = () => { const parameters = new URLSearchParams(search); - const notification = parameters.get(searchKeys.notification); - - if (notification) { - sessionStorage.setItem(searchKeys.notification, notification); - } - if (parameters.get(searchKeys.noCache) !== null) { sessionStorage.setItem(searchKeys.noCache, 'true'); } diff --git a/packages/integration-tests/src/tests/api/well-known.test.ts b/packages/integration-tests/src/tests/api/well-known.test.ts index 46a001106..c39c10bdc 100644 --- a/packages/integration-tests/src/tests/api/well-known.test.ts +++ b/packages/integration-tests/src/tests/api/well-known.test.ts @@ -41,18 +41,18 @@ describe('.well-known api', () => { // Also test for Redis cache invalidation it('should be able to return updated phrases', async () => { - const notification = 'Big brother is watching you.'; + const and = '&'; const original = await api .get('.well-known/phrases?lng=en') .json<{ translation: Translation }>(); - expect(original.translation.demo_app).not.toHaveProperty('notification', notification); + expect(original.translation.list).not.toHaveProperty('and', and); - await authedAdminApi.put('custom-phrases/en', { json: { demo_app: { notification } } }); + await authedAdminApi.put('custom-phrases/en', { json: { list: { and } } }); const updated = await api .get('.well-known/phrases?lng=en') .json<{ translation: Translation }>(); - expect(updated.translation.demo_app).toHaveProperty('notification', notification); + expect(updated.translation.list).toHaveProperty('and', and); }); describe('sso connectors in sign-in experience', () => { diff --git a/packages/phrases-experience/src/locales/de/demo-app.ts b/packages/phrases-experience/src/locales/de/demo-app.ts deleted file mode 100644 index c1539bc24..000000000 --- a/packages/phrases-experience/src/locales/de/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Tipp: Erstelle zuerst ein Konto, um die Anmeldeerfahrung zu testen.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/de/index.ts b/packages/phrases-experience/src/locales/de/index.ts index 44c709a73..c853e3a93 100644 --- a/packages/phrases-experience/src/locales/de/index.ts +++ b/packages/phrases-experience/src/locales/de/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const de = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/en/demo-app.ts b/packages/phrases-experience/src/locales/en/demo-app.ts deleted file mode 100644 index 3ffe78869..000000000 --- a/packages/phrases-experience/src/locales/en/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Tip: Create an account first to test the sign-in experience.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/en/index.ts b/packages/phrases-experience/src/locales/en/index.ts index 3798d2652..2c9ba3ee4 100644 --- a/packages/phrases-experience/src/locales/en/index.ts +++ b/packages/phrases-experience/src/locales/en/index.ts @@ -1,5 +1,4 @@ import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -14,7 +13,6 @@ const en = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/es/demo-app.ts b/packages/phrases-experience/src/locales/es/demo-app.ts deleted file mode 100644 index 1777ae3ae..000000000 --- a/packages/phrases-experience/src/locales/es/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Consejo: Crea una cuenta primero para probar la experiencia de inicio de sesión.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/es/index.ts b/packages/phrases-experience/src/locales/es/index.ts index 90508f9f9..0dc0ca996 100644 --- a/packages/phrases-experience/src/locales/es/index.ts +++ b/packages/phrases-experience/src/locales/es/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const es = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/fr/demo-app.ts b/packages/phrases-experience/src/locales/fr/demo-app.ts deleted file mode 100644 index 28053c977..000000000 --- a/packages/phrases-experience/src/locales/fr/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: "Astuce : Créez d'abord un compte pour tester l'expérience de connexion.", -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/fr/index.ts b/packages/phrases-experience/src/locales/fr/index.ts index e54c3768f..b872a65aa 100644 --- a/packages/phrases-experience/src/locales/fr/index.ts +++ b/packages/phrases-experience/src/locales/fr/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const fr = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/it/demo-app.ts b/packages/phrases-experience/src/locales/it/demo-app.ts deleted file mode 100644 index 0a2db01b5..000000000 --- a/packages/phrases-experience/src/locales/it/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: "Suggerimento: crea prima un account per testare l'esperienza di accesso.", -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/it/index.ts b/packages/phrases-experience/src/locales/it/index.ts index b3913a2e6..2a8ac2ab8 100644 --- a/packages/phrases-experience/src/locales/it/index.ts +++ b/packages/phrases-experience/src/locales/it/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const it = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/ja/demo-app.ts b/packages/phrases-experience/src/locales/ja/demo-app.ts deleted file mode 100644 index 70e901af4..000000000 --- a/packages/phrases-experience/src/locales/ja/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'ヒント:最初にアカウントを作成してサインイン体験をテストしてください。', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/ja/index.ts b/packages/phrases-experience/src/locales/ja/index.ts index 55f2aa9aa..5fd337ec2 100644 --- a/packages/phrases-experience/src/locales/ja/index.ts +++ b/packages/phrases-experience/src/locales/ja/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const ja = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/ko/demo-app.ts b/packages/phrases-experience/src/locales/ko/demo-app.ts deleted file mode 100644 index a3f399888..000000000 --- a/packages/phrases-experience/src/locales/ko/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: '알림:로그인 경험을 테스트하기 위해 먼저 계정을 만드는 것이 좋아요.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/ko/index.ts b/packages/phrases-experience/src/locales/ko/index.ts index 6f968a78a..5c161ab2b 100644 --- a/packages/phrases-experience/src/locales/ko/index.ts +++ b/packages/phrases-experience/src/locales/ko/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const ko = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/pl-pl/demo-app.ts b/packages/phrases-experience/src/locales/pl-pl/demo-app.ts deleted file mode 100644 index 1123b1b22..000000000 --- a/packages/phrases-experience/src/locales/pl-pl/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Wskazówka: Najpierw stwórz konto, aby przetestować proces logowania.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/pl-pl/index.ts b/packages/phrases-experience/src/locales/pl-pl/index.ts index 809af1260..cbb83a5fc 100644 --- a/packages/phrases-experience/src/locales/pl-pl/index.ts +++ b/packages/phrases-experience/src/locales/pl-pl/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const pl_pl = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/pt-br/demo-app.ts b/packages/phrases-experience/src/locales/pt-br/demo-app.ts deleted file mode 100644 index 4c149fd1a..000000000 --- a/packages/phrases-experience/src/locales/pt-br/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Dica: Crie uma conta primeiro para testar a experiência de login.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/pt-br/index.ts b/packages/phrases-experience/src/locales/pt-br/index.ts index da27fccd5..0d1a677eb 100644 --- a/packages/phrases-experience/src/locales/pt-br/index.ts +++ b/packages/phrases-experience/src/locales/pt-br/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const pt_br = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/pt-pt/demo-app.ts b/packages/phrases-experience/src/locales/pt-pt/demo-app.ts deleted file mode 100644 index 4c149fd1a..000000000 --- a/packages/phrases-experience/src/locales/pt-pt/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Dica: Crie uma conta primeiro para testar a experiência de login.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/pt-pt/index.ts b/packages/phrases-experience/src/locales/pt-pt/index.ts index 027406354..b48274d42 100644 --- a/packages/phrases-experience/src/locales/pt-pt/index.ts +++ b/packages/phrases-experience/src/locales/pt-pt/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const pt_pt = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/ru/demo-app.ts b/packages/phrases-experience/src/locales/ru/demo-app.ts deleted file mode 100644 index a89fb2805..000000000 --- a/packages/phrases-experience/src/locales/ru/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'Совет: Создайте аккаунт сначала, чтобы протестировать процесс входа.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/ru/index.ts b/packages/phrases-experience/src/locales/ru/index.ts index 2b31274e4..973f836c0 100644 --- a/packages/phrases-experience/src/locales/ru/index.ts +++ b/packages/phrases-experience/src/locales/ru/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const ru = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/tr-tr/demo-app.ts b/packages/phrases-experience/src/locales/tr-tr/demo-app.ts deleted file mode 100644 index 70c505662..000000000 --- a/packages/phrases-experience/src/locales/tr-tr/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: 'İpucu: Oturum açma deneyimini test etmek için önce bir hesap oluşturun.', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/tr-tr/index.ts b/packages/phrases-experience/src/locales/tr-tr/index.ts index 7857a8685..c0c83fab7 100644 --- a/packages/phrases-experience/src/locales/tr-tr/index.ts +++ b/packages/phrases-experience/src/locales/tr-tr/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const tr_tr = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/zh-cn/demo-app.ts b/packages/phrases-experience/src/locales/zh-cn/demo-app.ts deleted file mode 100644 index f72a095fb..000000000 --- a/packages/phrases-experience/src/locales/zh-cn/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: '提示:先注册一个账号,再测试登录体验。', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/zh-cn/index.ts b/packages/phrases-experience/src/locales/zh-cn/index.ts index 8d7501792..2f3dcb8d0 100644 --- a/packages/phrases-experience/src/locales/zh-cn/index.ts +++ b/packages/phrases-experience/src/locales/zh-cn/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const zh_cn = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/zh-hk/demo-app.ts b/packages/phrases-experience/src/locales/zh-hk/demo-app.ts deleted file mode 100644 index 0abee5fa0..000000000 --- a/packages/phrases-experience/src/locales/zh-hk/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: '提示:先注冊一個賬號,再測試登入體驗。', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/zh-hk/index.ts b/packages/phrases-experience/src/locales/zh-hk/index.ts index 7237da138..ad1072efe 100644 --- a/packages/phrases-experience/src/locales/zh-hk/index.ts +++ b/packages/phrases-experience/src/locales/zh-hk/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const zh_hk = { action, description, error, - demo_app, list, mfa, }, diff --git a/packages/phrases-experience/src/locales/zh-tw/demo-app.ts b/packages/phrases-experience/src/locales/zh-tw/demo-app.ts deleted file mode 100644 index a30bbd927..000000000 --- a/packages/phrases-experience/src/locales/zh-tw/demo-app.ts +++ /dev/null @@ -1,5 +0,0 @@ -const demo_app = { - notification: '提示:先註冊一個帳號,再測試登錄體驗。', -}; - -export default Object.freeze(demo_app); diff --git a/packages/phrases-experience/src/locales/zh-tw/index.ts b/packages/phrases-experience/src/locales/zh-tw/index.ts index 8f9ced7d7..9d460af30 100644 --- a/packages/phrases-experience/src/locales/zh-tw/index.ts +++ b/packages/phrases-experience/src/locales/zh-tw/index.ts @@ -1,7 +1,6 @@ import type { LocalePhrase } from '../../types.js'; import action from './action.js'; -import demo_app from './demo-app.js'; import description from './description.js'; import error from './error/index.js'; import input from './input.js'; @@ -16,7 +15,6 @@ const zh_tw = { action, description, error, - demo_app, list, mfa, },