Skip to content

Commit 00b4334

Browse files
committed
use workspace name element
1 parent 2e1951b commit 00b4334

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/packages/user/user/workspace/user/user-workspace-editor.element.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { UMB_USER_ROOT_WORKSPACE_PATH } from '../../paths.js';
33
import type { UmbUserWorkspaceContext } from './user-workspace.context.js';
44
import { UMB_USER_WORKSPACE_CONTEXT } from './user-workspace.context-token.js';
55
import { UMB_USER_WORKSPACE_ALIAS } from './constants.js';
6-
import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui';
7-
import { UUIInputEvent } from '@umbraco-cms/backoffice/external/uui';
86
import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit';
9-
import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element';
7+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
108
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
119

1210
// import local components. Theses are not meant to be used outside of this component.
@@ -37,17 +35,6 @@ export class UmbUserWorkspaceEditorElement extends UmbLitElement {
3735
this.observe(this.#workspaceContext.data, (user) => (this._user = user), 'umbUserObserver');
3836
}
3937

40-
// TODO. find a way where we don't have to do this for all workspaces.
41-
#onNameChange(event: UUIInputEvent) {
42-
if (event instanceof UUIInputEvent) {
43-
const target = event.composedPath()[0] as UUIInputElement;
44-
45-
if (typeof target?.value === 'string') {
46-
this.#workspaceContext?.updateProperty('name', target.value);
47-
}
48-
}
49-
}
50-
5138
override render() {
5239
if (!this._user) return html`User not found`;
5340

@@ -67,9 +54,7 @@ export class UmbUserWorkspaceEditorElement extends UmbLitElement {
6754

6855
#renderHeader() {
6956
return html`
70-
<div id="header" slot="header">
71-
<uui-input id="name" .value=${this._user?.name ?? ''} @input="${this.#onNameChange}" ${umbFocus()}></uui-input>
72-
</div>
57+
<umb-workspace-name slot="header"></umb-workspace-name>
7358
<umb-workspace-entity-action-menu slot="action-menu"></umb-workspace-entity-action-menu>
7459
`;
7560
}
@@ -106,11 +91,6 @@ export class UmbUserWorkspaceEditorElement extends UmbLitElement {
10691
height: 100%;
10792
}
10893
109-
#header {
110-
width: 100%;
111-
display: grid;
112-
}
113-
11494
#main {
11595
display: grid;
11696
grid-template-columns: 1fr 350px;

0 commit comments

Comments
 (0)