|
|
@@ -1,15 +1,13 @@
|
|
|
|
|
|
-import React, { Fragment } from 'react';
|
|
|
+import React from 'react';
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
|
|
|
-import AppContainer from '~/client/services/AppContainer';
|
|
|
import { toastError } from '~/client/util/apiNotification';
|
|
|
import { toArrayIfNot } from '~/utils/array-utils';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
-import { withLoadingSppiner } from '../../SuspenseUtils';
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
|
import CustomizeCssSetting from './CustomizeCssSetting';
|
|
|
@@ -24,33 +22,33 @@ import CustomizeTitle from './CustomizeTitle';
|
|
|
|
|
|
const logger = loggerFactory('growi:services:AdminCustomizePage');
|
|
|
|
|
|
-let retrieveErrors = null;
|
|
|
+const retrieveErrors = null;
|
|
|
function Customize(props) {
|
|
|
- const { appContainer, adminCustomizeContainer } = props;
|
|
|
+ const { adminCustomizeContainer } = props;
|
|
|
|
|
|
- if (adminCustomizeContainer.state.currentTheme === adminCustomizeContainer.dummyCurrentTheme) {
|
|
|
- throw (async() => {
|
|
|
- try {
|
|
|
- await adminCustomizeContainer.retrieveCustomizeData();
|
|
|
- }
|
|
|
- catch (err) {
|
|
|
- const errs = toArrayIfNot(err);
|
|
|
- toastError(errs);
|
|
|
- logger.error(errs);
|
|
|
- retrieveErrors = errs;
|
|
|
- adminCustomizeContainer.setState({ currentTheme: adminCustomizeContainer.dummyCurrentThemeForError });
|
|
|
- }
|
|
|
- })();
|
|
|
- }
|
|
|
+ // if (adminCustomizeContainer.state.currentTheme === adminCustomizeContainer.dummyCurrentTheme) {
|
|
|
+ // throw (async() => {
|
|
|
+ // try {
|
|
|
+ // await adminCustomizeContainer.retrieveCustomizeData();
|
|
|
+ // }
|
|
|
+ // catch (err) {
|
|
|
+ // const errs = toArrayIfNot(err);
|
|
|
+ // toastError(errs);
|
|
|
+ // logger.error(errs);
|
|
|
+ // retrieveErrors = errs;
|
|
|
+ // adminCustomizeContainer.setState({ currentTheme: adminCustomizeContainer.dummyCurrentThemeForError });
|
|
|
+ // }
|
|
|
+ // })();
|
|
|
+ // }
|
|
|
|
|
|
- if (adminCustomizeContainer.state.currentTheme === adminCustomizeContainer.dummyCurrentThemeForError) {
|
|
|
- throw new Error(`${retrieveErrors.length} errors occured`);
|
|
|
- }
|
|
|
+ // if (adminCustomizeContainer.state.currentTheme === adminCustomizeContainer.dummyCurrentThemeForError) {
|
|
|
+ // throw new Error(`${retrieveErrors.length} errors occured`);
|
|
|
+ // }
|
|
|
|
|
|
return (
|
|
|
<div data-testid="admin-customize">
|
|
|
<div className="mb-5">
|
|
|
- <CustomizeLayoutSetting appContainer={appContainer} />
|
|
|
+ <CustomizeLayoutSetting />
|
|
|
</div>
|
|
|
<div className="mb-5">
|
|
|
<CustomizeThemeSetting />
|
|
|
@@ -67,6 +65,7 @@ function Customize(props) {
|
|
|
<div className="mb-5">
|
|
|
<CustomizeTitle />
|
|
|
</div>
|
|
|
+ {/* TODO: show CustomizeHeaderSetting, CustomizeCssSetting and CustomizeScriptSetting by https://redmine.weseek.co.jp/issues/100534
|
|
|
<div className="mb-5">
|
|
|
<CustomizeHeaderSetting />
|
|
|
</div>
|
|
|
@@ -76,14 +75,14 @@ function Customize(props) {
|
|
|
<div className="mb-5">
|
|
|
<CustomizeScriptSetting />
|
|
|
</div>
|
|
|
+ */}
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-const CustomizePageWithUnstatedContainer = withUnstatedContainers(withLoadingSppiner(Customize), [AppContainer, AdminCustomizeContainer]);
|
|
|
+const CustomizePageWithUnstatedContainer = withUnstatedContainers(Customize, [AdminCustomizeContainer]);
|
|
|
|
|
|
Customize.propTypes = {
|
|
|
- appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
|
adminCustomizeContainer: PropTypes.instanceOf(AdminCustomizeContainer).isRequired,
|
|
|
};
|
|
|
|