|
@@ -8,8 +8,6 @@ export default class PageHistory extends React.Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
|
|
|
- this.crowi = window.crowi; // FIXME
|
|
|
|
|
-
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
|
revisions: [],
|
|
revisions: [],
|
|
|
diffOpened: {},
|
|
diffOpened: {},
|
|
@@ -26,14 +24,14 @@ export default class PageHistory extends React.Component {
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.crowi.apiGet('/revisions.ids', {page_id: pageId})
|
|
|
|
|
|
|
+ this.props.crowi.apiGet('/revisions.ids', {page_id: pageId})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
|
|
|
|
|
const rev = res.revisions;
|
|
const rev = res.revisions;
|
|
|
let diffOpened = {};
|
|
let diffOpened = {};
|
|
|
const lastId = rev.length - 1;
|
|
const lastId = rev.length - 1;
|
|
|
res.revisions.map((revision, i) => {
|
|
res.revisions.map((revision, i) => {
|
|
|
- const user = this.crowi.findUserById(revision.author);
|
|
|
|
|
|
|
+ const user = this.props.crowi.findUserById(revision.author);
|
|
|
if (user) {
|
|
if (user) {
|
|
|
rev[i].author = user;
|
|
rev[i].author = user;
|
|
|
}
|
|
}
|
|
@@ -101,7 +99,7 @@ export default class PageHistory extends React.Component {
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.crowi.apiGet('/revisions.get', {revision_id: revision._id})
|
|
|
|
|
|
|
+ this.props.crowi.apiGet('/revisions.get', {revision_id: revision._id})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (res.ok) {
|
|
if (res.ok) {
|
|
|
this.setState({
|
|
this.setState({
|
|
@@ -137,4 +135,5 @@ export default class PageHistory extends React.Component {
|
|
|
|
|
|
|
|
PageHistory.propTypes = {
|
|
PageHistory.propTypes = {
|
|
|
pageId: React.PropTypes.string,
|
|
pageId: React.PropTypes.string,
|
|
|
|
|
+ crowi: React.PropTypes.object.isRequired,
|
|
|
};
|
|
};
|