forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info-table-row.hbs
81 lines (81 loc) · 2.54 KB
/
info-table-row.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{{#if (or alwaysRender value)}}
<div class="column is-one-quarter" data-test-label-div>
{{#if label}}
<span class="is-label has-text-grey-dark" data-test-row-label="{{label}}">{{label}}</span>
{{#if helperText}}
<div>
<span class="is-label helper-text has-text-grey">{{helperText}}</span>
</div>
{{/if}}
{{else}}
<Icon @size="s" @glyph="minus-plain"/>
{{/if}}
</div>
<div class="column is-flex" data-test-value-div="{{label}}">
{{#if (has-block)}}
{{yield}}
{{else if valueIsBoolean}}
{{#if value}}
<Icon
aria-hidden="true"
class="icon-true"
@size="l"
@glyph="check-circle-outline"
data-test-boolean-true
/> Yes
{{else}}
<Icon
aria-hidden="true"
class="icon-false"
@size="l"
@glyph="cancel-square-outline"
/> No
{{/if}}
{{!-- alwaysRender is still true --}}
{{else if (and (not value) defaultShown)}}
<span data-test-row-value="{{label}}">{{defaultShown}}</span>
{{else if valueIsEmpty}}
<Icon @size="s" @glyph="minus-plain"/>
{{else}}
{{#if (eq type 'array')}}
<InfoTableItemArray
@backend={{backend}}
@displayArray={{value}}
@isLink={{isLink}}
@label={{label}}
@modelType={{modelType}}
@queryParam={{queryParam}}
@viewAll={{viewAll}}
@wildcardLabel={{wildcardLabel}}
/>
{{else}}
{{#if tooltipText}}
<ToolTip
@verticalPosition="above"
@horizontalPosition="left"
as |T|>
<T.trigger @tabindex=false>
<code class="is-word-break has-text-black" data-test-row-value="{{label}}">{{value}}</code>
</T.trigger>
<T.content @class="tool-tip">
<CopyButton
@clipboardText={{tooltipText}}
@success={{action (set-flash-message 'Data copied!')}}
@tagName="div"
@disabled={{not this.isTooltipCopyable}}
class={{if this.isTooltipCopyable "has-pointer"}}
data-test-tooltip-copy
>
<div class="box">
{{tooltipText}}
</div>
</CopyButton>
</T.content>
</ToolTip>
{{else}}
<code class="is-word-break has-text-black" data-test-row-value="{{label}}">{{value}}</code>
{{/if}}
{{/if}}
{{/if}}
</div>
{{/if}}