Commit Graph

25179 Commits

Author SHA1 Message Date
Steve Howell df857fb214 Test maybe_load_newer_messages. 2018-03-28 09:13:46 -07:00
Steve Howell 084ef0bea9 Fetch new messages when you scroll forward in narrows.
Note from tabbott: This is a somewhat surprising feature to be adding
this late in Zulip's development, but the model we've had of what
narrows are easy to access via clicking around has meant that it was
fairly difficult to get into a narrow that didn't include the very
latest messages in that narrow.

Fixes #3465.
2018-03-28 09:12:59 -07:00
Steve Howell 80ed8294a1 Suppress local echo when we are not caught up. 2018-03-28 09:12:25 -07:00
Steve Howell bcdd12773e Ignore new messages when lists are behind.
If individual messages arrive before we get the latest
messages from the server, they can create gaps in rendering,
and would often be offscreen anyway, so we just ignore them.
2018-03-28 09:12:25 -07:00
Steve Howell 4e431516bf Update message_list.all.fetch_status during frontfill. 2018-03-27 18:14:09 -07:00
Steve Howell 60c77ddf6c Update message_list.all in do_backfill(). 2018-03-27 18:14:09 -07:00
Shubham Dhama 419208cabe settings: Refactor to use pluck to extract `setting` attribute.
This is just a small refactor to use `pluck` over manually using `map`.
2018-03-27 18:01:03 -07:00
Shubham Dhama 6427afec43 settings notification: Wrap subsections in seperate divs.
This wraps each subsection in notification settings in a parent div.
This is done just to make the code more readable and clean.
There will be no UI change.
2018-03-27 18:01:03 -07:00
Shubham Dhama 1d88eb5d6a org permissions: Remove redundant status elements. 2018-03-27 18:01:03 -07:00
Rohitt Vashishtha 3c96b04763 emoji: Add translate_emoticons flag in bugdown testcases.
Also switches the default behaviour of the code to not translate the
emoticons. Earlier, the code was testing-aware, and used to translate
when there was no user profile data available(assuming that as a testing
environment).
2018-03-27 17:16:55 -07:00
Rohitt Vashishtha b976447102 markdown: Test the translate_emoticons flag.
The main testing of the translate emoticons code is in the
node_tests/emoji.js file. This code just checks if the setting
to enable/disable the emoticon translation is being honored.
2018-03-27 17:16:55 -07:00
Rohitt Vashishtha 6dda3fe83e emoji: Do selective local echo of emoticon conversions.
Earlier, we used to convert all occurrences of an emoticon on the
frontend. That behavior has been altered to do conversions only
when the emoticon has some terminal symbols around them, and not
any alphabet or number. Also adds tests for emoji conversions for
the above logic.

Fixes #8585.
2018-03-27 17:16:55 -07:00
Shubham Dhama 33b6e19e31 org settings: Remove obsolete property_types's status messages.
Since now we use buttons as a method to show saving status,
we don't need anymore `msg`, `checked_msg` etc.
2018-03-27 16:48:29 -07:00
Shubham Dhama 2f496ffe1f org profile: Use new org setting changes saving framework.
With this we have the same way to save changes done in org profile
subsection, i.e. show "Save" button beside header of subsection,
add "Discard changes" button for org profile subsection and
show "Save" and "Discard" button only when needed.

Also, there is so much code which become obsolete which is removed
in this commit.
2018-03-27 16:48:28 -07:00
Shubham Dhama 034eaf0aa1 org settings: Restructure org-profile-admin template. 2018-03-27 16:45:32 -07:00
Marco Burstein 6279a9ef09 message view: Hide "view source" and "quote" for deleted messages.
Fix #8839.
2018-03-27 16:43:24 -07:00
sinwar 79672fffc6 populate_db: Pre-populate open graph cache to avoid network activity.
This prevents annoying network errors when trying to populate the
database without Internet access.

Cleaned up a bit by tabbott.

Fixes #8289.
2018-03-27 16:42:59 -07:00
Tim Abbott ac7031de3a message_list_view: Add a workaround for Chrome scrolling down bug.
Based on extensive manual testing with print-debugg (the exact
situation here was highly reproducible), in the absence of this line
here or slightly above here, Chrome 64 will consistently trigger an
extra scroll-forward-by-12000-pixels size downward scrolling event
immediately after it finishes rendering the 5th batch of ~100 messages
one gets from hitting the End key in `near:1` narrows.

I don't understand clearly why this change would protect against such
a Chrome bug, but my best guess is that Chrome was doing some sort of
incorrect optimization, and querying the scrollTop was forcing it to
come to a clear conclusion about the scrolling position before
appending more content.

But runs with the scrollTop() line not present in that function show a
scrollTop of around 25K in `append()` just before the call to
`render()`, and 37K at the end; while runs with this scrollTop line
always show 25K both before and after, so it does seem to work.
2018-03-27 13:51:28 -07:00
Tim Abbott 5404edaf03 tests: Verify database queries for realm administrators.
This number is way too high, because of a recent regression.  Adding a
test here lets us prevent similar regressions in the future and
provides an easy way to be sure if we've fixed the issue.
2018-03-27 11:56:13 -07:00
neiljp (Neil Pilgrim) 07971d3a66 linter: Add check that Optional models are tagged with null=True.
Exclude NullBooleanField explicitly.

Amend one line in models.py found from this linter change.
2018-03-27 10:21:25 -07:00
neiljp (Neil Pilgrim) 7d93f5726c linter: Add check that null=True lines are annotated as Optional.
Also add two missing annotations of this type that were missed
until linted.
2018-03-27 10:21:25 -07:00
neiljp (Neil Pilgrim) 9d26c78ece mypy: Annotate last null=true in models.py; modify mypy.ini exclusions. 2018-03-27 10:21:25 -07:00
neiljp (Neil Pilgrim) 1416c9f0c9 mypy: Broaden model variables with null=True to be Optional. 2018-03-27 10:21:25 -07:00
Tim Abbott 43ec04dcff narrow: Fix a buggy condense_and_collapse call.
Previously, when unnarrowing, we were calling this on the wrong
selector (this was missed years ago when we refactored Zulip to use
divs rather than table rows in the main message feed).

Noticed while debugging #5312.
2018-03-27 09:53:45 -07:00
Puneeth Chaganti 97b90c1e87 condense: Re-condense all messages on window resize.
Previously, if you started out with a very small window, loaded the
Zulip webapp, and then resized the window to be larger, you'd get the
condensed "[More]" links on essentially every message.  This failure
mode was most visible with multi-protocol Electron apps like Rambox
that would sloppily start with a tiny window and then resize it when
loading Zulip.

The Rambox experience was essential to our being able to track this
down; once we knew what was happening, the fix was simply to
re-compute the condense state on resize.

Commit message rewritten by tabbott to explain the debugging and
context involved here, since this was one of our longest-lived mystery
bugs.

Fixes #5312.
2018-03-27 09:53:45 -07:00
Tim Abbott 3b29d00c69 setup-apt-repo: Fix use of shasum alias for sha1sum.
This is apparently installed by the perl package; I hadn't even known
it existed.  We of course want to use the sha1sum command from
coreutils.

Fixes #8836.
2018-03-27 09:47:14 -07:00
Shubham Dhama 4cf42ce478 settings: Move remove-default-stream-button handler to settings_streams. 2018-03-26 10:27:09 -07:00
Steve Howell 825f5feba4 stream_create: Finish handler cleanup.
This commit is similar to the prior commit, in that we are
more disciplined about setting up handlers.  We set them up right
as the widgets get rendered, and the handlers only delegate
up to the container div (id="stream_creation").
2018-03-26 06:44:19 -04:00
Steve Howell 954fceeed6 stream_create: Make handlers more modular for users.
We now wire up the handlers that correspond to elements in
the 'new_stream_users' template when we render that template,
rather than at startup time.

We also delegate the events only up to #people_to_add, rather
than all the way up to body/document.
2018-03-26 06:44:19 -04:00
Steve Howell 04e25fe2a2 Extract stream_create.create_handlers_for_users(). 2018-03-26 06:44:19 -04:00
Joshua Pan 0f58f20ad8 tests: Clean up test-js-with-node output on success. 2018-03-26 06:35:58 -04:00
Joshua Pan ed9eb3bdb5 tests: Make test-js-with-node handling smarter.
Added support for passing a filename without `.js` suffix.
This then fixed the issue of no complaints for invalid test
files. Now, throws an error for invalid test files.

Fixes #8579.
2018-03-26 06:35:58 -04:00
Shubham Dhama eb0da20b78 settings: Clean up repeating code in error callbacks.
This cleans repeating code in error callback in settings.
We made a generic function in `ui_report.js` which require two
arguments `xhr` and `btn`; we preferred `btn` over `row` as argument
because a row may have more than one buttons.

Fixes: #8788.
2018-03-25 10:40:40 -07:00
Steve Howell cb54acf120 stream create: Make docs open in another tab.
We really don't want to make the user hit the back button right in
the middle of creating a stream.
2018-03-25 10:21:44 -07:00
Steve Howell f8e0137678 node test: Add message_fetch.js tests.
This tests the initialize() function for now.

It goes deep on this:
    * uses "mostly real" message lists
    * asserts on fetch parameters

It stubs out many modules that aren't really central to
the logic of fetching.  In particular, when messages are
processed, we notify things like the buddy list that messages
have been added.
2018-03-25 10:18:00 -07:00
Steve Howell 3dd1d784cb node tests: Add test_render_windows(). 2018-03-25 10:18:00 -07:00
neiljp (Neil Pilgrim) 9a6e84a1c3 requirements: Upgrade mypy to 0.580. 2018-03-25 10:17:47 -07:00
Umair Khan d1c7a400ee i18n: Ignore var directory.
Previously, makemessages command was also searching var directory for
translatable strings. This commit ignores that directory.

Fixes #8751
2018-03-25 09:08:37 -07:00
neiljp (Neil Pilgrim) 8810245d48 mypy.ini: Expand tests wildcard from strict-optional into files list. 2018-03-25 08:59:08 -07:00
neiljp (Neil Pilgrim) ac09687fa2 mypy: Raise in commands/create_user.py if initial_password returns None. 2018-03-25 08:59:08 -07:00
neiljp (Neil Pilgrim) de76297f31 mypy.ini: Move purge_queue exclusion into re-architecting section. 2018-03-25 08:59:08 -07:00
neiljp (Neil Pilgrim) 3b28d6ab8b mypy: Rewrite sign_is_valid in zthumbor helpers.py for None secret_key. 2018-03-25 08:59:08 -07:00
neiljp (Neil Pilgrim) 8b697b4093 mypy: Annotate stream_data in populate_analytics_db.py handle function. 2018-03-25 08:59:08 -07:00
Eeshan Garg a95e9000fb css: Apply the CSS for `!!! tip` syntax to integrations.
We should be able to use the `!!! tip` syntax within our integration
docs. This commit adds the requisite CSS.
2018-03-25 08:58:08 -07:00
Eeshan Garg ee895fa182 integrations/rss: Recommend integrating RSS via Zapier.
An integration with RSS can be much easier to set up with Zapier.
Since the current RSS integration predates Zapier, we should at
least mention that there is an easier way to set it up via
Zapier!
2018-03-25 08:58:08 -07:00
Shubham Dhama 3e47a9fe22 org settings: Add real-time syncing for property changes. 2018-03-25 08:30:47 -07:00
Shubham Dhama 315058498b org settings: Handle dependent sub settings manually.
This replaces the previous logic of triggering change() event.
(Also, when we trigger the change() event whole path for detecting
changes in a subsection are triggered which isn't good.)
2018-03-25 08:30:04 -07:00
Shubham Dhama 84a5786b2e org settings: Refactor the discard changes function.
This extract the logic of resetting the value of a single property element
at a time so that we can reuse this for real-time-syncing.
2018-03-25 08:30:04 -07:00
Shubham Dhama a779fc6095 org settings: Use disable_sub_setting_onchange for dependent checkbox.
This makes use of `settings_ui.disable_sub_setting_onchange` for
handling dependent `id_realm_disallow_disposable_email_addresses`
checkbox when `id_realm_restricted_to_domain` is changed.
2018-03-25 08:30:04 -07:00
Shubham Dhama f17fa3305b org settings: Fix discard changes for realm_create_stream_permission.
On discarding changes made for `realm_create_stream_permission` always
"by_admin_user_with_custom_time" get selected because
`create_stream_by_admins_only` isn't a valid page_param.
2018-03-25 08:30:04 -07:00