This commit is contained in:
Niels Lyngsø
2023-11-13 10:12:46 +01:00
parent 7cacb4837a
commit 7d87aff5c2
2 changed files with 4 additions and 6 deletions

View File

@@ -9,17 +9,17 @@ export interface UmbWorkspaceAction<WorkspaceType = unknown> extends UmbApi {
execute(): Promise<void>;
}
export abstract class UmbWorkspaceActionBase<WorkspaceType extends UmbWorkspaceContextInterface>
implements UmbWorkspaceAction<WorkspaceType>
export abstract class UmbWorkspaceActionBase<WorkspaceContextType extends UmbWorkspaceContextInterface>
implements UmbWorkspaceAction<WorkspaceContextType>
{
host: UmbControllerHostElement;
workspaceContext?: WorkspaceType;
workspaceContext?: WorkspaceContextType;
constructor(host: UmbControllerHostElement) {
this.host = host;
new UmbContextConsumerController(this.host, UMB_WORKSPACE_CONTEXT, (instance) => {
// TODO: Be aware we are casting here. We should consider a better solution for typing the contexts. (But notice we still want to capture the first workspace...)
this.workspaceContext = instance as unknown as WorkspaceType;
this.workspaceContext = instance as unknown as WorkspaceContextType;
});
}
abstract execute(): Promise<void>;

View File

@@ -135,7 +135,6 @@ export class UmbDocumentTypeWorkspaceContext
this.setIsSorting(false);
//this.#draft.next(data);
return { data } || undefined;
// TODO: Is this wrong? should we return { data }??
}
async load(entityId: string) {
@@ -146,7 +145,6 @@ export class UmbDocumentTypeWorkspaceContext
this.setIsSorting(false);
//this.#draft.next(data);
return { data } || undefined;
// TODO: Is this wrong? should we return { data }??
}
/**