mirror of
https://github.com/corda/corda.git
synced 2024-12-25 07:31:10 +00:00
Display party names as common name only
Display party names as common name only in IRS & SIMM samples. This doesn't change the UI where it takes in names (i.e. in IRS), as that requires significantly more infrastructure.
This commit is contained in:
parent
60efce8f87
commit
23ca884316
@ -16,6 +16,17 @@ define(['angular', 'utils/semantic', 'services/NodeApi'], (angular, semantic, no
|
||||
$scope.date = newDate
|
||||
}, handleHttpFail);
|
||||
};
|
||||
/* Extract the common name from an X500 name */
|
||||
$scope.renderX500Name = (x500Name) => {
|
||||
var name = x500Name
|
||||
x500Name.split(',').forEach(function(element) {
|
||||
var keyValue = element.split('=');
|
||||
if (keyValue[0].toUpperCase() == 'CN') {
|
||||
name = keyValue[1];
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
|
||||
nodeService.getDate().then((date) => $scope.date = date);
|
||||
nodeService.getDeals().then((deals) => $scope.deals = deals);
|
||||
|
@ -46,9 +46,9 @@
|
||||
<tbody>
|
||||
<tr class="center aligned" ng-repeat="deal in deals">
|
||||
<td><a href="#/deal/{{deal.ref}}">{{deal.ref}}</a></td>
|
||||
<td class="single line">{{deal.fixedLeg.fixedRatePayer}}</td>
|
||||
<td class="single line">{{renderX500Name(deal.fixedLeg.fixedRatePayer)}}</td>
|
||||
<td class="single line">{{deal.fixedLeg.notional.quantity | number}} {{deal.fixedLeg.notional.token}}</td>
|
||||
<td class="single line">{{deal.floatingLeg.floatingRatePayer}}</td>
|
||||
<td class="single line">{{renderX500Name(deal.floatingLeg.floatingRatePayer)}}</td>
|
||||
<td class="single line">{{deal.floatingLeg.notional.quantity | number}} {{deal.floatingLeg.notional.token}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -24,11 +24,26 @@ var AppComponent = (function () {
|
||||
AppComponent.prototype.refreshValue = function (value) {
|
||||
this.counterparty = this.httpWrapperService.setCounterparty(value.id);
|
||||
};
|
||||
AppComponent.prototype.renderX500Name = function (x500Name) {
|
||||
var name = x500Name
|
||||
x500Name.split(',').forEach(function(element) {
|
||||
var keyValue = element.split('=');
|
||||
if (keyValue[0].toUpperCase() == 'CN') {
|
||||
name = keyValue[1];
|
||||
}
|
||||
});
|
||||
return name;
|
||||
};
|
||||
AppComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.httpWrapperService.getAbsolute("whoami").toPromise().then(function (data) {
|
||||
_this.whoAmI = data.self.text;
|
||||
_this.counterParties = data.counterparties;
|
||||
_this.whoAmI = _this.renderX500Name(data.self.text);
|
||||
_this.counterParties = data.counterparties.map(function(x) {
|
||||
return {
|
||||
id: x.id,
|
||||
text: _this.renderX500Name(x.text)
|
||||
};
|
||||
});
|
||||
if (_this.counterParties.length == 0) {
|
||||
console.log("/whoami is returning no counterparties, the whole app won't run", data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user