Open harrykeeran12 opened 4 months ago
@nann7 Would you be able to get this done? Basically you'd just need to add 2 buttons, which replace the content of the admin dashboard site with two tables, one with a list of all the symptoms, and the other with a list of all the users(you can use the table listed in the link above)
Ok, no problem!
Is it to create a new management page that only administrators can use? Or add it to our original application page.
Is it to create a new management page that only administrators can use? Or add it to our original application page.
So this would be for the admin dashboard that we already have, which would have like a button which the admin could press, and then it shows a list of users, that the administrator could see and use. @nann7 If you have any questions please ask!
I've mocked up a basic design on Figma(don't worry about the sidenav bar I'll fix that in a bit), please make sure you're up to date with the main branch before you create a new branch @nann7
OK I see that. I would like to ask if the user list contains the user's name, account number and other information?
@nann7 It should contain everything that the selectAllUsers api returns(aka everything apart from the password), so if you use the useSWR hook, which returns the JSON output, you would get all the data. Currently the register function is not working though, so you might have to manually add data to your postgres database.
Also I'll create a branch for you called adminDashboard.
I've created the adminDashboard branch and added the table component. If you have any other questions please ask!
Ok, thank you!
Why is there this error saying that it does not match the TypeScript format?
Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & RefAttributes
You have to use the table like its a component import, and probably do it in the admin folder. If you use components/ui/table in the import, the table is in there(provided you've done an npm ci recently and that your branch is up to date)
@nann7 could I ask you to also:
There are methods to add and delete a user, I'll make one to upgrade a user to be an admin.
[ ] Also please use tanstack-table
the version of react table you're using is old.
[x] The CSS should be designed by you using Tailwind not Bootstrap as it is a heavy library.
Ask if you have any questions.
Sorry, I would like to ask if it is possible to still use react table without tanstack-table. There is so much to change, and I make a lot of mistakes when I try it.
Sorry, I would like to ask if it is possible to still use react table without tanstack-table. There is so much to change, and I make a lot of mistakes when I try it.
It would be better if we used the best version of the table. I'm sorry but we do still have time for you to attempt this. I would recommend watching videos.
I tried changing the code, but after finding errors, I tried to rewrite it. It is found that the useTable hook function of @tanstack/react-table cannot be used. I imported it correctly and reinstalled the dependencies. Don't know what's wrong.
@nann7 If you push it I can take a look at it?
I tried changing the code, but after finding errors, I tried to rewrite it. It is found that the useTable hook function of @tanstack/react-table cannot be used. I imported it correctly and reinstalled the dependencies. Don't know what's wrong.
https://tanstack.com/table/latest/docs/framework/react/react-table
This link has your answer.
我尝试更改代码,但在发现错误后,我尝试重写它。发现无法使用 @tanstack/react-table 的 useTable 钩子函数。我正确导入了它并重新安装了依赖项。不知道怎么了。
https://tanstack.com/table/latest/docs/framework/react/react-table
这个链接有你的答案。
I just watched this page and changed my code
I submitted it to github. I didn't change it based on my original one because I was worried that my changes would make a mess. So I created a new usertable1.jsx. The inside is newly modified by me. I'm very sorry, I tried all afternoon without success. Can you help take a look?