Commit Graph

22527 Commits

Author SHA1 Message Date
David Taylor
293467a37a
REFACTOR: Remove jquery usage from resolveAllShortUrls, and fix debounce
- This function now requires an explicit scope. It will never run on the entire document.

- Previously debounce was being used with an anonymous function, which means it was having no effect.
2020-06-05 17:15:14 +01:00
David Taylor
0f09fd22f3
DEV: Remove attachment css handling from resolveAllShortUrls
This was moved inside the markdown processor in 65481858, so there is no longer any need to run this logic after cooking
2020-06-05 15:12:30 +01:00
Robin Ward
a9def011d0 FIX: (getURL "") was not working with the i18n helper 2020-06-05 09:53:43 -04:00
David Taylor
be5974734d
PERF: Pass element to resolveAllShortUrl function, not text selector (#9988)
We already have a reference to the preview element, so there is no need to look it up again. This saves about 1ms per keypress in my testing.
2020-06-05 13:37:07 +01:00
David Taylor
731263b81c
PERF: Correctly memoize baseUri value in javascript app (#9986)
An empty string is a falsey value in javascript, so we were looking for the meta tag every time getURL was called, which took approximately 1.5ms every time.
2020-06-05 13:36:48 +01:00
Vinoth Kannan
0f20a6f0aa FIX: use short_path of flair upload to get signed url for secure media.
If we use `upload.url` for secure urls then the images won't render.
2020-06-05 07:43:15 +05:30
Penar Musaraj
2de2537595
UX: add bottom padding to user lists on mobile
In some cases, when lists had a handful of items, the last item would be covered by the footer-nav eoverlay on PWAs and DiscourseHub.
2020-06-04 21:42:01 -04:00
Penar Musaraj
f6c3962e3c
UX: Change collapsed draft z-index on mobile 2020-06-04 21:24:14 -04:00
Kris
5cea4a6cc2 icon color fix, follow-up to 5cc0369 2020-06-04 17:29:28 -04:00
Kris
5cc0369898 Minor dropdown icon width fix 2020-06-04 17:26:57 -04:00
Rafael dos Santos Silva
f00e5515e4
FIX: Service Worker URL was broken
Behavior was changed in #9966, which made the URL be relative.

If the user landed in a topic, for example, the browser was given a
service worker URL under that specific topic URL, which was a 404.

Fixes broken PWA install and broken push notifications
2020-06-04 14:49:39 -03:00
Joffrey JAFFEUX
a23d31e4d6
DEV: removes unecessary casting (#9982) 2020-06-04 19:07:34 +02:00
Jeff Wong
de29b4a511
PERF: rate limit search, and add anon cache for search results (#9969)
Adds new hidden site settings for rate limits:
30 for logged in users, 15 for anon

Adds an anon cache for searching, caches results of searches for 1 minute
2020-06-04 09:26:08 -07:00
Penar Musaraj
2d880b42a3
UX: Add simple-list setting type (#9970) 2020-06-04 10:44:54 -04:00
Arpit Jalan
40dfac176f FIX: client side /my/ redirects were appending extra slash 2020-06-04 17:32:34 +05:30
Guo Xiang Tan
2188ccccd5 DEV: Remove initiating_user keyword arg from EmailUpdater.
The guardian contains the acting user.
2020-06-04 13:21:56 +08:00
Mark VanLandingham
c200238bdc
DEV: Reorder appending extra header icons (#9973) 2020-06-03 14:28:02 -05:00
Vinoth Kannan
3e7f7fdde8
FEATURE: category setting for default list filter. (#9975) 2020-06-04 00:56:56 +05:30
Robin Ward
22789e0201 New bootstrap.json endpoint for starting up Discourse
Discourse needs a bunch of data preloaded before it can start up.
Normally we throw blobs of this into the HTML document that is requested
but in some cases that's awkward to retrieve.

For example with Ember CLI you have a separate javascript application
that needs to make its own HTML.

This API endpoint returns a JSON object with all the data Discourse needs to
bootstrap and start up.
2020-06-03 14:45:23 -04:00
Robin Ward
ba00cc8ec4
DEV: Move Discourse.getURL and related functions to a module (#9966)
* DEV: Move `Discourse.getURL` and related functions to a module

* DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN`

* FIX: `get-url` is required for server side code

* DEV: Deprecate `BaseUri` too.
2020-06-03 12:45:26 -04:00
Joffrey JAFFEUX
d27b877a40
FIX: prevents false boolean param to be filtered as non existant (#9968)
* FIX: prevents false boolean param to be filtered as non existant

This was preventing to filter top category route to be filtered by replies.

* if order is different ascending should be true on first click

* test

* fix

* just pass params

* more fixxes
2020-06-03 10:19:53 -06:00
Vinoth Kannan
7fe414d35d FIX: hide rss feed & json if a user profile is hidden. 2020-06-03 19:03:02 +05:30
Guo Xiang Tan
141fba8866
UX: Ensure that select-kit is hidden consistently. 2020-06-03 11:51:01 +08:00
Sam Saffron
57a3d4e0d2
FEATURE: whitelist theme repo mode (experimental)
In some restricted setups all JS payloads need tight control.

This setting bans admins from making changes to JS on the site and
requires all themes be whitelisted to be used.

There are edge cases we still need to work through in this mode
hence this is still not supported in production and experimental.

Use an example like this to enable:

`DISCOURSE_WHITELISTED_THEME_REPOS="https://repo.com/repo.git,https://repo.com/repo2.git"`

By default this feature is not enabled and no changes are made.

One exception is that default theme id was missing a security check
this was added for correctness.
2020-06-03 13:19:57 +10:00
Guo Xiang Tan
062db10c52
FIX: EmailValidator needs to validate format of email. 2020-06-03 10:34:37 +08:00
Kris
1b5a505930 Small fixes to image uploaders 2020-06-02 20:36:01 -04:00
Sam Saffron
10e321a96f
Revert "DEV: makes autocomplete debounced (#9941)"
This reverts commit f9e715672b.

Sadly this debounce fix appears to break @mention autocomplete,
reverting for now.
2020-06-03 08:40:21 +10:00
Kris
688d9428fe Use an em-based width for better scaling with font-size changes 2020-06-02 17:14:04 -04:00
Kris
9e9ff01e86 Add missing text back in 2020-06-02 16:39:18 -04:00
Gerhard Schlager
0cf297725f DEV: Use consistent interpolation key format in translations
From now on client strings can easily be reused on the server and you don’t have to think about choosing the right format anymore.
2020-06-02 19:05:10 +02:00
Mark VanLandingham
b3c8d36412
DEV: Plugin api for adding extra header icons (#9964) 2020-06-02 11:39:12 -05:00
Robin Ward
4e3a84c687 FIX: If creating a flag for a watched word, include the reason 2020-06-02 11:49:02 -04:00
Jarek Radosz
3e8d548d35
FIX: Prevent clipping user mentions (#9962) 2020-06-02 16:30:34 +02:00
Guo Xiang Tan
439db7ca1e
DEV: Add REDIS_RAILS_FAILOVER env to test our new redis failover. 2020-06-02 17:24:14 +08:00
David Taylor
75b1298e99
DEV: Drop unused image_url column from posts and topics (#9953)
This has been superseded by image_upload_id. The image_url value in API responses is now generated dynamically from the upload record.
2020-06-02 16:21:38 +10:00
Bianca Nenciu
d76ea9fa6b
FIX: Do not destroy $.fileupload element (#9888)
conditional-loading-section component rerendered the <input> element
and lost the necessary event handlers for jQuery-File-Upload.
2020-06-02 16:14:41 +10:00
Dan Ungureanu
ef3e3077d0
FIX: Staff users can bypass tag validation rule (#9924) 2020-06-02 16:11:25 +10:00
Joffrey JAFFEUX
f9e715672b
DEV: makes autocomplete debounced (#9941)
* DEV: makes autocomplete debounced

* better wording
2020-06-02 15:20:14 +10:00
Guo Xiang Tan
3dd1778199
PERF: Reduce number of queries from 3 -> 1 when fetching web manifest. 2020-06-02 12:04:02 +08:00
Guo Xiang Tan
7897010dfd
Fix lint. 2020-06-02 10:45:18 +08:00
Guo Xiang Tan
370cba451d
DEV: Refactor away conditionals that we don't need. 2020-06-02 10:40:29 +08:00
Guo Xiang Tan
c21e3bbd1b
DEV: Prefer create! over create when not checking return value.
We don't want stuff to silently fail.
2020-06-02 10:34:05 +08:00
Penar Musaraj
2a0a689442
UX: prevent devices from miscalculating fullscreen composer height
Fixes issue seen in some Chromebooks that flip between tablet and regular notebook window size
2020-06-01 22:24:16 -04:00
Sam Saffron
7e52106812
DEV: when synchornizing state pull tags
In some cases we may want topic tracking state to keep track of tags
this small change ensures we do not remove them if they are already in place
2020-06-02 11:42:00 +10:00
Penar Musaraj
fa6aa7f627
FIX: Digest frequency issue on user creation
If `default email digest frequency` was set to "Never", users would get
a `digest_after_minutes` set to `nil` which triggered this error
in the logs if/when the site eventually changed that setting and
enabled digests:

```
NoMethodError (undefined method `>=' for nil:NilClass)
/var/www/discourse/app/mailers/user_notifications.rb:227:in `digest'
```
2020-06-01 17:39:16 -04:00
Robin Ward
a95826f60c
Remove discourse constants (#9958)
* DEV: `Discourse.baseUri` does not exist

This never could have worked - should have been `Discourse.BaseUri` if
anything.

* DEV: Remove Discourse.Environment

* DEV: Remove `Discourse.disableMissingIconWarning`

* DEV: A bunch more missing environment checks
2020-06-01 16:33:43 -04:00
Kane York
9162cd8f3d
FIX: Only render group card if user title is from group (#9946)
This was failing when a user with a primary_group chose to display a title coming from a badge.
2020-06-01 11:44:41 -07:00
Mark VanLandingham
b6709f0dda
DEV: Add option to only show icons to header widget (#9935) 2020-06-01 12:26:59 -05:00
David Taylor
3106f85983
FIX: Support exporting reports which reference topics (#9957) 2020-06-01 18:23:58 +01:00
tshenry
0d6b638dac
FEATURE: New plugin outlet under badges page title (#9936) 2020-06-01 08:55:51 -07:00