mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +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
71072eafb5
commit
f1f4498ebc
@ -16,6 +16,17 @@ define(['angular', 'utils/semantic', 'services/NodeApi'], (angular, semantic, no
|
|||||||
$scope.date = newDate
|
$scope.date = newDate
|
||||||
}, handleHttpFail);
|
}, 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.getDate().then((date) => $scope.date = date);
|
||||||
nodeService.getDeals().then((deals) => $scope.deals = deals);
|
nodeService.getDeals().then((deals) => $scope.deals = deals);
|
||||||
|
@ -46,9 +46,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr class="center aligned" ng-repeat="deal in deals">
|
<tr class="center aligned" ng-repeat="deal in deals">
|
||||||
<td><a href="#/deal/{{deal.ref}}">{{deal.ref}}</a></td>
|
<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.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>
|
<td class="single line">{{deal.floatingLeg.notional.quantity | number}} {{deal.floatingLeg.notional.token}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -24,11 +24,26 @@ var AppComponent = (function () {
|
|||||||
AppComponent.prototype.refreshValue = function (value) {
|
AppComponent.prototype.refreshValue = function (value) {
|
||||||
this.counterparty = this.httpWrapperService.setCounterparty(value.id);
|
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 () {
|
AppComponent.prototype.ngOnInit = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.httpWrapperService.getAbsolute("whoami").toPromise().then(function (data) {
|
this.httpWrapperService.getAbsolute("whoami").toPromise().then(function (data) {
|
||||||
_this.whoAmI = data.self.text;
|
_this.whoAmI = _this.renderX500Name(data.self.text);
|
||||||
_this.counterParties = data.counterparties;
|
_this.counterParties = data.counterparties.map(function(x) {
|
||||||
|
return {
|
||||||
|
id: x.id,
|
||||||
|
text: _this.renderX500Name(x.text)
|
||||||
|
};
|
||||||
|
});
|
||||||
if (_this.counterParties.length == 0) {
|
if (_this.counterParties.length == 0) {
|
||||||
console.log("/whoami is returning no counterparties, the whole app won't run", data);
|
console.log("/whoami is returning no counterparties, the whole app won't run", data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user