Skip to content
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

boxes: Add support for community topic edits. #793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaustubh-nair
Copy link
Member

@kaustubh-nair kaustubh-nair commented Sep 1, 2020

No description provided.

@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label Sep 1, 2020
@kaustubh-nair kaustubh-nair added the PR needs review PR requires feedback to proceed label Sep 2, 2020
@kaustubh-nair
Copy link
Member Author

Fixed tests and added feature level check.

@kaustubh-nair kaustubh-nair requested a review from neiljp September 2, 2020 17:16
Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaustubh-nair Functionally this seems mostly there, though I don't think it will support 2.1 properly?

While we do have a few cases of accessing the initial_data outside the model, I think the data and logic may be easier to follow if we place the check for editing in the model. That would make it easier to test separately from the UI. We have no cases outside the model which access the server_feature_level (except to display it), which emphasizes where we should put this. For example, we could have a method which returns what is editable ('all', 'topic', ''/None), an explanation (or simplified version of one), and possibly a time limit - based on whether a message is editable at the time of calling. We could consider something more complex to support time limits for topics and general editing separately, but we don't have the feature for that right now so let's stick with what's necessary :)

I'd have to check, but moving the code into the model may by default test with at least set the minimum feature level (None), which might cause this code to fail, assuming you don't override setting the property in the test of course - and if not, that may be a good thing to aim for, ideally with a way to customize other feature levels?

key):
varied_message = dict(message_fixture, **to_vary_in_each_message)
size = (20,)
msg_box = MessageBox(varied_message, self.model, message_fixture)
msg_box.model.user_id = 1
msg_box.model.server_feature_level = 11
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start, but I'd prefer to see tests at other feature levels, eg. like the op/operation case I added recently.

A test like that would pick up on server_feature_level being tested against None - which currently means this feature likely fails on Zulip 2.1.

@neiljp neiljp removed the PR needs review PR requires feedback to proceed label Sep 7, 2020
@neiljp neiljp added the PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback label Sep 22, 2020
@neiljp neiljp added this to the Release after next milestone Jan 28, 2021
Base automatically changed from master to main January 30, 2021 20:31
@zulipbot
Copy link
Member

Heads up @kaustubh-nair, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback wanted has conflicts PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback size: L [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants