diff --git a/backend/src/graphql/arg/CreateUserArgs.ts b/backend/src/graphql/arg/CreateUserArgs.ts index cb263b84a..c348b9b4c 100644 --- a/backend/src/graphql/arg/CreateUserArgs.ts +++ b/backend/src/graphql/arg/CreateUserArgs.ts @@ -2,6 +2,9 @@ import { ArgsType, Field, Int } from 'type-graphql' @ArgsType() export class CreateUserArgs { + @Field(() => String, { nullable: true }) + alias?: string | null + @Field(() => String) email: string diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 227684b7a..da58ea096 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -195,7 +195,15 @@ export class UserResolver { @Mutation(() => User) async createUser( @Args() - { email, firstName, lastName, language, publisherId = null, redeemCode = null }: CreateUserArgs, + { + alias = null, + email, + firstName, + lastName, + language, + publisherId = null, + redeemCode = null, + }: CreateUserArgs, ): Promise { logger.addContext('user', 'unknown') logger.info( @@ -231,6 +239,9 @@ export class UserResolver { user.lastName = lastName user.language = language user.publisherId = publisherId + if (alias && (await validateAlias(alias))) { + user.alias = alias + } logger.debug('partly faked user', user) void sendAccountMultiRegistrationEmail({ @@ -264,6 +275,9 @@ export class UserResolver { dbUser.firstName = firstName dbUser.lastName = lastName dbUser.language = language + if (alias && (await validateAlias(alias))) { + dbUser.alias = alias + } dbUser.publisherId = publisherId ?? 0 dbUser.passwordEncryptionType = PasswordEncryptionType.NO_PASSWORD logger.debug('new dbUser', dbUser) diff --git a/backend/src/seeds/graphql/mutations.ts b/backend/src/seeds/graphql/mutations.ts index 29d08b20a..d604b1f72 100644 --- a/backend/src/seeds/graphql/mutations.ts +++ b/backend/src/seeds/graphql/mutations.ts @@ -50,6 +50,7 @@ export const updateUserInfos = gql` export const createUser = gql` mutation ( + $alias: String $firstName: String! $lastName: String! $email: String! @@ -58,6 +59,7 @@ export const createUser = gql` $redeemCode: String ) { createUser( + alias: $alias email: $email firstName: $firstName lastName: $lastName diff --git a/backend/src/seeds/users/UserInterface.ts b/backend/src/seeds/users/UserInterface.ts index 08aa5d19d..181eb3f8e 100644 --- a/backend/src/seeds/users/UserInterface.ts +++ b/backend/src/seeds/users/UserInterface.ts @@ -1,4 +1,5 @@ export interface UserInterface { + alias?: string email?: string firstName?: string lastName?: string diff --git a/backend/src/seeds/users/bob-baumeister.ts b/backend/src/seeds/users/bob-baumeister.ts index ac88611b8..b7902f7bc 100644 --- a/backend/src/seeds/users/bob-baumeister.ts +++ b/backend/src/seeds/users/bob-baumeister.ts @@ -1,6 +1,7 @@ import { UserInterface } from './UserInterface' export const bobBaumeister: UserInterface = { + alias: 'MeisterBob', email: 'bob@baumeister.de', firstName: 'Bob', lastName: 'der Baumeister', diff --git a/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts b/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts index c939b8de2..84ffe46c6 100644 --- a/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts +++ b/e2e-tests/cypress/support/step_definitions/user_profile_change_password_steps.ts @@ -7,7 +7,7 @@ const profilePage = new ProfilePage() When('the user opens the change password menu', () => { cy.get(profilePage.openChangePassword).click() cy.get(profilePage.newPasswordRepeatInput).should('be.visible') - cy.get(profilePage.submitNewPasswordBtn).should('be.disabled') + cy.get(profilePage.submitNewPasswordBtn).should('have.class','btn-light') }) When('the user fills the password form with:', (table: DataTable) => { diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index da2182c54..80a0d2d22 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -56,6 +56,8 @@ module.exports = { 'settings.password.subtitle', 'math.asterisk', '/pageTitle./', + 'error.empty-transactionlist', + 'error.no-transactionlist', ], enableFix: false, }, diff --git a/frontend/src/App.vue b/frontend/src/App.vue index a35017836..46f7dacb8 100755 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,5 @@