Redirect to peers.show after establishing peering

This commit is contained in:
Michael Klein 2022-10-26 11:15:57 +02:00
parent 6eaa9d94da
commit be97a2a4a8
3 changed files with 14 additions and 1 deletions

View File

@ -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);
};
}

View File

@ -76,7 +76,7 @@
<Consul::Peer::Form @params={{route.params}} as |form|>
<form.Form
@onchange={{loader.invalidate}}
@onsubmit={{modal.close}}
@onsubmit={{fn this.redirectToPeerShow modal.close}}
as |form|
>
{{did-insert (set this "form" form)}}

View File

@ -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