Merge branch 'master' into eslint-dht-import

This commit is contained in:
Ulf Gebhardt 2023-07-06 13:23:15 +02:00 committed by GitHub
commit 35cb0397b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 276 additions and 862 deletions

View File

@ -4,8 +4,38 @@ 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).
#### [1.22.3](https://github.com/gradido/gradido/compare/1.22.2...1.22.3)
- fix(backend): corrected email-link [`#3129`](https://github.com/gradido/gradido/pull/3129)
#### [1.22.2](https://github.com/gradido/gradido/compare/1.22.1...1.22.2)
> 6 July 2023
- chore(release): v1.22.2 [`#3127`](https://github.com/gradido/gradido/pull/3127)
- fix(backend): moderation message are completely hidden from the user [`#3123`](https://github.com/gradido/gradido/pull/3123)
- fix(frontend): properly save username, do not allow to edit it again [`#3124`](https://github.com/gradido/gradido/pull/3124)
- fix(frontend): fix German "Speichern" to have capital letter [`#3122`](https://github.com/gradido/gradido/pull/3122)
#### [1.22.1](https://github.com/gradido/gradido/compare/1.22.0...1.22.1)
> 4 July 2023
- chore(release): v1.22.1 [`#3117`](https://github.com/gradido/gradido/pull/3117)
- fix(backend): use base url from config in email templates [`#3114`](https://github.com/gradido/gradido/pull/3114)
- feat(frontend): test right side layout template [`#3052`](https://github.com/gradido/gradido/pull/3052)
- feat(backend): remove iota from backend [`#3115`](https://github.com/gradido/gradido/pull/3115)
- refactor(frontend): text juni to juli [`#3116`](https://github.com/gradido/gradido/pull/3116)
- refactor(frontend): refactor changes incorporated [`#3113`](https://github.com/gradido/gradido/pull/3113)
- refactor(frontend): date from deploy changed to infotext [`#3108`](https://github.com/gradido/gradido/pull/3108)
- fix(frontend): add alias to the verifyLogin GraphQL answer. [`#3107`](https://github.com/gradido/gradido/pull/3107)
- fix(backend): moderator message don't send email to user [`#3106`](https://github.com/gradido/gradido/pull/3106)
#### [1.22.0](https://github.com/gradido/gradido/compare/1.21.0...1.22.0)
> 30 June 2023
- chore(release): v1.22.0 [`#3101`](https://github.com/gradido/gradido/pull/3101)
- fix(backend): yarn.lock after typeorm update [`#3097`](https://github.com/gradido/gradido/pull/3097)
- feat(frontend): new style for settings page [`#3040`](https://github.com/gradido/gradido/pull/3040)
- feat(admin): query users on contributions [`#3094`](https://github.com/gradido/gradido/pull/3094)

View File

@ -3,7 +3,7 @@
"description": "Administraion Interface for Gradido",
"main": "index.js",
"author": "Moriz Wahl",
"version": "1.22.0",
"version": "1.22.3",
"license": "Apache-2.0",
"private": false,
"scripts": {

View File

@ -21,11 +21,6 @@ KLICKTIPP_PASSWORD=secret321
KLICKTIPP_APIKEY_DE=SomeFakeKeyDE
KLICKTIPP_APIKEY_EN=SomeFakeKeyEN
# IOTA
IOTA=false
IOTA_API_URL=https://chrysalis-nodes.iota.org
IOTA_COMMUNITY_ALIAS=GRADIDO: TestHelloWelt1
# Community
COMMUNITY_NAME=Gradido Entwicklung
COMMUNITY_URL=http://localhost/

View File

@ -22,11 +22,6 @@ KLICKTIPP_PASSWORD=$KLICKTIPP_PASSWORD
KLICKTIPP_APIKEY_DE=$KLICKTIPP_APIKEY_DE
KLICKTIPP_APIKEY_EN=$KLICKTIPP_APIKEY_EN
# IOTA
IOTA=$IOTA
IOTA_API_URL=https://chrysalis-nodes.iota.org
IOTA_COMMUNITY_ALIAS=GRADIDO: TestHelloWelt1
# Community
COMMUNITY_NAME=$COMMUNITY_NAME
COMMUNITY_URL=$COMMUNITY_URL

View File

@ -33,8 +33,6 @@ LABEL maintainer="support@gradido.net"
# Install Additional Software
## install: git
#RUN apk --no-cache add git
# Install Build Tool for Rust for @iota/client
RUN apk add --no-cache rust cargo python3 make g++
# Settings
## Expose Container Port
@ -94,9 +92,6 @@ CMD /bin/sh -c "yarn run start"
##################################################################################
FROM base as production
# Remove Build Tool for Rust else they would bloat the image unneccessary
RUN apk del rust cargo python3 make g++
# Copy "binary"-files from build image
COPY --from=build ${DOCKER_WORKDIR}/build ./build
COPY --from=build ${DOCKER_WORKDIR}/../database/build ../database/build

View File

@ -1,6 +1,6 @@
{
"name": "gradido-backend",
"version": "1.22.0",
"version": "1.22.3",
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
"main": "src/index.ts",
"repository": "https://github.com/gradido/gradido/backend",
@ -19,7 +19,6 @@
"locales": "scripts/sort.sh"
},
"dependencies": {
"@iota/client": "^2",
"apollo-server-express": "^2.25.2",
"await-semaphore": "^0.1.3",
"axios": "^0.21.1",

View File

@ -1,43 +0,0 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { IotaClientSingleton } from '@/apis/IotaConnector'
import { CONFIG } from '@/config'
CONFIG.IOTA = true
CONFIG.IOTA_COMMUNITY_ALIAS = 'GRADIDO: TestHelloWelt1'
CONFIG.IOTA_API_URL = 'https://chrysalis-nodes.iota.org'
describe('apis/IotaConnector/enabled', () => {
describe('Hello World', () => {
const now = new Date()
let messageId: string
const messageString = 'Hello World - ' + now.toString()
const messageHexString = Buffer.from(messageString, 'utf8').toString('hex')
const indexHexString = Buffer.from(CONFIG.IOTA_COMMUNITY_ALIAS, 'utf8').toString('hex')
it('sends hello world message to iota tangle', async () => {
const iotaMessage = await IotaClientSingleton.getInstance()?.sendDataMessage(messageString)
expect(iotaMessage).toMatchObject({
message: {
payload: {
data: messageHexString,
index: indexHexString,
},
},
messageId: expect.any(String),
})
messageId =
iotaMessage?.messageId ?? '5498130bc3918e1a7143969ce05805502417e3e1bd596d3c44d6a0adeea22710'
})
it('receives hello world message from iota tangle by message id', async () => {
const iotaMessage = await IotaClientSingleton.getInstance()?.getMessage(messageId)
expect(iotaMessage).toMatchObject({
message: {
payload: {
data: messageHexString,
index: indexHexString,
},
},
messageId,
})
})
})
})

View File

@ -1,93 +0,0 @@
import { Client, ClientBuilder } from '@iota/client'
import { MessageWrapper } from '@iota/client/lib/types'
import { CONFIG } from '@/config'
import { backendLogger as logger } from '@/server/logger'
// Source: https://refactoring.guru/design-patterns/singleton/typescript/example
// and ../federation/client/FederationClientFactory.ts
/**
* A Singleton class defines the `getInstance` method that lets clients access
* the unique singleton instance.
*/
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class IotaClientSingleton {
// eslint-disable-next-line no-use-before-define
private static instance: IotaClientSingleton
private client: Client
/**
* The Singleton's constructor should always be private to prevent direct
* construction calls with the `new` operator.
*/
// eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
private constructor() {}
/**
* The static method that controls the access to the singleton instance.
*
* This implementation let you subclass the Singleton class while keeping
* just one instance of each subclass around.
*/
public static getInstance(): IotaClientSingleton | undefined {
if (!CONFIG.IOTA || !CONFIG.IOTA_API_URL) {
logger.info(`Iota are disabled via config...`)
return
}
if (!IotaClientSingleton.instance) {
IotaClientSingleton.instance = new IotaClientSingleton()
try {
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
} catch (e) {
logger.error("couldn't connect to iota")
return
}
}
return IotaClientSingleton.instance
}
/**
* send data message onto iota tangle
* use CONFIG.IOTA_COMMUNITY_ALIAS for index
* @param {string} message - the message as utf based string, will be converted to hex automatically from @iota/client
* @return {Promise<MessageWrapper>} the iota message typed
*/
public sendDataMessage(message: string): Promise<MessageWrapper> {
return this.client.message().index(CONFIG.IOTA_COMMUNITY_ALIAS).data(message).submit()
}
/**
* receive message for known message id from iota tangle
* @param {string} messageId - as hex string
* @return {Promise<MessageWrapper>} the iota message typed
*/
public getMessage(messageId: string): Promise<MessageWrapper> {
return this.client.getMessage().data(messageId)
}
}
export { IotaClientSingleton }
/**
* example for message:
```json
{
message: {
networkId: '1454675179895816119',
parentMessageIds: [
'5f30efecca59fdfef7c103e85ef691b2b1dc474e9eae9056888a6d58605083e7',
'77cef2fb405daedcd7469e009bb87a6d9a4840e618cdb599cd21a30a9fec88dc',
'7d2cfb39f40585ba568a29ad7e85c1478b2584496eb736d4001ac344f6a6cacf',
'c66da602874220dfa26925f6be540d37c0084d37cd04726fcc5be9d80b36f850'
],
payload: {
type: 2,
index: '4752414449444f3a205465737448656c6c6f57656c7431',
data: '48656c6c6f20576f726c64202d20546875204a756e20303820323032332031343a35393a343520474d542b3030303020284b6f6f7264696e69657274652057656c747a65697429'
},
nonce: '13835058055282465157'
},
messageId: '5498130bc3918e1a7143969ce05805502417e3e1bd596d3c44d6a0adeea22710'
}
```
*/

View File

@ -1,26 +0,0 @@
import { IotaClientSingleton } from '@/apis/IotaConnector'
import { CONFIG } from '@/config'
import { backendLogger as logger } from '@/server/logger'
describe('apis/IotaConnector/disabled', () => {
beforeEach(() => {
CONFIG.IOTA = false
})
it('getInstance return undefined if iota is disabled', () => {
const spyLog = jest.spyOn(logger, 'info')
expect(IotaClientSingleton.getInstance()).toBeUndefined()
expect(spyLog).toHaveBeenCalledWith('Iota are disabled via config...')
})
})
describe('apis/IotaConnector/invalidIotaUrl', () => {
beforeEach(() => {
CONFIG.IOTA = true
CONFIG.IOTA_API_URL = 'invalidUrl'
})
it('log "couldn\'t connect to iota"', () => {
const spyLog = jest.spyOn(logger, 'error')
expect(IotaClientSingleton.getInstance()).toBeUndefined()
expect(spyLog).toHaveBeenCalledWith("couldn't connect to iota")
})
})

View File

@ -19,7 +19,7 @@ const constants = {
LOG_LEVEL: process.env.LOG_LEVEL ?? 'info',
CONFIG_VERSION: {
DEFAULT: 'DEFAULT',
EXPECTED: 'v16.2023-06-08',
EXPECTED: 'v17.2023-07-03',
CURRENT: '',
},
}
@ -51,12 +51,6 @@ const klicktipp = {
KLICKTIPP_APIKEY_EN: process.env.KLICKTIPP_APIKEY_EN ?? 'SomeFakeKeyEN',
}
const iota = {
IOTA: process.env.IOTA === 'true' || false,
IOTA_API_URL: process.env.IOTA_API_URL ?? 'https://chrysalis-nodes.iota.org',
IOTA_COMMUNITY_ALIAS: process.env.IOTA_COMMUNITY_ALIAS ?? 'GRADIDO: TestHelloWelt1',
}
const community = {
COMMUNITY_NAME: process.env.COMMUNITY_NAME ?? 'Gradido Entwicklung',
COMMUNITY_URL: process.env.COMMUNITY_URL ?? 'http://localhost/',
@ -132,7 +126,6 @@ export const CONFIG = {
...server,
...database,
...klicktipp,
...iota,
...community,
...email,
...loginServer,

View File

@ -484,7 +484,7 @@ exports[`sendEmailVariants sendAddedContributionMessageEmail result has the corr
</div>
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Read and reply to message</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To view and reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/community/contribution\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To view and reply to the message, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"http://localhost/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">
@ -651,8 +651,8 @@ exports[`sendEmailVariants sendContributionConfirmedEmail result has the correct
</div>
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Contribution details</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">https://gdd.gradido.net/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"http://localhost/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"http://localhost/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">http://localhost/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">
@ -819,8 +819,8 @@ exports[`sendEmailVariants sendContributionDeletedEmail result has the correct h
</div>
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Contribution details</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">https://gdd.gradido.net/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"http://localhost/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"http://localhost/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">http://localhost/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">
@ -987,8 +987,8 @@ exports[`sendEmailVariants sendContributionDeniedEmail result has the correct ht
</div>
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Contribution details</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"https://gdd.gradido.net/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">https://gdd.gradido.net/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">To see your common good contributions and related messages, go to the “Creation” menu in your Gradido account and click on the “My contributions” tab.</div><a class=\\"button-3\\" href=\\"http://localhost/community/contributions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Or copy the link into your browser window.</div><a class=\\"clink\\" href=\\"http://localhost/community/contributions\\" style=\\"line-break: anywhere; margin-bottom: 40px;\\">http://localhost/community/contributions</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">
@ -1328,7 +1328,7 @@ exports[`sendEmailVariants sendTransactionLinkRedeemedEmail result has the corre
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Transaction details</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Amount: 17.65 GDD<br>Message: You deserve it! 🙏🏼<br>You can find transaction details in your Gradido account.
</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/transactions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
</div><a class=\\"button-3\\" href=\\"http://localhost/transactions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">
@ -1495,7 +1495,7 @@ exports[`sendEmailVariants sendTransactionReceivedEmail result has the correct h
</div>
<div class=\\"content\\" style=\\"display: block; width: 78%; margin: 40px 1% 40px 1%; padding: 20px 10% 40px 10%; border-radius: 24px; background-image: linear-gradient(180deg, #f5f5f5, #f5f5f5);\\">
<h2 style=\\"margin-top: 15px; color: #383838;\\">Transaction details</h2>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">You can find transaction details in your Gradido account.</div><a class=\\"button-3\\" href=\\"https://gdd.gradido.net/transactions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">You can find transaction details in your Gradido account.</div><a class=\\"button-3\\" href=\\"http://localhost/transactions\\" style=\\"display: inline-block; padding: 9px 15px; color: white; border: 0; line-height: inherit; text-decoration: none; cursor: pointer; border-radius: 20px; background-image: radial-gradient(circle farthest-corner at 0% 0%, #f9cd69, #c58d38); box-shadow: 16px 13px 35px 0 rgba(56, 56, 56, 0.3); margin: 25px 0 25px 0; width: 50%;\\">To account</a>
<div class=\\"p_content\\" style=\\"margin: 15px 0 15px 0; line-height: 26px; color: #9ca0a8;\\">Please do not reply to this email.</div>
</div>
<div class=\\"text-block\\" style=\\"margin-top: 20px; color: #9ca0a8;\\">

View File

@ -9,6 +9,6 @@ block content
h2= t('emails.addedContributionMessage.readMessage')
div(class="p_content")= t('emails.addedContributionMessage.toSeeAndAnswerMessage')
a.button-3(href="https://gdd.gradido.net/community/contribution") #{t('emails.general.toAccount')}
a.button-3(href=`${communityURL}community/contributions`) #{t('emails.general.toAccount')}
include ../includes/doNotReply.pug

View File

@ -1,7 +1,7 @@
//-
h2= t('emails.general.contributionDetails')
div(class="p_content")= t('emails.contribution.toSeeContributionsAndMessages')
a.button-3(href="https://gdd.gradido.net/community/contributions") #{t('emails.general.toAccount')}
a.button-3(href=`${communityURL}community/contributions`) #{t('emails.general.toAccount')}
div(class="p_content")= t('emails.general.orCopyLink')
a.clink(href="https://gdd.gradido.net/community/contributions") https://gdd.gradido.net/community/contributions
a.clink(href=`${communityURL}community/contributions`) #{`${communityURL}community/contributions`}

View File

@ -13,6 +13,6 @@ block content
br
= t('emails.general.detailsYouFindOnLinkToYourAccount')
a.button-3(href="https://gdd.gradido.net/transactions") #{t('emails.general.toAccount')}
a.button-3(href=`${communityURL}transactions`) #{t('emails.general.toAccount')}
include ../includes/doNotReply.pug

View File

@ -9,7 +9,7 @@ block content
h2= t('emails.general.transactionDetails')
div(class="p_content")= t('emails.general.detailsYouFindOnLinkToYourAccount')
a.button-3(href="https://gdd.gradido.net/transactions") #{t('emails.general.toAccount')}
a.button-3(href=`${communityURL}transactions`) #{t('emails.general.toAccount')}
include ../includes/doNotReply.pug

View File

@ -4,10 +4,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Connection } from '@dbTools/typeorm'
import { Contribution as DbContribution } from '@entity/Contribution'
import { Event as DbEvent } from '@entity/Event'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { GraphQLError } from 'graphql'
import { ContributionStatus } from '@enum/ContributionStatus'
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
import { logger, i18n as localization } from '@test/testSetup'
@ -168,6 +170,50 @@ describe('ContributionMessageResolver', () => {
})
})
describe('contribution message type MODERATOR', () => {
beforeAll(() => {
jest.clearAllMocks()
})
it('creates ContributionMessage', async () => {
await expect(
mutate({
mutation: adminCreateContributionMessage,
variables: {
contributionId: result.data.createContribution.id,
message: 'Internal moderator communication',
messageType: 'MODERATOR',
},
}),
).resolves.toEqual(
expect.objectContaining({
data: {
adminCreateContributionMessage: expect.objectContaining({
id: expect.any(Number),
message: 'Internal moderator communication',
type: 'MODERATOR',
userFirstName: 'Peter',
userLastName: 'Lustig',
}),
},
}),
)
})
it('does not call sendAddedContributionMessageEmail', () => {
expect(sendAddedContributionMessageEmail).not.toBeCalled()
})
it('does not change contribution status', async () => {
await expect(DbContribution.find()).resolves.toContainEqual(
expect.objectContaining({
id: result.data.createContribution.id,
contributionStatus: ContributionStatus.PENDING,
}),
)
})
})
describe('valid input', () => {
it('creates ContributionMessage', async () => {
await expect(
@ -205,6 +251,15 @@ describe('ContributionMessageResolver', () => {
})
})
it('changes contribution status', async () => {
await expect(DbContribution.find()).resolves.toContainEqual(
expect.objectContaining({
id: result.data.createContribution.id,
contributionStatus: ContributionStatus.IN_PROGRESS,
}),
)
})
it('stores the ADMIN_CONTRIBUTION_MESSAGE_CREATE event in the database', async () => {
await expect(DbEvent.find()).resolves.toContainEqual(
expect.objectContaining({
@ -217,33 +272,6 @@ describe('ContributionMessageResolver', () => {
)
})
})
describe('contribution message type MODERATOR', () => {
it('creates ContributionMessage', async () => {
await expect(
mutate({
mutation: adminCreateContributionMessage,
variables: {
contributionId: result.data.createContribution.id,
message: 'Internal moderator communication',
messageType: 'MODERATOR',
},
}),
).resolves.toEqual(
expect.objectContaining({
data: {
adminCreateContributionMessage: expect.objectContaining({
id: expect.any(Number),
message: 'Internal moderator communication',
type: 'MODERATOR',
userFirstName: 'Peter',
userLastName: 'Lustig',
}),
},
}),
)
})
})
})
})

View File

@ -158,24 +158,28 @@ export class ContributionMessageResolver {
contributionMessage.isModerator = true
await queryRunner.manager.insert(DbContributionMessage, contributionMessage)
if (
contribution.contributionStatus === ContributionStatus.DELETED ||
contribution.contributionStatus === ContributionStatus.DENIED ||
contribution.contributionStatus === ContributionStatus.PENDING
) {
contribution.contributionStatus = ContributionStatus.IN_PROGRESS
await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution)
}
if (messageType !== ContributionMessageType.MODERATOR) {
// change status (does not apply to moderator messages)
if (
contribution.contributionStatus === ContributionStatus.DELETED ||
contribution.contributionStatus === ContributionStatus.DENIED ||
contribution.contributionStatus === ContributionStatus.PENDING
) {
contribution.contributionStatus = ContributionStatus.IN_PROGRESS
await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution)
}
void sendAddedContributionMessageEmail({
firstName: contribution.user.firstName,
lastName: contribution.user.lastName,
email: contribution.user.emailContact.email,
language: contribution.user.language,
senderFirstName: moderator.firstName,
senderLastName: moderator.lastName,
contributionMemo: contribution.memo,
})
// send email (never for moderator messages)
void sendAddedContributionMessageEmail({
firstName: contribution.user.firstName,
lastName: contribution.user.lastName,
email: contribution.user.emailContact.email,
language: contribution.user.language,
senderFirstName: moderator.firstName,
senderLastName: moderator.lastName,
contributionMemo: contribution.memo,
})
}
await queryRunner.commitTransaction()
await EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE(
{ id: contribution.userId } as DbUser,

View File

@ -11,6 +11,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { GraphQLError } from 'graphql'
import { ContributionMessageType } from '@enum/ContributionMessageType'
import { ContributionStatus } from '@enum/ContributionStatus'
import { Order } from '@enum/Order'
import {
@ -153,6 +154,14 @@ describe('ContributionResolver', () => {
message: 'Test message to IN_PROGRESS contribution',
},
})
await mutate({
mutation: adminCreateContributionMessage,
variables: {
contributionId: pendingContribution.data.createContribution.id,
message: 'Test moderator message',
messageType: ContributionMessageType.MODERATOR,
},
})
await mutate({
mutation: logout,
})
@ -1043,31 +1052,37 @@ describe('ContributionResolver', () => {
amount: '100',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: pendingContribution.data.createContribution.id,
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 1,
}),
expect.objectContaining({
id: contributionToDeny.data.createContribution.id,
memo: 'Test contribution to deny',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: contributionToDelete.data.createContribution.id,
memo: 'Test contribution to delete',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: inProgressContribution.data.createContribution.id,
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 1,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
]),
})
@ -1099,24 +1114,28 @@ describe('ContributionResolver', () => {
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 1,
}),
expect.objectContaining({
id: contributionToDeny.data.createContribution.id,
status: 'DENIED',
memo: 'Test contribution to deny',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: contributionToDelete.data.createContribution.id,
status: 'DELETED',
memo: 'Test contribution to delete',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: inProgressContribution.data.createContribution.id,
status: 'IN_PROGRESS',
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 1,
}),
]),
})
@ -1230,42 +1249,49 @@ describe('ContributionResolver', () => {
status: 'CONFIRMED',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: pendingContribution.data.createContribution.id,
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 0,
}),
expect.objectContaining({
id: contributionToDeny.data.createContribution.id,
status: 'DENIED',
memo: 'Test contribution to deny',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: inProgressContribution.data.createContribution.id,
status: 'IN_PROGRESS',
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
status: 'CONFIRMED',
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'CONFIRMED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'DENIED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
]),
})
@ -1295,42 +1321,49 @@ describe('ContributionResolver', () => {
status: 'CONFIRMED',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: pendingContribution.data.createContribution.id,
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 0,
}),
expect.objectContaining({
id: contributionToDeny.data.createContribution.id,
status: 'DENIED',
memo: 'Test contribution to deny',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: inProgressContribution.data.createContribution.id,
status: 'IN_PROGRESS',
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
status: 'CONFIRMED',
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'CONFIRMED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'DENIED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
]),
})
@ -1360,42 +1393,49 @@ describe('ContributionResolver', () => {
status: 'CONFIRMED',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: pendingContribution.data.createContribution.id,
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 0,
}),
expect.objectContaining({
id: contributionToDeny.data.createContribution.id,
status: 'DENIED',
memo: 'Test contribution to deny',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: inProgressContribution.data.createContribution.id,
status: 'IN_PROGRESS',
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 0,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
status: 'CONFIRMED',
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'CONFIRMED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'DENIED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
]),
})
@ -1422,18 +1462,21 @@ describe('ContributionResolver', () => {
status: 'CONFIRMED',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
status: 'CONFIRMED',
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'CONFIRMED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.not.objectContaining({
status: 'PENDING',
@ -1484,6 +1527,7 @@ describe('ContributionResolver', () => {
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 0,
}),
]),
})
@ -1522,6 +1566,7 @@ describe('ContributionResolver', () => {
status: 'IN_PROGRESS',
memo: 'Test IN_PROGRESS contribution',
amount: '100',
messagesCount: 0,
}),
]),
})
@ -1554,6 +1599,7 @@ describe('ContributionResolver', () => {
status: 'DENIED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.not.objectContaining({
status: 'CONFIRMED',
@ -1611,24 +1657,28 @@ describe('ContributionResolver', () => {
status: 'CONFIRMED',
id: contributionToConfirm.data.createContribution.id,
memo: 'Test contribution to confirm',
messagesCount: 0,
}),
expect.objectContaining({
id: pendingContribution.data.createContribution.id,
status: 'PENDING',
memo: 'Test PENDING contribution update',
amount: '10',
messagesCount: 0,
}),
expect.objectContaining({
id: bibiCreatedContribution.id,
status: 'CONFIRMED',
memo: 'Herzlich Willkommen bei Gradido!',
amount: '1000',
messagesCount: 0,
}),
expect.objectContaining({
id: expect.any(Number),
status: 'CONFIRMED',
memo: 'Whatever contribution',
amount: '166',
messagesCount: 0,
}),
expect.not.objectContaining({
status: 'DENIED',
@ -2825,7 +2875,7 @@ describe('ContributionResolver', () => {
id: expect.any(Number),
lastName: 'Bloxberg',
memo: 'Test PENDING contribution update',
messagesCount: 1,
messagesCount: 2,
status: 'PENDING',
}),
expect.objectContaining({

View File

@ -142,9 +142,16 @@ export class ContributionResolver {
userId: user.id,
statusFilter,
})
return new ContributionListResult(
count,
dbContributions.map((contribution) => new Contribution(contribution, user)),
dbContributions.map((contribution) => {
// filter out moderator messages for this call
contribution.messages = contribution.messages?.filter(
(m) => m.type !== ContributionMessageType.MODERATOR,
)
return new Contribution(contribution, user)
}),
)
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "gradido-database",
"version": "1.22.0",
"version": "1.22.3",
"description": "Gradido Database Tool to execute database migrations",
"main": "src/index.ts",
"repository": "https://github.com/gradido/gradido/database",

View File

@ -27,7 +27,7 @@ COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community"
COMMUNITY_SUPPORT_MAIL=support@supportmail.com
# backend
BACKEND_CONFIG_VERSION=v16.2023-06-08
BACKEND_CONFIG_VERSION=v17.2023-07-03
JWT_EXPIRES_IN=10m
GDT_API_URL=https://gdt.gradido.net
@ -40,9 +40,6 @@ KLICKTIPP_PASSWORD=
KLICKTIPP_APIKEY_DE=
KLICKTIPP_APIKEY_EN=
# IOTA
IOTA=false
EMAIL=true
EMAIL_TEST_MODUS=false
EMAIL_TEST_RECEIVER=test_team@gradido.net

View File

@ -1,6 +1,6 @@
{
"name": "gradido-dht-node",
"version": "1.22.0",
"version": "1.22.3",
"description": "Gradido dht-node module",
"main": "src/index.ts",
"repository": "https://github.com/gradido/gradido/",

View File

@ -1,6 +1,6 @@
{
"name": "gradido-federation",
"version": "1.22.0",
"version": "1.22.3",
"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",

View File

@ -1,6 +1,6 @@
{
"name": "bootstrap-vue-gradido-wallet",
"version": "1.22.0",
"version": "1.22.3",
"private": true,
"scripts": {
"start": "node run/server.js",

View File

@ -1,35 +1,35 @@
[
{
"locale": "de",
"date": "13. juni 2023",
"date": "4. Juli 2023",
"text": "Neue Funktion verfügbar: Jetzt Benutzernamen eintragen!",
"url": "/settings",
"extra": "Deine persönlichen Daten sind uns wichtig, und wir legen großen Wert auf deren Schutz. Wir wissen, dass nicht jeder seine E-Mail-Adresse anderen Benutzern preisgeben möchte. Aus diesem Grund kannst du nun einen Benutzernamen deiner Wahl in den Einstellungen angeben. Dies ist auch ein wichtiger Bestandteil unserer Vorbereitung für die bevorstehende Einführung unserer dezentralen Community-Server."
},
{
"locale": "en",
"date": "13 june 2023",
"date": "4 July 2023",
"text": "New function available: Enter username now!",
"url": "/settings",
"extra": "Your personal information is important to us, and we take great care to protect it. We know that not everyone wants to reveal their email address to other users. For this reason, you can now enter a username of your choice in the settings. This is also an important part of our preparation for the upcoming launch of our decentralized community servers."
},
{
"locale": "fr",
"date": "13 juin 2023",
"date": "4 juillet 2023",
"text": "Nouvelle fonction disponible : Saisis ton nom d'utilisateur maintenant !",
"url": "/settings",
"extra": "Tes données personnelles sont importantes pour nous et nous attachons une grande importance à leur protection. Nous savons que certains ne souhaitent pas divulguer leur adresse e-mail à d'autres utilisateurs. C'est pourquoi tu peux désormais indiquer un nom d'utilisateur de ton choix dans les paramètres. Il s'agit également d'un élément important de notre préparation à l'introduction prochaine de nos serveurs communautaires décentralisés."
},
{
"locale": "es",
"date": "13 junio 20233",
"date": "4 julio 20233",
"text": "Nueva función disponible: Introduzca ahora su nombre de usuario",
"url": "/settings",
"extra": "Sus datos personales son importantes para nosotros y concedemos gran importancia a su protección. Sabemos que no todo el mundo quiere revelar su dirección de correo electrónico a otros usuarios. Por este motivo, ahora puede introducir un nombre de usuario de su elección en los ajustes. Esto es también una parte importante de nuestra preparación para el próximo lanzamiento de nuestros servidores comunitarios descentralizados."
},
{
"locale": "nl",
"date": "13 juni 2023",
"date": "4 juli 2023",
"text": "Nieuwe functie beschikbaar: Voer nu je gebruikersnaam in!",
"url": "/settings",
"extra": "Je persoonlijke gegevens zijn belangrijk voor ons en we hechten veel belang aan de bescherming ervan. We weten dat niet iedereen zijn e-mailadres bekend wil maken aan andere gebruikers. Daarom kun je nu een gebruikersnaam naar keuze invoeren in de instellingen. Dit is ook een belangrijk onderdeel van onze voorbereiding op de komende lancering van onze gedecentraliseerde community servers."

View File

@ -9,7 +9,7 @@
vid="username"
v-slot="{ errors, valid, validated, ariaInput, ariaMsg }"
>
<b-form-group :label="$t('form.username')">
<b-form-group :label="$t('form.username')" :description="$t('settings.usernameInfo')">
<b-input-group>
<b-form-input
v-model="currentValue"

View File

@ -105,7 +105,7 @@ describe('UserName Form', () => {
jest.clearAllMocks()
await wrapper.find('input').setValue('petra')
await wrapper.find('form').trigger('keyup')
await wrapper.find('[data-test="submit-username-button"]').trigger('click')
await wrapper.find('[data-test="submit-username-button"]').trigger('submit')
await flushPromises()
})
@ -136,7 +136,7 @@ describe('UserName Form', () => {
jest.clearAllMocks()
await wrapper.find('input').setValue('petra')
await wrapper.find('form').trigger('keyup')
await wrapper.find('[data-test="submit-username-button"]').trigger('click')
await wrapper.find('[data-test="submit-username-button"]').trigger('submit')
await flushPromises()
})

View File

@ -2,13 +2,17 @@
<div id="username_form">
<div v-if="$store.state.username">
<label>{{ $t('form.username') }}</label>
<b-input-group class="mb-3" data-test="username-input-group">
<b-form-group
class="mb-3"
data-test="username-input-group"
:description="$t('settings.emailInfo')"
>
<b-form-input
v-model="username"
readonly
data-test="username-input-readonly"
></b-form-input>
</b-input-group>
</b-form-group>
</div>
<div v-else>
<validation-observer ref="usernameObserver" v-slot="{ handleSubmit, invalid }">
@ -38,7 +42,6 @@
<div class="text-right" ref="submitButton">
<b-button
:variant="disabled(invalid) ? 'light' : 'success'"
@click="onSubmit"
type="submit"
:disabled="disabled(invalid)"
data-test="submit-username-button"
@ -79,7 +82,6 @@ export default {
},
methods: {
async onSubmit(event) {
event.preventDefault()
this.$apollo
.mutate({
mutation: updateUserInfos,

View File

@ -4,6 +4,7 @@ export const verifyLogin = gql`
query {
verifyLogin {
gradidoID
alias
firstName
lastName
language

View File

@ -0,0 +1,50 @@
import { mount } from '@vue/test-utils'
import RightSide from './RightSide'
const localVue = global.localVue
describe('RightSide', () => {
let wrapper
const mocks = {
$route: {
path: '/community/contribute',
},
}
const Wrapper = () => {
return mount(RightSide, { localVue, mocks })
}
describe('at /community/contribute', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has name set to "community"', () => {
expect(wrapper.vm.name).toBe('community')
})
})
describe('at /settings', () => {
beforeEach(() => {
mocks.$route.path = '/settings'
wrapper = Wrapper()
})
it('has name set to "empty"', () => {
expect(wrapper.vm.name).toBe('empty')
})
})
describe('at /overview', () => {
beforeEach(() => {
mocks.$route.path = '/overview'
wrapper = Wrapper()
})
it('has name set to "transactions"', () => {
expect(wrapper.vm.name).toBe('transactions')
})
})
})

View File

@ -337,7 +337,8 @@
"username": {
"change-success": "Dein Nutzername wurde erfolgreich geändert.",
"no-username": "Bitte gib einen Benutzernamen ein. Damit hilfst du anderen Benutzern dich zu finden, ohne deine E-Mail-Adresse preisgeben zu müssen."
}
},
"usernameInfo": "Kann nach dem Speichern nicht mehr geändert werden!"
},
"signin": "Anmelden",
"signup": "Registrieren",

View File

@ -292,7 +292,7 @@
"warningText": "Are you still there?"
},
"settings": {
"emailInfo": "NCannot be changed at this time.",
"emailInfo": "Cannot be changed at this time.",
"hideAmountGDD": "Your GDD amount is hidden.",
"hideAmountGDT": "Your GDT amount is hidden.",
"info": "Transactions can now be made by username or email address.",
@ -337,7 +337,8 @@
"username": {
"change-success": "Your username has been changed successfully.",
"no-username": "Please enter a username. This will help other users find you without having to reveal your email address."
}
},
"usernameInfo": "Cannot be changed after saving!"
},
"signin": "Sign in",
"signup": "Sign up",

View File

@ -1,7 +1,7 @@
<template>
<div class="card bg-white gradido-border-radius appBoxShadow p-4 mt--3">
<div class="h2">{{ $t('PersonalDetails') }}</div>
<div class="m-4 text-small">
<div class="my-4 text-small">
{{ $t('settings.info') }}
</div>
@ -58,7 +58,7 @@
</b-row>
<hr />
<div class="h3 mt-5">{{ $t('form.password') }}</div>
<div class="mt-5">{{ $t('form.password') }}</div>
<user-password />
<hr />
<b-row class="mb-5">

View File

@ -1,6 +1,6 @@
{
"name": "gradido",
"version": "1.22.0",
"version": "1.22.3",
"description": "Gradido",
"main": "index.js",
"repository": "git@github.com:gradido/gradido.git",