fix: back navigation in global search resource selection (#7798)
This commit is contained in:
commit
4a4d64ac31
2 changed files with 40 additions and 4 deletions
|
|
@ -1336,6 +1336,42 @@ public function cancelResourceSelection()
|
|||
$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));
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ class="mt-2 bg-white dark:bg-coolgray-100 rounded-lg shadow-xl ring-1 ring-neutr
|
|||
<div class="mb-4" x-init="selectedIndex = -1">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<button type="button"
|
||||
@click="$wire.set('searchQuery', ''); setTimeout(() => $refs.searchInput.focus(), 100)"
|
||||
@click="$wire.goBack()"
|
||||
class="text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none"
|
||||
viewBox="0 0 24 24" stroke="currentColor">
|
||||
|
|
@ -398,7 +398,7 @@ class="p-3 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:bo
|
|||
<div class="mb-4" x-init="selectedIndex = -1">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<button type="button"
|
||||
@click="$wire.set('searchQuery', ''); setTimeout(() => $refs.searchInput.focus(), 100)"
|
||||
@click="$wire.goBack()"
|
||||
class="text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none"
|
||||
viewBox="0 0 24 24" stroke="currentColor">
|
||||
|
|
@ -467,7 +467,7 @@ class="p-3 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:bo
|
|||
<div class="mb-4" x-init="selectedIndex = -1">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<button type="button"
|
||||
@click="$wire.set('searchQuery', ''); setTimeout(() => $refs.searchInput.focus(), 100)"
|
||||
@click="$wire.goBack()"
|
||||
class="text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none"
|
||||
viewBox="0 0 24 24" stroke="currentColor">
|
||||
|
|
@ -542,7 +542,7 @@ class="p-3 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:bo
|
|||
<div class="mb-4" x-init="selectedIndex = -1">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<button type="button"
|
||||
@click="$wire.set('searchQuery', ''); setTimeout(() => $refs.searchInput.focus(), 100)"
|
||||
@click="$wire.goBack()"
|
||||
class="text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none"
|
||||
viewBox="0 0 24 24" stroke="currentColor">
|
||||
|
|
|
|||
Loading…
Reference in a new issue