use specific user context token

This commit is contained in:
Mads Rasmussen
2024-05-16 16:26:14 +02:00
parent 93563906e0
commit 83641a79c5
3 changed files with 9 additions and 9 deletions

View File

@@ -2,10 +2,10 @@ import type { UmbUserCollectionContext } from './user-collection.context.js';
import type { UmbUserOrderByOption } from './types.js';
import type { UmbUserStateFilterType } from './utils/index.js';
import { UmbUserStateFilter } from './utils/index.js';
import { UMB_USER_COLLECTION_CONTEXT } from './user-collection.context-token.js';
import type { UUIBooleanInputEvent, UUICheckboxElement } from '@umbraco-cms/backoffice/external/uui';
import { css, html, customElement, state, repeat, ifDefined } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection';
import type { UmbUserGroupDetailModel } from '@umbraco-cms/backoffice/user-group';
import { UmbUserGroupCollectionRepository } from '@umbraco-cms/backoffice/user-group';
import { observeMultiple } from '@umbraco-cms/backoffice/observable-api';
@@ -39,8 +39,8 @@ export class UmbUserCollectionHeaderElement extends UmbLitElement {
constructor() {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance as UmbUserCollectionContext;
this.consumeContext(UMB_USER_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance;
this.#observeOrderByOptions();
});
}

View File

@@ -1,9 +1,9 @@
import { getDisplayStateFromUserStatus } from '../../../utils.js';
import type { UmbUserCollectionContext } from '../../user-collection.context.js';
import type { UmbUserDetailModel } from '../../../types.js';
import { UMB_USER_COLLECTION_CONTEXT } from '../../user-collection.context-token.js';
import { css, html, nothing, customElement, state, repeat, ifDefined } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UserStateModel } from '@umbraco-cms/backoffice/external/backend-api';
import type { UmbUserGroupDetailModel } from '@umbraco-cms/backoffice/user-group';
@@ -29,8 +29,8 @@ export class UmbUserGridCollectionViewElement extends UmbLitElement {
constructor() {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance as UmbUserCollectionContext;
this.consumeContext(UMB_USER_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance;
this.observe(
this.#collectionContext.selection.selection,
(selection) => (this._selection = selection),

View File

@@ -1,5 +1,6 @@
import type { UmbUserCollectionContext } from '../../user-collection.context.js';
import type { UmbUserDetailModel } from '../../../types.js';
import { UMB_USER_COLLECTION_CONTEXT } from '../../user-collection.context-token.js';
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type {
@@ -11,7 +12,6 @@ import type {
UmbTableConfig,
UmbTableOrderedEvent,
} from '@umbraco-cms/backoffice/components';
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbUserGroupItemModel } from '@umbraco-cms/backoffice/user-group';
import { UmbUserGroupItemRepository } from '@umbraco-cms/backoffice/user-group';
@@ -68,8 +68,8 @@ export class UmbUserTableCollectionViewElement extends UmbLitElement {
constructor() {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance as UmbUserCollectionContext;
this.consumeContext(UMB_USER_COLLECTION_CONTEXT, (instance) => {
this.#collectionContext = instance;
this.observe(
this.#collectionContext.selection.selection,
(selection) => (this._selection = selection),