Commit Graph

52162 Commits

Author SHA1 Message Date
Martin Brennan
1fc0ce1ac2
FIX: with_secure_uploads? could return nil in some cases (#24592)
When we check upload security, one of the checks is to
run `access_control_post.with_secure_uploads?`. The problem
here is that the `topic` for the post could be deleted,
which would make the check return `nil` sometimes instead
of false because of safe navigation. We just need to be
more explicit.
2023-11-28 13:12:28 +10:00
dependabot[bot]
b21a559663
Build(deps-dev): Bump fabrication from 2.30.0 to 2.31.0 (#24579)
Bumps [fabrication](https://gitlab.com/fabrication-gem/fabrication) from 2.30.0 to 2.31.0.
- [Changelog](https://gitlab.com/fabrication-gem/fabrication/blob/master/Changelog.markdown)
- [Commits](https://gitlab.com/fabrication-gem/fabrication/compare/2.30.0...2.31.0)

---
updated-dependencies:
- dependency-name: fabrication
  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-11-27 23:05:16 +01:00
Krzysztof Kotlarek
5551a71c55
FEATURE: increase tag description limit to 1000 (#24561)
Admin can add tag description up to 1000 characters.

Full description is displayed on tag page, however on topic list it is truncated to 80 characters.
2023-11-28 08:45:40 +11:00
Penar Musaraj
633deb5af8
UX: Submit security key edit form on Enter (#24532)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-11-27 16:11:12 -05:00
David Taylor
cda86e63bb
DEV: Run ember enforcement on merge-result ref (#24577)
Checking out the raw PR branch was only needed for the dependabot-helper workflow, but then I copy/pasted it here 🤦‍♂️

Followup to 16b6e86932
2023-11-27 20:27:32 +00:00
Blake Erickson
52617e7425
DEV: Auto link video placeholder posts (#24576)
* DEV: Auto link video placeholder posts

Followup to 91232847e3

Adds a migration to auto-link any video placeholder posts so that upload
references will be created.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-11-27 13:22:42 -07:00
David Taylor
6f3b087907 DEV: Generate Ember5 lockfile 2023-11-27 16:40:22 +00:00
David Taylor
16b6e86932 DEV: Introduce feature-flag for Ember 5 upgrade
This commit introduces the scaffolding for us to easily switch between Ember 3.28 and Ember 5 on the `main` branch of Discourse. Unfortunately, there is no built-in system to apply this kind of flagging within yarn / ember-cli. There are projects like `ember-try` which are designed for running against multiple version of a dependency, but they do not allow us to 'lock' dependency/sub-dependency versions, and are therefore unsuitable for our use in production.

Instead, we will be maintaining two root `package.json` files, and two `yarn.lock` files. For ember-3, they remain as-is. For ember5, we use a yarn 'resolution' to override the version for ember-source across the entire yarn workspace.

To allow for easy switching with minimal diff against the repository, `package.json` and `yarn.lock` are symlinks which point to `package-ember3.json` and `yarn-ember3.lock` by default. To switch to Ember 5, we can run `script/switch ember version 5` to update the symlinks to point to `package-ember5.json` and `package-ember3.json` respectively. In production, and when using `bin/ember-cli` for development, the ember version can also be upgraded using the `EMBER_VERSION=5` environment variable.

When making changes to dependencies, these should be made against the default `ember3` versions, and then `script/regen_ember_5_lockfile` should be used to regenerate `yarn-ember5.lock` accordingly. A new 'Ember Version Lockfiles' GitHub workflow will automate this process on Dependabot PRs.

When running a local environment against Ember 5, the two symlink changes will show up as git diffs. To avoid us accidentally committing/pushing that change, another GitHub workflow is introduced which checks the default Ember version and raises an error if it is greater than v3.

Supporting two ember versions simultaneously obviously carries significant overhead, so our aim will be to get themes/plugins updated as quickly as possible, and then drop this flag.
2023-11-27 16:40:22 +00:00
David Taylor
bdd71d49b5 DEV: Rename files in preparation for version feature-flagging 2023-11-27 16:40:22 +00:00
Renato Atilio
d93be8c7a1
FIX: remove trailing slashes and query params on meta-tag-updater's canonical url (#24445)
* FIX: remove trailing slashes and query params on meta-tag-updater's canonical url
2023-11-27 12:28:07 -03:00
Jan Cernik
ac9e804dbe
FEATURE: Add threads support to chat archives (#24325)
This PR introduces thread support for channel archives. Now, threaded messages are rendered inside a `details` HTML tag in posts.

The transcript markdown rules now support two new attributes: `threadId` and `threadTitle`.

- If `threadId` is present, all nested `chat` tags are rendered inside the first one.
- `threadTitle` (optional) defines the summary content.

```
[chat threadId=19 ... ]
thread OM

  [chat ... ]
  thread reply
  [/chat]

[/chat]
```

If threads are split across multiple posts when archiving, the range of messages in each part will be displayed alongside the thread title. For example: `(message 1 to 16 of 20)` and `(message 17 to 20 of 20)`.
2023-11-27 15:47:35 +01:00
Duc Manh
d506721eee
Fix: Handle failing to update parent category (#24401)
Co-authored-by: Jan Cernik <jancernik12@gmail.com>
2023-11-27 11:33:31 -03:00
David Taylor
a9bc732837
DEV: Prepare jquery integration for Ember upgrade (#24566)
- Update optional-features to tie the `jquery-integration` flag to the current ember version
- Wrap ember-4-specific logic in ember-cli-build with a version check
- Update global-compat.js to add the jquery global if it doesn't exist (i.e. if we're on a modern ember version)

Extracted from https://github.com/discourse/discourse/pull/21720. This is a no-op under our current Ember 3.28 version.
2023-11-27 14:01:27 +00:00
David Taylor
04164f7dda
DEV: Prepare lib/ember-events for Ember upgrade (#24565)
Extracted from https://github.com/discourse/discourse/pull/21720. This is a no-op under our current Ember 3.28 version.
2023-11-27 14:00:30 +00:00
David Taylor
056898c55f
DEV: Prepare modal implementation for Ember upgrade (#24564)
- Skip rendering DModalLegacy when running Ember 5
- Move named outlet inside the DModalLegacy component file
- Exclude that DModalLegacy template from the build when running Ember 5
- Skip LegacySupport version of modal service when running Ember 5
- Add error popup for legacy modals when running Ember 5

Extracted from https://github.com/discourse/discourse/pull/21720. This is a no-op under our current Ember 3.28 version.
2023-11-27 13:50:25 +00:00
David Taylor
59bae95190
DEV: Prepare module-shims for Ember upgrade (#24569)
Replaces console error with comment so that we can defer removing this code while we run modern Ember behind a feature flag
2023-11-27 13:50:09 +00:00
David Taylor
60b5800745
DEV: Prepare deprecation-workflow for Ember upgrade (#24568)
Extracted from https://github.com/discourse/discourse/pull/21720
2023-11-27 13:43:22 +00:00
David Taylor
824878f315
DEV: Prepare plugin-outlet for ember upgrade (#24567)
In modern versions of Ember, `this.parentView` is called internally during component init. We don't want our deprecation message to be triggered by that internal call, so we need an additional check.

Extracted from https://github.com/discourse/discourse/pull/21720
2023-11-27 13:43:02 +00:00
David Taylor
86f3e86596
FIX: Ensure topic route does not replaceState after navigation (#24563)
This hook is `cancel()`'d in a willTransition hook, but that isn't always enough. It might still be scheduled if there is a scroll event between `willTransition`, and the transition actually completing. Following c2d94be06e, this kind of scroll event happens when the loading indicator is set to 'spinner'. This would put the router in a weird state and cause navigation issues.

Also takes the opportunity to remove JQuery from this code path

https://meta.discourse.org/t/286463/15
2023-11-27 11:35:59 +00:00
Jarek Radosz
b1e43425bf
DEV: Don't use attrs (#24323) 2023-11-27 12:16:31 +01:00
dependabot[bot]
e05dbba845
Build(deps): Bump ember-auto-import in /app/assets/javascripts (#24556) 2023-11-27 11:12:00 +01:00
dependabot[bot]
68803a6b7d
Build(deps-dev): Bump jsdom in /app/assets/javascripts (#24557) 2023-11-27 11:09:42 +01:00
Alan Guo Xiang Tan
36a9d4df3a
DEV: Don't depend on assets path to determine layout that is rendered (#24562)
Why this change?

In the `invites_controller_spec.rb` file, we had several tests that were
checking for assets path in the response's body to determine which
layout has been rendered. However, those test fails if `bin/ember-cli
--build` has been run locally.

What does this change do?

Instead of checking for asset paths to determine the layout that has
been rendered, this change relies on the fact that the `no_ember` layout
has a `no-ember` class on the `body` element. This is more deterministic
as compared to relying on the different asset paths that are rendered in
the response.
2023-11-27 14:04:13 +08:00
Alan Guo Xiang Tan
e6ebeac640
Revert "Build(deps-dev): Bump rswag-specs from 2.11.0 to 2.12.0 (#24555)" (#24560)
This reverts commit fd5d595412.

See https://github.com/rswag/rswag/issues/703
2023-11-27 14:03:55 +08:00
Martin Brennan
91232847e3
FIX: Video placeholders not auto-linking post uploads (#24559)
Followup to 2443446e62

We introduced video placeholders which prevent preloading
metadata for videos in posts. The structure looks like this
in HTML when the post is cooked:

```
<div class="video-placeholder-container" data-video-src="http://some-url.com/video.mp4" dir="ltr" style="cursor: pointer;">
  <div class="video-placeholder-wrapper">
    <div class="video-placeholder-overlay">
      <svg class="fa d-icon d-icon-play svg-icon svg-string" xmlns="http://www.w3.org/2000/svg">
        <use href="#play"></use>
      </svg>
    </div>
  </div>
</div>
```

However, we did not update the code that links post uploads
to the post via UploadReference, so any videos uploaded since
this change are essentially dangling and liable to be deleted.
This also causes some uploads to be marked secure when they
shouldn't be, because they are not picked up and analysed in the
CookedPostProcessor flow.
2023-11-27 12:38:52 +10:00
Martin Brennan
eb1a622d38
FIX: Improve group mention copy for small groups (#24558)
If a group is < 5 members, the mention warning doesn't need to
be so harsh. This commit changes the copy for the existing warning
and adds a new one for groups that are >= 5 members.
2023-11-27 10:31:24 +10:00
dependabot[bot]
fd5d595412
Build(deps-dev): Bump rswag-specs from 2.11.0 to 2.12.0 (#24555)
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.11.0...2.12.0)

---
updated-dependencies:
- dependency-name: rswag-specs
  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-11-27 07:23:06 +08:00
Alan Guo Xiang Tan
585e010af9
DEV: Cache plugin gems when running plugin test jobs in Github CI (#24535)
Why this change?

Plugin gems for official plugins are being installed over and over again
each time we run RSpec and QUnit tests for plugins. In particular, the
rugged gem installed by the discourse-code-review plugin takes
approximately 50-60 seconds to install because it is compiling libgit2.
2023-11-27 07:22:32 +08:00
Krzysztof Kotlarek
dc2a0854b0
UX: add gift emoji styling for new features (#24523)
When admin has unseen new feature, gift emoji is added to a link.

In addition, `/new-features` path was changed to `/whats-new`
2023-11-27 09:32:28 +11:00
Renato Atilio
856ccb34e1
UX: fix new group chat cancel i18n label (#24554) 2023-11-25 16:54:07 -03:00
Jarek Radosz
24532653e6
FIX: A typo bug in an import script (#24553) 2023-11-25 18:10:42 +01:00
Jarek Radosz
68960b26be
DEV: Consistently use kebab-case in service lookups (#24552) 2023-11-25 18:10:10 +01:00
Jarek Radosz
3912a2dc24
DEV: Don't reload looping tests when cancelling (#24551) 2023-11-25 18:09:36 +01:00
David Taylor
34a859d628
FIX: disable browser history.scrollRestoration feature (#24550)
When going 'back', default browser behavior is to restore the scroll position. Unfortunately sites are given no control over the timing of this restoration, which means it can happen halfway through an Ember transition. Therefore we disable it, and re-implement the functionality in our scroll-manager service.

We inadvertently dropped this configuration in 7c9cf666da, which led to issues like https://meta.discourse.org/t/286463
2023-11-25 00:56:19 +00:00
Renato Atilio
bf9c0c4889
DEV: ensure discovery getters don't fail with a missing #routeAttrs (#24549) 2023-11-24 15:54:16 -03:00
Bianca Nenciu
d5f459db14
FIX: Use same names for category CSS variables (#24527)
--category-bg-color and --category-badge-color were both used to
represent category.color. --category-badge-color is now used instead for
all of them.
2023-11-24 16:42:24 +02:00
David Taylor
3a67a0280f
DEV: Remove unneeded Model injections (#24546)
These are handled by our implicit-injections shim, or explicit injections
2023-11-24 14:20:02 +00:00
Jarek Radosz
1da4e1be0a
DEV: Convert relative-time-picker to gjs (#24324) 2023-11-24 14:16:17 +01:00
Jarek Radosz
e98ac4736e
DEV: Add "loop until failure" feature to QUnit (#24545) 2023-11-24 13:15:43 +01:00
Jarek Radosz
1f2a25331b
DEV: Fix settledState debug message (#24544)
A properly formatted string instead of circular-JSON error
2023-11-24 12:18:28 +01:00
Joffrey JAFFEUX
2befff5101
FIX: nullifies target message id when not readable (#24540)
This bug was very reproducible when your last read was a message you didn't read and an admin would delete it. When coming back to the channel you would get a not found, in this case we will now reset last read and present you the last message of the channel.

We could be more fancy and  try to detect the next readable message but that would be more code and complexity for such a rare case.
2023-11-24 11:46:00 +01:00
David Taylor
0253cba9be
DEV: Load svg icons in dev-environment qunit tests (#24542)
Making the icons available generally in tests is tricky because they're generated dynamically by the rails server. However, if we restrict it to dev-mode (`/tests` in a browser) then it's possible to load them from the running rails server. This is purely a visual thing to make debugging easier - it should not affect test behavior.
2023-11-24 10:12:10 +00:00
David Taylor
46782a9f1c
DEV: Cleanup unused markdownItUrl references (#24541)
These are unused since 9a1695ccc1
2023-11-24 10:00:07 +00:00
chapoi
0b352ce7fb
UX: fix date time modal on mobile (#24531)
* UX: fix date time modal
2023-11-24 10:28:46 +01:00
Martin Brennan
09c446c1ae
FIX: Handle missing git repo details in plugin list (#24539)
Followup to e37fb3042d,
in some cases we cannot get git information for the
plugin folder (e.g. permission issues), so we need
to only try and get information about it if
commit_hash is present.
2023-11-24 12:08:10 +10:00
Joffrey JAFFEUX
d667c22171
FIX: prevents input to reset at wrong moment (#24536)
Before this fix we would reset the input two times:

- right before sending message
- and after it's been sent

The second one is actually not necessary, and more over with the server delay the user could have started typing a new message and that would clear it.
2023-11-24 10:59:48 +10:00
Sam
c2fd090d7d
DEV: revert missing license for maxmind changes (#24538)
Reverts
 
 - DEV: maxmind license checking failing tests #24534 
 - UX: Show if MaxMind key is missing on IP lookup #18993

These changes are leading to surprising results, our logs are now filling up with warnings on dev environments 

We need the change to be redone
2023-11-24 11:31:11 +11:00
Sam
85d2b5fa48
DEV: maxmind license checking failing tests (#24534)
This improves the implementation of #18993

1. Error message displayed to user is clearer
2. open_db will also be called, even if license key is blank, as it was previously
3. This in turn means no need to keep stubbing 'maxmind_license_key'
2023-11-24 09:38:46 +11:00
MichaIng
c58a41cb3e
UX: Show on IP lookup if MaxMind key is missing (#18993)
as discussed in https://meta.discourse.org/t/maxminddb-not-found-error/148512/7.
 
shows a warning to the admin if no license for maxmind is found
2023-11-24 08:02:05 +11:00
PhilippRenner
c0216f85a8
Update INSTALL-cloud.md (#23624)
Adding Tutorial for installation Docker and Git,
2023-11-24 07:53:53 +11:00