Fixes a bug where clicking keep editing in the discard modal dialog
would result in the composer auto save being disabled. Because of this
updates to drafts after this point can easily be lost.
The issue was that the `cancelComposer` was not resolving the promise,
and therefore not setting `skipAutoSave` to false in the final step.
This change also includes another fix for an issue that was revealed
where the discard draft dialog would continually open again after we
close it. This would happen when editing a draft while viewing a
different topic. It wasn't noticed before as the `keep editing` button
would result in the code hanging at the `await
this.cancelComposer(opts)` stage and not opening the composer again for
the new topic reply.
This commit ensures rails will recognise `IST` as a timezone. It will be
mapped to the standard timezone `Asia/Kolkata`.
Its technically not a standard, but it's used by many people so we are
adding it as a timezone in core.
/t/-/150799
Im not exactly sure of the reason, but I thought it was related to the
recent `addAdminPluginConfigurationNav`. I followed more closely what
has been made in chat for hooks and it seems to fix the problem.
/t/-/154466
Recently, themes page was rebranded and put
`/admin/config/customize/themes`. In this PR, old
`/admin/customize/themes` was removed. In addition, when an admin visits
an old URL, they are redirected to the new one.
`label` and `description` did not work in `type: objects` in site
settings; this PR fixes that.
In theme settings, it is still working as expected(added tests for it ).
The component was importing `@ember/component` but not marking the
category arg as tracked. Changed to `@glimmer/component` so the category
arg is tracked, and cleaned up the rest of the component to match.
Related to [this issue on
meta](https://meta.discourse.org/t/category-headers-missing-the-titles/361954).
Apparently a few customers with themes using the CategoryTitleLink
component got hit with the category title not updating correctly when
the category changed.
This creates a new `/common/base/list-controls.scss` file and pulls
relevant styles from `_topic_list.scss` into it along with the mobile
`list-controls.scss`
Introduces the viewport_based_mobile_mode experimental site setting.
When enabled, user-agent-based mobile/desktop detection will be replaced
with viewport-width logic. 'mobile mode' is enabled for any viewport
less than our 'sm' breakpoint (40rem, or 640px at default font size).
When this mode is enabled, mobile/desktop toggle buttons are hidden,
since they are non-functional.
Tests are also updated to use a consistent method for force-enabling the
legacy mobile mode. All state is now stored in `lib/mobile`, and the
`Site` model references that via a getter.
Clearing of params is now happening in the addTheme callback in the call site. Calling it in the component in willDestroy results in a double redirect which breaks the redirection to the components tab.
Removes the rich editor checklist input rule `undoable: false`, which is
not needed.
Making it undoable allows a backspace to undo the input rule conversion,
so we can go from a check to a `[]` again
Follow up to refactoring the generic utils mixin used in select-kit
components in https://github.com/discourse/discourse/pull/32594.
This PR follows a different approach as the util functions related to
properties here aren't easily extracted without a major change to the
interface due to the dependency on `this.selectKit`. These util
functions are instead declared on the prototype with a class decorator
which ensures the same behaviour is maintained without relying on a
mixin.
It's largely a lift-and-shift with some minor refactoring of the
conditional logic to reduce nesting and improve readability of the
functions.
## 🔍 Overview
This update add an _optional_ attribute to the `toolbar.addButton()` API
so that we can conditionally hide the shortcut showing up in the title.
Although for most cases, showing the shortcut in the title is fine. For
complex uses of `toolbar.addButton` where it triggers a menu, it isn't
ideal. For example, in Discourse AI, the toolbar API is used to show a
menu for the AI composer helper. The shortcut in the API is used to
trigger the proofreading item, but not necessarily for all other items.
As such, we want the shortcut hidden in the title.
## 🛠️ Usage
```diff
withPluginApi((api) => {
api.onToolbarCreate((toolbar) => {
toolbar.addButton({
id: "smile",
group: "extras",
name: "smile",
icon: "far-face-smile",
title: "cheese",
shortcut: "ALT+S",
+ hideShortcutInTitle: true,
});
});
});
```
### ← Before
Title shows:
> Cheese (Ctrl + Alt + S)
### → After
Title shows:
> Cheese
Marking mixed-decls as silenced & fatal simultaneously is causing a
warning "Ignoring setting to silence mixed-decls deprecation, since it
has also been made fatal"
The intention is for it to be silenced for themes/plugins, but fatal for
core.
This is a more efficient version of `{{hash`, where the values are only evaluated when they're actually accessed. Also enables a new lint rule which will ensure `{{hash` is not reintroduced on PluginOutlets