Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Umbraco.Web.UI.Client/src/assets/lang/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default {
changeDataType: 'Datentyp ändern',
copy: 'Kopieren',
create: 'Neu',
createFor: (name: string) => (name ? `Neu erstellen für ${name}` : 'Neu'),
export: 'Exportieren',
createPackage: 'Neues Paket',
createGroup: 'Neue Gruppe',
Expand Down Expand Up @@ -63,6 +64,7 @@ export default {
unlock: 'Freigeben',
createblueprint: 'Inhaltsvorlage anlegen',
resendInvite: 'Einladung erneut versenden',
viewActionsFor: (name: string) => (name ? `Aktionen anzeigen für ${name}` : 'Aktionen anzeigen'),
},
actionCategories: {
content: 'Inhalt',
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Web.UI.Client/src/assets/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default {
copy: 'Duplicate',
copyTo: 'Duplicate to',
create: 'Create',
createFor: (name: string) => (name ? `Create item for ${name}` : 'Create'),
createblueprint: 'Create Document Blueprint',
createGroup: 'Create group',
createPackage: 'Create Package',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class UmbClipboardEntryPickerElement extends UmbLitElement {
slot="actions"
.entityType=${item.entityType}
.unique=${item.unique}
.label=${this.localize.term('actions_viewActionsFor', [item.name])}>
.label=${this.localize.string(item.name)}>
</umb-entity-actions-bundle>
`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { UmbEntityContext } from '../../entity/entity.context.js';
import type { UmbEntityAction, ManifestEntityActionDefaultKind } from '@umbraco-cms/backoffice/entity-action';
import type { PropertyValueMap } from '@umbraco-cms/backoffice/external/lit';
import { html, nothing, customElement, property, state, ifDefined, css } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { css, customElement, html, ifDefined, nothing, property, state } from '@umbraco-cms/backoffice/external/lit';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { UmbExtensionsManifestInitializer, createExtensionApi } from '@umbraco-cms/backoffice/extension-api';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { PropertyValueMap } from '@umbraco-cms/backoffice/external/lit';
import type { UmbEntityAction, ManifestEntityActionDefaultKind } from '@umbraco-cms/backoffice/entity-action';

@customElement('umb-entity-actions-bundle')
export class UmbEntityActionsBundleElement extends UmbLitElement {
Expand Down Expand Up @@ -114,28 +114,29 @@ export class UmbEntityActionsBundleElement extends UmbLitElement {

override render() {
if (this._numberOfActions === 0) return nothing;
return html`<uui-action-bar slot="actions">${this.#renderMore()} ${this.#renderFirstAction()} </uui-action-bar>`;
return html`<uui-action-bar slot="actions">${this.#renderMore()}${this.#renderFirstAction()}</uui-action-bar>`;
}

#renderMore() {
if (this._numberOfActions === 1) return nothing;

return html`
<umb-entity-actions-dropdown .label=${this.label} compact>
<umb-entity-actions-dropdown compact .label=${this.localize.term('actions_viewActionsFor', this.label)}>
<uui-symbol-more slot="label"></uui-symbol-more>
</umb-entity-actions-dropdown>
`;
}

#renderFirstAction() {
if (!this._firstActionApi || !this._firstActionManifest) return nothing;
return html`<uui-button
label=${this.localize.string(this._firstActionManifest.meta.label)}
data-mark=${'entity-action:' + this._firstActionManifest.alias}
@click=${this.#onFirstActionClick}
href="${ifDefined(this._firstActionHref)}">
<uui-icon name=${ifDefined(this._firstActionManifest.meta.icon)}></uui-icon>
</uui-button>`;
return html`
<uui-button
label=${this.localize.string(this._firstActionManifest.meta.label, this.label)}
data-mark=${'entity-action:' + this._firstActionManifest.alias}
href=${ifDefined(this._firstActionHref)}
@click=${this.#onFirstActionClick}>
<umb-icon name=${ifDefined(this._firstActionManifest.meta.icon)}></umb-icon>
</uui-button>
`;
}

static override styles = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const manifest: UmbExtensionManifestKind = {
forEntityTypes: [],
meta: {
icon: 'icon-add',
label: '#actions_create',
label: '#actions_createFor',
additionalOptions: true,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import { UmbEntityActionBase } from '../../entity-action-base.js';
import type { UmbEntityActionArgs } from '../../types.js';
import type { MetaEntityActionCreateKind } from './types.js';
import { UMB_ENTITY_CREATE_OPTION_ACTION_LIST_MODAL } from './modal/constants.js';
import { createExtensionApi, UmbExtensionsManifestInitializer } from '@umbraco-cms/backoffice/extension-api';
import { umbOpenModal } from '@umbraco-cms/backoffice/modal';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import {
type UmbExtensionManifestInitializer,
createExtensionApi,
UmbExtensionsManifestInitializer,
type PermittedControllerType,
} from '@umbraco-cms/backoffice/extension-api';
import type {
ManifestEntityCreateOptionAction,
UmbEntityCreateOptionAction,
} from '@umbraco-cms/backoffice/entity-create-option-action';
import type { PermittedControllerType, UmbExtensionManifestInitializer } from '@umbraco-cms/backoffice/extension-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';

export class UmbCreateEntityAction extends UmbEntityActionBase<MetaEntityActionCreateKind> {
#hasSingleOption = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class UmbEntityActionsTableColumnViewElement extends UmbLitElement {
<umb-entity-actions-bundle
.entityType=${this.value.entityType}
.unique=${this.value.unique}
.label=${this.localize.term('actions_viewActionsFor', [(this.value as any).name])}>
.label=${this.localize.string((this.value as any).name)}>
</umb-entity-actions-bundle>
`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, customElement, property, ifDefined, state } from '@umbraco-cms/backoffice/external/lit';
import { customElement, html, ifDefined, property, state, when } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { ensureSlash } from '@umbraco-cms/backoffice/router';
import { debounce } from '@umbraco-cms/backoffice/utils';
Expand Down Expand Up @@ -72,24 +72,28 @@ export class UmbMenuItemLayoutElement extends UmbLitElement {
}

override render() {
return html`<uui-menu-item
href="${ifDefined(this.href)}"
label=${this.label}
.caretLabel=${this.localize.term('visuallyHiddenTexts_expandChildItems') + ' ' + this.label}
?active=${this._isActive}
?has-children=${this.hasChildren}
target=${ifDefined(this.href && this.target ? this.target : undefined)}>
<umb-icon slot="icon" name=${this.iconName}></umb-icon>
${this.entityType
? html`<umb-entity-actions-bundle
slot="actions"
.entityType=${this.entityType}
.unique=${null}
.label=${this.localize.term('actions_viewActionsFor', [this.label])}>
</umb-entity-actions-bundle>`
: ''}
<slot></slot>
</uui-menu-item>`;
return html`
<uui-menu-item
label=${this.label}
href=${ifDefined(this.href)}
target=${ifDefined(this.href && this.target ? this.target : undefined)}
.caretLabel=${this.localize.term('visuallyHiddenTexts_expandChildItems') + ' ' + this.label}
?active=${this._isActive}
?has-children=${this.hasChildren}>
<umb-icon slot="icon" name=${this.iconName}></umb-icon>
${when(
this.entityType,
() => html`
<umb-entity-actions-bundle
slot="actions"
.entityType=${this.entityType}
.unique=${null}
.label=${this.label}></umb-entity-actions-bundle>
`,
)}
<slot></slot>
</uui-menu-item>
`;
}

override disconnectedCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export class UmbSectionSidebarMenuWithEntityActionsElement extends UmbSectionSid
}

override renderHeader() {
const label = this.localize.string(this.manifest?.meta?.label ?? '');
return html`
<div id="header">
<h3>${this.localize.string(this.manifest?.meta?.label ?? '')}</h3>
<h3>${label}</h3>
<umb-entity-actions-bundle
slot="actions"
.unique=${this._unique}
.entityType=${this.manifest?.meta.entityType}
.label=${this.localize.term('actions_viewActionsFor', [this.manifest?.meta.label])}>
.label=${label}>
</umb-entity-actions-bundle>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export abstract class UmbTreeItemElementBase<
// Note: Currently we want to prevent opening when the item is in a selectable context, but this might change in the future.
// If we like to be able to open items in selectable context, then we might want to make it as a menu item action, so you have to click ... and chose an action called 'Edit'
override render() {
const caretLabelKey = this._isOpen
? 'visuallyHiddenTexts_collapseChildItems'
: 'visuallyHiddenTexts_expandChildItems';
return html`
<uui-menu-item
@show-children=${this._onShowChildren}
Expand All @@ -151,11 +154,9 @@ export abstract class UmbTreeItemElementBase<
.loading=${this._isLoading}
.hasChildren=${this._hasChildren}
.showChildren=${this._isOpen}
.caretLabel=${this._isOpen
? this.localize.term('visuallyHiddenTexts_collapseChildItems') + ' ' + this._label
: this.localize.term('visuallyHiddenTexts_expandChildItems') + ' ' + this._label}
.caretLabel=${this.localize.term(caretLabelKey) + ' ' + this._label}
label=${ifDefined(this._label)}
href="${ifDefined(this._isSelectableContext ? undefined : this._href)}">
href=${ifDefined(this._isSelectableContext ? undefined : this._href)}>
${this.renderIconContainer()} ${this.renderLabel()} ${this.#renderActions()} ${this.#renderChildItems()}
<slot></slot>
${this.#renderPaging()}
Expand Down Expand Up @@ -224,7 +225,7 @@ export abstract class UmbTreeItemElementBase<
slot="actions"
.entityType=${this.#api.entityType}
.unique=${this.#api.unique}
.label=${this.localize.term('actions_viewActionsFor', [this._label])}>
.label=${this._label}>
</umb-entity-actions-bundle>
`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { UmbDocumentItemRepository } from '../../item/index.js';
import { UMB_DOCUMENT_CREATE_OPTIONS_MODAL } from './document-create-options-modal.token.js';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
import { umbOpenModal } from '@umbraco-cms/backoffice/modal';
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { umbOpenModal } from '@umbraco-cms/backoffice/modal';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';

export class UmbCreateDocumentEntityAction extends UmbEntityActionBase<never> {
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const manifests: Array<UmbExtensionManifest> = [
forEntityTypes: [UMB_DOCUMENT_ROOT_ENTITY_TYPE, UMB_DOCUMENT_ENTITY_TYPE],
meta: {
icon: 'icon-add',
label: '#actions_create',
label: '#actions_createFor',
additionalOptions: true,
},
conditions: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { UmbMediaItemRepository } from '../../repository/index.js';
import { UMB_MEDIA_CREATE_OPTIONS_MODAL } from './media-create-options-modal.token.js';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
import { umbOpenModal } from '@umbraco-cms/backoffice/modal';
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { umbOpenModal } from '@umbraco-cms/backoffice/modal';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';

export class UmbCreateMediaEntityAction extends UmbEntityActionBase<never> {
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
Expand All @@ -30,5 +30,4 @@ export class UmbCreateMediaEntityAction extends UmbEntityActionBase<never> {
});
}
}

export { UmbCreateMediaEntityAction as api };
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const manifests: Array<UmbExtensionManifest> = [
forEntityTypes: [UMB_MEDIA_ROOT_ENTITY_TYPE, UMB_MEDIA_ENTITY_TYPE],
meta: {
icon: 'icon-add',
label: '#actions_create',
label: '#actions_createFor',
additionalOptions: true,
},
conditions: [
Expand Down
Loading