Merge branch 'master' into send-coins-via-alias

This commit is contained in:
Moriz Wahl 2023-05-17 11:51:52 +02:00
commit b11238a35b
8 changed files with 71 additions and 52 deletions

View File

@ -13,7 +13,7 @@
</template>
<script>
import { formatDistanceToNow } from 'date-fns'
import { de, en, fr, es, nl } from 'date-fns/locale'
import { de, enUS as en, fr, es, nl } from 'date-fns/locale'
const locales = { en, de, es, fr, nl }

View File

@ -3,15 +3,23 @@
<div class="bg-white appBoxShadow gradido-border-radius p-3">
<div class="h3 mb-4">{{ $t('form.send_check') }}</div>
<b-row class="mt-5">
<b-col cols="2"></b-col>
<b-col>
<div class="h4">{{ userName ? userName : identifier }}</div>
<div class="mt-3 h5">{{ $t('form.memo') }}</div>
<div>{{ memo }}</div>
</b-col>
<b-col cols="3">
<div class="small">{{ $t('send_gdd') }}</div>
<div>{{ amount | GDD }}</div>
<b-col cols="12">
<b-row class="mt-3">
<b-col class="h5">{{ $t('form.recipientCommunity') }}</b-col>
<b-col>{{ communityName }}</b-col>
</b-row>
<b-row>
<b-col class="h5">{{ $t('form.recipient') }}</b-col>
<b-col>{{ userName ? userName : identifier }}</b-col>
</b-row>
<b-row>
<b-col class="h5">{{ $t('form.amount') }}</b-col>
<b-col>{{ amount | GDD }}</b-col>
</b-row>
<b-row>
<b-col class="h5">{{ $t('form.memo') }}</b-col>
<b-col>{{ memo }}</b-col>
</b-row>
</b-col>
</b-row>
@ -58,6 +66,8 @@
</div>
</template>
<script>
import { COMMUNITY_NAME } from '@/config'
export default {
name: 'TransactionConfirmationSend',
props: {
@ -70,6 +80,7 @@ export default {
data() {
return {
disabled: false,
communityName: COMMUNITY_NAME,
}
},
}

View File

@ -49,6 +49,14 @@
<b-row>
<b-col>
<b-row>
<b-col class="mb-4" cols="12" v-if="radioSelected === sendTypes.send">
<b-row>
<b-col>{{ $t('form.recipientCommunity') }}</b-col>
</b-row>
<b-row>
<b-col class="font-weight-bold">{{ communityName }}</b-col>
</b-row>
</b-col>
<b-col cols="12" v-if="radioSelected === sendTypes.send">
<div v-if="!gradidoID">
<input-email
@ -131,6 +139,7 @@ import InputAmount from '@/components/Inputs/InputAmount'
import InputTextarea from '@/components/Inputs/InputTextarea'
import { user as userQuery } from '@/graphql/queries'
import { isEmpty } from 'lodash'
import { COMMUNITY_NAME } from '@/config'
export default {
name: 'TransactionForm',
@ -155,6 +164,7 @@ export default {
},
radioSelected: this.selected,
userName: '',
communityName: COMMUNITY_NAME,
}
},
methods: {

View File

@ -9,28 +9,27 @@
v-slot="{ errors, valid, validated, ariaInput, ariaMsg }"
>
<b-form-group :label-for="labelFor">
<b-input-group>
<b-form-input
v-model="currentValue"
v-bind="ariaInput"
:id="labelFor"
:name="name"
:placeholder="placeholder"
type="text"
:state="validated ? valid : false"
></b-form-input>
<b-form-invalid-feedback v-bind="ariaMsg">
<div v-if="showAllErrors">
<span v-for="error in errors" :key="error">
{{ error }}
<br />
</span>
</div>
<div v-else>
{{ errors[0] }}
</div>
</b-form-invalid-feedback>
</b-input-group>
<b-form-input
v-model="currentValue"
v-bind="ariaInput"
:id="labelFor"
:name="name"
:placeholder="placeholder"
type="text"
:state="validated ? valid : false"
autocomplete="off"
></b-form-input>
<b-form-invalid-feedback v-bind="ariaMsg">
<div v-if="showAllErrors">
<span v-for="error in errors" :key="error">
{{ error }}
<br />
</span>
</div>
<div v-else>
{{ errors[0] }}
</div>
</b-form-invalid-feedback>
</b-form-group>
</validation-provider>
</template>

View File

@ -12,7 +12,7 @@
</template>
<script>
import { formatDistance } from 'date-fns'
import { en, de, es, fr, nl } from 'date-fns/locale'
import { enUS as en, de, es, fr, nl } from 'date-fns/locale'
const locales = { en, de, es, fr, nl }

View File

@ -153,6 +153,7 @@
"password_new_repeat": "Neues Passwort wiederholen",
"password_old": "Altes Passwort",
"recipient": "Empfänger",
"recipientCommunity": "Gemeinschaft des Empfängers",
"reply": "Antworten",
"reset": "Zurücksetzen",
"save": "Speichern",
@ -326,7 +327,7 @@
"username": {
"change-success": "Dein Nutzername wurde erfolgreich geändert.",
"change-username": "Nutzername ändern",
"no-username": "Bitte gebe einen Nutzernamen ein. Damit hilfst du anderen Benutzern dich zu finden, ohne ihnen deine Email geben zu müsen."
"no-username": "Bitte gebe einen Nutzernamen ein. Damit hilfst du anderen Benutzern dich zu finden, ohne deine Email preisgeben zu müssen."
}
},
"signin": "Anmelden",

View File

@ -153,6 +153,7 @@
"password_new_repeat": "Repeat new password",
"password_old": "Old password",
"recipient": "Recipient",
"recipientCommunity": "Community of the recipient",
"reply": "Reply",
"reset": "Reset",
"save": "Save",
@ -172,7 +173,7 @@
"gddCreationTime": "The field {_field_} must be a number between {min} and {max} with at most one decimal place.",
"gddSendAmount": "The {_field_} field must be a number between {min} and {max} with at most two digits after the decimal point",
"is-not": "You cannot send Gradidos to yourself",
"username-allowed-chars": "The username may contain letters, numbers, hyphens or underscores.",
"username-allowed-chars": "The username may only contain letters, numbers, hyphens or underscores.",
"username-hyphens": "Hyphens or underscores must be in between letters or numbers.",
"username-unique": "This username is already taken."
},
@ -324,9 +325,9 @@
"showAmountGDD": "Your GDD amount is visible.",
"showAmountGDT": "Your GDT amount is visible.",
"username": {
"change-success": "Your username has been successfully changed.",
"change-success": "Your username has been changed successfully.",
"change-username": "Change username",
"no-username": "Please enter a username. This helps other users to find you without giving them your email."
"no-username": "Please enter a username. This helps other users to find you without exposing your email."
}
},
"signin": "Sign in",

View File

@ -134,27 +134,24 @@ export const loadAllRules = (i18nCallback, apollo) => {
extend('usernameHyphens', {
validate(value) {
return !!value.match(/^[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9])*$/)
return !!value.match(/^[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+?)*$/)
},
message: (_, values) => i18nCallback.t('form.validation.username-hyphens', values),
})
extend('usernameUnique', {
validate(value) {
if (value.match(/^(?=.{3,20}$)[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+?)*$/)) {
return apollo
.query({
query: checkUsername,
variables: { username: value },
})
.then(({ data }) => {
return {
valid: data.checkUsername,
}
})
} else {
return false
}
if (!value.match(/^(?=.{3,20}$)[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+?)*$/)) return true
return apollo
.query({
query: checkUsername,
variables: { username: value },
})
.then(({ data }) => {
return {
valid: data.checkUsername,
}
})
},
message: (_, values) => i18nCallback.t('form.validation.username-unique', values),
})