Skip to content

Commit 4a1e4f8

Browse files
authored
Merge pull request #2040 from umbraco/v14/feature/block-workspace-only-show-settings-when-available
Block Editors: only show settings when available in block workspace
2 parents b16a459 + 3b5c709 commit 4a1e4f8

16 files changed

+31
-34
lines changed

src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace.context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export class UmbBlockGridAreaTypeWorkspaceContext
6969
if (value) {
7070
const blockTypeData = value.find((x: UmbBlockGridTypeAreaType) => x.key === unique);
7171
if (blockTypeData) {
72-
console.log(blockTypeData);
7372
this.#data.setValue(blockTypeData);
7473
return;
7574
}

src/packages/block/block/conditions/block-workspace-has-settings.condition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../workspace/block-workspace.context-token.js';
21
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
32
import type { BlockWorkspaceHasSettingsConditionConfig } from '@umbraco-cms/backoffice/extension-registry';
43
import type { UmbConditionControllerArguments, UmbExtensionCondition } from '@umbraco-cms/backoffice/extension-api';
54
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
5+
import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../workspace/block-workspace.context-token.js';
66

77
export class UmbBlockWorkspaceHasSettingsCondition
88
extends UmbConditionBase<BlockWorkspaceHasSettingsConditionConfig>
@@ -18,7 +18,7 @@ export class UmbBlockWorkspaceHasSettingsCondition
1818
this.observe(
1919
context.settings.contentTypeId,
2020
(settingsContentTypeId) => {
21-
this.permitted = !!settingsContentTypeId;
21+
this.permitted = settingsContentTypeId !== undefined;
2222
},
2323
'observeSettingsElementTypeId',
2424
);

src/packages/block/block/context/block-entries.context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export abstract class UmbBlockEntriesContext<
6262
return this._layoutEntries.setValue(layouts);
6363
}
6464
setOneLayout(layoutData: BlockLayoutType) {
65-
console.log('setOneLayout', layoutData);
6665
return this._layoutEntries.appendOne(layoutData);
6766
}
6867

src/packages/block/block/context/block-entry.context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ export abstract class UmbBlockEntryContext<
334334
this.settings,
335335
(settings) => {
336336
if (settings) {
337-
console.log('settings to be set', this.#contentUdi, settings);
338337
this._manager?.setOneSettings(settings);
339338
}
340339
},

src/packages/block/block/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
12
import { manifests as conditionManifests } from './conditions/manifests.js';
23
import { manifests as modalManifests } from './modals/manifests.js';
34
import { manifests as workspaceManifests } from './workspace/manifests.js';
4-
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
55

66
export const manifests: Array<ManifestTypes> = [...modalManifests, ...workspaceManifests, ...conditionManifests];

src/packages/block/block/workspace/block-element-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { UmbBlockDataType } from '../types.js';
2-
import { UmbBlockElementPropertyDatasetContext } from './block-element-property-dataset.context.js';
31
import type { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
42
import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
53
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
64
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
75
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
86
import { UmbDocumentTypeDetailRepository } from '@umbraco-cms/backoffice/document-type';
7+
import type { UmbBlockDataType } from '../types.js';
8+
import { UmbBlockElementPropertyDatasetContext } from './block-element-property-dataset.context.js';
99

1010
export class UmbBlockElementManager extends UmbControllerBase {
1111
//

src/packages/block/block/workspace/block-element-property-dataset.context-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { UmbBlockElementPropertyDatasetContext } from './block-element-property-dataset.context.js';
21
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
2+
import type { UmbBlockElementPropertyDatasetContext } from './block-element-property-dataset.context.js';
33

44
export const UMB_BLOCK_ELEMENT_PROPERTY_DATASET_CONTEXT = new UmbContextToken<UmbBlockElementPropertyDatasetContext>(
55
'UmbPropertyDatasetContext',

src/packages/block/block/workspace/block-element-property-dataset.context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { UmbBlockElementManager } from './block-element-manager.js';
2-
import { UMB_BLOCK_ELEMENT_PROPERTY_DATASET_CONTEXT } from './block-element-property-dataset.context-token.js';
31
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
42
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
53
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
64
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
75
import { UmbVariantId } from '@umbraco-cms/backoffice/variant';
86
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
7+
import { UMB_BLOCK_ELEMENT_PROPERTY_DATASET_CONTEXT } from './block-element-property-dataset.context-token.js';
8+
import type { UmbBlockElementManager } from './block-element-manager.js';
99

1010
export class UmbBlockElementPropertyDatasetContext extends UmbControllerBase implements UmbPropertyDatasetContext {
1111
#elementManager: UmbBlockElementManager;

src/packages/block/block/workspace/block-workspace.context-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { UmbBlockWorkspaceContext } from './block-workspace.context.js';
21
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
32
import type { UmbWorkspaceContext } from '@umbraco-cms/backoffice/workspace';
3+
import type { UmbBlockWorkspaceContext } from './block-workspace.context.js';
44

55
export const UMB_BLOCK_WORKSPACE_CONTEXT = new UmbContextToken<UmbWorkspaceContext, UmbBlockWorkspaceContext>(
66
'UmbWorkspaceContext',

src/packages/block/block/workspace/block-workspace.context.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import type { UmbBlockDataType, UmbBlockLayoutBaseModel } from '../types.js';
2-
import { UmbBlockElementManager } from './block-element-manager.js';
3-
import { UmbBlockWorkspaceEditorElement } from './block-workspace-editor.element.js';
41
import {
52
UmbSubmittableWorkspaceContextBase,
63
type UmbRoutableWorkspaceContext,
@@ -9,13 +6,16 @@ import {
96
import { UmbObjectState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
107
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
118
import type { ManifestWorkspace } from '@umbraco-cms/backoffice/extension-registry';
9+
import { UMB_MODAL_CONTEXT } from '@umbraco-cms/backoffice/modal';
10+
import { decodeFilePath } from '@umbraco-cms/backoffice/utils';
11+
import type { UmbBlockDataType, UmbBlockLayoutBaseModel } from '../types.js';
12+
import { UmbBlockWorkspaceEditorElement } from './block-workspace-editor.element.js';
13+
import { UmbBlockElementManager } from './block-element-manager.js';
1214
import {
1315
UMB_BLOCK_ENTRIES_CONTEXT,
1416
UMB_BLOCK_MANAGER_CONTEXT,
1517
type UmbBlockWorkspaceData,
1618
} from '@umbraco-cms/backoffice/block';
17-
import { UMB_MODAL_CONTEXT } from '@umbraco-cms/backoffice/modal';
18-
import { decodeFilePath } from '@umbraco-cms/backoffice/utils';
1919

2020
export type UmbBlockWorkspaceElementManagerNames = 'content' | 'settings';
2121
export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseModel = UmbBlockLayoutBaseModel>

0 commit comments

Comments
 (0)