Commit Graph

41808 Commits

Author SHA1 Message Date
dependabot[bot] 2eeb4cde2a
Build(deps): Bump raindrops from 0.19.1 to 0.19.2 (#13172)
Bumps [raindrops](https://yhbt.net/raindrops/) from 0.19.1 to 0.19.2.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 00:31:45 +02:00
dependabot[bot] c014f4f99c
Build(deps): Bump kgio from 2.11.3 to 2.11.4 (#13170)
Bumps [kgio](https://yhbt.net/kgio/) from 2.11.3 to 2.11.4.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 00:31:36 +02:00
dependabot[bot] a3f2449dee
Build(deps): Bump rubocop-ast from 1.5.0 to 1.6.0 (#13169)
Bumps [rubocop-ast](https://github.com/rubocop-hq/rubocop-ast) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/rubocop-hq/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-ast/compare/v1.5.0...v1.6.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 00:31:24 +02:00
Robin Ward 96fd202d9c
FIX: We can't use `?.` yet (#13168) 2021-05-26 17:30:27 -04:00
Sam d45682716b
FIX: automatically expire bad push channels (#13156)
Previously we would retry push notifications indefinitely for all errors
except for ExpiredSubscription

Under certain conditions other persistent errors may arise such as a persistent
rate limit.

If we track more than 3 errors in a period of time longer than a day we will
delete the subscription

Also performs a bit of internal cleanup to ensure protected methods really
are private.
2021-05-27 06:49:20 +10:00
Robin Ward b9053c5e77
UX: Add auto focus to hamburger and user menu dropdowns (#13165) 2021-05-27 06:45:52 +10:00
Penar Musaraj ea68bab135
FIX: Close hyperlink modal on ESC key (#13166) 2021-05-26 15:11:12 -04:00
Roman Rizzi 83dd47f0b4
FEATURE: Navigate to an approved queued topic from the review queue. (#12841)
Admins can visit an approved queued topic from the review queue by clicking their title. We no longer store the created post and topic ids in the reviewable's payload object. Instead, we set the `topic_id` and `target_id` attributes.
2021-05-26 15:43:18 -03:00
Bianca Nenciu 8e1448487f
FIX: Make poll options tabbable (#13159) 2021-05-26 20:45:10 +03:00
Penar Musaraj 787f989fb9
FIX: add body class and remove jQuery usage in footer-nav component (#13162) 2021-05-26 13:03:34 -04:00
Roman Rizzi 91ee3fb6e3
FIX: Use a better default for the low_priority_threshold setting. (#13161)
Using 1 as the default value is confusing for some people as low-score flags are hidden unless staff uses the "(any)" priority filter. Let's change it to 0 and let every site adjust the setting to match their needs.
2021-05-26 13:16:16 -03:00
David Taylor ea61bcaf13
DEV: Define theme test modules under a `/test` subdirectory (#13158) 2021-05-26 11:49:51 +01:00
Arpit Jalan 283b08d45f
DEV: Absorb onebox gem into core (#12979)
* Move onebox gem in core library

* Update template file path

* Remove warning for onebox gem caching

* Remove onebox version file

* Remove onebox gem

* Add sanitize gem

* Require onebox library in lazy-yt plugin

* Remove onebox web specific code

This code was used in standalone onebox Sinatra application

* Merge Discourse specific AllowlistedGenericOnebox engine in core

* Fix onebox engine filenames to match class name casing

* Move onebox specs from gem into core

* DEV: Rename `response` helper to `onebox_response`

Fixes a naming collision.

* Require rails_helper

* Don't use `before/after(:all)`

* Whitespace

* Remove fakeweb

* Remove poor unit tests

* DEV: Re-add fakeweb, plugins are using it

* Move onebox helpers

* Stub Instagram API

* FIX: Follow additional redirect status codes (#476)

Don’t throw errors if we encounter 303, 307 or 308 HTTP status codes in responses

* Remove an empty file

* DEV: Update the license file

Using the copy from https://choosealicense.com/licenses/gpl-2.0/#

Hopefully this will enable GitHub to show the license UI?

* DEV: Update embedded copyrights

* DEV: Add Onebox copyright notice

* DEV: Add MIT license, convert COPYRIGHT.txt to md

* DEV: Remove an incorrect copyright claim

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: jbrw <jamie@goatforce5.org>
2021-05-26 15:11:35 +05:30
Bianca Nenciu d0779a87bb
FIX: Use max_category_nesting when importing categories (#13105)
It allowed for a parent category and a sub-category.
2021-05-26 12:40:26 +03:00
Jarek Radosz 96f3f15f38
UX: Align list-controls & topic-title top margins (#13150) 2021-05-26 11:12:32 +02:00
David Taylor f25eda13fa
FIX: Make UI match server behavior for external-auth invites (#13113)
There are two methods which the server uses to verify an invite is being redeemed with a matching email:
  1) The email token, supplied via a `?t=` parameter
  2) The validity of the email, as provided by the auth provider

Only one of these needs to be true for the invite to be redeemed successfully on the server. The frontend logic was previously only checking (2). This commit updates the frontend logic to match the server.

This commit does not affect the invite redemption logic. It only affects the 'show' endpoint, and the UI.
2021-05-26 09:47:44 +01:00
Kris d0dfd0c73f
UX: Consistent padding on mobile/desktop `.wrap` (#13155) 2021-05-26 17:33:08 +10:00
Jarek Radosz 494fe7f2f6
UX: Adjust list and onebox margins (#13131)
Lists – made the indent smaller (helps on mobile), added vertical margin
Onebox – added top margin
2021-05-25 23:52:33 -04:00
Roman Rizzi a5fddd5cdb
FIX: Hide a post's pending flag count from TL4 users. (#13129)
They can't see the review queue, so there's no reason to show a button with the post's pending flag count in the post controls.
2021-05-26 12:58:00 +10:00
Dan Ungureanu a5273b37f7
FIX: Show inviter name in email's from field (#13141)
'From' field of the email contained the name of the user who posted the
shared post. Instead, it should contain the name of the inviter.
2021-05-26 12:55:07 +10:00
Kris f78fa76847
UX: change categories page dropdown to a wrench (#13154) 2021-05-26 12:53:52 +10:00
Sam 759abb3206
UX: Improve navigation on topic lists for screen readers (#13153)
Previously we had no role set for various topic links, nor did we have any
headers.

This teaches screen readers that topic links in topic lists are to be treated
as H2. We opted for this less radical change cause a change of the element
type would probably result in many broken themes.

Confirmed on NVDA you can very quickly breeze through topic lists now. Minor
edge case is pinned topics which can be a bit annoying due to multiple links.
2021-05-26 12:53:14 +10:00
Sam 293877237d
UX: provide a region for various topic actions (#13152)
This makes it much easier to reply to topics / bookmark topics and so on

Previously topic buttons had no region
2021-05-26 11:05:35 +10:00
Dan Ungureanu 197e3f24ce
FEATURE: Show stale reviewable to other clients (#13114)
The previous commits removed reviewables leading to a bad user
experience. This commit updates the status, replaces actions with a
message and greys out the reviewable.
2021-05-26 09:47:35 +10:00
David Taylor 8c83803109
DEV: Remove unused `disabled_plugins` checks (#13144)
We now bundle Javascript for each theme/plugin separately, and only ship bundles for enabled plugins to the client. Therefore, these disabled_plugins checks are now redundant, and can be removed.
2021-05-26 09:44:58 +10:00
Martin Brennan 7a79bd7da3
FEATURE: Allow selective dismissal of new and unread topics (#12976)
This PR improves the UI of bulk select so that its context is applied to the Dismiss Unread and Dismiss New buttons. Regular users (not just staff) are now able to use topic bulk selection on the /new and /unread routes to perform these dismiss actions more selectively.

For Dismiss Unread, there is a new count in the text of the button and in the modal when one or more topic is selected with the bulk select checkboxes.

For Dismiss New, there is a count in the button text, and we have added functionality to the server side to accept an array of topic ids to dismiss new for, instead of always having to dismiss all new, the same as the bulk dismiss unread functionality. To clean things up, the `DismissTopics` service has been rolled into the `TopicsBulkAction` service.

We now also show the top Dismiss/Dismiss New button based on whether the bottom one is in the viewport, not just based on the topic count.
2021-05-26 09:38:46 +10:00
Roman Rizzi de0f2b9546
UX: Users can postpone discobot's tutorial. (#13060) 2021-05-25 16:30:16 -07:00
Rafael dos Santos Silva 9118bb2076
FEATURE: Normalize the service worker route (#12343)
Re-lands the change initially proposed on #8359 but without a new nginx
location block, so it has less change surface.

Co-authored-by: Jeff Wong <awole20@gmail.com>

Co-authored-by: Jeff Wong <awole20@gmail.com>
2021-05-25 19:39:31 -03:00
Jordan Vidrine b0b23a969f
UX: Search result link title color change (#13149) 2021-05-26 08:08:34 +10:00
Nolan Darilek 549e100d8c
A11Y: Add heading role for post titles. (#13143)
Not all screen readers treat articles as navigable roles when moving between landmarks. To help with this, we use a `heading` role on the title, with an arbitrary depth of 2 chosen as to not conflict with the main `<h1/>`. Because ARIA roles are used, this change should be entirely non-visual.

While this introduces minor navigation challenges in posts where headers are included, the vast majority of posts don't, and as screen reader users, we're used to mixed headers in longer-form content.
2021-05-25 22:43:09 +02:00
Justin DiRose a363f47798
UX: Make discobot flag tutorial copy clearer (#13148)
Per https://meta.discourse.org/t/-/186896, this is a simple copy change to help curb users from sending messages to the moderators via flagging the Discobot tutorial.
2021-05-25 15:34:38 -05:00
Robin Ward 681a129ec0
FIX: Better focus support for modals (#13147) 2021-05-25 16:33:46 -04:00
Penar Musaraj 452ea7e32e
FIX: Properly break overflowing long links in topic map (#13146) 2021-05-25 15:43:58 -04:00
Penar Musaraj 6e9ee3db03
FIX: Sort user bookmarks by reminder date (#13145) 2021-05-25 15:23:46 -04:00
Mark VanLandingham 72950e051c
Add category breadcrumbs to edit category page (#13126) 2021-05-25 13:40:11 -05:00
Jarek Radosz 3f5d868219
DEV: Add peer dependencies (#13132)
Fixes yarn warnings.

* DEV: Add `eslint` peer dependency
* DEV: Add `@babel/core` peer dependency
* DEV: `npx yarn-deduplicate` & `yarn`
2021-05-25 18:39:40 +02:00
Jarek Radosz 9b9b601e2f
DEV: Remove unused `offscreen-content` (#13133)
Looks like a vestige of Ember 1.x?
2021-05-25 18:39:06 +02:00
Jarek Radosz 3a4b28e902
DEV: Change default `code_formatting_style` to `code-fences` (#13135)
Code fences:
1. allow to have syntax highlighting by declaring a language
2. are easier to edit (the composer doesn't preserve indentation when inserting a new line)
3. are more popular
2021-05-25 18:38:53 +02:00
Jarek Radosz 61cf34c09d
DEV: Don't resetSite() more often than needed (#13138)
Avoid calling resetSite() twice per test in certain situations.

Included:
* DEV: Import `exists` helper
2021-05-25 18:38:41 +02:00
Jarek Radosz 51b360916c
DEV: Use `import { inject as controller}` Ember idiom (#13140) 2021-05-25 18:37:32 +02:00
Jarek Radosz 5c3c2b8d31
FEATURE: Change "Preformatted text" shortcut (#13137)
Cmd/Ctrl+Shift+C was conflicting with browsers' "inspect element" keyboard shortcuts. Cmd/Ctrl-E was chosen because it's the same one that GitHub is now using: https://github.blog/changelog/2021-04-09-new-codeblock-shortcut/
2021-05-25 15:57:29 +02:00
Discourse Translator Bot e2e13a70f6
Update translations (#13136) 2021-05-25 15:29:11 +02:00
Sam 6e2ecf40c7
UX: add ARIA region role to posts (#13130)
NVDA does not detect HTML5 articles as regions. This explicitly sets a
region with an aria-label denoting post numbers making it much easier to
know where you are in a topic.

Note role: article which is more semantically correct is not respected by
NVDA d/D shortcut, hence the much more generic "region" role.
2021-05-25 20:58:13 +10:00
Andrei Prigorshnev f21d50ebb6
UX: show Update button instead of Enable button when slow mode is already enabled (#13077)
When slow mode is enabled it's possible to open the slow mode dialog again to disable it or to update slow mode settings. The problem is that in this case, the button for saving still has the label "Enable" which is confusing.

This changes the text on the button from "Enable" to "Update" when slow mode is already enabled.
2021-05-25 13:33:39 +04:00
Jeff Atwood 50926f6143
FIX: Simplify post and topic deletion language (#13128)
Based on feedback from Matt Haughey, we don't need to use so many words when describing a deleted topic or post.

Co-authored-by: Martin Brennan <martin@discourse.org>
2021-05-25 12:04:10 +10:00
Blake Erickson fccf4d4375
DEV: Switch off of our image_optim fork (#13124)
The main image_optim gem now includes the timeout feature
that we had in our fork. So it is now safe to switch off of our fork and
back to the image_optim gem.

This is the link to the commit in the image_optim repo that adds the
timeout option:

ec3767dde0

One difference with the new timeout implementation is that image_optim
now handles the timeout exceptions instead of bubbling them up:

1ed0328587/lib/image_optim.rb (L128-L129)

```
 rescue Errors::TimeoutExceeded
   handler.result
```

So a timeout will just return `nil`, which is the same response if it
couldn't optimize an image. I don't think we were really watching for
or doing anything about these timeout warnings in our logs so I think
this is an okay change to have and we will have less warnings in our
logs now too.
2021-05-24 19:27:20 -06:00
Jeff Atwood b8a08d21e0
minor refinements to the Universal Rules (#13127)
.. of civilized discourse!
2021-05-24 15:09:01 -07:00
Jeff Wong b66802ccf1
DEV: add plugin hook to add topic participant classes (#13125)
Allow plugins to add custom css classes to topic participants
2021-05-24 12:33:21 -07:00
Daniel Waterworth ca809d2c40
FEATURE: Add on_preload for TopicView (#13122)
This allows plugins to load data on fetched posts before each post is
individually serialized.
2021-05-24 11:46:57 -05:00
David Taylor fc6e7dd3f1
DEV: Add `session` to `before_auth` and `after_auth` hooks (#13123)
This allows plugins to store/modify things in the session (e.g. the destination_url). This change is backwards compatible with existing plugins. If they do not specify a third argument, they will just be passed the first two.
2021-05-24 17:35:51 +01:00