Commit Graph

23072 Commits

Author SHA1 Message Date
David Taylor
041d28295f
UX: Hide login button during externally authenticated account creation
Also switch to use the new d-button loading property for the create account button
2020-07-06 10:18:49 +01:00
David Taylor
977766e7a8
FEATURE: sso_overrides_(email|username|name) for all auth methods
These settings previously applied only to discourse-sso. Now they work for all external authentication methods.
2020-07-06 10:18:45 +01:00
David Taylor
ec448a1516
DEV: Refactor Auth::Result for readability, recreate during signup flow 2020-07-06 10:18:41 +01:00
Joffrey JAFFEUX
789a15a897
DEV: allows autocomplete to be debounced (#10166)
Usage:

```
$(".foo").autocomplete({debounced: true});
```
2020-07-06 09:28:57 +02:00
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
Jarek Radosz
f28ea4751b FIX: A variable name typo
Not that this whole method is used much anymore.
2020-06-19 19:29:19 +02:00
Mark VanLandingham
0b58414de2
DEV: Add classes to admin customize nav items (#10092) 2020-06-19 10:51:53 -05:00
Jarek Radosz
58a5293d9b
FIX: Delete PostUploads on Post deletion (#10090)
Related uploads will then be removed by Jobs::CleanUpUploads
2020-06-19 17:45:08 +02:00
Robin Ward
4a2871f7f6
FEATURE: Don't display muted/ignored users under "who liked" (#10084)
* FEATURE: Don't display muted/ignored users under "who liked"

Previously, if you clicked on the heart icon below a post
it would show you the avatar for a user even if you ignored or muted
them.

This commit will instead display a (?) icon. The count of likes will
remain correct, but you needn't be reminded of the person you
preferred not to see.

* Use a circle instead of (?) for unknown user
2020-06-19 10:44:21 -04:00
David Taylor
a99bb0ded4
Revert "FIX: Do not attempt to pull_hotlinked on emoji images when CDN enabled"
This changed cause plugin spec failures and needs further investigation

This reverts commit 78626d2832.
2020-06-19 14:39:16 +01:00
David Taylor
9f2e7e4651
FIX: Handle invalid URLs gracefully when pulling hotlinked images 2020-06-19 12:52:51 +01:00
David Taylor
78626d2832
FIX: Do not attempt to pull_hotlinked on emoji images when CDN enabled 2020-06-19 12:45:06 +01:00
Joffrey JAFFEUX
3e161e372a
FEATURE: allows to have header/footer in publshed pages (#10067)
Usage: fill Header/Footer sections of your theme.
2020-06-19 09:51:03 +02:00
Martin Brennan
b5495b8e9c
FIX: Do not incorrectly add topic bookmark on Escape (#10088)
* The first post was showing as bookmarked incorrectly after pressing f to open the topic modal then pressing escape to cancel without saving, because the closeWithoutSaving option was not being respected.
* Also re-introduce the enter shortcut when the name input is focused to saveAndClose the bookmark modal by pressing enter.
2020-06-19 11:17:18 +10:00
Kris
5faf074e61 minor fix to post admin menu button class 2020-06-18 19:18:00 -04:00
Vinoth Kannan
ae47bcb269
DEV: move user references deletion code to before_destroy. (#10085)
Moving the `delete_source_user_references` method code from user merger service to user model.
2020-06-18 17:42:39 -04:00
Bianca Nenciu
a1df68d4c4
FIX: Do not change tracked categories for staged users (#10076) 2020-06-18 21:09:54 +03:00
Cassius
d13d5e2b99
FIX: Allow multiple hyphens in host (#10078)
* FIX: Allow multiple hyphens in host

* FIX: added spec for multiple hyphens
2020-06-18 13:58:47 -04:00
Robin Ward
494a27dc27 FIX: A much nicer error message if you can't ignore/mute a user 2020-06-18 13:41:27 -04:00
Robin Ward
6cb6faff29 UX: Ignore modal margin was too tight 2020-06-18 13:26:25 -04:00
Joffrey JAFFEUX
b8c676e727
FEATURE: allows to ignore a user forever (#10074) 2020-06-18 11:24:07 -04:00
Bernhard Suttner
e31471585a
DEV: allow to have duplicate topic titles if categegory is different (#10034)
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-06-18 11:19:47 -04:00
Mark VanLandingham
ec794c7f29
DEV: Plugin outlet after user-info (#10072) 2020-06-18 10:18:34 -05:00
Dan Ungureanu
d21a08c284
DEV: Deprecate Category#url_with_id in favor of Category#url (#9972) 2020-06-18 11:32:14 +03:00
Dan Ungureanu
62faa0f5fe
FIX: Do not show Add or Change buttons if email is not editable (#10068) 2020-06-18 11:15:44 +03:00
Penar Musaraj
d72ed8c5a8
UX: Include category name in hyperlink modal results on mobile 2020-06-17 14:46:01 -04:00
Dan Ungureanu
a60a67c431
FIX: Show unconfirmed emails too when checking emails (#10062)
When checking emails through user preferences, it did not display the
unconfirmed emails.
2020-06-17 21:41:01 +03:00
Jeff Wong
81a3129ffb
ARIA - add aria-label on topic input and post textarea (#10057)
Add reply form role with label as create/reply, and aria-labels on text inputs
2020-06-17 08:55:19 -07:00
Penar Musaraj
76b05ef8ad
DEV: Use short_date helper for email post template (#10063) 2020-06-17 11:29:37 -04:00
David Taylor
6caad5c083
FIX: Do not send staff welcome message if user already has role 2020-06-17 12:12:55 +01:00
Joffrey JAFFEUX
9da3a7f436
FEATURE: allows published pages to be public (#10053) 2020-06-17 12:42:20 +02:00
Jarek Radosz
7d289a4f3e
UX: Style video elements, show descriptions (#10040)
It's a stop gap – ideally we would generate a thumbnail for uploaded videos. For now, a bit of intentionality in the style and a pinch of context should do.
2020-06-17 12:38:00 +02:00
Jarek Radosz
a859d507e7
FIX: Prevent producing "undefined" strings (#10042)
Fixes a bug in search-menu-results (type: "group"), where:

```javascript
const fullName = escapeExpression(group.fullName);
const name = escapeExpression(group.name);
const groupNames = [h("span.name", fullName || name)];
```

`groupNames` could end up having value "undefined" if a group doesn't have a `fullName`.
2020-06-17 12:37:06 +02:00
Faizaan Gagan
d66ccabdb1
DEV: Added topic-list-after-title outlet in the mobile template (#10059) 2020-06-17 10:05:37 +01:00
Guo Xiang Tan
52580605d8 FIX: select-kit components not being hidden. 2020-06-17 09:39:51 +08:00
tshenry
a3e812453e
FEATURE: new category-list-above-each-category plugin outlet (#10037) 2020-06-16 11:53:36 -07:00
Jarek Radosz
df0e3b4ed4
FIX: Allow opening FAQ in a new tab (#10039) 2020-06-16 17:35:04 +02:00
Samuel Carvalho Santos
ce37561e10
UX: Improve revert label in post history modal (#10038) 2020-06-16 11:31:25 -04:00
spirobel
4b4f568ec0
add showPreview to composer fields plugin outlet (#10019)
showPreview is necessary because we need to add 50% width class similar to: class="title-and-category with-preview" on the category and title div if the preview is shown.
2020-06-16 10:50:55 -04:00
Dan Ungureanu
f1b97202d4
FIX: Ensure users can confirm new emails using security keys 2020-06-16 14:19:21 +03:00
Dan Ungureanu
84dfaad137
FIX: Fill acting_user field instead of target_user in history 2020-06-16 13:30:58 +03:00
Dan Ungureanu
219bb0b6a7
DEV: Fix build
Follow-up to 6258406419.
2020-06-16 13:00:09 +03:00
Krzysztof Kotlarek
6258406419
FIX: secondary_emails, unconfirmed_emails, group_users are private fields
Those fields should be only visible to the user.
2020-06-16 12:46:27 +03:00
David Taylor
a2f80670e1
FIX: Do not count youtube thumbnail when counting post images (#10049) 2020-06-15 20:25:30 +01:00
Penar Musaraj
298393a5bc
FIX: Keep onebox styling in edit history 2020-06-15 15:23:14 -04:00
Arpit Jalan
a94387c088 FIX: check for inviter group permissions at the time of redeeming invite 2020-06-15 14:44:35 +05:30
Guo Xiang Tan
402b80f306
DEV: Make rails_failover compatible with SKIP_DB_AND_REDIS env. 2020-06-15 16:23:24 +08:00
Guo Xiang Tan
58e52c0e4f
DEV: Use rails_failover gem for ActiveRecord and Redis failover handling 2020-06-15 15:47:07 +08:00
Arpit Jalan
6780d4d70c FIX: process /invites/ route from server side only 2020-06-15 12:31:27 +05:30
Guo Xiang Tan
d8cd912769
DEV: Switch to db config to disable advisory locks. 2020-06-15 14:33:41 +08:00
Martin Brennan
35a157619a
FEATURE: Add "Now" as an option (default hidden) to the future date input selector (#10047)
Sometimes you need to schedule things from now onward. "Now" in this case is now + 1 minute. this option is hidden by default.
2020-06-15 14:06:03 +10:00
Kris
7429512ced FIX: Get correct right/left offset for topic progress bar on compose 2020-06-12 18:44:42 -04:00
Kris
16b41aa485 Save button alignment fixes for admin badge page 2020-06-12 17:15:59 -04:00
Kris
2adad96d05 Center align items in select kit headers 2020-06-12 17:07:50 -04:00
Kris
d0a7f15764 Usercard buttons on mobile should utilize full width 2020-06-12 16:24:25 -04:00
Bianca Nenciu
ff6811ceb8
Allow multiple groups which can vote when creating a poll (#10015)
* FEATURE: Allow multiple groups which can vote when creating a poll

* DEV: Fix select-kit deprecations

* DEV: Fix lint
2020-06-12 14:52:32 +03:00
Dan Ungureanu
111877db1f
FIX: Load I18n first in show_confirm_new_email page 2020-06-12 14:49:16 +03:00
Bianca Nenciu
60196cc192
FIX: Hide bootbox after a negative answer (#10028)
Starting to reply and then editing a post was not possible because of a
bootbox which kept showing up.
2020-06-12 13:48:45 +02:00
Sam Saffron
7211394e4d
FEATURE: include tags in unread/new messages
We need this information to maintain counts on tracked/watched
tags.
2020-06-12 16:20:30 +10:00
Penar Musaraj
f57ecf22e0
UX: Send background color to iPad app too
Previously, we were only updating mobile devices.
2020-06-11 23:20:25 -04:00
Guo Xiang Tan
2fbd4eb11f
DEV: Remove double query in Group#remove_review_group.
Probably a mistake during commit.
2020-06-12 10:14:45 +08:00
Guo Xiang Tan
62ad473716
FIX: Preload readonly mode attribute seperately.
There are two problems I'm trying to tackle here.

1. The site json is cached for anonymous users so readonly mode can be
cached for up to 30 minutes which makes it confusing.

2. We've already checked for readonly mode in the controller so having
to check for readonly mode again in `SiteSerializer` is adding an extra
Redis query on every request.
2020-06-12 09:54:05 +08:00
Dan Ungureanu
b7e70850e4
FIX: Allow users to add emails which were deleted before 2020-06-11 14:54:11 +03:00
Bianca Nenciu
dd85d44dda
FIX: Show tag count for existing tags (#9892)
* FIX: Show tag count for existing tags

* Add test
2020-06-11 14:13:48 +03:00
Joffrey JAFFEUX
6fa990f05d
FIX: prevents emoji in links to appear as large emojis (#10027) 2020-06-11 12:27:48 +02:00
Sam Saffron
a26b490047
FIX: present correct new/unread counts when filtered by tag
Previously we would incorrectly ignore tags.

This ensures tracking state is properly shipped to client if
show_filter_by_tag is enabled.
2020-06-11 16:47:57 +10:00
Mark VanLandingham
b8acb36532
DEV: Plugin outlet at top of user preference interface (#10020) 2020-06-10 13:36:50 -05:00
Blake Erickson
1ce6ff0a55 DEV: Include raw in post webhook serializer
This came in as a request on meta to include the raw field in the post
webhook serializer.

 https://meta.discourse.org/t/-/49045/55?u=blake

 Including this field can prevent needing to make a 2nd API request to
 get the raw field of a post.

 It would be handy down the road if we updated the webhook ui to specify
 fields or arguments that you wanted to be included in the serialized
 data, but most requests I've seen to update the serializers have been
 valid requests that are good to add anyways, so I don't think we have
 reached that point yet.
2020-06-10 11:56:39 -06:00
Dan Ungureanu
5bfe1ee4f1
FEATURE: Improve UX support for multiple email addresses (#9691) 2020-06-10 19:11:49 +03:00
Dan Ungureanu
3a7ca97c36
FIX: Use include-subcategories filter in report export (#10007)
Some filters were renamed and the conversion of the filter names and arguments
was removed.
2020-06-10 18:57:39 +03:00
Joffrey JAFFEUX
8fe074430b
REVERT: partly revert change to ensure context is the same (#10012) 2020-06-10 11:10:39 +02:00
Guo Xiang Tan
31a527a293
FIX: Return 400 when invalid topic_id is provided when creating invite. 2020-06-10 09:29:28 +08:00
Guo Xiang Tan
45fd668dc5
DEV: Render a proper response that can be handled on the client side. 2020-06-10 09:25:58 +08:00
Krzysztof Kotlarek
f993d8a197
FIX: flaky post_alerter_spec.rb because of missing order (#10000) 2020-06-10 08:28:54 +10:00
David Taylor
9e98c02dd7
FIX: Don't call cooked decorators in composer if cooked is unchanged
If cooked is unchanged, ember will not re-render the preview area, so we should not re-run the post-processing decorators. This can cause issues when decorateCooked functions are not idempotent.
2020-06-09 23:01:07 +01:00
Vinoth Kannan
f67e7d2fad FIX: add attributes of params to topic findOpts.
If `params` is ignored then `findTopicList` won't get the `no_subcategories` attribute.

d27b877a40
2020-06-10 01:33:58 +05:30
Joffrey JAFFEUX
43e17f92e0
DEV: allows to call a widget function without re-rendering the widget (#10004) 2020-06-09 19:58:17 +02:00
Joffrey JAFFEUX
84d767716f
linting (#10008) 2020-06-09 19:54:06 +02:00
David Taylor
ae6c4cd237
FIX: Allow merging users when email domains are restricted 2020-06-09 18:51:59 +01:00
Joffrey JAFFEUX
a3cf1cf6ff
DEV: allows to prepend widgets to post nav controls (#10005)
Co-authored-by: Régis Hanol <regis@hanol.fr>
2020-06-09 19:37:06 +02:00
Joffrey JAFFEUX
23ed16339f
DEV: adds mouse{Over,Out} and touch{Start,End} to widgets (#10003) 2020-06-09 19:36:28 +02:00
Joe
415c1bb9e1 FIX: don't show create topic suggestion to users who can't
Users with TL below the "min trust to create topic" setting used to see a prompt to create new topics in the footer message below the topic list. Those topics would never be submitted because those users don't meet the TL requirements to create a new topic (based on that site setting). This PR removes that prompt for those users.
2020-06-10 00:02:11 +08:00
Arpit Jalan
3094459cd9
FEATURE: multiple use invite links (#9813) 2020-06-09 20:49:32 +05:30
David Taylor
f1fc6cd40d
DEV: Add user-card-additional-buttons plugin outlet
The user-card-additional-controls outlet is outside the `<li>` element, which makes styling difficult. Placing an outlet inside the button list means that themes/plugins can easily reuse core styling.
2020-06-09 14:33:24 +01:00
Guo Xiang Tan
edc940ce3e
DEV: Fix incorrect messagebus redis config for rails_failover. 2020-06-09 17:05:14 +08:00
Sam Saffron
08044b4f94
FIX: emoji autocomplete triggering incorrectly
Previous to this fix the we were checking for non letters.

This was mismatching what pretty-text/addon/emoji.js was doing.

`ù:su`

and

`1:su`

Would lead to an emoji autocomplete popup in the composer.
2020-06-09 17:22:51 +10:00
Martin Brennan
3e210b76d9 FIX: Change bookmark name "name" attr to disable autocomplete 2020-06-09 14:47:30 +10:00
Kris
d09bf892c7 UX: Improve layout of topic pin admin modal 2020-06-08 23:58:53 -04:00
Penar Musaraj
c5b1f028ed
FIX: update minimum required tag when switching categories in composer 2020-06-08 17:10:26 -04:00
Kris
fbeaba4acf FIX: don't override category text color in dropdown 2020-06-08 16:45:30 -04:00
Penar Musaraj
bdba17cdf7
FIX: Restore stream position in safari (#9993)
Safari uses an aggressive back/forward cache, which means the app loads
very quickly when hitting Back. But, in topics with > 30 posts, hitting
Back runs post stream calculations too early, which means that users
get taken back to an earlier point in the stream, consistently.

Using `onpageshow`, we can restore the correct location before the post
stream calculations take place.
2020-06-08 10:13:46 -04:00
Bianca Nenciu
052c91770f
FIX: Reply notifications should not appear as edited (#9965) 2020-06-08 15:23:33 +02:00
Joffrey JAFFEUX
cb13152a43
FIX: ensures edit-category-setting is correctly casting boolean (#9999) 2020-06-08 15:16:42 +02:00
David Taylor
833b5d89e0
PERF: Cache PrettyText instance for rendering composer preview (#9987)
Previously we were building pretty-text from scratch on every keypress
2020-06-08 10:42:59 +01:00
Gerhard Schlager
0bf753a739 DEV: Remove unused routes 2020-06-08 10:26:29 +02:00
Gerhard Schlager
8c6a42c589 FIX: Redirects containing Unicode usernames didn't work 2020-06-08 10:26:29 +02:00
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
tshenry
c01a994263
DEV: Better error handling for destroy:users task (#9939) 2020-06-01 08:55:08 -07:00
Jarek Radosz
e19d907f0f
FIX: Correct the misalignment of popover arrows (#9947)
* Fixes position of the top arrow, and border width of both
* Merged top and transform properties
* .5px values are required to make arrow border appear the same with as overall popover border width

I did have a chance to try it out on a Windows machine with a non-high DPI display and there were no issues. And I just re-tested it with Firefox on macOS using the "Open in Low Resolution" option and it looked more or less ok (bearing in mind that it the whole app is then a blurry mess, and that using custom zoom levels causes the arrow to break slightly, but that was also the case on Firefox before this change)
2020-06-01 16:31:53 +02:00
Penar Musaraj
c2abf88a61
UX: Adjustments to topic admin menu on mobile (#9945) 2020-06-01 09:39:38 -04:00
Jarek Radosz
921751f128
UX: Remove box-shadow from kbd, unify styling (#9948)
Having many elements with multiple box-shadows (e.g. in keyboard shortcuts modal) was tanking scrolling performance in some browsers.
2020-06-01 15:00:56 +02:00
Jarek Radosz
ef8e44af73 FIX: Don't change the button height when spinner appears
on the exception page.
2020-06-01 14:15:41 +02:00
Joffrey JAFFEUX
57e587f39f
DEV: removes dead code of dropdown-menu (#9942) 2020-06-01 11:22:35 +02:00
Jarek Radosz
6ed3dbef03
UX: Fix border radius artifacts on dashboard pills (#9949) 2020-06-01 11:21:07 +02:00
Joffrey JAFFEUX
40c4a8e3fc
DEV: skips/tweaks brittle tests (#9952) 2020-06-01 11:09:34 +02:00
Sam Saffron
82de9c5308
DEV: add countTags to topic tracking state
This introduces a new core API to get counts per tag from topic
tracking state

This API will only be useful if a plugin enable tags in topic
tracking state using

`TopicTrackingState.include_tags_in_report = true`
2020-06-01 17:05:24 +10:00
Jarek Radosz
00aab49829
FIX: Restore the ability to rebake posts in deleted topics (#9951)
Lost in #9852
2020-06-01 07:04:16 +02:00
Jarek Radosz
9ee77eae98 FIX: z helper doesn't resolve inside calc
It resulted in invalid `z-index: calc(z("tooltip") - 100)` in the output CSS. `calc` wasn't necessary here anyway since both operands are constant.
2020-06-01 05:50:50 +02:00
Jarek Radosz
7bcee784c8 DEV: Remove an obsolete comment
Its first part was removed with other changes and this one got displaced after a `prettier` pass.
2020-06-01 05:50:49 +02:00
Jarek Radosz
754a255ef7 UX: Remove the period after "Enable Notifications" button 2020-06-01 05:50:49 +02:00
Jarek Radosz
7ac9a79ecb UX: Fix inputs alignment in admin/customize/colors 2020-06-01 05:50:49 +02:00
Krzysztof Kotlarek
9a6ef80739
FEATURE: notify admins about old credentials (#9918)
* FEATURE: notify admins about old credentials

Security and API keys should be renewed periodically.
This additional notification should help admins keep their Discourse safe and secure.
2020-06-01 13:49:27 +10:00
Penar Musaraj
f2647f1f36
UX: Position topic admin menu next to wrench (#9932) 2020-05-30 15:32:57 -04:00
Vinoth Kannan
e1af91f5ae Revert "FEATURE: category setting for default list filter."
This reverts commit 6f03d14c23.
2020-05-30 20:53:53 +05:30
Joffrey JAFFEUX
93bd1ff228
FIX: topic-admin-popup-menu was overflowing on small screens (#9944) 2020-05-30 10:53:08 +02:00
Kris
530c6594cb follow-up fix due to adding overflow hidden in 32e40ea 2020-05-29 22:23:23 -04:00
Kris
3c11c5dcdc show-replies styles were lost with some menu changes 2020-05-29 22:05:58 -04:00
Kris
32e40ea133 UX: Make the menu links header within the user panel more flexible 2020-05-29 21:02:26 -04:00
Joffrey JAFFEUX
8f59f155fb
UI: makes topic count less visible in category drop (#9938) 2020-05-30 00:32:20 +02:00
Joffrey JAFFEUX
c5ccf5f93c
UI: removes font-weight: bold from category-drop names (#9937) 2020-05-30 00:06:35 +02:00
Joffrey JAFFEUX
03c3448b15
UX: better alignment of icons in notifications menu (#9934) 2020-05-29 22:48:47 +02:00
Joe
7a76f3c295 UX: Relocate before-topic-list outlet so it shows up on Top as well 2020-05-30 03:31:28 +08:00
Joe
8e6d95a309
DEV: adds a few plugin outlets required for themes (#9929) 2020-05-30 03:04:12 +08:00
Joffrey JAFFEUX
931bfca454
DEV: allows categories-admin-dropdown to have custom items (#9931)
Usage:

```
modifySelectKit("categories-admin-dropdown").appendContent(function() {
  return {
    id: "foo",
    name: I18n.t("foo"),
    description: I18n.t("foo_description"),
    icon: "gear",
    onChange: () => alert("Foo.")
  };
});
```
2020-05-29 21:01:19 +02:00
Robin Ward
2b2434b82d
Start Discourse in an initializer (#9930)
* DEV: To be pedantic, there is more than EMBER in there now

* DEV: Use less globals. Have `Discourse` start in an initializer

* DEV: Remove another global
2020-05-29 14:37:02 -04:00
David Taylor
ecfce93f28
FIX: Support IRIs (unicode URIs) when pulling hotlinked images (#9928) 2020-05-29 17:47:05 +01:00
Robin Ward
3fe5eacd1b DEV: Abstract Ember.testing so our application code doesn't use it 2020-05-29 12:16:58 -04:00
Robin Ward
e5cd331fb3 DEV: Why use a whole object when a functionw will do? 2020-05-29 11:56:45 -04:00
Mark VanLandingham
94cb5ab172
DEV: Remove unused variable topic_tracking_state (#9915) 2020-05-29 09:47:25 -05:00
David Taylor
28f46c171c
FIX: Pull hotlinked images even when edited by system users (#9890)
Previously the pull hotlinked images job was skipped after system edits. This ensured that we never had an infinite loop of system-edit/pull-hotlinked/system-edit/pull-hotlinked etc.

A side effect was that edits made by system for any other reason (e.g. API, removing full quotes) would prevent pulling hotlinked images. This commit removes the system edit check, and replaces it with another method to avoid an infinite job scheduling loop.
2020-05-29 13:07:47 +01:00
David Taylor
d29d69e10d
FIX: Invalidate database theme cache when hostname changes (#9908)
Hostname can vary per-site on a multisite cluster, so this change requires converting the compiler_version from a constant into a class method which is evaluated at runtime. The value is stored in the theme DistributedCache, so performance impact should be negligible.
2020-05-29 13:04:51 +01:00
Joffrey JAFFEUX
5d792483f0
UI: various select-kit dropdown tweaks/cleaning (#9922) 2020-05-29 11:11:28 +02:00
Guo Xiang Tan
81de592804
PERF: Use more efficient query when checking for existence. 2020-05-29 15:47:05 +08:00
Joffrey JAFFEUX
d7d5bb4454
UX: homogenises sk row padding and topic-admin-menu (#9920) 2020-05-29 09:35:43 +02:00
Joffrey JAFFEUX
4be45bec7e
UI: homogenise topic-footer-mobile-dropdown styles (#9919) 2020-05-29 08:34:19 +02:00
Joffrey JAFFEUX
31d1468922
UX: reworks various menus to homogenize them (#9905)
- bookmark modal menu
- topic-footer-mobile-dropdown
- post-admin-menu
- topic-admin-menu
- quick-access menus
- toolbar-popup-menu
2020-05-29 08:05:21 +02:00
Vinoth Kannan
ef5320dd47 FIX: don't rerender whole users page while typing on input. 2020-05-29 09:06:26 +05:30
Sam Saffron
2acec4370b
FIX: muted tags removed topics with no tags from counts
We previously did not account for completely untagged topics when
looking at muted tags, this caused new/unread counts to be off if

1. You had muted tags
2. You had an unread/new topic
3. This topic had no tags
2020-05-29 12:59:47 +10:00
Sam Saffron
136835370c
FEATURE: optionally allow tags in topic tracking state
This feature allows certain plugins to output tag information
to topic tracking state, this allows per tag stats which can be
used by sidebars and other plugins that need per tag stats

Not enabled by default cause this would add cost to a critical
query
2020-05-29 12:59:47 +10:00
Kris
c7d75bc3a0 Minor adjustment to menu-links-header spacing to avoid some wrapping 2020-05-28 18:40:22 -04:00
Vinoth Kannan
ce1491e830
UX: remove in:unpinned filter from advanced search page. (#9911) 2020-05-29 00:47:28 +05:30
Andrew Schleifer
74d28a43d1
new S3 backup layout (#9830)
* DEV: new S3 backup layout

Currently, with $S3_BACKUP_BUCKET of "bucket/backups", multisite backups
end up in "bucket/backups/backups/dbname/" and single-site will be in
"bucket/backups/".

Both _should_ be in "bucket/backups/dbname/"

- remove MULTISITE_PREFIX,
- always include dbname,
- method to move to the new prefix
- job to call the method

* SPEC: add tests for `VacateLegacyPrefixBackups` onceoff job.

Co-authored-by: Vinoth Kannan <vinothkannan@vinkas.com>
2020-05-29 00:28:23 +05:30
Jeff Wong
1509afefba DEV: simplify detailed_404 logic 2020-05-28 10:54:02 -07:00
Penar Musaraj
a98182debf
UX: Fix activity column display in wizard homepage step
Followup to f8f281cdad, thanks @jjafeux
2020-05-28 11:24:24 -04:00
Roman Rizzi
a41476800b
FIX: Don't raise an exception if a topic cannot be retrieved (#9906) 2020-05-28 11:59:20 -03:00
Robin Ward
2033c3ec9c Revert "Revert "DEV: Import MessageBus from message-bus-client instead of globals""
This reverts commit b10e995d9d.
2020-05-28 08:42:36 -04:00
David Taylor
8a3d9d7036
DEV: Run jobs sequentially in test mode (#9897)
When running jobs in tests, we use `Jobs.run_immediately!`. This means that jobs are run synchronously when they are enqueued. Jobs sometimes enqueue other jobs, which are also executed synchronously. This means that the outermost job will block until the inner jobs have finished executing. In some cases (e.g. process_post with hotlinked images) this can lead to a deadlock.

This commit changes the behavior slightly. Now we will never run jobs inside other jobs. Instead, we will queue them up and run them sequentially in the order they were enqueued. As a whole, they are still executed synchronously. Consider the example

```ruby
class Jobs::InnerJob < Jobs::Base
  def execute(args)
    puts "Running inner job"
  end
end

class Jobs::OuterJob < Jobs::Base
  def execute(args)
    puts "Starting outer job"
    Jobs.enqueue(:inner_job)
    puts "Finished outer job"
  end
end

Jobs.enqueue(:outer_job)
puts "All jobs complete"
```

The old behavior would result in:

```
Starting outer job
Running inner job
Finished outer job
All jobs complete
```

The new behavior will result in:
```
Starting outer job
Finished outer job
Running inner job
All jobs complete
```
2020-05-28 12:52:27 +01:00
Guo Xiang Tan
8c86a109bb
DEV: Add ENV flag to test out ActiveRecord::Failover. 2020-05-28 16:24:22 +08:00
Joffrey JAFFEUX
0854785175
FIX: allows to define label/title properties for display instead of name
Usage:

```
const content = [{foo: "FOO", bar: "BAR", value: 1, name: "foo-bar"}];

{{combo-box
  content=content
  value=value
  labelProperty="foo"
  titleProperty="bar"
}}
```
2020-05-28 08:30:31 +02:00
Sam Saffron
ecc8e559ec
UX: remove edit PM button
Edit PM button leads to confusion and is uneeded
2020-05-28 15:15:27 +10:00
Kris
b9d9bbb95f UX: More consistent alignment of topic timer's selected datetimes 2020-05-27 22:19:00 -04:00
Sam Saffron
9841569bba
Revert "DEV: Fix a deprecated ember import (#9903)"
This reverts commit 75f46ca632.

This unfortunately breaks

`RAILS_ENV=production bin/rake assets:precompile`

I don't think discourse-loader.js is transpiled
2020-05-28 10:06:05 +10:00
Blake Erickson
b10e995d9d Revert "DEV: Import MessageBus from message-bus-client instead of globals"
This reverts commit 9dddbcc00d.
2020-05-27 16:14:09 -06:00
Blake Erickson
6548cd1a96 FIX: sending messages to groups with non-lowercase names
Fixes a regression in

e8fb9d4066

which caused a bug where you couldn't send a message to a group that
contained an Uppercase letter. Added a test case for this.

Bug report: https://meta.discourse.org/t/-/152999
2020-05-27 14:52:08 -06:00
Jarek Radosz
75f46ca632
DEV: Fix a deprecated ember import (#9903)
See the following for `Ember.testing` and `@ember/debug isTesting`:

* 8cf29959f7/packages/ember/index.js (L372-L376)
* 8cf29959f7/packages/%40ember/debug/lib/testing.ts
2020-05-27 22:47:46 +02:00
Robin Ward
9dddbcc00d DEV: Import MessageBus from message-bus-client instead of globals 2020-05-27 16:42:42 -04:00
Robin Ward
0f71d38d3a Revert "DEV: Import MessageBus from message-bus-client instead of globals (#9902)"
This reverts commit d3bd482142.
2020-05-27 16:34:30 -04:00
Robin Ward
d3bd482142
DEV: Import MessageBus from message-bus-client instead of globals (#9902) 2020-05-27 15:56:46 -04:00
Blake Erickson
a788427b46
FIX: broken query if upload id is missing (#9900)
Log warnings if there are any errors trying to upload group flair image
and ensure upload.id exists before trying to use it in a sql query.
2020-05-27 12:39:30 -06:00
Jeff Wong
a9d92f338e
SECURITY: make find topic by slug adhere to SiteSetting.detailed_404 (#9898) 2020-05-27 11:28:38 -07:00
Joffrey JAFFEUX
77801aa9be
FIX: allows to have custom emoji translation without static file (#9893) 2020-05-27 20:11:52 +02:00
Roman Rizzi
207b72ade1
UX: Don't show the suspension date if the user is permantently suspended. (#9895)
Use the same pattern used in user.hbs
2020-05-27 14:50:17 -03:00
Dan Ungureanu
570b12a903
FEATURE: Show a detailed 404 page for private topics (#9894) 2020-05-27 20:10:01 +03:00
Penar Musaraj
7bc496070f UX: Keep focus on input after selecting an autocomplete option
This is particularly helpful on mobile, now tapping on an item from
the autocomplete dropdown keeps the keyboard visible.
2020-05-27 12:45:03 -04:00
Arpit Jalan
68fdfd76f5 fix the build 2020-05-27 22:06:45 +05:30
Arpit Jalan
8d2908dd9e UX: do not show redundant user count
UX: add spacing between +member_count and "more"
2020-05-27 21:53:59 +05:30
Artem Vasiliev
12544c02c1
FIX: add X-Robots-Tag header for check_xhr-covered GET actions, too (#9868)
* FIX: add X-Robots-Tag header for check_xhr-covered GET actions, too

see https://meta.discourse.org/t/missing-x-robots-tag/152593/3 for context

* test: a spec making sure X-Robots-Tag header is present when needed

/groups path responds to anonymous requests and doesn't skip `check_xhr` method, so we can use it here.
2020-05-27 11:57:05 -04:00
Roman Rizzi
461df7d050
UX: Rename Priority to score for sorting. (#9846) 2020-05-27 12:50:28 -03:00
Blake Erickson
da839e6d26 SECURITY: Use FinalDestination for topic embeds 2020-05-27 09:26:09 -06:00
Régis Hanol
2a4db15544 FIX: don't send digests to users with no primary email
It might happen that some User records have no associated primary emails.
In which case we don't ever want to send them a digest.

Also added a new "user_email_no_email" skipped email log to ensure these cases
are properly handled and surfaced.
2020-05-27 17:09:40 +02:00
Arpit Jalan
2152e70e0d DEV: annotate models 2020-05-27 19:05:24 +05:30
Joffrey JAFFEUX
f51093dde7
FIX: correctly set values and defaults for group-form-interaction-fields (#9891) 2020-05-27 12:10:27 +02:00
Joffrey JAFFEUX
1d685c22af
REVERT: removes translate_emoji (#9889)
This API is actually used in some plugins.
2020-05-27 12:08:24 +02:00
Sam Saffron
1cf2d1f9f2
FIX: when destroying a draft always ensure saving is done
There was a race condition where drafts could be either saving
or queued to be saved and a user canceled draft leading to destroying
it.

This cancels debounce save and waits for save in the pipeline to
be over prior to firing off a DELETE on the draft
2020-05-27 18:46:19 +10:00
Sam Saffron
f41fcad6c3
FIX: opening cancel draft dialog broke autosave
cancelComposer would leak a promise that never got resolved if
you aborted cancelling a composer.

This change ensured the promise will always be resolved
2020-05-27 18:16:48 +10:00
Sam Saffron
5bfb6830c9
SECURITY: missing security check prior to redirect
In some rare cases, if a user knows the exact title of a topic
they could possibly determine that it really exists in the system
2020-05-27 10:58:22 +10:00
Martin Brennan
2d534bf2e0
FIX: Pass current_user to TopicQuery in for categories_and_top_topics (#9885) 2020-05-27 10:05:06 +10:00
Krzysztof Kotlarek
34e5f0a9a3
Revert "FEATURE: notify admins about old credentials (#9854)" (#9886)
This reverts commit 349a67bee6.
2020-05-27 09:52:53 +10:00
Kris
66ec634cb3 Composer whisper icon missing margin when editing replies 2020-05-26 19:17:09 -04:00
Jordan Vidrine
5f61deff80
FIX: updates variables for HTML to use em instead of px in font-size (#9883) 2020-05-26 17:48:35 -05:00
Krzysztof Kotlarek
349a67bee6
FEATURE: notify admins about old credentials (#9854)
* FEATURE: notify admins about old credentials

Security and API keys should be renewed periodically.
This additional notification should help admins keep their Discourse safe and secure.
2020-05-27 08:13:47 +10:00
Neil Lalonde
2c880b9bf9
FIX: wizard fails to start when default_theme_id is -1 2020-05-26 16:08:35 -04:00
Penar Musaraj
b1c726be0d
Remove support for FontAwesome 4.7 icon names (#9871) 2020-05-26 14:53:32 -04:00
Mark VanLandingham
7820686f73
FIX: Wizard previews if color step is excluded (#9881) 2020-05-26 12:56:36 -05:00
Joffrey JAFFEUX
675e9b81c6
FIX: document.activeElement can be null on IE11 (#9880) 2020-05-26 16:51:55 +02:00
Guo Xiang Tan
26c7fa2c29
FIX: rescue_from doesn't bubble up.
See a47e0c19e6/actionpack/lib/action_controller/metal/rescue.rb (L25)
2020-05-26 22:43:29 +08:00
Joffrey JAFFEUX
253a185769
FIX: makes focust text area after complete more resilient (#9879) 2020-05-26 16:27:02 +02:00
Bianca Nenciu
f47400475e
FEATURE: Send a private message when a group membership is accepted (#9822)
* FEATURE: Send a private message when a group membership is accepted

* DEV: Small code improvements

* FIX: Send PM as group owner

* Copy edits
2020-05-26 16:28:03 +03:00
Sam Saffron
76c4bc925d
DEV: followup to prev commit
337bd9a0f7 did not account for optimized image being nil
2020-05-26 16:19:05 +10:00
Sam Saffron
337bd9a0f7
FIX: concurrency bug when creating topic thumbnails
We were failing erratically when backfilling topic thumbnails.

This ensures that racing threads/processes will not conflict.
2020-05-26 16:10:22 +10:00
Osama Sayegh
2211581a85
FIX: Don't responde with error 500 if domain is invalid when adding automatic membership domain (#9655) 2020-05-26 15:40:09 +10:00
Arpit Jalan
5462fe9462
FIX: do not allow tag with name 'none' (#9867)
https://meta.discourse.org/t/none-tag-is-uneditable/152003
2020-05-26 08:15:45 +05:30
Guo Xiang Tan
878f06f1fe DEV: Remove custom connection reaper.
Rails 6 fixed the reaper to use one thread to reap all the connection pools.
2020-05-26 09:09:46 +08:00
Sam Saffron
fc97f7e0e7
FIX: properly ban non human users from draft system
Previously we had a partial fix in place where non human users
were not allowed draft sequences, this left edges around where non
human users asked for drafts yet had none.

For example system could already have a few drafts in place.

This also removes and extensibility point we added that is not in use
2020-05-26 10:07:09 +10:00
Joffrey JAFFEUX
d9f915b195
FIX: documentation was using incorrect function (#9876) 2020-05-25 21:55:30 +02:00
Joffrey JAFFEUX
be16205118
DEV: plugin api should have been bumped for #8825395 (#9874) 2020-05-25 21:44:15 +02:00
Vinoth Kannan
5fb9271878
DEV: ignore flair_url column in group model. (#9873) 2020-05-26 00:43:50 +05:30
Joffrey JAFFEUX
8825395bdc
DEV: allows to decorate username selector (#9869)
Usage:

```
api.addUsernameSelectorDecorator(username => {
  return iconHTML("calendar-alt");
});
```
2020-05-25 19:09:55 +02:00
Robin Ward
fd2d7ca992 FIX: Email Styles were evaluated out of order
`yield` puts the content in the template right away unless explicitly
`capture`'d.
2020-05-25 12:47:23 -04:00
Arpit Jalan
e8fb9d4066 FIX: when creating new PM username/groupname should be case-insensitive
(take 2)

https://meta.discourse.org/t/case-sensitivity-in-links-to-groupname/147596
https://meta.discourse.org/t/remove-case-sensitive-in-adding-users-to-a-message/151275
2020-05-25 21:34:05 +05:30
Arpit Jalan
302b37c805 Revert "FIX: when creating new PM username/groupname should be case-insensitive"
This reverts commit 2be79d94f5.

This is affecting multiple code path. Investigating.
2020-05-25 20:10:14 +05:30
Arpit Jalan
2be79d94f5 FIX: when creating new PM username/groupname should be case-insensitive
https://meta.discourse.org/t/case-sensitivity-in-links-to-groupname/147596
https://meta.discourse.org/t/remove-case-sensitive-in-adding-users-to-a-message/151275
2020-05-25 19:04:59 +05:30
Gerhard Schlager
631024ae5d FEATURE: Permalinks for tags 2020-05-25 14:51:01 +02:00
Sam Saffron
48fb354bce
PERF: avoid traversing DOM in loadScript
Once a script is loaded operation should be very fast.

This optimisation avoids a DOM traverse and call to getURL on
every invocation.
2020-05-25 18:19:59 +10:00
Vinoth Kannan
505122bb45 FIX: skip onceoff job for groups with invalid flair URL. 2020-05-25 13:11:00 +05:30
Sam Saffron
c011b817b2
FIX: do not fallback to flair_url column
flair_url is not loaded by our query anymore so avoid falling back
to the old value
2020-05-25 16:25:42 +10:00
Vinoth Kannan
47c6fe9bfa Merge branch 'master' of github.com:discourse/discourse 2020-05-25 11:36:18 +05:30
Bianca Nenciu
e31adef32d
FIX: Keep composer title and reply when switching to PM (#9851) 2020-05-25 15:46:02 +10:00
Vinoth Kannan
8e56197728
UX: use "icon-picker" & "image-uploader" fields to set group flair. (#9779) 2020-05-25 11:08:47 +05:30
Gerhard Schlager
13d5ccedf5 FIX: Destroying a user failed when it had title
...because updating the user caused a validation of the primary email and the UserEmail records are already deleted at that time.
2020-05-24 22:14:50 +02:00
Vinoth Kannan
6f03d14c23 FEATURE: category setting for default list filter. 2020-05-25 00:04:06 +05:30
Vinoth Kannan
058bf56b4c FIX: group card not showing if user can't see its members. 2020-05-24 23:08:51 +05:30
Vinoth Kannan
60a3110113 FIX: call getURL method explicitly to prevent this context override. 2020-05-24 21:58:03 +05:30
Michael Brown
d9a02d1336
Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse""
This reverts commit 20780a1eee.

* 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
Jeff Atwood
20780a1eee Revert "Merge branch 'master' of https://github.com/discourse/discourse"
This reverts commit e62a85cf6f, reversing
changes made to 2660c2e21d.
2020-05-22 20:25:56 -07:00
Blake Erickson
03d26cd6f0 SECURITY: ensure embed_url contains valid http(s) uri 2020-05-22 14:54:56 -06:00
Jordan Vidrine
bf8085e436
FIX: Double Button Alignment Mobile (#9862) 2020-05-22 13:33:29 -05:00
Joffrey JAFFEUX
06e1d430c1
FIX: better cross browser topic footer buttons alignment (#9860) 2020-05-22 17:03:22 +02:00
Roman Rizzi
671f882fa3
FIX: We don't create a Post object if the queued post gets rejected. We need to count review items directly. (#9856) 2020-05-22 11:50:28 -03:00
Mark VanLandingham
f9649c92b5
FIX: Live reloading of css in development (#9859) 2020-05-22 16:37:35 +02:00
Joffrey JAFFEUX
793085c703
REFACTOR: slightly cleaner topic admin button css (#9858) 2020-05-22 15:23:17 +02:00
Joffrey JAFFEUX
e71f5e8951
UI: apply margin only if the menu has content (#9857) 2020-05-22 15:19:55 +02:00
Martin Brennan
f9d55b4941
FEATURE: Update the topic excerpt when the OP is rebaked (#9852)
* We now have a site setting "topic_excerpt_maxlength" that is used when the OP is created or revised to generate a topic excerpt.
* However, posts created before this setting was introduced cannot benefit from this change unless they are revised, and if the topic excerpt length setting is changed that situation is also not covererd.
* This PR makes a change to rebake! to update the topic excerpt IF the post is the OP.
2020-05-22 13:04:15 +10:00
Martin Brennan
c0779df99d
FIX: Remove access control post FK from uploads (#9853) 2020-05-22 11:20:25 +10:00
Robin Ward
d11c462104 SECURITY: ERB execution in custom Email Style 2020-05-21 14:48:30 -04:00
Neil Lalonde
5a71c51ddd
FIX: tag input says tags are optional when they're required 2020-05-21 12:40:33 -04:00
Mark VanLandingham
1a5bcf2a64
UX: Remove live theme previewing in favor of refresh (#9798) 2020-05-21 08:32:50 -05:00
Joffrey JAFFEUX
66960563ea
FIX: ensures category chooser is case insensitive (#9850) 2020-05-21 11:16:44 +02:00
Joffrey JAFFEUX
7b6fbe9af2
FIX: adds missing tags to published page header (#9835) 2020-05-21 11:04:23 +02:00
Arpit Jalan
18959ff9da UX: user name instead username for profile link title 2020-05-21 14:02:12 +05:30
Arpit Jalan
3c9212fd88 UX: add title for user profile link 2020-05-21 13:00:05 +05:30
Martin Brennan
df68d11c38
FEATURE: Add topic excerpt max length site setting (#9847)
Adds a new topic_excerpt_maxlength site setting.

* When topic excerpt is requested for a post, use the new topic_excerpt_maxlength site setting to limit the size of the excerpt
* Remove code for getting/setting Post.excerpt_size as it is not used anywhere
2020-05-21 13:19:48 +10:00
Guo Xiang Tan
68db5deaec
FIX: Badge granter was disabled by default. 2020-05-21 06:55:22 +08:00
Kris
62ecb2885f glob @import desktop and mobile scss 2020-05-20 18:05:27 -04:00
Roman Rizzi
234933c781
FIX: Show staff counters if the rejected posts count is the only value to show (#9845) 2020-05-20 19:00:35 -03:00
Kris
eef47a26d9 UX: More consistent mobile banner/alert styles, css cleanup 2020-05-20 17:17:47 -04:00
Robin Ward
096eca0ee8 FIX: Requests were not being logged correctly
`enable` was defaulting to `nil` which is not what we wanted.
2020-05-20 15:09:17 -04:00
Robin Ward
ba04bb7552 FIX: Path should be addon not app 2020-05-20 12:13:15 -04:00
Robin Ward
3062036f2f FIX: Allow deprecation to work with Ember CLI 2020-05-20 12:05:56 -04:00
Régis Hanol
8851b79472 DEV: less code for Category#url 2020-05-20 18:01:06 +02:00
Robin Ward
09ca75d17e FIX: select-kit was in the wrong place
`app/` means we want to merge it into our application there. `addon`
means give it its own module namespace, which is what we wanted.
2020-05-20 11:51:49 -04:00
Jordan Vidrine
8e7efb48ae
FIX: Update default_template.html 2020-05-20 10:39:04 -05:00
Robin Ward
6c9c8dfefd FIX: guidFor is not part of Ember.Object 2020-05-20 11:31:11 -04:00
Mark VanLandingham
bd57ae83f1
DEV: Guardian for hiding about stats (#9841) 2020-05-20 10:26:20 -05:00
Joffrey JAFFEUX
30631a963f
UX: moves editFirstPost in taggable Pms in dropdown on mobile (#9840) 2020-05-20 14:07:00 +02:00
Bianca Nenciu
fb15da43da
Remove old web hooks in favor of 'reviewable' web hook (#9776)
* FIX: Emit web hooks for flags

* FEATURE: Remove 'flag' web hook in favor of 'reviewable' web hook

* FEATURE: Remove 'queued post' web hook in favor of 'reviewable' web hook

* FIX: Do not set a default value for web hooks with no events
2020-05-20 12:07:48 +03:00
Guo Xiang Tan
f7f436e536
DEV: Install rails_failover gem to test our Redis changes. 2020-05-20 15:40:27 +08:00
Sam Saffron
e97cb20c2a
UX: strip text from PM bookmark and share buttons
Also organize priorities in an easier to reason about way and
shift bookmark topic so it is after link. (consistent with posts)
2020-05-20 16:46:49 +10:00
Guo Xiang Tan
234cd5c3e7
FIX: Switch discobot to pull avatar from gravatar. 2020-05-20 10:20:08 +08:00
Sam Saffron
6b92c78033
FIX: purge all associated data on user delete
This commit reorganises the delete dependencies on users and make sure
all are covered. We forgot some on bookmarks, security keys, anon users
and so on.
2020-05-20 11:27:57 +10:00
Kris
a93d0a8fcc UX: Remove bold from category badge text 2020-05-19 21:11:49 -04:00
Roman Rizzi
52228b1fa6
DEV: These routes don't exist anymore (#9823) 2020-05-19 16:09:03 -03:00
Joffrey JAFFEUX
a239900522
UI: reduces category row description margin (#9834) 2020-05-19 20:44:54 +02:00
Joffrey JAFFEUX
05d8091bd3
DEV: adds triggerOnChangeOnTab option to select-kit (#9833)
Usage:

```
options=(hash triggerOnChangeOnTab=false)
```

This will prevent to select the row when pressing tab.
2020-05-19 20:39:29 +02:00
Joffrey JAFFEUX
ab6737c44a
UX: improves topic-notifications-button loading behavior (#9832) 2020-05-19 17:13:40 +02:00
Arpit Jalan
f038f8f154 FIX: description for 'uncategorized' category was blank 2020-05-19 18:45:43 +05:30
Joffrey JAFFEUX
7c3663ff73
UX: adds visual feedback when changing topic notifications level (#9831) 2020-05-19 13:27:57 +02:00
Dan Ungureanu
05ca0c908f
FIX: GroupArchivedMessage belongs to Group, not User 2020-05-19 14:13:28 +03:00
David Taylor
725e38f9d7
DEV: Allow plugins to request topic thumbnail sizes (#9828)
In plugin.rb, you can register new sizes like

```
register_topic_thumbnail_size [512, 512]
```

For more information about thumbnails see 03818e642a
2020-05-19 10:38:58 +01:00
Joffrey JAFFEUX
1647ba4624
FIX: applies flex on topic-footer-main-buttons (#9829) 2020-05-19 11:29:38 +02:00
Joffrey JAFFEUX
3623a395dc
UI: refinements to topic footer buttons (#9780) 2020-05-19 09:51:34 +02:00
Guo Xiang Tan
062cb1e1cb
UX: Remove caret from notifications-button. 2020-05-19 13:41:13 +08:00
Kris
864fb45ff0 Improve mobile friendliness of crawler view 2020-05-19 00:24:17 -04:00
Gerhard Schlager
6d5e9db883 FIX: Restoring backup didn't clear cached translation overrides 2020-05-18 18:51:51 +02:00
Gerhard Schlager
27c611b1d1 FIX: Reverting multiple translation overrides didn't clear cache 2020-05-18 18:51:29 +02:00
Joffrey JAFFEUX
cfad38184d
FIX: improves and fixes a regression with category-selector (#9821) 2020-05-18 17:44:47 +02:00
David Taylor
96848b7649
UX: Allow secure media URLs to be cached for a short period of time
Signed S3 URLs are valid for 15 seconds, so we can safely allow the browser to cache them for 10 seconds. This should help with large numbers of requests when composing a post with many images.
2020-05-18 15:00:41 +01:00
Joffrey JAFFEUX
1876b3cc4c
FIX: more resilient/consistent date-picker loading (#9817) 2020-05-18 15:29:24 +02:00
Joffrey JAFFEUX
48ed1b40cf
REFACTOR: ensures later is correctly canceled (#9796) 2020-05-18 14:20:23 +02:00
Joffrey JAFFEUX
9482ddff73
UX: show caret only in topic footer buttons dropdown select boxes (#9816) 2020-05-18 14:07:40 +02:00
David Taylor
f968155288
FIX: Ensure no image downloads during topic thumbnail serialization
If image uploads are missing a width/height, we re-download them to update the width/height in the database. However, this takes significant resources so we don't want to run this logic during topic serialization.
2020-05-18 12:04:29 +01:00
Joffrey JAFFEUX
918bd75909
FIX: allows to remove a topic timer with delete_replies as type (#9800) 2020-05-18 11:47:08 +02:00
Guo Xiang Tan
d01c336899
DEV: Clean up some Redis leaks in test env. 2020-05-18 17:27:37 +08:00
Joffrey JAFFEUX
320b21ab5b
UX: allows dropdown-select-box to display a caret (#9803)
```
selectKitOptions: {
  showCaret: true // default false
}
```
2020-05-18 10:50:33 +02:00
Joffrey JAFFEUX
e5dc843185
FIX: ensures hide is called when card is destroyed (#9814) 2020-05-18 10:10:40 +02:00
Joffrey JAFFEUX
e81a4048e3
REFACTOR: s/focusAfterOnchange/focusAfterOnChange (#9801) 2020-05-16 11:20:37 +02:00
Robin Ward
db8e872bda
DEV: Move select kit to an addon (#9797) 2020-05-15 16:07:35 -04:00
Alan Guo Xiang Tan
7f07c513a7
FIX: Switching composer action does not refresh composer actions content (#9791) 2020-05-15 13:54:44 -04:00
Robin Ward
6b04760572 FIX: Component was still used by data explorer 2020-05-15 13:52:03 -04:00
David Taylor
eee20a9814
FIX: Include plugin CSS assets when previewing themes 2020-05-15 18:12:53 +01:00
Joffrey JAFFEUX
7edd312f85
UX: focus category name when editing category (#9795) 2020-05-15 18:27:06 +02:00
Joffrey JAFFEUX
b07f1bfd93
FIX: displays a title on sk header if no selected name (#9794)
none has to be defined.
2020-05-15 17:36:00 +02:00
Justin DiRose
9810ca1dbd
UX: Add copied text upon copy button click (#9793) 2020-05-15 17:08:46 +02:00
Guo Xiang Tan
d1146ccb7b
Revert "FIX: Correct plugin api version bump."
This reverts commit 6a96c424b7.

False alarm. I was deploying on a docker image which was still on 0.9.0.
2020-05-15 21:22:44 +08:00
Guo Xiang Tan
6a96c424b7
FIX: Correct plugin api version bump.
It doesn't seem to be following semver.
2020-05-15 21:17:50 +08:00
David Taylor
461b4e5cc6
DEV: Add framework for filtered plugin registers (#9763)
* DEV: Add framework for filtered plugin registers

Plugins often need to add values to a list, and we need to filter those lists at runtime to ignore values from disabled plugins. This commit provides a re-usable way to do that, which should make it easier to add new registers in future, and also reduce repeated code.

Follow-up commits will migrate existing registers to use this new system

* DEV: Migrate user and group custom field APIs to plugin registry

This gives us a consistent system for checking plugin enabled state, so we are repeating less logic. API changes are backwards compatible
2020-05-15 14:04:38 +01:00
David Taylor
0495a748d0
FIX: Use CDN URLs for topic thumbnails 2020-05-15 13:35:20 +01:00
Guo Xiang Tan
162d125b83
Fix lint. 2020-05-15 20:23:17 +08:00
Guo Xiang Tan
dada1fc417
UX: Better composer-action icon when creating new topic. 2020-05-15 16:40:49 +08:00
Guo Xiang Tan
f9a9bd136b
FEATURE: Expose Composer.serializeToTopic in client side plugin api. 2020-05-15 16:16:58 +08:00
Sam Saffron
0cbaa8d813
FEATURE: extend duration allowed for download
Previously we would raise a warning in the logs if downloading
a file (from s3) takes longer than 60 seconds.

At scale this happens reasonably frequently.

1. Raised the duration to 3 minutes

2. Pulled the resizing mutex out of the downloading mutex
so we have less and clearer error logs
2020-05-15 12:45:47 +10:00
Guo Xiang Tan
165fa13c9d
FIX: Always return 0 for non-human user current DraftSequence. 2020-05-15 10:40:36 +08:00
Guo Xiang Tan
e37ea4a4a1
Revert "FIX: don't compute draft for bots on categories index route"
This reverts commit 1b7f23a1bc.
2020-05-15 10:40:35 +08:00
Blake Erickson
1a2b9435b0
DEV: Standardize table sorting verbiage (#9757)
* DEV: Standardize table sorting verbiage

This commit creates a common component that tables can use to make their
headers sortable. This commit also standardizes on using `desc` as the
default and passing in the `asc=true` flag to adjust the sorting
direction.

* Add deprecation warnings

Adds deprecation warnings if using previous params and maintains
backwards compatibility. Set the default sort value for group members to
be asc.

* switch group requests to use common table-header-toggle

* update fixture
2020-05-14 20:10:59 -06:00
Rafael dos Santos Silva
11cd149122
FIX: WebAPK minting was broken due to shortcut icons
SVG support is very flaky, but this way at least minting works again
2020-05-14 21:56:35 -03:00
Kane York
869f9b20a2
PERF: Dematerialize topic_reply_count (#9769)
* PERF: Dematerialize topic_reply_count

It's only ever used for trust level promotions that run daily, or compared to 0. We don't need to track it on every post creation.

* UX: Add symbol in TL3 report if topic reply count is capped

* DEV: Drop user_stats.topic_reply_count column
2020-05-14 15:42:00 -07:00
Rafael dos Santos Silva
675c9c38c8
Revert "FIX: Workaround WebAPK server bug with images without sizes"
This reverts commit bb7fca832f.
2020-05-14 19:33:54 -03:00
Rafael dos Santos Silva
bb7fca832f
FIX: Workaround WebAPK server bug with images without sizes
Google WebAPK server was returning 500 with `any` sized svgs,
which is a spec violation.

Workaround for now setting a static size.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1061911
2020-05-14 18:08:51 -03:00
Penar Musaraj
5ff2a235f6 DEV: Allow 3-digit HEX color code in single icon route
Followup to aee8e62
2020-05-14 16:37:45 -04:00
Neil Lalonde
1b7f23a1bc
FIX: don't compute draft for bots on categories index route 2020-05-14 16:35:32 -04:00
Kane York
e0e967ac46
FIX: Apply code quoting with no syntax highlighting (#9784) 2020-05-14 13:03:42 -07:00
Rafael dos Santos Silva
4595560537
FIX: Use proper icons for App shortcut menu
Follow up to 3b0fa9b using the new icon URL introduced in e618efe

Will automatically use icons of the primary color of the active theme
 for the user during install.
2020-05-14 16:32:53 -03:00
Penar Musaraj
aee8e62e21
FEATURE: Add endpoint for individual SVG icons (#9765) 2020-05-14 14:17:19 -04:00
Mark VanLandingham
bec6bace53
DEV: Allow plugins to hide user stats by new guardian method (#9772) 2020-05-14 11:57:35 -05:00
Penar Musaraj
87b9488137 UX: Limit iOS modal keyboard changes to composer
Followup to 423802fbc
2020-05-14 12:48:28 -04:00
Robin Ward
aa2d040526 DEV: Update ESLint to remove I18n global
Also fixes missed imports in core.
2020-05-14 10:18:12 -04:00
Joffrey JAFFEUX
42e5a5bb39
DEV: do not append/prepend if callback returns nothing (#9778) 2020-05-14 14:38:03 +02:00
Dan Ungureanu
321879a619
FIX: Load locale first in wizard app 2020-05-14 11:48:55 +03:00
Guo Xiang Tan
9a18bacbe3
DEV: Fix lint. 2020-05-14 16:10:51 +08:00
Guo Xiang Tan
a1a798ac7d
DEV: Expose Composer.serializeOnUpdate in client side plugin api.
Also expose `Composer.serializeOnCreate` as well.
2020-05-14 16:06:29 +08:00
Guo Xiang Tan
fdea969f14
DEV: Minor follow up to d7e230c1b9 2020-05-14 16:02:54 +08:00
Guo Xiang Tan
95a80525ae
DEV: Remove erroneous code introduced in d7e230c1b9 2020-05-14 15:58:44 +08:00
Guo Xiang Tan
d7e230c1b9
UX: Introduce composer-actions when editing a post. 2020-05-14 15:56:08 +08:00
Dan Ungureanu
b80128a973
FEATURE: Add structured data to follow Google's guidelines (#9764)
All Schema.org properties are optional, but Google has a set of
properties which are required.
2020-05-14 10:42:01 +03:00
Vinoth Kannan
c014b93854
UX: don't disable "create account" button & display error message for required fields. (#9643) 2020-05-14 12:15:33 +05:30
Sam Saffron
3d050bdaa3
DEV: correct test suite
We have no choice but to bypass recursive debouncers in test

Otherwise we overrun the stack with frames
2020-05-14 16:41:34 +10:00
Sam Saffron
ce4b5b56e5
FIX: never save draft while it is saving
Previously if saving a draft took longer than 2 seconds there
could be conditions where drafts could be saved concurrently.
This meant the composer could race with itself and raise conflicts.

This is likely to happen on bad internet connections or where
latency is really high.

Additionally a throttle was added so drafts save unconditionally
every 15 seconds.

Save draft in the model now properly and consistently returns a
promise.
2020-05-14 15:36:18 +10:00
Penar Musaraj
ad7c964cd1 FIX: Prevent Safari from scrolling when closing composer
Unlike other browsers, Safari maintains focus on elements even when
they are hidden. And since the composer is fixed-positioned when hidden,
closing the composer on a topic with several replies causes Safari to
scroll the window up.

Deliberately blurring the focused element fixes the issue.
2020-05-13 21:24:40 -04:00
Robin Ward
eab560fe2a
DEV: import I18n instead of global usage (#9768)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2020-05-13 16:23:41 -04:00
Kane York
1059557ce1
DEV: Standardize ignored_columns removal comments (#9771) 2020-05-13 13:08:15 -07:00
Mark VanLandingham
3d54f497db
DEV: add classes to li's inside user navigation (#9766) 2020-05-13 12:22:14 -05:00
Guo Xiang Tan
c405b15914
DEV: Add plugin outlet revision-user-details-after. 2020-05-13 15:40:37 +08:00
Sam Saffron
7f841dc21f
PERF: avoid race conditions when creating topic links
Previously the code was very race condition prone leading to
odd failures in production

It was re-written in raw SQL to avoid conditions where rows
conflict on inserts

There is no clean way in ActiveRecord to do:

Insert, on conflict do nothing and return existing id.

This also increases test coverage, we were previously not testing
the code responsible for crawling external sites directly
2020-05-13 16:05:57 +10:00
Martin Brennan
a64cf265fd
FIX: Change /bookmarks URL back to topic list and add bookmark poster avatars (#9759)
* Changes the /bookmarks URL to show the original "topics filtered by bookmark" list instead of redirecting to user activity bookmarks (see https://meta.discourse.org/t/domain-com-bookmarks-is-showing-domain-com-u-user-activity-bookmarks-with-reminders/149252/12)
* Add the user avatar for the user who made the post that is bookmarked
2020-05-13 14:03:24 +10:00
Kris
811bc3544f prettier 2020-05-12 23:12:46 -04:00
Guo Xiang Tan
34c39b65bb
PERF: Avoid executing the same query twice. 2020-05-13 11:10:09 +08:00
Guo Xiang Tan
822e594fc8
UX: Improve display of site setting validation message.
Previously, the validation message is shown inline with the label which
leads to the available width for both element being reduced.
2020-05-13 11:10:08 +08:00
Kris
765e842101 UX: remove underline from del & ins elements 2020-05-12 22:51:28 -04:00
Martin Brennan
9981fa4466
FIX: Prevent column name conflicts in reviewable code (#9753)
We were getting errors like this in Reviewables in some cases:

```
ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR:  column reference "category_id" is ambiguous
LINE 4: ...TRUE) OR (reviewable_by_group_id IN (NULL))) AND (category_i...
```

The problem that was making everything go boom is that plugins can add their own custom filters for Reviewables. If one is doing an INNER JOIN on topics, which has its own category_id column, we would get the above AmbiguousColumn error. The solution here is to just make all references to the reviewable columns in the list_for and viewable_by code prefixed by the table name e.g. reviewables.category_id.
2020-05-13 09:05:56 +10:00
Robin Ward
d9f5499f3a Revert "Revert "DEV: Remove Discourse.Route""
This reverts commit b4d27d327d.

Plugins have been updated to not use this anymore.
2020-05-12 14:15:07 -04:00
Daniel Waterworth
497dc6eaa7 Add a global setting for CDN origin
This is so that, on a multisite cluster, when we handle a CDN request,
the hostname that is requested corresponds to one of the sites -
specifically the default site.
2020-05-12 16:43:40 +01:00
Rafael dos Santos Silva
2298e14d38
FEATURE: Support for App Shortcuts Menu (#9749)
* FEATURE: Support for App Shortcuts Menu

This adds a list of shortcuts to a installed Discourse instance.

It can be accessed by right clicks or long press on the app icon.

See https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/Shortcuts/explainer.md

List of possible follow ups include:

- Making it admin customizable
- Making it user customizable
- Using SVG icons from the site icon sprite
- Picking an accent color for icons

* FIX: Add type to shortcut menu icons
2020-05-12 12:24:33 -03:00
Robin Ward
088c11a12c FIX: Don't raise an exception if a TopicLink cannot be created
This can happen under concurrency and it's fine. If a `TopicLink`
already exists we can continue on without raising an error.
2020-05-12 11:15:59 -04:00
Joshua Rosenfeld
c94e6a9a66
FEATURE: add noindex header to tags pages (#9748) 2020-05-12 10:44:46 -04:00
Mark VanLandingham
9bce91f59f
DEV: Allow plugins to add extra icons to category-link (#9743) 2020-05-12 09:41:16 -05:00
Bianca Nenciu
16137308b0
FIX: Show Settings button if plugin has settings (#9728)
It used to check if the plugin has an enabled_setting.
2020-05-12 11:18:19 +03:00
Sam Saffron
a29ae17d3a
FIX: saving drafts unconditionally increases sequence
Previously we only changed sequence on ownership change, this
cause a race condition between tabs where user could type for a
long time without being warned of an out of date draft.

This change is a radical change and we should watch closely.

Code was already in place to track sequence on the client so no
changes are needed there.
2020-05-12 16:55:42 +10:00
Sam Saffron
451e9c4bb9
DEV: minor SQL formatting change
Moved join prior to left join to make query less confusing.

Has no material impact on performance.
2020-05-12 16:55:42 +10:00
Guo Xiang Tan
8fb99f218d
FEATURE: Allow plugins to register a callback to ignore DraftSequence. 2020-05-12 14:25:20 +08:00
Guo Xiang Tan
d301af39bd
PERF: Avoid hitting DB when fetching draft sequence of bot user. 2020-05-12 13:56:58 +08:00
Martin Brennan
39a2d90e0f
DEV: Pass currentUser to post-menu button builders (#9752)
Adding this from a review; I was using Discourse.currentUser which is frowned upon now.

Passing currentUser both for regular post menu buttons and extra buttons attached via the plugin API.

Lots of formatting/whitespace changes, best off reviewing with ?w=1
2020-05-12 14:09:38 +10:00
Kris
a009ec597d remove ember container div 2020-05-11 21:12:33 -04:00
tshenry
6f228b0312
FIX: Remove unnecessary forward slashes in regex 2020-05-11 17:55:44 -07:00
Penar Musaraj
7cdf41d311 DEV: Remove reference to Discourse.Category 2020-05-11 18:28:45 -04:00
Jeff Wong
e744b9efec FIX: add tabindex=-1 on tabLoc post links
This prevents tabbing from confusing screenreaders, as having default tabindex
with aria-hidden confuses screenreaders
2020-05-11 14:43:12 -07:00
Penar Musaraj
90b900704b FIX: Improve mobile footer nav accessibility 2020-05-11 16:55:34 -04:00
Robin Ward
b4d27d327d Revert "DEV: Remove Discourse.Route"
This reverts commit eed7983404.
2020-05-11 16:50:53 -04:00
Robin Ward
22af44ac49 DEV: Remove Discourse.Mobile 2020-05-11 16:13:29 -04:00
Robin Ward
eed7983404 DEV: Remove Discourse.Route 2020-05-11 16:11:33 -04:00
Robin Ward
74db317974 DEV: Remove deprecation for Discourse.Category 2020-05-11 16:10:21 -04:00
Joffrey JAFFEUX
286b4e535e
DEV: allows buttons to define aria-label (#9747) 2020-05-11 22:09:44 +02:00
Robin Ward
b4bd238dd6 DEV: Add safe deprecation to Discourse.User 2020-05-11 16:08:12 -04:00