From 33aa5a5114b1d56d6be1e711ae5300c6a983c861 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 30 Sep 2025 10:51:33 +0100 Subject: [PATCH 1/3] Ability to use your own Vue component in action confirmation modal Instead of the built-in confirmation text stuff. Might be useful for our fieldset deletion flow. --- .../components/actions/ConfirmableAction.vue | 41 +++++++++++-------- src/Actions/Action.php | 7 ++++ 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/resources/js/components/actions/ConfirmableAction.vue b/resources/js/components/actions/ConfirmableAction.vue index b610546e62d..74b33c19d97 100644 --- a/resources/js/components/actions/ConfirmableAction.vue +++ b/resources/js/components/actions/ConfirmableAction.vue @@ -95,25 +95,32 @@ defineExpose({ @confirm="confirmed" @cancel="reset" > - -
- -
+ icon ?? ''; } + public function component(): ?string + { + return $this->component; + } + public function buttonText() { /** @translation */ @@ -135,6 +141,7 @@ public function toArray() 'handle' => $this->handle(), 'title' => $this->title(), 'icon' => $this->icon(), + 'component' => $this->component(), 'confirm' => $this->confirm, 'buttonText' => $this->buttonText(), 'confirmationText' => $this->confirmationText(), From 6f4a540628cbbe3191aad3b36c996e000f3e241f Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 30 Sep 2025 10:57:38 +0100 Subject: [PATCH 2/3] Ability to hide "Run action" button in action modal --- resources/js/components/actions/ConfirmableAction.vue | 1 + resources/js/components/modals/ConfirmationModal.vue | 7 ++++++- src/Actions/Action.php | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/resources/js/components/actions/ConfirmableAction.vue b/resources/js/components/actions/ConfirmableAction.vue index 74b33c19d97..44b6af8b087 100644 --- a/resources/js/components/actions/ConfirmableAction.vue +++ b/resources/js/components/actions/ConfirmableAction.vue @@ -90,6 +90,7 @@ defineExpose({ v-if="confirming" :title="action.title" :danger="action.dangerous" + :submittable="action.runnable" :buttonText="runButtonText" :busy="running" @confirm="confirmed" diff --git a/resources/js/components/modals/ConfirmationModal.vue b/resources/js/components/modals/ConfirmationModal.vue index 4213c5acb22..a93c064822d 100644 --- a/resources/js/components/modals/ConfirmationModal.vue +++ b/resources/js/components/modals/ConfirmationModal.vue @@ -19,6 +19,10 @@ const props = defineProps({ type: Boolean, default: true, }, + submittable: { + type: Boolean, + default: true, + }, cancelText: { type: String, default: () => __('Cancel'), @@ -72,7 +76,7 @@ function submit() {

{{ __('Are you sure?') }}

-