Przeglądaj źródła

chore(breakout-rooms) Added analytics (#10421)

master
Robert Pintilii 3 lat temu
rodzic
commit
0106e68728
No account linked to committer's email address

+ 15
- 0
react/features/analytics/AnalyticsEvents.js Wyświetl plik

884
         action: 'screen.sharing.capture.taken'
884
         action: 'screen.sharing.capture.taken'
885
     };
885
     };
886
 }
886
 }
887
+
888
+/**
889
+ * Creates an event for an action on breakout rooms.
890
+ *
891
+ * @param {string} actionSubject - The subject that was acted upon.
892
+ * @returns {Object} The event in a format suitable for sending via
893
+ * sendAnalytics.
894
+ */
895
+export function createBreakoutRoomsEvent(actionSubject) {
896
+    return {
897
+        action: 'clicked',
898
+        actionSubject: `${actionSubject}.button`,
899
+        source: 'breakout.rooms'
900
+    };
901
+}

+ 8
- 0
react/features/breakout-rooms/actions.js Wyświetl plik

4
 import _ from 'lodash';
4
 import _ from 'lodash';
5
 import type { Dispatch } from 'redux';
5
 import type { Dispatch } from 'redux';
6
 
6
 
7
+import { createBreakoutRoomsEvent, sendAnalytics } from '../analytics';
7
 import {
8
 import {
8
     conferenceLeft,
9
     conferenceLeft,
9
     conferenceWillLeave,
10
     conferenceWillLeave,
36
         const index = Object.keys(rooms).length;
37
         const index = Object.keys(rooms).length;
37
         const subject = name || i18next.t('breakoutRooms.defaultName', { index });
38
         const subject = name || i18next.t('breakoutRooms.defaultName', { index });
38
 
39
 
40
+        sendAnalytics(createBreakoutRoomsEvent('create'));
41
+
39
         // $FlowExpectedError
42
         // $FlowExpectedError
40
         getCurrentConference(getState)?.getBreakoutRooms()
43
         getCurrentConference(getState)?.getBreakoutRooms()
41
             ?.createBreakoutRoom(subject);
44
             ?.createBreakoutRoom(subject);
54
         const room = rooms[roomId];
57
         const room = rooms[roomId];
55
         const mainRoom = getMainRoom(getState);
58
         const mainRoom = getMainRoom(getState);
56
 
59
 
60
+        sendAnalytics(createBreakoutRoomsEvent('close'));
61
+
57
         if (room && mainRoom) {
62
         if (room && mainRoom) {
58
             Object.values(room.participants).forEach(p => {
63
             Object.values(room.participants).forEach(p => {
59
 
64
 
72
  */
77
  */
73
 export function removeBreakoutRoom(breakoutRoomJid: string) {
78
 export function removeBreakoutRoom(breakoutRoomJid: string) {
74
     return (dispatch: Dispatch<any>, getState: Function) => {
79
     return (dispatch: Dispatch<any>, getState: Function) => {
80
+        sendAnalytics(createBreakoutRoomsEvent('remove'));
81
+
75
         // $FlowExpectedError
82
         // $FlowExpectedError
76
         getCurrentConference(getState)?.getBreakoutRooms()
83
         getCurrentConference(getState)?.getBreakoutRooms()
77
             ?.removeBreakoutRoom(breakoutRoomJid);
84
             ?.removeBreakoutRoom(breakoutRoomJid);
89
         const breakoutRooms = _.filter(rooms, (room: Object) => !room.isMainRoom);
96
         const breakoutRooms = _.filter(rooms, (room: Object) => !room.isMainRoom);
90
 
97
 
91
         if (breakoutRooms) {
98
         if (breakoutRooms) {
99
+            sendAnalytics(createBreakoutRoomsEvent('auto.assign'));
92
             const participantIds = Array.from(getRemoteParticipants(getState).keys());
100
             const participantIds = Array.from(getRemoteParticipants(getState).keys());
93
             const length = Math.ceil(participantIds.length / breakoutRooms.length);
101
             const length = Math.ceil(participantIds.length / breakoutRooms.length);
94
 
102
 

+ 2
- 0
react/features/breakout-rooms/components/native/BreakoutRoomContextMenu.js Wyświetl plik

6
 import { Text } from 'react-native-paper';
6
 import { Text } from 'react-native-paper';
7
 import { useDispatch, useSelector } from 'react-redux';
7
 import { useDispatch, useSelector } from 'react-redux';
8
 
8
 
9
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
9
 import { hideDialog } from '../../../base/dialog/actions';
10
 import { hideDialog } from '../../../base/dialog/actions';
10
 import BottomSheet from '../../../base/dialog/components/native/BottomSheet';
11
 import BottomSheet from '../../../base/dialog/components/native/BottomSheet';
11
 import {
12
 import {
32
     const { t } = useTranslation();
33
     const { t } = useTranslation();
33
 
34
 
34
     const onJoinRoom = useCallback(() => {
35
     const onJoinRoom = useCallback(() => {
36
+        sendAnalytics(createBreakoutRoomsEvent('join'));
35
         dispatch(moveToRoom(room.jid));
37
         dispatch(moveToRoom(room.jid));
36
         closeDialog();
38
         closeDialog();
37
     }, [ dispatch, room ]);
39
     }, [ dispatch, room ]);

+ 5
- 2
react/features/breakout-rooms/components/native/LeaveBreakoutRoomButton.js Wyświetl plik

5
 import { Button } from 'react-native-paper';
5
 import { Button } from 'react-native-paper';
6
 import { useDispatch } from 'react-redux';
6
 import { useDispatch } from 'react-redux';
7
 
7
 
8
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
8
 import { moveToRoom } from '../../actions';
9
 import { moveToRoom } from '../../actions';
9
 
10
 
10
 import styles from './styles';
11
 import styles from './styles';
13
     const { t } = useTranslation();
14
     const { t } = useTranslation();
14
     const dispatch = useDispatch();
15
     const dispatch = useDispatch();
15
 
16
 
16
-    const onLeave = useCallback(() =>
17
-        dispatch(moveToRoom())
17
+    const onLeave = useCallback(() => {
18
+        sendAnalytics(createBreakoutRoomsEvent('leave'));
19
+        dispatch(moveToRoom());
20
+    }
18
     , [ dispatch ]);
21
     , [ dispatch ]);
19
 
22
 
20
     return (
23
     return (

+ 2
- 0
react/features/breakout-rooms/components/web/JoinQuickActionButton.js Wyświetl plik

5
 import { useTranslation } from 'react-i18next';
5
 import { useTranslation } from 'react-i18next';
6
 import { useDispatch } from 'react-redux';
6
 import { useDispatch } from 'react-redux';
7
 
7
 
8
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
8
 import { QuickActionButton } from '../../../base/components';
9
 import { QuickActionButton } from '../../../base/components';
9
 import { moveToRoom } from '../../actions';
10
 import { moveToRoom } from '../../actions';
10
 
11
 
31
 
32
 
32
     const onJoinRoom = useCallback(e => {
33
     const onJoinRoom = useCallback(e => {
33
         e.stopPropagation();
34
         e.stopPropagation();
35
+        sendAnalytics(createBreakoutRoomsEvent('join'));
34
         dispatch(moveToRoom(room.jid));
36
         dispatch(moveToRoom(room.jid));
35
     }, [ dispatch, room ]);
37
     }, [ dispatch, room ]);
36
 
38
 

+ 2
- 0
react/features/breakout-rooms/components/web/LeaveButton.js Wyświetl plik

5
 import { useTranslation } from 'react-i18next';
5
 import { useTranslation } from 'react-i18next';
6
 import { useDispatch } from 'react-redux';
6
 import { useDispatch } from 'react-redux';
7
 
7
 
8
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
8
 import ParticipantPaneBaseButton from '../../../participants-pane/components/web/ParticipantPaneBaseButton';
9
 import ParticipantPaneBaseButton from '../../../participants-pane/components/web/ParticipantPaneBaseButton';
9
 import { moveToRoom } from '../../actions';
10
 import { moveToRoom } from '../../actions';
10
 
11
 
28
     const styles = useStyles();
29
     const styles = useStyles();
29
 
30
 
30
     const onLeave = useCallback(() => {
31
     const onLeave = useCallback(() => {
32
+        sendAnalytics(createBreakoutRoomsEvent('leave'));
31
         dispatch(moveToRoom());
33
         dispatch(moveToRoom());
32
     }, [ dispatch ]);
34
     }, [ dispatch ]);
33
 
35
 

+ 2
- 0
react/features/breakout-rooms/components/web/RoomContextMenu.js Wyświetl plik

4
 import { useTranslation } from 'react-i18next';
4
 import { useTranslation } from 'react-i18next';
5
 import { useDispatch, useSelector } from 'react-redux';
5
 import { useDispatch, useSelector } from 'react-redux';
6
 
6
 
7
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
7
 import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
8
 import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
8
 import {
9
 import {
9
     IconClose,
10
     IconClose,
54
     const _overflowDrawer = useSelector(showOverflowDrawer);
55
     const _overflowDrawer = useSelector(showOverflowDrawer);
55
 
56
 
56
     const onJoinRoom = useCallback(() => {
57
     const onJoinRoom = useCallback(() => {
58
+        sendAnalytics(createBreakoutRoomsEvent('join'));
57
         dispatch(moveToRoom(room.id));
59
         dispatch(moveToRoom(room.id));
58
     }, [ dispatch, room ]);
60
     }, [ dispatch, room ]);
59
 
61
 

+ 2
- 0
react/features/participants-pane/components/web/MeetingParticipantContextMenu.js Wyświetl plik

2
 import { withStyles } from '@material-ui/styles';
2
 import { withStyles } from '@material-ui/styles';
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 
4
 
5
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
5
 import { approveParticipant } from '../../../av-moderation/actions';
6
 import { approveParticipant } from '../../../av-moderation/actions';
6
 import { Avatar } from '../../../base/avatar';
7
 import { Avatar } from '../../../base/avatar';
7
 import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
8
 import { ContextMenu, ContextMenuItemGroup } from '../../../base/components';
305
         return () => {
306
         return () => {
306
             const { _participant, dispatch } = this.props;
307
             const { _participant, dispatch } = this.props;
307
 
308
 
309
+            sendAnalytics(createBreakoutRoomsEvent('send.participant.to.room'));
308
             dispatch(sendParticipantToRoom(_participant.id, room.id));
310
             dispatch(sendParticipantToRoom(_participant.id, room.id));
309
         };
311
         };
310
     }
312
     }

+ 2
- 0
react/features/video-menu/components/native/SendToBreakoutRoom.js Wyświetl plik

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { createBreakoutRoomsEvent, sendAnalytics } from '../../../analytics';
3
 import { translate } from '../../../base/i18n';
4
 import { translate } from '../../../base/i18n';
4
 import { IconRingGroup } from '../../../base/icons';
5
 import { IconRingGroup } from '../../../base/icons';
5
 import { isLocalParticipantModerator } from '../../../base/participants';
6
 import { isLocalParticipantModerator } from '../../../base/participants';
57
     _handleClick() {
58
     _handleClick() {
58
         const { dispatch, participantID, room } = this.props;
59
         const { dispatch, participantID, room } = this.props;
59
 
60
 
61
+        sendAnalytics(createBreakoutRoomsEvent('send.participant.to.room'));
60
         dispatch(sendParticipantToRoom(participantID, room.id));
62
         dispatch(sendParticipantToRoom(participantID, room.id));
61
     }
63
     }
62
 }
64
 }

Ładowanie…
Anuluj
Zapisz