I would like to access the Topic Controller’s toggleVisibility
action within a component via a connector.
I see there is a precedent for this.
Would the following PR be accepted?:
to
<span>
<PluginOutlet
@name="topic-above-post-stream"
@connectorTagName="div"
@outletArgs={{lazyHash
model=@controller.model
editFirstPost=@controller.editFirstPost
toggleVisibility=@controller.toggleVisibility
}}
/>
</span>
If so, I’ll raise
Thanks!
إعجاب واحد (1)
david
(David Taylor)
28 مايو 2025، 7:49ص
2
Seems reasonable to me.
Although without looking, I’m not sure what toggleVisibility does. Should we give it a more descriptive name?
إعجاب واحد (1)
great!
well it’s the current naming convention for this action across Discourse
It’s the name used for listing and unlisting a topic.
إعجابَين (2)
david
(David Taylor)
28 مايو 2025، 7:52ص
4
Ah ok, better keep the name as-is then, rather than having to rename it everywhere
إعجاب واحد (1)
Yeah, that was my thought
I’ll raise!
david
(David Taylor)
28 مايو 2025، 7:53ص
6
Just looking at the implementation:
You already have access to the model
in the connector, so does it make sense to just do this.args.model.toggleStatus("visible")
from your connector instead?
إعجاب واحد (1)
wow, thanks, that’s awesome!
It definitely makes a lot less sense. I didn’t realise that existed, I’ll give that a go!
إعجاب واحد (1)
system
(system)
تم إغلاقه في
27 يونيو 2025، 7:56ص
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.