add conditions to property actions manifest

This commit is contained in:
Mads Rasmussen
2023-03-13 20:50:48 +01:00
parent 520bda84ab
commit a4db26de7d
3 changed files with 5 additions and 5 deletions

View File

@@ -2,9 +2,9 @@ import type { ManifestElement } from './models';
export interface ManifestPropertyAction extends ManifestElement {
type: 'propertyAction';
meta: MetaPropertyAction;
conditions: ConditionsPropertyAction;
}
export interface MetaPropertyAction {
export interface ConditionsPropertyAction {
propertyEditors: string[];
}

View File

@@ -6,7 +6,7 @@ export const manifests: Array<ManifestPropertyAction> = [
alias: 'Umb.PropertyAction.Copy',
name: 'Copy Property Action',
loader: () => import('./copy/property-action-copy.element'),
meta: {
conditions: {
propertyEditors: ['Umb.PropertyEditorUI.TextBox'],
},
},
@@ -15,7 +15,7 @@ export const manifests: Array<ManifestPropertyAction> = [
alias: 'Umb.PropertyAction.Clear',
name: 'Clear Property Action',
loader: () => import('./clear/property-action-clear.element'),
meta: {
conditions: {
propertyEditors: ['Umb.PropertyEditorUI.TextBox'],
},
},

View File

@@ -78,7 +78,7 @@ export class UmbPropertyActionMenuElement extends UmbLitElement {
this._actionsObserver = this.observe(
umbExtensionsRegistry.extensionsOfType('propertyAction').pipe(
map((propertyActions) => {
return propertyActions.filter((propertyAction) => propertyAction.meta.propertyEditors.includes(alias));
return propertyActions.filter((propertyAction) => propertyAction.conditions.propertyEditors.includes(alias));
})
),
(manifests) => {