getByTypeAndAlias
This commit is contained in:
@@ -135,8 +135,8 @@ export class UmbEntityPropertyElement extends UmbLitElement {
|
||||
|
||||
private _observePropertyEditorUI() {
|
||||
this.propertyEditorUIObserver?.destroy();
|
||||
this.propertyEditorUIObserver = this.observe(umbExtensionsRegistry.getByAlias(this.propertyEditorUIAlias), (manifest) => {
|
||||
if (manifest?.type === 'propertyEditorUI') {
|
||||
this.propertyEditorUIObserver = this.observe(umbExtensionsRegistry.getByTypeAndAlias('propertyEditorUI', this.propertyEditorUIAlias), (manifest) => {
|
||||
if(manifest) {
|
||||
this._gotEditor(manifest);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -70,9 +70,13 @@ export class UmbExtensionRegistry {
|
||||
}
|
||||
|
||||
|
||||
getByAlias<T = ManifestTypes>(alias: string): Observable<T | null> {
|
||||
getByAlias(alias: string) {
|
||||
// TODO: make pipes prettier/simpler/reuseable
|
||||
return this.extensions.pipe(map((dataTypes) => dataTypes.find((extension) => extension.alias === alias) || null)) as Observable<T | null>;
|
||||
return this.extensions.pipe(map((dataTypes) => dataTypes.find((extension) => extension.alias === alias) || null));
|
||||
}
|
||||
|
||||
getByTypeAndAlias(type: string, alias: string) {
|
||||
return this.extensionsOfType(type).pipe(map((extensions) => extensions.find((extension) => extension.alias === alias) || null));
|
||||
}
|
||||
|
||||
// TODO: implement unregister of extension
|
||||
|
||||
Reference in New Issue
Block a user