Commit Graph

50145 Commits

Author SHA1 Message Date
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
David Taylor
e9387e238c
FIX: Do not follow redirects for twitter oneboxes (#22362)
Twitter is now redirecting anonymous users (with a browser-like user agent, which FinalDestination uses) to the login page. Skipping redirect-following for twitter.com will allow us to continue oneboxing tweets via the OpenGraph data and the API (when credentials are present).

https://meta.discourse.org/t/269371/17
2023-06-30 11:30:03 +01:00
Martin Brennan
e3ddc7c93d
DEV: Try fix flaky chat navigation spec (#22360)
Followup to e57070af92,
try to check for href of link first before clicking.
2023-06-30 14:03:22 +08: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
Alan Guo Xiang Tan
fd7b534a49
DEV: Update MessageBus to 4.3.7 (#22357)
Follow-up to 351005ef1b which didn't
actually upgrade MessageBus to the latest version.
2023-06-30 10:32:25 +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
Martin Brennan
58a3cdc6ae
DEV: Try fix flaky chat navigation spec (#22356)
Followup to e57070af92,
try to check for href of link first before clicking.
2023-06-30 09:08:29 +08:00
Alan Guo Xiang Tan
351005ef1b
DEV: Upgrade MessageBus to latest version. (#22355)
Previously it was pinned to 4.3.2 because 4.3.3 was broken. This has now
been resolved so we no longer need to pin MessageBus.
2023-06-30 08:14:16 +08:00
Gerhard Schlager
50f710bcae
DEV: Bump oj from 3.13.14 to 3.15.0 (#22352)
https://github.com/ohler55/oj/issues/789 has been fixed and SSE4.2 is disabled by default.
2023-06-30 07:39:55 +08:00
dependabot[bot]
37e7d0639b
Build(deps): Bump faraday from 2.7.7 to 2.7.8 (#22338)
Bumps [faraday](https://github.com/lostisland/faraday) from 2.7.7 to 2.7.8.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.7.7...v2.7.8)

---
updated-dependencies:
- dependency-name: faraday
  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-30 07:36:16 +08:00
Alan Guo Xiang Tan
e57070af92
DEV: Skip a flaky system test (#22354)
This has been flagged by our internal system as well and has been
failing on CI. Skip this for now to improve the stability of our system
test runs while we figure out why it is flaky.
2023-06-30 07:35:44 +08:00
Leonardo Mosquera
c83914e2e5
FIX: fix normalize_raw method for nil inputs in migration scripts (#22304)
Various migration scripts define a normalize_raw method to do custom processing of post contents before storing it in the Post.raw and other fields.

They normally do not handle nil inputs, but it's a relatively common occurrence in data dumps.

Since this method is used from various points in the migration script, as it stands, the experience of using a migration script is that it will fail multiple times at different points, forcing you to fix the data or apply logic hacks every time then restarting.

This PR generalizes handling of nil input by returning a <missing> string.

Pros:

    no more messy repeated crashes + restarts
    consistency

Cons:

    it might hide data issues
        OTOH we can't print a warning on that method because it will flood the console since it's called from inside loops.

* FIX: zendesk import script: support nil inputs in normalize_raw
* FIX: return '<missing>' instead of empty string; do it for all methods
2023-06-29 13:22:47 -03:00
dependabot[bot]
f2fe5bc84e
Build(deps): Bump uri from 0.12.1 to 0.12.2 (#22348)
Bumps [uri](https://github.com/ruby/uri) from 0.12.1 to 0.12.2.
- [Release notes](https://github.com/ruby/uri/releases)
- [Commits](https://github.com/ruby/uri/compare/v0.12.1...v0.12.2)

---
updated-dependencies:
- dependency-name: uri
  dependency-type: indirect
  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 17:46:23 +02: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
6b4762e450
DEV: Delete uglify asset codepath (#22346)
We no longer process any thrid-party assets with uglify
2023-06-29 12:23:46 +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
Jarek Radosz
507d705fb5
DEV: Add diffhtml composer preview specs (#22333)
(both fail with the updated diffhtml)
2023-06-29 09:37:44 +02:00
Joffrey JAFFEUX
ea0b8ca38c
FEATURE: allows to enable/disable threading in UI (#22307)
Enabling/Disabling threading has been possible through command line until now. This commit introduces two new UIs:

- When creating a channel, it will be available once the category has been selected
- On the settings page of a channel for admins
2023-06-29 07:19:12 +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
Martin Brennan
1194ed10e1
FEATURE: Track last_viewed_at datetime for channel members (#22294)
Whenever a user opens a channel or marks it read, we now
update the last_viewed_at datetime for that channel membership
record. This is so we will be able to show thread unread indicators
in the channel sidebar that clear independently of the main thread
unread indicators. This unread functionality will follow in another
PR.
2023-06-29 09:22:17 +10:00
Martin Brennan
58c14ba0f9
DEV: Remove AJAX usage in chat-channel model (#22320)
Addressing TODO about using chatApi in the ChatChannel model,
but since it's a model we cannot easily use the chatApi service.
The model function is only called in one place so we may as well
just move the call there since the component can use chatApi
2023-06-29 09:21:28 +10:00
Martin Brennan
58c8f91d9a
DEV: Use same excerpt everywhere in chat (#22319)
Followup to c6b43ce68b

We can just use the rich excerpt everywhere since we know
we don't need text_entities -- that introduced security issues
just to fix a spec.
2023-06-29 09:20:20 +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
David Taylor
ed70b16db6
DEV: Resolve poll plugin deprecation (#22330)
When using native class syntax, `observes` must be imported from `@ember-decorators/object`
2023-06-28 17:53:45 +01:00
Neil Lalonde
d6a82f1034
DEV: Don't print plugin changes in details blocks (#22328) 2023-06-28 11:28:08 -04: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
Jarek Radosz
6efc4bb065
DEV: Update highlightjs from 11.6.0 to 11.8.0 (#22312) 2023-06-28 09:40:30 +02:00
Martin Brennan
ccdc0822a8
DEV: Fix flaky thread navigation spec (#22323)
Introduced in cec68b3e2c,
this is flaky because if you click the back button before
the route is fully transitioned to the loaded thread,
we end up going to the history _before_ the thread list,
which ends up being the channel.

We need to make sure that everything is loaded for the
thread first, meaning the skeleton is not there.

Also exclude some noise from the capybara logs (image load failures)
2023-06-28 17:20:05 +10:00
Martin Brennan
c4c566846d
DEV: Get rid of old chat TODOs (#22324)
These are all well-known things we need to deal with
(e.g. scrolling and granular read in thread panel) or just
unnecessary to keep around.
2023-06-28 17:16:03 +10:00
Martin Brennan
41ebbab4ff
FIX: Chat threads N1 (#22322)
Followup to 1526d1f97d

This commit fixes an N1 for mentions/user status
when querying chat threads. This only happened if
any of the thread OMs had mentions.
2023-06-28 15:41:51 +10: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
Martin Brennan
1526d1f97d
FEATURE: Sort thread list by unread threads first (#22272)
* FEATURE: Sort thread list by unread threads first

This commit changes the thread list to show the threads that
have unread messages at the top of the list sorted by the
last reply date + time, then all other threads sorted by
last reply date + time.

This also fixes some issues by removing the last_reply
relationship on the thread, which did not work for complex
querying scenarios because its order would be discarded.

* FIX: Various fixes for thread list loading

* Use the channel.threadsManager and find the channel first rather
  than use activeChannel in the threads manager, otherwise we may
  be looking at differenct channels.
* Look at threadsManager directly instead of storing result for threads
  list otherwise it can get out of sync because of replace: true in
  other places we are loading threads into the store.
* Fix sorting for thread.last_reply, needed a resort.
2023-06-28 13:14:01 +10:00