Merge branch 'main' into feature/send-user-invite

This commit is contained in:
Niels Lyngsø
2023-11-28 15:55:17 +01:00
committed by GitHub
3 changed files with 14 additions and 9 deletions

View File

@@ -48,10 +48,7 @@ export class UmbBackofficeModalContainerElement extends UmbLitElement {
const modalElement = new UmbModalElement();
modalElement.modalContext = modal;
// TODO: We need to change this to the close-end event, when it is added to UUI again.
// This solution solves the memory leak issue where the modal contexts where not removed from the manager when they are closed.
// It breaks the modal animation though, so we need to wait for the close-end so we are sure the animation is done.
modalElement.element?.addEventListener('close', () => this._modalManager?.remove(modal.key));
modalElement.element?.addEventListener('close-end', () => this._modalManager?.remove(modal.key));
this._modalElementMap.set(modal.key, modalElement);
});

View File

@@ -1,7 +1,7 @@
import { UmbDocumentPermissionRepository } from '../../user-permissions/index.js';
import { UmbDocumentRepository } from '../../repository/index.js';
import { UmbUserGroupRepository } from '@umbraco-cms/backoffice/user-group';
import { html, customElement, property, state, ifDefined } from '@umbraco-cms/backoffice/external/lit';
import { html, customElement, property, state, ifDefined, nothing } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import {
UMB_ENTITY_USER_PERMISSION_MODAL,
@@ -137,7 +137,7 @@ export class UmbPermissionsModalElement extends UmbLitElement {
.userPermissionAliases=${userGroup.permissions}
@open=${() => this.#openUserPermissionsModal(userGroup.id)}
border>
<uui-icon slot="icon" .icon=${userGroup.icon}></uui-icon>
${userGroup.icon ? html`<uui-icon slot="icon" name=${userGroup.icon}></uui-icon>` : nothing}
</umb-user-group-ref>`,
)}
</uui-ref-list>

View File

@@ -85,8 +85,16 @@ export class UmbUserGroupInputElement extends FormControlMixin(UmbLitElement) {
() => !!this.max && this.#pickerContext.getSelection().length > this.max,
);
this.observe(this.#pickerContext.selection, (selection) => (super.value = selection.join(',')), 'umbUserGroupInputSelectionObserver');
this.observe(this.#pickerContext.selectedItems, (selectedItems) => (this._items = selectedItems), 'umbUserGroupInputItemsObserver');
this.observe(
this.#pickerContext.selection,
(selection) => (super.value = selection.join(',')),
'umbUserGroupInputSelectionObserver',
);
this.observe(
this.#pickerContext.selectedItems,
(selectedItems) => (this._items = selectedItems),
'umbUserGroupInputItemsObserver',
);
}
protected getFormElement() {
@@ -106,7 +114,7 @@ export class UmbUserGroupInputElement extends FormControlMixin(UmbLitElement) {
if (!item.id) return;
return html`
<umb-user-group-ref name="${ifDefined(item.name)}">
${item.icon ? html`<uui-icon slot="icon" icon=${item.icon}></uui-icon>` : nothing}
${item.icon ? html`<uui-icon slot="icon" name=${item.icon}></uui-icon>` : nothing}
<uui-action-bar slot="actions">
<uui-button @click=${() => this.#pickerContext.requestRemoveItem(item.id!)} label="Remove ${item.name}"