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

Make default_streams web controllable #817

Conversation

hackerkid
Copy link
Member

@hackerkid hackerkid commented May 22, 2016

Fixes: #665

@smarx
Copy link

smarx commented May 22, 2016

Automated message from Dropbox CLA bot

@hackerkid, it looks like you've already signed the Dropbox CLA. Thanks!

@hackerkid
Copy link
Member Author

hackerkid commented May 26, 2016

@timabbott Please review

@timabbott
Copy link
Sponsor Member

Playing around with creating a new stream and then trying to add it as a default stream in Chrome, one gets an ugly overlap of the browser's native autocomplete with the default streams autocomplete. We should probably just disable browser autocomplete in this text box.

streams = do_get_streams(user_profile, include_public=include_public,
include_subscribed=include_subscribed,
include_all_active=include_all_active,
include_default=include_default)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

whitespace looks wrong here

@timabbott
Copy link
Sponsor Member

Otherwise the UI looks pretty good; thanks for building this @hackerkid!

Can you add some Casper frontend tests for the admin UI for this feature?

@hackerkid
Copy link
Member Author

@timabbott Yeah. Sure. Working on it.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 3 times, most recently from 37939c1 to cbe10bd Compare May 29, 2016 00:05
@hackerkid
Copy link
Member Author

@timabbott Added the tests. Please review.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 2 times, most recently from fb9c1b7 to 88163b8 Compare May 29, 2016 14:02
@hackerkid
Copy link
Member Author

@timabbott Fixed the merge conflicts.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 3 times, most recently from a35a92a to 636a8ce Compare May 30, 2016 23:29
@timabbott
Copy link
Sponsor Member

timabbott commented May 31, 2016

@hackerkid can your rebase to resolve the merge conflicts? Looks like just a small conflict with something else I merged yesterday.

Also, I notice that this adds a ton of tab-based whitespace, which we don't allow in the Zulip codebase (and triggers linter errors); you'll want to fix those (and configure your editor to not introduce them!). (Oh, looks like you fixed those in later commits -- can you squash the fixes into the commits that introduced the bugs? In this case I think you can probably just squash everything into a single commit).

I'll take a look at the code as well, so you can fix all the issues in one batch.

casper.click('#settings-dropdown');
casper.click('a[href^="#administration"]');
var stream_name = "Scotland";
get_suggestions("O");
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Why do you pass "0" here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@timabbott It matches with all the stream names which has the 'O' as a substring (Rome, Scotland, Verona etc). I used 'O' to make sure that it works even if there are multiple suggestions.Capital 'O' is used instead of small 'o' to make sure that the suggestions are not case sensitive. I can change into Scotland if you want.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Ahh, OK, got it-- I misread it as a zero. Can you just add a comment with that explanation of the reasoning on the line above this?

@timabbott
Copy link
Sponsor Member

@hackerkid thanks for working on this, it's looking really good; I posted a bunch of comments on little optimizations to make this match the Zulip Python style, cleaner and more performant, but I'm excited about the progress on this!

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch from f127206 to 887298c Compare June 3, 2016 23:55
@hackerkid
Copy link
Member Author

@timabbott Made the changes as you suggested. Please check.

@timabbott
Copy link
Sponsor Member

Cool, this is looking pretty good! I played around with this and found one more bug:

  • If you type in a stream name that doesn't exist and hit enter, the admin page reloads (leaving the "default streams) tab

@timabbott
Copy link
Sponsor Member

Also, the first of the two commits should include the hunk that deletes make_dict.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 2 times, most recently from 37e1d6f to a64de6d Compare June 6, 2016 14:53
@hackerkid
Copy link
Member Author

hackerkid commented Jun 6, 2016

@timabbott Fixed both the issues. Please check.

@timabbott
Copy link
Sponsor Member

@hackerkid this looks great! I merged the first commit, and I think there's just one thing this still needs:

  • Since this adds a new event type, you should add a new test to EventsRegisterTest; often that will end up finding bugs in how once implemented the apply_events code for a feature

Once that's done (and issues are resolved), we can merge this! I'm super excited about this feature.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 4 times, most recently from b7a15ea to d5344c0 Compare June 7, 2016 20:42
@hackerkid
Copy link
Member Author

@timabbott I have added a test for default_streams event in EventsRegisterTest. Please check.

@timabbott
Copy link
Sponsor Member

timabbott commented Jun 7, 2016

Test looks great! But I noticed a few more improvements we can make to the templates:

  • Several of the strings in the template (e.g. "Stream name") aren't marked for translation
  • Also, while you're tweaking the templates, I think we should style the "Add default stream" control more like the "Add realm emoji" box in the first tab of http://127.0.0.1:9991/#administration
  • We should add some description for what this is where the text "Add default streams" is currently (also tagged for translation), e.g. "Configure the default streams new users are subscribed to when joining the {{domain}} organization." I just merged a similar description for the "realm emoji" feature if you're looking to borrow code.

image

(Sorry I didn't catch these in the last round of review!)

@timabbott
Copy link
Sponsor Member

Also, a small note, you should add Fixes: #665 to your commit message (usually we do it as its own sentence at the end) so that merging this auto-closes the original issue.,

@hackerkid
Copy link
Member Author

@timabbott Sure. Will do that.

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch 4 times, most recently from d8e742c to b85bc65 Compare June 9, 2016 20:43
@hackerkid
Copy link
Member Author

@timabbott Fixed the issues. Please check.

@timabbott
Copy link
Sponsor Member

Can you rebase on top of master so the Travis CI tests will rerun post-rebase?

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch from b85bc65 to 8345eca Compare June 9, 2016 21:23
@hackerkid
Copy link
Member Author

@timabbott Done 👍

@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch from 8345eca to d9b373e Compare June 9, 2016 21:26
@hackerkid hackerkid force-pushed the make-default-streams-web-configurable branch from d9b373e to 28b2682 Compare June 9, 2016 21:52
@timabbott
Copy link
Sponsor Member

Awesome, thanks @hackerkid, I've merged this. I'm very excited -- this feature is a key part of the Zulip 2016 roadmap :)

@timabbott timabbott closed this Jun 9, 2016
@hackerkid
Copy link
Member Author

@timabbott I am also excited to see this getting merged. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants