Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix typo #407

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/components/Dialog/DialogDeleteConfirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@
</div>
<div align="center" class="pb-5">
<strong>Are you sure you want delete this {{ type }}?</strong>
<div class= "d-flex justify-space-between mt-3 px-16" >
<div>
<span
style="font-size: 12px"
> Estimated Transaction Weight </span>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="primary"
size="14"
v-bind="attrs"
v-on="on"
> mdi-alert-circle-outline
</v-icon>
</template>
<span style="font-size: 10px;">Total fee paid in DBIO to execute this transaction.</span>
</v-tooltip>
</div>
<span style="font-size: 12px;">
{{ Number(fee).toFixed(4) }} DBIO
</span>
</div>
</div>
<div class="d-flex justify-center pb-5">
<v-col lg="5" md="5" sm="8">
Expand Down Expand Up @@ -38,7 +60,8 @@ export default {

props: {
show: Boolean,
type: String
type: String,
fee: { type: [String, Number]}
},

methods: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
<template>
<div>
<template>
<v-card class="mt-10 px-10" v-if="specimenStatus === 'WorkWet'">
<input
type="file"
style="display: none"
ref="encryptUploadGenome"
accept=".vcf"
/>
<div v-if="hasGenomeFile" class="d-flex mt-5 mb-5">
<v-row >
<v-col>
<b class="secondary--text card-header mb-2" style="display: block">VCF Data</b>
<div v-for="(file, idx) in files.genome" :key="idx + '-' + file.fileName + '-' + file.fileType">
<FileCard
:filename="file.fileName"
:ipfsUrl="file.ipfsPath"
:view-only="submitted"
@edit="onEditClick('genome')"
@delete="onFileDelete('genome')"
/>
</div>
</v-col>
</v-row>
</div>
<div v-else class="mb-3 mt-3">
<div class= "d-flex justify-space-between">
<div class="mb-5 mt-5">
<span
Expand All @@ -26,33 +48,7 @@
</span>
</div>
</div>
</v-card>
</template>

<template>
<input
type="file"
style="display: none"
ref="encryptUploadGenome"
accept=".vcf"
/>
<div v-if="hasGenomeFile" class="d-flex mt-5 mb-5">
<v-row >
<v-col>
<b class="secondary--text card-header mb-2" style="display: block">VCF Data</b>
<div v-for="(file, idx) in files.genome" :key="idx + '-' + file.fileName + '-' + file.fileType">
<FileCard
:filename="file.fileName"
:ipfsUrl="file.ipfsPath"
:view-only="submitted"
@edit="onEditClick('genome')"
@delete="onFileDelete('genome')"
/>
</div>
</v-col>
</v-row>
</div>
<div v-else class="mb-3 mt-3">
<v-btn
color="primary"
large
Expand Down Expand Up @@ -100,6 +96,30 @@
</v-row>
</div>
<div v-else class="mb-3">
<div class= "d-flex justify-space-between" v-if="!uploadReportDisabled">
<div class="mb-5 mt-5">
<span
style="font-size: 12px"
> Estimated Transaction Weight </span>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="primary"
size="14"
v-bind="attrs"
v-on="on"
> mdi-alert-circle-outline
</v-icon>
</template>
<span style="font-size: 10px;">Total fee paid in DBIO to execute this transaction.</span>
</v-tooltip>
</div>
<div class="mt-5">
<span style="font-size: 12px;">
{{ Number(fee).toFixed(4) }} DBIO
</span>
</div>
</div>
<v-btn
color="primary"
large
Expand Down Expand Up @@ -130,7 +150,7 @@
block
class="mt-6"
:disabled="isLoading"
@click="confirmationDialog = true"
@click="showConfirmationDialog"
>
Submit Result
<template v-slot:loader>
Expand Down Expand Up @@ -160,7 +180,7 @@
@close="reportUploadSucceedDialog = false"
/>

<Dialog :show="confirmationDialog" @close="!confirmationDialog">
<Dialog :show="confirmationDialog" @close="confirmationDialog = false">
<template v-slot:title>
<div></div>
</template>
Expand All @@ -169,6 +189,30 @@
<v-img v-bind:src="require('@/assets/debio-logo.png')" max-width="50" />
</div>
<div align="center" class="pb-5">Are you sure you want to submit the results?</div>
<div class= "d-flex justify-space-between px-5">
<div class="mt-5">
<span
style="font-size: 12px"
> Estimated Transaction Weight </span>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="primary"
size="14"
v-bind="attrs"
v-on="on"
> mdi-alert-circle-outline
</v-icon>
</template>
<span style="font-size: 10px;">Total fee paid in DBIO to execute this transaction.</span>
</v-tooltip>
</div>
<div class="mt-5">
<span style="font-size: 12px;">
{{ Number(fee).toFixed(4) }} DBIO
</span>
</div>
</div>
</template>
<template v-slot:actions>
<v-col col="12" md="6">
Expand Down Expand Up @@ -196,7 +240,7 @@ import Dialog from "@/components/Dialog"
import { u8aToHex } from "@polkadot/util"
import Button from "@/components/Button"
import { uploadFile, getFileUrl, getIpfsMetaData } from "@/lib/pinata-proxy"
import { submitTestResult, processDnaSample, submitTestResultFee } from "@/lib/polkadotProvider/command/geneticTesting"
import { submitTestResult, processDnaSample, submitTestResultFee, processDnaSampleFee } from "@/lib/polkadotProvider/command/geneticTesting"
import { queryDnaTestResults } from "@/lib/polkadotProvider/query/geneticTesting"
import localStorage from "@/lib/local-storage"

Expand Down Expand Up @@ -359,7 +403,7 @@ export default {
},

async getFee() {
const fee = await submitTestResultFee(this.api, this.pair, this.specimenNumber, this.nextStatus)
const fee = await submitTestResultFee(this.api, this.pair, this.specimenNumber)
this.fee = this.web3.utils.fromWei(String(fee.partialFee), "ether")
},

Expand Down Expand Up @@ -390,6 +434,13 @@ export default {
)
},

async showConfirmationDialog() {
const fee = await processDnaSampleFee(this.api, this.pair, this.specimenNumber, "ResultReady")
this.fee = this.web3.utils.fromWei(String(fee.partialFee), "ether")

this.confirmationDialog = true
},

async resultReady() {
this.isProcessing = true
await this.dispatch(
Expand Down
15 changes: 12 additions & 3 deletions src/views/Dashboard/Lab/Registration/Services/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
</v-card-text>
</v-card>
<DialogDelete
:fee="fee"
:show="deleteConfirmation"
type="service"
@close="toggleDelete"
Expand All @@ -70,7 +71,7 @@
<script>
import { mapGetters, mapState } from "vuex"
import serviceHandler from "@/mixins/serviceHandler"
import { deleteService } from "@/lib/polkadotProvider/command/services"
import { deleteService, deleteServiceFee } from "@/lib/polkadotProvider/command/services"
import DialogDelete from "@/components/Dialog/DialogDeleteConfirmation"

export default {
Expand All @@ -84,7 +85,8 @@ export default {

data: () => ({
deleteConfirmation: false,
service: null
service: null,
fee: 0
}),

computed: {
Expand All @@ -109,14 +111,21 @@ export default {
this.$emit("edit-service", service)
},

toggleDelete(service) {
async toggleDelete(service) {
if (service) {
this.service = service
this.deleteConfirmation = true
} else {
this.service = null
this.deleteConfirmation = false
}

await this.getDeleteFee()
},

async getDeleteFee() {
const fee = await deleteServiceFee(this.api, this.pair, this.service.id)
this.fee = this.web3.utils.fromWei(String(fee.partialFee), "ether")
},

async deleteService() {
Expand Down
15 changes: 13 additions & 2 deletions src/views/Dashboard/Lab/Registration/Services/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,19 @@ export default {

clearServicesForm() {
this.$refs.serviceForm.resetValidation()
this.$refs.serviceForm.reset()
this.document.durationType = "Days"
this.document = {
category: "",
dnaCollectionProcess: "",
name: "",
currency: "DAI",
price: 0,
qcPrice: 0,
description: "",
longDescription: "",
duration: "",
durationType: "Days"
},
this.testResultSampleFile = ""
this.imageUrl = ""
this.fee = 0
},
Expand Down