diff --git a/ui-v2/app/controllers/dc/intentions/edit.js b/ui-v2/app/controllers/dc/intentions/edit.js
index 5b5b400e2a..669ed0fb25 100644
--- a/ui-v2/app/controllers/dc/intentions/edit.js
+++ b/ui-v2/app/controllers/dc/intentions/edit.js
@@ -1,5 +1,5 @@
import Controller from '@ember/controller';
-import { set } from '@ember/object';
+import { get, set } from '@ember/object';
// import Changeset from 'ember-changeset';
// import validations from 'consul-ui/validations/acl';
// import lookupValidator from 'ember-changeset-validations';
@@ -16,11 +16,15 @@ export default Controller.extend({
},
actions: {
change: function(e) {
- const target = e.target;
+ const target = e.target || { name: 'SourceName', value: e };
switch (target.name) {
case 'Action':
set(this.changeset, target.name, target.value);
break;
+ case 'SourceName':
+ set(this.changeset, 'SourceName', get(target.value, 'Name'));
+ set(this.item, 'SourceName', get(target.value, 'Name'));
+ break;
}
},
},
diff --git a/ui-v2/app/routes/dc/intentions/edit.js b/ui-v2/app/routes/dc/intentions/edit.js
index 9a75d057b0..12bd62a263 100644
--- a/ui-v2/app/routes/dc/intentions/edit.js
+++ b/ui-v2/app/routes/dc/intentions/edit.js
@@ -7,10 +7,12 @@ import WithAclActions from 'consul-ui/mixins/intention/with-actions';
export default Route.extend(WithAclActions, {
repo: service('intentions'),
+ servicesRepo: service('services'),
model: function(params) {
return hash({
isLoading: false,
item: get(this, 'repo').findBySlug(params.id, this.modelFor('dc').dc.Name),
+ items: get(this, 'servicesRepo').findAllByDatacenter(this.modelFor('dc').dc.Name),
intents: ['allow', 'deny'],
});
},
diff --git a/ui-v2/app/styles/app.scss b/ui-v2/app/styles/app.scss
index 03048d259d..f468c65440 100644
--- a/ui-v2/app/styles/app.scss
+++ b/ui-v2/app/styles/app.scss
@@ -60,3 +60,5 @@ main label a[rel*='help'] {
[role='tabpanel'] > p:only-child [rel*='help']::after {
content: none;
}
+
+@import 'ember-power-select';
diff --git a/ui-v2/app/templates/dc/intentions/-form.hbs b/ui-v2/app/templates/dc/intentions/-form.hbs
index 93a0734d58..e560804a47 100644
--- a/ui-v2/app/templates/dc/intentions/-form.hbs
+++ b/ui-v2/app/templates/dc/intentions/-form.hbs
@@ -2,6 +2,9 @@