Commit Graph

26235 Commits

Author SHA1 Message Date
Steve Howell
56f872507c refactor: Inline message_list.prepend. 2018-05-15 14:25:21 -07:00
Steve Howell
6834745feb refactor: Inline message_list.add_and_rerender. 2018-05-15 14:25:21 -07:00
Steve Howell
08fd2027a1 Refine offset logic for narrows.
We now only preserve the offset for the previous
selection (pre-narrow) if that is still the id
we want selected after calling maybe_add_local_messages.

Right not this does not change any behavior, but
upcoming changes to maybe_add_local_messages will
change the selected id to the first unread message
in certain circumstances, in which case preserving
the offset will possibly be confusing, since you're
not on the same message.
2018-05-15 14:25:21 -07:00
Steve Howell
0dea143fcf Use unread data in topic_data.get_recent_names().
Fixes #9347.
2018-05-15 14:25:21 -07:00
Steve Howell
9b4a4d09ea Add unread.get_missing_topics().
We will need this for cases where the topic names in
unread.js are a superset of the names we got from messages.

It's important to pass in a dict of existing dicts to avoid
expensive max() calls to get the max ids of topics (otherwise
the plan would have been to merge the lists in the caller).
2018-05-15 14:25:21 -07:00
Tim Abbott
31ce382e71 coverage: Disable coverage checking for exceptions.py.
We also take the opportunity to slightly improve the errors if
AbstractEnum ever gets used.
2018-05-15 13:57:40 -07:00
Tim Abbott
badfec2b49 coverage: Don't include settings files in test coverage. 2018-05-15 13:55:01 -07:00
Tim Abbott
191e6dc13a create_user: Remove user_profile_id option.
This hasn't been used in years, had no test coverage, and doesn't have
a clear use case.
2018-05-15 13:51:56 -07:00
=
e731aeda44 zerver: Remove dead code from do_change_password. 2018-05-15 13:39:53 -07:00
=
9d07faaf0c zerver: Remove dead code from do_create_realm. 2018-05-15 13:39:53 -07:00
=
344d6544da zerver: Remove dead code for accessing subscribers.
These haven't been used in years, and clutter the codebase.
2018-05-15 13:39:39 -07:00
Yashashvi Dave
8909836815 zerver/tests/test_custom_profile_data.py: Refactor tests.
Refactor custom fields creation and deletion tests to assert
if created/deleted field exist or not, instead of asserting
total count of all realm fields.
2018-05-15 12:38:18 -07:00
Yashashvi Dave
d66d2445b4 custom fields: Don't ask org admin to enter "value" for choice.
When org admin add choice type of custom profile fields, set
numeric ID for choices instead of asking "value" from org admin.
2018-05-15 12:08:29 -07:00
Yashashvi Dave
ece6b68e4c custom fields: Remove minor bugs in custom profile org settings.
Remove minor bugs like reset create-field form, on submit.
Set initial true values in edit-field form.
2018-05-15 12:08:29 -07:00
Yashashvi Dave
ffe986886f custom fields: Fix field value not saved on change, just after created.
Whenever custom fields templates get rendered within user account
settings, on-change event listener wasn't get created. Cause
event listener wasn't set properly.
2018-05-15 12:08:29 -07:00
Shubham Padia
3703013b4f models: Add is_announcement_only to Stream.to_dict(). 2018-05-15 12:05:52 -07:00
Baron Chandler
f59adfa67c actions: Change do_change_is_admin Exception to an Assertion Error.
- do_change_is_admin now raises AssertionError when a non-admin
  permission is given.
- adds test to test_users to ensure admin asserts on invalid
  permission values.
2018-05-15 11:27:01 -07:00
Baron Chandler
4bdc8332fa zerver: Require permissions be acceptable to do_change_is_admin. 2018-05-15 11:25:47 -07:00
Alena Volkova
ba9668470c emoji: Don't start typeahead for colon-space.
Fixes #9339.
2018-05-15 11:18:08 -07:00
Yago González
35577a1f66 api docs: Rename Swagger directory to OpenAPI. 2018-05-15 11:05:03 -07:00
Yago González
f9f8d9c578 bugdown: Parse argument JSON files as streams. 2018-05-15 11:05:03 -07:00
RobbieClarken
f81b936727 zerver/tests: Require 100% test coverage of zerver/lib/upload.py.
The last line here is impossible to test.

Fixes #4489.
2018-05-15 10:52:20 -07:00
RobbieClarken
17d6d4fed1 zerver/tests: Add test for get_emoji_url for local upload backend. 2018-05-15 10:50:39 -07:00
RobbieClarken
fb42b58316 zerver/tests: Test emoji upload for local storage backend. 2018-05-15 10:50:39 -07:00
RobbieClarken
2dc13d6b50 zerver/tests: Test ensure_medium_avatar_url when the file exists. 2018-05-15 10:50:39 -07:00
RobbieClarken
398141268f zerver/tests: Test get_emoji_url for S3. 2018-05-15 10:50:39 -07:00
RobbieClarken
dd19ed3972 zerver/tests: Test upload emoji to S3. 2018-05-15 10:50:39 -07:00
RobbieClarken
ff95c67197 zerver/tests: Test upload realm icon for S3. 2018-05-15 10:50:39 -07:00
RobbieClarken
25e91b289d zerver/tests: Test delete message image from S3 when file is missing. 2018-05-15 10:50:39 -07:00
RobbieClarken
b3a6c0a253 zerver/tests: Test currently_used_upload_space function. 2018-05-15 10:50:38 -07:00
RobbieClarken
efc63d4ca0 zerver/tests: Test S3 file upload with undefined content type. 2018-05-15 10:42:10 -07:00
RobbieClarken
b9fff04f39 zerver/tests: Add test for resize_emoji for images that need resizing. 2018-05-15 10:42:10 -07:00
RobbieClarken
69a5ce102f zerver/tests: Remove unecessary re-open on files in tests.
The get_test_image_file helper function returns a file handle so we can
call the read method on this directly.
2018-05-15 10:42:10 -07:00
RobbieClarken
f34d9dc910 zerver/tests: Test get_realm_for_filename when filename doesn't exist. 2018-05-15 10:42:10 -07:00
Yashashvi Dave
80beb51836 edit bot: Fix error on updating no-owner-bots name.
When org admin tries to change only bots name of no-owner-bot,
It update bots name but returns error, "No such bot owner".
Cause frontend pass `null` value in `bot-owner`.
2018-05-15 10:35:19 -07:00
Yashashvi Dave
0554e68528 static/templates/edit_bot.handlebars: Fix undefined bot_id.
Template was rendering undefined value of `bot_id` instead of
`user_id`.

Fix this by replacing `bot_id` with `user_id` and changing
template data variable to `data-user-id` to avoid
future confusion.
2018-05-15 10:35:19 -07:00
Tim Abbott
8a66b0b9a9 docker: Set has_appserver=0 correctly.
The docker installer configuration incorrectly had has_appserver set
to 0; this meant that (A) the docker-zulip code needed to copy the
block of code in the installer for the `has_appserver` case into the
Dockerfile (unnecessarily), and (B) one couldn't use `install` from a
Git ref (because the static asset compiler didn't end up in the right
place).

It appears that docker-zulip tried to set this flag in their `install`
command line, but the construction inside `install` meant that didn't
work.
2018-05-15 10:13:44 -07:00
Baron Chandler
52d53f4a81 test_subs: Ensure gather_subscriptions_helper excludes deleted streams. 2018-05-15 10:11:32 -07:00
Hendy Irawan
bb5457c2f7 docs: Clarify need to provision from /srv/zulip when troubleshooting.
Text tweaked slightly by tabbott.
2018-05-15 09:43:09 -07:00
Shubham Padia
f0d874d51f hashchange: Handle trailing slashes in narrowing URLs.
Fixes #9305.
Empty operators are not allowed while parsing narrowing URLs.
`parse_narrow` stops parsing further if it encounters an empty string
operator.
2018-05-15 09:34:50 -07:00
Aman Ghebreweldi
83ee8211a8 third: Get sorttable package from npm.
We didn't have any local changes, so there's no need to have it
vendored in the repository.
2018-05-15 09:25:48 -07:00
Yago González
bc403fc4c4 i18n: Tag missing strings for translation. 2018-05-15 09:06:56 -07:00
Yago González
f0fa550001 docs: Rename rest_endpoints with dashes. 2018-05-15 09:06:56 -07:00
Tim Abbott
b656388ee2 check_send_receive_time: Fix mypy Optional issues.
These were not correctly interacting with the Zulip API, and improved
annotations in the API bindings are now actually being type-checked.
2018-05-15 09:06:56 -07:00
Steve Howell
42435db492 Add run_test helper for individual tests.
This run_test helper sets up a convention that allows
us to give really short tracebacks for errors, and
eventually we can have more control over running
individual tests.  (The latter goal has some
complications, since we often intentionally leak
setup in tests.)
2018-05-15 08:24:44 -07:00
Steve Howell
4f0b3fc1b6 test-js-with-node: Exit more cleanly for errors.
We don't need a Python stack trace when the node
piece fails, so just give a non-distracting error
message.
2018-05-15 08:24:44 -07:00
Steve Howell
0289794e5d zjsunit: Give shorter tracebacks for failures. 2018-05-15 08:24:44 -07:00
Eeshan Garg
3a68f998a7 integration-docs-guide: Add a more detailed writing style guide.
Most of the recommendations in this guide were written by Rishi
Gupta (rishig), with a few contributions from Eeshan Garg.
2018-05-15 10:06:08 -04:00
Eeshan Garg
fa28ccb952 integration-docs-guide: Trim text documenting Markdown macros.
We were devoting too much space/text to documenting our Markdown
macro. It is much more concise to just have a description and a
link to an example doc for each major macro.
2018-05-14 20:14:08 -02:30
Tim Abbott
a2ed06314d send_test_email: Throw an error if email not configured.
This should help minimize confusion when folks try to use this before
properly configuring outgoing email.

Thanks to Bruce Eckel for the report.
2018-05-14 12:02:36 -07:00