Skip to content

Commit 9e06df2

Browse files
Introduce utilities section for Backoffice customization helpers (#7633)
* move sorting to utilities * move confirm dialog to utils * update path * Update SUMMARY.md * remove old sorting location * remove old entry of confirm dialog * fix overview
1 parent 8e84cb8 commit 9e06df2

File tree

8 files changed

+51
-23
lines changed

8 files changed

+51
-23
lines changed

17/umbraco-cms/.gitbook.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,6 @@ redirects:
150150
customizing/extending-overview/extension-types/workspaces/workspace-footer-app: customizing/extending-overview/extension-types/workspaces/workspace-footer-apps.md
151151
customizing/foundation/repositories: customizing/foundation/repositories/README.md
152152
customizing/extending-overview/extension-kind: customizing/extending-overview/extension-types/kind.md
153+
customizing/foundation/sorting: customizing/utilities/sorting.md
154+
customizing/extending-overview/extension-types/modals/confirm-dialog: customizing/utilities/modals/confirm-dialog.md
153155

17/umbraco-cms/SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@
180180
* [Localization](customizing/extending-overview/extension-types/localization.md)
181181
* [Menu](customizing/extending-overview/extension-types/menu.md)
182182
* [Modals](customizing/extending-overview/extension-types/modals/README.md)
183-
* [Confirm Dialog](customizing/extending-overview/extension-types/modals/confirm-dialog.md)
184183
* [Custom Modals](customizing/extending-overview/extension-types/modals/custom-modals.md)
185184
* [Modal Route Registration](customizing/extending-overview/extension-types/modals/route-registration.md)
186185
* [Property Value Preset](customizing/extending-overview/extension-types/property-value-preset.md)
@@ -220,7 +219,6 @@
220219
* [Item Repository](customizing/foundation/repositories/repository-types/item-repository.md)
221220
* [Tree Repository](customizing/foundation/repositories/repository-types/tree-repository.md)
222221
* [States](customizing/foundation/states.md)
223-
* [UI Sorting](customizing/foundation/sorting.md)
224222
* [Routes](customizing/foundation/routes.md)
225223
* [Backoffice Localization](customizing/foundation/localization.md)
226224
* [Integrate Validation](customizing/foundation/integrate-validation.md)
@@ -247,6 +245,10 @@
247245
* [Integrate Property Editors](customizing/property-editors/integrate-property-editors.md)
248246
* [Tracking References](customizing/property-editors/tracking.md)
249247
* [Property Dataset](customizing/property-editors/property-dataset.md)
248+
* [Utilities](customizing/utilities/README.md)
249+
* [Modals](customizing/utilities/modals/README.md)
250+
* [Confirm Dialog](customizing/utilities/modals/confirm-dialog.md)
251+
* [UI Sorting](customizing/utilities/sorting.md)
250252
* [Workspaces](customizing/workspaces.md)
251253
* [Umbraco Package](customizing/umbraco-package.md)
252254
* [UI Library](customizing/ui-library.md)

17/umbraco-cms/customizing/extending-overview/extension-types/modals/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ declare global {
4848

4949
The Promise returned by `umbOpenModal` is handled for potential rejection. This occurs when the Model is closed without submitting. Use this behavior to carry out a certain action if the modal is cancelled. In this case, `undefined` is returned when the Modal is cancelled (rejected).
5050

51-
See the [Confirm Modal article](confirm-dialog.md) for an example.
51+
See the [Confirm Modal article](../../../utilities/modals/confirm-dialog.md) for an example.
5252

5353
### Directly open via the Modal Manager Context
5454

@@ -93,7 +93,7 @@ modalContext
9393
.catch(() => undefined);
9494
```
9595

96-
[See the implementing a Confirm Dialog for an example.](confirm-dialog.md)
96+
[See the implementing a Confirm Dialog for an example.](../../../utilities/modals/confirm-dialog.md)
9797

9898
### Modal Route Registration
9999

17/umbraco-cms/customizing/foundation/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ Learn how to communicate with the rest of the application, whether you want to r
2626

2727
Bring life into your UI by ensuring it's up to date with the current data.
2828

29-
## [Sorting](sorting.md)
30-
31-
Create a UI that the user can sort via Drag and Drop.
32-
3329
## [Routes](routes.md)
3430

3531
Implements routes into your UI, enabling Users to deep link into your UI.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: >-
3+
In this section you can find information about different code utilities that can be
4+
used in your extension when customizing the Backoffice.
5+
---
6+
7+
# Utilities
8+
9+
## [Modals](modals/README.md)
10+
11+
Open dialogs and sidebars to interact with the user.
12+
13+
## [Sorting](sorting.md)
14+
15+
Create a UI that the user can sort via Drag and Drop.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: >-
3+
In this section you can find information about different modal utilities that can be
4+
used in your extension when customizing the Backoffice.
5+
---
6+
7+
## [Confirm Dialog](modals/confirm-dialog.md)
8+
9+
Present a dialog to ask the user for confirmation.
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Extension authors do not need to register the dialog in their extension's manife
1010

1111
Extension authors can customize the dialog with configuration options such as headline, body content, colors, and button labels.
1212

13-
* `headline` - The headline of the modal.
14-
* `content` - The content of the modal, which can be a TemplateResult or a string.
15-
* `color` - (Optional) The color of the modal, can be `positive` or `danger`. Defaults to `positive`.
16-
* `confirmLabel` - (Optional) The label of the confirmation button.
17-
* `cancelLabel` - (Optional) The label of the cancel button.
13+
- `headline` - The headline of the modal.
14+
- `content` - The content of the modal, which can be a TemplateResult or a string.
15+
- `color` - (Optional) The color of the modal, can be `positive` or `danger`. Defaults to `positive`.
16+
- `confirmLabel` - (Optional) The label of the confirmation button.
17+
- `cancelLabel` - (Optional) The label of the cancel button.
1818

1919
To see all properties of the `UMB_CONFIRM_MODAL` token, see the [API reference](https://apidocs.umbraco.com/v16/ui-api/interfaces/packages_core_modal.UmbConfirmModalData.html).
2020

@@ -23,6 +23,7 @@ The `onSubmit` method returns a promise that resolves when the user confirms the
2323
## Opening a Confirmation Dialog
2424

2525
{% code title="my-element.ts" %}
26+
2627
```typescript
2728
import {
2829
html,
@@ -53,21 +54,23 @@ export class MyConfirmationModal extends UmbElementMixin(LitElement) {
5354

5455
render() {
5556
return html`<uui-button
56-
look="primary"
57-
color="danger"
58-
@click=${this.#onRequestDisable}
59-
label=${this.localize.term("actions_disable")}
60-
></uui-button>`;
57+
look="primary"
58+
color="danger"
59+
@click=${this.#onRequestDisable}
60+
label=${this.localize.term("actions_disable")}
61+
></uui-button>`;
6162
}
6263
}
6364
```
65+
6466
{% endcode %}
6567

6668
## Convenience Method
6769

6870
Confirmation dialogs can be opened using the `umbConfirmModal` method, which offers a slightly simplified API.
6971

7072
{% code title="my-element.ts" %}
73+
7174
```typescript
7275
import {
7376
html,
@@ -96,12 +99,13 @@ export class RestartServicesModal extends UmbElementMixin(LitElement) {
9699

97100
render() {
98101
return html`<uui-button
99-
look="primary"
100-
color="positive"
101-
@click=${this.#onRequestDisable}
102-
label=${this.localize.term("actions_disable")}
103-
></uui-button>`;
102+
look="primary"
103+
color="positive"
104+
@click=${this.#onRequestDisable}
105+
label=${this.localize.term("actions_disable")}
106+
></uui-button>`;
104107
}
105108
}
106109
```
110+
107111
{% endcode %}
File renamed without changes.

0 commit comments

Comments
 (0)