Commit Graph

32468 Commits

Author SHA1 Message Date
Hariom Verma 107da5402c url preview: Replace YouTube URLs with their titles.
Modified by punchagan to:
* Replace URLs with titles only if the inline url embed previews are turned on
* Add a test for youtube titles replacing URLs

The titles for the videos are fetched asynchronously after the message has been
sent via the code that fetches metadata for open graph previews. So, the URLs
are replaced with titles only if the inline embed url previews feature is
enabled.

Ideally, YouTube previews should be shown only if inline url previews are
enabled, but this feature is in beta, while YouTube previews are pretty stable.
Once this feature is out of beta, YouTube previews should be shown only if the
url previews feature is turned on.

YouTube preview image is calculated as soon as the message is sent, while the
title needs to be fetched using a network request. This means that the URL is
replaced only after the data has been fetched from the request, and happens a
couple of seconds after the message has been rendered.

Closes #7549
2019-07-12 19:14:19 -07:00
Puneeth Chaganti 865bc24f67 url preview: Avoid showing previews for URLs in blockquotes.
Messages with links embedded in blockquotes turn out to be replies to
messages with links, more often than not. Showing previews for links in
replies seems like clutter, and it seems reasonable to turn off previews for
such links.
2019-07-12 19:14:00 -07:00
Puneeth Chaganti ad98f536bf bugdown: Fix incorrect type annotation for ElementPair. 2019-07-12 19:14:00 -07:00
Tim Abbott 86f762bc75 docs: Document TEST_WORKER_DIR. 2019-07-12 17:52:08 -07:00
Wyatt Hoodes 0e3fddbc6e test_fixtures: Add logic for removing stale test directories.
Similarly to how stale database removal is handled, we add a check for
stale test run directories at the end of the `test-backend` script.
2019-07-12 17:42:18 -07:00
Wyatt Hoodes f7f32df3ef docs: Update directory structure. 2019-07-12 17:42:18 -07:00
Wyatt Hoodes 16abd3d1e7 test-backend: Remove long-term clean up code.
With the refactored file structure approach, the clean up block at the
end of `test-backend` is no longer necessary.
2019-07-12 17:42:18 -07:00
Wyatt Hoodes 62566f02d7 tests: Use TEST_WORKER_DIR for file access. 2019-07-12 17:42:18 -07:00
Wyatt Hoodes 5f20caa6e0 test_upload: Refactor test_upload output to new filepath.
We write a function to set the `LOCAL_UPLOADS_DIR` path depending
on whether tests are being run in parallel or serial mode.
2019-07-12 17:35:44 -07:00
Wyatt Hoodes ff156c1f8a test_runner: Create file structure for test-backend filepath rework.
We create a path structure in the from:
 `/var/<uuid>/test-backend/run_1234567/worker_N/`

A settings attribute, `TEST_WORKER_DIR`, was created as a worker's
directory for a given `test-backend` run's file storage.  The
appropirate path is created in `setup_test_environment`, while each
workers subdirectory is created within `init_worker`.

This allows a test class to write to `settings.TEST_WORKER_DIR`,
populating the appropirate directory of a given worker.  Also
providing the long-term approach to clean up filesystem access
in the backend unit tests.
2019-07-12 17:27:18 -07:00
Cynthia Lin e5d0448505 user settings: Improve accessibility for new delete profile picture button. 2019-07-12 16:53:25 -07:00
Cynthia Lin ffaa0ee120 styles: Refactor #user-settings-avatar elements to use SCSS nesting feature. 2019-07-12 16:53:25 -07:00
Cynthia Lin 886deaf48d styles: Remove superflous .white-color class.
Class was only used in one location, rendering it unnecessary.
2019-07-12 16:53:25 -07:00
Cynthia Lin faa556ab5e user settings: Change delete profile picture button into a x icon.
Fixes part of #10255.
2019-07-12 16:53:25 -07:00
Cynthia Lin c4f510b724 styles: Refactor #user_presences li selectors to use SCSS nesting. 2019-07-12 16:34:06 -07:00
Cynthia Lin 2694dd7e24 styles: Reorder #user_presences li selectors for SCSS nesting. 2019-07-12 16:25:40 -07:00
Cynthia Lin ff2db8cf93 styles: Eliminiate duplicate selector for user/group PM circles. 2019-07-12 16:25:40 -07:00
Tim Abbott 06d3194ff6 dependencies: Use the django-bitfield 1.9.5 release.
The release contains all the fixes from our fork.
2019-07-12 16:25:40 -07:00
Rishi Gupta 0f3c2748dd notification bot: Update stream announcement message. 2019-07-11 15:22:36 -07:00
Tim Abbott e8e420bbd9 markdown: Fix marked generation of unnecessarily absolute URLs.
The new versions should exactly match the HTML we generate in the
backend unit test suite.
2019-07-11 15:09:38 -07:00
Rohitt Vashishtha e68f90db9c topic-mention: Support updating old renders on stream rename. 2019-07-11 14:53:10 -07:00
Rohitt Vashishtha 3698cdcc58 topic-mention: Add Marked implementation as HandleStreamTopic. 2019-07-11 14:53:10 -07:00
Rohitt Vashishtha 0ba332bcc0 topic-mention: Add Bugdown implementation as StreamTopicPattern. 2019-07-11 14:53:10 -07:00
Puneeth Chaganti a138d8e95c templates: Update open graph metadata for some portico pages.
Closes #12580
2019-07-11 14:23:25 -07:00
Puneeth Chaganti 6fdd8fb4a1 documentation: Change open graph metadata for /integrations. 2019-07-11 14:23:25 -07:00
Rishi Gupta c3adafbee9 notification bot: Remove check for existence in add_subscriptions_backend.
We implicitly assume settings.NOTIFICATION_BOT is not None just a few lines
above, in
sender = get_system_bot(settings.NOTIFICATION_BOT)
notifications.append(
    internal_prep_private_message(
        realm=user_profile.realm,
        sender=sender,
        ...
2019-07-11 14:18:21 -07:00
Rishi Gupta 6c8569d99f notification bot: Add stream creator to initial stream message.
Also removes the "Welcome", since it's cleaner to have this be strictly a
notification.
2019-07-11 14:16:56 -07:00
Rishi Gupta 5400eb62be notification bot: Inline prep_stream_welcome_message.
This will make it easier to have access to the stream creator.

The indirection also isn't really adding anything, especially given that the
announce message is inlined just above.
2019-07-11 14:16:56 -07:00
Rishi Gupta 7de7b6872b notification bot: Modify initial stream creation message.
Discussion at
https://chat.zulip.org/#narrow/stream/137-feedback/topic/hello.20topic

The "by @**X**" part in the message content is in a later commit.
2019-07-11 14:16:56 -07:00
Tim Abbott 1d3312eede docs: Improve email gateway documentation based on feedback. 2019-07-11 14:01:29 -07:00
Aayush Agrawal 54584f6c16 url preview: Create a single preview for each URL in a message.
Modified by punchagan to:
* Add a separate markdown test for de-duplicating inline previews
* Check for number of unique URLs to see if per limit message is crossed
* Use a set for processed URLs instead of a list

Fixes #8379.
2019-07-11 13:37:15 -07:00
Yashashvi Dave ff75c77f7a account settings: Replace logic with existing functions.
Replace settings api calls with existing function
`settings_ui.do_settings_change()`. This commit also
adds a ui element for save alert notificaiton.
2019-07-11 13:29:08 -07:00
Yashashvi Dave e2e7d288a5 user settings: Fix garbage full name in change-full-name modal.
We should set full name evertime we open the modal. Otherwise
it will show garbage value which user has entered before but
did not save.
2019-07-11 13:17:59 -07:00
Yashashvi Dave ecddc10272 user setting: Fix error message style in change user info modals.
This commit fixes style of error message in update-user-info
modals. Commit adds error message element in modal body and
fixes margin.
2019-07-11 13:17:42 -07:00
Yashashvi Dave da2b80c173 custom field: Make external-custom-field URL input wider. 2019-07-11 12:52:21 -07:00
Yashashvi Dave 27ead227c0 custom fields: Add separate alert-save widget for create field.
Add separate alert-notification widget for create-custom-field
in admin view.

Fixes part of #12748
2019-07-11 12:52:21 -07:00
Vaibhav 81a7467441 css: Nest `.subscriber-list` inside `.subscriber_list_container`. 2019-07-11 12:23:42 -07:00
Vaibhav 52027af52a css: Nest `.subscriber_list_container` inside `.subscriber-list-box`. 2019-07-11 12:23:42 -07:00
Vaibhav 57aedf0a46 css: Use SCSS nesting for `.subscriber_list_container`. 2019-07-11 12:23:42 -07:00
Vaibhav f27031925a css: Use SCSS nesting for `.subscriber-list`. 2019-07-11 12:23:42 -07:00
Vaibhav 39f6d0a71b css: Reorder subscriptions.scss so `.subscriber-list` are in same place. 2019-07-11 12:23:42 -07:00
Tim Abbott 4aeb399315 apps: Fix buggy toggling with version_info.show_instructions.
We were doing the seemingly innocent
.toggle(version_info.show_instructions) to show the instructions if
and only if show_instructions was true.  However, our data structures
that should have been false didn't set a value, and `.toggle` with no
arguments just flips the state, rather than unconditionally hiding.
2019-07-11 11:48:24 -07:00
Vishnu Ks db6439ca57 emails: Remove cheers section from missed_message email. 2019-07-11 11:33:31 -07:00
Hemanth V. Alluri 041fe396f6 openapi: Extract logical segments in the validation test.
Extract some logical segments of test_openapi_arguments into
individual (helper) functions. E.g. extraction of the regex
to OpenAPI URL format conversion and testing.
2019-07-11 11:01:46 -07:00
Hemanth V. Alluri 644fba495b openapi: Use standardized URL format in validator test.
Now that the URL format has been standardized as {var_name},
we can finally clean up the validator test.
2019-07-11 11:01:46 -07:00
Hemanth V. Alluri ffd2bccd4e openapi: Standardize URL format to use {var_name} syntax.
The previous code for the validator test was fairly messy due to
checking for both formats of the openapi url, one with
<variable_name> and the other with {variable_name}. To eliminate
this, we have standardized the format and restricted it to
{variable_name} as per the official format at:
https://swagger.io/docs/specification/describing-parameters.
2019-07-11 11:01:40 -07:00
Rishi Gupta fe59c31e85 portico: Add link for accessibility on /features. 2019-07-10 22:59:14 -07:00
Mateusz Mandera 6f778ffe53 docs: Fix typos in email-gateway.md. 2019-07-10 17:58:38 -07:00
Wyatt Hoodes 69bd7c6dd3 test_realm_export: Add coverage for tarball upload and retrieval.
These updates are added as a direct result of the new strategy related
to the the following refactorings:

* Having `do_export_realm` return the value of the tarball path.
See 6e187e974a4e6282d3616312bdfa19d0d2a949d1.

* Moving the upload logic for s3 and local tarball storage out of
`export_realm_wrapper` and into `upload.py`.
See f1041e1fb6cb60f2c53b294695245e4c86a4d40b.
2019-07-10 17:48:54 -07:00
Wyatt Hoodes 0f31053b0c export.py: Call upload_backend only when we know which backend to use.
Importing at the top of the file causes conflictions on the
backend when deciding whether to go down the S3 path, or the
`LOCAL_UPLOADS_DIR` path.
2019-07-10 17:48:54 -07:00