refactor: Update parse method in Advanced, All, ApplicationPreview, General, and ApplicationDeploymentJob classes

This commit is contained in:
Andras Bacsai
2024-08-29 12:39:37 +02:00
parent b8a37d897e
commit cfc6518157
9 changed files with 36 additions and 1103 deletions

View File

@@ -68,7 +68,7 @@ class Advanced extends Component
if ($this->application->settings->is_raw_compose_deployment_enabled) {
$this->application->oldRawParser();
} else {
$this->application->oldParser();
$this->application->parse();
}
$this->application->settings->save();
$this->dispatch('success', 'Settings saved.');

View File

@@ -131,7 +131,7 @@ class General extends Component
public function mount()
{
try {
$this->parsedServices = $this->application->oldParser();
$this->parsedServices = $this->application->parse();
if (is_null($this->parsedServices) || empty($this->parsedServices)) {
$this->dispatch('error', 'Failed to parse your docker-compose file. Please check the syntax and try again.');
@@ -204,7 +204,7 @@ class General extends Component
return;
}
$this->application->oldParser();
$this->application->parse();
$this->dispatch('success', 'Docker compose file loaded.');
$this->dispatch('compose_loaded');
$this->dispatch('refreshStorages');

View File

@@ -26,7 +26,7 @@ class All extends Component
$this->containerNames = $this->containerNames->merge($this->resource->databases()->pluck('name'));
} elseif ($this->resource->type() == 'application') {
if ($this->resource->build_pack === 'dockercompose') {
$parsed = $this->resource->oldParser();
$parsed = $this->resource->parse();
$containers = collect(data_get($parsed, 'services'))->keys();
$this->containerNames = $containers;
} else {