diff --git a/front/src/Administration/AnalyticsClient.ts b/front/src/Administration/AnalyticsClient.ts index 8c14eaed..3c6bcb44 100644 --- a/front/src/Administration/AnalyticsClient.ts +++ b/front/src/Administration/AnalyticsClient.ts @@ -17,7 +17,7 @@ class AnalyticsClient { } } - identifyUser(uuid: string, email: string | null) { + identifyUser(uuid: string, email: string | null): void { this.posthogPromise ?.then((posthog) => { posthog.identify(uuid, { uuid, email, wa: true }); @@ -25,7 +25,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - loggedWithSso() { + loggedWithSso(): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-logged-sso"); @@ -33,7 +33,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - loggedWithToken() { + loggedWithToken(): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-logged-token"); @@ -41,7 +41,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - enteredRoom(roomId: string, roomGroup: string | null) { + enteredRoom(roomId: string, roomGroup: string | null): void { this.posthogPromise ?.then((posthog) => { posthog.capture("$pageView", { roomId, roomGroup }); @@ -50,7 +50,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - openedMenu() { + openedMenu(): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-opened-menu"); @@ -58,7 +58,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - launchEmote(emote: string) { + launchEmote(emote: string): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-emote-launch", { emote }); @@ -66,7 +66,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - enteredJitsi(roomName: string, roomId: string) { + enteredJitsi(roomName: string, roomId: string): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-entered-jitsi", { roomName, roomId }); @@ -74,7 +74,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - validationName() { + validationName(): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-name-validation"); @@ -82,7 +82,7 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - validationWoka(scene: string) { + validationWoka(scene: string): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-woka-validation", { scene }); @@ -90,12 +90,309 @@ class AnalyticsClient { .catch((e) => console.error(e)); } - validationVideo() { + validationVideo(): void { this.posthogPromise ?.then((posthog) => { posthog.capture("wa-video-validation"); }) .catch((e) => console.error(e)); } + + /** New feature analytics **/ + openedChat(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa-opened-chat"); + }) + .catch((e) => console.error(e)); + } + + openRegister(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa-opened-register"); + }) + .catch((e) => console.error(e)); + } + + openInvite(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa-opened-invite"); + }) + .catch((e) => console.error(e)); + } + + lockDiscussion(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_lockroom"); + }) + .catch((e) => console.error(e)); + } + + screenSharing(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa-screensharing"); + }) + .catch((e) => console.error(e)); + } + + follow(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_follow"); + }) + .catch((e) => console.error(e)); + } + + camera(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_camera"); + }) + .catch((e) => console.error(e)); + } + + microphone(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_microphone"); + }) + .catch((e) => console.error(e)); + } + + settingMicrophone(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_microphone", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingCamera(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_camera", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingNotification(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_notification", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingFullscreen(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_fullscreen", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingAskWebsite(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_ask_website", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingRequestFollow(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_request_follow", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + settingDecreaseAudioVolume(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_setting_decrease_audio_volume", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + login(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_login"); + }) + .catch((e) => console.error(e)); + } + + logout(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_logout"); + }) + .catch((e) => console.error(e)); + } + + switchMultiIframe(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_multiiframe_switch"); + }) + .catch((e) => console.error(e)); + } + + closeMultiIframe(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_multiiframe_close"); + }) + .catch((e) => console.error(e)); + } + + fullScreenMultiIframe(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_multiiframe_fullscreen"); + }) + .catch((e) => console.error(e)); + } + + stackOpenCloseMultiIframe(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_multiiframe_stack_open_close"); + }) + .catch((e) => console.error(e)); + } + + menuCredit(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_credit"); + }) + .catch((e) => console.error(e)); + } + + menuProfile(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_profile"); + }) + .catch((e) => console.error(e)); + } + + menuSetting() { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_setting"); + }) + .catch((e) => console.error(e)); + } + + menuInvite(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_invite"); + }) + .catch((e) => console.error(e)); + } + + globalMessage(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_globalmessage"); + }) + .catch((e) => console.error(e)); + } + + menuContact(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_contact"); + }) + .catch((e) => console.error(e)); + } + + inviteCopyLink(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_invite_copylink"); + }) + .catch((e) => console.error(e)); + } + + inviteCopyLinkWalk(value: string): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_menu_invite_copylink_walk", { + checkbox: value, + }); + }) + .catch((e) => console.error(e)); + } + + editCompanion(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_edit_companion"); + }) + .catch((e) => console.error(e)); + } + + editCamera(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_edit_camera"); + }) + .catch((e) => console.error(e)); + } + + editName(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_edit_name"); + }) + .catch((e) => console.error(e)); + } + + editWoka(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_edit_woka"); + }) + .catch((e) => console.error(e)); + } + + selectWoka(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_wokascene_select"); + }) + .catch((e) => console.error(e)); + } + + selectCustomWoka(): void { + this.posthogPromise + ?.then((posthog) => { + posthog.capture("wa_wokascene_custom"); + }) + .catch((e) => console.error(e)); + } } export const analyticsClient = new AnalyticsClient(); diff --git a/front/src/Components/CameraControls.svelte b/front/src/Components/CameraControls.svelte index fad3c3c1..6e7098ed 100644 --- a/front/src/Components/CameraControls.svelte +++ b/front/src/Components/CameraControls.svelte @@ -17,6 +17,7 @@ import { followRoleStore, followStateStore, followUsersStore } from "../Stores/FollowStore"; import { gameManager } from "../Phaser/Game/GameManager"; import { currentPlayerGroupLockStateStore } from "../Stores/CurrentPlayerGroupStore"; + import { analyticsClient } from "../Administration/AnalyticsClient"; const gameScene = gameManager.getCurrentGameScene(); @@ -89,6 +90,7 @@ class="btn-follow" class:hide={($peerStore.size === 0 && $followStateStore === "off") || $silentStore} class:disabled={$followStateStore !== "off"} + on:click={() => analyticsClient.follow()} on:click={followClick} > @@ -98,6 +100,7 @@ class="btn-lock" class:hide={$peerStore.size === 0 || $silentStore} class:disabled={$currentPlayerGroupLockStateStore} + on:click={() => analyticsClient.lockDiscussion()} on:click={lockClick} > @@ -105,6 +108,7 @@
analyticsClient.screenSharing()} on:click={screenSharingClick} class:hide={!$screenSharingAvailableStore || $silentStore} class:enabled={$requestedScreenSharingState} @@ -116,7 +120,12 @@ {/if}
-
+
analyticsClient.camera()} + on:click={cameraClick} + class:disabled={!$requestedCameraState || $silentStore} + > {#if $requestedCameraState && !$silentStore} Turn on webcam {:else} @@ -124,7 +133,12 @@ {/if}
-
+
analyticsClient.microphone()} + on:click={microphoneClick} + class:disabled={!$requestedMicrophoneState || $silentStore} + > {#if $requestedMicrophoneState && !$silentStore} Turn on microphone {:else} diff --git a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte index fb133b78..b4c5bf88 100644 --- a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte +++ b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte @@ -10,6 +10,7 @@ import { coWebsiteManager } from "../../WebRtc/CoWebsiteManager"; import uploadFile from "../images/jitsi.png"; + import { analyticsClient } from "../../Administration/AnalyticsClient"; export let index: number; export let coWebsite: CoWebsite; @@ -89,6 +90,7 @@ class:ready={$state === "ready"} class:displayed={isMain || isHighlight} class:vertical + on:click={() => analyticsClient.stackOpenCloseMultiIframe()} on:click={onClick} > - + {:else}

{$LL.menu.invite.description()}

- +
{/if} -

Select an entry point

+

{$LL.menu.invite.selectEntryPoint()}

+ analyticsClient.settingCamera(event.currentTarget.value)} + bind:checked={valueCameraPrivacySettings} + /> {$LL.menu.settings.privacySettings.cameraToggle()}
@@ -211,6 +222,7 @@ type="checkbox" class="nes-checkbox is-dark" bind:checked={fullscreen} + on:change={(event) => analyticsClient.settingFullscreen(event.currentTarget.value)} on:change={changeFullscreen} /> {$LL.menu.settings.fullscreen()} @@ -220,6 +232,7 @@ type="checkbox" class="nes-checkbox is-dark" bind:checked={notification} + on:change={(event) => analyticsClient.settingNotification(event.currentTarget.value)} on:change={changeNotification} /> {$LL.menu.settings.notifications()} @@ -229,6 +242,7 @@ type="checkbox" class="nes-checkbox is-dark" bind:checked={forceCowebsiteTrigger} + on:change={(event) => analyticsClient.settingAskWebsite(event.currentTarget.value)} on:change={changeForceCowebsiteTrigger} /> {$LL.menu.settings.cowebsiteTrigger()} @@ -238,6 +252,7 @@ type="checkbox" class="nes-checkbox is-dark" bind:checked={ignoreFollowRequests} + on:change={(event) => analyticsClient.settingRequestFollow(event.currentTarget.value)} on:change={changeIgnoreFollowRequests} /> {$LL.menu.settings.ignoreFollowRequest()} @@ -246,6 +261,7 @@ type="checkbox" class="nes-checkbox is-dark" bind:checked={decreaseAudioPlayerVolumeWhileTalking} + on:change={(event) => analyticsClient.settingDecreaseAudioVolume(event.currentTarget.value)} on:change={changeDecreaseAudioPlayerVolumeWhileTalking} /> {$LL.audio.manager.reduce()} diff --git a/front/src/Components/selectCharacter/SelectCharacterScene.svelte b/front/src/Components/selectCharacter/SelectCharacterScene.svelte index ecf00828..d929d993 100644 --- a/front/src/Components/selectCharacter/SelectCharacterScene.svelte +++ b/front/src/Components/selectCharacter/SelectCharacterScene.svelte @@ -3,6 +3,7 @@ import { SelectCharacterScene, SelectCharacterSceneName } from "../../Phaser/Login/SelectCharacterScene"; import LL from "../../i18n/i18n-svelte"; import { customizeAvailableStore, selectedCollection } from "../../Stores/SelectCharacterSceneStore"; + import { analyticsClient } from "../../Administration/AnalyticsClient"; export let game: Game; @@ -40,13 +41,15 @@ analyticsClient.selectWoka()} + on:click={cameraScene}>{$LL.woka.selectWoka.continue()} {#if $customizeAvailableStore} analyticsClient.selectCustomWoka()} + on:click={customizeScene}>{$LL.woka.selectWoka.customize()} {/if} diff --git a/front/src/Stores/MenuStore.ts b/front/src/Stores/MenuStore.ts index 381ca59e..dc93e0dd 100644 --- a/front/src/Stores/MenuStore.ts +++ b/front/src/Stores/MenuStore.ts @@ -2,7 +2,6 @@ import { get, writable } from "svelte/store"; import Timeout = NodeJS.Timeout; import { userIsAdminStore } from "./GameStore"; import { CONTACT_URL, IDENTITY_URL, PROFILE_URL } from "../Enum/EnvironmentVariable"; -import { analyticsClient } from "../Administration/AnalyticsClient"; import type { Translation } from "../i18n/i18n-types"; import axios from "axios"; import { localUserStore } from "../Connexion/LocalUserStore"; @@ -14,7 +13,6 @@ export const userIsConnected = writable(false); export const profileAvailable = writable(true); menuVisiblilityStore.subscribe((value) => { - if (value) analyticsClient.openedMenu(); if (userIsConnected && value && IDENTITY_URL != null) { axios.get(getMeUrl()).catch((err) => { console.error("menuVisiblilityStore => err => ", err); diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index 7bc53c23..b378b218 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -8,6 +8,7 @@ import { isMediaBreakpointDown } from "../Utils/BreakpointsUtils"; import { LayoutMode } from "./LayoutManager"; import type { CoWebsite } from "./CoWebsite/CoWesbite"; import type CancelablePromise from "cancelable-promise"; +import { analyticsClient } from "../Administration/AnalyticsClient"; export enum iframeStates { closed = 1, @@ -126,6 +127,7 @@ class CoWebsiteManager { const buttonCloseCoWebsite = HtmlUtils.getElementByIdOrFail(cowebsiteCloseButtonId); buttonCloseCoWebsite.addEventListener("click", () => { + analyticsClient.closeMultiIframe(); const coWebsite = this.getMainCoWebsite(); if (!coWebsite) { @@ -143,6 +145,7 @@ class CoWebsiteManager { const buttonFullScreenFrame = HtmlUtils.getElementByIdOrFail(cowebsiteFullScreenButtonId); buttonFullScreenFrame.addEventListener("click", () => { + analyticsClient.fullScreenMultiIframe(); buttonFullScreenFrame.blur(); this.fullscreen(); }); @@ -159,6 +162,7 @@ class CoWebsiteManager { }); buttonSwipe.addEventListener("click", () => { + analyticsClient.switchMultiIframe(); const mainCoWebsite = this.getMainCoWebsite(); const highlightedEmbed = get(highlightedEmbedScreen); if (highlightedEmbed?.type === "cowebsite") { diff --git a/front/src/i18n/de-DE/menu.ts b/front/src/i18n/de-DE/menu.ts index c41dee34..58d5f118 100644 --- a/front/src/i18n/de-DE/menu.ts +++ b/front/src/i18n/de-DE/menu.ts @@ -77,7 +77,8 @@ const menu: NonNullable = { description: "Link zu diesem Raum teilen!", copy: "Kopieren", share: "Teilen", - walk_automatically_to_position: "Automatisch zu meiner Position gehen", + walkAutomaticallyToPosition: "Automatisch zu meiner Position gehen", + selectEntryPoint: "Select an entry point", }, globalMessage: { text: "Text", diff --git a/front/src/i18n/en-US/menu.ts b/front/src/i18n/en-US/menu.ts index f3968b9b..5ba366da 100644 --- a/front/src/i18n/en-US/menu.ts +++ b/front/src/i18n/en-US/menu.ts @@ -77,7 +77,8 @@ const menu: BaseTranslation = { description: "Share the link of the room!", copy: "Copy", share: "Share", - walk_automatically_to_position: "Walk automatically to my position", + walkAutomaticallyToPosition: "Walk automatically to my position", + selectEntryPoint: "Select an entry point", }, globalMessage: { text: "Text", diff --git a/front/src/i18n/fr-FR/menu.ts b/front/src/i18n/fr-FR/menu.ts index 3c915f6f..6eae52d2 100644 --- a/front/src/i18n/fr-FR/menu.ts +++ b/front/src/i18n/fr-FR/menu.ts @@ -77,7 +77,8 @@ const menu: NonNullable = { description: "Partager le lien de la salle!", copy: "Copier", share: "Partager", - walk_automatically_to_position: "Marcher automatiquement jusqu'à ma position", + walkAutomaticallyToPosition: "Marcher automatiquement jusqu'à ma position", + selectEntryPoint: "Selectionner la zone de départ", }, globalMessage: { text: "Texte", diff --git a/front/src/i18n/zh-CN/menu.ts b/front/src/i18n/zh-CN/menu.ts index be1d63d5..5bd0ddd9 100644 --- a/front/src/i18n/zh-CN/menu.ts +++ b/front/src/i18n/zh-CN/menu.ts @@ -77,7 +77,8 @@ const menu: NonNullable = { description: "分享该房间的链接!", copy: "复制", share: "分享", - walk_automatically_to_position: "自动走到我的位置", + walkAutomaticallyToPosition: "自动走到我的位置", + selectEntryPoint: "Select an entry point", }, globalMessage: { text: "文本", diff --git a/pusher/src/Controller/SwaggerController.ts b/pusher/src/Controller/SwaggerController.ts index f840551b..e1e50ef3 100644 --- a/pusher/src/Controller/SwaggerController.ts +++ b/pusher/src/Controller/SwaggerController.ts @@ -2,7 +2,6 @@ import { BaseHttpController } from "./BaseHttpController"; import * as fs from "fs"; import { ADMIN_URL } from "../Enum/EnvironmentVariable"; import SwaggerGenerator from "../Services/SwaggerGenerator"; -import swaggerJsdoc from "swagger-jsdoc"; export class SwaggerController extends BaseHttpController { routes() {