2022-08-25 11:35:19 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-09-13 07:36:00 +00:00
|
|
|
import { Theme } from '@mui/material';
|
|
|
|
import { withStyles } from '@mui/styles';
|
2018-06-20 20:19:53 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
2022-10-11 10:47:54 +00:00
|
|
|
import { getAvailableDevices } from '../../../base/devices/actions';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2022-10-19 08:42:54 +00:00
|
|
|
import { DialogWithTabs } from '../../../base/dialog';
|
|
|
|
import { hideDialog } from '../../../base/dialog/actions';
|
2022-08-25 11:35:19 +00:00
|
|
|
import { connect } from '../../../base/redux/functions';
|
2022-09-15 12:20:11 +00:00
|
|
|
import { withPixelLineHeight } from '../../../base/styles/functions.web';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
import { isCalendarEnabled } from '../../../calendar-sync';
|
2018-06-20 20:19:53 +00:00
|
|
|
import {
|
|
|
|
DeviceSelection,
|
|
|
|
getDeviceSelectionDialogProps,
|
|
|
|
submitDeviceSelectionTab
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2018-06-20 20:19:53 +00:00
|
|
|
} from '../../../device-selection';
|
2021-11-10 11:19:40 +00:00
|
|
|
import {
|
|
|
|
submitModeratorTab,
|
|
|
|
submitMoreTab,
|
|
|
|
submitProfileTab,
|
|
|
|
submitSoundsTab
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
} from '../../actions';
|
2020-05-20 10:57:03 +00:00
|
|
|
import { SETTINGS_TABS } from '../../constants';
|
2021-11-10 11:19:40 +00:00
|
|
|
import {
|
|
|
|
getModeratorTabProps,
|
|
|
|
getMoreTabProps,
|
|
|
|
getProfileTabProps,
|
|
|
|
getSoundsTabProps
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 11:19:40 +00:00
|
|
|
} from '../../functions';
|
2018-06-20 20:19:53 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
import CalendarTab from './CalendarTab';
|
2021-11-10 11:19:40 +00:00
|
|
|
import ModeratorTab from './ModeratorTab';
|
2018-06-20 20:19:53 +00:00
|
|
|
import MoreTab from './MoreTab';
|
|
|
|
import ProfileTab from './ProfileTab';
|
2021-07-20 11:56:57 +00:00
|
|
|
import SoundsTab from './SoundsTab';
|
2018-06-20 20:19:53 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
declare let interfaceConfig: any;
|
2018-06-20 20:19:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of
|
|
|
|
* {@link ConnectedSettingsDialog}.
|
|
|
|
*/
|
|
|
|
type Props = {
|
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
/**
|
|
|
|
* Information about the tabs to be rendered.
|
|
|
|
*/
|
|
|
|
_tabs: Array<{
|
|
|
|
name: string;
|
|
|
|
onMount: () => void;
|
|
|
|
submit: () => void;
|
2022-09-08 09:52:36 +00:00
|
|
|
}>;
|
2022-08-25 11:35:19 +00:00
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
/**
|
|
|
|
* An object containing the CSS classes.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
classes: Object;
|
2022-03-29 08:50:32 +00:00
|
|
|
|
2018-06-20 20:19:53 +00:00
|
|
|
/**
|
|
|
|
* Which settings tab should be initially displayed. If not defined then
|
|
|
|
* the first tab will be displayed.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
defaultTab: string;
|
2018-06-20 20:19:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoked to save changed settings.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
dispatch: Function;
|
2022-05-24 19:04:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the device selection dialog is displayed on the
|
|
|
|
* welcome page or not.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
isDisplayedOnWelcomePage: boolean;
|
2018-06-20 20:19:53 +00:00
|
|
|
};
|
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
/**
|
|
|
|
* Creates the styles for the component.
|
|
|
|
*
|
|
|
|
* @param {Object} theme - The current UI theme.
|
|
|
|
*
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-13 07:36:00 +00:00
|
|
|
const styles = (theme: Theme) => {
|
2022-03-29 08:50:32 +00:00
|
|
|
return {
|
|
|
|
settingsDialog: {
|
|
|
|
display: 'flex',
|
|
|
|
width: '100%',
|
|
|
|
|
|
|
|
'&.profile-pane': {
|
|
|
|
flexDirection: 'column'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .auth-name': {
|
2022-09-13 07:36:00 +00:00
|
|
|
marginBottom: theme.spacing(1)
|
2022-03-29 08:50:32 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
'& .calendar-tab, & .device-selection': {
|
|
|
|
marginTop: '20px'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .mock-atlaskit-label': {
|
|
|
|
color: '#b8c7e0',
|
|
|
|
fontSize: '12px',
|
|
|
|
fontWeight: 600,
|
|
|
|
lineHeight: 1.33,
|
2022-09-13 07:36:00 +00:00
|
|
|
padding: `20px 0px ${theme.spacing(1)} 0px`
|
2022-03-29 08:50:32 +00:00
|
|
|
},
|
|
|
|
|
2022-09-15 12:20:11 +00:00
|
|
|
'& .checkbox-label': {
|
|
|
|
color: theme.palette.text01,
|
|
|
|
...withPixelLineHeight(theme.typography.bodyShortRegular),
|
|
|
|
marginBottom: theme.spacing(2),
|
|
|
|
display: 'block',
|
|
|
|
marginTop: '20px'
|
|
|
|
},
|
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
'& input[type="checkbox"]:checked + svg': {
|
|
|
|
'--checkbox-background-color': '#6492e7',
|
|
|
|
'--checkbox-border-color': '#6492e7'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& input[type="checkbox"] + svg + span': {
|
|
|
|
color: '#9FB0CC'
|
|
|
|
},
|
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2022-03-29 08:50:32 +00:00
|
|
|
[[ '& .calendar-tab',
|
|
|
|
'& .more-tab',
|
|
|
|
'& .box' ]]: {
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
width: '100%'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .profile-edit': {
|
|
|
|
display: 'flex',
|
|
|
|
width: '100%'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .profile-edit-field': {
|
|
|
|
flex: 0.5,
|
2022-08-01 07:04:36 +00:00
|
|
|
marginRight: '20px',
|
2022-09-13 07:36:00 +00:00
|
|
|
marginTop: theme.spacing(3)
|
2022-03-29 08:50:32 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
'& .settings-sub-pane': {
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .settings-sub-pane .right': {
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
'& .settings-sub-pane .left': {
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .settings-sub-pane-element': {
|
|
|
|
textAlign: 'left',
|
|
|
|
flex: 1
|
|
|
|
},
|
|
|
|
|
2022-09-15 12:20:11 +00:00
|
|
|
'& .dropdown-menu': {
|
|
|
|
marginTop: '20px'
|
|
|
|
},
|
|
|
|
|
2022-08-02 10:51:42 +00:00
|
|
|
'& .settings-checkbox': {
|
|
|
|
display: 'flex',
|
2022-09-13 07:36:00 +00:00
|
|
|
marginBottom: theme.spacing(2)
|
2022-08-02 10:51:42 +00:00
|
|
|
},
|
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
'& .moderator-settings-wrapper': {
|
|
|
|
paddingTop: '20px'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .calendar-tab': {
|
|
|
|
alignItems: 'center',
|
|
|
|
flexDirection: 'column',
|
|
|
|
fontSize: '14px',
|
|
|
|
minHeight: '100px',
|
|
|
|
textAlign: 'center'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .calendar-tab-sign-in': {
|
|
|
|
marginTop: '20px'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .sign-out-cta': {
|
|
|
|
marginBottom: '20px'
|
|
|
|
},
|
|
|
|
|
2022-08-04 10:39:22 +00:00
|
|
|
'& .sign-out-cta-button': {
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'center'
|
|
|
|
},
|
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
'@media only screen and (max-width: 700px)': {
|
|
|
|
'& .device-selection': {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .more-tab': {
|
|
|
|
flexDirection: 'column'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-06-20 20:19:53 +00:00
|
|
|
/**
|
|
|
|
* A React {@code Component} for displaying a dialog to modify local settings
|
|
|
|
* and conference-wide (moderator) settings. This version is connected to
|
|
|
|
* redux to get the current settings.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2018-06-20 20:19:53 +00:00
|
|
|
*/
|
|
|
|
class SettingsDialog extends Component<Props> {
|
|
|
|
/**
|
|
|
|
* Initializes a new {@code ConnectedSettingsDialog} instance.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The React {@code Component} props to initialize
|
|
|
|
* the new {@code ConnectedSettingsDialog} instance with.
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
// Bind event handlers so they are only bound once for every instance.
|
|
|
|
this._closeDialog = this._closeDialog.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const { _tabs, defaultTab, dispatch } = this.props;
|
|
|
|
const onSubmit = this._closeDialog;
|
|
|
|
const defaultTabIdx
|
|
|
|
= _tabs.findIndex(({ name }) => name === defaultTab);
|
|
|
|
const tabs = _tabs.map(tab => {
|
|
|
|
return {
|
|
|
|
...tab,
|
2018-08-06 15:24:59 +00:00
|
|
|
onMount: tab.onMount
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
|
|
|
? (...args: any) => dispatch(tab.onMount(...args))
|
2018-08-06 15:24:59 +00:00
|
|
|
: undefined,
|
2022-08-25 11:35:19 +00:00
|
|
|
submit: (...args: any) => tab.submit
|
|
|
|
// @ts-ignore
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
&& dispatch(tab.submit(...args))
|
2018-06-20 20:19:53 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
return (
|
|
|
|
<DialogWithTabs
|
|
|
|
closeDialog = { this._closeDialog }
|
2018-11-24 11:50:09 +00:00
|
|
|
cssClassName = 'settings-dialog'
|
2018-06-20 20:19:53 +00:00
|
|
|
defaultTab = {
|
|
|
|
defaultTabIdx === -1 ? undefined : defaultTabIdx
|
|
|
|
}
|
|
|
|
onSubmit = { onSubmit }
|
2018-11-24 11:50:09 +00:00
|
|
|
tabs = { tabs }
|
|
|
|
titleKey = 'settings.title' />
|
2018-06-20 20:19:53 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback invoked to close the dialog without saving changes.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_closeDialog() {
|
|
|
|
this.props.dispatch(hideDialog());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated props for the
|
|
|
|
* {@code ConnectedSettingsDialog} component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
2022-03-29 08:50:32 +00:00
|
|
|
* @param {Object} ownProps - The props passed to the component.
|
2018-06-20 20:19:53 +00:00
|
|
|
* @private
|
|
|
|
* @returns {{
|
|
|
|
* tabs: Array<Object>
|
|
|
|
* }}
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
function _mapStateToProps(state: IReduxState, ownProps: any) {
|
2022-05-24 19:04:21 +00:00
|
|
|
const { classes, isDisplayedOnWelcomePage } = ownProps;
|
2018-06-20 20:19:53 +00:00
|
|
|
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
|
|
|
|
|
|
|
|
// The settings sections to display.
|
2020-03-30 14:44:45 +00:00
|
|
|
const showDeviceSettings = configuredTabs.includes('devices');
|
2018-06-20 20:19:53 +00:00
|
|
|
const moreTabProps = getMoreTabProps(state);
|
2021-11-10 11:19:40 +00:00
|
|
|
const moderatorTabProps = getModeratorTabProps(state);
|
|
|
|
const { showModeratorSettings } = moderatorTabProps;
|
2022-08-08 11:44:11 +00:00
|
|
|
const showMoreTab = configuredTabs.includes('more');
|
2018-06-20 20:19:53 +00:00
|
|
|
const showProfileSettings
|
2020-11-05 17:35:03 +00:00
|
|
|
= configuredTabs.includes('profile') && !state['features/base/config'].disableProfile;
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
const showCalendarSettings
|
2019-05-28 13:32:29 +00:00
|
|
|
= configuredTabs.includes('calendar') && isCalendarEnabled(state);
|
2021-07-20 11:56:57 +00:00
|
|
|
const showSoundsSettings = configuredTabs.includes('sounds');
|
2018-06-20 20:19:53 +00:00
|
|
|
const tabs = [];
|
|
|
|
|
|
|
|
if (showDeviceSettings) {
|
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.DEVICES,
|
|
|
|
component: DeviceSelection,
|
|
|
|
label: 'settings.devices',
|
2018-08-06 15:24:59 +00:00
|
|
|
onMount: getAvailableDevices,
|
2022-05-24 19:04:21 +00:00
|
|
|
props: getDeviceSelectionDialogProps(state, isDisplayedOnWelcomePage),
|
2022-08-25 11:35:19 +00:00
|
|
|
propsUpdateFunction: (tabState: any, newProps: any) => {
|
2018-08-06 15:24:59 +00:00
|
|
|
// Ensure the device selection tab gets updated when new devices
|
|
|
|
// are found by taking the new props and only preserving the
|
|
|
|
// current user selected devices. If this were not done, the
|
|
|
|
// tab would keep using a copy of the initial props it received,
|
|
|
|
// leaving the device list to become stale.
|
|
|
|
|
|
|
|
return {
|
|
|
|
...newProps,
|
|
|
|
selectedAudioInputId: tabState.selectedAudioInputId,
|
|
|
|
selectedAudioOutputId: tabState.selectedAudioOutputId,
|
|
|
|
selectedVideoInputId: tabState.selectedVideoInputId
|
|
|
|
};
|
|
|
|
},
|
2022-03-29 11:14:23 +00:00
|
|
|
styles: `settings-pane ${classes.settingsDialog} devices-pane`,
|
2022-08-25 11:35:19 +00:00
|
|
|
submit: (newState: any) => submitDeviceSelectionTab(newState, isDisplayedOnWelcomePage)
|
2018-06-20 20:19:53 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (showProfileSettings) {
|
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.PROFILE,
|
|
|
|
component: ProfileTab,
|
|
|
|
label: 'profile.title',
|
|
|
|
props: getProfileTabProps(state),
|
2022-03-29 11:14:23 +00:00
|
|
|
styles: `settings-pane ${classes.settingsDialog} profile-pane`,
|
2018-06-20 20:19:53 +00:00
|
|
|
submit: submitProfileTab
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-11-10 11:19:40 +00:00
|
|
|
if (showModeratorSettings) {
|
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.MODERATOR,
|
|
|
|
component: ModeratorTab,
|
|
|
|
label: 'settings.moderator',
|
|
|
|
props: moderatorTabProps,
|
2022-08-25 11:35:19 +00:00
|
|
|
propsUpdateFunction: (tabState: any, newProps: any) => {
|
2021-11-10 11:19:40 +00:00
|
|
|
// Updates tab props, keeping users selection
|
|
|
|
|
|
|
|
return {
|
|
|
|
...newProps,
|
2022-03-22 11:10:08 +00:00
|
|
|
followMeEnabled: tabState?.followMeEnabled,
|
|
|
|
startAudioMuted: tabState?.startAudioMuted,
|
|
|
|
startVideoMuted: tabState?.startVideoMuted,
|
|
|
|
startReactionsMuted: tabState?.startReactionsMuted
|
2021-11-10 11:19:40 +00:00
|
|
|
};
|
|
|
|
},
|
2022-03-29 11:14:23 +00:00
|
|
|
styles: `settings-pane ${classes.settingsDialog} moderator-pane`,
|
2021-11-10 11:19:40 +00:00
|
|
|
submit: submitModeratorTab
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
if (showCalendarSettings) {
|
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.CALENDAR,
|
|
|
|
component: CalendarTab,
|
2022-04-07 08:31:53 +00:00
|
|
|
label: 'settings.calendar.title',
|
|
|
|
styles: `settings-pane ${classes.settingsDialog} calendar-pane`
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
});
|
|
|
|
}
|
2021-07-20 11:56:57 +00:00
|
|
|
|
|
|
|
if (showSoundsSettings) {
|
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.SOUNDS,
|
|
|
|
component: SoundsTab,
|
|
|
|
label: 'settings.sounds',
|
|
|
|
props: getSoundsTabProps(state),
|
2022-03-29 11:14:23 +00:00
|
|
|
styles: `settings-pane ${classes.settingsDialog} profile-pane`,
|
2021-07-20 11:56:57 +00:00
|
|
|
submit: submitSoundsTab
|
|
|
|
});
|
|
|
|
}
|
Google & Microsoft calendar API integration (#3340)
* Refactor calendar-sync feature to be loaded on web.
For the web part it just adds new property to enable/disable calendar web integration, disabled by default.
* Initial implementation of retrieving google calendar events.
* Initial implementation of retrieving microsoft calendar events.
* Fixes comments.
* Rework to use the promise part of microsoft-graph-client api.
* Moves dispatching some actions, fixing comments.
* Makes sure we do not initializeClient google-api client multiple times.
* Do not try to login when fetching calendar entries.
The case where there is a calendar type google selected, but not logged in, trying to login on loading welcome page will show a warning that it tried to open a popup, which was denied by browser.
* Updates profile display data on sign in.
* Propagate google-api state to calendar-sync only if we use google cal.
* Adds sign out action.
* Clears the event listener when the popup closes.
* Clears calendarIntegrationInstance on signOut.
* WIP: UI for calendar settings, refactor auth flows
* Clean up some unused constants, functions and exports.
* break circular dependency of function and constant
* Exports only isCalendarEnabled from functions.
* Checks isSignedIn when doing fetchCalendarEntries on web.
* address comments
List microsoftApiApplicationClientID in undocument config.
remove unused SET_CALENDAR_TYPE action
use helper for calendar enabled in bootstrap
reorder actions
reorder imports
change order of signin -> set type -> update profile
add logging for signout error
reword setting dialog desc to avoid redundancy
add jsdoc to microsoft button props
reorder calendar constants
move default state to reducer (not reused anywhere)
update comment about calendar-sync due to removal of getCalendarState
update comment for getCalendarIntegration
remove vague comment
alpha order reducer, return default state on reset
alpha order persistence registry
remove unnecessary getType from apis
update comments in microsoftCalendar
alpha order google-api exports, use api.get in loadGoogleAPI
set jsdoc for google signin props
alpha order googleapi methods
fix calendartab docs
* Moves fetching calendar from APP_WILL_MOUNT to SET_CONFIG.
The web part needs configuration in order to refresh tokens (Microsoft).
* Fixes storing token expire time and refreshing tokens in Microsoft impl.
* Address comments
updateProfile changed to getCurrentEmail
rename result to results
stop storing integration in redux, store if ready for use
use existing helpers to parse redirect url
* update jsdocs, get google app id from redux
* clear integration instead of actual sign out
2018-08-15 20:11:54 +00:00
|
|
|
|
2021-12-17 12:39:15 +00:00
|
|
|
if (showMoreTab) {
|
2018-06-20 20:19:53 +00:00
|
|
|
tabs.push({
|
|
|
|
name: SETTINGS_TABS.MORE,
|
|
|
|
component: MoreTab,
|
|
|
|
label: 'settings.more',
|
|
|
|
props: moreTabProps,
|
2022-08-25 11:35:19 +00:00
|
|
|
propsUpdateFunction: (tabState: any, newProps: any) => {
|
2019-04-26 18:11:53 +00:00
|
|
|
// Updates tab props, keeping users selection
|
|
|
|
|
|
|
|
return {
|
|
|
|
...newProps,
|
2022-03-22 11:10:08 +00:00
|
|
|
currentFramerate: tabState?.currentFramerate,
|
|
|
|
currentLanguage: tabState?.currentLanguage,
|
|
|
|
hideSelfView: tabState?.hideSelfView,
|
|
|
|
showPrejoinPage: tabState?.showPrejoinPage,
|
2022-07-12 11:11:44 +00:00
|
|
|
enabledNotifications: tabState?.enabledNotifications || {},
|
2022-04-07 08:31:53 +00:00
|
|
|
maxStageParticipants: tabState?.maxStageParticipants
|
2019-04-26 18:11:53 +00:00
|
|
|
};
|
|
|
|
},
|
2022-03-29 11:14:23 +00:00
|
|
|
styles: `settings-pane ${classes.settingsDialog} more-pane`,
|
2018-06-20 20:19:53 +00:00
|
|
|
submit: submitMoreTab
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return { _tabs: tabs };
|
|
|
|
}
|
|
|
|
|
2022-03-29 08:50:32 +00:00
|
|
|
export default withStyles(styles)(connect(_mapStateToProps)(SettingsDialog));
|