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:
parent
b97240963e
commit
d62b471afe
@ -186,7 +186,7 @@ class General extends Component
|
|||||||
}
|
}
|
||||||
$this->dispatch('success', 'Docker compose file loaded.');
|
$this->dispatch('success', 'Docker compose file loaded.');
|
||||||
$this->dispatch('compose_loaded');
|
$this->dispatch('compose_loaded');
|
||||||
$this->dispatch('refreshStorages');
|
$this->dispatch('refresh_storages');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->application->docker_compose_location = $this->initialDockerComposeLocation;
|
$this->application->docker_compose_location = $this->initialDockerComposeLocation;
|
||||||
$this->application->docker_compose_pr_location = $this->initialDockerComposePrLocation;
|
$this->application->docker_compose_pr_location = $this->initialDockerComposePrLocation;
|
||||||
|
@ -44,7 +44,7 @@ class FileStorage extends Component
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
$this->dispatch('storagesChanged');
|
$this->dispatch('refresh_storages');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function convertToFile() {
|
public function convertToFile() {
|
||||||
@ -57,7 +57,7 @@ class FileStorage extends Component
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
$this->dispatch('storagesChanged');
|
$this->dispatch('refresh_storages');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function delete() {
|
public function delete() {
|
||||||
@ -68,7 +68,7 @@ class FileStorage extends Component
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
$this->dispatch('storagesChanged');
|
$this->dispatch('refresh_storages');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
|
@ -12,7 +12,7 @@ class Storage extends Component
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'addNewVolume',
|
'addNewVolume',
|
||||||
'storagesChanged'=> '$refresh'
|
'refresh_storages' => '$refresh',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function addNewVolume($data)
|
public function addNewVolume($data)
|
||||||
@ -28,7 +28,7 @@ class Storage extends Component
|
|||||||
$this->resource->refresh();
|
$this->resource->refresh();
|
||||||
$this->dispatch('success', 'Storage added successfully');
|
$this->dispatch('success', 'Storage added successfully');
|
||||||
$this->dispatch('clearAddStorage');
|
$this->dispatch('clearAddStorage');
|
||||||
$this->dispatch('refreshStorages');
|
$this->dispatch('refresh_storages');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,5 @@ use Livewire\Component;
|
|||||||
class All extends Component
|
class All extends Component
|
||||||
{
|
{
|
||||||
public $resource;
|
public $resource;
|
||||||
protected $listeners = ['refreshStorages', 'storagesChanged' => '$refresh'];
|
protected $listeners = ['refresh_storages' => '$refresh'];
|
||||||
|
|
||||||
public function refreshStorages()
|
|
||||||
{
|
|
||||||
$this->resource->refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,6 @@ class Show extends Component
|
|||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$this->storage->delete();
|
$this->storage->delete();
|
||||||
$this->dispatch('refreshStorages');
|
$this->dispatch('refresh_storages');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user