From b2d76300215d4a89c052ae4a462aa3bd82ca8044 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Tue, 12 Jul 2016 11:07:25 +0100 Subject: [PATCH] Improved and simplified UI further. --- src/main/webdemo/js/Deal.js | 31 +++++++++++++------------- src/main/webdemo/js/app.js | 4 ++-- src/main/webdemo/js/utils/semantic.js | 1 + src/main/webdemo/view/create-deal.html | 29 ++++++++++-------------- src/main/webdemo/view/deal.html | 14 ++++++------ 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/main/webdemo/js/Deal.js b/src/main/webdemo/js/Deal.js index bd1e08411c..9d6e9a1711 100644 --- a/src/main/webdemo/js/Deal.js +++ b/src/main/webdemo/js/Deal.js @@ -14,6 +14,20 @@ let Deal = function(dealViewModel) { _.assign(fixedLeg.fixedRate, fixedRateViewModel); 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.eligibleCurrency = common.baseCurrency; @@ -21,21 +35,8 @@ let Deal = function(dealViewModel) { common.threshold.token = common.baseCurrency; common.minimumTransferAmount.token = common.baseCurrency; common.rounding.token = common.baseCurrency; - - fixedLeg.notional.token = common.baseCurrency; - 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; + delete common.effectiveDate; + delete common.terminationDate; let json = { fixedLeg: fixedLeg, diff --git a/src/main/webdemo/js/app.js b/src/main/webdemo/js/app.js index 6e8bb4b0bf..39da941598 100644 --- a/src/main/webdemo/js/app.js +++ b/src/main/webdemo/js/app.js @@ -18,9 +18,7 @@ let fixedLegModel = { quantity: 2500000000 }, paymentFrequency: "Annual", - effectiveDate: new Date(2016, 3, 11), effectiveDateAdjustment: null, - terminationDate: new Date(2026, 3, 11), terminationDateAdjustment: null, fixedRate: "1.676", dayCountBasis: "30/360", @@ -84,6 +82,8 @@ let fixedRateViewModel = { let commonViewModel = { baseCurrency: "EUR", + effectiveDate: new Date(2016, 3, 11), + terminationDate: new Date(2026, 3, 11), eligibleCreditSupport: "Cash in an Eligible Currency", independentAmounts: { quantity: 0 diff --git a/src/main/webdemo/js/utils/semantic.js b/src/main/webdemo/js/utils/semantic.js index 11521067de..2a90ff44e7 100644 --- a/src/main/webdemo/js/utils/semantic.js +++ b/src/main/webdemo/js/utils/semantic.js @@ -5,6 +5,7 @@ define(['jquery', 'semantic'], ($, semantic) => { init: () => { $('.ui.accordion').accordion(); $('.ui.dropdown').dropdown(); + $('.ui.sticky').sticky(); } }; }); \ No newline at end of file diff --git a/src/main/webdemo/view/create-deal.html b/src/main/webdemo/view/create-deal.html index 1117e3ad08..703e97afd9 100644 --- a/src/main/webdemo/view/create-deal.html +++ b/src/main/webdemo/view/create-deal.html @@ -4,8 +4,11 @@
Loading

New Deal

-
+
+
+ +
@@ -15,6 +18,14 @@
+
+ + +
+
+ + +

Fixed Leg

@@ -38,14 +49,6 @@
-
- - -
-
- - -
-
- - -
-
- - -