From 7461ae576c753ad6b324b35125d3d05ecbcb4a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 5 Sep 2024 11:25:58 +0200 Subject: [PATCH] feat(client) drop ability to specify an avatar URL The backend generated JWT can include one if desired. --- .../common/app-state/setup/action-types.js | 2 -- .../src/common/app-state/setup/actions.js | 13 ------- .../src/common/app-state/setup/reducer.js | 8 ----- .../src/common/app-state/setup/selectors.js | 11 ------ .../src/common/app-state/setup/setup.test.js | 7 ---- spot-client/src/common/i18n/en.json | 1 - .../src/common/utils/store-persistence.js | 2 -- .../meeting-frame/AbstractMeetingFrame.js | 1 - .../JitsiMeetingFrame/JitsiMeetingFrame.js | 1 - .../spot-tv/ui/components/setup/profile.js | 36 ++----------------- spot-client/src/spot-tv/ui/views/meeting.js | 5 --- 11 files changed, 2 insertions(+), 85 deletions(-) diff --git a/spot-client/src/common/app-state/setup/action-types.js b/spot-client/src/common/app-state/setup/action-types.js index aac781332..4c94ade09 100644 --- a/spot-client/src/common/app-state/setup/action-types.js +++ b/spot-client/src/common/app-state/setup/action-types.js @@ -1,7 +1,5 @@ export const SETUP_COMPLETED = 'SETUP_COMPLETED'; -export const SET_AVATAR_URL = 'SET_AVATAR_URL'; - export const SET_CUSTOMER_ID = 'SET_CUSTOMER_ID'; export const SET_DISPLAY_NAME = 'SET_DISPLAY_NAME'; diff --git a/spot-client/src/common/app-state/setup/actions.js b/spot-client/src/common/app-state/setup/actions.js index 718a12741..65454b074 100644 --- a/spot-client/src/common/app-state/setup/actions.js +++ b/spot-client/src/common/app-state/setup/actions.js @@ -1,6 +1,5 @@ import { SETUP_COMPLETED, - SET_AVATAR_URL, SET_CUSTOMER_ID, SET_DISPLAY_NAME, SET_IS_PERMANENT_REMOTE_PAIRED, @@ -12,18 +11,6 @@ import { SET_TENANT } from './action-types'; -/** - * Updates the preferred avatar URL to use for Spot-TV while in a meeting. - * - * @param {string} avatarUrl - The URL to an image. - * @returns {Object} - */ -export function setAvatarUrl(avatarUrl) { - return { - type: SET_AVATAR_URL, - avatarUrl - }; -} /** * Sets the customer ID assigned to the room's owner. diff --git a/spot-client/src/common/app-state/setup/reducer.js b/spot-client/src/common/app-state/setup/reducer.js index 025b0a137..f01c64e36 100644 --- a/spot-client/src/common/app-state/setup/reducer.js +++ b/spot-client/src/common/app-state/setup/reducer.js @@ -1,6 +1,5 @@ import { SETUP_COMPLETED, - SET_AVATAR_URL, SET_DISPLAY_NAME, SET_IS_PERMANENT_REMOTE_PAIRED, SET_IS_SPOT, @@ -11,7 +10,6 @@ import { } from './action-types'; const DEFAULT_STATE = { - avatarUrl: '', completed: false, displayName: undefined, isPermanentRemotePaired: false, @@ -39,12 +37,6 @@ const setup = (state = DEFAULT_STATE, action) => { completed: true }; - case SET_AVATAR_URL: - return { - ...state, - avatarUrl: action.avatarUrl - }; - case SET_DISPLAY_NAME: return { ...state, diff --git a/spot-client/src/common/app-state/setup/selectors.js b/spot-client/src/common/app-state/setup/selectors.js index 3e5c6300e..360f7c9ec 100644 --- a/spot-client/src/common/app-state/setup/selectors.js +++ b/spot-client/src/common/app-state/setup/selectors.js @@ -1,14 +1,3 @@ -/** - * A selector which returns the configured url to use for the Spot-TV avatar - * which should be displayed in meetings. - * - * @param {Object} state - The Redux state. - * @returns {boolean} - */ -export function getAvatarUrl(state) { - return state.setup.avatarUrl; -} - /** * A selector which returns the locally configured name to use for the Spot-TV * to be displayed while in a meeting. diff --git a/spot-client/src/common/app-state/setup/setup.test.js b/spot-client/src/common/app-state/setup/setup.test.js index 281ed7307..808642cf0 100644 --- a/spot-client/src/common/app-state/setup/setup.test.js +++ b/spot-client/src/common/app-state/setup/setup.test.js @@ -20,13 +20,6 @@ describe('setup state', () => { expect(selectors.isSetupComplete(getState())).toBe(true); }); - it('saves the avatar url', () => { - const avatarUrl = 'new-url'; - - dispatch(actions.setAvatarUrl(avatarUrl)); - expect(selectors.getAvatarUrl(getState())).toBe(avatarUrl); - }); - it('saves the display name', () => { const displayName = 'new-name'; diff --git a/spot-client/src/common/i18n/en.json b/spot-client/src/common/i18n/en.json index f0053a773..5dde03d27 100644 --- a/spot-client/src/common/i18n/en.json +++ b/spot-client/src/common/i18n/en.json @@ -142,7 +142,6 @@ "audioOut": "Speaker", "audioOutTest": "Play test sound", "autoSyncing": "Auto syncing is in progress...", - "avatar": "Enter an avatar url", "devices": "Setup your devices", "enterCode": "Enter your pairing code and start your setup", "enterName": "Enter an email or room name (case-sensitive)", diff --git a/spot-client/src/common/utils/store-persistence.js b/spot-client/src/common/utils/store-persistence.js index be3a437fb..b1741152e 100644 --- a/spot-client/src/common/utils/store-persistence.js +++ b/spot-client/src/common/utils/store-persistence.js @@ -31,7 +31,6 @@ const keysToStore = [ 'calendars.displayName', 'backend.permanentPairingCode', 'deviceId.deviceId', - 'setup.avatarUrl', 'setup.completed', 'setup.displayName', 'setup.preferredCamera', @@ -86,7 +85,6 @@ function parsePersistedState(state) { deviceId: state.deviceId.deviceId }, setup: { - avatarUrl: state.setup.avatarUrl, completed: state.setup.completed, displayName: state.setup.displayName, preferredCamera: state.setup.preferredCamera, diff --git a/spot-client/src/spot-tv/ui/components/meeting-frame/AbstractMeetingFrame.js b/spot-client/src/spot-tv/ui/components/meeting-frame/AbstractMeetingFrame.js index 2c9722b63..a21018cf5 100644 --- a/spot-client/src/spot-tv/ui/components/meeting-frame/AbstractMeetingFrame.js +++ b/spot-client/src/spot-tv/ui/components/meeting-frame/AbstractMeetingFrame.js @@ -12,7 +12,6 @@ import { ApiHealthCheck } from './ApiHealthCheck'; */ export default class AbstractMeetingFrame extends React.Component { static propTypes = { - avatarUrl: PropTypes.string, displayName: PropTypes.string, dtmfThrottleRate: PropTypes.number, invites: PropTypes.array, diff --git a/spot-client/src/spot-tv/ui/components/meeting-frame/JitsiMeetingFrame/JitsiMeetingFrame.js b/spot-client/src/spot-tv/ui/components/meeting-frame/JitsiMeetingFrame/JitsiMeetingFrame.js index caab1404d..57b84ed15 100644 --- a/spot-client/src/spot-tv/ui/components/meeting-frame/JitsiMeetingFrame/JitsiMeetingFrame.js +++ b/spot-client/src/spot-tv/ui/components/meeting-frame/JitsiMeetingFrame/JitsiMeetingFrame.js @@ -205,7 +205,6 @@ export class JitsiMeetingFrame extends AbstractMeetingFrame { this._jitsiApi.addListener( 'videoMuteStatusChanged', this._onVideoMuteChange); - this._jitsiApi.executeCommand('avatarUrl', this.props.avatarUrl || ''); this._jitsiApi.executeCommand( 'displayName', this.props.displayName diff --git a/spot-client/src/spot-tv/ui/components/setup/profile.js b/spot-client/src/spot-tv/ui/components/setup/profile.js index f0e028a97..d948815e5 100644 --- a/spot-client/src/spot-tv/ui/components/setup/profile.js +++ b/spot-client/src/spot-tv/ui/components/setup/profile.js @@ -1,8 +1,6 @@ import { - getAvatarUrl, getCalendarName, getDisplayName, - setAvatarUrl, setDisplayName } from 'common/app-state'; import { Button, Input } from 'common/ui'; @@ -13,15 +11,12 @@ import { connect } from 'react-redux'; /** - * Prompts to set a display name and an avatar url for the Spot-TV to use during - * meetings. + * Prompts to set a display name and for the Spot-TV to use during meetings. */ export class Profile extends React.Component { static propTypes = { - avatarUrl: PropTypes.string, dispatch: PropTypes.func, displayName: PropTypes.string, - onSetAvatarUrl: PropTypes.func, onSetDisplayName: PropTypes.func, onSuccess: PropTypes.func, t: PropTypes.func @@ -37,11 +32,9 @@ export class Profile extends React.Component { super(props); this.state = { - avatarUrl: props.avatarUrl || '', displayName: props.displayName || '' }; - this._onAvatarUrlChange = this._onAvatarUrlChange.bind(this); this._onDisplayNameChange = this._onDisplayNameChange.bind(this); this._onSubmit = this._onSubmit.bind(this); } @@ -64,10 +57,6 @@ export class Profile extends React.Component { onChange = { this._onDisplayNameChange } placeholder = { t('setup.name') } value = { this.state.displayName } /> -