Merge pull request #488 from umbraco/bugfix/use-of-load-and-create-methods-for-workspaces

This commit is contained in:
Niels Lyngsø
2023-01-30 08:41:12 +01:00
committed by GitHub
2 changed files with 15 additions and 33 deletions

View File

@@ -17,25 +17,16 @@ export class UmbMediaWorkspaceElement extends UmbLitElement {
`,
];
private _entityKey!: string;
@property()
public get entityKey(): string {
return this._entityKey;
}
public set entityKey(value: string) {
this._entityKey = value;
if (this._entityKey) {
this._workspaceContext?.load(this._entityKey);
}
}
@property()
public set create(parentKey: string | null) {
this._workspaceContext?.create(parentKey);
}
private _workspaceContext: UmbWorkspaceMediaContext = new UmbWorkspaceMediaContext(this);
public load(value: string) {
this._workspaceContext?.load(value);
}
public create(parentKey: string | null) {
this._workspaceContext?.create(parentKey);
}
render() {
return html`<umb-workspace-content alias="Umb.Workspace.Media"></umb-workspace-content>`;

View File

@@ -29,25 +29,16 @@ export class UmbDataTypeWorkspaceElement extends UmbLitElement {
`,
];
private _entityKey!: string;
@property()
public get entityKey(): string {
return this._entityKey;
}
public set entityKey(value: string) {
this._entityKey = value;
if (this._entityKey) {
this._workspaceContext.load(this._entityKey);
}
}
@property()
public set create(parentKey: string | null) {
this._workspaceContext.create(parentKey);
}
private _workspaceContext: UmbWorkspaceDataTypeContext = new UmbWorkspaceDataTypeContext(this);
public load(value: string) {
this._workspaceContext?.load(value);
}
public create(parentKey: string | null) {
this._workspaceContext?.create(parentKey);
}
@state()
private _dataTypeName = '';