Improved and simplified UI further.

This commit is contained in:
Clinton Alexander 2016-07-12 11:07:25 +01:00
parent 1458c3ac1f
commit b2d7630021
5 changed files with 38 additions and 41 deletions

View File

@ -14,6 +14,20 @@ let Deal = function(dealViewModel) {
_.assign(fixedLeg.fixedRate, fixedRateViewModel); _.assign(fixedLeg.fixedRate, fixedRateViewModel);
fixedLeg.fixedRate = Number(fixedLeg.fixedRate) / 100; fixedLeg.fixedRate = Number(fixedLeg.fixedRate) / 100;
fixedLeg.notional.token = common.baseCurrency;
fixedLeg.effectiveDate = formatDateForNode(common.effectiveDate);
fixedLeg.terminationDate = formatDateForNode(common.terminationDate);
fixedLeg.fixedRate = { ratioUnit: { value: fixedLeg.fixedRate } };
fixedLeg.dayCountBasisDay = dayCountBasisLookup[fixedLeg.dayCountBasis].day;
fixedLeg.dayCountBasisYear = dayCountBasisLookup[fixedLeg.dayCountBasis].year;
delete fixedLeg.dayCountBasis;
floatingLeg.notional.token = common.baseCurrency;
floatingLeg.effectiveDate = formatDateForNode(common.effectiveDate);
floatingLeg.terminationDate = formatDateForNode(common.terminationDate);
floatingLeg.dayCountBasisDay = dayCountBasisLookup[floatingLeg.dayCountBasis].day;
floatingLeg.dayCountBasisYear = dayCountBasisLookup[floatingLeg.dayCountBasis].year;
delete floatingLeg.dayCountBasis;
common.tradeID = tradeId; common.tradeID = tradeId;
common.eligibleCurrency = common.baseCurrency; common.eligibleCurrency = common.baseCurrency;
@ -21,21 +35,8 @@ let Deal = function(dealViewModel) {
common.threshold.token = common.baseCurrency; common.threshold.token = common.baseCurrency;
common.minimumTransferAmount.token = common.baseCurrency; common.minimumTransferAmount.token = common.baseCurrency;
common.rounding.token = common.baseCurrency; common.rounding.token = common.baseCurrency;
delete common.effectiveDate;
fixedLeg.notional.token = common.baseCurrency; delete common.terminationDate;
fixedLeg.effectiveDate = formatDateForNode(fixedLeg.effectiveDate);
fixedLeg.terminationDate = formatDateForNode(fixedLeg.terminationDate);
fixedLeg.fixedRate = { ratioUnit: { value: fixedLeg.fixedRate } };
fixedLeg.dayCountBasisDay = dayCountBasisLookup[fixedLeg.dayCountBasis].day;
fixedLeg.dayCountBasisYear = dayCountBasisLookup[fixedLeg.dayCountBasis].year;
delete fixedLeg.dayCountBasis;
floatingLeg.notional.token = common.baseCurrency;
floatingLeg.effectiveDate = formatDateForNode(floatingLeg.effectiveDate);
floatingLeg.terminationDate = formatDateForNode(floatingLeg.terminationDate);
floatingLeg.dayCountBasisDay = dayCountBasisLookup[floatingLeg.dayCountBasis].day;
floatingLeg.dayCountBasisYear = dayCountBasisLookup[floatingLeg.dayCountBasis].year;
delete floatingLeg.dayCountBasis;
let json = { let json = {
fixedLeg: fixedLeg, fixedLeg: fixedLeg,

View File

@ -18,9 +18,7 @@ let fixedLegModel = {
quantity: 2500000000 quantity: 2500000000
}, },
paymentFrequency: "Annual", paymentFrequency: "Annual",
effectiveDate: new Date(2016, 3, 11),
effectiveDateAdjustment: null, effectiveDateAdjustment: null,
terminationDate: new Date(2026, 3, 11),
terminationDateAdjustment: null, terminationDateAdjustment: null,
fixedRate: "1.676", fixedRate: "1.676",
dayCountBasis: "30/360", dayCountBasis: "30/360",
@ -84,6 +82,8 @@ let fixedRateViewModel = {
let commonViewModel = { let commonViewModel = {
baseCurrency: "EUR", baseCurrency: "EUR",
effectiveDate: new Date(2016, 3, 11),
terminationDate: new Date(2026, 3, 11),
eligibleCreditSupport: "Cash in an Eligible Currency", eligibleCreditSupport: "Cash in an Eligible Currency",
independentAmounts: { independentAmounts: {
quantity: 0 quantity: 0

View File

@ -5,6 +5,7 @@ define(['jquery', 'semantic'], ($, semantic) => {
init: () => { init: () => {
$('.ui.accordion').accordion(); $('.ui.accordion').accordion();
$('.ui.dropdown').dropdown(); $('.ui.dropdown').dropdown();
$('.ui.sticky').sticky();
} }
}; };
}); });

View File

@ -4,8 +4,11 @@
<div class="ui text loader">Loading</div> <div class="ui text loader">Loading</div>
</div> </div>
<h2>New Deal</h2> <h2>New Deal</h2>
<form class="ui form" ng-submit="createDeal()"> <form id="deal-form" class="ui form" ng-submit="createDeal()">
<div class="ui grid"> <div class="ui grid">
<div class="sixteen wide column">
<input type="submit" class="ui submit primary button fluid"/>
</div>
<div class="sixteen wide column"> <div class="sixteen wide column">
<div class="field"> <div class="field">
<label>Base Currency</label> <label>Base Currency</label>
@ -15,6 +18,14 @@
<option value="GBP">GBP</option> <option value="GBP">GBP</option>
</select> </select>
</div> </div>
<div class="field">
<label>Effective Date</label>
<input type="date" name="effectiveDate" ng-model="deal.common.effectiveDate"/>
</div>
<div class="field">
<label>Termination Date</label>
<input type="date" name="terminationDate" ng-model="deal.common.terminationDate"/>
</div>
</div> </div>
<div class="eight wide column" id="createfixedleg"> <div class="eight wide column" id="createfixedleg">
<h3>Fixed Leg</h3> <h3>Fixed Leg</h3>
@ -38,14 +49,6 @@
<option value="Quarterly">Quarterly</option> <option value="Quarterly">Quarterly</option>
</select> </select>
</div> </div>
<div class="field">
<label>Effective Date</label>
<input type="date" name="effectiveDate" ng-model="deal.fixedLeg.effectiveDate"/>
</div>
<div class="field">
<label>Termination Date</label>
<input type="date" name="terminationDate" ng-model="deal.fixedLeg.terminationDate"/>
</div>
<div class="field"> <div class="field">
<label>Day Count Basis</label> <label>Day Count Basis</label>
<select class="ui selection dropdown" ng-model="deal.fixedLeg.dayCountBasis"> <select class="ui selection dropdown" ng-model="deal.fixedLeg.dayCountBasis">
@ -113,14 +116,6 @@
<option value="SemiAnnual">Semi Annual</option> <option value="SemiAnnual">Semi Annual</option>
</select> </select>
</div> </div>
<div class="field">
<label>Effective Date</label>
<input type="date" name="effectiveDate" ng-model="deal.floatingLeg.effectiveDate"/>
</div>
<div class="field">
<label>Termination Date</label>
<input type="date" name="terminationDate" ng-model="deal.floatingLeg.terminationDate"/>
</div>
<div class="field"> <div class="field">
<label>Day Count Basis</label> <label>Day Count Basis</label>
<select class="ui selection dropdown" ng-model="deal.floatingLeg.dayCountBasis"> <select class="ui selection dropdown" ng-model="deal.floatingLeg.dayCountBasis">

View File

@ -70,6 +70,13 @@
<td>Effective From</td> <td>Effective From</td>
<td>{{deal.fixedLeg.effectiveDate}}</td> <td>{{deal.fixedLeg.effectiveDate}}</td>
</tr> </tr>
<tr class="center aligned">
<td>Fixed Rate</td>
<td>
<span ng-show="!deal.fixedLeg.fixedRate.positive">-</span>
{{deal.fixedLeg.fixedRate.value}}%
</td>
</tr>
<tr class="center aligned"> <tr class="center aligned">
<td>Terminates</td> <td>Terminates</td>
<td>{{deal.fixedLeg.terminationDate}}</td> <td>{{deal.fixedLeg.terminationDate}}</td>
@ -105,13 +112,6 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="center aligned">
<td>Fixed Rate</td>
<td>
<span ng-show="!deal.fixedLeg.fixedRate.positive">-</span>
{{deal.fixedLeg.fixedRate.value}}%
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>