Skip to content

Commit 4f87b26

Browse files
committed
Pre-alpha release tidy-up
Added missing property-editor UI aliases on the data-sources and list-editors. Updated the progress status dashboard.
1 parent d2cad23 commit 4f87b26

File tree

36 files changed

+166
-119
lines changed

36 files changed

+166
-119
lines changed

src/Umbraco.Community.Contentment/Client/src/dashboard/bellissima-status/bellissima-status.element.ts

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const UmbMarked = new Marked({ gfm: true, breaks: true });
1515
const elementName = 'umb-bellissima-status-dashboard-element';
1616
@customElement(elementName)
1717
export class UmbBellissimaStatusDashboardElement extends UmbLitElement {
18-
#started = 36;
18+
#started = 40;
1919
#total = 63;
2020
#percentage = Math.floor((this.#started / this.#total) * 100);
2121

@@ -29,12 +29,10 @@ export class UmbBellissimaStatusDashboardElement extends UmbLitElement {
2929
markup: `
3030
<p>During the alpha phase of Contentment v6.0, this dashboard will appear to provide a status update of progress on Contentment for Umbraco Bellissima.</p>
3131
<p>Once the development is out of the alpha phase, this dashboard <strong>will be removed</strong> from stable releases.</p>
32-
<p>Development has started on <strong>${this.#started} of the ${
33-
this.#total
34-
}</strong> UI components. Package migration is <strong>${
35-
this.#percentage
36-
}% complete</strong>.</p>
37-
<uui-progress-bar progress="${this.#percentage}" style="background-color:var(--uui-color-divider)"></uui-progress-bar>`,
32+
<p>Development has started on <strong>${this.#started} of the ${this.#total}</strong> UI components. Package migration is <strong>${this.#percentage}% complete</strong>.</p>
33+
<uui-progress-bar progress="${this.#percentage}" style="background-color:var(--uui-color-divider)"></uui-progress-bar>
34+
<p>If you find any bugs, or feel something is amiss, then please raise an issue on <a href="https://github.com/leekelleher/umbraco-contentment/issues" target="_blank" rel="noopener">the Contentment source-code repository on GitHub</a>.</p>
35+
<p>Pleaes do keep in mind that I am a solo developer on this project, working on it in my own free time.</p>`,
3836
},
3937
},
4038
]);
@@ -92,13 +90,13 @@ Status of list-editors used by the Data List editor.
9290
9391
| :octocat: | Editor | Status | Comment |
9492
| --------------- | --------------- | ----------- | ------- |
95-
| :green_circle: | **Buttons** | **Done** | |
93+
| :green_circle: | **Buttons** | **Done** | |
9694
| :green_circle: | **Checkbox List** | **Done** | |
97-
| :green_circle: | **Dropdown List** | **Done** | |
95+
| :large_blue_circle: | **Dropdown List** | **Done** | :warning: Missing "HTML attributes" UI. |
9896
| :grey_question: | Item Picker | _Pending_ | I haven't thought about it yet. |
9997
| :green_circle: | **Radio Button List** | **Done** | |
10098
| :grey_question: | Tags | _Pending_ | I haven't thought about it yet. |
101-
| :thinking: | Templated List | _Researching_ | Exploring alternative options. |
99+
| :thinking: | Templated List | _Researching_ | Exploring alternative options. :warning: Missing "HTML attributes" UI. |
102100
103101
### Data List sources
104102
@@ -109,7 +107,7 @@ The majority of this work is reliant on the internal **Configuration Editor** UI
109107
| --------------- | --------------- | ----------- | ------- |
110108
| :green_circle: | **.NET Countries** | **Done** | |
111109
| :green_circle: | **.NET Currencies** | **Done** | |
112-
| :grey_question: | .NET Enum | _Pending_ | I haven't thought about it yet. |
110+
| :large_blue_circle: | .NET Enum | _Reviewed_ | Missing "Enumeration type" UI. |
113111
| :green_circle: | **.NET Languages** | **Done** | |
114112
| :green_circle: | **.NET Time Zone** | **Done** | |
115113
| :green_circle: | Examine | **Done** | |
@@ -120,23 +118,23 @@ The majority of this work is reliant on the internal **Configuration Editor** UI
120118
| :green_circle: | **Text Delimited** | **Done** | |
121119
| :green_circle: | **uCssClassName** | **Done** | |
122120
| :thinking: | Umbraco Backoffice Sections | _Researching_ | :no_entry_sign: Backoffice sections are now registered client-side, unable to query on the server. Exploring alternative options. |
123-
| :grey_question: | Umbraco Content | _Pending_ | I haven't thought about it yet. |
124-
| :grey_question: | Umbraco Content Properties | _Pending_ | I haven't thought about it yet. |
121+
| :large_blue_circle: | Umbraco Content | _Reviewed_ | Missing "Parent node" UI. |
122+
| :large_blue_circle: | Umbraco Content Properties | _Reviewed_ | Missing "Content Type UI". |
125123
| :grey_question: | Umbraco Content Property Value | _Pending_ | I haven't thought about it yet. |
126124
| :grey_question: | Umbraco Content Types | _Pending_ | I haven't thought about it yet. |
127125
| :no_entry_sign: | Umbraco Content XPath | **Deprecated** | Umbraco 14 doesn't support XPath in the content cache. |
128-
| :grey_question: | Umbraco Dictionary | _Pending_ | I haven't thought about it yet. |
129-
| :grey_question: | Umbraco Entity | _Pending_ | I haven't thought about it yet. |
126+
| :large_blue_circle: | Umbraco Dictionary | _Reviewed_ | Missing "Dictionary Item" UI. |
127+
| :green_circle: | **Umbraco Entity** | **Done** | |
130128
| :grey_question: | Umbraco Files | _Pending_ | I haven't thought about it yet. |
131-
| :grey_question: | Umbraco Image Crop | _Pending_ | I haven't thought about it yet. |
129+
| :green_circle: | **Umbraco Image Crop** | **Done** | |
132130
| :green_circle: | **Umbraco Languages** | **Done** | |
133131
| :green_circle: | **Umbraco Member Group** | **Done** | |
134-
| :grey_question: | Umbraco Members | _Pending_ | I haven't thought about it yet. |
135-
| :grey_question: | Umbraco Tags | _Pending_ | I haven't thought about it yet. |
136-
| :grey_question: | Umbraco Templates | _Pending_ | I haven't thought about it yet. |
132+
| :large_blue_circle: | Umbraco Members | _Reviewed_ | Missing "Member Type" UI. |
133+
| :green_circle: | **Umbraco Tags** | **Done** | |
134+
| :green_circle: | **Umbraco Templates** | **Done** | |
137135
| :green_circle: | **Umbraco User Group** | **Done** | |
138-
| :grey_question: | Umbraco Users | _Pending_ | I haven't thought about it yet. |
139-
| :grey_question: | User Defined | _Pending_ | I haven't thought about it yet. |
136+
| :large_blue_circle: | Umbraco Users | _Reviewed_ | Missing "User Group" UI. |
137+
| :large_blue_circle: | User Defined | _Reviewed_ | Missing "Options" UI. |
140138
| :green_circle: | **XML** | **Done** | |
141139
| :green_circle: | **XML Sitemap Change Frequency** | **Done** | |
142140
| :green_circle: | **XML Sitemap Priority** | **Done** | |

src/Umbraco.Community.Contentment/Client/src/property-editor-ui/data-list/data-list.element.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
UmbPropertyEditorConfigCollection,
1010
UmbPropertyValueChangeEvent,
1111
} from '@umbraco-cms/backoffice/property-editor';
12-
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
13-
import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
12+
// import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
13+
// import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
1414
import type { ContentmentConfigurationEditorValue, ContentmentDataListEditor } from '../types.js';
1515
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
1616

@@ -23,14 +23,14 @@ const ELEMENT_NAME = 'contentment-property-editor-ui-data-list';
2323
export class ContentmentPropertyEditorUIDataListElement extends UmbLitElement implements UmbPropertyEditorUiElement {
2424
#listEditor?: ContentmentDataListEditor;
2525

26-
@state()
27-
private _entityUnique?: string | null;
26+
// @state()
27+
// private _entityUnique?: string | null;
2828

29-
@state()
30-
private _propertyAlias?: string;
29+
// @state()
30+
// private _propertyAlias?: string;
3131

32-
@state()
33-
private _variantId?: string;
32+
// @state()
33+
// private _variantId?: string;
3434

3535
@state()
3636
private _initialized = false;
@@ -53,15 +53,15 @@ export class ContentmentPropertyEditorUIDataListElement extends UmbLitElement im
5353
constructor() {
5454
super();
5555

56-
this.consumeContext(UMB_WORKSPACE_CONTEXT, (entityContext) => {
57-
// @ts-ignore
58-
this.observe(entityContext.unique, (unique) => (this._entityUnique = unique));
59-
});
56+
// this.consumeContext(UMB_WORKSPACE_CONTEXT, (entityContext) => {
57+
// // @ts-ignore
58+
// this.observe(entityContext.unique, (unique) => (this._entityUnique = unique));
59+
// });
6060

61-
this.consumeContext(UMB_PROPERTY_CONTEXT, (propertyContext) => {
62-
this.observe(propertyContext.alias, (alias) => (this._propertyAlias = alias));
63-
this.observe(propertyContext.variantId, (variantId) => (this._variantId = variantId?.toString() || 'invariant'));
64-
});
61+
// this.consumeContext(UMB_PROPERTY_CONTEXT, (propertyContext) => {
62+
// this.observe(propertyContext.alias, (alias) => (this._propertyAlias = alias));
63+
// this.observe(propertyContext.variantId, (variantId) => (this._variantId = variantId?.toString() || 'invariant'));
64+
// });
6565
}
6666

6767
protected async firstUpdated() {
@@ -101,7 +101,7 @@ export class ContentmentPropertyEditorUIDataListElement extends UmbLitElement im
101101
render() {
102102
if (!this._initialized || !this.#listEditor) return html`<uui-loader></uui-loader>`;
103103
if (!this.#listEditor.propertyEditorUiAlias) return html`<contentment-lee-was-here></contentment-lee-was-here>`;
104-
console.log('data-list', [this._entityUnique, this._propertyAlias, this._variantId]);
104+
//console.log('data-list', [this._entityUnique, this._propertyAlias, this._variantId]);
105105
return html`
106106
<contentment-property-editor-ui
107107
.config=${this.#listEditor.config}

src/Umbraco.Community.Contentment/Client/src/property-editor-ui/editor-notes/editor-notes.element.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export class ContentmentPropertyEditorUIEditorNotesElement extends UmbLitElement
3333
this.#alertType = config.getValueByAlias('alertType') || 'default';
3434
this.#icon = config.getValueByAlias('icon');
3535
this.#heading = config.getValueByAlias('heading');
36-
const message = config.getValueByAlias('message');
37-
this.#message = typeof message === 'string' ? message : (message as unknown as any).markup;
36+
const message = config.getValueByAlias('message');
37+
this.#message = (message as unknown as any)?.markup ?? message;
3838
this.#hideLabel = parseBoolean(config.getValueByAlias('hideLabel'));
3939

4040
if (this.#icon) {
@@ -90,9 +90,9 @@ export class ContentmentPropertyEditorUIEditorNotesElement extends UmbLitElement
9090
padding: 1rem;
9191
}
9292
93-
#note > div {
94-
flex: 1;
95-
}
93+
#note > div {
94+
flex: 1;
95+
}
9696
9797
umb-icon {
9898
font-size: 3rem;
@@ -107,6 +107,7 @@ export class ContentmentPropertyEditorUIEditorNotesElement extends UmbLitElement
107107
108108
details > summary {
109109
cursor: pointer;
110+
font-weight: bold;
110111
}
111112
`,
112113
];
Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
1-
import { css, customElement, html, property } from '@umbraco-cms/backoffice/external/lit';
1+
import { customElement, html, nothing, property } from '@umbraco-cms/backoffice/external/lit';
22
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
33
import { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
44
import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
55

6-
const ELEMENT_NAME = 'contentment-property-editor-ui-templated-label';
6+
import '../../property-editor-ui/editor-notes/editor-notes.element.js';
7+
8+
const ELEMENT_NAME = 'contentment-property-editor-ui-read-only';
79

810
@customElement(ELEMENT_NAME)
9-
export class ContentmentPropertyEditorUITemplatedLabelElement
11+
export class ContentmentPropertyEditorUIReadOnlyElement
1012
extends UmbLitElement
1113
implements UmbPropertyEditorUiElement
1214
{
1315
@property({ attribute: false })
1416
public value?: unknown;
1517

16-
@property({ attribute: false })
17-
public config?: UmbPropertyEditorConfigCollection;
18+
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
19+
if (!config) return;
20+
21+
const jsonConfig = JSON.stringify(config, null, 2);
22+
const jsonValue = JSON.stringify(this.value, null, 2);
23+
const markup = `
24+
<p><em>The property value and data-type configuration are in read-only mode.</em></p>
25+
${jsonValue ? `<details><summary>Value</summary><umb-code-block copy>${jsonValue}</umb-code-block></details>` : ''}
26+
${jsonConfig ? `<details><summary>Configuration</summary><umb-code-block copy>${jsonConfig}</umb-code-block></details>` : ''}
27+
`;
28+
29+
this.#notesConfig = new UmbPropertyEditorConfigCollection([
30+
{ alias: 'alertType', value: 'warning' },
31+
{ alias: 'icon', value: 'icon-alert' },
32+
{ alias: 'heading', value: 'This editor has not been developed yet.' },
33+
{ alias: 'message', value: { markup } },
34+
]);
35+
}
36+
37+
#notesConfig?: UmbPropertyEditorConfigCollection;
1838

1939
constructor() {
2040
super();
2141
}
2242

2343
render() {
44+
if (!this.#notesConfig) return nothing;
2445
return html`
25-
<div>
26-
<p><em>This is a read-only view of the property value and data-type configuration.</em></p>
27-
<details>
28-
<summary>Value</summary>
29-
<umb-code-block copy>${JSON.stringify(this.value, null, 2)}</umb-code-block>
30-
</details>
31-
<details>
32-
<summary>Configuration</summary>
33-
<umb-code-block copy>${JSON.stringify(this.config, null, 2)}</umb-code-block>
34-
</details>
35-
</div>
46+
<contentment-property-editor-ui-editor-notes .config=${this.#notesConfig}>
47+
</contentment-property-editor-ui-editor-notes>
3648
`;
3749
}
38-
39-
static styles = [
40-
css`
41-
details > summary {
42-
cursor: pointer;
43-
font-weight: bold;
44-
}
45-
46-
umb-code-block {
47-
margin-bottom: 1rem;
48-
}
49-
`,
50-
];
5150
}
5251

53-
export { ContentmentPropertyEditorUITemplatedLabelElement as element };
52+
export { ContentmentPropertyEditorUIReadOnlyElement as element };
5453

5554
declare global {
5655
interface HTMLElementTagNameMap {
57-
[ELEMENT_NAME]: ContentmentPropertyEditorUITemplatedLabelElement;
56+
[ELEMENT_NAME]: ContentmentPropertyEditorUIReadOnlyElement;
5857
}
5958
}

src/Umbraco.Community.Contentment/Client/src/property-editor-ui/render-macro/render-macro.element.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MPL-2.0
22
// Copyright © 2023 Lee Kelleher
33

4-
import { customElement, html, property } from '@umbraco-cms/backoffice/external/lit';
4+
import { customElement, html, nothing, property } from '@umbraco-cms/backoffice/external/lit';
55
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
66
import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
77
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
@@ -15,15 +15,10 @@ export class ContentmentPropertyEditorUIRenderMacroElement extends UmbLitElement
1515
@property()
1616
public value?: string;
1717

18-
@property({ attribute: false })
19-
config?: UmbPropertyEditorConfigCollection;
18+
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
19+
if (!config) return;
2020

21-
#notesConfig?: UmbPropertyEditorConfigCollection;
22-
23-
connectedCallback() {
24-
super.connectedCallback();
25-
26-
const json = JSON.stringify(this.config, null, 2);
21+
const json = JSON.stringify(config, null, 2);
2722
const markup = `
2823
<p><em>Support for Macros were deprecated in Umbraco 14. Please consider alternative functionality.</em></p>
2924
${json ? `<details><summary>Macro configuration</summary><umb-code-block copy>${json}</umb-code-block></details>` : ''}
@@ -37,7 +32,10 @@ ${json ? `<details><summary>Macro configuration</summary><umb-code-block copy>${
3732
]);
3833
}
3934

35+
#notesConfig?: UmbPropertyEditorConfigCollection;
36+
4037
render() {
38+
if (!this.#notesConfig) return nothing;
4139
return html`
4240
<contentment-property-editor-ui-editor-notes .config=${this.#notesConfig}>
4341
</contentment-property-editor-ui-editor-notes>

src/Umbraco.Community.Contentment/DataEditors/Buttons/ButtonsDataListEditor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public sealed class ButtonsDataListEditor : IDataListEditor
1313
{
1414
internal const string DataEditorViewPath = Constants.Internals.EditorsPathRoot + "buttons.html";
1515

16+
internal const string DataEditorUiAlias = "Umb.Contentment.PropertyEditorUi.Buttons";
17+
1618
private readonly IIOHelper _ioHelper;
1719

1820
public ButtonsDataListEditor(IIOHelper ioHelper)
@@ -106,6 +108,6 @@ public bool HasMultipleValues(Dictionary<string, object>? config)
106108

107109
public string View => DataEditorViewPath;
108110

109-
public string PropertyEditorUiAlias => "Umb.Contentment.PropertyEditorUi.Buttons";
111+
public string PropertyEditorUiAlias => DataEditorUiAlias;
110112
}
111113
}

src/Umbraco.Community.Contentment/DataEditors/CascadingDropdownList/CascadingDropdownListDataEditor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright © 2019 Lee Kelleher.
1+
/* Copyright © 2019 Lee Kelleher.
22
* This Source Code Form is subject to the terms of the Mozilla Public
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
@@ -10,5 +10,8 @@ internal sealed class CascadingDropdownListDataEditor
1010
internal const string APIs = "apis";
1111

1212
internal const string DataEditorViewPath = Constants.Internals.EditorsPathRoot + "cascading-dropdown-list.html";
13+
14+
// TODO: [LK] This property-editor UI needs to be developed.
15+
internal const string DataEditorUiAlias = "Umb.Contentment.PropertyEditorUi.ReadOnly";
1316
}
1417
}

src/Umbraco.Community.Contentment/DataEditors/CheckboxList/CheckboxListDataListEditor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Umbraco.Community.Contentment.DataEditors
1010
public sealed class CheckboxListDataListEditor : IDataListEditor
1111
{
1212
internal const string DataEditorViewPath = Constants.Internals.EditorsPathRoot + "checkbox-list.html";
13+
internal const string DataEditorUiAlias = "Umb.Contentment.PropertyEditorUi.CheckBoxList";
1314

1415
public string Name => "Checkbox List";
1516

@@ -43,6 +44,6 @@ public sealed class CheckboxListDataListEditor : IDataListEditor
4344

4445
public string View => DataEditorViewPath;
4546

46-
public string PropertyEditorUiAlias => "Umb.Contentment.PropertyEditorUi.CheckBoxList";
47+
public string PropertyEditorUiAlias => DataEditorUiAlias;
4748
}
4849
}

src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorDataEditor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ internal sealed class ConfigurationEditorDataEditor
1313
internal const string DataEditorInlineViewPath = Constants.Internals.EditorsPathRoot + "configuration-editor.inline.html";
1414
internal const string DataEditorOverlayViewPath = Constants.Internals.EditorsPathRoot + "configuration-editor.overlay.html";
1515
internal const string DataEditorIcon = UmbConstants.Icons.Package;
16+
17+
// TODO: [LK] This property-editor UI needs to be developed.
18+
internal const string DataEditorUiAlias = "Umb.Contentment.PropertyEditorUi.ReadOnly";
1619
}
1720
}

src/Umbraco.Community.Contentment/DataEditors/ContentPicker/ContentPickerDataEditor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright © 2020 Lee Kelleher.
1+
/* Copyright © 2020 Lee Kelleher.
22
* This Source Code Form is subject to the terms of the Mozilla Public
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
@@ -8,5 +8,8 @@ namespace Umbraco.Community.Contentment.DataEditors
88
internal sealed class ContentPickerDataEditor
99
{
1010
internal const string DataEditorViewPath = Constants.Internals.EditorsPathRoot + "content-source.html";
11+
12+
// TODO: [LK] This property-editor UI needs to be developed.
13+
internal const string DataEditorUiAlias = "Umb.Contentment.PropertyEditorUi.ReadOnly";
1114
}
1215
}

0 commit comments

Comments
 (0)