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 76174b52c..8324932a3 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/backend/src/config/index.ts b/backend/src/config/index.ts index 1fda26728..9c0347f97 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -12,7 +12,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0074-add_updated_by_contribution', + DB_VERSION: '0075-add_updated_by_contribution', 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/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap index f05291eab..da50bbcaf 100644 --- a/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap +++ b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap @@ -160,8 +160,7 @@ If the validity of the link has already expired, you can have a new link sent to
@@ -330,8 +329,7 @@ exports[`sendEmailVariants sendAccountMultiRegistrationEmail calls "sendEmailTra @@ -497,8 +495,7 @@ exports[`sendEmailVariants sendAddedContributionMessageEmail result has the corr @@ -665,8 +662,7 @@ exports[`sendEmailVariants sendContributionConfirmedEmail result has the correct @@ -833,8 +829,7 @@ exports[`sendEmailVariants sendContributionDeletedEmail result has the correct h @@ -1001,8 +996,7 @@ exports[`sendEmailVariants sendContributionDeniedEmail result has the correct ht @@ -1173,8 +1167,7 @@ If the validity of the link has already expired, you can have a new link sent to @@ -1341,8 +1334,7 @@ exports[`sendEmailVariants sendTransactionLinkRedeemedEmail result has the corre @@ -1508,8 +1500,7 @@ exports[`sendEmailVariants sendTransactionReceivedEmail result has the correct h diff --git a/backend/src/emails/templates/includes/footer.pug b/backend/src/emails/templates/includes/footer.pug index 3ae63e32e..5827b203b 100644 --- a/backend/src/emails/templates/includes/footer.pug +++ b/backend/src/emails/templates/includes/footer.pug @@ -40,16 +40,19 @@ footer .line .footer div(class="footer_p1")= t("emails.footer.contactOurSupport") - div(class="footer_p2")= t("emails.footer.supportEmail") + a( + class="footer_p2" + href='mailto:' + t("emails.footer.supportEmail") + )= t("emails.footer.supportEmail") img.image( alt="Gradido Logo" src="https://gdd.gradido.net/img/brand/green.png" ) div a( - class="terms_of_use" - href="https://gradido.net/de/impressum/" - target="_blank" + class="terms_of_use" + href="https://gradido.net/de/impressum/" + target="_blank" )= t("emails.footer.imprint") br a( diff --git a/backend/src/graphql/arg/Paginated.ts b/backend/src/graphql/arg/Paginated.ts index 6bb31a6b8..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, { defaultValue: 3 }) + @Field(() => Int, { nullable: true }) @IsPositive() - pageSize: number + pageSize?: number - @Field(() => Order, { defaultValue: Order.DESC }) + @Field(() => Order, { nullable: true }) @IsEnum(Order) - order: Order + order?: Order } diff --git a/backend/src/graphql/resolver/EmailOptinCodes.test.ts b/backend/src/graphql/resolver/EmailOptinCodes.test.ts index 640faad17..09ad743fe 100644 --- a/backend/src/graphql/resolver/EmailOptinCodes.test.ts +++ b/backend/src/graphql/resolver/EmailOptinCodes.test.ts @@ -8,6 +8,7 @@ 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' @@ -46,6 +47,7 @@ describe('EmailOptinCodes', () => { lastName: 'Lustig', language: 'de', } + 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 a9c50553e..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' @@ -125,9 +126,11 @@ describe('UserResolver', () => { let result: any let emailVerificationCode: string let user: User[] + let homeCom: DbCommunity beforeAll(async () => { jest.clearAllMocks() + homeCom = await writeHomeCommunityEntry() result = await mutate({ mutation: createUser, variables }) }) @@ -172,7 +175,7 @@ describe('UserResolver', () => { referrerId: null, contributionLinkId: null, passwordEncryptionType: PasswordEncryptionType.NO_PASSWORD, - communityUuid: null, + communityUuid: homeCom.communityUuid, foreign: false, }, ]) @@ -542,6 +545,7 @@ describe('UserResolver', () => { let newUser: User beforeAll(async () => { + await writeHomeCommunityEntry() await mutate({ mutation: createUser, variables: createUserVariables }) const emailContact = await UserContact.findOneOrFail({ where: { email: createUserVariables.email }, @@ -586,6 +590,7 @@ describe('UserResolver', () => { describe('no valid password', () => { beforeAll(async () => { + await writeHomeCommunityEntry() 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 b7c64eed9..4a7a1fa2f 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -272,6 +272,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/findContributions.ts b/backend/src/graphql/resolver/util/findContributions.ts index 48d66d883..d02043ff6 100644 --- a/backend/src/graphql/resolver/util/findContributions.ts +++ b/backend/src/graphql/resolver/util/findContributions.ts @@ -6,6 +6,7 @@ import { Paginated } from '@arg/Paginated' import { SearchContributionsFilterArgs } from '@arg/SearchContributionsFilterArgs' import { Connection } from '@typeorm/connection' +import { Order } from '@/graphql/enum/Order' import { LogError } from '@/server/LogError' interface Relations { @@ -28,7 +29,7 @@ function joinRelationsRecursive( } export const findContributions = async ( - paginate: Paginated, + { pageSize = 3, currentPage = 1, order = Order.DESC }: Paginated, filter: SearchContributionsFilterArgs, withDeleted = false, relations: Relations | undefined = undefined, @@ -61,9 +62,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() } diff --git a/backend/src/seeds/community/index.ts b/backend/src/seeds/community/index.ts index 6a639ee44..84542e002 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