diff --git a/ui/packages/consul-peerings/app/components/consul/peer/form/initiate/index.hbs b/ui/packages/consul-peerings/app/components/consul/peer/form/initiate/index.hbs index 8b29c46b8..f7daf88cf 100644 --- a/ui/packages/consul-peerings/app/components/consul/peer/form/initiate/index.hbs +++ b/ui/packages/consul-peerings/app/components/consul/peer/form/initiate/index.hbs @@ -1,54 +1,43 @@ -
+
- - - -

- Error
- {{error.message}} -

-
-
-
- -{{#let - (unique-id) -as |id|}} -
- {{yield (hash - Fieldsets=(component "consul/peer/form/initiate/fieldsets" - item=@item + as |writer| + > + + + +

+ Error
+ {{error.message}} +

+
+
+
+ + {{#let (unique-id) as |id|}} + + {{yield + (hash + Fieldsets=(component + "consul/peer/form/initiate/fieldsets" item=@item + ) + Actions=(component + "consul/peer/form/initiate/actions" item=@item id=id + ) ) - Actions=(component "consul/peer/form/initiate/actions" - item=@item - id=id - ) - )}} + }} -{{/let}} + {{/let}}
-
+
\ No newline at end of file diff --git a/ui/packages/consul-peerings/app/controllers/dc/peers/index.js b/ui/packages/consul-peerings/app/controllers/dc/peers/index.js new file mode 100644 index 000000000..e8812e486 --- /dev/null +++ b/ui/packages/consul-peerings/app/controllers/dc/peers/index.js @@ -0,0 +1,12 @@ +import Controller from "@ember/controller"; +import { inject as service } from "@ember/service"; + +export default class DcPeersIndexController extends Controller { + @service router; + + redirectToPeerShow = (modalCloseFn, peerModel) => { + modalCloseFn?.(); + + this.router.transitionTo("dc.peers.show", peerModel.Name); + }; +} diff --git a/ui/packages/consul-peerings/app/templates/dc/peers/index.hbs b/ui/packages/consul-peerings/app/templates/dc/peers/index.hbs index 75ee9afa7..2d57dec8d 100644 --- a/ui/packages/consul-peerings/app/templates/dc/peers/index.hbs +++ b/ui/packages/consul-peerings/app/templates/dc/peers/index.hbs @@ -1,235 +1,231 @@ - + + ) + }} + as |loader| + > - + -{{#let - - (hash - value=(or sortBy "State:asc") - change=(action (mut sortBy) value="target.selected") - ) - - (hash - state=(hash - value=(if state (split state ',') undefined) - change=(action (mut state) value="target.selectedItems") - ) - searchproperty=(hash - value=(if (not-eq searchproperty undefined) - (split searchproperty ',') - searchProperties - ) - change=(action (mut searchproperty) value="target.selectedItems") - default=searchProperties - ) - ) - - loader.data - -as |sort filters items|}} - - -

- -

-
- - - {{#if (gt items.length 0)}} - - {{/if}} - - - - - - - - {{did-insert (set this 'create' modal)}} -

- Add peer connection -

-
- - - {{#if modal.opened}} - - - {{did-insert (set this 'form' form)}} - - - - {{/if}} - - - - - -
- - Add peer connection - - -
- - - + searchproperty=(hash + value=(if + (not-eq searchproperty undefined) + (split searchproperty ",") + searchProperties + ) + change=(action (mut searchproperty) value="target.selectedItems") + default=searchProperties + ) + ) + loader.data + as |sort filters items| + }} + + +

+ +

+
+ - - - - + {{#if (gt items.length 0)}} + + {{/if}} + + + + @aria={{hash label="Add peer connection"}} + class="peer-create-modal" + as |modal| + > - {{did-insert (set this 'regenerate' modal)}} + {{did-insert (set this "create" modal)}}

- Regenerate token + Add peer connection

- {{#if this.item}} - - {{did-insert (set this 'regenerateForm' form)}} - - + + {{#if modal.opened}} + + + {{did-insert (set this "form" form)}} + + + {{/if}} + - +
+ + Add peer connection + - + + + - + @label="Peer" + as |writer| + > - + + + - - - {{!-- TODO: do we need to check permissions here or will we receive an error automatically? --}} - + {{did-insert (set this "regenerate" modal)}}

- {{t 'routes.dc.peers.index.empty.header' - items=items.length - }} + Regenerate token

-

- {{t 'routes.dc.peers.index.empty.body' - items=items.length - canUsePartitions=(can "use partitions") - canUseACLs=(can "use acls") - htmlSafe=true - }} -

+ {{#if this.item}} + + {{did-insert (set this "regenerateForm" form)}} + + + {{/if}}
- - + -
-
-
-
-
-
-
-{{/let}} + + + + + + + + + + {{! TODO: do we need to check permissions here or will we receive an error automatically? }} + + +

+ {{t + "routes.dc.peers.index.empty.header" + items=items.length + }} +

+
+ +

+ {{t + "routes.dc.peers.index.empty.body" + items=items.length + canUsePartitions=(can "use partitions") + canUseACLs=(can "use acls") + htmlSafe=true + }} +

+
+ + + + +
+
+
+
+ + + + {{/let}}
-
+
\ No newline at end of file diff --git a/ui/packages/consul-ui/tests/acceptance/dc/peers/establish.feature b/ui/packages/consul-ui/tests/acceptance/dc/peers/establish.feature index f037d4572..c773155ac 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/peers/establish.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/peers/establish.feature @@ -28,3 +28,4 @@ Feature: dc / peers / establish: Peer Establish Peering --- And "[data-notification]" has the "notification-update" class And "[data-notification]" has the "success" class + And the url should be /dc-1/peers/new-peer/imported-services