Actions Confirmation

Edit on GitHub

Actions Confirmation is an angular Service in the components library that calls another action with a confirmation via the Modal component.


Service configuration:

type An action type.
action Registered action configuration.
modal Modal configuration based on the ConfirmModalStrategyOptions interface of the Modal component.

Usage example:

        type: 'confirmation',
        action: {
            type: 'redirect',
            url: '/url',
        modal: {
            description: 'Redirect to /url',

Service registration

Register the service:

declare module '@spryker/actions' {
    interface ActionsRegistry {
        confirmation: ConfirmationActionHandlerService,

    imports: [
            confirmation: ConfirmationActionHandlerService,
export class RootModule {}


Actions Confirmation interfaces:

export interface ConfirmationActionConfig extends ActionConfig {
    action: ActionConfig;
    modal?: ConfirmModalStrategyOptions;

export interface ConfirmModalStrategyOptions extends ConfirmModalData {}

export interface ConfirmModalData {
    title?: string | TemplateRef<ModalTemplateContext<AnyModal>>;
    description?: string | TemplateRef<ModalTemplateContext<AnyModal>>;
    icon?: string | TemplateRef<ModalTemplateContext<AnyModal>>;
    okText?: string | TemplateRef<ModalTemplateContext<AnyModal>>;
    okType?: string;
    okVariant?: ButtonVariant;
    okSize?: ButtonSize;
    cancelText?: string | TemplateRef<ModalTemplateContext<AnyModal>>;
    cancelType?: string;
    cancelVariant?: ButtonVariant;
    cancelSize?: ButtonSize;
    class?: string;