Commit Graph

22291 Commits

Author SHA1 Message Date
Penar Musaraj f782c3019c FIX: Improve topic timeline calculation logic
Followup to 999e2ff5

Switching between the topic timeline and the progress bar was buggy when
resizing the composer. The root of the problem is that we can't know
the height of the timeline once it's hidden from view.

This uses a magic number for the calucation, which in this case is
necessary. Additionally, the calculation now takes place when
the resizing of the composer ends (previously, it was triggered when
dragging was started, which caused issues when resizing slowly).
2020-05-06 21:48:22 -04:00
Arpit Jalan 7052e6f4a1 UX: remove top padding from reddit onebox description 2020-05-07 07:13:37 +05:30
Kris 6e2060e973 Remove extra category whitespace on category+latest/top pages 2020-05-06 21:19:46 -04:00
Kris 3d6c952c3e UX: remove bold to de-emphasize category names on visited topics 2020-05-06 18:02:39 -04:00
Krzysztof Kotlarek 05799538e6
FIX: correct edit notification username for PMs (#9649)
When the tag is added to PM by admin, notification has an incorrect username (post author username instead of admin username)
2020-05-07 07:52:21 +10:00
Kane York 15a938e861
FIX: make can_invite_to_forum robust against plugin interference (#9644) 2020-05-06 13:57:26 -07:00
Robin Ward 01929e3505 DEV: Move `preload-store` to `discourse/lib/preload-store`
It's only used inside Discourse so it needn't be its own module
2020-05-06 15:28:06 -04:00
Robin Ward f5bdbd347e Revert "FIX: Discobot has not been created with our custom avatar."
This reverts commit 1062dbc3e9.

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
Joffrey JAFFEUX c99ecba68f
DEV: improves sk api (#9653)
- reduces the API to 3 actions for now: appendContent/prependContent/onChange
- well tested
- removes all previous APIS which were only half supported or too dangerous as they could collide with other plugins or core behaviors
- this plugins also puts every sk test helpers in one file
2020-05-06 17:16:20 +02:00
Robin Ward 7c2d3275f4 DEV: Remove `Discourse` constants from focus mixin.
Also removes the mixin which was only used in `app/app`
2020-05-06 10:36:08 -04:00
Arpit Jalan 10ca6968af Bump onebox version
- reuse existing video icon class
- CSS changes for reddit video onebox
2020-05-06 19:34:03 +05:30
Robin Ward eda2d184d6 Backwards compatibility for raw-templates lib 2020-05-06 09:14:19 -04:00
Arpit Jalan 5121708814 Add styling for Reddit video onebox.
0d49811aac
2020-05-06 15:58:30 +05:30
Martin Brennan fa572d3a7a
DEV: Remove all code referencing at_desktop bookmark reminders (#9650)
We have found no need for these reminder types, so we are removing the code for them.
2020-05-06 15:22:43 +10:00
Martin Brennan 4239ca1f8d
FIX: Change user digest email total unread notification calculation (#9648)
We now add together unread notifications (which are low-priority only) and unread high priority notifications (PMs and bookmark reminder notifications), and removed the separate "X unread high priority notifications" count in the user digest email.
2020-05-06 14:23:13 +10:00
Kris 4f26893d57 UX: Fix time alignment on user activity pages 2020-05-06 00:02:49 -04:00
Guo Xiang Tan 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
Guo Xiang Tan b299f5f491 DEV: Use Ember.Service over manually registering a factory.
Follow up to 9e827eb420
2020-05-06 09:24:49 +08:00
Kris 4e1c2fbd18 UX: Add prefixed property so Firefox also gets 4-space tabs in code 2020-05-05 21:00:40 -04:00
Kris 0a766b594e add class for topic-list dismiss button container 2020-05-05 19:50:00 -04:00
Kris 27d1a605af revert spacing reduction from 4afbcb9 2020-05-05 17:31:35 -04:00
Kris e27f07e57d minor followup to 657facb 2020-05-05 17:18:36 -04:00
Kane York e7443ab5da
FIX: Preserve code blocks when quoting (#9632)
But, produce a non-block quote if a single code line is quoted.
2020-05-05 12:12:22 -07:00
Robin Ward e1d64cf896 DEV: Have `app/app` export a class not an instance.
The app boot should call `create()`
2020-05-05 14:54:13 -04:00
Robin Ward 279835f603 DEV: Remove more `Discourse.` globals 2020-05-05 14:42:47 -04:00
Robin Ward 4cf3dbe3db DEV: Remove `Discourse.` global variable usage in initializers 2020-05-05 14:14:38 -04:00
Jordan Vidrine bae813fac6
fix linting 2020-05-05 18:29:19 +02:00
Robin Ward 612284cef3
DEV: Remove `Discourse.RAW_TEMPLATES` (#9630)
We were sharing `Discourse` both as an application object and a
namespace which complicated things for Ember CLI. This patch
moves raw templates into `__DISCOURSE_RAW_TEMPLATES` and adds
a couple helper methods to create/remove them.
2020-05-05 12:15:03 -04:00
Jordan Vidrine 657facb1d5
FIX: Fixes wrapping of buttons with larger buttons
Thanks to Kris for solution
2020-05-05 10:51:49 -05:00
Dan Ungureanu 1019789d1a
FIX: Resolve Schema.org validation issues 2020-05-05 16:57:16 +03:00
Zdravko Curic 8010e1ab2e
DEV: Add remove button function to PluginAPI (#9627) 2020-05-05 09:18:02 -04:00
Joffrey JAFFEUX 6b14a0f352
FIX: apply sameWidth from 450px screen width 2020-05-05 13:01:02 +02:00
Joffrey JAFFEUX bd0abddf6f
UX: attempts to have a better use of available space with sk (#9639) 2020-05-05 12:59:47 +02:00
David Taylor 03818e642a
FEATURE: Include optimized thumbnails for topics (#9215)
This introduces new APIs for obtaining optimized thumbnails for topics. There are a few building blocks required for this:

- Introduces new `image_upload_id` columns on the `posts` and `topics` table. This replaces the old `image_url` column, which means that thumbnails are now restricted to uploads. Hotlinked thumbnails are no longer possible. In normal use (with pull_hotlinked_images enabled), this has no noticeable impact

- A migration attempts to match existing urls to upload records. If a match cannot be found then the posts will be queued for rebake

- Optimized thumbnails are generated during post_process_cooked. If thumbnails are missing when serializing a topic list, then a sidekiq job is queued

- Topic lists and topics now include a `thumbnails` key, which includes all the available images:
   ```
   "thumbnails": [
   {
     "max_width": null,
     "max_height": null,
     "url": "//example.com/original-image.png",
     "width": 1380,
     "height": 1840
   },
   {
     "max_width": 1024,
     "max_height": 1024,
     "url": "//example.com/optimized-image.png",
     "width": 768,
     "height": 1024
   }
   ]
  ```

- Themes can request additional thumbnail sizes by using a modifier in their `about.json` file:
   ```
    "modifiers": {
      "topic_thumbnail_sizes": [
        [200, 200],
        [800, 800]
      ],
      ...
  ```
  Remember that these are generated asynchronously, so your theme should include logic to fallback to other available thumbnails if your requested size has not yet been generated

- Two new raw plugin outlets are introduced, to improve the customisability of the topic list. `topic-list-before-columns` and `topic-list-before-link`
2020-05-05 09:07:50 +01:00
Martin Brennan 5cf6984a1a
FIX: Pre-select Later Today on bookmark edit if the time is the same (#9636)
If the user chooses "Later Today" as the reminder for a bookmark, then edits that bookmark, we should pre-select "Later Today" if that time has not changed (e.g. later is still 6pm). We do this to avoid confusion instead of opening the custom date + time section.
2020-05-05 16:28:31 +10:00
Martin Brennan 6aa9014509
UX: Bookmark removal tweaks (#9635)
* Do not show confirmation modal if deleting bookmark from list unless the bookmark has a reminder
* Remove the deleted bookmark from the in-memory array for the user list so a full reload of the list is not needed and scrolling is maintained
2020-05-05 14:56:04 +10:00
Krzysztof Kotlarek 9bff0882c3
FEATURE: Nokogumbo (#9577)
* FEATURE: Nokogumbo

Use Nokogumbo HTML parser.
2020-05-05 13:46:57 +10:00
tshenry 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
Kris 0ee796f66d revert 4afbcb9 2020-05-04 19:40:51 -04:00
Penar Musaraj a610a762d1 DEV: Deprecated icon name fix 2020-05-04 15:58:35 -04:00
Penar Musaraj 5706cab897
FIX: Improve digest email styling on Outlook 2016 (#9626) 2020-05-04 14:07:03 -04:00
Joffrey JAFFEUX 70b1e98609
FIX: reverts to use an observer to support loading more notifications (#9628)
Apparently, didReceiveAttrs is not called when loading more notifications, this would require a more heavy refactoring.
2020-05-04 18:23:45 +02:00
David Taylor ff73f116e8
DEV: Set owner on raw views (#9624)
This allows things like `Ember.inject.service` to be used within the raw view. setOwner simply sets one property on the object, and the result is cached along with the other injected properties, so this should have negligible performance impact.
2020-05-04 16:31:31 +01:00
Roman Rizzi 29c6c4b092
UX: Use created_at as the default order when viewing reviewed items or everything (#9601) 2020-05-04 10:26:12 -03:00
Vinoth Kannan 0fe8ad13fa UX: change the user merge button's label and icon. 2020-05-04 18:44:30 +05:30
Joffrey JAFFEUX 5285cbee62
FIX: shows filter if there's no notifications to show after filter 2020-05-04 13:16:53 +02:00
David Taylor a51b8d9c66
FIX: Do not use cached settings during theme compilation
We compile within a database transaction, so using a cached value from redis can cause unwanted side effects
2020-05-04 09:43:06 +01:00
David Taylor 4f885d7da2
FIX: Clear theme caches after database transaction has committed
This was causing unusual side effects on high-traffic sites, where the cache would be rebuilt before the transaction had been committed
2020-05-04 09:42:50 +01:00
Sam Saffron 3877ef2cfa
FEATURE: Unconditionally notify on edits at least once a day
This ensures that at a minimum you are notified once a day of
repeat edits by the same user.

Long term we may consider winding this down to say 1 hour or
making it configurable.
2020-05-04 17:55:00 +10:00
Sam Saffron 3d0ccf8642
FIX: missing edit notifications in some rare cases
Due to a refactor in e90f9e5cc4 we stopped notifying on edits if
a user liked a post and then edited.

The like could have happened a long time ago so this gets extra
confusing.

This change makes the suppression more deliberate. We only want
to suppress quite/link/mention if the user already got a reply
notification.

We can expand this suppression if it is not enough.
2020-05-04 17:40:56 +10:00
Joffrey JAFFEUX 5e9c96dfed
REFACTOR: minor tweaks to user's notifications-filter (#9623) 2020-05-04 09:09:13 +02:00
Ahmed Gagan 99abdf51cd
FEATURE: adds a filter for all/unread/read on user's notifications page (#9535) 2020-05-04 08:36:59 +02:00
Joffrey JAFFEUX d8a086abc5
FIX: do not apply only-emoji margin for excluded cases (#9619) 2020-05-03 17:52:19 +02:00
Kane York 784bf2a173
FIX: Unassign user titles when a badge is deleted (#9573) 2020-05-02 18:02:28 -07:00
Joffrey JAFFEUX 0e4db91870
FIX: save bookmark reminder on tap unless custom (#9611) 2020-05-02 10:31:44 +02:00
Robin Ward e57fd283db DEV: Rename `deprecated` to the more appropriate app-boot 2020-05-01 15:19:19 -04:00
Joffrey JAFFEUX cdbba81ee0
UX: collapse extra files when browsing a theme component (#9610) 2020-05-01 20:19:17 +02:00
Robin Ward f182e61def DEV: Remove global Handlebars 2020-05-01 14:12:09 -04:00
Artem Vasiliev d908bf101d
FIX: an `<a>` with a target of _blank wants a new window (#9607)
..even if it wraps an image
2020-05-01 11:05:36 -04:00
Joffrey JAFFEUX 2d287ef16a
FIX: ensures an anonymous shortcut fn can be used globally (#9605) 2020-05-01 10:42:28 +02:00
Martin Brennan bcc9ad6f57
FIX: Bookmark UI tweaks (#9604)
* When hovering over the bookmark icon for a post, show the name of the bookmark at the end of the tooltip _if_ it has been set.
* Order bookmarks by `updated_at DESC` in the user list and show that instead of created at.
2020-05-01 16:14:20 +10:00
Kris 4afbcb9872 Minor header title spacing reduction 2020-04-30 23:19:32 -04:00
Krzysztof Kotlarek 37e93914fc
FIX: the muted message should be sent after edit (#9593)
Recently, we added feature that we are sending `/muted` to users who muted specific topic just before `/latest` so the client knows to ignore those messages - https://github.com/discourse/discourse/pull/9482

Same `/muted` message should be included when the post is edited
2020-05-01 08:33:57 +10:00
Robin Ward d615de9139
DEV: Support for `import Handlebars from 'handlebars'`; (#9600)
* Remove Handlebars.SafeString usage

* DEV: Support for `import Handlebars from 'handlebars'`;

* FIX: Sprockets was broken when `node_modules` was present

By default the old version of sprockets looks for application.js
anywhere, including in a node_modules folder if this exists
(which it will when we move to Ember CLI.)
2020-04-30 16:41:02 -04:00
Jeff Wong 2cb9e85d14
FEATURE: add category banner for why a user cannot post (#9576)
* FEATURE: add category banner for why a user cannot post

Adds a category banner for why a user is unable to post in a category.

Also adds an extra alert for the user when a user is unable to create a topic in a
category and they still try and click on the disabled-looking new topic
button.
2020-04-30 10:39:11 -07:00
Robin Ward 03815f9795 DEV: Remove `Handlebars.Utils.escapeExpression` usage 2020-04-30 11:36:55 -04:00
Joffrey JAFFEUX 1b2db44678
FEATURE: allows to limit visible reports and tabs in dashboard (#9598) 2020-04-30 17:31:04 +02:00
Vinoth Kannan 71241a50f7 DEV: improve code readability & add tests for user guardian.
a511bea4cc
2020-04-30 20:59:33 +05:30
Joffrey JAFFEUX 45f704906d
UX: display info about extra files and uploader (#9595)
Co-authored-by: David Taylor <david@taylorhq.com>
2020-04-30 16:02:38 +02:00
Joffrey JAFFEUX 0d84f3afd4
UX: adds title attribute to widget dropdown header (#9597) 2020-04-30 14:36:21 +02:00
Joffrey JAFFEUX 7ef8f7bb7c
DEV: adds documentation about caret option of widget dropdown (#9596) 2020-04-30 14:28:34 +02:00
Dan Ungureanu fe51f7a863
FEATURE: More improvements to crawler and old browsers view
Related to c85018cdfd.
2020-04-30 12:07:51 +03:00
Sam Saffron d0d5a138c3
DEV: stop freezing frozen strings
We have the `# frozen_string_literal: true` comment on all our
files. This means all string literals are frozen. There is no need
to call #freeze on any literals.

For files with `# frozen_string_literal: true`

```
puts %w{a b}[0].frozen?
=> true

puts "hi".frozen?
=> true

puts "a #{1} b".frozen?
=> true

puts ("a " + "b").frozen?
=> false

puts (-("a " + "b")).frozen?
=> true
```

For more details see: https://samsaffron.com/archive/2018/02/16/reducing-string-duplication-in-ruby
2020-04-30 16:48:53 +10:00
Andrew Schleifer 02ef88052d DEV: take out more trash (icons)
folloup to f755810906
2020-04-30 14:25:05 +08:00
Martin Brennan 10f9f295dc
DEV: Add acceptance tests for bookmarks with reminders (#9592) 2020-04-30 14:58:26 +10:00
Guo Xiang Tan 3ac5df0546
UX: Add margin when displaying unlisted details in composer. 2020-04-30 10:50:26 +08:00
David Taylor 367cbf5d2b
FEATURE: Allow user creation with admin api when local logins disabled (#9587) 2020-04-30 11:39:24 +10:00
Sam Saffron 310a7edee5
DEV: remove unused columns from posts and topics
avg_time on posts and topics have not been used in a year.

This uses a re-runnable ddl transaction diasabled migration to
drop the column, cause it touchs very high traffic table and may
deadlock
2020-04-30 11:22:33 +10:00
Martin Brennan 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
Jeff Wong 8e4fea897e FIX: temporarily disable event listener for dismissing the first notification 2020-04-29 14:34:49 -07:00
Robin Ward f697133b7d DEV: Add Handlebars support to Ember CLI in discourse-common 2020-04-29 16:15:13 -04:00
Joffrey JAFFEUX e1dbc700b1
FIX: ensures widget dropdown doesn't overflow document (#9590) 2020-04-29 21:12:32 +02:00
Dan Ungureanu 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 4eebbd2212.

* FIX: Hide browser update notice in print view
2020-04-29 21:40:21 +03:00
Dan Ungureanu 402194f313
FIX: Enter selected link with 'o' on full page search
Follow-up to 70012f2027.
2020-04-29 21:25:59 +03:00
Joffrey JAFFEUX 816a08cf5f
UI: do not change widget dropdown separator background on hover (#9589) 2020-04-29 19:42:50 +02:00
Joffrey JAFFEUX a1b9150512
DEV: adds a caret option to widget dropdown (#9588) 2020-04-29 19:37:21 +02:00
Robin Ward cbb27241c4
DEV: Make `discourse-common` an Ember addon. (#9578)
This is to help with the migration to Ember CLI. In the current running
version of Discourse everything should be the same as before, just with
a few extra files that are not used. However, using Ember CLI this can
be installed as an Ember addon.

Co-Authored-By: Jarek Radosz <jradosz@gmail.com>
2020-04-29 12:18:21 -04:00
Joshua Rosenfeld 9dccf4f3b8
FIX: Copyedit for "You were logged out" modal (#9584)
See https://meta.discourse.org/t/-/149596
2020-04-29 07:37:06 -07:00
Joffrey JAFFEUX db337b10ee
FIX: correctly hides timeline scroller for short posts (#9581)
* FIX: correctly hides timeline scroller for short posts

* fix linting
2020-04-29 16:24:53 +02:00
Joffrey JAFFEUX 4eed86919e
FIX: ensures card cloak is removed (#9582)
Repro steps for current failure:
- use mobile view
- click on a different user avatar to show user card
- click message
- close composer
- cloak is still showing and prevents any click
2020-04-29 13:30:34 +02:00
Dan Ungureanu 7a946b9f5c
DEV: Fix typo
Follow-up to 0a85a7aef9.
2020-04-29 12:38:57 +03:00
Dan Ungureanu 0a85a7aef9
FEATURE: Add user_profile to user_archive CSV export (#9571) 2020-04-29 12:09:50 +03:00
Kris 24b9759c60 UX: fix dashboard version panel width by removing extra wrapper 2020-04-28 21:14:29 -04:00
Martin Brennan 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
Martin Brennan 17ca47af1a
FIX: Remove timezone in brackets from user card (#9567)
For clarity and to save space remove the timezone in brackets e.g. (EDT) from the user card. Also add a title to the user time span to say it is Local Time.
2020-04-29 08:45:38 +10:00
Martin Brennan 0d519c78fb
FIX: Do not save bookmark if close (X) on modal is clicked (#9541)
* After this change the bookmark will still be saved if clicking out of the modal or pressing escape
* To achieve this I implemented an initiatedBy parameter for modal closing from d-modal. If clicking on the cross it is initiated by close, if clicking out of the modal it is by click out.
* These options can then be compared in controllers consuming onClose

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-04-29 08:45:06 +10:00
Joffrey JAFFEUX 4ecc258835
DEV: adds support for header-title in topicTitleDecorators (#9562) 2020-04-28 21:27:07 +02:00
Neil Lalonde 9d781d4959
FIX: error customizing text for badges from plugins 2020-04-28 14:34:41 -04:00
Penar Musaraj 22f11efad0 DEV: Replace setTimeout with Ember.run.later
Followup to 6fad0463
2020-04-28 14:28:16 -04:00
Joffrey JAFFEUX 07e6452759
FIX: makes tracking shortcuts working when tracking button is not visible (#9575) 2020-04-28 20:12:16 +02:00
Joffrey JAFFEUX a8308e73e7
FIX: improves tag-list setting (#9574)
- Prevents setting to display an empty tag
- Updates dropdown when selecting/removing tag
2020-04-28 20:05:30 +02:00
Joffrey JAFFEUX a6f986b50f
FEATURE: allows to to style published page with themes/plugins (#9570) 2020-04-28 18:24:24 +02:00
Penar Musaraj b19dcac272
FIX: Include default notification level in category serializer (#9572)
Fixes an issue where the notification level state goes missing when user edits a category in the UI.
2020-04-28 12:05:53 -04:00
Joffrey JAFFEUX 4b57eb7049
FIX: published pages couldn't be routed from inside discourse (#9569)
This will allow to post a link to published page in a post. Before this, users clicking this link would have seen a 404.

ATM /pub is server sider only.
2020-04-28 16:37:56 +02:00
Robin Ward c1cc2f2a05
DEV: Remove ember-addons (#9559)
We weren't using this very much and introduces a dependency between
discourse-common and discourse which makes moving to yarn workspaces
more difficult.

In the future we might user ember-addons properly but for now it's
easier to move the code into discourse-common.

Note the old folder is still there because at least one plugin was still
requiring the old files. It will be removed in the future.
2020-04-28 10:14:49 -04:00
Arpit Jalan 198856f78d DEV: annotate models 2020-04-28 15:59:39 +05:30
mentalstring 67f3fe14aa
FEATURE: support SSO website and location overrides
Add location and website + the ability to override using SSO using the `sso_overrides_location` and `sso_overrides_website` site settings.
2020-04-28 16:06:35 +10:00
Joffrey JAFFEUX 23ff071ebd
FIX: currentUser might be undefined (#9555) 2020-04-28 15:55:06 +10:00
Kris 82c5d85e99 add btn-default class to show-tag-info button 2020-04-27 23:29:28 -04:00
Martin Brennan 66b5b8cf29
FIX: Local time not updating between user cards (#9564)
The local time was not updating between user cards because the computed property was not used correctly.

There's an old saying in Tennessee — I know it's in Texas, probably in Tennessee — that says, fool me once computed properties, shame on — shame on you. Fool me — you can't get fooled again.
2020-04-28 13:23:43 +10:00
Kris f9a44488e9 UX: Right align notification item time, adjust mobile space, consolodate 2020-04-27 23:19:15 -04:00
Kris dcb40a92c7 Add discovery-below outlet to tag pages too 2020-04-27 22:49:11 -04:00
Kris c679c8008c Remove additional wrapper, follow-up to d516a88 2020-04-27 22:13:31 -04:00
Penar Musaraj a70ca3a72a UX: Better spacing for composer toggle buttons on mobile 2020-04-27 22:04:29 -04:00
Penar Musaraj b1d30d7f05 FIX: keep scroll position when minimizing composer in iOS 2020-04-27 22:03:56 -04:00
Joffrey JAFFEUX ad978b93ab
FIX: Correctly shows no bookmark message (#9548) 2020-04-28 11:19:35 +10:00
Joffrey JAFFEUX 2c6d6dfd05
FIX: Improves bookmark shortcut reliability and other minor issues (#9547)
This commit reworks slightly the `toggleBookmark` and `toggleBookmarkTopic` functions.

- Pressing [f] (toggleBookmarkTopic)
  - a topic list item is selected, we attempt to toggle the related topic
  - a post is selected, we bookmark the current topic
  - nothing is selected, if there's a currentTopic we bookmark it

- Pressing [b] (toggleBookmark)
  - a post is selected, we bookmark it
  - a topic list item is selected, we attempt to toggle the related topic
  - nothing is selected, if there's a currentTopic we bookmark it

Note this, commit also reduces jquery usage, a bug where the [f] shortcut was propagated to the modal input, and fixes bug when bookmarking a topic list item on the front page and the firstPost couldn't be found.
2020-04-28 10:32:59 +10:00
Martin Brennan bb4e965a66
FEATURE: Optionally show local time for user in card (#9527)
This adds a site setting (default off) to optionally show a user's local time and timezone in their user card. For example, I live in Brisbane, and if at 3:30PM my time I were to open a user who lives in California's card I would see 22:30 (PST).
2020-04-28 10:13:59 +10:00
Mark VanLandingham 051e6be7b8
DEV: Trigger 'user_added_to_group' when accepting invite with groups (#9561) 2020-04-27 15:13:34 -05:00
Roman Rizzi 394babcae3
FIX: Only show the review page to users that can see it. Do not publish the reviewable count update message to everyone. (#9556) 2020-04-27 14:51:25 -03:00
Mark VanLandingham d8c884a856
DEV: Add has_many category_tag_stats in tag.rb (#9558) 2020-04-27 12:42:13 -05:00
Robin Ward 056327c0c9
DEV: Move `discourse.js` to `app/app.js` (#9545)
This is another thing to get our application in line with what Ember CLI
expects.
2020-04-27 13:28:10 -04:00
Guo Xiang Tan 16f0d1c503
PERF: Remove database query when publishing to staff users. 2020-04-27 11:50:21 +08:00
Jarek Radosz e0aec23844 DEV: Don't warn about valid data 2020-04-26 22:18:44 +02:00
Dan Ungureanu 0ae504aece
FIX: Raise a 4xx error instead of a 5xx if draft data is invalid 2020-04-25 11:47:22 +03:00
Sam Saffron 1f6eaf26a1
Revert "UX: replace closed topic icon with discourse-no-entry"
This reverts commit 040b8c00a4.

We decided to keep status quo for now
2020-04-25 13:12:56 +10:00
Kris d516a88b4c DEV: add tag name class to body of tag pages 2020-04-24 22:27:25 -04:00
Kris 67429335d5 Remove SASS spacing function 2020-04-24 19:32:02 -04:00
Kris 040b8c00a4 UX: replace closed topic icon with discourse-no-entry 2020-04-24 17:31:34 -04:00
Jeff Wong e638d43f0a
FEATURE: dismiss first notification on click anywhere (#9525)
FEATURE: dismiss first notification on click anywhere

Quicker jumpstart for those already familiar with the platform:

Allow dismissal of first notification mask from any click.
On the dismissal click, we also need to send a "yes I saw it" confirmation
by grabbing a batch of notifications. This prevents the dialog from appearing
again on refresh, or other browsers and ensures we only see it once.
2020-04-24 13:27:54 -07:00
Penar Musaraj 5a3350cd76 FIX: Do not override all title elements with page title
This is redudant too, setting document.title is sufficient.
2020-04-24 10:16:05 -04:00
Penar Musaraj b45142ef79
FIX: reenable draft check modal and fix focus on iOS for PMs 2020-04-24 09:35:19 -04:00
Joffrey JAFFEUX d83f39be73
DEV: replaces jquery scrollTop by vanilla js code (#9543) 2020-04-24 12:45:47 +02:00
David Taylor 0616826841
DEV: Add jquery-free `decorateCookedElement` function to plugin api (#9534)
This is a replacement for `decorateCooked` which will work without jquery.

A backwards compatibility layer is provided for existing plugins/themes which are currently using `decorateCooked`
2020-04-24 09:47:33 +01:00
David Taylor 8a112b7464
DEV: Automatically extend CSP when themes link to external scripts (#9531) 2020-04-24 09:47:01 +01:00
Joffrey JAFFEUX 90d6816d19
FIX: removes inheriting as it's too random and can be very hard to track (#9542) 2020-04-24 10:08:22 +02:00
Sam Saffron cbceadf48b
FEATURE: when blocking emails prefer blocking canonical
Previously we relied entirely on levenshtein_distance_spammer_emails site
setting to handle "similar looking" emails.

This commit improves the situation by always preferring to block (and check)
canonical emails.

This means that if:

`samevil+test@domain.com` is blocked the system will block `samevil@domain.com`

This means that `samevil+2@domain.com` (ad infinitum) will be blocked
2020-04-24 14:09:51 +10:00
Sam Saffron 6a18c9aa0b
Revert "FEATURE: enforce_canonical_emails site setting"
This reverts commit 6f9177e2ed.

We decided on a completely different approach to the problem.

Instead we will let blocked emails be treated as canonical.
2020-04-24 13:52:06 +10:00
Martin Brennan cd1c7d7560
FIX: Copying image markdown for secure media loading full image (#9488)
* When copying the markdown for an image between posts, we were not adding the srcset and data-small-image attributes which are done by calling optimize_image! in cooked post processor
* Refactored the code which was confusing in its current state (the consider_for_reuse method was super confusing) and fixed the issue
2020-04-24 10:29:02 +10:00
Blake Erickson bd3425b389 REFACTOR: Use rescue inside do/end block
Follow up to 9cbbaf4237
2020-04-23 16:26:29 -06:00
Kris 9f52997be1 UX: Let's try X for the closed topic icon instead of a \ 2020-04-23 17:23:25 -04:00
Joffrey JAFFEUX b19d50f355
FIX: site settings dropdown can be 440px width (#9539) 2020-04-23 23:12:58 +02:00
Joffrey JAFFEUX b871e79c5b
FIX: removes rounding correction as it can be in either direction (#9538) 2020-04-23 23:10:40 +02:00
Penar Musaraj 7cd006fe3a Revert "DEV: Draft check async when starting new PM"
This reverts commit e49212d0bc.

This requires some more work.
2020-04-23 15:51:54 -04:00
Blake Erickson 5b98161f2f
DEV: ember-cli refactor for TextField and TextArea imports (#9480)
In order to be able to use ember-cli we need to fix the import
statements for `TextField` and `TextArea` in the code base.

The only change I don't fully understand is the one in
`discourse-loader.js`, but adding the components to that file make it
all work.
2020-04-23 12:36:05 -06:00
Penar Musaraj e49212d0bc DEV: Draft check async when starting new PM
When the sequence is missng, the draft check is done synchronously and it results in  iOS devices not launching the keyboard.
2020-04-23 14:17:15 -04:00
Mark VanLandingham 3e543dfa18
FIX: Do not set title attribute on header-topic-info widget (#9533) 2020-04-23 12:44:20 -05:00
Joffrey JAFFEUX 82b43451b3
FIX: Inner content of a row could have no max-width and be very large (#9532) 2020-04-23 19:18:01 +02:00
Joffrey JAFFEUX be1b7f7468
FIX: fails gracefully if :scope is not handled by a browser (#9529) 2020-04-23 16:50:30 +02:00
Roman Rizzi 7a2e8d3ead
DEV: Add the missing `app` subdirectory (#9499)
* DEV: Add missing  directory to the Discourse ember app

* DEV: Resolve imports correctly
2020-04-23 10:07:54 -03:00
David Taylor 8e28ccb2ea
PERF: Refactor decorateCooked to run in a detached DOM (#9517)
This means that decorateCooked can be used to modify HTML without triggering the download of remote resources (e.g. images)

In some rare cases (e.g. IntersectionObservers in Chromium), decorating needs to happen in the real DOM. For this, pass `afterAdopt: true` to `decorateCooked`
2020-04-23 11:03:46 +01:00
Sam Saffron 8dccf0521c
Revert "PERF: stop firing superfluous onSelectionChange"
This reverts commit fa96054acf.

Sadly this fails a test case, we may have to hunt up all the
parentElements to check for the cooked class to perform the
bypass
2020-04-23 18:16:13 +10:00
Sam Saffron fa96054acf
PERF: stop firing superfluous onSelectionChange
onSelectionChanged fires a debounced event that calls window.getSelection()

window.getSelection() is reasonably expensive. There is no reason to do any
of this work if we have an input field focused, that is not how quote works
2020-04-23 17:51:23 +10:00
Joffrey JAFFEUX 7132c50f3b
FIX: prevents constant composer reloading (#9528) 2020-04-23 07:54:29 +02:00
Sam Saffron d69ec186b9
Revert "DEV: DiscourseEvents fired when users are added/removed from groups (#9522)"
This reverts commit 54ec9f7009.

The commit clashes with a previous implementation of the same event
2020-04-23 15:06:55 +10:00
Krzysztof Kotlarek 52c1d7337e
FEATURE: don't display new/unread notification for muted topics (#9482)
* FEATURE: don't display new/unread notification for muted topics

Currently, even if user mute topic, when a new reply to that topic arrives, the user will get "See 1 new or updated topic" message. After clicking on that link, nothing is visible (because the topic is muted)

To solve that problem, we will send background message to all users who recently muted that topic that update is coming and they can ignore the next message about that topic.
2020-04-23 14:57:35 +10:00
Mark VanLandingham 54ec9f7009
DEV: DiscourseEvents fired when users are added/removed from groups (#9522) 2020-04-23 14:53:31 +10:00
Joffrey JAFFEUX 3bbd8b1258
UX: rework date time input range (#9524) 2020-04-22 22:17:53 +02:00
Blake Erickson 9cbbaf4237 FIX: Don't throw 500 for invalid website url input
It's possible to cause a 500 error by putting in weird characters in the
input field for updating a users website on their profile.

Normal invalid input like not including the domain extension is already
handled by the user_profile model validation. This fix ensures a server
error doesn't occur for weird input characters.
2020-04-22 13:57:56 -06:00
Joffrey JAFFEUX 00f632fb0d
REFACTOR: s/translatedfilterPlaceholder/translatedFilterPlaceholder (#9521) 2020-04-22 20:39:55 +02:00
Joffrey JAFFEUX 4c248fc5c4
UX: do not attempt to full width sk on mobile (#9520) 2020-04-22 20:39:45 +02:00
Robin Ward e4a0e0bead FIX: Ignore removed column 2020-04-22 14:27:01 -04:00
Vinoth Kannan df0c386f8a
UX: drop the `automatic_membership_retroactive` column from groups model. (#9430) 2020-04-22 22:07:39 +05:30
Kris bf0c055a9a UX: add comment-plus icon for reopening topics 2020-04-22 12:29:27 -04:00
Krzysztof Kotlarek 81c216e04c
FIX: composer problem on the categories page (#9508) 2020-04-22 09:24:54 -07:00
Mark VanLandingham 04fb37c7a4
DEV: Export openNewCategoryModal from discovery-categories (#9501) 2020-04-22 11:03:28 -05:00
Eric Mueller 45f3517ef6
FEATURE: add class to <aside> quote block when quoting an ignored user (#9511)
* add class to <aside> quote block when quoted an ignored user

* Changed from single to double quotes
2020-04-22 12:00:44 -04:00
Robin Ward 13f2723dcb FIX: Don't log an error to logster if a topic could not be updated.
If for some reason an update did not go through (for example,
concurrently updating the same topic twice), we were logging something
like:

```
create_errors_json called with unrecognized type: #<Topic
```

This happened because we knew an error occurred but the active record
object had no errors attached.

This patch fixes the issue by attaching a proper error message in the
event that this happens.
2020-04-22 11:56:04 -04:00
Justin DiRose b7dea0d5c1
FIX: Copy button was displayed on quoted codeblock (#9514) 2020-04-22 15:57:25 +02:00
Vinoth Kannan e5c44f6dcf UX: display 'merge' button in all non-staff user profiles. 2020-04-22 17:42:09 +05:30
Daniel Waterworth c8fed90e4e FIX: Handle sub-sub-category paths without an id 2020-04-22 12:19:54 +01:00
Vinoth Kannan ceee855d00 minor code improvement
a511bea4cc
2020-04-22 16:40:59 +05:30
Joffrey JAFFEUX 5fb5807098
FIX: caret icon should inherit its color (#9513) 2020-04-22 13:10:02 +02:00
Joffrey JAFFEUX 4889dbde49
FIX: differentiate sk outline handling on single/multi (#9512) 2020-04-22 13:02:20 +02:00
Dan Ungureanu 4e5f9d4cd1
DEV: Drop 'key' column from user_api_keys (#9388) 2020-04-22 12:13:19 +03:00
Joffrey JAFFEUX 5c45363e67
UX: better outline support in sk components (#9510) 2020-04-22 10:54:02 +02:00
Dan Ungureanu e733701887
FEATURE: Make report filters reusable (#9444)
This commit also adds 'include subcategories' report filter
2020-04-22 11:52:50 +03:00
Vinoth Kannan a511bea4cc
FEATURE: admin UI to merge two users. (#9509) 2020-04-22 14:07:51 +05:30
Arpit Jalan ee63c35c35 DEV: use array for matching multiple values 2020-04-22 12:25:59 +05:30
Arpit Jalan c028e1aca7 FIX: use absolute url for `/user_avatar/` links 2020-04-22 12:08:59 +05:30
Martin Brennan 628ba9d1e2
FEATURE: Promote bookmarks with reminders to core functionality (#9369)
The main thrust of this PR is to take all the conditional checks based on the `enable_bookmarks_with_reminders` away and only keep the code from the `true` path, making bookmarks with reminders the core bookmarks feature. There is also a migration to create `Bookmark` records out of `PostAction` bookmarks for a site.

### Summary

* Remove logic based on whether enable_bookmarks_with_reminders is true. This site setting is now obsolete, the old bookmark functionality is being removed. Retain the setting and set the value to `true` in a migration.
* Use the code from the rake task to create a database migration that creates bookmarks from post actions.
* Change the bookmark report to read from the new table.
* Get rid of old endpoints for bookmarks
* Link to the new bookmarks list from the user summary page
2020-04-22 13:44:19 +10:00
Kris b6489d2690 UX: Replaced locked topic "lock" icon with "comment-slash" icon 2020-04-21 17:34:59 -04:00
David Taylor f51b48b421
PERF: Improve lazy-load performance in Safari
Safari starts loading images as soon as attributes are modified. Modern browsers all prefer the srcset attribute over src, so we should remove srcset last, and add it first.
2020-04-21 19:05:33 +01:00
Mark VanLandingham 036236d6d6
FIX: properly add 'two-rows' class to header-topic-info container (#9497) 2020-04-21 13:01:57 -05:00
David Taylor a97cb2444c
UX: Fix broken image placeholder styling 2020-04-21 19:00:47 +01:00
Robin Ward 63811707e8 DEV: Remove `setupTopicController` event 2020-04-21 13:48:33 -04:00
Jeff Wong c4cc19a2ba Revert "DEV: allow nav items to override computed property values"
This reverts commit 74e4102093.
2020-04-21 09:58:46 -07:00
Joffrey JAFFEUX 1eb9bc4cec
DEV: encapsulates _events and clearing it at app-events module level (#9489) 2020-04-21 17:27:17 +02:00
Justin DiRose c9cdd12e97
FIX: Improve selector for copy codeblock button (#9493)
Previous selector implementation was not accounting for codeblocks in
nested elements, like lists.
2020-04-21 10:12:56 -05:00
Joffrey JAFFEUX 62459c845f
DEV: allows a sk component to stop click propagation (#9495) 2020-04-21 17:11:40 +02:00
Joffrey JAFFEUX 79058a6d99
DEV: makes sk scroll to current selection (#9492) 2020-04-21 16:48:49 +02:00
Joffrey JAFFEUX 4f834f0008
DEV: allows click to propagate outside of header but not outside of sk (#9491) 2020-04-21 16:20:05 +02:00
Justin DiRose 6559ad0d80
FEATURE: Add copy button to codeblocks (#9451) 2020-04-21 08:02:13 -05:00
Martin Brennan d123138d3a
FIX: Only confirm bookmark delete if a reminder has been set (#9484)
We do not need a secondary bootbox confirm if the bookmark has no reminder, because nothing really will be lost in that case.
2020-04-21 14:29:12 +10:00
Jarek Radosz a781ef7662
FIX: Reject invalid Category slugs (#9473)
Previously it would sanitize given slug and then save the resulting empty slug.
2020-04-21 03:50:50 +02:00
Jarek Radosz 17cf300b71
DEV: Use more specific error responses (#9472)
* DEV: Use `render_json_error` (Adds specs for Admin::GroupsController)
* DEV: Use a specific error on blank category slug (Fixes a `render_json_error` warning)
* DEV: Use a specific error on reviewable claim conflict (Fixes a `render_json_error` warning)
* DEV: Use specific errors in Admin::UsersController (Fixes `render_json_error` warnings)
* FIX: PublishedPages error responses
* FIX: TopicsController error responses (There was an issue of two separate `Topic` instances for the same record. This makes sure there's only one up-to-date instance.)
2020-04-21 03:50:20 +02:00
Jarek Radosz 5a81e3999c
DEV: Remove `bypass_bump` from CookedPostProcessor (#9468)
It was only passing it along to `PullHotlinkedImages` and that class have not used that arg since April 2014 (c52ee665b4)
2020-04-21 03:48:19 +02:00
Jarek Radosz 9a6e4b1fa1
FIX: Make InlineUploads handle more URL formats (#9467)
It previously failed to match URLs with characters other than `[a-zA-z0-9\.\/:-]`. This meant that `PullHotlinkedImages` would sometimes download an external image and then never use it in any posts.
2020-04-21 03:47:48 +02:00
Krzysztof Kotlarek e9f7262813
FIX: when category or tag is muted, update user (#9456)
Currently, when category or tag is muted, only after hard refresh, these new muted categories are really muted. Without a hard refresh, you will still receive "new topic" messages.

Therefore, when tag or category is muted, we should update the user object right away.
2020-04-21 08:33:55 +10:00
Jeff Wong 74e4102093 DEV: allow nav items to override computed property values
Plugins need to override extra nav-items. Make sure these properties are
override-able.

See:
https://deprecations.emberjs.com/v3.x/#toc_computed-property-override
2020-04-20 15:21:58 -07:00