Commit Graph

22668 Commits

Author SHA1 Message Date
Krzysztof Kotlarek
1fd3a30a59
FIX: update normalize css from 3.0.1 to 8.0.1 (#10141)
It is a second attempt to this update. First one was reverted here https://github.com/discourse/discourse/pull/8618

We noticed a problem that `like` counter had incorrect colour on mobile.

I added a missing rule to the bottom of the file (that rule existed in normalize-3 and was removed in normalize-8)

```
button,
input,
optgroup,
select,
textarea {
  color: inherit;
}
```
2020-07-06 09:09:30 +10:00
Régis Hanol
48b4ed41f5 FIX: uploading an existing image as a site setting
The previous fix (f43c0a5d85) wasn't working for images that were already uploaded.
The "metadata" (eg. 'for_*' and 'secure' attributes) were not added to existing uploads.

Also used 'Upload.get_from_url' is the admin/site_setting controller to properly retrieve
an upload from its URL.

Fixed the Upload::URL_REGEX to use the \h (hexadecimal) for the SHA

Follow-up-to: f43c0a5d85
2020-07-03 19:16:54 +02:00
David Taylor
4c1e690e32
DEV: after_extract_linked_users hook for plugins to modify user list
This allows plugins to change the list of users which will be sent 'linked' notifications
2020-07-03 14:52:49 +01:00
Régis Hanol
f43c0a5d85 FIX: uploading an image as a site setting
When uploading an image as a site setting, we need to return the "raw" URL, otherwise
when saving the site setting, the upload won't be looked up properly.

Follow-up-to: f11363d446
2020-07-03 13:23:10 +02:00
Sam Saffron
a9c703c230
FIX: emoji autocomplete not triggering correctly
08044b4f regressed emoji auto complete logic since we (I) forgot to add the
space into the not capturing group at the beginning.

This meant that

`hello 👍t` would not trigger an autocomplete to pick skin tone.
2020-07-03 16:56:11 +10:00
Martin Brennan
8ef782bdbd
FIX: Increase time of DOWNLOAD_URL_EXPIRES_AFTER_SECONDS to 5 minutes (#10160)
* Change S3Helper::DOWNLOAD_URL_EXPIRES_AFTER_SECONDS to 5 minutes, which controls presigned URL expiry and secure-media route cache time.
* This is done because of the composer preview refreshing while typing causes a lot of requests sent to our server because of the short URL expiry. If this ends up being not enough we can always increase the time or explore other avenues (e.g. GitHub has a 7 day validity for secure URLs)
2020-07-03 13:42:36 +10:00
Vinoth Kannan
9426d12c1d FEATURE: trigger user_updated event if username is changed. 2020-07-03 00:14:19 +05:30
Osama Sayegh
de243426c4
FIX: Negative limit values shouldn't cause error 500 (#10162) 2020-07-02 19:52:37 +03:00
Roman Rizzi
2df388ffd7
DEV: Plugins can extend ReviewableScore types. (#10156) 2020-07-02 11:47:43 -03:00
Ahmed Gagan
04d7693355
FIX: Filter read/unread notifications on the server side (#10152)
https://meta.discourse.org/t/notifications-unread-only-filter/37621/32
2020-07-02 11:06:00 +01:00
David Taylor
95153356ea
PERF: Refactor lightbox decorator to use querySelectorAll (#10158)
Previously we were using `$elem.find(...).not($elem.find(...))`. This took approximately 2ms on my machine with a test post.

This commit switches to using a native querySelectorAll method, which takes less than 0.5ms on the same test post.
2020-07-02 11:04:19 +01:00
Guo Xiang Tan
ecc799ab56
FIX: Delete related search data when record has been deleted. 2020-07-02 12:24:59 +08:00
Kris
490939a1c9 UX: Truncate long badge names in the mobile usercard 2020-07-01 21:39:40 -04:00
Vinoth Kannan
f11363d446 FIX: return cdn url for uploads if available.
Currently it is displaying non-cdn urls in the composer preview.
2020-07-02 06:36:14 +05:30
Robin Ward
8bc61e84a7 FIX: Support root paths that omit the trailing slash and have QPs 2020-07-01 14:55:20 -04:00
David Taylor
76d5e54aab
PERF: Check for modal visibility in a more efficient way
This code runs on every keyup event in the application, so it needs to be efficient. Previously we were iterating over the whole document using the JQuery :visible selector. Per the JQuery docs at https://api.jquery.com/visible-selector/

> Using this selector heavily can have performance implications, as it may force the browser to re-render the page before it can determine visibility. Tracking the visibility of elements via other methods, using a class for example, can provide better performance.

We already had a `hidden` class on the modal element which we can check, so we can check that instead.
2020-07-01 17:49:23 +01:00
Dan Ungureanu
fc4d74870c
UX: Add Login button on 403 error page if user is not logged in (#10154) 2020-07-01 18:27:42 +03:00
Robin Ward
e0d2174e75 FIX: Search was not multisite aware 2020-07-01 09:58:17 -04:00
Guo Xiang Tan
01a722885d
PERF: Exclude image_url and thumbnails from SearchTopicListItemSerializer.
The attributes are not used and was resulting in N+1 queries.
2020-07-01 14:28:31 +08:00
Sam Saffron
ac968f5363
PERF: cache all metadata for 60 seconds
Clients tend to request webmanifests and such very often.

Keep the data cached for 60 seconds so it is not requested aggresively.
2020-07-01 12:58:02 +10:00
Mark VanLandingham
57a8b3b964
DEV: Add group name as class to group-box (#10150) 2020-06-30 10:49:31 -05:00
David Taylor
4db9f7bb73
FIX: Hide publish_read_state option from non-admin users (#10148) 2020-06-30 16:49:04 +01:00
Sam Saffron
67a310db02
FIX: emoji_autocomplete_min_chars failing when not 0
autocomplete resolving to [] was causing it to stop working.
Instead we have a special const (SKIP) which ensures it will
continue to be evaluated and only this instance is skipped.
2020-06-30 17:39:52 +10:00
Mark VanLandingham
d00e83eab1
FIX: update theme fields when updating from ThemesInstallTask (#10143) 2020-06-29 13:49:02 -05:00
Roman Rizzi
7ddd83dfcf
FIX: Uploads cannot be mapped due to the cook-text's element attr being null (#10136) 2020-06-29 15:37:40 -03:00
Mark VanLandingham
cd5cfc1496
FEATURE: Site setting to always show category definitions (#10124) 2020-06-29 13:22:02 -05:00
Régis Hanol
860deeb072 FIX: identify slug-less topic urls everywhere
In 91c89df6, I fixed the onebox to support local topics with a slug-less URL.
This commit fixes all the other spots (search, topic links and user badges) where we look up for a local topic.

Follow-up-to: 91c89df6
2020-06-29 12:31:20 +02:00
Dan Ungureanu
4efc126635
FIX: Serialize an empty array if no suggested topics exist (#10134)
It used to return nil, which was ambiguous (empty vs absent
result).
2020-06-26 22:25:38 +03:00
tshenry
d5a063993d
FIX: published-page-header should be a sibling to published-page-body not a parent (#10126) 2020-06-25 14:47:05 -07:00
Neil Lalonde
8c9cc5b772
DEV: add class to body of no_ember layout so it can targeted in CSS 2020-06-25 16:17:19 -04:00
Joshua Rosenfeld
b52143feff
FIX: Remove paths from robots.txt in favor of noindex header
Google no longer supports the use of robots.txt to block indexing.
See https://support.google.com/webmasters/answer/6062608 and
https://support.google.com/webmasters/answer/93710

Previous commits have added the `noindex` header to appropriate pages,
now we need to remove the paths from robots.txt so the pages can be
crawled.

Follow up to:
13f229808a
b6765aac4b
676be3a853
07b728c5e5
c94e6a9a66
2020-06-25 13:55:06 -04:00
Sam Saffron
88459e08c9
FEATURE: allow disabling of extra term injection in search
There is a feature in search where we take over from the tokenizer
in postgres and attempt to inject more words into search.

So for example: sam.i.am will inject the words i and am.

This is not ideal cause there are many edge cases and this can
cause extreme index bloat.

This is an opening move commit to make it configurable, over the
next few weeks we will evaluate and decide if we disable this by
default or simply remove.
2020-06-25 13:36:52 +10:00
Guo Xiang Tan
9c7d3b2dc0
FIX: Avoid marking notifications as seen in readonly mode. 2020-06-25 10:14:07 +08:00
Régis Hanol
7109d94ee7 FIX: properly invalidate inline oneboxes when rebaking
When rebaking a post we were invalidating _regular_ oneboxes but not inline oneboxes.

DEV: also renamed 'InlineOneboxer.purge' to 'InlineOneboxer.invalidate' to keep
the API consistent with 'Oneboxer.invalidate'
2020-06-24 11:54:54 +02:00
Joffrey JAFFEUX
df1f804400
FIX: ensures moderation history is accessible from topic/post admin menu (#10118) 2020-06-24 10:49:47 +02:00
Bianca Nenciu
75151f0457
FIX: Use correct URL for unsubscribe (#10077) 2020-06-24 09:31:20 +02:00
Sam Saffron
9ffc022cf4
DEV: improve verbose mode for reindexer
This makes the verbose mode provide a bit of progress notification
while reindexing as it can take many hours to do a giant site
2020-06-24 17:29:45 +10:00
Sam Saffron
2987901043
FIX: skip category notification_level unless scoped
#b19dcac2 improved the serializer so it sends default notification
levels to users to work around cases where a category edit would
would result in clients being left with invalid notification state

Unfortunately this did not address the root issue.

When we edit categories we publish state to multiple users this
means that the serializer is executed unscoped with no user.

The client already handles this case per:

dcad720a4c/app/assets/javascripts/discourse/app/models/site.js (L119-L119)

If a property is not shipped to it, it will leave it alone on the
existing category.


This fix ensures that these wide category info updates do not
include notification state to avoid corruption of local state.
2020-06-24 17:08:12 +10:00
Kane York
52278ce6fd
FIX: Use Discourse.system_user when we need a placeholder admin (#9781) 2020-06-24 15:51:30 +10:00
Bianca Nenciu
42226e12ee
FEATURE: Add after-user-name plugin outlet (#10113) 2020-06-24 15:45:11 +10:00
Sam Saffron
dcad720a4c
DEV: add optional verbose logging to re-index job
This verbose logging can be useful when executing the job by hand
for debugging purposes

In general people will not use this
2020-06-24 15:37:08 +10:00
Jarek Radosz
13087cab54 FIX: Prevent typing "#" when showing "Jump to…"
Closes https://meta.discourse.org/t/the-shortcut-behaves-wrong-in-some-browsers/155531
2020-06-24 00:25:54 +02:00
David Taylor
d473ddd02c
FIX: Use raw content when checking for watched words to flag (#10104)
This makes flagged watched words match the behavior of censor, requires_approval and blocked watched words.
2020-06-22 19:48:06 +01:00
Bianca Nenciu
685646540a
FIX: Hide PM tags if the site setting is disabled (#10089)
* FIX: Hide PM tags if the site setting is disabled

* Apply code suggestions
2020-06-22 16:48:24 +03:00
Bianca Nenciu
aff9bfd5bc
FIX: Fix select kit size (#10094) 2020-06-22 16:48:00 +03:00
Guo Xiang Tan
3370ef188e
FEATURE: Remove deprecated uploads url site settings.
The site settings have been replaced with direct image upload since
Discourse 2.3.
2020-06-22 14:32:29 +08:00
Martin Brennan
516a03be09
FIX: Improve admin permalink UX (#10101)
The admin permalink list was a little tricky to use because the URLs are easily reduced with a ... if they are too long. This adds a copy to clipboard button for the URL and a title on hover so the full text of the URL can be seen.
2020-06-22 13:14:16 +10:00
Kris
02d3bf304a remove inaccurate comment, follow up to c028936 2020-06-19 16:49:56 -04:00
Kris
c0289362f7 Safari icon fix, follow up to 5cc0369 2020-06-19 16:44:34 -04:00
David Taylor
17c4f76eac
FIX: Do not attempt to pull_hotlinked on emoji images when CDN enabled (#10091) 2020-06-19 20:21:05 +01:00