Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

WIP more delete confirmations

ayntk-ai9136d7acdc45
diff --git a/app/Livewire/Project/DeleteEnvironment.php b/app/Livewire/Project/DeleteEnvironment.php
index 22478916f6..e01741770a 100644
--- a/app/Livewire/Project/DeleteEnvironment.php
+++ b/app/Livewire/Project/DeleteEnvironment.php
@@ -13,9 +13,12 @@ class DeleteEnvironment extends Component
public bool $disabled = false;
+ public string $environmentName = '';
+
public function mount()
{
$this->parameters = get_route_parameters();
+ $this->environmentName = Environment::findOrFail($this->environment_id)->name;
}
public function delete()
diff --git a/app/Livewire/Project/DeleteProject.php b/app/Livewire/Project/DeleteProject.php
index 499b86e3e5..360fad10a8 100644
--- a/app/Livewire/Project/DeleteProject.php
+++ b/app/Livewire/Project/DeleteProject.php
@@ -13,9 +13,12 @@ class DeleteProject extends Component
public bool $disabled = false;
+ public string $projectName = '';
+
public function mount()
{
$this->parameters = get_route_parameters();
+ $this->projectName = Project::findOrFail($this->project_id)->name;
}
public function delete()
diff --git a/resources/views/livewire/project/delete-environment.blade.php b/resources/views/livewire/project/delete-environment.blade.php
index 30b8235da3..956ecb92e5 100644
--- a/resources/views/livewire/project/delete-environment.blade.php
+++ b/resources/views/livewire/project/delete-environment.blade.php
@@ -1,3 +1,14 @@
-<x-modal-confirmation isErrorButton buttonTitle="Delete Environment" disabled="{{ $disabled }}">
- This environment will be deleted. It is not reversible. <br>Please think again.
+<x-modal-confirmation
+ title="Confirm Delete Environment?"
+ buttonTitle="Delete Environment"
+ isErrorButton
+ action="delete_environment"
+ :actions="['This will delete the selected environment.']"
+ confirmationLabel="Please confirm the execution of the actions by entering the Environment Name below"
+ shortConfirmationLabel="Environment Name"
+ submitAction="delete_environment"
+ buttonTitle="Delete Environment"
+ confirmText="{{ $environmentName }}"
+ step3ButtonText="Permanently Delete Environment"
+>
</x-modal-confirmation>
diff --git a/resources/views/livewire/project/delete-project.blade.php b/resources/views/livewire/project/delete-project.blade.php
index b49ab40330..b8e996f56d 100644
--- a/resources/views/livewire/project/delete-project.blade.php
+++ b/resources/views/livewire/project/delete-project.blade.php
@@ -1,3 +1,13 @@
-<x-modal-confirmation isErrorButton buttonTitle="Delete Project" disabled="{{ $disabled }}">
- This project will be deleted. It is not reversible. <br>Please think again.
-</x-modal-confirmation>
+<x-modal-confirmation
+ title="Confirm Project Deletion?"
+ buttonTitle="Delete Project"
+ isErrorButton
+ action="delete_project"
+ :actions="['This will delete the selected project.']"
+ confirmationLabel="Please confirm the execution of the actions by entering the Project Name below"
+ shortConfirmationLabel="Project Name"
+ submitAction="delete_project"
+ buttonTitle="Delete Project"
+ confirmText="{{ $projectName }}"
+ step3ButtonText="Permanently Delete Project"
+/>