discourse/app/assets/javascripts/admin/addon
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
..
adapters DEV: Allow typed objects theme settings to be saved via settings editor (#26100) 2024-03-11 08:42:12 +08:00
components DEV: Rewrite SchemaThemeSetting::Editor to avoid rerendering problems (#26416) 2024-03-28 21:13:02 +08:00
controllers FEATURE: More flexible admin plugin config nav definition (#26254) 2024-03-21 13:42:06 +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 DEV: Load theme objects typed setting metadata when routing to editor (#26354) 2024-03-26 14:02:05 +08:00
routes DEV: Load theme objects typed setting metadata when routing to editor (#26354) 2024-03-26 14:02:05 +08:00
services FEATURE: More flexible admin plugin config nav definition (#26254) 2024-03-21 13:42:06 +10:00
templates FEATURE: More flexible admin plugin config nav definition (#26254) 2024-03-21 13:42:06 +10:00