ui: Wrap service names on show and instance routes (#14771)

* Wrap service names on show and instance routes
Moves the trailing type/kind/actions to the second row of the header
no matter what length the service name is. Wraps service name text.

* Change grid format of AppView globally

* Add tooltips to the last element of breadcrumbs
This commit is contained in:
Tyler Wendlandt 2022-10-05 13:21:34 -06:00 committed by GitHub
parent bca6f8ae4a
commit 734be3fa11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 23 deletions

View File

@ -13,14 +13,16 @@
</YieldSlot>
</nav>
<div class="title">
<YieldSlot @name="header">
{{yield}}
</YieldSlot>
<div class="actions">
<YieldSlot @name="actions">
<PortalTarget @name="app-view-actions" />
<div class="title-left-container">
<YieldSlot @name="header">
{{yield}}
</YieldSlot>
</YieldSlot>
</div>
<div class="actions">
<YieldSlot @name="actions">
<PortalTarget @name="app-view-actions" />
{{yield}}
</YieldSlot>
</div>
</div>
<YieldSlot @name="nav">

View File

@ -10,6 +10,9 @@
%app-view-header .title {
@extend %app-view-title;
}
%app-view-title .title-left-container {
@extend %app-view-title-left-container;
}
%app-view-header .actions {
@extend %app-view-actions;
}

View File

@ -1,25 +1,38 @@
/* layout */
%app-view-title {
display: flex;
align-items: center;
white-space: nowrap;
display: grid;
grid-template-columns: 1fr auto;
grid-template-areas: "title actions";
position: relative;
z-index: 5;
}
%app-view-title-left-container {
grid-area: title;
display: flex;
flex-wrap: wrap;
align-items: center;
white-space: normal;
}
%app-view-title-left-container > :first-child {
flex-basis: 100%;
}
%app-view-title-left-container > :not(:first-child) {
margin-right: 8px;
}
%app-view-actions {
grid-area: actions;
align-self: end;
display: flex;
align-items: flex-start;
margin-left: auto;
margin-top: 9px;
}
/* units */
%app-view-title {
padding-bottom: 0.2em;
}
%app-view-title > :not(:last-child) {
margin-right: 8px;
}
%app-view-actions {
margin-top: 9px;
padding-bottom: 1.4em;
}
/* content */

View File

@ -1,4 +1,4 @@
%app-view-title > *:first-child {
%app-view-title-left-container > *:first-child {
@extend %h100;
}
%app-view-title {

View File

@ -1,6 +1,14 @@
%breadcrumbs {
display: grid;
grid-auto-flow: column;
white-space: nowrap;
overflow: hidden;
}
%breadcrumbs > li {
list-style-type: none;
display: inline-flex;
overflow: hidden
}
%breadcrumb-milestone::before {
margin-right: 4px;
@ -10,6 +18,8 @@
/* as the separator is a '/' the left margin needs */
/* to be different from the right in order to center it */
margin-left: 6px;
overflow: hidden;
text-overflow: ellipsis;
}
%breadcrumb::before {
margin-right: 8px;

View File

@ -63,6 +63,7 @@ as |parts|}}
{{! We push on a '' here so make sure we get a trailing slash/separator }}
<li>
<Action
{{action breadcrumb}}
@href={{href-to 'dc.kv.folder'
(join '/'
(append
@ -149,4 +150,4 @@ as |parts|}}
</DataLoader>
{{/let}}
{{/let}}
</Route>
</Route>

View File

@ -108,7 +108,7 @@ as |sort filters parent items|}}
<ol>
<li><a href={{href-to 'dc.kv'}}>Key / Values</a></li>
{{#each (slice 0 -2 (split parent.Key '/')) as |breadcrumb index|}}
<li><a href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li>
<li><a {{tooltip breadcrumb}} href={{href-to 'dc.kv.folder' (join '/' (append (slice 0 (add index 1) (split parent.Key '/')) ''))}}>{{breadcrumb}}</a></li>
{{/each}}
</ol>
</BlockSlot>
@ -207,4 +207,4 @@ as |sort filters parent items|}}
{{/let}}
</BlockSlot>
</DataLoader>
</Route>
</Route>

View File

@ -129,7 +129,9 @@ as |item|}}
<BlockSlot @name="breadcrumbs">
<ol>
<li><a href={{href-to 'dc.services' params=(hash peer=undefined)}}>All Services</a></li>
<li><a data-test-back href={{href-to 'dc.services.show'}}>Service ({{item.Service.Service}})</a></li>
<li><a {{tooltip (concat "Service (" item.Service.Service ")")}} data-test-back href={{href-to 'dc.services.show'}}>
Service ({{item.Service.Service}})
</a></li>
</ol>
</BlockSlot>
<BlockSlot @name="header">
@ -192,4 +194,4 @@ as |item|}}
{{/let}}
</BlockSlot>
</DataLoader>
</Route>
</Route>