Commit Graph

23789 Commits

Author SHA1 Message Date
David Taylor
942888a10c
FEATURE: Increase maximum watched word length from 50 to 100 chars (#11437)
This is useful for more complex regex watched words

https://meta.discourse.org/t/166249
2020-12-09 17:45:34 +11:00
jbrw
4c118e4d7a
FIX: Allow for cateogry edit routes of unknown depth (#11426)
* FIX: Allow for cateogry edit routes of unknown depth

* DEV: remove unused files
2020-12-08 16:50:26 -05:00
Kane York
59ef48c0b9
FIX: Remove custom 'error' action on build-category-route/discovery (#11425)
The root cause of the issue was that the route was overriding the 'error' action from the correctly implemented handler in routes/application.js.

Remove the custom handler, and the duplicated template logic for displaying the errorHtml.

Fixes: e16b3da04a
2020-12-08 11:58:36 -08:00
tshenry
a446e0fde1
FEATURE: Link to text customization when editing system badges (#11345)
Being that system badges ship with every instance of Discourse, we've opted to define the name, description, and long description in our locales files to promote translation into other languages. When an admin visited the overview page of a system badge in their admin panel, they were met with disabled inputs for these text properties. The problem is that we failed to educate the admin that the text needs to be managed via the site text customization settings. 

This change adds a small "Customize Text" link under theses inputs that takes the admin to the specific site text customization where they can make desired changes.
2020-12-08 11:55:49 -08:00
Penar Musaraj
3e1b84963d
DEV: Remove duplicate (and deprecated) SK option (#11435) 2020-12-08 13:21:02 -05:00
Mark VanLandingham
9f786306bd
FIX: Actually error when topic timer time is in the past (#11434) 2020-12-08 11:13:45 -06:00
Joffrey JAFFEUX
b824af02d4
FIX: removes extra slashes from URL (#11433)
This is similar to a fix used in ember core: https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/routing/lib/location/history_location.ts#L140

It will prevent a URL with a double slash to hang and end up in a 404.
2020-12-08 17:47:43 +01:00
Bianca Nenciu
9df2bce538
FIX: Generate correct prev and next topics page URL (#11431)
It did not work well for category + tags pages.
2020-12-08 17:34:28 +02:00
Arpit Jalan
f62ea77666
Revert "DEV: no need to iterate through each tag for rendering" (#11432)
This reverts commit a19a3adf9e.

Need to look into failing tests.
2020-12-08 20:35:46 +05:30
Arpit Jalan
a19a3adf9e
DEV: no need to iterate through each tag for rendering (#11428)
This commit allows discourse-assign plugin to show assigned user next
to tags.
2020-12-08 18:41:26 +05:30
Sam Saffron
1cf057fb1c DEV: lint file
We enforce ordering of imports in our linter, missed this on a merge
2020-12-08 09:16:28 +08:00
Joffrey JAFFEUX
daefa3d25a
UX: makes sk components full width on users admin page (#11413) 2020-12-08 11:18:02 +11:00
Jarek Radosz
6b464d1b8d
FIX: Restore dismissing the first notification (#10433)
* FIX: Restore dismissing the first notification

Reverts the temporary fix (8e4fea897e) and restores the feature introduced in e638d43f0a.

The issue that was the reason for the revert (https://meta.discourse.org/t/logins-redirects-to-missing-notifications-page/149718) was a combination of two bugs:

1. Fixed in this commit - the click listener was accidentally registered also for logged-out users. This meant that the first click on a page always trigger an AJAX call to the notifications endpoint (`/notifications?recent=true&limit=5`), which returned a 403 error. Now, this code is run only when the user is logged in.

2. A still unknown bug that I could not reproduce, which was somehow setting the login redirect cookie to the URL of that previously failed AJAX request.
2020-12-08 11:11:35 +11:00
David Taylor
c69bb5d5be
DEV: Always enqueue sidekiq jobs after database transaction commit (#11293)
When jobs are enqueued inside a transaction, it's possible that they will be executed before the necessary data is available in the database. This commit ensures all jobs are enqueued in an ActiveRecord after_commit hook.

One potential downside here is if the job fails to enqueue, the transaction will no longer be aborted. However, the chance of that happening is reasonably low, and the impact is significantly lower than the current issue where jobs are scheduled before their data is ready.
2020-12-08 11:05:01 +11:00
Bianca Nenciu
812d047c60
FIX: Follow open in new tab site setting for bio links (#11418) 2020-12-08 10:56:14 +11:00
Joe
5ab6ef9765
FEATURE: Adds back button to theme editor (#11416) 2020-12-08 10:54:44 +11:00
Kris
3ef60686ed
UX: When requiring user fields at signup, also mark default fields as required (#11356) 2020-12-07 18:26:31 -05:00
Kris
0302de058c
UX: Fix invite checkbox width issue (#11371) 2020-12-07 18:08:04 -05:00
Kane York
e16b3da04a
FIX: Stop category 404s from breaking the router (#11424)
The propagated promise failure from model() caused the router to reject future route transitions, even though it correctly routed to the last-resort 404 page.

Co-authored-by: Jeff Wong <awole20@gmail.com>
2020-12-07 14:22:39 -08:00
Krzysztof Kotlarek
d5ba854c91
FIX: hide user id when hide_email_address_taken (#11417)
We should always hide user_id in response when `hide_email_address_taken` setting is enabled. Currently, it can be used to determine if the email was used or not.
2020-12-08 08:25:35 +11:00
Penar Musaraj
dd9ec827e5
FIX: Adjust reviewable menu placement on mobile (#11420)
Shows the actions dropdown above the triggering button to avoid some
options from displaying below mobile navigation in DiscourseHub.
2020-12-07 13:39:18 -05:00
Penar Musaraj
490e1cfbbb
DEV: Use tag renderer in tags filter dropdown (#11378)
A small change that would allow components to extend the tag
display in the filter dropdown, like they can in other contexts.

Was requested in the tag icons component, see
https://meta.discourse.org/t/tag-icons-component/109757/60?u=pmusaraj

The PR also standardises tag styling in select-kit dropdowns.
2020-12-07 12:10:21 -05:00
David Taylor
8b33e2f73d
FIX: Include locale in cache key for not_found_topics (#11406)
This ensures that users are only served cached content in their own language. This commit also refactors to make use of the `Discourse.cache` framework rather than direct redis access
2020-12-07 12:24:18 +00:00
Bianca Nenciu
154c8c3fef
FIX: Use CDN for custom emojis (#11401) 2020-12-07 13:36:08 +02:00
Bianca Nenciu
ed52577e1c
FIX: Group#flair_url must be a real URL (#11400)
It used to be a short URL, but that did not work with the lightbox
in {{image-uploader}}.
2020-12-07 13:35:41 +02:00
Bianca Nenciu
da74b3e14b
FEATURE: Add after-topic-list-body plugin-outlet (#11410) 2020-12-07 13:33:24 +02:00
Joffrey JAFFEUX
54519a2976
FIX: do not replace smiling_face by slight_smile (#11412) 2020-12-06 18:28:39 +01:00
Roman Rizzi
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
Roman Rizzi
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
Gerhard Schlager
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
Krzysztof Kotlarek
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
Gerhard Schlager
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
Mark VanLandingham
acbc47ef36
FIX: Load .js files from plugins in qunit testing env (#11304) 2020-12-03 10:25:42 -06:00
Krzysztof Kotlarek
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
jbrw
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
Jordan Vidrine
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
Arpit Jalan
d627cc6233
Fix typo. (#11395) 2020-12-02 19:08:59 +05:30
Arpit Jalan
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
Arpit Jalan
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
Roman Rizzi
bbe5d8d5cf
DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
Régis Hanol
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
Krzysztof Kotlarek
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
David Taylor
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
Robin Ward
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
Roman Rizzi
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
Gerhard Schlager
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
Bianca Nenciu
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
Robin Ward
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
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
David Taylor
f56c4b78da
FEATURE: Add users:log_out API key scope (#11359) 2020-11-26 10:39:38 +00:00