Skip to content

Commit

Permalink
changed action names
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Oct 11, 2016
1 parent 9b2f7f7 commit 5154553
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions web/client/actions/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* LICENSE file in the root directory of this source tree.
*/

const ON_STARTUP = 'ON_STARTUP';
const MANAGER_ITEM_SELECTED = 'MANAGER_ITEM_SELECTED';

function onStartUp(toolId) {
function itemSelected(toolId) {
return {
type: ON_STARTUP,
type: MANAGER_ITEM_SELECTED,
toolId
};
}

module.exports = {
ON_STARTUP, onStartUp
MANAGER_ITEM_SELECTED, itemSelected
};
11 changes: 5 additions & 6 deletions web/client/plugins/manager/Manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const { onStartUp } = require('../../actions/manager');
const { itemSelected } = require('../../actions/manager');
const {Nav, NavItem, Glyphicon} = require('react-bootstrap');
const {connect} = require('react-redux');
const {Message} = require('../../components/I18N/I18N');
Expand All @@ -16,8 +16,7 @@ const Manager = React.createClass({
propTypes: {
navStyle: React.PropTypes.object,
items: React.PropTypes.array,
onItemSelected: React.PropTypes.func,
onStartUp: React.PropTypes.func,
itemSelected: React.PropTypes.func,
selectedTool: React.PropTypes.string
},
contextTypes: {
Expand All @@ -28,7 +27,7 @@ const Manager = React.createClass({
items: [],
mapType: "openlayers",
selectedTool: "importer",
onStartUp: () => {}
itemSelected: () => {}
};
},
renderToolIcon(tool) {
Expand All @@ -44,7 +43,7 @@ const Manager = React.createClass({
href="#"
onClick={(event) => {
event.preventDefault();
this.props.onStartUp(tool.id);
this.props.itemSelected(tool.id);
this.context.router.push("/manager/" + tool.id);
}}>
{this.renderToolIcon(tool)}
Expand Down Expand Up @@ -78,6 +77,6 @@ module.exports = {
selectedTool: ownProps.tool
}),
{
onStartUp
itemSelected
})(Manager)
};
10 changes: 5 additions & 5 deletions web/client/plugins/manager/ManagerMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const React = require('react');
const {connect} = require('react-redux');

const { onStartUp } = require('../../actions/manager');
const { itemSelected } = require('../../actions/manager');
const assign = require('object-assign');

const {DropdownButton, Glyphicon, MenuItem} = require('react-bootstrap');
Expand All @@ -33,7 +33,7 @@ const ManagerMenu = React.createClass({
entries: React.PropTypes.array,
title: React.PropTypes.node,
onItemClick: React.PropTypes.func,
onStartUp: React.PropTypes.func,
itemSelected: React.PropTypes.func,
controls: React.PropTypes.object,
mapType: React.PropTypes.string,
panelStyle: React.PropTypes.object,
Expand All @@ -49,7 +49,7 @@ const ManagerMenu = React.createClass({
entries: [],
role: "",
onItemClick: () => {},
onStartUp: () => {},
itemSelected: () => {},
title: <MenuItem header>Manager</MenuItem>,
controls: [],
mapType: "leaflet",
Expand All @@ -66,7 +66,7 @@ const ManagerMenu = React.createClass({
getTools() {
return [{element: <span key="burger-menu-title">{this.props.title}</span>}, ...this.props.entries.sort((a, b) => a.position - b.position).map((entry) => {
return {
action: (context) => {context.router.push(entry.path); return this.props.onStartUp(entry.id); },
action: (context) => {context.router.push(entry.path); return this.props.itemSelected(entry.id); },
text: entry.msgId ? <Message msgId={entry.msgId} /> : entry.text,
cfg: {...entry}
};
Expand Down Expand Up @@ -97,7 +97,7 @@ module.exports = {
controls: state.controls,
role: state.security && state.security.user && state.security.user.role
}), {
onStartUp
itemSelected
})(ManagerMenu), {
OmniBar: {
name: "managermenu",
Expand Down

0 comments on commit 5154553

Please sign in to comment.