ui: Add conditionals to Lock Session list items (#10121)

* Add conditionals to Lock Session list items

* Add changelog

* Show ID in details if there is a name to go in title

* Add copy-button if ID is in the title

* Update TTL conditional

* Update .changelog/10121.txt

Co-authored-by: John Cowen <johncowen@users.noreply.github.com>

Co-authored-by: John Cowen <johncowen@users.noreply.github.com>
This commit is contained in:
Kenia 2021-05-11 11:35:15 -04:00 committed by GitHub
parent ff3abc3b48
commit 7103f9f44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

3
.changelog/10121.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Add conditionals to lock sessions tab
```

View File

@ -1,9 +1,20 @@
{{#if (gt items.length 0)}} {{#if (gt items.length 0)}}
<ListCollection @items={{items}} class="consul-lock-session-list" as |item index|> <ListCollection @items={{items}} class="consul-lock-session-list" as |item index|>
<BlockSlot @name="header"> <BlockSlot @name="header">
{{#if item.Name}}
<span>{{item.Name}}</span> <span>{{item.Name}}</span>
{{else}}
<span>
{{item.ID}}
<CopyButton
@value={{item.ID}}
@name="ID"
/>
</span>
{{/if}}
</BlockSlot> </BlockSlot>
<BlockSlot @name="details"> <BlockSlot @name="details">
{{#if item.Name}}
<dl> <dl>
<dt> <dt>
<CopyButton <CopyButton
@ -13,6 +24,7 @@
</dt> </dt>
<dd>{{item.ID}}</dd> <dd>{{item.ID}}</dd>
</dl> </dl>
{{/if}}
<dl class="lock-delay"> <dl class="lock-delay">
<dt> <dt>
<Tooltip> <Tooltip>
@ -27,7 +39,11 @@
TTL TTL
</Tooltip> </Tooltip>
</dt> </dt>
{{#if (eq item.TTL "")}}
<dd data-test-session-ttl={{item.TTL}}>-</dd>
{{else}}
<dd data-test-session-ttl={{item.TTL}}>{{item.TTL}}</dd> <dd data-test-session-ttl={{item.TTL}}>{{item.TTL}}</dd>
{{/if}}
</dl> </dl>
<dl class="behavior"> <dl class="behavior">
<dt> <dt>

View File

@ -57,7 +57,6 @@
margin-left: 4px; margin-left: 4px;
} }
%composite-row-detail .copy-button { %composite-row-detail .copy-button {
margin-right: 4px;
margin-top: 2px; margin-top: 2px;
} }
%composite-row .copy-button button { %composite-row .copy-button button {