move to constructor

This commit is contained in:
Niels Lyngsø
2023-01-02 11:21:54 +01:00
parent de341069df
commit 8d25b19bfa

View File

@@ -127,24 +127,16 @@ export class UmbEntityPropertyElement extends UmbControllerHostMixin(UmbObserver
// TODO: make it easier to create a provider, unless a context should just extends a provider-controller?
new UmbContextProviderController(this, 'umbPropertyContext', this._propertyContext);
}
connectedCallback(): void {
super.connectedCallback();
this._observePropertyEditorUI();
this.addEventListener('property-editor-change', this._onPropertyEditorChange as any as EventListener);
}
private _observePropertyEditorUI() {
this.observe<ManifestTypes>(umbExtensionsRegistry.getByAlias(this.propertyEditorUIAlias), (manifest) => {
if (manifest?.type === 'propertyEditorUI') {
this._gotData(manifest);
}
});
this.addEventListener('property-editor-change', this._onPropertyEditorChange as any as EventListener);
}
private _gotData(propertyEditorUIManifest?: ManifestPropertyEditorUI) {
if (!propertyEditorUIManifest) {
// TODO: if dataTypeKey didn't exist in store, we should do some nice UI.