Refactor dispatch event names to use snake_case in General.php, FileStorage.php, Storage.php, All.php, and Show.php

This commit is contained in:
Andras Bacsai 2024-04-17 11:32:35 +02:00
parent b97240963e
commit d62b471afe
5 changed files with 8 additions and 13 deletions

View File

@ -186,7 +186,7 @@ public function loadComposeFile($isInit = false)
}
$this->dispatch('success', 'Docker compose file loaded.');
$this->dispatch('compose_loaded');
$this->dispatch('refreshStorages');
$this->dispatch('refresh_storages');
} catch (\Throwable $e) {
$this->application->docker_compose_location = $this->initialDockerComposeLocation;
$this->application->docker_compose_pr_location = $this->initialDockerComposePrLocation;

View File

@ -44,7 +44,7 @@ public function convertToDirectory() {
} catch (\Throwable $e) {
return handleError($e, $this);
} finally {
$this->dispatch('storagesChanged');
$this->dispatch('refresh_storages');
}
}
public function convertToFile() {
@ -57,7 +57,7 @@ public function convertToFile() {
} catch (\Throwable $e) {
return handleError($e, $this);
} finally {
$this->dispatch('storagesChanged');
$this->dispatch('refresh_storages');
}
}
public function delete() {
@ -68,7 +68,7 @@ public function delete() {
} catch (\Throwable $e) {
return handleError($e, $this);
} finally {
$this->dispatch('storagesChanged');
$this->dispatch('refresh_storages');
}
}
public function submit()

View File

@ -12,7 +12,7 @@ public function getListeners()
{
return [
'addNewVolume',
'storagesChanged'=> '$refresh'
'refresh_storages' => '$refresh',
];
}
public function addNewVolume($data)
@ -28,7 +28,7 @@ public function addNewVolume($data)
$this->resource->refresh();
$this->dispatch('success', 'Storage added successfully');
$this->dispatch('clearAddStorage');
$this->dispatch('refreshStorages');
$this->dispatch('refresh_storages');
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@ -7,10 +7,5 @@
class All extends Component
{
public $resource;
protected $listeners = ['refreshStorages', 'storagesChanged' => '$refresh'];
public function refreshStorages()
{
$this->resource->refresh();
}
protected $listeners = ['refresh_storages' => '$refresh'];
}

View File

@ -39,6 +39,6 @@ public function submit()
public function delete()
{
$this->storage->delete();
$this->dispatch('refreshStorages');
$this->dispatch('refresh_storages');
}
}