Commit Graph

17889 Commits

Author SHA1 Message Date
Kris
1c70a14d7c
UX: adjust various button classes (#24121) 2023-10-27 10:26:59 -04:00
Renato Atilio
5bd92dd252
FIX: only clear upload list if multiple not allowed (#24123)
* FIX: only clear upload list if multiple not allowed
2023-10-27 00:12:55 -03:00
Martin Brennan
545e92039c
FIX: Hashtags were not decorated in user activity list (#24125)
This was just a case of removing the `onlyStream: true`
operation from `decorateCookedElement`, since that restricts
the decoration only to topic page posts.
2023-10-27 12:00:19 +10:00
Penar Musaraj
7f57ba45ac
UX: Fix mobile passkeys login button (#24124)
This regressed in b6dc929. A test to ensure this doesn't regress has
been added as well.

This PR also fixes a flakey system spec. The conditional UI gets
triggered automatically, so the system spec shouldn't explicitly call
`find(".passkey-login-button").click`, because sometimes it isn't
present and that causes a test failure.
2023-10-26 20:55:41 -04:00
dependabot[bot]
7e002e52f7
Build(deps-dev): Bump sass in /app/assets/javascripts (#24120)
Bumps [sass](https://github.com/sass/dart-sass) from 1.69.4 to 1.69.5.
- [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.69.4...1.69.5)

---
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-10-26 23:53:08 +02:00
Jarek Radosz
125c19e8f7
FIX: Username validation in create-account modal (#24114)
* Move the create account test
* Clean up username-validation
* Fix the username validation bug
2023-10-26 20:38:34 +02:00
David Taylor
c124c69833
DEV: Simplify sprockets configuration (#24111)
- Remove the wildcard crawler. This was already excluding almost all file types, but the exclude list was missing '.gjs' which meant those files were unnecessarily being hoisted into the `public/` directory during precompile

- Automatically include all ember-cli-generated assets without needing them to be listed. The main motivation for this change is to allow us to start using async imports via Embroider/Webpack. The filenames for those new async bundles will not be known in advance.

- Skips sprockets fingerprinting on Embroider/Webpack chunk JS files. Their filenames already include a fingerprint, and having sprockets change the filenames will cause problems for the async import feature (where filenames are included deep inside js bundles)

This commit also updates our ember-cli build so that it skips building plugin tests in the production environment. This should provide a slight build speed improvement.
2023-10-26 17:29:53 +01:00
Jarek Radosz
00dc063d40
FIX: Restore support for custom NavItem class (#24113)
A followup to 930dc38500
2023-10-26 18:26:36 +02:00
Penar Musaraj
b8ee52c4cb
UX: Wait for render before invoking A11YDialog (#24100)
Previously, focus wasn't being applied correctly on dialogs using named
components. This was because the A11YDialog was being invoked before
the component was completely rendered.

The long-term plan is to move away from A11YDialog doing the rendering
here, but for now this should do.
2023-10-26 08:24:47 -04:00
David Taylor
d405305456
DEV: Explicitly disable Ember string prototype extensions (#24110)
These have been deprecated for some time, and the vast majority of themes/plugins have already removed their use. The prototype extensions were unexpectedly disabled as a side effect of 895036bd7a (more details in https://github.com/discourse/discourse/pull/24101).

Given that restoring the functionality now involves significant complexity, and would only be delaying the inevitable removal in a matter of months, we've decided to keep them disabled. This commit explicitly sets the flag in the ember environment config to make things clearer.
2023-10-26 11:16:57 +01:00
dependabot[bot]
8438aed727
Build(deps-dev): Bump jquery in /app/assets/javascripts (#24108)
Bumps [jquery](https://github.com/jquery/jquery) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.7.0...3.7.1)

---
updated-dependencies:
- dependency-name: jquery
  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-26 00:39:40 +02:00
Joffrey JAFFEUX
becad4d7d7
FIX: do not check if inside cooked early (#24105)
We already do this check inside `selectionChanged` and this was preventing us to correctly set `isSelecting` to true. This was causing issues when starting your selection from outside cooked.
2023-10-25 22:50:32 +02:00
Joffrey JAFFEUX
619d709d54
FIX: clear state if selected text is empty (#24102)
This would cause a loop and some very fast flashing of the selection in safari when scrolling the selection until the bottom of the page.
2023-10-25 22:15:30 +02:00
Penar Musaraj
e231ed2153
DEV: Improve error messaging (#24099)
Applies to passkeys, visible in a dev environment when using a non-standard
host. The error modal should only be shown when invoking the passkey
login button.
2023-10-25 13:44:08 -04:00
Joffrey JAFFEUX
334be4eac7
UX: improve quote/edit bar's rendering (#24097)
This change allows for a faster and smoother experience. It's also less noisy because the buttons will not be shown while selecting text.
2023-10-25 12:51:47 -04:00
Keegan George
115a05f37a
FIX: Don't show like error on topic creation (#24084) 2023-10-25 08:40:50 -07:00
Joffrey JAFFEUX
0e37ceeeb9
FIX: improves reliability of post-text-selection bar (#24093)
The main change made is to use `pointerdown` and `touchstart` for detecting click outside in `FloatKit`, the problem of using `click` is that it will trigger on `mouseup` which is not working well with `FloatKit` shown using `mousedown` (when we change selection with the `mousedown` for example) as the release will be interpreted as a click outside and close the menu. To solve this issue the previous code in `post-text-selection` was going through various hacks for detecting state of mouse which are not always very reliable.

The second fix is to exit earlier when selection didn't change.

This has been tested on chrome/firefox and safari (mobile) and seems to work reliably.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-10-25 14:34:53 +02:00
Godfrey Chan
895036bd7a
DEV: remove @ember/jquery in favor of just jquery (#24034)
`@ember/jquery` was necessary to automate the `app.import()` but
that is no longer necessary with `ember-auto-import`. A secondary
thing it does is bringing back the `this.$` feature, but with a
deprecation. It is my understanding that the deprecation has long
be fully absorbed into both core and plugins so we shouldn't need
this package anymore.
2023-10-25 10:14:50 +01:00
Martin Brennan
3090b4801b
FIX: Add checkbox-label CSS class to flag modal labels (#24087)
Avoids a similar bolding issue to 88ae4c7b5c
2023-10-25 11:49:07 +10:00
Martin Brennan
9db4eaa870
DEV: Change anonymous_posting_min_trust_level to a group-based setting (#24072)
No plugins or themes rely on anonymous_posting_min_trust_level so we
can just switch straight over to anonymous_posting_allowed_groups

This also adds an AUTO_GROUPS const which can be imported in JS
tests which is analogous to the one defined in group.rb. This can be used
to set the current user's groups where JS tests call for checking these groups
against site settings.

Finally a AtLeastOneGroupValidator validator is added for group_list site
settings which ensures that at least one group is always selected, since if
you want to allow all users to use a feature in this way you can just use
the everyone group.
2023-10-25 11:45:10 +10:00
Martin Brennan
5e395d4382
FIX: Add support for OffscreenCanvas in media optimization worker (#24074)
Back in c31772879b we introduced
SiteSetting.composer_ios_media_optimisation_image_enabled and
disabled media optimization on safari iOS because of performance
issues when rendering to canvas, and OffscreenCanvas support
was not yet available.

Safari now supports OffscreenCanvas, so now we can give this
another go, and also use OffscreenCanvas everywhere it is supported.
2023-10-25 09:28:09 +10:00
Martin Brennan
88ae4c7b5c
FIX: Add checkbox-label class to site setting checkboxes (#24075)
Followup to e2d9117378, which
made these labels bold because they were missing the correct
class.
2023-10-25 09:14:27 +10:00
Kris
63a0700d45
DEV: add above-category-heading outlet (#24083) 2023-10-24 15:47:29 -04:00
Jarek Radosz
2f1acbb12d
DEV: Convert user-field to gjs (#24082) 2023-10-24 20:28:47 +02:00
Jarek Radosz
930dc38500
DEV: Convert nav-item to gjs (#24076) 2023-10-24 17:55:09 +02:00
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
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