From 7808d7fcbc9a7d08a61b3d016ba7cd3617dc6b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 28 Feb 2024 15:12:10 +0100 Subject: [PATCH 1/3] test: crisp variable log --- webapp/src/components/support/Crisp.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/src/components/support/Crisp.ts b/webapp/src/components/support/Crisp.ts index 33450dd4..1804cc67 100644 --- a/webapp/src/components/support/Crisp.ts +++ b/webapp/src/components/support/Crisp.ts @@ -14,6 +14,7 @@ const crispToken = process.env.NEXT_PUBLIC_CRISP_TOKEN as string const CrispChat = (props: CrispProps) => { const { user, onClose } = props; useEffect(() => { + console.log(crispToken) if (crispToken) { Crisp.configure(crispToken, { autoload: false, From 242aa0ac064f78c5bfdf5aa015c066751326f8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 28 Feb 2024 15:28:24 +0100 Subject: [PATCH 2/3] fix: crisp token from page --- webapp/src/components/support/Crisp.ts | 5 ++--- webapp/src/pages/dashboard/account/index.tsx | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/support/Crisp.ts b/webapp/src/components/support/Crisp.ts index 1804cc67..b7ee79a1 100644 --- a/webapp/src/components/support/Crisp.ts +++ b/webapp/src/components/support/Crisp.ts @@ -6,15 +6,14 @@ import { UserIncluded } from "~/server/api/routers/user"; type CrispProps = { user: UserIncluded; + crispToken: string; onClose: () => void; } -const crispToken = process.env.NEXT_PUBLIC_CRISP_TOKEN as string const CrispChat = (props: CrispProps) => { - const { user, onClose } = props; + const { user, onClose, crispToken } = props; useEffect(() => { - console.log(crispToken) if (crispToken) { Crisp.configure(crispToken, { autoload: false, diff --git a/webapp/src/pages/dashboard/account/index.tsx b/webapp/src/pages/dashboard/account/index.tsx index 053d73b5..039c814a 100644 --- a/webapp/src/pages/dashboard/account/index.tsx +++ b/webapp/src/pages/dashboard/account/index.tsx @@ -25,6 +25,8 @@ import { UserIncluded } from "~/server/api/routers/user"; import NewPassComponent from "~/components/NewPassComponent"; import dynamic from "next/dynamic"; +const CRISP_TOKEN = process.env.NEXT_PUBLIC_CRISP_TOKEN as string + const displayDynamicCJECardMessage = (user: User) => { if (!user.image) { return ( @@ -260,7 +262,7 @@ export default function Account() { onClose={() => setIsOpenNewPassComponent(false)} /> { - isOpenCrisp && user && ( { + isOpenCrisp && user && ( { setIsOpenCrisp(false) }} />) } From b5e7799ca5576cbfe8da22d82342a632903c271a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 28 Feb 2024 15:55:58 +0100 Subject: [PATCH 3/3] fix: Dockerfile args --- webapp/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webapp/Dockerfile b/webapp/Dockerfile index b76b73a3..d2e47d8b 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -8,6 +8,17 @@ COPY yarn.lock .yarnrc.yml ./ COPY .yarn .yarn RUN yarn fetch +ARG NEXT_PUBLIC_JWT_NAME +ENV NEXT_PUBLIC_JWT_NAME=$NEXT_PUBLIC_JWT_NAME +ARG NEXT_PUBLIC_MATOMO_URL +ENV NEXT_PUBLIC_MATOMO_URL=$NEXT_PUBLIC_MATOMO_URL +ARG NEXT_PUBLIC_MATOMO_SITE_ID +ENV NEXT_PUBLIC_MATOMO_SITE_ID=$NEXT_PUBLIC_MATOMO_SITE_ID +ARG NEXT_PUBLIC_MATOMO_TRACKING_ENABLED +ENV NEXT_PUBLIC_MATOMO_TRACKING_ENABLED=$NEXT_PUBLIC_MATOMO_TRACKING_ENABLED +ARG NEXT_PUBLIC_CRISP_TOKEN +ENV NEXT_PUBLIC_CRISP_TOKEN=$NEXT_PUBLIC_CRISP_TOKEN + COPY . . RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; \ yarn build