Skip to content

Fix #905. Implemented user manager plugin#1061

Merged
offtherailz merged 20 commits intogeosolutions-it:masterfrom
offtherailz:user_manager
Oct 4, 2016
Merged

Fix #905. Implemented user manager plugin#1061
offtherailz merged 20 commits intogeosolutions-it:masterfrom
offtherailz:user_manager

Conversation

@offtherailz
Copy link
Copy Markdown
Member

Implemented user manager.

image

  • Creation / Editing /Deletion of users

image
image
image

  • Minimal support to group management (no creation or delete, only add to the user).
    image
    image
  • Plus:
    • Improvements to dialog (support loading mask and modal mode)
    • Add a reusable confirm dialog already configured.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 80.511% when pulling 6d16249 on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@@ -0,0 +1,615 @@
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have importer related actions in this PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to remove them

return (dispatch, getState) => {
let text = searchText;
let state = getState && getState();
if (state) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like too much handling this sort of stuff here

Copy link
Copy Markdown
Member Author

@offtherailz offtherailz Oct 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I know that search text and current page should come from the action, but this way the component are not indipendent. Where you should place them?

groups
});
});
dispatch({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define an action creator, please

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't find any convention that forces to create module internal function that create the final object from the action creator. I thought to improve readability in this way (avoid to jump here and there for simple objects definition, avoid passing variables that can be inverted and so on...) I fixed this, let's check if it is a good convention and lets write it if there is a reason to make it mandatory.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason for now is: we always did this way, so far, let's discuss if we want to improve it and how, but I agree it's not mandatory


});
}).catch((error) => {
dispatch({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define an action creator, please

status: "loading"
});
return API.getAvailableGroups(user).then((groups) => {
dispatch({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define an action creator, please

const {editUser, changeUserMetadata, saveUser} = require('../../../actions/users');


const mapStateToProps = (state) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to make it so complex? Please, use the usual selectors composition with reselect

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are only not null checks, how it is less complex and more readable than this?

groups: users && users.groups
};
};
const mapDispatchToProps = (dispatch) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bindActionCreators is not needed, bind is not needed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 25, bind the action with null as first parameter, this is needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it, do we also need it for onChange and onSave ?

onDelete: deleteUser
}, dispatch);
};
const mergeProps = (stateProps, dispatchProps, ownProps) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear the purpose of this...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow overriding from ownProps , start and limit , even if not defined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

const assign = require('object-assign');
function users(state = {
start: 0,
limit: 12
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 is duplicated everywhere, can we make this a constant that we change in a single place?

top: "50%",
left: "50%",
transform: "translate(-50%, -40%)"
}}>Loading...<Spinner spinnerName="circle" noFadeIn/></div></div>);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be localized

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 80.454% when pulling 7eee84c on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 80.557% when pulling 7eee84c on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 80.557% when pulling 9170b2e on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 80.549% when pulling 9170b2e on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 80.557% when pulling d49c2c3 on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 80.464% when pulling a023262 on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 80.55% when pulling a023262 on offtherailz:user_manager into e777e1a on geosolutions-it:master.

@offtherailz offtherailz merged commit 3724048 into geosolutions-it:master Oct 4, 2016
@offtherailz offtherailz deleted the user_manager branch March 21, 2018 08:56
@allyoucanmap allyoucanmap mentioned this pull request Aug 9, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants