Commit Graph

43040 Commits

Author SHA1 Message Date
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
016524e244 DEV: use mailhog in our docker dev environment (#14549) 2021-10-08 11:10:46 +05:30
488f716c16 FIX: Apply quote selection workaround to all browsers (#14558)
Firefox also needs this.
2021-10-07 16:17:14 -04:00
538fe2cc31 FIX: selection going missing in Safari (#14557) 2021-10-07 14:55:38 -04:00
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
aa00960638 FIX: JS error when showing topic search results (#14551) 2021-10-07 11:47:01 -04:00
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
2af6052307 UX: adds shortcuts for quote (q) and fast edit (e) (#14552) 2021-10-07 17:22:28 +02:00
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
ba380c5f52 DEV: Update invite API docs expires_at default (#14550) 2021-10-07 12:41:04 +01:00
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
8a377130f4 UX: Add keyboard shortcut for fast edits (#14543) 2021-10-07 11:25:58 +02:00
0dbc83132a DEV: Fix flaky search test (#14546) 2021-10-06 20:57:28 -04:00
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
d6a24e9cd7 FIX: Tooltip in quick search didn't work (#14542) 2021-10-06 23:30:05 +02:00
b632ffd802 DEV: Allow actions to change the manifest endpoint (#14522) 2021-10-06 15:41:52 -05:00
6141ed31c7 UX: More consistent shortcut labels for macOS (#14538) 2021-10-06 16:20:43 -04:00
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
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
3d5ff23b16 UX: Fix alignment of composer when tags are disabled (#14535) 2021-10-06 14:58:08 -04:00
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: fe676f334aa07489092b4d6af61d643ecb95aa27

* fix spec
2021-10-06 12:34:03 -06:00
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
bdd2b5bb9c Add LTI plugin (#14532)
Add LTI plugin to the Official list
2021-10-06 19:19:12 +02:00
a413a1e015 DEV: process image uploads in the Zendesk API import script (#14524) 2021-10-06 12:24:12 -04:00
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
98d2836eb4 FIX: Disable Show results if nobody voted (#14528) 2021-10-06 17:51:46 +03:00
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
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
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
20e70d0ac5 DEV: adds a topic level bookmark toggle (#14471) 2021-10-06 11:53:57 +02:00
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
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
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
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
e5c257e5b5 FIX: Reenable global setting HTML support. (#14521) 2021-10-05 16:25:41 -03:00
fe676f334a FEATURE: Return subcategories on categories endpoint (#14492)
* FEATURE: Return subcategories on categories endpoint

When using the API subcategories will now be returned nested inside of
each category response under the `subcategory_list` param. We already
return all the subcategory ids under the `subcategory_ids` param, but
you then would have to make multiple separate API calls to fetch each of
those subcategories. This way you can get **ALL** of the categories
along with their subcategories in a single API response.

The UI will not be affected by this change because you need to pass in
the `include_subcategories=true` param in order for subcategories to be
returned.

In a follow up PR I'll add the API scoping for fetching categories so
that a readonly API key can be used for the `/categories.json` endpoint. This
endpoint should be used instead of the `/site.json` endpoint for
fetching a sites categories and subcategories.

* Update PR based on feedback

- Have spec check for specific subcategory
- Move comparison check out of loop
- Only populate subcategory list if option present
- Remove empty array initialization
- Update api spec to allow null response

* More PR updates based on feedback

- Use a category serializer for the subcategory_list
- Don't include the subcategory_list param if empty
- For the spec check for the subcategory by id
- Fix spec to account for param not present when empty
2021-10-05 12:12:31 -06:00
766d337d42 FIX: Display embeddable host's post to category. (#14517)
The host's category was successfully updated on the database, but the category property was not properly set when rendering the component for the first time.
2021-10-05 13:59:27 -03:00
dbbfad7ed0 FIX: Support Ruby 3 keyword arguments 2021-10-05 11:25:00 -04:00
5569723321 DEV: Add plugin outlet to the bottom of flag modal (#14413)
This will be used by discourse-akismet to show the current status of the
Akismet scan (post marked as spam, not spam, etc).
2021-10-05 17:37:16 +03:00
0f5d737a61 Update translations (#14513) 2021-10-05 15:59:26 +02:00
437410e269 UX: Global notice no longer accepts HTML. (#14515) 2021-10-05 10:34:26 -03:00
d3a59e3f69 DEV: Use Set instead of array-as-an-object (#14511)
I don't know if JS engines were able to optimize-away those gigantic arrays but in any case that's a definite anti-pattern.
2021-10-05 14:35:32 +02:00
cd8a608d17 FIX: Ember CLI was always loading the admin payload in dev mode
The admin payload should only be loaded if the user is staff.
2021-10-05 08:34:10 -04:00
1552d06008 UX: capitalize unsubscribed email locale (#14512)
https://meta.discourse.org/t/unsubscribed-description-text-needs-a-capital-letter/205239
2021-10-05 17:13:22 +05:30
fbeb854ffc DEV: replace mailcatcher references with mailhog (#14500) 2021-10-05 15:48:06 +05:30
fbe9cd49b6 FIX: Vimeo private video oneboxes were broken (#14510) 2021-10-05 15:46:58 +05:30
71cf05fbc6 DEV: observe all elements to prevent any missed mutation (#14507) 2021-10-05 12:00:05 +02:00
74a9c0509b FIX: Use addresses to compare email header (#14509)
Usually, when an email is received a user lookup is performed using the
email address found in the `From` header. When an email has an
`X-Original-From` header, if it is equal to `Reply-To` then it uses that
one instead. The comparison was sensitive to whitespaces and other
insignificant characters such as quotes because it reconstructed the
`From` header.

For the fixture added in this commit, it compared the reconstructed
`From` header `John Doe <johndoe@example.com>` with the `Reply-To`
header `"John Doe"    <johndoe@example.com>`.
2021-10-05 12:42:19 +03:00
6a143030f8 FEATURE: Allow users to remove their vote (#14459)
They can use the remove vote button or select the same option again for
single choice polls.

This commit refactor the plugin to properly organize code and make it
easier to follow.
2021-10-05 11:38:49 +03:00
12856ab8c2 FIX: Stop tracking incoming message after navigating away take 2. (#14508)
* FIX: Stop tracking incoming message after navigating away take 2.

Previous fix in d82e5cd37c1c3b2377507ed0354bbdce6a96ae99 resulted in
counts being flappy as we cleared the active inbox between routes.

Co-authored-by: Osama Sayegh <asooomaasoooma90@gmail.com>
2021-10-05 15:00:44 +08:00