Skip to content

Commit 41836bd

Browse files
use hds tooltip and remove custom tooltip component (#23441)
* use hds tooltip and remove custom tooltip component * fix lint issue
1 parent d428353 commit 41836bd

File tree

51 files changed

+167
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+167
-374
lines changed

ui/packages/consul-ui/app/components/composite-row/index.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@
6060
.consul-service-instance-list .detail {
6161
overflow-x: visible !important;
6262
}
63+
.consul-service-list .mesh,
64+
.consul-service-instance-list .mesh {
65+
gap: 8px;
66+
}
67+
.consul-service-list .mesh dt + dd,
68+
.consul-service-instance-list .mesh dt + dd {
69+
margin-left: 0;
70+
}
6371
.consul-intention-permission-list > ul {
6472
border-top: 1px solid var(--token-color-surface-interactive-active);
6573
}

ui/packages/consul-ui/app/components/consul-copy-button/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Button component used for copy-to-clipboard functionality so the user can easily copy specified text to their clipboard, along with tooltip-like notifications so the user has some sort of feedback to know the value has been copied.
44

5-
This component is essentially a composition of our `{{with-copyable}}` modifier, our `{{tooltip}}` modifier plus specific Consul-flavored visual treatment. This is all glued together with our `<StateChart />` component to manage states.
5+
This component is essentially a composition of our `{{with-copyable}}` modifier, the `{{hds-tooltip}}` modifier, plus specific Consul-flavored visual treatment. This is all glued together with our `<StateChart />` component to manage states.
66

77
Can be used inline to render only a small icon for the button with no other text.
88

ui/packages/consul-ui/app/components/consul-copy-button/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
aria-label={{t 'components.consul-copy-button.title' name=@name}}
1818
type="button"
1919
class="copy-btn"
20-
{{tooltip
20+
{{hds-tooltip
2121
(if (state-matches state 'success') (t 'components.consul-copy-button.success' name=@name) (t 'components.consul-copy-button.error'))
22-
options=(hash
22+
options=(detached-tooltip-options
2323
trigger='manual'
2424
showOnCreate=(not (state-matches state 'idle'))
2525
delay=(array 0 3000)

ui/packages/consul-ui/app/components/consul/acl/selector/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{#if (can "use acls")}}
88
<SNL.Title>{{t "components.hashicorp-consul.side-nav.acls.title"}}</SNL.Title>
99
{{else}}
10-
<SNL.Title {{tooltip (t "components.hashicorp-consul.side-nav.acls.tooltip")}}>
10+
<SNL.Title {{hds-tooltip (t "components.hashicorp-consul.side-nav.acls.tooltip") options=(detached-tooltip-options)}}>
1111
{{t "components.hashicorp-consul.side-nav.acls.title"}}
1212
</SNL.Title>
1313
{{/if}}

ui/packages/consul-ui/app/components/consul/auth-method/binding-list/index.hbs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@
99
<dt class="type">{{t "models.binding-rule.BindType"}}</dt>
1010
<dd>
1111
{{@item.BindType}}
12-
<span>
13-
{{#if (eq @item.BindType 'service')}}
14-
<Tooltip>
15-
{{t "components.consul.auth-method.binding-list.bind-type.service"}}
16-
</Tooltip>
17-
{{else if (eq @item.BindType 'node')}}
18-
<Tooltip>
19-
{{t "components.consul.auth-method.binding-list.bind-type.node"}}
20-
</Tooltip>
21-
{{else if (eq @item.BindType 'role')}}
22-
<Tooltip>
23-
{{t "components.consul.auth-method.binding-list.bind-type.role"}}
24-
</Tooltip>
12+
{{#let
13+
(if
14+
(eq @item.BindType 'service')
15+
(t "components.consul.auth-method.binding-list.bind-type.service")
16+
(if
17+
(eq @item.BindType 'node')
18+
(t "components.consul.auth-method.binding-list.bind-type.node")
19+
(if
20+
(eq @item.BindType 'role')
21+
(t "components.consul.auth-method.binding-list.bind-type.role")
22+
''
23+
)
24+
)
25+
)
26+
as |bindTypeTooltip|
27+
}}
28+
{{#if bindTypeTooltip}}
29+
<span {{hds-tooltip bindTypeTooltip options=(detached-tooltip-options)}}></span>
2530
{{/if}}
26-
</span>
31+
{{/let}}
2732
</dd>
2833
<dt>{{t "models.binding-rule.Selector"}}</dt>
2934
<dd><code>{{@item.Selector}}</code></dd>

ui/packages/consul-ui/app/components/consul/auth-method/list/index.hbs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
{{/if}}
3030
{{#if item.MaxTokenTTL}}
3131
<dl class="ttl">
32-
<dt>
33-
<Tooltip>
34-
Maximum Time to Live: the maximum life of any token created by this auth method
35-
</Tooltip>
32+
<dt {{hds-tooltip "Maximum Time to Live: the maximum life of any token created by this auth method" options=(detached-tooltip-options)}}>
33+
Maximum Time to Live
3634
</dt>
3735
<dd>{{item.MaxTokenTTL}}</dd>
3836
</dl>

ui/packages/consul-ui/app/components/consul/bucket/list/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{#if this.itemsToDisplay.length}}
77
<dl class="consul-bucket-list">
88
{{#each this.itemsToDisplay as |item|}}
9-
<dt class={{item.type}} {{tooltip}}>
9+
<dt class={{item.type}} {{hds-tooltip options=(detached-tooltip-options)}}>
1010
{{item.label}}
1111
</dt>
1212
<dd data-test-bucket-item={{item.type}}>

ui/packages/consul-ui/app/components/consul/discovery-chain/index.hbs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
{{@chain.ServiceName}}
2424
Router
2525
<span
26-
{{tooltip
26+
{{hds-tooltip
2727
'Use routers to intercept traffic using Layer 7 criteria such as path prefixes or http headers.'
28+
options=(detached-tooltip-options)
2829
}}
2930
>
3031
</span>
@@ -46,8 +47,9 @@
4647
<h2>
4748
Splitters
4849
<span
49-
{{tooltip
50+
{{hds-tooltip
5051
'Splitters are configured to split incoming requests across different services or subsets of a single service.'
52+
options=(detached-tooltip-options)
5153
}}
5254
>
5355
</span>
@@ -69,8 +71,9 @@
6971
<h2>
7072
Resolvers
7173
<span
72-
{{tooltip
74+
{{hds-tooltip
7375
'Resolvers are used to define which instances of a service should satisfy discovery requests.'
76+
options=(detached-tooltip-options)
7477
}}
7578
>
7679
</span>
@@ -133,9 +136,9 @@
133136
}}
134137

135138
<path
136-
{{tooltip
139+
{{hds-tooltip
137140
(concat (round (or item.Weight 0) decimals=2) '%')
138-
options=(hash followCursor=true)
141+
options=(detached-tooltip-options followCursor=true)
139142
}}
140143
tabindex='-1'
141144
id={{concat 'splitter:' splitter.Name '>' item.NextNode}}

ui/packages/consul-ui/app/components/consul/discovery-chain/resolver-card/index.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{{#if @item.Failover}}
1515
<dl class="failover">
1616
<dt
17-
{{tooltip (concat @item.Failover.Type ' failover')}}
17+
{{hds-tooltip (concat @item.Failover.Type ' failover') options=(detached-tooltip-options)}}
1818
>
1919
{{concat @item.Failover.Type ' failover'}}
2020
</dt>
@@ -41,7 +41,7 @@
4141
{{#if child.Redirect}}
4242
<dl class="redirect">
4343
<dt
44-
{{tooltip (concat child.Redirect ' redirect')}}
44+
{{hds-tooltip (concat child.Redirect ' redirect') options=(detached-tooltip-options)}}
4545
>
4646
{{child.Redirect}} redirect
4747
</dt>
@@ -52,7 +52,7 @@
5252
{{#if child.Failover}}
5353
<dl class="failover">
5454
<dt
55-
{{tooltip (concat child.Failover.Type ' failover')}}
55+
{{hds-tooltip (concat child.Failover.Type ' failover') options=(detached-tooltip-options)}}
5656
>
5757
{{child.Failover.Type}} failover
5858
</dt>
@@ -71,7 +71,7 @@
7171
{{child.Name}}
7272
<dl class="failover">
7373
<dt
74-
{{tooltip (concat child.Failover.Type ' failover')}}
74+
{{hds-tooltip (concat child.Failover.Type ' failover') options=(detached-tooltip-options)}}
7575
>
7676
{{concat child.Failover.Type ' failover'}}
7777
</dt>

ui/packages/consul-ui/app/components/consul/discovery-chain/route-card/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{{#if (gt @item.Definition.Match.HTTP.Header.length 0) }}
3030
<section class="match-headers">
3131
{{!-- template-lint-disable no-duplicate-landmark-elements --}}
32-
<header {{tooltip 'Header'}}>
32+
<header {{hds-tooltip 'Header' options=(detached-tooltip-options)}}>
3333
<h4>Headers</h4>
3434
</header>
3535
<dl>
@@ -47,7 +47,7 @@
4747
{{#if (gt @item.Definition.Match.HTTP.QueryParam.length 0) }}
4848
<section class="match-queryparams">
4949
{{!-- template-lint-disable no-duplicate-landmark-elements --}}
50-
<header {{tooltip 'Query Params'}}>
50+
<header {{hds-tooltip 'Query Params' options=(detached-tooltip-options)}}>
5151
<h4>Query Params</h4>
5252
</header>
5353
<dl>

0 commit comments

Comments
 (0)