Skip to content

Commit 335b379

Browse files
UI/ember upgrade to v4.12 (#23070)
* all tests fixed * code cleanup * fix minor issue * adds changelog * remove redundant fn usage * fixes assert equal issues * ppnpm lock update * avoid crashing on error * fixes lint issue * revert * test change * fix torii provider baseUrl assertion without changing SSO flow * linting fix * route import change * minor fixes * added required parameter @type to hds:alert * fixes some browser error logs * lint fixes
1 parent 45c9d68 commit 335b379

File tree

238 files changed

+3615
-5878
lines changed

Some content is hidden

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

238 files changed

+3615
-5878
lines changed

.changelog/23070.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: upgraded Ember framework from v3.28 to v4.12, improving performance and stability. Upgrades multiple other packages which support Ember v4.
3+
```

ui/packages/consul-lock-sessions/app/components/consul/lock-session/form/index.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
dc=@item.Datacenter
1818
)
1919
}}
20-
@type={{'session'}}
21-
@label={{'Lock Session'}}
20+
@type='session'
21+
@label='Lock Session'
2222
@ondelete={{fn (if @ondelete @ondelete @onsubmit) @item}}
2323
@onchange={{fn (optional @onsubmit) @item}}
2424
as |writer|>
@@ -86,7 +86,7 @@
8686
@text='Invalidate Session'
8787
@color='critical'
8888
data-test-delete
89-
{{on 'click' (fn confirm )}}
89+
{{on 'click' confirm }}
9090
/>
9191
</BlockSlot>
9292
<BlockSlot @name="dialog" as |execute cancel message|>
@@ -103,7 +103,7 @@
103103
<Hds::Button
104104
@text='Cancel'
105105
@color='secondary'
106-
{{on 'click' (fn cancel)}}
106+
{{on 'click' cancel}}
107107
/>
108108
</Hds::ButtonSet>
109109
</BlockSlot>

ui/packages/consul-lock-sessions/app/components/consul/lock-session/list/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ as |item index|>
107107
<Hds::Button
108108
@text='Cancel'
109109
@color='secondary'
110-
{{on 'click' (fn cancel)}}
110+
{{on 'click' cancel}}
111111
/>
112112
</Hds::ButtonSet>
113113
</BlockSlot>

ui/packages/consul-nspaces/app/components/consul/nspace/form/index.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"/${partition}/${nspace}/${dc}/nspace"
1010
(hash partition="" nspace="" dc=@item.Datacenter)
1111
}}
12-
@type={{"nspace"}}
13-
@label={{"Namespace"}}
12+
@type="nspace"
13+
@label="Namespace"
1414
@ondelete={{fn this.onDelete @item}}
1515
@onchange={{fn this.onSubmit @item}}
1616
as |writer|
@@ -145,7 +145,7 @@
145145
data-test-delete
146146
@color='critical'
147147
@text='Delete'
148-
{{on "click" (fn confirm )}}
148+
{{on "click" confirm }}
149149
/>
150150
</BlockSlot>
151151
<BlockSlot @name="dialog" as |execute cancel message|>

ui/packages/consul-nspaces/app/templates/dc/nspaces/edit.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}}
55

66
<Route
7-
@name={{routeName}}
7+
@name={{this.routeName}}
88
as |route|>
99
<DataLoader @src={{
1010
uri '/${partition}/${nspace}/${dc}/namespace/${id}'

ui/packages/consul-nspaces/app/templates/dc/nspaces/index.hbs

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

66
<Route
7-
@name={{routeName}}
7+
@name={{this.routeName}}
88
as |route|>
99
<DataLoader
1010
@src={{
@@ -27,18 +27,18 @@ as |route|>
2727
{{#let
2828

2929
(hash
30-
value=(or sortBy "Name:asc")
31-
change=(action (mut sortBy) value="target.selected")
30+
value=(or this.sortBy "Name:asc")
31+
change=(action (mut this.sortBy) value="target.selected")
3232
)
3333

3434
(hash
3535
searchproperty=(hash
36-
value=(if (not-eq searchproperty undefined)
37-
(split searchproperty ',')
38-
searchProperties
36+
value=(if (not-eq this.searchproperty undefined)
37+
(split this.searchproperty ',')
38+
this.searchProperties
3939
)
40-
change=(action (mut searchproperty) value="target.selectedItems")
41-
default=searchProperties
40+
change=(action (mut this.searchproperty) value="target.selectedItems")
41+
default=this.searchProperties
4242
)
4343
)
4444

@@ -64,8 +64,8 @@ as |route|>
6464
<BlockSlot @name="toolbar">
6565
{{#if (gt items.length 0)}}
6666
<Consul::Nspace::SearchBar
67-
@search={{search}}
68-
@onsearch={{action (mut search) value="target.value"}}
67+
@search={{this.search}}
68+
@onsearch={{action (mut this.search) value="target.value"}}
6969

7070
@sort={{sort}}
7171

@@ -100,7 +100,7 @@ as |route|>
100100
@type="nspace"
101101
@sort={{sort.value}}
102102
@filters={{filters}}
103-
@search={{search}}
103+
@search={{this.search}}
104104
@items={{items}}
105105
as |collection|>
106106
<collection.Collection>

ui/packages/consul-partitions/app/components/consul/partition/form/index.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
dc=@item.Datacenter
1717
)
1818
}}
19-
@type={{'partition'}}
20-
@label={{'Partition'}}
19+
@type='partition'
20+
@label='Partition'
2121
@ondelete={{fn (if @ondelete @ondelete @onsubmit) @item}}
2222
@onchange={{fn (optional @onsubmit) @item}}
2323
as |writer|>

ui/packages/consul-partitions/app/templates/dc/partitions/edit.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}}
55

66
<Route
7-
@name={{routeName}}
7+
@name={{this.routeName}}
88
as |route|>
99
<DataLoader @src={{
1010
uri '/${partition}/${nspace}/${dc}/partition/${id}'

ui/packages/consul-partitions/app/templates/dc/partitions/index.hbs

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

66
<Route
7-
@name={{routeName}}
7+
@name={{this.routeName}}
88
as |route|>
99
<DataLoader
1010
@src={{
@@ -27,18 +27,18 @@ as |route|>
2727
{{#let
2828

2929
(hash
30-
value=(or sortBy "Name:asc")
31-
change=(action (mut sortBy) value="target.selected")
30+
value=(or this.sortBy "Name:asc")
31+
change=(action (mut this.sortBy) value="target.selected")
3232
)
3333

3434
(hash
3535
searchproperty=(hash
36-
value=(if (not-eq searchproperty undefined)
37-
(split searchproperty ',')
38-
searchProperties
36+
value=(if (not-eq this.searchproperty undefined)
37+
(split this.searchproperty ',')
38+
this.searchProperties
3939
)
40-
change=(action (mut searchproperty) value="target.selectedItems")
41-
default=searchProperties
40+
change=(action (mut this.searchproperty) value="target.selectedItems")
41+
default=this.searchProperties
4242
)
4343
)
4444

@@ -64,8 +64,8 @@ as |route|>
6464
<BlockSlot @name="toolbar">
6565
{{#if (gt items.length 0)}}
6666
<Consul::Partition::SearchBar
67-
@search={{search}}
68-
@onsearch={{action (mut search) value="target.value"}}
67+
@search={{this.search}}
68+
@onsearch={{action (mut this.search) value="target.value"}}
6969

7070
@sort={{sort}}
7171

@@ -100,7 +100,7 @@ as |route|>
100100
@type="nspace"
101101
@sort={{sort.value}}
102102
@filters={{filters}}
103-
@search={{search}}
103+
@search={{this.search}}
104104
@items={{items}}
105105
as |collection|>
106106
<collection.Collection>

ui/packages/consul-peerings/app/components/consul/peer/form/generate/index.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
as |fsm|
1414
>
1515

16-
{{#let (unique-id) as |id reset|}}
16+
{{#let (dom-guid) as |id reset|}}
1717
<form {{on "submit" (fn fsm.dispatch "LOAD")}} id={{id}}>
1818

1919
<fsm.State @matches={{array "idle" "error"}}>
20-
<fsm.State @matches={{"error"}}>
21-
<Hds::Alert @color='critical' class='mb-3 mt-2' as |A|>
20+
<fsm.State @matches="error">
21+
<Hds::Alert @type="inline" @color='critical' class='mb-3 mt-2' as |A|>
2222
<A.Title>Error</A.Title>
2323
<A.Description>{{fsm.state.context.error.message}}</A.Description>
2424
</Hds::Alert>
@@ -35,7 +35,7 @@
3535
}}
3636
</fsm.State>
3737

38-
<fsm.State @matches={{"loading"}}>
38+
<fsm.State @matches="loading">
3939
<DataSource
4040
@src={{uri
4141
"/${partition}/${nspace}/${dc}/peering/token-for/${name}/${externalAddresses}"
@@ -55,7 +55,7 @@
5555
/>
5656
</fsm.State>
5757

58-
<fsm.State @matches={{"success"}}>
58+
<fsm.State @matches="success">
5959
{{yield
6060
(hash
6161
Fieldsets=(component

0 commit comments

Comments
 (0)