-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #206, show authors, issues & articles editors in Dialog boxes on admin site #217
Changes from 5 commits
7dea9bf
d3498a1
477d011
6c19b95
804300f
651ec48
dc3a2cc
081fefe
4b44343
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import React from 'react'; | ||
import FalcorController from 'lib/falcor/FalcorController'; | ||
import { browserHistory } from 'react-router'; | ||
import _ from 'lodash'; | ||
import EditAuthorsForm from './EditAuthorsForm'; | ||
import { debounce } from 'lib/utilities'; | ||
|
@@ -8,6 +9,7 @@ import moment from 'moment'; | |
import { updateFieldValue } from 'components/editor/lib/form-field-updaters'; | ||
|
||
// material-ui | ||
import Dialog from 'material-ui/Dialog'; | ||
import CircularProgress from 'material-ui/CircularProgress'; | ||
import RaisedButton from 'material-ui/RaisedButton'; | ||
import Divider from 'material-ui/Divider'; | ||
|
@@ -21,6 +23,7 @@ const MAX_TEASER_LENGTH = 156; | |
export default class EditorArticleController extends FalcorController { | ||
constructor(props) { | ||
super(props); | ||
this.handleDialogClose = this.handleDialogClose.bind(this); | ||
this.isFormChanged = this.isFormChanged.bind(this); | ||
this.handleSaveChanges = this.handleSaveChanges.bind(this); | ||
this.handleAddAuthor = this.handleAddAuthor.bind(this); | ||
|
@@ -36,6 +39,7 @@ export default class EditorArticleController extends FalcorController { | |
image: updateFieldValue.bind(this, 'image', undefined), | ||
}; | ||
this.safeSetState({ | ||
open: true, | ||
changed: false, | ||
saving: false, | ||
authors: [], | ||
|
@@ -121,6 +125,14 @@ export default class EditorArticleController extends FalcorController { | |
} | ||
} | ||
|
||
handleDialogClose() { | ||
if (this.state.saving) return; | ||
|
||
const page = this.props.params.page; | ||
const path = `/articles/page/${page}`; | ||
browserHistory.push(path); | ||
} | ||
|
||
handleSaveChanges(event) { | ||
event.preventDefault(); | ||
|
||
|
@@ -349,8 +361,14 @@ export default class EditorArticleController extends FalcorController { | |
} | ||
|
||
return ( | ||
<div style={styles.innerPaper}> | ||
<h2>Article Editor: {article.title}</h2> | ||
<Dialog | ||
title="Article Editor" | ||
open={this.state.open} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's just change this to just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I kinda overlooked this.. will change it now! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and thanks for bringing me onboard :D |
||
modal={false} | ||
autoScrollBodyContent | ||
onRequestClose={this.handleDialogClose} | ||
> | ||
<h2>{article.title}</h2> | ||
<Divider /> | ||
<TextField | ||
disabled | ||
|
@@ -435,7 +453,7 @@ export default class EditorArticleController extends FalcorController { | |
onClick={this.unpublish} | ||
icon={<Warning />} | ||
/> | ||
</div> | ||
</Dialog> | ||
); | ||
} | ||
return ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this as described below.