![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /opt/mattermost/client/ |
Upload File : |
{"version":3,"file":"5977.3e836e5e6150a3e7a19d.js","mappings":"wLAMO,SAASA,EAAYC,GACxB,MAAO,CAACC,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA0BF,GAAe,EAAMH,GAAM,CAE7E,CAEO,SAASM,IACZ,MAAO,CAACL,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA0BF,GAAe,GAAO,CAExE,CAEO,SAASI,IACZ,MAAO,CAACN,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA8BF,GAAe,CAErE,C,4iBCFe,MAAMK,UAAwBC,IAAAA,cAGzCC,WAAAA,CAAYC,GACRC,MAAMD,GAAOE,EAAA,oBAII,CAACC,EAAUC,KAAwB,IAAAC,EACpDD,EAAEE,iBACFC,KAAKP,MAAMQ,UAAUL,EAAIM,MACuB,QAAhDJ,EAACD,EAAEM,OAAmBC,QAAQ,0BAAkB,IAAAN,GAAhDA,EAAkDO,UAAUC,IAAI,mBAAmB,IACtFX,EAAA,oBAEoB,CAACY,EAAeV,MAC7BW,EAAAA,EAAAA,GA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wB18C,IAAAA,KAAAC,WAExB7C,UAAS4C,IAAAA,OAITstC,SAAQttC,IAAAA,KAAAC,WAERyD,QAAO1D,IAAAA,MAAA,CACHsrB,sBAAqBtrB,IAAAA,KAAAC,WACrBqH,mBAAkBtH,IAAAA,KAAAC,WAClBglB,QAAOjlB,IAAAA,KAAAC,aAAAA,aAwYf,UAAeyT,EAAAA,EAAAA,YAAWyoC,G","sources":["webpack://mattermost-webapp/./src/actions/views/mfa.js","webpack://mattermost-webapp/./src/components/settings_sidebar/settings_sidebar.tsx","webpack://mattermost-webapp/./src/components/settings_sidebar/index.ts","webpack://mattermost-webapp/./src/components/setting_item_min.tsx","webpack://mattermost-webapp/./src/components/setting_item.tsx","webpack://mattermost-webapp/./src/components/setting_item_max.tsx","webpack://mattermost-webapp/./src/components/user_settings/advanced/join_leave_section/join_leave_section.tsx","webpack://mattermost-webapp/./src/components/user_settings/advanced/join_leave_section/index.ts","webpack://mattermost-webapp/./src/components/user_settings/advanced/performance_debugging_section/performance_debugging_section.tsx","webpack://mattermost-webapp/./src/components/user_settings/advanced/performance_debugging_section/index.ts","webpack://mattermost-webapp/./src/components/user_settings/headers/setting_desktop_header.tsx","webpack://mattermost-webapp/./src/components/user_settings/headers/setting_mobile_header.tsx","webpack://mattermost-webapp/./src/components/user_settings/advanced/user_settings_advanced.tsx","webpack://mattermost-webapp/./src/components/user_settings/advanced/index.ts","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/color_chooser/color_chooser.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/custom_theme_chooser/custom_theme_chooser.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/theme_thumbnail.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/premade_theme_chooser/premade_theme_chooser.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/premade_theme_chooser/index.ts","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/user_settings_theme.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_theme/index.ts","webpack://mattermost-webapp/./src/components/user_settings/display/manage_languages/manage_languages.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/manage_languages/index.ts","webpack://mattermost-webapp/./src/components/user_settings/display/manage_timezones/manage_timezones.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/manage_timezones/index.ts","webpack://mattermost-webapp/./src/components/user_settings/display/user_settings_display.tsx","webpack://mattermost-webapp/./src/components/user_settings/display/index.ts","webpack://mattermost-webapp/./src/components/setting_picture.tsx","webpack://mattermost-webapp/./src/components/user_settings/general/user_settings_general.tsx","webpack://mattermost-webapp/./src/components/user_settings/general/index.ts","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_denied_section_notice.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_never_granted_section_notice.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_unsupported_section_notice.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_desktop_denied_section_notice.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/index.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_title_tag/index.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_and_mobile_notification_setting/index.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/desktop_notification_sounds_setting/index.tsx","webpack://mattermost-webapp/./src/packages/mattermost-redux/src/utils/notify_props.ts","webpack://mattermost-webapp/./src/components/user_settings/notifications/email_notification_setting/email_notification_setting.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/email_notification_setting/index.ts","webpack://mattermost-webapp/./src/components/user_settings/notifications/manage_auto_responder/manage_auto_responder.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/send_test_notification_notice.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/user_settings_notifications.tsx","webpack://mattermost-webapp/./src/components/user_settings/notifications/index.ts","webpack://mattermost-webapp/./src/components/user_settings/plugin/plugin_action.tsx","webpack://mattermost-webapp/./src/utils/plugins/preferences.tsx","webpack://mattermost-webapp/./src/components/user_settings/plugin/radio_option.tsx","webpack://mattermost-webapp/./src/components/user_settings/plugin/radio.tsx","webpack://mattermost-webapp/./src/components/user_settings/plugin/plugin_setting.tsx","webpack://mattermost-webapp/./src/components/user_settings/plugin/index.tsx","webpack://mattermost-webapp/./src/components/access_history_modal/access_history_modal.tsx","webpack://mattermost-webapp/./src/components/access_history_modal/index.ts","webpack://mattermost-webapp/./src/components/activity_log_modal/components/device_icon.tsx","webpack://mattermost-webapp/./src/components/activity_log_modal/components/more_info.tsx","webpack://mattermost-webapp/./src/components/activity_log_modal/components/activity_log.tsx","webpack://mattermost-webapp/./src/components/activity_log_modal/activity_log_modal.tsx","webpack://mattermost-webapp/./src/components/activity_log_modal/index.ts","webpack://mattermost-webapp/./src/components/user_settings/security/mfa_section/mfa_section.tsx","webpack://mattermost-webapp/./src/components/user_settings/security/mfa_section/index.ts","webpack://mattermost-webapp/./src/components/user_settings/security/user_access_token_section/user_access_token_section.tsx","webpack://mattermost-webapp/./src/components/user_settings/security/user_access_token_section/index.ts","webpack://mattermost-webapp/./src/components/user_settings/security/user_settings_security.tsx","webpack://mattermost-webapp/./src/components/user_settings/security/index.ts","webpack://mattermost-webapp/./src/components/user_settings/sidebar/limit_visible_gms_dms/limit_visible_gms_dms.tsx","webpack://mattermost-webapp/./src/components/user_settings/sidebar/limit_visible_gms_dms/index.ts","webpack://mattermost-webapp/./src/components/user_settings/sidebar/show_unreads_category/show_unreads_category.tsx","webpack://mattermost-webapp/./src/components/user_settings/sidebar/show_unreads_category/index.ts","webpack://mattermost-webapp/./src/components/user_settings/sidebar/user_settings_sidebar.tsx","webpack://mattermost-webapp/./src/components/user_settings/sidebar/index.ts","webpack://mattermost-webapp/./src/components/user_settings/index.tsx","webpack://mattermost-webapp/./src/components/widgets/smart_loader/index.tsx","webpack://mattermost-webapp/./src/components/user_settings/modal/user_settings_modal.tsx"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport * as UserActions from 'mattermost-redux/actions/users';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nexport function activateMfa(code) {\n return (dispatch, getState) => {\n const currentUserId = getCurrentUserId(getState());\n\n return dispatch(UserActions.updateUserMfa(currentUserId, true, code));\n };\n}\n\nexport function deactivateMfa() {\n return (dispatch, getState) => {\n const currentUserId = getCurrentUserId(getState());\n\n return dispatch(UserActions.updateUserMfa(currentUserId, false));\n };\n}\n\nexport function generateMfaSecret() {\n return (dispatch, getState) => {\n const currentUserId = getCurrentUserId(getState());\n\n return dispatch(UserActions.generateMfaSecret(currentUserId));\n };\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport Constants from 'utils/constants';\nimport {isKeyPressed} from 'utils/keyboard';\nimport {a11yFocus} from 'utils/utils';\n\nexport type Tab = {\n icon: string | {url: string};\n iconTitle: string;\n name: string;\n uiName: string;\n}\n\nexport type Props = {\n activeTab?: string;\n tabs: Tab[];\n pluginTabs?: Tab[];\n updateTab: (name: string) => void;\n isMobileView: boolean;\n};\n\nexport default class SettingsSidebar extends React.PureComponent<Props> {\n buttonRefs: Array<RefObject<HTMLButtonElement>>;\n\n constructor(props: Props) {\n super(props);\n this.buttonRefs = this.props.tabs.map(() => React.createRef());\n }\n\n public handleClick = (tab: Tab, e: React.MouseEvent) => {\n e.preventDefault();\n this.props.updateTab(tab.name);\n (e.target as Element).closest('.settings-modal')?.classList.add('display--content');\n };\n\n public handleKeyUp = (index: number, e: React.KeyboardEvent) => {\n if (isKeyPressed(e, Constants.KeyCodes.UP)) {\n if (index > 0) {\n this.props.updateTab(this.props.tabs[index - 1].name);\n a11yFocus(this.buttonRefs[index - 1].current);\n }\n } else if (isKeyPressed(e, Constants.KeyCodes.DOWN)) {\n if (index < this.props.tabs.length - 1) {\n this.props.updateTab(this.props.tabs[index + 1].name);\n a11yFocus(this.buttonRefs[index + 1].current);\n }\n }\n };\n\n private renderTab(tab: Tab, index: number) {\n const key = `${tab.name}_li`;\n const isActive = this.props.activeTab === tab.name;\n let className = '';\n if (isActive) {\n className = 'active';\n }\n\n let icon;\n if (typeof tab.icon === 'string') {\n icon = (\n <i\n className={tab.icon}\n title={tab.iconTitle}\n />\n );\n } else {\n icon = (\n <img\n src={tab.icon.url}\n alt={tab.iconTitle}\n className='icon'\n />\n );\n }\n\n return (\n <li\n id={`${tab.name}Li`}\n key={key}\n className={className}\n role='presentation'\n >\n <button\n ref={this.buttonRefs[index]}\n id={`${tab.name}Button`}\n className='cursor--pointer style--none'\n onClick={this.handleClick.bind(null, tab)}\n onKeyUp={this.handleKeyUp.bind(null, index)}\n aria-label={tab.uiName.toLowerCase()}\n role='tab'\n aria-selected={isActive}\n tabIndex={!isActive && !this.props.isMobileView ? -1 : 0}\n >\n {icon}\n {tab.uiName}\n </button>\n </li>\n );\n }\n\n public render() {\n const tabList = this.props.tabs.map((tab, index) => this.renderTab(tab, index));\n let pluginTabList: React.ReactNode;\n if (this.props.pluginTabs?.length) {\n pluginTabList = (\n <>\n <hr/>\n <li\n key={'plugin preferences heading'}\n role='heading'\n className={'header'}\n >\n <FormattedMessage\n id={'userSettingsModal.pluginPreferences.header'}\n defaultMessage={'PLUGIN PREFERENCES'}\n />\n </li>\n {this.props.pluginTabs.map((tab, index) => this.renderTab(tab, index))}\n </>\n );\n }\n\n return (\n <div>\n <ul\n id='tabList'\n className='nav nav-pills nav-stacked'\n role='tablist'\n aria-orientation='vertical'\n >\n {tabList}\n {pluginTabList}\n </ul>\n </div>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {getIsMobileView} from 'selectors/views/browser';\n\nimport type {GlobalState} from 'types/store';\n\nimport SettingsSidebar from './settings_sidebar';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n isMobileView: getIsMobileView(state),\n };\n}\n\nexport default connect(mapStateToProps)(SettingsSidebar);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport classNames from 'classnames';\nimport React, {type ReactNode, type MouseEvent} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport EditIcon from 'components/widgets/icons/fa_edit_icon';\n\nimport {a11yFocus} from 'utils/utils';\n\ninterface Props {\n\n /**\n * Settings title\n */\n title: ReactNode;\n\n /**\n * Option to disable opening the setting\n */\n isDisabled?: boolean;\n\n /**\n * Settings or tab section\n */\n section: string;\n\n /**\n * Function to update section\n */\n updateSection: (section: string) => void;\n\n /**\n * Settings description\n */\n describe?: ReactNode;\n\n /**\n * Replacement in place of edit button when the setting (in collapsed mode) is disabled\n */\n collapsedEditButtonWhenDisabled?: ReactNode;\n}\n\nexport default class SettingItemMin extends React.PureComponent<Props> {\n private edit: HTMLButtonElement | null = null;\n\n focus() {\n a11yFocus(this.edit);\n }\n\n private getEdit = (node: HTMLButtonElement) => {\n this.edit = node;\n };\n\n handleClick = (e: MouseEvent<HTMLDivElement | HTMLButtonElement>) => {\n if (this.props.isDisabled) {\n return;\n }\n\n e.preventDefault();\n this.props.updateSection(this.props.section);\n };\n\n render() {\n let editButtonComponent: ReactNode;\n\n if (this.props.isDisabled) {\n if (this.props.collapsedEditButtonWhenDisabled) {\n editButtonComponent = this.props.collapsedEditButtonWhenDisabled;\n } else {\n editButtonComponent = null;\n }\n } else {\n editButtonComponent = (\n <button\n ref={this.getEdit}\n id={this.props.section + 'Edit'}\n className='color--link style--none section-min__edit'\n onClick={this.handleClick}\n aria-labelledby={this.props.section + 'Title ' + this.props.section + 'Edit'}\n aria-expanded={false}\n >\n <EditIcon/>\n <FormattedMessage\n id='setting_item_min.edit'\n defaultMessage='Edit'\n />\n </button>\n );\n }\n\n return (\n <div\n className={classNames('section-min', {isDisabled: this.props.isDisabled})}\n onClick={this.handleClick}\n >\n <div\n className='secion-min__header'\n >\n <h4\n id={this.props.section + 'Title'}\n className={classNames('section-min__title', {isDisabled: this.props.isDisabled})}\n >\n {this.props.title}\n </h4>\n {editButtonComponent}\n </div>\n <div\n id={this.props.section + 'Desc'}\n className={classNames('section-min__describe', {isDisabled: this.props.isDisabled})}\n >\n {this.props.describe}\n </div>\n </div>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ReactNode} from 'react';\nimport React, {useRef} from 'react';\n\nimport type SettingItemMinComponent from 'components/setting_item_min';\nimport SettingItemMin from 'components/setting_item_min';\n\nimport useDidUpdate from './common/hooks/useDidUpdate';\n\ntype Props = {\n\n /**\n * Whether this setting item is currently open\n */\n active: boolean;\n\n /**\n * Whether all sections in the panel are currently closed\n */\n areAllSectionsInactive: boolean;\n\n /**\n * The identifier of this section\n */\n section: string;\n\n /**\n * The setting UI when it is maximized (open)\n */\n max?: ReactNode;\n\n // Props to pass through for SettingItemMin\n updateSection: (section: string) => void;\n title?: ReactNode;\n isDisabled?: boolean;\n describe?: ReactNode;\n\n /**\n * Replacement in place of edit button when the setting (in collapsed mode) is disabled\n */\n collapsedEditButtonWhenDisabled?: ReactNode;\n}\n\nconst SettingItem = ({\n active,\n areAllSectionsInactive,\n section,\n max,\n updateSection,\n title,\n isDisabled,\n describe,\n collapsedEditButtonWhenDisabled,\n}: Props) => {\n const minRef = useRef<SettingItemMinComponent>(null);\n\n useDidUpdate(() => {\n // We want to bring back focus to the edit button when the section is opened and then closed along with all sections are closed\n\n if (!active && areAllSectionsInactive) {\n minRef.current?.focus();\n }\n }, [active]);\n\n if (active) {\n return <>{max}</>;\n }\n\n return (\n <SettingItemMin\n ref={minRef}\n title={title}\n updateSection={updateSection}\n describe={describe}\n section={section}\n isDisabled={isDisabled}\n collapsedEditButtonWhenDisabled={collapsedEditButtonWhenDisabled}\n />\n );\n};\n\nexport default React.memo(SettingItem);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport type {ReactNode} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport SaveButton from 'components/save_button';\n\nimport Constants from 'utils/constants';\nimport {isKeyPressed} from 'utils/keyboard';\nimport {a11yFocus} from 'utils/utils';\n\ntype Props = {\n\n // Array of inputs selection\n inputs?: ReactNode;\n containerStyle?: string;\n serverError?: ReactNode;\n\n /**\n * Client error\n */\n clientError?: ReactNode;\n\n /**\n * Settings extra information\n */\n extraInfo?: ReactNode;\n\n /**\n * Info position\n */\n infoPosition?: string;\n\n /**\n * Settings or tab section\n */\n section: string;\n updateSection?: (section: string) => void;\n setting?: string;\n submit?: ((setting?: string) => void) | null;\n disableEnterSubmit?: boolean;\n submitExtra?: ReactNode;\n saving?: boolean;\n title?: ReactNode;\n extraContentBeforeSettingList?: ReactNode;\n isFullWidth?: boolean;\n cancelButtonText?: ReactNode;\n shiftEnter?: boolean;\n saveButtonText?: string;\n saveButtonClassName?: string;\n}\nexport default class SettingItemMax extends React.PureComponent<Props> {\n settingList: React.RefObject<HTMLDivElement>;\n\n static defaultProps = {\n infoPosition: 'bottom',\n saving: false,\n section: '',\n containerStyle: '',\n };\n\n constructor(props: Props) {\n super(props);\n this.settingList = React.createRef();\n }\n\n componentDidMount() {\n if (this.settingList.current) {\n const focusableElements: NodeListOf<HTMLElement> = this.settingList.current.querySelectorAll('.btn:not(.save-button):not(.btn-tertiary), input.form-control, input[type=\"radio\"][checked], input[type=\"checkbox\"], select, textarea, [tabindex]:not([tabindex=\"-1\"])');\n if (focusableElements.length > 0) {\n a11yFocus(focusableElements[0]);\n } else {\n a11yFocus(this.settingList.current);\n }\n }\n\n document.addEventListener('keydown', this.onKeyDown);\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.onKeyDown);\n }\n\n onKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement;\n if (this.props.shiftEnter && isKeyPressed(e, Constants.KeyCodes.ENTER) && e.shiftKey) {\n return;\n }\n if (this.props.disableEnterSubmit !== true &&\n isKeyPressed(e, Constants.KeyCodes.ENTER) &&\n this.props.submit &&\n target.tagName !== 'SELECT' &&\n target.parentElement &&\n target.parentElement.className !== 'react-select__input' &&\n !target.classList.contains('btn-tertiary') &&\n this.settingList.current &&\n this.settingList.current.contains(target)) {\n this.handleSubmit(e);\n }\n };\n\n handleSubmit = (e: React.MouseEvent | KeyboardEvent) => {\n e.preventDefault();\n\n if (this.props.setting && this.props.submit) {\n this.props.submit(this.props.setting);\n } else if (this.props.submit) {\n this.props.submit();\n }\n };\n\n handleUpdateSection = (e: React.MouseEvent) => {\n if (this.props.updateSection) {\n this.props.updateSection(this.props.section);\n }\n e.preventDefault();\n };\n\n render() {\n let clientError = null;\n if (this.props.clientError) {\n clientError = (\n <div className='form-group'>\n <label\n id='clientError'\n className='col-sm-12 has-error'\n >\n {this.props.clientError}\n </label>\n </div>\n );\n }\n\n let serverError = null;\n if (this.props.serverError) {\n serverError = (\n <div className='form-group'>\n <label\n id='serverError'\n className='col-sm-12 has-error'\n >\n {this.props.serverError}\n </label>\n </div>\n );\n }\n\n let extraInfo = null;\n let hintClass = 'setting-list__hint';\n if (this.props.infoPosition === 'top') {\n hintClass = 'pb-3';\n }\n\n if (this.props.extraInfo) {\n extraInfo = (\n <div\n id='extraInfo'\n className={hintClass}\n >\n {this.props.extraInfo}\n </div>\n );\n }\n\n let submit: JSX.Element | null = null;\n if (this.props.submit) {\n submit = (\n <SaveButton\n defaultMessage={this.props.saveButtonText}\n saving={this.props.saving}\n disabled={this.props.saving}\n onClick={this.handleSubmit}\n btnClass={this.props.saveButtonClassName}\n />\n );\n }\n\n const inputs = this.props.inputs;\n\n let title;\n if (this.props.title) {\n title = (\n <h4\n id='settingTitle'\n className='col-sm-12 section-title'\n >\n {this.props.title}\n </h4>\n );\n }\n\n let listContent = (\n <div className='setting-list-item'>\n {inputs}\n {extraInfo}\n </div>\n );\n\n if (this.props.infoPosition === 'top') {\n listContent = (\n <div>\n {extraInfo}\n {inputs}\n </div>\n );\n }\n\n let cancelButtonText;\n if (this.props.cancelButtonText) {\n cancelButtonText = this.props.cancelButtonText;\n } else {\n cancelButtonText = (\n <FormattedMessage\n id='setting_item_max.cancel'\n defaultMessage='Cancel'\n />\n );\n }\n\n return (\n <section\n className={`section-max form-horizontal ${this.props.containerStyle}`}\n >\n {title}\n {this.props.extraContentBeforeSettingList}\n <div\n className={classNames('sectionContent', {\n 'col-sm-12': this.props.isFullWidth,\n 'col-sm-10 col-sm-offset-2': !this.props.isFullWidth,\n })}\n >\n <div\n tabIndex={-1}\n ref={this.settingList}\n className='setting-list'\n >\n {listContent}\n <div className='setting-list-item'>\n <hr/>\n {this.props.submitExtra}\n {serverError}\n {clientError}\n {submit}\n <button\n id={'cancelSetting'}\n className='btn btn-tertiary'\n onClick={this.handleUpdateSection}\n >\n {cancelButtonText}\n </button>\n </div>\n </div>\n </div>\n </section>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {ReactNode, RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {PreferencesType, PreferenceType} from '@mattermost/types/preferences';\n\nimport {Preferences} from 'mattermost-redux/constants';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {AdvancedSections} from 'utils/constants';\nimport {a11yFocus} from 'utils/utils';\n\nexport type OwnProps = {\n adminMode?: boolean;\n userId: string;\n userPreferences?: PreferencesType;\n}\n\ntype Props = OwnProps & {\n active: boolean;\n areAllSectionsInactive: boolean;\n joinLeave: string;\n onUpdateSection: (section?: string) => void;\n renderOnOffLabel: (label: string) => ReactNode;\n actions: {\n savePreferences: (userId: string, preferences: PreferenceType[]) => void;\n };\n}\n\ntype State = {\n joinLeaveState: string;\n isSaving?: boolean;\n serverError?: string;\n}\n\nexport default class JoinLeaveSection extends React.PureComponent<Props, State> {\n minRef: RefObject<SettingItemMinComponent>;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n joinLeaveState: props.joinLeave,\n };\n\n this.minRef = React.createRef();\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n public handleOnChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const value = e.currentTarget.value;\n\n this.setState({joinLeaveState: value});\n a11yFocus(e.currentTarget);\n };\n\n public handleUpdateSection = (section?: string): void => {\n if (!section) {\n this.setState({joinLeaveState: this.props.joinLeave});\n }\n\n this.props.onUpdateSection(section);\n };\n\n public handleSubmit = (): void => {\n const {actions, userId, onUpdateSection} = this.props;\n const joinLeavePreference = {category: Preferences.CATEGORY_ADVANCED_SETTINGS, user_id: userId, name: Preferences.ADVANCED_FILTER_JOIN_LEAVE, value: this.state.joinLeaveState};\n actions.savePreferences(userId, [joinLeavePreference]);\n\n onUpdateSection();\n };\n\n public render(): React.ReactNode {\n const {joinLeaveState} = this.state;\n if (this.props.active) {\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.joinLeaveTitle'\n defaultMessage='Enable Join/Leave Messages'\n />\n }\n inputs={[\n <fieldset key='joinLeaveSetting'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage\n id='user.settings.advance.joinLeaveTitle'\n defaultMessage='Enable Join/Leave Messages'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='joinLeaveOn'\n type='radio'\n value={'true'}\n name={AdvancedSections.JOIN_LEAVE}\n checked={joinLeaveState === 'true'}\n onChange={this.handleOnChange}\n />\n <FormattedMessage\n id='user.settings.advance.on'\n defaultMessage='On'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='joinLeaveOff'\n type='radio'\n value={'false'}\n name={AdvancedSections.JOIN_LEAVE}\n checked={joinLeaveState === 'false'}\n onChange={this.handleOnChange}\n />\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n </label>\n <br/>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.advance.joinLeaveDesc'\n defaultMessage='When \"On\", System Messages saying a user has joined or left a channel will be visible. When \"Off\", the System Messages about joining or leaving a channel will be hidden. A message will still show up when you are added to a channel, so you can receive a notification.'\n />\n </div>\n </fieldset>,\n ]}\n setting={AdvancedSections.JOIN_LEAVE}\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n return (\n <SettingItemMin\n title={\n <FormattedMessage\n id='user.settings.advance.joinLeaveTitle'\n defaultMessage='Enable Join/Leave Messages'\n />\n }\n describe={this.props.renderOnOffLabel(joinLeaveState!)}\n section={AdvancedSections.JOIN_LEAVE}\n updateSection={this.handleUpdateSection}\n ref={this.minRef}\n />\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {Preferences} from 'mattermost-redux/constants';\nimport {getConfig} from 'mattermost-redux/selectors/entities/general';\nimport {get} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './join_leave_section';\nimport JoinLeaveSection from './join_leave_section';\n\nexport function mapStateToProps(state: GlobalState, props: OwnProps) {\n const config = getConfig(state);\n const enableJoinLeaveMessage = config.EnableJoinLeaveMessageByDefault === 'true';\n const userPreference = props.adminMode && props.userPreferences ? props.userPreferences : undefined;\n\n return {\n userId: props.adminMode ? props.userId : getCurrentUserId(state),\n joinLeave: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, Preferences.ADVANCED_FILTER_JOIN_LEAVE, enableJoinLeaveMessage.toString(), userPreference),\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n savePreferences,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(JoinLeaveSection);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useState, useRef, useEffect} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport {Preferences} from 'mattermost-redux/constants';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {AdvancedSections} from 'utils/constants';\n\nimport type {PropsFromRedux} from './index';\n\nexport type OwnProps = {\n adminMode?: boolean;\n userId: string;\n}\n\ntype Props = PropsFromRedux & OwnProps & {\n active: boolean;\n areAllSectionsInactive: boolean;\n onUpdateSection: (section?: string) => void;\n};\n\nexport default function PerformanceDebuggingSection(props: Props) {\n const minRef = useRef<SettingItemMinComponent>(null);\n const prevActiveRef = useRef(false);\n\n useEffect(() => {\n if (prevActiveRef.current && !props.active && props.areAllSectionsInactive) {\n minRef.current?.focus();\n }\n });\n\n useEffect(() => {\n prevActiveRef.current = props.active;\n }, [props.active]);\n\n if (!props.performanceDebuggingEnabled) {\n return null;\n }\n\n let settings;\n if (props.active) {\n settings = <PerformanceDebuggingSectionExpanded {...props}/>;\n } else {\n settings = (\n <PerformanceDebuggingSectionCollapsed\n {...props}\n ref={minRef}\n />\n );\n }\n\n return (\n <>\n {settings}\n <div className='divider-light'/>\n </>\n );\n}\n\nconst PerformanceDebuggingSectionCollapsed = React.forwardRef<SettingItemMinComponent, Props>((props, ref) => {\n let settingsEnabled = 0;\n\n if (props.disableClientPlugins) {\n settingsEnabled += 1;\n }\n if (props.disableTelemetry) {\n settingsEnabled += 1;\n }\n if (props.disableTypingMessages) {\n settingsEnabled += 1;\n }\n\n let description;\n if (settingsEnabled === 0) {\n description = (\n <FormattedMessage\n id='user.settings.advance.performance.noneEnabled'\n defaultMessage='No settings enabled'\n />\n );\n } else {\n description = (\n <FormattedMessage\n id='user.settings.advance.performance.settingsEnabled'\n defaultMessage='{count, number} {count, plural, one {setting} other {settings}} enabled'\n values={{count: settingsEnabled}}\n />\n );\n }\n\n return (\n <SettingItemMin\n title={\n <FormattedMessage\n id='user.settings.advance.performance.title'\n defaultMessage='Performance Debugging'\n />\n }\n describe={description}\n section={AdvancedSections.PERFORMANCE_DEBUGGING}\n updateSection={props.onUpdateSection}\n ref={ref}\n />\n );\n});\n\nfunction PerformanceDebuggingSectionExpanded(props: Props) {\n const [disableClientPlugins, setDisableClientPlugins] = useState(props.disableClientPlugins);\n const [disableTelemetry, setDisableTelemetry] = useState(props.disableTelemetry);\n const [disableTypingMessages, setDisableTypingMessages] = useState(props.disableTypingMessages);\n\n const handleSubmit = useCallback(() => {\n if (!props.userId) {\n return;\n }\n\n const preferences = [];\n\n if (disableClientPlugins !== props.disableClientPlugins) {\n preferences.push({\n user_id: props.userId,\n category: Preferences.CATEGORY_PERFORMANCE_DEBUGGING,\n name: Preferences.NAME_DISABLE_CLIENT_PLUGINS,\n value: disableClientPlugins.toString(),\n });\n }\n if (disableTelemetry !== props.disableTelemetry) {\n preferences.push({\n user_id: props.userId,\n category: Preferences.CATEGORY_PERFORMANCE_DEBUGGING,\n name: Preferences.NAME_DISABLE_TELEMETRY,\n value: disableTelemetry.toString(),\n });\n }\n if (disableTypingMessages !== props.disableTypingMessages) {\n preferences.push({\n user_id: props.userId,\n category: Preferences.CATEGORY_PERFORMANCE_DEBUGGING,\n name: Preferences.NAME_DISABLE_TYPING_MESSAGES,\n value: disableTypingMessages.toString(),\n });\n }\n\n if (preferences.length !== 0 && props.userId) {\n props.savePreferences(props.userId, preferences);\n }\n\n props.onUpdateSection('');\n }, [\n props.userId,\n props.onUpdateSection,\n props.savePreferences,\n disableClientPlugins,\n disableTelemetry,\n disableTypingMessages,\n ]);\n\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.performance.title'\n defaultMessage='Performance Debugging'\n />\n }\n inputs={[\n <fieldset key='settings'>\n <div className='checkbox'>\n <label>\n <input\n type='checkbox'\n checked={disableClientPlugins}\n onChange={(e) => {\n setDisableClientPlugins(e.target.checked);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.performance.disableClientPlugins'\n defaultMessage='Disable Client-side Plugins'\n />\n </label>\n </div>\n <div className='checkbox'>\n <label>\n <input\n type='checkbox'\n checked={disableTelemetry}\n onChange={(e) => {\n setDisableTelemetry(e.target.checked);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.performance.disableTelemetry'\n defaultMessage='Disable telemetry events sent from the client'\n />\n </label>\n </div>\n <div className='checkbox'>\n <label>\n <input\n type='checkbox'\n checked={disableTypingMessages}\n onChange={(e) => {\n setDisableTypingMessages(e.target.checked);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.performance.disableTypingMessages'\n defaultMessage='Disable \"User is typing...\" messages'\n />\n </label>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.advance.performance.info1'\n defaultMessage=\"You may enable these settings temporarily to help isolate performance issues while debugging. We don't recommend leaving these settings enabled for an extended period of time as they can negatively impact your user experience.\"\n />\n <br/>\n <br/>\n <FormattedMessage\n id='user.settings.advance.performance.info2'\n defaultMessage='You may need to refresh the page before these settings take effect.'\n />\n </div>\n </fieldset>,\n ]}\n submit={handleSubmit}\n updateSection={props.onUpdateSection}\n />\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport type {ConnectedProps} from 'react-redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {Preferences} from 'mattermost-redux/constants';\nimport {isPerformanceDebuggingEnabled} from 'mattermost-redux/selectors/entities/general';\nimport {getBool, getUserPreferences} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './performance_debugging_section';\nimport PerformanceDebuggingSection from './performance_debugging_section';\n\nfunction mapStateToProps(state: GlobalState, props: OwnProps) {\n const userPreferences = props.adminMode && props.userId ? getUserPreferences(state, props.userId) : undefined;\n\n return {\n userId: props.adminMode ? props.userId : getCurrentUserId(state),\n disableClientPlugins: getBool(state, Preferences.CATEGORY_PERFORMANCE_DEBUGGING, Preferences.NAME_DISABLE_CLIENT_PLUGINS, undefined, userPreferences),\n disableTelemetry: getBool(state, Preferences.CATEGORY_PERFORMANCE_DEBUGGING, Preferences.NAME_DISABLE_TELEMETRY, undefined, userPreferences),\n disableTypingMessages: getBool(state, Preferences.CATEGORY_PERFORMANCE_DEBUGGING, Preferences.NAME_DISABLE_TYPING_MESSAGES, undefined, userPreferences),\n performanceDebuggingEnabled: isPerformanceDebuggingEnabled(state),\n\n };\n}\n\nconst mapDispatchToProps = {\n savePreferences,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport type PropsFromRedux = ConnectedProps<typeof connector>;\n\nexport default connector(PerformanceDebuggingSection);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ReactNode} from 'react';\nimport React from 'react';\n\nimport './setting_desktop_header.scss';\n\ninterface Props {\n id?: string;\n text: ReactNode;\n info?: ReactNode;\n}\n\nexport default function SettingDesktopHeader(props: Props) {\n return (\n <div className='userSettingDesktopHeader'>\n <h3\n id={props.id}\n className='tab-header'\n >\n {props.text}\n </h3>\n {props.info && <div className='userSettingDesktopHeaderInfo'>{props.info}</div>}\n </div>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ReactNode} from 'react';\nimport React from 'react';\nimport {useIntl} from 'react-intl';\n\ntype Props = {\n text: ReactNode;\n closeModal: () => void;\n collapseModal: () => void;\n}\nconst SettingMobileHeader = ({\n text,\n closeModal,\n collapseModal,\n}: Props) => {\n const intl = useIntl();\n\n return (\n <div className='modal-header'>\n <button\n id='closeButton'\n type='button'\n className='close'\n data-dismiss='modal'\n onClick={closeModal}\n >\n <span aria-hidden='true'>{'×'}</span>\n </button>\n <h4 className='modal-title'>\n <div className='modal-back'>\n <i\n className='fa fa-angle-left'\n aria-label={\n intl.formatMessage({\n id: 'generic_icons.collapse',\n defaultMessage: 'Collapse Icon',\n })\n }\n onClick={collapseModal}\n />\n </div>\n {text}\n </h4>\n </div>\n );\n};\n\nexport default SettingMobileHeader;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable max-lines */\n\nimport React from 'react';\nimport type {ReactNode} from 'react';\nimport {FormattedMessage, defineMessages} from 'react-intl';\n\nimport type {PreferencesType, PreferenceType} from '@mattermost/types/preferences';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {emitUserLoggedOutEvent} from 'actions/global_actions';\n\nimport ConfirmModal from 'components/confirm_modal';\nimport SettingItem from 'components/setting_item';\nimport SettingItemMax from 'components/setting_item_max';\n\nimport Constants, {AdvancedSections, Preferences} from 'utils/constants';\nimport {isMac} from 'utils/user_agent';\nimport {a11yFocus} from 'utils/utils';\n\nimport JoinLeaveSection from './join_leave_section';\nimport PerformanceDebuggingSection from './performance_debugging_section';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nimport type {PropsFromRedux} from './index';\n\ntype Settings = {\n [key: string]: string | undefined;\n send_on_ctrl_enter: Props['sendOnCtrlEnter'];\n code_block_ctrl_enter: Props['codeBlockOnCtrlEnter'];\n formatting: Props['formatting'];\n join_leave: Props['joinLeave'];\n sync_drafts: Props['syncDrafts'];\n};\n\nexport type OwnProps = {\n adminMode?: boolean;\n user: UserProfile;\n userPreferences?: PreferencesType;\n updateSection: (section?: string) => void;\n activeSection: string;\n closeModal: () => void;\n collapseModal: () => void;\n}\n\nexport type Props = OwnProps & PropsFromRedux;\n\ntype State = {\n settings: Settings;\n isSaving: boolean;\n showDeactivateAccountModal: boolean;\n serverError: string;\n}\n\nexport default class AdvancedSettingsDisplay extends React.PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n\n this.state = this.getStateFromProps();\n }\n\n getStateFromProps = (): State => {\n const settings: Settings = {\n send_on_ctrl_enter: this.props.sendOnCtrlEnter,\n code_block_ctrl_enter: this.props.codeBlockOnCtrlEnter,\n formatting: this.props.formatting,\n join_leave: this.props.joinLeave,\n sync_drafts: this.props.syncDrafts,\n [Preferences.UNREAD_SCROLL_POSITION]: this.props.unreadScrollPosition,\n };\n\n const isSaving = false;\n\n const showDeactivateAccountModal = false;\n\n return {\n settings,\n isSaving,\n showDeactivateAccountModal,\n serverError: '',\n };\n };\n\n updateSetting = (setting: string, value: string, e?: React.ChangeEvent): void => {\n const settings = this.state.settings;\n settings[setting] = value;\n\n this.setState((prevState) => ({...prevState, ...settings}));\n a11yFocus(e?.currentTarget as HTMLElement);\n };\n\n handleSubmit = async (settings: string[]): Promise<void> => {\n if (!this.props.user) {\n return;\n }\n\n const preferences: PreferenceType[] = [];\n const {actions, user} = this.props;\n const userId = user.id;\n\n // this should be refactored so we can actually be certain about what type everything is\n (Array.isArray(settings) ? settings : [settings]).forEach((setting) => {\n preferences.push({\n user_id: userId,\n category: Constants.Preferences.CATEGORY_ADVANCED_SETTINGS,\n name: setting,\n value: this.state.settings[setting]!,\n });\n });\n\n this.setState({isSaving: true});\n await actions.savePreferences(userId, preferences);\n\n this.handleUpdateSection('');\n };\n\n handleDeactivateAccountSubmit = async (): Promise<void> => {\n const userId = this.props.user.id;\n\n this.setState({isSaving: true});\n\n this.props.actions.updateUserActive(userId, false).\n then(({error}) => {\n if (error) {\n this.setState({serverError: error.message});\n }\n });\n\n const {data, error} = await this.props.actions.revokeAllSessionsForUser(userId);\n if (data) {\n emitUserLoggedOutEvent();\n } else if (error) {\n this.setState({serverError: error.message});\n }\n };\n\n handleShowDeactivateAccountModal = (): void => {\n this.setState({\n showDeactivateAccountModal: true,\n });\n };\n\n handleHideDeactivateAccountModal = (): void => {\n this.setState({\n showDeactivateAccountModal: false,\n });\n };\n\n handleUpdateSection = (section?: string): void => {\n if (!section) {\n this.setState(this.getStateFromProps());\n }\n this.setState({isSaving: false});\n this.props.updateSection(section);\n };\n\n // This function changes ctrl to cmd when OS is mac\n getCtrlSendText = () => {\n const description = defineMessages({\n default: {\n id: 'user.settings.advance.sendDesc',\n defaultMessage: 'When enabled, CTRL + ENTER will send the message and ENTER inserts a new line.',\n },\n mac: {\n id: 'user.settings.advance.sendDesc.mac',\n defaultMessage: 'When enabled, ⌘ + ENTER will send the message and ENTER inserts a new line.',\n },\n });\n const title = defineMessages({\n default: {\n id: 'user.settings.advance.sendTitle',\n defaultMessage: 'Send Messages on CTRL+ENTER',\n },\n mac: {\n id: 'user.settings.advance.sendTitle.mac',\n defaultMessage: 'Send Messages on ⌘+ENTER',\n },\n });\n if (isMac()) {\n return {\n ctrlSendTitle: title.mac,\n ctrlSendDesc: description.mac,\n };\n }\n return {\n ctrlSendTitle: title.default,\n ctrlSendDesc: description.default,\n };\n };\n\n renderOnOffLabel(enabled: string): JSX.Element {\n if (enabled === 'false') {\n return (\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.advance.on'\n defaultMessage='On'\n />\n );\n }\n\n renderUnreadScrollPositionLabel(option?: string): JSX.Element {\n if (option === Preferences.UNREAD_SCROLL_POSITION_START_FROM_LEFT) {\n return (\n <FormattedMessage\n id='user.settings.advance.startFromLeftOff'\n defaultMessage='Start me where I left off'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.advance.startFromNewest'\n defaultMessage='Start me at the newest message'\n />\n );\n }\n\n renderCtrlEnterLabel(): JSX.Element {\n const ctrlEnter = this.state.settings.send_on_ctrl_enter;\n const codeBlockCtrlEnter = this.state.settings.code_block_ctrl_enter;\n if (ctrlEnter === 'false' && codeBlockCtrlEnter === 'false') {\n return (\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n );\n } else if (ctrlEnter === 'true' && codeBlockCtrlEnter === 'true') {\n return (\n <FormattedMessage\n id='user.settings.advance.onForAllMessages'\n defaultMessage='On for all messages'\n />\n );\n }\n return (\n <FormattedMessage\n id='user.settings.advance.onForCode'\n defaultMessage='On only for code blocks starting with ```'\n />\n );\n }\n\n renderFormattingSection = () => {\n const active = this.props.activeSection === 'formatting';\n let max = null;\n if (active) {\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.formattingTitle'\n defaultMessage='Enable Post Formatting'\n />\n }\n inputs={[\n <fieldset key='formattingSetting'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage\n id='user.settings.advance.formattingTitle'\n defaultMessage='Enable Post Formatting'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='postFormattingOn'\n type='radio'\n name='formatting'\n checked={this.state.settings.formatting !== 'false'}\n onChange={this.updateSetting.bind(this, 'formatting', 'true')}\n />\n <FormattedMessage\n id='user.settings.advance.on'\n defaultMessage='On'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='postFormattingOff'\n type='radio'\n name='formatting'\n checked={this.state.settings.formatting === 'false'}\n onChange={this.updateSetting.bind(this, 'formatting', 'false')}\n />\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n </label>\n <br/>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.advance.formattingDesc'\n defaultMessage='If enabled, posts will be formatted to create links, show emoji, style the text, and add line breaks. By default, this setting is enabled.'\n />\n </div>\n </fieldset>,\n ]}\n submit={this.handleSubmit.bind(this, ['formatting'])}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.advance.formattingTitle'\n defaultMessage='Enable Post Formatting'\n />\n }\n describe={this.renderOnOffLabel(this.state.settings.formatting)}\n section={'formatting'}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n renderUnreadScrollPositionSection = () => {\n const active = this.props.activeSection === Preferences.UNREAD_SCROLL_POSITION;\n let max = null;\n if (active) {\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.unreadScrollPositionTitle'\n defaultMessage='Scroll position when viewing an unread channel'\n />\n }\n inputs={[\n <fieldset key='unreadScrollPositionSetting'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage\n id='user.settings.advance.unreadScrollPositionTitle'\n defaultMessage='Scroll position when viewing an unread channel'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='unreadPositionStartFromLeftOff'\n type='radio'\n name='unreadScrollPosition'\n checked={this.state.settings.unread_scroll_position === Preferences.UNREAD_SCROLL_POSITION_START_FROM_LEFT}\n onChange={this.updateSetting.bind(this, Preferences.UNREAD_SCROLL_POSITION, Preferences.UNREAD_SCROLL_POSITION_START_FROM_LEFT)}\n />\n <FormattedMessage\n id='user.settings.advance.startFromLeftOff'\n defaultMessage='Start me where I left off'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='unreadPositionStartFromNewest'\n type='radio'\n name='unreadScrollPosition'\n checked={this.state.settings.unread_scroll_position === Preferences.UNREAD_SCROLL_POSITION_START_FROM_NEWEST}\n onChange={this.updateSetting.bind(this, Preferences.UNREAD_SCROLL_POSITION, Preferences.UNREAD_SCROLL_POSITION_START_FROM_NEWEST)}\n />\n <FormattedMessage\n id='user.settings.advance.startFromNewest'\n defaultMessage='Start me at the newest message'\n />\n </label>\n <br/>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.advance.unreadScrollPositionDesc'\n defaultMessage='Choose your scroll position when you view an unread channel. Channels will always be marked as read when viewed.'\n />\n </div>\n </fieldset>,\n ]}\n submit={this.handleSubmit.bind(this, [Preferences.UNREAD_SCROLL_POSITION])}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.advance.unreadScrollPositionTitle'\n defaultMessage='Scroll position when viewing an unread channel'\n />\n }\n describe={this.renderUnreadScrollPositionLabel(this.state.settings[Preferences.UNREAD_SCROLL_POSITION])}\n section={Preferences.UNREAD_SCROLL_POSITION}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n renderSyncDraftsSection = () => {\n const active = this.props.activeSection === AdvancedSections.SYNC_DRAFTS;\n let max = null;\n if (active) {\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.syncDrafts.Title'\n defaultMessage='Allow message drafts to sync with the server'\n />\n }\n inputs={[\n <fieldset key='syncDraftsSetting'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage\n id='user.settings.advance.syncDrafts.Title'\n defaultMessage='Allow message drafts to sync with the server'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='syncDraftsOn'\n type='radio'\n name='syncDrafts'\n checked={this.state.settings.sync_drafts !== 'false'}\n onChange={this.updateSetting.bind(this, 'sync_drafts', 'true')}\n />\n <FormattedMessage\n id='user.settings.advance.on'\n defaultMessage='On'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='syncDraftsOff'\n type='radio'\n name='syncDrafts'\n checked={this.state.settings.sync_drafts === 'false'}\n onChange={this.updateSetting.bind(this, 'sync_drafts', 'false')}\n />\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n </label>\n <br/>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.advance.syncDrafts.Desc'\n defaultMessage='When enabled, message drafts are synced with the server so they can be accessed from any device. When disabled, message drafts are only saved locally on the device where they are composed.'\n />\n </div>\n </fieldset>,\n ]}\n setting={AdvancedSections.SYNC_DRAFTS}\n submit={this.handleSubmit.bind(this, ['sync_drafts'])}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.advance.syncDrafts.Title'\n defaultMessage='Allow message drafts to sync with the server'\n />\n }\n describe={this.renderOnOffLabel(this.state.settings.sync_drafts)}\n section={AdvancedSections.SYNC_DRAFTS}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n renderCtrlSendSection = () => {\n const active = this.props.activeSection === 'advancedCtrlSend';\n const serverError = this.state.serverError || null;\n const {ctrlSendTitle, ctrlSendDesc} = this.getCtrlSendText();\n let max = null;\n if (active) {\n const ctrlSendActive = [\n this.state.settings.send_on_ctrl_enter === 'true',\n this.state.settings.send_on_ctrl_enter === 'false' && this.state.settings.code_block_ctrl_enter === 'true',\n this.state.settings.send_on_ctrl_enter === 'false' && this.state.settings.code_block_ctrl_enter === 'false',\n ];\n\n const inputs = [\n <fieldset key='ctrlSendSetting'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage {...ctrlSendTitle}/>\n </legend>\n <div className='radio'>\n <label>\n <input\n id='ctrlSendOn'\n type='radio'\n name='sendOnCtrlEnter'\n checked={ctrlSendActive[0]}\n onChange={(e) => {\n this.updateSetting('send_on_ctrl_enter', 'true');\n this.updateSetting('code_block_ctrl_enter', 'true');\n a11yFocus(e.currentTarget);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.onForAllMessages'\n defaultMessage='On for all messages'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='ctrlSendOnForCode'\n type='radio'\n name='sendOnCtrlEnter'\n checked={ctrlSendActive[1]}\n onChange={(e) => {\n this.updateSetting('send_on_ctrl_enter', 'false');\n this.updateSetting('code_block_ctrl_enter', 'true');\n a11yFocus(e.currentTarget);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.onForCode'\n defaultMessage='On only for code blocks starting with ```'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='ctrlSendOff'\n type='radio'\n name='sendOnCtrlEnter'\n checked={ctrlSendActive[2]}\n onChange={(e) => {\n this.updateSetting('send_on_ctrl_enter', 'false');\n this.updateSetting('code_block_ctrl_enter', 'false');\n a11yFocus(e.currentTarget);\n }}\n />\n <FormattedMessage\n id='user.settings.advance.off'\n defaultMessage='Off'\n />\n </label>\n <br/>\n </div>\n <div>\n <br/>\n <FormattedMessage {...ctrlSendDesc}/>\n </div>\n </fieldset>,\n ];\n max = (\n <SettingItemMax\n title={\n <FormattedMessage {...ctrlSendTitle}/>\n }\n inputs={inputs}\n submit={this.handleSubmit.bind(this, ['send_on_ctrl_enter', 'code_block_ctrl_enter'])}\n saving={this.state.isSaving}\n serverError={serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage {...ctrlSendTitle}/>\n }\n describe={this.renderCtrlEnterLabel()}\n section={'advancedCtrlSend'}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n render() {\n const ctrlSendSection = this.renderCtrlSendSection();\n\n const formattingSection = this.renderFormattingSection();\n let formattingSectionDivider = null;\n if (formattingSection) {\n formattingSectionDivider = <div className='divider-light'/>;\n }\n\n let deactivateAccountSection: ReactNode = '';\n let makeConfirmationModal: ReactNode = '';\n\n if (this.props.user.auth_service === '' && this.props.enableUserDeactivation && !this.props.adminMode) {\n const active = this.props.activeSection === 'deactivateAccount';\n let max = null;\n if (active) {\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.advance.deactivateAccountTitle'\n defaultMessage='Deactivate Account'\n />\n }\n inputs={[\n <div key='formattingSetting'>\n <div>\n <br/>\n <FormattedMessage\n id='user.settings.advance.deactivateDesc'\n defaultMessage='Deactivating your account removes your ability to log in to this server and disables all email and mobile notifications. To reactivate your account, contact your System Administrator.'\n />\n </div>\n </div>,\n ]}\n saveButtonText={'Deactivate'}\n saveButtonClassName={'btn-danger'}\n setting={'deactivateAccount'}\n submit={this.handleShowDeactivateAccountModal}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n deactivateAccountSection = (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.advance.deactivateAccountTitle'\n defaultMessage='Deactivate Account'\n />\n }\n describe={\n <FormattedMessage\n id='user.settings.advance.deactivateDescShort'\n defaultMessage=\"Click 'Edit' to deactivate your account\"\n />\n }\n section={'deactivateAccount'}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n\n const confirmButtonClass = 'btn btn-danger';\n const deactivateMemberButton = (\n <FormattedMessage\n id='user.settings.advance.deactivate_member_modal.deactivateButton'\n defaultMessage='Yes, deactivate my account'\n />\n );\n\n makeConfirmationModal = (\n <ConfirmModal\n show={this.state.showDeactivateAccountModal}\n title={\n <FormattedMessage\n id='user.settings.advance.confirmDeactivateAccountTitle'\n defaultMessage='Confirm Deactivation'\n />\n }\n message={\n <FormattedMessage\n id='user.settings.advance.confirmDeactivateDesc'\n defaultMessage='Are you sure you want to deactivate your account? This can only be reversed by your System Administrator.'\n />\n }\n confirmButtonClass={confirmButtonClass}\n confirmButtonText={deactivateMemberButton}\n onConfirm={this.handleDeactivateAccountSubmit}\n onCancel={this.handleHideDeactivateAccountModal}\n />\n );\n }\n\n const unreadScrollPositionSection = this.renderUnreadScrollPositionSection();\n let unreadScrollPositionSectionDivider = null;\n if (unreadScrollPositionSection) {\n unreadScrollPositionSectionDivider = <div className='divider-light'/>;\n }\n\n let syncDraftsSection = null;\n let syncDraftsSectionDivider = null;\n if (this.props.syncedDraftsAreAllowed) {\n syncDraftsSection = this.renderSyncDraftsSection();\n if (syncDraftsSection) {\n syncDraftsSectionDivider = <div className='divider-light'/>;\n }\n }\n\n return (\n <div>\n <SettingMobileHeader\n closeModal={this.props.closeModal}\n collapseModal={this.props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.advance.title'\n defaultMessage='Advanced Settings'\n />\n }\n />\n <div className='user-settings'>\n <SettingDesktopHeader\n text={\n <FormattedMessage\n id='user.settings.advance.title'\n defaultMessage='Advanced Settings'\n />\n }\n />\n <div className='divider-dark first'/>\n {ctrlSendSection}\n {formattingSectionDivider}\n {formattingSection}\n <div className='divider-light'/>\n <JoinLeaveSection\n active={this.props.activeSection === AdvancedSections.JOIN_LEAVE}\n areAllSectionsInactive={this.props.activeSection === ''}\n onUpdateSection={this.handleUpdateSection}\n renderOnOffLabel={this.renderOnOffLabel}\n adminMode={this.props.adminMode}\n userPreferences={this.props.userPreferences}\n userId={this.props.user.id}\n />\n <PerformanceDebuggingSection\n active={this.props.activeSection === AdvancedSections.PERFORMANCE_DEBUGGING}\n onUpdateSection={this.handleUpdateSection}\n areAllSectionsInactive={this.props.activeSection === ''}\n adminMode={this.props.adminMode}\n userId={this.props.user.id}\n />\n {unreadScrollPositionSectionDivider}\n {unreadScrollPositionSection}\n {syncDraftsSectionDivider}\n {syncDraftsSection}\n {formattingSectionDivider}\n {deactivateAccountSection}\n <div className='divider-dark'/>\n {makeConfirmationModal}\n </div>\n </div>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ConnectedProps} from 'react-redux';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {updateUserActive, revokeAllSessionsForUser} from 'mattermost-redux/actions/users';\nimport {getConfig} from 'mattermost-redux/selectors/entities/general';\nimport {\n get,\n getUnreadScrollPositionPreference,\n makeGetCategory, makeGetUserCategory,\n syncedDraftsAreAllowed,\n} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUser} from 'mattermost-redux/selectors/entities/users';\n\nimport {Preferences} from 'utils/constants';\n\nimport type {GlobalState} from 'types/store';\n\nimport AdvancedSettingsDisplay from './user_settings_advanced';\nimport type {OwnProps} from './user_settings_advanced';\n\nconst getAdvancedSettingsCategory = makeGetCategory('getAdvancedSettingsCategory', Preferences.CATEGORY_ADVANCED_SETTINGS);\n\nfunction makeMapStateToProps() {\n const getUserAdvancedSettingsCategory = makeGetUserCategory('getAdvancedSettingsCategory', Preferences.CATEGORY_ADVANCED_SETTINGS);\n\n return (state: GlobalState, props: OwnProps) => {\n const config = getConfig(state);\n\n const enableUserDeactivation = config.EnableUserDeactivation === 'true';\n const enableJoinLeaveMessage = config.EnableJoinLeaveMessageByDefault === 'true';\n\n const userPreferences = props.adminMode && props.userPreferences ? props.userPreferences : undefined;\n const advancedSettingsCategory = userPreferences ? getUserAdvancedSettingsCategory(state, props.user.id) : getAdvancedSettingsCategory(state);\n\n return {\n advancedSettingsCategory,\n sendOnCtrlEnter: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter', 'false', userPreferences),\n codeBlockOnCtrlEnter: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'code_block_ctrl_enter', 'true', userPreferences),\n formatting: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'formatting', 'true', userPreferences),\n joinLeave: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'join_leave', enableJoinLeaveMessage.toString(), userPreferences),\n syncDrafts: get(state, Preferences.CATEGORY_ADVANCED_SETTINGS, 'sync_drafts', 'true', userPreferences),\n user: props.adminMode && props.user ? props.user : getCurrentUser(state),\n unreadScrollPosition: getUnreadScrollPositionPreference(state, userPreferences),\n enableUserDeactivation,\n syncedDraftsAreAllowed: syncedDraftsAreAllowed(state),\n };\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n savePreferences,\n updateUserActive,\n revokeAllSessionsForUser,\n }, dispatch),\n };\n}\n\nconst connector = connect(makeMapStateToProps, mapDispatchToProps);\n\nexport type PropsFromRedux = ConnectedProps<typeof connector>;\n\nexport default connector(AdvancedSettingsDisplay);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\n\nimport ColorInput from 'components/color_input';\n\ntype Props = {\n id: string;\n label: React.ReactNode;\n value: string;\n onChange?: (id: string, newColor: string) => void;\n}\n\nexport default function ColorChooser(props: Props) {\n const handleChange = (newColor: string) => {\n props.onChange?.(props.id, newColor);\n };\n\n return (\n <>\n <label className='custom-label'>{props.label}</label>\n <ColorInput\n id={props.id}\n value={props.value}\n onChange={handleChange}\n />\n </>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {createRef} from 'react';\nimport type {ChangeEvent, ClipboardEvent, MouseEvent, RefObject} from 'react';\nimport {defineMessages, FormattedMessage, injectIntl} from 'react-intl';\nimport type {IntlShape, MessageDescriptor} from 'react-intl';\n\nimport type {Theme} from 'mattermost-redux/selectors/entities/preferences';\nimport {setThemeDefaults} from 'mattermost-redux/utils/theme_utils';\n\nimport WithTooltip from 'components/with_tooltip';\n\nimport Constants from 'utils/constants';\n\nimport ColorChooser from '../color_chooser/color_chooser';\n\nconst COPY_SUCCESS_INTERVAL = 3000;\n\nconst messages: Record<string, MessageDescriptor> = defineMessages({\n sidebarBg: {\n id: 'user.settings.custom_theme.sidebarBg',\n defaultMessage: 'Sidebar BG',\n },\n sidebarText: {\n id: 'user.settings.custom_theme.sidebarText',\n defaultMessage: 'Sidebar Text',\n },\n sidebarHeaderBg: {\n id: 'user.settings.custom_theme.sidebarHeaderBg',\n defaultMessage: 'Sidebar Header BG',\n },\n sidebarTeamBarBg: {\n id: 'user.settings.custom_theme.sidebarTeamBarBg',\n defaultMessage: 'Team Sidebar BG',\n },\n sidebarHeaderTextColor: {\n id: 'user.settings.custom_theme.sidebarHeaderTextColor',\n defaultMessage: 'Sidebar Header Text',\n },\n sidebarUnreadText: {\n id: 'user.settings.custom_theme.sidebarUnreadText',\n defaultMessage: 'Sidebar Unread Text',\n },\n sidebarTextHoverBg: {\n id: 'user.settings.custom_theme.sidebarTextHoverBg',\n defaultMessage: 'Sidebar Text Hover BG',\n },\n sidebarTextActiveBorder: {\n id: 'user.settings.custom_theme.sidebarTextActiveBorder',\n defaultMessage: 'Sidebar Text Active Border',\n },\n sidebarTextActiveColor: {\n id: 'user.settings.custom_theme.sidebarTextActiveColor',\n defaultMessage: 'Sidebar Text Active Color',\n },\n onlineIndicator: {\n id: 'user.settings.custom_theme.onlineIndicator',\n defaultMessage: 'Online Indicator',\n },\n awayIndicator: {\n id: 'user.settings.custom_theme.awayIndicator',\n defaultMessage: 'Away Indicator',\n },\n dndIndicator: {\n id: 'user.settings.custom_theme.dndIndicator',\n defaultMessage: 'Do Not Disturb Indicator',\n },\n mentionBg: {\n id: 'user.settings.custom_theme.mentionBg',\n defaultMessage: 'Mention Jewel BG',\n },\n mentionColor: {\n id: 'user.settings.custom_theme.mentionColor',\n defaultMessage: 'Mention Jewel Text',\n },\n centerChannelBg: {\n id: 'user.settings.custom_theme.centerChannelBg',\n defaultMessage: 'Center Channel BG',\n },\n centerChannelColor: {\n id: 'user.settings.custom_theme.centerChannelColor',\n defaultMessage: 'Center Channel Text',\n },\n newMessageSeparator: {\n id: 'user.settings.custom_theme.newMessageSeparator',\n defaultMessage: 'New Message Separator',\n },\n linkColor: {\n id: 'user.settings.custom_theme.linkColor',\n defaultMessage: 'Link Color',\n },\n buttonBg: {\n id: 'user.settings.custom_theme.buttonBg',\n defaultMessage: 'Button BG',\n },\n buttonColor: {\n id: 'user.settings.custom_theme.buttonColor',\n defaultMessage: 'Button Text',\n },\n errorTextColor: {\n id: 'user.settings.custom_theme.errorTextColor',\n defaultMessage: 'Error Text Color',\n },\n mentionHighlightBg: {\n id: 'user.settings.custom_theme.mentionHighlightBg',\n defaultMessage: 'Mention Highlight BG',\n },\n mentionHighlightLink: {\n id: 'user.settings.custom_theme.mentionHighlightLink',\n defaultMessage: 'Mention Highlight Link',\n },\n codeTheme: {\n id: 'user.settings.custom_theme.codeTheme',\n defaultMessage: 'Code Theme',\n },\n});\n\ntype Props = {\n theme: Theme;\n updateTheme: (theme: Theme) => void;\n intl: IntlShape;\n};\n\ntype State = {\n copyTheme: string;\n};\n\nexport class CustomThemeChooser extends React.PureComponent<Props, State> {\n textareaRef: RefObject<HTMLTextAreaElement>;\n sidebarStylesHeaderRef: RefObject<HTMLDivElement>;\n centerChannelStylesHeaderRef: RefObject<HTMLDivElement>;\n linkAndButtonStylesHeaderRef: RefObject<HTMLDivElement>;\n sidebarStylesRef: RefObject<HTMLDivElement>;\n centerChannelStylesRef: RefObject<HTMLDivElement>;\n linkAndButtonStylesRef: RefObject<HTMLDivElement>;\n\n constructor(props: Props) {\n super(props);\n this.textareaRef = createRef();\n this.sidebarStylesHeaderRef = createRef();\n this.centerChannelStylesHeaderRef = createRef();\n this.linkAndButtonStylesHeaderRef = createRef();\n this.sidebarStylesRef = createRef();\n this.centerChannelStylesRef = createRef();\n this.linkAndButtonStylesRef = createRef();\n\n const copyTheme = this.setCopyTheme(this.props.theme);\n\n this.state = {\n copyTheme,\n };\n }\n handleColorChange = (settingId: string, color: string) => {\n const {updateTheme, theme} = this.props;\n if (theme[settingId] !== color) {\n const newTheme: Theme = {\n ...theme,\n type: 'custom',\n [settingId]: color,\n };\n\n // For backwards compatability\n if (settingId === 'mentionBg') {\n newTheme.mentionBj = color;\n }\n\n updateTheme(newTheme);\n\n const copyTheme = this.setCopyTheme(newTheme);\n\n this.setState({\n copyTheme,\n });\n }\n };\n\n setCopyTheme(theme: Theme) {\n const copyTheme = Object.assign({}, theme);\n delete copyTheme.type;\n delete copyTheme.image;\n\n return JSON.stringify(copyTheme);\n }\n\n pasteBoxChange = (e: ClipboardEvent<HTMLTextAreaElement>) => {\n let text = '';\n\n if ((window as any).clipboardData && (window as any).clipboardData.getData) { // IE\n text = (window as any).clipboardData.getData('Text');\n } else {\n text = e.clipboardData.getData('Text');//e.clipboardData.getData('text/plain');\n }\n\n if (text.length === 0) {\n return;\n }\n\n let theme;\n try {\n theme = JSON.parse(text);\n } catch (err) {\n return;\n }\n\n theme = setThemeDefaults(theme);\n\n this.setState({\n copyTheme: JSON.stringify(theme),\n });\n\n theme.type = 'custom';\n this.props.updateTheme(theme);\n };\n\n onChangeHandle = (e: ChangeEvent<HTMLTextAreaElement>) => e.stopPropagation();\n\n selectTheme = () => {\n this.textareaRef.current?.focus();\n this.textareaRef.current?.setSelectionRange(0, this.state.copyTheme.length);\n };\n\n toggleSidebarStyles = (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n this.sidebarStylesHeaderRef.current?.classList.toggle('open');\n this.toggleSection(this.sidebarStylesRef.current);\n };\n\n toggleCenterChannelStyles = (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n this.centerChannelStylesHeaderRef.current?.classList.toggle('open');\n this.toggleSection(this.centerChannelStylesRef.current);\n };\n\n toggleLinkAndButtonStyles = (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n this.linkAndButtonStylesHeaderRef.current?.classList.toggle('open');\n this.toggleSection(this.linkAndButtonStylesRef.current);\n };\n\n toggleSection(node: HTMLElement | null) {\n if (!node) {\n return;\n }\n node.classList.toggle('open');\n\n // set overflow after animation, so the colorchooser is fully shown\n node.ontransitionend = () => {\n if (node.classList.contains('open')) {\n node.style.overflowY = 'inherit';\n } else {\n node.style.overflowY = 'hidden';\n }\n };\n }\n\n onCodeThemeChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n const theme: Theme = {\n ...this.props.theme,\n type: 'custom',\n codeTheme: e.target.value,\n };\n\n this.props.updateTheme(theme);\n };\n\n copyTheme = () => {\n this.selectTheme();\n document.execCommand('copy');\n this.showCopySuccess();\n };\n\n showCopySuccess = () => {\n const copySuccess: HTMLElement | null = document.querySelector('.copy-theme-success');\n if (copySuccess) {\n copySuccess.style.display = 'inline-block';\n setTimeout(() => {\n copySuccess.style.display = 'none';\n }, COPY_SUCCESS_INTERVAL);\n }\n };\n\n render() {\n const {intl, theme} = this.props;\n const sidebarElements: JSX.Element[] = [];\n const centerChannelElements: JSX.Element[] = [];\n const linkAndButtonElements: JSX.Element[] = [];\n Constants.THEME_ELEMENTS.forEach((element, index) => {\n if (element.id === 'codeTheme') {\n const codeThemeOptions: JSX.Element[] = [];\n let codeThemeURL = '';\n\n element.themes?.forEach((codeTheme, codeThemeIndex) => {\n if (codeTheme.id === theme[element.id]) {\n codeThemeURL = codeTheme.iconURL;\n }\n codeThemeOptions.push(\n <option\n key={'code-theme-key' + codeThemeIndex}\n value={codeTheme.id}\n >\n {codeTheme.uiName}\n </option>,\n );\n });\n\n centerChannelElements.push(\n <div\n className='col-sm-6 form-group'\n key={'custom-theme-key' + index}\n >\n <label\n className='custom-label'\n htmlFor='codeThemeSelect'\n >\n <FormattedMessage {...messages[element.id]}/>\n </label>\n <div\n className='input-group theme-group group--code dropdown'\n id={element.id}\n >\n <select\n id='codeThemeSelect'\n className='form-control'\n defaultValue={theme[element.id]}\n onChange={this.onCodeThemeChange}\n >\n {codeThemeOptions}\n </select>\n <WithTooltip\n title={\n <div className='code-popover'>\n <img\n width='200'\n alt={'code theme image'}\n src={codeThemeURL}\n />\n </div>\n }\n >\n <span className='input-group-addon'>\n <img\n alt={'code theme image'}\n src={codeThemeURL}\n />\n </span>\n </WithTooltip>\n </div>\n </div>,\n );\n } else if (element.group === 'centerChannelElements') {\n centerChannelElements.push(\n <div\n className='col-sm-6 form-group element'\n key={'custom-theme-key' + index}\n >\n <ColorChooser\n id={element.id}\n label={<FormattedMessage {...messages[element.id]}/>}\n value={theme[element.id] || ''}\n onChange={this.handleColorChange}\n />\n </div>,\n );\n } else if (element.group === 'sidebarElements') {\n // Need to support old typo mentionBj element for mentionBg\n let color = theme[element.id];\n if (!color && element.id === 'mentionBg') {\n color = theme.mentionBj;\n }\n\n sidebarElements.push(\n <div\n className='col-sm-6 form-group element'\n key={'custom-theme-key' + index}\n >\n <ColorChooser\n id={element.id}\n label={<FormattedMessage {...messages[element.id]}/>}\n value={color || ''}\n onChange={this.handleColorChange}\n />\n </div>,\n );\n } else {\n linkAndButtonElements.push(\n <div\n className='col-sm-6 form-group element'\n key={'custom-theme-key' + index}\n >\n <ColorChooser\n id={element.id}\n label={<FormattedMessage {...messages[element.id]}/>}\n value={theme[element.id] || ''}\n onChange={this.handleColorChange}\n />\n </div>,\n );\n }\n });\n\n const pasteBox = (\n <div className='col-sm-12'>\n <label\n className='custom-label'\n htmlFor='pasteBox'\n >\n <FormattedMessage\n id='user.settings.custom_theme.copyPaste'\n defaultMessage='Copy to share or paste theme colors here:'\n />\n </label>\n <textarea\n ref={this.textareaRef}\n className='form-control'\n id='pasteBox'\n value={this.state.copyTheme}\n onCopy={this.showCopySuccess}\n onPaste={this.pasteBoxChange}\n onChange={this.onChangeHandle}\n onClick={this.selectTheme}\n />\n <div className='mt-3'>\n <button\n className='btn btn-tertiary'\n onClick={this.copyTheme}\n >\n <FormattedMessage\n id='user.settings.custom_theme.copyThemeColors'\n defaultMessage='Copy Theme Colors'\n />\n </button>\n <span\n className='alert alert-success copy-theme-success'\n role='alert'\n style={{display: 'none'}}\n >\n <FormattedMessage\n id='user.settings.custom_theme.copied'\n defaultMessage='✔ Copied'\n />\n </span>\n </div>\n </div>\n );\n\n return (\n <div className='appearance-section pt-2'>\n <div className='theme-elements row'>\n <div\n ref={this.sidebarStylesHeaderRef}\n id='sidebarStyles'\n className='theme-elements__header'\n onClick={this.toggleSidebarStyles}\n >\n <FormattedMessage\n id='user.settings.custom_theme.sidebarTitle'\n defaultMessage='Sidebar Styles'\n />\n <div className='header__icon'>\n <i\n className='fa fa-plus'\n title={intl.formatMessage({id: 'generic_icons.expand', defaultMessage: 'Expand Icon'})}\n />\n <i\n className='fa fa-minus'\n title={intl.formatMessage({id: 'generic_icons.collapse', defaultMessage: 'Collapse Icon'})}\n />\n </div>\n </div>\n <div\n ref={this.sidebarStylesRef}\n className='theme-elements__body'\n >\n {sidebarElements}\n </div>\n </div>\n <div className='theme-elements row'>\n <div\n ref={this.centerChannelStylesHeaderRef}\n id='centerChannelStyles'\n className='theme-elements__header'\n onClick={this.toggleCenterChannelStyles}\n >\n <FormattedMessage\n id='user.settings.custom_theme.centerChannelTitle'\n defaultMessage='Center Channel Styles'\n />\n <div className='header__icon'>\n <i\n className='fa fa-plus'\n title={intl.formatMessage({id: 'generic_icons.expand', defaultMessage: 'Expand Icon'})}\n />\n <i\n className='fa fa-minus'\n title={intl.formatMessage({id: 'generic_icons.collapse', defaultMessage: 'Collapse Icon'})}\n />\n </div>\n </div>\n <div\n ref={this.centerChannelStylesRef}\n id='centerChannelStyles'\n className='theme-elements__body'\n >\n {centerChannelElements}\n </div>\n </div>\n <div className='theme-elements row'>\n <div\n ref={this.linkAndButtonStylesHeaderRef}\n id='linkAndButtonsStyles'\n className='theme-elements__header'\n onClick={this.toggleLinkAndButtonStyles}\n >\n <FormattedMessage\n id='user.settings.custom_theme.linkButtonTitle'\n defaultMessage='Link and Button Styles'\n />\n <div className='header__icon'>\n <i\n className='fa fa-plus'\n title={intl.formatMessage({id: 'generic_icons.expand', defaultMessage: 'Expand Icon'})}\n />\n <i\n className='fa fa-minus'\n title={intl.formatMessage({id: 'generic_icons.collapse', defaultMessage: 'Collapse Icon'})}\n />\n </div>\n </div>\n <div\n ref={this.linkAndButtonStylesRef}\n className='theme-elements__body'\n >\n {linkAndButtonElements}\n </div>\n </div>\n <div className='row mt-3'>\n {pasteBox}\n </div>\n </div>\n );\n }\n}\n\nexport default injectIntl(CustomThemeChooser);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable react/jsx-max-props-per-line */\n\nimport React from 'react';\n\ntype ThemeThumbnailProps = {\n themeName?: string;\n themeKey: string;\n sidebarBg: string;\n sidebarText: string;\n sidebarUnreadText: string;\n onlineIndicator: string;\n awayIndicator: string;\n dndIndicator: string;\n centerChannelColor: string;\n centerChannelBg: string;\n newMessageSeparator: string;\n buttonBg: string;\n}\n\nfunction ThemeThumbnail({\n themeName,\n themeKey,\n sidebarBg = '#174AB5',\n sidebarText = '#86A1D9',\n sidebarUnreadText = 'white',\n onlineIndicator = '#3DB887',\n awayIndicator = '#FFBC1F',\n dndIndicator = '#D24B4E',\n centerChannelColor = '#E0E1E3',\n centerChannelBg = 'white',\n newMessageSeparator = '#1C58D9',\n buttonBg = '#15B7B7',\n}: ThemeThumbnailProps): JSX.Element {\n return (\n <svg width='112' height='86' viewBox='0 0 112 86' fill='none' xmlns='http://www.w3.org/2000/svg' aria-labelledby={`${themeKey}-theme-icon`} role='img'>\n <title id={`${themeKey}-theme-icon`}>{`${themeName} theme icon`}</title>\n <rect style={{fill: centerChannelBg}} x='0' y='0' width='112' height='86'/>\n <g>\n <rect style={{fill: centerChannelBg}} x='50' y='-1' width='63' height='88'/>\n <g>\n <rect style={{fill: centerChannelColor}} x='55' y='75' width='52' height='6' rx='3'/>\n <rect style={{fill: centerChannelBg}} x='56' y='76' width='50' height='4' rx='2'/>\n </g>\n <rect style={{fill: buttonBg}} x='71' y='65' width='22' height='5' rx='2.5'/>\n <rect style={{fill: newMessageSeparator}} x='50' y='32' width='62' height='1'/>\n <g style={{fill: centerChannelColor}}>\n <rect x='55' y='5' width='52' height='4' rx='2'/>\n <rect x='55' y='14' width='52' height='4' rx='2'/>\n <rect x='55' y='23' width='52' height='4' rx='2'/>\n <rect x='55' y='38' width='52' height='4' rx='2'/>\n <rect x='55' y='47' width='52' height='4' rx='2'/>\n <rect x='55' y='56' width='52' height='4' rx='2'/>\n </g>\n </g>\n <g>\n <rect style={{fill: sidebarBg}} x='-1' y='-1' width='51' height='88'/>\n <g style={{fill: sidebarText}}>\n <circle cx='7' cy='61' r='2'/>\n <circle cx='7' cy='70' r='2'/>\n <circle cx='7' cy='43' r='2'/>\n <circle cx='7' cy='34' r='2'/>\n <circle cx='7' cy='16' r='2'/>\n <circle cx='7' cy='7' r='2'/>\n <rect x='11' y='5' width='28' height='4' rx='2'/>\n <rect x='11' y='14' width='28' height='4' rx='2'/>\n <rect x='11' y='32' width='28' height='4' rx='2'/>\n <rect x='11' y='41' width='28' height='4' rx='2'/>\n <rect x='11' y='50' width='28' height='4' rx='2'/>\n <rect x='11' y='59' width='28' height='4' rx='2'/>\n <rect x='11' y='68' width='28' height='4' rx='2'/>\n <rect x='11' y='77' width='28' height='4' rx='2'/>\n </g>\n <circle style={{fill: dndIndicator}} cx='7' cy='79' r='2'/>\n <circle style={{fill: awayIndicator}} cx='7' cy='52' r='2'/>\n <circle style={{fill: onlineIndicator}} cx='7' cy='25' r='2'/>\n <g style={{fill: sidebarUnreadText}}>\n <circle cx='43' cy='25' r='2'/>\n <rect x='11' y='23' width='28' height='4' rx='2'/>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default ThemeThumbnail;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\n\nimport {Preferences} from 'mattermost-redux/constants';\nimport type {Theme, ThemeKey} from 'mattermost-redux/selectors/entities/preferences';\nimport {changeOpacity} from 'mattermost-redux/utils/theme_utils';\n\nimport {toTitleCase} from 'utils/utils';\n\nimport ThemeThumbnail from '../theme_thumbnail';\n\ntype Props = {\n theme: Theme;\n updateTheme: (theme: Theme) => void;\n allowedThemes: string[];\n}\n\nconst PremadeThemeChooser = ({theme, updateTheme, allowedThemes = []}: Props) => {\n const premadeThemes = [];\n const hasAllowedThemes = allowedThemes.length > 1 || (allowedThemes[0] && allowedThemes[0].trim().length > 0);\n\n for (const k in Preferences.THEMES) {\n if (Object.hasOwn(Preferences.THEMES, k)) {\n if (hasAllowedThemes && allowedThemes.indexOf(k) < 0) {\n continue;\n }\n\n const premadeTheme: Theme = Object.assign({}, Preferences.THEMES[k as ThemeKey]);\n\n let activeClass = '';\n if (premadeTheme.type === theme.type) {\n activeClass = 'active';\n }\n\n premadeThemes.push(\n <div\n className='col-xs-6 col-sm-3 premade-themes'\n key={'premade-theme-key' + k}\n >\n <div\n id={`premadeTheme${premadeTheme.type?.replace(' ', '')}`}\n className={activeClass}\n onClick={() => updateTheme(premadeTheme)}\n >\n <label>\n <ThemeThumbnail\n themeKey={k}\n themeName={premadeTheme.type}\n sidebarBg={premadeTheme.sidebarBg}\n sidebarText={changeOpacity(premadeTheme.sidebarText, 0.48)}\n sidebarUnreadText={premadeTheme.sidebarUnreadText}\n onlineIndicator={premadeTheme.onlineIndicator}\n awayIndicator={premadeTheme.awayIndicator}\n dndIndicator={premadeTheme.dndIndicator}\n centerChannelColor={changeOpacity(premadeTheme.centerChannelColor, 0.16)}\n centerChannelBg={premadeTheme.centerChannelBg}\n newMessageSeparator={premadeTheme.newMessageSeparator}\n buttonBg={premadeTheme.buttonBg}\n />\n <div className='theme-label'>{toTitleCase(premadeTheme.type || '')}</div>\n </label>\n </div>\n </div>,\n );\n }\n }\n\n return (\n <div className='row appearance-section'>\n <div className='clearfix'>\n {premadeThemes}\n </div>\n </div>\n );\n};\n\nexport default PremadeThemeChooser;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {getConfig} from 'mattermost-redux/selectors/entities/general';\n\nimport type {GlobalState} from 'types/store';\n\nimport PremadeThemeChooser from './premade_theme_chooser';\n\nfunction mapStateToProps(state: GlobalState) {\n const config = getConfig(state);\n\n const allowedThemes = (config.AllowedThemes && config.AllowedThemes.split(',')) || [];\n\n return {\n allowedThemes,\n };\n}\n\nexport default connect(mapStateToProps)(PremadeThemeChooser);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {Theme} from 'mattermost-redux/selectors/entities/preferences';\n\nimport ExternalLink from 'components/external_link';\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {Constants} from 'utils/constants';\nimport {applyTheme} from 'utils/utils';\n\nimport type {ModalData} from 'types/actions';\n\nimport CustomThemeChooser from './custom_theme_chooser/custom_theme_chooser';\nimport PremadeThemeChooser from './premade_theme_chooser';\n\ntype Props = {\n currentTeamId: string;\n theme: Theme;\n selected: boolean;\n areAllSectionsInactive: boolean;\n updateSection: (section: string) => void;\n setRequireConfirm?: (requireConfirm: boolean) => void;\n allowCustomThemes: boolean;\n showAllTeamsCheckbox: boolean;\n applyToAllTeams: boolean;\n actions: {\n saveTheme: (teamId: string, theme: Theme) => void;\n deleteTeamSpecificThemes: () => void;\n openModal: <P>(modalData: ModalData<P>) => void;\n };\n};\n\ntype State = {\n isSaving: boolean;\n type: string;\n showAllTeamsCheckbox: boolean;\n applyToAllTeams: boolean;\n serverError: string;\n theme: Theme;\n};\n\nexport default class ThemeSetting extends React.PureComponent<Props, State> {\n minRef: RefObject<SettingItemMinComponent>;\n originalTheme: Theme;\n constructor(props: Props) {\n super(props);\n\n this.state = {\n ...this.getStateFromProps(props),\n isSaving: false,\n serverError: '',\n };\n\n this.originalTheme = Object.assign({}, this.state.theme);\n this.minRef = React.createRef();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.selected && !this.props.selected) {\n this.resetFields();\n }\n if (prevProps.selected && !this.props.selected && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n componentWillUnmount() {\n if (this.props.selected) {\n applyTheme(this.props.theme);\n }\n }\n\n getStateFromProps(props = this.props): State {\n const theme = {...props.theme};\n if (!theme.codeTheme) {\n theme.codeTheme = Constants.DEFAULT_CODE_THEME;\n }\n\n return {\n theme,\n type: theme.type || 'premade',\n showAllTeamsCheckbox: props.showAllTeamsCheckbox,\n applyToAllTeams: props.applyToAllTeams,\n serverError: '',\n isSaving: false,\n };\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n submitTheme = async (): Promise<void> => {\n const teamId = this.state.applyToAllTeams ? '' : this.props.currentTeamId;\n\n this.setState({isSaving: true});\n\n await this.props.actions.saveTheme(teamId, this.state.theme);\n\n if (this.state.applyToAllTeams) {\n await this.props.actions.deleteTeamSpecificThemes();\n }\n\n this.props.setRequireConfirm?.(false);\n this.originalTheme = Object.assign({}, this.state.theme);\n this.props.updateSection('');\n this.setState({isSaving: false});\n };\n\n updateTheme = (theme: Theme): void => {\n let themeChanged = this.state.theme.length === theme.length;\n if (!themeChanged) {\n for (const field in theme) {\n if (Object.hasOwn(theme, field)) {\n if (this.state.theme[field] !== theme[field]) {\n themeChanged = true;\n break;\n }\n }\n }\n }\n\n this.props.setRequireConfirm?.(themeChanged);\n\n this.setState({theme});\n applyTheme(theme);\n };\n\n updateType = (type: string): void => this.setState({type});\n\n resetFields = (): void => {\n const state = this.getStateFromProps();\n state.serverError = '';\n this.setState(state);\n\n applyTheme(state.theme);\n\n this.props.setRequireConfirm?.(false);\n };\n\n handleUpdateSection = (section: string): void => this.props.updateSection(section);\n\n render() {\n let serverError;\n if (this.state.serverError) {\n serverError = this.state.serverError;\n }\n\n const displayCustom = this.state.type === 'custom';\n\n let custom;\n let premade;\n if (displayCustom && this.props.allowCustomThemes) {\n custom = (\n <div key='customThemeChooser'>\n <CustomThemeChooser\n theme={this.state.theme}\n updateTheme={this.updateTheme}\n />\n </div>\n );\n } else {\n premade = (\n <div key='premadeThemeChooser'>\n <br/>\n <PremadeThemeChooser\n theme={this.state.theme}\n updateTheme={this.updateTheme}\n />\n </div>\n );\n }\n\n let themeUI;\n if (this.props.selected) {\n const inputs = [];\n\n if (this.props.allowCustomThemes) {\n inputs.push(\n <div\n className='radio'\n key='premadeThemeColorLabel'\n >\n <label>\n <input\n id='standardThemes'\n type='radio'\n name='theme'\n checked={!displayCustom}\n onChange={this.updateType.bind(this, 'premade')}\n />\n <FormattedMessage\n id='user.settings.display.theme.themeColors'\n defaultMessage='Theme Colors'\n />\n </label>\n <br/>\n </div>,\n );\n }\n\n inputs.push(premade);\n\n if (this.props.allowCustomThemes) {\n inputs.push(\n <div\n className='radio'\n key='customThemeColorLabel'\n >\n <label>\n <input\n id='customThemes'\n type='radio'\n name='theme'\n checked={displayCustom}\n onChange={this.updateType.bind(this, 'custom')}\n />\n <FormattedMessage\n id='user.settings.display.theme.customTheme'\n defaultMessage='Custom Theme'\n />\n </label>\n </div>,\n );\n\n inputs.push(custom);\n\n inputs.push(\n <div key='otherThemes'>\n <br/>\n <ExternalLink\n id='otherThemes'\n href='http://docs.mattermost.com/help/settings/theme-colors.html#custom-theme-examples'\n location='user_settings_theme'\n >\n <FormattedMessage\n id='user.settings.display.theme.otherThemes'\n defaultMessage='See other themes'\n />\n </ExternalLink>\n </div>,\n );\n }\n\n let allTeamsCheckbox = null;\n if (this.state.showAllTeamsCheckbox) {\n allTeamsCheckbox = (\n <div className='checkbox user-settings__submit-checkbox'>\n <label>\n <input\n id='applyThemeToAllTeams'\n type='checkbox'\n checked={this.state.applyToAllTeams}\n onChange={(e) => this.setState({applyToAllTeams: e.target.checked})}\n />\n <FormattedMessage\n id='user.settings.display.theme.applyToAllTeams'\n defaultMessage='Apply new theme to all my teams'\n />\n </label>\n </div>\n );\n }\n\n themeUI = (\n <SettingItemMax\n inputs={inputs}\n submitExtra={allTeamsCheckbox}\n submit={this.submitTheme}\n disableEnterSubmit={true}\n saving={this.state.isSaving}\n serverError={serverError}\n isFullWidth={true}\n updateSection={this.handleUpdateSection}\n />\n );\n } else {\n themeUI = (\n <SettingItemMin\n title={\n <FormattedMessage\n id='user.settings.display.theme.title'\n defaultMessage='Theme'\n />\n }\n describe={\n <FormattedMessage\n id='user.settings.display.theme.describe'\n defaultMessage='Open to manage your theme'\n />\n }\n section={'theme'}\n updateSection={this.handleUpdateSection}\n ref={this.minRef}\n />\n );\n }\n\n return themeUI;\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {saveTheme, deleteTeamSpecificThemes} from 'mattermost-redux/actions/preferences';\nimport {getTheme, getThemePreferences} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentTeamId, getMyTeamsCount} from 'mattermost-redux/selectors/entities/teams';\n\nimport {openModal} from 'actions/views/modals';\n\nimport type {GlobalState} from 'types/store';\n\nimport UserSettingsTheme from './user_settings_theme';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n currentTeamId: getCurrentTeamId(state),\n theme: getTheme(state),\n applyToAllTeams: getThemePreferences(state).length <= 1,\n showAllTeamsCheckbox: getMyTeamsCount(state) > 1,\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n saveTheme,\n deleteTeamSpecificThemes,\n openModal,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserSettingsTheme);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage, injectIntl} from 'react-intl';\nimport type {IntlShape} from 'react-intl';\nimport ReactSelect from 'react-select';\nimport type {ValueType} from 'react-select';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport ExternalLink from 'components/external_link';\nimport SettingItemMax from 'components/setting_item_max';\n\nimport type {Language} from 'i18n/i18n';\nimport Constants from 'utils/constants';\nimport {isKeyPressed} from 'utils/keyboard';\n\ntype Actions = {\n updateMe: (user: UserProfile) => Promise<ActionResult>;\n patchUser: (user: UserProfile) => Promise<ActionResult>;\n};\n\ntype Props = {\n intl: IntlShape;\n user: UserProfile;\n locale: string;\n locales: Record<string, Language>;\n updateSection: (section: string) => void;\n actions: Actions;\n adminMode?: boolean;\n};\n\ntype SelectedOption = {\n value: string;\n label: string;\n}\n\ntype State = {\n isSaving: boolean;\n openMenu: boolean;\n locale: string;\n serverError?: string;\n selectedOption: SelectedOption;\n};\n\nexport class ManageLanguage extends React.PureComponent<Props, State> {\n reactSelectContainer: React.RefObject<HTMLDivElement>;\n constructor(props: Props) {\n super(props);\n const userLocale = props.locale;\n const selectedOption = {\n value: props.locales[userLocale].value,\n label: props.locales[userLocale].name,\n };\n this.reactSelectContainer = React.createRef();\n\n this.state = {\n locale: props.locale,\n selectedOption,\n isSaving: false,\n openMenu: false,\n };\n }\n\n componentDidMount() {\n const reactSelectContainer = this.reactSelectContainer.current;\n if (reactSelectContainer) {\n reactSelectContainer.addEventListener(\n 'keydown',\n this.handleContainerKeyDown,\n );\n }\n }\n\n componentWillUnmount() {\n if (this.reactSelectContainer.current) {\n this.reactSelectContainer.current.removeEventListener(\n 'keydown',\n this.handleContainerKeyDown,\n );\n }\n }\n\n handleContainerKeyDown = (e: KeyboardEvent) => {\n const modalBody = document.querySelector('.modal-body');\n if (isKeyPressed(e, Constants.KeyCodes.ESCAPE) && this.state.openMenu) {\n modalBody?.classList.remove('no-scroll');\n this.setState({openMenu: false});\n e.stopPropagation();\n }\n };\n\n handleKeyDown = (e: React.KeyboardEvent) => {\n const modalBody = document.querySelector('.modal-body');\n if (isKeyPressed(e, Constants.KeyCodes.ENTER)) {\n modalBody?.classList.add('no-scroll');\n this.setState({openMenu: true});\n }\n };\n\n setLanguage = (selectedOption: ValueType<SelectedOption>) => {\n if (selectedOption && 'value' in selectedOption) {\n this.setState({\n locale: selectedOption.value,\n selectedOption,\n });\n }\n };\n\n changeLanguage = () => {\n if (this.props.user.locale === this.state.locale) {\n this.props.updateSection('');\n } else {\n this.submitUser({\n ...this.props.user,\n locale: this.state.locale,\n });\n }\n };\n\n submitUser = (user: UserProfile) => {\n this.setState({isSaving: true});\n\n const action = this.props.adminMode ? this.props.actions.patchUser : this.props.actions.updateMe;\n action(user).then((res) => {\n if ('data' in res) {\n this.setState({isSaving: false});\n } else if ('error' in res) {\n let serverError;\n const {error} = res;\n if (error instanceof Error) {\n serverError = error.message;\n } else {\n serverError = error;\n }\n this.setState({serverError, isSaving: false});\n }\n });\n };\n\n handleMenuClose = () => {\n const modalBody = document.querySelector('.modal-body');\n if (modalBody) {\n modalBody.classList.remove('no-scroll');\n }\n this.setState({openMenu: false});\n };\n\n handleMenuOpen = () => {\n const modalBody = document.querySelector('.modal-body');\n if (modalBody) {\n modalBody.classList.add('no-scroll');\n }\n this.setState({openMenu: true});\n };\n\n render() {\n const {intl, locales} = this.props;\n\n let serverError;\n if (this.state.serverError) {\n serverError = (\n <label className='has-error'>{this.state.serverError}</label>\n );\n }\n\n const options: SelectedOption[] = [];\n\n const languages = Object.keys(locales).\n map((l) => {\n return {\n value: locales[l].value as string,\n name: locales[l].name,\n order: locales[l].order,\n };\n }).\n sort((a, b) => a.order - b.order);\n\n languages.forEach((lang) => {\n options.push({value: lang.value, label: lang.name});\n });\n\n const reactStyles = {\n menuPortal: (provided: React.CSSProperties) => ({\n ...provided,\n zIndex: 9999,\n }),\n };\n const interfaceLanguageLabelAria = intl.formatMessage({id: 'user.settings.languages.dropdown.arialabel', defaultMessage: 'Dropdown selector to change the interface language'});\n\n const input = (\n <div key='changeLanguage'>\n <br/>\n <label\n aria-label={interfaceLanguageLabelAria}\n className='control-label'\n id='changeInterfaceLanguageLabel'\n htmlFor='displayLanguage'\n >\n <FormattedMessage\n id='user.settings.languages.change'\n defaultMessage='Change interface language'\n />\n </label>\n <div\n ref={this.reactSelectContainer}\n className='pt-2'\n >\n <ReactSelect\n className='react-select react-select-top'\n classNamePrefix='react-select'\n id='displayLanguage'\n menuIsOpen={this.state.openMenu}\n menuPortalTarget={document.body}\n styles={reactStyles}\n options={options}\n clearable={false}\n onChange={this.setLanguage}\n onKeyDown={this.handleKeyDown}\n value={this.state.selectedOption}\n onMenuClose={this.handleMenuClose}\n onMenuOpen={this.handleMenuOpen}\n aria-labelledby='changeInterfaceLanguageLabel'\n />\n {serverError}\n </div>\n <div>\n <br/>\n <FormattedMessage\n id='user.settings.languages.promote1'\n defaultMessage='Select which language Mattermost displays in the user interface.'\n />\n <p/>\n <FormattedMessage\n id='user.settings.languages.promote2'\n defaultMessage='Would you like to help with translations? Join the <link>Mattermost Translation Server</link> to contribute.'\n values={{\n link: (msg: React.ReactNode) => (\n <ExternalLink\n href='http://translate.mattermost.com'\n location='manage_languages'\n >\n {msg}\n </ExternalLink>\n ),\n }}\n />\n </div>\n </div>\n );\n\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.display.language'\n defaultMessage='Language'\n />\n }\n submit={this.changeLanguage}\n saving={this.state.isSaving}\n inputs={[input]}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\nexport default injectIntl(ManageLanguage);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {patchUser, updateMe} from 'mattermost-redux/actions/users';\n\nimport {getLanguages} from 'i18n/i18n';\n\nimport type {GlobalState} from 'types/store';\n\nimport ManageLanguages from './manage_languages';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n locales: getLanguages(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n updateMe,\n patchUser,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ManageLanguages);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport ReactSelect from 'react-select';\nimport type {ValueType} from 'react-select';\nimport type {Timezone} from 'timezones.json';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\nimport {getTimezoneLabel} from 'mattermost-redux/utils/timezone_utils';\n\nimport SettingItemMax from 'components/setting_item_max';\n\nimport {getBrowserTimezone} from 'utils/timezone';\n\ntype Actions = {\n updateMe: (user: UserProfile) => Promise<ActionResult>;\n patchUser: (user: UserProfile) => Promise<ActionResult>;\n}\n\ntype Props = {\n user: UserProfile;\n updateSection: (section: string) => void;\n useAutomaticTimezone: boolean;\n automaticTimezone: string;\n manualTimezone: string;\n timezones: Timezone[];\n timezoneLabel: string;\n actions: Actions;\n adminMode?: boolean;\n}\ntype SelectedOption = {\n value: string;\n label: string;\n}\n\ntype State = {\n useAutomaticTimezone: boolean;\n automaticTimezone: string;\n manualTimezone: string;\n isSaving: boolean;\n serverError?: string;\n openMenu: boolean;\n selectedOption: SelectedOption;\n}\n\nexport default class ManageTimezones extends React.PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {\n useAutomaticTimezone: props.useAutomaticTimezone,\n automaticTimezone: props.automaticTimezone,\n manualTimezone: props.manualTimezone,\n isSaving: false,\n openMenu: false,\n selectedOption: {label: props.timezoneLabel, value: props.useAutomaticTimezone ? props.automaticTimezone : props.manualTimezone},\n };\n }\n\n onChange = (selectedOption: ValueType<SelectedOption>) => {\n if (selectedOption && 'value' in selectedOption) {\n this.setState({\n manualTimezone: selectedOption.value,\n selectedOption,\n });\n }\n };\n\n timezoneNotChanged = () => {\n const {\n useAutomaticTimezone,\n automaticTimezone,\n manualTimezone,\n } = this.state;\n\n const {\n useAutomaticTimezone: oldUseAutomaticTimezone,\n automaticTimezone: oldAutomaticTimezone,\n manualTimezone: oldManualTimezone,\n } = this.props;\n\n return (\n useAutomaticTimezone === oldUseAutomaticTimezone &&\n automaticTimezone === oldAutomaticTimezone &&\n manualTimezone === oldManualTimezone\n );\n };\n\n changeTimezone = () => {\n if (this.timezoneNotChanged()) {\n this.props.updateSection('');\n return;\n }\n\n this.submitUser();\n };\n\n submitUser = () => {\n const {user} = this.props;\n const {useAutomaticTimezone, automaticTimezone, manualTimezone} = this.state;\n\n const timezone = {\n useAutomaticTimezone: useAutomaticTimezone.toString(),\n automaticTimezone,\n manualTimezone,\n };\n\n const updatedUser = {\n ...user,\n timezone,\n };\n\n const action = this.props.adminMode ? this.props.actions.patchUser : this.props.actions.updateMe;\n action(updatedUser).\n then((res) => {\n if ('data' in res) {\n this.props.updateSection('');\n } else if ('error' in res) {\n const {error} = res;\n let serverError;\n if (error instanceof Error) {\n serverError = error.message;\n } else {\n serverError = error as string;\n }\n this.setState({serverError, isSaving: false});\n }\n });\n };\n\n handleAutomaticTimezone = (e: React.ChangeEvent<HTMLInputElement>) => {\n const useAutomaticTimezone = e.target.checked;\n let automaticTimezone = '';\n let timezoneLabel: string;\n let selectedOptionValue: string;\n\n if (useAutomaticTimezone) {\n automaticTimezone = getBrowserTimezone();\n timezoneLabel = getTimezoneLabel(this.props.timezones, automaticTimezone);\n selectedOptionValue = automaticTimezone;\n } else {\n timezoneLabel = getTimezoneLabel(this.props.timezones, getBrowserTimezone());\n selectedOptionValue = getBrowserTimezone();\n this.setState({\n manualTimezone: getBrowserTimezone(),\n });\n }\n\n this.setState({\n useAutomaticTimezone,\n automaticTimezone,\n selectedOption: {label: timezoneLabel, value: selectedOptionValue},\n });\n };\n\n render() {\n const {timezones} = this.props;\n const {useAutomaticTimezone} = this.state;\n\n let index = 0;\n let previousTimezone: Timezone;\n\n const timeOptions = this.props.timezones.map((timeObject) => {\n if (timeObject.utc[index] === previousTimezone?.utc[index]) {\n index++;\n } else {\n // It's safe to use the first item since consecutive timezones\n // don't have the same 'utc' array.\n index = index === 0 ? index : 0;\n }\n\n previousTimezone = timeObject;\n\n // Some more context on why different 'utc' items are used can be found here.\n // https://github.com/mattermost/mattermost/pull/29290#issuecomment-2478492626\n return {\n value: timeObject.utc[index],\n label: timeObject.text,\n };\n });\n\n let serverError;\n if (this.state.serverError) {\n serverError = <label className='has-error'>{this.state.serverError}</label>;\n }\n\n const inputs = [];\n\n // These are passed to the 'key' prop and should all be unique.\n const inputId = {\n automaticTimezoneInput: 1,\n manualTimezoneInput: 2,\n message: 3,\n };\n\n const reactStyles = {\n\n menuPortal: (provided: React.CSSProperties) => ({\n ...provided,\n zIndex: 9999,\n }),\n\n };\n\n const noTimezonesFromServer = timezones.length === 0;\n const automaticTimezoneInput = (\n <div\n className='checkbox'\n key={inputId.automaticTimezoneInput}\n >\n <label>\n <input\n id='automaticTimezoneInput'\n type='checkbox'\n checked={useAutomaticTimezone}\n onChange={this.handleAutomaticTimezone}\n disabled={noTimezonesFromServer}\n />\n <FormattedMessage\n id='user.settings.timezones.automatic'\n defaultMessage='Automatic'\n />\n\n </label>\n </div>\n );\n\n const manualTimezoneInput = (\n <div\n className='pt-2'\n key={inputId.manualTimezoneInput}\n >\n <ReactSelect\n className='react-select react-select-top'\n classNamePrefix='react-select'\n id='displayTimezone'\n menuPortalTarget={document.body}\n styles={reactStyles}\n options={timeOptions}\n clearable={false}\n onChange={this.onChange}\n value={this.state.selectedOption}\n aria-labelledby='changeInterfaceTimezoneLabel'\n isDisabled={useAutomaticTimezone}\n />\n {serverError}\n </div>\n );\n\n inputs.push(automaticTimezoneInput);\n\n inputs.push(manualTimezoneInput);\n\n inputs.push(\n <div key={inputId.message}>\n <br/>\n <FormattedMessage\n id='user.settings.timezones.promote'\n defaultMessage='Select the time zone used for timestamps in the user interface and email notifications.'\n />\n </div>,\n );\n\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.display.timezone'\n defaultMessage='Timezone'\n />\n }\n containerStyle='timezone-container'\n submit={this.changeTimezone}\n saving={this.state.isSaving}\n inputs={inputs}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\nimport timezones from 'timezones.json';\n\nimport type {GlobalState} from '@mattermost/types/store';\n\nimport {patchUser, updateMe} from 'mattermost-redux/actions/users';\nimport {getCurrentTimezoneLabel} from 'mattermost-redux/selectors/entities/timezone';\n\nimport ManageTimezones from './manage_timezones';\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n updateMe,\n patchUser,\n }, dispatch),\n };\n}\nfunction mapStateToProps(state: GlobalState) {\n const timezoneLabel = getCurrentTimezoneLabel(state);\n return {\n timezones,\n timezoneLabel,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(ManageTimezones);\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable max-lines */\n\nimport deepEqual from 'fast-deep-equal';\nimport React from 'react';\nimport type {MessageDescriptor} from 'react-intl';\nimport {FormattedMessage, defineMessage} from 'react-intl';\nimport type {Timezone} from 'timezones.json';\n\nimport type {PreferencesType, PreferenceType} from '@mattermost/types/preferences';\nimport type {UserProfile, UserTimezone} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport {trackEvent} from 'actions/telemetry_actions';\n\nimport SettingItem from 'components/setting_item';\nimport SettingItemMax from 'components/setting_item_max';\nimport ThemeSetting from 'components/user_settings/display/user_settings_theme';\n\nimport {getLanguageInfo} from 'i18n/i18n';\nimport type {Language} from 'i18n/i18n';\nimport Constants from 'utils/constants';\nimport {getBrowserTimezone} from 'utils/timezone';\nimport {a11yFocus} from 'utils/utils';\n\nimport ManageLanguages from './manage_languages';\nimport ManageTimezones from './manage_timezones';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nconst Preferences = Constants.Preferences;\n\nfunction getDisplayStateFromProps(props: Props) {\n return {\n militaryTime: props.militaryTime,\n teammateNameDisplay: props.teammateNameDisplay,\n availabilityStatusOnPosts: props.availabilityStatusOnPosts,\n channelDisplayMode: props.channelDisplayMode,\n messageDisplay: props.messageDisplay,\n colorizeUsernames: props.colorizeUsernames,\n collapseDisplay: props.collapseDisplay,\n collapsedReplyThreads: props.collapsedReplyThreads,\n linkPreviewDisplay: props.linkPreviewDisplay,\n lastActiveDisplay: props.lastActiveDisplay.toString(),\n oneClickReactionsOnPosts: props.oneClickReactionsOnPosts,\n clickToReply: props.clickToReply,\n };\n}\n\ntype ChildOption = {\n label: MessageDescriptor;\n value: string;\n display: string;\n more: MessageDescriptor;\n};\n\ntype Option = {\n value: string;\n radionButtonText: {\n label: MessageDescriptor;\n more?: MessageDescriptor;\n };\n childOption?: ChildOption;\n}\n\ntype SectionProps ={\n section: string;\n display: string;\n defaultDisplay: string;\n value: string;\n title: MessageDescriptor;\n firstOption: Option;\n secondOption: Option;\n thirdOption?: Option;\n description: MessageDescriptor;\n disabled?: boolean;\n onSubmit?: () => void;\n}\n\nexport type OwnProps = {\n user: UserProfile;\n adminMode?: boolean;\n userPreferences?: PreferencesType;\n}\n\ntype Props = OwnProps & {\n user: UserProfile;\n updateSection: (section: string) => void;\n activeSection?: string;\n closeModal: () => void;\n collapseModal: () => void;\n setRequireConfirm?: () => void;\n timezones: Timezone[];\n userTimezone: UserTimezone;\n allowCustomThemes: boolean;\n enableLinkPreviews: boolean;\n locales: Record<string, Language>;\n userLocale: string;\n enableThemeSelection: boolean;\n configTeammateNameDisplay: string;\n shouldAutoUpdateTimezone: boolean | string;\n lockTeammateNameDisplay: boolean;\n militaryTime: string;\n teammateNameDisplay: string;\n availabilityStatusOnPosts: string;\n channelDisplayMode: string;\n messageDisplay: string;\n colorizeUsernames: string;\n collapseDisplay: string;\n collapsedReplyThreads: string;\n collapsedReplyThreadsAllowUserPreference: boolean;\n clickToReply: string;\n linkPreviewDisplay: string;\n oneClickReactionsOnPosts: string;\n emojiPickerEnabled: boolean;\n timezoneLabel: string;\n lastActiveDisplay: boolean;\n lastActiveTimeEnabled: boolean;\n actions: {\n savePreferences: (userId: string, preferences: PreferenceType[]) => void;\n autoUpdateTimezone: (deviceTimezone: string) => void;\n updateMe: (user: UserProfile) => Promise<ActionResult>;\n patchUser: (user: UserProfile) => Promise<ActionResult>;\n };\n}\n\ntype State = {\n [key: string]: any;\n isSaving: boolean;\n militaryTime: string;\n teammateNameDisplay: string;\n availabilityStatusOnPosts: string;\n channelDisplayMode: string;\n messageDisplay: string;\n colorizeUsernames: string;\n collapseDisplay: string;\n collapsedReplyThreads: string;\n linkPreviewDisplay: string;\n lastActiveDisplay: string;\n oneClickReactionsOnPosts: string;\n clickToReply: string;\n handleSubmit?: () => void;\n serverError?: string;\n}\n\nexport default class UserSettingsDisplay extends React.PureComponent<Props, State> {\n public prevSections: {\n theme: string;\n\n clock: string;\n linkpreview: string;\n message_display: string;\n channel_display_mode: string;\n languages: string;\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n ...getDisplayStateFromProps(props),\n isSaving: false,\n };\n\n this.prevSections = {\n theme: 'dummySectionName', // dummy value that should never match any section name\n clock: 'theme',\n linkpreview: 'clock',\n message_display: 'linkpreview',\n channel_display_mode: 'message_display',\n languages: 'channel_display_mode',\n };\n }\n\n componentDidMount() {\n const {actions, shouldAutoUpdateTimezone} = this.props;\n\n if (shouldAutoUpdateTimezone) {\n actions.autoUpdateTimezone(getBrowserTimezone());\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n if (this.props.teammateNameDisplay !== prevProps.teammateNameDisplay) {\n this.updateState();\n }\n }\n\n trackChangeIfNecessary(preference: PreferenceType, oldValue: any): void {\n const props = {\n field: 'display.' + preference.name,\n value: preference.value,\n };\n\n if (preference.value !== oldValue) {\n trackEvent('settings', 'user_settings_update', props);\n }\n }\n\n submitLastActive = () => {\n const {user, actions} = this.props;\n const {lastActiveDisplay} = this.state;\n\n const updatedUser = {\n ...user,\n props: {\n ...user.props,\n show_last_active: lastActiveDisplay,\n },\n };\n\n const action = this.props.adminMode ? actions.patchUser : actions.updateMe;\n action(updatedUser).\n then((res) => {\n if ('data' in res) {\n this.props.updateSection('');\n } else if ('error' in res) {\n const {error} = res;\n let serverError;\n if (error instanceof Error) {\n serverError = error.message;\n } else {\n serverError = error as string;\n }\n this.setState({serverError, isSaving: false});\n }\n });\n };\n\n handleSubmit = async () => {\n const userId = this.props.user.id;\n\n const timePreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.USE_MILITARY_TIME,\n value: this.state.militaryTime,\n };\n const availabilityStatusOnPostsPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.AVAILABILITY_STATUS_ON_POSTS,\n value: this.state.availabilityStatusOnPosts,\n };\n const teammateNameDisplayPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.NAME_NAME_FORMAT,\n value: this.state.teammateNameDisplay,\n };\n const channelDisplayModePreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.CHANNEL_DISPLAY_MODE,\n value: this.state.channelDisplayMode,\n };\n const messageDisplayPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.MESSAGE_DISPLAY,\n value: this.state.messageDisplay,\n };\n const colorizeUsernamesPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.COLORIZE_USERNAMES,\n value: this.state.colorizeUsernames,\n };\n const collapseDisplayPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.COLLAPSE_DISPLAY,\n value: this.state.collapseDisplay,\n };\n const collapsedReplyThreadsPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.COLLAPSED_REPLY_THREADS,\n value: this.state.collapsedReplyThreads,\n };\n const linkPreviewDisplayPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.LINK_PREVIEW_DISPLAY,\n value: this.state.linkPreviewDisplay,\n };\n const oneClickReactionsOnPostsPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.ONE_CLICK_REACTIONS_ENABLED,\n value: this.state.oneClickReactionsOnPosts,\n };\n const clickToReplyPreference = {\n user_id: userId,\n category: Preferences.CATEGORY_DISPLAY_SETTINGS,\n name: Preferences.CLICK_TO_REPLY,\n value: this.state.clickToReply,\n };\n\n this.setState({isSaving: true});\n\n const preferences = [\n timePreference,\n channelDisplayModePreference,\n messageDisplayPreference,\n collapsedReplyThreadsPreference,\n clickToReplyPreference,\n collapseDisplayPreference,\n linkPreviewDisplayPreference,\n teammateNameDisplayPreference,\n availabilityStatusOnPostsPreference,\n oneClickReactionsOnPostsPreference,\n colorizeUsernamesPreference,\n ];\n\n this.trackChangeIfNecessary(collapsedReplyThreadsPreference, this.props.collapsedReplyThreads);\n\n await this.props.actions.savePreferences(userId, preferences);\n\n this.updateSection('');\n };\n\n handleClockRadio = (militaryTime: string) => {\n this.setState({militaryTime});\n };\n\n handleTeammateNameDisplayRadio = (teammateNameDisplay: string) => {\n this.setState({teammateNameDisplay});\n };\n\n handleAvailabilityStatusRadio = (availabilityStatusOnPosts: string) => {\n this.setState({availabilityStatusOnPosts});\n };\n\n handleChannelDisplayModeRadio(channelDisplayMode: string) {\n this.setState({channelDisplayMode});\n }\n\n handlemessageDisplayRadio(messageDisplay: string) {\n this.setState({messageDisplay});\n }\n\n handleCollapseRadio(collapseDisplay: string) {\n this.setState({collapseDisplay});\n }\n\n handleCollapseReplyThreadsRadio(collapsedReplyThreads: string) {\n this.setState({collapsedReplyThreads});\n }\n\n handleLastActiveRadio(lastActiveDisplay: string) {\n this.setState({lastActiveDisplay});\n }\n\n handleLinkPreviewRadio(linkPreviewDisplay: string) {\n this.setState({linkPreviewDisplay});\n }\n\n handleOneClickReactionsRadio = (oneClickReactionsOnPosts: string) => {\n this.setState({oneClickReactionsOnPosts});\n };\n\n handleClickToReplyRadio = (clickToReply: string) => {\n this.setState({clickToReply});\n };\n\n handleOnChange(e: React.ChangeEvent, display: {[key: string]: any}) {\n this.setState({...display});\n a11yFocus(e.currentTarget as HTMLElement);\n }\n\n updateSection = (section: string) => {\n this.updateState();\n this.props.updateSection(section);\n };\n\n updateState = () => {\n const newState = getDisplayStateFromProps(this.props);\n if (!deepEqual(newState, this.state)) {\n this.setState(newState);\n }\n\n this.setState({isSaving: false});\n };\n\n createSection(props: SectionProps) {\n const {\n section,\n display,\n value,\n title,\n firstOption,\n secondOption,\n thirdOption,\n description,\n disabled,\n onSubmit,\n } = props;\n let extraInfo = null;\n let submit: (() => Promise<void>) | (() => void) | null = onSubmit || this.handleSubmit;\n\n const firstMessage = (\n <FormattedMessage\n id={firstOption.radionButtonText.label.id}\n defaultMessage={firstOption.radionButtonText.label.defaultMessage}\n />\n );\n\n let moreColon;\n let firstMessageMore;\n if (firstOption.radionButtonText.more?.id) {\n moreColon = ': ';\n firstMessageMore = (\n <span className='font-weight--normal'>\n <FormattedMessage\n id={firstOption.radionButtonText.more.id}\n defaultMessage={firstOption.radionButtonText.more.defaultMessage}\n />\n </span>\n );\n }\n\n const secondMessage = (\n <FormattedMessage\n id={secondOption.radionButtonText.label.id}\n defaultMessage={secondOption.radionButtonText.label.defaultMessage}\n />\n );\n\n let secondMessageMore;\n if (secondOption.radionButtonText.more?.id) {\n secondMessageMore = (\n <span className='font-weight--normal'>\n <FormattedMessage\n id={secondOption.radionButtonText.more.id}\n defaultMessage={secondOption.radionButtonText.more.defaultMessage}\n />\n </span>\n );\n }\n\n let thirdMessage;\n if (thirdOption) {\n thirdMessage = (\n <FormattedMessage\n id={thirdOption.radionButtonText.label.id}\n defaultMessage={thirdOption.radionButtonText.label.defaultMessage}\n />\n );\n }\n\n const messageTitle = (\n <FormattedMessage\n id={title.id}\n defaultMessage={title.defaultMessage}\n />\n );\n\n const messageDesc = (\n <FormattedMessage\n id={description.id}\n defaultMessage={description.defaultMessage}\n />\n );\n\n const active = this.props.activeSection === section;\n let max = null;\n if (active) {\n const format = [false, false, false];\n let childOptionToShow: ChildOption | undefined;\n if (value === firstOption.value) {\n format[0] = true;\n childOptionToShow = firstOption.childOption;\n } else if (value === secondOption.value) {\n format[1] = true;\n childOptionToShow = secondOption.childOption;\n } else {\n format[2] = true;\n if (thirdOption) {\n childOptionToShow = thirdOption.childOption;\n }\n }\n\n const name = section + 'Format';\n const key = section + 'UserDisplay';\n\n const firstDisplay = {\n [display]: firstOption.value,\n };\n\n const secondDisplay = {\n [display]: secondOption.value,\n };\n\n let thirdSection;\n if (thirdOption && thirdMessage) {\n const thirdDisplay = {\n [display]: thirdOption.value,\n };\n\n thirdSection = (\n <div className='radio'>\n <label>\n <input\n id={name + 'C'}\n type='radio'\n name={name}\n checked={format[2]}\n onChange={(e) => this.handleOnChange(e, thirdDisplay)}\n />\n {thirdMessage}\n </label>\n <br/>\n </div>\n );\n }\n\n let childOptionSection;\n if (childOptionToShow) {\n const childDisplay = childOptionToShow.display;\n childOptionSection = (\n <div className='checkbox'>\n <hr/>\n <label>\n <input\n id={name + 'childOption'}\n type='checkbox'\n name={childOptionToShow.label.id}\n checked={childOptionToShow.value === 'true'}\n onChange={(e) => {\n this.handleOnChange(e, {[childDisplay]: e.target.checked ? 'true' : 'false'});\n }}\n />\n <FormattedMessage\n id={childOptionToShow.label.id}\n defaultMessage={childOptionToShow.label.defaultMessage}\n />\n {moreColon}\n <span className='font-weight--normal'>\n <FormattedMessage\n id={childOptionToShow.more.id}\n defaultMessage={childOptionToShow.more.defaultMessage}\n />\n </span>\n </label>\n <br/>\n </div>\n );\n }\n\n let inputs = [\n <fieldset key={key}>\n <legend className='form-legend hidden-label'>\n {messageTitle}\n </legend>\n <div className='radio'>\n <label>\n <input\n id={name + 'A'}\n type='radio'\n name={name}\n checked={format[0]}\n onChange={(e) => this.handleOnChange(e, firstDisplay)}\n />\n {firstMessage}\n {moreColon}\n {firstMessageMore}\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id={name + 'B'}\n type='radio'\n name={name}\n checked={format[1]}\n onChange={(e) => this.handleOnChange(e, secondDisplay)}\n />\n {secondMessage}\n {moreColon}\n {secondMessageMore}\n </label>\n <br/>\n </div>\n {thirdSection}\n <div>\n <br/>\n {messageDesc}\n </div>\n {childOptionSection}\n </fieldset>,\n ];\n\n if (display === 'teammateNameDisplay' && disabled) {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.display.teammateNameDisplay'\n defaultMessage='This field is handled through your System Administrator. If you want to change it, you need to do so through your System Administrator.'\n />\n </span>\n );\n submit = null;\n inputs = [];\n }\n max = (\n <SettingItemMax\n title={messageTitle}\n inputs={inputs}\n submit={submit}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n extraInfo={extraInfo}\n updateSection={this.updateSection}\n />);\n }\n\n let describe;\n if (value === firstOption.value) {\n describe = firstMessage;\n } else if (value === secondOption.value) {\n describe = secondMessage;\n } else {\n describe = thirdMessage;\n }\n\n return (\n <div>\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={messageTitle}\n describe={describe}\n section={section}\n updateSection={this.updateSection}\n max={max}\n />\n <div className='divider-dark'/>\n </div>\n );\n }\n\n render() {\n const collapseSection = this.createSection({\n section: 'collapse',\n display: 'collapseDisplay',\n value: this.state.collapseDisplay,\n defaultDisplay: 'false',\n title: defineMessage({\n id: 'user.settings.display.collapseDisplay',\n defaultMessage: 'Default Appearance of Image Previews',\n }),\n firstOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.collapseOn',\n defaultMessage: 'Expanded',\n }),\n },\n },\n secondOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.collapseOff',\n defaultMessage: 'Collapsed',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.collapseDesc',\n defaultMessage: 'Set whether previews of image links and image attachment thumbnails show as expanded or collapsed by default. This setting can also be controlled using the slash commands /expand and /collapse.',\n }),\n });\n\n let linkPreviewSection = null;\n\n if (this.props.enableLinkPreviews) {\n linkPreviewSection = this.createSection({\n section: 'linkpreview',\n display: 'linkPreviewDisplay',\n value: this.state.linkPreviewDisplay,\n defaultDisplay: 'true',\n title: defineMessage({\n id: 'user.settings.display.linkPreviewDisplay',\n defaultMessage: 'Website Link Previews',\n }),\n firstOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.linkPreviewOn',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.linkPreviewOff',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.linkPreviewDesc',\n defaultMessage: 'When available, the first web link in a message will show a preview of the website content below the message.',\n }),\n });\n this.prevSections.message_display = 'linkpreview';\n } else {\n this.prevSections.message_display = this.prevSections.linkpreview;\n }\n\n let lastActiveSection = null;\n\n if (this.props.lastActiveTimeEnabled) {\n lastActiveSection = this.createSection({\n section: 'lastactive',\n display: 'lastActiveDisplay',\n value: this.state.lastActiveDisplay,\n defaultDisplay: 'true',\n title: defineMessage({\n id: 'user.settings.display.lastActiveDisplay',\n defaultMessage: 'Share last active time',\n }),\n firstOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.lastActiveOn',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.lastActiveOff',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.lastActiveDesc',\n defaultMessage: 'When enabled, other users will see when you were last active.',\n }),\n onSubmit: this.submitLastActive,\n });\n }\n\n const clockSection = this.createSection({\n section: 'clock',\n display: 'militaryTime',\n value: this.state.militaryTime,\n defaultDisplay: 'false',\n title: defineMessage({\n id: 'user.settings.display.clockDisplay',\n defaultMessage: 'Clock Display',\n }),\n firstOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.normalClock',\n defaultMessage: '12-hour clock (example: 4:00 PM)',\n }),\n },\n },\n secondOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.militaryClock',\n defaultMessage: '24-hour clock (example: 16:00)',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.preferTime',\n defaultMessage: 'Select how you prefer time displayed.',\n }),\n });\n\n const teammateNameDisplaySection = this.createSection({\n section: Preferences.NAME_NAME_FORMAT,\n display: 'teammateNameDisplay',\n value: this.props.lockTeammateNameDisplay ? this.props.configTeammateNameDisplay : this.state.teammateNameDisplay,\n defaultDisplay: this.props.configTeammateNameDisplay,\n title: defineMessage({\n id: 'user.settings.display.teammateNameDisplayTitle',\n defaultMessage: 'Teammate Name Display',\n }),\n firstOption: {\n value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_USERNAME,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.teammateNameDisplayUsername',\n defaultMessage: 'Show username',\n }),\n },\n },\n secondOption: {\n value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_NICKNAME_FULLNAME,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.teammateNameDisplayNicknameFullname',\n defaultMessage: 'Show nickname if one exists, otherwise show first and last name',\n }),\n },\n },\n thirdOption: {\n value: Constants.TEAMMATE_NAME_DISPLAY.SHOW_FULLNAME,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.teammateNameDisplayFullname',\n defaultMessage: 'Show first and last name',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.teammateNameDisplayDescription',\n defaultMessage: 'Set how to display other user\\'s names in posts and the Direct Messages list.',\n }),\n disabled: this.props.lockTeammateNameDisplay,\n });\n\n const availabilityStatusOnPostsSection = this.createSection({\n section: 'availabilityStatus',\n display: 'availabilityStatusOnPosts',\n value: this.state.availabilityStatusOnPosts,\n defaultDisplay: 'true',\n title: defineMessage({\n id: 'user.settings.display.availabilityStatusOnPostsTitle',\n defaultMessage: 'Show user availability on posts',\n }),\n firstOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.on',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.off',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.availabilityStatusOnPostsDescription',\n defaultMessage: 'When enabled, online availability is displayed on profile images in the message list.',\n }),\n });\n\n let timezoneSelection;\n if (!this.props.shouldAutoUpdateTimezone) {\n const userTimezone = this.props.userTimezone;\n const active = this.props.activeSection === 'timezone';\n let max = null;\n if (active) {\n max = (\n <ManageTimezones\n user={this.props.user}\n useAutomaticTimezone={Boolean(userTimezone.useAutomaticTimezone)}\n automaticTimezone={userTimezone.automaticTimezone}\n manualTimezone={userTimezone.manualTimezone}\n updateSection={this.updateSection}\n adminMode={this.props.adminMode}\n />\n );\n }\n timezoneSelection = (\n <div>\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.display.timezone'\n defaultMessage='Timezone'\n />\n }\n describe={this.props.timezoneLabel}\n section={'timezone'}\n updateSection={this.updateSection}\n max={max}\n />\n <div className='divider-dark'/>\n </div>\n );\n }\n\n const messageDisplaySection = this.createSection({\n section: Preferences.MESSAGE_DISPLAY,\n display: 'messageDisplay',\n value: this.state.messageDisplay,\n defaultDisplay: Preferences.MESSAGE_DISPLAY_CLEAN,\n title: defineMessage({\n id: 'user.settings.display.messageDisplayTitle',\n defaultMessage: 'Message Display',\n }),\n firstOption: {\n value: Preferences.MESSAGE_DISPLAY_CLEAN,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.messageDisplayClean',\n defaultMessage: 'Standard',\n }),\n more: defineMessage({\n id: 'user.settings.display.messageDisplayCleanDes',\n defaultMessage: 'Easy to scan and read.',\n }),\n },\n },\n secondOption: {\n value: Preferences.MESSAGE_DISPLAY_COMPACT,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.messageDisplayCompact',\n defaultMessage: 'Compact',\n }),\n more: defineMessage({\n id: 'user.settings.display.messageDisplayCompactDes',\n defaultMessage: 'Fit as many messages on the screen as we can.',\n }),\n },\n childOption: {\n label: defineMessage({\n id: 'user.settings.display.colorize',\n defaultMessage: 'Colorize usernames',\n }),\n value: this.state.colorizeUsernames,\n display: 'colorizeUsernames',\n more: defineMessage({\n id: 'user.settings.display.colorizeDes',\n defaultMessage: 'Use colors to distinguish users in compact mode',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.messageDisplayDescription',\n defaultMessage: 'Select how messages in a channel should be displayed.',\n }),\n });\n\n let collapsedReplyThreads;\n\n if (this.props.collapsedReplyThreadsAllowUserPreference) {\n collapsedReplyThreads = this.createSection({\n section: Preferences.COLLAPSED_REPLY_THREADS,\n display: 'collapsedReplyThreads',\n value: this.state.collapsedReplyThreads,\n defaultDisplay: Preferences.COLLAPSED_REPLY_THREADS_FALLBACK_DEFAULT,\n title: defineMessage({\n id: 'user.settings.display.collapsedReplyThreadsTitle',\n defaultMessage: 'Threaded Discussions',\n }),\n firstOption: {\n value: Preferences.COLLAPSED_REPLY_THREADS_ON,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.collapsedReplyThreadsOn',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: Preferences.COLLAPSED_REPLY_THREADS_OFF,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.collapsedReplyThreadsOff',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.collapsedReplyThreadsDescription',\n defaultMessage: 'When enabled, reply messages are not shown in the channel and you\\'ll be notified about threads you\\'re following in the \"Threads\" view.',\n }),\n });\n }\n\n const clickToReply = this.createSection({\n section: Preferences.CLICK_TO_REPLY,\n display: 'clickToReply',\n value: this.state.clickToReply,\n defaultDisplay: 'true',\n title: defineMessage({\n id: 'user.settings.display.clickToReply',\n defaultMessage: 'Click to open threads',\n }),\n firstOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.on',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.off',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.clickToReplyDescription',\n defaultMessage: 'When enabled, click anywhere on a message to open the reply thread.',\n }),\n });\n\n const channelDisplayModeSection = this.createSection({\n section: Preferences.CHANNEL_DISPLAY_MODE,\n display: 'channelDisplayMode',\n value: this.state.channelDisplayMode,\n defaultDisplay: Preferences.CHANNEL_DISPLAY_MODE_FULL_SCREEN,\n title: defineMessage({\n id: 'user.settings.display.channelDisplayTitle',\n defaultMessage: 'Channel Display',\n }),\n firstOption: {\n value: Preferences.CHANNEL_DISPLAY_MODE_FULL_SCREEN,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.fullScreen',\n defaultMessage: 'Full width',\n }),\n },\n },\n secondOption: {\n value: Preferences.CHANNEL_DISPLAY_MODE_CENTERED,\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.display.fixedWidthCentered',\n defaultMessage: 'Fixed width, centered',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.channeldisplaymode',\n defaultMessage: 'Select the width of the center channel.',\n }),\n });\n\n let languagesSection;\n const userLocale = this.props.userLocale;\n const localeName = getLanguageInfo(userLocale).name;\n\n languagesSection = (\n <div>\n <SettingItem\n active={this.props.activeSection === 'languages'}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.display.language'\n defaultMessage='Language'\n />\n }\n describe={localeName}\n section={'languages'}\n updateSection={this.updateSection}\n max={(\n <ManageLanguages\n user={this.props.user}\n locale={userLocale}\n updateSection={this.updateSection}\n adminMode={this.props.adminMode}\n />\n )}\n />\n <div className='divider-dark'/>\n </div>\n );\n\n if (Object.keys(this.props.locales).length === 1) {\n languagesSection = null;\n }\n\n let themeSection;\n if (this.props.enableThemeSelection && !this.props.adminMode) {\n themeSection = (\n <div>\n <ThemeSetting\n selected={this.props.activeSection === 'theme'}\n areAllSectionsInactive={this.props.activeSection === ''}\n updateSection={this.updateSection}\n setRequireConfirm={this.props.setRequireConfirm}\n allowCustomThemes={this.props.allowCustomThemes}\n />\n <div className='divider-dark'/>\n </div>\n );\n }\n\n let oneClickReactionsOnPostsSection;\n if (this.props.emojiPickerEnabled) {\n oneClickReactionsOnPostsSection = this.createSection({\n section: Preferences.ONE_CLICK_REACTIONS_ENABLED,\n display: 'oneClickReactionsOnPosts',\n value: this.state.oneClickReactionsOnPosts,\n defaultDisplay: 'true',\n title: defineMessage({\n id: 'user.settings.display.oneClickReactionsOnPostsTitle',\n defaultMessage: 'Quick reactions on messages',\n }),\n firstOption: {\n value: 'true',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.on',\n defaultMessage: 'On',\n }),\n },\n },\n secondOption: {\n value: 'false',\n radionButtonText: {\n label: defineMessage({\n id: 'user.settings.sidebar.off',\n defaultMessage: 'Off',\n }),\n },\n },\n description: defineMessage({\n id: 'user.settings.display.oneClickReactionsOnPostsDescription',\n defaultMessage: 'When enabled, you can react in one-click with recently used reactions when hovering over a message.',\n }),\n });\n }\n\n return (\n <div id='displaySettings'>\n <SettingMobileHeader\n closeModal={this.props.closeModal}\n collapseModal={this.props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.display.title'\n defaultMessage='Display Settings'\n />\n }\n />\n <div className='user-settings'>\n <SettingDesktopHeader\n id='displaySettingsTitle'\n text={\n <FormattedMessage\n id='user.settings.display.title'\n defaultMessage='Display Settings'\n />\n }\n />\n <div className='divider-dark first'/>\n {themeSection}\n {collapsedReplyThreads}\n {clockSection}\n {teammateNameDisplaySection}\n {availabilityStatusOnPostsSection}\n {lastActiveSection}\n {timezoneSelection}\n {linkPreviewSection}\n {collapseSection}\n {messageDisplaySection}\n {clickToReply}\n {channelDisplayModeSection}\n {oneClickReactionsOnPostsSection}\n {languagesSection}\n </div>\n </div>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\nimport timezones from 'timezones.json';\n\nimport {CollapsedThreads} from '@mattermost/types/config';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {autoUpdateTimezone} from 'mattermost-redux/actions/timezone';\nimport {patchUser, updateMe} from 'mattermost-redux/actions/users';\nimport {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';\nimport {\n get,\n isCollapsedThreadsAllowed,\n getCollapsedThreadsPreference,\n} from 'mattermost-redux/selectors/entities/preferences';\nimport {\n generateCurrentTimezoneLabel,\n getCurrentTimezoneFull,\n getCurrentTimezoneLabel,\n getTimezoneForUserProfile,\n} from 'mattermost-redux/selectors/entities/timezone';\nimport {getCurrentUserId, getUser} from 'mattermost-redux/selectors/entities/users';\nimport {getUserCurrentTimezone} from 'mattermost-redux/utils/timezone_utils';\n\nimport {getLanguages, isLanguageAvailable} from 'i18n/i18n';\nimport {Preferences} from 'utils/constants';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './user_settings_display';\nimport UserSettingsDisplay from './user_settings_display';\n\nexport function makeMapStateToProps() {\n return (state: GlobalState, props: OwnProps) => {\n const config = getConfig(state);\n const currentUserId = getCurrentUserId(state);\n const userTimezone = props.adminMode ? getTimezoneForUserProfile(props.user) : getCurrentTimezoneFull(state);\n const automaticTimezoneNotSet = userTimezone && userTimezone.useAutomaticTimezone && !userTimezone.automaticTimezone;\n const shouldAutoUpdateTimezone = !userTimezone || automaticTimezoneNotSet;\n const timezoneLabel = props.adminMode ? generateCurrentTimezoneLabel(getUserCurrentTimezone(userTimezone)) : getCurrentTimezoneLabel(state);\n const allowCustomThemes = config.AllowCustomThemes === 'true';\n const enableLinkPreviews = config.EnableLinkPreviews === 'true';\n const enableThemeSelection = config.EnableThemeSelection === 'true';\n const lockTeammateNameDisplay = getLicense(state).LockTeammateNameDisplay === 'true' && config.LockTeammateNameDisplay === 'true';\n const configTeammateNameDisplay = config.TeammateNameDisplay as string;\n const emojiPickerEnabled = config.EnableEmojiPicker === 'true';\n const lastActiveTimeEnabled = config.EnableLastActiveTime === 'true';\n const userPreference = props.adminMode && props.userPreferences ? props.userPreferences : undefined;\n\n let lastActiveDisplay = true;\n const user = props.adminMode ? props.user : getUser(state, currentUserId);\n if (user.props?.show_last_active === 'false') {\n lastActiveDisplay = false;\n }\n\n let userLocale = props.user.locale;\n if (!isLanguageAvailable(state, userLocale)) {\n userLocale = config.DefaultClientLocale as string;\n }\n\n return {\n lockTeammateNameDisplay,\n allowCustomThemes,\n configTeammateNameDisplay,\n enableLinkPreviews,\n locales: getLanguages(state),\n userLocale,\n enableThemeSelection,\n timezones,\n timezoneLabel,\n userTimezone,\n shouldAutoUpdateTimezone,\n availabilityStatusOnPosts: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.AVAILABILITY_STATUS_ON_POSTS, Preferences.AVAILABILITY_STATUS_ON_POSTS_DEFAULT, userPreference),\n militaryTime: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.USE_MILITARY_TIME, Preferences.USE_MILITARY_TIME_DEFAULT, userPreference),\n teammateNameDisplay: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.NAME_NAME_FORMAT, configTeammateNameDisplay, userPreference),\n channelDisplayMode: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.CHANNEL_DISPLAY_MODE, Preferences.CHANNEL_DISPLAY_MODE_DEFAULT, userPreference),\n messageDisplay: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.MESSAGE_DISPLAY, Preferences.MESSAGE_DISPLAY_DEFAULT, userPreference),\n colorizeUsernames: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.COLORIZE_USERNAMES, Preferences.COLORIZE_USERNAMES_DEFAULT, userPreference),\n collapseDisplay: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.COLLAPSE_DISPLAY, Preferences.COLLAPSE_DISPLAY_DEFAULT, userPreference),\n collapsedReplyThreadsAllowUserPreference: isCollapsedThreadsAllowed(state) && getConfig(state).CollapsedThreads !== CollapsedThreads.ALWAYS_ON,\n collapsedReplyThreads: getCollapsedThreadsPreference(state),\n clickToReply: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.CLICK_TO_REPLY, Preferences.CLICK_TO_REPLY_DEFAULT, userPreference),\n linkPreviewDisplay: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.LINK_PREVIEW_DISPLAY, Preferences.LINK_PREVIEW_DISPLAY_DEFAULT, userPreference),\n oneClickReactionsOnPosts: get(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.ONE_CLICK_REACTIONS_ENABLED, Preferences.ONE_CLICK_REACTIONS_ENABLED_DEFAULT, userPreference),\n emojiPickerEnabled,\n lastActiveDisplay,\n lastActiveTimeEnabled,\n };\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n autoUpdateTimezone,\n savePreferences,\n updateMe,\n patchUser,\n }, dispatch),\n };\n}\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(UserSettingsDisplay);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {Component, createRef} from 'react';\nimport type {ChangeEvent, CSSProperties, MouseEvent, ReactNode, RefObject} from 'react';\nimport {defineMessage, FormattedMessage} from 'react-intl';\n\nimport FormError from 'components/form_error';\nimport LoadingWrapper from 'components/widgets/loading/loading_wrapper';\n\nimport {Constants} from 'utils/constants';\nimport * as FileUtils from 'utils/file_utils';\nimport {localizeMessage} from 'utils/utils';\n\nimport WithTooltip from './with_tooltip';\n\ntype Props = {\n clientError?: ReactNode;\n serverError?: ReactNode;\n src?: string | null;\n defaultImageSrc?: string;\n file?: File | null;\n loadingPicture?: boolean;\n submitActive?: boolean;\n onRemove?: () => void;\n onSetDefault?: (() => Promise<void>) | null;\n onSubmit?: (() => void) | null;\n title?: string;\n onFileChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n updateSection?: (e: MouseEvent<HTMLButtonElement>) => void;\n imageContext?: string;\n maxFileSize?: number;\n helpText?: ReactNode;\n}\n\ntype State = {\n image: string | null;\n removeSrc: boolean;\n setDefaultSrc: boolean;\n orientationStyles?: CSSProperties;\n}\n\nexport default class SettingPicture extends Component<Props, State> {\n static defaultProps = {\n imageContext: 'profile',\n };\n private readonly settingList: RefObject<HTMLDivElement>;\n private readonly selectInput: RefObject<HTMLInputElement>;\n private readonly confirmButton: RefObject<HTMLButtonElement>;\n private previewBlob: string | null;\n\n constructor(props: Props) {\n super(props);\n\n this.settingList = createRef();\n this.selectInput = createRef();\n this.confirmButton = createRef();\n this.previewBlob = null;\n\n this.state = {\n image: null,\n removeSrc: false,\n setDefaultSrc: false,\n };\n }\n\n focusFirstElement() {\n this.settingList.current?.focus();\n }\n\n componentDidMount() {\n this.focusFirstElement();\n\n if (this.selectInput.current) {\n this.selectInput.current.addEventListener('input', this.handleFileSelected);\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n if (this.props.file && prevProps.file !== this.props.file) {\n this.setPicture(this.props.file);\n }\n }\n\n componentWillUnmount() {\n if (this.previewBlob) {\n URL.revokeObjectURL(this.previewBlob);\n }\n\n if (this.selectInput.current) {\n this.selectInput.current.removeEventListener('input', this.handleFileSelected);\n }\n }\n\n handleCancel = (e: MouseEvent<HTMLButtonElement>) => {\n this.setState({removeSrc: false, setDefaultSrc: false});\n this.props.updateSection?.(e);\n };\n\n handleFileSelected = () => {\n if (this.confirmButton.current) {\n this.confirmButton.current.focus();\n }\n };\n\n handleSave = (e: MouseEvent) => {\n e.preventDefault();\n if (this.props.loadingPicture) {\n return;\n }\n if (this.state.removeSrc) {\n this.props.onRemove?.();\n } else if (this.state.setDefaultSrc) {\n this.props.onSetDefault?.();\n } else {\n this.props.onSubmit?.();\n }\n };\n\n handleRemoveSrc = (e: MouseEvent) => {\n e.preventDefault();\n this.setState({removeSrc: true});\n this.focusFirstElement();\n };\n\n handleSetDefaultSrc = (e: MouseEvent) => {\n e.preventDefault();\n this.setState({setDefaultSrc: true});\n this.focusFirstElement();\n };\n\n handleFileChange = (e: ChangeEvent<HTMLInputElement>) => {\n this.setState({removeSrc: false, setDefaultSrc: false});\n this.props.onFileChange?.(e);\n };\n\n handleInputFile = () => {\n if (this.selectInput.current) {\n this.selectInput.current.value = '';\n this.selectInput.current.click();\n }\n };\n\n setPicture = (file: File) => {\n if (file) {\n this.previewBlob = URL.createObjectURL(file);\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const orientation = FileUtils.getExifOrientation(e.target!.result! as ArrayBuffer);\n const orientationStyles = FileUtils.getOrientationStyles(orientation);\n\n this.setState({\n image: this.previewBlob,\n orientationStyles,\n });\n };\n reader.readAsArrayBuffer(file);\n }\n };\n\n renderImg = () => {\n const imageContext = this.props.imageContext;\n\n if (this.props.file) {\n const imageStyles = {\n backgroundImage: 'url(' + this.state.image + ')',\n ...this.state.orientationStyles,\n };\n\n return (\n <div className={`${imageContext}-img-preview`}>\n <div className='img-preview__image'>\n <div\n style={imageStyles}\n className={`${imageContext}-img-preview`}\n />\n </div>\n </div>\n );\n }\n\n if (this.state.setDefaultSrc) {\n return (\n <img\n className={`${imageContext}-img`}\n alt={`${imageContext} image`}\n src={this.props.defaultImageSrc}\n />\n );\n }\n\n if (this.props.src && !this.state.removeSrc) {\n const imageElement = (\n <img\n className={`${imageContext}-img`}\n alt={`${imageContext} image`}\n src={this.props.src}\n />\n );\n if (!this.props.onRemove && !this.props.onSetDefault) {\n return imageElement;\n }\n\n let title;\n let handler;\n if (this.props.onRemove) {\n title = (\n <FormattedMessage\n id='setting_picture.remove'\n defaultMessage='Remove This Icon'\n />\n );\n handler = this.handleRemoveSrc;\n } else if (this.props.onSetDefault) {\n title = (\n <FormattedMessage\n id='setting_picture.remove_profile_picture'\n defaultMessage='Remove Profile Picture'\n />\n );\n handler = this.handleSetDefaultSrc;\n }\n\n return (\n <div className={`${imageContext}-img__container`}>\n <div\n className='img-preview__image'\n aria-hidden={true}\n >\n {imageElement}\n </div>\n <WithTooltip\n title={title ?? ''}\n disabled={!title}\n >\n <button\n data-testid='removeSettingPicture'\n className={`${imageContext}-img__remove`}\n onClick={handler}\n >\n <span aria-hidden={true}>{'×'}</span>\n <span className='sr-only'>{title}</span>\n </button>\n </WithTooltip>\n </div>\n );\n }\n return null;\n };\n\n render() {\n const img = this.renderImg();\n\n let confirmButtonClass = 'btn';\n let disableSaveButtonFocus = false;\n if (this.props.submitActive || this.state.removeSrc || this.state.setDefaultSrc) {\n confirmButtonClass += ' btn-primary';\n } else {\n confirmButtonClass += ' btn-inactive disabled';\n disableSaveButtonFocus = true;\n }\n\n let imgRender;\n if (img) {\n imgRender = (\n <li\n className='setting-list-item'\n role='presentation'\n >\n {img}\n </li>\n );\n }\n\n let buttonRender;\n if (this.props.onSubmit) {\n buttonRender = (\n <span>\n <input\n data-testid='uploadPicture'\n ref={this.selectInput}\n className='hidden'\n accept={Constants.ACCEPT_STATIC_IMAGE}\n type='file'\n onChange={this.handleFileChange}\n disabled={this.props.loadingPicture}\n aria-hidden={true}\n tabIndex={-1}\n />\n <button\n data-testid='inputSettingPictureButton'\n className='btn btn-primary btn-file'\n disabled={this.props.loadingPicture}\n onClick={this.handleInputFile}\n aria-label={localizeMessage({id: 'setting_picture.select', defaultMessage: 'Select'})}\n >\n <FormattedMessage\n id='setting_picture.select'\n defaultMessage='Select'\n />\n </button>\n <button\n tabIndex={disableSaveButtonFocus ? -1 : 0}\n data-testid='saveSettingPicture'\n disabled={disableSaveButtonFocus}\n ref={this.confirmButton}\n className={confirmButtonClass}\n onClick={this.handleSave}\n aria-label={this.props.loadingPicture ? localizeMessage({id: 'setting_picture.uploading', defaultMessage: 'Uploading...'}) : localizeMessage({id: 'setting_picture.save', defaultMessage: 'Save'})}\n >\n <LoadingWrapper\n loading={this.props.loadingPicture}\n text={defineMessage({id: 'setting_picture.uploading', defaultMessage: 'Uploading...'})}\n >\n <FormattedMessage\n id='setting_picture.save'\n defaultMessage='Save'\n />\n </LoadingWrapper>\n </button>\n </span>\n );\n }\n return (\n <section className='section-max form-horizontal'>\n <h4 className='col-xs-12 section-title'>\n {this.props.title}\n </h4>\n <div className='col-sm-10 col-sm-offset-2'>\n <div\n className='setting-list'\n ref={this.settingList}\n tabIndex={-1}\n aria-label={this.props.title}\n aria-describedby='setting-picture__helptext'\n >\n {imgRender}\n <div\n id='setting-picture__helptext'\n className='setting-list-item pt-3'\n >\n {this.props.helpText}\n </div>\n <div\n className='setting-list-item'\n >\n <hr/>\n <FormError\n errors={[this.props.clientError, this.props.serverError]}\n type={'modal'}\n />\n {buttonRender}\n <button\n data-testid='cancelSettingPicture'\n className='btn btn-tertiary theme ml-2'\n onClick={this.handleCancel}\n aria-label={localizeMessage({id: 'setting_picture.cancel', defaultMessage: 'Cancel'})}\n >\n <FormattedMessage\n id='setting_picture.cancel'\n defaultMessage='Cancel'\n />\n </button>\n </div>\n </div>\n </div>\n </section>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable max-lines */\n\nimport React, {PureComponent} from 'react';\nimport {defineMessage, defineMessages, FormattedDate, FormattedMessage, injectIntl} from 'react-intl';\nimport type {IntlShape} from 'react-intl';\n\nimport type {UserPropertyField} from '@mattermost/types/properties';\nimport type {UserProfile} from '@mattermost/types/users';\nimport type {IDMappedObjects} from '@mattermost/types/utilities';\n\nimport {Client4} from 'mattermost-redux/client';\nimport type {ActionResult} from 'mattermost-redux/types/actions';\nimport {isEmail} from 'mattermost-redux/utils/helpers';\n\nimport {trackEvent} from 'actions/telemetry_actions.jsx';\n\nimport SettingItem from 'components/setting_item';\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingPicture from 'components/setting_picture';\nimport LoadingWrapper from 'components/widgets/loading/loading_wrapper';\n\nimport {AnnouncementBarMessages, AnnouncementBarTypes, AcceptedProfileImageTypes, Constants, ValidationErrors} from 'utils/constants';\nimport * as Utils from 'utils/utils';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nconst holders = defineMessages({\n usernameReserved: {\n id: 'user.settings.general.usernameReserved',\n defaultMessage: 'This username is reserved, please choose a new one.',\n },\n usernameGroupNameUniqueness: {\n id: 'user.settings.general.usernameGroupNameUniqueness',\n defaultMessage: 'This username conflicts with an existing group name.',\n },\n usernameRestrictions: {\n id: 'user.settings.general.usernameRestrictions',\n defaultMessage: \"Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'.\",\n },\n validEmail: {\n id: 'user.settings.general.validEmail',\n defaultMessage: 'Please enter a valid email address.',\n },\n emailMatch: {\n id: 'user.settings.general.emailMatch',\n defaultMessage: 'The new emails you entered do not match.',\n },\n incorrectPassword: {\n id: 'user.settings.general.incorrectPassword',\n defaultMessage: 'Your password is incorrect.',\n },\n emptyPassword: {\n id: 'user.settings.general.emptyPassword',\n defaultMessage: 'Please enter your current password.',\n },\n validImage: {\n id: 'user.settings.general.validImage',\n defaultMessage: 'Only BMP, JPG, JPEG, or PNG images may be used for profile pictures',\n },\n imageTooLarge: {\n id: 'user.settings.general.imageTooLarge',\n defaultMessage: 'Unable to upload profile image. File is too large.',\n },\n uploadImage: {\n id: 'user.settings.general.uploadImage',\n defaultMessage: \"Click 'Edit' to upload an image.\",\n },\n uploadImageMobile: {\n id: 'user.settings.general.mobile.uploadImage',\n defaultMessage: 'Click to upload an image',\n },\n fullName: {\n id: 'user.settings.general.fullName',\n defaultMessage: 'Full Name',\n },\n nickname: {\n id: 'user.settings.general.nickname',\n defaultMessage: 'Nickname',\n },\n username: {\n id: 'user.settings.general.username',\n defaultMessage: 'Username',\n },\n profilePicture: {\n id: 'user.settings.general.profilePicture',\n defaultMessage: 'Profile Picture',\n },\n close: {\n id: 'user.settings.general.close',\n defaultMessage: 'Close',\n },\n position: {\n id: 'user.settings.general.position',\n defaultMessage: 'Position',\n },\n});\n\nexport type Props = {\n intl: IntlShape;\n user: UserProfile;\n updateSection: (section: string) => void;\n updateTab: (notifications: string) => void;\n activeSection?: string;\n closeModal: () => void;\n collapseModal: () => void;\n isMobileView: boolean;\n maxFileSize: number;\n customProfileAttributeFields: IDMappedObjects<UserPropertyField>;\n actions: {\n logError: ({message, type}: {message: any; type: string}, status: boolean) => void;\n clearErrors: () => void;\n updateMe: (user: UserProfile) => Promise<ActionResult>;\n sendVerificationEmail: (email: string) => Promise<ActionResult>;\n setDefaultProfileImage: (id: string) => void;\n uploadProfileImage: (id: string, file: File) => Promise<ActionResult>;\n saveCustomProfileAttribute: (userID: string, attributeID: string, attributeValue: string) => Promise<ActionResult<Record<string, string>>>;\n getCustomProfileAttributeFields: () => Promise<ActionResult>;\n };\n requireEmailVerification?: boolean;\n ldapFirstNameAttributeSet?: boolean;\n ldapLastNameAttributeSet?: boolean;\n samlFirstNameAttributeSet?: boolean;\n samlLastNameAttributeSet?: boolean;\n ldapNicknameAttributeSet?: boolean;\n samlNicknameAttributeSet?: boolean;\n ldapPositionAttributeSet?: boolean;\n samlPositionAttributeSet?: boolean;\n ldapPictureAttributeSet?: boolean;\n enableCustomProfileAttributes: boolean;\n}\n\ntype State = {\n username: string;\n firstName: string;\n lastName: string;\n nickname: string;\n position: string;\n originalEmail: string;\n email: string;\n confirmEmail: string;\n currentPassword: string;\n pictureFile: File | null;\n loadingPicture: boolean;\n sectionIsSaving: boolean;\n showSpinner: boolean;\n resendStatus?: string;\n clientError?: string | null;\n serverError?: string | {server_error_id: string; message: string};\n emailError?: string;\n customAttributeValues: Record<string, string>;\n}\n\nexport class UserSettingsGeneralTab extends PureComponent<Props, State> {\n public submitActive = false;\n\n constructor(props: Props) {\n super(props);\n this.state = this.setupInitialState(props);\n }\n\n componentDidMount() {\n if (this.props.enableCustomProfileAttributes) {\n const fetchValues = async () => {\n const response = await Client4.getUserCustomProfileAttributesValues(this.props.user.id);\n this.setState({customAttributeValues: response});\n };\n\n this.props.actions.getCustomProfileAttributeFields();\n fetchValues();\n }\n }\n\n handleEmailResend = (email: string) => {\n this.setState({resendStatus: 'sending', showSpinner: true});\n this.props.actions.sendVerificationEmail(email).then(({data, error: err}) => {\n if (data) {\n this.setState({resendStatus: 'success'});\n } else if (err) {\n this.setState({resendStatus: 'failure'});\n }\n });\n };\n\n createEmailResendLink = (email: string) => {\n return (\n <span className='resend-verification-wrapper'>\n <LoadingWrapper\n loading={this.state.showSpinner}\n text={defineMessage({id: 'user.settings.general.sending', defaultMessage: 'Sending'})}\n >\n <a\n onClick={() => {\n this.handleEmailResend(email);\n setTimeout(() => {\n this.setState({\n showSpinner: false,\n });\n }, 500);\n }}\n >\n <FormattedMessage\n id='user.settings.general.sendAgain'\n defaultMessage='Send again'\n />\n </a>\n </LoadingWrapper>\n </span>\n );\n };\n\n submitUsername = () => {\n const user = Object.assign({}, this.props.user);\n const username = this.state.username.trim().toLowerCase();\n\n const {formatMessage} = this.props.intl;\n const usernameError = Utils.isValidUsername(username);\n if (usernameError) {\n let errObj;\n if (usernameError.id === ValidationErrors.RESERVED_NAME) {\n errObj = {clientError: formatMessage(holders.usernameReserved), serverError: ''};\n } else {\n errObj = {clientError: formatMessage(holders.usernameRestrictions, {min: Constants.MIN_USERNAME_LENGTH, max: Constants.MAX_USERNAME_LENGTH}), serverError: ''};\n }\n this.setState(errObj);\n return;\n }\n\n if (user.username === username) {\n this.updateSection('');\n return;\n }\n\n user.username = username;\n\n trackEvent('settings', 'user_settings_update', {field: 'username'});\n\n this.submitUser(user, false);\n };\n\n submitNickname = () => {\n const user = Object.assign({}, this.props.user);\n const nickname = this.state.nickname.trim();\n\n if (user.nickname === nickname) {\n this.updateSection('');\n return;\n }\n\n user.nickname = nickname;\n\n trackEvent('settings', 'user_settings_update', {field: 'nickname'});\n\n this.submitUser(user, false);\n };\n\n submitName = () => {\n const user = Object.assign({}, this.props.user);\n const firstName = this.state.firstName.trim();\n const lastName = this.state.lastName.trim();\n\n if (user.first_name === firstName && user.last_name === lastName) {\n this.updateSection('');\n return;\n }\n\n user.first_name = firstName;\n user.last_name = lastName;\n\n trackEvent('settings', 'user_settings_update', {field: 'fullname'});\n\n this.submitUser(user, false);\n };\n\n submitEmail = () => {\n const user = Object.assign({}, this.props.user);\n const email = this.state.email.trim().toLowerCase();\n const confirmEmail = this.state.confirmEmail.trim().toLowerCase();\n const currentPassword = this.state.currentPassword;\n\n const {formatMessage} = this.props.intl;\n\n if (email === user.email && (confirmEmail === '' || confirmEmail === user.email)) {\n this.updateSection('');\n return;\n }\n\n if (email === '' || !isEmail(email)) {\n this.setState({emailError: formatMessage(holders.validEmail), clientError: '', serverError: ''});\n return;\n }\n\n if (email !== confirmEmail) {\n this.setState({emailError: formatMessage(holders.emailMatch), clientError: '', serverError: ''});\n return;\n }\n\n if (currentPassword === '') {\n this.setState({emailError: formatMessage(holders.emptyPassword), clientError: '', serverError: ''});\n return;\n }\n\n user.email = email;\n user.password = currentPassword;\n trackEvent('settings', 'user_settings_update', {field: 'email'});\n this.submitUser(user, true);\n };\n\n submitUser = (user: UserProfile, emailUpdated: boolean) => {\n const {formatMessage} = this.props.intl;\n this.setState({sectionIsSaving: true});\n\n this.props.actions.updateMe(user).\n then(({data, error: err}) => {\n if (data) {\n this.updateSection('');\n\n const verificationEnabled = this.props.requireEmailVerification && emailUpdated;\n if (verificationEnabled) {\n this.props.actions.clearErrors();\n this.props.actions.logError({\n message: AnnouncementBarMessages.EMAIL_VERIFICATION_REQUIRED,\n type: AnnouncementBarTypes.SUCCESS,\n }, true);\n }\n } else if (err) {\n let serverError;\n if (err.server_error_id &&\n err.server_error_id === 'api.user.check_user_password.invalid.app_error') {\n serverError = formatMessage(holders.incorrectPassword);\n } else if (err.server_error_id === 'app.user.group_name_conflict') {\n serverError = formatMessage(holders.usernameGroupNameUniqueness);\n } else if (err.message) {\n serverError = err.message;\n } else {\n serverError = err;\n }\n this.setState({serverError, emailError: '', clientError: '', sectionIsSaving: false});\n }\n });\n };\n\n setDefaultProfilePicture = async () => {\n try {\n await this.props.actions.setDefaultProfileImage(this.props.user.id);\n this.updateSection('');\n this.submitActive = false;\n } catch (err) {\n let serverError;\n if (err.message) {\n serverError = err.message;\n } else {\n serverError = err;\n }\n this.setState({serverError, emailError: '', clientError: '', sectionIsSaving: false});\n }\n };\n\n submitPicture = () => {\n if (!this.state.pictureFile) {\n return;\n }\n\n if (!this.submitActive) {\n return;\n }\n\n trackEvent('settings', 'user_settings_update', {field: 'picture'});\n\n const {formatMessage} = this.props.intl;\n const file = this.state.pictureFile;\n\n if (!AcceptedProfileImageTypes.includes(file.type)) {\n this.setState({clientError: formatMessage(holders.validImage), serverError: ''});\n return;\n } else if (file.size > this.props.maxFileSize) {\n this.setState({clientError: formatMessage(holders.imageTooLarge), serverError: ''});\n return;\n }\n\n this.setState({loadingPicture: true});\n\n this.props.actions.uploadProfileImage(this.props.user.id, file).\n then(({data, error: err}) => {\n if (data) {\n this.updateSection('');\n this.submitActive = false;\n } else if (err) {\n const state = this.setupInitialState(this.props);\n state.serverError = err.message;\n this.setState(state);\n }\n });\n };\n\n submitPosition = () => {\n const user = Object.assign({}, this.props.user);\n const position = this.state.position.trim();\n\n if (user.position === position) {\n this.updateSection('');\n return;\n }\n\n user.position = position;\n\n trackEvent('settings', 'user_settings_update', {field: 'position'});\n\n this.submitUser(user, false);\n };\n\n submitAttribute = async (settings: string[]) => {\n const attributeID = settings[0];\n const attributeValue = this.state.customAttributeValues?.[attributeID];\n if (attributeValue == null) {\n return;\n }\n\n trackEvent('settings', 'user_settings_update', {field: 'customAttributeValues-' + attributeID});\n\n this.setState({sectionIsSaving: true});\n\n this.props.actions.saveCustomProfileAttribute(this.props.user.id, attributeID, attributeValue).\n then(({data, error: err}) => {\n if (data) {\n this.updateSection('');\n this.setState({customAttributeValues: {...this.state.customAttributeValues, ...data}});\n } else if (err) {\n const serverError = err;\n this.setState({serverError, emailError: '', clientError: '', sectionIsSaving: false});\n }\n });\n };\n\n updateUsername = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({username: e.target.value});\n };\n\n updateFirstName = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({firstName: e.target.value});\n };\n\n updateLastName = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({lastName: e.target.value});\n };\n\n updateNickname = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({nickname: e.target.value});\n };\n\n updatePosition = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({position: e.target.value});\n };\n\n updateEmail = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({email: e.target.value});\n };\n\n updateConfirmEmail = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({confirmEmail: e.target.value});\n };\n\n updateCurrentPassword = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({currentPassword: e.target.value});\n };\n\n updatePicture = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files[0]) {\n this.setState({pictureFile: e.target.files[0]});\n\n this.submitActive = true;\n this.setState({clientError: null});\n } else {\n this.setState({pictureFile: null});\n }\n };\n\n updateAttribute = (e: React.ChangeEvent<HTMLInputElement>) => {\n const attributeValues = Object.assign({}, this.state.customAttributeValues);\n const id = e.target.id.substring(e.target.id.indexOf('_') + 1);\n attributeValues[id] = e.target.value;\n this.setState({customAttributeValues: attributeValues});\n };\n\n updateSection = (section: string) => {\n this.setState(Object.assign({}, this.setupInitialState(this.props), {clientError: '', serverError: '', emailError: '', sectionIsSaving: false}));\n this.submitActive = false;\n this.props.updateSection(section);\n };\n\n setupInitialState(props: Props) {\n const user = props.user;\n let cav = {};\n if (this.state !== undefined) {\n cav = this.state.customAttributeValues;\n }\n return {\n username: user.username,\n firstName: user.first_name,\n lastName: user.last_name,\n nickname: user.nickname,\n position: user.position,\n originalEmail: user.email,\n email: '',\n confirmEmail: '',\n currentPassword: '',\n pictureFile: null,\n loadingPicture: false,\n sectionIsSaving: false,\n showSpinner: false,\n serverError: '',\n customAttributeValues: cav,\n };\n }\n\n createEmailSection() {\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'email';\n let max = null;\n if (active) {\n const emailVerificationEnabled = this.props.requireEmailVerification;\n const inputs = [];\n\n let helpText = (\n <FormattedMessage\n id='user.settings.general.emailHelp1'\n defaultMessage='Email is used for sign-in, notifications, and password reset. Email requires verification if changed.'\n />\n );\n\n if (!emailVerificationEnabled) {\n helpText = (\n <FormattedMessage\n id='user.settings.general.emailHelp3'\n defaultMessage='Email is used for sign-in, notifications, and password reset.'\n />\n );\n }\n\n let submit = null;\n\n if (this.props.user.auth_service === '') {\n inputs.push(\n <div key='currentEmailSetting'>\n <div className='form-group'>\n <span className='as-bs-label col-sm-5 control-label'>\n <FormattedMessage\n id='user.settings.general.currentEmail'\n defaultMessage='Current Email'\n />\n </span>\n <div className='col-sm-7'>\n <span className='as-bs-label control-label word-break--all text-left'>{this.state.originalEmail}</span>\n </div>\n </div>\n </div>,\n );\n\n inputs.push(\n <div key='emailSetting'>\n <div className='form-group'>\n <label\n className='col-sm-5 control-label'\n htmlFor='primaryEmail'\n >\n <FormattedMessage\n id='user.settings.general.newEmail'\n defaultMessage='New Email'\n />\n </label>\n <div className='col-sm-7'>\n <input\n autoFocus={true}\n id='primaryEmail'\n className='form-control'\n type='email'\n onChange={this.updateEmail}\n maxLength={Constants.MAX_EMAIL_LENGTH}\n value={this.state.email}\n aria-label={formatMessage({id: 'user.settings.general.newEmail', defaultMessage: 'New Email'})}\n />\n </div>\n </div>\n </div>,\n );\n\n inputs.push(\n <div key='confirmEmailSetting'>\n <div className='form-group'>\n <label\n className='col-sm-5 control-label'\n htmlFor='confirmEmail'\n >\n <FormattedMessage\n id='user.settings.general.confirmEmail'\n defaultMessage='Confirm Email'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='confirmEmail'\n className='form-control'\n type='email'\n onChange={this.updateConfirmEmail}\n maxLength={Constants.MAX_EMAIL_LENGTH}\n value={this.state.confirmEmail}\n aria-label={formatMessage({id: 'user.settings.general.confirmEmail', defaultMessage: 'Confirm Email'})}\n />\n </div>\n </div>\n </div>,\n );\n\n inputs.push(\n <div key='currentPassword'>\n <div className='form-group'>\n <label\n className='col-sm-5 control-label'\n htmlFor='currentPassword'\n >\n <FormattedMessage\n id='user.settings.general.currentPassword'\n defaultMessage='Current Password'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='currentPassword'\n className='form-control'\n type='password'\n onChange={this.updateCurrentPassword}\n value={this.state.currentPassword}\n aria-label={formatMessage({id: 'user.settings.general.currentPassword', defaultMessage: 'Current Password'})}\n />\n </div>\n </div>\n {helpText}\n </div>,\n );\n\n submit = this.submitEmail;\n } else if (this.props.user.auth_service === Constants.GITLAB_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailGitlabCantUpdate'\n defaultMessage='Login occurs through GitLab. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n {helpText}\n </div>,\n );\n } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailGoogleCantUpdate'\n defaultMessage='Login occurs through Google Apps. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n {helpText}\n </div>,\n );\n } else if (this.props.user.auth_service === Constants.OFFICE365_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailOffice365CantUpdate'\n defaultMessage='Login occurs through Entra ID. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n {helpText}\n </div>,\n );\n } else if (this.props.user.auth_service === Constants.OPENID_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailOpenIdCantUpdate'\n defaultMessage='Login occurs through OpenID Connect. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n {helpText}\n </div>,\n );\n } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='pb-2'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailLdapCantUpdate'\n defaultMessage='Login occurs through AD/LDAP. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n </div>,\n );\n } else if (this.props.user.auth_service === Constants.SAML_SERVICE) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='pb-2'\n >\n <div className='setting-list__hint pb-3'>\n <FormattedMessage\n id='user.settings.general.emailSamlCantUpdate'\n defaultMessage='Login occurs through SAML. Email cannot be updated. Email address used for notifications is {email}.'\n values={{\n email: this.state.originalEmail,\n }}\n />\n </div>\n {helpText}\n </div>,\n );\n }\n\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.general.email'\n defaultMessage='Email'\n />\n }\n inputs={inputs}\n submit={submit}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.emailError}\n updateSection={this.updateSection}\n />\n );\n }\n\n let describe: JSX.Element|string = '';\n if (this.props.user.auth_service === '') {\n describe = this.props.user.email;\n } else if (this.props.user.auth_service === Constants.GITLAB_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.general.loginGitlab'\n defaultMessage='Login done through GitLab ({email})'\n values={{\n email: this.state.originalEmail,\n }}\n />\n );\n } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.general.loginGoogle'\n defaultMessage='Login done through Google Apps ({email})'\n values={{\n email: this.state.originalEmail,\n }}\n />\n );\n } else if (this.props.user.auth_service === Constants.OFFICE365_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.general.loginOffice365'\n defaultMessage='Login done through Entra ID ({email})'\n values={{\n email: this.state.originalEmail,\n }}\n />\n );\n } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.general.loginLdap'\n defaultMessage='Login done through AD/LDAP ({email})'\n values={{\n email: this.state.originalEmail,\n }}\n />\n );\n } else if (this.props.user.auth_service === Constants.SAML_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.general.loginSaml'\n defaultMessage='Login done through SAML ({email})'\n values={{\n email: this.state.originalEmail,\n }}\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.general.email'\n defaultMessage='Email'\n />\n }\n describe={describe}\n section={'email'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n }\n\n createNameSection = () => {\n const user = this.props.user;\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'name';\n let max = null;\n if (active) {\n const inputs = [];\n\n let extraInfo;\n let submit = null;\n if (\n (this.props.user.auth_service === Constants.LDAP_SERVICE &&\n (this.props.ldapFirstNameAttributeSet || this.props.ldapLastNameAttributeSet)) ||\n (this.props.user.auth_service === Constants.SAML_SERVICE &&\n (this.props.samlFirstNameAttributeSet || this.props.samlLastNameAttributeSet)) ||\n (Constants.OAUTH_SERVICES.includes(this.props.user.auth_service))\n ) {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.field_handled_externally'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </span>\n );\n } else {\n inputs.push(\n <div\n key='firstNameSetting'\n className='form-group'\n >\n <label\n className='col-sm-5 control-label'\n htmlFor='firstName'\n >\n <FormattedMessage\n id='user.settings.general.firstName'\n defaultMessage='First Name'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='firstName'\n autoFocus={true}\n className='form-control'\n type='text'\n onChange={this.updateFirstName}\n maxLength={Constants.MAX_FIRSTNAME_LENGTH}\n value={this.state.firstName}\n onFocus={Utils.moveCursorToEnd}\n aria-label={formatMessage({id: 'user.settings.general.firstName', defaultMessage: 'First Name'})}\n />\n </div>\n </div>,\n );\n\n inputs.push(\n <div\n key='lastNameSetting'\n className='form-group'\n >\n <label\n className='col-sm-5 control-label'\n htmlFor='lastName'\n >\n <FormattedMessage\n id='user.settings.general.lastName'\n defaultMessage='Last Name'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='lastName'\n className='form-control'\n type='text'\n onChange={this.updateLastName}\n maxLength={Constants.MAX_LASTNAME_LENGTH}\n value={this.state.lastName}\n aria-label={formatMessage({id: 'user.settings.general.lastName', defaultMessage: 'Last Name'})}\n />\n </div>\n </div>,\n );\n\n const notifClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n this.updateSection('');\n this.props.updateTab('notifications');\n };\n\n const notifLink = (\n <a\n href='#'\n onClick={notifClick.bind(this)}\n >\n <FormattedMessage\n id='user.settings.general.notificationsLink'\n defaultMessage='Notifications'\n />\n </a>\n );\n\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.notificationsExtra'\n defaultMessage='By default, you will receive mention notifications when someone types your first name. Go to {notify} settings to change this default.'\n values={{\n notify: (notifLink),\n }}\n />\n </span>\n );\n\n submit = this.submitName;\n }\n\n max = (\n <SettingItemMax\n title={formatMessage(holders.fullName)}\n inputs={inputs}\n submit={submit}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={this.updateSection}\n extraInfo={extraInfo}\n />\n );\n }\n\n let describe: JSX.Element|string = '';\n\n if (user.first_name && user.last_name) {\n describe = user.first_name + ' ' + user.last_name;\n } else if (user.first_name) {\n describe = user.first_name;\n } else if (user.last_name) {\n describe = user.last_name;\n } else {\n describe = (\n <FormattedMessage\n id='user.settings.general.emptyName'\n defaultMessage=\"Click 'Edit' to add your full name\"\n />\n );\n if (this.props.isMobileView) {\n describe = (\n <FormattedMessage\n id='user.settings.general.mobile.emptyName'\n defaultMessage='Click to add your full name'\n />\n );\n }\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={formatMessage(holders.fullName)}\n describe={describe}\n section={'name'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n };\n\n createNicknameSection = () => {\n const user = this.props.user;\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'nickname';\n let max = null;\n if (active) {\n const inputs = [];\n\n let extraInfo;\n let submit = null;\n if ((this.props.user.auth_service === 'ldap' && this.props.ldapNicknameAttributeSet) || (this.props.user.auth_service === Constants.SAML_SERVICE && this.props.samlNicknameAttributeSet)) {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.field_handled_externally'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </span>\n );\n } else {\n let nicknameLabel: JSX.Element|string = (\n <FormattedMessage\n id='user.settings.general.nickname'\n defaultMessage='Nickname'\n />\n );\n if (this.props.isMobileView) {\n nicknameLabel = '';\n }\n\n inputs.push(\n <div\n key='nicknameSetting'\n className='form-group'\n >\n <label className='col-sm-5 control-label'>{nicknameLabel}</label>\n <div className='col-sm-7'>\n <input\n id='nickname'\n autoFocus={true}\n className='form-control'\n type='text'\n onChange={this.updateNickname}\n value={this.state.nickname}\n maxLength={Constants.MAX_NICKNAME_LENGTH}\n autoCapitalize='off'\n aria-label={formatMessage({id: 'user.settings.general.nickname', defaultMessage: 'Nickname'})}\n />\n </div>\n </div>,\n );\n\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.nicknameExtra'\n defaultMessage='Use Nickname for a name you might be called that is different from your first name and username. This is most often used when two or more people have similar sounding names and usernames.'\n />\n </span>\n );\n\n submit = this.submitNickname;\n }\n\n max = (\n <SettingItemMax\n title={formatMessage(holders.nickname)}\n inputs={inputs}\n submit={submit}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={this.updateSection}\n extraInfo={extraInfo}\n />\n );\n }\n\n let describe: JSX.Element|string = '';\n if (user.nickname) {\n describe = user.nickname;\n } else {\n describe = (\n <FormattedMessage\n id='user.settings.general.emptyNickname'\n defaultMessage=\"Click 'Edit' to add a nickname\"\n />\n );\n if (this.props.isMobileView) {\n describe = (\n <FormattedMessage\n id='user.settings.general.mobile.emptyNickname'\n defaultMessage='Click to add a nickname'\n />\n );\n }\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={formatMessage(holders.nickname)}\n describe={describe}\n section={'nickname'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n };\n\n createUsernameSection = () => {\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'username';\n let max = null;\n if (active) {\n const inputs = [];\n\n let extraInfo;\n let submit = null;\n if (this.props.user.auth_service === '') {\n let usernameLabel: JSX.Element | string = (\n <FormattedMessage\n id='user.settings.general.username'\n defaultMessage='Username'\n />\n );\n if (this.props.isMobileView) {\n usernameLabel = '';\n }\n\n inputs.push(\n <div\n key='usernameSetting'\n className='form-group'\n >\n <label className='col-sm-5 control-label'>{usernameLabel}</label>\n <div className='col-sm-7'>\n <input\n id='username'\n autoFocus={true}\n maxLength={Constants.MAX_USERNAME_LENGTH}\n className='form-control'\n type='text'\n onChange={this.updateUsername}\n value={this.state.username}\n autoCapitalize='off'\n onFocus={Utils.moveCursorToEnd}\n aria-label={formatMessage({id: 'user.settings.general.username', defaultMessage: 'Username'})}\n />\n </div>\n </div>,\n );\n\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.usernameInfo'\n defaultMessage='Pick something easy for teammates to recognize and recall.'\n />\n </span>\n );\n\n submit = this.submitUsername;\n } else {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.field_handled_externally'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </span>\n );\n }\n\n max = (\n <SettingItemMax\n title={formatMessage(holders.username)}\n inputs={inputs}\n submit={submit}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={this.updateSection}\n extraInfo={extraInfo}\n />\n );\n }\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={formatMessage(holders.username)}\n describe={this.props.user.username}\n section={'username'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n };\n\n createPositionSection = () => {\n const user = this.props.user;\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'position';\n let max = null;\n if (active) {\n const inputs = [];\n\n let extraInfo: JSX.Element|string;\n let submit = null;\n if ((this.props.user.auth_service === Constants.LDAP_SERVICE && this.props.ldapPositionAttributeSet) || (this.props.user.auth_service === Constants.SAML_SERVICE && this.props.samlPositionAttributeSet)) {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.field_handled_externally'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </span>\n );\n } else {\n let positionLabel: JSX.Element | string = (\n <FormattedMessage\n id='user.settings.general.position'\n defaultMessage='Position'\n />\n );\n if (this.props.isMobileView) {\n positionLabel = '';\n }\n\n inputs.push(\n <div\n key='positionSetting'\n className='form-group'\n >\n <label className='col-sm-5 control-label'>{positionLabel}</label>\n <div className='col-sm-7'>\n <input\n id='position'\n autoFocus={true}\n className='form-control'\n type='text'\n onChange={this.updatePosition}\n value={this.state.position}\n maxLength={Constants.MAX_POSITION_LENGTH}\n autoCapitalize='off'\n onFocus={Utils.moveCursorToEnd}\n aria-label={formatMessage({id: 'user.settings.general.position', defaultMessage: 'Position'})}\n />\n </div>\n </div>,\n );\n\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.positionExtra'\n defaultMessage='Use Position for your role or job title. This will be shown in your profile popover.'\n />\n </span>\n );\n\n submit = this.submitPosition;\n }\n\n max = (\n <SettingItemMax\n title={formatMessage(holders.position)}\n inputs={inputs}\n submit={submit}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={this.updateSection}\n extraInfo={extraInfo}\n />\n );\n }\n\n let describe: JSX.Element|string = '';\n if (user.position) {\n describe = user.position;\n } else {\n describe = (\n <FormattedMessage\n id='user.settings.general.emptyPosition'\n defaultMessage=\"Click 'Edit' to add your job title / position\"\n />\n );\n if (this.props.isMobileView) {\n describe = (\n <FormattedMessage\n id='user.settings.general.mobile.emptyPosition'\n defaultMessage='Click to add your job title / position'\n />\n );\n }\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={formatMessage(holders.position)}\n describe={describe}\n section={'position'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n };\n\n createCustomAttributeSection = () => {\n if (this.props.customProfileAttributeFields == null) {\n return <></>;\n }\n\n const attributeSections = Object.values(this.props.customProfileAttributeFields).map((attribute) => {\n const attributeValue = this.state.customAttributeValues?.[attribute.id] ?? '';\n const sectionName = 'customAttribute_' + attribute.id;\n const active = this.props.activeSection === sectionName;\n let max = null;\n\n if (active) {\n const inputs = [];\n\n let attributeLabel: JSX.Element | string = (\n attribute.name\n );\n if (this.props.isMobileView) {\n attributeLabel = '';\n }\n\n inputs.push(\n <div\n key={sectionName}\n className='form-group'\n >\n <label className='col-sm-5 control-label'>{attributeLabel}</label>\n <div className='col-sm-7'>\n <input\n id={sectionName}\n autoFocus={true}\n className='form-control'\n type='text'\n onChange={this.updateAttribute}\n value={attributeValue}\n maxLength={Constants.MAX_CUSTOM_ATTRIBUTE_LENGTH}\n autoCapitalize='off'\n onFocus={Utils.moveCursorToEnd}\n aria-label={attribute.name}\n />\n </div>\n </div>,\n );\n\n const extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.general.attributeExtra'\n defaultMessage='This will be shown in your profile popover.'\n />\n </span>\n );\n\n max = (\n <SettingItemMax\n key={'settingItemMax_' + attribute.id}\n title={attribute.name}\n inputs={inputs}\n submit={this.submitAttribute.bind(this, [attribute.id])}\n saving={this.state.sectionIsSaving}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={this.updateSection}\n extraInfo={extraInfo}\n />\n );\n }\n let describe: JSX.Element|string = '';\n if (attributeValue) {\n describe = attributeValue;\n } else {\n describe = (\n <FormattedMessage\n id='user.settings.general.emptyAttribute'\n defaultMessage=\"Click 'Edit' to add your custom attribute\"\n />\n );\n if (this.props.isMobileView) {\n describe = (\n <FormattedMessage\n id='user.settings.general.mobile.emptyAttribute'\n defaultMessage='Click to add your custom attribute'\n />\n );\n }\n }\n\n return (\n <div key={sectionName}>\n <SettingItem\n key={'settingItem_' + attribute.id}\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={attribute.name}\n describe={describe}\n section={sectionName}\n updateSection={this.updateSection}\n max={max}\n />\n <div className='divider-dark'/>\n </div>\n );\n });\n return <>{attributeSections}</>;\n };\n\n createPictureSection = () => {\n const user = this.props.user;\n const {formatMessage} = this.props.intl;\n\n const active = this.props.activeSection === 'picture';\n let max = null;\n\n if (active) {\n let submit = null;\n let setDefault = null;\n let helpText = null;\n let imgSrc = null;\n\n if ((this.props.user.auth_service === Constants.LDAP_SERVICE || this.props.user.auth_service === Constants.SAML_SERVICE) && this.props.ldapPictureAttributeSet) {\n helpText = (\n <span>\n <FormattedMessage\n id='user.settings.general.field_handled_externally'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </span>\n );\n } else {\n submit = this.submitPicture;\n setDefault = user.last_picture_update > 0 ? this.setDefaultProfilePicture : null;\n imgSrc = Utils.imageURLForUser(user.id, user.last_picture_update);\n helpText = (\n <FormattedMessage\n id='setting_picture.help.profile'\n defaultMessage='Upload a picture in BMP, JPG, JPEG, or PNG format. Maximum file size: {max}'\n values={{max: Utils.fileSizeToString(this.props.maxFileSize)}}\n />\n );\n }\n\n max = (\n <SettingPicture\n title={formatMessage(holders.profilePicture)}\n onSubmit={submit}\n onSetDefault={setDefault}\n src={imgSrc}\n defaultImageSrc={Utils.defaultImageURLForUser(user.id)}\n serverError={this.state.serverError}\n clientError={this.state.clientError}\n updateSection={(e: React.MouseEvent) => {\n this.updateSection('');\n e.preventDefault();\n }}\n file={this.state.pictureFile}\n onFileChange={this.updatePicture}\n submitActive={this.submitActive}\n loadingPicture={this.state.loadingPicture}\n maxFileSize={this.props.maxFileSize}\n helpText={helpText}\n />\n );\n }\n\n let minMessage: JSX.Element|string = formatMessage(holders.uploadImage);\n if (this.props.isMobileView) {\n minMessage = formatMessage(holders.uploadImageMobile);\n }\n if (user.last_picture_update > 0) {\n minMessage = (\n <FormattedMessage\n id='user.settings.general.imageUpdated'\n defaultMessage='Image last updated {date}'\n values={{\n date: (\n <FormattedDate\n value={new Date(user.last_picture_update)}\n day='2-digit'\n month='short'\n year='numeric'\n />\n ),\n }}\n />\n );\n }\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={formatMessage(holders.profilePicture)}\n describe={minMessage}\n section={'picture'}\n updateSection={this.updateSection}\n max={max}\n />\n );\n };\n\n render() {\n const nameSection = this.createNameSection();\n const nicknameSection = this.createNicknameSection();\n const usernameSection = this.createUsernameSection();\n const positionSection = this.createPositionSection();\n const emailSection = this.createEmailSection();\n const customProperiesSection = this.createCustomAttributeSection();\n const pictureSection = this.createPictureSection();\n\n return (\n <div id='generalSettings'>\n <SettingMobileHeader\n closeModal={this.props.closeModal}\n collapseModal={this.props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.modal.profile'\n defaultMessage='Profile'\n />\n }\n />\n <div className='user-settings'>\n <SettingDesktopHeader\n id='generalSettingsTitle'\n text={\n <FormattedMessage\n id='user.settings.modal.profile'\n defaultMessage='Profile'\n />\n }\n />\n <div className='divider-dark first'/>\n {nameSection}\n <div className='divider-light'/>\n {usernameSection}\n <div className='divider-light'/>\n {nicknameSection}\n <div className='divider-light'/>\n {positionSection}\n <div className='divider-light'/>\n {emailSection}\n <div className='divider-light'/>\n {customProperiesSection}\n {pictureSection}\n <div className='divider-dark'/>\n </div>\n </div>\n );\n }\n}\n\nexport default injectIntl(UserSettingsGeneralTab);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {clearErrors, logError} from 'mattermost-redux/actions/errors';\nimport {getCustomProfileAttributeFields} from 'mattermost-redux/actions/general';\nimport {\n updateMe,\n sendVerificationEmail,\n setDefaultProfileImage,\n uploadProfileImage,\n saveCustomProfileAttribute,\n} from 'mattermost-redux/actions/users';\nimport {getConfig, getCustomProfileAttributes, getFeatureFlagValue} from 'mattermost-redux/selectors/entities/general';\n\nimport {getIsMobileView} from 'selectors/views/browser';\n\nimport type {GlobalState} from 'types/store';\n\nimport UserSettingsGeneralTab from './user_settings_general';\n\nfunction mapStateToProps(state: GlobalState) {\n const config = getConfig(state);\n const customProfileAttributeFields = getCustomProfileAttributes(state);\n\n const requireEmailVerification = config.RequireEmailVerification === 'true';\n const maxFileSize = parseInt(config.MaxFileSize!, 10);\n const ldapFirstNameAttributeSet = config.LdapFirstNameAttributeSet === 'true';\n const ldapLastNameAttributeSet = config.LdapLastNameAttributeSet === 'true';\n const samlFirstNameAttributeSet = config.SamlFirstNameAttributeSet === 'true';\n const samlLastNameAttributeSet = config.SamlLastNameAttributeSet === 'true';\n const ldapNicknameAttributeSet = config.LdapNicknameAttributeSet === 'true';\n const samlNicknameAttributeSet = config.SamlNicknameAttributeSet === 'true';\n const samlPositionAttributeSet = config.SamlPositionAttributeSet === 'true';\n const ldapPositionAttributeSet = config.LdapPositionAttributeSet === 'true';\n const ldapPictureAttributeSet = config.LdapPictureAttributeSet === 'true';\n const enableCustomProfileAttributes = getFeatureFlagValue(state, 'CustomProfileAttributes') === 'true';\n\n return {\n isMobileView: getIsMobileView(state),\n requireEmailVerification,\n maxFileSize,\n customProfileAttributeFields,\n ldapFirstNameAttributeSet,\n ldapLastNameAttributeSet,\n samlFirstNameAttributeSet,\n samlLastNameAttributeSet,\n ldapNicknameAttributeSet,\n samlNicknameAttributeSet,\n samlPositionAttributeSet,\n ldapPositionAttributeSet,\n ldapPictureAttributeSet,\n enableCustomProfileAttributes,\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n logError,\n clearErrors,\n updateMe,\n sendVerificationEmail,\n setDefaultProfileImage,\n uploadProfileImage,\n saveCustomProfileAttribute,\n getCustomProfileAttributeFields,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserSettingsGeneralTab);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback} from 'react';\nimport {useIntl} from 'react-intl';\n\nimport SectionNotice from 'components/section_notice';\n\nexport default function NotificationPermissionDeniedSectionNotice() {\n const intl = useIntl();\n\n const handleClick = useCallback(() => {\n window.open('https://mattermost.com/pl/manage-notifications', '_blank', 'noopener,noreferrer');\n }, []);\n\n return (\n <div className='extraContentBeforeSettingList'>\n <SectionNotice\n type='danger'\n title={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDenied.title',\n defaultMessage: 'Browser notification permission was denied',\n })}\n text={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDenied.message',\n defaultMessage: 'You\\'re missing important message and call notifications from Mattermost. To start receiving notifications, please enable notifications for Mattermost in your browser settings.',\n })}\n tertiaryButton={{\n text: intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDenied.button',\n defaultMessage: 'How to enable notifications',\n }),\n onClick: handleClick,\n }}\n />\n </div>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback} from 'react';\nimport {useIntl} from 'react-intl';\n\nimport SectionNotice from 'components/section_notice';\n\nimport {requestNotificationPermission} from 'utils/notifications';\n\ntype Props = {\n onCtaButtonClick: (permission: NotificationPermission) => void;\n}\n\nexport default function NotificationPermissionNeverGrantedSectionNotice(props: Props) {\n const intl = useIntl();\n\n const handleClick = useCallback(async () => {\n const permission = await requestNotificationPermission();\n if (permission) {\n props.onCtaButtonClick(permission);\n }\n }, [props.onCtaButtonClick]);\n\n return (\n <div className='extraContentBeforeSettingList'>\n <SectionNotice\n type='danger'\n title={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionNeverGranted.title',\n defaultMessage: 'Browser notifications are disabled',\n })}\n text={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionNeverGranted.message',\n defaultMessage: 'You\\'re missing important message and call notifications from Mattermost. Mattermost notifications are disabled by this browser.',\n })}\n primaryButton={{\n text: intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionNeverGranted.button',\n defaultMessage: 'Enable notifications',\n }),\n onClick: handleClick,\n }}\n />\n </div>\n );\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback} from 'react';\nimport {useIntl} from 'react-intl';\n\nimport SectionNotice from 'components/section_notice';\n\nexport default function NotificationPermissionUnsupportedSectionNotice() {\n const intl = useIntl();\n\n const handleClick = useCallback(async () => {\n window.open('https://mattermost.com/pl/pc-web-requirements', '_blank', 'noopener,noreferrer');\n }, []);\n\n return (\n <div className='extraContentBeforeSettingList'>\n <SectionNotice\n type='danger'\n title={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionUnsupported.title',\n defaultMessage: 'Browser notifications unsupported',\n })}\n text={intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionUnsupported.message',\n defaultMessage: 'You\\'re missing important message and call notifications from Mattermost. To start receiving notifications, please update to a supported browser.',\n })}\n tertiaryButton={{\n text: intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionUnsupported.button',\n defaultMessage: 'Update your browser',\n }),\n onClick: handleClick,\n }}\n />\n </div>\n );\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useState} from 'react';\nimport {useIntl} from 'react-intl';\n\nimport SectionNotice from 'components/section_notice';\n\nimport {NotificationPermissionDenied} from 'utils/notifications';\n\ninterface Props {\n requestDesktopNotificationPermission: () => Promise<NotificationPermission>;\n}\n\nexport default function NotificationPermissionDesktopDeniedSectionNotice(props: Props) {\n const intl = useIntl();\n\n const [checkedPermissionDenied, setCheckedPermissionDenied] = useState(false);\n\n async function handleCheckPermissionButtonClick() {\n const permission = await props.requestDesktopNotificationPermission();\n if (permission === NotificationPermissionDenied) {\n setCheckedPermissionDenied(true);\n }\n }\n\n const handleInstructionButtonClick = useCallback(() => {\n window.open('https://mattermost.com/pl/manage-notifications', '_blank', 'noopener,noreferrer');\n }, []);\n\n const title = checkedPermissionDenied ? intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDeniedDesktop.titleDenied',\n defaultMessage: 'Desktop notifications permission was denied',\n }) : intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDeniedDesktop.title',\n defaultMessage: 'Desktop notifications permission required',\n });\n\n const text = checkedPermissionDenied ? intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDeniedDesktop.messageDenied',\n defaultMessage: 'Notifications for this Mattermost server are blocked. To receive notifications, please enable them manually.',\n }) : intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDeniedDesktop.message',\n defaultMessage: \"You're missing important message and call notifications from Mattermost. To start receiving them, please enable them manually.\",\n });\n\n return (\n <div className='extraContentBeforeSettingList'>\n <SectionNotice\n type='danger'\n title={title}\n text={text}\n primaryButton={{\n text: intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDeniedDesktop.checkPermissionButton',\n defaultMessage: 'Check permission',\n }),\n onClick: handleCheckPermissionButtonClick,\n disabled: checkedPermissionDenied,\n }}\n tertiaryButton={{\n text: intl.formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionDenied.instructionButton',\n defaultMessage: 'How to enable notifications',\n }),\n onClick: handleInstructionButtonClick,\n }}\n />\n </div>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useState} from 'react';\n\nimport {useDesktopAppNotificationPermission} from 'components/common/hooks/use_desktop_notification_permission';\nimport NotificationPermissionDeniedNotice from 'components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_denied_section_notice';\nimport NotificationPermissionNeverGrantedNotice from 'components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_never_granted_section_notice';\nimport NotificationPermissionUnsupportedSectionNotice from 'components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice/notification_permission_unsupported_section_notice';\n\nimport {getNotificationPermission, isNotificationAPISupported, NotificationPermissionDenied, NotificationPermissionNeverGranted} from 'utils/notifications';\n\nimport NotificationPermissionDesktopDeniedSectionNotice from './notification_permission_desktop_denied_section_notice';\n\nexport default function NotificationPermissionSectionNotice() {\n const isNotificationSupported = isNotificationAPISupported();\n\n const [notificationPermission, setNotificationPermission] = useState(getNotificationPermission());\n\n const [desktopNotificationPermission, requestDesktopNotificationPermission] = useDesktopAppNotificationPermission();\n\n function handleRequestNotificationClicked(permission: NotificationPermission) {\n setNotificationPermission(permission);\n }\n\n if (!isNotificationSupported) {\n return <NotificationPermissionUnsupportedSectionNotice/>;\n }\n\n if (desktopNotificationPermission === NotificationPermissionDenied) {\n return <NotificationPermissionDesktopDeniedSectionNotice requestDesktopNotificationPermission={requestDesktopNotificationPermission}/>;\n }\n\n if (isNotificationSupported && notificationPermission === NotificationPermissionNeverGranted) {\n return <NotificationPermissionNeverGrantedNotice onCtaButtonClick={handleRequestNotificationClicked}/>;\n }\n\n if (isNotificationSupported && notificationPermission === NotificationPermissionDenied) {\n return <NotificationPermissionDeniedNotice/>;\n }\n\n return null;\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {useIntl} from 'react-intl';\n\nimport {useDesktopAppNotificationPermission} from 'components/common/hooks/use_desktop_notification_permission';\nimport Tag from 'components/widgets/tag/tag';\n\nimport {\n getNotificationPermission,\n isNotificationAPISupported,\n NotificationPermissionDenied,\n NotificationPermissionNeverGranted,\n} from 'utils/notifications';\n\nexport default function NotificationPermissionTitleTag() {\n const {formatMessage} = useIntl();\n\n const [desktopNotificationPermission] = useDesktopAppNotificationPermission();\n\n if (!isNotificationAPISupported()) {\n return (\n <Tag\n size='sm'\n variant='danger'\n icon='alert-outline'\n text={formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.noPermissionIssueTag',\n defaultMessage: 'Not supported',\n })}\n />\n );\n }\n\n if (\n getNotificationPermission() === NotificationPermissionNeverGranted ||\n getNotificationPermission() === NotificationPermissionDenied ||\n desktopNotificationPermission === NotificationPermissionDenied\n ) {\n return (\n <Tag\n size='sm'\n variant='dangerDim'\n icon='alert-outline'\n text={formatMessage({\n id: 'user.settings.notifications.desktopAndMobile.notificationSection.permissionIssueTag',\n defaultMessage: 'Permission required',\n })}\n />\n );\n }\n\n return null;\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {Fragment, useCallback, useEffect, useMemo, useRef, memo} from 'react';\nimport type {ChangeEvent, ReactNode} from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport ReactSelect from 'react-select';\nimport type {ValueType, OptionsType} from 'react-select';\n\nimport type {UserNotifyProps} from '@mattermost/types/users';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\nimport NotificationPermissionSectionNotice from 'components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_section_notice';\nimport NotificationPermissionTitleTag from 'components/user_settings/notifications/desktop_and_mobile_notification_setting/notification_permission_title_tag';\n\nimport Constants, {NotificationLevels, UserSettingsNotificationSections} from 'utils/constants';\n\nimport type {Props as UserSettingsNotificationsProps} from '../user_settings_notifications';\n\nexport type SelectOption = {\n label: ReactNode;\n value: string;\n};\n\nexport type Props = {\n active: boolean;\n updateSection: (section: string) => void;\n onSubmit: () => void;\n onCancel: () => void;\n saving: boolean;\n error: string;\n setParentState: (key: string, value: string | boolean) => void;\n areAllSectionsInactive: boolean;\n isCollapsedThreadsEnabled: boolean;\n desktopActivity: UserNotifyProps['desktop'];\n sendPushNotifications: UserSettingsNotificationsProps['sendPushNotifications'];\n pushActivity: UserNotifyProps['push'];\n pushStatus: UserNotifyProps['push_status'];\n desktopThreads: UserNotifyProps['desktop_threads'];\n pushThreads: UserNotifyProps['push_threads'];\n desktopAndMobileSettingsDifferent: boolean;\n};\n\nfunction DesktopAndMobileNotificationSettings({\n active,\n updateSection,\n onSubmit,\n onCancel,\n saving,\n error,\n setParentState,\n areAllSectionsInactive,\n isCollapsedThreadsEnabled,\n desktopActivity,\n sendPushNotifications,\n pushActivity,\n pushStatus,\n desktopThreads,\n pushThreads,\n desktopAndMobileSettingsDifferent,\n}: Props) {\n const editButtonRef = useRef<SettingItemMinComponent>(null);\n const previousActiveRef = useRef(active);\n\n // Focus back on the edit button, after this section was closed after it was opened\n useEffect(() => {\n if (previousActiveRef.current && !active && areAllSectionsInactive) {\n editButtonRef.current?.focus();\n }\n\n previousActiveRef.current = active;\n }, [active, areAllSectionsInactive]);\n\n const handleChangeForSendDesktopNotificationsRadio = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n setParentState('desktopActivity', value);\n }, [setParentState]);\n\n const handleChangeForDesktopThreadsCheckbox = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION;\n setParentState('desktopThreads', value);\n }, [setParentState]);\n\n const handleChangeForDifferentMobileNotificationsCheckbox = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.checked;\n setParentState('desktopAndMobileSettingsDifferent', value);\n }, [setParentState]);\n\n const handleChangeForSendMobileNotificationsSelect = useCallback((selectedOption: ValueType<SelectOption>) => {\n if (selectedOption && 'value' in selectedOption) {\n setParentState('pushActivity', selectedOption.value);\n }\n }, [setParentState]);\n\n const handleChangeForMobileThreadsCheckbox = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION;\n setParentState('pushThreads', value);\n }, [setParentState]);\n\n const handleChangeForTriggerMobileNotificationsSelect = useCallback((selectedOption: ValueType<SelectOption>) => {\n if (selectedOption && 'value' in selectedOption) {\n setParentState('pushStatus', selectedOption.value);\n }\n }, [setParentState]);\n\n const maximizedSettingsInputs = useMemo(() => {\n const maximizedSettingInputs = [];\n\n const sendDesktopNotificationsSection = (\n <fieldset\n id='sendDesktopNotificationsSection'\n key='sendDesktopNotificationsSection'\n >\n <legend className='form-legend'>\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.sendDesktopNotificationFor'\n defaultMessage='Send notifications for:'\n />\n </legend>\n {optionsOfSendNotifications.map((optionOfSendNotifications) => (\n <div\n key={optionOfSendNotifications.value}\n className='radio'\n >\n <label>\n <input\n type='radio'\n checked={desktopActivity === optionOfSendNotifications.value}\n value={optionOfSendNotifications.value}\n onChange={handleChangeForSendDesktopNotificationsRadio}\n />\n {optionOfSendNotifications.label}\n </label>\n </div>\n ))}\n </fieldset>\n );\n maximizedSettingInputs.push(sendDesktopNotificationsSection);\n\n if (shouldShowDesktopThreadsSection(isCollapsedThreadsEnabled, desktopActivity)) {\n const desktopThreadNotificationSection = (\n <Fragment key='desktopThreadNotificationSection'>\n <br/>\n <div className='checkbox single-checkbox'>\n <label>\n <input\n type='checkbox'\n checked={desktopThreads === NotificationLevels.ALL}\n onChange={handleChangeForDesktopThreadsCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.notifyForDesktopthreads'\n defaultMessage={'Notify me about replies to threads I\\'m following'}\n />\n </label>\n </div>\n </Fragment>\n );\n maximizedSettingInputs.push(desktopThreadNotificationSection);\n }\n\n if (sendPushNotifications) {\n const differentMobileNotificationsSection = (\n <Fragment key='differentMobileNotificationsSection'>\n <hr/>\n <div className='checkbox single-checkbox'>\n <label>\n <input\n type='checkbox'\n checked={desktopAndMobileSettingsDifferent}\n onChange={handleChangeForDifferentMobileNotificationsCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.differentMobileNotificationsTitle'\n defaultMessage='Use different settings for my mobile devices'\n />\n </label>\n </div>\n </Fragment>\n );\n maximizedSettingInputs.push(differentMobileNotificationsSection);\n }\n\n if (shouldShowSendMobileNotificationsSection(sendPushNotifications, desktopAndMobileSettingsDifferent)) {\n const sendMobileNotificationsSection = (\n <React.Fragment key='sendMobileNotificationsSection'>\n <br/>\n <label\n id='sendMobileNotificationsLabel'\n htmlFor='sendMobileNotificationsSelectInput'\n className='singleSelectLabel'\n >\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.sendMobileNotificationsFor'\n defaultMessage='Send mobile notifications for:'\n />\n </label>\n <ReactSelect\n inputId='sendMobileNotificationsSelectInput'\n aria-labelledby='sendMobileNotificationsLabel'\n className='react-select singleSelect'\n classNamePrefix='react-select'\n options={optionsOfSendNotifications}\n clearable={false}\n isClearable={false}\n isSearchable={false}\n components={{IndicatorSeparator: NoIndicatorSeparatorComponent}}\n value={getValueOfSendMobileNotificationForSelect(pushActivity)}\n onChange={handleChangeForSendMobileNotificationsSelect}\n />\n </React.Fragment>\n );\n maximizedSettingInputs.push(sendMobileNotificationsSection);\n }\n\n if (shouldShowMobileThreadsSection(sendPushNotifications, isCollapsedThreadsEnabled, desktopAndMobileSettingsDifferent, pushActivity)) {\n const threadNotificationSection = (\n <Fragment key='threadNotificationSection'>\n <br/>\n <div className='checkbox single-checkbox'>\n <label>\n <input\n type='checkbox'\n checked={pushThreads === NotificationLevels.ALL}\n onChange={handleChangeForMobileThreadsCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.notifyForMobilethreads'\n defaultMessage={'Notify me on mobile about replies to threads I\\'m following'}\n />\n </label>\n </div>\n </Fragment>\n );\n maximizedSettingInputs.push(threadNotificationSection);\n }\n\n if (shouldShowTriggerMobileNotificationsSection(sendPushNotifications, desktopActivity, pushActivity, desktopAndMobileSettingsDifferent)) {\n const triggerMobileNotificationsSection = (\n <React.Fragment key='triggerMobileNotificationsSection'>\n <br/>\n <label\n id='pushMobileNotificationsLabel'\n htmlFor='pushMobileNotificationSelectInput'\n className='singleSelectLabel'\n >\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.pushNotification'\n defaultMessage='Trigger mobile notifications when I am:'\n />\n </label>\n <ReactSelect\n inputId='pushMobileNotificationSelectInput'\n aria-labelledby='pushMobileNotificationsLabel'\n className='react-select singleSelect'\n classNamePrefix='react-select'\n options={optionsOfSendMobileNotificationsWhenSelect}\n clearable={false}\n isClearable={false}\n isSearchable={false}\n components={{IndicatorSeparator: NoIndicatorSeparatorComponent}}\n value={getValueOfSendMobileNotificationWhenSelect(pushStatus)}\n onChange={handleChangeForTriggerMobileNotificationsSelect}\n />\n </React.Fragment>\n );\n maximizedSettingInputs.push(triggerMobileNotificationsSection);\n }\n\n if (!sendPushNotifications) {\n const disabledPushNotificationsSection = (\n <>\n <br/>\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.pushNotificationsDisabled'\n defaultMessage={'Mobile push notifications haven\\'t been enabled by your system administrator.'}\n />\n </>\n );\n maximizedSettingInputs.push(disabledPushNotificationsSection);\n }\n\n return maximizedSettingInputs;\n },\n [\n desktopActivity,\n handleChangeForSendDesktopNotificationsRadio,\n isCollapsedThreadsEnabled,\n desktopThreads,\n handleChangeForDesktopThreadsCheckbox,\n sendPushNotifications,\n desktopAndMobileSettingsDifferent,\n handleChangeForDifferentMobileNotificationsCheckbox,\n pushActivity,\n handleChangeForSendMobileNotificationsSelect,\n pushThreads,\n handleChangeForMobileThreadsCheckbox,\n pushStatus,\n handleChangeForTriggerMobileNotificationsSelect,\n ]);\n\n function handleChangeForMaxSection(section: string) {\n updateSection(section);\n }\n\n function handleChangeForMinSection(section: string) {\n updateSection(section);\n onCancel();\n }\n\n if (active) {\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id={'user.settings.notifications.desktopAndMobile.title'}\n defaultMessage='Desktop and mobile notifications'\n />\n }\n inputs={maximizedSettingsInputs}\n submit={onSubmit}\n saving={saving}\n serverError={error}\n updateSection={handleChangeForMaxSection}\n extraContentBeforeSettingList={<NotificationPermissionSectionNotice/>}\n />\n );\n }\n\n return (\n <SettingItemMin\n ref={editButtonRef}\n title={\n <>\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.title'\n defaultMessage='Desktop and mobile notifications'\n />\n <NotificationPermissionTitleTag/>\n </>\n }\n describe={getCollapsedText(desktopActivity, pushActivity)}\n section={UserSettingsNotificationSections.DESKTOP_AND_MOBILE}\n updateSection={handleChangeForMinSection}\n />\n );\n}\n\nfunction NoIndicatorSeparatorComponent() {\n return null;\n}\n\nconst optionsOfSendNotifications = [\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.allNewMessages'\n defaultMessage='All new messages'\n />\n ),\n value: NotificationLevels.ALL,\n },\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.onlyMentions'\n defaultMessage='Mentions, direct messages, and group messages'\n />\n ),\n value: NotificationLevels.MENTION,\n },\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.nothing'\n defaultMessage='Nothing'\n />\n ),\n value: NotificationLevels.NONE,\n },\n];\n\nexport function shouldShowDesktopThreadsSection(isCollapsedThreadsEnabled: boolean, desktopActivity: UserNotifyProps['desktop']) {\n if (!isCollapsedThreadsEnabled) {\n return false;\n }\n\n if (desktopActivity === NotificationLevels.ALL || desktopActivity === NotificationLevels.NONE) {\n return false;\n }\n\n return true;\n}\n\nexport function shouldShowMobileThreadsSection(sendPushNotifications: UserSettingsNotificationsProps['sendPushNotifications'], isCollapsedThreadsEnabled: boolean, desktopAndMobileSettingsDifferent: boolean, pushActivity: UserNotifyProps['push']) {\n if (!sendPushNotifications) {\n return false;\n }\n\n if (!isCollapsedThreadsEnabled) {\n return false;\n }\n\n if (!desktopAndMobileSettingsDifferent) {\n return false;\n }\n\n if (pushActivity === NotificationLevels.ALL || pushActivity === NotificationLevels.NONE) {\n return false;\n }\n\n return true;\n}\n\nfunction shouldShowSendMobileNotificationsSection(sendPushNotifications: UserSettingsNotificationsProps['sendPushNotifications'], desktopAndMobileSettingsDifferent: boolean) {\n if (!sendPushNotifications) {\n return false;\n }\n\n if (desktopAndMobileSettingsDifferent) {\n return true;\n }\n\n return false;\n}\n\nexport function getValueOfSendMobileNotificationForSelect(pushActivity: UserNotifyProps['push']): ValueType<SelectOption> {\n if (!pushActivity) {\n return optionsOfSendNotifications[1];\n }\n\n const option = optionsOfSendNotifications.find((option) => option.value === pushActivity);\n if (!option) {\n return optionsOfSendNotifications[1];\n }\n\n return option;\n}\n\nexport function shouldShowTriggerMobileNotificationsSection(sendPushNotifications: UserSettingsNotificationsProps['sendPushNotifications'], desktopActivity: UserNotifyProps['desktop'], pushActivity: UserNotifyProps['push'], desktopAndMobileSettingsDifferent: boolean): boolean {\n if (!sendPushNotifications) {\n return false;\n }\n\n if (!desktopActivity || !pushActivity) {\n return true;\n }\n\n if (!desktopAndMobileSettingsDifferent) {\n if (desktopActivity === NotificationLevels.NONE) {\n return false;\n }\n return true;\n }\n\n if (pushActivity === NotificationLevels.NONE) {\n return false;\n }\n\n return true;\n}\n\nconst optionsOfSendMobileNotificationsWhenSelect: OptionsType<SelectOption> = [\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.online'\n defaultMessage='Online, away, or offline'\n />\n ),\n value: Constants.UserStatuses.ONLINE,\n },\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.away'\n defaultMessage='Away or offline'\n />\n ),\n value: Constants.UserStatuses.AWAY,\n },\n {\n label: (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.offline'\n defaultMessage='Offline'\n />\n ),\n value: Constants.UserStatuses.OFFLINE,\n },\n];\n\nexport function getValueOfSendMobileNotificationWhenSelect(pushStatus?: UserNotifyProps['push_status']): ValueType<SelectOption> {\n if (!pushStatus) {\n return optionsOfSendMobileNotificationsWhenSelect[2];\n }\n\n const option = optionsOfSendMobileNotificationsWhenSelect.find((option) => option.value === pushStatus);\n if (!option) {\n return optionsOfSendMobileNotificationsWhenSelect[2];\n }\n\n return option;\n}\n\nfunction getCollapsedText(desktopActivity: UserNotifyProps['desktop'], pushActivity: UserNotifyProps['push']): ReactNode {\n if (desktopActivity === NotificationLevels.ALL) {\n if (pushActivity === NotificationLevels.ALL) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.allForDesktopAndMobile'\n defaultMessage='All new messages'\n />\n );\n } else if (pushActivity === NotificationLevels.MENTION) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.allDesktopButMobileMentions'\n defaultMessage='All new messages on desktop; mentions, direct messages, and group messages on mobile'\n />\n );\n } else if (pushActivity === NotificationLevels.NONE) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.allDesktopButMobileNone'\n defaultMessage='All new messages on desktop; never on mobile'\n />\n );\n }\n } else if (desktopActivity === NotificationLevels.MENTION) {\n if (pushActivity === NotificationLevels.ALL) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.mentionsDesktopButMobileAll'\n defaultMessage='Mentions, direct messages, and group messages on desktop; all new messages on mobile'\n />\n );\n } else if (pushActivity === NotificationLevels.MENTION) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.mentionsForDesktopAndMobile'\n defaultMessage='Mentions, direct messages, and group messages'\n />\n );\n } else if (pushActivity === NotificationLevels.NONE) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.mentionsForDesktopButMobileNone'\n defaultMessage='Mentions, direct messages, and group messages on desktop; never on mobile'\n />\n );\n }\n } else if (desktopActivity === NotificationLevels.NONE) {\n if (pushActivity === NotificationLevels.ALL) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.noneDesktopButMobileAll'\n defaultMessage='Never on desktop; all new messages on mobile'\n />\n );\n } else if (pushActivity === NotificationLevels.MENTION) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.noneDesktopButMobileMentions'\n defaultMessage='Never on desktop; mentions, direct messages, and group messages on mobile'\n />\n );\n } else if (pushActivity === NotificationLevels.NONE) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.noneForDesktopAndMobile'\n defaultMessage='Never'\n />\n );\n }\n }\n\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopAndMobile.noValidSettings'\n defaultMessage='Configure desktop and mobile settings'\n />\n );\n}\n\nexport default memo(DesktopAndMobileNotificationSettings);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ChangeEvent, ReactNode} from 'react';\nimport React, {memo, useEffect, useRef, Fragment, useMemo, useCallback} from 'react';\nimport {FormattedMessage, useIntl} from 'react-intl';\nimport type {ValueType} from 'react-select';\nimport ReactSelect from 'react-select';\n\nimport type {UserNotifyProps} from '@mattermost/types/users';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {UserSettingsNotificationSections} from 'utils/constants';\nimport {\n notificationSoundKeys,\n stopTryNotificationRing,\n tryNotificationSound,\n tryNotificationRing,\n getValueOfNotificationSoundsSelect,\n getValueOfIncomingCallSoundsSelect,\n optionsOfMessageNotificationSoundsSelect,\n optionsOfIncomingCallSoundsSelect,\n callNotificationSoundKeys,\n} from 'utils/notification_sounds';\n\nimport type {Props as UserSettingsNotificationsProps} from '../user_settings_notifications';\n\nexport type SelectOption = {\n value: string;\n label: ReactNode;\n};\n\nexport type Props = {\n active: boolean;\n updateSection: (section: string) => void;\n onSubmit: () => void;\n onCancel: () => void;\n saving: boolean;\n error: string;\n setParentState: (key: string, value: string | boolean) => void;\n areAllSectionsInactive: boolean;\n desktopSound: UserNotifyProps['desktop_sound'];\n desktopNotificationSound: UserNotifyProps['desktop_notification_sound'];\n isCallsRingingEnabled: UserSettingsNotificationsProps['isCallsRingingEnabled'];\n callsDesktopSound: UserNotifyProps['calls_desktop_sound'];\n callsNotificationSound: UserNotifyProps['calls_notification_sound'];\n};\n\nfunction DesktopNotificationSoundsSettings({\n active,\n updateSection,\n onSubmit,\n onCancel,\n saving,\n error,\n setParentState,\n areAllSectionsInactive,\n desktopSound,\n desktopNotificationSound,\n isCallsRingingEnabled,\n callsDesktopSound,\n callsNotificationSound,\n}: Props) {\n const intl = useIntl();\n\n const editButtonRef = useRef<SettingItemMinComponent>(null);\n const previousActiveRef = useRef(active);\n\n // Focus back on the edit button, after this section was closed after it was opened\n useEffect(() => {\n if (previousActiveRef.current && !active && areAllSectionsInactive) {\n editButtonRef.current?.focus();\n }\n\n previousActiveRef.current = active;\n }, [active, areAllSectionsInactive]);\n\n const handleChangeForMessageNotificationSoundCheckbox = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.checked ? 'true' : 'false';\n setParentState('desktopSound', value);\n\n if (value === 'false') {\n stopTryNotificationRing();\n }\n }, [setParentState]);\n\n const handleChangeForIncomginCallSoundCheckbox = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.checked ? 'true' : 'false';\n setParentState('callsDesktopSound', value);\n\n if (value === 'false') {\n stopTryNotificationRing();\n }\n }, [setParentState]);\n\n const handleChangeForMessageNotificationSoundSelect = useCallback((selectedOption: ValueType<SelectOption>) => {\n stopTryNotificationRing();\n\n if (selectedOption && 'value' in selectedOption) {\n setParentState('desktopNotificationSound', selectedOption.value);\n tryNotificationSound(selectedOption.value);\n }\n }, [setParentState]);\n\n const handleChangeForIncomingCallSoundSelect = useCallback((selectedOption: ValueType<SelectOption>) => {\n stopTryNotificationRing();\n\n if (selectedOption && 'value' in selectedOption) {\n setParentState('callsNotificationSound', selectedOption.value);\n tryNotificationRing(selectedOption.value);\n }\n }, [setParentState]);\n\n const maximizedSettingInputs = useMemo(() => {\n const maximizedSettingInputs = [];\n\n const isMessageNotificationSoundChecked = desktopSound === 'true';\n const messageSoundSection = (\n <Fragment key='messageSoundSection'>\n <div className='checkbox inlineCheckboxSelect'>\n <label>\n <input\n type='checkbox'\n checked={desktopSound === 'true'}\n onChange={handleChangeForMessageNotificationSoundCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.messageNotificationSound'\n defaultMessage='Message notification sound'\n />\n </label>\n <ReactSelect\n id='messageNotificationSoundSelect'\n inputId='messageNotificationSoundSelectInput'\n className='react-select inlineSelect'\n classNamePrefix='react-select'\n options={optionsOfMessageNotificationSoundsSelect}\n clearable={false}\n isClearable={false}\n isSearchable={false}\n isDisabled={!isMessageNotificationSoundChecked}\n placeholder={intl.formatMessage({\n id: 'user.settings.notifications.desktopNotificationSound.soundSelectPlaceholder',\n defaultMessage: 'Select a sound',\n })}\n components={{IndicatorSeparator: NoIndicatorSeparatorComponent}}\n value={getValueOfNotificationSoundsSelect(desktopNotificationSound)}\n onChange={handleChangeForMessageNotificationSoundSelect}\n />\n </div>\n </Fragment>\n );\n maximizedSettingInputs.push(messageSoundSection);\n\n if (isCallsRingingEnabled) {\n const isIncomingCallSoundChecked = callsDesktopSound === 'true';\n const callSoundSection = (\n <Fragment key='callSoundSection'>\n <br/>\n <div className='checkbox inlineCheckboxSelect'>\n <label>\n <input\n type='checkbox'\n checked={isIncomingCallSoundChecked}\n onChange={handleChangeForIncomginCallSoundCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.incomingCallSound'\n defaultMessage='Incoming call sound'\n />\n </label>\n <ReactSelect\n id='incomingCallSoundNotificationSelect'\n inputId='incomingCallSoundNotificationSelectInput'\n className='react-select inlineSelect'\n classNamePrefix='react-select'\n options={optionsOfIncomingCallSoundsSelect}\n clearable={false}\n isClearable={false}\n isSearchable={false}\n isDisabled={!isIncomingCallSoundChecked}\n components={{IndicatorSeparator: NoIndicatorSeparatorComponent}}\n placeholder={intl.formatMessage({\n id: 'user.settings.notifications.desktopNotificationSound.soundSelectPlaceholder',\n defaultMessage: 'Select a sound',\n })}\n value={getValueOfIncomingCallSoundsSelect(callsNotificationSound)}\n onChange={handleChangeForIncomingCallSoundSelect}\n />\n </div>\n </Fragment>\n );\n maximizedSettingInputs.push(callSoundSection);\n }\n return maximizedSettingInputs;\n },\n [\n desktopSound,\n handleChangeForMessageNotificationSoundCheckbox,\n handleChangeForMessageNotificationSoundSelect,\n desktopNotificationSound,\n isCallsRingingEnabled,\n callsDesktopSound,\n handleChangeForIncomginCallSoundCheckbox,\n callsNotificationSound,\n handleChangeForIncomingCallSoundSelect,\n ]);\n\n function handleChangeForMaxSection(section: string) {\n stopTryNotificationRing();\n updateSection(section);\n }\n\n function handleChangeForMinSection(section: string) {\n stopTryNotificationRing();\n updateSection(section);\n onCancel();\n }\n\n function handleSubmit() {\n stopTryNotificationRing();\n onSubmit();\n }\n\n if (active) {\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSounds.title'\n defaultMessage='Desktop notification sounds'\n />\n }\n inputs={maximizedSettingInputs}\n submit={handleSubmit}\n saving={saving}\n serverError={error}\n updateSection={handleChangeForMaxSection}\n />\n );\n }\n\n return (\n <SettingItemMin\n ref={editButtonRef}\n title={\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSounds.title'\n defaultMessage='Desktop notification sounds'\n />\n }\n describe={getCollapsedText(isCallsRingingEnabled, desktopSound, desktopNotificationSound, callsDesktopSound, callsNotificationSound)}\n section={UserSettingsNotificationSections.DESKTOP_NOTIFICATION_SOUND}\n updateSection={handleChangeForMinSection}\n />\n );\n}\n\nfunction NoIndicatorSeparatorComponent() {\n return null;\n}\n\nfunction getCollapsedText(\n isCallsRingingEnabled: UserSettingsNotificationsProps['isCallsRingingEnabled'],\n desktopSound: UserNotifyProps['desktop_sound'],\n desktopNotificationSound: UserNotifyProps['desktop_notification_sound'],\n callsDesktopSound: UserNotifyProps['calls_desktop_sound'],\n callsNotificationSound: UserNotifyProps['calls_notification_sound'],\n) {\n const desktopNotificationSoundIsSelected = notificationSoundKeys.includes(desktopNotificationSound as string);\n const callNotificationSoundIsSelected = callNotificationSoundKeys.includes(callsNotificationSound as string);\n\n let hasCallsSound: boolean | null = null;\n if (isCallsRingingEnabled && callNotificationSoundIsSelected) {\n if (callsDesktopSound === 'true') {\n hasCallsSound = true;\n } else {\n hasCallsSound = false;\n }\n }\n\n let hasDesktopSound: boolean | null = null;\n if (desktopNotificationSoundIsSelected) {\n if (desktopSound === 'true') {\n hasDesktopSound = true;\n } else {\n hasDesktopSound = false;\n }\n }\n\n if (hasDesktopSound !== null && hasCallsSound !== null) {\n if (hasDesktopSound && hasCallsSound) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.hasDesktopAndCallsSound'\n defaultMessage='\"{desktopSound}\" for messages, \"{callsSound}\" for calls'\n values={{\n desktopSound: desktopNotificationSound,\n callsSound: callsNotificationSound,\n }}\n />\n );\n } else if (!hasDesktopSound && hasCallsSound) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.noDesktopAndhasCallsSound'\n defaultMessage='No sound for messages, \"{callsSound}\" for calls'\n values={{callsSound: callsNotificationSound}}\n />\n );\n } else if (hasDesktopSound && !hasCallsSound) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.hasDesktopAndNoCallsSound'\n defaultMessage='\"{desktopSound}\" for messages, no sound for calls'\n values={{desktopSound: desktopNotificationSound}}\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.noDesktopAndNoCallsSound'\n defaultMessage='No sound'\n />\n );\n } else if (hasDesktopSound !== null && hasCallsSound === null) {\n if (hasDesktopSound) {\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.hasDesktopSound'\n defaultMessage='\"{desktopSound}\" for messages'\n values={{desktopSound: desktopNotificationSound}}\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.noDesktopSound'\n defaultMessage='No sound'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.notifications.desktopNotificationSound.noValidSound'\n defaultMessage='Configure desktop notification sounds'\n />\n );\n}\n\nexport default memo(DesktopNotificationSoundsSettings);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Preferences} from '../constants';\nexport function getEmailInterval(enableEmailNotification: boolean, enableEmailBatching: boolean, emailIntervalPreference: number): number {\n const {\n INTERVAL_NEVER,\n INTERVAL_IMMEDIATE,\n INTERVAL_FIFTEEN_MINUTES,\n INTERVAL_HOUR,\n } = Preferences;\n\n const validValuesWithEmailBatching = [INTERVAL_IMMEDIATE, INTERVAL_NEVER, INTERVAL_FIFTEEN_MINUTES, INTERVAL_HOUR];\n const validValuesWithoutEmailBatching = [INTERVAL_IMMEDIATE, INTERVAL_NEVER];\n\n if (!enableEmailNotification) {\n return INTERVAL_NEVER;\n } else if (enableEmailBatching && validValuesWithEmailBatching.indexOf(emailIntervalPreference) === -1) {\n // When email batching is enabled, the default interval is 15 minutes\n return INTERVAL_FIFTEEN_MINUTES;\n } else if (!enableEmailBatching && validValuesWithoutEmailBatching.indexOf(emailIntervalPreference) === -1) {\n // When email batching is not enabled, the default interval is immediately\n return INTERVAL_IMMEDIATE;\n } else if (enableEmailNotification && emailIntervalPreference === INTERVAL_NEVER) {\n // When email notification is enabled, the default interval is immediately\n return INTERVAL_IMMEDIATE;\n }\n\n return emailIntervalPreference;\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {type RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {PreferenceType} from '@mattermost/types/preferences';\nimport type {UserNotifyProps} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\nimport {getEmailInterval} from 'mattermost-redux/utils/notify_props';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {Preferences, NotificationLevels} from 'utils/constants';\nimport {a11yFocus} from 'utils/utils';\n\nconst SECONDS_PER_MINUTE = 60;\n\ntype Props = {\n active: boolean;\n updateSection: (section: string) => void;\n onSubmit: () => void;\n onCancel: () => void;\n saving?: boolean;\n error?: string;\n setParentState: (key: string, value: any) => void;\n areAllSectionsInactive: boolean;\n isCollapsedThreadsEnabled: boolean;\n enableEmail: boolean;\n onChange: (enableEmail: UserNotifyProps['email']) => void;\n threads: string;\n currentUserId: string;\n emailInterval: number;\n sendEmailNotifications: boolean;\n enableEmailBatching: boolean;\n actions: {\n savePreferences: (currentUserId: string, emailIntervalPreference: PreferenceType[]) => Promise<ActionResult>;\n };\n};\n\ntype State = {\n active: boolean;\n emailInterval: number;\n enableEmail: boolean;\n enableEmailBatching: boolean;\n sendEmailNotifications: boolean;\n newInterval: number;\n};\n\nexport default class EmailNotificationSetting extends React.PureComponent<Props, State> {\n editButtonRef: RefObject<SettingItemMinComponent>;\n\n constructor(props: Props) {\n super(props);\n\n const {\n emailInterval,\n enableEmail,\n enableEmailBatching,\n sendEmailNotifications,\n active,\n } = props;\n\n this.state = {\n active,\n emailInterval,\n enableEmail,\n enableEmailBatching,\n sendEmailNotifications,\n newInterval: getEmailInterval(enableEmail && sendEmailNotifications, enableEmailBatching, emailInterval),\n };\n\n this.editButtonRef = React.createRef();\n }\n\n static getDerivedStateFromProps(nextProps: Props, prevState: State) {\n const {\n emailInterval,\n enableEmail,\n enableEmailBatching,\n sendEmailNotifications,\n active,\n } = nextProps;\n\n // If we're re-opening this section, reset to defaults from props\n if (active && !prevState.active) {\n return {\n active,\n emailInterval,\n enableEmail,\n enableEmailBatching,\n sendEmailNotifications,\n newInterval: getEmailInterval(enableEmail && sendEmailNotifications, enableEmailBatching, emailInterval),\n };\n }\n\n if (sendEmailNotifications !== prevState.sendEmailNotifications ||\n enableEmailBatching !== prevState.enableEmailBatching ||\n emailInterval !== prevState.emailInterval ||\n active !== prevState.active\n ) {\n return {\n active,\n emailInterval,\n enableEmail,\n enableEmailBatching,\n sendEmailNotifications,\n newInterval: getEmailInterval(enableEmail && sendEmailNotifications, enableEmailBatching, emailInterval),\n };\n }\n\n return null;\n }\n\n focusEditButton(): void {\n this.editButtonRef.current?.focus();\n }\n\n handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const enableEmail = e.currentTarget.getAttribute('data-enable-email')!;\n const newInterval = parseInt(e.currentTarget.getAttribute('data-email-interval')!, 10);\n\n this.setState({\n enableEmail: enableEmail === 'true',\n newInterval,\n });\n\n a11yFocus(e.currentTarget);\n\n this.props.onChange(enableEmail as UserNotifyProps['email']);\n };\n\n handleThreadsOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.checked ? NotificationLevels.ALL : NotificationLevels.MENTION;\n this.props.setParentState('emailThreads', value);\n };\n\n handleSubmit = async () => {\n const {newInterval} = this.state;\n if (this.props.emailInterval === newInterval && this.props.enableEmail === this.state.enableEmail) {\n this.props.updateSection('');\n } else {\n // until the rest of the notification settings are moved to preferences, we have to do this separately\n const {currentUserId, actions} = this.props;\n const emailIntervalPreference = {\n user_id: currentUserId,\n category: Preferences.CATEGORY_NOTIFICATIONS,\n name: Preferences.EMAIL_INTERVAL,\n value: newInterval.toString(),\n };\n\n await actions.savePreferences(currentUserId, [emailIntervalPreference]);\n }\n\n this.props.onSubmit();\n };\n\n handleUpdateSection = (section?: string) => {\n if (section) {\n this.props.updateSection(section);\n } else {\n this.props.updateSection('');\n\n this.setState({\n enableEmail: this.props.enableEmail,\n newInterval: this.props.emailInterval,\n });\n this.props.onCancel();\n }\n };\n\n renderMinSettingView = () => {\n const {\n enableEmail,\n sendEmailNotifications,\n } = this.props;\n\n const {newInterval} = this.state;\n\n let description;\n if (!sendEmailNotifications) {\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.disabled'\n defaultMessage='Email notifications are not enabled'\n />\n );\n } else if (enableEmail) {\n switch (newInterval) {\n case Preferences.INTERVAL_IMMEDIATE:\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.immediately'\n defaultMessage='Immediately'\n />\n );\n break;\n case Preferences.INTERVAL_HOUR:\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.everyHour'\n defaultMessage='Every hour'\n />\n );\n break;\n case Preferences.INTERVAL_FIFTEEN_MINUTES:\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.everyXMinutes'\n defaultMessage='Every {count, plural, one {minute} other {{count, number} minutes}}'\n values={{count: newInterval / SECONDS_PER_MINUTE}}\n />\n );\n break;\n default:\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.never'\n defaultMessage='Never'\n />\n );\n }\n } else {\n description = (\n <FormattedMessage\n id='user.settings.notifications.email.never'\n defaultMessage='Never'\n />\n );\n }\n\n return (\n <SettingItemMin\n ref={this.editButtonRef}\n title={\n <FormattedMessage\n id='user.settings.notifications.emailNotifications'\n defaultMessage='Email notifications'\n />\n }\n describe={description}\n section={'email'}\n updateSection={this.handleUpdateSection}\n />\n );\n };\n\n renderMaxSettingView = () => {\n if (!this.props.sendEmailNotifications) {\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.notifications.emailNotifications'\n defaultMessage='Email notifications'\n />\n }\n inputs={[\n <div\n key='oauthEmailInfo'\n className='pt-2'\n >\n <FormattedMessage\n id='user.settings.notifications.email.disabled_long'\n defaultMessage='Email notifications have not been enabled by your System Administrator.'\n />\n </div>,\n ]}\n serverError={this.props.error}\n section={'email'}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n const {newInterval} = this.state;\n let batchingOptions = null;\n let batchingInfo = null;\n if (this.props.enableEmailBatching) {\n batchingOptions = (\n <fieldset>\n <div className='radio'>\n <label>\n <input\n id='emailNotificationMinutes'\n type='radio'\n name='emailNotifications'\n checked={newInterval === Preferences.INTERVAL_FIFTEEN_MINUTES}\n data-enable-email={'true'}\n data-email-interval={Preferences.INTERVAL_FIFTEEN_MINUTES}\n onChange={this.handleChange}\n />\n <FormattedMessage\n id='user.settings.notifications.email.everyXMinutes'\n defaultMessage='Every {count, plural, one {minute} other {{count, number} minutes}}'\n values={{count: Preferences.INTERVAL_FIFTEEN_MINUTES / SECONDS_PER_MINUTE}}\n />\n </label>\n </div>\n <div className='radio'>\n <label>\n <input\n id='emailNotificationHour'\n type='radio'\n name='emailNotifications'\n checked={newInterval === Preferences.INTERVAL_HOUR}\n data-enable-email={'true'}\n data-email-interval={Preferences.INTERVAL_HOUR}\n onChange={this.handleChange}\n />\n <FormattedMessage\n id='user.settings.notifications.email.everyHour'\n defaultMessage='Every hour'\n />\n </label>\n </div>\n </fieldset>\n );\n\n batchingInfo = (\n <FormattedMessage\n id='user.settings.notifications.emailBatchingInfo'\n defaultMessage='Notifications received over the time period selected are combined and sent in a single email.'\n />\n );\n }\n\n let threadsNotificationSelection = null;\n if (this.props.isCollapsedThreadsEnabled && this.props.enableEmail) {\n threadsNotificationSelection = (\n <React.Fragment key='userNotificationEmailThreadsOptions'>\n <hr/>\n <fieldset>\n <div className='checkbox single-checkbox'>\n <label>\n <input\n id='desktopThreadsNotificationAllActivity'\n type='checkbox'\n name='desktopThreadsNotificationLevel'\n checked={this.props.threads === NotificationLevels.ALL}\n onChange={this.handleThreadsOnChange}\n />\n <FormattedMessage\n id='user.settings.notifications.email.notifyForthreads'\n defaultMessage={'Notify me about replies to threads I’m following'}\n />\n </label>\n </div>\n </fieldset>\n </React.Fragment>\n );\n }\n\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.notifications.emailNotifications'\n defaultMessage='Email notifications'\n />\n }\n inputs={[\n <fieldset key='userNotificationEmailOptions'>\n <legend className='form-legend'>\n <FormattedMessage\n id='user.settings.notifications.email.send'\n defaultMessage='Send email notifications'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='emailNotificationImmediately'\n type='radio'\n name='emailNotifications'\n checked={newInterval === Preferences.INTERVAL_IMMEDIATE}\n data-enable-email={'true'}\n data-email-interval={Preferences.INTERVAL_IMMEDIATE}\n onChange={this.handleChange}\n />\n <FormattedMessage\n id='user.settings.notifications.email.immediately'\n defaultMessage='Immediately'\n />\n </label>\n </div>\n {batchingOptions}\n <div className='radio'>\n <label>\n <input\n id='emailNotificationNever'\n type='radio'\n name='emailNotifications'\n checked={newInterval === Preferences.INTERVAL_NEVER}\n data-enable-email={'false'}\n data-email-interval={Preferences.INTERVAL_NEVER}\n onChange={this.handleChange}\n />\n <FormattedMessage\n id='user.settings.notifications.email.never'\n defaultMessage='Never'\n />\n </label>\n </div>\n <div className='mt-3'>\n <FormattedMessage\n id='user.settings.notifications.emailInfo'\n defaultMessage='Email notifications are sent for mentions and direct messages when you are offline or away for more than 5 minutes.'\n />\n {' '}\n {batchingInfo}\n </div>\n </fieldset>,\n threadsNotificationSelection,\n ]}\n submit={this.handleSubmit}\n saving={this.props.saving}\n serverError={this.props.error}\n updateSection={this.handleUpdateSection}\n />\n );\n };\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n render() {\n if (this.props.active) {\n return this.renderMaxSettingView();\n }\n\n return this.renderMinSettingView();\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {GlobalState} from '@mattermost/types/store';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {Preferences} from 'mattermost-redux/constants';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/common';\nimport {getConfig} from 'mattermost-redux/selectors/entities/general';\nimport {get as getPreference} from 'mattermost-redux/selectors/entities/preferences';\n\nimport EmailNotificationSetting from './email_notification_setting';\n\nfunction mapStateToProps(state: GlobalState) {\n const config = getConfig(state);\n const emailInterval = parseInt(getPreference(\n state,\n Preferences.CATEGORY_NOTIFICATIONS,\n Preferences.EMAIL_INTERVAL,\n Preferences.INTERVAL_NOT_SET.toString(),\n ), 10);\n\n return {\n currentUserId: getCurrentUserId(state),\n emailInterval,\n enableEmailBatching: config.EnableEmailBatching === 'true',\n sendEmailNotifications: config.SendEmailNotifications === 'true',\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n savePreferences,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EmailNotificationSetting);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {ChangeEvent} from 'react';\nimport {defineMessage, FormattedMessage} from 'react-intl';\n\nimport LocalizedPlaceholderTextarea from 'components/localized_placeholder_textarea';\nimport SettingItemMax from 'components/setting_item_max';\n\nconst MESSAGE_MAX_LENGTH = 200;\n\ntype Props = {\n autoResponderActive: boolean;\n autoResponderMessage: string;\n updateSection: (section: string) => void;\n setParentState: (key: string, value: string | boolean) => void;\n submit: () => void;\n saving: boolean;\n error?: string;\n}\n\nexport default class ManageAutoResponder extends React.PureComponent<Props> {\n handleAutoResponderChecked = (e: ChangeEvent<HTMLInputElement>) => {\n this.props.setParentState('autoResponderActive', e.target.checked);\n };\n\n onMessageChanged = (e: ChangeEvent<HTMLTextAreaElement>) => {\n this.props.setParentState('autoResponderMessage', e.target.value);\n };\n\n render() {\n const {\n autoResponderActive,\n autoResponderMessage,\n } = this.props;\n\n let serverError;\n if (this.props.error) {\n serverError = <label className='has-error'>{this.props.error}</label>;\n }\n\n const inputs = [];\n\n const activeToggle = (\n <div\n id='autoResponderCheckbox'\n key='autoResponderCheckbox'\n className='checkbox'\n >\n <label>\n <input\n id='autoResponderActive'\n type='checkbox'\n checked={autoResponderActive}\n onChange={this.handleAutoResponderChecked}\n />\n <FormattedMessage\n id='user.settings.notifications.autoResponderEnabled'\n defaultMessage='Enabled'\n />\n </label>\n </div>\n );\n\n const message = (\n <div\n id='autoResponderMessage'\n key='autoResponderMessage'\n >\n <div className='pt-2'>\n <LocalizedPlaceholderTextarea\n style={{resize: 'none'}}\n id='autoResponderMessageInput'\n className='form-control'\n rows={5}\n placeholder={defineMessage({id: 'user.settings.notifications.autoResponderPlaceholder', defaultMessage: 'Message'})}\n value={autoResponderMessage}\n maxLength={MESSAGE_MAX_LENGTH}\n onChange={this.onMessageChanged}\n />\n {serverError}\n </div>\n </div>\n );\n\n inputs.push(activeToggle);\n if (autoResponderActive) {\n inputs.push(message);\n }\n inputs.push((\n <div\n key='autoResponderHint'\n className='mt-5'\n >\n <FormattedMessage\n id='user.settings.notifications.autoResponderHint'\n defaultMessage='Set a custom message that will be automatically sent in response to Direct Messages. Mentions in Public and Private Channels will not trigger the automated reply. Enabling Automatic Replies sets your status to Out of Office and disables email and push notifications.'\n />\n </div>\n ));\n\n return (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.notifications.autoResponder'\n defaultMessage='Automatic direct message replies'\n />\n }\n shiftEnter={true}\n submit={this.props.submit}\n saving={this.props.saving}\n inputs={inputs}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {useIntl} from 'react-intl';\n\nimport {sendTestNotification} from 'actions/notification_actions';\n\nimport {useExternalLink} from 'components/common/hooks/use_external_link';\nimport SectionNotice from 'components/section_notice';\n\nconst sectionNoticeContainerStyle: React.CSSProperties = {marginTop: 20};\n\nconst TIME_TO_SENDING = 500;\nconst TIME_TO_SEND = 500;\nconst TIME_TO_IDLE = 3000;\n\ntype Props = {\n adminMode?: boolean;\n};\n\ntype ButtonState = 'idle'|'sending'|'sent'|'error';\n\nconst SendTestNotificationNotice = ({\n adminMode = false,\n}: Props) => {\n const intl = useIntl();\n const [buttonState, setButtonState] = useState<ButtonState>('idle');\n const isSending = useRef(false);\n const timeout = useRef<NodeJS.Timeout>();\n const [externalLink] = useExternalLink('https://mattermost.com/pl/troubleshoot-notifications');\n\n const onGoToNotificationDocumentation = useCallback(() => {\n window.open(externalLink);\n }, [externalLink]);\n\n const onSendTestNotificationClick = useCallback(async () => {\n if (isSending.current) {\n return;\n }\n isSending.current = true;\n let isShowingSending = false;\n timeout.current = setTimeout(() => {\n isShowingSending = true;\n setButtonState('sending');\n }, TIME_TO_SENDING);\n const result = await sendTestNotification();\n clearTimeout(timeout.current);\n const setResult = () => {\n if (result.status === 'OK') {\n setButtonState('sent');\n } else {\n // We want to log this error into the console mainly\n // for debugging reasons. We still use the 'error' level\n // because it is an unexpected error.\n // eslint-disable-next-line no-console\n console.error(result);\n setButtonState('error');\n }\n timeout.current = setTimeout(() => {\n isSending.current = false;\n setButtonState('idle');\n }, TIME_TO_IDLE);\n };\n\n if (isShowingSending) {\n timeout.current = setTimeout(setResult, TIME_TO_SEND);\n } else {\n setResult();\n }\n }, []);\n\n useEffect(() => {\n return () => {\n clearTimeout(timeout.current);\n };\n }, []);\n\n const primaryButton = useMemo(() => {\n let text;\n let icon;\n let loading;\n switch (buttonState) {\n case 'idle':\n text = intl.formatMessage({id: 'user_settings.notifications.test_notification.send_button.send', defaultMessage: 'Send a test notification'});\n break;\n case 'sending':\n text = intl.formatMessage({id: 'user_settings.notifications.test_notification.send_button.sending', defaultMessage: 'Sending a test notification'});\n loading = true;\n break;\n case 'sent':\n text = intl.formatMessage({id: 'user_settings.notifications.test_notification.send_button.sent', defaultMessage: 'Test notification sent'});\n icon = 'icon-check';\n break;\n case 'error':\n text = intl.formatMessage({id: 'user_settings.notifications.test_notification.send_button.error', defaultMessage: 'Error sending test notification'});\n icon = 'icon-alert-outline';\n }\n return {\n onClick: onSendTestNotificationClick,\n text,\n leadingIcon: icon,\n loading,\n };\n }, [buttonState, intl, onSendTestNotificationClick]);\n\n const secondaryButton = useMemo(() => {\n return {\n onClick: onGoToNotificationDocumentation,\n text: intl.formatMessage({id: 'user_settings.notifications.test_notification.go_to_docs', defaultMessage: 'Troubleshooting docs'}),\n trailingIcon: 'icon-open-in-new',\n };\n }, [intl, onGoToNotificationDocumentation]);\n\n if (adminMode) {\n return null;\n }\n\n return (\n <>\n <div className='divider-light'/>\n <div style={sectionNoticeContainerStyle}>\n <SectionNotice\n text={intl.formatMessage({\n id: 'user_settings.notifications.test_notification.body',\n defaultMessage: 'Not receiving notifications? Start by sending a test notification to all your devices to check if they’re working as expected. If issues persist, explore ways to solve them with troubleshooting steps.',\n })}\n title={intl.formatMessage({id: 'user_settings.notifications.test_notification.title', defaultMessage: 'Troubleshooting notifications'})}\n primaryButton={primaryButton}\n tertiaryButton={secondaryButton}\n type='hint'\n />\n </div>\n </>\n );\n};\n\nexport default SendTestNotificationNotice;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable max-lines */\n\nimport React from 'react';\nimport type {ChangeEvent} from 'react';\nimport type {WrappedComponentProps} from 'react-intl';\nimport {FormattedMessage, injectIntl} from 'react-intl';\nimport type {Styles as ReactSelectStyles, ValueType} from 'react-select';\nimport CreatableReactSelect from 'react-select/creatable';\n\nimport {LightbulbOutlineIcon} from '@mattermost/compass-icons/components';\nimport type {PreferencesType} from '@mattermost/types/preferences';\nimport type {UserNotifyProps, UserProfile} from '@mattermost/types/users';\n\nimport {TrackPassiveKeywordsFeature, TrackPassiveKeywordsEvent} from 'mattermost-redux/constants/telemetry';\n\nimport {trackFeatureEvent} from 'actions/telemetry_actions.jsx';\n\nimport ExternalLink from 'components/external_link';\nimport SettingItem from 'components/setting_item';\nimport SettingItemMax from 'components/setting_item_max';\nimport RestrictedIndicator from 'components/widgets/menu/menu_items/restricted_indicator';\n\nimport Constants, {NotificationLevels, MattermostFeatures, LicenseSkus, UserSettingsNotificationSections} from 'utils/constants';\nimport {notificationSoundKeys, stopTryNotificationRing} from 'utils/notification_sounds';\nimport {a11yFocus} from 'utils/utils';\n\nimport DesktopAndMobileNotificationSettings from './desktop_and_mobile_notification_setting';\nimport DesktopNotificationSoundsSettings from './desktop_notification_sounds_setting';\nimport EmailNotificationSetting from './email_notification_setting';\nimport ManageAutoResponder from './manage_auto_responder/manage_auto_responder';\nimport SendTestNotificationNotice from './send_test_notification_notice';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nimport type {PropsFromRedux} from './index';\n\nconst WHITE_SPACE_REGEX = /\\s+/g;\nconst COMMA_REGEX = /,/g;\n\ntype MultiInputValue = {\n label: string;\n value: string;\n}\n\nexport type OwnProps = {\n user: UserProfile;\n updateSection: (section: string) => void;\n activeSection: string;\n closeModal: () => void;\n collapseModal: () => void;\n adminMode?: boolean;\n userPreferences?: PreferencesType;\n}\n\nexport type Props = PropsFromRedux & OwnProps & WrappedComponentProps;\n\ntype State = {\n enableEmail: UserNotifyProps['email'];\n desktopActivity: UserNotifyProps['desktop'];\n desktopThreads: UserNotifyProps['desktop_threads'];\n pushThreads: UserNotifyProps['push_threads'];\n emailThreads: UserNotifyProps['email_threads'];\n pushActivity: UserNotifyProps['push'];\n pushStatus: UserNotifyProps['push_status'];\n desktopSound: UserNotifyProps['desktop_sound'];\n callsDesktopSound: UserNotifyProps['calls_desktop_sound'];\n desktopNotificationSound: UserNotifyProps['desktop_notification_sound'];\n callsNotificationSound: UserNotifyProps['calls_notification_sound'];\n usernameKey: boolean;\n isCustomKeysWithNotificationInputChecked: boolean;\n customKeysWithNotification: MultiInputValue[];\n customKeysWithNotificationInputValue: string;\n customKeysWithHighlight: MultiInputValue[];\n customKeysWithHighlightInputValue: string;\n firstNameKey: boolean;\n channelKey: boolean;\n autoResponderActive: boolean;\n autoResponderMessage: UserNotifyProps['auto_responder_message'];\n notifyCommentsLevel: UserNotifyProps['comments'];\n isSaving: boolean;\n serverError: string;\n desktopAndMobileSettingsDifferent: boolean;\n};\n\nfunction getDefaultStateFromProps(props: Props): State {\n let desktop: UserNotifyProps['desktop'] = NotificationLevels.MENTION;\n let desktopThreads: UserNotifyProps['desktop_threads'] = NotificationLevels.ALL;\n let pushThreads: UserNotifyProps['push_threads'] = NotificationLevels.ALL;\n let emailThreads: UserNotifyProps['email_threads'] = NotificationLevels.ALL;\n let sound: UserNotifyProps['desktop_sound'] = 'true';\n let callsSound: UserNotifyProps['calls_desktop_sound'] = 'true';\n let desktopNotificationSound: UserNotifyProps['desktop_notification_sound'] = notificationSoundKeys[0] as UserNotifyProps['desktop_notification_sound'];\n let callsNotificationSound: UserNotifyProps['calls_notification_sound'] = 'Calm';\n let comments: UserNotifyProps['comments'] = 'never';\n let enableEmail: UserNotifyProps['email'] = 'true';\n let pushActivity: UserNotifyProps['push'] = NotificationLevels.MENTION;\n let pushStatus: UserNotifyProps['push_status'] = Constants.UserStatuses.AWAY;\n let autoResponderActive = false;\n let autoResponderMessage: UserNotifyProps['auto_responder_message'] = props.intl.formatMessage({\n id: 'user.settings.notifications.autoResponderDefault',\n defaultMessage: 'Hello, I am out of office and unable to respond to messages.',\n });\n let desktopAndMobileSettingsDifferent = true;\n\n if (props.user.notify_props) {\n if (props.user.notify_props.desktop) {\n desktop = props.user.notify_props.desktop;\n }\n if (props.user.notify_props.desktop_threads) {\n desktopThreads = props.user.notify_props.desktop_threads;\n }\n if (props.user.notify_props.push_threads) {\n pushThreads = props.user.notify_props.push_threads;\n }\n if (props.user.notify_props.email_threads) {\n emailThreads = props.user.notify_props.email_threads;\n }\n if (props.user.notify_props.desktop_sound) {\n sound = props.user.notify_props.desktop_sound;\n }\n if (props.user.notify_props.calls_desktop_sound) {\n callsSound = props.user.notify_props.calls_desktop_sound;\n }\n if (props.user.notify_props.desktop_notification_sound) {\n desktopNotificationSound = props.user.notify_props.desktop_notification_sound;\n }\n if (props.user.notify_props.calls_notification_sound) {\n callsNotificationSound = props.user.notify_props.calls_notification_sound;\n }\n if (props.user.notify_props.comments) {\n comments = props.user.notify_props.comments;\n }\n if (props.user.notify_props.email) {\n enableEmail = props.user.notify_props.email;\n }\n if (props.user.notify_props.push) {\n pushActivity = props.user.notify_props.push;\n }\n if (props.user.notify_props.push_status) {\n pushStatus = props.user.notify_props.push_status;\n }\n\n if (props.user.notify_props.auto_responder_active) {\n autoResponderActive = props.user.notify_props.auto_responder_active === 'true';\n }\n\n if (props.user.notify_props.auto_responder_message) {\n autoResponderMessage = props.user.notify_props.auto_responder_message;\n }\n\n if (props.user.notify_props.desktop && props.user.notify_props.push) {\n desktopAndMobileSettingsDifferent = areDesktopAndMobileSettingsDifferent(props.user.notify_props.desktop, props.user.notify_props.push, props.user.notify_props?.desktop_threads, props.user.notify_props?.push_threads, props.isCollapsedThreadsEnabled);\n }\n }\n\n let usernameKey = false;\n let firstNameKey = false;\n let channelKey = false;\n let isCustomKeysWithNotificationInputChecked = false;\n const customKeysWithNotification: MultiInputValue[] = [];\n const customKeysWithHighlight: MultiInputValue[] = [];\n\n if (props.user.notify_props) {\n if (props.user.notify_props?.mention_keys?.length > 0) {\n const mentionKeys = props.user.notify_props.mention_keys.split(',').filter((key) => key.length > 0);\n mentionKeys.forEach((mentionKey) => {\n // Remove username(s) from list of keys\n if (mentionKey !== props.user.username && mentionKey !== `@${props.user.username}`) {\n customKeysWithNotification.push({\n label: mentionKey,\n value: mentionKey,\n });\n }\n });\n\n // Check if username is in list of keys, if so, set the checkbox to true\n usernameKey = mentionKeys.includes(props.user.username);\n\n // Check if there are any keys in the list, if so, set the checkbox of custom keys to true\n isCustomKeysWithNotificationInputChecked = customKeysWithNotification.length > 0;\n }\n\n if (props.user.notify_props?.highlight_keys?.length > 0) {\n const highlightKeys = props.user.notify_props.highlight_keys.split(',').filter((key) => key.length > 0);\n highlightKeys.forEach((highlightKey) => {\n customKeysWithHighlight.push({\n label: highlightKey,\n value: highlightKey,\n });\n });\n }\n\n firstNameKey = props.user.notify_props?.first_name === 'true';\n channelKey = props.user.notify_props?.channel === 'true';\n }\n\n return {\n desktopActivity: desktop,\n desktopThreads,\n pushThreads,\n emailThreads,\n enableEmail,\n pushActivity,\n pushStatus,\n desktopSound: sound,\n callsDesktopSound: callsSound,\n desktopNotificationSound,\n callsNotificationSound,\n usernameKey,\n customKeysWithNotification,\n isCustomKeysWithNotificationInputChecked,\n customKeysWithNotificationInputValue: '',\n customKeysWithHighlight,\n customKeysWithHighlightInputValue: '',\n firstNameKey,\n channelKey,\n autoResponderActive,\n autoResponderMessage,\n notifyCommentsLevel: comments,\n isSaving: false,\n serverError: '',\n desktopAndMobileSettingsDifferent,\n };\n}\n\nclass NotificationsTab extends React.PureComponent<Props, State> {\n static defaultProps = {\n activeSection: '',\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = getDefaultStateFromProps(props);\n }\n\n handleSubmit = async () => {\n const data: UserNotifyProps = {...this.props.user.notify_props};\n data.email = this.state.enableEmail;\n data.desktop_sound = this.state.desktopSound;\n data.calls_desktop_sound = this.state.callsDesktopSound;\n data.desktop_notification_sound = this.state.desktopNotificationSound;\n data.calls_notification_sound = this.state.callsNotificationSound;\n data.desktop = this.state.desktopActivity;\n data.desktop_threads = this.state.desktopThreads;\n data.email_threads = this.state.emailThreads;\n data.push_status = this.state.pushStatus;\n data.comments = this.state.notifyCommentsLevel;\n data.auto_responder_active = this.state.autoResponderActive ? 'true' : 'false';\n data.auto_responder_message = this.state.autoResponderMessage;\n data.first_name = this.state.firstNameKey ? 'true' : 'false';\n data.channel = this.state.channelKey ? 'true' : 'false';\n\n if (this.state.desktopAndMobileSettingsDifferent) {\n data.push = this.state.pushActivity;\n data.push_threads = this.state.pushThreads;\n } else {\n data.push = this.state.desktopActivity;\n data.push_threads = this.state.desktopThreads;\n }\n\n if (!data.auto_responder_message || data.auto_responder_message === '') {\n data.auto_responder_message = this.props.intl.formatMessage({\n id: 'user.settings.notifications.autoResponderDefault',\n defaultMessage: 'Hello, I am out of office and unable to respond to messages.',\n });\n }\n\n const mentionKeys: string[] = [];\n if (this.state.usernameKey) {\n mentionKeys.push(this.props.user.username);\n }\n if (this.state.isCustomKeysWithNotificationInputChecked && this.state.customKeysWithNotification.length > 0) {\n this.state.customKeysWithNotification.forEach((key) => {\n mentionKeys.push(key.value);\n });\n }\n data.mention_keys = mentionKeys.join(',');\n\n const highlightKeys: string[] = [];\n if (this.state.customKeysWithHighlight.length > 0) {\n this.state.customKeysWithHighlight.forEach((key) => {\n highlightKeys.push(key.value);\n });\n }\n data.highlight_keys = highlightKeys.join(',');\n if (this.props.user.notify_props?.highlight_keys !== data.highlight_keys && data.highlight_keys.length > 0) {\n trackFeatureEvent(TrackPassiveKeywordsFeature, TrackPassiveKeywordsEvent);\n }\n\n this.setState({isSaving: true});\n stopTryNotificationRing();\n\n let updatedUser: UserProfile | undefined;\n let error;\n\n if (this.props.adminMode) {\n const payloadUser = {...this.props.user, notify_props: data};\n const response = await this.props.patchUser(payloadUser);\n updatedUser = response.data;\n error = response.error;\n } else {\n const response = await this.props.updateMe({notify_props: data});\n updatedUser = response.data;\n error = response.error;\n }\n\n if (updatedUser) {\n this.handleUpdateSection('');\n this.setState(getDefaultStateFromProps(this.props));\n } else if (error) {\n this.setState({serverError: error.message, isSaving: false});\n } else {\n this.setState({serverError: '', isSaving: false});\n }\n };\n\n handleCancel = (): void => {\n this.setState(getDefaultStateFromProps(this.props));\n stopTryNotificationRing();\n };\n\n handleUpdateSection = (section: string): void => {\n if (section) {\n this.props.updateSection(section);\n } else {\n this.props.updateSection('');\n }\n this.setState({isSaving: false});\n this.handleCancel();\n };\n\n setStateValue = (key: string, value: string | boolean): void => {\n const data: {[key: string]: string | boolean } = {};\n data[key] = value;\n this.setState((prevState) => ({...prevState, ...data}));\n };\n\n handleNotifyCommentsRadio = (notifyCommentsLevel: UserNotifyProps['comments'], e?: React.ChangeEvent): void => {\n this.setState({notifyCommentsLevel});\n a11yFocus(e?.currentTarget as HTMLElement);\n };\n\n handleEmailRadio = (enableEmail: UserNotifyProps['email']): void => {\n this.setState({enableEmail});\n };\n\n handleChangeForUsernameKeyCheckbox = (event: ChangeEvent<HTMLInputElement>) => {\n const {target: {checked}} = event;\n this.setState({usernameKey: checked});\n };\n\n handleChangeForFirstNameKeyCheckbox = (event: ChangeEvent<HTMLInputElement>) => {\n const {target: {checked}} = event;\n this.setState({firstNameKey: checked});\n };\n\n handleChangeForChannelKeyCheckbox = (event: ChangeEvent<HTMLInputElement>) => {\n const {target: {checked}} = event;\n this.setState({channelKey: checked});\n };\n\n handleChangeForCustomKeysWithNotificationCheckbox = (event: ChangeEvent<HTMLInputElement>) => {\n const {target: {checked}} = event;\n this.setState({isCustomKeysWithNotificationInputChecked: checked});\n };\n\n handleChangeForCustomKeysWithNotificationInput = (values: ValueType<{ value: string }>) => {\n if (values && Array.isArray(values) && values.length > 0) {\n // Check the custom keys input checkbox when atleast a single key is entered\n if (this.state.isCustomKeysWithNotificationInputChecked === false) {\n this.setState({\n isCustomKeysWithNotificationInputChecked: true,\n });\n }\n\n const customKeysWithNotification = values.\n map((value: MultiInputValue) => {\n // Remove all spaces from the value\n const formattedValue = value.value.trim().replace(WHITE_SPACE_REGEX, '');\n return {value: formattedValue, label: formattedValue};\n }).\n filter((value) => value.value.length > 0);\n this.setState({customKeysWithNotification});\n } else {\n this.setState({\n isCustomKeysWithNotificationInputChecked: false,\n customKeysWithNotification: [],\n });\n }\n };\n\n updateCustomKeysWithNotificationWithInputValue = (newValue: string) => {\n const customKeysWithNotification = [\n ...this.state.customKeysWithNotification,\n {\n value: newValue,\n label: newValue,\n },\n ];\n\n this.setState({\n customKeysWithNotification,\n customKeysWithNotificationInputValue: '', // Clear the input field\n });\n\n if (!this.state.isCustomKeysWithNotificationInputChecked) {\n this.setState({isCustomKeysWithNotificationInputChecked: true});\n }\n };\n\n handleOnKeydownForCustomKeysWithNotificationInput = (event: React.KeyboardEvent) => {\n if (event.key === Constants.KeyCodes.COMMA[0] || event.key === Constants.KeyCodes.TAB[0]) {\n const unsavedCustomKeyWithNotification = this.state.customKeysWithNotificationInputValue?.trim()?.replace(WHITE_SPACE_REGEX, '')?.replace(COMMA_REGEX, '') ?? '';\n if (unsavedCustomKeyWithNotification.length > 0) {\n this.updateCustomKeysWithNotificationWithInputValue(unsavedCustomKeyWithNotification);\n }\n }\n };\n\n handleChangeForCustomKeysWithNotificationInputValue = (value: string) => {\n // Check if input contains comma, if so, add the value to the list of custom keys\n if (!value.includes(Constants.KeyCodes.COMMA[0])) {\n const formattedValue = value.trim().replace(WHITE_SPACE_REGEX, '');\n this.setState({customKeysWithNotificationInputValue: formattedValue});\n }\n };\n\n handleBlurForCustomKeysWithNotificationInput = () => {\n const unsavedCustomKeyWithNotification = this.state.customKeysWithNotificationInputValue?.trim()?.replace(WHITE_SPACE_REGEX, '')?.replace(COMMA_REGEX, '') ?? '';\n if (unsavedCustomKeyWithNotification.length > 0) {\n this.updateCustomKeysWithNotificationWithInputValue(unsavedCustomKeyWithNotification);\n }\n };\n\n handleChangeForCustomKeysWithHighlightInput = (values: ValueType<{ value: string }>) => {\n if (values && Array.isArray(values) && values.length > 0) {\n const customKeysWithHighlight = values.\n map((value: MultiInputValue) => {\n const formattedValue = value.value.trim();\n return {value: formattedValue, label: formattedValue};\n }).\n filter((value) => value.value.length > 0);\n this.setState({customKeysWithHighlight});\n } else {\n this.setState({\n customKeysWithHighlight: [],\n });\n }\n };\n\n handleChangeForCustomKeysWithHighlightInputValue = (value: string) => {\n if (!value.includes(Constants.KeyCodes.COMMA[0])) {\n this.setState({customKeysWithHighlightInputValue: value});\n }\n };\n\n updateCustomKeysWithHighlightWithInputValue = (newValue: State['customKeysWithHighlightInputValue']) => {\n const unsavedCustomKeyWithHighlight = newValue?.trim()?.replace(COMMA_REGEX, '') ?? '';\n\n if (unsavedCustomKeyWithHighlight.length > 0) {\n const customKeysWithHighlight = [\n ...this.state.customKeysWithHighlight,\n {\n value: unsavedCustomKeyWithHighlight,\n label: unsavedCustomKeyWithHighlight,\n },\n ];\n\n this.setState({\n customKeysWithHighlight,\n customKeysWithHighlightInputValue: '',\n });\n }\n };\n\n handleBlurForCustomKeysWithHighlightInput = () => {\n this.updateCustomKeysWithHighlightWithInputValue(this.state.customKeysWithHighlightInputValue);\n };\n\n handleOnKeydownForCustomKeysWithHighlightInput = (event: React.KeyboardEvent) => {\n if (event.key === Constants.KeyCodes.COMMA[0] || event.key === Constants.KeyCodes.TAB[0]) {\n this.updateCustomKeysWithHighlightWithInputValue(this.state.customKeysWithHighlightInputValue);\n }\n };\n\n handleCloseSettingsModal = () => {\n this.props.closeModal();\n };\n\n createKeywordsWithNotificationSection = () => {\n const serverError = this.state.serverError;\n const user = this.props.user;\n const isSectionExpanded = this.props.activeSection === UserSettingsNotificationSections.KEYWORDS_MENTIONS;\n\n let expandedSection = null;\n if (isSectionExpanded) {\n const inputs = [];\n\n if (user.first_name) {\n inputs.push(\n <div key='userNotificationFirstNameOption'>\n <div className='checkbox'>\n <label>\n <input\n id='notificationTriggerFirst'\n type='checkbox'\n checked={this.state.firstNameKey}\n onChange={this.handleChangeForFirstNameKeyCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.sensitiveName'\n defaultMessage='Your case-sensitive first name \"{first_name}\"'\n values={{\n first_name: user.first_name,\n }}\n />\n </label>\n </div>\n </div>,\n );\n }\n\n inputs.push(\n <div key='userNotificationUsernameOption'>\n <div className='checkbox'>\n <label>\n <input\n id='notificationTriggerUsername'\n type='checkbox'\n checked={this.state.usernameKey}\n onChange={this.handleChangeForUsernameKeyCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.sensitiveUsername'\n defaultMessage='Your non case-sensitive username \"{username}\"'\n values={{\n username: user.username,\n }}\n />\n </label>\n </div>\n </div>,\n );\n\n inputs.push(\n <div key='userNotificationChannelOption'>\n <div className='checkbox'>\n <label>\n <input\n id='notificationTriggerShouts'\n type='checkbox'\n checked={this.state.channelKey}\n onChange={this.handleChangeForChannelKeyCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.channelWide'\n defaultMessage='Channel-wide mentions \"@channel\", \"@all\", \"@here\"'\n />\n </label>\n </div>\n </div>,\n );\n\n inputs.push(\n <div\n key='userNotificationCustomOption'\n className='customKeywordsWithNotificationSubsection'\n >\n <div className='checkbox'>\n <label>\n <input\n id='notificationTriggerCustom'\n type='checkbox'\n checked={this.state.isCustomKeysWithNotificationInputChecked}\n onChange={this.handleChangeForCustomKeysWithNotificationCheckbox}\n />\n <FormattedMessage\n id='user.settings.notifications.sensitiveCustomWords'\n defaultMessage='Other non case-sensitive words, press Tab or use commas to separate keywords:'\n />\n </label>\n </div>\n <CreatableReactSelect\n inputId='notificationTriggerCustomText'\n autoFocus={true}\n isClearable={false}\n isMulti={true}\n styles={customKeywordsSelectorStyles}\n placeholder=''\n components={{\n DropdownIndicator: () => null,\n Menu: () => null,\n MenuList: () => null,\n }}\n aria-labelledby='notificationTriggerCustom'\n onChange={this.handleChangeForCustomKeysWithNotificationInput}\n value={this.state.customKeysWithNotification}\n inputValue={this.state.customKeysWithNotificationInputValue}\n onInputChange={this.handleChangeForCustomKeysWithNotificationInputValue}\n onBlur={this.handleBlurForCustomKeysWithNotificationInput}\n onKeyDown={this.handleOnKeydownForCustomKeysWithNotificationInput}\n />\n </div>,\n );\n\n const extraInfo = (\n <FormattedMessage\n id='user.settings.notifications.keywordsWithNotification.extraInfo'\n defaultMessage='Notifications are triggered when someone sends a message that includes your username (\"@{username}\") or any of the options selected above.'\n values={{\n username: user.username,\n }}\n />\n );\n\n expandedSection = (\n <SettingItemMax\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.keywordsWithNotification.title', defaultMessage: 'Keywords that trigger notifications'})}\n inputs={inputs}\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n serverError={serverError}\n extraInfo={extraInfo}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n const selectedMentionKeys = ['@' + user.username];\n if (this.state.firstNameKey) {\n selectedMentionKeys.push(user.first_name);\n }\n if (this.state.usernameKey) {\n selectedMentionKeys.push(user.username);\n }\n if (this.state.channelKey) {\n selectedMentionKeys.push('@channel');\n selectedMentionKeys.push('@all');\n selectedMentionKeys.push('@here');\n }\n if (this.state.customKeysWithNotification.length > 0) {\n const customKeysWithNotificationStringArray = this.state.customKeysWithNotification.map((key) => key.value);\n selectedMentionKeys.push(...customKeysWithNotificationStringArray);\n }\n const collapsedDescription = selectedMentionKeys.filter((key) => key.trim().length !== 0).map((key) => `\"${key}\"`).join(', ');\n\n return (\n <SettingItem\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.keywordsWithNotification.title', defaultMessage: 'Keywords that trigger notifications'})}\n section={UserSettingsNotificationSections.KEYWORDS_MENTIONS}\n active={isSectionExpanded}\n areAllSectionsInactive={this.props.activeSection === ''}\n describe={collapsedDescription}\n updateSection={this.handleUpdateSection}\n max={expandedSection}\n />);\n };\n\n createKeywordsWithHighlightSection = () => {\n const isSectionExpanded = this.props.activeSection === UserSettingsNotificationSections.KEYWORDS_HIGHLIGHT;\n\n let expandedSection = null;\n if (isSectionExpanded) {\n const inputs = [(\n <div\n key='userNotificationHighlightOption'\n className='customKeywordsWithNotificationSubsection'\n >\n <label htmlFor='mentionKeysWithHighlightInput'>\n <FormattedMessage\n id='user.settings.notifications.keywordsWithHighlight.inputTitle'\n defaultMessage='Enter non case-sensitive keywords, press Tab or use commas to separate them:'\n />\n </label>\n <CreatableReactSelect\n inputId='mentionKeysWithHighlightInput'\n autoFocus={true}\n isClearable={false}\n isMulti={true}\n styles={customKeywordsSelectorStyles}\n placeholder=''\n components={{\n DropdownIndicator: () => null,\n Menu: () => null,\n MenuList: () => null,\n }}\n aria-labelledby='mentionKeysWithHighlightInput'\n onChange={this.handleChangeForCustomKeysWithHighlightInput}\n value={this.state.customKeysWithHighlight}\n inputValue={this.state.customKeysWithHighlightInputValue}\n onInputChange={this.handleChangeForCustomKeysWithHighlightInputValue}\n onBlur={this.handleBlurForCustomKeysWithHighlightInput}\n onKeyDown={this.handleOnKeydownForCustomKeysWithHighlightInput}\n />\n </div>\n )];\n\n const extraInfo = (\n <FormattedMessage\n id='user.settings.notifications.keywordsWithHighlight.extraInfo'\n defaultMessage='These keywords will be shown to you with a highlight when anyone sends a message that includes them.'\n />\n );\n\n expandedSection = (\n <SettingItemMax\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.keywordsWithHighlight.title', defaultMessage: 'Keywords that get highlighted (without notifications)'})}\n inputs={inputs}\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n serverError={this.state.serverError}\n extraInfo={extraInfo}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n let collapsedDescription = this.props.intl.formatMessage({id: 'user.settings.notifications.keywordsWithHighlight.none', defaultMessage: 'None'});\n if (!this.props.isEnterpriseOrCloudOrSKUStarterFree && this.props.isEnterpriseReady && this.state.customKeysWithHighlight.length > 0) {\n const customKeysWithHighlightStringArray = this.state.customKeysWithHighlight.map((key) => key.value);\n collapsedDescription = customKeysWithHighlightStringArray.map((key) => `\"${key}\"`).join(', ');\n }\n\n const collapsedEditButtonWhenDisabled = (\n <RestrictedIndicator\n blocked={this.props.isEnterpriseOrCloudOrSKUStarterFree && this.props.isEnterpriseReady}\n feature={MattermostFeatures.HIGHLIGHT_WITHOUT_NOTIFICATION}\n minimumPlanRequiredForFeature={LicenseSkus.Professional}\n tooltipTitle={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.disabledTooltipTitle',\n defaultMessage: 'Professional feature',\n })}\n tooltipMessageBlocked={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.disabledTooltipMessage',\n defaultMessage:\n 'This feature is available on the Professional plan',\n })}\n titleAdminPreTrial={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.titleAdminPreTrial',\n defaultMessage: 'Highlight keywords without notifications with Mattermost Professional',\n })}\n messageAdminPreTrial={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.messageAdminPreTrial',\n defaultMessage: 'Get the ability to passively highlight keywords that you care about. Upgrade to Professional plan to unlock this feature.',\n })}\n titleAdminPostTrial={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.titleAdminPostTrial',\n defaultMessage: 'Highlight keywords without notifications with Mattermost Professional',\n })}\n messageAdminPostTrial={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.messageAdminPostTrial',\n defaultMessage: 'Get the ability to passively highlight keywords that you care about. Upgrade to Professional plan to unlock this feature.',\n },\n )}\n titleEndUser={this.props.intl.formatMessage({\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.titleEndUser',\n defaultMessage: 'Highlight keywords without notifications with Mattermost Professional',\n })}\n messageEndUser={this.props.intl.formatMessage(\n {\n id: 'user.settings.notifications.keywordsWithHighlight.userModal.messageEndUser',\n defaultMessage: 'Get the ability to passively highlight keywords that you care about.{br}{br}Request your admin to upgrade to Mattermost Professional to access this feature.',\n },\n {\n br: <br/>,\n },\n )}\n ctaExtraContent={\n <FormattedMessage\n id='user.settings.notifications.keywordsWithHighlight.professional'\n defaultMessage='Professional'\n />\n }\n clickCallback={this.handleCloseSettingsModal}\n />\n );\n\n return (\n <SettingItem\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.keywordsWithHighlight.title', defaultMessage: 'Keywords that get highlighted (without notifications)'})}\n section={UserSettingsNotificationSections.KEYWORDS_HIGHLIGHT}\n active={isSectionExpanded}\n areAllSectionsInactive={this.props.activeSection === ''}\n describe={collapsedDescription}\n updateSection={this.handleUpdateSection}\n max={expandedSection}\n isDisabled={this.props.isEnterpriseOrCloudOrSKUStarterFree && this.props.isEnterpriseReady}\n collapsedEditButtonWhenDisabled={collapsedEditButtonWhenDisabled}\n />);\n };\n\n createCommentsSection = () => {\n const serverError = this.state.serverError;\n\n let max = null;\n if (this.props.activeSection === UserSettingsNotificationSections.REPLY_NOTIFCATIONS) {\n const commentsActive = [false, false, false];\n if (this.state.notifyCommentsLevel === 'never') {\n commentsActive[2] = true;\n } else if (this.state.notifyCommentsLevel === 'root') {\n commentsActive[1] = true;\n } else {\n commentsActive[0] = true;\n }\n\n const inputs = [];\n\n inputs.push(\n <fieldset key='userNotificationLevelOption'>\n <legend className='form-legend hidden-label'>\n <FormattedMessage\n id='user.settings.notifications.comments'\n defaultMessage='Reply notifications'\n />\n </legend>\n <div className='radio'>\n <label>\n <input\n id='notificationCommentsAny'\n type='radio'\n name='commentsNotificationLevel'\n checked={commentsActive[0]}\n onChange={this.handleNotifyCommentsRadio.bind(this, 'any')}\n />\n <FormattedMessage\n id='user.settings.notifications.commentsAny'\n defaultMessage='Trigger notifications on messages in reply threads that I start or participate in'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='notificationCommentsRoot'\n type='radio'\n name='commentsNotificationLevel'\n checked={commentsActive[1]}\n onChange={this.handleNotifyCommentsRadio.bind(this, 'root')}\n />\n <FormattedMessage\n id='user.settings.notifications.commentsRoot'\n defaultMessage='Trigger notifications on messages in threads that I start'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n id='notificationCommentsNever'\n type='radio'\n name='commentsNotificationLevel'\n checked={commentsActive[2]}\n onChange={this.handleNotifyCommentsRadio.bind(this, 'never')}\n />\n <FormattedMessage\n id='user.settings.notifications.commentsNever'\n defaultMessage=\"Do not trigger notifications on messages in reply threads unless I'm mentioned\"\n />\n </label>\n </div>\n </fieldset>,\n );\n\n const extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.notifications.commentsInfo'\n defaultMessage=\"In addition to notifications for when you're mentioned, select if you would like to receive notifications on reply threads.\"\n />\n </span>\n );\n\n max = (\n <SettingItemMax\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.comments', defaultMessage: 'Reply notifications'})}\n extraInfo={extraInfo}\n inputs={inputs}\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n serverError={serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n let describe: JSX.Element;\n if (this.state.notifyCommentsLevel === 'never') {\n describe = (\n <FormattedMessage\n id='user.settings.notifications.commentsNever'\n defaultMessage=\"Do not trigger notifications on messages in reply threads unless I'm mentioned\"\n />\n );\n } else if (this.state.notifyCommentsLevel === 'root') {\n describe = (\n <FormattedMessage\n id='user.settings.notifications.commentsRoot'\n defaultMessage='Trigger notifications on messages in threads that I start'\n />\n );\n } else {\n describe = (\n <FormattedMessage\n id='user.settings.notifications.commentsAny'\n defaultMessage='Trigger notifications on messages in reply threads that I start or participate in'\n />\n );\n }\n\n return (\n <SettingItem\n title={this.props.intl.formatMessage({id: 'user.settings.notifications.comments', defaultMessage: 'Reply notifications'})}\n active={this.props.activeSection === UserSettingsNotificationSections.REPLY_NOTIFCATIONS}\n describe={describe}\n section={UserSettingsNotificationSections.REPLY_NOTIFCATIONS}\n updateSection={this.handleUpdateSection}\n max={max}\n areAllSectionsInactive={this.props.activeSection === ''}\n />\n );\n };\n\n createAutoResponderSection = () => {\n const describe = this.state.autoResponderActive ? (\n <FormattedMessage\n id='user.settings.notifications.autoResponderEnabled'\n defaultMessage='Enabled'\n />\n ) : (\n <FormattedMessage\n id='user.settings.notifications.autoResponderDisabled'\n defaultMessage='Disabled'\n />\n );\n\n return (\n <SettingItem\n active={this.props.activeSection === UserSettingsNotificationSections.AUTO_RESPONDER}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.notifications.autoResponder'\n defaultMessage='Automatic direct message replies'\n />\n }\n describe={describe}\n section={UserSettingsNotificationSections.AUTO_RESPONDER}\n updateSection={this.handleUpdateSection}\n max={(\n <div>\n <ManageAutoResponder\n autoResponderActive={this.state.autoResponderActive}\n autoResponderMessage={this.state.autoResponderMessage || ''}\n updateSection={this.handleUpdateSection}\n setParentState={this.setStateValue}\n submit={this.handleSubmit}\n error={this.state.serverError}\n saving={this.state.isSaving}\n />\n <div className='divider-dark'/>\n </div>\n )}\n />\n );\n };\n\n render() {\n const keywordsWithNotificationSection = this.createKeywordsWithNotificationSection();\n const keywordsWithHighlightSection = this.createKeywordsWithHighlightSection();\n const commentsSection = this.createCommentsSection();\n const autoResponderSection = this.createAutoResponderSection();\n\n const areAllSectionsInactive = this.props.activeSection === '';\n\n return (\n <div id='notificationSettings'>\n <SettingMobileHeader\n closeModal={this.props.closeModal}\n collapseModal={this.props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.notifications.title'\n defaultMessage='Notification settings'\n />\n }\n />\n <div\n className='user-settings'\n >\n <SettingDesktopHeader\n id='notificationSettingsTitle'\n text={\n <FormattedMessage\n id='user.settings.notifications.header'\n defaultMessage='Notifications'\n />\n }\n info={\n <FormattedMessage\n id='user.settings.notifications.learnMore'\n defaultMessage='<a>Learn more about notifications</a>'\n values={{\n a: (chunks: string) => ((\n <ExternalLink\n location='user_settings_notifications'\n href='https://mattermost.com/pl/about-notifications'\n className='btn btn-link'\n >\n <LightbulbOutlineIcon className='circular-border'/>\n <span>{chunks}</span>\n </ExternalLink>\n )),\n }}\n />\n }\n />\n <div className='divider-dark first'/>\n <DesktopAndMobileNotificationSettings\n active={this.props.activeSection === UserSettingsNotificationSections.DESKTOP_AND_MOBILE}\n updateSection={this.handleUpdateSection}\n onSubmit={this.handleSubmit}\n onCancel={this.handleCancel}\n saving={this.state.isSaving}\n error={this.state.serverError}\n setParentState={this.setStateValue}\n areAllSectionsInactive={areAllSectionsInactive}\n isCollapsedThreadsEnabled={this.props.isCollapsedThreadsEnabled}\n desktopActivity={this.state.desktopActivity}\n pushActivity={this.state.pushActivity}\n sendPushNotifications={this.props.sendPushNotifications}\n pushStatus={this.state.pushStatus}\n desktopThreads={this.state.desktopThreads}\n pushThreads={this.state.pushThreads}\n desktopAndMobileSettingsDifferent={this.state.desktopAndMobileSettingsDifferent}\n />\n <div className='divider-light'/>\n <DesktopNotificationSoundsSettings\n active={this.props.activeSection === UserSettingsNotificationSections.DESKTOP_NOTIFICATION_SOUND}\n updateSection={this.handleUpdateSection}\n onSubmit={this.handleSubmit}\n onCancel={this.handleCancel}\n saving={this.state.isSaving}\n error={this.state.serverError}\n setParentState={this.setStateValue}\n areAllSectionsInactive={areAllSectionsInactive}\n desktopSound={this.state.desktopSound}\n desktopNotificationSound={this.state.desktopNotificationSound}\n isCallsRingingEnabled={this.props.isCallsRingingEnabled}\n callsDesktopSound={this.state.callsDesktopSound}\n callsNotificationSound={this.state.callsNotificationSound}\n />\n <div className='divider-light'/>\n <EmailNotificationSetting\n active={this.props.activeSection === UserSettingsNotificationSections.EMAIL}\n updateSection={this.handleUpdateSection}\n onSubmit={this.handleSubmit}\n onCancel={this.handleCancel}\n saving={this.state.isSaving}\n error={this.state.serverError}\n setParentState={this.setStateValue}\n areAllSectionsInactive={areAllSectionsInactive}\n isCollapsedThreadsEnabled={this.props.isCollapsedThreadsEnabled}\n enableEmail={this.state.enableEmail === 'true'}\n onChange={this.handleEmailRadio}\n threads={this.state.emailThreads || ''}\n />\n <div className='divider-light'/>\n {keywordsWithNotificationSection}\n {(!this.props.isEnterpriseOrCloudOrSKUStarterFree && this.props.isEnterpriseReady) && (\n <>\n <div className='divider-light'/>\n {keywordsWithHighlightSection}\n </>\n )}\n <div className='divider-light'/>\n {!this.props.isCollapsedThreadsEnabled && (\n <>\n <div className='divider-light'/>\n {commentsSection}\n </>\n )}\n {this.props.enableAutoResponder && (\n <>\n <div className='divider-light'/>\n {autoResponderSection}\n </>\n )}\n\n {/* We placed the disabled items in the last */}\n {(this.props.isEnterpriseOrCloudOrSKUStarterFree && this.props.isEnterpriseReady) && (\n <>\n <div className='divider-light'/>\n {keywordsWithHighlightSection}\n </>\n )}\n <SendTestNotificationNotice adminMode={this.props.adminMode}/>\n </div>\n </div>\n\n );\n }\n}\n\nconst customKeywordsSelectorStyles: ReactSelectStyles = {\n container: ((baseStyle) => ({\n ...baseStyle,\n marginBlockStart: '10px',\n })),\n control: ((baseStyles) => ({\n ...baseStyles,\n backgroundColor: 'var(--center-channel-bg)',\n border: '1px solid rgba(var(--center-channel-color-rgb), 0.16);',\n ':hover': {\n borderColor: 'rgba(var(--center-channel-color-rgb), 0.48);',\n },\n })),\n multiValue: ((baseStyles) => ({\n ...baseStyles,\n background: 'rgba(var(--center-channel-color-rgb), 0.08)',\n })),\n multiValueLabel: ((baseStyles) => ({\n ...baseStyles,\n color: 'var(--center-channel-color);',\n })),\n input: ((baseStyles) => ({\n ...baseStyles,\n color: 'var(--center-channel-color)',\n })),\n indicatorSeparator: ((indicatorSeperatorStyles) => ({\n ...indicatorSeperatorStyles,\n display: 'none',\n })),\n multiValueRemove: ((multiValueRemoveStyles) => ({\n ...multiValueRemoveStyles,\n cursor: 'pointer',\n color: 'rgba(var(--center-channel-color-rgb),0.32);',\n ':hover': {\n backgroundColor: 'rgba(var(--center-channel-color-rgb), 0.16)',\n color: 'rgba(var(--center-channel-color-rgb), 0.56);',\n },\n })),\n};\n\nconst validNotificationLevels = Object.values(NotificationLevels);\n\n/**\n * Check's if user's global notification settings for desktop and mobile are different\n */\nexport function areDesktopAndMobileSettingsDifferent(\n desktopActivity: UserNotifyProps['desktop'],\n pushActivity?: UserNotifyProps['push'],\n desktopThreads?: UserNotifyProps['desktop_threads'],\n pushThreads?: UserNotifyProps['push_threads'],\n isCollapsedThreadsEnabled?: boolean,\n): boolean {\n if (!desktopActivity || !pushActivity || !desktopThreads || !pushThreads) {\n return true;\n }\n\n if (\n !validNotificationLevels.includes(desktopActivity) ||\n !validNotificationLevels.includes(pushActivity) ||\n !validNotificationLevels.includes(desktopThreads) ||\n !validNotificationLevels.includes(pushThreads)\n ) {\n return true;\n }\n\n if (desktopActivity === pushActivity) {\n if (isCollapsedThreadsEnabled) {\n if (desktopThreads === pushThreads) {\n return false;\n }\n return true;\n }\n return false;\n }\n\n return true;\n}\n\nexport default injectIntl(NotificationsTab);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect, type ConnectedProps} from 'react-redux';\n\nimport {patchUser, updateMe} from 'mattermost-redux/actions/users';\nimport {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud';\nimport {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';\nimport {\n isCollapsedThreadsEnabled,\n isCollapsedThreadsEnabledForUser,\n} from 'mattermost-redux/selectors/entities/preferences';\n\nimport {isCallsEnabled, isCallsRingingEnabledOnServer} from 'selectors/calls';\n\nimport {isEnterpriseOrCloudOrSKUStarterFree} from 'utils/license_utils';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './user_settings_notifications';\nimport UserSettingsNotifications from './user_settings_notifications';\n\nconst mapStateToProps = (state: GlobalState, props: OwnProps) => {\n // server config, related to server configuration, not the user\n const config = getConfig(state);\n\n const sendPushNotifications = config.SendPushNotifications === 'true';\n const enableAutoResponder = config.ExperimentalEnableAutomaticReplies === 'true';\n\n const license = getLicense(state);\n const subscriptionProduct = getSubscriptionProduct(state);\n\n const isEnterpriseReady = config.BuildEnterpriseReady === 'true';\n\n return {\n sendPushNotifications,\n enableAutoResponder,\n isCollapsedThreadsEnabled: props.adminMode && props.userPreferences ? isCollapsedThreadsEnabledForUser(state, props.userPreferences) : isCollapsedThreadsEnabled(state),\n isCallsRingingEnabled: isCallsEnabled(state, '0.17.0') && isCallsRingingEnabledOnServer(state),\n isEnterpriseOrCloudOrSKUStarterFree: isEnterpriseOrCloudOrSKUStarterFree(license, subscriptionProduct, isEnterpriseReady),\n isEnterpriseReady,\n };\n};\n\nconst mapDispatchToProps = {\n updateMe,\n patchUser,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\nexport type PropsFromRedux = ConnectedProps<typeof connector>;\n\nexport default connector(UserSettingsNotifications);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {ComponentProps} from 'react';\nimport React, {useMemo} from 'react';\n\nimport SectionNotice from 'components/section_notice';\n\nimport type {PluginConfigurationAction} from 'types/plugins/user_settings';\n\nimport './plugin_action.scss';\n\ntype Props = {\n action?: PluginConfigurationAction;\n};\n\nconst PluginAction = ({\n action,\n}: Props) => {\n const props = useMemo<ComponentProps<typeof SectionNotice>>(() => {\n return action ? {\n text: action.text,\n title: action.title,\n primaryButton: {\n onClick: action?.onClick,\n text: action?.buttonText,\n },\n } : {\n text: '',\n title: '',\n };\n }, [action]);\n\n if (!action) {\n return null;\n }\n\n return (\n <div className={'pluginActionContainer'}>\n <SectionNotice {...props}/>\n </div>\n );\n};\n\nexport default PluginAction;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nexport function getPluginPreferenceKey(pluginId: string) {\n return `pp_${pluginId}`.slice(0, 32);\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback} from 'react';\n\nimport Markdown from 'components/markdown';\n\nimport type {PluginConfigurationRadioSettingOption} from 'types/plugins/user_settings';\n\ntype Props = {\n selectedValue: string;\n name: string;\n option: PluginConfigurationRadioSettingOption;\n onSelected: (v: string) => void;\n}\n\nconst markdownOptions = {mentionHighlight: false};\n\nconst RadioOption = ({\n selectedValue,\n name,\n option,\n onSelected,\n}: Props) => {\n const onChange = useCallback(() => onSelected(option.value), [option.value]);\n return (\n <div className={'radio'}>\n <label >\n <input\n type='radio'\n name={name}\n checked={selectedValue === option.value}\n onChange={onChange}\n />\n {option.text}\n </label>\n <br/>\n {option.helpText && (\n <Markdown\n message={option.helpText}\n options={markdownOptions}\n />\n )}\n </div>\n );\n};\n\nexport default RadioOption;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useState} from 'react';\nimport {useSelector} from 'react-redux';\n\nimport {get as getPreference} from 'mattermost-redux/selectors/entities/preferences';\n\nimport Markdown from 'components/markdown';\n\nimport {getPluginPreferenceKey} from 'utils/plugins/preferences';\n\nimport type {PluginConfigurationRadioSetting} from 'types/plugins/user_settings';\nimport type {GlobalState} from 'types/store';\n\nimport RadioOption from './radio_option';\n\ntype Props = {\n setting: PluginConfigurationRadioSetting;\n pluginId: string;\n informChange: (name: string, value: string) => void;\n}\n\nconst RadioInput = ({\n setting,\n pluginId,\n informChange,\n}: Props) => {\n const preference = useSelector<GlobalState, string>((state: GlobalState) => getPreference(state, getPluginPreferenceKey(pluginId), setting.name, setting.default));\n const [selectedValue, setSelectedValue] = useState(preference);\n\n const onSelected = useCallback((value: string) => {\n setSelectedValue(value);\n informChange(setting.name, value);\n }, [setting.name]);\n\n return (\n <fieldset key={setting.name}>\n <legend className='form-legend hidden-label'>\n {setting.title || setting.name}\n </legend>\n {setting.options.map((option) => (\n <RadioOption\n key={option.value}\n name={setting.name}\n option={option}\n selectedValue={selectedValue}\n onSelected={onSelected}\n />\n ))}\n {setting.helpText && (\n <div className='mt-5'>\n <Markdown\n message={setting.helpText}\n options={{mentionHighlight: false}}\n />\n </div>\n )}\n </fieldset>\n );\n};\n\nexport default RadioInput;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useEffect, useMemo, useRef} from 'react';\nimport {useDispatch, useSelector} from 'react-redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {get as getPreference} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\n\nimport PluggableErrorBoundary from 'plugins/pluggable/error_boundary';\nimport {getPluginPreferenceKey} from 'utils/plugins/preferences';\n\nimport type {PluginConfigurationSection} from 'types/plugins/user_settings';\nimport type {GlobalState} from 'types/store';\n\nimport RadioInput from './radio';\n\ntype Props = {\n pluginId: string;\n updateSection: (section: string) => void;\n activeSection: string;\n section: PluginConfigurationSection;\n}\n\nconst PluginSetting = ({\n pluginId,\n section,\n activeSection,\n updateSection,\n}: Props) => {\n const dispatch = useDispatch();\n const userId = useSelector(getCurrentUserId);\n const preferenceMin = useSelector<GlobalState, string>((state: GlobalState) => getPreference(state, getPluginPreferenceKey(pluginId), section.settings[0].name, section.settings[0].default));\n const toUpdate = useRef<{[name: string]: string}>({});\n\n const minDescribe = useMemo(() => {\n const setting = section.settings[0];\n if (setting.type === 'radio') {\n return setting.options.find((v) => v.value === preferenceMin)?.text;\n }\n\n return undefined;\n }, [section, preferenceMin]);\n\n const onSettingChanged = useCallback((name: string, value: string) => {\n toUpdate.current[name] = value;\n }, []);\n\n const updateSetting = useCallback(async () => {\n const preferences = [];\n for (const key of Object.keys(toUpdate.current)) {\n preferences.push({\n user_id: userId,\n category: getPluginPreferenceKey(pluginId),\n name: key,\n value: toUpdate.current[key],\n });\n }\n\n if (preferences.length) {\n // Save preferences does not offer any await strategy or error handling\n // so I am leaving this as is for now. We probably should update save\n // preferences and handle any kind of error or network delay here.\n dispatch(savePreferences(userId, preferences));\n section.onSubmit?.(toUpdate.current);\n }\n\n updateSection('');\n }, [pluginId, dispatch, section.onSubmit]);\n\n useEffect(() => {\n if (activeSection !== section.title) {\n toUpdate.current = {};\n }\n }, [activeSection, section.title]);\n\n const inputs = [];\n for (const setting of section.settings) {\n if (setting.type === 'radio') {\n inputs.push(\n <RadioInput\n key={setting.name}\n setting={setting}\n informChange={onSettingChanged}\n pluginId={pluginId}\n />);\n } else if (setting.type === 'custom') {\n const CustomComponent = setting.component;\n const inputEl = (\n <PluggableErrorBoundary\n key={setting.name}\n pluginId={pluginId}\n >\n <CustomComponent informChange={onSettingChanged}/>\n </PluggableErrorBoundary>\n );\n inputs.push(inputEl);\n }\n }\n\n if (!inputs.length) {\n return null;\n }\n\n if (section.title === activeSection) {\n return (\n <SettingItemMax\n title={section.title}\n inputs={inputs}\n submit={updateSetting}\n updateSection={updateSection}\n />\n );\n }\n\n return (\n <SettingItemMin\n section={section.title}\n title={section.title}\n updateSection={updateSection}\n describe={minDescribe}\n isDisabled={section.disabled}\n />\n );\n};\n\nexport default PluginSetting;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {useIntl} from 'react-intl';\n\nimport PluggableErrorBoundary from 'plugins/pluggable/error_boundary';\n\nimport type {PluginConfiguration} from 'types/plugins/user_settings';\n\nimport PluginAction from './plugin_action';\nimport PluginSetting from './plugin_setting';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\ntype Props = {\n updateSection: (section: string) => void;\n activeSection: string;\n closeModal: () => void;\n collapseModal: () => void;\n settings: PluginConfiguration;\n}\n\nconst PluginTab = ({\n activeSection,\n closeModal,\n collapseModal,\n settings,\n updateSection,\n}: Props) => {\n const intl = useIntl();\n\n const headerText = intl.formatMessage(\n {id: 'user.settings.plugins.title', defaultMessage: '{pluginName} Settings'},\n {pluginName: settings.uiName},\n );\n\n return (\n <div>\n <SettingMobileHeader\n closeModal={closeModal}\n collapseModal={collapseModal}\n text={headerText}\n />\n <div className='user-settings'>\n <SettingDesktopHeader text={headerText}/>\n <PluginAction action={settings.action}/>\n <div className='divider-dark first'/>\n {settings.sections.map((v) => {\n let sectionEl;\n if ('component' in v) {\n const CustomComponent = v.component;\n sectionEl = (\n <PluggableErrorBoundary\n pluginId={settings.id}\n >\n <CustomComponent/>\n </PluggableErrorBoundary>\n );\n } else {\n sectionEl = (\n <PluginSetting\n pluginId={settings.id}\n activeSection={activeSection}\n section={v}\n updateSection={updateSection}\n />\n );\n }\n\n return (\n <React.Fragment key={v.title}>\n {sectionEl}\n <div className='divider-light'/>\n </React.Fragment>\n );\n },\n )}\n <div className='divider-dark'/>\n </div>\n </div>\n );\n};\n\nexport default PluginTab;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useEffect, useState} from 'react';\nimport {Modal} from 'react-bootstrap';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {Audit} from '@mattermost/types/audits';\n\nimport AuditTable from 'components/audit_table';\nimport LoadingScreen from 'components/loading_screen';\n\nimport './access_history_modal.scss';\n\ntype Props = {\n onHide: () => void;\n actions: {\n getUserAudits: (userId: string, page?: number, perPage?: number) => void;\n };\n userAudits: Audit[];\n currentUserId: string;\n}\n\nconst AccessHistoryModal = ({\n actions: {\n getUserAudits,\n },\n currentUserId,\n onHide,\n userAudits,\n}: Props) => {\n const [show, setShow] = useState(true);\n\n const onCloseClick = useCallback(() => {\n setShow(false);\n }, []);\n\n useEffect(() => {\n getUserAudits(currentUserId, 0, 200);\n }, []);\n\n let content;\n if (userAudits.length === 0) {\n content = (<LoadingScreen/>);\n } else {\n content = (\n <AuditTable\n audits={userAudits}\n showIp={true}\n showSession={true}\n />\n );\n }\n\n return (\n <Modal\n dialogClassName='a11y__modal modal--scroll access-history-modal'\n show={show}\n onHide={onCloseClick}\n onExited={onHide}\n bsSize='large'\n role='none'\n aria-labelledby='accessHistoryModalLabel'\n >\n <Modal.Header closeButton={true}>\n <Modal.Title\n componentClass='h1'\n id='accessHistoryModalLabel'\n >\n <FormattedMessage\n id='access_history.title'\n defaultMessage='Access History'\n />\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n {content}\n </Modal.Body>\n <Modal.Footer className='modal-footer--invisible'>\n <button\n id='closeModalButton'\n type='button'\n className='btn btn-tertiary'\n >\n <FormattedMessage\n id='general_button.close'\n defaultMessage='Close'\n />\n </button>\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default React.memo(AccessHistoryModal);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {getUserAudits} from 'mattermost-redux/actions/users';\nimport {getCurrentUserId, getUserAudits as getCurrentUserAudits} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport AccessHistoryModal from './access_history_modal';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n currentUserId: getCurrentUserId(state),\n userAudits: getCurrentUserAudits(state) || [],\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n getUserAudits,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AccessHistoryModal);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {MessageDescriptor} from 'react-intl';\nimport {useIntl} from 'react-intl';\n\nimport {formatAsString} from 'utils/i18n';\n\ntype Props = {\n devicePicture?: string;\n deviceTitle: MessageDescriptor | string;\n}\n\nexport default function DeviceIcon(props: Props) {\n const intl = useIntl();\n\n return (\n <i\n className={props.devicePicture}\n title={formatAsString(intl.formatMessage, props.deviceTitle)}\n />\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedDate, FormattedMessage, FormattedTime} from 'react-intl';\n\nimport type {Session} from '@mattermost/types/sessions';\n\nimport {getMonthLong} from 'utils/i18n';\n\ntype Props = {\n locale: string;\n currentSession: Session;\n handleMoreInfo: () => void;\n moreInfo: boolean;\n};\n\nexport default function MoreInfo(props: Props) {\n const {locale, currentSession, handleMoreInfo, moreInfo} = props;\n\n if (moreInfo) {\n const firstAccessTime = new Date(currentSession.create_at);\n\n return (\n <div>\n <div>\n <FormattedMessage\n id='activity_log.firstTime'\n defaultMessage='First time active: {date}, {time}'\n values={{\n date: (\n <FormattedDate\n value={firstAccessTime}\n day='2-digit'\n month={getMonthLong(locale)}\n year='numeric'\n />\n ),\n time: (\n <FormattedTime\n value={firstAccessTime}\n hour='2-digit'\n minute='2-digit'\n />\n ),\n }}\n />\n </div>\n <div>\n <FormattedMessage\n id='activity_log.os'\n defaultMessage='OS: {os}'\n values={{\n os: currentSession.props.os,\n }}\n />\n </div>\n <div>\n <FormattedMessage\n id='activity_log.browser'\n defaultMessage='Browser: {browser}'\n values={{\n browser: currentSession.props.browser,\n }}\n />\n </div>\n <div>\n <FormattedMessage\n id='activity_log.sessionId'\n defaultMessage='Session ID: {id}'\n values={{\n id: currentSession.id,\n }}\n />\n </div>\n </div>\n );\n }\n\n return (\n <a\n className='theme'\n href='#'\n onClick={handleMoreInfo}\n >\n <FormattedMessage\n id='activity_log.moreInfo'\n defaultMessage='More info'\n />\n </a>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {MessageDescriptor} from 'react-intl';\nimport {FormattedDate, FormattedMessage, FormattedTime, defineMessages} from 'react-intl';\n\nimport type {Session} from '@mattermost/types/sessions';\n\nimport {General} from 'mattermost-redux/constants';\n\nimport {getMonthLong} from 'utils/i18n';\n\nimport DeviceIcon from './device_icon';\nimport MoreInfo from './more_info';\n\ntype Props = {\n\n /**\n * The index of this instance within the list\n */\n index: number;\n\n /**\n * The current locale of the user\n */\n locale: string;\n\n /**\n * The session that's to be displayed\n */\n currentSession: Session;\n\n /**\n * Function to revoke session\n */\n submitRevoke: (sessionId: string, event: React.MouseEvent) => void;\n};\n\ntype State = {\n moreInfo: boolean;\n};\n\ntype MobileSessionInfo = {\n devicePicture?: string;\n deviceTitle?: MessageDescriptor;\n devicePlatform?: JSX.Element;\n};\n\nexport default class ActivityLog extends React.PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n moreInfo: false,\n };\n }\n\n handleMoreInfo = (): void => {\n this.setState({moreInfo: true});\n };\n\n submitRevoke = (e: React.MouseEvent): void => {\n this.props.submitRevoke(this.props.currentSession.id, e);\n };\n\n isMobileSession = (session: Session): boolean => {\n return Boolean(session.device_id && (session.device_id.includes('apple') || session.device_id.includes('android')));\n };\n\n mobileSessionInfo = (session: Session): MobileSessionInfo => {\n let devicePlatform;\n let devicePicture;\n let deviceTitle;\n\n if (session.device_id.includes('apple')) {\n devicePicture = 'fa fa-apple';\n deviceTitle = messages.appleIcon;\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.iphoneNativeClassicApp'\n defaultMessage='iPhone Native Classic App'\n />\n );\n\n if (session.device_id.includes(General.PUSH_NOTIFY_APPLE_REACT_NATIVE)) {\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.iphoneNativeApp'\n defaultMessage='iPhone Native App'\n />\n );\n }\n } else if (session.device_id.includes('android')) {\n devicePicture = 'fa fa-android';\n deviceTitle = messages.androidIcon;\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.androidNativeClassicApp'\n defaultMessage='Android Native Classic App'\n />\n );\n\n if (session.device_id.includes(General.PUSH_NOTIFY_ANDROID_REACT_NATIVE)) {\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.androidNativeApp'\n defaultMessage='Android Native App'\n />\n );\n }\n }\n\n return {\n devicePicture,\n deviceTitle,\n devicePlatform,\n };\n };\n\n render(): React.ReactNode {\n const {\n index,\n locale,\n currentSession,\n } = this.props;\n\n const lastAccessTime = new Date(currentSession.last_activity_at);\n let devicePlatform = currentSession.props.platform;\n let devicePicture: string | undefined = '';\n let deviceTitle: MessageDescriptor | string = '';\n\n if (this.isMobileSession(currentSession)) {\n const sessionInfo = this.mobileSessionInfo(currentSession);\n devicePicture = sessionInfo.devicePicture;\n devicePlatform = sessionInfo.devicePlatform;\n deviceTitle = sessionInfo.deviceTitle || deviceTitle;\n } else {\n if (currentSession.props.platform === 'Windows') {\n devicePicture = 'fa fa-windows';\n deviceTitle = messages.windowsIcon;\n } else if (currentSession.props.platform === 'Macintosh' ||\n currentSession.props.platform === 'iPhone') {\n devicePicture = 'fa fa-apple';\n deviceTitle = messages.appleIcon;\n } else if (currentSession.props.platform === 'Linux') {\n if (currentSession.props.os.indexOf('Android') >= 0) {\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.android'\n defaultMessage='Android'\n />\n );\n devicePicture = 'fa fa-android';\n deviceTitle = messages.androidIcon;\n } else {\n devicePicture = 'fa fa-linux';\n deviceTitle = messages.linuxIcon;\n }\n } else if (currentSession.props.os.indexOf('Linux') !== -1) {\n devicePicture = 'fa fa-linux';\n deviceTitle = messages.linuxIcon;\n }\n\n if (currentSession.props.browser.indexOf('Desktop App') !== -1) {\n devicePlatform = (\n <FormattedMessage\n id='activity_log_modal.desktop'\n defaultMessage='Native Desktop App'\n />\n );\n }\n }\n\n return (\n <div\n key={'activityLogEntryKey' + index}\n className='activity-log__table'\n >\n <div className='activity-log__report'>\n <div className='report__platform'>\n <DeviceIcon\n devicePicture={devicePicture}\n deviceTitle={deviceTitle}\n />\n {devicePlatform}\n </div>\n <div className='report__info'>\n <div>\n <FormattedMessage\n id='activity_log.lastActivity'\n defaultMessage='Last activity: {date}, {time}'\n values={{\n date: (\n <FormattedDate\n value={lastAccessTime}\n day='2-digit'\n month={getMonthLong(locale)}\n year='numeric'\n />\n ),\n time: (\n <FormattedTime\n value={lastAccessTime}\n hour='2-digit'\n minute='2-digit'\n />\n ),\n }}\n />\n </div>\n <MoreInfo\n locale={locale}\n currentSession={currentSession}\n moreInfo={this.state.moreInfo}\n handleMoreInfo={this.handleMoreInfo}\n />\n </div>\n </div>\n <div className='activity-log__action'>\n <button\n onClick={this.submitRevoke}\n className='btn btn-primary'\n >\n <FormattedMessage\n id='activity_log.logout'\n defaultMessage='Log Out'\n />\n </button>\n </div>\n </div>\n );\n }\n}\n\nconst messages = defineMessages({\n androidIcon: {\n id: 'device_icons.android',\n defaultMessage: 'Android Icon',\n },\n appleIcon: {\n id: 'device_icons.apple',\n defaultMessage: 'Apple Icon',\n },\n linuxIcon: {\n id: 'device_icons.linux',\n defaultMessage: 'Linux Icon',\n },\n windowsIcon: {\n id: 'device_icons.windows',\n defaultMessage: 'Windows Icon',\n },\n});\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {Modal} from 'react-bootstrap';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {Session} from '@mattermost/types/sessions';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport ActivityLog from 'components/activity_log_modal/components/activity_log';\n\nexport type Props = {\n\n /**\n * The current user id\n */\n currentUserId: string;\n\n /**\n * Current user's sessions\n */\n sessions: Session[];\n\n /**\n * Current user's locale\n */\n locale: string;\n\n /**\n * Function that's called when user closes the modal\n */\n onHide: () => void;\n\n actions: {\n\n /**\n * Function to refresh sessions from server\n */\n getSessions: (userId: string) => void;\n\n /**\n * Function to revoke a particular session\n */\n revokeSession: (userId: string, sessionId: string) => Promise<ActionResult>;\n };\n}\n\ntype State = {\n show: boolean;\n}\n\nexport default class ActivityLogModal extends React.PureComponent<Props, State> {\n static propTypes = {\n\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n show: true,\n };\n }\n\n submitRevoke = (altId: string, e: React.MouseEvent) => {\n e.preventDefault();\n const modalContent = (e.target as Element)?.closest('.modal-content');\n modalContent?.classList.add('animation--highlight');\n setTimeout(() => {\n modalContent?.classList.remove('animation--highlight');\n }, 1500);\n this.props.actions.revokeSession(this.props.currentUserId, altId).then(() => {\n this.props.actions.getSessions(this.props.currentUserId);\n });\n };\n\n onShow = () => {\n this.props.actions.getSessions(this.props.currentUserId);\n };\n\n onHide = () => {\n this.setState({show: false});\n };\n\n componentDidMount() {\n this.onShow();\n }\n\n render() {\n const activityList = this.props.sessions.reduce((array: JSX.Element[], currentSession, index) => {\n if (currentSession.props.type === 'UserAccessToken') {\n return array;\n }\n\n array.push(\n <ActivityLog\n key={currentSession.id}\n index={index}\n locale={this.props.locale}\n currentSession={currentSession}\n submitRevoke={this.submitRevoke}\n />,\n );\n return array;\n }, []);\n\n const content = <form role='form'>{activityList}</form>;\n\n return (\n <Modal\n dialogClassName='a11y__modal modal--scroll'\n show={this.state.show}\n onHide={this.onHide}\n onExited={this.props.onHide}\n bsSize='large'\n role='none'\n aria-labelledby='activityLogModalLabel'\n >\n <Modal.Header closeButton={true}>\n <Modal.Title\n componentClass='h1'\n id='activityLogModalLabel'\n >\n <FormattedMessage\n id='activity_log.activeSessions'\n defaultMessage='Active Sessions'\n />\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <p className='session-help-text'>\n <FormattedMessage\n id='activity_log.sessionsDescription'\n defaultMessage=\"Sessions are created when you log in through a new browser on a device. Sessions let you use Mattermost without having to log in again for a time period specified by the system administrator. To end the session sooner, use the 'Log Out' button.\"\n />\n </p>\n {content}\n </Modal.Body>\n <Modal.Footer className='modal-footer--invisible'>\n <button\n id='closeModalButton'\n type='button'\n className='btn btn-tertiary'\n >\n <FormattedMessage\n id='general_button.close'\n defaultMessage='Close'\n />\n </button>\n </Modal.Footer>\n </Modal>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport {getSessions, revokeSession} from 'mattermost-redux/actions/users';\nimport {getCurrentUserId, getUserSessions} from 'mattermost-redux/selectors/entities/users';\n\nimport {getCurrentLocale} from 'selectors/i18n';\n\nimport type {GlobalState} from 'types/store';\n\nimport ActivityLogModal from './activity_log_modal';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n currentUserId: getCurrentUserId(state),\n sessions: getUserSessions(state),\n locale: getCurrentLocale(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n getSessions,\n revokeSession,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ActivityLogModal);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {getHistory} from 'utils/browser_history';\n\nconst SECTION_MFA = 'mfa';\n\ntype Props = {\n active: boolean;\n areAllSectionsInactive: boolean;\n\n // Whether or not the current user has MFA enabled\n mfaActive: boolean;\n\n // Whether or not the current user can enable MFA based on their authentication type and the server's settings\n mfaAvailable: boolean;\n\n // Whether or not this server enforces that all users have MFA\n mfaEnforced: boolean;\n\n updateSection: (section: string) => void;\n actions: {deactivateMfa: () => Promise<{error?: {message: string}}>};\n}\n\ntype State = {\n serverError: string|null;\n}\n\nexport default class MfaSection extends React.PureComponent<Props, State> {\n minRef: RefObject<SettingItemMinComponent>;\n\n public constructor(props: Props) {\n super(props);\n this.state = {\n serverError: null,\n };\n\n this.minRef = React.createRef();\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n public setupMfa = (e: React.MouseEvent<HTMLElement>) => {\n e.preventDefault();\n\n getHistory().push('/mfa/setup');\n };\n\n public removeMfa = async (e: React.MouseEvent<HTMLElement>) => {\n e.preventDefault();\n\n const {error} = await this.props.actions.deactivateMfa();\n\n if (error) {\n this.setState({\n serverError: error.message,\n });\n return;\n }\n\n if (this.props.mfaEnforced) {\n getHistory().push('/mfa/setup');\n return;\n }\n\n this.props.updateSection('');\n this.setState({\n serverError: null,\n });\n };\n\n private renderTitle = () => {\n return (\n <FormattedMessage\n id='user.settings.mfa.title'\n defaultMessage='Multi-factor Authentication'\n />\n );\n };\n\n private renderDescription = () => {\n if (this.props.mfaActive) {\n return (\n <FormattedMessage\n id='user.settings.security.active'\n defaultMessage='Active'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.security.inactive'\n defaultMessage='Inactive'\n />\n );\n };\n\n private renderContent = () => {\n let content;\n\n if (this.props.mfaActive) {\n let buttonText;\n\n if (this.props.mfaEnforced) {\n buttonText = (\n <FormattedMessage\n id='user.settings.mfa.reset'\n defaultMessage='Reset MFA on Account'\n />\n );\n } else {\n buttonText = (\n <FormattedMessage\n id='user.settings.mfa.remove'\n defaultMessage='Remove MFA from Account'\n />\n );\n }\n\n content = (\n <a\n className='btn btn-primary'\n href='#'\n onClick={this.removeMfa}\n >\n {buttonText}\n </a>\n );\n } else {\n content = (\n <a\n className='btn btn-primary'\n href='#'\n onClick={this.setupMfa}\n >\n <FormattedMessage\n id='user.settings.mfa.add'\n defaultMessage='Add MFA to Account'\n />\n </a>\n );\n }\n\n return (\n <div className='pt-2'>\n {content}\n <br/>\n </div>\n );\n };\n\n private renderHelpText = () => {\n if (this.props.mfaActive) {\n if (this.props.mfaEnforced) {\n return (\n <FormattedMessage\n id='user.settings.mfa.requiredHelp'\n defaultMessage='Multi-factor authentication is required on this server. Resetting is only recommended when you need to switch code generation to a new mobile device. You will be required to set it up again immediately.'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.mfa.removeHelp'\n defaultMessage='Removing multi-factor authentication means you will no longer require a phone-based passcode to sign-in to your account.'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.mfa.addHelp'\n defaultMessage='Adding multi-factor authentication will make your account more secure by requiring a code from your mobile phone each time you sign in.'\n />\n );\n };\n\n public render() {\n const title = this.renderTitle();\n\n if (!this.props.mfaAvailable) {\n return null;\n }\n\n if (!this.props.active) {\n return (\n <SettingItemMin\n title={title}\n describe={this.renderDescription()}\n section={SECTION_MFA}\n updateSection={this.props.updateSection}\n ref={this.minRef}\n />\n );\n }\n\n return (\n <SettingItemMax\n title={title}\n inputs={this.renderContent()}\n extraInfo={this.renderHelpText()}\n serverError={this.state.serverError}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {GlobalState} from '@mattermost/types/store';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';\nimport {getCurrentUser} from 'mattermost-redux/selectors/entities/users';\n\nimport {deactivateMfa} from 'actions/views/mfa';\n\nimport Constants from 'utils/constants';\n\nimport MfaSection from './mfa_section';\n\nfunction mapStateToProps(state: GlobalState) {\n const license = getLicense(state);\n const config = getConfig(state);\n const mfaLicensed = license && license.IsLicensed === 'true' && license.MFA === 'true';\n const mfaEnabled = config.EnableMultifactorAuthentication === 'true';\n const mfaEnforced = mfaLicensed && config.EnforceMultifactorAuthentication === 'true';\n const user: UserProfile = getCurrentUser(state);\n let mfaActive = false;\n let mfaAvailable = false;\n if (user) {\n mfaActive = (user as any).mfa_active;\n mfaAvailable = mfaEnabled && (user.auth_service === '' || user.auth_service === Constants.LDAP_SERVICE);\n }\n return {\n mfaActive,\n mfaAvailable,\n mfaEnforced,\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n deactivateMfa,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MfaSection);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {UserAccessToken, UserProfile} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\nimport * as UserUtils from 'mattermost-redux/utils/user_utils';\n\nimport {trackEvent} from 'actions/telemetry_actions.jsx';\n\nimport ConfirmModal from 'components/confirm_modal';\nimport ExternalLink from 'components/external_link';\nimport SaveButton from 'components/save_button';\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\nimport WarningIcon from 'components/widgets/icons/fa_warning_icon';\n\nimport {Constants, DeveloperLinks} from 'utils/constants';\nimport * as Keyboard from 'utils/keyboard';\nimport {isMobile} from 'utils/user_agent';\n\nconst SECTION_TOKENS = 'tokens';\nconst TOKEN_CREATING = 'creating';\nconst TOKEN_CREATED = 'created';\nconst TOKEN_NOT_CREATING = 'not_creating';\n\ntype Props = {\n user: UserProfile;\n active?: boolean;\n areAllSectionsInactive: boolean;\n updateSection: (section: string) => void;\n userAccessTokens: {[tokenId: string]: {description: string; id: string; is_active: boolean}};\n setRequireConfirm: (isRequiredConfirm: boolean, confirmCopyToken: (confirmAction: () => void) => void) => void;\n actions: {\n getUserAccessTokensForUser: (userId: string, page: number, perPage: number) => void;\n createUserAccessToken: (userId: string, description: string) => Promise<ActionResult<UserAccessToken>>;\n revokeUserAccessToken: (tokenId: string) => Promise<ActionResult>;\n enableUserAccessToken: (tokenId: string) => Promise<ActionResult>;\n disableUserAccessToken: (tokenId: string) => Promise<ActionResult>;\n clearUserAccessTokens: () => void;\n };\n}\n\ntype State = {\n active?: boolean;\n showConfirmModal: boolean;\n newToken?: UserAccessToken | null;\n tokenCreationState?: string;\n tokenError?: React.ReactNode;\n serverError?: string|null;\n saving?: boolean;\n confirmTitle?: React.ReactNode;\n confirmMessage?: ((state: State) => JSX.Element)|null;\n confirmButton?: React.ReactNode;\n confirmComplete?: (() => void)|null;\n confirmHideCancel?: boolean;\n}\n\nexport default class UserAccessTokenSection extends React.PureComponent<Props, State> {\n private minRef: React.RefObject<SettingItemMinComponent>;\n private newtokendescriptionRef: React.RefObject<HTMLInputElement>;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n active: this.props.active,\n showConfirmModal: false,\n newToken: null,\n tokenCreationState: TOKEN_NOT_CREATING,\n tokenError: '',\n serverError: null,\n saving: false,\n };\n this.newtokendescriptionRef = React.createRef();\n this.minRef = React.createRef();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n componentDidMount() {\n this.props.actions.clearUserAccessTokens();\n const userId = this.props.user ? this.props.user.id : '';\n this.props.actions.getUserAccessTokensForUser(userId, 0, 200);\n }\n\n static getDerivedStateFromProps(nextProps: Props, prevState: State) {\n if (!nextProps.active && prevState.active) {\n return {\n active: nextProps.active,\n showConfirmModal: false,\n newToken: null,\n tokenCreationState: TOKEN_NOT_CREATING,\n tokenError: '',\n serverError: null,\n saving: false,\n };\n }\n return {active: nextProps.active};\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n startCreatingToken = () => {\n this.setState({tokenCreationState: TOKEN_CREATING});\n };\n\n stopCreatingToken = () => {\n this.setState({tokenCreationState: TOKEN_NOT_CREATING, saving: false});\n };\n\n handleCreateToken = async () => {\n this.handleCancelConfirm();\n\n const description = this.newtokendescriptionRef ? this.newtokendescriptionRef.current!.value : '';\n\n if (description === '') {\n this.setState({\n tokenError: (\n <FormattedMessage\n id='user.settings.tokens.nameRequired'\n defaultMessage='Please enter a description.'\n />\n ),\n });\n return;\n }\n\n this.setState({tokenError: '', saving: true});\n this.props.setRequireConfirm(true, this.confirmCopyToken);\n\n const userId = this.props.user ? this.props.user.id : '';\n const {data, error} = await this.props.actions.createUserAccessToken(userId, description);\n\n if (data && this.state.tokenCreationState === TOKEN_CREATING) {\n this.setState({tokenCreationState: TOKEN_CREATED, newToken: data, saving: false});\n } else if (error) {\n this.setState({serverError: error.message, saving: false});\n }\n };\n\n confirmCopyToken = (confirmAction: () => void) => {\n this.setState({\n showConfirmModal: true,\n confirmTitle: (\n <FormattedMessage\n id='user.settings.tokens.confirmCopyTitle'\n defaultMessage='Copied Your Token?'\n />\n ),\n confirmMessage: (state: State) => (\n <div>\n <FormattedMessage\n id='user.settings.tokens.confirmCopyMessage'\n defaultMessage=\"Make sure you have copied and saved the access token below. You won't be able to see it again!\"\n />\n <br/>\n <br/>\n {state.tokenCreationState === TOKEN_CREATING ? (\n <div>\n <strong className='word-break--all'>\n <FormattedMessage\n id='user.settings.tokens.token'\n defaultMessage='Access Token: '\n />\n </strong>\n <FormattedMessage\n id='user.settings.tokens.tokenLoading'\n defaultMessage='Loading...'\n />\n </div>\n ) : (\n <strong className='word-break--all'>\n <FormattedMessage\n id='user.settings.tokens.token'\n defaultMessage='Access Token: '\n />\n {state.newToken!.token}\n </strong>\n )}\n </div>\n ),\n confirmButton: (\n <FormattedMessage\n id='user.settings.tokens.confirmCopyButton'\n defaultMessage='Yes, I have copied the token'\n />\n ),\n confirmComplete: () => {\n this.handleCancelConfirm();\n confirmAction();\n },\n confirmHideCancel: true,\n });\n };\n\n handleCancelConfirm = () => {\n this.setState({\n showConfirmModal: false,\n confirmTitle: null,\n confirmMessage: null,\n confirmButton: null,\n confirmComplete: null,\n confirmHideCancel: false,\n });\n };\n\n confirmCreateToken = () => {\n if (!UserUtils.isSystemAdmin(this.props.user!.roles)) {\n this.handleCreateToken();\n return;\n }\n\n this.setState({\n showConfirmModal: true,\n confirmTitle: (\n <FormattedMessage\n id='user.settings.tokens.confirmCreateTitle'\n defaultMessage='Create System Admin Personal Access Token'\n />\n ),\n confirmMessage: () => (\n <div className='alert alert-danger'>\n <FormattedMessage\n id='user.settings.tokens.confirmCreateMessage'\n defaultMessage='You are generating a personal access token with System Admin permissions. Are you sure want to create this token?'\n />\n </div>\n ),\n confirmButton: (\n <FormattedMessage\n id='user.settings.tokens.confirmCreateButton'\n defaultMessage='Yes, Create'\n />\n ),\n confirmComplete: () => {\n this.handleCreateToken();\n trackEvent('settings', 'system_admin_create_user_access_token');\n },\n });\n };\n\n saveTokenKeyPress = (e: React.KeyboardEvent) => {\n if (Keyboard.isKeyPressed(e, Constants.KeyCodes.ENTER)) {\n this.confirmCreateToken();\n }\n };\n\n confirmRevokeToken = (tokenId: string) => {\n const token = this.props.userAccessTokens[tokenId];\n\n this.setState({\n showConfirmModal: true,\n confirmTitle: (\n <FormattedMessage\n id='user.settings.tokens.confirmDeleteTitle'\n defaultMessage='Delete Token?'\n />\n ),\n confirmMessage: () => (\n <div className='alert alert-danger'>\n <p>\n <FormattedMessage\n id='user.settings.tokens.confirmDelete.description'\n defaultMessage={'Any integrations using this token will no longer be able to access the Mattermost API. You cannot undo this action.'}\n />\n </p>\n <p>\n <FormattedMessage\n id='user.settings.tokens.confirmDelete.confirmation'\n defaultMessage={'Are you sure you want to delete the <b>{description}</b> token?'}\n values={{\n description: token.description,\n b: (chunks: string) => <b>{chunks}</b>,\n }}\n />\n </p>\n </div>\n ),\n confirmButton: (\n <FormattedMessage\n id='user.settings.tokens.confirmDeleteButton'\n defaultMessage='Yes, Delete'\n />\n ),\n confirmComplete: () => {\n this.revokeToken(tokenId);\n trackEvent('settings', 'revoke_user_access_token');\n },\n });\n };\n\n revokeToken = async (tokenId: string) => {\n const {error} = await this.props.actions.revokeUserAccessToken(tokenId);\n if (error) {\n this.setState({serverError: error.message});\n }\n this.handleCancelConfirm();\n };\n\n activateToken = async (tokenId: string) => {\n const {error} = await this.props.actions.enableUserAccessToken(tokenId);\n if (error) {\n this.setState({serverError: error.message});\n } else {\n trackEvent('settings', 'activate_user_access_token');\n }\n };\n\n deactivateToken = async (tokenId: string) => {\n const {error} = await this.props.actions.disableUserAccessToken(tokenId);\n if (error) {\n this.setState({serverError: error.message});\n } else {\n trackEvent('settings', 'deactivate_user_access_token');\n }\n };\n\n render() {\n let tokenListClass = '';\n\n if (!this.props.active) {\n const describe = (\n <FormattedMessage\n id='user.settings.tokens.clickToEdit'\n defaultMessage=\"Click 'Edit' to manage your personal access tokens\"\n />\n );\n\n return (\n <SettingItemMin\n title={\n <FormattedMessage\n id='user.settings.tokens.title'\n defaultMessage='Personal Access Tokens'\n />\n }\n describe={describe}\n section={SECTION_TOKENS}\n updateSection={this.props.updateSection}\n ref={this.minRef}\n />\n );\n }\n\n const tokenList: JSX.Element[] = [];\n Object.values(this.props.userAccessTokens).forEach((token) => {\n if (this.state.newToken && this.state.newToken.id === token.id) {\n return;\n }\n\n let activeLink: JSX.Element;\n let activeStatus;\n\n if (token.is_active) {\n activeLink = (\n <a\n id={token.id + '_deactivate'}\n href='#'\n onClick={(e) => {\n e.preventDefault();\n this.deactivateToken(token.id);\n }}\n >\n <FormattedMessage\n id='user.settings.tokens.deactivate'\n defaultMessage='Disable'\n />\n </a>);\n } else {\n activeStatus = (\n <span className='has-error setting-box__inline-error'>\n <FormattedMessage\n id='user.settings.tokens.deactivatedWarning'\n defaultMessage='(Disabled)'\n />\n </span>\n );\n activeLink = (\n <a\n id={token.id + '_activate'}\n href='#'\n onClick={(e) => {\n e.preventDefault();\n this.activateToken(token.id);\n }}\n >\n <FormattedMessage\n id='user.settings.tokens.activate'\n defaultMessage='Enable'\n />\n </a>\n );\n }\n\n tokenList.push(\n <div\n key={token.id}\n className='setting-box__item'\n >\n <div className='whitespace--nowrap overflow--ellipsis'>\n <FormattedMessage\n id='user.settings.tokens.tokenDesc'\n defaultMessage='Token Description: '\n />\n {token.description}\n {activeStatus}\n </div>\n <div className='setting-box__token-id whitespace--nowrap overflow--ellipsis'>\n <FormattedMessage\n id='user.settings.tokens.tokenId'\n defaultMessage='Token ID: '\n />\n {token.id}\n </div>\n <div>\n {activeLink}\n {' - '}\n <a\n id={token.id + '_delete'}\n href='#'\n onClick={(e) => {\n e.preventDefault();\n this.confirmRevokeToken(token.id);\n }}\n >\n <FormattedMessage\n id='user.settings.tokens.delete'\n defaultMessage='Delete'\n />\n </a>\n </div>\n <hr className='mb-3 mt-3'/>\n </div>,\n );\n });\n\n let noTokenText;\n if (tokenList.length === 0) {\n noTokenText = (\n <FormattedMessage\n key='notokens'\n id='user.settings.tokens.userAccessTokensNone'\n defaultMessage='No personal access tokens.'\n />\n );\n }\n\n let extraInfo;\n if (isMobile()) {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.tokens.description_mobile'\n defaultMessage='<linkTokens>Personal access tokens</linkTokens> function similarly to session tokens and can be used by integrations to <linkAPI>authenticate against the REST API</linkAPI>. Create new tokens on your desktop.'\n values={{\n linkTokens: (msg: React.ReactNode) => (\n <ExternalLink\n href={DeveloperLinks.PERSONAL_ACCESS_TOKENS}\n location='user_access_token_section'\n >\n {msg}\n </ExternalLink>\n ),\n linkAPI: (msg: React.ReactNode) => (\n <ExternalLink\n href='https://api.mattermost.com/#tag/authentication'\n location='user_access_token_section'\n >\n {msg}\n </ExternalLink>\n ),\n }}\n />\n </span>\n );\n } else {\n extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.tokens.description'\n defaultMessage='<linkTokens>Personal access tokens</linkTokens> function similarly to session tokens and can be used by integrations to <linkAPI>authenticate against the REST API</linkAPI>.'\n values={{\n linkTokens: (msg: React.ReactNode) => (\n <ExternalLink\n href={DeveloperLinks.PERSONAL_ACCESS_TOKENS}\n location='user_access_token_section'\n >\n {msg}\n </ExternalLink>\n ),\n linkAPI: (msg: React.ReactNode) => (\n <ExternalLink\n href='https://api.mattermost.com/#tag/authentication'\n location='user_access_token_section'\n >\n {msg}\n </ExternalLink>\n ),\n }}\n />\n </span>\n );\n }\n\n let newTokenSection;\n if (this.state.tokenCreationState === TOKEN_CREATING) {\n newTokenSection = (\n <div className='pl-3'>\n <div className='row'>\n <label\n className='col-sm-auto control-label pr-3'\n htmlFor='newTokenDescription'\n >\n <FormattedMessage\n id='user.settings.tokens.name'\n defaultMessage='Token Description: '\n />\n </label>\n <div className='col-sm-5'>\n <input\n id='newTokenDescription'\n autoFocus={true}\n ref={this.newtokendescriptionRef}\n className='form-control'\n type='text'\n maxLength={64}\n onKeyPress={this.saveTokenKeyPress}\n />\n </div>\n </div>\n <div>\n <div className='pt-3'>\n <FormattedMessage\n id='user.settings.tokens.nameHelp'\n defaultMessage='Enter a description for your token to remember what it does.'\n />\n </div>\n <div>\n <label\n id='clientError'\n className='has-error mt-2 mb-2'\n >\n {this.state.tokenError}\n </label>\n </div>\n <SaveButton\n savingMessage={\n <FormattedMessage\n id='user.settings.tokens.save'\n defaultMessage='Save'\n />\n }\n saving={this.state.saving}\n onClick={this.confirmCreateToken}\n />\n <button\n className='btn btn-tertiary'\n onClick={this.stopCreatingToken}\n >\n <FormattedMessage\n id='user.settings.tokens.cancel'\n defaultMessage='Cancel'\n />\n </button>\n </div>\n </div>\n );\n } else if (this.state.tokenCreationState === TOKEN_CREATED) {\n if (tokenList.length === 0) {\n tokenListClass = ' hidden';\n }\n\n newTokenSection = (\n <div\n className='alert alert-warning'\n >\n <WarningIcon additionalClassName='mr-2'/>\n <FormattedMessage\n id='user.settings.tokens.copy'\n defaultMessage=\"Please copy the access token below. You won't be able to see it again!\"\n />\n <br/>\n <br/>\n <div className='whitespace--nowrap overflow--ellipsis'>\n <FormattedMessage\n id='user.settings.tokens.name'\n defaultMessage='Token Description: '\n />\n {this.state.newToken!.description}\n </div>\n <div className='whitespace--nowrap overflow--ellipsis'>\n <FormattedMessage\n id='user.settings.tokens.id'\n defaultMessage='Token ID: '\n />\n {this.state.newToken!.id}\n </div>\n <strong className='word-break--all'>\n <FormattedMessage\n id='user.settings.tokens.token'\n defaultMessage='Access Token: '\n />\n {this.state.newToken!.token}\n </strong>\n </div>\n );\n } else {\n newTokenSection = (\n <a\n className='btn btn-primary'\n href='#'\n onClick={this.startCreatingToken}\n >\n <FormattedMessage\n id='user.settings.tokens.create'\n defaultMessage='Create Token'\n />\n </a>\n );\n }\n\n const inputs = [];\n inputs.push(\n <div\n key='tokensSetting'\n className='pt-2'\n >\n <div key='tokenList'>\n <div className={'alert alert-transparent' + tokenListClass}>\n {tokenList}\n {noTokenText}\n </div>\n {newTokenSection}\n </div>\n </div>,\n );\n\n return (\n <div>\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.tokens.title'\n defaultMessage='Personal Access Tokens'\n />\n }\n inputs={inputs}\n extraInfo={extraInfo}\n infoPosition='top'\n serverError={this.state.serverError}\n updateSection={this.props.updateSection}\n isFullWidth={true}\n saving={this.state.saving}\n cancelButtonText={\n <FormattedMessage\n id='user.settings.security.close'\n defaultMessage='Close'\n />\n }\n />\n <ConfirmModal\n title={this.state.confirmTitle}\n message={this.state.confirmMessage ? this.state.confirmMessage(this.state) : null}\n confirmButtonText={this.state.confirmButton}\n show={this.state.showConfirmModal}\n onConfirm={this.state.confirmComplete || (() => null)}\n onCancel={this.handleCancelConfirm}\n hideCancel={this.state.confirmHideCancel}\n />\n </div>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {GlobalState} from '@mattermost/types/store';\n\nimport {\n clearUserAccessTokens,\n createUserAccessToken,\n getUserAccessTokensForUser,\n revokeUserAccessToken,\n enableUserAccessToken,\n disableUserAccessToken,\n} from 'mattermost-redux/actions/users';\n\nimport UserAccessTokenSection from './user_access_token_section';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n userAccessTokens: state.entities.users.myUserAccessTokens,\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n getUserAccessTokensForUser,\n createUserAccessToken,\n revokeUserAccessToken,\n enableUserAccessToken,\n disableUserAccessToken,\n clearUserAccessTokens,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(UserAccessTokenSection);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable max-lines */\n\nimport React from 'react';\nimport type {IntlShape} from 'react-intl';\nimport {FormattedDate, FormattedMessage, FormattedTime, injectIntl} from 'react-intl';\nimport {Link} from 'react-router-dom';\n\nimport type {OAuthApp} from '@mattermost/types/integrations';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {PasswordConfig} from 'mattermost-redux/selectors/entities/general';\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport AccessHistoryModal from 'components/access_history_modal';\nimport ActivityLogModal from 'components/activity_log_modal';\nimport ExternalLink from 'components/external_link';\nimport SettingItem from 'components/setting_item';\nimport SettingItemMax from 'components/setting_item_max';\nimport ToggleModalButton from 'components/toggle_modal_button';\n\nimport icon50 from 'images/icon50x50.png';\nimport Constants from 'utils/constants';\nimport {isValidPassword} from 'utils/password';\n\nimport MfaSection from './mfa_section';\nimport UserAccessTokenSection from './user_access_token_section';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nconst SECTION_MFA = 'mfa';\nconst SECTION_PASSWORD = 'password';\nconst SECTION_SIGNIN = 'signin';\nconst SECTION_APPS = 'apps';\nconst SECTION_TOKENS = 'tokens';\n\ntype Actions = {\n getMe: () => void;\n updateUserPassword: (\n userId: string,\n currentPassword: string,\n newPassword: string\n ) => Promise<ActionResult>;\n getAuthorizedOAuthApps: () => Promise<ActionResult>;\n deauthorizeOAuthApp: (clientId: string) => Promise<ActionResult>;\n};\n\ntype Props = {\n user: UserProfile;\n activeSection?: string;\n updateSection: (section: string) => void;\n closeModal: () => void;\n collapseModal: () => void;\n setRequireConfirm: () => void;\n canUseAccessTokens: boolean;\n enableOAuthServiceProvider: boolean;\n allowedToSwitchToEmail: boolean;\n enableSignUpWithGitLab: boolean;\n enableSignUpWithGoogle: boolean;\n enableSignUpWithOpenId: boolean;\n enableLdap: boolean;\n enableSaml: boolean;\n enableSignUpWithOffice365: boolean;\n experimentalEnableAuthenticationTransfer: boolean;\n passwordConfig: PasswordConfig;\n militaryTime: boolean;\n actions: Actions;\n intl: IntlShape;\n};\n\ntype State = {\n currentPassword: string;\n newPassword: string;\n confirmPassword: string;\n passwordError: React.ReactNode;\n serverError: string | null;\n tokenError: string;\n savingPassword: boolean;\n authorizedApps: OAuthApp[];\n};\n\nexport class SecurityTab extends React.PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = this.getDefaultState();\n }\n\n getDefaultState() {\n return {\n currentPassword: '',\n newPassword: '',\n confirmPassword: '',\n passwordError: '',\n serverError: '',\n tokenError: '',\n authService: this.props.user.auth_service,\n savingPassword: false,\n authorizedApps: [],\n };\n }\n\n componentDidMount() {\n if (this.props.enableOAuthServiceProvider) {\n this.loadAuthorizedOAuthApps();\n }\n }\n\n loadAuthorizedOAuthApps = async () => {\n const res = await this.props.actions.getAuthorizedOAuthApps();\n if ('data' in res) {\n const {data} = res;\n this.setState({authorizedApps: data, serverError: null});\n } else if ('error' in res) {\n const {error} = res;\n this.setState({serverError: error.message});\n }\n };\n\n submitPassword = async () => {\n const user = this.props.user;\n const currentPassword = this.state.currentPassword;\n const newPassword = this.state.newPassword;\n const confirmPassword = this.state.confirmPassword;\n\n if (currentPassword === '') {\n this.setState({\n passwordError: this.props.intl.formatMessage({\n id: 'user.settings.security.currentPasswordError',\n defaultMessage: 'Please enter your current password.',\n }),\n serverError: '',\n });\n return;\n }\n\n const {valid, error} = isValidPassword(\n newPassword,\n this.props.passwordConfig,\n );\n if (!valid && error) {\n this.setState({\n passwordError: error,\n serverError: '',\n });\n return;\n }\n\n if (newPassword !== confirmPassword) {\n const defaultState = Object.assign(this.getDefaultState(), {\n passwordError: this.props.intl.formatMessage({\n id: 'user.settings.security.passwordMatchError',\n defaultMessage:\n 'The new passwords you entered do not match.',\n }),\n serverError: '',\n });\n this.setState(defaultState);\n return;\n }\n\n this.setState({savingPassword: true});\n\n const res = await this.props.actions.updateUserPassword(\n user.id,\n currentPassword,\n newPassword,\n );\n if ('data' in res) {\n this.props.updateSection('');\n this.props.actions.getMe();\n this.setState(this.getDefaultState());\n } else if ('error' in res) {\n const {error: err} = res;\n const state = this.getDefaultState();\n if (err.message) {\n state.serverError = err.message;\n } else {\n state.serverError = err;\n }\n state.passwordError = '';\n this.setState(state);\n }\n };\n\n updateCurrentPassword = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({currentPassword: e.target.value});\n };\n\n updateNewPassword = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({newPassword: e.target.value});\n };\n\n updateConfirmPassword = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({confirmPassword: e.target.value});\n };\n\n deauthorizeApp = async (e: React.MouseEvent) => {\n e.preventDefault();\n\n const appId = e.currentTarget.getAttribute('data-app') as string;\n\n const res = await this.props.actions.deauthorizeOAuthApp(appId);\n if ('data' in res) {\n const authorizedApps = this.state.authorizedApps.filter((app) => {\n return app.id !== appId;\n });\n this.setState({authorizedApps, serverError: null});\n } else if ('error' in res) {\n const {error} = res;\n this.setState({serverError: error.message});\n }\n };\n\n handleUpdateSection = (section: string) => {\n if (section) {\n this.props.updateSection(section);\n } else {\n switch (this.props.activeSection) {\n case SECTION_MFA:\n case SECTION_SIGNIN:\n case SECTION_TOKENS:\n case SECTION_APPS:\n this.setState({\n serverError: null,\n });\n break;\n case SECTION_PASSWORD:\n this.setState({\n currentPassword: '',\n newPassword: '',\n confirmPassword: '',\n serverError: null,\n passwordError: null,\n });\n break;\n default:\n }\n\n this.props.updateSection('');\n }\n };\n\n createPasswordSection = () => {\n const inputs = [];\n let submit;\n\n const active = this.props.activeSection === SECTION_PASSWORD;\n let max = null;\n if (active) {\n if (this.props.user.auth_service === '') {\n submit = this.submitPassword;\n\n inputs.push(\n <div\n key='currentPasswordUpdateForm'\n className='form-group'\n >\n <label\n className='col-sm-5 control-label'\n htmlFor='currentPassword'\n >\n <FormattedMessage\n id='user.settings.security.currentPassword'\n defaultMessage='Current Password'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='currentPassword'\n autoFocus={true}\n className='form-control'\n type='password'\n onChange={this.updateCurrentPassword}\n value={this.state.currentPassword}\n aria-label={this.props.intl.formatMessage({\n id: 'user.settings.security.currentPassword',\n defaultMessage: 'Current Password',\n })}\n />\n </div>\n </div>,\n );\n inputs.push(\n <div\n key='newPasswordUpdateForm'\n className='form-group'\n >\n <label\n className='col-sm-5 control-label'\n htmlFor='newPassword'\n >\n <FormattedMessage\n id='user.settings.security.newPassword'\n defaultMessage='New Password'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='newPassword'\n className='form-control'\n type='password'\n onChange={this.updateNewPassword}\n value={this.state.newPassword}\n aria-label={this.props.intl.formatMessage({\n id: 'user.settings.security.newPassword',\n defaultMessage: 'New Password',\n })}\n />\n </div>\n </div>,\n );\n inputs.push(\n <div\n key='retypeNewPasswordUpdateForm'\n className='form-group'\n >\n <label\n className='col-sm-5 control-label'\n htmlFor='confirmPassword'\n >\n <FormattedMessage\n id='user.settings.security.retypePassword'\n defaultMessage='Retype New Password'\n />\n </label>\n <div className='col-sm-7'>\n <input\n id='confirmPassword'\n className='form-control'\n type='password'\n onChange={this.updateConfirmPassword}\n value={this.state.confirmPassword}\n aria-label={this.props.intl.formatMessage({\n id: 'user.settings.security.retypePassword',\n defaultMessage: 'Retype New Password',\n })}\n />\n </div>\n </div>,\n );\n } else if (\n this.props.user.auth_service === Constants.GITLAB_SERVICE\n ) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='pb-3'>\n <FormattedMessage\n id='user.settings.security.passwordGitlabCantUpdate'\n defaultMessage='Login occurs through GitLab. Password cannot be updated.'\n />\n </div>\n </div>,\n );\n } else if (\n this.props.user.auth_service === Constants.LDAP_SERVICE\n ) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='pb-3'>\n <FormattedMessage\n id='user.settings.security.passwordLdapCantUpdate'\n defaultMessage='Login occurs through AD/LDAP. Password cannot be updated.'\n />\n </div>\n </div>,\n );\n } else if (\n this.props.user.auth_service === Constants.SAML_SERVICE\n ) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='pb-3'>\n <FormattedMessage\n id='user.settings.security.passwordSamlCantUpdate'\n defaultMessage='This field is handled through your login provider. If you want to change it, you need to do so through your login provider.'\n />\n </div>\n </div>,\n );\n } else if (\n this.props.user.auth_service === Constants.GOOGLE_SERVICE\n ) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='pb-3'>\n <FormattedMessage\n id='user.settings.security.passwordGoogleCantUpdate'\n defaultMessage='Login occurs through Google Apps. Password cannot be updated.'\n />\n </div>\n </div>,\n );\n } else if (\n this.props.user.auth_service === Constants.OFFICE365_SERVICE\n ) {\n inputs.push(\n <div\n key='oauthEmailInfo'\n className='form-group'\n >\n <div className='pb-3'>\n <FormattedMessage\n id='user.settings.security.passwordOffice365CantUpdate'\n defaultMessage='Login occurs through Entra ID. Password cannot be updated.'\n />\n </div>\n </div>,\n );\n }\n\n max = (\n <SettingItemMax\n title={\n <FormattedMessage\n id='user.settings.security.password'\n defaultMessage='Password'\n />\n }\n inputs={inputs}\n submit={submit}\n saving={this.state.savingPassword}\n serverError={this.state.serverError}\n clientError={this.state.passwordError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n let describe;\n\n if (this.props.user.auth_service === '') {\n const d = new Date(this.props.user.last_password_update);\n\n describe = (\n <FormattedMessage\n id='user.settings.security.lastUpdated'\n defaultMessage='Last updated {date} at {time}'\n values={{\n date: (\n <FormattedDate\n value={d}\n day='2-digit'\n month='short'\n year='numeric'\n />\n ),\n time: (\n <FormattedTime\n value={d}\n hour12={!this.props.militaryTime}\n hour='2-digit'\n minute='2-digit'\n />\n ),\n }}\n />\n );\n } else if (this.props.user.auth_service === Constants.GITLAB_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.loginGitlab'\n defaultMessage='Login done through GitLab'\n />\n );\n } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.loginLdap'\n defaultMessage='Login done through AD/LDAP'\n />\n );\n } else if (this.props.user.auth_service === Constants.SAML_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.loginSaml'\n defaultMessage='Login done through SAML'\n />\n );\n } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.loginGoogle'\n defaultMessage='Login done through Google Apps'\n />\n );\n } else if (\n this.props.user.auth_service === Constants.OFFICE365_SERVICE\n ) {\n describe = (\n <FormattedMessage\n id='user.settings.security.loginOffice365'\n defaultMessage='Login done through Entra ID'\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={\n <FormattedMessage\n id='user.settings.security.password'\n defaultMessage='Password'\n />\n }\n describe={describe}\n section={SECTION_PASSWORD}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n createSignInSection = () => {\n const user = this.props.user;\n\n const active = this.props.activeSection === SECTION_SIGNIN;\n let max = null;\n if (active) {\n let emailOption;\n let gitlabOption;\n let googleOption;\n let office365Option;\n let openidOption;\n let ldapOption;\n let samlOption;\n\n if (user.auth_service === '') {\n if (this.props.enableSignUpWithGitLab) {\n gitlabOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_oauth?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service +\n '&new_type=' +\n Constants.GITLAB_SERVICE\n }\n >\n <FormattedMessage\n id='user.settings.security.switchGitlab'\n defaultMessage='Switch to Using GitLab SSO'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n if (this.props.enableSignUpWithGoogle) {\n googleOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_oauth?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service +\n '&new_type=' +\n Constants.GOOGLE_SERVICE\n }\n >\n <FormattedMessage\n id='user.settings.security.switchGoogle'\n defaultMessage='Switch to Using Google SSO'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n if (this.props.enableSignUpWithOffice365) {\n office365Option = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_oauth?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service +\n '&new_type=' +\n Constants.OFFICE365_SERVICE\n }\n >\n <FormattedMessage\n id='user.settings.security.switchOffice365'\n defaultMessage='Switch to Using Entra ID SSO'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n if (this.props.enableSignUpWithOpenId) {\n openidOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_oauth?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service +\n '&new_type=' +\n Constants.OPENID_SERVICE\n }\n >\n <FormattedMessage\n id='user.settings.security.switchOpenId'\n defaultMessage='Switch to Using OpenID SSO'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n if (this.props.enableLdap) {\n ldapOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_ldap?email=' +\n encodeURIComponent(user.email)\n }\n >\n <FormattedMessage\n id='user.settings.security.switchLdap'\n defaultMessage='Switch to Using AD/LDAP'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n if (this.props.enableSaml) {\n samlOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={\n '/claim/email_to_oauth?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service +\n '&new_type=' +\n Constants.SAML_SERVICE\n }\n >\n <FormattedMessage\n id='user.settings.security.switchSaml'\n defaultMessage='Switch to Using SAML SSO'\n />\n </Link>\n <br/>\n </div>\n );\n }\n } else if (this.props.allowedToSwitchToEmail) {\n let link;\n if (user.auth_service === Constants.LDAP_SERVICE) {\n link =\n '/claim/ldap_to_email?email=' +\n encodeURIComponent(user.email);\n } else {\n link =\n '/claim/oauth_to_email?email=' +\n encodeURIComponent(user.email) +\n '&old_type=' +\n user.auth_service;\n }\n\n emailOption = (\n <div className='pb-3'>\n <Link\n className='btn btn-primary'\n to={link}\n >\n <FormattedMessage\n id='user.settings.security.switchEmail'\n defaultMessage='Switch to Using Email and Password'\n />\n </Link>\n <br/>\n </div>\n );\n }\n\n const inputs = [];\n inputs.push(\n <div key='userSignInOption'>\n {emailOption}\n {gitlabOption}\n {googleOption}\n {office365Option}\n {openidOption}\n {ldapOption}\n {samlOption}\n </div>,\n );\n\n const extraInfo = (\n <span>\n <FormattedMessage\n id='user.settings.security.oneSignin'\n defaultMessage='You may only have one sign-in method at a time. Switching sign-in method will send an email notifying you if the change was successful.'\n />\n </span>\n );\n\n max = (\n <SettingItemMax\n title={this.props.intl.formatMessage({\n id: 'user.settings.security.method',\n defaultMessage: 'Sign-in Method',\n })}\n extraInfo={extraInfo}\n inputs={inputs}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n />\n );\n }\n\n let describe = (\n <FormattedMessage\n id='user.settings.security.emailPwd'\n defaultMessage='Email and Password'\n />\n );\n if (this.props.user.auth_service === Constants.GITLAB_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.gitlab'\n defaultMessage='GitLab'\n />\n );\n } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.google'\n defaultMessage='Google'\n />\n );\n } else if (\n this.props.user.auth_service === Constants.OFFICE365_SERVICE\n ) {\n describe = (\n <FormattedMessage\n id='user.settings.security.office365'\n defaultMessage='Entra ID'\n />\n );\n } else if (\n this.props.user.auth_service === Constants.OPENID_SERVICE\n ) {\n describe = (\n <FormattedMessage\n id='user.settings.security.openid'\n defaultMessage='OpenID'\n />\n );\n } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.ldap'\n defaultMessage='AD/LDAP'\n />\n );\n } else if (this.props.user.auth_service === Constants.SAML_SERVICE) {\n describe = (\n <FormattedMessage\n id='user.settings.security.saml'\n defaultMessage='SAML'\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={this.props.intl.formatMessage({\n id: 'user.settings.security.method',\n defaultMessage: 'Sign-in Method',\n })}\n describe={describe}\n section={SECTION_SIGNIN}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n createOAuthAppsSection = () => {\n const active = this.props.activeSection === SECTION_APPS;\n let max = null;\n if (active) {\n let apps;\n if (\n this.state.authorizedApps &&\n this.state.authorizedApps.length > 0\n ) {\n apps = this.state.authorizedApps.map((app) => {\n const homepage = (\n <ExternalLink\n href={app.homepage}\n location='user_settings_security'\n >\n {app.homepage}\n </ExternalLink>\n );\n\n return (\n <div\n key={app.id}\n className='pb-3 authorized-app'\n >\n <div className='col-sm-10'>\n <div className='authorized-app__name'>\n {app.name}\n <span className='authorized-app__url'>\n {' -'} {homepage}\n </span>\n </div>\n <div className='authorized-app__description'>\n {app.description}\n </div>\n <div className='authorized-app__deauthorize'>\n <a\n href='#'\n data-app={app.id}\n onClick={this.deauthorizeApp}\n >\n <FormattedMessage\n id='user.settings.security.deauthorize'\n defaultMessage='Deauthorize'\n />\n </a>\n </div>\n </div>\n <div className='col-sm-2 pull-right'>\n <img\n alt={app.name}\n src={app.icon_url || icon50}\n />\n </div>\n <br/>\n </div>\n );\n });\n } else {\n apps = (\n <div className='pb-3 authorized-app'>\n <div className='setting-list__hint'>\n <FormattedMessage\n id='user.settings.security.noApps'\n defaultMessage='No OAuth 2.0 Applications are authorized.'\n />\n </div>\n </div>\n );\n }\n\n const inputs = [];\n let wrapperClass;\n let helpText;\n if (Array.isArray(apps)) {\n wrapperClass = 'authorized-apps__wrapper';\n\n helpText = (\n <div className='authorized-apps__help'>\n <FormattedMessage\n id='user.settings.security.oauthAppsHelp'\n defaultMessage='Applications act on your behalf to access your data based on the permissions you grant them.'\n />\n </div>\n );\n }\n\n inputs.push(\n <div\n className={wrapperClass}\n key='authorizedApps'\n >\n {apps}\n </div>,\n );\n\n const title = (\n <div>\n <FormattedMessage\n id='user.settings.security.oauthApps'\n defaultMessage='OAuth 2.0 Applications'\n />\n {helpText}\n </div>\n );\n\n max = (\n <SettingItemMax\n title={title}\n inputs={inputs}\n serverError={this.state.serverError}\n updateSection={this.handleUpdateSection}\n isFullWidth={true}\n cancelButtonText={\n <FormattedMessage\n id='user.settings.security.close'\n defaultMessage='Close'\n />\n }\n />\n );\n }\n\n return (\n <SettingItem\n active={active}\n areAllSectionsInactive={this.props.activeSection === ''}\n title={this.props.intl.formatMessage({\n id: 'user.settings.security.oauthApps',\n defaultMessage: 'OAuth 2.0 Applications',\n })}\n describe={\n <FormattedMessage\n id='user.settings.security.oauthAppsDescription'\n defaultMessage=\"Click 'Edit' to manage your OAuth 2.0 Applications\"\n />\n }\n section={SECTION_APPS}\n updateSection={this.handleUpdateSection}\n max={max}\n />\n );\n };\n\n render() {\n const user = this.props.user;\n\n const passwordSection = this.createPasswordSection();\n\n let numMethods = 0;\n numMethods = this.props.enableSignUpWithGitLab ? numMethods + 1 : numMethods;\n numMethods = this.props.enableSignUpWithGoogle ? numMethods + 1 : numMethods;\n numMethods = this.props.enableSignUpWithOffice365 ? numMethods + 1 : numMethods;\n numMethods = this.props.enableSignUpWithOpenId ? numMethods + 1 : numMethods;\n numMethods = this.props.enableLdap ? numMethods + 1 : numMethods;\n numMethods = this.props.enableSaml ? numMethods + 1 : numMethods;\n\n // If there are other sign-in methods and either email is enabled or the user's account is email, then allow switching\n let signInSection;\n if (\n (this.props.allowedToSwitchToEmail || user.auth_service === '') &&\n numMethods > 0 &&\n this.props.experimentalEnableAuthenticationTransfer\n ) {\n signInSection = this.createSignInSection();\n }\n\n let oauthSection;\n if (this.props.enableOAuthServiceProvider) {\n oauthSection = this.createOAuthAppsSection();\n }\n\n let tokensSection;\n if (this.props.canUseAccessTokens) {\n tokensSection = (\n <UserAccessTokenSection\n user={this.props.user}\n active={this.props.activeSection === SECTION_TOKENS}\n areAllSectionsInactive={this.props.activeSection === ''}\n updateSection={this.handleUpdateSection}\n setRequireConfirm={this.props.setRequireConfirm}\n />\n );\n }\n\n return (\n <div>\n <SettingMobileHeader\n closeModal={this.props.closeModal}\n collapseModal={this.props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.security.title'\n defaultMessage='Security Settings'\n />\n }\n />\n <div className='user-settings'>\n <SettingDesktopHeader\n text={\n <FormattedMessage\n id='user.settings.security.title'\n defaultMessage='Security Settings'\n />\n }\n />\n <div className='divider-dark first'/>\n {passwordSection}\n <div className='divider-light'/>\n <MfaSection\n active={this.props.activeSection === SECTION_MFA}\n areAllSectionsInactive={this.props.activeSection === ''}\n updateSection={this.handleUpdateSection}\n />\n <div className='divider-light'/>\n {oauthSection}\n <div className='divider-light'/>\n {tokensSection}\n <div className='divider-light'/>\n {signInSection}\n <div className='divider-dark'/>\n <br/>\n <ToggleModalButton\n className='security-links color--link'\n modalId='access_history'\n dialogType={AccessHistoryModal}\n id='viewAccessHistory'\n >\n <i\n className='fa fa-clock-o'\n title={this.props.intl.formatMessage({\n id: 'user.settings.security.viewHistory.icon',\n defaultMessage: 'Access History Icon',\n })}\n />\n <FormattedMessage\n id='user.settings.security.viewHistory'\n defaultMessage='View Access History'\n />\n </ToggleModalButton>\n <ToggleModalButton\n className='security-links color--link mt-2'\n modalId='activity_log'\n dialogType={ActivityLogModal}\n id='viewAndLogOutOfActiveSessions'\n >\n <i\n className='fa fa-clock-o'\n title={this.props.intl.formatMessage({\n id: 'user.settings.security.logoutActiveSessions.icon',\n defaultMessage: 'Active Sessions Icon',\n })}\n />\n <FormattedMessage\n id='user.settings.security.logoutActiveSessions'\n defaultMessage='View and Log Out of Active Sessions'\n />\n </ToggleModalButton>\n </div>\n </div>\n );\n }\n}\n\nexport default injectIntl(SecurityTab);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {GlobalState} from '@mattermost/types/store';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {getAuthorizedOAuthApps, deauthorizeOAuthApp} from 'mattermost-redux/actions/integrations';\nimport {getMe, updateUserPassword} from 'mattermost-redux/actions/users';\nimport {getConfig, getPasswordConfig} from 'mattermost-redux/selectors/entities/general';\nimport {getBool} from 'mattermost-redux/selectors/entities/preferences';\nimport * as UserUtils from 'mattermost-redux/utils/user_utils';\n\nimport {Preferences} from 'utils/constants';\n\nimport SecurityTab from './user_settings_security';\n\ntype Props = {\n user: UserProfile;\n activeSection?: string;\n updateSection: (section: string) => void;\n closeModal: () => void;\n collapseModal: () => void;\n setRequireConfirm: () => void;\n};\n\nfunction mapStateToProps(state: GlobalState, ownProps: Props) {\n const config = getConfig(state);\n\n const tokensEnabled = config.EnableUserAccessTokens === 'true';\n const userHasTokenRole = UserUtils.hasUserAccessTokenRole(ownProps.user.roles) || UserUtils.isSystemAdmin(ownProps.user.roles);\n\n const enableOAuthServiceProvider = config.EnableOAuthServiceProvider === 'true';\n const allowedToSwitchToEmail = config.EnableSignUpWithEmail === 'true' && (config.EnableSignInWithEmail === 'true' || config.EnableSignInWithUsername === 'true');\n const enableSignUpWithGitLab = config.EnableSignUpWithGitLab === 'true';\n const enableSignUpWithGoogle = config.EnableSignUpWithGoogle === 'true';\n const enableSignUpWithOpenId = config.EnableSignUpWithOpenId === 'true';\n const enableLdap = config.EnableLdap === 'true';\n const enableSaml = config.EnableSaml === 'true';\n const enableSignUpWithOffice365 = config.EnableSignUpWithOffice365 === 'true';\n const experimentalEnableAuthenticationTransfer = config.ExperimentalEnableAuthenticationTransfer === 'true';\n\n return {\n canUseAccessTokens: tokensEnabled && userHasTokenRole,\n enableOAuthServiceProvider,\n allowedToSwitchToEmail,\n enableSignUpWithGitLab,\n enableSignUpWithGoogle,\n enableSignUpWithOpenId,\n enableLdap,\n enableSaml,\n enableSignUpWithOffice365,\n experimentalEnableAuthenticationTransfer,\n passwordConfig: getPasswordConfig(state),\n militaryTime: getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.USE_MILITARY_TIME, false),\n };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n getMe,\n updateUserPassword,\n getAuthorizedOAuthApps,\n deauthorizeOAuthApp,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SecurityTab);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport ReactSelect from 'react-select';\nimport type {ValueType} from 'react-select';\n\nimport type {PreferencesType, PreferenceType} from '@mattermost/types/preferences';\n\nimport {Preferences} from 'mattermost-redux/constants';\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\ntype Limit = {\n value: number;\n label: string;\n};\n\nexport type OwnProps = {\n adminMode?: boolean;\n userId: string;\n userPreferences?: PreferencesType;\n}\n\ntype Props = OwnProps & {\n active: boolean;\n areAllSectionsInactive: boolean;\n savePreferences: (userId: string, preferences: PreferenceType[]) => Promise<ActionResult>;\n dmGmLimit: number;\n updateSection: (section: string) => void;\n}\n\ntype State = {\n active: boolean;\n limit: Limit;\n isSaving: boolean;\n}\n\nconst limits: Limit[] = [\n {value: 10, label: '10'},\n {value: 15, label: '15'},\n {value: 20, label: '20'},\n {value: 40, label: '40'},\n];\n\nexport default class LimitVisibleGMsDMs extends React.PureComponent<Props, State> {\n minRef: RefObject<SettingItemMinComponent>;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n active: false,\n limit: {value: 20, label: '20'},\n isSaving: false,\n };\n\n this.minRef = React.createRef();\n }\n\n static getDerivedStateFromProps(props: Props, state: State) {\n if (props.active !== state.active) {\n if (props.active && !state.active) {\n return {\n limit: limits.find((l) => l.value === props.dmGmLimit),\n active: props.active,\n };\n }\n\n return {\n active: props.active,\n };\n } else if (!props.active) {\n return {\n limit: limits.find((l) => l.value === props.dmGmLimit),\n };\n }\n\n return null;\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n handleChange = (selected: ValueType<Limit>) => {\n if (selected && 'value' in selected) {\n this.setState({limit: selected});\n }\n };\n\n handleSubmit = async () => {\n if (!this.props.userId) {\n return;\n }\n\n this.setState({isSaving: true});\n\n await this.props.savePreferences(this.props.userId, [{\n user_id: this.props.userId,\n category: Preferences.CATEGORY_SIDEBAR_SETTINGS,\n name: Preferences.LIMIT_VISIBLE_DMS_GMS,\n value: this.state.limit.value.toString(),\n }]);\n\n this.setState({isSaving: false});\n\n this.props.updateSection('');\n };\n\n renderDescription = () => {\n return (\n <span>{this.state.limit.label}</span>\n );\n };\n\n render() {\n const title = (\n <FormattedMessage\n id='user.settings.sidebar.limitVisibleGMsDMsTitle'\n defaultMessage='Number of direct messages to show'\n />\n );\n\n if (!this.props.active) {\n return (\n <SettingItemMin\n title={title}\n describe={this.renderDescription()}\n section='limitVisibleGMsDMs'\n updateSection={this.props.updateSection}\n ref={this.minRef}\n />\n );\n }\n\n return (\n <SettingItemMax\n title={title}\n inputs={\n <fieldset>\n <legend className='form-legend hidden-label'>\n {title}\n </legend>\n <ReactSelect\n className='react-select'\n classNamePrefix='react-select'\n id='limitVisibleGMsDMs'\n options={limits}\n clearable={false}\n onChange={this.handleChange}\n value={this.state.limit}\n isSearchable={false}\n menuPortalTarget={document.body}\n styles={reactStyles}\n />\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.sidebar.limitVisibleGMsDMsDesc'\n defaultMessage='You can also change these settings in the direct messages sidebar menu.'\n />\n </div>\n </fieldset>\n }\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\n\nconst reactStyles = {\n menuPortal: (provided: React.CSSProperties) => ({\n ...provided,\n zIndex: 9999,\n }),\n};\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {getVisibleDmGmLimit} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './limit_visible_gms_dms';\nimport LimitVisibleGMsDMs from './limit_visible_gms_dms';\n\nfunction mapStateToProps(state: GlobalState, ownProps: OwnProps) {\n const userPreferences = ownProps.adminMode && ownProps.userPreferences ? ownProps.userPreferences : undefined;\n return {\n userId: ownProps.adminMode ? ownProps.userId : getCurrentUserId(state),\n dmGmLimit: getVisibleDmGmLimit(state, userPreferences),\n };\n}\n\nconst mapDispatchToProps = {\n savePreferences,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(LimitVisibleGMsDMs);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport type {RefObject} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {PreferencesType, PreferenceType} from '@mattermost/types/preferences';\n\nimport {Preferences} from 'mattermost-redux/constants';\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport SettingItemMax from 'components/setting_item_max';\nimport SettingItemMin from 'components/setting_item_min';\nimport type SettingItemMinComponent from 'components/setting_item_min';\n\nimport {a11yFocus} from 'utils/utils';\n\nexport type OwnProps = {\n adminMode?: boolean;\n userId: string;\n userPreferences?: PreferencesType;\n}\n\ntype Props = OwnProps & {\n active: boolean;\n areAllSectionsInactive: boolean;\n savePreferences: (userId: string, preferences: PreferenceType[]) => Promise<ActionResult>;\n showUnreadsCategory: boolean;\n updateSection: (section: string) => void;\n}\n\ntype State = {\n active: boolean;\n checked: boolean;\n isSaving: boolean;\n}\n\nexport default class ShowUnreadsCategory extends React.PureComponent<Props, State> {\n minRef: RefObject<SettingItemMinComponent>;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n active: false,\n checked: false,\n isSaving: false,\n };\n\n this.minRef = React.createRef();\n }\n\n static getDerivedStateFromProps(props: Props, state: State) {\n if (props.active !== state.active) {\n if (props.active && !state.active) {\n return {\n checked: props.showUnreadsCategory,\n active: props.active,\n };\n }\n\n return {\n active: props.active,\n };\n }\n\n return null;\n }\n\n focusEditButton(): void {\n this.minRef.current?.focus();\n }\n\n handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n this.setState({\n checked: e.target.value === 'true',\n });\n a11yFocus(e.target);\n };\n\n handleSubmit = async () => {\n if (!this.props.userId) {\n // Only for type safety, won't actually happen\n return;\n }\n\n this.setState({isSaving: true});\n\n await this.props.savePreferences(this.props.userId, [{\n user_id: this.props.userId,\n category: Preferences.CATEGORY_SIDEBAR_SETTINGS,\n name: Preferences.SHOW_UNREAD_SECTION,\n value: this.state.checked.toString(),\n }]);\n\n this.setState({isSaving: false});\n\n this.props.updateSection('');\n };\n\n renderDescription = () => {\n if (this.props.showUnreadsCategory) {\n return (\n <FormattedMessage\n id='user.settings.sidebar.on'\n defaultMessage='On'\n />\n );\n }\n\n return (\n <FormattedMessage\n id='user.settings.sidebar.off'\n defaultMessage='Off'\n />\n );\n };\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.active && !this.props.active && this.props.areAllSectionsInactive) {\n this.focusEditButton();\n }\n }\n\n render() {\n const title = (\n <FormattedMessage\n id='user.settings.sidebar.showUnreadsCategoryTitle'\n defaultMessage='Group unread channels separately'\n />\n );\n\n if (!this.props.active) {\n return (\n <SettingItemMin\n title={title}\n describe={this.renderDescription()}\n section='showUnreadsCategory'\n updateSection={this.props.updateSection}\n ref={this.minRef}\n />\n );\n }\n\n return (\n <SettingItemMax\n title={title}\n inputs={\n <fieldset>\n <legend className='form-legend hidden-label'>\n {title}\n </legend>\n <div className='radio'>\n <label>\n <input\n data-testid='showUnreadsCategoryOn'\n type='radio'\n name='showUnreadsCategory'\n checked={this.state.checked}\n onChange={() => this.setState({checked: true})}\n />\n <FormattedMessage\n id='user.settings.sidebar.on'\n defaultMessage='On'\n />\n </label>\n <br/>\n </div>\n <div className='radio'>\n <label>\n <input\n data-testid='showUnreadsCategoryOff'\n type='radio'\n name='showUnreadsCategory'\n checked={!this.state.checked}\n onChange={() => this.setState({checked: false})}\n />\n <FormattedMessage\n id='user.settings.sidebar.off'\n defaultMessage='Off'\n />\n </label>\n <br/>\n </div>\n <div className='mt-5'>\n <FormattedMessage\n id='user.settings.sidebar.showUnreadsCategoryDesc'\n defaultMessage='When enabled, all unread channels and direct messages will be grouped together in the sidebar.'\n />\n </div>\n </fieldset>\n }\n submit={this.handleSubmit}\n saving={this.state.isSaving}\n updateSection={this.props.updateSection}\n />\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {savePreferences} from 'mattermost-redux/actions/preferences';\nimport {\n shouldShowUnreadsCategory,\n} from 'mattermost-redux/selectors/entities/preferences';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport type {OwnProps} from './show_unreads_category';\nimport ShowUnreadsCategory from './show_unreads_category';\n\nfunction mapStateToProps(state: GlobalState, props: OwnProps) {\n const userPreferences = props.adminMode && props.userPreferences ? props.userPreferences : undefined;\n return {\n userId: props.adminMode ? props.userId : getCurrentUserId(state),\n showUnreadsCategory: shouldShowUnreadsCategory(state, userPreferences),\n };\n}\n\nconst mapDispatchToProps = {\n savePreferences,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ShowUnreadsCategory);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {PreferencesType} from '@mattermost/types/preferences';\n\nimport LimitVisibleGMsDMs from './limit_visible_gms_dms';\nimport ShowUnreadsCategory from './show_unreads_category';\n\nimport SettingDesktopHeader from '../headers/setting_desktop_header';\nimport SettingMobileHeader from '../headers/setting_mobile_header';\n\nexport interface Props {\n updateSection: (section: string) => void;\n activeSection: string;\n closeModal: () => void;\n collapseModal: () => void;\n adminMode?: boolean;\n userId: string;\n userPreferences?: PreferencesType;\n}\n\nexport default function UserSettingsSidebar(props: Props): JSX.Element {\n return (\n <div>\n <SettingMobileHeader\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n text={\n <FormattedMessage\n id='user.settings.sidebar.title'\n defaultMessage='Sidebar Settings'\n />\n }\n />\n <div\n id='sidebarTitle'\n className='user-settings'\n >\n <SettingDesktopHeader\n text={\n <FormattedMessage\n id='user.settings.sidebar.title'\n defaultMessage='Sidebar Settings'\n />\n }\n />\n\n <div className='divider-dark first'/>\n <ShowUnreadsCategory\n active={props.activeSection === 'showUnreadsCategory'}\n updateSection={props.updateSection}\n areAllSectionsInactive={props.activeSection === ''}\n adminMode={props.adminMode}\n userId={props.userId}\n userPreferences={props.userPreferences}\n />\n <div className='divider-dark'/>\n <LimitVisibleGMsDMs\n active={props.activeSection === 'limitVisibleGMsDMs'}\n updateSection={props.updateSection}\n areAllSectionsInactive={props.activeSection === ''}\n adminMode={props.adminMode}\n userId={props.userId}\n userPreferences={props.userPreferences}\n />\n <div className='divider-dark'/>\n </div>\n </div>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport UserSettingsSidebar from './user_settings_sidebar';\n\nexport default UserSettingsSidebar;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\n\nimport type {PreferencesType} from '@mattermost/types/preferences';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {PluginConfiguration} from 'types/plugins/user_settings';\n\nimport AdvancedTab from './advanced';\nimport DisplayTab from './display';\nimport GeneralTab from './general';\nimport NotificationsTab from './notifications';\nimport PluginTab from './plugin';\nimport SecurityTab from './security';\nimport SidebarTab from './sidebar';\n\nexport type Props = {\n user: UserProfile;\n activeTab?: string;\n activeSection: string;\n updateSection: (section?: string) => void;\n updateTab: (notifications: string) => void;\n closeModal: () => void;\n collapseModal: () => void;\n setRequireConfirm: () => void;\n pluginSettings: {[tabName: string]: PluginConfiguration};\n userPreferences?: PreferencesType;\n adminMode?: boolean;\n};\n\nexport default function UserSettings(props: Props) {\n if (props.activeTab === 'profile') {\n return (\n <div>\n <GeneralTab\n user={props.user}\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n updateTab={props.updateTab}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n />\n </div>\n );\n } else if (props.activeTab === 'security') {\n return (\n <div>\n <SecurityTab\n user={props.user}\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n setRequireConfirm={props.setRequireConfirm}\n />\n </div>\n );\n } else if (props.activeTab === 'notifications') {\n return (\n <div>\n <NotificationsTab\n user={props.user}\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n adminMode={props.adminMode}\n userPreferences={props.userPreferences}\n />\n </div>\n );\n } else if (props.activeTab === 'display') {\n return (\n <div>\n <DisplayTab\n user={props.user}\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n setRequireConfirm={props.setRequireConfirm}\n adminMode={props.adminMode}\n userPreferences={props.userPreferences}\n />\n </div>\n );\n } else if (props.activeTab === 'sidebar') {\n return (\n <div>\n <SidebarTab\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n adminMode={props.adminMode}\n userId={props.user.id}\n userPreferences={props.userPreferences}\n />\n </div>\n );\n } else if (props.activeTab === 'advanced') {\n return (\n <div>\n <AdvancedTab\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n adminMode={props.adminMode}\n user={props.user}\n userPreferences={props.userPreferences}\n />\n </div>\n );\n } else if (props.activeTab && props.pluginSettings[props.activeTab]) {\n return (\n <div>\n <PluginTab\n activeSection={props.activeSection}\n updateSection={props.updateSection}\n closeModal={props.closeModal}\n collapseModal={props.collapseModal}\n settings={props.pluginSettings[props.activeTab]}\n />\n </div>\n );\n }\n\n return null;\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {type ReactNode, useEffect, useState} from 'react';\n\nconst DEFAULT_MIN_LOADER_DURATION = 1000;\n\ntype Props = {\n loading: boolean;\n children: ReactNode;\n className?: string;\n onLoaded: () => void;\n}\n\nconst SmartLoader = ({loading, children, className, onLoaded}: Props) => {\n const [timeoutFinished, setTimeoutFinished] = useState(false);\n\n useEffect(() => {\n setTimeout(() => {\n setTimeoutFinished(true);\n }, DEFAULT_MIN_LOADER_DURATION);\n }, []);\n\n useEffect(() => {\n if (!loading && timeoutFinished) {\n onLoaded();\n }\n }, [loading, timeoutFinished, onLoaded]);\n\n return loading || !timeoutFinished ? (\n <div className={`SmartLoader ${className}`}>\n {children}\n </div>\n ) : null;\n};\n\nexport default SmartLoader;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {Modal} from 'react-bootstrap';\nimport ReactDOM from 'react-dom';\nimport {FormattedMessage, injectIntl} from 'react-intl';\nimport type {IntlShape} from 'react-intl';\n\nimport type {PreferencesType} from '@mattermost/types/preferences';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport ConfirmModal from 'components/confirm_modal';\nimport SettingsSidebar from 'components/settings_sidebar';\nimport UserSettings from 'components/user_settings';\nimport LoadingSpinner from 'components/widgets/loading/loading_spinner';\nimport SmartLoader from 'components/widgets/smart_loader';\n\nimport Constants from 'utils/constants';\nimport {cmdOrCtrlPressed, isKeyPressed} from 'utils/keyboard';\nimport {stopTryNotificationRing} from 'utils/notification_sounds';\nimport {isValidUrl} from 'utils/url';\nimport {getDisplayName} from 'utils/utils';\n\nimport type {PluginConfiguration} from 'types/plugins/user_settings';\n\nexport type OwnProps = {\n userID?: string;\n adminMode?: boolean;\n isContentProductSettings: boolean;\n userPreferences?: PreferencesType;\n activeTab?: string;\n}\n\nexport type Props = OwnProps & {\n onExited: () => void;\n intl: IntlShape;\n actions: {\n sendVerificationEmail: (email: string) => Promise<ActionResult>;\n getUserPreferences: (userID: string) => Promise<unknown>;\n getUser: (userID: string) => Promise<unknown>;\n };\n pluginSettings: {[pluginId: string]: PluginConfiguration};\n user?: UserProfile;\n}\n\ntype State = {\n active_tab?: string;\n active_section: string;\n showConfirmModal: boolean;\n enforceFocus?: boolean;\n show: boolean;\n resendStatus: string;\n loading: boolean;\n}\n\nclass UserSettingsModal extends React.PureComponent<Props, State> {\n private requireConfirm: boolean;\n private customConfirmAction: ((handleConfirm: () => void) => void) | null;\n private modalBodyRef: React.RefObject<Modal>;\n private afterConfirm: (() => void) | null;\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n active_tab: props.activeTab ?? (props.isContentProductSettings ? 'notifications' : 'profile'),\n active_section: '',\n showConfirmModal: false,\n enforceFocus: true,\n show: true,\n resendStatus: '',\n loading: false,\n };\n\n this.requireConfirm = false;\n\n // Used when settings want to override the default confirm modal with their own\n // If set by a child, it will be called in place of showing the regular confirm\n // modal. It will be passed a function to call on modal confirm\n this.customConfirmAction = null;\n this.afterConfirm = null;\n\n this.modalBodyRef = React.createRef();\n }\n\n handleResend = (email: string) => {\n this.setState({resendStatus: 'sending'});\n\n this.props.actions.sendVerificationEmail(email).then(({data, error: err}) => {\n if (data) {\n this.setState({resendStatus: 'success'});\n } else if (err) {\n this.setState({resendStatus: 'failure'});\n }\n });\n };\n\n componentDidMount() {\n document.addEventListener('keydown', this.handleKeyDown);\n\n if (this.props.adminMode && this.props.userID) {\n this.setState({loading: true});\n\n if (!this.props.userPreferences) {\n this.props.actions.getUserPreferences(this.props.userID);\n }\n\n if (!this.props.user) {\n this.props.actions.getUser(this.props.userID);\n }\n }\n\n if (!this.props.adminMode) {\n this.setState({loading: false});\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n\n componentDidUpdate(prevProps: Props, prevState: State) {\n if (this.state.active_tab !== prevState.active_tab) {\n const el = ReactDOM.findDOMNode(this.modalBodyRef.current) as any;\n el.scrollTop = 0;\n }\n }\n\n setLoadingFinished = () => {\n this.setState({loading: false});\n };\n\n handleKeyDown = (e: KeyboardEvent) => {\n if (cmdOrCtrlPressed(e) && e.shiftKey && isKeyPressed(e, Constants.KeyCodes.A)) {\n e.preventDefault();\n this.handleHide();\n }\n };\n\n // Called when the close button is pressed on the main modal\n handleHide = () => {\n if (this.requireConfirm) {\n this.showConfirmModal(() => this.handleHide());\n return;\n }\n\n // Cancel any ongoing notification sound, if any (from DesktopNotificationSettings)\n stopTryNotificationRing();\n\n this.setState({\n show: false,\n });\n };\n\n // called after the dialog is fully hidden and faded out\n handleHidden = () => {\n this.setState({\n active_tab: this.props.isContentProductSettings ? 'notifications' : 'profile',\n active_section: '',\n });\n this.props.onExited();\n };\n\n // Called to hide the settings pane when on mobile\n handleCollapse = () => {\n const el = ReactDOM.findDOMNode(this.modalBodyRef.current) as HTMLDivElement;\n el.closest('.modal-dialog')!.classList.remove('display--content');\n\n this.setState({\n active_tab: '',\n active_section: '',\n });\n };\n\n handleConfirm = () => {\n this.setState({\n showConfirmModal: false,\n enforceFocus: true,\n });\n\n this.requireConfirm = false;\n this.customConfirmAction = null;\n\n if (this.afterConfirm) {\n this.afterConfirm();\n this.afterConfirm = null;\n }\n };\n\n handleCancelConfirmation = () => {\n this.setState({\n showConfirmModal: false,\n enforceFocus: true,\n });\n\n this.afterConfirm = null;\n };\n\n showConfirmModal = (afterConfirm: () => void) => {\n if (afterConfirm) {\n this.afterConfirm = afterConfirm;\n }\n\n if (this.customConfirmAction) {\n this.customConfirmAction(this.handleConfirm);\n return;\n }\n\n this.setState({\n showConfirmModal: true,\n enforceFocus: false,\n });\n };\n\n // Called by settings tabs when their close button is pressed\n closeModal = () => {\n if (this.requireConfirm) {\n this.showConfirmModal(this.closeModal);\n } else {\n this.handleHide();\n }\n };\n\n // Called by settings tabs when their back button is pressed\n collapseModal = () => {\n if (this.requireConfirm) {\n this.showConfirmModal(this.collapseModal);\n } else {\n this.handleCollapse();\n }\n };\n\n updateTab = (tab?: string, skipConfirm?: boolean) => {\n if (!skipConfirm && this.requireConfirm) {\n this.showConfirmModal(() => this.updateTab(tab, true));\n } else {\n this.setState({\n active_tab: tab,\n active_section: '',\n });\n }\n };\n\n updateSection = (section?: string, skipConfirm?: boolean) => {\n if (!skipConfirm && this.requireConfirm) {\n this.showConfirmModal(() => this.updateSection(section, true));\n } else {\n this.setState({\n active_section: section ?? '',\n });\n }\n };\n\n getUserSettingsTabs = () => {\n return [\n {\n name: 'notifications',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.notifications', defaultMessage: 'Notifications'}),\n icon: 'icon icon-bell-outline',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.notifications.icon', defaultMessage: 'Notification Settings Icon'}),\n },\n {\n name: 'display',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.display', defaultMessage: 'Display'}),\n icon: 'icon icon-eye-outline',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.display.icon', defaultMessage: 'Display Settings Icon'}),\n },\n {\n name: 'sidebar',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.sidebar', defaultMessage: 'Sidebar'}),\n icon: 'icon icon-dock-left',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.sidebar.icon', defaultMessage: 'Sidebar Settings Icon'}),\n },\n {\n name: 'advanced',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.advanced', defaultMessage: 'Advanced'}),\n icon: 'icon icon-tune',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.advance.icon', defaultMessage: 'Advanced Settings Icon'}),\n },\n ];\n };\n\n getProfileSettingsTab = () => {\n return [\n {\n name: 'profile',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.profile', defaultMessage: 'Profile'}),\n icon: 'icon icon-settings-outline',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.profile.icon', defaultMessage: 'Profile Settings Icon'}),\n },\n {\n name: 'security',\n uiName: this.props.intl.formatMessage({id: 'user.settings.modal.security', defaultMessage: 'Security'}),\n icon: 'icon icon-lock-outline',\n iconTitle: this.props.intl.formatMessage({id: 'user.settings.security.icon', defaultMessage: 'Security Settings Icon'}),\n },\n ];\n };\n\n getPluginsSettingsTab = () => {\n return Object.values(this.props.pluginSettings).map((v) => {\n const className = v.icon ? `icon ${v.icon}` : 'icon icon-power-plug-outline';\n const useURL = v.icon && (isValidUrl(v.icon) || v.icon.startsWith('/'));\n return {\n name: v.id,\n uiName: v.uiName,\n icon: useURL ? {url: v.icon!} : className,\n iconTitle: v.uiName,\n };\n });\n };\n\n render() {\n const {formatMessage} = this.props.intl;\n\n let modalTitle: string;\n\n if (this.props.adminMode && this.props.user) {\n modalTitle = formatMessage({\n id: 'userSettings.adminMode.modal_header',\n defaultMessage: \"{userDisplayName}'s Settings\",\n }, {\n userDisplayName: getDisplayName(this.props.user),\n });\n } else {\n modalTitle = this.props.isContentProductSettings ? formatMessage({\n id: 'global_header.productSettings',\n defaultMessage: 'Settings',\n }) : formatMessage({\n id: 'user.settings.modal.title',\n defaultMessage: 'Profile',\n });\n }\n\n return (\n <Modal\n id='accountSettingsModal'\n dialogClassName='a11y__modal settings-modal'\n show={this.state.show}\n onHide={this.handleHide}\n onExited={this.handleHidden}\n enforceFocus={this.state.enforceFocus}\n aria-label={modalTitle}\n role='none'\n >\n <Modal.Header\n id='accountSettingsHeader'\n closeButton={true}\n >\n <Modal.Title\n componentClass='h1'\n id='accountSettingsModalLabel'\n >\n {modalTitle}\n </Modal.Title>\n\n {\n this.props.adminMode &&\n <div className='adminModeBadge'>\n <FormattedMessage\n id='userSettings.adminMode.admin_mode_badge'\n defaultMessage='Admin Mode'\n />\n </div>\n }\n </Modal.Header>\n <Modal.Body ref={this.modalBodyRef}>\n {\n this.props.adminMode &&\n <SmartLoader\n loading={this.props.adminMode && (!this.props.userPreferences || !this.props.user)}\n className='loadingIndicator'\n onLoaded={this.setLoadingFinished}\n >\n <LoadingSpinner/>\n </SmartLoader>\n }\n\n {\n !this.state.loading && this.props.user &&\n <div className='settings-table'>\n <div className='settings-links'>\n <SettingsSidebar\n tabs={this.props.isContentProductSettings ? this.getUserSettingsTabs() : this.getProfileSettingsTab()}\n pluginTabs={this.props.isContentProductSettings ? this.getPluginsSettingsTab() : []}\n activeTab={this.state.active_tab}\n updateTab={this.updateTab}\n />\n </div>\n <div className='settings-content minimize-settings'>\n <UserSettings\n activeTab={this.state.active_tab}\n activeSection={this.state.active_section}\n updateSection={this.updateSection}\n updateTab={this.updateTab}\n closeModal={this.closeModal}\n collapseModal={this.collapseModal}\n setRequireConfirm={\n (requireConfirm?: boolean, customConfirmAction?: () => () => void) => {\n this.requireConfirm = requireConfirm!;\n this.customConfirmAction = customConfirmAction!;\n }\n }\n pluginSettings={this.props.pluginSettings}\n user={this.props.user}\n adminMode={this.props.adminMode}\n userPreferences={this.props.userPreferences}\n />\n </div>\n </div>\n }\n </Modal.Body>\n <ConfirmModal\n title={formatMessage({id: 'user.settings.modal.confirmTitle', defaultMessage: 'Discard Changes?'})}\n message={formatMessage({\n id: 'user.settings.modal.confirmMsg',\n defaultMessage: 'You have unsaved changes, are you sure you want to discard them?',\n })}\n confirmButtonText={formatMessage({\n id: 'user.settings.modal.confirmBtns',\n defaultMessage: 'Yes, Discard',\n })}\n show={this.state.showConfirmModal}\n onConfirm={this.handleConfirm}\n onCancel={this.handleCancelConfirmation}\n />\n </Modal>\n );\n }\n}\n\nexport default injectIntl(UserSettingsModal);\n"],"names":["activateMfa","code","dispatch","getState","currentUserId","getCurrentUserId","UserActions","deactivateMfa","generateMfaSecret","SettingsSidebar","React","constructor","props","super","_defineProperty","tab","e","_closest","preventDefault","this","updateTab","name","target","closest","classList","add","index","isKeyPressed","Constants","KeyCodes","UP","tabs","a11yFocus","buttonRefs","current","DOWN","length","map","renderTab","key","concat","isActive","activeTab","icon","className","title","iconTitle","src","url","alt","id","role","ref","onClick","handleClick","bind","onKeyUp","handleKeyUp","uiName","toLowerCase","tabIndex","isMobileView","render","_this$props$pluginTab","tabList","pluginTabList","pluginTabs","FormattedMessage","defaultMessage","connect","state","getIsMobileView","SettingItemMin","arguments","node","edit","isDisabled","updateSection","section","focus","editButtonComponent","collapsedEditButtonWhenDisabled","getEdit","EditIcon","classNames","describe","_pt","isRequired","SettingItem","_ref","active","areAllSectionsInactive","max","minRef","useRef","useDidUpdate","_minRef$current","propTypes","SettingItemMax","shiftEnter","ENTER","shiftKey","disableEnterSubmit","submit","tagName","parentElement","contains","settingList","handleSubmit","setting","componentDidMount","focusableElements","querySelectorAll","document","addEventListener","onKeyDown","componentWillUnmount","removeEventListener","clientError","serverError","extraInfo","hintClass","infoPosition","SaveButton","saveButtonText","saving","disabled","btnClass","saveButtonClassName","inputs","cancelButtonText","listContent","containerStyle","extraContentBeforeSettingList","isFullWidth","submitExtra","handleUpdateSection","JoinLeaveSection","value","currentTarget","setState","joinLeaveState","joinLeave","onUpdateSection","actions","userId","joinLeavePreference","category","Preferences","CATEGORY_ADVANCED_SETTINGS","user_id","ADVANCED_FILTER_JOIN_LEAVE","savePreferences","focusEditButton","_this$minRef$current","componentDidUpdate","prevProps","type","AdvancedSections","JOIN_LEAVE","checked","onChange","handleOnChange","isSaving","renderOnOffLabel","enableJoinLeaveMessage","getConfig","EnableJoinLeaveMessageByDefault","userPreference","adminMode","userPreferences","undefined","get","toString","bindActionCreators","PerformanceDebuggingSection","prevActiveRef","useEffect","performanceDebuggingEnabled","settings","PerformanceDebuggingSectionExpanded","PerformanceDebuggingSectionCollapsed","Object","assign","description","settingsEnabled","disableClientPlugins","disableTelemetry","disableTypingMessages","values","count","PERFORMANCE_DEBUGGING","setDisableClientPlugins","useState","setDisableTelemetry","setDisableTypingMessages","useCallback","preferences","push","CATEGORY_PERFORMANCE_DEBUGGING","NAME_DISABLE_CLIENT_PLUGINS","NAME_DISABLE_TELEMETRY","NAME_DISABLE_TYPING_MESSAGES","mapDispatchToProps","getUserPreferences","getBool","isPerformanceDebuggingEnabled","SettingDesktopHeader","text","info","SettingMobileHeader","closeModal","collapseModal","intl","useIntl","formatMessage","AdvancedSettingsDisplay","send_on_ctrl_enter","sendOnCtrlEnter","code_block_ctrl_enter","codeBlockOnCtrlEnter","formatting","join_leave","sync_drafts","syncDrafts","UNREAD_SCROLL_POSITION","unreadScrollPosition","showDeactivateAccountModal","prevState","_objectSpread","async","user","Array","isArray","forEach","updateUserActive","then","error","message","data","revokeAllSessionsForUser","emitUserLoggedOutEvent","getStateFromProps","defineMessages","default","mac","isMac","ctrlSendTitle","ctrlSendDesc","activeSection","updateSetting","unread_scroll_position","UNREAD_SCROLL_POSITION_START_FROM_LEFT","UNREAD_SCROLL_POSITION_START_FROM_NEWEST","renderUnreadScrollPositionLabel","SYNC_DRAFTS","getCtrlSendText","ctrlSendActive","renderCtrlEnterLabel","enabled","option","ctrlEnter","codeBlockCtrlEnter","ctrlSendSection","renderCtrlSendSection","formattingSection","renderFormattingSection","formattingSectionDivider","deactivateAccountSection","makeConfirmationModal","auth_service","enableUserDeactivation","handleShowDeactivateAccountModal","confirmButtonClass","deactivateMemberButton","ConfirmModal","show","confirmButtonText","onConfirm","handleDeactivateAccountSubmit","onCancel","handleHideDeactivateAccountModal","unreadScrollPositionSection","renderUnreadScrollPositionSection","unreadScrollPositionSectionDivider","syncDraftsSection","syncDraftsSectionDivider","syncedDraftsAreAllowed","renderSyncDraftsSection","getAdvancedSettingsCategory","makeGetCategory","getUserAdvancedSettingsCategory","makeGetUserCategory","config","EnableUserDeactivation","advancedSettingsCategory","getCurrentUser","getUnreadScrollPositionPreference","ColorChooser","label","ColorInput","newColor","_props$onChange","call","messages","sidebarBg","sidebarText","sidebarHeaderBg","sidebarTeamBarBg","sidebarHeaderTextColor","sidebarUnreadText","sidebarTextHoverBg","sidebarTextActiveBorder","sidebarTextActiveColor","onlineIndicator","awayIndicator","dndIndicator","mentionBg","mentionColor","centerChannelBg","centerChannelColor","newMessageSeparator","linkColor","buttonBg","buttonColor","errorTextColor","mentionHighlightBg","mentionHighlightLink","codeTheme","CustomThemeChooser","settingId","color","updateTheme","theme","newTheme","mentionBj","copyTheme","setCopyTheme","window","clipboardData","getData","JSON","parse","err","setThemeDefaults","stringify","stopPropagation","_this$textareaRef$cur","_this$textareaRef$cur2","textareaRef","setSelectionRange","_this$sidebarStylesHe","sidebarStylesHeaderRef","toggle","toggleSection","sidebarStylesRef","_this$centerChannelSt","centerChannelStylesHeaderRef","centerChannelStylesRef","_this$linkAndButtonSt","linkAndButtonStylesHeaderRef","linkAndButtonStylesRef","selectTheme","execCommand","showCopySuccess","copySuccess","querySelector","style","display","setTimeout","createRef","image","ontransitionend","overflowY","sidebarElements","centerChannelElements","linkAndButtonElements","THEME_ELEMENTS","element","_element$themes","codeThemeOptions","codeThemeURL","themes","codeThemeIndex","iconURL","htmlFor","defaultValue","onCodeThemeChange","WithTooltip","width","group","handleColorChange","pasteBox","onCopy","onPaste","pasteBoxChange","onChangeHandle","toggleSidebarStyles","toggleCenterChannelStyles","toggleLinkAndButtonStyles","injectIntl","ThemeThumbnail","themeName","themeKey","height","viewBox","fill","xmlns","x","y","rx","cx","cy","r","PremadeThemeChooser","allowedThemes","premadeThemes","hasAllowedThemes","trim","k","THEMES","hasOwn","_premadeTheme$type","indexOf","premadeTheme","activeClass","replace","changeOpacity","toTitleCase","AllowedThemes","split","ThemeSetting","_this$props$setRequir","_this$props","teamId","applyToAllTeams","currentTeamId","saveTheme","deleteTeamSpecificThemes","setRequireConfirm","originalTheme","_this$props$setRequir2","_this$props2","themeChanged","field","applyTheme","_this$props$setRequir3","_this$props3","selected","resetFields","DEFAULT_CODE_THEME","showAllTeamsCheckbox","displayCustom","custom","premade","themeUI","allowCustomThemes","updateType","ExternalLink","href","location","allTeamsCheckbox","submitTheme","getCurrentTeamId","getTheme","getThemePreferences","getMyTeamsCount","openModal","UserSettingsTheme","ManageLanguage","modalBody","ESCAPE","openMenu","remove","selectedOption","locale","submitUser","patchUser","updateMe","res","Error","userLocale","locales","reactSelectContainer","handleContainerKeyDown","options","keys","l","order","sort","a","b","lang","reactStyles","menuPortal","provided","zIndex","interfaceLanguageLabelAria","input","ReactSelect","classNamePrefix","menuIsOpen","menuPortalTarget","body","styles","clearable","setLanguage","handleKeyDown","onMenuClose","handleMenuClose","onMenuOpen","handleMenuOpen","link","msg","changeLanguage","getLanguages","ManageLanguages","ManageTimezones","manualTimezone","useAutomaticTimezone","automaticTimezone","oldUseAutomaticTimezone","oldAutomaticTimezone","oldManualTimezone","timezoneNotChanged","timezone","updatedUser","timezoneLabel","selectedOptionValue","getBrowserTimezone","getTimezoneLabel","timezones","previousTimezone","timeOptions","timeObject","_previousTimezone","utc","noTimezonesFromServer","automaticTimezoneInput","handleAutomaticTimezone","manualTimezoneInput","changeTimezone","getCurrentTimezoneLabel","getDisplayStateFromProps","militaryTime","teammateNameDisplay","availabilityStatusOnPosts","channelDisplayMode","messageDisplay","colorizeUsernames","collapseDisplay","collapsedReplyThreads","linkPreviewDisplay","lastActiveDisplay","oneClickReactionsOnPosts","clickToReply","UserSettingsDisplay","show_last_active","timePreference","CATEGORY_DISPLAY_SETTINGS","USE_MILITARY_TIME","availabilityStatusOnPostsPreference","AVAILABILITY_STATUS_ON_POSTS","teammateNameDisplayPreference","NAME_NAME_FORMAT","channelDisplayModePreference","CHANNEL_DISPLAY_MODE","messageDisplayPreference","MESSAGE_DISPLAY","colorizeUsernamesPreference","COLORIZE_USERNAMES","collapseDisplayPreference","COLLAPSE_DISPLAY","collapsedReplyThreadsPreference","COLLAPSED_REPLY_THREADS","linkPreviewDisplayPreference","LINK_PREVIEW_DISPLAY","oneClickReactionsOnPostsPreference","ONE_CLICK_REACTIONS_ENABLED","clickToReplyPreference","CLICK_TO_REPLY","trackChangeIfNecessary","updateState","newState","deepEqual","prevSections","clock","linkpreview","message_display","channel_display_mode","languages","shouldAutoUpdateTimezone","autoUpdateTimezone","preference","oldValue","trackEvent","handleChannelDisplayModeRadio","handlemessageDisplayRadio","handleCollapseRadio","handleCollapseReplyThreadsRadio","handleLastActiveRadio","handleLinkPreviewRadio","createSection","_firstOption$radionBu","_secondOption$radionB","firstOption","secondOption","thirdOption","onSubmit","firstMessage","radionButtonText","moreColon","firstMessageMore","more","secondMessage","secondMessageMore","thirdMessage","messageTitle","messageDesc","format","childOptionToShow","childOption","firstDisplay","secondDisplay","thirdSection","childOptionSection","thirdDisplay","childDisplay","collapseSection","defaultDisplay","defineMessage","linkPreviewSection","enableLinkPreviews","lastActiveSection","lastActiveTimeEnabled","submitLastActive","clockSection","teammateNameDisplaySection","lockTeammateNameDisplay","configTeammateNameDisplay","TEAMMATE_NAME_DISPLAY","SHOW_USERNAME","SHOW_NICKNAME_FULLNAME","SHOW_FULLNAME","availabilityStatusOnPostsSection","timezoneSelection","userTimezone","Boolean","messageDisplaySection","MESSAGE_DISPLAY_CLEAN","MESSAGE_DISPLAY_COMPACT","collapsedReplyThreadsAllowUserPreference","COLLAPSED_REPLY_THREADS_FALLBACK_DEFAULT","COLLAPSED_REPLY_THREADS_ON","COLLAPSED_REPLY_THREADS_OFF","channelDisplayModeSection","CHANNEL_DISPLAY_MODE_FULL_SCREEN","CHANNEL_DISPLAY_MODE_CENTERED","languagesSection","localeName","getLanguageInfo","themeSection","oneClickReactionsOnPostsSection","enableThemeSelection","emojiPickerEnabled","_user$props","getTimezoneForUserProfile","getCurrentTimezoneFull","automaticTimezoneNotSet","generateCurrentTimezoneLabel","getUserCurrentTimezone","AllowCustomThemes","EnableLinkPreviews","EnableThemeSelection","getLicense","LockTeammateNameDisplay","TeammateNameDisplay","EnableEmojiPicker","EnableLastActiveTime","getUser","isLanguageAvailable","DefaultClientLocale","AVAILABILITY_STATUS_ON_POSTS_DEFAULT","USE_MILITARY_TIME_DEFAULT","CHANNEL_DISPLAY_MODE_DEFAULT","MESSAGE_DISPLAY_DEFAULT","COLORIZE_USERNAMES_DEFAULT","COLLAPSE_DISPLAY_DEFAULT","isCollapsedThreadsAllowed","CollapsedThreads","ALWAYS_ON","getCollapsedThreadsPreference","CLICK_TO_REPLY_DEFAULT","LINK_PREVIEW_DISPLAY_DEFAULT","ONE_CLICK_REACTIONS_ENABLED_DEFAULT","SettingPicture","Component","_this$props$updateSec","removeSrc","setDefaultSrc","confirmButton","_this$props$onRemove","loadingPicture","onRemove","_this$props$onSetDefa","onSetDefault","_this$props$onSubmit","_this$props4","focusFirstElement","_this$props$onFileCha","_this$props5","onFileChange","selectInput","click","file","previewBlob","URL","createObjectURL","reader","FileReader","onload","orientation","FileUtils","result","orientationStyles","readAsArrayBuffer","imageContext","imageStyles","backgroundImage","defaultImageSrc","_title","imageElement","handler","handleRemoveSrc","handleSetDefaultSrc","_this$settingList$cur","handleFileSelected","setPicture","revokeObjectURL","img","renderImg","imgRender","buttonRender","disableSaveButtonFocus","submitActive","accept","ACCEPT_STATIC_IMAGE","handleFileChange","handleInputFile","localizeMessage","handleSave","LoadingWrapper","loading","helpText","FormError","errors","handleCancel","holders","usernameReserved","usernameGroupNameUniqueness","usernameRestrictions","validEmail","emailMatch","incorrectPassword","emptyPassword","validImage","imageTooLarge","uploadImage","uploadImageMobile","fullName","nickname","username","profilePicture","close","position","UserSettingsGeneralTab","PureComponent","email","resendStatus","showSpinner","sendVerificationEmail","handleEmailResend","usernameError","Utils","errObj","ValidationErrors","RESERVED_NAME","min","MIN_USERNAME_LENGTH","MAX_USERNAME_LENGTH","firstName","lastName","first_name","last_name","confirmEmail","currentPassword","isEmail","password","emailError","emailUpdated","sectionIsSaving","_ref2","requireEmailVerification","clearErrors","logError","AnnouncementBarMessages","EMAIL_VERIFICATION_REQUIRED","AnnouncementBarTypes","SUCCESS","server_error_id","setDefaultProfileImage","pictureFile","AcceptedProfileImageTypes","includes","size","maxFileSize","uploadProfileImage","_ref3","setupInitialState","_this$state$customAtt","attributeID","attributeValue","customAttributeValues","saveCustomProfileAttribute","_ref4","files","attributeValues","substring","LDAP_SERVICE","ldapFirstNameAttributeSet","ldapLastNameAttributeSet","SAML_SERVICE","samlFirstNameAttributeSet","samlLastNameAttributeSet","OAUTH_SERVICES","autoFocus","updateFirstName","maxLength","MAX_FIRSTNAME_LENGTH","onFocus","updateLastName","MAX_LASTNAME_LENGTH","notifClick","notifLink","notify","submitName","ldapNicknameAttributeSet","samlNicknameAttributeSet","nicknameLabel","updateNickname","MAX_NICKNAME_LENGTH","autoCapitalize","submitNickname","usernameLabel","updateUsername","submitUsername","ldapPositionAttributeSet","samlPositionAttributeSet","positionLabel","updatePosition","MAX_POSITION_LENGTH","submitPosition","customProfileAttributeFields","attributeSections","attribute","_this$state$customAtt2","_this$state$customAtt3","sectionName","attributeLabel","updateAttribute","MAX_CUSTOM_ATTRIBUTE_LENGTH","submitAttribute","setDefault","imgSrc","ldapPictureAttributeSet","submitPicture","last_picture_update","setDefaultProfilePicture","updatePicture","minMessage","date","FormattedDate","Date","day","month","year","enableCustomProfileAttributes","fetchValues","response","Client4","getUserCustomProfileAttributesValues","getCustomProfileAttributeFields","cav","originalEmail","createEmailSection","emailVerificationEnabled","updateEmail","MAX_EMAIL_LENGTH","updateConfirmEmail","updateCurrentPassword","submitEmail","GITLAB_SERVICE","GOOGLE_SERVICE","OFFICE365_SERVICE","OPENID_SERVICE","nameSection","createNameSection","nicknameSection","createNicknameSection","usernameSection","createUsernameSection","positionSection","createPositionSection","emailSection","customProperiesSection","createCustomAttributeSection","pictureSection","createPictureSection","getCustomProfileAttributes","RequireEmailVerification","parseInt","MaxFileSize","LdapFirstNameAttributeSet","LdapLastNameAttributeSet","SamlFirstNameAttributeSet","SamlLastNameAttributeSet","LdapNicknameAttributeSet","SamlNicknameAttributeSet","SamlPositionAttributeSet","LdapPositionAttributeSet","LdapPictureAttributeSet","getFeatureFlagValue","NotificationPermissionDeniedSectionNotice","open","SectionNotice","tertiaryButton","NotificationPermissionNeverGrantedSectionNotice","permission","requestNotificationPermission","onCtaButtonClick","primaryButton","NotificationPermissionUnsupportedSectionNotice","NotificationPermissionDesktopDeniedSectionNotice","checkedPermissionDenied","setCheckedPermissionDenied","handleInstructionButtonClick","requestDesktopNotificationPermission","NotificationPermissionDenied","NotificationPermissionSectionNotice","isNotificationSupported","isNotificationAPISupported","notificationPermission","setNotificationPermission","getNotificationPermission","desktopNotificationPermission","useDesktopAppNotificationPermission","NotificationPermissionNeverGranted","NotificationPermissionNeverGrantedNotice","NotificationPermissionDeniedNotice","NotificationPermissionTitleTag","Tag","variant","DesktopAndMobileNotificationSettings","setParentState","isCollapsedThreadsEnabled","desktopActivity","sendPushNotifications","pushActivity","pushStatus","desktopThreads","pushThreads","desktopAndMobileSettingsDifferent","editButtonRef","previousActiveRef","_editButtonRef$curren","handleChangeForSendDesktopNotificationsRadio","event","handleChangeForDesktopThreadsCheckbox","NotificationLevels","ALL","MENTION","handleChangeForDifferentMobileNotificationsCheckbox","handleChangeForSendMobileNotificationsSelect","handleChangeForMobileThreadsCheckbox","handleChangeForTriggerMobileNotificationsSelect","maximizedSettingsInputs","useMemo","maximizedSettingInputs","sendDesktopNotificationsSection","optionsOfSendNotifications","optionOfSendNotifications","NONE","shouldShowDesktopThreadsSection","desktopThreadNotificationSection","Fragment","differentMobileNotificationsSection","shouldShowSendMobileNotificationsSection","sendMobileNotificationsSection","inputId","isClearable","isSearchable","components","IndicatorSeparator","NoIndicatorSeparatorComponent","getValueOfSendMobileNotificationForSelect","shouldShowMobileThreadsSection","threadNotificationSection","shouldShowTriggerMobileNotificationsSection","triggerMobileNotificationsSection","optionsOfSendMobileNotificationsWhenSelect","getValueOfSendMobileNotificationWhenSelect","disabledPushNotificationsSection","getCollapsedText","UserSettingsNotificationSections","DESKTOP_AND_MOBILE","find","ONLINE","AWAY","OFFLINE","memo","DesktopNotificationSoundsSettings","desktopSound","desktopNotificationSound","isCallsRingingEnabled","callsDesktopSound","callsNotificationSound","handleChangeForMessageNotificationSoundCheckbox","stopTryNotificationRing","handleChangeForIncomginCallSoundCheckbox","handleChangeForMessageNotificationSoundSelect","tryNotificationSound","handleChangeForIncomingCallSoundSelect","tryNotificationRing","isMessageNotificationSoundChecked","messageSoundSection","optionsOfMessageNotificationSoundsSelect","placeholder","getValueOfNotificationSoundsSelect","isIncomingCallSoundChecked","callSoundSection","optionsOfIncomingCallSoundsSelect","getValueOfIncomingCallSoundsSelect","DESKTOP_NOTIFICATION_SOUND","desktopNotificationSoundIsSelected","notificationSoundKeys","callNotificationSoundIsSelected","callNotificationSoundKeys","hasCallsSound","hasDesktopSound","callsSound","getEmailInterval","enableEmailNotification","enableEmailBatching","emailIntervalPreference","INTERVAL_NEVER","INTERVAL_IMMEDIATE","INTERVAL_FIFTEEN_MINUTES","INTERVAL_HOUR","validValuesWithoutEmailBatching","EmailNotificationSetting","enableEmail","getAttribute","newInterval","emailInterval","CATEGORY_NOTIFICATIONS","EMAIL_INTERVAL","sendEmailNotifications","batchingOptions","batchingInfo","handleChange","threadsNotificationSelection","threads","handleThreadsOnChange","getDerivedStateFromProps","nextProps","_this$editButtonRef$c","renderMaxSettingView","renderMinSettingView","getPreference","INTERVAL_NOT_SET","EnableEmailBatching","SendEmailNotifications","ManageAutoResponder","autoResponderActive","autoResponderMessage","activeToggle","handleAutoResponderChecked","LocalizedPlaceholderTextarea","resize","rows","onMessageChanged","sectionNoticeContainerStyle","marginTop","SendTestNotificationNotice","buttonState","setButtonState","isSending","timeout","externalLink","useExternalLink","onGoToNotificationDocumentation","onSendTestNotificationClick","isShowingSending","sendTestNotification","clearTimeout","setResult","status","console","leadingIcon","secondaryButton","trailingIcon","WHITE_SPACE_REGEX","COMMA_REGEX","getDefaultStateFromProps","desktop","emailThreads","sound","comments","_props$user$notify_pr","_props$user$notify_pr2","notify_props","desktop_threads","push_threads","email_threads","desktop_sound","calls_desktop_sound","desktop_notification_sound","calls_notification_sound","push_status","auto_responder_active","auto_responder_message","validNotificationLevels","areDesktopAndMobileSettingsDifferent","usernameKey","firstNameKey","channelKey","isCustomKeysWithNotificationInputChecked","customKeysWithNotification","customKeysWithHighlight","_props$user$notify_pr3","_props$user$notify_pr4","_props$user$notify_pr5","_props$user$notify_pr6","_props$user$notify_pr7","_props$user$notify_pr8","mention_keys","mentionKeys","filter","mentionKey","highlight_keys","highlightKey","channel","customKeysWithNotificationInputValue","customKeysWithHighlightInputValue","notifyCommentsLevel","NotificationsTab","_this$props$user$noti","join","highlightKeys","trackFeatureEvent","TrackPassiveKeywordsFeature","TrackPassiveKeywordsEvent","payloadUser","formattedValue","newValue","COMMA","TAB","_this$state$customKey","_this$state$customKey2","_this$state$customKey3","_this$state$customKey4","unsavedCustomKeyWithNotification","updateCustomKeysWithNotificationWithInputValue","_this$state$customKey5","_this$state$customKey6","_this$state$customKey7","_this$state$customKey8","_newValue$trim$replac","_newValue$trim","unsavedCustomKeyWithHighlight","updateCustomKeysWithHighlightWithInputValue","isSectionExpanded","KEYWORDS_MENTIONS","expandedSection","handleChangeForFirstNameKeyCheckbox","handleChangeForUsernameKeyCheckbox","handleChangeForChannelKeyCheckbox","handleChangeForCustomKeysWithNotificationCheckbox","CreatableReactSelect","isMulti","customKeywordsSelectorStyles","DropdownIndicator","Menu","MenuList","handleChangeForCustomKeysWithNotificationInput","inputValue","onInputChange","handleChangeForCustomKeysWithNotificationInputValue","onBlur","handleBlurForCustomKeysWithNotificationInput","handleOnKeydownForCustomKeysWithNotificationInput","selectedMentionKeys","customKeysWithNotificationStringArray","collapsedDescription","KEYWORDS_HIGHLIGHT","handleChangeForCustomKeysWithHighlightInput","handleChangeForCustomKeysWithHighlightInputValue","handleBlurForCustomKeysWithHighlightInput","handleOnKeydownForCustomKeysWithHighlightInput","isEnterpriseOrCloudOrSKUStarterFree","isEnterpriseReady","RestrictedIndicator","blocked","feature","MattermostFeatures","HIGHLIGHT_WITHOUT_NOTIFICATION","minimumPlanRequiredForFeature","LicenseSkus","Professional","tooltipTitle","tooltipMessageBlocked","titleAdminPreTrial","messageAdminPreTrial","titleAdminPostTrial","messageAdminPostTrial","titleEndUser","messageEndUser","br","ctaExtraContent","clickCallback","handleCloseSettingsModal","REPLY_NOTIFCATIONS","commentsActive","handleNotifyCommentsRadio","AUTO_RESPONDER","setStateValue","keywordsWithNotificationSection","createKeywordsWithNotificationSection","keywordsWithHighlightSection","createKeywordsWithHighlightSection","commentsSection","createCommentsSection","autoResponderSection","createAutoResponderSection","chunks","LightbulbOutlineIcon","EMAIL","handleEmailRadio","enableAutoResponder","container","baseStyle","marginBlockStart","control","baseStyles","backgroundColor","border","borderColor","multiValue","background","multiValueLabel","indicatorSeparator","indicatorSeperatorStyles","multiValueRemove","multiValueRemoveStyles","cursor","mapStateToProps","SendPushNotifications","ExperimentalEnableAutomaticReplies","license","subscriptionProduct","getSubscriptionProduct","BuildEnterpriseReady","isCollapsedThreadsEnabledForUser","isCallsEnabled","isCallsRingingEnabledOnServer","UserSettingsNotifications","action","buttonText","getPluginPreferenceKey","pluginId","slice","markdownOptions","mentionHighlight","RadioOption","selectedValue","onSelected","Markdown","RadioInput","informChange","useSelector","setSelectedValue","PluginSetting","useDispatch","preferenceMin","toUpdate","minDescribe","_setting$options$find","v","onSettingChanged","_section$onSubmit","CustomComponent","component","inputEl","PluggableErrorBoundary","PluginTab","headerText","pluginName","PluginAction","sections","sectionEl","AccessHistoryModal","getUserAudits","onHide","userAudits","setShow","onCloseClick","content","LoadingScreen","AuditTable","audits","showIp","showSession","Modal","dialogClassName","onExited","bsSize","Header","closeButton","Title","componentClass","Body","Footer","getCurrentUserAudits","DeviceIcon","devicePicture","formatAsString","deviceTitle","MoreInfo","currentSession","handleMoreInfo","moreInfo","firstAccessTime","create_at","getMonthLong","time","FormattedTime","hour","minute","os","browser","ActivityLog","submitRevoke","session","device_id","devicePlatform","appleIcon","General","PUSH_NOTIFY_APPLE_REACT_NATIVE","androidIcon","PUSH_NOTIFY_ANDROID_REACT_NATIVE","lastAccessTime","last_activity_at","platform","isMobileSession","sessionInfo","mobileSessionInfo","windowsIcon","linuxIcon","ActivityLogModal","altId","_e$target","modalContent","revokeSession","getSessions","onShow","activityList","sessions","reduce","array","getUserSessions","getCurrentLocale","MfaSection","getHistory","mfaEnforced","mfaActive","removeMfa","setupMfa","renderTitle","mfaAvailable","renderContent","renderHelpText","renderDescription","mfaLicensed","IsLicensed","MFA","mfaEnabled","EnableMultifactorAuthentication","EnforceMultifactorAuthentication","mfa_active","TOKEN_CREATING","TOKEN_CREATED","TOKEN_NOT_CREATING","UserAccessTokenSection","tokenCreationState","handleCancelConfirm","newtokendescriptionRef","tokenError","confirmCopyToken","createUserAccessToken","newToken","confirmAction","showConfirmModal","confirmTitle","confirmMessage","token","confirmComplete","confirmHideCancel","UserUtils","roles","handleCreateToken","Keyboard","confirmCreateToken","tokenId","userAccessTokens","revokeToken","revokeUserAccessToken","enableUserAccessToken","disableUserAccessToken","clearUserAccessTokens","getUserAccessTokensForUser","tokenListClass","tokenList","noTokenText","newTokenSection","activeLink","activeStatus","is_active","deactivateToken","activateToken","confirmRevokeToken","isMobile","linkTokens","DeveloperLinks","PERSONAL_ACCESS_TOKENS","linkAPI","onKeyPress","saveTokenKeyPress","savingMessage","stopCreatingToken","WarningIcon","additionalClassName","startCreatingToken","hideCancel","entities","users","myUserAccessTokens","SECTION_PASSWORD","SECTION_SIGNIN","SECTION_APPS","SECTION_TOKENS","SecurityTab","getAuthorizedOAuthApps","authorizedApps","newPassword","confirmPassword","passwordError","valid","isValidPassword","passwordConfig","defaultState","getDefaultState","savingPassword","updateUserPassword","getMe","appId","deauthorizeOAuthApp","app","submitPassword","updateNewPassword","updateConfirmPassword","d","last_password_update","hour12","emailOption","gitlabOption","googleOption","office365Option","openidOption","ldapOption","samlOption","enableSignUpWithGitLab","Link","to","encodeURIComponent","enableSignUpWithGoogle","enableSignUpWithOffice365","enableSignUpWithOpenId","enableLdap","enableSaml","allowedToSwitchToEmail","apps","homepage","deauthorizeApp","icon_url","icon50","wrapperClass","authService","enableOAuthServiceProvider","loadAuthorizedOAuthApps","passwordSection","createPasswordSection","signInSection","oauthSection","tokensSection","numMethods","experimentalEnableAuthenticationTransfer","createSignInSection","createOAuthAppsSection","canUseAccessTokens","ToggleModalButton","modalId","dialogType","ownProps","tokensEnabled","EnableUserAccessTokens","userHasTokenRole","EnableOAuthServiceProvider","EnableSignUpWithEmail","EnableSignInWithEmail","EnableSignInWithUsername","EnableSignUpWithGitLab","EnableSignUpWithGoogle","EnableSignUpWithOpenId","EnableLdap","EnableSaml","EnableSignUpWithOffice365","ExperimentalEnableAuthenticationTransfer","getPasswordConfig","limits","LimitVisibleGMsDMs","limit","CATEGORY_SIDEBAR_SETTINGS","LIMIT_VISIBLE_DMS_GMS","dmGmLimit","getVisibleDmGmLimit","ShowUnreadsCategory","SHOW_UNREAD_SECTION","showUnreadsCategory","shouldShowUnreadsCategory","UserSettingsSidebar","UserSettings","GeneralTab","DisplayTab","SidebarTab","AdvancedTab","pluginSettings","SmartLoader","children","onLoaded","timeoutFinished","setTimeoutFinished","UserSettingsModal","_props$activeTab","cmdOrCtrlPressed","A","handleHide","requireConfirm","active_tab","isContentProductSettings","active_section","ReactDOM","modalBodyRef","enforceFocus","customConfirmAction","afterConfirm","handleConfirm","handleCollapse","skipConfirm","useURL","isValidUrl","startsWith","userID","scrollTop","modalTitle","userDisplayName","getDisplayName","handleHidden","setLoadingFinished","LoadingSpinner","getUserSettingsTabs","getProfileSettingsTab","getPluginsSettingsTab","handleCancelConfirmation"],"sourceRoot":""}