mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into combine_listTransactionLinks_and_listTransactionLinksAdmin
This commit is contained in:
commit
21b6e35391
@ -6,7 +6,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import defaultLayout from '@/layouts/defaultLayout.vue'
|
||||
import defaultLayout from '@/layouts/defaultLayout'
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ChangeUserRoleFormular from './ChangeUserRoleFormular.vue'
|
||||
import ChangeUserRoleFormular from './ChangeUserRoleFormular'
|
||||
import { setUserRole } from '../graphql/setUserRole'
|
||||
import { toastSuccessSpy, toastErrorSpy } from '../../test/testSetup'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ConfirmRegisterMailFormular from './ConfirmRegisterMailFormular.vue'
|
||||
import ConfirmRegisterMailFormular from './ConfirmRegisterMailFormular'
|
||||
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../test/testSetup'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLink from './ContributionLink.vue'
|
||||
import ContributionLink from './ContributionLink'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ContributionLinkForm from '../ContributionLink/ContributionLinkForm.vue'
|
||||
import ContributionLinkList from '../ContributionLink/ContributionLinkList.vue'
|
||||
import ContributionLinkForm from '../ContributionLink/ContributionLinkForm'
|
||||
import ContributionLinkList from '../ContributionLink/ContributionLinkList'
|
||||
|
||||
export default {
|
||||
name: 'ContributionLink',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLinkForm from './ContributionLinkForm.vue'
|
||||
import ContributionLinkForm from './ContributionLinkForm'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../../test/testSetup'
|
||||
import { createContributionLink } from '@/graphql/createContributionLink.js'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLinkList from './ContributionLinkList.vue'
|
||||
import ContributionLinkList from './ContributionLinkList'
|
||||
import { toastSuccessSpy, toastErrorSpy } from '../../../test/testSetup'
|
||||
// import { deleteContributionLink } from '../graphql/deleteContributionLink'
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { deleteContributionLink } from '@/graphql/deleteContributionLink.js'
|
||||
import FigureQrCode from '../FigureQrCode.vue'
|
||||
import FigureQrCode from '../FigureQrCode'
|
||||
|
||||
export default {
|
||||
name: 'ContributionLinkList',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesFormular from './ContributionMessagesFormular.vue'
|
||||
import ContributionMessagesFormular from './ContributionMessagesFormular'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesList from './ContributionMessagesList.vue'
|
||||
import ContributionMessagesList from './ContributionMessagesList'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ContributionMessagesListItem from './slots/ContributionMessagesListItem.vue'
|
||||
import ContributionMessagesFormular from '../ContributionMessages/ContributionMessagesFormular.vue'
|
||||
import ContributionMessagesListItem from './slots/ContributionMessagesListItem'
|
||||
import ContributionMessagesFormular from '../ContributionMessages/ContributionMessagesFormular'
|
||||
import { listContributionMessages } from '../../graphql/listContributionMessages.js'
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesListItem from './ContributionMessagesListItem.vue'
|
||||
import ContributionMessagesListItem from './ContributionMessagesListItem'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ParseMessage from '@/components/ContributionMessages/ParseMessage.vue'
|
||||
import ParseMessage from '@/components/ContributionMessages/ParseMessage'
|
||||
|
||||
export default {
|
||||
name: 'ContributionMessagesListItem',
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CreationFormular from './CreationFormular.vue'
|
||||
import CreationFormular from './CreationFormular'
|
||||
import { adminCreateContribution } from '../graphql/adminCreateContribution'
|
||||
import { adminCreateContributions } from '../graphql/adminCreateContributions'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
@ -328,122 +327,6 @@ describe('CreationFormular', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('mass creation with success', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockResolvedValue({
|
||||
data: {
|
||||
adminCreateContributions: {
|
||||
success: true,
|
||||
successfulContribution: ['bob@baumeister.de', 'bibi@bloxberg.de'],
|
||||
failedContribution: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }],
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test mass create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(200)
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('calls the API', () => {
|
||||
expect(apolloMutateMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
mutation: adminCreateContributions,
|
||||
variables: {
|
||||
pendingCreations: [
|
||||
{
|
||||
email: 'bob@baumeister.de',
|
||||
creationDate: getCreationDate(1),
|
||||
amount: 200,
|
||||
memo: 'Test mass create coins',
|
||||
},
|
||||
{
|
||||
email: 'bibi@bloxberg.de',
|
||||
creationDate: getCreationDate(1),
|
||||
amount: 200,
|
||||
memo: 'Test mass create coins',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('updates open creations in store', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 2)
|
||||
})
|
||||
|
||||
it('emits remove-all-bookmark', () => {
|
||||
expect(wrapper.emitted('remove-all-bookmark')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
describe('mass creation with success but all failed', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockResolvedValue({
|
||||
data: {
|
||||
adminCreateContributions: {
|
||||
success: true,
|
||||
successfulContribution: [],
|
||||
failedContribution: ['bob@baumeister.de', 'bibi@bloxberg.de'],
|
||||
},
|
||||
},
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }],
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test mass create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(200)
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('updates open creations in store', () => {
|
||||
expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 0)
|
||||
})
|
||||
|
||||
it('emits remove all bookmarks', () => {
|
||||
expect(wrapper.emitted('remove-all-bookmark')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('emits toast failed creations with two emails', () => {
|
||||
expect(wrapper.emitted('toast-failed-creations')).toEqual([
|
||||
[['bob@baumeister.de', 'bibi@bloxberg.de']],
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('mass creation with error', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutateMock.mockRejectedValue({
|
||||
message: 'Oh no!',
|
||||
})
|
||||
await wrapper.setProps({
|
||||
type: 'massCreation',
|
||||
creation: [200, 400, 600],
|
||||
items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }],
|
||||
})
|
||||
await wrapper.findAll('input[type="radio"]').at(1).setChecked()
|
||||
await wrapper.find('textarea').setValue('Test mass create coins')
|
||||
await wrapper.find('input[type="number"]').setValue(200)
|
||||
await wrapper.find('.test-submit').trigger('click')
|
||||
})
|
||||
|
||||
it('toasts an error message', () => {
|
||||
expect(toastErrorSpy).toBeCalledWith('Oh no!')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -86,16 +86,11 @@
|
||||
</template>
|
||||
<script>
|
||||
import { adminCreateContribution } from '../graphql/adminCreateContribution'
|
||||
import { adminCreateContributions } from '../graphql/adminCreateContributions'
|
||||
import { creationMonths } from '../mixins/creationMonths'
|
||||
export default {
|
||||
name: 'CreationFormular',
|
||||
mixins: [creationMonths],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
pagetype: {
|
||||
type: String,
|
||||
required: false,
|
||||
@ -140,78 +135,38 @@ export default {
|
||||
updateRadioSelected(name) {
|
||||
// do we want to reset the memo everytime the month changes?
|
||||
this.text = this.$t('creation_form.creation_for') + ' ' + name.short + ' ' + name.year
|
||||
if (this.type === 'singleCreation') {
|
||||
this.rangeMin = 0
|
||||
this.rangeMax = name.creation
|
||||
}
|
||||
this.rangeMin = 0
|
||||
this.rangeMax = name.creation
|
||||
},
|
||||
submitCreation() {
|
||||
let submitObj = []
|
||||
if (this.type === 'massCreation') {
|
||||
this.items.forEach((item) => {
|
||||
submitObj.push({
|
||||
email: item.email,
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: adminCreateContribution,
|
||||
variables: {
|
||||
email: this.item.email,
|
||||
creationDate: this.selected.date,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
})
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('update-user-data', this.item, result.data.adminCreateContribution)
|
||||
this.$store.commit('openCreationsPlus', 1)
|
||||
this.toastSuccess(
|
||||
this.$t('creation_form.toasted', {
|
||||
value: this.value,
|
||||
email: this.item.email,
|
||||
}),
|
||||
)
|
||||
// what is this? Tests says that this.text is not reseted
|
||||
this.$refs.creationForm.reset()
|
||||
this.value = 0
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
this.$refs.creationForm.reset()
|
||||
this.value = 0
|
||||
})
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: adminCreateContributions,
|
||||
variables: {
|
||||
pendingCreations: submitObj,
|
||||
},
|
||||
fetchPolicy: 'no-cache',
|
||||
})
|
||||
.then((result) => {
|
||||
const failedContributions = []
|
||||
this.$store.commit(
|
||||
'openCreationsPlus',
|
||||
result.data.adminCreateContributions.successfulContribution.length,
|
||||
)
|
||||
if (result.data.adminCreateContributions.failedContribution.length > 0) {
|
||||
result.data.adminCreateContributions.failedContribution.forEach((email) => {
|
||||
failedContributions.push(email)
|
||||
})
|
||||
}
|
||||
this.$emit('remove-all-bookmark')
|
||||
this.$emit('toast-failed-creations', failedContributions)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
})
|
||||
} else if (this.type === 'singleCreation') {
|
||||
submitObj = {
|
||||
email: this.item.email,
|
||||
creationDate: this.selected.date,
|
||||
amount: Number(this.value),
|
||||
memo: this.text,
|
||||
}
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: adminCreateContribution,
|
||||
variables: submitObj,
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('update-user-data', this.item, result.data.adminCreateContribution)
|
||||
this.$store.commit('openCreationsPlus', 1)
|
||||
this.toastSuccess(
|
||||
this.$t('creation_form.toasted', {
|
||||
value: this.value,
|
||||
email: this.item.email,
|
||||
}),
|
||||
)
|
||||
// what is this? Tests says that this.text is not reseted
|
||||
this.$refs.creationForm.reset()
|
||||
this.value = 0
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
this.$refs.creationForm.reset()
|
||||
this.value = 0
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CreationTransactionList from './CreationTransactionList.vue'
|
||||
import CreationTransactionList from './CreationTransactionList'
|
||||
import { toastErrorSpy } from '../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import DeletedUserFormular from './DeletedUserFormular.vue'
|
||||
import DeletedUserFormular from './DeletedUserFormular'
|
||||
import { deleteUser } from '../graphql/deleteUser'
|
||||
import { unDeleteUser } from '../graphql/unDeleteUser'
|
||||
import { toastErrorSpy } from '../../test/testSetup'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import EditCreationFormular from './EditCreationFormular.vue'
|
||||
import EditCreationFormular from './EditCreationFormular'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import FigureQrCode from './FigureQrCode.vue'
|
||||
import FigureQrCode from './FigureQrCode'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import NavBar from './NavBar.vue'
|
||||
import NavBar from './NavBar'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -68,14 +68,11 @@ describe('NavBar', () => {
|
||||
})
|
||||
|
||||
describe('wallet', () => {
|
||||
const windowLocationMock = jest.fn()
|
||||
const windowLocation = window.location
|
||||
beforeEach(async () => {
|
||||
delete window.location
|
||||
window.location = {
|
||||
assign: windowLocationMock,
|
||||
}
|
||||
await wrapper.findAll('.nav-item').at(5).find('a').trigger('click')
|
||||
window.location = ''
|
||||
await wrapper.findAll('.nav-item').at(4).find('a').trigger('click')
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
@ -83,8 +80,8 @@ describe('NavBar', () => {
|
||||
window.location = windowLocation
|
||||
})
|
||||
|
||||
it.skip('changes window location to wallet', () => {
|
||||
expect(windowLocationMock()).toBe('valid-token')
|
||||
it('changes window location to wallet', () => {
|
||||
expect(window.location).toBe('http://localhost/authenticate?token=valid-token')
|
||||
})
|
||||
|
||||
it('dispatches logout to store', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Overlay from './Overlay.vue'
|
||||
import Overlay from './Overlay'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import OpenCreationsTable from './OpenCreationsTable.vue'
|
||||
import OpenCreationsTable from './OpenCreationsTable'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -117,9 +117,9 @@
|
||||
|
||||
<script>
|
||||
import { toggleRowDetails } from '../../mixins/toggleRowDetails'
|
||||
import RowDetails from '../RowDetails.vue'
|
||||
import EditCreationFormular from '../EditCreationFormular.vue'
|
||||
import ContributionMessagesList from '../ContributionMessages/ContributionMessagesList.vue'
|
||||
import RowDetails from '../RowDetails'
|
||||
import EditCreationFormular from '../EditCreationFormular'
|
||||
import ContributionMessagesList from '../ContributionMessages/ContributionMessagesList'
|
||||
|
||||
const iconMap = {
|
||||
IN_PROGRESS: 'question-square',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import SearchUserTable from './SearchUserTable.vue'
|
||||
import SearchUserTable from './SearchUserTable'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -53,7 +53,6 @@
|
||||
<b-tab :title="$t('creation')" active :disabled="row.item.deletedAt !== null">
|
||||
<creation-formular
|
||||
v-if="!row.item.deletedAt"
|
||||
type="singleCreation"
|
||||
pagetype="singleCreation"
|
||||
:creation="row.item.creation"
|
||||
:item="row.item"
|
||||
@ -92,12 +91,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CreationFormular from '../CreationFormular.vue'
|
||||
import ConfirmRegisterMailFormular from '../ConfirmRegisterMailFormular.vue'
|
||||
import CreationTransactionList from '../CreationTransactionList.vue'
|
||||
import TransactionLinkList from '../TransactionLinkList.vue'
|
||||
import ChangeUserRoleFormular from '../ChangeUserRoleFormular.vue'
|
||||
import DeletedUserFormular from '../DeletedUserFormular.vue'
|
||||
import CreationFormular from '../CreationFormular'
|
||||
import ConfirmRegisterMailFormular from '../ConfirmRegisterMailFormular'
|
||||
import CreationTransactionList from '../CreationTransactionList'
|
||||
import TransactionLinkList from '../TransactionLinkList'
|
||||
import ChangeUserRoleFormular from '../ChangeUserRoleFormular'
|
||||
import DeletedUserFormular from '../DeletedUserFormular'
|
||||
|
||||
export default {
|
||||
name: 'SearchUserTable',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import StatisticTable from './StatisticTable.vue'
|
||||
import StatisticTable from './StatisticTable'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import TransactionLinkList from './TransactionLinkList.vue'
|
||||
import TransactionLinkList from './TransactionLinkList'
|
||||
import { listTransactionLinksAdmin } from '../graphql/listTransactionLinksAdmin.js'
|
||||
import { toastErrorSpy } from '../../test/testSetup'
|
||||
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const adminCreateContributions = gql`
|
||||
mutation ($pendingCreations: [AdminCreateContributionArgs!]!) {
|
||||
adminCreateContributions(pendingCreations: $pendingCreations) {
|
||||
success
|
||||
successfulContribution
|
||||
failedContribution
|
||||
}
|
||||
}
|
||||
`
|
||||
@ -7,8 +7,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import ContentFooter from '@/components/ContentFooter.vue'
|
||||
import NavBar from '@/components/NavBar'
|
||||
import ContentFooter from '@/components/ContentFooter'
|
||||
export default {
|
||||
name: 'defaultLayout',
|
||||
components: {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import App from './App'
|
||||
|
||||
// without this async calls are not working
|
||||
import 'regenerator-runtime'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CommunityStatistic from './CommunityStatistic.vue'
|
||||
import CommunityStatistic from './CommunityStatistic'
|
||||
import { communityStatistics } from '@/graphql/communityStatistics.js'
|
||||
import { toastErrorSpy } from '../../test/testSetup'
|
||||
import VueApollo from 'vue-apollo'
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { communityStatistics } from '@/graphql/communityStatistics.js'
|
||||
import StatisticTable from '../components/Tables/StatisticTable.vue'
|
||||
import StatisticTable from '../components/Tables/StatisticTable'
|
||||
|
||||
export default {
|
||||
name: 'CommunityStatistic',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLinks from './ContributionLinks.vue'
|
||||
import ContributionLinks from './ContributionLinks'
|
||||
import { listContributionLinks } from '@/graphql/listContributionLinks.js'
|
||||
import { toastErrorSpy } from '../../test/testSetup'
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { listContributionLinks } from '@/graphql/listContributionLinks.js'
|
||||
import ContributionLink from '../components/ContributionLink/ContributionLink.vue'
|
||||
import ContributionLink from '../components/ContributionLink/ContributionLink'
|
||||
|
||||
export default {
|
||||
name: 'ContributionLinks',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import CreationConfirm from './CreationConfirm.vue'
|
||||
import CreationConfirm from './CreationConfirm'
|
||||
import { adminDeleteContribution } from '../graphql/adminDeleteContribution'
|
||||
import { denyContribution } from '../graphql/denyContribution'
|
||||
import { listAllContributions } from '../graphql/listAllContributions'
|
||||
|
||||
@ -71,8 +71,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Overlay from '../components/Overlay.vue'
|
||||
import OpenCreationsTable from '../components/Tables/OpenCreationsTable.vue'
|
||||
import Overlay from '../components/Overlay'
|
||||
import OpenCreationsTable from '../components/Tables/OpenCreationsTable'
|
||||
import { listAllContributions } from '../graphql/listAllContributions'
|
||||
import { adminDeleteContribution } from '../graphql/adminDeleteContribution'
|
||||
import { confirmContribution } from '../graphql/confirmContribution'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Overview from './Overview.vue'
|
||||
import Overview from './Overview'
|
||||
import { listAllContributions } from '../graphql/listAllContributions'
|
||||
import VueApollo from 'vue-apollo'
|
||||
import { createMockClient } from 'mock-apollo-client'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import UserSearch from './UserSearch.vue'
|
||||
import UserSearch from './UserSearch'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import SearchUserTable from '../components/Tables/SearchUserTable.vue'
|
||||
import SearchUserTable from '../components/Tables/SearchUserTable'
|
||||
import { searchUsers } from '../graphql/searchUsers'
|
||||
import { creationMonths } from '../mixins/creationMonths'
|
||||
|
||||
@ -72,7 +72,6 @@ export default {
|
||||
return {
|
||||
showArrays: false,
|
||||
searchResult: [],
|
||||
massCreation: [],
|
||||
criteria: '',
|
||||
filters: {
|
||||
byActivated: null,
|
||||
|
||||
@ -24,9 +24,6 @@ export const mutations = {
|
||||
moderator: (state, moderator) => {
|
||||
state.moderator = moderator
|
||||
},
|
||||
setUserSelectedInMassCreation: (state, userSelectedInMassCreation) => {
|
||||
state.userSelectedInMassCreation = userSelectedInMassCreation
|
||||
},
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
@ -10,7 +10,6 @@ const {
|
||||
resetOpenCreations,
|
||||
setOpenCreations,
|
||||
moderator,
|
||||
setUserSelectedInMassCreation,
|
||||
} = mutations
|
||||
const { logout } = actions
|
||||
|
||||
@ -65,14 +64,6 @@ describe('Vuex store', () => {
|
||||
expect(state.openCreations).toEqual(12)
|
||||
})
|
||||
})
|
||||
|
||||
describe('setUserSelectedInMassCreation', () => {
|
||||
it('sets userSelectedInMassCreation to given value', () => {
|
||||
const state = { userSelectedInMassCreation: [] }
|
||||
setUserSelectedInMassCreation(state, [0, 1, 2])
|
||||
expect(state.userSelectedInMassCreation).toEqual([0, 1, 2])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('actions', () => {
|
||||
|
||||
@ -42,7 +42,6 @@ export enum RIGHTS {
|
||||
DELETE_USER = 'DELETE_USER',
|
||||
UNDELETE_USER = 'UNDELETE_USER',
|
||||
ADMIN_CREATE_CONTRIBUTION = 'ADMIN_CREATE_CONTRIBUTION',
|
||||
ADMIN_CREATE_CONTRIBUTIONS = 'ADMIN_CREATE_CONTRIBUTIONS',
|
||||
ADMIN_UPDATE_CONTRIBUTION = 'ADMIN_UPDATE_CONTRIBUTION',
|
||||
ADMIN_DELETE_CONTRIBUTION = 'ADMIN_DELETE_CONTRIBUTION',
|
||||
LIST_UNCONFIRMED_CONTRIBUTIONS = 'LIST_UNCONFIRMED_CONTRIBUTIONS',
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
import { ObjectType, Field } from 'type-graphql'
|
||||
|
||||
@ObjectType()
|
||||
export class AdminCreateContributions {
|
||||
constructor() {
|
||||
this.success = false
|
||||
this.successfulContribution = []
|
||||
this.failedContribution = []
|
||||
}
|
||||
|
||||
@Field(() => Boolean)
|
||||
success: boolean
|
||||
|
||||
@Field(() => [String])
|
||||
successfulContribution: string[]
|
||||
|
||||
@Field(() => [String])
|
||||
failedContribution: string[]
|
||||
}
|
||||
@ -13,7 +13,6 @@ import {
|
||||
denyContribution,
|
||||
confirmContribution,
|
||||
adminCreateContribution,
|
||||
adminCreateContributions,
|
||||
adminUpdateContribution,
|
||||
adminDeleteContribution,
|
||||
login,
|
||||
@ -1655,21 +1654,6 @@ describe('ContributionResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminCreateContributions', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
mutate({
|
||||
mutation: adminCreateContributions,
|
||||
variables: { pendingCreations: [variables] },
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
errors: [new GraphQLError('401 Unauthorized')],
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminUpdateContribution', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
@ -1749,21 +1733,6 @@ describe('ContributionResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminCreateContributions', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
mutate({
|
||||
mutation: adminCreateContributions,
|
||||
variables: { pendingCreations: [variables] },
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
errors: [new GraphQLError('401 Unauthorized')],
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminUpdateContribution', () => {
|
||||
it('returns an error', async () => {
|
||||
await expect(
|
||||
@ -2094,59 +2063,13 @@ describe('ContributionResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminCreateContributions', () => {
|
||||
describe('adminUpdateContribution', () => {
|
||||
// at this point we have this data in DB:
|
||||
// bibi@bloxberg.de: [1000, 1000, 800]
|
||||
// peter@lustig.de: [1000, 600, 1000]
|
||||
// stephen@hawking.uk: [1000, 1000, 1000] - deleted
|
||||
// garrick@ollivander.com: [1000, 1000, 1000] - not activated
|
||||
|
||||
const massCreationVariables = [
|
||||
'bibi@bloxberg.de',
|
||||
'peter@lustig.de',
|
||||
'stephen@hawking.uk',
|
||||
'garrick@ollivander.com',
|
||||
'bob@baumeister.de',
|
||||
].map((email) => {
|
||||
return {
|
||||
email,
|
||||
amount: new Decimal(500),
|
||||
memo: 'Grundeinkommen',
|
||||
creationDate: contributionDateFormatter(new Date()),
|
||||
}
|
||||
})
|
||||
|
||||
it('returns success, two successful creation and three failed creations', async () => {
|
||||
await expect(
|
||||
mutate({
|
||||
mutation: adminCreateContributions,
|
||||
variables: { pendingCreations: massCreationVariables },
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
data: {
|
||||
adminCreateContributions: {
|
||||
success: true,
|
||||
successfulContribution: ['bibi@bloxberg.de', 'peter@lustig.de'],
|
||||
failedContribution: [
|
||||
'stephen@hawking.uk',
|
||||
'garrick@ollivander.com',
|
||||
'bob@baumeister.de',
|
||||
],
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('adminUpdateContribution', () => {
|
||||
// at this I expect to have this data in DB:
|
||||
// bibi@bloxberg.de: [1000, 1000, 300]
|
||||
// peter@lustig.de: [1000, 600, 500]
|
||||
// stephen@hawking.uk: [1000, 1000, 1000] - deleted
|
||||
// garrick@ollivander.com: [1000, 1000, 1000] - not activated
|
||||
|
||||
describe('user for creation to update does not exist', () => {
|
||||
it('throws an error', async () => {
|
||||
jest.clearAllMocks()
|
||||
@ -2360,7 +2283,7 @@ describe('ContributionResolver', () => {
|
||||
date: expect.any(String),
|
||||
memo: 'Das war leider zu Viel!',
|
||||
amount: '200',
|
||||
creation: ['1000', '800', '500'],
|
||||
creation: ['1000', '800', '1000'],
|
||||
},
|
||||
},
|
||||
}),
|
||||
@ -2772,15 +2695,15 @@ describe('ContributionResolver', () => {
|
||||
resetToken()
|
||||
})
|
||||
|
||||
it('returns 19 creations in total', async () => {
|
||||
it('returns 17 creations in total', async () => {
|
||||
const {
|
||||
data: { adminListAllContributions: contributionListObject },
|
||||
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
||||
query: adminListAllContributions,
|
||||
})
|
||||
expect(contributionListObject.contributionList).toHaveLength(19)
|
||||
expect(contributionListObject.contributionList).toHaveLength(17)
|
||||
expect(contributionListObject).toMatchObject({
|
||||
contributionCount: 19,
|
||||
contributionCount: 17,
|
||||
contributionList: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
amount: expect.decimalEqual(50),
|
||||
@ -2845,24 +2768,6 @@ describe('ContributionResolver', () => {
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: expect.decimalEqual(500),
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: expect.decimalEqual(500),
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: expect.decimalEqual(10),
|
||||
firstName: 'Bibi',
|
||||
@ -2957,21 +2862,21 @@ describe('ContributionResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('returns five pending creations with page size set to 5', async () => {
|
||||
it('returns two pending creations with page size set to 2', async () => {
|
||||
const {
|
||||
data: { adminListAllContributions: contributionListObject },
|
||||
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
||||
query: adminListAllContributions,
|
||||
variables: {
|
||||
currentPage: 1,
|
||||
pageSize: 5,
|
||||
pageSize: 2,
|
||||
order: Order.DESC,
|
||||
statusFilter: ['PENDING'],
|
||||
},
|
||||
})
|
||||
expect(contributionListObject.contributionList).toHaveLength(5)
|
||||
expect(contributionListObject.contributionList).toHaveLength(2)
|
||||
expect(contributionListObject).toMatchObject({
|
||||
contributionCount: 6,
|
||||
contributionCount: 4,
|
||||
contributionList: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
amount: '400',
|
||||
@ -2991,33 +2896,6 @@ describe('ContributionResolver', () => {
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '500',
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '500',
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '100',
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Test env contribution',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.not.objectContaining({
|
||||
state: 'DENIED',
|
||||
}),
|
||||
|
||||
@ -8,7 +8,6 @@ import { UserContact } from '@entity/UserContact'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||
|
||||
import { AdminCreateContributions } from '@model/AdminCreateContributions'
|
||||
import { AdminUpdateContribution } from '@model/AdminUpdateContribution'
|
||||
import { Contribution, ContributionListResult } from '@model/Contribution'
|
||||
import { Decay } from '@model/Decay'
|
||||
@ -318,33 +317,6 @@ export class ContributionResolver {
|
||||
return getUserCreation(emailContact.userId, clientTimezoneOffset)
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.ADMIN_CREATE_CONTRIBUTIONS])
|
||||
@Mutation(() => AdminCreateContributions)
|
||||
async adminCreateContributions(
|
||||
@Arg('pendingCreations', () => [AdminCreateContributionArgs])
|
||||
contributions: AdminCreateContributionArgs[],
|
||||
@Ctx() context: Context,
|
||||
): Promise<AdminCreateContributions> {
|
||||
let success = false
|
||||
const successfulContribution: string[] = []
|
||||
const failedContribution: string[] = []
|
||||
for (const contribution of contributions) {
|
||||
await this.adminCreateContribution(contribution, context)
|
||||
.then(() => {
|
||||
successfulContribution.push(contribution.email)
|
||||
success = true
|
||||
})
|
||||
.catch(() => {
|
||||
failedContribution.push(contribution.email)
|
||||
})
|
||||
}
|
||||
return {
|
||||
success,
|
||||
successfulContribution,
|
||||
failedContribution,
|
||||
}
|
||||
}
|
||||
|
||||
@Authorized([RIGHTS.ADMIN_UPDATE_CONTRIBUTION])
|
||||
@Mutation(() => AdminUpdateContribution)
|
||||
async adminUpdateContribution(
|
||||
|
||||
@ -126,16 +126,6 @@ export const unDeleteUser = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const adminCreateContributions = gql`
|
||||
mutation ($pendingCreations: [AdminCreateContributionArgs!]!) {
|
||||
adminCreateContributions(pendingCreations: $pendingCreations) {
|
||||
success
|
||||
successfulContribution
|
||||
failedContribution
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const adminUpdateContribution = gql`
|
||||
mutation ($id: Int!, $email: String!, $amount: Decimal!, $memo: String!, $creationDate: String!) {
|
||||
adminUpdateContribution(
|
||||
|
||||
@ -123,10 +123,6 @@ Zusätzlich wird als Parameter ein *creationDate* vom User mitgeliefert, das dem
|
||||
|
||||
nothing to do
|
||||
|
||||
#### + adminCreateContributions
|
||||
|
||||
Hier wird eine Liste von übergebenen Contributions über den internen Aufruf von *adminCreateContribution()* verarbeitet. Da dort eine Berücksichtigung des User-TimeOffsets notwendig ist, muss hier die UserTime entsprechen im Context weitergereicht werden.
|
||||
|
||||
#### - adminDeleteContribution
|
||||
|
||||
nothing to do
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DashboardLayout from '@/layouts/DashboardLayout.vue'
|
||||
import AuthLayout from '@/layouts/AuthLayout.vue'
|
||||
import DashboardLayout from '@/layouts/DashboardLayout'
|
||||
import AuthLayout from '@/layouts/AuthLayout'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesFormular from './ContributionMessagesFormular.vue'
|
||||
import ContributionMessagesFormular from './ContributionMessagesFormular'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '../../../test/testSetup'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesList from './ContributionMessagesList.vue'
|
||||
import ContributionMessagesList from './ContributionMessagesList'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ContributionMessagesListItem from '@/components/ContributionMessages/ContributionMessagesListItem.vue'
|
||||
import ContributionMessagesFormular from '@/components/ContributionMessages/ContributionMessagesFormular.vue'
|
||||
import ContributionMessagesListItem from '@/components/ContributionMessages/ContributionMessagesListItem'
|
||||
import ContributionMessagesFormular from '@/components/ContributionMessages/ContributionMessagesFormular'
|
||||
|
||||
export default {
|
||||
name: 'ContributionMessagesList',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionMessagesList from './ContributionMessagesList.vue'
|
||||
import ContributionMessagesListItem from './ContributionMessagesListItem.vue'
|
||||
import ContributionMessagesList from './ContributionMessagesList'
|
||||
import ContributionMessagesListItem from './ContributionMessagesListItem'
|
||||
|
||||
const localVue = global.localVue
|
||||
let wrapper
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
<script>
|
||||
import Avatar from 'vue-avatar'
|
||||
import ParseMessage from '@/components/ContributionMessages/ParseMessage.vue'
|
||||
import ParseMessage from '@/components/ContributionMessages/ParseMessage'
|
||||
|
||||
export default {
|
||||
name: 'ContributionMessagesListItem',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionForm from './ContributionForm.vue'
|
||||
import ContributionForm from './ContributionForm'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -88,9 +88,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import InputHour from '@/components/Inputs/InputHour.vue'
|
||||
import InputAmount from '@/components/Inputs/InputAmount.vue'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea.vue'
|
||||
import InputHour from '@/components/Inputs/InputHour'
|
||||
import InputAmount from '@/components/Inputs/InputAmount'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea'
|
||||
|
||||
export default {
|
||||
name: 'ContributionForm',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionList from './ContributionList.vue'
|
||||
import ContributionList from './ContributionList'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ContributionListItem from '@/components/Contributions/ContributionListItem.vue'
|
||||
import ContributionListItem from '@/components/Contributions/ContributionListItem'
|
||||
|
||||
export default {
|
||||
name: 'ContributionList',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionListItem from './ContributionListItem.vue'
|
||||
import ContributionListItem from './ContributionListItem'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<script>
|
||||
import Avatar from 'vue-avatar'
|
||||
import CollapseIcon from '../TransactionRows/CollapseIcon'
|
||||
import ContributionMessagesList from '@/components/ContributionMessages/ContributionMessagesList.vue'
|
||||
import ContributionMessagesList from '@/components/ContributionMessages/ContributionMessagesList'
|
||||
import { listContributionMessages } from '../../graphql/queries.js'
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import OpenCreationsAmount from './OpenCreationsAmount.vue'
|
||||
import OpenCreationsAmount from './OpenCreationsAmount'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TransactionLink from '@/components/TransactionLinks/TransactionLink.vue'
|
||||
import TransactionLink from '@/components/TransactionLinks/TransactionLink'
|
||||
export default {
|
||||
name: 'CollapseLinksList',
|
||||
components: {
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DurationRow from '@/components/TransactionRows/DurationRow.vue'
|
||||
import DurationRow from '@/components/TransactionRows/DurationRow'
|
||||
|
||||
export default {
|
||||
name: 'DecayInformation-StartBlock',
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DurationRow from '@/components/TransactionRows/DurationRow.vue'
|
||||
import DurationRow from '@/components/TransactionRows/DurationRow'
|
||||
|
||||
export default {
|
||||
name: 'DecayInformation-Long',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import TransactionForm from './TransactionForm.vue'
|
||||
import TransactionForm from './TransactionForm'
|
||||
import flushPromises from 'flush-promises'
|
||||
import { SEND_TYPES } from '@/pages/Send.vue'
|
||||
import DashboardLayout from '@/layouts/DashboardLayout.vue'
|
||||
import { SEND_TYPES } from '@/pages/Send'
|
||||
import DashboardLayout from '@/layouts/DashboardLayout'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -120,10 +120,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { SEND_TYPES } from '@/pages/Send.vue'
|
||||
import InputEmail from '@/components/Inputs/InputEmail.vue'
|
||||
import InputAmount from '@/components/Inputs/InputAmount.vue'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea.vue'
|
||||
import { SEND_TYPES } from '@/pages/Send'
|
||||
import InputEmail from '@/components/Inputs/InputEmail'
|
||||
import InputAmount from '@/components/Inputs/InputAmount'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea'
|
||||
|
||||
export default {
|
||||
name: 'TransactionForm',
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ClipboardCopy from '../ClipboardCopy.vue'
|
||||
import FigureQrCode from '../QrCode/FigureQrCode.vue'
|
||||
import ClipboardCopy from '../ClipboardCopy'
|
||||
import FigureQrCode from '../QrCode/FigureQrCode'
|
||||
|
||||
export default {
|
||||
name: 'TransactionResultLink',
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Transaction from '@/components/Transaction.vue'
|
||||
import Transaction from '@/components/Transaction'
|
||||
|
||||
export default {
|
||||
name: 'GdtTransactionList',
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation.vue'
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation'
|
||||
import { authLinks } from '@/mixins/authLinks'
|
||||
|
||||
export default {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation.vue'
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation'
|
||||
|
||||
export default {
|
||||
name: 'RedeemSelfCreator',
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation.vue'
|
||||
import RedeemInformation from '@/components/LinkInformations/RedeemInformation'
|
||||
|
||||
export default {
|
||||
name: 'RedeemValid',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import VueRouter from 'vue-router'
|
||||
import AuthNavbar from './Navbar.vue'
|
||||
import AuthNavbar from './Navbar'
|
||||
|
||||
const localVue = global.localVue
|
||||
localVue.use(VueRouter)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import Sidebar from './Sidebar'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Sidebar from '@/components/Menu/Sidebar.vue'
|
||||
import Sidebar from '@/components/Menu/Sidebar'
|
||||
|
||||
export default {
|
||||
name: 'MobileSidebar',
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import Avatar from 'vue-avatar'
|
||||
import Name from '@/components/TransactionRows/Name.vue'
|
||||
import Name from '@/components/TransactionRows/Name'
|
||||
|
||||
export default {
|
||||
name: 'LastTransactions',
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import CollapseIcon from './TransactionRows/CollapseIcon'
|
||||
import TransactionCollapse from './TransactionCollapse.vue'
|
||||
import TransactionCollapse from './TransactionCollapse'
|
||||
import { GdtEntryType } from '../graphql/enums'
|
||||
|
||||
export default {
|
||||
|
||||
@ -75,7 +75,7 @@ import AmountAndNameRow from '../TransactionRows/AmountAndNameRow'
|
||||
import MemoRow from '../TransactionRows/MemoRow'
|
||||
import DateRow from '../TransactionRows/DateRow'
|
||||
import DecayRow from '../TransactionRows/DecayRow'
|
||||
import FigureQrCode from '@/components/QrCode/FigureQrCode.vue'
|
||||
import FigureQrCode from '@/components/QrCode/FigureQrCode'
|
||||
import { copyLinks } from '../../mixins/copyLinks'
|
||||
|
||||
export default {
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
</b-card>
|
||||
</template>
|
||||
<script>
|
||||
import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue'
|
||||
import LanguageSwitchSelect from '@/components/LanguageSwitchSelect'
|
||||
import { updateUserInfos } from '@/graphql/mutations'
|
||||
|
||||
export default {
|
||||
|
||||
@ -81,11 +81,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AuthNavbar from '@/components/Auth/AuthNavbar.vue'
|
||||
import AuthNavbarSmall from '@/components/Auth/AuthNavbarSmall.vue'
|
||||
import AuthCarousel from '@/components/Auth/AuthCarousel.vue'
|
||||
import AuthNavbar from '@/components/Auth/AuthNavbar'
|
||||
import AuthNavbarSmall from '@/components/Auth/AuthNavbarSmall'
|
||||
import AuthCarousel from '@/components/Auth/AuthCarousel'
|
||||
import LanguageSwitch from '@/components/LanguageSwitch2'
|
||||
import AuthFooter from '@/components/Auth/AuthFooter.vue'
|
||||
import AuthFooter from '@/components/Auth/AuthFooter'
|
||||
import CONFIG from '@/config'
|
||||
|
||||
export default {
|
||||
|
||||
@ -185,25 +185,25 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ContentHeader from '@/layouts/templates/ContentHeader.vue'
|
||||
import CommunityTemplate from '@/layouts/templates/CommunityTemplate.vue'
|
||||
import Breadcrumb from '@/components/Breadcrumb/breadcrumb.vue'
|
||||
import RightSide from '@/layouts/templates/RightSide.vue'
|
||||
import SkeletonOverview from '@/components/skeleton/Overview.vue'
|
||||
import Navbar from '@/components/Menu/Navbar.vue'
|
||||
import Sidebar from '@/components/Menu/Sidebar.vue'
|
||||
import MobileSidebar from '@/components/MobileSidebar/MobileSidebar.vue'
|
||||
import SessionLogoutTimeout from '@/components/SessionLogoutTimeout.vue'
|
||||
import ContentHeader from '@/layouts/templates/ContentHeader'
|
||||
import CommunityTemplate from '@/layouts/templates/CommunityTemplate'
|
||||
import Breadcrumb from '@/components/Breadcrumb/breadcrumb'
|
||||
import RightSide from '@/layouts/templates/RightSide'
|
||||
import SkeletonOverview from '@/components/skeleton/Overview'
|
||||
import Navbar from '@/components/Menu/Navbar'
|
||||
import Sidebar from '@/components/Menu/Sidebar'
|
||||
import MobileSidebar from '@/components/MobileSidebar/MobileSidebar'
|
||||
import SessionLogoutTimeout from '@/components/SessionLogoutTimeout'
|
||||
import { transactionsQuery, communityStatistics } from '@/graphql/queries'
|
||||
import { logout } from '@/graphql/mutations'
|
||||
import ContentFooter from '@/components/ContentFooter.vue'
|
||||
import ContentFooter from '@/components/ContentFooter'
|
||||
import { FadeTransition } from 'vue2-transitions'
|
||||
import CONFIG from '@/config'
|
||||
import GddAmount from '@/components/Template/ContentHeader/GddAmount.vue'
|
||||
import GdtAmount from '@/components/Template/ContentHeader/GdtAmount.vue'
|
||||
import CommunityMember from '@/components/Template/ContentHeader/CommunityMember.vue'
|
||||
import NavCommunity from '@/components/Template/ContentHeader/NavCommunity.vue'
|
||||
import LastTransactions from '@/components/Template/RightSide/LastTransactions.vue'
|
||||
import GddAmount from '@/components/Template/ContentHeader/GddAmount'
|
||||
import GdtAmount from '@/components/Template/ContentHeader/GdtAmount'
|
||||
import CommunityMember from '@/components/Template/ContentHeader/CommunityMember'
|
||||
import NavCommunity from '@/components/Template/ContentHeader/NavCommunity'
|
||||
import LastTransactions from '@/components/Template/RightSide/LastTransactions'
|
||||
|
||||
export default {
|
||||
name: 'DashboardLayout',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import DashboardPlugin from './plugins/dashboard-plugin'
|
||||
import App from './App.vue'
|
||||
import App from './App'
|
||||
import i18n from './i18n.js'
|
||||
import { loadAllRules } from './validation-rules'
|
||||
import { toasters } from './mixins/toaster'
|
||||
|
||||
@ -58,9 +58,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import OpenCreationsAmount from '@/components/Contributions/OpenCreationsAmount.vue'
|
||||
import ContributionForm from '@/components/Contributions/ContributionForm.vue'
|
||||
import ContributionList from '@/components/Contributions/ContributionList.vue'
|
||||
import OpenCreationsAmount from '@/components/Contributions/OpenCreationsAmount'
|
||||
import ContributionForm from '@/components/Contributions/ContributionForm'
|
||||
import ContributionList from '@/components/Contributions/ContributionList'
|
||||
import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations'
|
||||
import { listContributions, listAllContributions, openCreations } from '@/graphql/queries'
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CommunityNews from '@/components/Overview/CommunityNews.vue'
|
||||
import CommunityNews from '@/components/Overview/CommunityNews'
|
||||
|
||||
export default {
|
||||
name: 'Overview',
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<script>
|
||||
import { createUser } from '@/graphql/mutations'
|
||||
import CONFIG from '@/config'
|
||||
import InputEmail from '@/components/Inputs/InputEmail.vue'
|
||||
import InputEmail from '@/components/Inputs/InputEmail'
|
||||
import Message from '@/components/Message/Message'
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Send, { SEND_TYPES } from './Send'
|
||||
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
|
||||
import { TRANSACTION_STEPS } from '@/components/GddSend.vue'
|
||||
import { TRANSACTION_STEPS } from '@/components/GddSend'
|
||||
import { sendCoins, createTransactionLink } from '@/graphql/mutations.js'
|
||||
import DashboardLayout from '@/layouts/DashboardLayout.vue'
|
||||
import DashboardLayout from '@/layouts/DashboardLayout'
|
||||
import flushPromises from 'flush-promises'
|
||||
|
||||
const apolloMutationMock = jest.fn()
|
||||
|
||||
@ -52,13 +52,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import GddSend, { TRANSACTION_STEPS } from '@/components/GddSend.vue'
|
||||
import TransactionForm from '@/components/GddSend/TransactionForm.vue'
|
||||
import TransactionConfirmationSend from '@/components/GddSend/TransactionConfirmationSend.vue'
|
||||
import TransactionConfirmationLink from '@/components/GddSend/TransactionConfirmationLink.vue'
|
||||
import TransactionResultSendSuccess from '@/components/GddSend/TransactionResultSendSuccess.vue'
|
||||
import TransactionResultSendError from '@/components/GddSend/TransactionResultSendError.vue'
|
||||
import TransactionResultLink from '@/components/GddSend/TransactionResultLink.vue'
|
||||
import GddSend, { TRANSACTION_STEPS } from '@/components/GddSend'
|
||||
import TransactionForm from '@/components/GddSend/TransactionForm'
|
||||
import TransactionConfirmationSend from '@/components/GddSend/TransactionConfirmationSend'
|
||||
import TransactionConfirmationLink from '@/components/GddSend/TransactionConfirmationLink'
|
||||
import TransactionResultSendSuccess from '@/components/GddSend/TransactionResultSendSuccess'
|
||||
import TransactionResultSendError from '@/components/GddSend/TransactionResultSendError'
|
||||
import TransactionResultLink from '@/components/GddSend/TransactionResultLink'
|
||||
import { sendCoins, createTransactionLink } from '@/graphql/mutations.js'
|
||||
|
||||
const EMPTY_TRANSACTION_DATA = {
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UserCard from '@/components/UserSettings/UserCard.vue'
|
||||
import UserData from '@/components/UserSettings/UserData.vue'
|
||||
import UserPassword from '@/components/UserSettings/UserPassword.vue'
|
||||
import UserLanguage from '@/components/UserSettings/UserLanguage.vue'
|
||||
import UserNewsletter from '@/components/UserSettings/UserNewsletter.vue'
|
||||
import UserCard from '@/components/UserSettings/UserCard'
|
||||
import UserData from '@/components/UserSettings/UserData'
|
||||
import UserPassword from '@/components/UserSettings/UserPassword'
|
||||
import UserLanguage from '@/components/UserSettings/UserLanguage'
|
||||
import UserNewsletter from '@/components/UserSettings/UserNewsletter'
|
||||
|
||||
export default {
|
||||
name: 'Profile',
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import GddTransactionList from '@/components/GddTransactionList.vue'
|
||||
import GdtTransactionList from '@/components/GdtTransactionList.vue'
|
||||
import GddTransactionList from '@/components/GddTransactionList'
|
||||
import GdtTransactionList from '@/components/GdtTransactionList'
|
||||
import { listGDTEntriesQuery } from '@/graphql/queries'
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import router from './router'
|
||||
import NotFound from '@/pages/NotFoundPage.vue'
|
||||
import NotFound from '@/pages/NotFoundPage'
|
||||
|
||||
describe('router', () => {
|
||||
describe('options', () => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import NotFound from '@/pages/NotFoundPage.vue'
|
||||
import NotFound from '@/pages/NotFoundPage'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@ -12,7 +12,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/overview',
|
||||
component: () => import('@/pages/Overview.vue'),
|
||||
component: () => import('@/pages/Overview'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'overview',
|
||||
@ -20,7 +20,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/send',
|
||||
component: () => import('@/pages/Send.vue'),
|
||||
component: () => import('@/pages/Send'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'send',
|
||||
@ -28,14 +28,14 @@ const routes = [
|
||||
},
|
||||
// {
|
||||
// path: '/profile',
|
||||
// component: () => import('@/pages/Profile.vue'),
|
||||
// component: () => import('@/pages/Profile'),
|
||||
// meta: {
|
||||
// requiresAuth: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: '/transactions',
|
||||
component: () => import('@/pages/Transactions.vue'),
|
||||
component: () => import('@/pages/Transactions'),
|
||||
props: { gdt: false },
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
@ -44,7 +44,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/gdt',
|
||||
component: () => import('@/pages/Transactions.vue'),
|
||||
component: () => import('@/pages/Transactions'),
|
||||
props: { gdt: true },
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
@ -53,7 +53,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/community',
|
||||
component: () => import('@/pages/Community.vue'),
|
||||
component: () => import('@/pages/Community'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'community',
|
||||
@ -72,7 +72,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/information',
|
||||
component: () => import('@/pages/InfoStatistic.vue'),
|
||||
component: () => import('@/pages/InfoStatistic'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'information',
|
||||
@ -80,21 +80,21 @@ const routes = [
|
||||
},
|
||||
// {
|
||||
// path: '/storys',
|
||||
// component: () => import('@/pages/TopStorys.vue'),
|
||||
// component: () => import('@/pages/TopStorys'),
|
||||
// meta: {
|
||||
// requiresAuth: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: '/addresses',
|
||||
// component: () => import('@/pages/Addresses.vue'),
|
||||
// component: () => import('@/pages/Addresses'),
|
||||
// meta: {
|
||||
// requiresAuth: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: '/settings',
|
||||
component: () => import('@/pages/Settings.vue'),
|
||||
component: () => import('@/pages/Settings'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'settings',
|
||||
@ -102,39 +102,39 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/login/:code?',
|
||||
component: () => import('@/pages/Login.vue'),
|
||||
component: () => import('@/pages/Login'),
|
||||
},
|
||||
{
|
||||
path: '/register/:code?',
|
||||
component: () => import('@/pages/Register.vue'),
|
||||
component: () => import('@/pages/Register'),
|
||||
},
|
||||
{
|
||||
path: '/forgot-password',
|
||||
component: () => import('@/pages/ForgotPassword.vue'),
|
||||
component: () => import('@/pages/ForgotPassword'),
|
||||
},
|
||||
{
|
||||
path: '/forgot-password/:comingFrom',
|
||||
component: () => import('@/pages/ForgotPassword.vue'),
|
||||
component: () => import('@/pages/ForgotPassword'),
|
||||
},
|
||||
{
|
||||
path: '/register-community',
|
||||
component: () => import('@/pages/RegisterCommunity.vue'),
|
||||
component: () => import('@/pages/RegisterCommunity'),
|
||||
},
|
||||
// {
|
||||
// path: '/select-community',
|
||||
// component: () => import('@/pages/SelectCommunity.vue'),
|
||||
// component: () => import('@/pages/SelectCommunity'),
|
||||
// },
|
||||
{
|
||||
path: '/reset-password/:optin',
|
||||
component: () => import('@/pages/ResetPassword.vue'),
|
||||
component: () => import('@/pages/ResetPassword'),
|
||||
},
|
||||
{
|
||||
path: '/checkEmail/:optin/:code?',
|
||||
component: () => import('@/pages/ResetPassword.vue'),
|
||||
component: () => import('@/pages/ResetPassword'),
|
||||
},
|
||||
{
|
||||
path: '/redeem/:code',
|
||||
component: () => import('@/pages/TransactionLink.vue'),
|
||||
component: () => import('@/pages/TransactionLink'),
|
||||
},
|
||||
{ path: '*', component: NotFound },
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user