Commit Graph

16940 Commits

Author SHA1 Message Date
Yago González 43bc4cd762 formatting help: Remove unnecessary space. 2017-04-21 14:59:57 -07:00
Yago González fac8d1a91d formatting help: Add documentation for TeX math. 2017-04-21 14:59:57 -07:00
Joshua Pan 64984f5bf4 Rename tools/lint-all to tools/lint.
Fixes #4574.
2017-04-21 14:57:47 -07:00
Tim Abbott f4a4c23380 KaTeX: Fix path to KaTeX bundle in production. 2017-04-21 14:56:19 -07:00
Tim Abbott 1883bff243 lint: Rename lint-commits to keep tab-complete fast. 2017-04-21 13:45:20 -07:00
Tommy Ip ec8e47192a lint: Add checks for commit messages using gitlint.
Fixes #1131.
2017-04-21 13:45:12 -07:00
Tim Abbott 7d8d9c1bf9 Fix message-edit animations being displayed after sending.
This fixes a regression in 3041480600
that would cause anything rendered on the backend differently than on
the frontend to experience this animation.

We actually only want to do the animation when the message content was
changed in a way that generates an edit history event, i.e. a
user-facing edit, not in cases where we're either transparently
swapping in post-backend-rendering content (e.g. with link previews)
or cases where there's a discrepancy between the exact HTML from the
frontend and backend markdown processes (e.g. mentions).
2017-04-21 11:46:35 -07:00
Tim Abbott e7974b3b65 git: Fix nondeterministic ordering of commit authors.
This should fix the nondeterministic test failures introduced by
e7455e276b.
2017-04-21 11:45:30 -07:00
Siddharth Mahapatra e7455e276b git integrations: Expand details in commit push notifications.
We now show a few new things:
(1) The number of commits pushed.
(2) Who authored the commits (just counts, not which specific ones, for brevity).

Add tests for case of multiple committers.

Part of #3968.
2017-04-21 11:07:44 -07:00
Joshua Pan 11878313fb docs: Tweak reset-to-pull-request warning.
Tweaked this warning because we currently check if there are any
uncommited changes before we reset to a specific pull request.

Changes expanded a bit by tabbott.
2017-04-21 10:12:04 -07:00
Steve Howell cc6c0104c8 Refine compose box behavior for topic narrows.
The comments that were added in the code for this commit explain
the cases here, but essentially for topics, we need to decide
among a few possible behaviors with regard to composing:

- Leave it closed.
- Cancel the compose.
- Leave the compose box as it was before.
- Fill in the new topic.

Before this commit, we were cancelling compose in all cases (or
leaving it closed).

Now we leave it alone in some cases where there is already content.
And we fill in the topic when the stream was correct and the topic
was empty.

Fixes #3300
2017-04-20 16:15:07 -07:00
Tim Abbott 21c4be3f00 chat-zulip-org: Document learning stream. 2017-04-20 16:04:42 -07:00
Tim Abbott b3c8562bd9 css: Remove use of under-specified 'thin' borders.
This was causing buggy behavior in our emoji reactions when zoomed to
200%.
2017-04-20 15:07:26 -07:00
Tim Abbott f3c36147d9 /me: Fix alignment of name with non-/me messages. 2017-04-20 14:58:22 -07:00
Brock Whittaker 83d51b2bdb Hide status message on edit.
When editing a /me, the status message element should be hidden.
2017-04-20 14:36:17 -07:00
Brock Whittaker 323ff6edca /me: Fix presentation and markup for /me statuses.
This fixes the /me elements to be display inline-block and inline
rather than display block with top and left properties.

This also fixes an unrelated issue with emoji reactions not being
able to be clicked on with /me messages.

Fixes: #4218.
2017-04-20 14:36:17 -07:00
Tim Abbott 1cfebdcb84 forms: Fix minor pep-8 lint error. 2017-04-20 11:39:19 -07:00
Umair Khan dbbc73837d redirect_to_main_site: Handle is_signup parameter.
Passes on the is_signup parameter passed in a querystring.
2017-04-20 11:14:28 -07:00
Umair Khan 8b88cfc84b redirect_and_log_into_subdomain: Handle is_signup. 2017-04-20 11:11:54 -07:00
Umair Khan 4ab783134e testing: Move unsign_subdomain_cookie to test_helpers.
We'll be using it in other files soon.
2017-04-20 11:10:56 -07:00
Umair Khan 8fee31f7ff forms.py: Include email in the error messages. 2017-04-20 11:07:01 -07:00
Umair Khan 1d9113d326 forms.py: Use .format() for string formatting. 2017-04-20 10:28:05 -07:00
Joshua Pan 728594c74a activity.js: Stop opening compose box in user search.
This prevents compose box from opening when you
just press enter with an empty search field in
user search.

Fixes #4376.
2017-04-19 22:18:08 -07:00
Brock Whittaker 3041480600 message-edit: Fade in message on update.
When a message update comes back from the server and replaces an
old message, it should fade in. There are two components to the fade:

1. The message fades in from opacity: 0 =>  1.
2. The "edited" text will transform from X: -10 => X: 0.
2017-04-19 22:14:58 -07:00
Sarah 81f76ff13b Realm.py: Removing 'exclude' variable.
The exclude variable was superfluous. The realm properties
listed in the exclude variable are not in the
realm.property_types dict, so they do not need to
be explicitly excluded.
2017-04-19 22:08:36 -07:00
Sarah 95ff65b290 zerver/lib/events: Refactor fetch_initial_state_data.
This Refactors the function fetch_initial_state_data to use the
realm.property_types attribute, avoiding some unnecessary code
duplication.

Tweaked slightly by tabbott to simplify the code a bit.

Addresses part of issue #3854.
2017-04-19 22:08:03 -07:00
Feorlen 6ff78ca0e8 Set umask 022 before starting prod upgrade.
Follow-on from #2373/ PR https://github.com/zulip/zulip/pull/4316, to set an
appropriate umask also when upgrading so files have appropriate permissions.

I've tested this by starting from a clean install, deleting /srv/* so new
files are downloaded, and then doing an upgrade. It worked starting with both
a current version from master and an older release installed with a less
restrictive umask and then the umask changed.

Fixes #2373.
2017-04-19 10:28:06 -07:00
Steve Howell c7a9a02667 Consolidate code for narrow/compose interactions.
This commit extracts the method compose_actions.on_narrow()
to handle changing the compose box (as appropriate) after
any narrowing action.

This change should be mostly non-user-facing, but it's not
exactly a trivial extraction.

For the case where the user already had content in their
compose box, we continue to leave the compose box alone,
but we now update compose fading 150+ lines later in
narrow.activate().

Likewise, for cases where we cancel composing, this will
also happen later in the function.

Finally, for PM narrows, where we auto-open the compose box, we
no longer call compose.cancel() before calling compose.start(),
because either a) the compose box would have not been open
in the first place or b) the start() function can handle
clearing the old fields.
2017-04-19 10:06:00 -07:00
Tim Abbott 55bea73035 Revert "github: Call the appropriate authenticate."
This reverts commit ab260731a9.

The overridden authenticate method was buggy.
2017-04-19 10:06:00 -07:00
Tim Abbott 326cf9a73e stream_list: Add divider before dormant streams in list.
Fixes #4309.
2017-04-19 09:18:29 -07:00
Steve Howell 7962710132 Remove 40-streams criterion for flagging dormant streams.
Before this change, we would move "dormant" streams to the bottom
of your stream sidebar, but only if you had 40+ streams.

Now we do this in all cases to be more consistent.

This commit also changes the redraw strategy when we remove rows.
Before this change, we were doing incremental updates, but now we
call build_stream_list to do a complete rebuild.  This was partly
motivated by adding the new divider, which would have complicated
the incrememental approach when you removed the last remaining
dormant stream.
2017-04-19 09:18:18 -07:00
Steve Howell 9591b3a95b Extract stream_sort.js. 2017-04-19 09:16:37 -07:00
Joshua Pan 4fb450d4a9 hotkey.js: Add reactions popover navigation.
Fixes #4197.
2017-04-18 23:25:45 -07:00
Joshua Pan a7327422a8 reaction.js: Create reaction_navigate(). 2017-04-19 06:17:15 +00:00
Joshua Pan abda711c66 reaction.js: Extract reaction_show_list functions.
This creates get_emoji_at_index() and
find_index_for_emoji() functions, which search for
emojis and indices in reactions_show_list. Update
maybe_select_emoji with newly created functions.
2017-04-19 06:17:15 +00:00
Joshua Pan e075c84ca5 reaction.js: Maintain reaction_show_list.
This updates reaction_show_list whenever the popover
gets opened and whenever the search filter for reactions
gets used.
2017-04-19 06:17:15 +00:00
Joshua Pan cd28ea6d07 reaction.js: Update toggle_reaction().
Created get_selected_emoji() function.
toggle_reaction() now doesn't require emoji_name
and automatically looks for a selected_emoji
if possible.
2017-04-19 06:16:30 +00:00
Tim Abbott cddee49e75 Add support infrastructure for push notification bouncer service.
This is an incomplete cleaned-up continuation of Lisa Neigut's push
notification bouncer work.  It supports registration and
deregistration of individual push tokens with a central push
notification bouncer server.

It still is missing a few things before we can complete this effort:
* A registration form for server admins to configure their server for
  this service, with tests.
* Code (and tests) for actually bouncing the notifications.
2017-04-18 23:03:06 -07:00
Tim Abbott ae788b2e98 zilencer: Remove decorators Deployment code. 2017-04-18 23:00:10 -07:00
Tim Abbott cd89fbc0a9 models: Extract AbstractPushDeviceToken. 2017-04-18 23:00:10 -07:00
Tim Abbott 55a9101573 settings: Add support for ZULIP_ORG secrets.
These can be used to authenticate the current Zulip server to
zulip.org.
2017-04-18 23:00:10 -07:00
Tim Abbott 540bfce83f reactions: Use perfectScrollbar for emoji reactions scrollbar.
This fixed the fact that the scrollbar for this popover was super ugly
on Linux, while also ensuring that we have a consistent 6 emoji per
row in the popover (an important detail for the arrow hotkeys).
2017-04-18 22:58:11 -07:00
Joshua Pan c6d0e49cdf Add tabindex to reaction popover content handlebars. 2017-04-18 22:31:08 -07:00
Umair Khan 8f5dfffe39 testing: Fix test_update_invalid_value.
This test was using hardcoded field id which made it order dependent.
2017-04-18 21:46:14 -07:00
Jacob Hurwitz 8343d80873 Fix mobile home view returning messages older than the pointer.
In cases where old unread messages in the home view might have been
leaked (either due to bugs or unusual muting interactions), it's
theoretically possible for the first unread message in the home view
to be far older than the pointer.

Since the Zulip mobile app is loading messages following the
use_first_unread logic, we need to plug this gap.

Probably a longer-term solution will involve changing how
update_message_flags works to automatically advance the pointer, but
this change should make it possible for the mobile apps to
consistently use the `use_first_unread` mechanism for fetching the
latest home view messages.

With tweaks to the tests by tabbott.

Fixes zulip/zulip-mobile#422.
2017-04-18 21:39:24 -07:00
Tim Abbott 6d9962851c renumber_migrations: Strip trailing '.py' from migrations.
This fixes a bug when renumbering more than 1 migration at a time.
2017-04-18 21:31:17 -07:00
Tim Abbott c6cd7074ee renumber-migrations: Mark as executable. 2017-04-18 21:27:29 -07:00
Tim Abbott a543b3cacd attachment: Clarify and test logic for invalid uploads. 2017-04-18 21:27:29 -07:00
Tim Abbott e90748348b attachment: Remove unused claim_attachment return value. 2017-04-18 21:27:29 -07:00
Tim Abbott 568b59291b attachment: Improve rules for managing attachment ownership.
The previous logic was that anyone with a link to a file could send it
to other users, but only the owner could make a file realm-public.
This had some confusing corner cases.

The new logic is much simpler:
* Only the file's owner/uploader can include a file in a message for
  the first time.
* Anyone with access to read a file can share it with others by
  including it in messages they send.
* Once a file has been sent to a public stream, any user in the realm
  can access it.
2017-04-18 21:27:29 -07:00