Skip to content

SiActionDialogService documentation

provided in root

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.

Attributes and Methods

NameTypeDefaultDescription
showActionDialog(...)
<(T: ActionDialog)> (dialog: T, diOptions: ModalDependencyInjectionOptions) => Observable<ActionDialogReturnType<T>>Shows an action dialog
Returns Observable for the result of the dialog. Need to subscribe() to show the dialog

Parameters
showAlertDialog(...)
Deprecated
(message: string, heading: string, confirmBtnName: string, translationParams: { [ key: string ]: any } }, icon: string, diOptions: ModalDependencyInjectionOptions) => Observable<"confirm">Show an alert dialog.
Deprecated: use showActionDialog({ type: 'alert', ... }) instead

Parameters
showConfirmationDialog(...)
Deprecated
(message: string, heading: string, confirmBtnName: string, declineBtnName: string, translationParams: { [ key: string ]: any } }, icon: string, diOptions: ModalDependencyInjectionOptions) => Observable<ConfirmationDialogResult>Show a confirmation dialog.
Deprecated: use showActionDialog({ type: 'confirmation', ... }) instead

Parameters
showDeleteConfirmationDialog(...)
Deprecated
(message: string, heading: string, deleteBtnName: string, cancelBtnName: string, translationParams: { [ key: string ]: any } }, icon: string, diOptions: ModalDependencyInjectionOptions) => Observable<DeleteConfirmationDialogResult>Show a dialog confirming a deletion.
Deprecated: use showActionDialog({ type: 'delete-confirm', ... }) instead

Parameters
showEditDiscardDialog(...)
Deprecated
(disableSave: boolean, message: string, heading: string, saveBtnName: string, discardBtnName: string, cancelBtnName: string, disableSaveMessage: string, disableSaveDiscardBtnName: string, translationParams: { [ key: string ]: any } }, icon: string, diOptions: ModalDependencyInjectionOptions) => Observable<EditDiscardDialogResult>Show an edit dialog with the option to discard.
Deprecated: use showActionDialog({ type: 'edit-discard', ... }) instead

Parameters

Types Documentation

Returns the return value type for the given action dialog type
All possible action dialogs.
extends ActionDialogBase<AlertDialogResult>
An action dialog showing an alert
Properties
Label of the confirmation button.
confirmBtnName?: TranslatableString
Callback for delaying dismiss with a progress indicator until the returned Observable: Observable emits.
delayDismiss?: (result: "confirm") => Observable<"confirm"> from ActionDialogBase.delayDismiss
The heading.
heading?: TranslatableString from ActionDialogBase.heading
Icon displayed in the heading.
icon?: string from ActionDialogBase.icon
The message.
message?: TranslatableString from ActionDialogBase.message
Parameters for the translate pipe.
translationParams?: Record<string, any> from ActionDialogBase.translationParams
type: "alert"
An action dialog for a confirmation.
Properties
Label of the confirmation button.
confirmBtnName?: TranslatableString
Label of the decline button.
declineBtnName?: TranslatableString
Callback for delaying dismiss with a progress indicator until the returned Observable: Observable emits.
delayDismiss?: (result: ConfirmationDialogResult) => Observable<ConfirmationDialogResult> from ActionDialogBase.delayDismiss
The heading.
heading?: TranslatableString from ActionDialogBase.heading
Icon displayed in the heading.
icon?: string from ActionDialogBase.icon
The message.
message?: TranslatableString from ActionDialogBase.message
Parameters for the translate pipe.
translationParams?: Record<string, any> from ActionDialogBase.translationParams
type: "confirmation"
An action dialog for an edit/discard prompt.
Properties
Label of the cancel button.
cancelBtnName?: TranslatableString
Callback for delaying dismiss with a progress indicator until the returned Observable: Observable emits.
delayDismiss?: (result: EditDiscardDialogResult) => Observable<EditDiscardDialogResult> from ActionDialogBase.delayDismiss
Whether to disable the save button.
disableSave?: boolean
Label of the discard button when disableSave is set.
disableSaveDiscardBtnName?: TranslatableString
Message when disableSave is set.
disableSaveMessage?: TranslatableString
Label of the discard button.
discardBtnName?: TranslatableString
The heading.
heading?: TranslatableString from ActionDialogBase.heading
Icon displayed in the heading.
icon?: string from ActionDialogBase.icon
The message.
message?: TranslatableString from ActionDialogBase.message
Label of the save button.
saveBtnName?: TranslatableString
Parameters for the translate pipe.
translationParams?: Record<string, any> from ActionDialogBase.translationParams
type: "edit-discard"
An action dialog for a delete confirmation.
Properties
Label of the cancel button.
cancelBtnName?: TranslatableString
Callback for delaying dismiss with a progress indicator until the returned Observable: Observable emits.
delayDismiss?: (result: DeleteConfirmationDialogResult) => Observable<DeleteConfirmationDialogResult> from ActionDialogBase.delayDismiss
Label of the delete button.
deleteBtnName?: TranslatableString
The heading.
heading?: TranslatableString from ActionDialogBase.heading
Icon displayed in the heading.
icon?: string from ActionDialogBase.icon
The message.
message?: TranslatableString from ActionDialogBase.message
Parameters for the translate pipe.
translationParams?: Record<string, any> from ActionDialogBase.translationParams
type: "delete-confirm"
Properties
Optional environment Injector.
environmentInjector?: EnvironmentInjector
Optional element Injector.
injector?: Injector
Additional providers for the modal.
providers?: StaticProvider[]
{ Confirm: 'confirm', Decline: 'decline' } = ...
Variable
Deprecated: Will be removed in a future release. Use the string values directly.
{ Cancel: 'cancel', Delete: 'delete' } = ...
Variable
Deprecated: Will be removed in a future release. Use the string values directly.
{ Cancel: 'cancel', Discard: 'discard', Save: 'save' } = ...
Variable
Deprecated: Will be removed in a future release. Use the string values directly.
{ Confirm: 'confirm' } = ...
Variable
Deprecated: Will be removed in a future release. Use the string values directly.
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.
Translatable
import

Except where otherwise noted, content on this site is licensed under MIT License.