From: KIRAN KASHALKAR Date: Tue, 15 Nov 2016 22:58:11 +0000 (-0500) Subject: RIFT-15032: launchpad UI - Viewport - icons for nsr X-Git-Tag: v1.1.0~44^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F677%2F1;p=osm%2FUI.git RIFT-15032: launchpad UI - Viewport - icons for nsr Signed-off-by: KIRAN KASHALKAR --- diff --git a/skyquake/framework/utils/utils.js b/skyquake/framework/utils/utils.js index 744202731..8a54ff338 100644 --- a/skyquake/framework/utils/utils.js +++ b/skyquake/framework/utils/utils.js @@ -295,4 +295,20 @@ Utils.arrayIntersperse = (arr, sep) => { }, [arr[0]]); } +Utils.cleanImageDataURI = (imageString, type, id) => { + if (/\bbase64\b/g.test(imageString)) { + return imageString; + } else if (/<\?xml\b/g.test(imageString)) { + const imgStr = imageString.substring(imageString.indexOf(' {v['name']} @@ -125,7 +126,7 @@ export default class CatalogCard extends Component { className = "CatalogCard " + buildClass(this.props); return (
- +
@@ -178,19 +179,3 @@ function cardHandler(element) { '' } } - -function cleanDataURI(imageString, type, id) { - if (/\bbase64\b/g.test(imageString)) { - return imageString; - } else if (/<\?xml\b/g.test(imageString)) { - const imgStr = imageString.substring(imageString.indexOf(' { + console.log('Bad logo path, using default'); + e.target.src = require('style/img/catalog-default.svg'); + } render(){ let navClass = 'catalogItems'; @@ -53,7 +58,10 @@ export default class RecordNavigator extends React.Component{ } navObj.push(
- +

{vnfr.name}

{vnfr.type}

@@ -67,7 +75,10 @@ export default class RecordNavigator extends React.Component{ } navObj.push(
- +

{n.name}

{n.type}

diff --git a/skyquake/plugins/launchpad/src/recordViewer/recordViewStore.js b/skyquake/plugins/launchpad/src/recordViewer/recordViewStore.js index b9fded547..3c446760f 100644 --- a/skyquake/plugins/launchpad/src/recordViewer/recordViewStore.js +++ b/skyquake/plugins/launchpad/src/recordViewer/recordViewStore.js @@ -407,7 +407,8 @@ function connectionManager(type, connection) { name: nsrs.name, id: nsrs.id, nsd_name: nsrs.nsd_name, - type: 'nsr' + type: 'nsr', + logo: nsrs.nsd && nsrs.nsd.logo }); // Scaled VNFRs @@ -424,10 +425,12 @@ function connectionManager(type, connection) { sgInstance['vnfrs'] && sgInstance['vnfrs'].map((vnfr, vnfrIndex) => { scaledVnfrs.push(vnfr); + let vnfrObj = _.findWhere(nsrs.vnfrs, {id: vnfr}); scaledVnfNav.vnfr.push({ - name: _.findWhere(nsrs.vnfrs, {id: vnfr})['short-name'], + name: vnfrObj['short-name'], id: vnfr, - type: 'vnfr' + type: 'vnfr', + logo: vnfrObj['vnfd'] && vnfrObj['vnfd']['logo'] }); }); nav.push(scaledVnfNav); @@ -440,7 +443,8 @@ function connectionManager(type, connection) { nav.push({ name: vnfr["short-name"], id: vnfr.id, - type: 'vnfr' + type: 'vnfr', + logo: vnfr['vnfd'] && vnfr['vnfd']['logo'] }); } });