mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge changes from last branch.
This commit is contained in:
commit
ea9bf54c16
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -441,7 +441,7 @@ jobs:
|
|||||||
report_name: Coverage Admin Interface
|
report_name: Coverage Admin Interface
|
||||||
type: lcov
|
type: lcov
|
||||||
result_path: ./coverage/lcov.info
|
result_path: ./coverage/lcov.info
|
||||||
min_coverage: 52
|
min_coverage: 53
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -491,7 +491,7 @@ jobs:
|
|||||||
report_name: Coverage Backend
|
report_name: Coverage Backend
|
||||||
type: lcov
|
type: lcov
|
||||||
result_path: ./backend/coverage/lcov.info
|
result_path: ./backend/coverage/lcov.info
|
||||||
min_coverage: 37
|
min_coverage: 39
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
|
|
||||||
<b-row class="m-4" v-show="createdIndex != null">
|
<b-row class="m-4" v-show="createdIndex">
|
||||||
<label>Betrag Auswählen</label>
|
<label>Betrag Auswählen</label>
|
||||||
<div>
|
<div>
|
||||||
<b-input-group prepend="GDD" append=".00">
|
<b-input-group prepend="GDD" append=".00">
|
||||||
@ -210,12 +210,35 @@ export default {
|
|||||||
if (this.text.length < 10) {
|
if (this.text.length < 10) {
|
||||||
return alert('Bitte gib einen Text ein der länger als 10 Zeichen ist!')
|
return alert('Bitte gib einen Text ein der länger als 10 Zeichen ist!')
|
||||||
}
|
}
|
||||||
if (this.type === 'singleCreation') {
|
|
||||||
|
if (this.type === 'massCreation') {
|
||||||
|
// Die anzahl der Mitglieder aus der Mehrfachschöpfung
|
||||||
|
const i = Object.keys(this.itemsMassCreation).length
|
||||||
|
// hinweis das eine Mehrfachschöpfung ausgeführt wird an (Anzahl der MItgleider an die geschöpft wird)
|
||||||
|
alert('SUBMIT CREATION => ' + this.type + ' >> für VIELE ' + i + ' Mitglieder')
|
||||||
|
this.submitObj = [
|
||||||
|
{
|
||||||
|
item: this.itemsMassCreation,
|
||||||
|
email: this.item.email,
|
||||||
|
creationDate: this.radioSelected.long,
|
||||||
|
amount: this.value,
|
||||||
|
memo: this.text,
|
||||||
|
moderator: this.$store.state.moderator.id,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
alert('MehrfachSCHÖPFUNG ABSENDEN FÜR >> ' + i + ' Mitglieder')
|
||||||
|
|
||||||
|
// $store - offene Schöpfungen hochzählen
|
||||||
|
this.$store.commit('openCreationsPlus', i)
|
||||||
|
|
||||||
|
// lösche alle Mitglieder aus der MehrfachSchöpfungsListe nach dem alle Mehrfachschpfungen zum bestätigen gesendet wurden.
|
||||||
|
this.$emit('remove-all-bookmark')
|
||||||
|
} else if (this.type === 'singleCreation') {
|
||||||
this.submitObj = {
|
this.submitObj = {
|
||||||
email: this.item.email,
|
email: this.item.email,
|
||||||
creationDate: this.radioSelected.long,
|
creationDate: this.radioSelected.long,
|
||||||
amount: Number(this.value),
|
amount: Number(this.value),
|
||||||
note: this.text,
|
memo: this.text,
|
||||||
moderator: Number(this.$store.state.moderator.id),
|
moderator: Number(this.$store.state.moderator.id),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="component-nabvar">
|
<div class="component-nabvar">
|
||||||
<b-navbar toggleable="sm" type="dark" variant="success">
|
<b-navbar toggleable="sm" type="dark" variant="success">
|
||||||
<b-navbar-brand to="/">
|
<b-navbar-brand to="/">
|
||||||
<img :src="logo" class="navbar-brand-img" alt="..." />
|
<img src="img/brand/green.png" class="navbar-brand-img" alt="..." />
|
||||||
</b-navbar-brand>
|
</b-navbar-brand>
|
||||||
|
|
||||||
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
|
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
|
||||||
@ -32,28 +32,8 @@ import CONFIG from '../config'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'navbar',
|
name: 'navbar',
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
logo: 'img/brand/gradido_logo_w.png',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
logout() {
|
logout() {
|
||||||
// TODO
|
|
||||||
// this.$emit('logout')
|
|
||||||
/* this.$apollo
|
|
||||||
.query({
|
|
||||||
query: logout,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.$store.dispatch('logout')
|
|
||||||
this.$router.push('/logout')
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$store.dispatch('logout')
|
|
||||||
if (this.$router.currentRoute.path !== '/logout') this.$router.push('/logout')
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
this.$store.dispatch('logout')
|
this.$store.dispatch('logout')
|
||||||
this.$router.push('/logout')
|
this.$router.push('/logout')
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,11 +4,42 @@ import CreationConfirm from './CreationConfirm.vue'
|
|||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
const storeCommitMock = jest.fn()
|
const storeCommitMock = jest.fn()
|
||||||
|
const toastedErrorMock = jest.fn()
|
||||||
|
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||||
|
data: {
|
||||||
|
getPendingCreations: [
|
||||||
|
{
|
||||||
|
firstName: 'Bibi',
|
||||||
|
lastName: 'Bloxberg',
|
||||||
|
email: 'bibi@bloxberg.de',
|
||||||
|
amount: 500,
|
||||||
|
note: 'Danke für alles',
|
||||||
|
date: new Date(),
|
||||||
|
moderator: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
firstName: 'Räuber',
|
||||||
|
lastName: 'Hotzenplotz',
|
||||||
|
email: 'raeuber@hotzenplotz.de',
|
||||||
|
amount: 1000000,
|
||||||
|
note: 'Gut Ergatert',
|
||||||
|
date: new Date(),
|
||||||
|
moderator: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const mocks = {
|
const mocks = {
|
||||||
$store: {
|
$store: {
|
||||||
commit: storeCommitMock,
|
commit: storeCommitMock,
|
||||||
},
|
},
|
||||||
|
$apollo: {
|
||||||
|
query: apolloQueryMock,
|
||||||
|
},
|
||||||
|
$toasted: {
|
||||||
|
error: toastedErrorMock,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('CreationConfirm', () => {
|
describe('CreationConfirm', () => {
|
||||||
@ -29,12 +60,22 @@ describe('CreationConfirm', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('store', () => {
|
describe('store', () => {
|
||||||
it('commits resetOpenCreations to store', () => {
|
it('commits openCreationsPlus to store', () => {
|
||||||
expect(storeCommitMock).toBeCalledWith('resetOpenCreations')
|
expect(storeCommitMock).toBeCalledWith('openCreationsPlus', 2)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('server response is error', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
apolloQueryMock.mockRejectedValue({
|
||||||
|
message: 'Ouch!',
|
||||||
|
})
|
||||||
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('commits openCreationsPlus to store', () => {
|
it('toast an error message', () => {
|
||||||
expect(storeCommitMock).toBeCalledWith('openCreationsPlus', 5)
|
expect(toastedErrorMock).toBeCalledWith('Ouch!')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export default class CreatePendingCreationArgs {
|
|||||||
amount: number
|
amount: number
|
||||||
|
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
note: string
|
memo: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
creationDate: string
|
creationDate: string
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export class PendingCreation {
|
|||||||
date: Date
|
date: Date
|
||||||
|
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
note: string
|
memo: string
|
||||||
|
|
||||||
@Field(() => Number)
|
@Field(() => Number)
|
||||||
amount: BigInt
|
amount: BigInt
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export class AdminResolver {
|
|||||||
|
|
||||||
@Query(() => [Number])
|
@Query(() => [Number])
|
||||||
async createPendingCreation(
|
async createPendingCreation(
|
||||||
@Args() { email, amount, note, creationDate, moderator }: CreatePendingCreationArgs,
|
@Args() { email, amount, memo, creationDate, moderator }: CreatePendingCreationArgs,
|
||||||
): Promise<number[]> {
|
): Promise<number[]> {
|
||||||
const userRepository = getCustomRepository(UserRepository)
|
const userRepository = getCustomRepository(UserRepository)
|
||||||
const user = await userRepository.findByEmail(email)
|
const user = await userRepository.findByEmail(email)
|
||||||
@ -46,7 +46,7 @@ export class AdminResolver {
|
|||||||
loginPendingTaskAdmin.amount = BigInt(amount * 10000)
|
loginPendingTaskAdmin.amount = BigInt(amount * 10000)
|
||||||
loginPendingTaskAdmin.created = new Date()
|
loginPendingTaskAdmin.created = new Date()
|
||||||
loginPendingTaskAdmin.date = creationDateObj
|
loginPendingTaskAdmin.date = creationDateObj
|
||||||
loginPendingTaskAdmin.note = note
|
loginPendingTaskAdmin.memo = memo
|
||||||
loginPendingTaskAdmin.moderator = moderator
|
loginPendingTaskAdmin.moderator = moderator
|
||||||
|
|
||||||
pendingCreationRepository.save(loginPendingTaskAdmin)
|
pendingCreationRepository.save(loginPendingTaskAdmin)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
|||||||
\`userId\` int UNSIGNED DEFAULT 0,
|
\`userId\` int UNSIGNED DEFAULT 0,
|
||||||
\`created\` datetime NOT NULL,
|
\`created\` datetime NOT NULL,
|
||||||
\`date\` datetime NOT NULL,
|
\`date\` datetime NOT NULL,
|
||||||
\`note\` text DEFAULT NULL,
|
\`memo\` text DEFAULT NULL,
|
||||||
\`amount\` bigint(20) NOT NULL,
|
\`amount\` bigint(20) NOT NULL,
|
||||||
\`moderator\` int UNSIGNED DEFAULT 0,
|
\`moderator\` int UNSIGNED DEFAULT 0,
|
||||||
PRIMARY KEY (\`id\`)
|
PRIMARY KEY (\`id\`)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user