# SiActionDialogService documentation

**Kind:** class

**Provided in:** `root`

```
import { SiActionDialogService } from '@siemens/element-ng/action-modal';
```

The service provides convenient methods to show common modal dialogs. All return an observable, which emit the dialog results. After emitting, the observables complete. Therefore, clients do not need to unsubscribe.

```
undecorated_class SiActionDialogService
```

#### Attributes and Methods

##### showActionDialog

[Source for showActionDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.service.ts#L48-L81>)

Shows an action dialog

Returns: Observable for the result of the dialog. Need to `subscribe()` to show the dialog

```
showActionDialog<T extends ActionDialog>(dialog: T, diOptions?: ModalDependencyInjectionOptions): Observable<ActionDialogReturnType<T>>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [dialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.service.ts#L49-L49>) | `T` |  | • The dialog configuration |
| [diOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.service.ts#L50-L50>) (optional) | `ModalDependencyInjectionOptions` |  | • Optional DI configuration. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[ActionDialogReturnType](<index.html#t:ActionDialogReturnType>)`<T>>`

### Types Documentation

### [ActionDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L78-L79>)

**Kind:** type alias

```
import type { ActionDialog } from '@siemens/element-ng/action-modal';
```

All possible action dialogs.

```
type ActionDialog = AlertDialog | ConfirmationDialog | EditDiscardDialog | DeleteConfirmationDialog | never
```

### [ActionDialogReturnType](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L82-L90>)

**Kind:** type alias

```
import type { ActionDialogReturnType } from '@siemens/element-ng/action-modal';
```

Returns the return value type for the given action dialog type

```
type ActionDialogReturnType<T extends ActionDialogBase<any>> = T extends AlertDialog
  ? AlertDialogResult
  : T extends ConfirmationDialog
    ? ConfirmationDialogResult
    : T extends EditDiscardDialog
      ? EditDiscardDialogResult
      : T extends DeleteConfirmationDialog
        ? DeleteConfirmationDialogResult
        : never
```

### [ModalDependencyInjectionOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/modal/si-modal.service.ts#L25-L32>)

**Kind:** interface

```
import type { ModalDependencyInjectionOptions } from '@siemens/element-ng/modal';
```

```
interface ModalDependencyInjectionOptions
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [environmentInjector](<https://github.com/siemens/element/blob/main/projects/element-ng/modal/si-modal.service.ts#L31-L31>) (optional) | `EnvironmentInjector` | Optional environment Injector. |
| [injector](<https://github.com/siemens/element/blob/main/projects/element-ng/modal/si-modal.service.ts#L29-L29>) (optional) | `Injector` | Optional element Injector. |
| [providers](<https://github.com/siemens/element/blob/main/projects/element-ng/modal/si-modal.service.ts#L27-L27>) (optional) | `StaticProvider[]` | Additional providers for the modal. |

### [ActionDialogBase](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L19-L33>)

**Kind:** interface

Base type for all action dialogs

```
interface ActionDialogBase<TResult>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [delayDismiss](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L32-L32>) (optional) | `((result: TResult) => Observable<TResult>)` | Callback for delaying dismiss with a progress indicator until the returned [Observable](<https://rxjs.dev/api/index/class/Observable>) emits. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L23-L23>) (optional) | `TranslatableString` | The heading. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L25-L25>) (optional) | `string` | Icon displayed in the heading. |
| [message](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L21-L21>) (optional) | `TranslatableString` | The message. |
| [translationParams](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L27-L27>) (optional) | `Record<string, any>` | Parameters for the translate pipe. |

### [AlertDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L36-L40>)

**Kind:** interface

```
import type { AlertDialog } from '@siemens/element-ng/action-modal';
```

An action dialog showing an alert

```
interface AlertDialog extends ActionDialogBase<AlertDialogResult>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [confirmBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L39-L39>) (optional) | `TranslatableString` | Label of the confirmation button. |
| [delayDismiss](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L32-L32>) (optional, inherited) | `((result: "confirm") => Observable<"confirm">)` | Callback for delaying dismiss with a progress indicator until the returned [Observable](<https://rxjs.dev/api/index/class/Observable>) emits.<br><br>Inherited from [ActionDialogBase\<"confirm"\>](<index.html#t:ActionDialogBase>) |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L23-L23>) (optional, inherited) | `TranslatableString` | The heading.<br><br>Inherited from [ActionDialogBase\<"confirm"\>](<index.html#t:ActionDialogBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L25-L25>) (optional, inherited) | `string` | Icon displayed in the heading.<br><br>Inherited from [ActionDialogBase\<"confirm"\>](<index.html#t:ActionDialogBase>) |
| [message](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L21-L21>) (optional, inherited) | `TranslatableString` | The message.<br><br>Inherited from [ActionDialogBase\<"confirm"\>](<index.html#t:ActionDialogBase>) |
| [translationParams](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L27-L27>) (optional, inherited) | `Record<string, any>` | Parameters for the translate pipe.<br><br>Inherited from [ActionDialogBase\<"confirm"\>](<index.html#t:ActionDialogBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L37-L37>) | `"alert"` |  |

### [AlertDialogResult](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L8-L8>)

**Kind:** type alias

```
import type { AlertDialogResult } from '@siemens/element-ng/action-modal';
```

```
type AlertDialogResult = 'confirm'
```

### [ConfirmationDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L43-L49>)

**Kind:** interface

```
import type { ConfirmationDialog } from '@siemens/element-ng/action-modal';
```

An action dialog for a confirmation.

```
interface ConfirmationDialog extends ActionDialogBase<ConfirmationDialogResult>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [confirmBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L46-L46>) (optional) | `TranslatableString` | Label of the confirmation button. |
| [declineBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L48-L48>) (optional) | `TranslatableString` | Label of the decline button. |
| [delayDismiss](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L32-L32>) (optional, inherited) | `((result: ConfirmationDialogResult) => Observable<ConfirmationDialogResult>)` | Callback for delaying dismiss with a progress indicator until the returned [Observable](<https://rxjs.dev/api/index/class/Observable>) emits.<br><br>Inherited from [ActionDialogBase\<ConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L23-L23>) (optional, inherited) | `TranslatableString` | The heading.<br><br>Inherited from [ActionDialogBase\<ConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L25-L25>) (optional, inherited) | `string` | Icon displayed in the heading.<br><br>Inherited from [ActionDialogBase\<ConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [message](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L21-L21>) (optional, inherited) | `TranslatableString` | The message.<br><br>Inherited from [ActionDialogBase\<ConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [translationParams](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L27-L27>) (optional, inherited) | `Record<string, any>` | Parameters for the translate pipe.<br><br>Inherited from [ActionDialogBase\<ConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L44-L44>) | `"confirmation"` |  |

### [ConfirmationDialogResult](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L12-L12>)

**Kind:** type alias

```
import type { ConfirmationDialogResult } from '@siemens/element-ng/action-modal';
```

```
type ConfirmationDialogResult = 'confirm' | 'decline'
```

### [EditDiscardDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L52-L66>)

**Kind:** interface

```
import type { EditDiscardDialog } from '@siemens/element-ng/action-modal';
```

An action dialog for an edit/discard prompt.

```
interface EditDiscardDialog extends ActionDialogBase<EditDiscardDialogResult>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [cancelBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L61-L61>) (optional) | `TranslatableString` | Label of the cancel button. |
| [delayDismiss](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L32-L32>) (optional, inherited) | `((result: EditDiscardDialogResult) => Observable<EditDiscardDialogResult>)` | Callback for delaying dismiss with a progress indicator until the returned [Observable](<https://rxjs.dev/api/index/class/Observable>) emits.<br><br>Inherited from [ActionDialogBase\<EditDiscardDialogResult\>](<index.html#t:ActionDialogBase>) |
| [disableSave](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L55-L55>) (optional) | `boolean` | Whether to disable the save button. |
| [disableSaveDiscardBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L65-L65>) (optional) | `TranslatableString` | Label of the discard button when [disableSave](<index.html#t:EditDiscardDialog.disableSave>) is set. |
| [disableSaveMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L63-L63>) (optional) | `TranslatableString` | Message when [disableSave](<index.html#t:EditDiscardDialog.disableSave>) is set. |
| [discardBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L59-L59>) (optional) | `TranslatableString` | Label of the discard button. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L23-L23>) (optional, inherited) | `TranslatableString` | The heading.<br><br>Inherited from [ActionDialogBase\<EditDiscardDialogResult\>](<index.html#t:ActionDialogBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L25-L25>) (optional, inherited) | `string` | Icon displayed in the heading.<br><br>Inherited from [ActionDialogBase\<EditDiscardDialogResult\>](<index.html#t:ActionDialogBase>) |
| [message](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L21-L21>) (optional, inherited) | `TranslatableString` | The message.<br><br>Inherited from [ActionDialogBase\<EditDiscardDialogResult\>](<index.html#t:ActionDialogBase>) |
| [saveBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L57-L57>) (optional) | `TranslatableString` | Label of the save button. |
| [translationParams](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L27-L27>) (optional, inherited) | `Record<string, any>` | Parameters for the translate pipe.<br><br>Inherited from [ActionDialogBase\<EditDiscardDialogResult\>](<index.html#t:ActionDialogBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L53-L53>) | `"edit-discard"` |  |

### [EditDiscardDialogResult](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L10-L10>)

**Kind:** type alias

```
import type { EditDiscardDialogResult } from '@siemens/element-ng/action-modal';
```

```
type EditDiscardDialogResult = 'save' | 'discard' | 'cancel'
```

### [DeleteConfirmationDialog](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L69-L75>)

**Kind:** interface

```
import type { DeleteConfirmationDialog } from '@siemens/element-ng/action-modal';
```

An action dialog for a delete confirmation.

```
interface DeleteConfirmationDialog extends ActionDialogBase<DeleteConfirmationDialogResult>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [cancelBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L74-L74>) (optional) | `TranslatableString` | Label of the cancel button. |
| [delayDismiss](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L32-L32>) (optional, inherited) | `((result: DeleteConfirmationDialogResult) => Observable<DeleteConfirmationDialogResult>)` | Callback for delaying dismiss with a progress indicator until the returned [Observable](<https://rxjs.dev/api/index/class/Observable>) emits.<br><br>Inherited from [ActionDialogBase\<DeleteConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [deleteBtnName](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L72-L72>) (optional) | `TranslatableString` | Label of the delete button. |
| [heading](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L23-L23>) (optional, inherited) | `TranslatableString` | The heading.<br><br>Inherited from [ActionDialogBase\<DeleteConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L25-L25>) (optional, inherited) | `string` | Icon displayed in the heading.<br><br>Inherited from [ActionDialogBase\<DeleteConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [message](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L21-L21>) (optional, inherited) | `TranslatableString` | The message.<br><br>Inherited from [ActionDialogBase\<DeleteConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [translationParams](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L27-L27>) (optional, inherited) | `Record<string, any>` | Parameters for the translate pipe.<br><br>Inherited from [ActionDialogBase\<DeleteConfirmationDialogResult\>](<index.html#t:ActionDialogBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L70-L70>) | `"delete-confirm"` |  |

### [DeleteConfirmationDialogResult](<https://github.com/siemens/element/blob/main/projects/element-ng/action-modal/si-action-dialog.types.ts#L14-L14>)

**Kind:** type alias

```
import type { DeleteConfirmationDialogResult } from '@siemens/element-ng/action-modal';
```

```
type DeleteConfirmationDialogResult = 'delete' | 'cancel'
```

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
