ui: Split splitter names in the discovery-chain (#7180)

Previous to 1.7 splitter names didn't include the namespace name

i.e. 'service-name'

as of 1.7 they now include the namespace

i.e. 'service-name.namespace'

This commit take account of that
This commit is contained in:
John Cowen 2020-01-30 19:08:45 +00:00 committed by GitHub
parent 85ea64211f
commit 281654bc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -99,7 +99,7 @@ export default Component.extend({
switch (item.Type) {
case 'splitter':
item.Splits.forEach(splitter => {
graph.addLink(`splitter:${item.Name}`, splitter.NextNode);
graph.addLink(item.ID, splitter.NextNode);
});
break;
case 'router':

View File

@ -38,6 +38,14 @@ export const getSplitters = function(nodes) {
return getNodesByType(nodes, 'splitter').map(function(item) {
// Splitters need IDs adding so we can find them in the DOM later
item.ID = `splitter:${item.Name}`;
// splitters have a service.nspace as a name
// do the reverse dance to ensure we don't mess up any
// serivice names with dots in them
const temp = item.Name.split('.');
temp.reverse();
temp.shift();
temp.reverse();
item.Name = temp.join('.');
return item;
});
};