show a box if there are no variants
This commit is contained in:
@@ -255,6 +255,7 @@ export default {
|
||||
'Publish <strong>%0%</strong> and all content items underneath and thereby making their content publicly available.',
|
||||
publishDescendantsWithVariantsHelp:
|
||||
'Publish variants and variants of same type underneath and thereby making their content publicly available.',
|
||||
noVariantsToProcess: 'There are no available variants',
|
||||
releaseDate: 'Publish at',
|
||||
unpublishDate: 'Unpublish at',
|
||||
removeDate: 'Clear Date',
|
||||
|
||||
@@ -30,21 +30,25 @@ export class UmbDocumentVariantLanguagePickerElement extends UmbLitElement {
|
||||
_selection: Array<string> = [];
|
||||
|
||||
render() {
|
||||
return repeat(
|
||||
this.variantLanguageOptions,
|
||||
(option) => option.unique,
|
||||
(option) => html`
|
||||
<uui-menu-item
|
||||
selectable
|
||||
label=${option.variant?.name ?? option.language.name}
|
||||
@selected=${() => this.selectionManager.select(option.unique)}
|
||||
@deselected=${() => this.selectionManager.deselect(option.unique)}
|
||||
?selected=${this._selection.includes(option.unique)}>
|
||||
<uui-icon slot="icon" name="icon-globe"></uui-icon>
|
||||
${UmbDocumentVariantLanguagePickerElement.renderLabel(option)}
|
||||
</uui-menu-item>
|
||||
`,
|
||||
);
|
||||
return this.variantLanguageOptions.length
|
||||
? repeat(
|
||||
this.variantLanguageOptions,
|
||||
(option) => option.unique,
|
||||
(option) => html`
|
||||
<uui-menu-item
|
||||
selectable
|
||||
label=${option.variant?.name ?? option.language.name}
|
||||
@selected=${() => this.selectionManager.select(option.unique)}
|
||||
@deselected=${() => this.selectionManager.deselect(option.unique)}
|
||||
?selected=${this._selection.includes(option.unique)}>
|
||||
<uui-icon slot="icon" name="icon-globe"></uui-icon>
|
||||
${UmbDocumentVariantLanguagePickerElement.renderLabel(option)}
|
||||
</uui-menu-item>
|
||||
`,
|
||||
)
|
||||
: html`<uui-box>
|
||||
<umb-localize key="content_noVariantsToProcess">There are no available variants</umb-localize>
|
||||
</uui-box>`;
|
||||
}
|
||||
|
||||
static renderLabel(option: UmbDocumentVariantOptionModel) {
|
||||
|
||||
Reference in New Issue
Block a user