disable tow step confirmation
This commit is contained in:
@@ -22,18 +22,23 @@
|
|||||||
'dispatchEventMessage' => '',
|
'dispatchEventMessage' => '',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@php
|
||||||
|
$settings = instanceSettings();
|
||||||
|
$disableTwoStepConfirmation = $settings->disable_two_step_confirmation ?? false;
|
||||||
|
@endphp
|
||||||
|
|
||||||
<div x-data="{
|
<div x-data="{
|
||||||
modalOpen: false,
|
modalOpen: false,
|
||||||
step: {{ empty($checkboxes) ? 2 : 1 }},
|
step: {{ empty($checkboxes) ? 2 : 1 }},
|
||||||
initialStep: {{ empty($checkboxes) ? 2 : 1 }},
|
initialStep: {{ empty($checkboxes) ? 2 : 1 }},
|
||||||
finalStep: {{ $confirmWithPassword ? 3 : 2 }},
|
finalStep: {{ $confirmWithPassword && !$disableTwoStepConfirmation ? 3 : 2 }},
|
||||||
deleteText: '',
|
deleteText: '',
|
||||||
password: '',
|
password: '',
|
||||||
actions: @js($actions),
|
actions: @js($actions),
|
||||||
confirmationText: @js($confirmationText),
|
confirmationText: @js($confirmationText),
|
||||||
userConfirmationText: '',
|
userConfirmationText: '',
|
||||||
confirmWithText: @js($confirmWithText),
|
confirmWithText: @js($confirmWithText && !$disableTwoStepConfirmation),
|
||||||
confirmWithPassword: @js($confirmWithPassword),
|
confirmWithPassword: @js($confirmWithPassword && !$disableTwoStepConfirmation),
|
||||||
copied: false,
|
copied: false,
|
||||||
submitAction: @js($submitAction),
|
submitAction: @js($submitAction),
|
||||||
passwordError: '',
|
passwordError: '',
|
||||||
@@ -41,6 +46,7 @@
|
|||||||
dispatchEvent: @js($dispatchEvent),
|
dispatchEvent: @js($dispatchEvent),
|
||||||
dispatchEventType: @js($dispatchEventType),
|
dispatchEventType: @js($dispatchEventType),
|
||||||
dispatchEventMessage: @js($dispatchEventMessage),
|
dispatchEventMessage: @js($dispatchEventMessage),
|
||||||
|
disableTwoStepConfirmation: @js($disableTwoStepConfirmation),
|
||||||
resetModal() {
|
resetModal() {
|
||||||
this.step = this.initialStep;
|
this.step = this.initialStep;
|
||||||
this.deleteText = '';
|
this.deleteText = '';
|
||||||
@@ -222,6 +228,7 @@
|
|||||||
</template>
|
</template>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
@if (!$disableTwoStepConfirmation)
|
||||||
@if ($confirmWithText)
|
@if ($confirmWithText)
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
|
<h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
|
||||||
@@ -259,9 +266,11 @@
|
|||||||
class="p-2 mt-1 w-full text-black rounded input">
|
class="p-2 mt-1 w-full text-black rounded input">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Step 3: Password confirmation -->
|
<!-- Step 3: Password confirmation -->
|
||||||
|
@if (!$disableTwoStepConfirmation)
|
||||||
<div x-show="step === 3 && confirmWithPassword">
|
<div x-show="step === 3 && confirmWithPassword">
|
||||||
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
|
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
|
||||||
<p class="font-bold">Final Confirmation</p>
|
<p class="font-bold">Final Confirmation</p>
|
||||||
@@ -282,6 +291,7 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<!-- Navigation buttons -->
|
<!-- Navigation buttons -->
|
||||||
<div class="flex flex-wrap gap-2 justify-between mt-4">
|
<div class="flex flex-wrap gap-2 justify-between mt-4">
|
||||||
@@ -304,8 +314,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="step === 2">
|
<template x-if="step === 2">
|
||||||
<x-forms.button x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText"
|
<x-forms.button
|
||||||
class="w-auto" isError
|
x-bind:disabled="!disableTwoStepConfirmation && confirmWithText && userConfirmationText !== confirmationText"
|
||||||
|
class="w-auto"
|
||||||
|
isError
|
||||||
@click="
|
@click="
|
||||||
if (dispatchEvent) {
|
if (dispatchEvent) {
|
||||||
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
||||||
@@ -316,11 +328,14 @@
|
|||||||
modalOpen = false;
|
modalOpen = false;
|
||||||
resetModal();
|
resetModal();
|
||||||
submitForm();
|
submitForm();
|
||||||
}">
|
}
|
||||||
<span x-text="step2ButtonText"></span>
|
"
|
||||||
|
>
|
||||||
|
<span x-text="disableTwoStepConfirmation ? 'Permanently Delete' : step2ButtonText"></span>
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@if (!$disableTwoStepConfirmation)
|
||||||
<template x-if="step === 3 && confirmWithPassword">
|
<template x-if="step === 3 && confirmWithPassword">
|
||||||
<x-forms.button x-bind:disabled="!password" class="w-auto" isError
|
<x-forms.button x-bind:disabled="!password" class="w-auto" isError
|
||||||
@click="
|
@click="
|
||||||
@@ -339,6 +354,7 @@
|
|||||||
<span x-text="step3ButtonText"></span>
|
<span x-text="step3ButtonText"></span>
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</template>
|
</template>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user