This commit is contained in:
sairaj mote 2020-07-08 14:48:17 +05:30
parent 5f61e06afc
commit db9083b9b5
4 changed files with 127 additions and 103 deletions

View File

@ -548,8 +548,8 @@ form {
display: -ms-flexbox;
display: flex;
background: rgba(var(--foreground), 1);
-webkit-transform: translateY(1rem);
transform: translateY(1rem);
-webkit-transform: translateY(100%);
transform: translateY(100%);
-webkit-transition: -webkit-transform 0.3s;
transition: -webkit-transform 0.3s;
transition: transform 0.3s;
@ -918,7 +918,7 @@ form {
}
.options-tab .option h4 {
font-weight: 600;
font-weight: 400;
}
.options-tab .option:nth-of-type(1) .icon {
@ -992,6 +992,7 @@ form {
.request h5 {
color: rgba(var(--text-light), 1);
margin-bottom: 0.4rem;
text-transform: capitalize;
}
.request h3, .request h4 {
@ -1175,6 +1176,7 @@ form {
.time {
font-family: 'Roboto', sans-serif;
margin-bottom: 1.5rem !important;
font-weight: 400;
}
#report_popup h4 {
@ -1247,6 +1249,8 @@ form {
margin-left: 6rem;
}
.popup-container .popup {
-webkit-transform: translateY(0) scale(0.96);
transform: translateY(0) scale(0.96);
width: 24rem;
-ms-flex-item-align: center;
-ms-grid-row-align: center;

File diff suppressed because one or more lines are too long

View File

@ -356,7 +356,7 @@ form{
position: relative;
display: flex;
background: rgba(var(--foreground), 1);
transform: translateY(1rem);
transform: translateY(100%);
transition: transform 0.3s;
box-shadow: 0 2rem 2rem rgba($color: #000000, $alpha: 0.24);
overflow-y: auto;
@ -619,7 +619,7 @@ form{
stroke: rgba(var(--text), 0.4);
}
h4{
font-weight: 600;
font-weight: 400;
}
&:nth-of-type(1){
.icon{
@ -685,6 +685,7 @@ form{
h5{
color: rgba(var(--text-light), 1);
margin-bottom: 0.4rem;
text-transform: capitalize;
}
h3,h4{
margin-bottom: 1.5rem;
@ -821,6 +822,7 @@ form{
.time{
font-family: 'Roboto', sans-serif;
margin-bottom: 1.5rem !important;
font-weight: 400;
}
#report_popup{
h4{
@ -876,6 +878,7 @@ form{
}
.popup-container{
.popup{
transform: translateY(0) scale(0.96);
width: 24rem;
align-self: center;
border-radius: 0.2rem;

View File

@ -5,6 +5,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blockchain UPI</title>
<link
href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
</head>
@ -691,7 +694,7 @@
<sm-select name="complaint type" id="complaint_type">
<sm-option value="deposits">Deposits</sm-option>
<sm-option value="withdraws">Withdrawals</sm-option>
<sm-option value="payCashier">Pay through cashier</option>
<sm-option value="payCashier">Pay through cashier</sm-option>
</sm-select>
</div>
<h5 class="label">Select Cashier</h5>
@ -1064,7 +1067,7 @@
thisPopup.parentNode.setAttribute('style', `z-index: ${zIndex}`)
}, 400)
if (popup === 'main_loader' || popup === 'sign_in_popup') {
//loader.classList.remove('animate-loader')
loader.classList.remove('animate-loader')
document.querySelector('main').classList.remove('hide-completely')
}
if (popup === 'prompt') {
@ -1346,9 +1349,8 @@
document.getElementById('complaint_type').addEventListener('change', function (e) {
showComplaints(this.value)
})
document.getElementById('select_cashier').addEventListener('change', function (e) {
//load_deposit_complaints(this.value)
load_withdraw_complaints(this.value)
document.getElementById('select_cashier').addEventListener('change', async function (e) {
await Promise.all([load_deposit_complaints(this.value), load_withdraw_complaints(this.value)])
//load_pay_thru_cashier_complaints(this.value)
})
@ -1422,9 +1424,9 @@
hidePopup()
showPopup('sign_in_popup', 'no')
let signInBtn = document.getElementById('sign_in_btn'),
privKeyInput = document.getElementById('get_priv_key_field')
privateKeyInput = document.getElementById('get_priv_key_field')
signInBtn.onclick = () => {
resolve(privKeyInput.value)
resolve(privateKeyInput.value)
}
})
}
@ -1442,9 +1444,9 @@
})
}
}
// sm-select
const smSelect = document.createElement('template')
smSelect.innerHTML = `
// sm-select
const smSelect = document.createElement('template')
smSelect.innerHTML = `
<style>
*{
padding: 0;
@ -1487,27 +1489,35 @@
background: rgba(var(--text), 0.1);
align-items: center;
justify-content: space-between;
outline: none;
}
.icon{
margin-left: 1rem;
}
.options{
overflow: hidden auto;
margin-top: 0.5rem;
position: absolute;
grid-area: options;
display: flex;
flex-direction: column;
top: 100%;
right: 0;
width: 100%;
min-width: 100%;
transform: translateY(-0.5rem);
padding: 0.5rem 0;
background: rgba(var(--foreground), 1);
transition: opacity 0.3s;
box-shadow: 0 0.2rem 1rem #00000040;
border-radius: 0 0 0.2rem 0.2rem;
transition: opacity 0.3s, transform 0.3s;
border: solid 1px rgba(var(--text), 0.2);
border-radius: 0.2rem;
z-index: 2;
}
.rotate{
transform: rotate(-180deg)
}
.no-transformations{
transform: none;
}
</style>
<div class="sm-select">
<div class="selection" tabindex="0">
@ -1520,58 +1530,60 @@
<slot></slot>
</div>
</div>`;
customElements.define('sm-select', class extends HTMLElement {
constructor() {
super()
this.attachShadow({ mode: 'open' }).append(smSelect.content.cloneNode(true))
}
static get observedAttributes() {
return ['value']
}
get value() {
return this.getAttribute('value')
}
set value(val) {
this.setAttribute('value', val)
}
connectedCallback() {
let optionList = this.shadowRoot.querySelector('.options'),
chevron = this.shadowRoot.querySelector('.toggle'),
slot = this.shadowRoot.querySelector('.options slot'),
currentOption;
this.addEventListener('click', e => {
chevron.classList.toggle('rotate')
optionList.classList.toggle('hide')
})
this.addEventListener('optionSelected', e => {
if (currentOption !== e.detail.value) {
this.setAttribute('value', e.detail.value)
this.shadowRoot.querySelector('.option-text').textContent = e.detail.text;
this.dispatchEvent(new CustomEvent('change', {
bubbles: true,
composed: true
}))
currentOption = e.detail.value;
}
})
slot.addEventListener('slotchange', e => {
let firstElement = slot.assignedElements()[0];
currentOption = firstElement.getAttribute('value');
this.setAttribute('value', firstElement.getAttribute('value'))
this.shadowRoot.querySelector('.option-text').textContent = firstElement.textContent
});
document.addEventListener('mousedown', e => {
if (!this.contains(e.target)) {
chevron.classList.remove('rotate')
optionList.classList.add('hide')
}
})
}
})
customElements.define('sm-select', class extends HTMLElement {
constructor() {
super()
this.attachShadow({ mode: 'open' }).append(smSelect.content.cloneNode(true))
}
static get observedAttributes() {
return ['value']
}
get value() {
return this.getAttribute('value')
}
set value(val) {
this.setAttribute('value', val)
}
connectedCallback() {
let optionList = this.shadowRoot.querySelector('.options'),
chevron = this.shadowRoot.querySelector('.toggle'),
slot = this.shadowRoot.querySelector('.options slot'),
currentOption;
this.addEventListener('click', e => {
chevron.classList.toggle('rotate')
optionList.classList.toggle('hide')
optionList.classList.toggle('no-transformations')
})
this.addEventListener('optionSelected', e => {
if (currentOption !== e.detail.value) {
this.setAttribute('value', e.detail.value)
this.shadowRoot.querySelector('.option-text').textContent = e.detail.text;
this.dispatchEvent(new CustomEvent('change', {
bubbles: true,
composed: true
}))
currentOption = e.detail.value;
}
})
slot.addEventListener('slotchange', e => {
let firstElement = slot.assignedElements()[0];
currentOption = firstElement.getAttribute('value');
this.setAttribute('value', firstElement.getAttribute('value'))
this.shadowRoot.querySelector('.option-text').textContent = firstElement.textContent
});
document.addEventListener('mousedown', e => {
if (!this.contains(e.target)) {
chevron.classList.remove('rotate')
optionList.classList.add('hide')
optionList.classList.remove('no-transformations')
}
})
}
})
// sm-option
const smOption = document.createElement('template')
smOption.innerHTML = `
// sm-option
const smOption = document.createElement('template')
smOption.innerHTML = `
<style>
*{
padding: 0;
@ -1586,6 +1598,7 @@
padding: 0.6rem 0.8rem;
cursor: pointer;
overflow-wrap: break-word;
outline: none;
}
.sm-option:hover{
background: rgba(var(--text), 0.1);
@ -1594,13 +1607,25 @@
<div class="sm-option" tabindex="0">
<slot></slot>
</div>`;
customElements.define('sm-option', class extends HTMLElement {
constructor() {
super()
this.attachShadow({ mode: 'open' }).append(smOption.content.cloneNode(true))
}
connectedCallback() {
this.addEventListener('click', e => {
customElements.define('sm-option', class extends HTMLElement {
constructor() {
super()
this.attachShadow({ mode: 'open' }).append(smOption.content.cloneNode(true))
}
connectedCallback() {
this.addEventListener('click', e => {
let optionSelected = new CustomEvent('optionSelected', {
bubbles: true,
composed: true,
detail: {
text: this.textContent,
value: this.getAttribute('value')
}
})
this.dispatchEvent(optionSelected)
})
if (this.hasAttribute('default')) {
setTimeout(() => {
let optionSelected = new CustomEvent('optionSelected', {
bubbles: true,
composed: true,
@ -1610,22 +1635,10 @@
}
})
this.dispatchEvent(optionSelected)
})
if (this.hasAttribute('default')) {
setTimeout(() => {
let optionSelected = new CustomEvent('optionSelected', {
bubbles: true,
composed: true,
detail: {
text: this.textContent,
value: this.getAttribute('value')
}
})
this.dispatchEvent(optionSelected)
}, 0);
}
}, 0);
}
})
}
})
</script>
<script id="init_lib">
@ -11034,8 +11047,7 @@
for (cashier in token_app.master_configurations.cashiers)
cashierList += `<sm-option value = "${cashier}">${cashier}</sm-option>`
cashierSelect.innerHTML = cashierList;
//load_deposit_complaints(cashierSelect.value)
load_withdraw_complaints(cashierSelect.value)
await Promise.all([load_deposit_complaints(cashierSelect.value), load_withdraw_complaints(cashierSelect.value)])
//load_pay_thru_cashier_complaints(cashierSelect.value)
userType.textContent = 'Helpline'
showPage(document.getElementById('helpline_page_btn'), 'helpline_page')
@ -11626,27 +11638,28 @@
const withdraw_msg = floDapps.getNextGeneralData(token_app.master_configurations.TYPE_WITHDRAWS, "0").reverse();
const user_msg = floDapps.getNextGeneralData(token_app.master_configurations.TYPE_MSGES, "0").reverse();
console.log(deposit_msg, withdraw_msg, user_msg)
depositActivityContainer.innerHTML = ``;
for (usr_deposits of deposit_msg) {
let { upi_txid, deposit_amount } = usr_deposits.message;
frag.append(render.depositActivity(usr_deposits.vectorClock, upi_txid, deposit_amount))
}
if (frag.children.length)
depositActivityContainer.innerHTML = ``;
depositActivityContainer.append(frag)
withdrawActivityContainer.innerHTML = ``;
for (usr_withdraws of withdraw_msg) {
let { token_txid, withdrawer_upi, withdraw_amount } = usr_withdraws.message;
frag.append(render.withdrawActivity(usr_withdraws.vectorClock, token_txid, withdrawer_upi, withdraw_amount))
}
if (frag.children.length)
withdrawActivityContainer.innerHTML = ``;
withdrawActivityContainer.append(frag)
cashierMessageContainer.innerHTML = ``;
for (msg of user_msg) {
frag.append(render.cashierMessage(msg))
}
if (frag.children.length)
cashierMessageContainer.innerHTML = ``;
cashierMessageContainer.append(frag)
} catch (e) {
notify(e, 'error');
@ -11812,6 +11825,7 @@
// Show details of unprocessed ones
console.log(unprocessed_deposits_complaints);
let uniqueComplaints = []
for (const udc of unprocessed_deposits_complaints) {
let all_users_deposits = floDapps.getNextGeneralData(token_app.master_configurations.TYPE_DEPOSITS, "0");
@ -11847,10 +11861,13 @@
processed: false
}
}
if (this_user_deposit.length)
if (this_user_deposit.length){
frag.append(render.depositComplaint(userData, cashierData, udc))
uniqueComplaints.push({userData, cashierData})
}
}
console.log(uniqueComplaints)
let container = document.getElementById('deposit_complaints_container');
container.innerHTML = ``
@ -12023,7 +12040,7 @@
complaint_type = token_app.master_configurations.TYPE_PROCESSED_PAY_THROUGH_CASHIER_COMPLAINT;
} else return false;
floCloudAPI.sendGeneralData(input_data, complaint_type,
floCloudAPI.sendGeneralData(input_data.message, complaint_type,
{ receiverID: token_app.master_configurations.helplineFloId });
notify('Complaint marked as resolved.');