diff --git a/.github/workflows/sync_translations.yml b/.github/workflows/sync_translations.yml
index d1599d0f59..3d1ce59f8d 100644
--- a/.github/workflows/sync_translations.yml
+++ b/.github/workflows/sync_translations.yml
@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4
- name: Download translations
- uses: crowdin/github-action@v2.3.0
+ uses: crowdin/github-action@v2.4.0
env:
GITHUB_TOKEN: ${{github.token}}
CROWDIN_PROJECT_ID: 342361
diff --git a/package.json b/package.json
index cc0af365d1..4ebcc928e7 100644
--- a/package.json
+++ b/package.json
@@ -1,20 +1,22 @@
{
"dependencies": {
- "@wireapp/api-client": "27.8.0",
- "@wireapp/commons": "5.2.13",
- "@wireapp/react-ui-kit": "9.26.0",
+ "@wireapp/api-client": "27.11.0",
+ "@wireapp/commons": "5.4.0",
+ "@wireapp/react-ui-kit": "9.28.0",
+ "@wireapp/telemetry": "0.1.3",
"core-js": "3.39.0",
"dotenv": "16.4.5",
"dotenv-extended": "2.9.0",
- "i18next": "23.16.4",
+ "i18next": "24.0.2",
"i18next-browser-languagedetector": "8.0.0",
"i18next-react-postprocessor": "3.1.0",
"jest-environment-jsdom": "29.7.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-i18next": "11.18.6",
- "react-router": "6.27.0",
- "react-router-dom": "6.27.0"
+ "react-router": "7.0.1",
+ "react-router-dom": "6.28.0",
+ "uuid": "11.0.3"
},
"devDependencies": {
"@babel/core": "7.26.0",
@@ -26,13 +28,14 @@
"@emotion/babel-preset-css-prop": "11.12.0",
"@testing-library/react": "12.1.4",
"@types/jest": "29.5.14",
- "@types/node": "22.8.6",
+ "@types/node": "22.10.1",
"@types/platform": "1.3.6",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react-router-dom": "5.3.3",
+ "@types/uuid": "10.0.0",
"@types/webpack-env": "1.18.5",
- "@typescript-eslint/eslint-plugin": "8.12.2",
+ "@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "7.17.0",
"@wireapp/copy-config": "2.2.10",
"@wireapp/eslint-config": "1.4.0",
@@ -45,8 +48,8 @@
"eslint-config-prettier": "9.1.0",
"eslint-plugin-babel": "5.3.1",
"eslint-plugin-import": "2.31.0",
- "eslint-plugin-jest": "28.8.3",
- "eslint-plugin-jsdoc": "50.4.3",
+ "eslint-plugin-jest": "28.9.0",
+ "eslint-plugin-jsdoc": "50.6.0",
"eslint-plugin-no-unsanitized": "4.1.2",
"eslint-plugin-prettier": "5.2",
"eslint-plugin-react": "7.37.2",
diff --git a/server/Server.ts b/server/Server.ts
index b17993e8e5..04c660594a 100644
--- a/server/Server.ts
+++ b/server/Server.ts
@@ -191,6 +191,7 @@ class Server {
this.app.get('/favicon.ico', (_req, res) => res.sendFile(path.join(__dirname, 'img', 'favicon.ico')));
this.app.get('/robots.txt', (_req, res) => res.sendFile(path.join(__dirname, 'robots', 'robots.txt')));
this.app.use('/script', express.static(path.join(__dirname, 'static', 'script')));
+ this.app.use('/libs', express.static(path.join(__dirname, 'libs')));
}
initTemplateEngine(): void {
diff --git a/server/ServerConfig.ts b/server/ServerConfig.ts
index abc0eebe8f..82083e46ab 100644
--- a/server/ServerConfig.ts
+++ b/server/ServerConfig.ts
@@ -48,6 +48,8 @@ export interface ServerConfig {
URL_TERMS_OF_USE_TEAMS: string;
URL_SUPPORT_BACKUP_HISTORY: string;
};
+ COUNTLY_SERVER_URL: string;
+ COUNTLY_API_KEY: string;
VERSION: string;
};
COMMIT: string;
diff --git a/server/bin/copy_server_assets.js b/server/bin/copy_server_assets.js
index f7591357ec..0ed104fdab 100755
--- a/server/bin/copy_server_assets.js
+++ b/server/bin/copy_server_assets.js
@@ -24,9 +24,15 @@ const path = require('path');
const srcFolder = '../';
const distFolder = '../dist/';
+const npmModulesFolder = '../../node_modules/';
const assetFolders = ['.ebextensions/', 'img/', 'robots/', 'templates/', 'certificate'];
assetFolders.forEach(assetFolder => {
fs.copySync(path.resolve(__dirname, srcFolder, assetFolder), path.resolve(__dirname, distFolder, assetFolder));
});
+
+fs.copySync(
+ path.resolve(__dirname, npmModulesFolder, '@wireapp/telemetry/lib/embed.js'),
+ path.resolve(__dirname, distFolder, 'libs/wire/telemetry/embed.js'),
+);
diff --git a/server/config.ts b/server/config.ts
index cc6928f09d..fc97b326a4 100644
--- a/server/config.ts
+++ b/server/config.ts
@@ -134,6 +134,8 @@ const config: ServerConfig = {
URL_SUPPORT_BACKUP_HISTORY: process.env.URL_SUPPORT_BACKUP_HISTORY,
},
VERSION: readFile(VERSION_FILE, '0.0.0'),
+ COUNTLY_SERVER_URL: process.env.COUNTLY_SERVER_URL,
+ COUNTLY_API_KEY: process.env.COUNTLY_API_KEY,
},
COMMIT: readFile(COMMIT_FILE, ''),
PIWIK_HOSTNAME: process.env.PIWIK_HOSTNAME,
diff --git a/server/package.json b/server/package.json
index dfd8ff293f..e01d5b5ae3 100644
--- a/server/package.json
+++ b/server/package.json
@@ -1,6 +1,6 @@
{
"dependencies": {
- "@wireapp/commons": "5.2.13",
+ "@wireapp/commons": "5.4.0",
"dotenv": "16.4.5",
"dotenv-extended": "2.9.0",
"express": "4.21.1",
@@ -13,8 +13,8 @@
"logdown": "3.3.1",
"moment": "2.30.1",
"nocache": "4.0.0",
- "pm2": "5.4.2",
- "uuid": "11.0.2"
+ "pm2": "5.4.3",
+ "uuid": "11.0.3"
},
"devDependencies": {
"@babel/core": "7.26.0",
@@ -34,9 +34,9 @@
"jszip": "3.10.1",
"nodemon": "3.1.7",
"opn": "6.0.0",
- "prettier": "3.3.3",
+ "prettier": "3.4.1",
"rimraf": "6.0.1",
- "typescript": "5.6.3",
+ "typescript": "5.7.2",
"webpack-dev-middleware": "7.4.2",
"webpack-hot-middleware": "2.26.1"
},
diff --git a/server/templates/index.hbs b/server/templates/index.hbs
index 259601c82e..128a8e58b9 100644
--- a/server/templates/index.hbs
+++ b/server/templates/index.hbs
@@ -17,7 +17,9 @@
-
+ {{#if config.CLIENT.COUNTLY_API_KEY}}
+
+ {{/if}}
Wire
diff --git a/server/yarn.lock b/server/yarn.lock
index 0121c04ce2..c368848d52 100644
--- a/server/yarn.lock
+++ b/server/yarn.lock
@@ -1981,15 +1981,15 @@ __metadata:
languageName: node
linkType: hard
-"@wireapp/commons@npm:5.2.13":
- version: 5.2.13
- resolution: "@wireapp/commons@npm:5.2.13"
+"@wireapp/commons@npm:5.4.0":
+ version: 5.4.0
+ resolution: "@wireapp/commons@npm:5.4.0"
dependencies:
ansi-regex: 5.0.1
fs-extra: 11.2.0
logdown: 3.3.1
platform: 1.3.6
- checksum: 1a330c3dfa7a6e859135bd50dec231682592e11e5b17b5614ef0a4d5ac40d9251ed0fd11cd896663cfd5375f23a49bd18f8018d0cfe380f33bf34cc2bc89f98f
+ checksum: a0edf8b4276b2f83c5dca5141187b3475a924716711bdc0fcaf02095d79065f5b032daab0392acc6d27e65fc99d7ef5e1fe33f7a8f7d39a465e9f0cb5b474fed
languageName: node
linkType: hard
@@ -2726,13 +2726,13 @@ __metadata:
linkType: hard
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1":
- version: 7.0.3
- resolution: "cross-spawn@npm:7.0.3"
+ version: 7.0.5
+ resolution: "cross-spawn@npm:7.0.5"
dependencies:
path-key: ^3.1.0
shebang-command: ^2.0.0
which: ^2.0.1
- checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52
+ checksum: 55c50004cb6bbea3649784caac6e7b8ddd03fa8c1e14dbd5a1f15896708378006eb7526a52a0f48770c768c9b8aed48a5888eb8e785ff59ff7749e74f66cd96b
languageName: node
linkType: hard
@@ -4999,9 +4999,9 @@ __metadata:
languageName: node
linkType: hard
-"pm2@npm:5.4.2":
- version: 5.4.2
- resolution: "pm2@npm:5.4.2"
+"pm2@npm:5.4.3":
+ version: 5.4.3
+ resolution: "pm2@npm:5.4.3"
dependencies:
"@pm2/agent": ~2.0.0
"@pm2/io": ~6.0.1
@@ -5041,7 +5041,7 @@ __metadata:
pm2-dev: bin/pm2-dev
pm2-docker: bin/pm2-docker
pm2-runtime: bin/pm2-runtime
- checksum: 652d80bb754c30bd0f3e7793e0116e1765699ad53aee936788c1043f5dc40432f3d9a2570e3f9abd0ecaebdc896835fa8ec87052f65b88a51222e83c12729327
+ checksum: e20dfd191f9100c6f8a4633e7f506b0996d0ca06efddddd2fc5b973e3c94df54381d1089e9aa7ae669b02dfa5a5750e85d269bf37a8e5096c1e59439c7916ae4
languageName: node
linkType: hard
@@ -5052,12 +5052,12 @@ __metadata:
languageName: node
linkType: hard
-"prettier@npm:3.3.3":
- version: 3.3.3
- resolution: "prettier@npm:3.3.3"
+"prettier@npm:3.4.1":
+ version: 3.4.1
+ resolution: "prettier@npm:3.4.1"
bin:
prettier: bin/prettier.cjs
- checksum: bc8604354805acfdde6106852d14b045bb20827ad76a5ffc2455b71a8257f94de93f17f14e463fe844808d2ccc87248364a5691488a3304f1031326e62d9276e
+ checksum: f83ae83e38ae38f42c0b174833f58f820ed6eb063abfc5aa6725e8f9c1d626b54b1cb9d595cace525f8d59de89e186285f6bbcb460dc644ea9d8a7823cc54aca
languageName: node
linkType: hard
@@ -6011,23 +6011,23 @@ __metadata:
languageName: node
linkType: hard
-"typescript@npm:5.6.3":
- version: 5.6.3
- resolution: "typescript@npm:5.6.3"
+"typescript@npm:5.7.2":
+ version: 5.7.2
+ resolution: "typescript@npm:5.7.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
- checksum: ba302f8822777ebefb28b554105f3e074466b671e7444ec6b75dadc008a62f46f373d9e57ceced1c433756d06c8b7dc569a7eefdf3a9573122a49205ff99021a
+ checksum: b55300c4cefee8ee380d14fa9359ccb41ff8b54c719f6bc49b424899d662a5ce62ece390ce769568c7f4d14af844085255e63788740084444eb12ef423b13433
languageName: node
linkType: hard
-"typescript@patch:typescript@5.6.3#~builtin":
- version: 5.6.3
- resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin::version=5.6.3&hash=85af82"
+"typescript@patch:typescript@5.7.2#~builtin":
+ version: 5.7.2
+ resolution: "typescript@patch:typescript@npm%3A5.7.2#~builtin::version=5.7.2&hash=85af82"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
- checksum: ade87bce2363ee963eed0e4ca8a312ea02c81873ebd53609bc3f6dc0a57f6e61ad7e3fb8cbb7f7ab8b5081cbee801b023f7c4823ee70b1c447eae050e6c7622b
+ checksum: 803430c6da2ba73c25a21880d8d4f08a56d9d2444e6db2ea949ac4abceeece8e4a442b7b9b585db7d8a0b47ebda2060e45fe8ee8b8aca23e27ec1d4844987ee6
languageName: node
linkType: hard
@@ -6184,12 +6184,12 @@ __metadata:
languageName: node
linkType: hard
-"uuid@npm:11.0.2":
- version: 11.0.2
- resolution: "uuid@npm:11.0.2"
+"uuid@npm:11.0.3":
+ version: 11.0.3
+ resolution: "uuid@npm:11.0.3"
bin:
uuid: dist/esm/bin/uuid
- checksum: 9b322963db18623d22f46cf98f51b45830f956715577fb24d272ec29324fe919bedbedc6e29627aced490ac3f982ee53c80441651daf4a6ef74f2af58689f2e0
+ checksum: 646181c77e8b8df9bd07254faa703943e1c4d5ccde7d080312edf12f443f6c5750801fd9b27bf2e628594182165e6b1b880c0382538f7eca00b26622203741dc
languageName: node
linkType: hard
@@ -6277,7 +6277,7 @@ __metadata:
"@types/helmet": 4.0.0
"@types/moment": 2.13.0
"@types/uuid": 9.0.8
- "@wireapp/commons": 5.2.13
+ "@wireapp/commons": 5.4.0
cross-env: 7.0.3
dotenv: 16.4.5
dotenv-extended: 2.9.0
@@ -6296,11 +6296,11 @@ __metadata:
nocache: 4.0.0
nodemon: 3.1.7
opn: 6.0.0
- pm2: 5.4.2
- prettier: 3.3.3
+ pm2: 5.4.3
+ prettier: 3.4.1
rimraf: 6.0.1
- typescript: 5.6.3
- uuid: 11.0.2
+ typescript: 5.7.2
+ uuid: 11.0.3
webpack-dev-middleware: 7.4.2
webpack-hot-middleware: 2.26.1
languageName: unknown
diff --git a/src/i18n/en-US.json b/src/i18n/en-US.json
index 977219fbf2..2027f7c84f 100644
--- a/src/i18n/en-US.json
+++ b/src/i18n/en-US.json
@@ -112,7 +112,7 @@
"confirmPageHeader": "Join your team",
"confirmPageSubHeader": "To ensure a secure transfer and prevent unauthorized access, please enter the password of your personal account again.",
"termsPageHeader": "Join your team",
- "termsPageSubHeader": "You’re about to join the team.",
+ "termsPageSubHeader": "You’re about to join the team managed by {{email}}.",
"termsPageListHeader": "Things to know",
"termsPageListItem1": "Your personal account will be transferred to a team account.",
"termsPageListItem2": "This change is permanent and irrevocable.",
diff --git a/src/script/Environment.ts b/src/script/Environment.ts
index 4f77dc892d..a3d8cb476f 100644
--- a/src/script/Environment.ts
+++ b/src/script/Environment.ts
@@ -33,6 +33,8 @@ declare global {
NEW_PASSWORD_MINIMUM_LENGTH: number;
RAYGUN_API_KEY: string;
STRIPE_API_KEY: string;
+ COUNTLY_SERVER_URL: string;
+ COUNTLY_API_KEY: string;
URL: {
ACCOUNT_DELETE_SURVEY: string;
DOWNLOAD_ANDROID_BASE: string;
@@ -99,3 +101,5 @@ export const TEAMS_URL = window.wire.env.URL.TEAMS_BASE;
export const WEBSITE_URL = window.wire.env.URL.WEBSITE_BASE;
export const URL_SUPPORT_BACKUP_HISTORY = window.wire.env.URL.URL_SUPPORT_BACKUP_HISTORY;
export const URL_TERMS_OF_USE_TEAMS = window.wire.env.URL.URL_TERMS_OF_USE_TEAMS;
+export const COUNTLY_SERVER_URL = window.wire.env.COUNTLY_SERVER_URL;
+export const COUNTLY_API_KEY = window.wire.env.COUNTLY_API_KEY;
diff --git a/src/script/Root.tsx b/src/script/Root.tsx
index da97b81593..7c05e345ec 100644
--- a/src/script/Root.tsx
+++ b/src/script/Root.tsx
@@ -27,6 +27,7 @@ import {TermsAcknowledgement} from './page/migration/TermsAcknowledgement';
import {ConfirmInvitation} from './page/migration/ConfirmInvitation';
import {Welcome} from './page/migration/Welcome';
import {AcceptInvitation} from './page/migration/AcceptInvitation';
+import {initializeTelemetry} from './util/Tracking/Tracking';
const LazyIndex = lazy(() => import('./page/Index'));
const LazyDeleteAccount = lazy(() => import('./page/DeleteAccount'));
@@ -45,6 +46,8 @@ const Root = () => {
const hlParam = queryParams.get(QUERY_KEY.LANG);
const userLocale = navigator.languages?.length ? navigator.languages[0] : navigator.language;
+ initializeTelemetry();
+
if (!hlParam && !userLocale.includes('en')) {
queryParams.set(QUERY_KEY.LANG, userLocale);
window.history.pushState(null, '', `?${queryParams.toString()}`);
diff --git a/src/script/module/action/TeamAction.ts b/src/script/module/action/TeamAction.ts
index bd6fa65612..49ce3138a5 100644
--- a/src/script/module/action/TeamAction.ts
+++ b/src/script/module/action/TeamAction.ts
@@ -36,4 +36,8 @@ export class TeamAction {
acceptInvitation = async (payload: {code: string; password: string}) => {
return this.apiClient.api.teams.invitation.acceptInvitation(payload);
};
+
+ getInvitationInfo = async (code: string) => {
+ return this.apiClient.api.teams.invitation.getInvitationFromCode(code);
+ };
}
diff --git a/src/script/page/migration/AcceptInvitation.tsx b/src/script/page/migration/AcceptInvitation.tsx
index 8d596a7cd6..85ce2394e2 100644
--- a/src/script/page/migration/AcceptInvitation.tsx
+++ b/src/script/page/migration/AcceptInvitation.tsx
@@ -40,6 +40,8 @@ import {useTranslation} from 'react-i18next';
import {LoginData} from '@wireapp/api-client/lib/auth';
import {ClientType} from '@wireapp/api-client/lib/client';
import {useActionContext} from 'script/module/action';
+import {reportEvent} from 'script/util/Tracking/Tracking';
+import {EventName, SegmentationKey, SegmentationValue} from 'script/util/Tracking/types';
export const AcceptInvitation = () => {
const [searchParams] = useSearchParams();
@@ -54,7 +56,15 @@ export const AcceptInvitation = () => {
const code = searchParams.get(QUERY_KEY.TEAM_CODE);
const cachedCode = getTeamInvitationCode();
+ const trackEvent = (step: SegmentationValue) => {
+ reportEvent(EventName.USER_MIGRATION_LOGIN, {
+ [SegmentationKey.STEP]: step,
+ });
+ };
+
useEffect(() => {
+ trackEvent(SegmentationValue.OPENED);
+
if (!code && !cachedCode) {
navigate(ROUTE.HOME);
}
@@ -75,6 +85,7 @@ export const AcceptInvitation = () => {
const handleLogin = async (event: FormEvent) => {
event.preventDefault();
setError('');
+ trackEvent(SegmentationValue.CONTINUE_CLICKED);
const login: LoginData = {
clientType: ClientType.PERMANENT,
@@ -116,6 +127,7 @@ export const AcceptInvitation = () => {
title={t('invitationPagLoginLabel')}
value={email}
data-uie-name="enter-login-identifier"
+ onBlur={() => trackEvent(SegmentationValue.EMAIL_ENTERED)}
/>
{
type="password"
value={password}
data-uie-name="enter-login-password"
+ onBlur={() => trackEvent(SegmentationValue.PASSWORD_ENTERED)}
/>
-
+ trackEvent(SegmentationValue.PASSWORD_FORGOTTEN)}
+ data-uie-name="go-forgot-password"
+ >
{t('forgotPassword')}
diff --git a/src/script/page/migration/ConfirmInvitation.tsx b/src/script/page/migration/ConfirmInvitation.tsx
index 4b35187e84..e617668dad 100644
--- a/src/script/page/migration/ConfirmInvitation.tsx
+++ b/src/script/page/migration/ConfirmInvitation.tsx
@@ -30,12 +30,14 @@ import {
useMatchMedia,
} from '@wireapp/react-ui-kit';
import {loginContainerCss, loginSubHeaderCss, headerCss, forgotPasswordCss, buttonCss} from './styles';
-import React, {useState} from 'react';
+import React, {useEffect, useState} from 'react';
import {ROUTE} from 'script/route';
import {useNavigate} from 'react-router-dom';
import {getTeamInvitationCode, removeTeamInvitationCode} from './utils';
import {useTranslation} from 'react-i18next';
import {useActionContext} from 'script/module/action';
+import {reportEvent} from 'script/util/Tracking/Tracking';
+import {EventName, SegmentationKey, SegmentationValue} from 'script/util/Tracking/types';
export const ConfirmInvitation = () => {
const isTablet = useMatchMedia(QUERY[QueryKeys.TABLET_DOWN]);
@@ -48,8 +50,14 @@ export const ConfirmInvitation = () => {
const [loading, setLoading] = useState(false);
const code = getTeamInvitationCode();
+ const trackEvent = (step: SegmentationValue) => {
+ reportEvent(EventName.USER_MIGRATION_CONFIRMATION, {
+ [SegmentationKey.STEP]: step,
+ });
+ };
const handleSubmit = (event: any) => {
event.preventDefault();
+ trackEvent(SegmentationValue.CONTINUE_CLICKED);
setLoading(true);
teamAction
.acceptInvitation({
@@ -68,6 +76,10 @@ export const ConfirmInvitation = () => {
});
};
+ useEffect(() => {
+ trackEvent(SegmentationValue.OPENED);
+ }, []);
+
return (
{isTablet &&
}
@@ -86,6 +98,7 @@ export const ConfirmInvitation = () => {
type="password"
value={password}
data-uie-name="enter-login-password"
+ onBlur={() => trackEvent(SegmentationValue.PASSWORD_ENTERED)}
/>
diff --git a/src/script/page/migration/TermsAcknowledgement.tsx b/src/script/page/migration/TermsAcknowledgement.tsx
index 814c3faca3..836ebcdea1 100644
--- a/src/script/page/migration/TermsAcknowledgement.tsx
+++ b/src/script/page/migration/TermsAcknowledgement.tsx
@@ -23,6 +23,7 @@ import {
Checkbox,
COLOR_V2,
Link,
+ Loading,
Logo,
QUERY,
QueryKeys,
@@ -36,27 +37,65 @@ import {
termsContentHeaderCss,
termsListCss,
termsListItemCss,
- termsContentGrayBox,
- termsContentGrayBoxContent,
+ termsContentWarningBox,
+ termsContentWarningBoxContent,
termsContentBlueBox,
termsContentBlueBoxContent,
buttonCss,
termsCheckboxLabelCss,
+ loginContainerCss,
} from './styles';
import {ShieldIcon} from './ShieldIcon';
import {OutlinedCheckIcon} from './OutlinedCheckIcon';
-import React, {useState} from 'react';
+import React, {useEffect, useState} from 'react';
import {useNavigate} from 'react-router-dom';
import {EXTERNAL_ROUTE, ROUTE} from 'script/route';
import {useTranslation} from 'react-i18next';
import MarkupTranslation from 'script/component/MarkupTranslation';
+import {useActionContext} from 'script/module/action';
+import {getTeamInvitationCode} from './utils';
+import {reportEvent} from 'script/util/Tracking/Tracking';
+import {EventName, SegmentationKey, SegmentationValue} from 'script/util/Tracking/types';
export const TermsAcknowledgement = () => {
const navigate = useNavigate();
+ const {teamAction} = useActionContext();
const {t} = useTranslation('migration');
const isTablet = useMatchMedia(QUERY[QueryKeys.TABLET_DOWN]);
+ const code = getTeamInvitationCode();
+ const [loading, setLoading] = useState(true);
const [isMigrationAccepted, setIsMigrationAccepted] = useState(false);
const [isTermOfUseAccepted, setIsTermOfUseAccepted] = useState(false);
+ const [inviterEmail, setInviterEmail] = useState('');
+
+ const trackEvent = (step: SegmentationValue) => {
+ reportEvent(EventName.USER_MIGRATION_TERMS_ACKNOWLEDGEMENT, {
+ [SegmentationKey.STEP]: step,
+ });
+ };
+
+ useEffect(() => {
+ trackEvent(SegmentationValue.OPENED);
+ teamAction
+ .getInvitationInfo(code)
+ .then(res => {
+ setInviterEmail(res.created_by_email);
+ })
+ .finally(() => setLoading(false));
+ }, []);
+
+ if (loading) {
+ return (
+
+
+
+ );
+ }
+
+ const handleSubmit = () => {
+ navigate(ROUTE.CONFIRM_INVITATION);
+ trackEvent(SegmentationValue.CONTINUE_CLICKED);
+ };
return (
@@ -66,7 +105,7 @@ export const TermsAcknowledgement = () => {
)}
{t('termsPageHeader')}
-
{t('termsPageHeader')}
+
{t('termsPageSubHeader', {email: inviterEmail})}
{t('termsPageListHeader')}
@@ -87,8 +126,8 @@ export const TermsAcknowledgement = () => {
-
-
+
+
{t('termsPageAccountManagerHeader')}
{t('termsPageAccountManagerText')}
@@ -116,6 +155,7 @@ export const TermsAcknowledgement = () => {
checked={isMigrationAccepted}
onChange={(event: React.ChangeEvent
) => {
setIsMigrationAccepted(event.target.checked);
+ trackEvent(SegmentationValue.AGREE_MIGRATION_TERMS_CHECK);
}}
id="do-accept-migration"
data-uie-name="do-accept-migration"
@@ -127,6 +167,7 @@ export const TermsAcknowledgement = () => {
checked={isTermOfUseAccepted}
onChange={(event: React.ChangeEvent) => {
setIsTermOfUseAccepted(event.target.checked);
+ trackEvent(SegmentationValue.AGREE_TOC_CHECK);
}}
id="do-accept-terms"
data-uie-name="do-accept-terms"
@@ -141,7 +182,7 @@ export const TermsAcknowledgement = () => {