Skip to content

Commit

Permalink
User info fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fastpok committed Oct 13, 2022
1 parent 9c9c7b6 commit c6e34f4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
8 changes: 4 additions & 4 deletions hexstody-operator/static/components/ExchangeRequestsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export const ExchangeRequestsTable = {
</div>
<Modal v-show="isModalVisible" @close="closeModal">
<template v-slot:header>
<h4>Exchange request details</h4>
<h4>Exchange request info</h4>
</template>
<template v-slot:body v-if="userInfo">
<p><b>First name:</b> {{userInfo.firstName}}</p>
<p><b>Last name:</b> {{userInfo.lastName}}</p>
<p><b>First name:</b> {{userInfo.firstName ? userInfo.firstName : ""}}</p>
<p><b>Last name:</b> {{userInfo.lastName ? userInfo.lastName : ""}}</p>
<p><b>Email:</b> {{userInfo.email ? userInfo.email.email : ""}}</p>
<p><b>Phone:</b> {{userInfo.phone ? userInfo.phone.number : ""}}</p>
<p><b>Telegram:</b> {{userInfo.tgName.tg_name}}</p>
<p><b>Telegram:</b> {{userInfo.tgName ? userInfo.tgName.tg_name : ""}}</p>
</template>
<template v-slot:footer>
</template>
Expand Down
39 changes: 35 additions & 4 deletions hexstody-operator/static/components/WithdrawalLimits.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ import {
getCurrencyName,
confirmLimitRequest,
rejectLimitRequest,
getUserInfo,
} from "../scripts/common.js"

import { Modal } from "./Modal.js"

export const WithdrawalLimits = {
components: {
Modal
},
template:
/*html*/
`<div>
Expand Down Expand Up @@ -55,13 +61,27 @@ export const WithdrawalLimits = {
<div class="action-buttons-wrapper justify-center">
<button class="button primary" @click="confirmRequest(limitRequest)" :disabled="limitRequest.status.type !== 'InProgress'">Confirm</button>
<button class="button error" @click="rejectRequest(limitRequest)" :disabled="limitRequest.status.type !== 'InProgress'">Reject</button>
<!-- <button class="button" @click="showRequestDetails(withdrawalRequest)">Details</button> -->
<button class="button" @click="showRequestDetails(limitRequest)">Details</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<Modal v-show="isModalVisible" @close="closeModal">
<template v-slot:header>
<h4>Request info</h4>
</template>
<template v-slot:body v-if="userInfo">
<p><b>First name:</b> {{userInfo.firstName ? userInfo.firstName : ""}}</p>
<p><b>Last name:</b> {{userInfo.lastName ? userInfo.lastName : ""}}</p>
<p><b>Email:</b> {{userInfo.email ? userInfo.email.email : ""}}</p>
<p><b>Phone:</b> {{userInfo.phone ? userInfo.phone.number : ""}}</p>
<p><b>Telegram:</b> {{userInfo.tgName ? userInfo.tgName.tg_name : ""}}</p>
</template>
<template v-slot:footer>
</template>
</Modal>
</div>`,
methods: {
truncate,
Expand Down Expand Up @@ -105,8 +125,17 @@ export const WithdrawalLimits = {
rejectLimitRequest(this.privateKeyJwk, this.publicKeyDer, confirmationData)
this.fetchData()
},
showRequestDetails(limitRequest) {
// show additional info about user and request
async showRequestDetails(limitRequest) {
const userInfoResponse = await getUserInfo(this.privateKeyJwk, this.publicKeyDer, limitRequest.user)
let userInfo = await userInfoResponse.json()
this.userInfo = userInfo
this.showModal()
},
showModal() {
this.isModalVisible = true
},
closeModal() {
this.isModalVisible = false
},
},
async created() {
Expand All @@ -119,7 +148,9 @@ export const WithdrawalLimits = {
return {
limitRequests: [],
requiredConfirmations: null,
filter: "all"
filter: "all",
isModalVisible: false,
userInfo: null,
}
},
inject: ['eventToggle', 'privateKeyJwk', 'publicKeyDer'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ export const WithdrawalRequestsTable = {
</div>
<Modal v-show="isModalVisible" @close="closeModal">
<template v-slot:header>
<h4>Withdrawal request details</h4>
<h4>Withdrawal request info</h4>
</template>
<template v-slot:body v-if="userInfo">
<p><b>First name:</b> {{userInfo.firstName}}</p>
<p><b>Last name:</b> {{userInfo.lastName}}</p>
<p><b>First name:</b> {{userInfo.firstName ? userInfo.firstName : ""}}</p>
<p><b>Last name:</b> {{userInfo.lastName ? userInfo.lastName : ""}}</p>
<p><b>Email:</b> {{userInfo.email ? userInfo.email.email : ""}}</p>
<p><b>Phone:</b> {{userInfo.phone ? userInfo.phone.number : ""}}</p>
<p><b>Telegram:</b> {{userInfo.tgName.tg_name}}</p>
<p><b>Telegram:</b> {{userInfo.tgName ? userInfo.tgName.tg_name : ""}}</p>
</template>
<template v-slot:footer>
</template>
Expand Down

0 comments on commit c6e34f4

Please sign in to comment.