mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-20 20:01:31 +00:00
Merge branch 'master' into community_gdd_float_balance
This commit is contained in:
commit
ed554073dc
@ -99,12 +99,12 @@ class TransactionTransfer extends TransactionBase {
|
||||
->where(['public_key' => $senderPublic])
|
||||
->contain(['StateBalances' => ['fields' => ['amount', 'state_user_id']]])->first();
|
||||
if(!$user) {
|
||||
$this->addError($functionName, 'couldn\'t find sender ' . $i .' in db' );
|
||||
$this->addError($functionName, 'couldn\'t find sender in db' );
|
||||
return false;
|
||||
}
|
||||
//var_dump($user);
|
||||
if(intval($user->state_balances[0]->amount) < intval($amount)) {
|
||||
$this->addError($functionName, 'sender ' . $i . ' hasn\t enough GDD');
|
||||
$this->addError($functionName, 'sender hasn\t enough GDD');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class TransactionTransfer extends TransactionBase {
|
||||
// check if receiver exist
|
||||
$receiver_user = $stateUsersTable->find('all')->select(['id'])->where(['public_key' => $receiver_public_key])->first();
|
||||
if(!$receiver_user) {
|
||||
$this->addError($functionName, 'couldn\'t find receiver ' . $i .' in db' );
|
||||
$this->addError($functionName, 'couldn\'t find receiver in db' );
|
||||
return false;
|
||||
}
|
||||
if($amount < 0) {
|
||||
|
||||
@ -35,8 +35,10 @@ const communityAPI = {
|
||||
balance: async (session_id) => {
|
||||
return apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + session_id)
|
||||
},
|
||||
transactions: async (session_id) => {
|
||||
return apiGet(CONFIG.COMMUNITY_API_URL + 'listTransactions/1/25/ASC/' + session_id)
|
||||
transactions: async (session_id, firstPage = 1, items = 25, order = 'DESC') => {
|
||||
return apiGet(
|
||||
`${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${session_id}`,
|
||||
)
|
||||
},
|
||||
/*create: async (session_id, email, amount, memo, target_date = new Date() ) => {
|
||||
const payload = {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"form": {
|
||||
"attention": "<strong>Achtung!</strong> Bitte überprüfe alle deine Eingaben sehr genau. Du bist alleine Verantwortlich für deine Entscheidungen. Versendete Gradidos können nicht wieder zurück geholt werden.",
|
||||
"cancel":"Abbrechen",
|
||||
"reset": "Zurücksetzen",
|
||||
"close":"schließen",
|
||||
"receiver":"Empfänger",
|
||||
"sender":"Absender",
|
||||
@ -45,6 +46,9 @@
|
||||
"thx":"Danke,",
|
||||
"send_success":"deine Transaktion wurde erfolgreich ausgeführt"
|
||||
},
|
||||
"error": {
|
||||
"error":"Fehler"
|
||||
},
|
||||
"transaction":{
|
||||
"show_all":"Alle <strong>{count}</strong> Transaktionen ansehen",
|
||||
"nullTransactions":"Du hast noch keine Transaktionen auf deinem Konto.",
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"form": {
|
||||
"attention": "Achtung! Bitte überprüfe alle deine Eingaben sehr genau. Du bist alleine Verantwortlich für deine Entscheidungen. Versendete Gradidos können nicht wieder zurück geholt werden.",
|
||||
"cancel":"Cancel",
|
||||
"reset": "Reset",
|
||||
"close":"Close",
|
||||
"receiver":"Receiver",
|
||||
"sender":"Sender",
|
||||
@ -45,6 +46,9 @@
|
||||
"thx":"Thank you,",
|
||||
"send_success":"your transaction was successfully completed"
|
||||
},
|
||||
"error": {
|
||||
"error":"Error"
|
||||
},
|
||||
"transaction":{
|
||||
"show_part": "The last <strong>{count}</strong> transactions",
|
||||
"nullTransactions":"You don't have any transactions on your account yet.",
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<router-view></router-view>
|
||||
<content-footer v-if="!$route.meta.hideFooter"></content-footer>
|
||||
</div>
|
||||
</template>
|
||||
<div class="wrapper">
|
||||
<div class="main-content">
|
||||
<router-view></router-view>
|
||||
<content-footer v-if="!$route.meta.hideFooter"></content-footer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
<div>
|
||||
<!-- Header -->
|
||||
<div class="header py-1 py-lg-1 pt-lg-3">
|
||||
<b-container>xx</b-container>
|
||||
<b-container>
|
||||
<div class="header-body text-center mb-3">
|
||||
<a href="/login" to="/login">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<base-header class="pb-6 pb-8 pt-5 pt-md-8 bg-transparent"></base-header>
|
||||
<b-container fluid class="mt--7">
|
||||
<base-header class="pb-4 pt-2 bg-transparent"></base-header>
|
||||
<b-container fluid class="p-2">
|
||||
<gdd-status v-if="showTransactionList" :balance="balance" :gdt-balance="GdtBalance" />
|
||||
<br />
|
||||
<gdd-send
|
||||
|
||||
@ -120,7 +120,7 @@ describe('GddSend', () => {
|
||||
})
|
||||
|
||||
it('has the text "form.cancel"', () => {
|
||||
expect(wrapper.find('button[type="reset"]').text()).toBe('form.cancel')
|
||||
expect(wrapper.find('button[type="reset"]').text()).toBe('form.reset')
|
||||
})
|
||||
|
||||
it.skip('clears the email field on click', async () => {
|
||||
|
||||
@ -121,8 +121,8 @@
|
||||
<br />
|
||||
<b-row>
|
||||
<b-col>
|
||||
<b-button type="reset" variant="secondary">
|
||||
{{ $t('form.cancel') }}
|
||||
<b-button type="reset" variant="secondary" @click="onReset">
|
||||
{{ $t('form.reset') }}
|
||||
</b-button>
|
||||
</b-col>
|
||||
<b-col class="text-right">
|
||||
@ -275,6 +275,7 @@ export default {
|
||||
event.preventDefault()
|
||||
this.form.email = ''
|
||||
this.form.amount = ''
|
||||
this.form.memo = ''
|
||||
this.show = false
|
||||
this.$emit('toggle-show-list', true)
|
||||
this.row_check = false
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-row>
|
||||
<b-col xl="6" md="6">
|
||||
<b-row v-show="showTransactionList">
|
||||
<b-col col="6">
|
||||
<stats-card
|
||||
type="gradient-red"
|
||||
sub-title="balance_gdd"
|
||||
@ -11,7 +11,7 @@
|
||||
{{ $n(balance) }} GDD
|
||||
</stats-card>
|
||||
</b-col>
|
||||
<b-col xl="6" md="6">
|
||||
<b-col col="6">
|
||||
<stats-card
|
||||
type="gradient-orange"
|
||||
sub-title="balance_gdt"
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<b-row class="justify-content-center">
|
||||
<b-col lg="6" md="8">
|
||||
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="px-lg-5 py-lg-5">
|
||||
<b-card-body class="p-4">
|
||||
<validation-observer v-slot="{ handleSubmit }" ref="formValidator">
|
||||
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
|
||||
<base-input
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="login-form">
|
||||
<!-- Header -->
|
||||
<div class="header p-4">
|
||||
<div class="p-3">
|
||||
<b-container>
|
||||
<div class="text-center mb-7">
|
||||
<div class="text-center mb-7 header">
|
||||
<b-row class="justify-content-center">
|
||||
<b-col xl="5" lg="6" md="8" class="px-2">
|
||||
<h1>Gradido</h1>
|
||||
@ -14,11 +14,11 @@
|
||||
</b-container>
|
||||
</div>
|
||||
<!-- Page content -->
|
||||
<b-container class="mt--8 p-1">
|
||||
<b-container class="mt--8">
|
||||
<b-row class="justify-content-center">
|
||||
<b-col lg="5" md="7">
|
||||
<b-card no-body class="border-0 mb-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="py-lg-4 px-sm-0 px-0 px-md-2 px-lg-4">
|
||||
<b-card-body class="p-4">
|
||||
<div class="text-center text-muted mb-4">
|
||||
<small>{{ $t('login') }}</small>
|
||||
</div>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<b-row class="justify-content-center">
|
||||
<b-col lg="6" md="8">
|
||||
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="py-lg-4 px-sm-0 px-0 px-md-2 px-lg-4">
|
||||
<b-card-body class="p-4">
|
||||
<div class="text-center text-muted mb-4">
|
||||
<small>{{ $t('signup') }}</small>
|
||||
</div>
|
||||
@ -110,6 +110,20 @@
|
||||
</base-input>
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-alert
|
||||
v-if="showError"
|
||||
show
|
||||
dismissible
|
||||
variant="warning"
|
||||
@dismissed="closeAlert"
|
||||
>
|
||||
<span class="alert-icon"><i class="ni ni-point"></i></span>
|
||||
<span class="alert-text">
|
||||
<strong>{{ $t('error.error') }}!</strong>
|
||||
{{ messageError }}
|
||||
</span>
|
||||
</b-alert>
|
||||
|
||||
<div
|
||||
class="text-center"
|
||||
v-if="
|
||||
@ -160,6 +174,8 @@ export default {
|
||||
checkPassword: '',
|
||||
passwordVisible: false,
|
||||
submitted: false,
|
||||
showError: false,
|
||||
messageError: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -184,11 +200,18 @@ export default {
|
||||
this.password = ''
|
||||
this.$router.push('/thx')
|
||||
} else {
|
||||
// todo: Display a proper error message!
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
this.showError = true
|
||||
this.messageError = result.result.message
|
||||
}
|
||||
},
|
||||
closeAlert() {
|
||||
this.showError = false
|
||||
this.messageError = ''
|
||||
this.model.email = ''
|
||||
this.model.firstname = ''
|
||||
this.model.lastname = ''
|
||||
this.password = ''
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
samePasswords() {
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<b-row class="justify-content-center">
|
||||
<b-col lg="6" md="8">
|
||||
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="py-lg-4 px-sm-0 px-0 px-md-2 px-lg-4">
|
||||
<b-card-body class="p-4">
|
||||
<validation-observer v-slot="{ handleSubmit }" ref="formValidator">
|
||||
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
|
||||
<b-form-group :label="$t('form.password')">
|
||||
|
||||
@ -118,7 +118,7 @@ Poco::JSON::Object* JsonUnsecureLogin::handle(Poco::Dynamic::Var params)
|
||||
default:
|
||||
result->set("state", "error");
|
||||
result->set("msg", "unknown user state");
|
||||
result->set("details", USER_NO_GROUP);
|
||||
result->set("details", user_state);
|
||||
}
|
||||
|
||||
sm->releaseSession(session);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user