Commit Graph

16900 Commits

Author SHA1 Message Date
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
Tim Abbott b92385ea8e attachment: Make path_id field unique.
This will help avoid future bugs similar to that fixed in migration
0072.
2017-04-18 21:27:28 -07:00
Tim Abbott 0f855b84cc attachment: Add migration to fix duplicate attachment objects.
The comment in the migration explains this change in detail.
2017-04-18 21:27:27 -07:00
Aditya Bansal 08e4a67fa5 tests: Fix occasionally breaking tests.
In this commit we fix the occasionally breaking tests for
test_home.HomeTest.test_bad_narrow which were the result of
us patching global settings in test_upload to add some new emails
to CROSS_REALM_BOT_EMAILS and not rolling back.
2017-04-18 19:44:12 -07:00
Abhijeet Kaur 5e55fe992d backend: Add ability to search by group private message thread.
This doesn't yet contain the frontend or documentation for this
feature.

Modified by tabbott to rename the parameter and line-wrap the query
code.
2017-04-18 15:50:27 -07:00
Steve Howell cf4b08f0cf minor: Update dependency tool configuration. 2017-04-18 15:28:08 -07:00
Umair Khan cf3b6c6ca9 profile: Support custom profile data.
Implements backend for #1760.
2017-04-18 15:20:59 -07:00
Umair Khan d0f907f9da Make FindMyTeamForm strings translatable. 2017-04-18 15:13:25 -07:00
Kouhei Sutou 2f09866364 message: Support highlight in link tag.
textsearch based full text search doesn't match text in link tag but
PGroonga based full text search can match text in link tag.

Without this change, highlighting text in link tag generates broken
HTML.
2017-04-18 13:15:48 -07:00
Harshit Bansal 09c521d9e8 build_emoji: Use `ujson.load()` instead of `json.load()`.
Use `ujson.load()` to load `emoji_map.json` and `emoji.json` as
it is faster than `json.load()`.
2017-04-18 13:00:46 -07:00
Harshit Bansal c70cfa2188 build_emoji: Generate CSS files for all the emoji sets.
Modify the `build_emoji` tool to copy spritesheets for all the
emojisets to emoji cache and generate CSS files for them.
2017-04-18 13:00:46 -07:00
Harshit Bansal e52f2b5aba download-emoji-data: Download sprite sheets for the remaining emoji sets.
Modify the `download-emoji-data` tool to download the sprite sheets
for all the currently supported emoji sets(apple, emojione, google
and twitter).
2017-04-18 13:00:46 -07:00
Harshit Bansal 5674e63fc3 Download iamcal's sprite sheets during provisioning and generate CSS files.
Add code to download iamcal's sprite sheets and generate CSS files required
for displaying these sprite sheets using emoji's unicode codepoints rather
than their names.
2017-04-18 13:00:46 -07:00
Harshit Bansal d617fa8d81 emoji: Only include universal emoji in catalog.
Extracted from "Interrelated emoji infrastructure changes." by
tabbott.
2017-04-18 13:00:16 -07:00
Harshit Bansal 660d96038a build_emoji: Add `emoji_catalog` to emoji_code.js
Use `emoji.json` to create a emoji catalog and add it to
`emoji_code.js` file. This catalog contains the unicode
codepoints of all the emojis grouped according to their
category. Emojis are sorted according to the `sort_order`
defined in the iamcal's dataset.
2017-04-18 12:46:52 -07:00
Harshit Bansal 4470a3947b provision: Download emoji-data during provisioning.
Add code to download iamcal's emoji_pretty.json
(emoji-data/emoji.json) during provisioning.
2017-04-18 12:46:52 -07:00
Ayush Jain 518d25a0cf Disable proxy setting for test-backend and test-js-with-casper.
This fixes the fact that our test suites would have trouble connecting
to the other parts of the Zulip service when run with a proxy
configuration (e.g. trying to send requests to localhost through the
proxy!).

Thanks for Vishnu Ks for his work on this.

Fixes #971.
2017-04-18 12:35:44 -07:00
Steve Howell 70b7d4c00b Extract compose_state.js.
This is mostly just moving methods out of compose.js.

The variable `is_composing_message`, which isn't a boolean, has
been renamed to `message_type`, and there are new functions
set_message_type() and get_message_type() that wrap it.

This commit removes some shims related to the global variable
`compose_state`; now, `compose_state` is a typical global
variable with a 1:1 relationship with the module by the same
name.

The new module has 100% line coverage, most of it coming
via the tests on compose_actions.js.  (The methods here are
super simple, so it's a good thing that the tests are somewhat
integrated with a higher layer.)
2017-04-18 12:26:58 -07:00
Tejas Kasetty 7e4155cd42 update_emojis: Handle the case involving deletion of realm emoji. 2017-04-18 12:18:52 -07:00
Tejas Kasetty d227a8e35c compose: Re-render emoji picker when realm_emoji is added/deleted.
* reset the emoji popover in case of an event
regarding update of realm_emoji.
* test-node-with-js: Add dependency - popovers module;
In dispath.js to support popovers object.
2017-04-18 12:18:52 -07:00
Tejas Kasetty b7aa81f122 compose: Render the emoji picker only once.
* Whenever the emoji picker is opened a call is made to render
  the emoji's. This rendering happend everytime the emoji picker
  was opened. Thus, resulting in duplicates of emoji's getting
  appended in the emoji picker over multiple open and close.

* This commit, is a fix to render the emoji's only once when the
  emoji picker is opened for the first time. Further calls just
  toggles the emoji picker showing the already rendered emoji's.
  This enhances the performance of Emoji picker considerably
  because there is no overhead of making a request to get the emoji's
  from the server, each time the emoji picker is opened.

* Other changes -- on closing the emoji picker, the compose box
  remains in focus.

Fixes: #4300.
See Also: #3952.
2017-04-18 12:18:52 -07:00
Joshua Pan 6fe567846c Extract drafts_scroll() function.
Fixes #4334.
2017-04-18 12:14:41 -07:00
Joshua Pan 0377b5aba6 Extract drafts_initialize_focus().
This function takes care of focusing a draft if a draft
is not already focused in draft modal.
2017-04-18 12:14:41 -07:00
Joshua Pan 6fe26b6c04 Extract drafts process enter key to drafts.js.
Extracted draft code from hotkey.process_enter_key to drafts.js.
2017-04-18 12:14:41 -07:00
Aditya Bansal 065dd9ae10 Clean emoji-settings-admin.handlebars to use 4 space indents. 2017-04-18 12:06:31 -07:00
Aditya Bansal 1f09e38101 Clean bot-settings.handlebars to use 4 space indents. 2017-04-18 12:06:30 -07:00
Aditya Bansal c12f93efc4 Clean stream_privacy.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal c98cf5ba63 Clean message_edit_history.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal 23f8ec9759 Clean single_message.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 5f7c89b087 Clean stream_sidebar_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 83da92c316 Clean recipient_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0494944f3f Clean draft.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal face3562af Clean subscription_settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal bdcff375ab Clean deactivated-users-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 4c1b89a2ef Clean attachment-item.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e5d57c31b8 Clean muted-topics-settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 2a15fa17b9 Clean admin_auth_methods_list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal c0ca8b10ed Clean deactivation-stream-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0e906b683d Clean realm-domains-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 257b930492 Clean admin-realm-domains-list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e21731c1ae Clean streams-list-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00