Commit Graph

17080 Commits

Author SHA1 Message Date
Cory Lynch f9d1bff167 Fix textarea resize for editing messages.
Reusing code from the main compose_message component so that resizing now
behaves correctly. This means that when the user tries to resize vertically,
the autoresize code is disabled, and the textbox reverts to manual resizing.
Fixes #4573
2017-04-28 12:15:34 -07:00
Neeraj Wahi 90a154e451 Add mobile auth redirect to custom URI scheme (zulip://).
This makes it possible for the Zulip mobile apps to use the normal web
authentication/Oauth flows, so that they can support GitHub, Google,
and other authentication methods we support on the backend, without
needing to write significant custom mobile-app-side code for each
authentication backend.

This PR only provides support for Google auth; a bit more refactoring
would be needed to support this for the GitHub/Social backends.

Modified by tabbott to use the mobile_auth_otp library to protect the
API key.
2017-04-28 11:47:35 -07:00
Tim Abbott 0566b8dd73 auth: Fix prams typo in Google auth code path. 2017-04-28 11:47:35 -07:00
Tim Abbott 83fe8d4420 auth: Simplify code for Google CSRF state.
This will make it much easier to avoid adding new things that aren't
actually included in the CSRF hash of the other parameters.
2017-04-28 11:47:35 -07:00
Tim Abbott 54b899860d auth: Add GitHub to list of reported backends. 2017-04-28 11:47:35 -07:00
Tim Abbott 45b2b25026 mobile: Add mobile one-time-pad library.
We'll need to implement a version of the simple decoding/decryption
logic used by this library in the mobile code as well, but that should
be simple enough.
2017-04-28 11:47:35 -07:00
Tim Abbott 1b8c3398e7 models: Extract API_KEY_LENGTH constant. 2017-04-28 11:47:35 -07:00
Tim Abbott ce33368905 GoogleOAuthTest: Include the /accounts/login/google/ step in tests.
This makes our Google auth tests a bit more faithful, in that they now
follow the full Oauth flow, rather than skipping the first step.
2017-04-28 11:47:35 -07:00
Tim Abbott 8b78f22660 GoogleOAuthTest: Refactor parameter encoding. 2017-04-28 11:47:35 -07:00
Eeshan Garg 8ad3a8bc9a integration-guide: Replace references to old-style fixture directories.
The integration guide has now been updated to reflect the recent
decision to store webhook fixtures in
zerver/webhooks/<webhook_name>/fixtures/ as opposed to
zerver/fixtures/<webhook_name>/.
2017-04-28 11:07:03 -07:00
Eeshan Garg b3ffffd3b7 webhook-walkthrough: Replace references to old-style fixture directories.
The webhook walkthrough has now been updated to reflect the recent
decision to store webhook fixtures in
zerver/webhooks/<webhook_name>/fixtures/ as opposed to
zerver/fixtures/<webhook_name>/.
2017-04-28 11:07:03 -07:00
Eeshan Garg aa12002be7 webhooks: Move all fixtures to zerver/webhooks/<webhook_name>/fixtures.
All webhook fixtures in zerver/fixtures/<webhook_name> have now
been moved to dedicated webhook-specific directories under
zerver/webhooks/<webhook_name>/fixtures, where <webhook_name> is
the name of the webhook.
2017-04-28 11:07:03 -07:00
Brock Whittaker dcc2b3a900 left-sidebar: Restructure <a> to cover the <li>.
This restructures the <a> tag to be clickable essentially anywhere
within the <li> tags, unlike before where due to it being “inline”, you
had to hover over the text in particular.
2017-04-28 09:56:15 -07:00
Brock Whittaker e7ac6710e9 Resize <li> text and align icons.
This resizes the text of the line items to be 5% larger and aligns
the #global_filters icons to be centered vertically.
2017-04-28 09:56:15 -07:00
Steve Howell 0ced7cfc55 Make newly subscribed streams appear active.
When you subscribe to a stream, we now set a newly_subscribed
flag on the object, and we return true during the is_active()
call.

This solves the problem that immediately after you subscribe, you
don't have any messages in the stream, so it would appear active
by our old criteria.

This is still something of a workaround, as once you reload, the
stream will become inactive again, unless other messages come in.

A more permanent solution here would be to have the backend
indicate newly subscribed streams to us (apart from the initial
event), but we may not really need that in practice.
2017-04-28 07:40:25 -07:00
Steve Howell f9b3ff8f68 Change argument type for stream_data.is_active().
The function now takes a "sub" object instead of a stream
name.
2017-04-28 07:39:52 -07:00
Steve Howell 62d530196b Fix test_sort_streams().
It turns out the check to make sure that "social" filtered to
the bottom could give a false positive, since it was already
alphabetically at the end of the list.

So, I call the stream "cars" now instead, so that it only comes
after "Denmark" if the is_active flag gets respected.

I also check for the divider tags now.
2017-04-28 06:39:17 -07:00
K.Kanakhin e2cf6102fb test_tornado.py: Add websocket closing to tornado tests.
- Extend tornado tests with closing WebSocket connection
to avoid leakings warnings.
- Mark test_tornado as having 100% coverage.

Fixes #3942.
2017-04-27 12:05:56 -07:00
Umair Khan d011bd736d api_auth: Change email to identifier.
We can have an email or a server uuid as an argument so identifier
looks like a more appropriate name
2017-04-27 11:30:53 -07:00
Tim Abbott 331207a02b create_realm: Fix heading for creating an organization. 2017-04-27 11:12:09 -07:00
Tim Abbott 3fa6bdf49c login: On single-realm servers, assume the only open realm.
This makes it possible to display the nice new login/registration
banner on single-realm servers, which is the common case.
2017-04-26 18:04:05 -07:00
Brock Whittaker 7afbc9ddd6 Redesign login and registration pages.
This completes a major redesign of the Zulip login and registration
pages, making them look much more slick and modern.

Major features include:
* Display of the realm name, description and icon on the login page
  and registration pages in the subdomains case.
* Much slicker looking buttons and input fields.
* A new overall style for the exterior of these portico pages.
2017-04-26 18:04:05 -07:00
Brock Whittaker 6e512dddcb left-sidebar: Make <li> height and icon size consistent.
This makes the height of the list-items all 24px and changes
the home icon to be a slightly larger 16px instead of 14px which
looked visually smaller than the other icons.
2017-04-26 17:13:03 -07:00
Diego Berrocal e0a45640d2 Documentation: Improve new feature tutorial.
Resolves a few comments from #4598.
2017-04-26 16:19:51 -07:00
Tim Abbott 2708062181 events: Add support for fetch_event_types option to events_register.
This new feature makes it possible to request a different set of
initial data from the event_types an API client is subscribing to.

Primarily useful for mobile apps, where bandwidth constraints might
mean one wants to subscribe to events for a broader set of data than
is initially fetched, and plan to fetch the current state in future
requests.
2017-04-26 16:02:40 -07:00
Eeshan Garg ffdd5d3588 webhooks: Don't display "Commits by" when committer is the only author.
For our Git integrations, we now only display the number of commits
pushed when the pusher also happens to be the only author of the
commits being pushed.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
Eeshan Garg b7ca533315 webhooks: Add a space between author and number of commits for Git messages.
For Git push messages, we now have a single space character between
the name of a commit's author and the number of commits by that
author, plus a period at the end.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
Eeshan Garg af69faafc9 webhooks: Use author's name to format Git push messages.
We now use the name of the author of a commit as opposed to the
committer to format Git messages with multiple committers.

Part of #3968.
Follow-up to #4006.
2017-04-26 18:26:09 -02:30
K.Kanakhin 18f2a7428f Fix missing aggregated info in real-time sync race for presence.
- Add aggregated info to real-time updated presence status.
- Update `presence events` test case with adding aggregated
  information to presence event.
- Add test case for updating presence status for user which
  send state from multiple clients.

Fixes #4282.
2017-04-26 13:20:22 -07:00
Cory Lynch 088d881159 compose: Improve ordering in streams typeahead.
The new logic has 4 tiers of priority:
* Whether a match is found in the name, start of description, middle
of description, etc.
* Importance to the user / activity -- more specifically, the order
used in the left sidebar. This means pinned streams first, active
streams, then inactive streams.
* Subscriber count: How big is the stream?  Bigger is better.
* Alphabetical ordering is a final tiebreak.

Fixes #4508.
2017-04-26 12:46:14 -07:00
Brock Whittaker 2fce6a4dc3 message-feed: Fix message drag uncaught errors.
There is a mechanism to prevent a user from "clicking" on a message
if they drag over it, to allow people to copy message contents without
triggering the compose box to open.

In the case that a user would start dragging from outside a message
and finish dragging within a message, data on where the cursor started
at is missing.

This is fixed by checking if start data exists and if it doesn't, we
just throw a drag distance of Infinity which will tell the program to
not count the action as a "click" on the message. This now does not
have an uncaught error because it instead validates "start" as existing
before attempting to access its properties.
2017-04-26 12:31:14 -07:00
Tim Abbott 5d7aa4fae7 hashchange: Fix buggy narrowing to wrong message.
Due to a past refactoring, the from_reload argument to do_hashchange
changed from having true/undefined as the possible values to
true/false instead.  The check that sets the from_reload and
first_unread_from_server narrow options was thus incorreclty treating
from_reload of false the same as a from_reload of undefined.

As a result, if the browser had been loaded with a
page_params.initial_narrow_pointer (aka via the background reload code
path), then for the duration of that browser session, every time one
narrowed via a hashchange rather than an explicit click handler (which
apparently includes clicking on a PM thread in the left sidebar), we'd
end up narrowing with a then_select_id of the that initial narrow
pointer, not the correct first unread message.

The fix is simply changing the check for truthiness, not undefined, in
do_hashchange.
2017-04-26 12:07:56 -07:00
Umair Khan f4a9651346 reload: Garbage collect previously preserved state.
This fixes a minor local storage data leak.

Fixes: #4545.
2017-04-26 09:14:46 -07:00
Umair Khan 58a82e7c55 localstorage: Allow regex based delete. 2017-04-26 09:11:44 -07:00
Umair Khan ce5980aa45 testing: Don't destroy template DB in parallel mode. 2017-04-26 13:59:42 +05:00
Aditya Bansal e961d6a834 Clean account-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 6f49579e65 Clean actions_popover_content.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal acef0b1f32 Clean bot_avatar_row.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal ae2585ac8d Clean admin_user_list.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal af880b8bab Clean ui-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 73cd6948de Clean realm-filter-settings-admin.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal d5bb128f56 Clean notification-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 338c2d618a Clean display-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal a2d0976002 Clean deactivation-user-modal.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 4219bec14f Clean auth-methods-settings-admin.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Tim Abbott c4716aefc7 mypy: Move `type: ignore` check to the line with the error.
Fixes https://travis-ci.org/zulip/zulip/jobs/225841310

I'm pretty sure the fact that I need to do this is a mypy bug.
2017-04-25 23:44:41 -07:00
Tim Abbott cb6373210b logging_handlers: Fix tracebacks being emailed in subject lines.
Some exceptions happening in queue processors were being incorrectly
emailed out in the subject line, rather than the body, of the error
report.
2017-04-25 18:55:11 -07:00
Rishi Gupta f595f4f7f2 analytics: Change Number of Users chart to use realm_active_humans::day.
Previously we showed the total number of users with an active account. This
changes it to show only the number of users that have logged in in the past
two weeks.
2017-04-25 18:35:13 -07:00
Tim Abbott b43385ec34 Shrink max display width of topics.
This fixes an issue with topic names overlapping in the left sidebar.
While we're doing that, it makes sense to shrink the maximum size of
the topic input box, to discourage sending with topics that will be
cut off.
2017-04-25 17:51:47 -07:00
Brock Whittaker 3d64d190c1 Change right sidebar unread counts to be rounded.
This changes the right sidebar unread count styling to match the left
sidebar styling — in that they all now should have a 4px border radius
on the edges of the unread count blocks.
2017-04-25 17:47:36 -07:00