simplify use of host argument
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api';
|
||||
|
||||
export type ActiveVariant = {
|
||||
@@ -14,15 +13,9 @@ export type ActiveVariant = {
|
||||
* @description - Class managing the split view state for a workspace context.
|
||||
*/
|
||||
export class UmbWorkspaceSplitViewManager {
|
||||
#host: UmbControllerHostElement;
|
||||
|
||||
#activeVariantsInfo = new UmbArrayState<ActiveVariant>([], (x) => x.index);
|
||||
public readonly activeVariantsInfo = this.#activeVariantsInfo.asObservable();
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
this.#host = host;
|
||||
}
|
||||
|
||||
private _routeBase?: string;
|
||||
public getWorkspaceRoute(): string | undefined {
|
||||
return this._routeBase;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { UmbDocumentStore, UMB_DOCUMENT_STORE_CONTEXT_TOKEN } from './document.s
|
||||
import { UMB_DOCUMENT_ITEM_STORE_CONTEXT_TOKEN, type UmbDocumentItemStore } from './document-item.store.js';
|
||||
import { UmbDocumentItemServerDataSource } from './sources/document-item.server.data.js';
|
||||
import type { UmbDetailRepository } from '@umbraco-cms/backoffice/repository';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbBaseController } from '@umbraco-cms/backoffice/class-api';
|
||||
import {
|
||||
DocumentResponseModel,
|
||||
@@ -33,7 +33,7 @@ export class UmbDocumentRepository
|
||||
|
||||
#notificationContext?: UmbNotificationContext;
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host);
|
||||
|
||||
// TODO: figure out how spin up get the correct data source
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
UmbObjectState,
|
||||
UmbObserverController,
|
||||
} from '@umbraco-cms/backoffice/observable-api';
|
||||
import { UmbControllerHost, UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
type EntityType = DocumentResponseModel;
|
||||
export class UmbDocumentWorkspaceContext
|
||||
@@ -50,15 +50,12 @@ export class UmbDocumentWorkspaceContext
|
||||
readonly structure;
|
||||
readonly splitView;
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
constructor(host: UmbControllerHost) {
|
||||
// TODO: Get Workspace Alias via Manifest.
|
||||
super(host, 'Umb.Workspace.Document', new UmbDocumentRepository(host));
|
||||
|
||||
this.structure = new UmbContentTypePropertyStructureManager(
|
||||
this.host,
|
||||
new UmbDocumentTypeDetailRepository(this.host),
|
||||
);
|
||||
this.splitView = new UmbWorkspaceSplitViewManager(this.host);
|
||||
this.structure = new UmbContentTypePropertyStructureManager(this, new UmbDocumentTypeDetailRepository(this));
|
||||
this.splitView = new UmbWorkspaceSplitViewManager();
|
||||
|
||||
new UmbObserverController(this.host, this.documentTypeKey, (id) => this.structure.loadType(id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user