// @flow import * as React from 'react'; import { observable } from 'mobx'; import { observer, inject } from 'mobx-react'; import AuthStore from 'stores/AuthStore'; import UiStore from 'stores/UiStore'; import Checkbox from 'components/Checkbox'; import Button from 'components/Button'; import CenteredContent from 'components/CenteredContent'; import PageTitle from 'components/PageTitle'; import HelpText from 'components/HelpText'; type Props = { auth: AuthStore, ui: UiStore, }; @observer class Security extends React.Component { form: ?HTMLFormElement; @observable sharing: boolean; @observable documentEmbeds: boolean; componentDidMount() { const { auth } = this.props; if (auth.team) { this.documentEmbeds = auth.team.documentEmbeds; this.sharing = auth.team.sharing; } } handleSubmit = async (ev: SyntheticEvent<*>) => { ev.preventDefault(); await this.props.auth.updateTeam({ sharing: this.sharing, documentEmbeds: this.documentEmbeds, }); this.props.ui.showToast('Settings saved', 'success'); }; handleChange = (ev: SyntheticInputEvent<*>) => { switch (ev.target.name) { case 'sharing': return (this.sharing = ev.target.checked); case 'documentEmbeds': return (this.documentEmbeds = ev.target.checked); default: } }; get isValid() { return this.form && this.form.checkValidity(); } render() { const { isSaving } = this.props.auth; return (

Security

Settings that impact the access, security and content of your knowledgebase.
(this.form = ref)}>
); } } export default inject('auth', 'ui')(Security);