Merge pull request #1201 from umbraco/bugfix/workspace-modals-closing
Bugfix/workspace modals closing
This commit is contained in:
@@ -97,7 +97,8 @@ export const data: Array<UmbMockDocumentModel> = [
|
||||
alias: 'multiNodeTreePicker',
|
||||
culture: null,
|
||||
segment: null,
|
||||
value: null,
|
||||
value:
|
||||
'all-property-editors-document-id,c05da24d-7740-447b-9cdc-bd8ce2172e38,fd56a0b5-01a0-4da2-b428-52773bfa9cc4',
|
||||
},
|
||||
{
|
||||
alias: 'datePicker',
|
||||
|
||||
@@ -37,7 +37,7 @@ export class UmbInlineListBlockElement extends UmbLitElement {
|
||||
'observeContentUdi',
|
||||
);
|
||||
});
|
||||
this.observe(umbExtensionsRegistry.getByTypeAndAlias('workspace', UMB_BLOCK_WORKSPACE_ALIAS), (manifest) => {
|
||||
this.observe(umbExtensionsRegistry.byTypeAndAlias('workspace', UMB_BLOCK_WORKSPACE_ALIAS), (manifest) => {
|
||||
if (manifest) {
|
||||
createExtensionApi(manifest, [this, { manifest: manifest }]).then((context) => {
|
||||
if (context) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { UmbCollectionContext } from './types.js';
|
||||
import { customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import type { ManifestCollection} from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type { ManifestCollection } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { createExtensionApi, createExtensionElement } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
@@ -25,7 +25,7 @@ export class UmbCollectionElement extends UmbLitElement {
|
||||
#observeManifest() {
|
||||
if (!this._alias) return;
|
||||
this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('collection', this._alias),
|
||||
umbExtensionsRegistry.byTypeAndAlias('collection', this._alias),
|
||||
async (manifest) => {
|
||||
if (!manifest) return;
|
||||
this.#manifest = manifest;
|
||||
|
||||
@@ -46,7 +46,7 @@ export class UmbBackofficeModalContainerElement extends UmbLitElement {
|
||||
});
|
||||
|
||||
if (this._modals.length === 0) {
|
||||
this._modalElementMap.clear();
|
||||
//this._modalElementMap.clear(); // should not make a difference now that we clean it above. [NL]
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class UmbPropertyTypeBasedPropertyElement extends UmbLitElement {
|
||||
if (!this._propertyEditorUiAlias && dataType?.editorAlias) {
|
||||
//use 'dataType.editorAlias' to look up the extension in the registry:
|
||||
this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('propertyEditorSchema', dataType.editorAlias),
|
||||
umbExtensionsRegistry.byTypeAndAlias('propertyEditorSchema', dataType.editorAlias),
|
||||
(extension) => {
|
||||
if (!extension) return;
|
||||
this._propertyEditorUiAlias = extension?.meta.defaultPropertyEditorUiAlias;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { UmbDataTypeDetailRepository } from '../repository/detail/data-type-detail.repository.js';
|
||||
import type { UmbDataTypeDetailModel } from '../types.js';
|
||||
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
|
||||
import type {
|
||||
UmbInvariantableWorkspaceContextInterface} from '@umbraco-cms/backoffice/workspace';
|
||||
import type { UmbInvariantableWorkspaceContextInterface } from '@umbraco-cms/backoffice/workspace';
|
||||
import {
|
||||
UmbEditableWorkspaceContextBase,
|
||||
UmbInvariantWorkspacePropertyDatasetContext,
|
||||
@@ -17,10 +16,9 @@ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { combineLatest, map } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import type {
|
||||
PropertyEditorConfigDefaultData,
|
||||
PropertyEditorConfigProperty} from '@umbraco-cms/backoffice/extension-registry';
|
||||
import {
|
||||
umbExtensionsRegistry,
|
||||
PropertyEditorConfigProperty,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT } from '@umbraco-cms/backoffice/property-editor';
|
||||
|
||||
export class UmbDataTypeWorkspaceContext
|
||||
@@ -102,7 +100,7 @@ export class UmbDataTypeWorkspaceContext
|
||||
|
||||
#setPropertyEditorSchemaConfig(propertyEditorSchemaAlias: string) {
|
||||
return this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('propertyEditorSchema', propertyEditorSchemaAlias),
|
||||
umbExtensionsRegistry.byTypeAndAlias('propertyEditorSchema', propertyEditorSchemaAlias),
|
||||
(manifest) => {
|
||||
this._propertyEditorSchemaConfigProperties = manifest?.meta.settings?.properties || [];
|
||||
this._propertyEditorSchemaConfigDefaultData = manifest?.meta.settings?.defaultData || [];
|
||||
@@ -112,17 +110,14 @@ export class UmbDataTypeWorkspaceContext
|
||||
}
|
||||
|
||||
#setPropertyEditorUIConfig(propertyEditorUIAlias: string) {
|
||||
return this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('propertyEditorUi', propertyEditorUIAlias),
|
||||
(manifest) => {
|
||||
this.#propertyEditorUiIcon.setValue(manifest?.meta.icon || null);
|
||||
this.#propertyEditorUiName.setValue(manifest?.name || null);
|
||||
return this.observe(umbExtensionsRegistry.byTypeAndAlias('propertyEditorUi', propertyEditorUIAlias), (manifest) => {
|
||||
this.#propertyEditorUiIcon.setValue(manifest?.meta.icon || null);
|
||||
this.#propertyEditorUiName.setValue(manifest?.name || null);
|
||||
|
||||
this._propertyEditorUISettingsSchemaAlias = manifest?.meta.propertyEditorSchemaAlias;
|
||||
this._propertyEditorUISettingsProperties = manifest?.meta.settings?.properties || [];
|
||||
this._propertyEditorUISettingsDefaultData = manifest?.meta.settings?.defaultData || [];
|
||||
},
|
||||
).asPromise();
|
||||
this._propertyEditorUISettingsSchemaAlias = manifest?.meta.propertyEditorSchemaAlias;
|
||||
this._propertyEditorUISettingsProperties = manifest?.meta.settings?.properties || [];
|
||||
this._propertyEditorUISettingsDefaultData = manifest?.meta.settings?.defaultData || [];
|
||||
}).asPromise();
|
||||
}
|
||||
|
||||
private _mergeConfigProperties() {
|
||||
|
||||
@@ -124,7 +124,7 @@ export class UmbModalElement extends UmbLitElement {
|
||||
#observeModal(alias: string) {
|
||||
this.#modalExtensionObserver?.destroy();
|
||||
|
||||
this.observe(umbExtensionsRegistry.getByTypeAndAlias('modal', alias), async (manifest) => {
|
||||
this.observe(umbExtensionsRegistry.byTypeAndAlias('modal', alias), async (manifest) => {
|
||||
this.#removeInnerElement();
|
||||
|
||||
if (manifest) {
|
||||
|
||||
@@ -131,7 +131,7 @@ export class UmbPropertyElement extends UmbLitElement {
|
||||
|
||||
private _observePropertyEditorUI() {
|
||||
this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('propertyEditorUi', this._propertyEditorUiAlias),
|
||||
umbExtensionsRegistry.byTypeAndAlias('propertyEditorUi', this._propertyEditorUiAlias),
|
||||
(manifest) => {
|
||||
this._gotEditorUI(manifest);
|
||||
},
|
||||
|
||||
@@ -122,7 +122,7 @@ export class UmbTreeContextBase<TreeItemType extends UmbTreeItemModelBase>
|
||||
#observeTreeManifest() {
|
||||
if (this.#treeAlias) {
|
||||
this.observe(
|
||||
umbExtensionsRegistry.getByTypeAndAlias('tree', this.#treeAlias),
|
||||
umbExtensionsRegistry.byTypeAndAlias('tree', this.#treeAlias),
|
||||
async (treeManifest) => {
|
||||
if (!treeManifest) return;
|
||||
this.#observeRepository(treeManifest);
|
||||
|
||||
@@ -150,7 +150,6 @@ export class UmbInputDocumentElement extends FormControlMixin(UmbLitElement) {
|
||||
|
||||
#openPicker() {
|
||||
// TODO: Configure the content picker, with `startNodeId` and `ignoreUserStartNodes` [LK]
|
||||
console.log('#openPicker', [this.startNodeId, this.ignoreUserStartNodes]);
|
||||
this.#pickerContext.openPicker({
|
||||
hideTreeRoot: true,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
|
||||
@@ -149,7 +149,6 @@ export class UmbInputMediaElement extends FormControlMixin(UmbLitElement) {
|
||||
|
||||
#openPicker() {
|
||||
// TODO: Configure the media picker, with `allowedContentTypeIds` and `ignoreUserStartNodes` [LK]
|
||||
console.log('#openPicker', [this.allowedContentTypeIds, this.ignoreUserStartNodes]);
|
||||
this.#pickerContext.openPicker({
|
||||
hideTreeRoot: true,
|
||||
pickableFilter: this.#pickableFilter,
|
||||
|
||||
@@ -72,8 +72,10 @@ export class UmbRouteContext extends UmbBaseController {
|
||||
}
|
||||
|
||||
#removeModalPath(info: IRoutingInfo) {
|
||||
if (window.location.href.includes(info.match.fragments.consumed)) {
|
||||
window.history.pushState({}, '', window.location.href.split(info.match.fragments.consumed)[0]);
|
||||
// Reset the URL to the routerBasePath + routerActiveLocalPath
|
||||
const folderToRemove = info.match.match.input;
|
||||
if (folderToRemove && window.location.href.includes(folderToRemove)) {
|
||||
window.history.pushState({}, '', this.#routerBasePath + '/' + this.#routerActiveLocalPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class UmbRouterSlotElement extends UmbLitElement {
|
||||
#modalRouter: IRouterSlot = document.createElement('router-slot') as IRouterSlot;
|
||||
#listening = false;
|
||||
|
||||
@property()
|
||||
@property({ attribute: false })
|
||||
public get routes(): UmbRoute[] | undefined {
|
||||
return this.#router.routes;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ export class UmbRouterSlotElement extends UmbLitElement {
|
||||
}
|
||||
}
|
||||
|
||||
@property()
|
||||
@property({ attribute: false })
|
||||
public get parent(): IRouterSlot | null | undefined {
|
||||
return this.#router.parent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user