-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing property-editor UI aliases on the data-sources and list-editors. Updated the progress status dashboard.
- Loading branch information
1 parent
d2cad23
commit 4f87b26
Showing
36 changed files
with
166 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 30 additions & 31 deletions
61
...mbraco.Community.Contentment/Client/src/property-editor-ui/read-only/read-only.element.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,58 @@ | ||
import { css, customElement, html, property } from '@umbraco-cms/backoffice/external/lit'; | ||
import { customElement, html, nothing, property } from '@umbraco-cms/backoffice/external/lit'; | ||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; | ||
import { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry'; | ||
import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; | ||
|
||
const ELEMENT_NAME = 'contentment-property-editor-ui-templated-label'; | ||
import '../../property-editor-ui/editor-notes/editor-notes.element.js'; | ||
|
||
const ELEMENT_NAME = 'contentment-property-editor-ui-read-only'; | ||
|
||
@customElement(ELEMENT_NAME) | ||
export class ContentmentPropertyEditorUITemplatedLabelElement | ||
export class ContentmentPropertyEditorUIReadOnlyElement | ||
extends UmbLitElement | ||
implements UmbPropertyEditorUiElement | ||
{ | ||
@property({ attribute: false }) | ||
public value?: unknown; | ||
|
||
@property({ attribute: false }) | ||
public config?: UmbPropertyEditorConfigCollection; | ||
public set config(config: UmbPropertyEditorConfigCollection | undefined) { | ||
if (!config) return; | ||
|
||
const jsonConfig = JSON.stringify(config, null, 2); | ||
const jsonValue = JSON.stringify(this.value, null, 2); | ||
const markup = ` | ||
<p><em>The property value and data-type configuration are in read-only mode.</em></p> | ||
${jsonValue ? `<details><summary>Value</summary><umb-code-block copy>${jsonValue}</umb-code-block></details>` : ''} | ||
${jsonConfig ? `<details><summary>Configuration</summary><umb-code-block copy>${jsonConfig}</umb-code-block></details>` : ''} | ||
`; | ||
|
||
this.#notesConfig = new UmbPropertyEditorConfigCollection([ | ||
{ alias: 'alertType', value: 'warning' }, | ||
{ alias: 'icon', value: 'icon-alert' }, | ||
{ alias: 'heading', value: 'This editor has not been developed yet.' }, | ||
{ alias: 'message', value: { markup } }, | ||
]); | ||
} | ||
|
||
#notesConfig?: UmbPropertyEditorConfigCollection; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
render() { | ||
if (!this.#notesConfig) return nothing; | ||
return html` | ||
<div> | ||
<p><em>This is a read-only view of the property value and data-type configuration.</em></p> | ||
<details> | ||
<summary>Value</summary> | ||
<umb-code-block copy>${JSON.stringify(this.value, null, 2)}</umb-code-block> | ||
</details> | ||
<details> | ||
<summary>Configuration</summary> | ||
<umb-code-block copy>${JSON.stringify(this.config, null, 2)}</umb-code-block> | ||
</details> | ||
</div> | ||
<contentment-property-editor-ui-editor-notes .config=${this.#notesConfig}> | ||
</contentment-property-editor-ui-editor-notes> | ||
`; | ||
} | ||
|
||
static styles = [ | ||
css` | ||
details > summary { | ||
cursor: pointer; | ||
font-weight: bold; | ||
} | ||
umb-code-block { | ||
margin-bottom: 1rem; | ||
} | ||
`, | ||
]; | ||
} | ||
|
||
export { ContentmentPropertyEditorUITemplatedLabelElement as element }; | ||
export { ContentmentPropertyEditorUIReadOnlyElement as element }; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
[ELEMENT_NAME]: ContentmentPropertyEditorUITemplatedLabelElement; | ||
[ELEMENT_NAME]: ContentmentPropertyEditorUIReadOnlyElement; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.