-
Notifications
You must be signed in to change notification settings - Fork 338
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 moderator view button #1993
Conversation
Should moderator view be it's own parameter instead of one of the listing types? I can see |
You're right it would probably make more sense if moderator view was just another listing type (in appearance for the user). Listing type "all" would be applicable at all times but it will make for some ugly code in the listing type selector and home page. Besides, someone might actually want to differentiate between moderator view for local and all communities and unsubscribe from communities they consider themselves not to be very involved in moderating. A compromise might be automatically seeing the listing type to all when moderator view of selected but I'm not sure that wouldn't cause frustrations for some users. Let me know which solution you prefer. Another problem I just noticed now: the moderator view button should probably be hidden when only viewing comments, right? |
Not necessarily. Comments are content that will need moderation just as much as posts will. As to the rest of your response, I'd like to get some more input on this one. |
Its up to you whether its a part of the listing_type button group, or separate. Its technically possible to be a mod of non-local communities, so maybe separate is better, but either way works for me.
Unfortunately we didn't add |
I can certainly add moderator view support for comments to the Lemmy backend. I should be able to open a PR sometime next week but don't count on it for this one here. Since the moderation view currently is implemented as an additional parameter in the get posts method, I'd say it should be exposed to the user as such with its own toggle switch as I implemented it right now. |
I think it should be a listing type because if I click that button, I would want it to be all the communities I moderate regardless of local vs all vs subscribed. It's ultimately a way to filter the feed, not a different type of option. Comments should be a possible view with moderation actions possible of course.
I actually think that the API should be using the same param as the other listing types.. making it its own thing just complicates the API needlessly as the response is the same as any other view. IMO the API in general is not a good indication of how the UI should be made and it is often too inflexible - often giving too much information or too little - to actually experiment with the UI. |
As the consesus seems to be that moderator view should just be a listing type, I will open a PR for the lemmy backend and js client to implement those changes. Keeping this PR as draft until then. |
LemmyNet/lemmy-js-client@973b255 has added some more backend api changes that have built up over some time. The tests won't run clean before those issues are fixed (happens in yarn lint, mostly type problems). Things that would need to be changed:
|
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.
Just that one comment below, then the linting errors, and we can get this merged. Thx!
Run yarn lint
to check these.
@dessalines I have now fixed 3 of the linting errors I knew how to approach. There are 2 more I need some guidance on fixing though, both of them stemming from LemmyNet/lemmy@6047257: src/shared/components/comment/comment-node.tsx:1494:7 - error TS2345: Argument of type '{ person_id: number; added: boolean; auth: string; }' is not assignable to parameter of type 'AddAdmin'. AND: src/shared/components/post/post-listing.tsx:1690:7 - error TS2345: Argument of type '{ person_id: number; added: boolean; auth: string; }' is not assignable to parameter of type 'AddAdmin'. Both of those are buttons to add another admin to the instance. The new api needs a Local user id to do this. |
Apologies, that's an issue with our back-end I'll try to fix and get out an update for lemmy-js-client soon. |
@biosfood Okay new lemmy-js-client is deployed that should be good: |
Thx! |
Description
Fixes #1294.
This PR will add a moderator view button to the home page and uses the newly added moderator view parameter from LemmyNet/lemmy#3176 to give moderators easy access to all the communities they moderate.
The moderator view button should only be visible for logged in users that moderate at least one community.