Commit Graph

25599 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Penar Musaraj 3d5ff23b16
UX: Fix alignment of composer when tags are disabled (#14535) 2021-10-06 14:58:08 -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 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
Joffrey JAFFEUX 20e70d0ac5
DEV: adds a topic level bookmark toggle (#14471) 2021-10-06 11:53:57 +02: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
Roman Rizzi e5c257e5b5
FIX: Reenable global setting HTML support. (#14521) 2021-10-05 16:25:41 -03:00
Blake Erickson 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
Roman Rizzi 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
Yasuo Honda dbbfad7ed0 FIX: Support Ruby 3 keyword arguments 2021-10-05 11:25:00 -04:00
Dan Ungureanu 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
Jarek Radosz 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
Robin Ward 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
Joffrey JAFFEUX 71cf05fbc6
DEV: observe all elements to prevent any missed mutation (#14507) 2021-10-05 12:00:05 +02:00
Alan Guo Xiang Tan 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 d82e5cd37c 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
Alan Guo Xiang Tan 085eb56ea4
DEV: Allow `onStateChange` callbacks for PM topic tracking state. (#14479)
The changes here are in anticipation of a private plugin that will soon
be merged into Discourse core.
2021-10-05 14:12:01 +08:00
Alan Guo Xiang Tan d82e5cd37c
FIX: Stop incoming message tracking after navigating away. (#14498) 2021-10-05 11:17:20 +08:00
Penar Musaraj 724c836ffa
UX: Use consistent category badge font size in dropdowns (#14502) 2021-10-04 17:05:31 -04:00
Penar Musaraj 23df78acb3
UX: Fix label in search when tagging is disabled (#14503) 2021-10-04 17:04:34 -04:00
Roman Rizzi a9d20610d4
FIX: Make score's reason link building more explicit (#14475)
We relied on backticks to identify and replace site setting names with links. Unfortunately, some translations don't follow this convention, breaking this feature.

Additionally, this lets us linkify `category settings` and `watched words` without using HTML in the translations.

You may notice that I split the texts we want to linkify into two groups. I did this on purpose to emphasize those that should be translated (regular_links) from those who don't (site_settings_link). If you can think of a better solution, I'm open to suggestions.
2021-10-04 16:55:09 -03:00
Roman Rizzi 90a3fbc07b
DEV: Remove HTML setting type and sanitization logic. (#14440)
* DEV: Remove HTML setting type and sanitization logic.

We concluded that we don't want settings to contain HTML, so I'm removing the setting type and sanitization logic. Additionally, we no longer allow the global-notice text to contain HTML.

I searched for usages of this setting type in the `all-the-plugins` repo and found none, so I haven't added a migration for existing settings.

* Mark Global notices containing links as HTML Safe.
2021-10-04 15:40:35 -03:00
Andrei Prigorshnev 9f626f2735
FIX: empty state message on the user bookmarks page (#14257)
After adding an empty state banner to the user bookmarks page, we have found the bug. Steps to reproduce:

- Go to the user bookmarks page
- Search for something that doesn’t exist in bookmarks
- Click again Bookmarked on the sidebar or View All Bookmarks on the user menu again
2021-10-04 16:48:45 +04:00
Alan Guo Xiang Tan 4cade9d7f6
FIX: `Topic.similar_to` results in invalid query for certain locales. (#14497)
For `zh_CN`, we use the `cppjieba_rb` gem to remove stop words so
calling `Search.prepare_data` may result in an empty string.
2021-10-04 11:40:22 +08:00
Kris aba08d1929
DEV: add plugin outlet to categories page (#14491) 2021-10-01 15:50:50 -04:00
David Taylor b6937e936b
FIX: Do not show 'new or updated topics' for mobile categories page (#14490)
This banner should only show on the 'categories + latest topics' view, which is desktop-only

https://meta.discourse.org/t/204979
2021-10-01 16:52:35 +01:00
Roman Rizzi 4c2d5158c5
FIX: Follow the canonical URL when importing a remote topic. (#14489)
FinalDestination now supports the `follow_canonical` option, which will perform an initial GET request, parse the canonical link if present, and perform a HEAD request to it.

We use this mode during embeds to avoid treating URLs with different query parameters as different topics.
2021-10-01 12:48:21 -03:00
Alan Guo Xiang Tan f38fd1a5a7
FIX: Error loading suggested topics for anon users. (#14485)
Follow-up to fc1fd1b416
2021-10-01 10:53:05 +08:00
Alan Guo Xiang Tan dad4781806
UX: PM inboxes being expanded incorrectly when viewing tags. (#14478)
Follow-up to 9d5da2b383
2021-10-01 10:48:30 +08:00
Mark VanLandingham 0cc151c296
DEV: Export resetIdle function in desktop-notifications.js (#14474) 2021-09-29 12:41:31 -05:00
Jean 7737d56dd0
FIX: Notify incoming to categories and latest topics view specifically. (#14473) 2021-09-29 10:05:38 -04:00
David Taylor 928f102516
DEV: Clear pretender request log between test runs (#14456)
Previously we would store every FakeRequest object for all tests, resulting in many hundreds/thousands of objects in the `handledRequests` array.

This commit ensures all pretender state is reset between tests.
2021-09-29 14:43:55 +01:00
Andrei Prigorshnev b609f6c11c
FIX: restrict other user's notification routes (#14442)
It was possible to see notifications of other users using routes:
- notifications/responses
- notifications/likes-received
- notifications/mentions
- notifications/edits

We weren't showing anything private (like notifications about private messages), only things that're publicly available in other places. But anyway, it feels strange that it's possible to look at notifications of someone else. Additionally, there is a risk that we can unintentionally leak something on these pages in the future.

This commit restricts these routes.
2021-09-29 16:24:28 +04:00
Joffrey JAFFEUX 2d4b9595e8
DEV: uses standard browser_start_timeout (#14472) 2021-09-29 13:25:34 +02:00