move from general workspace context to document type context
This commit is contained in:
committed by
Jacob Overgaard
parent
44ad430db1
commit
72317c8e31
@@ -15,8 +15,4 @@ export interface UmbWorkspaceContextInterface<DataType = unknown> {
|
||||
isNew: Observable<boolean | undefined>;
|
||||
getIsNew(): boolean | undefined;
|
||||
setIsNew(value: boolean): void;
|
||||
|
||||
isSorting: Observable<boolean | undefined>;
|
||||
getIsSorting(): boolean | undefined;
|
||||
setIsSorting(value: boolean): void;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,6 @@ export abstract class UmbWorkspaceContext<RepositoryType, EntityType extends Umb
|
||||
#isNew = new UmbBooleanState(undefined);
|
||||
isNew = this.#isNew.asObservable();
|
||||
|
||||
#isSorting = new UmbBooleanState(undefined);
|
||||
isSorting = this.#isSorting.asObservable();
|
||||
|
||||
constructor(host: UmbControllerHostElement, workspaceAlias: string, repository: RepositoryType) {
|
||||
super(host);
|
||||
this.host = host;
|
||||
@@ -46,14 +43,6 @@ export abstract class UmbWorkspaceContext<RepositoryType, EntityType extends Umb
|
||||
this.#isNew.next(isNew);
|
||||
}
|
||||
|
||||
getIsSorting() {
|
||||
return this.#isSorting.getValue();
|
||||
}
|
||||
|
||||
setIsSorting(isSorting: boolean) {
|
||||
this.#isSorting.next(isSorting);
|
||||
}
|
||||
|
||||
protected saveComplete(data: EntityType) {
|
||||
if (this.modalContext) {
|
||||
this.submitModal(data);
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
} from '@umbraco-cms/backoffice/backend-api';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbBooleanState } from '@umbraco-cms/backoffice/observable-api';
|
||||
|
||||
type EntityType = DocumentTypeResponseModel;
|
||||
export class UmbDocumentTypeWorkspaceContext
|
||||
@@ -37,6 +38,9 @@ export class UmbDocumentTypeWorkspaceContext
|
||||
|
||||
readonly structure;
|
||||
|
||||
#isSorting = new UmbBooleanState(undefined);
|
||||
isSorting = this.#isSorting.asObservable();
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
super(host, 'Umb.Workspace.DocumentType', new UmbDocumentTypeRepository(host));
|
||||
|
||||
@@ -61,6 +65,14 @@ export class UmbDocumentTypeWorkspaceContext
|
||||
this.cleanup = this.structure.ownerContentTypeObservablePart((data) => data?.defaultTemplateId);
|
||||
}
|
||||
|
||||
getIsSorting() {
|
||||
return this.#isSorting.getValue();
|
||||
}
|
||||
|
||||
setIsSorting(isSorting: boolean) {
|
||||
this.#isSorting.next(isSorting);
|
||||
}
|
||||
|
||||
getData() {
|
||||
return this.structure.getOwnerContentType() || {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user