Overhaul The User Management Dashboard

Good work. I’ll look later this week.

You can probably reuse the validation from dashboard.

Current state: integrated user update/remove.

Will work on LDAP/Mongo ‘fixes’ (register user to one of this stores if missing). Bug fixes, validations, error handling - next steps, when all features will be done

1 Like

Okay, what do you have planned for the final week? August 15-23? Let’s aim for Monday to be your pencil’s down date.

You mean August, 22?

I plan to finish all features that we talked about, and fix bugs. And continue improve User Dashboard after GSoC. Lets see what I’ll done during this weekend, and than choose plan for last week.

Yup.

Great! One feature that would be nice is if we could create an account for a user. You are more than welcome to stick around and help out.

Good luck!

1 Like

The same as sign up?

Yea – but on second thought – I don’t think it’s even needed!

Okay @dmytro.trifonov,

  1. Get rid of all trailing whitespace. I hate seeing it. It’s everywhere in your code.
  2. you are not checking if I actually have the privileges to access the user management dashboard – this is bad.
  3. you’re doing absolutely zero error checking in your API – the middleware is kicking in and forcing me to login – you don’t need to login via the API – you need to ensure that I have the privileges in the first placet you and redirect me. We have middleare which can do this for us. You should tell me if the api calls fail. You can bank on if the HTTP response code is 302 – that an I don’t have access and return accordingly.

The middleware needs to be in your index.js file:

Add the following require at the top somewhere

const mid = require('../../express-middleware');

Then your route should become:

  app.get('/user-dashboard', mid.restrictTo('dashboard-administrators'), (req, res) => {
    res.sendFile(path.join(__dirname, './app/index.html'));
  });
  1. I should be able to reorder the columns if I so choose and resize too… The groups column if I choose to display it is a bit too much, one user can’t take up the whole screen. This is not acceptable – let’s not display the groups here at all.

  1. I don’t wanna have to click a checkbox to edit a user, let me click their username or email and I still only see the primary email – I should be able to see ALL emails and edit in addition to their primary email, ALL their emails. The email list needs to be sortable.

  2. I should be able to search by any emails they have in their list. More often than not people don’t give me their OpenMRS ID so I search by email – so it needs to support email, and OpenMRS ID ( if I search by email then the search should return if that email is in their email list). This shows promise but it’s pretty far from done.

  3. The headings are still not the way I want them, I brought this up before, it can wait for now – it’s not a HUGE problem as the others I mentioned.

Thanks for your tips!

Remove column ‘groups’ from possible columns to display?

Unfortunately, table component doesn’t support resizing columns http://react-toolbox.com/#/components/table

The same for this feaure - I didn’t fing the way to put links, or something else inside table cell

Yeah.

:slight_frown:

:slight_frown:

Please fix the other issues though! I can live with the UX of a checkbox. I should however be able to check multiple users and delete them in one fell swoop. I should be able to search gmail.com and find all users with gmail addresses. I’ve noticed spammers use certain email services, so this is a need I have. Bulk actions are a necessity here!

Yes, sure! I am working on it

1 Like

You are still not stripping trailing whitespace @dmytro.trifonov

Can you advise me, how to setup webstorm (if you use it) to auto-remove trailing whitespaces? I used this, but as you see, it didn’t help

https://makandracards.com/makandra/11541-how-to-not-leave-trailing-whitespace-using-your-editor-or-git

Also, – you don’t need to manually save to LDAP manually. We have a hook to handle it. See my comment.

yes, I know, that User model configured to save user in ldap on ‘pre’ save stage.

But I thought to call ldap.addUser manually to fix missing ldap account (if user stored in Mongo, but not in LDAP) You propose just to re-save user in Mongo? (and on ‘pre’ save stage user will be saved to ldap) I believe, we must set ‘inLDAP’ to false before that

That will work… call it something different other than register :slight_smile:

This is best name that I invented :slight_smile:

Maybe ‘saveToLDAP’ will be more clear

I mean we could have less code if we just used the mongoose hook…

Okay, I will re-implement it in the way that you proposed.

If it doesn’t work, we can always go back :slight_smile: