Commit Graph

35624 Commits

Author SHA1 Message Date
Roman Rizzi
c751291769
FIX: The 'reviewed' status filter should include deleted elements (#8630) 2019-12-30 14:56:17 -03:00
Robin Ward
5214f82841 API endpoints should return a response, not nil 2019-12-30 10:14:29 -05:00
David Taylor
bc4c40abd4
DEV: Remove unsafe-eval from development CSP (#8569)
- Refactor source_url to avoid using eval in development
- Precompile handlebars in development
- Include template compilers when running qunit
- Remove unsafe-eval in development CSP
- Include unsafe-eval only for qunit routes in development
2019-12-30 12:17:12 +00:00
David Taylor
df8444e813
FIX: Update topic/post counter correctly when category has zero topics (#8600)
Previously, categories without any topics were being excluded from the UPDATE query. This means the counter gets stuck, and the category cannot be deleted. This change ensures that the counters get correctly set to zero.
2019-12-30 11:20:44 +00:00
David Taylor
9348d2cfdf
PERF: Cache user badge count in user_stats table (#8610)
This means that we no longer need to run a `count()` on the user_badges table when serializing a user
2019-12-30 11:19:59 +00:00
Joffrey JAFFEUX
c15d702ae6
FEATURE: internet explorer deprecation global notice (#8577) 2019-12-30 08:19:07 +01:00
Joffrey JAFFEUX
6fa5725292
FIX: makes highlighting last viewed topic more resilient (#8624)
`highlight` was called from `didInsertElement` which technically doesn't ensure the list is rendered. By wrapping the highlighting code in `afterRender` we ensure it works more consistently.
2019-12-30 08:18:36 +01:00
Martin Brennan
473e39f4a4 DEV: model annotations 2019-12-30 16:13:27 +10:00
dependabot-preview[bot]
dca99c0391 Build(deps): Bump cose from 0.9.0 to 0.10.0 (#8595)
Bumps [cose](https://github.com/cedarcode/cose-ruby) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/cedarcode/cose-ruby/releases)
- [Changelog](https://github.com/cedarcode/cose-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cedarcode/cose-ruby/compare/v0.9.0...v0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-30 16:10:34 +10:00
dependabot-preview[bot]
831d46f55f DEV: Bump aws-partitions from 1.256.0 to 1.260.0 (#8617)
Bumps [aws-partitions](https://github.com/aws/aws-sdk-ruby) from 1.256.0 to 1.260.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-partitions/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

Contains a bunch of AWS gem updates that we do not use. My long term thinking here is that maybe the AWS dependency is just too heavy and we should consume the API directly to avoid this constant churn.
2019-12-30 17:09:07 +11:00
dependabot-preview[bot]
9178b36e64 Build(deps): Bump request_store from 1.4.1 to 1.5.0 (#8608)
Bumps [request_store](https://github.com/steveklabnik/request_store) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/steveklabnik/request_store/releases)
- [Commits](https://github.com/steveklabnik/request_store/compare/v1.4.1...v1.5.0)

request_store is a side dependency that is only used for lograge support, not expecting this to break anything.
2019-12-30 17:07:37 +11:00
dependabot-preview[bot]
bb9c54514f DEV: Bump unicorn from 5.5.1 to 5.5.2 (#8602)
Bumps [unicorn](https://bogomips.org/unicorn/) from 5.5.1 to 5.5.2.

This contains a fix for: 024f7a8c8c 

Specifically its around operation when you use the ruby tainting feature (which will soon be removed) 

Update has no actual impact on Discourse.
2019-12-30 17:06:00 +11:00
dependabot-preview[bot]
640fa6d118 DEV: Bump excon from 0.71.0 to 0.71.1 (#8587)
Bumps [excon](https://github.com/excon/excon) from 0.71.0 to 0.71.1.
- [Release notes](https://github.com/excon/excon/releases)
- [Changelog](https://github.com/excon/excon/blob/master/changelog.txt)
- [Commits](https://github.com/excon/excon/compare/v0.71.0...v0.71.1)

Minor performance update, the big change here is that internally excon starts using frozen strings.
2019-12-30 16:57:32 +11:00
Sam Saffron
be880d2ac1 DEV: update rubocop
This is a minor update to rubocop, it is fully compatible with our current
set of rules.
2019-12-30 16:54:47 +11:00
dependabot-preview[bot]
0234214533 DEV: Bump stackprof from 0.2.14 to 0.2.15 (#8584)
Bumps [stackprof](https://github.com/tmm1/stackprof) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/tmm1/stackprof/releases)
- [Changelog](https://github.com/tmm1/stackprof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tmm1/stackprof/compare/v0.2.14...v0.2.15)

Very safe change only used for diagnostics.
2019-12-30 16:42:16 +11:00
dependabot-preview[bot]
2d3d7a8f86 DEV: Bump mini_sql from 0.2.2 to 0.2.3 (#8601)
Bumps [mini_sql](https://discourse.org) from 0.2.2 to 0.2.3.

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

Minor update was there mainly for JRuby support should not have any real impact on Discourse.
2019-12-30 16:41:37 +11:00
dependabot-preview[bot]
4989fec1be DEV: Bump sidekiq from 6.0.3 to 6.0.4 (#8611)
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.0.3 to 6.0.4.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.0.3...v6.0.4)

Minor update which seems very safe.
2019-12-30 16:36:23 +11:00
Krzysztof Kotlarek
b725252cd0
FEATURE: Topic admin menu sticks to bottom on mobile. (#8620)
Our current topic admin menu is not always fully visible on a mobile
device, therefore some options are difficult to click.

To solve this issue, we can display the admin menu on the bottom of the
screen on mobile devices.
2019-12-30 08:15:46 +11:00
Joffrey JAFFEUX
041067cc21
FIX: correctly styles pwa consent banner (#8623) 2019-12-29 19:10:35 +01:00
Joffrey JAFFEUX
df465ed0be
FIX: allows global_notice site setting to contain html (#8622) 2019-12-29 18:29:41 +01:00
Michael Brown
7200653e16 FIX: cache_critical_dns was erroring without IPAddr
* sometimes cache_critical_dns would error out since "IPAddr" was
  undefined
* sometimes it autoloaded, so no error
2019-12-27 12:39:08 -05:00
Joffrey JAFFEUX
2f37f446f8
FIX: correctlt styles notification-consent-banner (#8621)
TODO: this should be moved to new global notice API
2019-12-27 15:27:12 +01:00
Roman Rizzi
16d97573f9
DEV: Improve support for extending flags. (#8619)
- Ensure that the 'notify_moderators' flag is always the last flag when using custom flags.
- Support passign a custom FlagSettings object when replacing flags to reuse existing ones.
2019-12-27 08:41:50 -03:00
Joffrey JAFFEUX
c25b8abd70
FEATURE: allows plugins to add a global notice (#8552)
* FEATURE: allows plugins to add a global notice

Usage:

```
api.addGlobalNotice(id, text, options = {});
```

Options can be:

```
dismissable // Will display a button to hide the notice if true
html // will prepend html to the next if present
level // alert level, will usee css class of alert component
persistentDismiss // if true won't show notice again on reload
onDismiss // execute a custom action on dismiss
visibility // defines custom logic for notice visibility
```

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2019-12-27 09:06:36 +01:00
Arpit Jalan
1820347d58 fix the build (take 2). 2019-12-24 19:27:35 +05:30
Gerhard Schlager
7aea7f2cae FIX: Track correct site setting 2019-12-24 14:11:37 +01:00
Gerhard Schlager
52a59b5811 FIX: English and US date/time formats 2019-12-24 12:17:25 +01:00
Arpit Jalan
49c124a12e fix the build. 2019-12-24 15:56:44 +05:30
Arpit Jalan
2c0574010a FIX: better error message when forum is in read-only mode 2019-12-24 15:49:27 +05:30
Krzysztof Kotlarek
86fb08d04a
Revert "FIX: update normalize css from 3.0.1 to 8.0.1 (#8591)" (#8618)
This reverts commit 16f01d0ddf.
2019-12-24 10:45:42 +11:00
Krzysztof Kotlarek
16f01d0ddf
FIX: update normalize css from 3.0.1 to 8.0.1 (#8591)
Changelog is available here - https://github.com/necolas/normalize.css/blob/master/CHANGELOG.md

I decided that the easiest way to ensure it works would be checking different browsers. It looked good to me on Chrome, Firefox, Edge and IE 11. In addition, I checked 3 random themes.
2019-12-24 08:39:51 +11:00
Krzysztof Kotlarek
9e4fcb1a0a
FIX: Correct description for out of love badge (#8615)
The bug mentioned here
https://meta.discourse.org/t/badge-not-triggering/135896/8

Basically, descriptions for 3 badges: "Out of Love", "Higher Love" and
"Crazy in Love" are granted based on on "max_likes_per_day" and the
description should reflect that.
2019-12-24 08:30:34 +11:00
Krzysztof Kotlarek
8c2e27790c
FIX: everyone can see poll results when on_vote and closed (#8613)
The bug was mentioned here: https://meta.discourse.org/t/poll-name/136436

I added specs to cover existing behaviour and refactored can_see_results method.

Guard condition should apply only if the poll result setting is set to `staff_only`.

In other cases, user can see results when the poll result setting is set to `always` or user voted or poll is closed.
2019-12-24 08:04:35 +11:00
Krzysztof Kotlarek
ac626a0dc3
FIX: bug when revoking badge as title (#8616)
When user revokes badge as title, UserHistory item is created. However,
that object is not accepting revoke_reson parameter.
2019-12-24 08:03:51 +11:00
Jeff Wong
63323bd7a8
FIX: category routes model params should decode their URL parts (#8612)
* FIX: category routes model params should decode their URL parts

Ember's route star globbing does not uri decode by default. This is
problematic for subcategory globs with encoded URL site settings enabled.

Subcategories with encoded URLs will 404 without this decode.

I found this https://github.com/tildeio/route-recognizer/pull/91
which explicitly explains that globbing does not decode automatically.
2019-12-23 10:24:41 -08:00
Jeff Wong
e36efb1edc FIX: ensure that we encode a slug only once if slug generation method is encoded
This was re-encoding the search slug each loop - if the category list was not
the first category in the list, it'd continually search with a re-encoded search
term from the previous iteration. This results in ember 404ing when navigating
to raw encoded category slugs of the form /c/encoded-slug-with-non-ascii
that have no ID attached.
2019-12-22 00:25:12 -08:00
Jeff Wong
eca1c643d5 FEATURE: allow TL3 promotions for overturned penalties
Restore tl3 reachability by calculating penalty counts vs unsuspend/unsilence.

Only count unsuspend or unsilences that have been made by a user other than
the Discourse system user.
2019-12-20 15:25:21 -08:00
Kris
00477d8f88 UX: Some category page style adjustments for sub-sub categories 2019-12-20 16:17:34 -05:00
Mark VanLandingham
6ec3d42b16
FEATURE: Allow complex post params from plugin (#8598) 2019-12-20 10:37:12 -06:00
AlexP11223
1e4a83cc2a FEATURE: add mybb.ru import script (#8609) 2019-12-20 11:10:18 -05:00
Kris
f8633d5c58 FIX: Give expanded CSS/HTML editor >0 height 2019-12-20 10:37:23 -05:00
Penar Musaraj
bbe2947742 DEV: Use FA5 name for moved post icon 2019-12-20 09:50:05 -05:00
David Taylor
61919ad39f
UX: Do not use avatars as fallback opengraph images for replies (#8605)
People rarely want to have their avatars show up as the preview image on social media platforms. Instead, we should fall back to the site opengraph image.
2019-12-20 13:17:14 +00:00
Krzysztof Kotlarek
b47b1d8af8 FIX: label helpers on sign up form are not hidden (#8603)
This commit fe9293b8b5 created a regression.

The problem is that dom changed a little bit.
Before it was
```
<tr class="instructions create-account-email">
  <td></td>
  <div id="account-email-validation" class="tip bad ember-view"></div>
  <td><label>Never shown to the public.</label></td>
</tr>
```

And after we got
```
<tr class="instructions create-account-email">
  <td></td>
  <div id="account-email-validation" class="tip bad ember-view"> </div>
  <td><label>Never shown to the public.</label></td>
</tr>
```
That small space may look like not important change.

However, now helpers are hitting that CSS rule:

```
.login-form {
  .tip {
    &:not(:empty) + td {
      display: none;
    }
}
```

To fix it, we should render template only if there is a reason - like it was before

```
if (reason) {
  buffer.push(iconHTML(this.good ? "check" : "times") + " " + reason);
}
```

* FIX: remove rerenderTriggers
2019-12-20 12:17:51 +01:00
Bianca Nenciu
9fe11d0fc3 Revert "Rename 'target usernames' with 'target recipients' in Composer (#8468)"
This reverts commit ebb288dc2c.
2019-12-20 11:56:20 +02:00
Régis Hanol
7030c93206 Revert "FIX: Show signup input tips and improve spacing"
This reverts commit d449834a28.

The signup input tips were hidden instead.
2019-12-20 09:42:11 +01:00
Bianca Nenciu
ebb288dc2c
Rename 'target usernames' with 'target recipients' in Composer (#8468) 2019-12-20 10:28:14 +02:00
Joffrey JAFFEUX
ff22f4cddd
UX: invites#show can't be requested with json and is not configured properly (#8570)
Currently at
tempting to access an invite via json will result in the following error:

```
HTTP_ACCEPT	application/json, text/javascript, */*; q=0.01
GET /invites/xxxxxxx

ActionView::MissingTemplate (Missing template invites/show, application/show with {:locale=>[:en_US, :en], :formats=>[:json], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}. Searched in:
  * "/var/www/discourse/app/views"
)
```
2019-12-20 09:24:55 +01:00
Bianca Nenciu
1bccd8eca9
FIX: Remove full nested quotes on direct reply (#8581)
It used to check how many quotes were inside a post, without taking
considering that some quotes can contain other quotes. This commit
selects only top level quotes.

I had to use XPath because I could not find an equivalent CSS
selector.
2019-12-20 10:24:34 +02:00
Kris
d449834a28 FIX: Show signup input tips and improve spacing 2019-12-19 20:37:47 -05:00