->modalFooterActions(function (Action $action) {
return [
$this->terminationRequiresReview() ? $this->submitTerminationForReviewAction($action) : $action->getModalSubmitAction(),
$action->getModalCancelAction(),
];
})
$this->submitTerminationForReviewAction(Action $parentAction): Action
{
return Action
->label('Submit for Review')
->requiresConfirmation()
->modalWidth(MaxWidth::ExtraLarge)
->modalHeading('Submit for Review')
->modalDescription('Are you sure you are ready to submit this action?')
->infolist([
ShoutEntry::make('review-alert')
->content('Once reviewed you will be notified of the results of the review and provided with instructions for next steps.'),
])
->action(function (Action $action) {
// need access to form data and it should be validated first like the normal submit action
$this->saveFormData();
$action->cancelParentActions();
});
}
->modalFooterActions(function (Action $action) {
return [
$this->terminationRequiresReview() ? $this->submitTerminationForReviewAction($action) : $action->getModalSubmitAction(),
$action->getModalCancelAction(),
];
})
$this->submitTerminationForReviewAction(Action $parentAction): Action
{
return Action
->label('Submit for Review')
->requiresConfirmation()
->modalWidth(MaxWidth::ExtraLarge)
->modalHeading('Submit for Review')
->modalDescription('Are you sure you are ready to submit this action?')
->infolist([
ShoutEntry::make('review-alert')
->content('Once reviewed you will be notified of the results of the review and provided with instructions for next steps.'),
])
->action(function (Action $action) {
// need access to form data and it should be validated first like the normal submit action
$this->saveFormData();
$action->cancelParentActions();
});
}