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

View File

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