2017-05-10 11:29:33 +00:00
|
|
|
export default class Store {
|
|
|
|
constructor({
|
2017-05-10 16:28:36 +00:00
|
|
|
titleHtml,
|
2017-05-24 11:25:53 +00:00
|
|
|
titleText,
|
2017-05-10 11:29:33 +00:00
|
|
|
descriptionHtml,
|
|
|
|
descriptionText,
|
|
|
|
}) {
|
|
|
|
this.state = {
|
2017-05-10 16:28:36 +00:00
|
|
|
titleHtml,
|
2017-05-24 11:25:53 +00:00
|
|
|
titleText,
|
2017-05-10 11:29:33 +00:00
|
|
|
descriptionHtml,
|
|
|
|
descriptionText,
|
|
|
|
taskStatus: '',
|
|
|
|
updatedAt: '',
|
|
|
|
};
|
2017-05-12 11:54:10 +00:00
|
|
|
this.formState = {
|
|
|
|
title: '',
|
2017-05-15 16:00:16 +00:00
|
|
|
confidential: false,
|
2017-05-12 14:52:45 +00:00
|
|
|
description: '',
|
2017-05-18 15:51:51 +00:00
|
|
|
lockedWarningVisible: false,
|
2017-05-17 12:01:24 +00:00
|
|
|
move_to_project_id: 0,
|
2017-05-26 08:29:06 +00:00
|
|
|
updateLoading: false,
|
2017-05-12 11:54:10 +00:00
|
|
|
};
|
2017-05-10 11:29:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
updateState(data) {
|
|
|
|
this.state.titleHtml = data.title;
|
|
|
|
this.state.titleText = data.title_text;
|
|
|
|
this.state.descriptionHtml = data.description;
|
|
|
|
this.state.descriptionText = data.description_text;
|
|
|
|
this.state.taskStatus = data.task_status;
|
|
|
|
this.state.updatedAt = data.updated_at;
|
|
|
|
}
|
2017-05-18 15:51:51 +00:00
|
|
|
|
|
|
|
stateShouldUpdate(data) {
|
|
|
|
return {
|
|
|
|
title: this.state.titleText !== data.title_text,
|
|
|
|
description: this.state.descriptionText !== data.description_text,
|
|
|
|
};
|
|
|
|
}
|
2017-05-10 11:29:33 +00:00
|
|
|
}
|