Commit Graph

30505 Commits

Author SHA1 Message Date
David Taylor
f314eaae55
FIX: Pass email correctly when resending activation email (#23741)
Regressed as part of the refactoring in 7df4eab038. This commit also introduces a system spec for the activation flow.
2023-10-02 13:00:29 +01:00
Jarek Radosz
5a904949b2
DEV: Add gjs support for themes (#23473) 2023-10-02 12:36:06 +02:00
dependabot[bot]
2ec7455c89
Build(deps): Bump a11y-dialog in /app/assets/javascripts (#23737)
Bumps [a11y-dialog](https://github.com/KittyGiraudel/a11y-dialog) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/KittyGiraudel/a11y-dialog/releases)
- [Commits](https://github.com/KittyGiraudel/a11y-dialog/compare/8.0.1...8.0.2)

---
updated-dependencies:
- dependency-name: a11y-dialog
  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-10-02 12:14:03 +02:00
David Taylor
39af44c76d
DEV: Bump ember-legacy-built-in-components (#23734)
This bump includes the fix we were waiting for, and so we can remove our patch file.
2023-09-29 22:16:22 +01:00
Ty Correll
70a07abfa4
UX: focused spacing in more topics table (#23730)
This PR addresses spacing between focused & the topic header, by cancelling out the spacing added between the first table row while still having space between the tabs "Suggested" & "Related"
2023-09-29 13:22:57 -05:00
dependabot[bot]
5f3265fe01
Build(deps-dev): Bump the embroider group (#23728)
Bumps the embroider group in /app/assets/javascripts with 4 updates: [@embroider/test-setup](https://github.com/embroider-build/embroider/tree/HEAD/packages/test-setup), [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat), [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core) and [@embroider/webpack](https://github.com/embroider-build/embroider/tree/HEAD/packages/webpack).


Updates `@embroider/test-setup` from 3.0.1 to 3.0.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/test-setup)

Updates `@embroider/compat` from 3.2.1 to 3.2.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/compat)

Updates `@embroider/core` from 3.2.1 to 3.3.0
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

Updates `@embroider/webpack` from 3.1.5 to 3.2.0
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/webpack)

---
updated-dependencies:
- dependency-name: "@embroider/test-setup"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: embroider
- dependency-name: "@embroider/webpack"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: embroider
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-29 18:00:33 +01:00
Ella E
b860c6ec17
A11Y: Improve contrast on the WCAG color schemes (#23692)
A11Y: Improve contrast on WCAG color palette

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2023-09-29 10:03:08 -06:00
Kris
a11869f8c5
A11Y: add aria-label to share copy button (#23706) 2023-09-29 09:33:45 -04:00
David Taylor
3df8ee9775
Revert "DEV: Add source-map-support in tests for qunit stack-traces (#23653)" (#23717)
This reverts commit 42070d49da.

Overriding Error.stack like this seems to break the browser's own sourcemapping of stack-traces. Plus, it adds quite a significant performance overhead to tests (QUnit seems to rely on Error.stack even when tests pass). Reverting for now, but perhaps we can build a way to make this only apply to the UI-displayed stack traces in future 🤔
2023-09-29 14:06:25 +01:00
Arpit Jalan
b39f823fd3
FEATURE: add custom date range filter for admin dashboard reports (#23702)
* FEATURE: add custom date range filter for admin dashboard reports

* Improvements per David's review
2023-09-29 14:44:17 +05:30
Ted Johansson
408579e6b2
FIX: Make CookText component reactive (#23709)
When navigating between renewables through the Ember router, e.g. through the links in the notifications menu the body of the reviewable (rendered by the CookText component) won't update, resulting in the same post body incorrectly being shown for all subsequent reviewables.

This is happening because there is no update path between the rawText attribute being passed to CookText and the computed cooked attribute, since this is being set explicitly using an async function.

This PR adds the missing link between rawText and cooked by listening for didUpdate and triggering the async function.
2023-09-29 10:55:16 +02:00
Kelv
3f6adca2d7
DEV: convert change owner modal to glimmer component (#23668)
* DEV: convert change owner modal to glimmer component

* DEV: add system test for change owner modal
2023-09-29 11:46:31 +08:00
Kris
b267c1054d
FIX: keep bookmark modal open when using keyboard (#23707) 2023-09-28 17:01:22 -04:00
Joffrey JAFFEUX
a441f07908
FIX: correctly clear the quote state (#23705)
Prior to this fix clicking outside text and reseting the selection wouldn't clear the quote state, which would cause a click on "reply" or "create" to start the composer with the quote state.

This commit attempts to simplify this behaviour by not mutating quote state while the menu is opened. The quote state will now only be cleared when the menu is closed.

No tests have ever been written for this complex and subtle behavior (both `mousedown` and `selectionchange` events can trigger the final `selectionChanged` codepath which prevents us to for example stop the event when clicking quote as it will still change the selection even if we can prevent the `mousedown`. Ideally a huge part of this code should be rewritten to be easier to test, this commit only attempt to fix a regression introduced when using FloatKit to position the menu.
2023-09-28 19:37:11 +02:00
Kris
34cc87db40
A11Y: UI emoji are decorative, use alt="" (#23690) 2023-09-28 13:30:19 -04:00
Kris
a5df906af3
A11Y: add aria-current to active navigation item (#23691) 2023-09-28 13:30:07 -04:00
Kris
a523f17ed7
A11Y: aria-label for mobile topic list avatar (#23693) 2023-09-28 13:29:56 -04:00
David Taylor
3fe5ce7ab4
DEV: Modernize <AddCategoryTagClasses> to use bodyClass helper (#23703) 2023-09-28 17:44:15 +01:00
David Taylor
43791ea2b5
DEV: Modernize <AddTopicStatusClasses> to use bodyClass helper (#23704) 2023-09-28 17:44:04 +01:00
David Taylor
0ec3cc4eb2
DEV: Update tag-show route to native class syntax (#23701) 2023-09-28 17:10:07 +01:00
Kris
9136109ca0
FIX: allow history modal columns to shrink width (#23700) 2023-09-28 10:31:24 -04:00
Jarek Radosz
1117640715
FIX: A regression in RequestGroupMembershipForm (#23699) 2023-09-28 15:39:49 +02:00
Matt Marjanović
619d43ea47
FEATURE: Add prompt=none functionality to SSO Provider protocol (#22393)
This commit adds support for an optional `prompt` parameter in the
payload of the /session/sso_provider endpoint.  If an SSO Consumer
adds a `prompt=none` parameter to the encoded/signed `sso` payload,
then Discourse will avoid trying to login a not-logged-in user:

 * If the user is already logged in, Discourse will immediately
   redirect back to the Consumer with the user's credentials in a
   signed payload, as usual.

 * If the user is not logged in, Discourse will immediately redirect
   back to the Consumer with a signed payload bearing the parameter
   `failed=true`.

This allows the SSO Consumer to simply test whether or not a user is
logged in, without forcing the user to try to log in.  This is useful
when the SSO Consumer allows both anonymous and authenticated access.
(E.g., users that are already logged-in to Discourse can be seamlessly
logged-in to the Consumer site, and anonymous users can remain
anonymous until they explicitly ask to log in.)

This feature is similar to the `prompt=none` functionality in an
OpenID Connect Authentication Request; see
https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
2023-09-28 12:53:28 +01:00
David Taylor
b72ed3cb38
DEV: Enable Embroider build by default (#23685) 2023-09-28 12:33:44 +01:00
Ty Correll
76e5a939d4
UX: selected indicator more topics spacing (#23696)
* UX: selected indicator more topics spacing

In relation to the selected indicator, this PR addresses a vertical and horizontal issue with the indicator touching the table header and its left alignment to be more consistent with the regular topic list feed.

* UX: border for pill navigation on mobile

Makes UI more consistent desktop -> mobile, by adding a border to the bottom of the Suggested/Related.
2023-09-27 18:23:30 -05:00
dependabot[bot]
d8883fac8a
Build(deps-dev): Bump markdown-it from 13.0.1 to 13.0.2 in /app/assets/javascripts (#23677)
Bumps [markdown-it](https://github.com/markdown-it/markdown-it) from 13.0.1 to 13.0.2.
- [Changelog](https://github.com/markdown-it/markdown-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/markdown-it/compare/13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: markdown-it
  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-09-28 07:03:44 +08:00
Ted Johansson
7569b64362
FIX: Disallow moderators from custom public sidebar sections (#23683)
Currently moderators can see the custom public sidebar section edit button, but they are prevented from making any changes by an error. According to the back-end, moderators can not access these.

This PR hides the custom public sidebar section edit button, as well as the "make public" checkbox of the create modal, if the user is not an admin, bringing the UI in line with the back-end.

If needed, we can add a site setting to allow moderator access when the need arises.
2023-09-27 19:52:23 +02:00
Penar Musaraj
ca394177cb
FIX: Copy button JS test failures (#23687)
JS tests expect `show_copy_button_on_codeblocks` to be false (because
default before #81f3f56 was false). There is probably a different
issue at play here with JS tests, I haven't dug into it yet.

Instead, this PR adds a system test to ensure copy button is present
for code blocks with default site settings enabled.
2023-09-27 13:05:27 -04:00
Jarek Radosz
6adc67a7a8
FIX: Broken error reporting in modals (and other places) (#23680)
1. actually call `popupAjaxError`, thanks :P
2. don't close a modal on error
3. use `extractError()` instead of manually joining error messages
4. …or passing just the error object to `this.flash`
2023-09-27 17:11:44 +02:00
David Taylor
fc2e92d423
DEV: Drop post_uploads table (#23673)
The post_uploads table has not been used since 9db8f00b3d
2023-09-27 12:43:19 +01:00
Natalie Tay
20a882389a
FIX: Correct error on add user modal (#23679) 2023-09-27 13:54:44 +08:00
Kris
bbb4e19612
UX: improve history modal layout (#23675) 2023-09-26 17:50:09 -04:00
David Taylor
dd0bbb189d
DEV: Modernize getOwner usage in discourse/components (#23674)
See 8958b4f76a for motivation
2023-09-26 18:21:51 +01:00
Jarek Radosz
52722c7086
DEV: Use getOwner from @ember/application in tests (#23670) 2023-09-26 18:40:10 +02:00
Arpit Jalan
3669723a86
FEATURE: allow filtering posts report by multiple categories (#23669) 2023-09-26 21:56:47 +05:30
dependabot[bot]
53a211b77e
Build(deps): Bump ember-cli-babel in /app/assets/javascripts (#23667)
Bumps [ember-cli-babel](https://github.com/babel/ember-cli-babel) from 7.26.11 to 8.1.0.
- [Release notes](https://github.com/babel/ember-cli-babel/releases)
- [Changelog](https://github.com/babel/ember-cli-babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/ember-cli-babel/compare/v7.26.11...v8.1.0)

---
updated-dependencies:
- dependency-name: ember-cli-babel
  dependency-type: direct:production
  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-09-26 17:52:08 +02:00
David Taylor
110fdf0189
DEV: Remove dependence on dartsass-sprockets (#23665)
Discourse has a custom stylesheet pipeline which compiles things 'just in time'. The only place we were still running sass files through sprockets was for the `/tests` route in development mode. This use can be removed by compiling the relevant stylesheets through ember-cli instead (which we were already doing for testem runs)

This work was prompted by the incompatibility of dartsass-sprockets with the latest sass-embedded release (https://github.com/tablecheck/dartsass-sprockets/issues/13)
2023-09-26 16:25:07 +01:00
David Taylor
8958b4f76a
DEV: Rename custom getOwner to getOwnerWithFallback (#23437)
Our custom implementation of `getOwner` includes a fallback which returns an owner, even if the passed object does not have one set. This is confusing and creates a false sense of security. Generally if the fallback is used, it means there is a problem with the patterns being used.

This commit renames our custom implementation to `getOwnerWithFallback`, while maintaining the old `getOwner` export with a deprecation notice. Core code is updated to use the official `@ember/application` implementation, or the new `getOwnerWithFallback` function.

This commit updates all core uses of `{ getOwner } from discourse-common/lib/get-owner` to use `getOwnerWithFallback`. Future commits will work through and convert many of these to use the official `@ember/application` implementation
2023-09-26 14:30:52 +01:00
David Taylor
2e950eb07a
DEV: Introduce RenderGlimmer for raw hbs (#23592)
A new `rawRenderGlimmer` function is introduced which can be used to render glimmer components inside our legacy 'raw hbs' views. See discourse/lib/raw-render-glimmer for more information. This will help as we work to move away from raw-hbs use.
2023-09-26 13:16:48 +01:00
David Taylor
42070d49da
DEV: Add source-map-support in tests for qunit stack-traces (#23653)
The source-map-support package uses JS sourcemaps to improve the human-readability of Error#stack stacktraces.
2023-09-26 13:15:49 +01:00
Joffrey JAFFEUX
2a10ea0e3f
DEV: FloatKit (#23650)
This PR introduces three new concepts to Discourse codebase through an addon called "FloatKit":

- menu
- tooltip
- toast


## Tooltips
### Component

Simple cases can be express with an API similar to DButton:

```hbs
<DTooltip 
  @Label={{i18n "foo.bar"}}
  @ICON="check"
  @content="Something"
/>
```

More complex cases can use blocks:

```hbs
<DTooltip>
  <:trigger>
   {{d-icon "check"}}
   <span>{{i18n "foo.bar"}}</span>
  </:trigger>
  <:content>
   Something
  </:content>
</DTooltip>
```

### Service

You can manually show a tooltip using the `tooltip` service:

```javascript
const tooltipInstance = await this.tooltip.show(
  document.querySelector(".my-span"),
  options
)

// and later manual close or destroy it
tooltipInstance.close();
tooltipInstance.destroy();

// you can also just close any open tooltip through the service
this.tooltip.close();
```

The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service:

```javascript
const tooltipInstance = this.tooltip.register(
  document.querySelector(".my-span"),
  options
)

// when done you can destroy the instance to remove the listeners
tooltipInstance.destroy();
```

Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args:

```javascript
const tooltipInstance = await this.tooltip.show(
  document.querySelector(".my-span"),
  { 
    component: MyComponent,
    data: { foo: 1 }
  }
)
```

## Menus

Menus are very similar to tooltips and provide the same kind of APIs:

### Component

```hbs
<DMenu @ICON="plus" @Label={{i18n "foo.bar"}}>
  <ul>
    <li>Foo</li>
    <li>Bat</li>
    <li>Baz</li>
  </ul>
</DMenu>
```

They also support blocks:

```hbs
<DMenu>
  <:trigger>
    {{d-icon "plus"}}
    <span>{{i18n "foo.bar"}}</span>
  </:trigger>
  <:content>
    <ul>
      <li>Foo</li>
      <li>Bat</li>
      <li>Baz</li>
    </ul>
  </:content>
</DMenu>
```

### Service

You can manually show a menu using the `menu` service:

```javascript
const menuInstance = await this.menu.show(
  document.querySelector(".my-span"),
  options
)

// and later manual close or destroy it
menuInstance.close();
menuInstance.destroy();

// you can also just close any open tooltip through the service
this.menu.close();
```

The service also allows you to register event listeners on a trigger, it removes the need for you to manage open/close of a tooltip started through the service:

```javascript
const menuInstance = this.menu.register(
   document.querySelector(".my-span"),
   options
)

// when done you can destroy the instance to remove the listeners
menuInstance.destroy();
```

Note that the service also allows you to use a custom component as content which will receive `@data` and `@close` as args:

```javascript
const menuInstance = await this.menu.show(
  document.querySelector(".my-span"),
  { 
    component: MyComponent,
    data: { foo: 1 }
  }
)
```


## Toasts

Interacting with toasts is made only through the `toasts` service.

A default component is provided (DDefaultToast) and can be used through dedicated service methods:

- this.toasts.success({ ... });
- this.toasts.warning({ ... });
- this.toasts.info({ ... });
- this.toasts.error({ ... });
- this.toasts.default({ ... });

```javascript
this.toasts.success({
  data: {
    title: "Foo",
    message: "Bar",
    actions: [
      {
        label: "Ok",
        class: "btn-primary",
        action: (componentArgs) => {
          // eslint-disable-next-line no-alert
          alert("Closing toast:" + componentArgs.data.title);
          componentArgs.close();
        },
      }
    ]
  },
});
```

You can also provide your own component:

```javascript
this.toasts.show(MyComponent, {
  autoClose: false,
  class: "foo",
  data: { baz: 1 },
})
```

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
Co-authored-by: Isaac Janzen <50783505+janzenisaac@users.noreply.github.com>
Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-09-26 13:39:52 +02:00
David Taylor
003b44c75c
UX: Restore wizard confetti in final step (#23533)
This was accidentally removed as part of the refactoring in fcb4e5a1a1. This commit restores it, and updates it use theme-specific colours.
2023-09-26 12:04:21 +01:00
Godfrey Chan
6bcb9f444e
DEV: Remove unused wizard code (#23664)
favicons were removed in #17477

theme-preview appears to once be a `.hbs` file shared by several
components, which went away with the refactor in #20282. It must
have accidentally came back with some rebase error, and then got
picked up by the template-only component codemod. It's unused and
does nothing anyway.
2023-09-26 12:03:39 +01:00
Godfrey Chan
f576187d78
UX: Correct tab selection in Wizard styling preview (#23639)
It seems like the intention is to update the tab selection at the bottom when the scrollable pane changes enough. In my testing (and I think by definition?), it doesn't seem like `scrollLeft` ever exceeds `offsetWidth`, so that tab-switching behavior doesn't ever happen
2023-09-26 12:02:09 +01:00
Alan Guo Xiang Tan
fa243484ca
FIX: Custom sidebar section link with / path leading to blank page (#23661)
What is the problem we are trying to solve here?

The `/` path in our Ember app leads to the `discovery.index` route but
we actually don't render anything on that route leading to a blank page
if the Ember app were to transition to it which is what was happening
when a user adds a custom sidebar section link with the `/` path.

What is the fix there?

Instead of generating a link for the `discovery.index` route when
creating the sidebar section link, we detect if the Ember route is
`discovery.index` and change it to the `discovery.${defaultHomepage()}`
route instead.
2023-09-26 15:14:13 +08:00
dependabot[bot]
77655cbb8c
Build(deps-dev): Bump sass from 1.66.1 to 1.68.0 in /app/assets/javascripts (#23638)
Bumps [sass](https://github.com/sass/dart-sass) from 1.66.1 to 1.68.0.
- [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.66.1...1.68.0)

---
updated-dependencies:
- dependency-name: sass
  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-09-26 10:41:35 +08:00
Godfrey Chan
b5ccf89914
DEV: Cleanup unused wizard illustrations (#23659)
These were defunct since #19487
2023-09-26 10:34:38 +08:00
dependabot[bot]
d0c7fa8db0
Build(deps-dev): Bump the babel group (#23657)
Bumps the babel group in /app/assets/javascripts with 2 updates: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) and [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.22.20 to 7.23.0
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.0/packages/babel-core)

Updates `@babel/standalone` from 7.22.20 to 7.23.1
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.1/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: babel
- dependency-name: "@babel/standalone"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: babel
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 02:34:33 +02:00
dependabot[bot]
ef878dcf93
Build(deps-dev): Bump babel-import-util in /app/assets/javascripts (#23658)
Bumps [babel-import-util](https://github.com/ef4/babel-import-util) from 1.4.1 to 2.0.1.
- [Commits](https://github.com/ef4/babel-import-util/compare/v1.4.1...v2.0.1)

---
updated-dependencies:
- dependency-name: babel-import-util
  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-09-26 01:47:26 +02:00
Kris
91c94f5aa6
DEV: update a couple button classes (#23127) 2023-09-25 16:45:57 -04:00