From cac7f5865a51abd8a433277213ffe430b0532300 Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Wed, 1 Nov 2023 09:43:36 +0100 Subject: [PATCH 01/11] fix default value --- backend/src/graphql/arg/Paginated.ts | 4 ++-- backend/src/graphql/resolver/util/findContributions.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/graphql/arg/Paginated.ts b/backend/src/graphql/arg/Paginated.ts index 6bb31a6b8..f4e5cf4a6 100644 --- a/backend/src/graphql/arg/Paginated.ts +++ b/backend/src/graphql/arg/Paginated.ts @@ -10,9 +10,9 @@ export class Paginated { @IsPositive() currentPage: number - @Field(() => Int, { defaultValue: 3 }) + @Field(() => Int, { nullable: true }) @IsPositive() - pageSize: number + pageSize?: number @Field(() => Order, { defaultValue: Order.DESC }) @IsEnum(Order) diff --git a/backend/src/graphql/resolver/util/findContributions.ts b/backend/src/graphql/resolver/util/findContributions.ts index 48d66d883..77ef0c298 100644 --- a/backend/src/graphql/resolver/util/findContributions.ts +++ b/backend/src/graphql/resolver/util/findContributions.ts @@ -28,7 +28,7 @@ function joinRelationsRecursive( } export const findContributions = async ( - paginate: Paginated, + { pageSize = 3, currentPage, order }: Paginated, filter: SearchContributionsFilterArgs, withDeleted = false, relations: Relations | undefined = undefined, @@ -61,9 +61,9 @@ export const findContributions = async ( ) } return queryBuilder - .orderBy('Contribution.createdAt', paginate.order) - .addOrderBy('Contribution.id', paginate.order) - .skip((paginate.currentPage - 1) * paginate.pageSize) - .take(paginate.pageSize) + .orderBy('Contribution.createdAt', order) + .addOrderBy('Contribution.id', order) + .skip((currentPage - 1) * pageSize) + .take(pageSize) .getManyAndCount() } From d5a362bb59f694950ce24be0bcefd4bda20d146d Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Wed, 1 Nov 2023 09:47:06 +0100 Subject: [PATCH 02/11] make it complete --- backend/src/graphql/arg/Paginated.ts | 8 ++++---- backend/src/graphql/resolver/util/findContributions.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/graphql/arg/Paginated.ts b/backend/src/graphql/arg/Paginated.ts index f4e5cf4a6..c63416e7e 100644 --- a/backend/src/graphql/arg/Paginated.ts +++ b/backend/src/graphql/arg/Paginated.ts @@ -6,15 +6,15 @@ import { Order } from '@enum/Order' @ArgsType() export class Paginated { - @Field(() => Int, { defaultValue: 1 }) + @Field(() => Int, { nullable: true }) @IsPositive() - currentPage: number + currentPage?: number @Field(() => Int, { nullable: true }) @IsPositive() pageSize?: number - @Field(() => Order, { defaultValue: Order.DESC }) + @Field(() => Order, { nullable: true }) @IsEnum(Order) - order: Order + order?: Order } diff --git a/backend/src/graphql/resolver/util/findContributions.ts b/backend/src/graphql/resolver/util/findContributions.ts index 77ef0c298..9331111ee 100644 --- a/backend/src/graphql/resolver/util/findContributions.ts +++ b/backend/src/graphql/resolver/util/findContributions.ts @@ -7,6 +7,7 @@ import { SearchContributionsFilterArgs } from '@arg/SearchContributionsFilterArg import { Connection } from '@typeorm/connection' import { LogError } from '@/server/LogError' +import { Order } from '@/graphql/enum/Order' interface Relations { [key: string]: boolean | Relations @@ -28,7 +29,7 @@ function joinRelationsRecursive( } export const findContributions = async ( - { pageSize = 3, currentPage, order }: Paginated, + { pageSize = 3, currentPage = 1, order = Order.DESC }: Paginated, filter: SearchContributionsFilterArgs, withDeleted = false, relations: Relations | undefined = undefined, From e1249beaad75172baf4d9339d917a4586845f1cb Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Wed, 1 Nov 2023 09:51:35 +0100 Subject: [PATCH 03/11] fix linting --- backend/src/graphql/resolver/util/findContributions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/util/findContributions.ts b/backend/src/graphql/resolver/util/findContributions.ts index 9331111ee..d02043ff6 100644 --- a/backend/src/graphql/resolver/util/findContributions.ts +++ b/backend/src/graphql/resolver/util/findContributions.ts @@ -6,8 +6,8 @@ import { Paginated } from '@arg/Paginated' import { SearchContributionsFilterArgs } from '@arg/SearchContributionsFilterArgs' import { Connection } from '@typeorm/connection' -import { LogError } from '@/server/LogError' import { Order } from '@/graphql/enum/Order' +import { LogError } from '@/server/LogError' interface Relations { [key: string]: boolean | Relations From 315c08262898de54b342c72666eb35192a702cfd Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Fri, 3 Nov 2023 01:27:15 +0100 Subject: [PATCH 04/11] existing homecommunity with uuid as prerequisit for createUser --- .../graphql/resolver/EmailOptinCodes.test.ts | 3 +++ .../src/graphql/resolver/UserResolver.test.ts | 8 +++++++- backend/src/graphql/resolver/UserResolver.ts | 4 ++++ .../src/graphql/resolver/util/communities.ts | 20 +++++++++++++++++++ backend/src/seeds/factory/user.ts | 4 +++- 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolver/EmailOptinCodes.test.ts b/backend/src/graphql/resolver/EmailOptinCodes.test.ts index 640faad17..731d4a395 100644 --- a/backend/src/graphql/resolver/EmailOptinCodes.test.ts +++ b/backend/src/graphql/resolver/EmailOptinCodes.test.ts @@ -11,6 +11,8 @@ import { CONFIG } from '@/config' import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations' import { queryOptIn } from '@/seeds/graphql/queries' +import { createHomeCommunity } from './util/communities' + let mutate: ApolloServerTestClient['mutate'], query: ApolloServerTestClient['query'], con: Connection @@ -46,6 +48,7 @@ describe('EmailOptinCodes', () => { lastName: 'Lustig', language: 'de', } + await createHomeCommunity() const { data: { createUser: user }, } = await mutate({ mutation: createUser, variables }) diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index a9c50553e..fd9a85790 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -67,6 +67,8 @@ import { stephenHawking } from '@/seeds/users/stephen-hawking' import { printTimeDuration } from '@/util/time' import { objectValuesToArray } from '@/util/utilities' +import { createHomeCommunity } from './util/communities' + jest.mock('@/emails/sendEmailVariants', () => { const originalModule = jest.requireActual('@/emails/sendEmailVariants') return { @@ -125,9 +127,11 @@ describe('UserResolver', () => { let result: any let emailVerificationCode: string let user: User[] + let homeCom: DbCommunity beforeAll(async () => { jest.clearAllMocks() + homeCom = await createHomeCommunity() result = await mutate({ mutation: createUser, variables }) }) @@ -172,7 +176,7 @@ describe('UserResolver', () => { referrerId: null, contributionLinkId: null, passwordEncryptionType: PasswordEncryptionType.NO_PASSWORD, - communityUuid: null, + communityUuid: homeCom.communityUuid, foreign: false, }, ]) @@ -542,6 +546,7 @@ describe('UserResolver', () => { let newUser: User beforeAll(async () => { + await createHomeCommunity() await mutate({ mutation: createUser, variables: createUserVariables }) const emailContact = await UserContact.findOneOrFail({ where: { email: createUserVariables.email }, @@ -586,6 +591,7 @@ describe('UserResolver', () => { describe('no valid password', () => { beforeAll(async () => { + await createHomeCommunity() await mutate({ mutation: createUser, variables: createUserVariables }) const emailContact = await UserContact.findOneOrFail({ where: { email: createUserVariables.email }, diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 45ccd720e..1f21abbb9 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -275,6 +275,10 @@ export class UserResolver { { id: 0 } as DbUser, ) let dbUser = new DbUser() + const homeCom = await getHomeCommunity() + if (homeCom.communityUuid) { + dbUser.communityUuid = homeCom.communityUuid + } dbUser.gradidoID = gradidoID dbUser.firstName = firstName dbUser.lastName = lastName diff --git a/backend/src/graphql/resolver/util/communities.ts b/backend/src/graphql/resolver/util/communities.ts index 0c0023a19..9a271066d 100644 --- a/backend/src/graphql/resolver/util/communities.ts +++ b/backend/src/graphql/resolver/util/communities.ts @@ -63,3 +63,23 @@ export async function getCommunity(communityUuid: string): Promise { + let homeCom: DbCommunity + try { + return await getHomeCommunity() + } catch (err) { + homeCom = DbCommunity.create() + homeCom.foreign = false + homeCom.url = 'http://localhost/api' + homeCom.publicKey = Buffer.from('publicKey-HomeCommunity') + homeCom.privateKey = Buffer.from('privateKey-HomeCommunity') + homeCom.communityUuid = 'HomeCom-UUID' + homeCom.authenticatedAt = new Date() + homeCom.name = 'HomeCommunity-name' + homeCom.description = 'HomeCommunity-description' + homeCom.creationDate = new Date() + await DbCommunity.insert(homeCom) + return homeCom + } +} diff --git a/backend/src/seeds/factory/user.ts b/backend/src/seeds/factory/user.ts index 65b0ff3bb..321e9db17 100644 --- a/backend/src/seeds/factory/user.ts +++ b/backend/src/seeds/factory/user.ts @@ -5,7 +5,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing' import { RoleNames } from '@enum/RoleNames' -import { getHomeCommunity } from '@/graphql/resolver/util/communities' +import { createHomeCommunity, getHomeCommunity } from '@/graphql/resolver/util/communities' import { setUserRole } from '@/graphql/resolver/util/modifyUserRole' import { createUser, setPassword } from '@/seeds/graphql/mutations' import { UserInterface } from '@/seeds/users/UserInterface' @@ -16,6 +16,8 @@ export const userFactory = async ( ): Promise => { const { mutate } = client + await createHomeCommunity() + const { data: { createUser: { id }, From f521a38a1ca93aae255ea4e99d9cf512d9a9b797 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Fri, 3 Nov 2023 01:56:04 +0100 Subject: [PATCH 05/11] mirgation to correct missing communityUuid in users --- ...74-insert_communityuuid in_existing_users.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 database/migrations/0074-insert_communityuuid in_existing_users.ts diff --git a/database/migrations/0074-insert_communityuuid in_existing_users.ts b/database/migrations/0074-insert_communityuuid in_existing_users.ts new file mode 100644 index 000000000..eac93832d --- /dev/null +++ b/database/migrations/0074-insert_communityuuid in_existing_users.ts @@ -0,0 +1,17 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + // read the community uuid of the homeCommunity + const result = await queryFn(`SELECT c.community_uuid from communities as c WHERE c.foreign = 0`) + // and if uuid exists enter the home_community_uuid for all local users + if (result && result[0]) { + await queryFn( + `UPDATE users as u SET u.community_uuid = "${result[0].community_uuid}" WHERE u.foreign = 0 AND u.community_uuid IS NULL`, + ) + } +} + +export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn('SELECT * FROM dual;') +} From 1b5601c7af627c247dbf0e56e3a17ab53d69cab5 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Fri, 3 Nov 2023 02:26:55 +0100 Subject: [PATCH 06/11] correct sql statement --- .../migrations/0074-insert_communityuuid in_existing_users.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/0074-insert_communityuuid in_existing_users.ts b/database/migrations/0074-insert_communityuuid in_existing_users.ts index eac93832d..d03462b49 100644 --- a/database/migrations/0074-insert_communityuuid in_existing_users.ts +++ b/database/migrations/0074-insert_communityuuid in_existing_users.ts @@ -13,5 +13,5 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis } export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { - await queryFn('SELECT * FROM dual;') + await queryFn('') } From acea79c2bf0febf53e1bb6158f443d7f1316bfb2 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Mon, 6 Nov 2023 22:03:54 +0100 Subject: [PATCH 07/11] add dummy statement for downgrade --- .../migrations/0074-insert_communityuuid in_existing_users.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/migrations/0074-insert_communityuuid in_existing_users.ts b/database/migrations/0074-insert_communityuuid in_existing_users.ts index d03462b49..11ddf7096 100644 --- a/database/migrations/0074-insert_communityuuid in_existing_users.ts +++ b/database/migrations/0074-insert_communityuuid in_existing_users.ts @@ -13,5 +13,6 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis } export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { - await queryFn('') + // dummy statement to satisfy linter and queryFn + await queryFn('select count(*) from communities') } From 8c898490fb345d031685f47a7c0f8d1b53ca4050 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Mon, 6 Nov 2023 22:06:15 +0100 Subject: [PATCH 08/11] upgrade db-version in modules --- backend/src/config/index.ts | 2 +- dht-node/src/config/index.ts | 2 +- federation/src/config/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 25e901491..7ad0271ea 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -12,7 +12,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0073-introduce_foreign_user_in_users_table', + DB_VERSION: '0074-insert_communityuuid in_existing_users', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info diff --git a/dht-node/src/config/index.ts b/dht-node/src/config/index.ts index 2d88e0f92..7aed88ccd 100644 --- a/dht-node/src/config/index.ts +++ b/dht-node/src/config/index.ts @@ -4,7 +4,7 @@ import dotenv from 'dotenv' dotenv.config() const constants = { - DB_VERSION: '0073-introduce_foreign_user_in_users_table', + DB_VERSION: '0074-insert_communityuuid in_existing_users', LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info LOG_LEVEL: process.env.LOG_LEVEL || 'info', diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index 7cc9ef37e..2770ada06 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -10,7 +10,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0073-introduce_foreign_user_in_users_table', + DB_VERSION: '0074-insert_communityuuid in_existing_users', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info From 63d7f754e84d244677d994734f5e1f05fb35b910 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Tue, 7 Nov 2023 21:34:04 +0100 Subject: [PATCH 09/11] shift homecommunity creation for tests in seed directory-tree --- .../graphql/resolver/EmailOptinCodes.test.ts | 5 ++-- .../src/graphql/resolver/UserResolver.test.ts | 9 +++---- .../src/graphql/resolver/util/communities.ts | 20 --------------- backend/src/seeds/community/index.ts | 25 ++++++++++++++++++- backend/src/seeds/factory/user.ts | 5 ++-- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/backend/src/graphql/resolver/EmailOptinCodes.test.ts b/backend/src/graphql/resolver/EmailOptinCodes.test.ts index 731d4a395..09ad743fe 100644 --- a/backend/src/graphql/resolver/EmailOptinCodes.test.ts +++ b/backend/src/graphql/resolver/EmailOptinCodes.test.ts @@ -8,11 +8,10 @@ import { GraphQLError } from 'graphql' import { testEnvironment, cleanDB } from '@test/helpers' import { CONFIG } from '@/config' +import { writeHomeCommunityEntry } from '@/seeds/community' import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations' import { queryOptIn } from '@/seeds/graphql/queries' -import { createHomeCommunity } from './util/communities' - let mutate: ApolloServerTestClient['mutate'], query: ApolloServerTestClient['query'], con: Connection @@ -48,7 +47,7 @@ describe('EmailOptinCodes', () => { lastName: 'Lustig', language: 'de', } - await createHomeCommunity() + await writeHomeCommunityEntry() const { data: { createUser: user }, } = await mutate({ mutation: createUser, variables }) diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index fd9a85790..e16e0f0fc 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -34,6 +34,7 @@ import { import { EventType } from '@/event/Events' import { SecretKeyCryptographyCreateKey } from '@/password/EncryptorUtils' import { encryptPassword } from '@/password/PasswordEncryptor' +import { writeHomeCommunityEntry } from '@/seeds/community' import { contributionLinkFactory } from '@/seeds/factory/contributionLink' import { transactionLinkFactory } from '@/seeds/factory/transactionLink' import { userFactory } from '@/seeds/factory/user' @@ -67,8 +68,6 @@ import { stephenHawking } from '@/seeds/users/stephen-hawking' import { printTimeDuration } from '@/util/time' import { objectValuesToArray } from '@/util/utilities' -import { createHomeCommunity } from './util/communities' - jest.mock('@/emails/sendEmailVariants', () => { const originalModule = jest.requireActual('@/emails/sendEmailVariants') return { @@ -131,7 +130,7 @@ describe('UserResolver', () => { beforeAll(async () => { jest.clearAllMocks() - homeCom = await createHomeCommunity() + homeCom = await writeHomeCommunityEntry() result = await mutate({ mutation: createUser, variables }) }) @@ -546,7 +545,7 @@ describe('UserResolver', () => { let newUser: User beforeAll(async () => { - await createHomeCommunity() + await writeHomeCommunityEntry() await mutate({ mutation: createUser, variables: createUserVariables }) const emailContact = await UserContact.findOneOrFail({ where: { email: createUserVariables.email }, @@ -591,7 +590,7 @@ describe('UserResolver', () => { describe('no valid password', () => { beforeAll(async () => { - await createHomeCommunity() + await writeHomeCommunityEntry() await mutate({ mutation: createUser, variables: createUserVariables }) const emailContact = await UserContact.findOneOrFail({ where: { email: createUserVariables.email }, diff --git a/backend/src/graphql/resolver/util/communities.ts b/backend/src/graphql/resolver/util/communities.ts index 9a271066d..0c0023a19 100644 --- a/backend/src/graphql/resolver/util/communities.ts +++ b/backend/src/graphql/resolver/util/communities.ts @@ -63,23 +63,3 @@ export async function getCommunity(communityUuid: string): Promise { - let homeCom: DbCommunity - try { - return await getHomeCommunity() - } catch (err) { - homeCom = DbCommunity.create() - homeCom.foreign = false - homeCom.url = 'http://localhost/api' - homeCom.publicKey = Buffer.from('publicKey-HomeCommunity') - homeCom.privateKey = Buffer.from('privateKey-HomeCommunity') - homeCom.communityUuid = 'HomeCom-UUID' - homeCom.authenticatedAt = new Date() - homeCom.name = 'HomeCommunity-name' - homeCom.description = 'HomeCommunity-description' - homeCom.creationDate = new Date() - await DbCommunity.insert(homeCom) - return homeCom - } -} diff --git a/backend/src/seeds/community/index.ts b/backend/src/seeds/community/index.ts index 6a639ee44..e3b420d00 100644 --- a/backend/src/seeds/community/index.ts +++ b/backend/src/seeds/community/index.ts @@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid' import { CONFIG } from '@/config' -export async function writeHomeCommunityEntry(): Promise { +export async function writeHomeCommunityEntry(): Promise { try { // check for existing homeCommunity entry let homeCom = await DbCommunity.findOne({ where: { foreign: false } }) @@ -28,7 +28,30 @@ export async function writeHomeCommunityEntry(): Promise { homeCom.creationDate = new Date() await DbCommunity.insert(homeCom) } + return homeCom } catch (err) { throw new Error(`Seeding: Error writing HomeCommunity-Entry`) // : ${err}`) } } + +export async function createHomeCommunity(): Promise { + let homeCom: DbCommunity + try { + return await DbCommunity.findOneOrFail({ + where: [{ foreign: false }], + }) + } catch (err) { + homeCom = DbCommunity.create() + homeCom.foreign = false + homeCom.url = 'http://localhost/api' + homeCom.publicKey = Buffer.from('publicKey-HomeCommunity') + homeCom.privateKey = Buffer.from('privateKey-HomeCommunity') + homeCom.communityUuid = 'HomeCom-UUID' + homeCom.authenticatedAt = new Date() + homeCom.name = 'HomeCommunity-name' + homeCom.description = 'HomeCommunity-description' + homeCom.creationDate = new Date() + await DbCommunity.insert(homeCom) + return homeCom + } +} diff --git a/backend/src/seeds/factory/user.ts b/backend/src/seeds/factory/user.ts index 321e9db17..3ddddf336 100644 --- a/backend/src/seeds/factory/user.ts +++ b/backend/src/seeds/factory/user.ts @@ -5,8 +5,8 @@ import { ApolloServerTestClient } from 'apollo-server-testing' import { RoleNames } from '@enum/RoleNames' -import { createHomeCommunity, getHomeCommunity } from '@/graphql/resolver/util/communities' import { setUserRole } from '@/graphql/resolver/util/modifyUserRole' +import { writeHomeCommunityEntry } from '@/seeds/community' import { createUser, setPassword } from '@/seeds/graphql/mutations' import { UserInterface } from '@/seeds/users/UserInterface' @@ -16,7 +16,7 @@ export const userFactory = async ( ): Promise => { const { mutate } = client - await createHomeCommunity() + const homeCom = await writeHomeCommunityEntry() const { data: { @@ -47,7 +47,6 @@ export const userFactory = async ( await dbUser.save() } try { - const homeCom = await getHomeCommunity() if (homeCom.communityUuid) { dbUser.communityUuid = homeCom.communityUuid await User.save(dbUser) From 0cc6614cd830a5f03262e0a176e8074b5a4fe716 Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Tue, 7 Nov 2023 21:38:22 +0100 Subject: [PATCH 10/11] remove unused function --- backend/src/seeds/community/index.ts | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/backend/src/seeds/community/index.ts b/backend/src/seeds/community/index.ts index e3b420d00..84542e002 100644 --- a/backend/src/seeds/community/index.ts +++ b/backend/src/seeds/community/index.ts @@ -33,25 +33,3 @@ export async function writeHomeCommunityEntry(): Promise { throw new Error(`Seeding: Error writing HomeCommunity-Entry`) // : ${err}`) } } - -export async function createHomeCommunity(): Promise { - let homeCom: DbCommunity - try { - return await DbCommunity.findOneOrFail({ - where: [{ foreign: false }], - }) - } catch (err) { - homeCom = DbCommunity.create() - homeCom.foreign = false - homeCom.url = 'http://localhost/api' - homeCom.publicKey = Buffer.from('publicKey-HomeCommunity') - homeCom.privateKey = Buffer.from('privateKey-HomeCommunity') - homeCom.communityUuid = 'HomeCom-UUID' - homeCom.authenticatedAt = new Date() - homeCom.name = 'HomeCommunity-name' - homeCom.description = 'HomeCommunity-description' - homeCom.creationDate = new Date() - await DbCommunity.insert(homeCom) - return homeCom - } -} From 5ad90e6e4dc64e417590f93a7035e0227bef51bb Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Wed, 8 Nov 2023 23:33:14 +0100 Subject: [PATCH 11/11] release build 2.0.1 --- CHANGELOG.md | 11 ++++++++++- admin/package.json | 2 +- backend/package.json | 2 +- database/package.json | 2 +- dht-node/package.json | 2 +- dlt-connector/package.json | 2 +- federation/package.json | 2 +- frontend/package.json | 2 +- package.json | 2 +- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f07cc6645..73261fb3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [2.0.0](https://github.com/gradido/gradido/compare/1.23.3...2.0.0) +#### [2.0.1](https://github.com/gradido/gradido/compare/2.0.0...2.0.1) +- fix(backend): new local user without communitiyuuid [`#3232`](https://github.com/gradido/gradido/pull/3232) +- fix(frontend): fix to less moderator/admins on information page [`#3230`](https://github.com/gradido/gradido/pull/3230) + +### [2.0.0](https://github.com/gradido/gradido/compare/1.23.3...2.0.0) + +> 31 October 2023 + +- chore(release): v2.0.0 [`#3226`](https://github.com/gradido/gradido/pull/3226) +- feat(frontend): split admins and moderators on info page [`#3222`](https://github.com/gradido/gradido/pull/3222) - feat(federation): x-com-sendcoins 32: communtiy authentication handshake [`#3220`](https://github.com/gradido/gradido/pull/3220) - docs(frontend): update news on wallet start page [`#3221`](https://github.com/gradido/gradido/pull/3221) - feat(backend): x-com-sendcoins 31: insert recipient as foreign user in users table after x com sendcoins [`#3215`](https://github.com/gradido/gradido/pull/3215) diff --git a/admin/package.json b/admin/package.json index f44873ed8..ca26057a5 100644 --- a/admin/package.json +++ b/admin/package.json @@ -3,7 +3,7 @@ "description": "Administraion Interface for Gradido", "main": "index.js", "author": "Moriz Wahl", - "version": "2.0.0", + "version": "2.0.1", "license": "Apache-2.0", "private": false, "scripts": { diff --git a/backend/package.json b/backend/package.json index 1f4ea67af..b25a7dedb 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "gradido-backend", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido unified backend providing an API-Service for Gradido Transactions", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/backend", diff --git a/database/package.json b/database/package.json index efb310a5a..8916962be 100644 --- a/database/package.json +++ b/database/package.json @@ -1,6 +1,6 @@ { "name": "gradido-database", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido Database Tool to execute database migrations", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/database", diff --git a/dht-node/package.json b/dht-node/package.json index a43c38cf5..b693b746f 100644 --- a/dht-node/package.json +++ b/dht-node/package.json @@ -1,6 +1,6 @@ { "name": "gradido-dht-node", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido dht-node module", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/", diff --git a/dlt-connector/package.json b/dlt-connector/package.json index d6d698542..686d6f29b 100644 --- a/dlt-connector/package.json +++ b/dlt-connector/package.json @@ -1,6 +1,6 @@ { "name": "gradido-dlt-connector", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido DLT-Connector", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/", diff --git a/federation/package.json b/federation/package.json index 926453137..e5b8c3e4f 100644 --- a/federation/package.json +++ b/federation/package.json @@ -1,6 +1,6 @@ { "name": "gradido-federation", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido federation module providing Gradido-Hub-Federation and versioned API for inter community communication", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/federation", diff --git a/frontend/package.json b/frontend/package.json index b0473f15e..8060beb74 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue-gradido-wallet", - "version": "2.0.0", + "version": "2.0.1", "private": true, "scripts": { "start": "node run/server.js", diff --git a/package.json b/package.json index ff2475769..b99dcdb66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gradido", - "version": "2.0.0", + "version": "2.0.1", "description": "Gradido", "main": "index.js", "repository": "git@github.com:gradido/gradido.git",