Commit Graph

30403 Commits

Author SHA1 Message Date
Jarek Radosz
dac4f97032
DEV: Convert reviewable-bundled-action to gjs (#23320) 2023-08-31 16:59:19 +02:00
Jarek Radosz
06a9963cbb
DEV: Don't fetch tagNotifications when additional tags are present (#23351)
We don't display them, see: 006a5166e5/app/assets/javascripts/discourse/app/components/d-navigation.js (L55-L55)
2023-08-31 16:40:33 +02:00
Penar Musaraj
006a5166e5
DEV: Refactor rp_id and rp_name (#23339)
They're both constant per-instance values, there is no need to store them
in the session. This also makes the code a bit more readable by moving
the `session_challenge_key` method up to the `DiscourseWebauthn` module.
2023-08-31 09:11:23 -04:00
Alan Guo Xiang Tan
5724b7bccd
DEV: Add hidden cross_origin_opener_policy_header site setting (#23346)
Why this change?

As part of our ongoing efforts to security harden the Discourse
application, we are adding the `cross_origin_opener_policy_header` site setting
which allows the `Cross-Origin-Opener-Policy` response header to be set on requests
that preloads the Discourse application. In more technical terms, only
GET requests that are not json or xhr will have the response header set.

The `cross_origin_opener_policy_header` site setting is hidden for now
for testing purposes and will either be released as a public site
setting or be remove if we decide to be opinionated and ship a default
for the `Cross-Origin-Opener-Policy` response header.
2023-08-31 08:50:06 -04:00
Jarek Radosz
6bd66438d8
FIX: Add missing props to move-to-topic (#23349)
Fixes tagging topics in that modal.
2023-08-31 14:18:57 +02:00
Jarek Radosz
1c87bb7fe9
DEV: Update DButton uses (#23333)
1. Use `this.` instead of `{{action}}` where applicable
2. Use `{{fn}}` instead of `@actionParam` where applicable
3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded
4. Remove `btn` class (it's added automatically to all DButtons)
5. Remove `type="button"` (it's the default)
6. Use `concat-class` helper
2023-08-31 11:49:35 +02:00
Martin Brennan
253d4a154c
FIX: Confusing vague upload error (#23347)
When an upload fails and we don't have a specific error, we
show a generic one. But it's a little too generic -- it doesn't
even include the file name.

This commit shows the file name so you at least know which of your
uploads failed.
2023-08-31 18:02:00 +10:00
Vinoth Kannan
5a810fd6cc
UX: display warning message when uploads are not included in backup. (#23253)
Also, this PR will introduce a new checkbox in the modal window to manage whether the uploads should be included in the backup or not.
2023-08-31 10:21:07 +05:30
Martin Brennan
8ef569cda4
UX: Remove Plugin Settings tab (#23345)
This tab doesn't really provide anything useful, and can be quite
confusing in some cases. Each plugin is already listed below, and
you can navigate to their settings from there. We want to move away
from the catch-all Plugins category for site settings. Core plugins are
not shown in this list as at 97a812f022.
2023-08-31 12:11:39 +10:00
Meghna
2cd2d7d4d6
FIX: add mobile specific stylesheet for onebox (#23329) 2023-08-31 10:35:28 +10:00
Kris
556e59580e
DEV: add plugin outlet to mobile login (#23341) 2023-08-30 17:36:47 -04:00
Kris
6b375440f5
DEV: add plugin outlets to create/login (#23340) 2023-08-30 15:58:22 -04:00
David Taylor
2c58d456dd
DEV: Improve strategy for identifying ember-cli JS chunks (#23336)
Our Ember build compiles assets into multiple chunks. In the past, we used the output from `ember-auto-import-chunks-json-generator` to give Rails a map of those chunks. However, that addon is specific to ember-auto-import, and is not compatible with Embroider.

Instead, we can switch to parsing the html files which are output by ember-cli. These are guaranteed to have the correct JS files in the correct place. A `<discourse-chunked-script>` will allow us to easily identify which chunks belong to which entrypoint.

In future, as we update more entrypoints to be compiled by Embroider/Webpack, we can easily introduce new wrappers.
2023-08-30 18:47:06 +01:00
Jarek Radosz
f6cd8e5968
DEV: Remove redundant braces (#23321) 2023-08-30 10:37:03 +02:00
dependabot[bot]
4f830d7561
Build(deps): Bump @uppy/utils in /app/assets/javascripts (#22767)
Bumps [@uppy/utils](https://github.com/transloadit/uppy) from 5.4.0 to 5.4.3.
- [Release notes](https://github.com/transloadit/uppy/releases)
- [Changelog](https://github.com/transloadit/uppy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/transloadit/uppy/compare/@uppy/utils@5.4.0...@uppy/utils@5.4.3)

---
updated-dependencies:
- dependency-name: "@uppy/utils"
  dependency-type: direct:production
  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>
2023-08-30 12:50:46 +10:00
Martin Brennan
bbd908ae09
FIX: Add hashtag placeholder when chat message sent (#23287)
This commit fixes an issue from 2ecc8291e8
where the user sees an ugly plain #hashtag when sending a chat
message. Now, we add a basic placeholder that looks like the
cooked hashtag with a grey square, which is then filled in
once the "sent" message bus event for the message comes back,
and we do decorateCooked on the message to fill in the proper
hashtag details.
2023-08-30 11:31:34 +10:00
dependabot[bot]
f97aef4b27
Build(deps-dev): Bump terser in /app/assets/javascripts (#23319)
Bumps [terser](https://github.com/terser/terser) from 5.19.2 to 5.19.3.
- [Changelog](https://github.com/terser/terser/blob/v5.19.3/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.19.2...v5.19.3)

---
updated-dependencies:
- dependency-name: terser
  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>
2023-08-30 00:35:57 +02:00
Renato Atilio
58b49bce41
FEATURE: support to initial values for form templates through /new-topic (#23313)
* FEATURE: adds support for initial values through /new-topic to form templates
2023-08-29 18:41:33 -03:00
Kris
8dddc9eb39
DEV: remove broken margin removal (#23318) 2023-08-29 17:11:38 -04:00
Renato Atilio
f49389309a
FIX: no form template logic when editing posts (#23317) 2023-08-29 16:07:33 -03:00
Isaac Janzen
6650aa18f5
DEV: Convert move-to-topic modal to component-based API (#23293)
<img width="654" alt="Screenshot 2023-08-28 at 2 49 04 PM" src="https://github.com/discourse/discourse/assets/50783505/5fc4dfb5-a7da-4a2b-a524-e81b5039efe6">
<img width="745" alt="Screenshot 2023-08-28 at 2 48 47 PM" src="https://github.com/discourse/discourse/assets/50783505/4432338e-ba05-4206-8553-eb69f8b31b4f">
<img width="448" alt="Screenshot 2023-08-28 at 2 48 44 PM" src="https://github.com/discourse/discourse/assets/50783505/6d6c305d-396b-488a-9ee9-bc41773dd98b">
<img width="747" alt="Screenshot 2023-08-28 at 2 48 42 PM" src="https://github.com/discourse/discourse/assets/50783505/9279f591-ca4a-4152-81c5-71d79dbcbc10">
<img width="671" alt="Screenshot 2023-08-28 at 2 40 42 PM" src="https://github.com/discourse/discourse/assets/50783505/dea02b8b-cf87-45bb-8466-449367b5609a">
<img width="643" alt="Screenshot 2023-08-28 at 2 40 37 PM" src="https://github.com/discourse/discourse/assets/50783505/e422b9b0-89b5-4681-91db-89b8eee05872">
2023-08-29 13:50:13 -05:00
Jordan Vidrine
480419565f
FIX: Remove border radius on more topics container buttons: (#23314) 2023-08-29 12:02:38 -05:00
Keegan George
f753918cf5
DEV: Add after-composer-title-input outlet (#23303) 2023-08-29 09:14:05 -07:00
Isaac Janzen
2671de3f86
DEV: Convert post-enqueued modal to component-based API (#23295) 2023-08-29 11:09:57 -05:00
Blake Erickson
5d438f805c
DEV: Add rake command to help detect dead settings (#23300)
* DEV: Add rake command to help detect dead settings

Some Site Settings may still exist but are no longer being used in the
core discourse code or in related plugins. This rake task will help
identify any unused (aka: dead) settings by using the `rg` command to
search for them.

You can execute the rake task by using this command:

`LOAD_PLUGINS=1 bin/rails "site_settings:find_dead"`

* Add env variable, apply feedback
2023-08-29 09:42:52 -06:00
Penar Musaraj
76f4142d3f
Revert "A11Y: Improve setting focus to post" (#23311)
This reverts commit 9b3fc8081a.
2023-08-29 09:24:16 -04:00
Meghna
d47a3e053a
UX: settings are misaligned when translations are too long (#23308) 2023-08-29 18:17:12 +05:30
Meghna
60a34b0908
UX: Fix github onebox on mobile (#23306)
* UX: Fix github onebox on mobile

* UX: Fix github onebox on mobile
2023-08-29 16:36:20 +05:30
Ted Johansson
7a4119846c
FIX: Include 'notify staff' separator in chat message flag modal (#23301)
When flagging a chat message, and options included both notifying user and notifying staff, the modal was missing the separating text. This was happening because the #staffFlagsAvailable method was based on post flags, and the model for chat flags is slightly different. This fixes that by delegating to the relevant flag target object.
2023-08-29 15:26:14 +08:00
Martin Brennan
e562bb1f43
DEV: Remove reviewable action custom_modal and use new action-based modal API (#23258)
This removes the custom_modal implementation for the
reviewable items and uses the new modal patterns defined at
https://meta.discourse.org/t/converting-modals-from-legacy-controllers-to-new-dmodal-component-api/268057

Only one plugin (discourse category experts) was using this API,
that has been fixed up here https://github.com/discourse/discourse-category-experts/pull/117

Also adds `registerReviewableActionModal` to allow for plugins and
core to map a reviewable action ID to an actual
JS class for the modal and improves docs for plugin API functions
used by reviewable-item.
2023-08-29 14:36:20 +10:00
dependabot[bot]
27ebbd2f8d
Build(deps-dev): Bump @babel/standalone from 7.22.12 to 7.22.13 in /app/assets/javascripts (#23299)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.22.12 to 7.22.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.13/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  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>
2023-08-29 08:21:48 +08:00
Isaac Janzen
026cd3e532
DEV: Convert flag modal to component-based API (#23279)
# Topic Flag
<img width="587" alt="Screenshot 2023-08-28 at 10 53 12 AM" src="https://github.com/discourse/discourse/assets/50783505/6ffe4e47-05a6-406c-9d1b-899ff4d5c2c9">

# Post Flag
<img width="620" alt="Screenshot 2023-08-28 at 10 52 44 AM" src="https://github.com/discourse/discourse/assets/50783505/1f893916-b62f-4825-a337-4c0e0e4ce3af">

# Chat Flag
<img width="648" alt="Screenshot 2023-08-28 at 10 52 31 AM" src="https://github.com/discourse/discourse/assets/50783505/e79444e8-a8b1-4f05-9b47-03d425bc9085">
2023-08-28 16:51:58 -05:00
Roman Rizzi
cf71f8358e
FIX: Typo in summary URL (#23298) 2023-08-28 18:06:36 -03:00
Roman Rizzi
e20de81de3
FIX: Display summaries for anonymous users. (#23294)
Streaming doesn't work for anonymous users because we scope updates to the current user. Since they can only see cached summaries, we can skip the streaming parameter and update it directly with the ajax response.
2023-08-28 17:29:48 -03:00
Jordan Vidrine
d8b62c2275
FIX: Update search-menu.scss (#23292)
Remove overflow hidden, which is causing issues on windows
2023-08-28 11:04:41 -05:00
Isaac Janzen
6870f38e87
DEV: Convert feature-topic modal to component-based API (#23277)
Updated styles with some sign off from @jordanvidrine 



<img width="655" alt="Screenshot 2023-08-28 at 9 07 47 AM" src="https://github.com/discourse/discourse/assets/50783505/31b453ef-a787-436f-9fd9-48c9cd3a2e81">
2023-08-28 09:41:14 -05:00
David Taylor
81d8c6ba6c
UX: Prevent initial jump when dragging topic timeline scroller (#23291)
Previously, when dragging the timeline scroller, we would position it purely based on the current cursor position. That means that if you started dragging it from anywhere other than the centre, the scroller will 'jump' suddenly to centre itself on the cursor.

This commit measures the offset of your cursor when the drag starts, and maintains it throughout the drag. So for example, if you start dragging at the bottom of the scroller and drag one pixel up, the scroller will only move by 1px.

This should make the UX much smoother, especially on large topics.
2023-08-28 15:00:32 +01:00
Jarek Radosz
6f1d666323
DEV: Make index.html a valid html (#23289)
Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-08-28 14:44:38 +02:00
David Taylor
33d5845991
FIX: Avoid scroll jumping for topics on slow connections (#23290)
When the 'loading slider' navigation indicator is enabled, and a connection is very slow, we `display: none` most of the page and display a spinner. The `still-loading` body class for this was being added in the `afterRender` step in the Ember runloop. This meant that, depending on the order they were scheduled, other `afterRender` jobs may run before it. This caused an issue with topic scroll locations because we would attempt to scroll to an element which was `display: none` at the point its position was calculated.

This commit moves the `still-loading` class manipulations to the `render` step of the runloop, which is technically more correct, and means that anything scheduled in the `afterRender` step is guaranteed to run without the `display: none` CSS.

https://meta.discourse.org/t/276305/29
2023-08-28 12:23:02 +01:00
Sam
997c839626
FEATURE: display count of topics being dismissed in dialog (#23288)
Previous to this change it was unclear if all new would be dismissed or just
some of them

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-08-28 11:46:38 +02:00
dependabot[bot]
09acba17de
Build(deps-dev): Bump eslint from 8.47.0 to 8.48.0 in /app/assets/javascripts (#23281)
Bumps [eslint](https://github.com/eslint/eslint) from 8.47.0 to 8.48.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.47.0...v8.48.0)

---
updated-dependencies:
- dependency-name: eslint
  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>
2023-08-28 12:58:31 +08:00
Martin Brennan
5fc93b95cc
FIX: Improve admin plugin list and modernize code (#23256)
This commit contains a few improvements:

* Use LinkTo instead of a button with a weird action referencing the
  controller to navigate to the filtered settings for a plugin
* Add an AdminPlugin model with tracked properties and use that when
  toggling the setting on/off and in the templates
* Make it so the Settings button for a plugin navigates to the correct
  site setting category instead of always just going to the generic
  "plugins" one if possible
2023-08-28 10:48:59 +10:00
Ted Johansson
4b52269827
DEV: Move option to delete user under reviewable reject menu (#23257)
Follow-up to #23199 in which we moved the "delete user" options under the relevant action menu for flagged post. This change does the same, but to queued posts.
2023-08-27 10:05:05 +08:00
Isaac Janzen
aaf0b0f1cc
DEV: Convert feature-topic-on-profile modal to component-based API (#23275)
# Before
<img width="738" alt="Screenshot 2023-08-25 at 2 04 31 PM" src="https://github.com/discourse/discourse/assets/50783505/c0778da2-d062-48d9-93e8-4b481190fadc">


# After
<img width="750" alt="Screenshot 2023-08-25 at 2 04 34 PM" src="https://github.com/discourse/discourse/assets/50783505/07aa2bec-e282-424e-b87d-48f5104eb534">
2023-08-26 09:52:19 -05:00
Jordan Vidrine
1209efb63c
FIX: Adjust border-radius in multiple locations (#23278) 2023-08-25 16:09:18 -05:00
Penar Musaraj
a94834abd5
A11Y: Improve setting focus to post (#23243) 2023-08-25 14:45:56 -04:00
Isaac Janzen
058c8496f0
DEV: Convert explain-reviewable modal to component-based API (#23274)
# Before
<img width="826" alt="Screenshot 2023-08-25 at 12 49 10 PM" src="https://github.com/discourse/discourse/assets/50783505/25c2bf52-33f3-4b18-89c1-9826ed605519">

# After
<img width="632" alt="Screenshot 2023-08-25 at 12 52 37 PM" src="https://github.com/discourse/discourse/assets/50783505/0d6697f2-6226-4acc-8aac-031f4645db93">
2023-08-25 13:09:21 -05:00
Isaac Janzen
dcbfb8c54b
DEV: Convert edit-topic-timer modal to component-based API (#23252)
# Before
<img width="479" alt="Screenshot 2023-08-25 at 10 52 04 AM" src="https://github.com/discourse/discourse/assets/50783505/65ec8f94-d3e3-4520-a3f0-b265af069e83">

# After
<img width="569" alt="Screenshot 2023-08-25 at 10 53 44 AM" src="https://github.com/discourse/discourse/assets/50783505/35d12af7-c287-42f8-bf9c-d0ae1b5a08db">
2023-08-25 12:17:34 -05:00
Isaac Janzen
34f502f68d
DEV: Convert uploaded-image-list modal to component-based API (#23245)
<img width="660" alt="Screenshot 2023-08-24 at 4 55 01 PM" src="https://github.com/discourse/discourse/assets/50783505/3fb8360d-c8cd-4ff4-acb2-15843eb4f868">
2023-08-25 09:20:14 -05:00
Isaac Janzen
0496199090
FIX: Badge preview not displaying grant count (#23269)
<img width="510" alt="Screenshot 2023-08-25 at 8 19 38 AM" src="https://github.com/discourse/discourse/assets/50783505/9ebf467e-7b3b-49e2-91d9-43e37b838431">
2023-08-25 09:19:01 -05:00
Isaac Janzen
e7cb417aaf
DEV: Convert auth-token modal to component-based API (#23251)
<img width="744" alt="Screenshot 2023-08-24 at 6 41 15 PM" src="https://github.com/discourse/discourse/assets/50783505/a5df1a15-fbb0-43a9-acce-742ef484d70a">
2023-08-25 08:56:29 -05:00
Isaac Janzen
98f2e6ab12
DEV: Convert edit-user-directory-columns modal to component-based API (#23250) 2023-08-25 07:22:09 -05:00
Isaac Janzen
5c652dd7a1
DEV: Convert reseed modal to component-based API (#23232)
<img width="728" alt="Screenshot 2023-08-24 at 1 35 53 PM" src="https://github.com/discourse/discourse/assets/50783505/5532eea4-1238-43dc-b2b7-a511e78d1f97">
2023-08-25 07:21:38 -05:00
Isaac Janzen
c22e2de2d8
DEV: Convert form-template-validation-options modal to component-based API (#23236)
<img width="794" alt="Screenshot 2023-08-25 at 6 38 21 AM" src="https://github.com/discourse/discourse/assets/50783505/f5cf6fa0-7a2f-4e38-93e2-657fb01f6703">
2023-08-25 07:02:54 -05:00
Jarek Radosz
0b74ba7c66
DEV: Add color to testem output (#23266) 2023-08-25 13:44:26 +02:00
Isaac Janzen
3052779ea6
DEV: Convert staff-action-log-details modal to component-based API (#23240)
<img width="800" alt="Screenshot 2023-08-24 at 3 08 38 PM" src="https://github.com/discourse/discourse/assets/50783505/c498c49c-88ca-4b34-90a0-194f177b5856">
2023-08-25 06:43:52 -05:00
Isaac Janzen
0c26d8b375
DEV: Convert color-scheme-select-base modal to component-based API (#23234)
<img width="560" alt="Screenshot 2023-08-24 at 2 12 38 PM" src="https://github.com/discourse/discourse/assets/50783505/9180f090-2142-4818-bb40-78cf7c25e9fe">
2023-08-25 06:26:39 -05:00
David Taylor
3081d83ac5
DEV: Update user-topics-list to native class syntax (#23263) 2023-08-25 10:57:44 +01:00
Jarek Radosz
90ef8d3041
DEV: Add missing pluginId to a modifyClass test (#23265) 2023-08-25 11:44:42 +02:00
dependabot[bot]
f4afa2c5cc
Build(deps-dev): Bump @babel/standalone in /app/assets/javascripts (#23262)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.22.10 to 7.22.12.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.12/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  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>
2023-08-25 11:14:43 +02:00
dependabot[bot]
556fc05506
Build(deps-dev): Bump @babel/core in /app/assets/javascripts (#23224)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.10 to 7.22.11.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.11/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  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>
2023-08-25 10:51:49 +02:00
David Taylor
b26fd03692
DEV: Introduce ember-router-service-refresh-polyfill (#23261)
This provides a `refresh()` function on Ember's public router service. The feature was added to Ember in v4.1.0, but this polyfill will allow us to start using it straight away under 3.28
2023-08-25 09:32:54 +01:00
Ted Johansson
12cdd7db1a
DEV: Move option to delete user under reviewable agree menu (#23199)
As per discussion, we want to move the options to delete the user under the "Yes" menu of the review queue, since these options are often the most recommended, but also frequently missed because they are tucked away under their own menu.

In addition to the move, I removed the title case of the options so that it matches the other options in the "Yes" menu.
2023-08-25 10:53:56 +08:00
Blake Erickson
9238a9cf42
DEV: Display fuzzy site setting search results below direct matches (#23197)
DEV: Display fuzzy site setting search results below direct matches

When searching for site settings, in the results under the ALL category
all the fuzzy search results were showing first followed by any direct
matches. This change adjusts that so that fuzzy searches show below
direct matches.

Fuzzy results are now also sorted based on their gap calculation in
ascending order.
2023-08-24 17:47:40 -06:00
Isaac Janzen
eab3bfc8d0
DEV: Allow ForgotPassword emailOrUsername arg to be null (#23246) 2023-08-24 17:36:02 -05:00
Ty Correll
bffd61746b
UX: update styling for related/suggested (#23242)
This PR changes the icon color to always be the same color for Related/Suggested buttons, even when not selected or active.
2023-08-24 16:22:44 -05:00
Ty Correll
0944666232
UX: update styling for related/suggested (#23231)
* UX: update styling for related/suggested

This PR addresses state issues for icons of the Related & Suggested buttons, as well as well as fixes alignment issues for folding phones / tablets, wider mobile devices by moving styling to the desktop scss file; also replaces border with box-shadow.
2023-08-24 15:23:35 -05:00
Isaac Janzen
d7538d7c99
DEV: Remove updated modals from KNOWN_LEGACY_MODALS (#23239)
`KNOWN_LEGACY_MODALS` now correctly reflects the remaining modals to be upgraded to the component based Modal API
2023-08-24 15:12:18 -05:00
Isaac Janzen
59569a6e64
DEV: Remove unused admin-theme-item modal (#23233) 2023-08-24 14:14:51 -05:00
Andrei Prigorshnev
c519d60d50
DEV: Don't print warning about attempt to track status of a user without id in tests (#23228)
It is hard to catch and debug potential bugs related to live updates of 
user status (though, we haven't seen many such bugs so far). We have 
this `console.warn` statement that should help us to catch one class of 
such bugs:

70f1cc5552/app/assets/javascripts/discourse/app/models/user.js (L1384-L1389)

But in tests, we quite often operate with stubs of users that don't have ID, 
and this warning create unnecessary noise. This PR disable the warning in 
the testing environment.
2023-08-24 21:32:13 +04:00
Joffrey JAFFEUX
46c7e47f50
FIX: prevents setPanel to also set separated mode (#23227)
This could happen after you had already change the separation mode and would cause unexpected bugs.

This PR also adds more tests around using switch buttons with chat.
2023-08-24 18:21:28 +02:00
Jarek Radosz
70f1cc5552
DEV: Use esbuild to make DiscourseJsProcessor (#23223)
Reverts e2705df and re-lands #23187 and #23219.

The issue was incorrect order of execution of Rails' `assets:precompile` task in our own precompilation stack.

Co-authored-by: David Taylor <david@taylorhq.com>
2023-08-24 16:36:22 +02:00
Penar Musaraj
fdc2080bd8
DEV: Use ellipsis instead of three dots (#23193)
Also adds a note for translators for the `type_to_filter` string.

@discourse-translator-bot keep_translations_and_approvals
2023-08-24 10:10:41 -04:00
Renato Atilio
353306219b
UX: fix form template error label position (#23208) 2023-08-24 11:09:47 -03:00
Penar Musaraj
d51c076bf8
FIX: Add site name to sitelinks structured data (#23151) 2023-08-24 10:07:45 -04:00
David Taylor
e2705df0f4
Revert "DEV: Use esbuild to make DiscourseJsProcessor (#23187)" (#23221)
This reverts commit 4dfe25d062 and 4fdeb6281e. We are investigating an issue related to asset compilation and S3 assets
2023-08-24 13:25:44 +01:00
Jarek Radosz
4dfe25d062
DEV: Use esbuild to make DiscourseJsProcessor (#23187)
Co-authored-by: David Taylor <david@taylorhq.com>
2023-08-24 12:43:59 +02:00
Ty Correll
af34e910f2
UX: update styling for related/suggested (#23217)
* UX: update styling for related/suggested

This PR fixes styling for previous related/suggested changes' positioning being off for topics and updates the active icon color by removing a line that changed its active color.
2023-08-24 01:53:53 -05:00
Martin Brennan
e8a6079c29
FIX: Video thumbnail uploads interfering with subsequent uploads (#23216)
Short answer -- the problem is the video thumbnail generator & uploader
code added a couple of months back in f144c64e13.
It was implemented as another Mixin which overrides `this._uppyInstance`
when uploading the video thumbnail after the initial upload is complete,
which means the composer's `this._uppyInstance` value is overridden,
and it loses all of its preprocessors & upload code.

This is generally a problem with the Mixin based architecture that I
used for the Uppy code, which we need to remove at some point and
refacotr.

The most ideal thing to do here would be to convert this video thumbnail
code into an Uppy
[postprocessor](https://uppy.io/docs/uppy/#addpostprocessorfn) plugin,
which runs on each upload after they are complete. I started looking
into this, and the main hurdle here is adding support to tracking the
progress of postprocessors to
[ExtendableUploader](cf42466dea/app/assets/javascripts/discourse/app/mixins/extendable-uploader.js)
so that is out of scope at this time.

The fix here makes it so the ComposerVideoThumbnailUppy code is no
longer a Mixin, but acts more like a normal class, a pattern which
we have used in chat. I also clean up a lot of the thumbnail uploader
code and remove some unnecessary things.

Attempted to add a system spec, but video streaming does not work
in Chrome for Testing at this time, and it is needed for the
onloadedmetadata event.
2023-08-24 14:04:26 +10:00
Alan Guo Xiang Tan
8d72a51ae1
FIX: Infinite loading broken on group members list (#23214)
This regressed in 5a99243629 where
the condition to load more members into the list on the client side was
inverted.
2023-08-24 08:50:20 +08:00
Ty Correll
7c12f7d50a
UX: update styling for related/suggested (#23213)
This PR updates the styling for the related & suggested topics to distract less from the Reply buttons and clearly indicate its usage as tabs, also referred to as pills.
2023-08-23 19:28:14 -05:00
Krzysztof Kotlarek
10c25e9b86
FIX: sidebar URL full reload when anchor (#23121)
Ember LinkTo is not accepting anchors.
In that case, we should treat those links as external, which will trigger full reload.
2023-08-24 08:39:30 +10:00
Keegan George
92b2e10ee8
DEV: Create wrapper API for getCaretPosition() jQuery (#23194) 2023-08-23 10:17:21 -07:00
Carson Chang
d0e369946c
Update compose.scss (#23198) 2023-08-23 10:11:16 -07:00
Jarek Radosz
64846d587d
FIX: Topic timeline/progress switching edge-cases (#23202)
`Window`'s `resize` event was unreliable. You could shrink down the browser window so that the timeline would disappear but the progress element would not render to replace it.

This commit makes it rely on a media query listener instead so it 1. matches the css 2. fires only when that query result changes (perf win)
2023-08-23 15:04:40 +02:00
David Taylor
61527f5eaf
FIX: Ensure service-worker cache is cleaned correctly (#23204)
By default, the workbox-expiration plugin will not expire cache entries which include a `Vary` header in the response. This means that cached entries can build up until the browser storage quota is hit.

This commit introduces the `ignoreVary: true` option, so that deletion is performed correctly. This will only apply going forward, so this commit also bumps the cache version and deletes the old caches.

Ref https://github.com/GoogleChrome/workbox/issues/2206
2023-08-23 13:58:32 +01:00
Andrei Prigorshnev
9c0e50e1cc
FIX: hide tooltips when scrolling on mobile (#23098)
This fixes the problem reported in 
https://meta.discourse.org/t/custom-status-message-in-front-of-by-header-on-scroll/273320.

This problem can be reproduced with any tooltip created using the DTooltip 
component or the createDTooltip function.

The problem happens because the trigger for tooltip on mobile is click, and for tooltip 
to disappear the user has to click outside the tooltip. This is the default behavior 
of tippy.js – the library we use under the hood.

Note that this PR fixes the problem in topics, but not in chat. I'm going to investigate and 
address it in chat in a following PR.

To fix it for tooltips created with the createDTooltip function, I had to make a refactoring. 
We had a somewhat not ideal solution there, we were leaking an implementation detail 
by passing tippy instances to calling sides, so they could then destroy them. With this fix, 
I would have to make it more complex, because now we need to also remove onScrool 
handlers, and I would need to leak this implementation detail too. So, I firstly refactored 
the current solution in 5a4af05 and then added onScroll handlers in fb4aabe.

When refactoring this, I was running locally some temporarily skipped flaky tests. Turned out 
they got a bit outdated, so I fixed them. Note that I'm not unskipping them in this commit, 
we'll address them separately later.
2023-08-23 15:39:58 +04:00
Martin Brennan
cf42466dea
DEV: Add S3 upload system specs using minio (#22975)
This commit adds some system specs to test uploads with
direct to S3 single and multipart uploads via uppy. This
is done with minio as a local S3 replacement. We are doing
this to catch regressions when uppy dependencies need to
be upgraded or we change uppy upload code, since before
this there was no way to know outside manual testing whether
these changes would cause regressions.

Minio's server lifecycle and the installed binaries are managed
by the https://github.com/discourse/minio_runner gem, though the
binaries are already installed on the discourse_test image we run
GitHub CI from.

These tests will only run in CI unless you specifically use the
CI=1 or RUN_S3_SYSTEM_SPECS=1 env vars.

For a history of experimentation here see https://github.com/discourse/discourse/pull/22381

Related PRs:

* https://github.com/discourse/minio_runner/pull/1
* https://github.com/discourse/minio_runner/pull/2
* https://github.com/discourse/minio_runner/pull/3
2023-08-23 11:18:33 +10:00
Roman Rizzi
7d0e2b9e7b
FIX: Keep track of suggestion updates during scrolling and navigation. (#23190)
This PR changes how we track which lists are available for a topic and how we decide which is the active one. The new approach centralizes everything in the service, and exposes functions for adding/removing a list, which each calls via `did-insert/will-destroy` modifiers.

It makes it much easier to track and update state when navigated to another topic or PM, ensuring things get updated correctly.
2023-08-22 14:10:15 -03:00
David Taylor
b5b4a3f233
UX: Fix positioning of mobile show-more following 71ff3417 (#23189)
71ff3417 removed the mobile-specific template for discovery/topics. It was noted that this would introduce an additional `<div class='show-more'>` wrapper around the new topic indicator on mobile, but I didn't realise that it would cause positioning problems on mobile.

This commit moves the desktop-specific CSS into the desktop SCSS file so that it does not apply to mobile.
2023-08-22 17:16:12 +01:00
Jarek Radosz
3a37ecfccd
DEV: Remove unused files (#23185)
I believe those were supposed to be deleted in fe294ab1a77c1026b6996550eb8c36b6f07e1b73?
2023-08-22 16:50:44 +02:00
David Taylor
71ff3417a6
DEV: Remove dedicated mobile template for discovery/topics (#23179)
Separate mobile templates are a pattern we're moving away from. They are not supported by Ember, and make things more difficult to develop/test. The differences between the mobile and desktop templates for `discovery/topics` are very minimal, so they can be easily integrated.

The only feature missing from the main template was the new 'list header controls' UI. This commit introduces that to the main template inside an `mobileView` conditional.

Key changes in behavior, many of which could be considered bug fixes, are:

- Mobile will now include 'redirected reason'
- Mobile will now include shared drafts
- Mobile will now include before-topic-list and after-topic-list Plugin Outlets
- Mobile will now have a `<div class="show-more">` wrapper around the 'new or updated' UI, to match desktop. This does not seem to cause any visual change.

Mobile-specific template overrides of `discovery/topics` will continue to function as before - this should not be a breaking change for any themes/plugins.

Mobile-specific templates for the topic list and topic-list-item remain in place.
2023-08-22 15:42:51 +01:00
Jarek Radosz
fd8fdb060f
DEV: Clean up extraneous helper parens (#23186) 2023-08-22 16:42:22 +02:00
Blake Erickson
26b3c63c74
DEV: Tighten up fuzzy search site setting results (#23176)
Sometimes the fuzzy search would return too many site setting results
making it hard to find what you are searching for. This change still
allows for fuzzy searching but tightens up the criteria for being a
fuzzy match.

One example is searching for 'cheer', a term associated with a plugin,
previously returned ~55 search results. With this change it will return
~13 (Actual numbers depend on how many plugins your instance has).

Another example is searching for 'digest'. Previously returned ~37
results and now will return ~14.

Follow up to: e63e193a0a

See also: https://meta.discourse.org/t/276013
2023-08-21 19:04:57 -06:00
Isaac Janzen
742d71e99c
DEV: Finalize glimmer search menu (#23174)
There was a few outstanding items that needed cleaning up.
### Make sure we don't clear the topic context prematurely
##### Before
https://github.com/discourse/discourse/assets/50783505/e92e4d6f-f42c-4357-8f13-8fa9f1024ade

_getting to zero search characters would automatically clear the search context_

##### After
https://github.com/discourse/discourse/assets/50783505/fd805dfd-576d-4e32-b6b5-5b93c25a5782

### Style fixes
##### Before
<img width="498" alt="Screenshot 2023-08-21 at 4 37 31 PM" src="https://github.com/discourse/discourse/assets/50783505/70847db1-43ec-477e-a21a-54ef2de0af42">

##### After
<img width="500" alt="Screenshot 2023-08-21 at 4 38 36 PM" src="https://github.com/discourse/discourse/assets/50783505/98cfb2e9-7c4d-44a6-bde2-53b85318fed3">

##### Before
<img width="450" alt="Screenshot 2023-08-21 at 4 33 45 PM" src="https://github.com/discourse/discourse/assets/50783505/3e057a52-5d1c-4776-93d0-a48133a722bc">

##### After
<img width="451" alt="Screenshot 2023-08-21 at 4 34 30 PM" src="https://github.com/discourse/discourse/assets/50783505/77548f6c-a9cf-4cf8-88d8-ee249736d684">

##### Before
<img width="460" alt="Screenshot 2023-08-21 at 4 31 01 PM" src="https://github.com/discourse/discourse/assets/50783505/9da57868-bc66-4d84-9108-4ae705a0562b">

##### After
<img width="456" alt="Screenshot 2023-08-21 at 4 30 52 PM" src="https://github.com/discourse/discourse/assets/50783505/f9444546-97f2-4d1a-9f78-7407f0f32ae7">
2023-08-21 17:51:11 -05:00
Isaac Janzen
3eb8046dde
DEV: Update replaceWith on Route (#23153)
# Context
This PR was originally implemented in https://github.com/discourse/discourse/pull/22645 then reverted in https://github.com/discourse/discourse/pull/22693. We protect from aborted transition when _awaiting_ on `replaceWith` by utilizing [followRedirects()](https://api.emberjs.com/ember/5.1/classes/Transition/methods/followRedirects?anchor=followRedirects)

# Description
Per https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods

We are upgrading all `this.replaceWith` calls on routes to directly call the router service (`this.router.replaceWith`)
2023-08-21 16:53:54 -05:00
Joffrey JAFFEUX
3bb2f3a604
FIX: correctly recognizes URL with subfolder (#23173)
Prior to this fix minimizing a full page chat on a subfolder install would cause the drawer to not show.
2023-08-21 22:12:05 +02:00
David Taylor
201c39e68e
DEV: Ensure plugin raw connectors are transpiled to /raw-templates (#23170)
Transpiling to `/raw-templates` is important so that they are detected by the `eager-load-raw-templates` initializer. Prior to 16c6ab86 this wasn't a problem because all connector modules were being eager-loaded. Now that connectors are lazily loaded, it's critical that `eager-load-raw-templates` does the eager loading. This problem doesn't affect themes because they compile raw templates into an iife instead of a `define()` module.

Unfortunately we don't have any way to introduce automated testing for this part of our compilation pipeline. However, discourse-calendar will begin depending on this functionality imminently, so its tests will warn us of future regressions.
2023-08-21 19:24:49 +01:00
Mark VanLandingham
730f652255
DEV: Add plugin modifier locations for user search locations (#23169) 2023-08-21 12:23:42 -05:00
Joffrey JAFFEUX
932fd089c5
DEV: converts user-status modal to component (#23168) 2023-08-21 16:19:21 +02:00
David Taylor
121cd886a4
PERF: Improve rendering performance of empty PluginOutlets (#23165)
This commit introduces a 'shortcut' when rendering PluginOutlets which have no registered connectors. On my machine, this improves rendering performance of empty PluginOutlets by around 30-40% (tested by running tachometer on a `/latest` route with 600 plugin outlets).
2023-08-21 13:42:59 +01:00
Jarek Radosz
c48e29db02
DEV: Use object spread instead of Object.assign({}, …) (#23167)
Same behavior, more consistent and concise code.
2023-08-21 14:28:16 +02:00
Ted Johansson
928a6cd143
FIX: Delete fast typer reviewable when deleting user (#23162)
In most cases, deleting a user from outside the review UI will also delete any pending reviewables for that user. This was not working in some cases, e.g. for reviewables created due to "fast typer" violations.

This was happening because UserDestroyer only automatically resolves flagged posts.

After this change, in addition to existing checks, look for ReviewablePost where the post was created by the user and reject them if present.
2023-08-21 18:03:03 +08:00
dependabot[bot]
db40941deb
Build(deps): Bump ember-cli-babel in /app/assets/javascripts (#23157)
Bumps [ember-cli-babel](https://github.com/babel/ember-cli-babel) from 7.26.11 to 8.0.0.
- [Release notes](https://github.com/babel/ember-cli-babel/releases)
- [Changelog](https://github.com/babel/ember-cli-babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/ember-cli-babel/compare/v7.26.11...v8.0.0)

---
updated-dependencies:
- dependency-name: ember-cli-babel
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 11:27:24 +02:00
dependabot[bot]
42bcec6c79
Build(deps-dev): Bump sass in /app/assets/javascripts (#23156)
Bumps [sass](https://github.com/sass/dart-sass) from 1.66.0 to 1.66.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.66.0...1.66.1)

---
updated-dependencies:
- dependency-name: sass
  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>
2023-08-21 11:01:16 +02:00
Kris
2a49757f35
UX: update /new toggle styles, class names (#23154)
* Minor style adjustments
* Removes "all" count because it's redundant to the count on New
* Updates generic class names with -- modifier to follow BEM and help avoid class name collisions
* Hides the toggle when bulk select is enabled (the UI ends up being too busy)
2023-08-21 09:34:12 +08:00
Juan David Martínez Cubillos
477a5dd371
FEATURE: Digest suppression by tags (#23089)
* FEATURE: Digest suppression by tags

* fixed stree issues

* fixed code so untagged topics are not suppressed when suppressing certain tags
2023-08-18 14:28:20 -05:00
Joffrey JAFFEUX
b2b84cc957
FEATURE: implements user based sidebar mode (#23078) 2023-08-18 20:33:07 +02:00
David Taylor
82b16f4f47
DEV: Do not manipulate theme module paths at build-time (#23148)
Manipulating theme module paths means that the paths you author are not the ones used at runtime. This can lead to some very unexpected behavior and potential module name clashes. It also meant that the refactor in 16c6ab8661 was unable to correctly match up theme connector js/templates.

While this could technically be a breaking change, I think it is reasonably safe because:

1. Themes are already forced to use relative paths when referencing their own modules (since they're namespaced based on the site-specific id). The only time this might be problematic is when theme tests reference modules in the theme's main `javascripts` directory

2. For things like components/services/controllers/etc. our custom Ember resolver works backwards from the end of the path, so adding `discourse/` in the middle will not affect resolution.
2023-08-18 18:15:23 +01:00
Mark VanLandingham
291749e35b
DEV: Move PluginOutlet at bottom of TopicNavigation (#23149) 2023-08-18 11:41:09 -05:00
marstall
0dd1ee2e09
FIX: correct bulk invite expire time for DST (#23073)
This is a bug that happens only when the current date is less than 90 days from a date on which the time zone transitions into or out of Daylight Savings Time.

In these conditions, bulk invites show the time of day of their expiration as being 1 hour later than the current time.

Whereas it should match the time of day the invite was generated.

This is because the server has not been using the user's timezone in calculating the expiration time of day. This PR fixes issue by considering the user's timezone when doing the date math.

https://meta.discourse.org/t/bulk-invite-logic-to-generate-expire-date-bug/274689
2023-08-18 12:33:40 -04:00
Daniel Waterworth
91f560a521
DEV: Make every DistributedCache lazily instantiated (#23147) 2023-08-18 10:59:11 -05:00
Selase Krakani
87ebbec9b2
FIX: Pending post deletion by creator (#23130)
`ReviewableQueuedPost` got refactored a while back to use the more
appropriate `target_created_by` for the user of the post being queued
instead of `created_by`. The change was not extended to the `DELETE
/review/:id` endpoint leading to error responses for a user attempting
to deleting their own queued post.

This fix extends the `Reviewable` lookup implementation in
`ReviewablesController#destroy` and Guardian implementation to account
for this change.
2023-08-18 15:30:59 +00:00
Joffrey JAFFEUX
4661bcb5ea
FIX: correctly makes this accessible in the scope (#23146) 2023-08-18 17:20:59 +02:00
Kris
51e369a2c6
UX: update admin popular theme list (#23134) 2023-08-18 09:07:25 -04:00
Penar Musaraj
10c6b2a0c2
WIP: Rename Webauthn to DiscourseWebauthn (#23077) 2023-08-18 08:39:10 -04:00
David Taylor
16c6ab8661
DEV: Allow plugin outlets to be defined using gjs (#23142)
Previously we were discovering plugin outlets by checking first for dedicated template files, and then looking for classes to match them. This doesn't work for components which are entirely defined in JS (e.g. those authored with gjs, or those which are re-exports of a colocated component).

This commit refactors our detection logic to look for both class and template modules in a single pass. It also refactors things so that the modules themselves are required lazily when needd, rather than all being loaded during app boot.
2023-08-18 12:07:10 +01:00
dependabot[bot]
b99565450d
Build(deps-dev): Bump sass from 1.65.1 to 1.66.0 in /app/assets/javascripts (#23138)
Bumps [sass](https://github.com/sass/dart-sass) from 1.65.1 to 1.66.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.65.1...1.66.0)

---
updated-dependencies:
- dependency-name: sass
  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>
2023-08-18 12:44:40 +08:00
Osama Sayegh
09d3709ec9
FEATURE: New topics vs replies toggle for the new new view (#22920)
This PR adds a new toggle to switch the (new) /new list between showing topics with new replies (a.k.a unread topics), new topics, or everything mixed together.
2023-08-18 12:44:04 +08:00
Ted Johansson
79e3d4e2bd
FIX: Don't run post validations when hiding post (#23139)
When hiding a post (essentially updating hidden, hidden_at, and hidden_reason_id) our callbacks are running the whole battery of post validations. This can cause the hiding to fail in a number of edge cases. The issue is similar to the one fixed in #11680, but applies to all post validations, none of which should apply when hiding a post.

After some code reading and discussion, none of the validations in PostValidator seem to be relevant when hiding posts, so instead of just skipping unique check, we skip all post validator checks.
2023-08-18 10:55:17 +08:00
Ella E
9d7254184c
UX: remove border radius on tippy (#23133)
* UX: remove border radius on tippy

* DEV: use border radius var
2023-08-17 20:53:28 -06:00
Ella E
49a54d4cee
UX: remove boostrap mode rounded corners (#23132) 2023-08-17 14:59:45 -06:00
Roman Rizzi
53407f956c
FIX: Inject currentUser service for related-messages (#23128) 2023-08-17 16:08:38 -03:00
Daniel Waterworth
80a0d88e4c
FIX: Ensure javascript caches are unique per theme/theme_field (#23126)
We were assuming that this was the case before, but not enforcing it.
2023-08-17 13:57:04 -05:00
Andrei Prigorshnev
54092833b9
DEV: there is no need anymore to wrap export methods into enumerators (#22567)
After fbe0e4c we always pass a block into these methods.
So yield inside the export methods works and there is no need 
anymore to wrap them into enumerators.
2023-08-17 22:09:58 +04:00
Roman Rizzi
af30f9945a
UX: Use pill design on both mobile and desktop (#23124) 2023-08-17 14:37:11 -03:00
Joffrey JAFFEUX
95c4d97db3
FIX: do not mutate this.attrs and this.actions (#23125)
Prior to this fix we would always re-set `this.attrs` with `this.attrs` when defined, which is both wasteful but also dangerous as `this.attrs` can possibly error when mutated.
2023-08-17 18:07:06 +02:00
David Taylor
712bbf9b88
DEV: Convert discovery-sortable and tag-show to native class syntax (#23123) 2023-08-17 15:32:51 +01:00
Andrei Prigorshnev
e3c6d3c1cb
DEV: we don't need a collection of entities (#22745) 2023-08-17 17:00:19 +04:00
David Taylor
5a99243629
DEV: Introduce declarative hide-application-footer helper (#23088)
Previously, we had a `showFooter` boolean on the application controller which would be set true/false in various routes by different routes/controllers. A global `routeWillChange` hook would set it `false` before every route transition, and the destination route/controller would have to set it `true` for the footer to show correctly.

This commit replaces that with a new 'declarative' system. Instead of having to set the value true/false manually, UIs which need the footer to be hidden can simply include the `{{hide-application-footer}}` helper in their template when needed. The helper/service will automatically keep track of all the current invocations of that helper, and only show the footer when there are 0 invocations.

This significantly simplifies things, and removes the need for many observers and controller injections, both of which are considered 'code smells' in modern Ember applications.
2023-08-17 12:47:08 +01:00
Krzysztof Kotlarek
f8cd1da92a
FIX: increase sidebar URL limit to 1000 (#23120)
Before this change, sidebar URL had a limit of 200 characters. In some cases it is not enough, therefore it was increased to 1000.
2023-08-17 14:46:24 +10:00
Andrei Prigorshnev
f4e424d7d4
DEV: find_each in CSV exports (#22573)
So we have to order by calling `find_each(order: :desc)`.
Note that that will order rows by Id, not by `last_match_at`
as we tried before (though that didn't work).
2023-08-17 12:33:52 +10:00
Alan Guo Xiang Tan
20840c341f
FIX: /filter route input field not updating on route change (#23119)
What is the problem here?

When transiting between `/filter` routes with different `q` query
params, the input field is not updating to include the values in the `q`
query param. This was because we were setting the value of the input
field in the constructor of the controller but controllers are actually
singletons in Ember so setting the value of the input field is only done
once when the controller is initialised.

What is the fix here?

Instead of setting the value of the input field in the controller, we
set the value in the `setupController` hook in the route file.
2023-08-17 09:04:48 +08:00
Andreas Klöckner
9e568df316
FIX: reference to non-existent groups#remove_members in API key scope (#23042) 2023-08-17 07:20:55 +10:00
marstall
77626c088e
UX: support links in tag descriptions (#22994)
* scrub non-a html tags from tag descriptions on create, strips all tags from tag description when displayed in tag hover

* test for tag description links

* UX: basic render-tag test

* UX: fix linting

* UX: fix linting

* fix broken tests

* Update spec/models/tag_spec.rb

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>

* UX: use has_sanitizable_fields instead of has_scrubbable_fields to ensafen tag.description

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2023-08-16 11:43:54 -04:00
David Taylor
f3cc294470
FIX: Avoid double-counting pageviews when navigating with loading spinner (#23107)
104baab5 fixed double-counted pageviews for the initial page load. Under the default 'loading slider' implementation, that resolved all the known problems.

However, under the 'loading spinner', there is an additional problem. In 'spinner' mode, each navigation within the JS app involves transitioning to an intermediate 'loading' route. Previously, this intermediate state was being treated as a separate page by the app, and so any ajax requests fired during it would be counted as a distinct pageview. One known case of this is the `/presence/get` request which is made when logged-in users visit a topic.

This commit updates the logic to ignore 'intermediate' transitions, and introduces regression tests for both the 'spinner' and 'slider' modes.
2023-08-15 22:30:37 +01:00
Mark VanLandingham
51a976eab9
FIX: Display 'shown on X' user field flags (#23109)
In this commit 2.5 years ago, variables for showOnUserCard and showOnProfile were removed, but we still used them in the component. e29605b

This corrects the variable names and adds a test to confirm the text is now shown.
2023-08-15 15:59:04 -05:00
Renato Atilio
a33c878b55
DEV: allow to skip the configured form template via the composer service (#23108)
* DEV: allow `formTemplateIds` to be explicitly set via the composer service

* DEV: allow to skip the configured form template via the composer service
2023-08-15 17:03:38 -03:00
Roman Rizzi
7251d89919
DEV: Remove need for reloading cached summary thanks to Range#max (#23106) 2023-08-15 15:03:42 -03:00
Roman Rizzi
5683c90917
FIX: TopicSummarization workaround for Postgres' discrete range types (#23105)
Our code assumed the content_range interval was inclusive, but they are open-ended due to Postgres' [discrete range types](https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-DISCRETE), meaning [1,2] will be represented as [1,3).

It also fixes some flaky tests due to test data not being correctly setup and the registry not being resetted after each test.
2023-08-15 14:16:06 -03:00
Godfrey Chan
eb4971cb06
DEV: move xss dependency into core (#23094)
This resolves the issue in #23064.

This issue arises because we need to produce the trees for the
auxilary bundles in `ember-cli-build.js` to pass these trees as
argument to `app.toTree()`. In order to produce these trees, the
code internally need to set up babel, which deep-clones the addons'
babel configs.

When using `@embroider/macros`, the addon's babel config includes a
`MacrosConfig` object which is not supposed to be touched until the
configs are "finalized". In a classic build, the finalization step
happens when `app.toTree()` is called. In Embroider, this happens
somewhere deeper inside `CompatApp`.

We need to produce these auxilary bundle trees before we call
`app.toTree()` or before constructing `CompatApp` because they
need to be passed as arguments to these functions. So this poses a
tricky chicken-and-egg timing issue. It was difficult to find a
workaround for this that works for both the classic and Embroider
build pipeline.

Of all the internal addons that uses the auxilary bundle pattern,
this only affets `pretty-text` as it is (for now, at least) the
only addon that uses `@embroider/macros`.

Taking a step back, the only reason (for now, at least) it was
introduced was for the loader shim for the `xss` package. This
package is actually used inside the lazily loaded markdown-it
bundle. However, we didn't have a better way to include the dep
into the lazy bundle directly, so it ends up going into the main
addon tree, and, inturns, the discourse core bundle.

In core's main loader shim manifest, we already have an entry for
`xss`. This was perhaps a mistake at the time, but it doesn't make
a difference – as mentioned above, `xss` needs to be included into
the main bundle anyway.

So, for now, the simpliest solution is to avoid `@embroider/macros`
in these internal addons for the time being. Ideally we would soon
absorb these back into core as lazily loaded (`import()`-ed) code
managed by Webpack when we fully switch over to Embroider.
2023-08-15 16:13:26 +01:00
David Taylor
e722a14700
FIX: Correct select-kit positioning strategy in modals (#23096)
The new modal API removed the `#discourse-modal` id from the wrapper element, which meant that select-kit couldn't properly detect when it was inside a modal. This commit updates the detection to use `.fixed-modal` which will match both legacy and modern modals.
2023-08-15 10:50:41 +01:00
dependabot[bot]
23ca3f7e8e
Build(deps-dev): Bump message-bus-client from 4.3.7 to 4.3.8 in /app/assets/javascripts (#23091)
Bumps [message-bus-client](https://github.com/discourse/message_bus) from 4.3.7 to 4.3.8.
- [Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
- [Commits](https://github.com/discourse/message_bus/compare/v4.3.7...v4.3.8)

---
updated-dependencies:
- dependency-name: message-bus-client
  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>
2023-08-15 10:20:55 +08:00
Sérgio Saquetim
91e5fa506d
DEV: Add @model/@models support in d-navigation-item (#23074) 2023-08-14 17:03:19 -03:00
Isaac Janzen
a5542eeab0
DEV: Convert penalize-user modal to component-based API (#22960)
<img width="681" alt="Screenshot 2023-08-03 at 12 55 08 PM" src="https://github.com/discourse/discourse/assets/50783505/79cc045a-523d-45a2-8c33-04b556331358">

<img width="763" alt="Screenshot 2023-08-03 at 12 55 05 PM" src="https://github.com/discourse/discourse/assets/50783505/7196a97f-e4f4-4870-b8ac-77255d604c27">

<img width="711" alt="Screenshot 2023-08-03 at 12 55 11 PM" src="https://github.com/discourse/discourse/assets/50783505/a916a85d-8bdb-41fb-8210-1e0c06cf7cf1">
2023-08-14 13:02:54 -05:00
Isaac Janzen
ba46b34581
DEV: Convert badge-preview modal to component-based API (#22969)
<img width="801" alt="Screenshot 2023-08-03 at 4 00 27 PM" src="https://github.com/discourse/discourse/assets/50783505/f4abc35d-4f3f-47b1-af8d-be36df69fe07">
<img width="486" alt="Screenshot 2023-08-03 at 4 00 15 PM" src="https://github.com/discourse/discourse/assets/50783505/65be7f67-ecfa-4c0c-a1d4-01dfd7452e06">
2023-08-14 12:33:45 -05:00
Keegan George
61571bee43
UX: Add show more button to long post queued reviewables (#23075) 2023-08-14 10:11:30 -07:00
Isaac Janzen
ac4e854a04
DEV: Convert edit-badge-groupings modal to component-based API (#22984)
<img width="603" alt="Screenshot 2023-08-04 at 4 43 02 PM" src="https://github.com/discourse/discourse/assets/50783505/033192cc-2c5c-4be6-adde-9dd89b6b05c3">
<img width="594" alt="Screenshot 2023-08-04 at 4 42 59 PM" src="https://github.com/discourse/discourse/assets/50783505/efe8d8fe-f06c-4940-9c99-66a2f8fb3532">
2023-08-14 12:03:28 -05:00
Jordan Vidrine
d546f34f2f
FIX: Adjust badge overflow ellipsis (#23086) 2023-08-14 11:10:02 -05:00
Roman Rizzi
5bb2316756
FIX: Topic summary UI fixes. (#23085)
Hide summary wasn't working because it called the wrong action, and we must disabled the summarize button until streaming finishes.
2023-08-14 12:33:12 -03:00