import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import loggerFactory from '@alias/logger'; import { createSubscribedElement } from '../../UnstatedUtils'; import { toastSuccess, toastError } from '../../../util/apiNotification'; import { tags, attrs } from '../../../../../lib/service/xss/recommended-whitelist'; import AppContainer from '../../../services/AppContainer'; import AdminMarkDownContainer from '../../../services/AdminMarkDownContainer'; import WhiteListInput from './WhiteListInput'; const logger = loggerFactory('growi:importer'); class XssForm extends React.Component { constructor(props) { super(props); this.onClickSubmit = this.onClickSubmit.bind(this); } async onClickSubmit() { const { t } = this.props; try { await this.props.adminMarkDownContainer.updateXssSetting(); toastSuccess(t('toaster:update_successed', { target: 'XSS' })); } catch (err) { toastError(err); logger.error(err); } } xssOptions() { const { t, adminMarkDownContainer } = this.props; const { xssOption } = adminMarkDownContainer.state; return (
); } render() { const { t, adminMarkDownContainer } = this.props; const { isEnabledXss } = adminMarkDownContainer.state; return (