|
@@ -18,6 +18,7 @@ class GrowiArchiveSection extends React.Component {
|
|
|
this.initialState = {
|
|
this.initialState = {
|
|
|
fileName: null,
|
|
fileName: null,
|
|
|
innerFileStats: null,
|
|
innerFileStats: null,
|
|
|
|
|
+ isTheSameVersion: true,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
this.state = this.initialState;
|
|
this.state = this.initialState;
|
|
@@ -25,6 +26,7 @@ class GrowiArchiveSection extends React.Component {
|
|
|
this.handleUpload = this.handleUpload.bind(this);
|
|
this.handleUpload = this.handleUpload.bind(this);
|
|
|
this.discardData = this.discardData.bind(this);
|
|
this.discardData = this.discardData.bind(this);
|
|
|
this.resetState = this.resetState.bind(this);
|
|
this.resetState = this.resetState.bind(this);
|
|
|
|
|
+ this.renderDefferentVersionAlert = this.renderDefferentVersionAlert.bind(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async componentWillMount() {
|
|
async componentWillMount() {
|
|
@@ -37,11 +39,15 @@ class GrowiArchiveSection extends React.Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- handleUpload({ meta, fileName, innerFileStats }) {
|
|
|
|
|
|
|
+ handleUpload({
|
|
|
|
|
+ meta, fileName, innerFileStats, isTheSameVersion,
|
|
|
|
|
+ }) {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
fileName,
|
|
fileName,
|
|
|
innerFileStats,
|
|
innerFileStats,
|
|
|
|
|
+ isTheSameVersion: false, // 仮
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log(`isTheSameVersion from handleUpload = ${isTheSameVersion}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async discardData() {
|
|
async discardData() {
|
|
@@ -74,12 +80,25 @@ class GrowiArchiveSection extends React.Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ renderDefferentVersionAlert() {
|
|
|
|
|
+ const { t } = this.props;
|
|
|
|
|
+ const { isTheSameVersion } = this.state;
|
|
|
|
|
+ console.log(`versionsNotMetinRenderDefferentVersionAlert=${isTheSameVersion}`);
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className="alert alert-warning mt-3">
|
|
|
|
|
+ {t('admin:importer_management.growi_settings.errors.versions_not_met')}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
resetState() {
|
|
resetState() {
|
|
|
this.setState(this.initialState);
|
|
this.setState(this.initialState);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
const { t } = this.props;
|
|
const { t } = this.props;
|
|
|
|
|
+ const { isTheSameVersion } = this.state;
|
|
|
|
|
+ console.log(`isTheSameVersion=${isTheSameVersion}`);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<Fragment>
|
|
<Fragment>
|
|
@@ -101,6 +120,7 @@ class GrowiArchiveSection extends React.Component {
|
|
|
|
|
|
|
|
{this.state.fileName != null ? (
|
|
{this.state.fileName != null ? (
|
|
|
<div className="px-4">
|
|
<div className="px-4">
|
|
|
|
|
+ {isTheSameVersion === false && this.renderDefferentVersionAlert()}
|
|
|
<ImportForm
|
|
<ImportForm
|
|
|
fileName={this.state.fileName}
|
|
fileName={this.state.fileName}
|
|
|
innerFileStats={this.state.innerFileStats}
|
|
innerFileStats={this.state.innerFileStats}
|