mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix: back navigation in global search resource selection
Add smart goBack() method that skips auto-selected steps and returns to the last step where user had a real choice. This prevents navigation loops when previous steps only have a single option and auto-select. Fixes #7739 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1336,6 +1336,42 @@ class GlobalSearch extends Component
|
||||
$this->autoOpenResource = null;
|
||||
}
|
||||
|
||||
public function goBack()
|
||||
{
|
||||
// From Environment Selection → go back to Project (if multiple) or further
|
||||
if ($this->selectedProjectUuid !== null) {
|
||||
$this->selectedProjectUuid = null;
|
||||
$this->selectedEnvironmentUuid = null;
|
||||
if (count($this->availableProjects) > 1) {
|
||||
return; // Stop here - user can choose a project
|
||||
}
|
||||
}
|
||||
|
||||
// From Project Selection → go back to Destination (if multiple) or further
|
||||
if ($this->selectedDestinationUuid !== null) {
|
||||
$this->selectedDestinationUuid = null;
|
||||
$this->selectedProjectUuid = null;
|
||||
$this->selectedEnvironmentUuid = null;
|
||||
if (count($this->availableDestinations) > 1) {
|
||||
return; // Stop here - user can choose a destination
|
||||
}
|
||||
}
|
||||
|
||||
// From Destination Selection → go back to Server (if multiple) or cancel
|
||||
if ($this->selectedServerId !== null) {
|
||||
$this->selectedServerId = null;
|
||||
$this->selectedDestinationUuid = null;
|
||||
$this->selectedProjectUuid = null;
|
||||
$this->selectedEnvironmentUuid = null;
|
||||
if (count($this->availableServers) > 1) {
|
||||
return; // Stop here - user can choose a server
|
||||
}
|
||||
}
|
||||
|
||||
// All previous steps were auto-selected, cancel entirely
|
||||
$this->cancelResourceSelection();
|
||||
}
|
||||
|
||||
public function getFilteredCreatableItemsProperty()
|
||||
{
|
||||
$query = strtolower(trim($this->searchQuery));
|
||||
|
||||
Reference in New Issue
Block a user