mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 21:38:22 +08:00
This PR replaces the use of the tags mixin for select-kit components with a tag-utils service instead. Main changes: 1. Remove methods needed to set selectKitOptions key `allowAny` from the service, this was largely unnecessary since 3 out of 4 components using the mixin already defined their own selectKitOptions `allowAny` (which would override the mixin version), and the last component `mini-tag-chooser` overrode the _value_ with its own `allowAnyTag` property. 2. Remove all state from service and decouple from whole components by explicitly requiring that any dependent property/callback be passed in as arguments to the methods (so anything relying on `this` or `context`). `site` and `siteSettings` are explicitly injected as services into the tag-utils service as well for access to their properties. 3. `_transformJson` needs to be passed into the service as a callback that acts on the component, and I chose the `@bind` decorator for this. `@action` doesn't work too well here as it results in subtle timing errors where later on in the cycle, this results in setting properties on destroyed components. |
||
|---|---|---|
| .. | ||
| tag-utils.js | ||