/* eslint-disable react/no-danger */ import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import Modal from 'react-bootstrap/es/Modal'; import GrowiArchiveImportOption from '@commons/models/admin/growi-archive-import-option'; import { createSubscribedElement } from '../../UnstatedUtils'; import AppContainer from '../../../services/AppContainer'; // import { toastSuccess, toastError } from '../../../util/apiNotification'; class GrowiZipImportConfigurationModal extends React.Component { constructor(props) { super(props); this.state = { option: null, }; this.initialize = this.initialize.bind(this); this.updateOption = this.updateOption.bind(this); } async initialize() { await this.setState({ option: Object.assign({}, this.props.option), // clone }); } /** * invoked when the value of control is changed * @param {object} updateObj */ changeHandler(updateObj) { const { option } = this.state; const newOption = Object.assign(option, updateObj); this.setState({ option: newOption }); } updateOption() { const { collectionName, onOptionChange, onClose, } = this.props; if (onOptionChange != null) { onOptionChange(collectionName, this.state.option); } onClose(); } renderPagesContents() { const { t } = this.props; const { option } = this.state; const translationBase = 'importer_management.growi_settings.configuration.pages'; /* eslint-disable react/no-unescaped-entities */ return ( <>