return null;
}
- getDescriptorIdFromRecord = (record) => {
- if (record.type && record.type == 'nsr') {
- return record.nsd && record.nsd.id;
- } else if (record.type && record.type == 'vnfr') {
- return record.vnfd && record.vnfd.id;
- }
-
- return null;
- }
-
render(){
let navClass = 'catalogItems';
<div key={'id' + k + '-' + vnfr.id} onClick={self.props.loadRecord.bind(self,vnfr)} className={iClassName}>
<img
onError={self.handleImageError}
- src={Utils.cleanImageDataURI(vnfr.logo, self.getDescriptorTypeFromRecordType(vnfr.type), getDescriptorIdFromRecord(vnfr))}
+ src={Utils.cleanImageDataURI(vnfr.logo, self.getDescriptorTypeFromRecordType(vnfr.type), vnfr.logoId)}
/>
<section id={vnfr.id}>
<h1 title={vnfr.name}>{vnfr.name}</h1>
<div key={'id' + k + '-' + n.id} onClick={self.props.loadRecord.bind(self,n)} className={itemClassName}>
<img
onError={self.handleImageError}
- src={Utils.cleanImageDataURI(n.logo, self.getDescriptorTypeFromRecordType(n.type), self.getDescriptorIdFromRecord(n))}
+ src={Utils.cleanImageDataURI(n.logo, self.getDescriptorTypeFromRecordType(n.type), n.logoId)}
/>
<section id={n.id}>
<h1 title={n.name}>{n.name}</h1>
id: nsrs.id,
nsd_name: nsrs.nsd_name,
type: 'nsr',
- logo: nsrs.nsd && nsrs.nsd.logo
+ logo: nsrs.nsd && nsrs.nsd.logo,
+ logoId: nsrs.nsd && nsrs.nsd && nsrs.nsd.id
});
// Scaled VNFRs
name: vnfrObj['short-name'],
id: vnfr,
type: 'vnfr',
- logo: vnfrObj['vnfd'] && vnfrObj['vnfd']['logo']
+ logo: vnfrObj['vnfd'] && vnfrObj['vnfd']['logo'],
+ logoId: vnfrObj['vnfd'] && vnfrObj['vnfd']['id']
});
});
nav.push(scaledVnfNav);
name: vnfr["short-name"],
id: vnfr.id,
type: 'vnfr',
- logo: vnfr['vnfd'] && vnfr['vnfd']['logo']
+ logo: vnfr['vnfd'] && vnfr['vnfd']['logo'],
+ logoId: vnfr['vnfd'] && vnfr['vnfd']['id']
});
}
});