fix preselect environment if there is only one
This commit is contained in:
parent
e776302a25
commit
b1dc8dec88
2 changed files with 18 additions and 0 deletions
|
|
@ -52,6 +52,15 @@ public function loadDeployments()
|
|||
|
||||
public function navigateToProject($projectUuid)
|
||||
{
|
||||
$project = Project::where('uuid', $projectUuid)->first();
|
||||
|
||||
if ($project && $project->environments->count() === 1) {
|
||||
return Redirect::route('project.resource.index', [
|
||||
'project_uuid' => $projectUuid,
|
||||
'environment_uuid' => $project->environments->first()->uuid,
|
||||
]);
|
||||
}
|
||||
|
||||
return Redirect::route('project.show', ['project_uuid' => $projectUuid]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,15 @@ public function render()
|
|||
|
||||
public function navigateToProject($projectUuid)
|
||||
{
|
||||
$project = Project::where('uuid', $projectUuid)->first();
|
||||
|
||||
if ($project && $project->environments->count() === 1) {
|
||||
return Redirect::route('project.resource.index', [
|
||||
'project_uuid' => $projectUuid,
|
||||
'environment_uuid' => $project->environments->first()->uuid,
|
||||
]);
|
||||
}
|
||||
|
||||
return Redirect::route('project.show', ['project_uuid' => $projectUuid]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue