Commit Graph

1255 Commits

Author SHA1 Message Date
3d20a1143b Update translations 2020-05-26 10:06:07 -04:00
979093787f FIX: Include lazyYT-container in cooked post HTML (#9870)
This applies the new styles without waiting for the JS to run.
2020-05-25 14:24:40 -07:00
faeb5793ba UI: various tweaks to polls UI on mobile (#9864) 2020-05-23 19:08:49 +02:00
d9a02d1336 Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse""
This reverts commit 20780a1eeed56b321daf18ee6bbfe681a51d1bf4.

* SECURITY: re-adds accidentally reverted commit:
  03d26cd6: ensure embed_url contains valid http(s) uri
* when the merge commit e62a85cf was reverted, git chose the 2660c2e2 parent to land on
  instead of the 03d26cd6 parent (which contains security fixes)
2020-05-23 00:56:13 -04:00
20780a1eee Revert "Merge branch 'master' of https://github.com/discourse/discourse"
This reverts commit e62a85cf6fd81a2a34aff6144bd36b9ac459964a, reversing
changes made to 2660c2e21d84bea667e1ea339f91cda352328062.
2020-05-22 20:25:56 -07:00
37128d71c7 Add rails_helper to spec (#9861) 2020-05-22 12:27:52 -04:00
3aecc1990b DEV: Review follow up to 234cd5c3e7f8d1be7c98af7eeb572e5b79f0a16a. 2020-05-20 16:17:59 +08:00
37983a7815 Fix lint. 2020-05-20 10:33:34 +08:00
b7387d4611 DEV: Remove code unused code when seeding narrative bot. 2020-05-20 10:22:51 +08:00
234cd5c3e7 FIX: Switch discobot to pull avatar from gravatar. 2020-05-20 10:20:08 +08:00
96c02caba7 DEV: Change use of Redis flushall to flushdb.
FLUSHALL removes all keys from all databases. Instead we only want to
remove keys from the current Redis database.
2020-05-19 10:20:00 +08:00
f86b123cfc DEV: Remove use of const in untranspiled js 2020-05-15 17:55:34 +01:00
ac042c2bbe UX: Fetch higher-resolution youtube thumbnails where available
We have been using YouTube's 'hqdefault.jpg' image which works consistently to provide a 480x360 thumbnail. YouTube does provide larger thumbnails, but not consistently for every video. By using og:image, we will fetch the best resolution YouTube can provide for each video.

This commit also refactors lazy-yt to re-use the thumbnail already existing in the cooked content. This means we get lazy-loading for free, and avoid hotlinking images to YouTube (when download remote images is enabled on the site).
2020-05-15 17:49:27 +01:00
0c6f30d92a FIX: Allow lazy-yt thumbnails to fetched by pull_hotlinked_images
The thumbnails were being correctly downloaded, but the URLs were not being substituted correctly in post_process_cooked because the lazy-yt output did not include the `onebox` class.
2020-05-14 17:33:16 +01:00
a849bdf0c9 FIX: Don't publish typing presence if composer isn't opened.
Hitting cancel on composer will set composer's reply and title to null
causing our observer to fire.
2020-05-14 12:52:10 +08:00
3d5589e026 DEV: Remove assertions that are not required. 2020-05-14 10:07:55 +08:00
c5ef465179 DEV: Avoid relative paths when importing in plugins. 2020-05-14 10:05:16 +08:00
623920f13d FEATURE: Introduce a staff only override key for discourse-presence.
Merge remote-tracking branch 'origin/coding-standards'
This uses the composer as a bridge for other plugins.
2020-05-13 14:13:31 +08:00
ca8d11635c Add missing export in 15e32dc1af90ceafbb8eadf2e0e5ecc59b9a7527. 2020-05-13 13:57:12 +08:00
15e32dc1af FIX: Composer presence shows user as editing when replying. 2020-05-13 13:41:03 +08:00
aa40a07d73 FIX: Throttle typing function in discourse-presence. 2020-05-13 13:31:06 +08:00
e990d8adce FIX: ensures preview is correctly computing timezone for current user (#9758)
This also fixes a related bug with timezones on displayed date when in calendar range.
2020-05-12 12:30:41 -07:00
6e3fe1abba DEV: Use async/await instead of andThen() 2020-05-11 18:22:48 +02:00
4a74f18e95 PERF: Move fetching of avatar into hijack for discobot certificate 2020-05-11 09:35:06 +08:00
6359a5f8a9 DEV: Fix poll plugin causing error when server reloads in dev env. 2020-05-08 14:59:55 +08:00
781e3f5e10 DEV: Use response.parsed_body in specs (#9615)
Most of it was autofixed with rubocop-discourse 2.1.1.
2020-05-07 17:04:12 +02:00
1dd9df9cd0 REFACTOR: removes overwritten properties and duplicates fn (#9686) 2020-05-07 16:39:53 +02:00
029d091ea8 FIX: displays poll's close date in local time (#9656) 2020-05-06 22:18:47 +02:00
f5bdbd347e Revert "FIX: Discobot has not been created with our custom avatar."
This reverts commit 1062dbc3e9cbf9370803c0acea55eb3c054060ca.

Looks like it's causing some errors on migration.

```
/var/www/discourse/lib/image_sizer.rb:6:in `resize'
/var/www/discourse/lib/upload_creator.rb:120:in `block in create_for'
/var/www/discourse/lib/distributed_mutex.rb:33:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:14:in `synchronize'
/var/www/discourse/lib/upload_creator.rb:37:in `create_for'
```
2020-05-06 11:28:42 -04:00
2f714c7412 FIX: end date of ranges in html preview was incorrect (#9654)
This commit also remove an unused block of code as previewedTimezones can't be empty anymore.
2020-05-06 17:16:36 +02:00
1062dbc3e9 FIX: Discobot has not been created with our custom avatar.
Previously the image was imported from a Discourse hosted CDN but the
URL has since become invalid. However, it was not caught since all
errors are rescued. This commit fixes the issue by shipping the user
avatar with the plugin.
2020-05-06 09:25:01 +08:00
b299f5f491 DEV: Use Ember.Service over manually registering a factory.
Follow up to 9e827eb420c7aefd166fba1e7724eced81aaffe7
2020-05-06 09:24:49 +08:00
9bff0882c3 FEATURE: Nokogumbo (#9577)
* FEATURE: Nokogumbo

Use Nokogumbo HTML parser.
2020-05-05 13:46:57 +10:00
b8b1cbbfb9 UX: Improve second factor UI (#9526)
This will make a few minor improvements to the second factor user interface. Highlights include:

- Using the site's title to prefix the backup code filename. If non-ascii characters are detected, then prefix "discourse" instead.
- Add icons and change the text on some of the buttons for better clarity and consistency
- Add an education link to the security key modal
2020-05-05 11:05:25 +10:00
3cce608379 Update translations 2020-05-04 10:39:01 -04:00
9e827eb420 DEV: Refactor presence manager to deal with multiple composer states.
This change amends it so we use a static service to keep track of
the typing presence.

It correct various edge cases the initial implementation had

- Faster close messages
- When composing on topic 1 and viewing topic 2 we had incorrect
  presence
- Changing a running composer to reply as new topic or reply to a
  differet topic would not correctly shift presence

Authored by tgxworld, with contributions by sam
2020-05-01 11:37:03 +10:00
238cbff46f Revert "HACK: Add dummy plugin folder"
This reverts commit 590830b931ec83f7ae4ccde3cf820a072d6c2d09 because a
proper fix was implemented in discourse_docker@d587158.
2020-04-30 11:02:15 +03:00
ca539fdccf FIX: Rename all instances of bookmarkWithReminder to just bookmark (#9579)
* Rename all instances of bookmarkWithReminder and bookmark_with_reminder to just bookmark
* Delete old bookmark code at the same time
* Add migration to remove the bookmarkWithReminder post menu item if people have it set in site settings
2020-04-30 10:09:22 +10:00
590830b931 HACK: Add dummy plugin folder
On some installations, there may be a leftover symlink which uses the
old plugin name:

  public/plugins/discourse-internet-explorer ->
  -> plugins/discourse-internet-explorer/public
2020-04-29 23:18:57 +03:00
c85018cdfd Improve support for old browsers (#9515)
* FEATURE: Improve crawler view

* FIX: Make lazyYT crawler-friendly

* DEV: Rename discourse-internet-explorer to discourse-unsupported-browser

* DEV: Detect more unsupported browsers

Follow-up to 4eebbd221239eaa3fc7e6f1bd6a9dcf0239b8444.

* FIX: Hide browser update notice in print view
2020-04-29 21:40:21 +03:00
bc1f7bd659 UX: Improve discobot random menion copy
As suggested in https://meta.discourse.org/t/-/148336/10
2020-04-29 13:09:16 -04:00
ae54a33719 FIX: discourse-presence breaks composer for users. 2020-04-29 15:29:29 +08:00
197d0332e6 DEV: Missing import. 2020-04-29 13:48:31 +08:00
8b3b5d1474 DEV: Disable discourse-presence in Ember test env. 2020-04-29 13:39:19 +08:00
2045f51312 FIX: correctly account for direct replies with presence
followup to 301a0fa5, we were not checking the action so we
were publishing some messages from composers we did not intend to
2020-04-29 15:23:17 +10:00
301a0fa54e FEATURE: Redesign discourse-presence to track state on the client side. (#9487)
Before this commit, the presence state of users were stored on the
server side and any updates to the state meant we had to publish the
entire state to the clients. Also, the way the state of users were
stored on the server side meant we didn't have a way to differentiate
between replying users and whispering users.

In this redesign, we decided to move the tracking of users state to the client
side and have the server publish client events instead. As a result of
this change, we're able to remove the number of opened connections
needed to track presence and also reduce the payload that is sent for
each event.

At the same time, we've also improved on the restrictions when publishing message_bus messages. Users that
do not have permission to see certain events will not receive messages
for those events.
2020-04-29 14:48:55 +10:00
6cf31f16f7 FIX: Change bookmarks-with-reminders URL back to bookmarks for user activity (#9566)
* Bookmarks with reminders is a core feature now, no need to have a separate URL
* Keep around the old /u/:username/activity/bookmarks-with-reminders route for backwards compat in Ember but just redirect to user activity bookmarks.
2020-04-29 10:53:37 +10:00
84be92c067 FIX: Avoid exception when rendering a poll in a trashed post
Maintain the poll belongs_to post relation when a post is trashed
2020-04-28 14:43:09 +01:00
7177b9d771 UX: Translating poll chart types wasn't possible 2020-04-28 14:29:42 +02:00
ec84b00aff fix the build. 2020-04-27 11:57:10 +05:30