Commit Graph

42133 Commits

Author SHA1 Message Date
Jarek Radosz 5af0636d83
DEV: Fix a leaky test (#13559)
The error was:

```
↪ Unit | Model | topic::recover [✔]
↪ Unit | Utility | emoji::emojiUnescape [✔]
↪ Unit | Utility | pretty-text::quoting a quote [✔]
↪ Unit | Utility | click-track::routes to internal urlsUnhandled request in test environment: /forum/t/1234/recover (PUT)
Error: Unhandled request in test environment: /forum/t/1234/recover (PUT)
    at Pretender.server.unhandledRequest (discourse/tests/setup-tests:173:15)
    at Pretender.handleRequest (pretender:400:14)
    at FakeRequest.send (pretender:169:21)
    at Object.send (jquery:10100:10)
    at Function.ajax (jquery:9683:15)
    at performAjax (discourse/app/lib/ajax:174:19)
    at eval (discourse/app/lib/ajax:183:11)
    at invokeCallback (ember:63104:17)
    at publish (ember:63087:9)
    at eval (ember:57463:16)
 [✘]
```

* DEV: Don't duplicate a function
2021-06-29 10:40:29 +10:00
Martin Brennan d098f51ad3
DEV: Drop duration column from topic timers (#13543)
The duration column has been ignored since the commit
4af77f1e38
for topic_timers, we use duration_minutes instead.

Also removing the duration key from Topic.set_or_create_timer. The only
plugin to use this was discourse-solved, which doesn't use it any
longer
since
c722b94a97
2021-06-29 09:27:12 +10:00
Martin Brennan 03338f9086
FIX: Remove legacy topic timer code (#13544)
The new topic timer backend code introduced six months ago
in 0034cbd is now used instead of this legacy code. It can be safely removed
now.
2021-06-29 09:16:25 +10:00
dependabot[bot] 69e557be66
Build(deps): Bump excon from 0.82.0 to 0.83.0 (#13558) 2021-06-29 00:34:17 +02:00
Jarek Radosz 6afba42985
UX: Tweak spacing in the admin dashboard (#13557)
Even margins, indented `li > ul`, no extra space inside parens `( sha )`.
2021-06-28 23:35:31 +02:00
Rafael dos Santos Silva d860e2717b
UX: Adds 'Processing Upload' to the composer status area during upload optimization (#13556) 2021-06-28 18:22:22 -03:00
Rafael dos Santos Silva 99da221034
FIX: Handle image decoding failure in composer image optimization (#13555)
There are some hard limits in browser Canvas implementations, that will
throw a runtime exception when crossed. Since those limits are platform
dependent, the best we can do is catch it and back off from trying to
optimize a problematic file.

For example, a 60MB PNG can be processed fine by Chrome but Firefox will
fail trying to extract the ImageData from the CanvasRenderingContext2D
with NS_ERROR_FAILURE.

Also cleans up the media-optimization-utils and add post-resize size logs
2021-06-28 18:21:39 -03:00
Mark VanLandingham d03aee4642
UX: Horizontal scroll bar on top of user directory (when needed) (#13553) 2021-06-28 15:10:38 -05:00
mintsaxon 7d0d13c32e FEATURE: add slow_mode_prevents_editing setting..
..as per https://meta.discourse.org/t/slow-mode-for-a-category/179574/16
2021-06-28 13:08:10 -04:00
Jarek Radosz 04baca593b
UX: Tweak the timestamp line in Twitter onebox (#13551)
Fixed alignment and made the color less intrusive to make the actual content pop out more.
2021-06-28 15:04:33 +02:00
Dan Ungureanu d015907668
FIX: Remove extra margin from share topic modal (#13549)
The styling between the "Create Invite" and "Share Topic" modals is
shared. The margin that was used to organize inputs in a list is not
needed for the "Share Topic" modal.
2021-06-28 15:52:44 +03:00
Arpit Jalan 3dda926cb2
FIX: only delete the word/phrase when the 'x' icon is clicked (#13547) 2021-06-28 15:14:18 +05:30
Andrei Prigorshnev 6be4699954
FIX: topic level bookmark button (#13530)
We changed (https://github.com/discourse/discourse/pull/13407) behaviour of the topic level bookmark button recently. That PR made the button be opening the edit bookmark modal when there is only one bookmark on the topic instead of just removing that bookmark as it was before.

This PR fixes the next problems that weren't taken into account in the previous PR:

1. Everything should work fine even on very big topics when a bookmarked post is unloaded from the post stream. I've added code that loads the post we need and makes everything work as expected
2. When at least one bookmark on the topic has a reminder, we should always be showing the icon with a clock on the topic level bookmark button
3. We should show correct tooltips for the topic level bookmark button
2021-06-28 12:24:23 +04:00
Alan Guo Xiang Tan 7719453fb7 DEV: Don't eager load tags when tagging is not enabled. 2021-06-28 16:00:10 +08:00
Sam 14a0247301
PERF: optimise backfilling of topic_id (#13545)
Relying on large offsets can have uneven performance on huge table, new
implementation recovers more cleanly and avoids double updates
2021-06-28 16:16:22 +10:00
Martin Brennan a6b9289477
DEV: Remove old group form code (#13542)
We don't use this group form anymore
since
964da21817
when we revamped the UI
2021-06-28 14:57:51 +10:00
Martin Brennan 4d0178deab
FIX: Do not show In Reply To for group SMTP emails (#13541)
We do not want to show the In Reply To section of the
group SMTP email template, it is similar to Context Posts
which we removed and is unnecessary.

This PR also removes the link to staged user profiles in
the email; their email addresses will just be converted
to regular mailto: links.
2021-06-28 13:19:17 +10:00
Alan Guo Xiang Tan fd8016d678 DEV: Remove unused attributes from topic-tracking-state. 2021-06-28 11:02:49 +08:00
Alan Guo Xiang Tan ff1c53dd6f FIX: Missing category edit icon.
Follow-up to 0e4b8c5318
2021-06-28 10:54:23 +08:00
Martin Brennan d3e27cabf6
FIX: Improve participant display in group SMTP emails (#13539)
This PR makes several changes to the group SMTP email contents to make it look more like a support inbox message.

* Remove the context posts, they only add clutter to the email and replies
* Display email addresses of staged users instead of odd generated usernames
* Add a "please reply above this line" message to sent emails
2021-06-28 10:42:06 +10:00
Martin Brennan 87684f7c5e
FEATURE: Use group SMTP job and mailer instead of UserNotifications change (#13489)
This PR backtracks a fair bit on this one https://github.com/discourse/discourse/pull/13220/files.

Instead of sending the group SMTP email for each user via `UserNotifications`, we are changing to send only one email with the existing `Jobs::GroupSmtpEmail` job and `GroupSmtpMailer`. We are changing this job and mailer along with `PostAlerter` to make the first topic allowed user the `to_address` for the email and any other `topic_allowed_users` to be the CC address on the email. This is to cut down on emails sent via SMTP, which is subject to daily limits from providers such as Gmail. We log these details in the `EmailLog` table now.

In addition to this, we have changed `PostAlerter` to no longer rely on incoming email email addresses for sending the `GroupSmtpEmail` job. This was unreliable as a user's email could have changed in the meantime. Also it was a little overcomplicated to use the incoming email records -- it is far simpler to reason about to just use topic allowed users.

This also adds a fix to include cc_addresses in the EmailLog.addressed_to_user scope.
2021-06-28 08:55:13 +10:00
dependabot[bot] f9886ecfa2
Build(deps-dev): Bump mocha from 1.12.0 to 1.13.0 (#13538)
Bumps [mocha](https://github.com/freerange/mocha) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/freerange/mocha/releases)
- [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md)
- [Commits](https://github.com/freerange/mocha/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-28 00:19:58 +02:00
Martin Brennan 69518bee15
FIX: Backfill topic_id for EmailLog (#13469)
In the previous commit 5222247
we added a topic_id column to EmailLog. This simply backfills it in
batches. The next PR will get rid of the topic method defined on EmailLog in favour
of belongs_to.
2021-06-28 08:15:52 +10:00
Jarek Radosz 203d56719d
UX: Improve blockquote styling in emails (#13527) 2021-06-25 20:13:46 +02:00
Roman Rizzi fa4e5e8dad
FEATURE: Render emojis on GitHub labels when oneboxing an issue. (#13531) 2021-06-25 14:48:36 -03:00
Jarek Radosz 61472d6aaa
DEV: Rename `hilight` to `highlight` (#13526) 2021-06-25 18:05:50 +02:00
Jarek Radosz b4f0a0fb94
FIX: Nil-filled CF arrays were not being deleted (#13518) 2021-06-25 11:34:51 +02:00
Bianca Nenciu 8ab6fd88ef
UX: Add notice when watched words are regexes (#13493)
There is a big difference between regular watched words and regular
expressions and this has been confusing in the past. This notice adds
an explanation.

This commit also reorganizes the code of the test modal.
2021-06-25 12:08:52 +03:00
Martin Brennan c3394ed9bb
DEV: Update aws-sdk-s3 gem for S3 multipart uploads (#13523)
We are a few versions behind on this gem. We need to update it
for S3 multipart uploads. In the current version we are using, we
cannot do this:

```ruby
Discourse.store.s3_helper.object(key).presigned_url(:upload_part, part_number: 1, upload_id: multipart_upload_id)
```

The S3 client raises an error, saying the operation is undefined. Once
I updated the gem this operation works as expected and returns a
presigned URL for the upload_part operation.

Also remove use of Aws::S3::FileUploader::FIFTEEN_MEGABYTES.
This was part of a private API and should not have been used.
2021-06-25 14:22:31 +10:00
awesomerobot 895df9c239 UX: margin improvement for mobile alerts 2021-06-25 09:18:06 +08:00
Alan Guo Xiang Tan 3b32b6bc13 DEV: Clean up state leak in `Site` tests. 2021-06-25 09:17:49 +08:00
dependabot[bot] 5c3109281d Build(deps): Bump faraday from 1.4.2 to 1.4.3
Bumps [faraday](https://github.com/lostisland/faraday) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v1.4.2...v1.4.3)

---
updated-dependencies:
- dependency-name: faraday
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-25 09:17:34 +08:00
Gerhard Schlager 51e4e5fde6 Remove unused strings 2021-06-25 00:16:29 +02:00
Gerhard Schlager a216862fe1 Fix spelling in `discourse_narrative_bot.new_user_narrative.flag.instructions`
This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/278/en-fr#51512

@discourse-translator-bot keep_translations_and_approvals
2021-06-25 00:16:29 +02:00
Penar Musaraj cb9e004121
UX: Make bulk select checkbox easier to target (#13517)
Adds a label element around the checkbox, so that user can more easily
hit the element. Quite useful when checking many items in topic list.
2021-06-24 11:46:26 -04:00
Mark VanLandingham 180c0c4dc3
FIX: Translation of plugin directory column on mobile (#13516) 2021-06-24 10:11:24 -05:00
Arpit Jalan 0adeddde61
FIX: follow redirects for inline/mini onebox (#13512) 2021-06-24 19:53:39 +05:30
Robin Ward a2b744ae25 DEV: Allow plugin tests to run in Ember CLI qunit 2021-06-24 10:13:35 -04:00
Roman Rizzi 2c918a3161
FEATURE: Staff can receive pending user reminders more frequently. (#13422)
* FEATURE: Staff can receive pending user reminders more frequently.

We now express the "pending_users_reminder_delay"  in minutes instead of hours so staff can have finer control over the delay.

We need to keep in mind that the reminders could still take up to 20 minutes, even when using a lower value. We send them from a scheduled job.

* Migrate to a new site setting for the reminders delay
2021-06-24 10:02:56 -03:00
David Taylor 20070f5089
DEV: Update script/promote_migrations (#13513)
Introduces the --plugins-base flag for updating plugins in a different directory. Followup to 49f39434c4
2021-06-24 13:57:23 +01:00
Andrei Prigorshnev cf1e8b2764
FEATURE: Accept the flag modal on CTRL + ENTER and CMD + ENTER (#13497)
We want to submit the flag modal on pressing CTRL + ENTER and CMD + ENTER.

Here's how our modals work:

Every modal can be dismissed by pressing ESC. This behaviour can be disabled for a specific modal if we need to.
Every modal can be submitted by pressing ENTER if the cursor wasn't on a text area or a form at the moment of pressing.
Now, the flag modal is actually a one big form and pressing ENTER doesn't submit it. I've added submitting by CTRL+ENTER but at first it was interfering with the basic modal submitting by ENTER. It's a pretty tricky thing to fix because we use the keyup event for submitting by ENTER and we need to use the keydown event for submitting with modifiers (because submitting by CMD+ENTER on Macs doesn't work with keyup).

Eventually, I fixed the problem just by adding a possibility to disable default submitting on ENTER (in the same way as we already have the possibility of disabling dismissing on ESC). Then I disabled default submitting for the flag form and implemented submitting by CTRL+ENTER and CMD+ENTER. This way everything is simple and robust. I did it only for the flag modal but it'll be easy and safe to add the same behaviour to another modal.
2021-06-24 14:13:38 +04:00
Joffrey JAFFEUX 2654a6685c
DEV: adds support for bannered until (#13417)
ATM it only implements server side of it, as my need is for automation purposes. However it should probably be added in the UI too as it's unexpected to have pinned_until and no bannered_until.
2021-06-24 11:35:36 +02:00
Alan Guo Xiang Tan 0e4b8c5318 PERF: Cache categories in Site model take 3.
Previous attempt resulted in custom fields going missing in the
serialized output.

This reverts commit 83a6ad32ff.
2021-06-24 13:30:51 +08:00
dependabot[bot] fd2aab09ef
Build(deps-dev): Bump test-prof from 1.0.5 to 1.0.6 (#13511)
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.5...v1.0.6)

---
updated-dependencies:
- dependency-name: test-prof
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-24 10:54:32 +10:00
Jarek Radosz 046a875222
DEV: Improve `script/downsize_uploads.rb` (#13508)
* Only shrink images that are used in Posts and no other models
* Don't save the upload if the size is the same
2021-06-24 00:09:40 +02:00
Mark VanLandingham 60a76737dc
FIX: Always serialize the correct attributes for DirectoryItems (#13510) 2021-06-23 14:55:17 -05:00
Kris 1702922a7c
UX: Fix mobile alert spacing (#13506) 2021-06-23 15:21:17 -04:00
Kris 958340b632
UX: Make it easier to hide the emoji on signup (#13509) 2021-06-23 15:20:54 -04:00
Neil Lalonde 1034e5fa65
FIX: increase max favorite badges to 6 (#13507)
Limit was 5 with the assumption that trust level badge
will be the 6th badge. With trust level badges disabled,
it should be possible to increase this to 6, or even more imo.
2021-06-23 14:53:09 -04:00
Mark VanLandingham 7c94efd6c9
FIX: Table header translations on admin users list (#13505) 2021-06-23 13:19:30 -05:00