From a08c2dfe1297a5d1e1e53a4fd66407cc20d4b7cb Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 26 Apr 2021 08:17:50 +0100 Subject: [PATCH] Added grouped and custom option support to `` no issue - `` is based around `` but using Power Select's grouped options feature didn't work because we weren't falling back to it's built-in group component - updated the `` template to use a supplied block as the option display rather than only displaying the option's label (allows for counts etc to be shown alongside dropdown options) --- ghost/admin/app/components/gh-token-input.hbs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/gh-token-input.hbs b/ghost/admin/app/components/gh-token-input.hbs index b0e51d34f2..b3d70d1a69 100644 --- a/ghost/admin/app/components/gh-token-input.hbs +++ b/ghost/admin/app/components/gh-token-input.hbs @@ -16,7 +16,7 @@ @disabled={{@disabled}} @dropdownClass={{@dropdownClass}} @extra={{@extra}} - @groupComponent={{@groupComponent}} + @groupComponent={{or @groupComponent "power-select/power-select-group"}} @horizontalPosition={{@horizontalPosition}} @initiallyOpened={{@initiallyOpened}} @loadingMessage={{@loadingMessage}} @@ -59,6 +59,10 @@ {{#if option.__isSuggestion__}} {{else}} - {{get option this.labelField}} + {{#if (has-block)}} + {{yield option}} + {{else}} + {{get option this.labelField}} + {{/if}} {{/if}} \ No newline at end of file