Commit Graph

22291 Commits

Author SHA1 Message Date
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