Commit Graph

21518 Commits

Author SHA1 Message Date
Jarek Radosz
9a497d9e22
DEV: Move toggleAnonymous out of app route (#24077) 2023-10-24 17:54:56 +02:00
Kelv
44c84413fb
DEV: upgrade reject reason reviewable modal to glimmer component (#24073)
* DEV: add system test for rejecting user from review page
* DEV: upgrade reject-reason-reviewable modal to glimmer & DModal
2023-10-24 17:44:43 +08:00
Martin Brennan
d5e8bd790b
DEV: Re-enable minio specs by pre-installing minio binary before test run (#24050)
This fixes a similar issue to 8b3eca0 where an Errno::ETXTBSY error was raised because the minio_runner gem was trying to install the binary across multiple processes in rspec. If we just make sure the latest version is installed before the tests run, this shouldn't happen, since MinioRunner.start will not do any further attempts at installation if the latest version is installed.
2023-10-24 12:43:14 +10:00
dependabot[bot]
9e4a72945c
Build(deps-dev): Bump the types group (#24068)
Bumps the types group in /app/assets/javascripts with 1 update: [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery).

- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

---
updated-dependencies:
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 23:29:40 +02:00
David Taylor
35290660bf
DEV: Cleanup autoimport-related config from ember-cli-build (#24006)
Running addonPostprocessTree manually was causing ember-auto-import's postprocess hook to run and generate extra unnecessary chunks. The only reason called addonPostprocessTree directly was to allow the terser plugin to run on the extra public trees. We can do the terser postprocessing manually instead.

This commit is approximately the inverse of e1d27400f5.

This commit also removes ember-auto-import as dependencies of admin/wizard/discourse-plugins because they are not 'real' ember addons, and so it isn't serving any useful purpose. (see also https://github.com/discourse/discourse/pull/23974)
2023-10-23 22:26:39 +01:00
Jarek Radosz
b3caa90f6e
DEV: Check for mobile upload button presence (#24059)
If rendering would break before `_bindMobileUploadButton` - this would fail too, obscuring the original issue.
2023-10-23 23:14:17 +02:00
Joffrey JAFFEUX
043b4a4187
FIX: replaces data-tooltip usage by <DTooltip /> (#24062)
As much as possible I would like us to avoid having to go the with a global event listener on click/mouseover. For now I have removed all cases of `data-tooltip`, if we clearly identify a use case of a global event listener we might reconsider this.

The following changes are also included:
- by default tooltips won't attempt to focus first focusable element anymore
- tooltip will now use `cursor: pointer` by default
- a new service has been introduced: `InternalTooltip` which is responsible to track the current instance displayed by a `<DTooltip />`. Portal elements when replaced are not properly cleaned and I couldn't figure out a way to have a proper hook to ensure the previous `DTooltipInstance` is properly set as not expanded; this problem was very visible when using a tooltip as interactive and hovering another tooltip, which would replace the interactive tooltip as not closed.
2023-10-23 21:09:02 +02:00
chapoi
e2d9117378
UX: change to input field + label styling (#24060) 2023-10-23 17:36:36 +02:00
Penar Musaraj
b6dc929141
UX: Add conditional UI for passkeys (#24041)
This allows users to see their passkeys recommended by the browser as they type their username.

There's a small refactor here, to make sure the same action is used by both the conditional UI and the passkey login button. The webauthn API only supports one auth attempt at a time, so in this PR we need to add a service singleton to manage the navigator.credentials.get promise so that it can be cancelled and reused as the user picks the conditional UI (i.e. the username login input) or the dedicated passkey login button.
2023-10-23 11:21:05 -04:00
Blake Erickson
8d640acf86
DEV: Show a loading spinner on video placeholders (#24039)
This commit adds a loading spinner that appears immediately after
clicking the play button on a video placeholder and will go away once
the "onCanPlay" event fires for the video.

This prevents a completely empty (no play button) placeholder from
appearing for some amount of time while the video is loading enough to
start playing.
2023-10-23 09:01:20 -06:00
Penar Musaraj
f9eec939e5
UX: Fixes for mobile "create account" modal (#24043)
- Don't include login buttons on mobile
- Fix padding/spacing
2023-10-23 10:48:46 -04:00
Penar Musaraj
0934cc6ece
DEV: Fix Ember inspector error on anonymous user (#24042) 2023-10-23 09:24:05 -04:00
Joffrey JAFFEUX
552cf56afe
DEV: toasts improvements (#24046)
- more subtle animation when showing a toast
- resumes auto close when removing the mouse from the toast
- correctly follows reduced motion
- uses output with role status as element: https://web.dev/articles/building/a-toast-component
- shows toasts inside a section element
- prevents toast to all have the same width
- fixes a bug on mobile where we would limit the width and the close button wouldn't show correctly aligned

I would prefer to have tests for this, but the conjunction of css/animations and our helper changing `discourseLater` to 0 in tests is making it quite challenging for a rather low value. We have system specs using  toasts ensuring they show when they should.
2023-10-23 15:23:10 +02:00
dependabot[bot]
2dc9c1b478
Build(deps-dev): Bump sinon in /app/assets/javascripts (#24052)
Bumps [sinon](https://github.com/sinonjs/sinon) from 16.1.3 to 17.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v16.1.3...v17.0.0)

---
updated-dependencies:
- dependency-name: sinon
  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-10-23 12:31:18 +02:00
Jarek Radosz
c84fe69e10
DEV: Use @discourse/lint-configs (#24038) 2023-10-23 12:08:35 +02:00
Kelv
6121869900
FIX: display and link to correct grant_by users for granted badges (#24021)
* FIX: display and link to correct grant_by users for granted badges in admin

* DEV: add system test for admin user badge granted by behaviour
2023-10-23 14:46:10 +08:00
Alan Guo Xiang Tan
8c07bbe084
FIX: Disable filter when loading tags in edit nav menu tags modal (#23789)
Why this change?

When we're in the midst of loading more tags, the filter dropdown
is still enabled and may result in us firing off multiple requests to
the server to load more tags. This makes the loading hard to reason
about in the tests environment and has led to flaky tests.

What does this change do?

This changes disables the filter dropdown when more tags are being
loading.
2023-10-23 08:35:40 +08:00
Sérgio Saquetim
53c23cf929
FIX: Use the category logo matching the theme (#24033)
This commit fixes a bug in which the dark category logo would be used in a light theme if the system preference was set to dark and the user forced the use of a light theme in Discourse
2023-10-20 17:57:36 +00:00
David Taylor
b38715e605
DEV: Actually fix decorateWidget error checking logic (#24037)
We need to separate the `:before` / `:after` suffix before looking up in the registry 🤦‍♂️🤦‍♂️
2023-10-20 17:54:15 +01:00
David Taylor
6c6740bb19
DEV: Correct decorateWidget error checking logic (#24036)
`name` referred to `window.name`, so the mistake wasn't detected by eslint 🤦‍♂️
2023-10-20 15:56:54 +01:00
David Taylor
373b2ca362
DEV: Correct addPostAdminMenuButton docs (#24035)
The `name` argument doesn't do anything, and 'title' should actually be 'label'
2023-10-20 14:12:27 +01:00
Sérgio Saquetim
0cfc42e0e6
FEATURE: Add dark mode option for category backgrounds (#24003)
Adds a new upload field for a dark mode category background that will be used as an alternative when Discourse is using a dark mode theme.
2023-10-20 12:48:06 +00:00
dependabot[bot]
467e1a1bdd
Build(deps-dev): Bump sinon from 16.1.0 to 16.1.3 in /app/assets/javascripts (#24031)
Bumps [sinon](https://github.com/sinonjs/sinon) from 16.1.0 to 16.1.3.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v16.1.0...v16.1.3)

---
updated-dependencies:
- dependency-name: sinon
  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-10-20 09:06:58 +08:00
Ty Correll
700c636d29
UX: unify ai representing icon (#24029)
This PR addresses the push to unify the icon representing AI throughout Discourse, by using the discourse-sparkles icon.

The icon is being moved to core to make changes with dependencies included in core that were using the "magic" icon instead.

In 2 places "magic" -> "discourse-sparkles,
1. topic summaries
2. (unreleased) chat summaries example
2023-10-19 17:30:27 -05:00
David Taylor
10cd0e5531
DEV: Print error when decorateWidget target does not exist (#24026) 2023-10-19 23:26:30 +01:00
David Taylor
a10a82131a
DEV: Remove post-admin-menu placeholder (#24025)
This widget is no longer used. It's better to remove it completely, so that `decorateWidget` and `reopenWidget` calls print a warning to the console rather than failing silently.
2023-10-19 23:26:13 +01:00
Roman Rizzi
a72e5fa763
FIX: Don't lose SummaryBox state through widget re-renders. (#24020)
* FIX: Don't lose SummaryBox state through widget re-renders.

The <SummaryBox /> component state will get lost when scrolling to the bottom of a topic. Due to the widget being re-rendered, it will go back to the collapsed state, and we need to fetch the summary again.

This change moves all the state updates to the postStream model, which also refreshes the widget to keep it updated.

* Reify topic summary using a pojo
2023-10-19 17:35:23 -03:00
Jarek Radosz
e31859a33a
FIX: Correctly set categoryId on Composer model (#23934) 2023-10-19 10:19:40 -07:00
Ella E
f42f54d58f
FIX: change max-width size to make the background image expand the same width as the browser (#24004) 2023-10-19 11:19:13 -06:00
Bianca Nenciu
a6b570681b
DEV: Fix category-selector's searching (#24023) 2023-10-19 20:00:02 +03:00
Kris
7b6e32c238
UX: move global option to sidebar modal footer, shorten translation (#24024) 2023-10-19 12:20:03 -04:00
Mark VanLandingham
cfbe16f9cc
DEV: Add option to float-kit toast to force auto-close (#24022) 2023-10-19 10:14:49 -05:00
Penar Musaraj
00aa81a271
UX: Fix form template mobile issues (#24019)
- allows scrolling on mobile when form template is present
- hides upload, preview buttons on mobile
2023-10-19 11:09:34 -04:00
David Taylor
7ed6195f19
PERF: Stop eagerly-loading core helper modules (#24015)
Now that core has a file structure and default imports, Ember's resolver can load helpers lazily. So we can remove the lazy loading, and helpers in ember templates will continue to work. This should provide a slight performance improvement for initial boot.

However, there is a slight complication: some of our helpers are also registered with our Raw Handlebars system as a side-effect of loading the module. Therefore, this commit adds a `helperMissing` helper to our RawHandlebars system. This looks up the helper by name in the ember resolver, which triggers the relevant module to be evaluated, and the raw helper to be registered as a side effect.

For backwards-compatibility, plugin and theme helpers continue to be eagerly evaluated. Once the `discourse.register-unbound` deprecation is resolved, we can safely remove this eager loading.
2023-10-19 15:52:51 +01:00
David Taylor
b1c6e67e2c
DEV: Update user-passkeys formatDate helper lookup (#24018)
This helper is now exported properly, so we can remove the `resolveRegistration()` workaround
2023-10-19 14:52:12 +01:00
Kris
d7474e643a
UX: video placeholder icon should always be white (#23990) 2023-10-19 09:35:43 -04:00
Joffrey JAFFEUX
bc9558550d
DEV: replace registerUnbound usage with default exports (#23802)
`registerUnbound` was present for legacy reasons when using helpers in raw-hbs and has been replaced by `registerRawHelper`.

For new helpers used only in classic ember template, exporting a default function from `helpers/*.js` is recommended.

This change also means that all existing helpers will be available to import in `gjs` files.

Co-authored-by: David Taylor <david@taylorhq.com>
2023-10-19 14:28:25 +01:00
Jarek Radosz
24dc36cf91
DEV: Fix ember/require-super-in-lifecycle-hooks (#24007)
and `ember/no-ember-super-in-es-classes`
2023-10-19 13:47:45 +02:00
Jarek Radosz
ac30673b98
DEV: Fix ember/no-settled-after-test-helper (#24008) 2023-10-19 13:47:28 +02:00
Jarek Radosz
b45720b158
DEV: Fix ember/no-incorrect-calls-with-inline-anonymous-functions (#24010) 2023-10-19 13:47:01 +02:00
Jarek Radosz
754d13f5fa
DEV: Fix ember/require-valid-css-selector-in-test-helpers (#24011) 2023-10-19 13:46:48 +02:00
Jarek Radosz
23af6c23d0
DEV: Fix ember/prefer-ember-test-helpers (#24013) 2023-10-19 13:46:28 +02:00
David Taylor
8c01947c45
DEV: Remove USE_EMBROIDER flag (#23971)
Embroider has been the default since b72ed3cb38. This commit removes the ability to set `USE_EMBROIDER=0` and go back to the classic build.
2023-10-19 10:38:25 +01:00
Martin Brennan
9ef3a18ce4
DEV: Add new experimental admin UI route and sidebar (#23952)
This commit adds a new admin UI under the route `/admin-revamp`, which is
only accessible if the user is in a group defined by the new `enable_experimental_admin_ui_groups` site setting. It
also adds a special `admin` sidebar panel that is shown instead of the `main`
forum one when the admin is in this area.

![image](https://github.com/discourse/discourse/assets/920448/fa0f25e1-e178-4d94-aa5f-472fd3efd787)

We also add an "Admin Revamp" sidebar link to the community section, which
will only appear if the user is in the setting group:

![image](https://github.com/discourse/discourse/assets/920448/ec05ca8b-5a54-442b-ba89-6af35695c104)

Within this there are subroutes defined like `/admin-revamp/config/:area`,
these areas could contain any UI imaginable, this is just laying down an
initial idea of the structure and how the sidebar will work. Sidebar links are
currently hardcoded.

Some other changes:

* Changed the `main` and `chat` panels sidebar panel keys to use exported const values for reuse
* Allowed custom sidebar sections to hide their headers with the `hideSectionHeader` option
* Add a `groupSettingArray` setting on `this.siteSettings` in JS, which accepts a group site setting name
  and splits it by `|` then converts the items in the array to integers, similar to the `_map` magic for ruby
  group site settings
* Adds a `hidden` option for sidebar panels which prevents them from showing in separated mode and prevents
  the switch button from being shown

---------

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2023-10-19 14:23:41 +10:00
Penar Musaraj
6837888b8b
UX: Update highlight.js styles (#23999) 2023-10-18 19:07:39 -04:00
Ella E
bec53210e8
DEV: remove unused root max width in wizard (#23996) 2023-10-18 16:25:04 -06:00
dependabot[bot]
67594f8d74
Build(deps-dev): Bump the types group (#23994)
Bumps the types group in /app/assets/javascripts with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@types/ember](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember) | `4.0.7` | `4.0.8` |
| [@types/ember__application](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__application) | `4.0.8` | `4.0.9` |
| [@types/ember__array](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__array) | `4.0.6` | `4.0.7` |
| [@types/ember__component](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__component) | `4.0.18` | `4.0.19` |
| [@types/ember__engine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__engine) | `4.0.7` | `4.0.8` |
| [@types/ember__object](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__object) | `4.0.8` | `4.0.9` |
| [@types/ember__routing](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__routing) | `4.0.16` | `4.0.17` |
| [@types/ember__runloop](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__runloop) | `4.0.6` | `4.0.7` |
| [@types/ember__test](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ember__test) | `4.0.3` | `4.0.4` |
| [@types/jquery](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jquery) | `3.5.23` | `3.5.24` |
| [@types/qunit](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/qunit) | `2.19.6` | `2.19.7` |
| [@types/rsvp](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/rsvp) | `4.0.5` | `4.0.6` |


Updates `@types/ember` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember)

Updates `@types/ember__application` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__application)

Updates `@types/ember__array` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__array)

Updates `@types/ember__component` from 4.0.18 to 4.0.19
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__component)

Updates `@types/ember__engine` from 4.0.7 to 4.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__engine)

Updates `@types/ember__object` from 4.0.8 to 4.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__object)

Updates `@types/ember__routing` from 4.0.16 to 4.0.17
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Changelog](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember__routing/history-location.d.ts)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__routing)

Updates `@types/ember__runloop` from 4.0.6 to 4.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__runloop)

Updates `@types/ember__test` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ember__test)

Updates `@types/jquery` from 3.5.23 to 3.5.24
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jquery)

Updates `@types/qunit` from 2.19.6 to 2.19.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/qunit)

Updates `@types/rsvp` from 4.0.5 to 4.0.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/rsvp)

---
updated-dependencies:
- dependency-name: "@types/ember"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__application"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__array"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__component"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__engine"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__object"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__routing"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__runloop"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/ember__test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/jquery"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/qunit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: "@types/rsvp"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 00:22:30 +02:00
Ella E
7af291b40d
UX: Wizard static confetti (#23973)
* UX: add static confetti bacgkround image on wizard steps

* DEV: slow down speed animation for confetti

* DEV: compress image file size

* UX: use an image that has transparent background

* DEV: use correct image file name
2023-10-18 15:19:00 -06:00
Penar Musaraj
a125c9e63e
UX: Minor fixes to passkey handling (#23947)
- don't try to guess the name of the manager (too many options)
- improve error message when registration is not allowed
- output error in console when registration fails
- minor fix to rename dialog layout
- hides action buttons in DiscourseHub (because adding passkeys there is not possible)
- adds acceptance test to ensure action buttons are hidden for admins seeing another user's profile
2023-10-18 11:46:51 -04:00
Mark VanLandingham
585bb0df27
DEV: Add class name of action type for flag-action-type container (#23972) 2023-10-18 10:18:52 -05:00