Overhaul The User Management Dashboard

The error isn’t fatal in that it prevents the save operation from happening. Disable the openmrs-contrib-id-sso module – it’s not required for your work, just comment it out.

No, it should not be locked, because we saved it manually. Nothing happens without us intervening. Whatever exists in LDAP should exist in Mongo; I may also want to delete them from LDAP and not migrate them. That’s also something I may want to do. We have probably a few hundred+ accounts like this.

Okay.

But what about default groups? I think, we must add it, before saving to Mongo.

Also, what about features of adding users, and cloning? (I see that there are such feature in the Formage)

Nothing happens automatically. This prevents any issues. You have to look at the groups they’re in in LDAP and just take them, LDAP is the authority here. The only case where we take the default is when we validate a user’s account on their behalf. HOWEVER, as I said, I may delete and not migrate them.

1 Like

@dmytro.trifonov,
I have some comments:

  1. Use the Material Design slider in the User List, see the the red boxes below.

  1. The email list is cool, but what would be really nice is if I didn’t I could reorder them to set the primary email.
  2. It’d be nice if the “Locked volumn” always displayed.
  3. do you have bulk actions implemented? When I select a user, I should also have a button to: 1) Edit the user and 2) Delete the user(s)
  4. Removing a user errors out for me(see stack trace below) ReferenceError: results is not defined at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/app/lib/Api.js:222:21 at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:52:16 at done (/home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:246:17) at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:44:16 at Immediate.<anonymous> (/home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/app/lib/Api.js:206:11) at Immediate._onImmediate (/home/rob/openmrs/openmrs-contrib-id/node_modules/mquery/lib/utils.js:137:16) at tryOnImmediate (timers.js:534:15) at processImmediate [as _immediateCallback] (timers.js:514:5)
  5. Reset Password is a noop for me.
  6. I should be able to delete from LDAP and/or Mongo (this allows me to revert if I make a mistake)
  7. You’re not validating properly and your error checking code is poor, adding an email address in use by another user causes the following error: [2016-08-21 01:37:50.970] [INFO] console - [TypeError: userMongo.save is not a function] TypeError: userMongo.save is not a function at Promise.<anonymous> (/home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/app/lib/Api.js:159:23) at Promise.<anonymous> (/home/rob/openmrs/openmrs-contrib-id/node_modules/mpromise/lib/promise.js:177:8) at emitOne (events.js:90:13) at Promise.emit (events.js:182:7) at Promise.emit (/home/rob/openmrs/openmrs-contrib-id/node_modules/mpromise/lib/promise.js:84:38) at Promise.fulfill (/home/rob/openmrs/openmrs-contrib-id/node_modules/mpromise/lib/promise.js:97:20) at Immediate.cb (/home/rob/openmrs/openmrs-contrib-id/node_modules/mongoose/lib/query.js:1153:30) at Immediate._onImmediate (/home/rob/openmrs/openmrs-contrib-id/node_modules/mquery/lib/utils.js:137:16) at tryOnImmediate (timers.js:534:15) at processImmediate [as _immediateCallback] (timers.js:514:5)
  1. I told you before, that unfortunately, Table component of React Toolbox library can’t be customized :frowning: http://react-toolbox.com/#/components/table We can set only column types (in the model)
  2. What about ‘set as primary’ button near each email?
  3. Okay, I will change that
  4. Yes, we can edit one or multiple users, but for mutiple we can edit only groups (selected groups will be added to ALL selected users)
  5. I believe that I’ve already fixed that
  6. Reset password - still not implemented… Maybe lets hide it for now?
  7. Revert - if user entry left in Mongo or LDAP? As I understand, you need option to remove user only from one storage (Mongo or LDAP) if he registered in both, right?
  8. It requires validations… Not implemented for now.

What about next features, I worked on now:

  1. Move delete, resave mongo, resave ldap from dialog to main screen (when user(s) selected) ?
  2. Option to sort by one or multiple fields

Also, did you saw my PR? I fixed group list for ‘getAllUsers’ from ldap

What features I must be focus on before deadline? Thanks

What do you think about this?

Show “remove” button and LDAP/Mongo switches on user selection

Er – sorry about that – that is really sucky :cry:

That works for me,it should be easy as a field swap.

:+1:

I want to have a button “Delete X users” if >1 user is selected – I will never edit users in bulk

Nope, not that I can see – I did a git pull before I ran this.

Yeah – hide it for now.

Only one – yes. Removal of the user will handle both – If I toggle one, the other should be disabled.

That’s the point. You trigger the email being sent for them for them to reset the email.

If these are workable, in two days – sure BUT first fix the bugs/issues I mentioned above.

I will look.

At this stage, you have 2 days, so all the bugs ironed out in existing features.

I like it. Can we change the text by the sliders? There has to be a way…

What text do you mean?

inLDAP, InMongo – those – let’s make it OpenLDAP, MongoDB

Okay :slight_smile: Regarding other notes: I’ve already done: added ‘locked’ column to the list of default columns, and also added button to set an email from emailList as primaryEmails. Can you make a ‘git pull’ now, and check, if “remove user” option works for you? If not, please send me actual error log, because on my machine everything works fine. Thanks :slight_smile:

if you’ll select multiple users, and click ‘delete’ now - it will delete all of them :slight_smile:

1 Like

@dmytro.trifonov, Removing user does not work:

[2016-08-21 19:28:58.556] [DEBUG] ldap - check validity of username undefined [2016-08-21 19:28:58.564] [DEBUG] ldap - ldap search ended with status: 0 [2016-08-21 19:28:58.565] [DEBUG] ldap - user: undefined not found [2016-08-21 19:28:58.566] [INFO] console - [ReferenceError: results is not defined] ReferenceError: results is not defined at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/app/lib/Api.js:222:21 at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:52:16 at done (/home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:246:17) at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/node_modules/async/lib/async.js:44:16 at /home/rob/openmrs/openmrs-contrib-id/app/user-modules/openmrs-contrib-id-user-management-dashboard/app/lib/Api.js:211:11 at check (/home/rob/openmrs/openmrs-contrib-id/app/ldap.js:400:16) at fn (/home/rob/openmrs/openmrs-contrib-id/node_modules/async/lib/async.js:582:34) at Immediate._onImmediate (/home/rob/openmrs/openmrs-contrib-id/node_modules/async/lib/async.js:498:34) at tryOnImmediate (timers.js:534:15) at processImmediate [as _immediateCallback] (timers.js:514:5)

At a bare minimum – there needs to be error handling – and me to be able to do basic user management :slight_smile: if you can’t reach the API – you need to tell me that. This is completely doable – come on you’re so close!

1 Like

Thanks for your feedback, just fixed that!

Some Final housekeeping:

@dmytro.trifonov,

You have until 17:00 UTC Tomorrow, 23 August to submit both your code sample and your evaluation of me to Google via the Summer of Code site.

Up until then keep working, at this stage, just iron out the bugs. Reset Password would be REALLY nice but not immediately necessary. Don’t worry about documentation, for now. If you get stuck, let me know, but responses and ability to help will be limited. Be forewarned however, I will be traveling for the better part of the day Tomorrow (Tuesday, 23 Aug).

One thing that would be nice is if you made a video walkthrough – even if it’s not useable by the community at large, just showing what you this summer.

It was a great summer and I hope you had fun!

1 Like

Okay, today I will make some improvements, and submit code sample.

yep, this summer was great! I got a lot of knew knowledge about react, webpack, ES6/ES7, and hope, that my work will be useful for community! I have a lot of ideas for the User Dashboard, and will continue my work on it

Keep working until 1630 UTC tomorrow. This gives me the chance to point out bugs as I see them.

1 Like

@dmytro.trifonov, Some final notes:

  1. Nice touch with the colors :heart:
  2. If I unlock a user, it is not reflected immediately in the list
  3. Kill the checkboxes in the data table – just a simple Y or N.
  4. Deleting a user from MongoDB – also deletes them from LDAP. this is actually good. You are not confirming before you delete – this is BAD – esp. considering MongoDB is a destructive op when deleting-- in that the whole account goes bye bye. You’re still not doing very much error checking. If I can’t delete from one of the stores, disable the toggle :wink: MongoDB deletes from BOTH – this is how it’s supposed to be.
  5. The bulk editing features are still not right – I do not want to see “Edit X Users” – I will more frequently mass delete users than edit them in bulk.

That said – you have enough of a prototype - it kinda works with a few bugs. Great work.

1 Like

Thanks, Robert! :slight_smile:

Yep, I know about this… it’s also about other "Boolean’ fields (inLDAP, inMongo). I don’t know the reason for now, but when we set Boolean ‘true’ to ‘false’ - this change doesn’t appear in the grid. But changing ‘false’ to ‘true’ works fine.

Ok, and it may fix previous bug :)[quote=“r0bby, post:306, topic:6292”] 4. Deleting a user from MongoDB – also deletes them from LDAP. [/quote]

Hmm… strange, because I set flag ‘inLDAP’ in the user to ‘false’ before deleting, so it must save ldap entry. Leave it as is? Regarding confirm message - I will add it :slight_smile:

Okay, you propose to remove feature of bulk editing? I made it, because I thought that it will be useful to lock/unlock multiple entries by one action, or set permissions (using groups).

Also, I propose to start some versioning of our project. When I fix all above bugs, I’ll set tag ‘v0.2’ on the repo, (v0.1 was the version with UI prototype :slight_smile: ), and then I will continue make improvements on the road to v1.0. It will be stability improvements (such as good error handling, and, which is very important, validations), and also support of new features (reset password, create/clone users, etc). We may discuss our roadmap later.

1 Like

Weird. Not a deal breaker – If we need to go a different route, we will. This is a first pass.

It will rarely ever happen. Maybe have both Edit/Delete? I like less clicks :slight_smile:

Yes, we can completely do that – whatever you have after 1700 UTC – is v0.1, tag it. I’m going to propose that your work be moved to the OpenMRS Github Org. This isn’t ready to be used in production yet. Let’s make time to iron out a roadmap – I’ll make a new thread soonish.

One other thing – Change the headings:

Username, First Name, Last Name, Primary E-mail, LDAP, Mongo, Locked are the headers I envision. Spaces – it IS possible to have spaces in the headings. Again, great work! A few bugs but things work almost as I envisioned. I will check in a few hours again – but won’t be able to do a review – I will before I do my final eval – and will give feedback there to you. I’m not sure if I’m allowed to say if you’d pass/fail – but I’ve been upfront all summer so you should have an intuition.

As for now, we already have both :slight_smile: Or you mean some other?

Also, did you noticed, that switching Mongo or LDAP switch from ‘true’ to ‘false’ will remove user from selected storage? I forgot to told you about