Commit Graph

29780 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 6ae4d6cd4c
DEV: Fix edit nav menu modals not appearing on mobile (#22403)
What is the problem?

This regressed in fe294ab1a7 and we did
not have any tests on mobile to catch the regression. The problem was
that we were conditionally rendering the edit nav menu modals component
in the sidebar. However, the sidebar is collapsed on mobile when a
button is clicked. When the sidebar collapses, the edit nav menu modals
ended up being destroyed with it.
2023-07-04 11:11:47 +08:00
Alan Guo Xiang Tan fe294ab1a7
DEV: Switch edit nav menu tags/categories modal to component (#22401)
Why this change?

A new component based API for modals was introduced in
b3a23bd9d6. This commit moves the edit
navigation menu tags and categories modal to the new API.
2023-07-04 09:45:21 +08:00
Krzysztof Kotlarek 2f5cb0a280
UX: visual indicator for reorder sidebar links mode (#22379)
Bring back CSS which was removed here 10dce46886 (diff-fa3cff3fcf18e3677f75fd71989c9bbd1b9940a5ce73f9c9efa6c4cbb0123b97L34)
2023-07-04 09:56:52 +10:00
Jan Cernik 77732cd2b4
FIX: Minor Twitter onebox improvements (#22387) 2023-07-03 19:53:12 -03:00
Isaac Janzen de192b1fbd
DEV: Skip flaky post-inline-mention test (#22399) 2023-07-03 17:09:30 -05:00
Bianca Nenciu 6a50d79044
DEV: Update diffhtml to 1.0.0-beta.29 again (#22365)
This reverts commit d40da76c8e.
2023-07-03 19:38:43 +03:00
David Taylor 1b693d0d60
DEV: Set owner on widget instances (#22391)
This allows us to use `getOwner(this)` on widgets (without needing to resort to our custom `discourse-common/lib/get-owner` implementation which has a hacky fallback)
2023-07-03 17:34:24 +01:00
David Taylor 0790e9f4f1
FIX: Correctly intercept `<a href target="_self"` (#22077)
`_self` is the default, so we should treat it the same as having no value specified. This fixes navigation to links like `/my/...` in custom sidebar links.
2023-07-03 16:46:40 +01:00
Jan Cernik 9bbfb6e171
DEV: Update `hasTouchCapabilities` in `d-tooltip.js` (#22388) 2023-07-03 11:45:06 -03:00
Jan Cernik 585a2e4e77
FEATURE: Use rich user status tooltip everywhere (#21125)
- Inline mentions on posts
- Inline mentions on chat messages
- The user autocomplete for the composer
- The user autocomplete for chat
- The chat section of the sidebar
2023-07-03 11:09:41 -03:00
Krzysztof Kotlarek 7a204e754c
FIX: improve performance of post alerter job (#22378)
Recently, SQL query returning users who have muted category or tag were introduced, and it is causing performance issues.

It is much more effective to first get IDs of users who have CategoryUser/TagUsers related to specific topic and then in second query get relevant users.
2023-07-03 19:58:53 +10:00
David Taylor b3a23bd9d6
DEV: Introduce new component-based DModal API (#21304)
Ember 4.x will be removing the 'named outlet' feature, which were previously relying on to render modal 'controllers' and their associated templates. This commit updates the modal.show API to accept a component class, and also introduces a declarative API which can be used by including the <DModal component directly in your template.

For more information on the API design, and conversion instructions from the current API, see these Meta topics:

DModal API: https://meta.discourse.org/t/268304
Conversion: https://meta.discourse.org/t/268057
2023-07-03 10:51:27 +01:00
Jarek Radosz 45c504d024
DEV: Remove unused `testSelectKitModule` (#22363) 2023-07-03 11:23:41 +02:00
Alan Guo Xiang Tan 68a3328999
FIX: Tags in tag groups not shown in edit nav menu tags modal (#22382)
What is the problem?

Before this change, the edit navigation menu tags modal was not
displaying tags that belonged to a tag_group when the tags_listed_by_group
site setting was set to true. This is because we are relying on the
/tags endpoint which returned tags in various keys depending on the
tags_listed_by_group site setting. When the site setting is set to
true, tags under belonging to tag groups were returned in the
extra.tag_groups attribute.

What is the fix?

This commit fixes it by pushing all tags in returned under the
`tag_groups` attribute into the list of tags to displayed. In a
following commit, we will move away from the `/tags` endpoint to a
dedicated route to handle the listing of tags in the modal.
2023-07-03 14:29:05 +08:00
Martin Brennan db80a8ce79
FIX: Preload fonts before rerendering wizard style canvas (#22361)
]When changing fonts in the `/wizard/steps/styling` step of
the wizard, users would not see the font loaded straight away,
having to switch to another one then back to the original to
see the result. This is because we are using canvas to render
the style preview and this fails with a Chrome-based intervention
when font loading is taking too long:

> [Intervention] Slow network is detected. See
https://www.chromestatus.com/feature/5636954674692096 for more details.
Fallback font will be used while loading:
https://sea2.discourse-cdn.com/business7/fonts/Roboto-Bold.ttf?v=0.0.9

We can get around this by manually loading the fonts selected using
the FontFace JS API when the user selects them and before rerendering
the canvas. This just requires preloading more information about the
fonts if the user is admin so the wizard can query this data.
2023-07-03 11:30:26 +10:00
Martin Brennan 7de3cb9b02
FIX: Revert uppy aws-s3 upgrade (#22376)
Reverting 898e571a91
which is causing upload failures for site settings and custom
avatars, same reason this one was reverted:

e0a20398dd
2023-07-03 10:07:34 +10:00
dependabot[bot] 19b1ecdf86
Build(deps-dev): Bump eslint from 8.43.0 to 8.44.0 in /app/assets/javascripts (#22372)
Bumps [eslint](https://github.com/eslint/eslint) from 8.43.0 to 8.44.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.43.0...v8.44.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-07-03 07:10:40 +08:00
Jarek Radosz 5584fb1e3b
DEV: Clean up package.json files (#22349)
Motivation: aligning us with JS/Ember practices (runtime deps in `dependencies`, build/dev-time deps in `devDependencies`)

1. Move deps to devDeps where applicable (rule of thumb: it's a devDep unless it's required at runtime by the rails app or it's imported in the addon's code)
2. Remove unused dependencies and add missing ones (in addons)
3. Remove empty `repository` fields
4. Move `engines` and `ember` fields to the bottom
2023-06-30 13:01:45 +02:00
Martin Brennan e0a20398dd
Revert "Build(deps): Bump @uppy/aws-s3-multipart from 3.1.3 to 3.4.0 in /app/assets/javascripts (#22190)" (#22359)
This reverts commit d8f0f17b50.

This causes errors when uploading to S3 because we are missing
a getFilesByIds function in core which we have not updated
yet c.f. https://github.com/discourse/discourse/pull/22195

Tests don't catch this because tests only try uploads.json
uploading.
2023-06-30 14:05:19 +10:00
dependabot[bot] d8f0f17b50
Build(deps): Bump @uppy/aws-s3-multipart from 3.1.3 to 3.4.0 in /app/assets/javascripts (#22190)
Bumps [@uppy/aws-s3-multipart](https://github.com/transloadit/uppy) from 3.1.3 to 3.4.0.
- [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/aws-s3-multipart@3.1.3...@uppy/aws-s3-multipart@3.4.0)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3-multipart"
  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>
2023-06-30 10:32:41 +08:00
Krzysztof Kotlarek 3c019b1c0f
FIX: consistent sidebar section external links (#22343)
Before this change, links which required full reload because they are not in ember routes like `/my/preferences` or links to docs like `/pub/*` were treated as real external links. Therefore, they were opening in self window or new tab based on user  `external_links_in_new_tab` setting.

To be consistent with behavior when full reload links are in the post, they are treated as internal and always open in the same window.
2023-06-30 12:25:43 +10:00
dependabot[bot] 898e571a91
Build(deps): Bump @uppy/aws-s3 from 3.0.6 to 3.2.0 in /app/assets/javascripts (#22192)
Bumps [@uppy/aws-s3](https://github.com/transloadit/uppy) from 3.0.6 to 3.2.0.
- [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/aws-s3@3.0.6...@uppy/aws-s3@3.2.0)

---
updated-dependencies:
- dependency-name: "@uppy/aws-s3"
  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>
2023-06-30 09:09:33 +08:00
dependabot[bot] b902978fb6
Build(deps): Bump @uppy/utils from 5.2.0 to 5.4.0 in /app/assets/javascripts (#22191)
Bumps [@uppy/utils](https://github.com/transloadit/uppy) from 5.2.0 to 5.4.0.
- [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.2.0...@uppy/utils@5.4.0)

---
updated-dependencies:
- dependency-name: "@uppy/utils"
  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>
2023-06-30 09:09:11 +08:00
Jarek Radosz e8490a735b
DEV: Update sub-dependencies (#22325)
Achieved by running `yarn upgrade --latest` both yarn.lock directories, then reverting changes to package.json files and running `yarn` again.

I also de-duped yarn.lock files with `npx yarn-deduplicate && yarn`
2023-06-29 17:08:33 +02:00
marstall 60273e4508
FIX: DateTimeInputRange should show correct intervals with @relativeDate param (#22331) 2023-06-29 09:43:01 -04:00
Jarek Radosz a7421d3675
DEV: Remove unused `User` methods (#22347) 2023-06-29 12:23:59 +02:00
Jarek Radosz 3290c954f9
DEV: Fix random typos (#22345) 2023-06-29 12:23:28 +02:00
Jarek Radosz b61ea8e16d
FIX: A mobile header regression in 9cc2b5c (#22344)
Hiding extra UI when topic title is visible broke when the plugin outlet was added.
2023-06-29 10:36:27 +02:00
Krzysztof Kotlarek de2febcc0c
FIX: error when CategoryList tried to find relevant topics (#22339)
Recently, we added the option for watched tag/categories to take precedence over muted tag/categories. Therefore, `remove_muted_tags` is using `category_users` to check if categories are not watched. There was missing join in CategoryList which was causing an error.
2023-06-29 11:25:58 +10:00
dependabot[bot] 4c95f786c0
Build(deps-dev): Bump eslint-plugin-qunit in /app/assets/javascripts (#22337)
Bumps [eslint-plugin-qunit](https://github.com/platinumazure/eslint-plugin-qunit) from 7.3.4 to 8.0.0.
- [Release notes](https://github.com/platinumazure/eslint-plugin-qunit/releases)
- [Changelog](https://github.com/platinumazure/eslint-plugin-qunit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/platinumazure/eslint-plugin-qunit/compare/v7.3.4...v8.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-qunit
  dependency-type: direct:development
  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-06-29 01:09:34 +02:00
dependabot[bot] 09feb03056
Build(deps): Bump message-bus-client in /app/assets/javascripts (#22335)
Bumps [message-bus-client](https://github.com/discourse/message_bus) from 4.3.2 to 4.3.7.
- [Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
- [Commits](https://github.com/discourse/message_bus/compare/v4.3.2...v4.3.7)

---
updated-dependencies:
- dependency-name: message-bus-client
  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-06-29 01:00:36 +02:00
dependabot[bot] c5b4168d3a
Build(deps): Bump webpack in /app/assets/javascripts (#22336)
Bumps [webpack](https://github.com/webpack/webpack) from 5.88.0 to 5.88.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.88.0...v5.88.1)

---
updated-dependencies:
- dependency-name: webpack
  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-06-29 01:00:12 +02:00
Kris 9cc2b5cc20
DEV: add before-header-panel plugin outlet (#22285) 2023-06-28 17:26:30 -04:00
Keegan George c3fa85c450
UX: Make template fields fill the container width (#22334) 2023-06-28 13:29:36 -07:00
Keegan George c0707897ef
DEV: Make max length of template and name admin configurable (#22332) 2023-06-28 12:49:19 -07:00
Keegan George b6f03fcecd
DEV: Add support for uploads to form templates (#22232) 2023-06-28 12:49:05 -07:00
Mark VanLandingham acaea2b5c5
DEV: Add plugin_modifier for groups in `users_controller#search_users` (#22329) 2023-06-28 14:04:22 -05:00
Jarek Radosz d40da76c8e
Revert "DEV: Update diffhtml from 1.0.0-beta.20 to 1.0.0-beta.29 (#22311)" (#22327) 2023-06-28 14:49:20 +02:00
Jarek Radosz b74d0633d8
DEV: Fix default pretenders (#22326)
Prevent state leakage and update `/tags` to match the server
2023-06-28 13:59:17 +02:00
Ted Johansson 6fc62586a2
FEATURE: Show available interpolation keys when overriding translations (#22220)
This is the first of a number of PRs aimed at helping admins manage their translation overrides. It simply adds a list of available interpolation keys below the input field when editing an override.

It also includes custom interpolation key.
2023-06-28 19:03:04 +08:00
Jarek Radosz 7791bb1276
DEV: Update moment-timezone-with-data (#22313)
`Africa/Cairo` timezone introduced DST so I replaced it in tests with `America/Lima`
2023-06-28 11:33:55 +02:00
Jarek Radosz 80bd7d7509
DEV: Update diffhtml from 1.0.0-beta.20 to 1.0.0-beta.29 (#22311)
It was already up to date in package.json but wasn't plugged in.
2023-06-28 10:27:42 +02:00
Jarek Radosz 3ceed88854
DEV: Update chartjs-plugin-datalabels from 2.0.0 to 2.2.0 (#22310)
It was already up to date in the package.json but it wasn't "plugged in"
2023-06-28 10:12:12 +02:00
Alan Guo Xiang Tan 0d1d707213
FIX: Set `Jobs::BackfillSidebarSiteSettings` cluster concurrency to 1 (#22316)
What is the problem?

When an admin changes the default_sidebar_categories or default_sidebar_tags site settings and opts to backfill the setting,
we currently enqueue a sidekiq job to run the backfilling operation. When an admin changes those settings multiple times
within a short time frame, multiple sidekiq jobs with different backfilling parameters will be enqueued.
This is problematic if multiple jobs are executed concurrently as it may lead to situations where a job
with “outdated” site setting values is completed after a job with the “latest” site setting values.

What is the fix?

By setting `cluster_concurrency` to `1`, we ensure that only one of such
backfilling job will execute across all the sidekiq processes that are
deployed at any point in time. Since Sidekiq pops off job in the order
in which they are pushed, limiting the cluster concurrency here will
allow us to execute the enqueued `Jobs::BackfillSidebarSiteSettings`
jobs serially.
2023-06-28 13:07:46 +08:00
dependabot[bot] 51657bee8d
Build(deps-dev): Bump terser from 5.18.1 to 5.18.2 in /app/assets/javascripts (#22315)
Bumps [terser](https://github.com/terser/terser) from 5.18.1 to 5.18.2.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.18.1...v5.18.2)

---
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-06-28 09:42:23 +08:00
Alan Guo Xiang Tan aef7c2fe8f
UX: Use modals to edit categories and tags that appear in sidebar (#22295)
Why this change?

We are currently not fully satisfied with the current way to edit the
categories and tags that appears in the sidebar where the user is
redirected to the tracking preferences tab in the user's profile causing
the user to lose context of the current page. In addition, the dropdown
to select categories or tags limits the amount of information we can
display.

Since editing or adding a custom categories section is already using a
modal, we have decided to switch editing the categories and tags that
appear in the sidebar to use a modal as well.

This commit removes the `new_edit_sidebar_categories_tags_interface_groups` site setting and
make the modals the default for all users.
2023-06-28 07:20:31 +08:00
Jarek Radosz d3facec7d0
DEV: Update `@json-editor/json-editor` (#22308)
Manually tried it out by editing a json_schema setting of a theme component
2023-06-27 23:01:58 +02:00
Kris b30ef5d6a0
FIX: nest theme translation data so it saves (#22306) 2023-06-27 14:27:32 -04:00
Vinoth Kannan ca016c1655
DEV: add `group-messages` css class to user private messages group page. (#22302)
It adds `group-messages` and `group-NAME` css classes to the PM topic list.
2023-06-27 21:34:07 +05:30
Roman Rizzi f4e7a80600
DEV: Cache summarization strategy results. (#22230)
Updates the interface for implementing summarization strategies and adds a cache layer to summarize topics once.

The cache stores the final summary and each chunk used to build it, which will be useful when we have to extend or rebuild it.
2023-06-27 11:44:34 -03:00