Skip to content

Commit

Permalink
Add "delete buttons" documentation (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirZaets authored Nov 21, 2023
1 parent 0cd9e6d commit 93bc2f2
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/pages/services/aem-cf-console-admin/api/action-bar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ You have the ability to:
- create multiple buttons from single extension;
- implement drop-down menu buttons;
- use any [icon](https://react-spectrum.adobe.com/react-spectrum/workflow-icons.html#available-icons) from React Spectrum;
- delete default or added by extension buttons;

## Custom button with callback

Expand Down Expand Up @@ -90,6 +91,30 @@ const guestConnection = await register({
});
```

## Custom button with sub menu

```js
import { register } from "@adobe/uix-guest";

// ...

const guestConnection = await register({
id: "my.company.extension-with-action-bar-button",
methods: {
actionBar: {
deleteButtons() {
return [
{
//The "id" property is the "data-id" property of html button element.
id: "my.company.export-button"
},
];
},
},
},
});
```

The callback is invoked when user clicks on the button and receives list of content fragments selected in the list.

<InlineAlert variant="warning" slots="text" />
Expand All @@ -116,3 +141,9 @@ The `getButton` method is deprecated. When defining a single button, use `getBut
| label | `string` | ✔️ | Button label that will be visible on UI |
| icon | `string` | | Name of a [React-Spectrum workflow icon](https://react-spectrum.adobe.com/react-spectrum/workflow-icons.html#available-icons) |
| onClick | `callback(selections): void` | ✔️ | A callback for a button `onClick` event. Receives list of content fragments selected in the list |

### Delete button API

| Field | Type | Required | Description |
|----------|-----------------------------------------------------------------------------| ------ |------------------------------------------------------------------------------|
| id | `string` | ✔️ | "id" is a "data-id" attribute of the button. (Use browser developer console) |
31 changes: 31 additions & 0 deletions src/pages/services/aem-cf-console-admin/api/header-menu/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ You have the ability to:
- implement drop-down menu buttons;
- use different [variations](https://spectrum.adobe.com/page/button/#Options) of buttons from React Spectrum;
- use any [icon](https://react-spectrum.adobe.com/react-spectrum/workflow-icons.html#available-icons) from React Spectrum;
- delete default or added by extension buttons;

## Custom button with callback

Expand Down Expand Up @@ -91,6 +92,30 @@ const guestConnection = await register({
});
```

## Delete button

```js
import { register } from "@adobe/uix-guest";

// ...

const guestConnection = await register({
id: "my.company.extension-with-header-menu-button",
methods: {
headerMenu: {
deleteButtons() {
return [
{
id: "my.company.export-button"
},
];
},
},
},
});
```


The `onClick` callback is invoked when a user clicks on the button. It does not receive any arguments.

<InlineAlert variant="warning" slots="text" />
Expand Down Expand Up @@ -118,3 +143,9 @@ The `getButton` method is deprecated. When defining a single button, use `getBut
| label | `string` | ✔️ | Button label that will be visible on UI |
| icon | `string` | | Name of a [React-Spectrum workflow icon](https://react-spectrum.adobe.com/react-spectrum/workflow-icons.html#available-icons) |
| onClick | `callback(): void` | ✔️ | A callback for a button `onClick` event |

### Delete button API

| Field | Type | Required | Description |
|----------|-----------------------------------------------------------------------------| ------ |------------------------------------------------------------------------------|
| id | `string` | ✔️ | "id" is a "data-id" attribute of the button. (Use browser developer console) |

0 comments on commit 93bc2f2

Please sign in to comment.