AtlasOfLivingAustralia / specieslist-webapp

Species lists and traits tool
https://lists.ala.org.au
Mozilla Public License 2.0
6 stars 21 forks source link

Replace deprecated functions provided by AuthService plugin #295

Closed qifeng-bai closed 1 month ago

qifeng-bai commented 9 months ago

1, Update userid based on username(email) of lists without userid

http://lists-test.ala.org.au/admin/updateListsWithUserIds

Issue: 1, Collect lists without userid, 2,Collection all registered users by calling authService.getAllUserNameMap() which is deprecated. 3, Iterate the returned lists, and find a userId in the returned users, then update records

Solution: Given that it is an administrative function and there are not many lists without user IDs, it is acceptable to call the AuthService to retrieve user details one by one.

Testing: Since we have to manually modify records in the database, we do not encourage testers to perform testing.

2, Update userid in Editor column.

We are not using 'editor' field in SpeciesList table. We are using 'Editor' table to store editors of a species list now This function can be removed safely.

There is no records which editors field has value. The 'editors' field in SpeciesList can be removed safely.
-- The 'editors' field has been removed. Editor related function performs well

How to test:

Open any species list, add a known user email as editor in admin page. And Open again, if the new added email should be there

qifeng-bai commented 9 months ago

If there are records missing a user ID, you will see:

Screenshot 2023-11-30 at 11 24 11 am