discourse/app/assets/javascripts/admin/addon
Alan Guo Xiang Tan cdba864598
DEV: Support description for properties in objects schema (#26172)
Why this change?

When editing a objects typed theme setting, the input fields which are
rendered should include a description so that the user knows the purpose
of the field which they are changing.

What does this change do?

This change adds support for adding description to each property in the
schema for an object by following a given convention in the locale file.

For a schema like this:

```
objects_setting:
  type: objects
  schema:
    name: section
    properties:
      name:
        type: string
        required: true
      links:
        type: objects
        schema:
          name: link
          properties:
            name:
              type: string
              required: true
              validations:
                max_length: 20
            url:
              type: string
```

Description for each property in the object can be added like so:

```
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>
```

If the a description is not present, the input field will simply not
have an description.

Also note that a description for a theme setting can now be added like
so:

```
en:
  theme_metadata:
    settings:
      some_other_setting: <This will be used as the description>
      objects_setting:
        description: <This will also be used as the description>
```
2024-03-15 07:47:42 +08:00
..
adapters DEV: Allow typed objects theme settings to be saved via settings editor (#26100) 2024-03-11 08:42:12 +08:00
components DEV: Support description for properties in objects schema (#26172) 2024-03-15 07:47:42 +08:00
controllers DEV: Single admin plugin page for consistent admin plugin UX (#26024) 2024-03-13 13:15:12 +10:00
helpers DEV: replace registerUnbound usage with default exports (#23802) 2023-10-19 14:28:25 +01:00
lib DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
mixins DEV: Add save button to editing typed objects theme setting route (#26133) 2024-03-13 06:52:46 +08:00
models FEATURE: filter additional keywords for the sidebar (#26148) 2024-03-14 12:28:08 +11:00
routes FEATURE: filter additional keywords for the sidebar (#26148) 2024-03-14 12:28:08 +11:00
services FEATURE: filter additional keywords for the sidebar (#26148) 2024-03-14 12:28:08 +11:00
templates FIX: improvements for the admin sidebar (#26168) 2024-03-14 15:01:47 +11:00