add transactionsEnabled : enable the circuit to the transactions

This commit is contained in:
Paolo Arena
2022-09-22 11:06:04 +02:00
parent 7358216e6f
commit bc2080c42c
19 changed files with 53 additions and 22 deletions

View File

@@ -1085,6 +1085,8 @@ export default defineComponent({
date_updated: 1,
nome_valuta: 1,
fido_scoperto_default: 1,
deperimento: 1,
transactionsEnabled: 1,
qta_max_default: 1,
valuta_per_euro: 1,
symbol: 1,

View File

@@ -908,6 +908,7 @@
</q-card-actions>
</q-card>
</q-dialog>
<br />
</div>
</template>
<script lang="ts" src="./CGridTableRec.ts">

View File

@@ -315,6 +315,7 @@
<CSendCoins
:showprop="showsendCoinTo"
:to_user="contact"
:circuitname="circuitname"
@close="showsendCoinTo = false"
>

View File

@@ -18,6 +18,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
circuitname: {
type: String,
default: ''
},
to_user: {
type: Object as PropType<IUserFields>,
required: true,
@@ -109,7 +113,11 @@ export default defineComponent({
console.log('user', props.to_user)
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
if (props.circuitname) {
circuitsel.value = props.circuitname
} else {
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
}
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
circuitsel.value = bothcircuits.value[0]
}

View File

@@ -34,6 +34,15 @@
</CMyUserOnlyView>
<div v-if="circuitloaded">
<q-banner
v-if="!circuitloaded.transactionsEnabled"
rounded
class="bg-red text-white"
style="text-align: center;"
>
<em style="font-weight: bold">{{ $t('circuit.transactionsEnabled_text') }}</em><br>
</q-banner>
<q-input
ref="qtyRef"
class="q-py-sm text-h5"
@@ -82,7 +91,7 @@
<q-card-actions align="center">
<q-btn
v-if="circuitloaded"
:disable="qtyRef ? qtyRef.hasError : false"
:disable="qtyRef ? (qtyRef.hasError || !circuitloaded.transactionsEnabled) : false"
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="positive"
@click="sendCoin()"></q-btn>
<q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup></q-btn>