Commit Graph

18052 Commits

Author SHA1 Message Date
Cynthia Lin b81e7ad51f hotkeys: Fix arrow key navigation in Streams modal.
Previously, one could not move past unsubscribed streams in the
Subscribed tab.

Fixes #5066.
2017-05-30 22:51:35 -07:00
Umair Khan 6ee08e0602 casper: Fix waiting condition in message deletion tests.
We now specifically wait for the length to decrease by one. This seems
like a more deterministic condition to wait on.

Previously we were waiting till the id of the deleted message remained
visible; intuitively, this should have worked but it seems that there
is some race condition that was causing the test to fail sporadically.
2017-05-30 22:49:59 -07:00
Pweaver (Paul Weaver) eb1a22a1d2 webpack: Fix webpack-dev-server urls for external resources.
This fixes issues some users found using the remote development environment.
2017-05-30 22:38:25 -07:00
Eeshan Garg fc6125ec2e api/setup.py: Upgrade the version to 0.3.1.
Apparently, PyPI is very strict about package file names. Once you
upload files for 0.3.0, and only wish to make minor changes and
re-release it as the same version, it doesn't let you and complains
about identical file names.
2017-05-30 22:25:14 -07:00
Eeshan Garg ea131936d6 api/setup.py: Upgrade to Beta and update homepage URL. 2017-05-30 22:25:14 -07:00
Eeshan Garg b309c403e0 webhooks/gitlab: Support Merge Request Hook reopen event.
Fixes #4795.
2017-05-30 22:11:37 -07:00
Steve Howell 4ec1260b41 reactions.js: Have an initialize() function. 2017-05-30 21:43:18 -07:00
Steve Howell 6149111b5e Add test_error_handling() for reactions.js. 2017-05-30 21:43:18 -07:00
Steve Howell b0b647c9e5 Add more code to test_add_and_remove_reaction().
This increases our line coverage a bit.
2017-05-30 21:43:18 -07:00
Steve Howell e7345bdd7f Improve error reporting in maybe_activate_stream_item.
This change should lead to clearer tracebacks when our
assumption about the stream list's list items get
violated, and we also short circuit some code in the
caller that tries to scroll to the active stream.
2017-05-30 21:26:55 -07:00
Steve Howell 561fba65d2 Remove spurious call to unread_ops.process_visible().
In stream_list.js we have some code to handle narrow activations,
and we were calling unread_ops.process_visible() only for
stream activations, not for PM-related activations, etc., so
our approach was inconsistent.

It also turns out that the call is redundant, since we call
unread_ops.process_visible() when the message pane scrolls as
part of updating the content.

Ideally, we want a more rigorous approach where we make this
call precisely when the new messages become visible to the user,
but the purpose of this fix is to de-clutter the stream_list
logic.
2017-05-30 21:26:55 -07:00
Eeshan Garg 2e81fdd319 api.html: Recommend pip install for installing API bindings.
We have an updated PyPI package now for our API bindings, so we
now recommend `pip install` rather than providing a download link
to the package.
2017-05-30 21:21:06 -07:00
Steve Howell b559364614 Use zjquery to test pm_list.js.
We now stub templates.render() to see what data gets passed in
to the template, rather than using jQuery to inspect the DOM that
gets created.  This changes the nature of the test to be less about
integration with the templating layer and more about how we pass
data into the template.

To compensate, we add more assertions to the relevant test
in templates.js.
2017-05-30 20:46:30 -07:00
Tim Abbott e321891f17 test-all: Don't run SVG optimizer by default. 2017-05-30 11:19:53 -07:00
Cynthia Lin 0600e1eb30 tools: Add optimize-svg tool for checking for unoptimized SVG files. 2017-05-30 11:15:56 -07:00
Cynthia Lin 76537665b9 integrations: Optimize SVG graphics. 2017-05-30 11:15:56 -07:00
Cynthia Lin 26afd4c162 integrations: Modify styling to emphasize label text. 2017-05-30 11:15:56 -07:00
Umair Khan 71f97b7bcb testing: Invalidate cache before counting queries.
To get accurate count of the queries, we should make sure that
caches don't come into play. If we count queries while caches are
filled, we will get a lower count. Caches are not supposed to be
persistent, so our test can also fail if cache is invalidated
during the course of the unit test.

This commit solves the problem with Stream cache. This cache comes
into play when we use `get_stream` function. If cache is valid,
we will not issue queries to Stream and Recipient table. I think
the problem was one of those rare occasions when the Stream cache
got invalidated during the course of the test, due to which query
count was increased by 2. After this commit, we intentially invalidate
the Stream cache.
2017-05-30 17:28:41 +05:00
K.Kanakhin 2434f2d96c messages: Add support for admins deleting messages.
This makes it possible for Zulip administrators to delete messages.
This is primarily intended for use in deleting early test messages,
but it can solve other problems as well.

Later we'll want to play with the permissions model for this, but for
now, the goal is just to integrate the feature.

Note that it saves the deleted messages for some time using the same
approach as Zulip's message retention policy feature.

Fixes #135.
2017-05-29 21:59:38 -07:00
neiljp 9b13b19006 docs: Add ')' and correct reference to step number in bots guide. 2017-05-29 20:52:23 -07:00
Abhijeet Kaur 4a531ac203 Updates get_help() function in 'virtual_fs' bot.
Update example commands from calling by keyword 'fs'
(As was done previously) to calling by at-mention of
the bot.
Updates '/contrib_bots/bots/virtual_fs/virtual_fs.py' by
correcting instructions on how to call 'virtual_fs' bot.
2017-05-29 20:44:13 -07:00
Abhijeet Kaur 9f17bded92 Fix minor errors in bots-guide. 2017-05-29 20:41:15 -07:00
neiljp 643d70eae1 contrib_bots: Add check_expected_responses() test helper and use it.
This further simplifies the logic for testing a contrib_bots bot to
require very little code per test in the common case.
2017-05-29 20:39:27 -07:00
Krzysztof Krzysztof 695c71d2cc bots: Add weather reporting bot. 2017-05-29 20:33:16 -07:00
Harshit Bansal 7126f6f30c settings: Allow either admin or realm emoji author to delete it.
If a realm is configured to allow any user to upload a realm emoji
then that user should also be allowed to delete the emoji in case
he feels it doesn't look good or if he uploaded a wrong emoji file.
This commit tweaks the realm emoji settings UI to allow an user who
uploaded an emoji to delete it.

Fixes: #4761.
2017-05-29 20:21:26 -07:00
Harshit Bansal 298e23b447 realm_emoji.py: Allow an user to delete an emoji uploaded by them.
If a realm is configured to allow any user to upload an emoji,
then, an emoji author must be allowed to delete an emoji uploaded
by them.
2017-05-29 20:21:25 -07:00
Steve Howell 879abd6290 Add coverage for update_existing_reaction(). 2017-05-29 20:10:53 -07:00
Steve Howell 1ae66cda6f Increase test coverage for insert_new_reaction. 2017-05-29 20:10:53 -07:00
Steve Howell 80920438a5 Add coverage for get_emojis_used_by_user_for_message_id. 2017-05-29 20:10:53 -07:00
Eeshan Garg 99c2e1875d api: Increase the version from 0.2.5 to 0.3.0. 2017-05-29 20:09:59 -07:00
Eeshan Garg debe9fa9dc api: If there is no $HOME, assume .zuliprc doesn't exist. 2017-05-29 20:09:57 -07:00
Steve Howell ecbbc8788a Move code from reactions -> emoji_picker.
This moves all the code dealing with emoji_picker
navigation and click/enter events to emoji_picker.js.

Some of the code still delegates back to reactions.js
in some way.

The navigate() code really does nothing reaction-specific,
nor does filter_emojis(), nor do some of their helpers.

This was mostly moving code, but I also did some
s/reaction// or s/reaction/emoji/ in names.
2017-05-29 17:10:05 -06:00
Steve Howell 3654406f17 Simplify/rename code to choose reaction in emoji picker.
We now call the function toggle_selected_emoji(), and it
is simpler in these ways:

    * We get the selected emoji more directly.
    * We reuse code in toggle_emoji_reaction().
2017-05-29 17:10:05 -06:00
Steve Howell ed2ceb49cb Use toggle_emoji_reaction for "+" hotkey.
This is a more direct codepath when we know which emoji
we want to toggle.
2017-05-29 17:10:05 -06:00
Steve Howell 1ee757a237 Use toggle_emoji_reaction() in the emoji picker.
If we know the name of the emoji you need to toggle,
we can toggle_emoji_reaction(), which is less complex
than toggle_reaction().
2017-05-29 17:10:04 -06:00
Steve Howell 805c99ae27 Add hide_emoji_popover() to toggle_emoji_reaction().
This change sets us up to de-duplicate some code.  It
changes behavior for the edge case situation where
you had the reaction menu open but then decide to
click on one of the existing reactions.  This change
closes the emoji popover, which is probably the
correct behavior.
2017-05-29 17:10:04 -06:00
Steve Howell 63d0711c4b Rename message_reaction_on_click() to toggle_emoji_reaction().
This prepares us to de-duplicate some code.
2017-05-29 17:10:04 -06:00
vaibhav 9cf9837f12 webhooks: Add outgoing webhook bot user to development database. 2017-05-29 16:01:23 -07:00
Tim Abbott 4acc89d379 help: Document the : hotkey for choosing reactions. 2017-05-29 15:43:55 -07:00
Tim Abbott 7b152bf0ad help: Clarify discussion of the emoji reactions picker.
The word "menu" was kinda confusing here.

Follow-up to #4547.
2017-05-29 15:43:44 -07:00
Daniel Lau 3037be9bc0 help: Document how to navigate the emoji reactions picker.
Fixes #4547.
2017-05-29 15:43:07 -07:00
Tim Abbott 4040cadf7d coverage: Omit some test runner files from coverage.
These files are part of the test runner and can't realisitically have
test coverage due to being imported before coverage in the setup
sequence.
2017-05-29 15:30:49 -07:00
Tim Abbott 4893779001 test_events: Avoid coverage errors in LogEventsTest. 2017-05-29 15:26:33 -07:00
Maxim Averin a4c3f571db Switch change_tos_version to use RealmAuditLog. 2017-05-29 15:24:01 -07:00
Maxim Averin 685fb16c39 Switch change_full_name to use RealmAuditLog.
This requires adding an `acting_user` parameter to the
`do_change_bot_owner` function.
2017-05-29 15:22:08 -07:00
Tim Abbott ce26f0e086 integrations: Remove legacy basecamp integration.
Now that we have the webhook integration, there's no reason to
maintain the pre-webhook version.
2017-05-29 15:10:59 -07:00
Steve Howell 49e3ee36c4 Add tests for reactions.remove_reaction(). 2017-05-29 14:59:52 -07:00
Steve Howell affff8ac82 Extract reactions.set_reaction_count. 2017-05-29 14:59:52 -07:00
Steve Howell 1747223c35 reactions: Refactor remove_reaction().
* Add whitespace/comments.
    * Use find_reaction() helper.
    * Handle full-removal earlier in block.
    * Sequence operations in a more organized way.
2017-05-29 14:59:52 -07:00
Steve Howell 5c405f7048 reactions: Refactor add_reaction().
This commit splits out some helper methods to make it easier
to test:

    get_reaction_section
    find_reaction
    get_add_reaction_button
    update_existing_reaction
    insert_new_reaction
2017-05-29 14:59:52 -07:00