mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
rename getPendingCreations
This commit is contained in:
parent
244cf20542
commit
d95b1893cd
@ -1,8 +1,8 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export const getPendingCreations = gql`
|
export const listUnconfirmedContributions = gql`
|
||||||
query {
|
query {
|
||||||
getPendingCreations {
|
listUnconfirmedContributions {
|
||||||
id
|
id
|
||||||
firstName
|
firstName
|
||||||
lastName
|
lastName
|
||||||
@ -9,7 +9,7 @@ const localVue = global.localVue
|
|||||||
const storeCommitMock = jest.fn()
|
const storeCommitMock = jest.fn()
|
||||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||||
data: {
|
data: {
|
||||||
getPendingCreations: [
|
listUnconfirmedContributions: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
firstName: 'Bibi',
|
firstName: 'Bibi',
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Overlay from '../components/Overlay.vue'
|
import Overlay from '../components/Overlay.vue'
|
||||||
import OpenCreationsTable from '../components/Tables/OpenCreationsTable.vue'
|
import OpenCreationsTable from '../components/Tables/OpenCreationsTable.vue'
|
||||||
import { getPendingCreations } from '../graphql/getPendingCreations'
|
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||||
import { deletePendingCreation } from '../graphql/deletePendingCreation'
|
import { deletePendingCreation } from '../graphql/deletePendingCreation'
|
||||||
import { confirmPendingCreation } from '../graphql/confirmPendingCreation'
|
import { confirmPendingCreation } from '../graphql/confirmPendingCreation'
|
||||||
|
|
||||||
@ -70,13 +70,13 @@ export default {
|
|||||||
getPendingCreations() {
|
getPendingCreations() {
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.query({
|
.query({
|
||||||
query: getPendingCreations,
|
query: listUnconfirmedContributions,
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.$store.commit('resetOpenCreations')
|
this.$store.commit('resetOpenCreations')
|
||||||
this.pendingCreations = result.data.getPendingCreations
|
this.pendingCreations = result.data.listUnconfirmedContributions
|
||||||
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
|
this.$store.commit('setOpenCreations', result.data.listUnconfirmedContributions.length)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.toastError(error.message)
|
this.toastError(error.message)
|
||||||
|
|||||||
@ -5,7 +5,7 @@ const localVue = global.localVue
|
|||||||
|
|
||||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||||
data: {
|
data: {
|
||||||
getPendingCreations: [
|
listUnconfirmedContributions: [
|
||||||
{
|
{
|
||||||
pending: true,
|
pending: true,
|
||||||
},
|
},
|
||||||
@ -46,7 +46,7 @@ describe('Overview', () => {
|
|||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls getPendingCreations', () => {
|
it('calls listUnconfirmedContributions', () => {
|
||||||
expect(apolloQueryMock).toBeCalled()
|
expect(apolloQueryMock).toBeCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getPendingCreations } from '../graphql/getPendingCreations'
|
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'overview',
|
name: 'overview',
|
||||||
@ -39,11 +39,11 @@ export default {
|
|||||||
async getPendingCreations() {
|
async getPendingCreations() {
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.query({
|
.query({
|
||||||
query: getPendingCreations,
|
query: listUnconfirmedContributions,
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.$store.commit('setOpenCreations', result.data.getPendingCreations.length)
|
this.$store.commit('setOpenCreations', result.data.listUnconfirmedContributions.length)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export enum RIGHTS {
|
|||||||
ADMIN_CREATE_CONTRIBUTION = 'ADMIN_CREATE_CONTRIBUTION',
|
ADMIN_CREATE_CONTRIBUTION = 'ADMIN_CREATE_CONTRIBUTION',
|
||||||
ADMIN_CREATE_CONTRIBUTIONS = 'ADMIN_CREATE_CONTRIBUTIONS',
|
ADMIN_CREATE_CONTRIBUTIONS = 'ADMIN_CREATE_CONTRIBUTIONS',
|
||||||
ADMIN_UPDATE_CONTRIBUTION = 'ADMIN_UPDATE_CONTRIBUTION',
|
ADMIN_UPDATE_CONTRIBUTION = 'ADMIN_UPDATE_CONTRIBUTION',
|
||||||
SEARCH_PENDING_CREATION = 'SEARCH_PENDING_CREATION',
|
LIST_UNCONFIRMED_CONTRIBUTIONS = 'LIST_UNCONFIRMED_CONTRIBUTIONS',
|
||||||
DELETE_PENDING_CREATION = 'DELETE_PENDING_CREATION',
|
DELETE_PENDING_CREATION = 'DELETE_PENDING_CREATION',
|
||||||
CONFIRM_PENDING_CREATION = 'CONFIRM_PENDING_CREATION',
|
CONFIRM_PENDING_CREATION = 'CONFIRM_PENDING_CREATION',
|
||||||
SEND_ACTIVATION_EMAIL = 'SEND_ACTIVATION_EMAIL',
|
SEND_ACTIVATION_EMAIL = 'SEND_ACTIVATION_EMAIL',
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import {
|
|||||||
updateContributionLink,
|
updateContributionLink,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
import {
|
import {
|
||||||
getPendingCreations,
|
listUnconfirmedContributions,
|
||||||
login,
|
login,
|
||||||
searchUsers,
|
searchUsers,
|
||||||
listTransactionLinksAdmin,
|
listTransactionLinksAdmin,
|
||||||
@ -548,11 +548,11 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('getPendingCreations', () => {
|
describe('listUnconfirmedContributions', () => {
|
||||||
it('returns an error', async () => {
|
it('returns an error', async () => {
|
||||||
await expect(
|
await expect(
|
||||||
query({
|
query({
|
||||||
query: getPendingCreations,
|
query: listUnconfirmedContributions,
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -658,11 +658,11 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('getPendingCreations', () => {
|
describe('listUnconfirmedContributions', () => {
|
||||||
it('returns an error', async () => {
|
it('returns an error', async () => {
|
||||||
await expect(
|
await expect(
|
||||||
query({
|
query({
|
||||||
query: getPendingCreations,
|
query: listUnconfirmedContributions,
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1116,16 +1116,16 @@ describe('AdminResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('getPendingCreations', () => {
|
describe('listUnconfirmedContributions', () => {
|
||||||
it('returns four pending creations', async () => {
|
it('returns four pending creations', async () => {
|
||||||
await expect(
|
await expect(
|
||||||
query({
|
query({
|
||||||
query: getPendingCreations,
|
query: listUnconfirmedContributions,
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
data: {
|
data: {
|
||||||
getPendingCreations: expect.arrayContaining([
|
listUnconfirmedContributions: expect.arrayContaining([
|
||||||
{
|
{
|
||||||
id: expect.any(Number),
|
id: expect.any(Number),
|
||||||
firstName: 'Peter',
|
firstName: 'Peter',
|
||||||
|
|||||||
@ -283,9 +283,9 @@ export class AdminResolver {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@Authorized([RIGHTS.SEARCH_PENDING_CREATION])
|
@Authorized([RIGHTS.LIST_UNCONFIRMED_CONTRIBUTIONS])
|
||||||
@Query(() => [UnconfirmedContribution])
|
@Query(() => [UnconfirmedContribution])
|
||||||
async getPendingCreations(): Promise<UnconfirmedContribution[]> {
|
async listUnconfirmedContributions(): Promise<UnconfirmedContribution[]> {
|
||||||
const contributions = await Contribution.find({ where: { confirmedAt: IsNull() } })
|
const contributions = await Contribution.find({ where: { confirmedAt: IsNull() } })
|
||||||
if (contributions.length === 0) {
|
if (contributions.length === 0) {
|
||||||
return []
|
return []
|
||||||
|
|||||||
@ -173,9 +173,9 @@ export const queryTransactionLink = gql`
|
|||||||
|
|
||||||
// from admin interface
|
// from admin interface
|
||||||
|
|
||||||
export const getPendingCreations = gql`
|
export const listUnconfirmedContributions = gql`
|
||||||
query {
|
query {
|
||||||
getPendingCreations {
|
listUnconfirmedContributions {
|
||||||
id
|
id
|
||||||
firstName
|
firstName
|
||||||
lastName
|
lastName
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user