Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(ui): name the deepest menu on the resource menu row

Andras Bacsaia80f0c7ca875
diff --git a/DESIGN.md b/DESIGN.md
index c6b59b8601..6dd7dec361 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -312,7 +312,8 @@ Class names below are examples. Keep the values and structure.
- A menu that replaces another menu in place starts with a back row: a
centered label and a 12px left chevron (`‹ Dashboard`).
- On a resource page, the main menu starts with a row that opens the resource
- menu again. It points right and shows the resource name (`adonisjs ›`). On
+ menu again. It points right and shows the name of the deepest menu (`adonisjs ›`,
+ `Backup ›`). On
other pages the main menu has no row above its items, and Dashboard is the
first item, right under Search.
diff --git a/resources/views/components/backup-sidebar.blade.php b/resources/views/components/backup-sidebar.blade.php
index efa09f884a..2167e72ee7 100644
--- a/resources/views/components/backup-sidebar.blade.php
+++ b/resources/views/components/backup-sidebar.blade.php
@@ -51,7 +51,7 @@
};
@endphp
-<x-main-nav-menu :depth="1" :back-label="$parentMenu" :back-title="'Back to the '.strtolower($parentMenu).' menu'"
+<x-main-nav-menu :depth="1" :back-label="$parentMenu" :back-title="'Back to the '.strtolower($parentMenu).' menu'" name="Backup"
data-settings-search-items="{{ json_encode(settingsSearchItems(['Backup' => collect($items)->map(fn (array $item): array => [...$item, 'route' => $routes[$item['key']]])], $parameters)) }}">
<nav aria-label="Backup settings"
class="grid grid-cols-1 gap-0.5">
diff --git a/resources/views/components/service-database/sidebar.blade.php b/resources/views/components/service-database/sidebar.blade.php
index a8de58b734..3f5ad5b86b 100644
--- a/resources/views/components/service-database/sidebar.blade.php
+++ b/resources/views/components/service-database/sidebar.blade.php
@@ -3,7 +3,8 @@
'serviceDatabase',
])
-<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu">
+<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu"
+ :name="$serviceDatabase->human_name ?: $serviceDatabase->name">
<nav aria-label="Compose resource settings"
class="grid grid-cols-1 gap-0.5">
<a class="menu-item" data-page-only {{ wireNavigate() }}
diff --git a/resources/views/livewire/project/service/index.blade.php b/resources/views/livewire/project/service/index.blade.php
index ae90f356e8..d5ecebed02 100644
--- a/resources/views/livewire/project/service/index.blade.php
+++ b/resources/views/livewire/project/service/index.blade.php
@@ -11,7 +11,8 @@
@if (! $embedded && $resourceType === 'database')
<x-service-database.sidebar :parameters="$parameters" :serviceDatabase="$serviceDatabase" />
@elseif (! $embedded)
- <x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu">
+ <x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu"
+ :name="$serviceApplication->human_name ?: $serviceApplication->name">
<nav aria-label="Compose resource settings"
class="grid grid-cols-1 gap-0.5">
<a class="menu-item" data-page-only {{ wireNavigate() }}
diff --git a/tests/Feature/ResourceMenuInMainNavTest.php b/tests/Feature/ResourceMenuInMainNavTest.php
index c32903f7d4..09439c68f1 100644
--- a/tests/Feature/ResourceMenuInMainNavTest.php
+++ b/tests/Feature/ResourceMenuInMainNavTest.php
@@ -144,7 +144,7 @@ test('a database backup page keeps the database menu one back away in the main s
->toContain('x-teleport="#main-nav-context-1"')
->toMatch('#@click="navLevel = -1; navSwap = \'back\'"\s+title="Back to the main menu"#')
->toMatch('#@click="navLevel = 0; navSwap = \'back\'"\s+title="Back to the database menu"#')
- ->toContain('Back to the orders-db menu')
+ ->toContain('Back to the Backup menu')
->and(substr_count($html, 'aria-label="Database settings"'))->toBe(1)
->and(substr_count($html, 'aria-label="Backup settings"'))->toBe(2);
});