Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4105729
delete hash messages
javiert-okta Dec 3, 2025
745bc69
delete hash component from layout
javiert-okta Dec 3, 2025
01e7d48
delete hash warning call
javiert-okta Dec 3, 2025
25dbc97
delete use hash warning
javiert-okta Dec 3, 2025
f811425
remove hash from url
javiert-okta Dec 3, 2025
8d06e99
temp disable hashchange listeners
javiert-okta Dec 8, 2025
0a10bc2
temporary logs
javiert-okta Dec 8, 2025
acdb533
temporary logs
javiert-okta Dec 8, 2025
ab7d9e0
move middleware search param logic to client decoder
javiert-okta Dec 8, 2025
26465fe
remove temp logs
javiert-okta Dec 9, 2025
231eac8
add temp useeffect
javiert-okta Dec 9, 2025
ff5cb89
fix client issue
javiert-okta Dec 9, 2025
e7dc5f4
remove temp useeffect
javiert-okta Dec 9, 2025
7db266c
temp remove jwt editor
javiert-okta Dec 9, 2025
3b5f793
temp disable input component
javiert-okta Dec 9, 2025
f625261
temp disable secret key
javiert-okta Dec 9, 2025
e6968cc
temp remove content output
javiert-okta Dec 9, 2025
2765794
temp disable token encoder and decoder
javiert-okta Dec 9, 2025
2386700
temp disable assets component
javiert-okta Dec 10, 2025
c16287f
undo temp changes
javiert-okta Dec 10, 2025
cbbc059
remove temp logs
javiert-okta Dec 11, 2025
567019f
update latest changes on main
javiert-okta Dec 11, 2025
8063748
temp remove layout
javiert-okta Dec 22, 2025
7b4d9ef
temp comment shell component
javiert-okta Dec 22, 2025
1a1e001
add temp log in shell component
javiert-okta Dec 22, 2025
70dfaf9
temp remove scripts
javiert-okta Dec 22, 2025
4432c7e
add back adobe analytics and theme detector component
javiert-okta Dec 22, 2025
690a582
add back one trust script
javiert-okta Dec 22, 2025
cb41d5b
add google tag and ab testing components
javiert-okta Dec 22, 2025
c69332b
temp remove google tag manager
javiert-okta Dec 22, 2025
8e01d07
temp remove ab testing
javiert-okta Dec 22, 2025
7fa8c2a
upgrade next third party library
javiert-okta Dec 23, 2025
5c5c4c3
add ab testing component back
javiert-okta Dec 23, 2025
32730d0
fix package-lock.json
javiert-okta Jan 13, 2026
b61d7f7
add safe gtm component
javiert-okta Jan 13, 2026
ba4e9b9
add temp log
javiert-okta Jan 13, 2026
1020d1c
reduce max url length
javiert-okta Jan 13, 2026
06b486b
set timeout for loading gtm component
javiert-okta Jan 13, 2026
e2cca12
load gtm on client test
javiert-okta Jan 13, 2026
225efe7
revert gtm logic, delete unnecessary log
javiert-okta Jan 13, 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
2 changes: 1 addition & 1 deletion .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: npx playwright install --with-deps

- name: Run Playwright Tests
run: npx playwright test
run: NODE_OPTIONS="--no-experimental-strip-types" npx playwright test

- name: Upload Playwright Traces
if: failure()
Expand Down
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import createMDX from "@next/mdx";

/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
webpack(config) {
config.module.rules.push(
{
Expand Down
13,868 changes: 7,284 additions & 6,584 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "^14.2.17",
"@next/third-parties": "^14.2.17",
"@next/third-parties": "^14.2.35",
"@svgr/webpack": "^8.1.0",
"@types/js-cookie": "^3.0.6",
"@types/mdx": "^2.0.13",
Expand Down
2 changes: 0 additions & 2 deletions src/app/[language]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.conf
import { cookies } from "next/headers";
import { PREFERRED_THEME_COOKIE_KEY } from "@/features/themes/theme.config";
import { PageLayoutComponent } from "@/features/common/components/layout/page-layout/page-layout.component";
import { UseHashWarningComponent } from "@/features/decoder/components/use-hash-warning/use-hash-warning.component";
import { PageMetadataProps } from "@/features/common/models/page-metadata.props";
import { getHomeDictionary } from "@/features/localization/services/language-dictionary.service";
import { generatePageMetadata } from "@/libs/metadata/metadata.service";
Expand Down Expand Up @@ -54,7 +53,6 @@ export default function RootLayout({
themeCode={initialThemeCookieValue}
>
{children}
<UseHashWarningComponent languageCode={languageCode} />
</PageLayoutComponent>
);
}
23 changes: 22 additions & 1 deletion src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ export default function sitemap(): MetadataRoute.Sitemap {
{
url: BASE_URL,
lastModified: new Date(),
alternates: {
languages: {
en: `${BASE_URL}/`,
ja: `${BASE_URL}/ja/`,
"x-default": `${BASE_URL}/`,
},
},
},
{
url: `${BASE_URL}/introduction`,
lastModified: new Date(),
alternates: {
languages: {
en: `${BASE_URL}/introduction`,
ja: `${BASE_URL}/ja/introduction`,
"x-default": `${BASE_URL}/introduction`,
},
},
},
{
url: `${BASE_URL}/libraries`,
lastModified: new Date(),
alternates: {
languages: {
en: `${BASE_URL}/libraries`,
ja: `${BASE_URL}/ja/libraries`,
"x-default": `${BASE_URL}/libraries`,
},
},
},
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Script from 'next/script';

const AdobeAnalyticsScript = () => {
const source = process.env.NEXT_PUBLIC_ADOBE_ANALYTICS_URL;
return source ? (
<Script type="text/javascript" src={source} charSet="UTF-8" async></Script>
) : null;
};

export default AdobeAnalyticsScript;
30 changes: 30 additions & 0 deletions src/features/common/components/shell/gtm/safe-gtm.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use client'

import { GoogleTagManager } from "@next/third-parties/google"
import { useEffect, useState } from "react";

const MAX_HASH_LENGTH = 4000;

export function SafeGTM({ gtmId}: { gtmId: string}) {
const [canLoad, setCanLoad] = useState(false)

useEffect(() => {
/** GTM can make the app crash when large tokens are sent via hash
* This code deletes temporaly the hash, loads the GTM and then puts it
* back again
*/
const hash = window.location.hash
const hasLargeHash = hash.length > MAX_HASH_LENGTH
let originalHash = ""
if(hasLargeHash) {
originalHash = hash
window.location.hash = ""
setTimeout(() => {
window.location.hash = originalHash
}, 500)
}
setCanLoad(true)
}, [])

return canLoad ? <GoogleTagManager gtmId={gtmId} /> : null
}
12 changes: 7 additions & 5 deletions src/features/common/components/shell/shell.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { COOKIE_LEVELS } from "@/features/analytics/models/cookie-levels.constan
import { OnetrustScriptComponent } from "@/features/analytics/components/onetrust-script.component";
import { CLIENT_CONFIG } from "@/features/analytics/services/config";
import { COOKIE_CONSENT_STATUS } from "@/features/analytics/models/cookie-consent-status.constants";
import { GoogleTagManager } from "@next/third-parties/google";
import styles from "./shell.module.scss";
import { UiLocalizationService } from "@/features/localization/services/ui-localization.service";
import { clsx } from "clsx";
Expand All @@ -26,6 +25,8 @@ import {
import { ThemeDetectorComponent } from "@/features/common/components/theme-detector/theme-detector.component";
import { ThemeCookieValues } from "@/features/common/values/theme.values";
import { AbTestingScriptComponent } from "@/features/analytics/components/ab-testing-script/ab-testing-script.component";
import AdobeAnalyticsScript from "@/features/analytics/components/adobe-analytics-script.component";
import { SafeGTM } from "./gtm/safe-gtm.component";

const GTM_ID = process.env.NEXT_PUBLIC_GTM_ID;

Expand Down Expand Up @@ -55,11 +56,11 @@ export const ShellComponent: React.FC<ShellComponentProps> = ({
if (e.data === COOKIE_CONSENT_STATUS.WAITING_FOR_CONSENT) {
// eslint-disable-next-line new-cap
window.OneTrust.OnConsentChanged(() =>
setConsentLevel(window.OnetrustActiveGroups),
setConsentLevel(window.OnetrustActiveGroups)
);
}
},
[consentLevel],
[consentLevel]
);

useEffect(() => {
Expand Down Expand Up @@ -98,20 +99,21 @@ export const ShellComponent: React.FC<ShellComponentProps> = ({
PrimaryFont.variable,
SecondaryFont.variable,
JapaneseFont.variable,
MonoFont.variable,
MonoFont.variable
)}
data-theme={themeCode}
>
<OnetrustScriptComponent
id={CLIENT_CONFIG.DEVELOPERS_DATA_DOMAIN_ID_ONETRUST}
/>
<AdobeAnalyticsScript />
{children}
{consentLevel &&
consentLevel.includes(COOKIE_LEVELS.NECESSARY.toString()) &&
process.env.NEXT_PUBLIC_IS_PROD &&
GTM_ID && (
<>
<GoogleTagManager gtmId={GTM_ID} />
<SafeGTM gtmId={GTM_ID} />
<AbTestingScriptComponent />
</>
)}
Expand Down
44 changes: 5 additions & 39 deletions src/features/decoder/components/token-decoder.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { SecretKeyInputComponent } from "@/features/decoder/components/secret-ke
import { useDecoderStore } from "@/features/decoder/services/decoder.store";
import { useRouter } from "next/navigation";
import {
SupportedTokenHashParamValues,
WARNING_PARAM_KEY,
WARNING_PARAM_VALUE,
SupportedTokenHashParamValues
} from "@/libs/config/project.constants";
import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model";
import { ClaimDescriptionVisibilityValues } from "@/features/common/values/claim-description-visibility.values";
Expand Down Expand Up @@ -50,9 +48,6 @@ export const TokenDecoderComponent: React.FC<TokenDecoderComponentProps> = ({

const loadDecoderInputs = useDecoderStore((state) => state.loadDecoderInputs);
const handleJwtChange$ = useDecoderStore((state) => state.handleJwtChange);
const showUseHashWarning$ = useDecoderStore(
(state) => state.showUseHashWarning
);

useEffect(() => {
const handleHashChange = () => {
Expand All @@ -72,18 +67,17 @@ export const TokenDecoderComponent: React.FC<TokenDecoderComponentProps> = ({
}

const newUrl = `${currentUrl}#${SupportedTokenHashParamValues.TOKEN}=${token}`;

window.location.replace(newUrl);

return;
}

if (!hash.includes("=")) {
return;
}

const hashParams = new URLSearchParams(hash);


const hashParams = new URLSearchParams(hash);
Object.values(SupportedTokenHashParamValues).forEach((hashParamKey) => {
const token = hashParams.get(hashParamKey);

Expand All @@ -93,42 +87,14 @@ export const TokenDecoderComponent: React.FC<TokenDecoderComponentProps> = ({
});
};

const handleWarning = () => {
const search = window.location.search;

const searchParams = new URLSearchParams(search);
const warning = searchParams.get(WARNING_PARAM_KEY);

if (warning === WARNING_PARAM_VALUE) {
showUseHashWarning$();

searchParams.delete(WARNING_PARAM_KEY);

const currentUrl = window.location.href.split("?")[0];

let newUrl = `${currentUrl}`;

if (searchParams.size > 0) {
newUrl += `?${searchParams.toString()}`;
}

if (window.location.hash) {
newUrl += window.location.hash;
}

router.push(newUrl);
}
};

window.addEventListener("hashchange", handleHashChange);

handleHashChange();
handleWarning();

return () => {
window.removeEventListener("hashchange", handleHashChange);
};
}, [handleJwtChange$, router, showUseHashWarning$]);
}, [handleJwtChange$, router]);

useEffect(() => {
if (isMounted.current) {
Expand Down

This file was deleted.

This file was deleted.

Loading