From d04fcc928024cd5274843c26f2be1ff81e4de436 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Nov 2021 10:57:46 +0100 Subject: [PATCH 001/112] Document release --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index ead54701c..a5060ffef 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,21 @@ We are currently restructuring the service to reduce dependencies and unify busi Once you have `docker-compose` up and running, you can open [http://localhost/vue](http://localhost/vue) and create yourself a new wallet account. +## How to release + +A release is tagged on Github by its version number and published as github release. This is done automatically when a new version is defined in the [package.json](./package.json) and merged into master - furthermore we set all our sub-package-versions to the same version as the main package.json version to make version management as simple as possible. +Each release is accompanied with release notes automatically generated from the git log which is available as [CHANGELOG.md](./CHANGELOG.md). + +To generate the Changelog and set a new Version you should use the following commands in the main folder +```bash +git fetch --all +yarn release +``` + +The first command `git fetch --all` will make sure you have all tags previously defined which is required to generate a correct changelog. The second command `yarn release` will execute the changelog tool and set version numbers in the main package and sub-packages. It is required to do `yarn install` before you can use this command. +After generating a new version you should commit the changes. This will be the CHANGELOG.md and several package.json files. This commit will be omitted in the changelog. + +Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `yarn release` command. ## Troubleshooting | Problem | Issue | Solution | Description | From 995abc53be46aaaa8e281a213d69090a0cbbe0f3 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Nov 2021 11:00:03 +0100 Subject: [PATCH 002/112] missing newline --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a5060ffef..ce8e84df0 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ The first command `git fetch --all` will make sure you have all tags previously After generating a new version you should commit the changes. This will be the CHANGELOG.md and several package.json files. This commit will be omitted in the changelog. Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `yarn release` command. + ## Troubleshooting | Problem | Issue | Solution | Description | From 030c94acedd9db1054d534b646ce3d3cff9f5ac3 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Nov 2021 11:03:25 +0100 Subject: [PATCH 003/112] add admin to the release script --- scripts/release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/release.sh b/scripts/release.sh index d18c4948c..0b70e76ad 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -6,6 +6,7 @@ PROJECT_DIR="${SCRIPT_DIR}/../" FRONTEND_DIR="${PROJECT_DIR}/frontend/" BACKEND_DIR="${PROJECT_DIR}/backend/" DATABASE_DIR="${PROJECT_DIR}/database/" +ADMIN_DIR="${PROJECT_DIR}/admin/" # navigate to project directory cd ${PROJECT_DIR} @@ -23,6 +24,8 @@ cd ${BACKEND_DIR} yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION} cd ${DATABASE_DIR} yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION} +cd ${ADMIN_DIR} +yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION} # generate changelog cd ${PROJECT_DIR} From 9e45a2168773b1ede494ac99ceb6a7a99af72e26 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Fri, 26 Nov 2021 10:59:32 +0100 Subject: [PATCH 004/112] Call Apollo query to get the pendingCreations. --- admin/src/graphql/getPendingCreations.js | 7 +++++++ admin/src/pages/CreationConfirm.vue | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 admin/src/graphql/getPendingCreations.js diff --git a/admin/src/graphql/getPendingCreations.js b/admin/src/graphql/getPendingCreations.js new file mode 100644 index 000000000..322d46269 --- /dev/null +++ b/admin/src/graphql/getPendingCreations.js @@ -0,0 +1,7 @@ +import gql from 'graphql-tag' + +export const getPendingCreations = gql` + query { + getPendingCreations + } +` diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 0d68635e0..d035e1b74 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -15,6 +15,7 @@ diff --git a/admin/src/store/store.js b/admin/src/store/store.js index 140a92391..9559e3d58 100644 --- a/admin/src/store/store.js +++ b/admin/src/store/store.js @@ -18,6 +18,9 @@ export const mutations = { token: (state, token) => { state.token = token }, + setOpenCreations: (state, openCreations) => { + state.openCreations = openCreations + }, } export const actions = { From 99749eebb2a6459a59844dd4d060aa3b6297054b Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Fri, 26 Nov 2021 11:28:14 +0100 Subject: [PATCH 006/112] Apollo first steps getPendingCreations. --- admin/src/pages/CreationConfirm.vue | 1 + backend/src/graphql/resolver/AdminResolver.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index d035e1b74..5e5078283 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -153,6 +153,7 @@ export default { }, }, created() { + this.getPendingCreations() this.$store.commit('resetOpenCreations') this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length) }, diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index f08b1a4dc..6b81ce220 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -1,5 +1,5 @@ import { Resolver, Query, Arg, Args, Authorized } from 'type-graphql' -import { getCustomRepository, Raw } from 'typeorm' +import { getCustomRepository, Raw, Any } from 'typeorm' import { UserAdmin } from '../model/UserAdmin' import { LoginUserRepository } from '../../typeorm/repository/LoginUser' import { RIGHTS } from '../../auth/RIGHTS' @@ -7,6 +7,7 @@ import { TransactionCreationRepository } from '../../typeorm/repository/Transact import { PendingCreationRepository } from '../../typeorm/repository/PendingCreation' import { UserRepository } from '../../typeorm/repository/User' import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs' +import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin' import moment from 'moment' @Resolver() @@ -52,6 +53,14 @@ export class AdminResolver { } return await getUserCreations(user.id) } + + @Query(() => String) + async getPendingCreations(): Promise { + const pendingCreationRepository = getCustomRepository(PendingCreationRepository) + const pendingCreations = await pendingCreationRepository.find() + console.log('pendingCreations', pendingCreations) + return pendingCreations.toString() + } } async function getUserCreations(id: number): Promise { From 602dfd64f1edb5ac5ada8ce34c3859ced92c6922 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Fri, 26 Nov 2021 12:36:01 +0100 Subject: [PATCH 007/112] Corected return type for getPendingCreations and corected query. --- admin/src/graphql/getPendingCreations.js | 10 +++++- backend/src/graphql/model/PendingCreation.ts | 31 +++++++++++++++++++ backend/src/graphql/resolver/AdminResolver.ts | 25 ++++++++++++--- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 backend/src/graphql/model/PendingCreation.ts diff --git a/admin/src/graphql/getPendingCreations.js b/admin/src/graphql/getPendingCreations.js index 322d46269..c387c368e 100644 --- a/admin/src/graphql/getPendingCreations.js +++ b/admin/src/graphql/getPendingCreations.js @@ -2,6 +2,14 @@ import gql from 'graphql-tag' export const getPendingCreations = gql` query { - getPendingCreations + getPendingCreations { + firstName + lastName + email + amount + note + date + moderator + } } ` diff --git a/backend/src/graphql/model/PendingCreation.ts b/backend/src/graphql/model/PendingCreation.ts new file mode 100644 index 000000000..56bbe6d27 --- /dev/null +++ b/backend/src/graphql/model/PendingCreation.ts @@ -0,0 +1,31 @@ +import { ObjectType, Field, Int } from 'type-graphql' + +@ObjectType() +export class PendingCreation { + @Field(() => String) + firstName: string + + @Field(() => Int) + id?: number + + @Field(() => String) + lastName: string + + @Field(() => Number) + userId: number + + @Field(() => String) + email: string + + @Field(() => Date) + date: Date + + @Field(() => String) + note: string + + @Field(() => Number) + amount: BigInt + + @Field(() => Number) + moderator: number +} diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 6b81ce220..8dd0293ce 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -1,6 +1,7 @@ import { Resolver, Query, Arg, Args, Authorized } from 'type-graphql' import { getCustomRepository, Raw, Any } from 'typeorm' import { UserAdmin } from '../model/UserAdmin' +import { PendingCreation } from '../model/PendingCreation' import { LoginUserRepository } from '../../typeorm/repository/LoginUser' import { RIGHTS } from '../../auth/RIGHTS' import { TransactionCreationRepository } from '../../typeorm/repository/TransactionCreation' @@ -54,12 +55,28 @@ export class AdminResolver { return await getUserCreations(user.id) } - @Query(() => String) - async getPendingCreations(): Promise { + @Query(() => [PendingCreation]) + async getPendingCreations(): Promise { const pendingCreationRepository = getCustomRepository(PendingCreationRepository) const pendingCreations = await pendingCreationRepository.find() - console.log('pendingCreations', pendingCreations) - return pendingCreations.toString() + + const pendingCreationsPromise = await Promise.all( + pendingCreations.map(async (pendingCreation) => { + const userRepository = getCustomRepository(UserRepository) + const user = await userRepository.findOneOrFail({ id: pendingCreation.userId }) + + const newPendingCreation = { + ...pendingCreation, + firstName: user.firstName, + lastName: user.lastName, + email: user.email, + } + + return newPendingCreation + }), + ) + console.log('pendingCreations', pendingCreationsPromise) + return pendingCreationsPromise } } From 48c0b687d6be249025dc512c12038b7c5fca33a4 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 15:05:49 +0100 Subject: [PATCH 008/112] Query changed to Type PendingCreation, changed the login user search to state user search, adding parameters to PendingCreation object, changed frontend to map the query informations. --- admin/src/graphql/getPendingCreations.js | 1 + admin/src/pages/CreationConfirm.vue | 98 +++---------------- backend/src/graphql/model/PendingCreation.ts | 3 + backend/src/graphql/resolver/AdminResolver.ts | 24 ++--- backend/src/typeorm/repository/User.ts | 13 +++ 5 files changed, 43 insertions(+), 96 deletions(-) diff --git a/admin/src/graphql/getPendingCreations.js b/admin/src/graphql/getPendingCreations.js index c387c368e..f359c79db 100644 --- a/admin/src/graphql/getPendingCreations.js +++ b/admin/src/graphql/getPendingCreations.js @@ -10,6 +10,7 @@ export const getPendingCreations = gql` note date moderator + creation } } ` diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 5e5078283..660436d6c 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -31,98 +31,25 @@ export default { { key: 'firstName', label: 'Vorname' }, { key: 'lastName', label: 'Nachname' }, { - key: 'creation_gdd', + key: 'amount', label: 'Schöpfung', formatter: (value) => { return value + ' GDD' }, }, - { key: 'text', label: 'Text' }, + { key: 'note', label: 'Text' }, { - key: 'creation_date', + key: 'date', label: 'Datum', formatter: (value) => { - return value.long + return this.$moment(value).format('ll') }, }, - { key: 'creation_moderator', label: 'Moderator' }, + { key: 'moderator', label: 'Moderator' }, { key: 'edit_creation', label: 'ändern' }, { key: 'confirm', label: 'speichern' }, ], - confirmResult: [ - { - id: 1, - email: 'dickerson@web.de', - firstName: 'Dickerson', - lastName: 'Macdonald', - creation: '[450,200,700]', - creation_gdd: '1000', - text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ', - - creation_date: { - short: 'November', - long: '22/11/2021', - }, - creation_moderator: 'Manuela Gast', - }, - { - id: 2, - email: 'larsen@woob.de', - firstName: 'Larsen', - lastName: 'Shaw', - creation: '[300,200,1000]', - creation_gdd: '1000', - text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ', - - creation_date: { - short: 'November', - long: '03/11/2021', - }, - creation_moderator: 'Manuela Gast', - }, - { - id: 3, - email: 'geneva@tete.de', - firstName: 'Geneva', - lastName: 'Wilson', - creation: '[350,200,900]', - creation_gdd: '1000', - text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam', - creation_date: { - short: 'September', - long: '27/09/2021', - }, - creation_moderator: 'Manuela Gast', - }, - { - id: 4, - email: 'viewrter@asdfvb.com', - firstName: 'Soledare', - lastName: 'Takker', - creation: '[100,400,800]', - creation_gdd: '500', - text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo ', - creation_date: { - short: 'Oktober', - long: '12/10/2021', - }, - creation_moderator: 'Evelyn Roller', - }, - { - id: 5, - email: 'dickerson@web.de', - firstName: 'Dickerson', - lastName: 'Macdonald', - creation: '[100,400,800]', - creation_gdd: '200', - text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At', - creation_date: { - short: 'September', - long: '05/09/2021', - }, - creation_moderator: 'Manuela Gast', - }, - ], + confirmResult: [], } }, @@ -141,20 +68,21 @@ export default { this.$store.commit('openCreationsMinus', 1) } }, - getPendingCreations() { + async getPendingCreations() { this.$apollo .query({ query: getPendingCreations, }) .then((result) => { - console.log('getPendingCreations.Result', result) + this.confirmResult = result.data.getPendingCreations + }) + .catch((error) => { + this.$toasted.error(error.message) }) - .catch() }, }, - created() { - this.getPendingCreations() - this.$store.commit('resetOpenCreations') + async created() { + await this.getPendingCreations() this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length) }, } diff --git a/backend/src/graphql/model/PendingCreation.ts b/backend/src/graphql/model/PendingCreation.ts index 56bbe6d27..aa12bd94b 100644 --- a/backend/src/graphql/model/PendingCreation.ts +++ b/backend/src/graphql/model/PendingCreation.ts @@ -28,4 +28,7 @@ export class PendingCreation { @Field(() => Number) moderator: number + + @Field(() => [Number]) + creation: number[] } diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 8dd0293ce..3c960b0fa 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -16,19 +16,19 @@ export class AdminResolver { @Authorized([RIGHTS.SEARCH_USERS]) @Query(() => [UserAdmin]) async searchUsers(@Arg('searchText') searchText: string): Promise { - const loginUserRepository = getCustomRepository(LoginUserRepository) - const loginUsers = await loginUserRepository.findBySearchCriteria(searchText) - const users = await Promise.all( - loginUsers.map(async (loginUser) => { - const user = new UserAdmin() - user.firstName = loginUser.firstName - user.lastName = loginUser.lastName - user.email = loginUser.email - user.creation = await getUserCreations(loginUser.id) - return user + const userRepository = getCustomRepository(UserRepository) + const users = await userRepository.findBySearchCriteria(searchText) + const adminUsers = await Promise.all( + users.map(async (user) => { + const adminUser = new UserAdmin() + adminUser.firstName = user.firstName + adminUser.lastName = user.lastName + adminUser.email = user.email + adminUser.creation = await getUserCreations(user.id) + return adminUser }), ) - return users + return adminUsers } @Query(() => [Number]) @@ -38,6 +38,7 @@ export class AdminResolver { const userRepository = getCustomRepository(UserRepository) const user = await userRepository.findByEmail(email) + console.log('User', user) const creations = await getUserCreations(user.id) const creationDateObj = new Date(creationDate) if (isCreationValid(creations, amount, creationDateObj)) { @@ -70,6 +71,7 @@ export class AdminResolver { firstName: user.firstName, lastName: user.lastName, email: user.email, + creation: await getUserCreations(user.id), } return newPendingCreation diff --git a/backend/src/typeorm/repository/User.ts b/backend/src/typeorm/repository/User.ts index e127c179c..cf67c837b 100644 --- a/backend/src/typeorm/repository/User.ts +++ b/backend/src/typeorm/repository/User.ts @@ -30,4 +30,17 @@ export class UserRepository extends Repository { }) return usersIndiced } + + async findBySearchCriteria(searchCriteria: string): Promise { + return await this.createQueryBuilder('user') + .where( + 'user.firstName like :name or user.lastName like :lastName or user.email like :email', + { + name: `%${searchCriteria}%`, + lastName: `%${searchCriteria}%`, + email: `%${searchCriteria}%`, + }, + ) + .getMany() + } } From 18a530b1b129cb270b85ac651a24bcfdb9b17c32 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 15:11:03 +0100 Subject: [PATCH 009/112] Withdrew console.logs. --- backend/src/graphql/resolver/AdminResolver.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 3c960b0fa..ca903f49b 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -38,7 +38,6 @@ export class AdminResolver { const userRepository = getCustomRepository(UserRepository) const user = await userRepository.findByEmail(email) - console.log('User', user) const creations = await getUserCreations(user.id) const creationDateObj = new Date(creationDate) if (isCreationValid(creations, amount, creationDateObj)) { @@ -77,7 +76,6 @@ export class AdminResolver { return newPendingCreation }), ) - console.log('pendingCreations', pendingCreationsPromise) return pendingCreationsPromise } } From e0ad9ab40a609728127c26ca0597a9f196033c8c Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 15:11:46 +0100 Subject: [PATCH 010/112] Removed unused imports. --- backend/src/graphql/resolver/AdminResolver.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index ca903f49b..a93696814 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -1,14 +1,12 @@ import { Resolver, Query, Arg, Args, Authorized } from 'type-graphql' -import { getCustomRepository, Raw, Any } from 'typeorm' +import { getCustomRepository, Raw } from 'typeorm' import { UserAdmin } from '../model/UserAdmin' import { PendingCreation } from '../model/PendingCreation' -import { LoginUserRepository } from '../../typeorm/repository/LoginUser' import { RIGHTS } from '../../auth/RIGHTS' import { TransactionCreationRepository } from '../../typeorm/repository/TransactionCreation' import { PendingCreationRepository } from '../../typeorm/repository/PendingCreation' import { UserRepository } from '../../typeorm/repository/User' import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs' -import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin' import moment from 'moment' @Resolver() From a618ac678e3685c26a83c68a31ab710286368bbb Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 15:35:21 +0100 Subject: [PATCH 011/112] Created delete query. --- admin/src/graphql/getPendingCreations.js | 1 + backend/src/graphql/resolver/AdminResolver.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/admin/src/graphql/getPendingCreations.js b/admin/src/graphql/getPendingCreations.js index f359c79db..add9efc29 100644 --- a/admin/src/graphql/getPendingCreations.js +++ b/admin/src/graphql/getPendingCreations.js @@ -3,6 +3,7 @@ import gql from 'graphql-tag' export const getPendingCreations = gql` query { getPendingCreations { + id firstName lastName email diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index a93696814..70f6c35ec 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -8,6 +8,7 @@ import { PendingCreationRepository } from '../../typeorm/repository/PendingCreat import { UserRepository } from '../../typeorm/repository/User' import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs' import moment from 'moment' +import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin' @Resolver() export class AdminResolver { @@ -76,6 +77,15 @@ export class AdminResolver { ) return pendingCreationsPromise } + + @Query(() => Boolean) + async deletePendingCreation(@Arg('id') id: number): Promise { + const pendingCreationRepository = getCustomRepository(PendingCreationRepository) + const entity = await pendingCreationRepository.findOne(id) + if (!entity) throw new Error('Not pending creation with this id.') + const res = await pendingCreationRepository.manager.remove(entity) + return res ? true : false + } } async function getUserCreations(id: number): Promise { From 2f6a1a06300c58bbfa567352bdf632de84a9d367 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 17:43:24 +0100 Subject: [PATCH 012/112] In CreationConfirm.vue number of all open creations and transferred to the store --- admin/src/pages/CreationConfirm.vue | 3 ++- admin/src/pages/Overview.vue | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 660436d6c..c44402a1e 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -75,6 +75,8 @@ export default { }) .then((result) => { this.confirmResult = result.data.getPendingCreations + this.$store.commit('resetOpenCreations') + this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length) }) .catch((error) => { this.$toasted.error(error.message) @@ -83,7 +85,6 @@ export default { }, async created() { await this.getPendingCreations() - this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length) }, } diff --git a/admin/src/pages/Overview.vue b/admin/src/pages/Overview.vue index d63c46199..329843cad 100644 --- a/admin/src/pages/Overview.vue +++ b/admin/src/pages/Overview.vue @@ -76,21 +76,27 @@ From f2c31b7d6837ef22e9c79a65d1d4f60323c3a724 Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 17:49:29 +0100 Subject: [PATCH 014/112] pendingCreationRepository.manager.remove res - fix prettier --- backend/src/graphql/resolver/AdminResolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 70f6c35ec..5d2ed47a2 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -84,7 +84,7 @@ export class AdminResolver { const entity = await pendingCreationRepository.findOne(id) if (!entity) throw new Error('Not pending creation with this id.') const res = await pendingCreationRepository.manager.remove(entity) - return res ? true : false + return !!res } } From 30ba6e473b176d02614a6360e93cd8cc854b7f7a Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 18:02:18 +0100 Subject: [PATCH 015/112] chnaged simpler counting, number of open creations --- admin/src/pages/CreationConfirm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index c44402a1e..1b53dc85b 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -76,7 +76,7 @@ export default { .then((result) => { this.confirmResult = result.data.getPendingCreations this.$store.commit('resetOpenCreations') - this.$store.commit('openCreationsPlus', Object.keys(this.confirmResult).length) + this.$store.commit('openCreationsPlus', result.data.getPendingCreations.length) }) .catch((error) => { this.$toasted.error(error.message) From 38da2dcdfd34d7b4331a4593849dffdeee2cbdaa Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 26 Nov 2021 18:09:10 +0100 Subject: [PATCH 016/112] Remove hint text for test creations on CreationConfirm Table. --- admin/src/pages/CreationConfirm.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 1b53dc85b..ec0e6e7af 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -1,9 +1,5 @@