Commit Graph

22211 Commits

Author SHA1 Message Date
Joffrey JAFFEUX e74170cd9e
REFACTOR: Superfluous arguments passed to function resolveSize (#9678)
resolveSize accepts only one param
2020-05-07 16:36:15 +02:00
Joffrey JAFFEUX affc79bb68
REFACTOR: removes useless assignment to local variable (#9676) 2020-05-07 16:35:54 +02:00
Joffrey JAFFEUX 08e8ae82cc
REFACTOR: removes useless conditional (#9677) 2020-05-07 16:34:49 +02:00
Joffrey JAFFEUX a078b086ba
REFACToR: removes useless assignment to local variable (#9675) 2020-05-07 16:34:36 +02:00
Joffrey JAFFEUX a04b226c2b
REFACTOR: removes useless conditional (#9674)
We already check if there's a post in the line before.
2020-05-07 16:34:25 +02:00
Joffrey JAFFEUX d5fe1279bd
REFACTOR: value assigned to precision here is unused (#9673) 2020-05-07 16:34:14 +02:00
Joffrey JAFFEUX a2109bd9b2
REFACTOR: value assigned to cp here is unused. (#9672) 2020-05-07 16:30:51 +02:00
Joffrey JAFFEUX 930989d462
REFACTOR: variable '_postSnapshot' always evaluates to true (#9671) 2020-05-07 16:28:28 +02:00
Joffrey JAFFEUX d020e70643
REFACTOR: removes unreachable return statement (#9670) 2020-05-07 16:27:53 +02:00
Joffrey JAFFEUX 48375db848
REFACTOR: removes superfluous argument passed to findWidget (#9669)
findWidget accepts only one argument
2020-05-07 16:27:15 +02:00
Joffrey JAFFEUX 5a201082c7
REFACTOR: removes useless conditional (#9667)
This use of variable 'content' always evaluates to true.
2020-05-07 16:25:44 +02:00
Joffrey JAFFEUX 864f48b2e6
REFACTOR: removes useless conditional (#9668)
Given we will return true on the line before if inlineEmoji, this will always be false.
2020-05-07 16:25:23 +02:00
Joffrey JAFFEUX 01272f2085
REFACTOR: removes unreachable code (#9665)
* REFACTOR: removes unreachable code

* this one too
2020-05-07 16:24:54 +02:00
Joffrey JAFFEUX ac4251fc9d
REFACTOR: publishedPage property was duplicated (#9664) 2020-05-07 16:24:35 +02:00
Joffrey JAFFEUX 87b1d435d2
FIX: improves positioning of sk in mobile when inside a modal (#9657) 2020-05-07 09:10:29 +02:00
Martin Brennan 37be2958f7
DEV: Allow specifying if a notification is high_priority on create (#9660)
This allows for special cases where we may not want a certain notification type to ALWAYS be high priority (e.g. a topic timer).
2020-05-07 14:35:32 +10:00
Martin Brennan be48e503fd
FIX: Show the Bookmark button for PM topics (#9659)
There is no point in suppressing this now that we have bookmark reminders.
2020-05-07 14:30:10 +10:00
Martin Brennan 6fb0f36ce1
FEATURE: Optionally delete bookmark when reminder sent (#9637)
We now show an options gear icon next to the bookmark name.

When expanded we show the "delete bookmark when reminder sent" option. The value of this checkbox is saved in local storage for the user.

If this is ticked, when a reminder is sent for the bookmark the bookmark itself is deleted. This is so people can use the reminder functionality by itself.

Also remove the blue alert reminder section from the "Edit Bookmark" modal as it just added clutter, because the user can already see they had a reminder set:

Adds a default false boolean column `delete_when_reminder_sent` to bookmarks.
2020-05-07 13:37:39 +10:00
Penar Musaraj 423802fbce UX: Fix modal positioning when iOS keyboard is visible 2020-05-06 23:06:57 -04:00
Kris 33c8adda83 UX: Adjust admin menu to better fit short (horizontal) viewports 2020-05-06 22:59:22 -04:00
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