Plugin admin button broken styling


(Kgish) #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}}

Horizontal admin menu buttons cut off
(Kgish) #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) #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) #4

I think this is related to something @sam uncovered recently too


(Kgish) #5

Yes, it’d be very nice if we could get this fixed.