Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7e1a4d9

Browse files
committedJun 29, 2022
improvement(reskin-payment): view all, view pending
1 parent 9a4386e commit 7e1a4d9

19 files changed

+1041
-11
lines changed
 

‎css/reskin-2/common.css

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,96 @@
2929
--green: #137d60;
3030
--blue-1: #eaf6fd;
3131
--blue-2: #bae1f9;
32-
32+
--blue-3: #2c95d7;
33+
--grey-1: #767676;
3334
--divider: #e9e9e9;
3435

3536
--header-height: 80px;
3637
--footer-height: 51px;
3738
--header-height-mobile: 60px;
3839
--footer-height-mobile: 75px;
40+
41+
--payment-status-owed: #f46500;
42+
--payment-status-paid: #0ab88a;
43+
--payment-status-cancelled: #ef476f;
44+
}
45+
46+
.modal {
47+
position: fixed;
48+
top: 0;
49+
left: 0;
50+
z-index: 1000;
51+
display: none;
52+
width: 100%;
53+
height: 100%;
54+
overflow-x: hidden;
55+
overflow-y: auto;
56+
}
57+
.modal.show {
58+
display: block;
59+
}
60+
.modal-dialog {
61+
position: relative;
62+
max-width: calc(100% - 16px);
63+
margin-left: auto;
64+
margin-right: auto;
65+
}
66+
.modal-content {
67+
position: relative;
68+
display: flex;
69+
flex-direction: column;
70+
width: 100%;
71+
background-color: #fff;
72+
border-radius: 8px;
73+
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.2);
74+
75+
padding: 32px;
76+
}
77+
.modal-header {
78+
display: flex;
79+
flex-shrink: 0;
80+
align-items: center;
81+
justify-content: space-between;
82+
padding: 0 0 24px 0;
83+
border-bottom: 2px solid var(--black-10);
84+
}
85+
.modal-title {
86+
font-family: Barlow;
87+
font-weight: 600;
88+
font-size: 22px;
89+
line-height: 26px;
90+
}
91+
.modal-body {
92+
position: relative;
93+
flex: 1 1 auto;
94+
padding: 24px 0;
95+
}
96+
.modal-footer {
97+
display: flex;
98+
flex-shrink: 0;
99+
flex-wrap: wrap;
100+
align-items: center;
101+
justify-content: flex-end;
102+
padding: 24px 0 0 0;
103+
gap: 16px;
104+
border-top: 2px solid var(--black-10);
39105
}
106+
@media (max-width: /* --xs-max */ 599px) {
107+
.modal-content {
108+
padding: 24px 16px;
109+
}
110+
.modal-header {
111+
padding: 0 0 16px 0;
112+
}
113+
.modal-title {
114+
font-size: 18px;
115+
line-height: 20px;
116+
}
117+
.modal-body {
118+
padding: 16px 0;
119+
}
120+
.modal-footer {
121+
padding: 16px 0 0 0;
122+
gap: 10px;
123+
}
124+
}

‎css/reskin-2/paymentHistory.css

Lines changed: 858 additions & 3 deletions
Large diffs are not rendered by default.

‎i/reskin-2/checkbox.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/cheveron-down-small.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/cheveron-up-small.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/chevron-right-green.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/chevron-right-grey.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/chevron-right-white.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/close-small.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/close.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/download-excel-mobile.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/download-excel.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/sort-down-green.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/sort-down.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/sortable-green.svg

Lines changed: 3 additions & 0 deletions
Loading

‎i/reskin-2/sortable.svg

Lines changed: 3 additions & 0 deletions
Loading

‎js/reskin/newTCScript.js

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,11 @@ function adjustAndShow(modal) {
365365
function updatePayMe() {
366366
var total = calcTotalPayment();
367367
if (total >= 0) {
368-
$('#payMe').val('Pay Me: $' + total.toFixed(2));
368+
// $('#payMe').val('Pay Me: $' + total.toFixed(2));
369+
$('#payMeValue').text('$' + total.toFixed(2));
369370
} else {
370-
$('#payMe').val('Pay Me: -$' + Math.abs(total.toFixed(2)));
371+
// $('#payMe').val('Pay Me: -$' + Math.abs(total.toFixed(2)));
372+
$('#payMeValue').text('-$' + Math.abs(total.toFixed(2)));
371373
}
372374
if (total < MINIMUM_PAYMENT_ACCRUAL_AMOUNT || !isUserPaymentMethodValid()) {
373375
$('#payMe').attr('disabled', 'disabled');
@@ -627,11 +629,51 @@ $(document).ready(function() {
627629
var total = calcTotalPayment();
628630
var confirmationMessage = PAY_ME_CONFIRMATION_TEMPLATE.replace('{0}', '$' + total.toFixed(2));
629631

630-
if (confirm(confirmationMessage)) {
631-
var myForm = document.f;
632-
myForm.method = 'POST';
633-
myForm.module.value = 'PayMe';
634-
myForm.submit();
632+
var isNativeDialog = $('#payment-confirm-modal-id').length === 0;
633+
634+
if (isNativeDialog) {
635+
if (confirm(confirmationMessage)) {
636+
var myForm = document.f;
637+
myForm.method = 'POST';
638+
myForm.module.value = 'PayMe';
639+
myForm.submit();
640+
}
641+
} else {
642+
var resultPromise = new Promise(function (resolve) {
643+
$('#payment-confirm-modal-id .modal-body').text(confirmationMessage);
644+
document.body.style.overflow = 'hidden';
645+
646+
function onCancel () {
647+
document.body.style.overflow = '';
648+
$('#payment-confirm-modal-id').removeClass('show');
649+
$('#payment-confirm-modal-id .close-btn').off('click');
650+
$('#payment-confirm-modal-id .button-secondary').off('click');
651+
$('#payment-confirm-modal-id .button-primary').off('click');
652+
resolve(false);
653+
}
654+
function onOk () {
655+
document.body.style.overflow = '';
656+
$('#payment-confirm-modal-id').removeClass('show');
657+
$('#payment-confirm-modal-id .close-btn').off('click');
658+
$('#payment-confirm-modal-id .button-secondary').off('click');
659+
$('#payment-confirm-modal-id .button-primary').off('click');
660+
resolve(true);
661+
}
662+
663+
$('#payment-confirm-modal-id').addClass('show');
664+
$('#payment-confirm-modal-id .close-btn').one('click', onCancel);
665+
$('#payment-confirm-modal-id .button-secondary').one('click', onCancel);
666+
$('#payment-confirm-modal-id .button-primary').one('click', onOk);
667+
});
668+
669+
resultPromise.then(function (ok) {
670+
if (ok) {
671+
var myForm = document.f;
672+
myForm.method = 'POST';
673+
myForm.module.value = 'PayMe';
674+
myForm.submit();
675+
}
676+
})
635677
}
636678
}
637679
});

0 commit comments

Comments
 (0)
This repository has been archived.