discourse/plugins/discourse-chat-integration/spec
Krzysztof Kotlarek 45538c7c11
DEV: Handle both string and object tag formats (#37207)
What is the problem?

PR discourse/discourse#36678 changes tags from an array of strings to an
array of tag objects. The chat-integration plugin's rule editing and
display functionality will break when tags become objects instead of
strings:
- The `EditRule` modal directly mutates `rule.tags` with the tag chooser
output
- The `RuleRow` component displays `rule.tags` directly in the template

What is the solution?

Update both components to handle both formats:
- Add `onTagsChanged` handler in `EditRule` that normalizes tags to
strings using `typeof t === "string" ? t : t.name`
- Add `displayTags` getter in `RuleRow` that converts tags to strings
before display
- Add system spec to verify tag editing works correctly

This is the same backwards-compatible approach used in Discourse core.
2026-01-21 08:43:32 +08:00
..
fabricators
helpers DEV: Fix random typos (#33839) 2025-07-24 22:04:13 +02:00
integration
jobs
lib/discourse_chat_integration DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
models
requests
services DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
system DEV: Handle both string and object tag formats (#37207) 2026-01-21 08:43:32 +08:00
dummy_provider.rb DEV: Remove unnecessary freeze calls (#35064) 2025-09-30 15:36:16 +02:00