// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import $ from 'jquery'; import React from 'react'; import {FormattedMessage} from 'react-intl'; import * as Utils from 'utils/utils.jsx'; import AdminSidebarCategory from './admin_sidebar_category.jsx'; import AdminSidebarHeader from './admin_sidebar_header.jsx'; import AdminSidebarSection from './admin_sidebar_section.jsx'; export default class AdminSidebar extends React.Component { static get contextTypes() { return { router: React.PropTypes.object.isRequired }; } constructor(props) { super(props); this.updateTitle = this.updateTitle.bind(this); } componentDidMount() { this.updateTitle(); if (!Utils.isMobile()) { $('.admin-sidebar .nav-pills__container').perfectScrollbar(); } } componentDidUpdate() { if (!Utils.isMobile()) { $('.admin-sidebar .nav-pills__container').perfectScrollbar(); } } updateTitle() { let currentSiteName = ''; if (global.window.mm_config.SiteName != null) { currentSiteName = global.window.mm_config.SiteName; } document.title = Utils.localizeMessage('sidebar_right_menu.console', 'System Console') + ' - ' + currentSiteName; } render() { let oauthSettings = null; let ldapSettings = null; let samlSettings = null; let clusterSettings = null; let metricsSettings = null; let complianceSettings = null; let mfaSettings = null; let license = null; let audits = null; let policy = null; if (window.mm_config.BuildEnterpriseReady === 'true') { license = ( } /> ); } if (window.mm_license.IsLicensed === 'true') { if (global.window.mm_license.LDAP === 'true') { ldapSettings = ( } /> ); } if (global.window.mm_license.Cluster === 'true') { clusterSettings = ( } /> ); } if (global.window.mm_license.Metrics === 'true') { metricsSettings = ( } /> ); } if (global.window.mm_license.SAML === 'true') { samlSettings = ( } /> ); } if (global.window.mm_license.Compliance === 'true') { complianceSettings = ( } /> ); } if (global.window.mm_license.MFA === 'true') { mfaSettings = ( } /> ); } oauthSettings = ( } /> ); policy = ( } /> ); } else { oauthSettings = ( } /> ); } if (window.mm_license.IsLicensed === 'true') { audits = ( } /> ); } let customBranding = null; if (window.mm_license.IsLicensed === 'true') { customBranding = ( } /> ); } let otherCategory = null; if (license || audits) { otherCategory = ( } > {license} {audits} ); } const webrtcSettings = ( } /> ); return (
    } > } /> } /> } /> } /> } > } > } /> } /> } /> {policy} } /> {complianceSettings} } /> } > } /> {oauthSettings} {ldapSettings} {samlSettings} {mfaSettings} } > } /> } /> } /> } /> } /> } > } /> } /> } > } /> {webrtcSettings} } /> } > } /> } /> } > {customBranding} } /> } /> } /> } /> } > } /> } /> } /> {clusterSettings} {metricsSettings} {otherCategory}
); } }