Commit Graph

11932 Commits

Author SHA1 Message Date
Steve Howell 78bbefbf94 export: Create import_attachments. 2016-08-10 14:16:17 -07:00
Steve Howell 01d28458fc Add frontend_tests/node_tests/dispatch.js.
This tests the dispatching code in server_events.js.
2016-08-09 18:49:13 -07:00
Steve Howell 48af751e8d Clean up server_events.js (minor stuff).
Make exceptions more clear and upstream patching of builtins to index.js.
2016-08-09 18:49:13 -07:00
Steve Howell ccb1d54e55 Export server_events._get_events_success for testing. 2016-08-09 18:49:13 -07:00
ukhan dced137f6f Fix function formatting in admin.js 2016-08-09 17:52:25 -07:00
Rag Sagar 2fef36f15a Add realm-level default language setting.
Adds a new field default language in the zerver_realm model.
This realm level default language will be used as default language
for newly created users. Realm level default language can be
changed from the administration page.

Fixes #1372.
2016-08-09 17:38:29 -07:00
Steve Howell 7ec6a394fe export: Filter Attachment objects by realm. 2016-08-09 16:47:14 -07:00
Steve Howell cecfaa7761 export: Extract import_message_data(). 2016-08-09 16:47:14 -07:00
Steve Howell 5386ed280e export: Extract update_id_map().
We also use a vanilla dictionary instead of a defaultdict, so
that we explicitly initialize what tables are being re-mapped.
2016-08-09 16:47:14 -07:00
Steve Howell 217ef8a4d2 export: Split fix_foreign_keys() into two functions.
We now have convert_to_id_fields for the simple case, and
re_map_foreign_keys for the more complex case. I also
renamed some parameters and variables.
2016-08-09 16:47:14 -07:00
Tomasz Kolek 4a25b92298 Cleanup result message code in test-js-with-node.
Remove duplicate code after quick fix in passing returned code.

Fixes: #1489.
2016-08-09 16:46:24 -07:00
Umair Khan e1090118c5 Percent translated should be an integer. 2016-08-09 16:19:07 -07:00
Rag Sagar 5771e2eb25 Move i18n functions from zerver/views/__init__.py to zerver/lib/i18n.py 2016-08-09 16:10:24 -07:00
Rag Sagar 28f0079432 Use a constant to set UserProfile default_language field max_length attribute. 2016-08-09 16:10:24 -07:00
Steve Howell dd88ffccfd export: Extract make_raw() in lib/export.py. 2016-08-09 15:58:27 -07:00
Steve Howell 09fa343bdd export: Use DATE_FIELDS in floatify_datetime_fields.
This avoids a little bit of code duplication, plus it should
make it a little easier to add new date fields in the future.
2016-08-09 15:58:27 -07:00
Steve Howell c14ab3c91f export: Add annotations to zerver/lib/export.py.
I also fixed some small things like removing unnecessary return
statements, and adding a TODO.

In some cases I explicitly cast stuff at run-time to set() or
str() to appease mypy, as well as make it clear to somebody
reading the code that the callee might not respect ordering
or tolerate unicode.
2016-08-09 15:58:27 -07:00
Steve Howell f18cc4ae3a export: Added export_avatars_local_helper(). 2016-08-09 15:58:27 -07:00
Tim Abbott 9441154316 debug: Fix actual traceback being hidden in blueslip.
When in debug mode, previously an explicit `blueslip.error()` call
would not display the original stack trace of the error, making
debugging difficult.

This isn't perfect, in that it seems to display some tracebacks
multiple times, but at least the trace is available.
2016-08-09 11:59:49 -07:00
Tim Abbott 469df75ab7 Fix admin.update_default_streams_table errors if tab not open.
It turns out that our logic for updating the default streams table
crashed in the case where the administration tab was not open.

Fixes: #1540.
2016-08-09 11:59:32 -07:00
Tim Abbott bb392374b2 travis: unset GEMPATH.
Travis CI support suggested this as the correct solution for some
recent changes in their environment that make ruby segfault.
2016-08-09 11:59:01 -07:00
Umair Khan 86920a297c Mock out loggers in push notification tests.
Fixes: #1575
2016-08-09 22:16:09 +05:00
Umair Khan 7a84f12a38 Verify mock calls without strict order.
In push notification tests, call assert_has_calls with `any_order=True`
so that the order of the calls does not matter.
2016-08-09 22:15:37 +05:00
Tim Abbott 42b63f5caa test_templates: Fix failure to report a user-facing error. 2016-08-09 09:54:44 -07:00
Tim Abbott f3365f4089 test_templates: Add integrations_dict to context.
This fixes the fact that this test was (silently) failing.
2016-08-09 09:54:36 -07:00
Umair Khan 25f70ebdaa Annotate zproject/jinja2/backends.py 2016-08-09 09:19:24 -07:00
Umair Khan 60f30fdb36 Annotate zproject/backends.py. 2016-08-09 09:19:24 -07:00
Umair Khan fe812a89bf mypy: Type of remote_username should be text_type. 2016-08-09 09:19:24 -07:00
Brock Whittaker e34b9be950 Append color picker to #subscriptions_table instead of document.body.
Adding the container attribute to the color picker options parameter
modifies the behavior of the spectrum function to allow the color
picker to be attached to the #subscriptions_table element rather than
the default document.body element.

This allows for the color picker to scroll with the subscriptions page,
fixing the bug where the color picker would not scroll up/down the page.

Fixes #1293.
2016-08-09 09:07:55 -07:00
Brock Whittaker eda1cdd0c5 third: Add option for which container to append the color picker to.
This allows you to select the container that the color picker should
append to and therefore be absolutely positioned in accordance with.

This still defaults to document body, which was the previously default
container to append the color picker to.
2016-08-09 09:07:15 -07:00
Brock Whittaker 77aa43fffb Prevent the color-picker from appearing above the navbar.
The color picker original z-index was set to (2^31)-1 which overrode
everything on the site. This behavior is unwanted as the color picker
should not override the z-index of the navbar.

In changing the z-index to 100 the navbar remains above the color
picker.
2016-08-09 09:07:15 -07:00
Umair Khan 8c249f859e Push Notification: Add tests for GCM. 2016-08-09 16:13:02 +05:00
Steve Howell a904222947 Add tools/find-add-class to tools/lint-all.
The find-add-class tool, when in lint mode, verifies that we can
understand all calls to addClass from our JS code.

When in non-lint mode, i.e. verbose mode, the tool prints out a
list of tuples of (fn, class) that we can use as we wish in other
tools.
2016-08-08 15:32:48 -07:00
Steve Howell 15f46a142e Remove obsolete #navbar-spacer style. 2016-08-08 15:24:45 -07:00
Steve Howell 98abe5bb3b Remove obsolete #left-of-compose style. 2016-08-08 15:24:45 -07:00
Steve Howell 95b19f9765 Add test_validate_django(). 2016-08-08 15:20:29 -07:00
Steve Howell d29e745142 Add test_validate_handlebars(). 2016-08-08 15:20:29 -07:00
Steve Howell 70bc932913 Add test_html_tag_tree(). 2016-08-08 15:20:29 -07:00
Steve Howell 65147e7368 Add tests for template_parser.tokenize. 2016-08-08 15:20:29 -07:00
Steve Howell 184e45b774 Fix bug with tools/html-grep.
We were ignoring singleton tags like "input" tags in
html-grep.  This was an artifact of our tokenizer originally
being built to check indentation of templates, for which
singleton tags had been a distraction. This fix actually cleans up
the template checking logic as well, since it can now rely
on the tokenizer to classify special tags and singleton tags.
The tokenizer is more complete and more specific.
2016-08-08 15:20:29 -07:00
Umair Khan acd76eb604 Annotate push_notifications.py. 2016-08-08 15:17:02 -07:00
Umair Khan 9c13e9a072 Annotate test_push_notifications. 2016-08-08 15:17:02 -07:00
Umair Khan 35dd1ffb13 Pass password as string to authenticate. 2016-08-08 15:17:01 -07:00
Umair Khan 266c791e64 Email should be a unicode. 2016-08-08 15:17:01 -07:00
Umair Khan 503ad774f5 Tokens should be unicode. 2016-08-08 15:17:01 -07:00
Umair Khan 4bc4c39528 Add *args and **kwargs to functions.
Arguments are added to:
    - SocialAuthMixin.get_email_address
    - SocialAuthMixin.get_full_name
2016-08-08 15:15:29 -07:00
Umair Khan 0dd7d0dda1 push_notifications: Change name to 'identifier'. 2016-08-08 15:15:29 -07:00
Umair Khan fdbd132ba4 Annotate zerver/context_processors.py. 2016-08-08 15:15:29 -07:00
Umair Khan 00eab4e526 Annotate zerver/views/__init__.py. 2016-08-08 15:15:29 -07:00
Umair Khan 25dd1aeb5c Annotate zerver/lib/actions.py. 2016-08-08 15:13:29 -07:00