-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Added stream_post_policy to the streaminfo view #1165
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.
@mounilKshah Good start, with lots of overlap with the other PR.
One thing we can do in these situations is, where appropriate, extract things like functions we use (or will use) in separate earlier commits in one of these PRs. If we're only adjusting existing code with no behavioral change, this is a refactor:
commit. Myself or someone else with merge rights can push a few commits using git cherry-pick
, making multiple PRs which depend on it easier to handle as they can both then be rebased against the new main
branch. Or, of course, you could just make another PR for that and rebase once that is merged.
zulipterminal/ui_tools/views.py
Outdated
if stream.get("stream_post_policy") is None: | ||
if stream.get("is_announcement_only"): | ||
stream_policy = "Only admins can post" | ||
else: | ||
stream_policy = "Any user can post" | ||
else: | ||
stream_policy = stream_posting_policy[stream.get("stream_post_policy")] |
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.
This is what I meant about the start of the other PR code, where there is something simpler.
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 will go through it once again and make the required changes.
4b2aa0a
to
e86548a
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.
@mounilKshah This looks close 👍
At some point I think it'd be good to migrate to modern versions when we get the data itself like we do with some other data, but this version works well for now.
I'm unclear if the final part of #1119 is functional on the server at this point (or will be replaced by a new implementation instead), but I suspect this can be extracted into a separate issue once we know what's happening there.
As a follow-up to this it might be useful to discuss if we want to group/combine the related stream visibility properties to make it clearer.
(we could also add a way to copy a link to the stream for web usage)
Putting it under a separate issue seems to be a good idea to me. As you had mentioned here, we can have a separate section for the user details in the stream. Apart from the user role, we can also add details like average number of messages sent by user in the stream, number of topics the user has posted on (out of total topics in the stream), etc.
This can be a good addition to the stream info! |
3e6d039
to
cd983d2
Compare
cd983d2
to
36eb8af
Compare
@mounilKshah While I think in principal we could improve these tests, I'll be happy to merge my local slightly adjusted version if we can agree on the text for the |
36eb8af
to
80b6b50
Compare
This commit adds a STREAM_POST_POLICY dictionary which maps API ids to descriptions of who can send messages on the respective stream.
Tests modified in test_popups.py Partial fix towards zulip#1119.
80b6b50
to
d108f2d
Compare
@mounilKshah Thanks for this! Merging now after some minor commit text adjustments 🎉 |
What does this PR do?
This PR contains commit which add the
stream_post_policy
to the streaminfo view. Test case for the same have been added undertests/ui_tools/test_popups.py
Partial fix for #1119.
Link to discussion on chat.zulip.org:
#zulip-terminal>Adding elements to stream info
Tested?
Commit flow
stream_post_policy
and the updatedtest_popup_height
functionVisual changes
Before the commt:
After the commit: