Skip to content

Commit 326d29a

Browse files
committed
fixed bug: can't set is_private in category
1 parent 422f87f commit 326d29a

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

app/assets/javascripts/notee/application.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/javascripts/components/categories/CategoryForm.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ export default class CategoryForm extends Component {
9494

9595
<Checkbox
9696
value={this.state.new_category.is_private}
97-
onChange={(event, index, value) => this.handleChangeNewCategoryIsPrivate(event, index, value)}
97+
onCheck={(event, isInputChecked) => this.handleChangeNewCategoryIsPrivate(event, isInputChecked)}
9898
label="this category is Privated?"
99-
defaultChecked={false}
99+
defaultChecked={this.state.new_category.is_private}
100100
/>
101101

102102
<AuthorityButtonCreate

frontend/src/javascripts/components/categories/CategorySectionEdit.react.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ export default class CategorySectionEdit extends Component {
183183

184184
<Checkbox
185185
value={this.state.category.is_private}
186-
onChange={(event, index, value) => this.handleChangeCategoryIsPrivate(event, index, value)}
186+
onCheck={(event, isInputChecked) => this.handleChangeCategoryIsPrivate(event, isInputChecked)}
187187
label="this category is Privated?"
188-
defaultChecked={false}
188+
defaultChecked={this.state.category.is_private}
189189
/>
190190

191191
<RaisedButton
@@ -215,7 +215,8 @@ export default class CategorySectionEdit extends Component {
215215
this.state.category.parent_id = value;
216216
this.setState({ category: this.state.category });
217217
}
218-
handleChangeCategoryIsPrivate(event, index, value){
218+
handleChangeCategoryIsPrivate(event, value){
219+
console.log(value);
219220
this.state.category.is_private = value;
220221
this.setState({ category: this.state.category });
221222
}

frontend/src/javascripts/components/commons/table/NoteeTableRow.react.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export default class NoteeTableRow extends Component {
2727
return(
2828
<TableRow>
2929
{this.state.contents.map((content, index)=>{
30+
31+
if (content != null){content = content.toString();}
3032
return (
3133
<TableRowColumn key={index}>{content}</TableRowColumn>
3234
);

frontend/src/javascripts/components/posts/PostNewCategory.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ export default class PostNewCategory extends Component {
112112
</select>
113113
<Checkbox
114114
value={this.state.new_category.is_private}
115-
onChange={(event, index, value) => this.handleChangeNewCategoryIsPrivate(event, index, value)}
115+
onCheck={(event, isInputChecked) => this.handleChangeCategoryIsPrivate(event, isInputChecked)}
116116
label="this category is Privated?"
117-
defaultChecked={false}
117+
defaultChecked={this.state.new_category.is_private}
118118
/>
119119
<button
120120
style={style.image_button}

0 commit comments

Comments
 (0)