Commit Graph

43206 Commits

Author SHA1 Message Date
Bianca Nenciu 79e55ec3f0
FIX: Remove List-Post email header (#14554)
* FIX: Remove List-Post email header

This header is used for mailing lists and can confuse some email clients
such as Thunderbird to display wrong replying options.

* FIX: Replace reply_key in email custom headers

Admins can add custom email headers from site settings. Email sender
will try to replace the reply key if %{reply_key} exists or remove the
header if a reply key does not exist.
2021-10-11 20:57:42 +03:00
Bianca Nenciu 8b99a7f73d
FIX: Move check if user is suspended later (#14566)
Calling create_notification_alert could still send a notification to a
suspended user. This just moves the check if user is suspended right
before sending the notification.
2021-10-11 20:55:18 +03:00
Roman Rizzi 7bc7e1aceb
FIX: update translation key to match flag reason. (#14573)
The refactor introduced in https://github.com/discourse/discourse/pull/14475 made this visible. Adds a safeguard to make sure translation is present before trying to linkify backticks.
2021-10-11 10:24:41 -03:00
Theodore Diamantidis 97178cd777
FIX: phpbb import - attachments not embedded in posts (#14570) 2021-10-11 14:27:54 +02:00
dependabot[bot] 9d28de0112
Build(deps): Bump excon from 0.86.0 to 0.87.0 (#14568)
Bumps [excon](https://github.com/excon/excon) from 0.86.0 to 0.87.0.
- [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.86.0...v0.87.0)

---
updated-dependencies:
- dependency-name: excon
  dependency-type: direct:production
  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-10-11 10:47:40 +01:00
David Taylor 821f14d8e0 DEV: Add basic acceptance tests for quote shortcut and fast-edit 2021-10-11 10:46:38 +01:00
David Taylor 9a3a5b19e9 DEV: Move duplicate `selectText` helper into qunit-helpers 2021-10-11 10:46:38 +01:00
David Taylor 9efc57f0c6 FEATURE: shortcuts for quote (q) and fast edit (e)
Reimplemented following the revert in ce0daae636

This approach uses the global `e`/`q` shortcuts, rather than shifting focus to the `quote-button` component. The current `quoteState` is used to determine whether the quote-button is currently visible. If yes, an appEvent transmits the intention to the quote-button component. If no, the old behavior is maintained.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2021-10-11 10:46:38 +01:00
Dan Ungureanu d0bd96e19c
FIX: Handle separately invite to topic and forum (#14562)
Invite is used in two contexts, when inviting a new user to the forum
and when inviting an existent user to a topic. The first case is more
complex and it involves permission checks to ensure that new users can
be created. In the second case, it is enough to ensure that the topic
is visible for both users and that all preconditions are met.

One edge case is the invite to topic via email functionality which
checks for both conditions because first the user must be invited to
create an account first and then to the topic.

A side effect of these changes is that all site settings related to
invites refer to inviting new users only now.
2021-10-11 12:19:31 +03:00
Sam f5cf647e57
DEV: add routes_lazy_route to boost boot-up time (#14545)
The lazy route initialization cuts down boot time of rails.

On my local system it cuts out 200ms of boot time taking me from 3.2 to 3 seconds.

This is not a radically enormous amount of time, but paper cuts add up, and a faster boot in dev will make everyone happy.

TBD if we want to also include this in production.

Gem is heavily maintained by @amatsuda, last commit 3 days ago.
2021-10-11 13:22:13 +11:00
Krzysztof Kotlarek 0301b775a8
FIX: topic_tracking_state not erroring when missing user_stat (#14559)
publish_unread should not error when UserStat is missing
2021-10-11 13:20:55 +11:00
Yasuo Honda 2944d2cdd6
FIX: Ruby 3 does not freeze interpolated string (#14567)
Ruby 2.7 or earlier `+contents` returns self.dup
when `frozen_string_literal: true`. However, Ruby 3.0 returns self
because this string is interpolated one, which is not frozen anymore.

This commit uses self.dup to return duplicated string regardless Ruby
versions.
https://bugs.ruby-lang.org/issues/17104
2021-10-11 13:20:18 +11:00
David Taylor 837bd5a6e5
FIX: Fix local-dates in non-post contexts, and in long topics (#14565)
- Stop looking up the topic title from the DOM. On long topics, the topic title may not be present. Instead, we can store the topic title in a data-title attribute during decorateCookedElement, and then access it later. This approach would also allow us to add customize titles per-local-date in future. If there is no topic title available (e.g. when local dates are used elsewhere in the UI), we use the site name to build a sensible default

- Don't require a postId for creating calendar events. We don't have postIds in non-post contexts. At the moment, the 'download ICS' function will fail without a valid postId, so that will need to be fixed in a future commit.
2021-10-08 20:22:52 +01:00
Robin Ward bef5223672 DEV: Plugin API for customizing text in the composer conditionally
Co-authored-by: Isaac Janzen <issac.janzen@discourse.org>
2021-10-08 13:58:18 -04:00
Rafael dos Santos Silva 3eb737c014
FIX: Correct password change path for password managers (#14561) 2021-10-08 14:53:14 -03:00
David Taylor ce0daae636
FIX: Resolve quoting issues by reverting new shortcuts (#14560)
This reverts the new e and q shortcuts for quick-edit, and quote. The current implementation of these is causing issues with quoting on mobile devices.

We intend restore these new shortcuts soon.

* Revert "FIX: Apply quote selection workaround to all browsers (#14558)"

This reverts commit 488f716c16.

* Revert "FIX: selection going missing in Safari (#14557)"

This reverts commit 538fe2cc31.

* Revert "UX: adds shortcuts for quote (q) and fast edit (e) (#14552)"

This reverts commit 2af6052307.
2021-10-08 15:31:43 +01:00
Bianca Nenciu ba81d1853b
FIX: Disable previews if diffhtml is enabled (#14537)
diffhtml should not rerender video and audio elements so there is no
point in having these.
2021-10-08 15:57:08 +03:00
Arpit Jalan 016524e244
DEV: use mailhog in our docker dev environment (#14549) 2021-10-08 11:10:46 +05:30
Penar Musaraj 488f716c16
FIX: Apply quote selection workaround to all browsers (#14558)
Firefox also needs this.
2021-10-07 16:17:14 -04:00
Penar Musaraj 538fe2cc31
FIX: selection going missing in Safari (#14557) 2021-10-07 14:55:38 -04:00
Andrei Prigorshnev e68dc0c598
DEV: add test cases that prove that sso can override username from "bob1" to "bob" (#14555)
The problem was reported a long time ago (https://meta.discourse.org/t/cannot-change-username-with-sso-enabled/31307). It's hard to say if this bag didn't exist or was fixed later, but test cases in this PR prove that this works now.
2021-10-07 22:29:24 +04:00
Penar Musaraj aa00960638
FIX: JS error when showing topic search results (#14551) 2021-10-07 11:47:01 -04:00
Roman Rizzi 9f3b82eeb2
DEV: Move settings to linkify to the serializer code. (#14553)
We aren't translating these settings, so it makes more sense to move them into the code. I added an instance method so plugins can add mappings for custom reasons.
2021-10-07 12:41:57 -03:00
Joffrey JAFFEUX 2af6052307
UX: adds shortcuts for quote (q) and fast edit (e) (#14552) 2021-10-07 17:22:28 +02:00
David Taylor a55642a30a
DEV: Various behind-the-scenes improvements to PresenceChannel (#14518)
- Allow the `/presence/get` endpoint to return multiple channels in a single request (limited to 50)
- When multiple presence channels are initialized in a single Ember runloop, batch them into a single GET request
- Introduce the `presence-pretender` to allow easy testing of PresenceChannel-related features
- Introduce a `use_cache` boolean (default true) on the the server-side PresenceChannel initializer. Useful during testing.
2021-10-07 15:50:14 +01:00
David Taylor ba380c5f52
DEV: Update invite API docs expires_at default (#14550) 2021-10-07 12:41:04 +01:00
David Taylor 7a52ce0d6d
FIX: Strip `discourse-logged-in` header during `force_anonymous!` (#14533)
When the anonymous cache forces users into anonymous mode, it strips the cookies from their request. However, the discourse-logged-in header from the JS client remained.

When the discourse-logged-in header is present without any valid auth_token, the current_user_provider [marks the request as ['logged out'](dbbfad7ed0/lib/auth/default_current_user_provider.rb (L125-L125)), and a [discourse-logged-out header is returned to the client](dbbfad7ed0/lib/middleware/request_tracker.rb (L209-L211)). This causes the JS app to [popup a "you were logged out" modal](dbbfad7ed0/app/assets/javascripts/discourse/app/components/d-document.js (L29-L29)), which is very disruptive.

This commit strips the discourse-logged-in header from the request at the same time as the auth cookie.
2021-10-07 12:31:42 +01:00
Penar Musaraj 8a377130f4
UX: Add keyboard shortcut for fast edits (#14543) 2021-10-07 11:25:58 +02:00
Penar Musaraj 0dbc83132a
DEV: Fix flaky search test (#14546) 2021-10-06 20:57:28 -04:00
Arpit Jalan be75d20fad
FIX: do not persist tags query param (#14527)
This commit fixes the inconsistent behaviour where a user lands on blank
page from the `/new-topic` route if the tag beign used does not have any
topic attached.

https://meta.discourse.org/t/tag-route-when-creating-a-topic-via-url/204973
2021-10-07 06:03:52 +05:30
Gerhard Schlager d6a24e9cd7
FIX: Tooltip in quick search didn't work (#14542) 2021-10-06 23:30:05 +02:00
Mark VanLandingham b632ffd802
DEV: Allow actions to change the manifest endpoint (#14522) 2021-10-06 15:41:52 -05:00
Penar Musaraj 6141ed31c7
UX: More consistent shortcut labels for macOS (#14538) 2021-10-06 16:20:43 -04:00
Robin Ward ae13839f98 FEATURE: Adds an API to exclude a tag from a TopicQuery
To exclude a tag from a topic list, add the `exclude_tag` query
parameter. For example: `latest?exclude_tag=music`
2021-10-06 16:07:08 -04:00
Blake Erickson 2fb9834821
DEV: Fix api docs for default calendar (#14539)
Change the type for default_calendar to a string.

The type specified for the default calendar in the api docs wasn't a
valid type. The linting in the api docs repo reports:

```
`type` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".
```

This linting currently is only in the `discourse_api_docs` repo.
2021-10-06 13:36:11 -06:00
Penar Musaraj 3d5ff23b16
UX: Fix alignment of composer when tags are disabled (#14535) 2021-10-06 14:58:08 -04:00
Blake Erickson aaf7ac8936
DEV: Add include_subcategories param to api docs (#14534)
* DEV: Add include_subcategories param to api docs

Adding the `include_subcategories=true` query param to the
`/categories.json` api docs.

Follow up to: fe676f334a

* fix spec
2021-10-06 12:34:03 -06:00
Daniel Waterworth 55dd9309e4
FIX: Check env for multisite config path even if config file exists (#14536)
... so that it can be overridden for rake tasks without changing the
config file.
2021-10-06 13:24:50 -05:00
Dax74 bdd2b5bb9c
Add LTI plugin (#14532)
Add LTI plugin to the Official list
2021-10-06 19:19:12 +02:00
Constanza a413a1e015
DEV: process image uploads in the Zendesk API import script (#14524) 2021-10-06 12:24:12 -04:00
Penar Musaraj e9b1d29d8b
UX: Revamp quick search (#14499)
Co-authored-by: Robin Ward <robin.ward@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2021-10-06 11:42:52 -04:00
Bianca Nenciu 98d2836eb4
FIX: Disable Show results if nobody voted (#14528) 2021-10-06 17:51:46 +03:00
Osama Sayegh d9d877fee7
DEV: Pass kwargs to the redis gem when calling methods/commands that we don't wrap (#14530)
This commit fixes the `eval` and `evalsha` commands/methods and any other methods that don't have a wrapper in `DiscourseRedis` and expect keyword arguments. I noticed this problem in Logster when I was trying to fetch some log messages in JSON format using the rails console and saw the messages were missing the `env` field. Logster uses the `eval` command to fetch messages `env`s:

dc351fd00f/lib/logster/redis_store.rb (L250-L253)

and that code was not fetching anything because `DiscourseRedis` didn't pass the `keys` keyword arg to the redis gem.
2021-10-06 17:42:04 +03:00
Bianca Nenciu 14efd17b7b
FIX: Hide form after password reset (#14526)
When hide_email_address_taken was disabled, the forgot password modal
showed a flash message and continued to display the form causing
confusion. This change shows the flash message only when an error occurs
and in all other cases it shows a success message and hides the form.
2021-10-06 17:16:59 +03:00
Bianca Nenciu f58ab2283d
FIX: Parse address lists in embedded emails (#14514)
Same fix is applied to emails immediately after being parsed because
long headers are sometimes in an invalid format.
2021-10-06 15:07:29 +03:00
Joffrey JAFFEUX 20e70d0ac5
DEV: adds a topic level bookmark toggle (#14471) 2021-10-06 11:53:57 +02:00
Krzysztof Kotlarek 4285706d97
FIX: local date trim when no time available (#14525)
When there is a blank space in the end of date, moment is returning a different value:

```javascript
  console.log(moment.tz("2021-09-09 ", "Australia/Sydney").toISOString());
  // 2021-09-09T00:00:00.000Z
  console.log(moment.tz("2021-09-09", "Australia/Sydney").toISOString());
  // 2021-09-08T14:00:00.000Z
```
2021-10-06 16:18:32 +11:00
Krzysztof Kotlarek 6f76fb960b
FIX: select all button on group assigned page (#14523)
Button is not working properly because `updateAutoAddTopicsToBulkSelect` function is not available.

Meta: https://meta.discourse.org/t/select-all-in-group-assigned-doesnt-work/205270
2021-10-06 16:18:16 +11:00
Krzysztof Kotlarek cb5b0cb9d8
FEATURE: save local date to calendar (#14486)
It allows saving local date to calendar.
Modal is giving option to pick between ics and google. User choice can be remembered as a default for the next actions.
2021-10-06 14:11:52 +11:00
Jordan Vidrine 6ab5f70090
UX: Change layout of invites page to match other user pages (#14520)
* UX: Change layout of invites page to match other user pages
2021-10-05 15:30:31 -05:00