mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1416 from gradido/1401-Admin-interface-does-user-have-member-area
admin interface does user have member area
This commit is contained in:
commit
bd7aab1437
@ -64,6 +64,13 @@
|
||||
</b-button>
|
||||
</template>
|
||||
|
||||
<template #cell(has_elopage)="row">
|
||||
<b-icon
|
||||
:variant="row.item.hasElopage ? 'success' : 'danger'"
|
||||
:icon="row.item.hasElopage ? 'check-circle' : 'x-circle'"
|
||||
></b-icon>
|
||||
</template>
|
||||
|
||||
<template #cell(transactions_list)="row">
|
||||
<b-button variant="warning" size="md" @click="rowToogleDetails(row, 2)" class="mr-2">
|
||||
<b-icon icon="list"></b-icon>
|
||||
|
||||
@ -16,6 +16,7 @@ export const searchUsers = gql`
|
||||
email
|
||||
creation
|
||||
emailChecked
|
||||
hasElopage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +106,7 @@ export default {
|
||||
},
|
||||
{ key: 'show_details', label: this.$t('details') },
|
||||
{ key: 'confirm_mail', label: this.$t('confirmed') },
|
||||
{ key: 'has_elopage', label: 'elopage' },
|
||||
{ key: 'transactions_list', label: this.$t('transaction') },
|
||||
]
|
||||
},
|
||||
|
||||
@ -19,6 +19,9 @@ export class UserAdmin {
|
||||
|
||||
@Field(() => Boolean)
|
||||
emailChecked: boolean
|
||||
|
||||
@Field(() => Boolean)
|
||||
hasElopage: boolean
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
|
||||
@ -21,6 +21,7 @@ import { UserTransactionRepository } from '../../typeorm/repository/UserTransact
|
||||
import { BalanceRepository } from '../../typeorm/repository/Balance'
|
||||
import { calculateDecay } from '../../util/decay'
|
||||
import { AdminPendingCreation } from '@entity/AdminPendingCreation'
|
||||
import { hasElopageBuys } from '../../util/hasElopageBuys'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
|
||||
@Resolver()
|
||||
@ -41,6 +42,7 @@ export class AdminResolver {
|
||||
adminUser.email = user.email
|
||||
adminUser.creation = await getUserCreations(user.id)
|
||||
adminUser.emailChecked = await hasActivatedEmail(user.email)
|
||||
adminUser.hasElopage = await hasElopageBuys(user.email)
|
||||
return adminUser
|
||||
}),
|
||||
)
|
||||
|
||||
@ -21,7 +21,7 @@ import { sendAccountActivationEmail } from '../../mailer/sendAccountActivationEm
|
||||
import { klicktippSignIn } from '../../apis/KlicktippController'
|
||||
import { RIGHTS } from '../../auth/RIGHTS'
|
||||
import { ROLE_ADMIN } from '../../auth/ROLES'
|
||||
import { LoginElopageBuys } from '@entity/LoginElopageBuys'
|
||||
import { hasElopageBuys } from '../../util/hasElopageBuys'
|
||||
import { ServerUser } from '@entity/ServerUser'
|
||||
|
||||
const EMAIL_OPT_IN_RESET_PASSWORD = 2
|
||||
@ -661,7 +661,6 @@ export class UserResolver {
|
||||
return false
|
||||
}
|
||||
|
||||
const elopageBuyCount = await LoginElopageBuys.count({ payerEmail: userEntity.email })
|
||||
return elopageBuyCount > 0
|
||||
return hasElopageBuys(userEntity.email)
|
||||
}
|
||||
}
|
||||
|
||||
6
backend/src/util/hasElopageBuys.ts
Normal file
6
backend/src/util/hasElopageBuys.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { LoginElopageBuys } from '@entity/LoginElopageBuys'
|
||||
|
||||
export async function hasElopageBuys(email: string): Promise<boolean> {
|
||||
const elopageBuyCount = await LoginElopageBuys.count({ payerEmail: email })
|
||||
return elopageBuyCount > 0
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user