Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

ApprovalRuleForm Container

Provides a form for creating or editing purchase order approval rules with validation and submission handling.

Version: 1.0.0-beta3

Configuration

The ApprovalRuleForm container provides the following configuration options:

ParameterTypeReq?Description
withHeaderbooleanNoWhen true, displays the header section. Set to false when embedding the container within a layout that provides its own header.
withWrapperbooleanNoWhen true, wraps the container in a styled wrapper. Set to false for custom styling or when the container is embedded within another styled component.
classNamestringNoAdditional CSS classes to apply to the container for custom styling.
approvalRuleIDstringNoThe unique identifier for the approval rule to display or manage. Required to fetch the correct data from the backend.
routeApprovalRulesListfunctionYesFunction to generate the URL for navigating to the approval rules list. Use to implement custom routing logic or add query parameters.
onSubmitfunctionNoCallback triggered when form is submitted. Use for custom success handling or navigation.
onChangefunctionNoCallback triggered when form values change. Use for real-time validation or tracking.

Slots

This container does not expose any customizable slots.

Usage

The following example demonstrates how to use the ApprovalRuleForm container:

import { render as provider } from '@dropins/storefront-purchase-order/render.js';
import { ApprovalRuleForm } from '@dropins/storefront-purchase-order/containers/ApprovalRuleForm.js';
await provider.render(ApprovalRuleForm, {
routeApprovalRulesList: routeApprovalRulesList,
withHeader: true,
withWrapper: true,
})(block);