kgish
(Kgish)
December 23, 2016, 6:19pm
1
Since the latest upgrade, my plugin button in the admin dashboard menu has lost the correct styling, as you can see here:
My /connectors/admin-menu/app-admin-connector.hbs
template looks like this:
{{#link-to 'admin.pvda'}}{{i18n 'pvda.admin.menu_title'}}{{/link-to}}
1 Like
kgish
(Kgish)
December 23, 2016, 6:28pm
2
I see that in the file app/assets/javascripts/admin/templates/admin.hbs
the line:
{{plugin-outlet "admin-menu" tagName="li"}}
has been changed to:
{{plugin-outlet name="admin-menu" connectorTagName="li"}}
kgish
(Kgish)
December 24, 2016, 10:44am
3
For those interested, this is my workaround until someone from the Discourse team fixes it.
Basically I need to unwrap
the stuff inside the span
like this:
<ul><span><li><a>...</a></li></span></ul>`
to this:
<ul><li>...</li></ul>
{{#link-to 'admin.pvda' id='admin-menu-pvda'}}
{{i18n 'pvda.admin.menu_title'}}
{{/link-to}}
api.onPageChange((url, title) => {
// --- ADMIN PAGE --- //
if (/\/admin\//.test(url)) {
// Admin pages start with "/admin/*"
let sel = '#admin-menu-pvda',
pvda_menu_item = $(sel);
if (pvda_menu_item.length) {
let li = pvda_menu_item.parent();
if (li.is("li")) {
let span = li.parent();
if (span.is("span")) {
li.unwrap();
}
}
}
}
...
}
cpradio
(cpradio)
December 24, 2016, 1:07pm
4
I think this is related to something @sam uncovered recently too
Just to expand a bit, looks like if you want to set a class on wrapping component you would use:
api.registerConnectorClass('user-profile-primary', 'my-connector', {
setupComponent() {
this.set('classNames', ['foo']);
}
});
With the new changes I am seeing a wrapping span @eviltrout which is a bit of a blocker for me:
[image]
Outlet is defined as:
{{plugin-outlet name="user-activity-bottom"
connectorTagName='li'
args=(hash model=model)}}
Is…
4 Likes
kgish
(Kgish)
December 25, 2016, 12:53pm
5
Yes, it’d be very nice if we could get this fixed.