Skip to content

Commit

Permalink
TASK: create nodes on Enter key, show loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip committed Oct 13, 2017
1 parent 47ba29d commit 82b7426
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
11 changes: 8 additions & 3 deletions Resources/Private/CreateNodeView/src/CreateNodeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {neos} from '@neos-project/neos-ui-decorators';
@connect($transform({
siteNodeContextPath: $get('cr.nodes.siteNode')
}), {
persistChanges: actions.Changes.persistChanges
persistChanges: actions.Changes.persistChanges,
startLoading: actions.UI.ContentCanvas.startLoading,
})
export default class CreateNodeView extends Component {

Expand All @@ -24,7 +25,8 @@ export default class CreateNodeView extends Component {
referenceNodePath: PropTypes.string.isRequired,
placeholder: PropTypes.string.isRequired
}),
persistChanges: PropTypes.func.isRequired
persistChanges: PropTypes.func.isRequired,
startLoading: PropTypes.func.isRequired
};

state = {
Expand All @@ -45,7 +47,9 @@ export default class CreateNodeView extends Component {
nodeType,
data
}
}])
}]);
this.setState({title: ''});
this.props.startLoading();
}

render() {
Expand All @@ -57,6 +61,7 @@ export default class CreateNodeView extends Component {
onChange={title => this.setState({title})}
value={this.state.title}
placeholder={placeholder}
onEnterKey={() => this.createNode()}
/>
<Button style="lighter" onClick={() => this.createNode()}>{this.props.i18nRegistry.translate('Psmb.CreateNodeButton:Main:create')}</Button>
</div>
Expand Down
13 changes: 10 additions & 3 deletions Resources/Public/JavaScript/CreateNodeView/Plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82b7426

Please sign in to comment.