Skip to content

Commit 712cbe8

Browse files
authored
Member Type Root Collection View / Workspace (#19271)
1 parent d1f0437 commit 712cbe8

File tree

26 files changed

+309
-26
lines changed

26 files changed

+309
-26
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/collection/action/create/collection-create-action.element.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import { html, customElement, state, ifDefined } from '@umbraco-cms/backoffice/external/lit';
2-
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
3-
import type { UmbExtensionApiInitializer } from '@umbraco-cms/backoffice/extension-api';
4-
import { UmbExtensionsApiInitializer } from '@umbraco-cms/backoffice/extension-api';
1+
import { customElement, html, ifDefined, state } from '@umbraco-cms/backoffice/external/lit';
52
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
3+
import { UmbExtensionsApiInitializer } from '@umbraco-cms/backoffice/extension-api';
4+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
65
import { UMB_ENTITY_CONTEXT } from '@umbraco-cms/backoffice/entity';
76
import type { ManifestEntityCreateOptionAction } from '@umbraco-cms/backoffice/entity-create-option-action';
7+
import type { UmbExtensionApiInitializer } from '@umbraco-cms/backoffice/extension-api';
88

99
type ManifestType = ManifestEntityCreateOptionAction;
1010

11-
const elementName = 'umb-collection-create-action-button';
12-
@customElement(elementName)
11+
@customElement('umb-collection-create-action-button')
1312
export class UmbCollectionCreateActionButtonElement extends UmbLitElement {
1413
@state()
1514
private _popoverOpen = false;
@@ -58,7 +57,7 @@ export class UmbCollectionCreateActionButtonElement extends UmbLitElement {
5857
if (!this.#entityContext) return;
5958

6059
const entityType = this.#entityContext.getEntityType();
61-
if (!entityType) throw new Error('No entityType found');
60+
if (!entityType) throw new Error('No entity type found');
6261

6362
const unique = this.#entityContext.getUnique();
6463
if (unique === undefined) throw new Error('No unique found');
@@ -93,11 +92,16 @@ export class UmbCollectionCreateActionButtonElement extends UmbLitElement {
9392
}
9493

9594
#renderSingleOptionAction() {
96-
return html` <uui-button
97-
label=${this.#createLabel}
98-
color="default"
99-
look="outline"
100-
@click=${(event: Event) => this.#onClick(event, this._apiControllers[0])}></uui-button>`;
95+
const href = this._hrefList[0];
96+
return html`
97+
<uui-button
98+
label=${this.#createLabel}
99+
color="default"
100+
look="outline"
101+
href=${ifDefined(href)}
102+
target=${this.#getTarget(href)}
103+
@click=${(event: Event) => this.#onClick(event, this._apiControllers[0], href)}></uui-button>
104+
`;
101105
}
102106

103107
#renderMultiOptionAction() {
@@ -139,9 +143,9 @@ export class UmbCollectionCreateActionButtonElement extends UmbLitElement {
139143
return html`
140144
<uui-menu-item
141145
label=${label}
142-
@click=${(event: Event) => this.#onClick(event, controller, href)}
143146
href=${ifDefined(href)}
144-
target=${this.#getTarget(href)}>
147+
target=${this.#getTarget(href)}
148+
@click=${(event: Event) => this.#onClick(event, controller, href)}>
145149
<umb-icon slot="icon" .name=${manifest.meta.icon}></umb-icon>
146150
</uui-menu-item>
147151
`;
@@ -152,6 +156,6 @@ export { UmbCollectionCreateActionButtonElement as element };
152156

153157
declare global {
154158
interface HTMLElementTagNameMap {
155-
[elementName]: UmbCollectionCreateActionButtonElement;
159+
'umb-collection-create-action-button': UmbCollectionCreateActionButtonElement;
156160
}
157161
}

src/Umbraco.Web.UI.Client/src/packages/members/member-type/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './entity-actions/constants.js';
2+
export * from './member-type-root/constants.js';
23
export * from './paths.js';
34
export * from './property-type/constants.js';
45
export * from './repository/constants.js';

src/Umbraco.Web.UI.Client/src/packages/members/member-type/entity-actions/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { UMB_MEMBER_TYPE_DETAIL_REPOSITORY_ALIAS, UMB_MEMBER_TYPE_ITEM_REPOSITORY_ALIAS } from '../constants.js';
22
import { UMB_MEMBER_TYPE_ENTITY_TYPE } from '../entity.js';
3-
import { manifests as duplicateManifests } from './duplicate/manifests.js';
43
import { manifests as createManifests } from './create/manifests.js';
4+
import { manifests as duplicateManifests } from './duplicate/manifests.js';
55
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
66

77
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE = 'member-type-root';
21
export const UMB_MEMBER_TYPE_ENTITY_TYPE = 'member-type';
2+
export const UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE = 'member-type-root';
33

44
export type UmbMemberTypeEntityType = typeof UMB_MEMBER_TYPE_ENTITY_TYPE;
55
export type UmbMemberTypeRootEntityType = typeof UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE;

src/Umbraco.Web.UI.Client/src/packages/members/member-type/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import './components/index.js';
22

33
export * from './components/index.js';
44
export * from './constants.js';
5+
export * from './member-type-root/index.js';
56
export * from './modal/member-type-picker-modal.token.js';
67
export * from './repository/index.js';
78
export * from './tree/index.js';
89
export * from './workspace/constants.js';
10+
911
export type * from './types.js';

src/Umbraco.Web.UI.Client/src/packages/members/member-type/manifests.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { manifests as entityActionsManifests } from './entity-actions/manifests.js';
2+
import { manifests as memberTypeRootManifests } from './member-type-root/manifests.js';
23
import { manifests as menuManifests } from './menu/manifests.js';
34
import { manifests as propertyTypeManifests } from './property-type/manifests.js';
45
import { manifests as repositoryManifests } from './repository/manifests.js';
56
import { manifests as searchManifests } from './search/manifests.js';
67
import { manifests as treeManifests } from './tree/manifests.js';
78
import { manifests as workspaceManifests } from './workspace/manifests.js';
9+
810
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
911

1012
import './components/index.js';
1113

1214
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
1315
...entityActionsManifests,
16+
...memberTypeRootManifests,
1417
...menuManifests,
1518
...propertyTypeManifests,
1619
...repositoryManifests,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const UMB_MEMBER_TYPE_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.MemberType.Root';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './constants.js';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE } from '../entity.js';
2+
3+
export const manifests: Array<UmbExtensionManifest> = [
4+
{
5+
type: 'workspace',
6+
kind: 'default',
7+
alias: 'Umb.Workspace.MemberType.Root',
8+
name: 'Member Type Root Workspace',
9+
meta: {
10+
entityType: UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE,
11+
headline: '#treeHeaders_memberTypes',
12+
},
13+
},
14+
];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export const UMB_MEMBER_TYPE_TREE_REPOSITORY_ALIAS = 'Umb.Repository.MemberType.Tree';
22
export const UMB_MEMBER_TYPE_TREE_STORE_ALIAS = 'Umb.Store.MemberType.Tree';
33
export const UMB_MEMBER_TYPE_TREE_ALIAS = 'Umb.Tree.MemberType';
4+
45
export { UMB_MEMBER_TYPE_TREE_STORE_CONTEXT } from './member-type-tree.store.context-token.js';
6+
7+
export * from './tree-item-children/constants.js';

0 commit comments

Comments
 (0)