mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
add option for disable cross tx link redeem, fix code that simple redeeming is working
This commit is contained in:
parent
f737c9d4a0
commit
801ef9da0a
@ -81,6 +81,8 @@ watch(
|
||||
|
||||
const normalizeAmount = (inputValue) => {
|
||||
amountFocused.value = false
|
||||
value.value = inputValue.replace(',', '.')
|
||||
if (typeof inputValue === 'string' && inputValue.length > 1) {
|
||||
value.value = inputValue.replace(',', '.')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="redeem-logged-out">
|
||||
<redeem-information v-bind="props.linkData" :is-contribution-link="props.isContributionLink" />
|
||||
<redeem-information :link-data="linkData" :is-contribution-link="isContributionLink" />
|
||||
|
||||
<BCard>
|
||||
<div class="mb-2">
|
||||
@ -27,7 +27,7 @@
|
||||
import { useAuthLinks } from '@/composables/useAuthLinks'
|
||||
|
||||
const { login, register } = useAuthLinks()
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
linkData: { type: Object, required: true },
|
||||
isContributionLink: { type: Boolean, default: false },
|
||||
})
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="redeem-self-creator">
|
||||
<redeem-information v-bind="linkData" :is-contribution-link="isContributionLink" />
|
||||
<redeem-information :link-data="linkData" :is-contribution-link="isContributionLink" />
|
||||
|
||||
<BCard>
|
||||
<div class="mb-3 text-center">
|
||||
|
||||
@ -41,6 +41,7 @@ const features = {
|
||||
GMS_ACTIVE: process.env.GMS_ACTIVE === 'true',
|
||||
HUMHUB_ACTIVE: process.env.HUMHUB_ACTIVE === 'true',
|
||||
AUTO_POLL_INTERVAL: Number.parseInt(process.env.AUTO_POLL_INTERVAL ?? 0),
|
||||
CROSS_TX_REDEEM_LINK_ACTIVE: process.env.CROSS_TX_REDEEM_LINK_ACTIVE === 'true',
|
||||
}
|
||||
|
||||
const environment = {
|
||||
|
||||
@ -54,6 +54,11 @@ module.exports = Joi.object({
|
||||
.description('URL for Register a new Account in frontend.')
|
||||
.required(),
|
||||
|
||||
CROSS_TX_REDEEM_LINK_ACTIVE: Joi.boolean()
|
||||
.description('Enable cross-community redeem links')
|
||||
.default(false)
|
||||
.optional(),
|
||||
|
||||
FRONTEND_HOSTING: Joi.string()
|
||||
.valid('nodejs', 'nginx')
|
||||
.description('set to `nodejs` if frontend is hosted by vite with a own nodejs instance')
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
<div class="show-transaction-link-informations">
|
||||
<div v-if="isTransactionLinkLoaded" class="mt-4">
|
||||
<transaction-link-item :type="itemTypeExt">
|
||||
<template #LOGGED_OUT>
|
||||
<redeem-logged-out :link-data="linkData" :is-contribution-link="isContributionLink" />
|
||||
</template>
|
||||
<template #REDEEM_SELECT_COMMUNITY>
|
||||
<redeem-select-community
|
||||
:link-data="linkData"
|
||||
@ -40,6 +43,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { useStore } from 'vuex'
|
||||
import { useQuery, useMutation } from '@vue/apollo-composable'
|
||||
import TransactionLinkItem from '@/components/TransactionLinkItem'
|
||||
import RedeemLoggedOut from '@/components/LinkInformations/RedeemLoggedOut'
|
||||
import RedeemSelectCommunity from '@/components/LinkInformations/RedeemSelectCommunity'
|
||||
import RedeemSelfCreator from '@/components/LinkInformations/RedeemSelfCreator'
|
||||
import RedeemValid from '@/components/LinkInformations/RedeemValid'
|
||||
@ -48,6 +52,7 @@ import { useAppToast } from '@/composables/useToast'
|
||||
import { queryTransactionLink } from '@/graphql/queries'
|
||||
import { disburseTransactionLink, redeemTransactionLink } from '@/graphql/mutations'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import CONFIG from '@/config'
|
||||
|
||||
const { toastError, toastSuccess } = useAppToast()
|
||||
const router = useRouter()
|
||||
@ -207,8 +212,12 @@ const itemType = computed(() => {
|
||||
return 'VALID'
|
||||
}
|
||||
}
|
||||
// console.log('TransactionLink.itemType...last return= REDEEM_SELECT_COMMUNITY')
|
||||
return 'REDEEM_SELECT_COMMUNITY'
|
||||
if (CONFIG.CROSS_TX_REDEEM_LINK_ACTIVE) {
|
||||
// console.log('TransactionLink.itemType...last return= REDEEM_SELECT_COMMUNITY')
|
||||
return 'REDEEM_SELECT_COMMUNITY'
|
||||
} else {
|
||||
return 'LOGGED_OUT'
|
||||
}
|
||||
})
|
||||
|
||||
const itemTypeExt = computed(() => {
|
||||
|
||||
@ -6,7 +6,7 @@ export const isLanguageKey = (str) =>
|
||||
|
||||
export const translateYupErrorString = (error, t) => {
|
||||
const type = typeof error
|
||||
if (type === 'object') {
|
||||
if (type === 'object' && error.key && typeof error.key === 'string') {
|
||||
return t(error.key, error.values)
|
||||
} else if (type === 'string' && error.length > 0 && isLanguageKey(error)) {
|
||||
return t(error)
|
||||
|
||||
@ -113,6 +113,7 @@ export default defineConfig(async ({ command }) => {
|
||||
EnvironmentPlugin({
|
||||
AUTO_POLL_INTERVAL: CONFIG.AUTO_POLL_INTERVAL,
|
||||
BUILD_COMMIT: CONFIG.BUILD_COMMIT,
|
||||
CROSS_TX_REDEEM_LINK_ACTIVE: CONFIG.CROSS_TX_REDEEM_LINK_ACTIVE,
|
||||
GMS_ACTIVE: CONFIG.GMS_ACTIVE,
|
||||
HUMHUB_ACTIVE: CONFIG.HUMHUB_ACTIVE,
|
||||
DEFAULT_PUBLISHER_ID: null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user