aodn / nrmn-application

A web application for collation, validation, and storage of all data obtained during surveys conducted by the NRMN
GNU General Public License v3.0
4 stars 3 forks source link

User management functions #1266

Closed nspool closed 1 year ago

nspool commented 1 year ago

For users with the Admin role this will display a list of users with the following functions:

utas-raymondng commented 1 year ago
  1. These warning appear in the console

WARNING in [eslint] src/components/admin/UserComponent.js Line 27:6: React Hook useEffect has a missing dependency: 'onAdd'. Either include it or remove the dependency array. If 'onAdd' changes too often, find the parent component that defines it and wrap that definition in useCallback react-hooks/exhaustive-deps Line 31:6: React Hook useEffect has a missing dependency: 'onAdd'. Either include it or remove the dependency array. If 'onAdd' changes too often, find the parent component that defines it and wrap that definition in useCallback react-hooks/exhaustive-deps

src/components/admin/UserList.js Line 62:30: 'i' is defined but never used no-unused-vars

  1. Disable Account button seems have no effect
  2. Rest password seems have no effect
nspool commented 1 year ago

@utas-raymondng fixed linter warnings. Also refactored into a reducer.

utas-raymondng commented 1 year ago

@utas-raymondng fixed linter warnings. Also refactored into a reducer.

Looks good now. A minor issue that I accidentally hit the "disable account" of the admin user of current login which ends up not able to do anything until I add the value back in the db. It may be better to show warning if user try to disable the current login user.