-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
Add Modlog Filters #2313
Add Modlog Filters #2313
Conversation
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.
Check out the search perform impl, this should look very similar to that.
About general Rust usage, cargo clippy should give you some hints. Also make sure that CI passes. You can look at |
61b4ac5
to
7d1a93e
Compare
@dessalines Okay i'm in a pretty good state now. I have two questions before I convert back to PR: Is there an established way to get just admins+mods from the api? And also, Should mods be able to view modlog names like admins would? I'm currently just getting all users for the 'filter by mod' feature, which isn't entirely correct, but works if you search and select a mod user. Also not sure if mods should be able to view another mods actions that may be in a different community. |
What do you mean "get admins and mods from api"? If you want to check that a given person is a mod/admin, use |
8a202ef
to
369d42a
Compare
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.
Its looking pretty close! I'll take a look at the front end ones now. lmk when you're ready for me to test these.
96da4bb
to
d382ddd
Compare
Okay give this all another look. |
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.
We try to review these as quickly as we can, so I apologize if I'm slow there, but it was 14 days since your last update.
Okay resolved those issues |
crates/api/src/site/mod_log.rs
Outdated
let is_admin = is_admin(local_user_view.as_ref().expect("")).is_ok(); | ||
let local_person_id = match local_user_view { | ||
Some(s) => s.person.id, | ||
None => PersonId(-1), |
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.
Why are you setting these to -1? They should be left as options so you can catch the None case. Also this is a better syntax:
let local_person_id = local_user_view.map(|l| l.person.id);
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.
It is only used to clean up the syntax around calling 'is_mod_or_admin' which requires a PersonId.
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.
Looks good, but I'll have @Nutomic take a look too.
Other than my last comment it looks good to me. Once that is changed we can merge. |
@makotech222 Have you had time to look at these? The merge conflicts will start to pile up the longer this waits here. |
Yep on my things to do list for this weekend |
9d8c213
to
fae3991
Compare
fae3991
to
47a1ad1
Compare
Okay should be good now |
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.
Nutomic should be able to take a look when they get back from vacay.
Thank you for the contribution :) |
Addresses issue: LemmyNet/lemmy-ui#555
In summary, this PR does the following:
Associated PRs:
Site: