-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin features frontend #629
Conversation
Now, without even login, I can see admin buttons on node page. Is this intended implementation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a bug about seeing profile page in this branch, because it works fine on frontend branch. It's not possible to visit profile pages as a guest (without logging). Can you please check it out?
@override | ||
Widget build(BuildContext context) { | ||
final User? user = Provider.of<Auth>(context).user; | ||
if (user == null) { | ||
// guest can see profile pages | ||
// TODO guest can see profile pages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see that it's not a bug but a whole logic change here, need to understand why this is all changed. Could you please briefly summarize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a discussion, we realized that there was a misunderstanding about these comments. Please delete TODO parts.
Thank you for catching this bug. I fixed and re-uploaded the code. |
final String email; | ||
final String name; | ||
final String surname; | ||
final int noWorks; | ||
final String aboutMe; | ||
final bool isBanned; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woah pretty complicated and scary constructor. There are always better ways to pass these kind of informations. Just keep in mind not to do that in the future, but for this class as it is used by just one parent widget, that's OK
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.end, | ||
children: [ | ||
Visibility( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice widget use! Visibility widget made everything clear.
Buttons on node view page are not connected to the backend yet. That's why you can see it unlike profile page. It will be implemented in the next PR. Since some of the implementations are needed by @Zulalm, we need this branch to be merged to the frontend branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
Since some of the features implemented in this branch is needed by others, It will be merged to the frontend.
So far admin feature buttons are implemented.
Visibility of the buttons are adjusted however not connected to the backend.
Only basic user provider is used in profile page to get user type.