Commit Graph

40039 Commits

Author SHA1 Message Date
da74b3e14b FEATURE: Add after-topic-list-body plugin-outlet (#11410) 2020-12-07 13:33:24 +02:00
54519a2976 FIX: do not replace smiling_face by slight_smile (#11412) 2020-12-06 18:28:39 +01:00
161e92be61 DEV: update onebox gem (#11409) 2020-12-04 15:07:32 -05:00
4aeb3ef8e0 FIX: Trigger an event when a post is bookmarked. (#11407)
When we renamed BookmarkWithReminder to Bookmark in ca539fd, the bookmark event trigger was removed with the old code, and we forgot to add it again.
2020-12-04 15:09:20 -03:00
4d9686c494 FEATURE: Reviewed by filter. (#11405)
New reviewable filter to only display reviewables handled by a specific user.
2020-12-04 14:09:05 -03:00
477538bf2d DEV: setproctitle on demon processes (#11402)
This makes it easier to identify processes in `ps` output
2020-12-04 09:41:17 +00:00
1960fc5333 FIX: Stop using duplicate composer button ID (#11404)
"quote" is used by the button added in `composer-editor`.
bbe5d8d5cf/app/assets/javascripts/discourse/app/components/composer-editor.js (L875-L882)
2020-12-04 00:05:43 +01:00
da9b837da0 DEV: More robust processing of URLs (#11361)
* DEV: More robust processing of URLs

The previous `UrlHelper.encode_component(CGI.unescapeHTML(UrlHelper.unencode(uri))` method would naively process URLs, which could result in a badly formed response.

`Addressable::URI.normalized_encode(uri)` appears to deal with these edge-cases in a more robust way.

* DEV: onebox should use UrlHelper

* DEV: fix spec

* DEV: Escape output when rendering local links
2020-12-03 17:16:01 -05:00
e4d51e5b0a FIX: correct link in the notification about moved post (#11399)
Notification is created by a job. If the job is evaluated before changes are committed to a database, a notification will have an incorrect URL.

Therefore, the job should be lodged in enqueue_jobs method which is triggered after the transaction:

```ruby
Topic.transaction do
  move_posts_to topic
end
add_allowed_users(participants) if participants.present? && @move_to_pm
enqueue_jobs(topic)
```

I improved a little bit specs to ensure that the destination topic_id is set. However, that tests are passing even without code improvements. I couldn't find an easy way to "delay" database transaction.

Meta: https://meta.discourse.org/t/bug-with-notifications-for-moved-posts/168937
2020-12-04 08:43:42 +11:00
bcbe2de646 DEV: Make it easier to customize omniauth login complete handler in plugins (#11403)
It also removes the unused `provider` variable and stops Discourse from redirecting to /login after a login.
2020-12-03 22:27:55 +01:00
acbc47ef36 FIX: Load .js files from plugins in qunit testing env (#11304) 2020-12-03 10:25:42 -06:00
9fb36290e3 FEATURE: Non-staff users can use shared drafts. (#11329)
You can let non-staff users use shared drafts by modifying the `shared_drafts_min_trust_level` site setting. These users must have access to the shared draft category.
2020-12-03 11:07:57 -03:00
e773e21f0a Build(deps): Bump rubocop-rspec from 2.0.0 to 2.0.1 (#11398)
Bumps [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/rubocop-hq/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-rspec/compare/v2.0.0...v2.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-03 03:11:09 +01:00
d0e2a00e01 Build(deps): Bump memory_profiler from 0.9.14 to 1.0.0 (#11397)
Bumps [memory_profiler](https://github.com/SamSaffron/memory_profiler) from 0.9.14 to 1.0.0.
- [Release notes](https://github.com/SamSaffron/memory_profiler/releases)
- [Changelog](https://github.com/SamSaffron/memory_profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/SamSaffron/memory_profiler/compare/v0.9.14...v1.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-03 03:10:11 +01:00
889d52e2af Build(deps): Bump rubocop from 1.5.0 to 1.5.1 (#11396)
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.5.0...v1.5.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-03 03:09:37 +01:00
9c5ee4923b FEATURE: silently close topic (#11392)
New TopicTimer to silently close topic. It will be used by discourse-solved plugin

Meta: https://meta.discourse.org/t/allow-auto-close-for-solved-to-do-so-silently/169300
2020-12-03 10:43:19 +11:00
1c87038255 FEATURE: Allow Category Group Moderators to edit topic titles (#11340)
* FEATURE: Allow Category Group Moderators to edit topic titles

Adds category group moderators to the topic guardian’s `can_edit` method.

The value of `can_edit` is returned by the topic view serializer, and this value determines whether the current user can edit the title/category/tags of the topic directly (which category group moderators could already do by editing the first post of a topic).

Note that the value of `can_edit` is now always returned by the topic view serializer (ie, for both true and false values) to cover the case where a topic is moved out of a category that a category group moderator has permissions on, so that when the topic is reloaded the UI picks up that `can_edit` is now false, and thus the edit icon should no longer be displayed.

* DEV: Add a comment explaining why `can_edit` is always returned
2020-12-02 17:21:59 -05:00
2b66a4364d Update header_primary in shades of blue (#11391)
This commit changes header_primary to a shade of blue, fixing contrast issues with some text colors in the header.
2020-12-02 09:22:30 -06:00
d627cc6233 Fix typo. (#11395) 2020-12-02 19:08:59 +05:30
a78c64db35 FIX: on invite redemption only update pending ReviewableUser record (#11394)
When the invite was being redeemed and the ReviewableUser record status
for the invited user was not pending an error was being raised.

This commit makes sure that we are only looking for ReviewableUser
record with status pending and updates that to approved.
2020-12-02 18:38:26 +05:30
86feaec9be FIX: URL encode tag name (#11393)
Tags with emoji in the name were failing to redirect via permalink
handling. This commit percent encodes the emoji name which fixes
the issue.

https://meta.discourse.org/t/permalinks-not-working-in-unicode-tags/171757/
2020-12-02 12:36:41 +05:30
28032eaf38 Build(deps): Bump rubocop from 1.4.2 to 1.5.0
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 1.4.2 to 1.5.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.4.2...v1.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 16:52:34 -05:00
dee2f6b36a Build(deps): Bump rubocop-ast from 1.2.0 to 1.3.0
Bumps [rubocop-ast](https://github.com/rubocop-hq/rubocop-ast) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/rubocop-hq/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-ast/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 16:51:40 -05:00
4052f5e854 DEV: Hide 'DEV: Sort imports alphabetically (#11382)' from blame (#11388) 2020-12-01 15:40:10 -03:00
bbe5d8d5cf DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
d1d87b6fa3 FIX: show/hide ignored users preferences (#11386)
* FIX: show/hide ignored users preferences

based on the current user trust level and the appropriate site setting.

* Allow us to await the `updateCurrentUser` call

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-12-01 18:20:43 +01:00
d7bd9aa3d0 Update translations (#11385) 2020-12-01 14:34:25 +01:00
b7490e894f FIX: don't error-index category job when missing category
When the category is missing we should not throw an error but just finish the job.
2020-12-01 09:30:53 +08:00
99240476cb Version bump to v2.7.0.beta1 v2.7.0.beta1 2020-11-30 17:46:05 -05:00
aa09d83453 DEV: remove PR numbers from release_note:generate output 2020-11-30 17:46:05 -05:00
c60084a8f1 Build(deps-dev): Bump simplecov from 0.19.1 to 0.20.0
Bumps [simplecov](https://github.com/simplecov-ruby/simplecov) from 0.19.1 to 0.20.0.
- [Release notes](https://github.com/simplecov-ruby/simplecov/releases)
- [Changelog](https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md)
- [Commits](https://github.com/simplecov-ruby/simplecov/compare/v0.19.1...v0.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 13:07:19 -05:00
e7bad9f05d FIX: Ensure directory items appear in a consistent order (#11370)
User directory items are sorted by some activity metric. If those metrics have the same value, postgres does not guarantee the order in which they will be returned. This can cause issues in pagination - some users may appear twice, and some may be missed. To illustrate

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 29
```

If we use the primary key to tie-break matching metrics, things are much more reliable

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received, :id).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 0
```

This most commonly effects new sites where all the directory metrics are zero.

The fact that the ordering is indeterminate makes it difficult to write a reliable test case for this.
2020-11-27 18:12:49 +00:00
65eec147fc FEATURE: Add plugin js / plugin test js to bootstrap.json
This allows 3rd party clients (such as Ember CLI) to run plugins and
their tests.
2020-11-27 12:31:17 -05:00
7af663ca63 Build(deps): Bump loofah from 2.7.0 to 2.8.0
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.7.0...v2.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-27 10:50:19 -05:00
5448f3ed9e Hide imports commit from blame (#11367) 2020-11-27 11:46:27 -03:00
1c2358ba16 DEV: Tidy up imports. (#11364)
Only allow one import definition per file and add a new eslint rule to enforce it.
2020-11-27 11:30:16 -03:00
2e5e4dbf19 DEV: Make it easier to customize link attributes in quick access menu (#11365)
This allows themes to customize link attributes:

```
api.reopenWidget("quick-access-item", {
  _linkAttributes(href) {
    const attributes = this._super(...arguments);
    // do stuff
    return attributes;
  }
}
```
2020-11-27 12:26:47 +01:00
eeae657ca5 FIX: No tags should be set if tag chooser is hidden (#11362)
If a user could not set tags because they had a trust level lower than
min_trust_level_to_tag_topics site setting, the "Create Topic" button
from a tag page would still show up and be enabled. Clicking it caused
the composer model to silently have the tags set.
2020-11-27 13:03:37 +02:00
a0c457120a Revert "FIX: bump nokogumbo to 2.0.3 with patch (#11357)" (#11366)
This reverts commit 2fee4ee7f360348774480afa5d2266c9796c3ed4.
2020-11-27 17:14:12 +11:00
2fee4ee7f3 FIX: bump nokogumbo to 2.0.3 with patch (#11357)
PR lodged to nokogumbo so later we should be able to drop freedom patch - https://github.com/rubys/nokogumbo/pull/158
2020-11-27 08:32:18 +11:00
dab2f2fdf4 REFACTOR: We can't use Ember.HTMLBars.compile in Ember CLI
Instead we use the inline `hbs` helper. Note in the non-Ember CLI
version this will not actually inline compile, but it will still work
for all our tests.
2020-11-26 09:27:20 -05:00
6ac270aa94 Build(deps): Bump regexp_parser from 1.8.2 to 2.0.0
Bumps [regexp_parser](https://github.com/ammar/regexp_parser) from 1.8.2 to 2.0.0.
- [Release notes](https://github.com/ammar/regexp_parser/releases)
- [Changelog](https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ammar/regexp_parser/compare/v1.8.2...v2.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-26 09:26:57 -05:00
Joe
eecff3d15b DEV: Ensures mobile RTL stylesheets are loaded (#11360)
This PR only makes CSS changes that have no visual impact, but they fix an issue in the compiler that causes some stylesheets not to load on mobile RTL.

Full context here

https://meta.discourse.org/t/user-card-will-not-open-on-the-mobile/171268/6?u=johani
2020-11-26 21:03:25 +08:00
f56c4b78da FEATURE: Add users:log_out API key scope (#11359) 2020-11-26 10:39:38 +00:00
Sam
97eae4e3ad PERF: avoid using destroy_all when removing stats (#11358)
destroy_all will load all the active record relation and iterate, this
can get extremely expensive.
2020-11-26 15:29:39 +10:00
c9df679ba1 FIX: Only use full slugs when compiling category backgrounds. (#11353)
If a category and a sub-category have the same slug, adding a background to one of them will also show it on the other one. This was introduced in 8e3f667 to fix a discrepancy, which was later fixed in 214b4c3.
2020-11-25 15:40:16 -03:00
059e9cb1d2 REFACTOR: Remove .erb from emoji-picker
We can't use erb in ember-cli, and it seems the emoji groups rarely
change anyway. This commit migrates the ERB to pre-rendered javascript
that is updated via the `rake javascript:update_constants` task.
2020-11-25 11:23:02 -05:00
9ec0359022 Build(deps): Bump rubocop from 1.4.1 to 1.4.2 (#11349)
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.4.1...v1.4.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-25 12:42:36 +01:00
834d71d1f7 Build(deps): Bump rails_failover from 0.6.1 to 0.6.2 (#11350)
Bumps rails_failover from 0.6.1 to 0.6.2.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-25 11:21:50 +00:00
Sam
f5945efae7 DEV: watch more test directories (#11346)
Much has moved and autospec stopped picking up certain tests.
2020-11-25 11:12:23 +00:00