Commit Graph

22512 Commits

Author SHA1 Message Date
Kris
b35da59865
UX: adjustments for experimental bulk select menu (#26474) 2024-04-02 18:01:21 -04:00
David Taylor
f2e7909a80
DEV: Rename components GlimmerHeader -> Header (#26466)
Originally we planned to do this rename after dropping the old widget implementation. However, as we continue rolling out the update, there is a risk that people will start depending on the component names (e.g. for modifyClass) so it seems best to make the rename now to reduce risk later.
2024-04-02 16:55:49 +01:00
Penar Musaraj
1eb70973a2
DEV: allow themes to render their own custom homepage (#26291)
This PR adds a theme modifier and route so that custom themes can opt to show their own homepage. See PR description for example usage.
2024-04-02 11:05:08 -04:00
Vinoth Kannan
cd43985de0
UX: rename the word "Upgrade" to "Update" in the UI. (#26396)
In this PR, all references in the UI to the word "`upgrade`" are changed to "`update`". This is to differentiate the update process in self-hosted sites from the plan "upgrade" process in hosted sites.

Follow-up to the PR: https://github.com/discourse/docker_manager/pull/208
2024-04-02 20:04:37 +05:30
Joffrey JAFFEUX
defd63d20b
FIX: allows modals to disable swipe to close (#26460)
Prior to this fix the `swipe` modifier could not be disabled and we were not using the `this.dimissable` property to apply/not apply it.

This commit adds a new `enabled` param to the `swipe` modifier, which is used in modals with the value of `this.dismissable`.

Note this commit also adds tests for this modifier.
2024-04-02 11:11:32 +02:00
Alan Guo Xiang Tan
6c1b320e2e
DEV: Fix case inconsistency in translation file (#26456)
Why this change?

Our translation files use the snake case convention.
2024-04-02 14:39:46 +08:00
Alan Guo Xiang Tan
91f0c71720
UX: Improve validation error message when saving theme objects setting (#26455)
Why this change?

Before this change, the validation error message shown to the user when
saving a theme objects setting is very cryptic. This commit changes the
validation error messages to be displayed on top of the editor instead.

Note that I don't think this way of displaying is the ideal state we
want to get to but given the time we have this will do for now.
2024-04-02 11:55:51 +08:00
Alan Guo Xiang Tan
e58110a9a0
UX: Fix required validation error shown for not required properties (#26453)
Why this change?

In the categories, groups and tags selectors, we were showing a
validation error message when a property that is not required but
has a min validation is empty. In this case, we should not be displaying
the min validation error message because the property is allowed to be
empty.
2024-04-02 10:38:49 +08:00
Alan Guo Xiang Tan
92e0faed0a
UX: Switch to new object when adding object in theme objects setting editor (#26454)
Why this change?

When adding a new object, we want to switch to the input fields of the
new object instead of just appending the new object to the list of
objects as we believe this is a better UX flow.
2024-04-02 10:36:32 +08:00
Alan Guo Xiang Tan
397a1b7366
DEV: Refactor Discourse models based field components to reduce duplication (#26452)
Why this change?

The field components to select categories, groups and tags had quite a
bit of logic duplicated between them. This commit refactors the logic
to remove most of the duplication so that we can introduce changes
without having to make the changes in multiple places.
2024-04-02 09:32:50 +08:00
Kris
3520f4a635
FIX: ensure "save" is translatable in bookmark modal (#26446) 2024-04-02 08:23:38 +08:00
dependabot[bot]
5375799453
Build(deps): Bump terser from 5.30.0 to 5.30.1 (#26447)
Bumps [terser](https://github.com/terser/terser) from 5.30.0 to 5.30.1.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.30.0...v5.30.1)

---
updated-dependencies:
- dependency-name: terser
  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>
2024-04-02 08:23:20 +08:00
Krzysztof Kotlarek
92a341355a
FEATURE: clear sidebar admin filter with ESC (#26408)
Allow the sidebar filter to be cleared by hitting ESC.
2024-04-02 09:45:25 +11:00
Kris
fa6e275ad9
UX: fix overflow of long site text site names in the header (#26450) 2024-04-02 09:17:14 +11:00
Kris
48cb7b7863
UX: minor style adjustments for schema objects editor (#26444) 2024-04-01 12:43:19 -04:00
Kelv
07605e52c2
FIX: only show edit history when navigating via edit notification for posts which have revisions and can have its edit history viewed (#26418) 2024-04-01 11:00:28 +08:00
carehabit
11877f3b9c
DEV: remove repetitive words (#26439) 2024-04-01 06:23:21 +08:00
Kris
5a54aefd27
UX: highlight code in em and strong blocks (#26435) 2024-03-29 16:41:12 -04:00
Kris
603dd89691
UX: minor theme schema editor adjustments for mobile (#26434) 2024-03-29 15:01:02 -04:00
Blake Erickson
ba806eec74
DEV: Various bulk-select dropdown tweaks (#26424)
* DEV: Various bulk-select dropdown tweaks

- Setting is no longer hidden
- descriptions have been moved to the modal
- Removed ... from one of the dropdown titles
2024-03-29 12:29:24 -06:00
dependabot[bot]
979df9ab7a
Build(deps): Bump @glimmer/syntax from 0.91.0 to 0.91.1 (#26428)
Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.91.0 to 0.91.1.
- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases)
- [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.91.0...v0.91.1)

---
updated-dependencies:
- dependency-name: "@glimmer/syntax"
  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>
2024-03-28 22:49:34 +01:00
dependabot[bot]
20dff96413
Build(deps-dev): Bump glob from 10.3.10 to 10.3.12 (#26429)
Bumps [glob](https://github.com/isaacs/node-glob) from 10.3.10 to 10.3.12.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.3.10...v10.3.12)

---
updated-dependencies:
- dependency-name: glob
  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>
2024-03-28 22:49:22 +01:00
Penar Musaraj
fa92f8bc94
DEV: Add {{hide-application-sidebar}} helper (#26310) 2024-03-28 15:03:40 -04:00
Kris
e80593c23e
UX: wrap small-user-list-content for many users case (#26422) 2024-03-28 13:40:23 -04:00
Daniel Waterworth
5835d4e5ed
DEV: Make CategoryChooser optionally provide the category (#26420)
... rather than just the category id.

In order for the user to have selected a category, the category must
have been loaded and it's useful for the category chooser to provide
this fetched category so that it doesn't need to be refetched.

In the future, it would be better to store the categories that the
chooser knows about in local component state, so that the category
doesn't need to be fetched from the id map, but this, at least, puts the
API in place.
2024-03-28 11:16:39 -05:00
Kris
2d6051a5d5
FIX: use getter for showPoweredBy (#26419) 2024-03-28 11:22:26 -04:00
Alan Guo Xiang Tan
a670d6d4af
DEV: Change group type to groups type for theme object schema (#26417)
Why this change?

This is a follow-up to 86b2e3a.

Basically, we want to allow people to select more than 1 group as well.

What does this change do?

1. Change `type: group` to `type: groups` and support `min` and `max`
   validations for `type: groups`.

2. Fix the `<SchemaThemeSetting::Types::Groups>` component to support the
   `min` and `max` validations and switch it to use the `<GroupChooser>` component
   instead of the `<ComboBoxComponent>` component which previously only supported
   selecting a single group.
2024-03-28 22:05:48 +08:00
Alan Guo Xiang Tan
70f7d369fb
DEV: Rewrite SchemaThemeSetting::Editor to avoid rerendering problems (#26416)
Why this change?

Prior to this change, the `SchemaThemeSetting::Editor#tree` was creating a
new `Tree` instance which holds instances of `Node`. Both classes
consisted of tracked properties. The problem with this approach is that
when any tracked properties is updated, Ember will revaluate
`SchemaThemeSetting::Editor#tree` and because that method always return
a new instance of `Tree`, it causes the whole navigation tree to
rerender just because on tracked property changed.

This rerendering of the whole navigation tree every time made it hard to
implement simple features like hiding a section in
9baa820d53. Instead of being able to just
declare a tracked property to hide/show a section, we end up with a more
complicated solution.

This commit rewrites `SchemaThemeSetting::Editor` to depend on Ember
components to form the tree structure instead. As needed, each component
in the tree structure can declare its own tracked property as necessary.
2024-03-28 21:13:02 +08:00
Alan Guo Xiang Tan
6dac187785
DEV: Support translations for property labels in objects schema editor (#26362)
Why this change?

In cdba864598, we added support for adding
a description which will be displayed under the input of each property
on the client side.

Currently this convention in the locale file is followed:

```
en:
  theme_metadata:
    settings:
      objects_setting:
        description: <description> for the setting
        schema:
          properties:
            name: <description for the name property>
            links:
              name: <description for the name property in link>
              url: <description for the url property in link>
```

Since we now want to allow the label to be translated as well, we will
be changing the convention to the following:

```
en:
  theme_metadata:
    settings:
      objects_setting:
        description: <description> for the setting
        schema:
          properties:
            name:
              label: <label for the name property>
              description: <description for the name property>
            links:
              name:
                label: <label for the name property>
                description: <description for the name property in link>
              url:
		label: <label for the url property>
                description: <description for the url property in link>
```

If the locale file does not provide a `label` key under the property's
name, the client side will just display the property's name as the
label for the input field.
2024-03-28 10:53:51 +08:00
dependabot[bot]
40278511ab
Build(deps): Bump terser from 5.29.2 to 5.30.0 (#26404)
Bumps [terser](https://github.com/terser/terser) from 5.29.2 to 5.30.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.29.2...v5.30.0)

---
updated-dependencies:
- dependency-name: terser
  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>
2024-03-27 22:53:59 +01:00
Joffrey JAFFEUX
88b9f0bc56
FIX: tweaks of select-kit on mobile (#26401)
- uses footer-nav height and safe-area-inset-bottom as bottom padding
- body scroll lock select-kit only when inside a modal
2024-03-27 17:26:24 +01:00
Joffrey JAFFEUX
65c03af919
FIX: prevents body scroll to hide sticky elements (#26400)
Applying `overflow: hidden` was not playing well with sticky elements (like the header for example). It appears that we don't really need this to achieve our goal so Im removing this part of body scroll lock for now.
2024-03-27 15:21:19 +01:00
Osama Sayegh
f79f9e236a
FIX: Descriptions not showing for some site setting types (#26399)
Descriptions for the `category-list`, `file-size-restriction` and `file-types-list` site/theme settings aren't rendered due to a bug that was introduced when those components were migrated to Glimmer components. This commit fixes the bug which is that arguments passed to .gjs components should be accessed as `@argument` and not `this.arugment` inside the `<template>` tag.
2024-03-27 15:48:48 +03:00
Joffrey JAFFEUX
2146ab492b
DEV: applies body-scroll-lock on select-kit (#26397)
This will prevent any scrolling issues with sk when on mobile, especially on iOS and in modals.

Prior to this fix, scrolling could sometimes stop working in dropdowns.
2024-03-27 13:33:21 +01:00
Joffrey JAFFEUX
f9eae75972
DEV: improves keyboard sizing (#26372)
This commit is making the following changes:

- replaces `mobile-keyboard` initializer and `chat-vh` with a new template-less component: `d-vh`
- ensures body scroll lock is released when page/tab focus changes
- correctly locks body on chat channels and chat threads when composer is focused
- removes `bodyScrollFix` as we now use body scroll lock
- `onViewportResize` has been debounced to ensure it's not a bad performance vector
- adds a reverse option do body scroll lock, this is made to support reversed scroll areas (like chat channels and threads)

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2024-03-27 08:50:32 +01:00
Kris
9baa820d53
UX: add collabsible headings to theme objects editor, adjust styles (#26383)
This adds collapsible headings to child lists, and adjusts the layout to utilize the available space.
2024-03-27 13:59:01 +08:00
Krzysztof Kotlarek
0932b146d9
FEATURE: the ability to expand/collapse all admin sections (#26358)
By default, admin sections should be collapsed.
In addition, a button to expand/collapse all sections has been added.
2024-03-27 14:42:06 +11:00
Alan Guo Xiang Tan
476d91d233
DEV: Change category type to categories type for theme object schema (#26339)
Why this change?

This is a follow-up to 86b2e3aa3e.

Basically, we want to allow people to select more than 1 category as well.

What does this change do?

1. Change `type: category` to `type: categories` and support `min` and `max`
   validations for `type: categories`.

2. Fix the `<SchemaThemeSetting::Types::Categories>` component to support the
   `min` and `max` validations and switch it to use the `<CategorySelector>` component
   instead of the `<CategoryChooser>` component which only supports selecting one category.
2024-03-27 10:54:30 +08:00
Daniel Waterworth
bf35928a14
DEV: Set category on embeddable-host component instead of rest object (#26374)
The rest object doesn't need the whole serialized category.
2024-03-26 11:16:07 -05:00
Joffrey JAFFEUX
58990fb00f
FIX: calendar options part 2 (#26371)
This part of the commit has been mistakenly forgotten from bddc41b7ad
2024-03-26 15:19:02 +01:00
Joffrey JAFFEUX
bddc41b7ad
FIX: correctly pass down calendar options (#26370)
Prior to this fix the options were not passed down when the user had no default calendar.

No test as it's mostly an interaction between discourse-calendar and core which is hard to test.
2024-03-26 15:09:05 +01:00
Joffrey JAFFEUX
f350cea5d2
DEV: introduces waitForClosedKeyboard (#26363)
This lib will allow us to wait for a keyboard state change. Not waiting for the keyboard to be closed could cause issues when showing a modal at the same time on iOS for example.

Example usage:
- blurSomeInput()
- await waitForClosedKeyboard(this)
- showSomeModal()

Note that this actual behavior has been baked in modals when we call show so you don't have to call the lib yourself.
2024-03-26 13:09:59 +01:00
Alan Guo Xiang Tan
ef99b97ea7
DEV: Load theme objects typed setting metadata when routing to editor (#26354)
Why this change?

Previously, we were preloading the necessary metadata for
`adminCustomizeThemes.show.schema` route in the
`adminCustomizeThemes.show` route. This is wasteful because we're
loading data upfront when the objects setting editor may not be used.

This change also lays the ground work for a future commit where we need
to be shipping down additional metadata which may further add to the
payload.
2024-03-26 14:02:05 +08:00
Alan Guo Xiang Tan
fbde7f8bc1
UX: Fix position of characters count on objects setting input field (#26357) 2024-03-26 12:54:04 +08:00
Joffrey JAFFEUX
2a1b675af7
FIX: attempts to update select-kit on keyboard (#26345)
Prior to this change the dropdown could appear offscreen due to its position not being updated after the appearance of the keyboard.
2024-03-25 22:58:11 +01:00
dependabot[bot]
72bac7eace
Build(deps): Bump @glimmer/syntax from 0.90.1 to 0.91.0 (#26351)
Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.90.1 to 0.91.0.
- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases)
- [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.90.1...v0.91.0)

---
updated-dependencies:
- dependency-name: "@glimmer/syntax"
  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>
2024-03-25 22:45:22 +01:00
Blake Erickson
ce037f9962
DEV: Bulk Actions Dropdown Plugin API (#26224)
Adds a plugin api for the bulk actions dropdown.

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-03-25 14:44:38 -06:00
dependabot[bot]
df10c0b3d0
Build(deps-dev): Bump express from 4.19.1 to 4.19.2 (#26348)
Bumps [express](https://github.com/expressjs/express) from 4.19.1 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.1...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 21:31:40 +01:00
Loïc Guitaut
99921120a1 DEV: Switch to Chromium in CI
This patch switches to using Chromium in our CI jobs instead of Chrome.
2024-03-25 21:24:26 +01:00
Kris
0de20f860b
UX: update twitter blue to X black (#26343) 2024-03-25 11:36:33 -04:00