Skip to content

Commit bb3453d

Browse files
[UI] deprecation this property fallback into 1.21.x (#22928) (#22963)
[UI] deprecation this property fallback (#22928) * fixes some this property fallback issues * more fixes * fixes for all files * linter fixes * add changelog * Update 22928.txt * fix more issues * adds exception for refresh-route helper * linting fix * fixes an error * minor fix
1 parent 63eff41 commit bb3453d

File tree

125 files changed

+826
-811
lines changed

Some content is hidden

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

125 files changed

+826
-811
lines changed

.changelog/22928.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``release-note:improvement
2+
ui: use explicit @ and this for property names instead of allowing them to fallback automatically. Fixes deprecation to upgrade to Ember v4.
3+
```

ui/packages/consul-ui/.template-lintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ module.exports = {
2828
'style-concatenation': false,
2929
'link-rel-noopener': false,
3030

31-
'no-implicit-this': false,
31+
'no-implicit-this': {
32+
allow: ['refresh-route'],
33+
},
3234
'no-curly-component-invocation': false,
3335
'no-action': false,
3436
'no-negated-condition': false,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
SPDX-License-Identifier: BUSL-1.1
44
}}
55

6-
{{#let (hash main=(concat guid '-main') Notification=(component 'app/notification')) as |exported|}}
6+
{{#let (hash main=(concat this.guid '-main') Notification=(component 'app/notification')) as |exported|}}
77

88
<div class='app' ...attributes>
99
<ModalLayer />
1010

1111
{{yield exported to='side-nav'}}
12-
<main id={{concat guid '-main'}}>
12+
<main id={{concat this.guid '-main'}}>
1313
<div class='notifications'>
1414
{{yield exported to='notifications'}}
1515
<PortalTarget @name='app-notifications' @multiple={{true}} />

ui/packages/consul-ui/app/components/aria-menu/index.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
(action 'keypress')
99
(action 'keypressClick')
1010
(hash
11-
labelledBy=(concat 'component-aria-menu-trigger-' guid)
12-
controls=(concat 'component-aria-menu-menu-' guid)
13-
expanded=(if expanded 'true' undefined)
11+
labelledBy=(concat 'component-aria-menu-trigger-' this.guid)
12+
controls=(concat 'component-aria-menu-menu-' this.guid)
13+
expanded=(if this.expanded 'true' undefined)
1414
)
1515
}}

ui/packages/consul-ui/app/components/auth-dialog/index.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}}
55

66
<StateChart
7-
@src={{chart}}
7+
@src={{this.chart}}
88
as |State Guard Action dispatch state|>
99

1010
<Guard
@@ -24,7 +24,7 @@ as |State Guard Action dispatch state|>
2424
{{! token, whether thats a new token, a changed token or a deleted token }}
2525
<DataSource
2626
@src={{@src}}
27-
@onchange={{queue (action (mut token) value="data") (action dispatch "CHANGE") (action (mut previousToken) value="data")}}
27+
@onchange={{queue (action (mut this.token) value="data") (action dispatch "CHANGE") (action (mut this.previousToken) value="data")}}
2828
/>
2929
{{! This DataSink is just used for logging in from the form, }}
3030
{{! or logging out via the exposed logout function }}
@@ -35,7 +35,7 @@ as |State Guard Action dispatch state|>
3535
{{#let (hash
3636
login=(action sink.open)
3737
logout=(action sink.open null)
38-
token=token
38+
token=this.token
3939
) as |api|}}
4040

4141
<State @matches="authorized">

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@
44
}}
55

66
<div
7-
class="child-selector {{type}}-child-selector"
7+
class="child-selector {{this.type}}-child-selector"
88
{{fix-super-select-aria}}
99
...attributes
1010
>
1111
{{yield}}
12-
{{#if (not disabled)}}
12+
{{#if (not @disabled)}}
1313
<YieldSlot @name="create">{{yield}}</YieldSlot>
1414
<label class="type-text">
1515
<span><YieldSlot @name="label">{{yield}}</YieldSlot></span>
1616
{{!-- {{#if isOpen}} --}}
1717
<DataSource
1818
@src={{uri '/${partition}/${nspace}/${dc}/${type}'
1919
(hash
20-
partition=partition
21-
nspace=nspace
22-
dc=dc
23-
type=(pluralize type)
20+
partition=@partition
21+
nspace=@nspace
22+
dc=@dc
23+
type=(pluralize this.type)
2424
)
2525
}}
26-
@onchange={{action (mut allOptions) value="data"}}
26+
@onchange={{action (mut this.allOptions) value="data"}}
2727
/>
2828
{{!-- {{/if}} --}}
2929
<DataCollection
30-
@type={{type}}
30+
@type={{this.type}}
3131
@sort='Name:asc'
3232
@filters={{hash
3333
searchproperties=(array 'Name')
3434
}}
35-
@items={{options}}
35+
@items={{this.options}}
3636
as |collection|>
3737
<Hds::Form::SuperSelect::Single::Field
3838
@searchEnabled={{true}}
3939
@onFilter={{action collection.search}}
40-
@options={{sort-by 'Name:asc' options}}
41-
@placeholder={{placeholder}}
42-
@onChange={{action "change" "items[]" items}}
43-
@label="Select {{type}}"
40+
@options={{sort-by 'Name:asc' this.options}}
41+
@placeholder={{@placeholder}}
42+
@onChange={{action "change" "items[]" @items}}
43+
@label="Select {{this.type}}"
4444
@isOptional={{true}}
4545
@searchField="Name"
4646
as |F|>
@@ -49,7 +49,7 @@
4949
</DataCollection>
5050
</label>
5151
{{/if}}
52-
{{#if (gt items.length 0)}}
52+
{{#if (gt @items.length 0)}}
5353
<YieldSlot @name="set" @params={{block-params (action "remove")}}>{{yield}}</YieldSlot>
5454
{{else}}
5555

ui/packages/consul-ui/app/components/confirmation-dialog/index.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
SPDX-License-Identifier: BUSL-1.1
44
}}
55

6-
<div class={{concat "with-confirmation" (if confirming " confirming" "")}} ...attributes>
6+
<div class={{concat "with-confirmation" (if this.confirming " confirming" "")}} ...attributes>
77
{{yield}}
88
<YieldSlot @name="action" @params={{block-params (action "confirm") (action "cancel")}}>
9-
{{#if (or permanent (not confirming))}}
9+
{{#if (or this.permanent (not this.confirming))}}
1010
{{yield}}
1111
{{/if}}
1212
</YieldSlot>
13-
<YieldSlot @name="dialog" @params={{block-params (action "execute") (action "cancel") message actionName}}>
14-
{{#if confirming }}
13+
<YieldSlot @name="dialog" @params={{block-params (action "execute") (action "cancel") @message this.actionName}}>
14+
{{#if this.confirming }}
1515
{{yield}}
1616
{{/if}}
1717
</YieldSlot>

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
}}
55

66
<style>
7-
{{#if selected.nodes}}
8-
{{selected.nodes}}
7+
{{#if this.selected.nodes}}
8+
{{this.selected.nodes}}
99
{ opacity: 1 !important; background-color: var(--token-color-surface-interactive); border:
1010
var(--decor-border-100); border-radius: var(--decor-radius-200); border-color:
1111
var(--token-color-foreground-faint); box-shadow: var(--token-surface-high-box-shadow); }
1212
{{/if}}
13-
{{#if selected.edges}}
14-
{{selected.edges}}
13+
{{#if this.selected.edges}}
14+
{{this.selected.edges}}
1515
{ opacity: 1; }
1616
{{/if}}
1717
</style>
1818

1919
<div class='routes'>
2020
<header>
2121
<h2>
22-
{{chain.ServiceName}}
22+
{{@chain.ServiceName}}
2323
Router
2424
<span
2525
{{tooltip
@@ -30,7 +30,7 @@
3030
</h2>
3131
</header>
3232
<div role='group'>
33-
{{#each routes as |item|}}
33+
{{#each this.routes as |item|}}
3434
<Consul::DiscoveryChain::RouteCard
3535
{{on-resize (dom-position (set item 'rect') from=this.edges)}}
3636
@item={{item}}
@@ -53,7 +53,7 @@
5353
</h2>
5454
</header>
5555
<div role='group'>
56-
{{#each (sort-by 'Name' splitters) as |item|}}
56+
{{#each (sort-by 'Name' this.splitters) as |item|}}
5757
<Consul::DiscoveryChain::SplitterCard
5858
{{on-resize (dom-position (set item 'rect') from=this.edges)}}
5959
@item={{item}}
@@ -76,7 +76,7 @@
7676
</h2>
7777
</header>
7878
<div role='group'>
79-
{{#each (sort-by 'Name' resolvers) as |item|}}
79+
{{#each (sort-by 'Name' this.resolvers) as |item|}}
8080
<Consul::DiscoveryChain::ResolverCard
8181
{{on-resize (dom-position (set item 'rect') from=this.edges)}}
8282
@item={{item}}
@@ -87,7 +87,7 @@
8787
</div>
8888
</div>
8989

90-
{{nodes}}
90+
{{this.nodes}}
9191

9292
<svg
9393
class='edges'
@@ -96,7 +96,7 @@
9696
height='100%'
9797
preserveAspectRatio='none'
9898
>
99-
{{#each routes as |item|}}
99+
{{#each this.routes as |item|}}
100100
{{#if item.rect}}
101101
{{#let item.rect item.NextItem.rect as |src destRect|}}
102102
{{#let
@@ -117,7 +117,7 @@
117117
{{/if}}
118118
{{/each}}
119119

120-
{{#each splitters as |splitter|}}
120+
{{#each this.splitters as |splitter|}}
121121
{{#if splitter.rect}}
122122
{{#let splitter.rect as |src|}}
123123
{{#each splitter.Splits as |item index|}}
@@ -153,14 +153,14 @@
153153
</svg>
154154

155155
<svg class='resolver-inlets' height='100%'>
156-
{{#each routes as |item|}}
156+
{{#each this.routes as |item|}}
157157
{{#if (string-starts-with item.NextNode 'resolver:')}}
158158
{{#let (or item.NextItem.rect (hash y=0 height=0)) as |dest|}}
159159
<circle r='2.5' cx='5' cy={{add dest.y (div dest.height 2)}}></circle>
160160
{{/let}}
161161
{{/if}}
162162
{{/each}}
163-
{{#each splitters as |item|}}
163+
{{#each this.splitters as |item|}}
164164
{{#each item.Splits as |item|}}
165165
{{#let (or item.NextItem.rect (hash y=0 height=0)) as |dest|}}
166166
<circle r='2.5' cx='5' cy={{add dest.y (div dest.height 2)}}></circle>
@@ -170,7 +170,7 @@
170170
</svg>
171171

172172
<svg class='splitter-inlets' height='100%'>
173-
{{#each routes as |item|}}
173+
{{#each this.routes as |item|}}
174174
{{#if (string-starts-with item.NextNode 'splitter:')}}
175175
{{#let (or item.NextItem.rect (hash y=0 height=0)) as |dest|}}
176176
<circle r='2.5' cx='5' cy={{add dest.y (div dest.height 2)}}></circle>

0 commit comments

Comments
 (0)