Commit Graph

19978 Commits

Author SHA1 Message Date
Osama Sayegh
f91631b625
DEV: Update javascript:update_constants rake task following template colocation (#20365)
As of ba3f62f576, handlebars templates are colocated with js files so the path to hbs templates referenced by this rake task is no longer valid. This commit fixes the path to hbs templates and updates a couple of files that are generated by the rake task.
2023-02-20 06:20:47 +03:00
dependabot[bot]
65b507dba4
Build(deps): Bump sass from 1.58.1 to 1.58.3 in /app/assets/javascripts (#20362) 2023-02-19 23:41:12 +01:00
dependabot[bot]
94a6749f7b
Build(deps): Bump terser in /app/assets/javascripts (#20363) 2023-02-19 23:40:37 +01:00
Isaac Janzen
53695e7d29 DEV: Only include userTips if user is present 2023-02-18 19:48:54 +00:00
Isaac Janzen
9fd2207826 DEV: Enable glimmer-topic-timeline by default 2023-02-18 19:48:54 +00:00
Penar Musaraj
a945ca3e01
FIX: Allow HTML in category read-only dialog (#20349)
We allow HTML for this string in `category-read-only-banner.hbs`,
this makes it consistent for the dialog.
2023-02-17 11:23:25 -05:00
Kris
d67ed8468f
UX: move vertical admin plugin nav to horizontal overflow nav (#20319) 2023-02-17 10:21:30 -05:00
David Taylor
e381a55533 DEV: Update section-link-test to ignore order of classes 2023-02-17 12:09:55 +00:00
David Taylor
e27966c944 PERF: Remove ember-link-component-extension to enable Glimmer LinkTo
Reopening Ember.LinkComponent causes `<LinkTo>` to enter 'legacy mode', and fall back to the Classic Component implementation. The extension added the ability to pass `@name` to the component. Setting a name (or any other attribute) on the new Glimmer implementation can be achieved by passing `name=` (no `@`).

The original use case for this was refactored out during https://github.com/discourse/discourse/commit/d3649873a2. There are no other instances of `@name` being used in core or `all-the-*`.

The update to section-link is required to avoid a warning when an `undefined` value is passed to the argument.
2023-02-17 12:09:55 +00:00
David Taylor
18e1f0e5b2 PERF: Remove custom Sidebar::SectionLinkTo implementation
This custom implementation was extending from `Ember.LinkComponent`, which is a legacy 'classic component' implementation of `<LinkTo`. Our current version of Ember includes a native glimmer implementation of LinkTo which should be much faster.

The patch we introduced was to set the 5th argument to `routing.isActiveForRoute` to `false`. In our current version of Ember, `isActiveForRoute` only takes 4 arguments, so this override is essentially a no-op. The change was made in https://github.com/emberjs/ember.js/commit/56af48bb41 (first released in Ember 3.24).
2023-02-17 12:09:55 +00:00
chapoi
1a653d2ce9
Revert "Revert "Select-kit > use new color vars" (#20042)" (#20345)
This reverts commit 5f90790110.
2023-02-17 07:29:26 +01:00
chapoi
8465f53a35
UX: userstatus limit handling in UI (#20343)
* UX: handle long userstatus in menupanel

* UX: remove margin on userstatus emoji

* UX: change emoji sise of user status in DM creator

* FIX: user status overflow on chat index
2023-02-17 06:54:56 +01:00
Rafael dos Santos Silva
8a224bf999
FEATURE: Use feature detection for showing push notification in iOS (#20338)
* FEATURE: Use feature detection for showing push notification in iOS

* Don't want this on DiscourseHub as it's confusing
2023-02-16 18:00:37 -03:00
Joffrey JAFFEUX
7391f8e077
FIX: correctly account for ipad footer nav height (#20334)
This code also removes duplicated code in chat which doesn’t seem necessary anymore.
2023-02-16 16:49:17 +01:00
Jarek Radosz
c541bd05a8
DEV: Add missing decorateCookedElement id (#20330)
Fixes "`decorateCooked` should be supplied with an `id` option to avoid memory leaks in test mode. The id will be used to ensure the decorator is only applied once." warnings
2023-02-16 13:58:23 +01:00
dependabot[bot]
5720bb7b64
Build(deps): Bump @uppy/xhr-upload in /app/assets/javascripts (#20296)
Bumps [@uppy/xhr-upload](https://github.com/transloadit/uppy) from 3.0.4 to 3.1.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/xhr-upload@3.0.4...@uppy/xhr-upload@3.1.0)

---
updated-dependencies:
- dependency-name: "@uppy/xhr-upload"
  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-02-16 12:06:51 +01:00
chapoi
99eceab6bc
UX: catch edge cases in tooltip (#20327) 2023-02-16 10:34:17 +01:00
Krzysztof Kotlarek
1a5f6aefc7
FIX: correct sidebar and chat height on DiscourseHub (#20323)
Before that change, footer of the sidebar was not visible.
Footer is very important, especially now, when add custom section button is located there.
Also, distance between chat input and keyboard were increased
2023-02-16 15:59:09 +11:00
Osama Sayegh
183946a549
FIX: Don't fallback to original implementation for linkTitle in the custom type (#20298)
The `custom` notification type is a generic notification type that plugins can use for their own notifications, so it doesn't make sense to fallback to the implementation of `linkTitle` in the base notification type because core can't possibly come up with a title suitable for all custom notifications.
2023-02-16 01:19:16 +03:00
Jordan Vidrine
d40143371b
UX: Style edits (#19927) 2023-02-15 11:02:16 -06:00
Canapin
4bfa130c3a
UX: Fix remove-user-from-pm hover styling (#20273) 2023-02-15 11:06:21 -05:00
David Taylor
4d9728d468
DEV: Colocate wizard component templates (#20309) 2023-02-15 11:29:22 +00:00
David Taylor
a5c92a7b43 DEV: Colocate core components with mobile templates
Core now has support for mobile-specific overrides of component templates, so we can now safely colocate the last batch of core components.

Followup to 524cb5211b
2023-02-15 11:08:22 +00:00
David Taylor
3ab7469fcb DEV: Remove identical mobile template and colocate
The mobile and desktop templates are identical, so there is no need to separate them
2023-02-15 11:08:22 +00:00
David Taylor
0b1ce9cede
DEV: Support mobile-specific template overrides of colocated components (#20307)
Long-term, we may aim to remove the ability to have mobile-specific component templates. But for now, this commit will allow us to colocate a component's template, while keeping the mobile-specific-override functionality for core, plugins and themes.
2023-02-15 10:55:08 +00:00
dependabot[bot]
ae6d6fba8f
Build(deps): Bump sass from 1.58.0 to 1.58.1 in /app/assets/javascripts (#20294)
Bumps [sass](https://github.com/sass/dart-sass) from 1.58.0 to 1.58.1.
- [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.58.0...1.58.1)

---
updated-dependencies:
- dependency-name: sass
  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-02-15 10:40:02 +01:00
chapoi
f19044af6a
UX: add transparent border for header icon (#20306) 2023-02-15 06:55:13 +01:00
Canapin
14a447175b
Double arrow support (#20288) 2023-02-14 14:24:14 -05:00
Penar Musaraj
afdb4a084a
FIX: Reset admin theme controller on modal cancel event (#20289)
When installing themes using the "Install this theme component" button
on meta.discourse.org, we pass the repo name and URL via query params.

However, these stick. So if a user cancels the installation, on the
next navigation to the same route, they'll see the modal again.

This PR clears the query params  of the controller when dismissing the
modal.
2023-02-14 14:23:07 -05:00
David Taylor
1506017767
DEV: Refactor wizard preview components to use inheritence (#20282)
The previous `createPreviewComponent` implementation was problematic for template colocation. We can achieve the same result using normal component class inheritance.
2023-02-14 14:20:15 +00:00
Kris
2dbcea9eee
A11Y: Allow header logo/title to hide, if needed (#20244) 2023-02-14 09:04:48 -05:00
Kris
dfffb43933
UX: warn about consequences of group deletion (#20030)
This adds the group member count, group name, and rewords the warning.

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2023-02-14 09:01:06 -05:00
David Taylor
524cb5211b
DEV: Revert colocation of components with mobile templates (#20285)
Separate mobile templates aren't compatible with colocation. Reverting for now.
2023-02-14 13:58:14 +00:00
David Taylor
8788672890 DEV: Remove unneeded layoutName properties
Now that templates are colocated, they are automatically associated with the Component class (and all child classes)
2023-02-14 12:10:05 +00:00
David Taylor
ba3f62f576 DEV: Colocate all component templates in discourse 2023-02-14 12:10:05 +00:00
David Taylor
18c560903d
DEV: Skip failing modifyClass test (#20281)
This is a known failure. Using todo causes it to show up at the bottom of all test runs, which is annoying. Let's just skip it instead.
2023-02-14 11:37:06 +00:00
David Taylor
5aac0bd97b
DEV: Correct bootstrap-mode-notice component filename (#20279)
The template is defined with dashes. Our resolver forgave this difference, and matched things up correctly. However, when we come to colocate templates, the names must match exactly.
2023-02-14 11:22:08 +00:00
David Taylor
6595374e49
DEV: Correct location of color-input template (#20278)
The JS component definition is in the admin bundle, but the template was in the main bundle. This was identified while attempting to colocate component templates in the discourse/app directory
2023-02-14 11:02:27 +00:00
David Taylor
605188a155
DEV: Update template-lint-disable in user.hbs (#20277)
Having a template-lint-disable comment with whitespace trimming was triggering a message during build, likely due to a bug in the build process.

```
unexpectedly found "! template-lint-disable ~" when slicing source, but expected " template-lint-disable "
```

This commit avoids the problem by moving the template-lint-disable comment outside of the stripped-whitespace area.
2023-02-14 10:38:51 +00:00
Krzysztof Kotlarek
ca7131648f
FIX: edit custom section title (#20258)
When custom section is edited, it should say "Edit custom section" instead of "Add custom section"
2023-02-14 10:24:45 +11:00
Jarek Radosz
2d99e508c6
DEV: Add a plugin outlet for admin upgrade-header (#20274) 2023-02-14 00:03:46 +01:00
Kris
1c64b2dd95
UX: allow sidebar to appear inline down to 768px (#20271)
* UX: allow sidebar to appear inline down to 768px

* test fix

* fix typos
2023-02-14 09:51:42 +11:00
David Taylor
3bfd8c7192
DEV: Modernise and colocate UserField component (#20267)
Dynamically setting the `layoutName` is not compatible with template colocation. Instead, we can give each field type a dedicated component and make `<UserField` a wrapper which renders the correct implementation.
2023-02-13 19:06:23 +00:00
David Taylor
87f9583dcf
DEV: Modernise CustomHtml implementation (#20266)
Dynamically setting `layoutName` is not compatible with template colocation. This commit updates `<CustomHTML` to remove the `custom-html-container.hbs` template, and instead dynamically sets the `layout` property as required. Once the deprecated 'custom hbs' feature is removed, this can be updated to be a regular colocated component template.
2023-02-13 18:58:59 +00:00
Penar Musaraj
4072786f5b
DEV: Support using Ember components in dialog service (#20230)
We often have the need to use rich HTML in dialog messages (to show lists, icons, etc.). Previously, our only option was to wrap the message in an `htmlSafe()` call. This PR adds the ability to pass a component name and model to the dialog, which means that we can write the HTML in regular Ember components. 

Example, whereas previously we would do this: 

```
    this.dialog.deleteConfirm({
      message: htmlSafe(`<li>Some text</li>`),
    });
```

instead we can now do this: 

```javascript
import SecondFactorConfirmPhrase from "discourse/components/dialog-messages/second-factor-confirm-phrase";

...

this.dialog.deleteConfirm({
  title: I18n.t("user.second_factor.disable_confirm"),
  bodyComponent: SecondFactorConfirmPhrase,
  bodyComponentModel: model,
})
```

The model passed to the component is optional and will be available as `@model` in the Handlebars template.
2023-02-13 13:03:31 -05:00
David Taylor
5dc2c0b5a2
DEV: Deprecate CustomHTML hbs templates (#20264)
This is an old system for introducing custom content into Discourse. Nowadays, plugins and themes should be using Plugin Outlets for this.
2023-02-13 17:41:32 +00:00
David Taylor
b718e3fffc DEV: Remove layoutName references to site-settings component template 2023-02-13 11:42:38 +00:00
David Taylor
076af132a1 DEV: Colocate all admin component templates 2023-02-13 11:42:38 +00:00
David Taylor
8efb787d87
DEV: Introduce support for Glimmer PluginOutlet connectors (#20108)
Previously, all plugin connector templates would be rendered using the PluginConnector classic component definition. This commit introduces three key changes:

1. PluginOutlets can be passed `@defaultGlimmer={{true}}`, which will cause all connectors to be rendered as highly-performant 'template only glimmer components'. For now, to avoid breaking backwards compatibility, this is only intended for use on newly introduced PluginOutlets.

2. Connector js files can now directly export component definitions. This allows connectors on existing outlets to start using Glimmer components (template-only, or otherwise) straight away. It also makes it much more ergonomic to introduce custom logic to outlets. `shouldRender` continues to be supported (as a static class method).

3. Outlet arguments are now made available as `@outletArgs` in classic, glimmer and template-only-glimmer connectors. In glimmer and template-only-glimmer connectors, this is the only way to access the outlet's arguments. In classic connectors, the old methods still function - `@outletArgs` exists as a path for incremental migration
2023-02-13 09:43:16 +00:00
Gerhard Schlager
1d7e21a338
DEV: Replace concatenated string (#20254) 2023-02-13 00:45:55 +01:00