Commit Graph

20004 Commits

Author SHA1 Message Date
David Taylor
e9ef4900ca
DEV: Correct test waiter for requestAnimationFrame (#20413)
Followup to 207c0dd88c. Waiters should return false to 'wait', true to continue.
2023-02-22 09:29:49 +00:00
David Taylor
cf0c73d1b7
DEV: Silence discourse.custom_html_template in its own test (#20414) 2023-02-22 09:29:36 +00:00
Alan Guo Xiang Tan
64cf7e444b
DEV: Remove use of deprecated prop from user notifications templates (#20404)
The redesigned_user_page_nav_enabled property has been deprecated and will be dropped from Discourse core soon.
2023-02-22 13:56:08 +08:00
Alan Guo Xiang Tan
2fc2d7d828
DEV: Remove use of deprecated prop from user preferences templates (#20403)
The `redesigned_user_page_nav_enabled` property has been deprecated and will be dropped from Discourse core soon.
2023-02-22 13:23:56 +08:00
Martin Brennan
a3712781e1
FIX: Text selection breaking with hashtag SVG in Firefox (#20406)
The new hashtags render with an `<svg>` element inside a `<a>`
tag, which is an icon to indicate the "type" of the hashtag.
In Firefox, this was disrupting both triple-click text selection
and simple dragging cursor text selection. The selection would
stop at the SVG rather than continuing past it. This works fine
in Chrome -- either Chrome is not doing the right thing or Firefox
is.

Either way the issue is fixed by simply making the `svg` an inline
element inside the link, which it should be anyway.
2023-02-22 13:56:08 +10:00
Alan Guo Xiang Tan
dc9af48942
DEV: Remove use of redesigned_user_page_nav_enabled prop client side 2 (#20388)
The property has been deprecated and will be dropped from Discourse core
soon.
2023-02-22 08:13:07 +08:00
Keegan George
c43cb0c571
DEV: Apply optimistic update pattern to badge toggle (#20399) 2023-02-21 15:27:59 -08:00
Alan Guo Xiang Tan
c11fd4fdf9
FIX: Override navigation menu to "legacy" via query param not working (#20402)
When the `navigation_menu` site setting has been set to `sidebar` or
`header dropdown`, overriding the site setting via the `navigation_menu`
query params did not work.

Follow-up to c47015b861
2023-02-22 06:43:14 +08:00
Krzysztof Kotlarek
b9d037770c
DEV: configurable public sidebar sections (#20303)
Extension of https://github.com/discourse/discourse/pull/20057

Admin can create a public session visible to everyone. An additional checkbox is displayed for staff members.
2023-02-22 08:55:44 +11:00
dependabot[bot]
e3ee81aa3c
Build(deps): Bump @babel/standalone in /app/assets/javascripts (#20398) 2023-02-21 20:59:02 +01:00
dependabot[bot]
692e843832
Build(deps): Bump @babel/core in /app/assets/javascripts (#20381)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.20.12 to 7.21.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.21.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  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-21 19:13:50 +01:00
David Taylor
207c0dd88c
DEV: Resolve flaky test caused by requestAnimationFrame use (#20396)
We need to register a waiter so that any calls to `await settled()` will wait for the `requestAnimationFrame` call to return. Wrapping in `DEBUG` as well as `isTesting()` means that this extra logic will be totally optimized out of production builds.
2023-02-21 18:02:04 +00:00
David Taylor
235edfd07b
UX: Restore wider search dropdown width (#20391)
Followup to c82094cd9d
2023-02-21 15:40:22 +00:00
Isaac Janzen
64975a6ecb
DEV: Remove deprecated topic timeline (#20314)
Continuing from https://github.com/discourse/discourse/pull/20313

- Drop deprecated topic timeline widget / component logic
2023-02-21 08:23:40 -06:00
David Taylor
c82094cd9d
PERF: Refactor slide-in menu sizing for improved performance (#20377)
Using Javascript to read and recalculate sizing is prone to causing 'forced reflows', which are very expensive, especially on slower devices. This PR refactors the slide-in menus so that all of the height calculation is done using CSS. This is made possible by the new dvh (dynamic view height) units and env(safe-area-inset-bottom), both of which are supported on all of our target browsers.

In tests on a moto g50, on a sidebar with 16 categories, 15 tags, and 2 chat channels, this improves the sidebar opening time by around 50ms (6%).
2023-02-21 13:55:38 +00:00
chapoi
87de3c2319
UX: highlight vars updates (#20346)
* UX: replace highlight vars in popup menu

* UX: replace highlight vars in autcomplete

* UX: replace highlight vars in menu-panel

* UX: update style guide

* UX: bulk replace highlight vars in various small appearances
2023-02-21 10:15:49 +01:00
Alan Guo Xiang Tan
452539bf5b
DEV: Remove use of redesigned_user_page_nav_enabled prop client side (#20387)
Since 359dc1c532, support for the old user
profile navigation menu has been dropped. This commit seeks to remove
code from the client side that still relies on the `currentUser.redesigned_user_page_nav_enabled` prop.
2023-02-21 14:09:48 +08:00
Alan Guo Xiang Tan
c1486790d6
DEV: Remove old user profile navigation menu tests (#20386)
Since 359dc1c532, support for the old user
profile navigation menu has been dropped. This commit seeks to remove
code from the client side that still relies on the `currentUser.redesigned_user_page_nav_enabled` prop.
2023-02-21 14:03:40 +08:00
Alan Guo Xiang Tan
6efebd7f11
DEV: Use data attributes as identifier for sidebar tag section links (#20385)
Why this change?

Prior to this change, we placed the identifier for the tag using
CSS classes like `sidebar-section-link-<tag name>`. However, we found that it wasn't obvious
that an identifier for the tag exists since it is first buried in
the CSS classes and second there isn't a way to describe what the
identifier is. Using data attributes, it makes it more obvious that an
identifier exists and what the identifier represents.

Follow-up to 53eb49de72
2023-02-21 11:05:34 +08:00
Alan Guo Xiang Tan
53eb49de72
DEV: Use data attributes as identifier for sidebar category section links (#20384)
Why this change?

Prior to this change, we placed the identifier for the category using
CSS classes like `sidebar-section-link-<category slug>`. However, we found that it wasn't obvious
that an identifier for the category exists since it is first buried in
the CSS classes and second there isn't a way to describe what the
identifier is. Using data attributes, it makes it more obvious that an
identifier exists and what the identifier represents.
2023-02-21 10:29:44 +08:00
Alan Guo Xiang Tan
c47015b861
DEV: Change enable_sidebar query param to navigation_menu (#20368)
What does this change do?

This commit the client to override the navigation menu setting
configured by the site temporarily based on the value of the
`navigation_menu` query param. The new query param replaces the old
`enable_sidebar` query param.

Why do we need this change?

The motivation here is to allow theme maintainers to quickly preview
what the site will look like with the various navigation menu site
setting.
2023-02-21 09:59:56 +08:00
chapoi
c8a4081a21
UX: add h1 tag to user page (#20378) 2023-02-20 17:26:14 +01:00
chapoi
b50a581c5d
UX: badge page styling update (#20373)
* UX: change layout badge card

* UX:  copy change

* UX: badge list styling

* UX: make active badge styling more clear

* Update translation

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>

* Include x in translation

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>

---------

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2023-02-20 15:14:54 +01:00
Keegan George
9c29d688e7
FEATURE: Add word count and indicator when exceeded max (#19367)
**This PR creates a new core reusable component wraps a character counter around any input.**

The component accepts the arguments: `max` (the maximum character limit), `value` (the value of text to be monitored).

It can be used for example, like so:
```hbs
  <CharCounter @max="50" @value={{this.charCounterContent}}>
    <textarea
      placeholder={{i18n "styleguide.sections.char_counter.placeholder"}}
      {{on "input" (action (mut this.charCounterContent) value="target.value")}}
      class="styleguide--char-counter"></textarea>
  </CharCounter>
```

**This PR also:**
1. Applies this component to the chat plugins edit channel's *Edit Description** modal, thereby replacing the simple text area which provided no visual indication when text exceeded the max allowed characters.
2. Adds an example to the `/styleguide` route
2023-02-20 12:06:43 +01:00
chapoi
dc7a2f0d1a
UX: remove fixed width from buttons (#20369) 2023-02-20 11:17:17 +01:00
Alan Guo Xiang Tan
d71a82786a
UX: Hide hamburger dropdown when enable_sidebar query param is used (#20367) 2023-02-20 11:34:37 +08:00
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