|
@@ -1,14 +1,19 @@
|
|
|
-import React from 'react';
|
|
|
|
|
|
|
+import React, { useEffect } from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'next-i18next';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import AdminImportContainer from '~/client/services/AdminImportContainer';
|
|
import AdminImportContainer from '~/client/services/AdminImportContainer';
|
|
|
|
|
+import { toastError } from '~/client/util/apiNotification';
|
|
|
|
|
+import { toArrayIfNot } from '~/utils/array-utils';
|
|
|
|
|
+import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
|
|
|
import GrowiArchiveSection from './GrowiArchiveSection';
|
|
import GrowiArchiveSection from './GrowiArchiveSection';
|
|
|
|
|
|
|
|
|
|
+const logger = loggerFactory('growi:importer');
|
|
|
|
|
+
|
|
|
class ImportDataPageContents extends React.Component {
|
|
class ImportDataPageContents extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
@@ -242,6 +247,23 @@ ImportDataPageContents.propTypes = {
|
|
|
const ImportDataPageContentsWrapperFc = (props) => {
|
|
const ImportDataPageContentsWrapperFc = (props) => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
+ const { adminImportContainer } = props;
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const fetchImportSettingsData = async() => {
|
|
|
|
|
+ await adminImportContainer.retrieveImportSettingsData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ fetchImportSettingsData();
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ const errs = toArrayIfNot(err);
|
|
|
|
|
+ toastError(errs);
|
|
|
|
|
+ logger.error(errs);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [adminImportContainer]);
|
|
|
|
|
+
|
|
|
return <ImportDataPageContents t={t} {...props} />;
|
|
return <ImportDataPageContents t={t} {...props} />;
|
|
|
};
|
|
};
|
|
|
|
|
|