Merge branch 'master' into 2785-add-events-for-subscribe-unsubscribe

This commit is contained in:
Hannes Heine 2023-05-04 11:28:42 +02:00 committed by GitHub
commit b4a497e158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
83 changed files with 1192 additions and 644 deletions

View File

@ -30,10 +30,13 @@
admin: &admin
- 'admin/**/*'
backend: &backend
- 'backend/**/*'
dht_node: &dht_node
- 'dht-node/**/*'
docker: &docker
docker-compose: &docker-compose
- 'docker-compose.*'
federation: &federation
@ -42,5 +45,8 @@ federation: &federation
frontend: &frontend
- 'frontend/**/*'
mariadb: &mariadb
- 'mariadb/**/*'
nginx: &nginx
- 'nginx/**/*'

View File

@ -1,195 +0,0 @@
name: gradido test CI
on: push
jobs:
##############################################################################
# JOB: DOCKER BUILD TEST BACKEND #############################################
##############################################################################
build_test_backend:
name: Docker Build Test - Backend
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# BACKEND ################################################################
##########################################################################
- name: Backend | Build `test` image
run: |
docker build -f ./backend/Dockerfile --target test -t "gradido/backend:test" .
docker save "gradido/backend:test" > /tmp/backend.tar
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: docker-backend-test
path: /tmp/backend.tar
##############################################################################
# JOB: DOCKER BUILD TEST DATABASE UP #########################################
##############################################################################
build_test_database_up:
name: Docker Build Test - Database up
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# DATABASE UP ############################################################
##########################################################################
- name: Database | Build `test_up` image
run: |
docker build --target test_up -t "gradido/database:test_up" database/
docker save "gradido/database:test_up" > /tmp/database_up.tar
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: docker-database-test_up
path: /tmp/database_up.tar
##############################################################################
# JOB: DOCKER BUILD TEST MARIADB #############################################
##############################################################################
build_test_mariadb:
name: Docker Build Test - MariaDB
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# BUILD MARIADB DOCKER IMAGE #############################################
##########################################################################
- name: mariadb | Build `test` image
run: |
docker build --target mariadb_server -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./
docker save "gradido/mariadb:test" > /tmp/mariadb.tar
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: docker-mariadb-test
path: /tmp/mariadb.tar
##############################################################################
# JOB: LINT BACKEND ##########################################################
##############################################################################
lint_backend:
name: Lint - Backend
runs-on: ubuntu-latest
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# LINT BACKEND ###########################################################
##########################################################################
- name: backend | Lint
run: cd database && yarn && cd ../backend && yarn && yarn run lint
##############################################################################
# JOB: LOCALES BACKEND #######################################################
##############################################################################
locales_backend:
name: Locales - Backend
runs-on: ubuntu-latest
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# LOCALES BACKEND #####################################################
##########################################################################
- name: Backend | Locales
run: cd backend && yarn && yarn locales
##############################################################################
# JOB: LINT DATABASE UP ######################################################
##############################################################################
lint_database_up:
name: Lint - Database Up
runs-on: ubuntu-latest
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# LINT DATABASE ##########################################################
##########################################################################
- name: Database | Lint
run: cd database && yarn && yarn run lint
##############################################################################
# JOB: UNIT TEST BACKEND ####################################################
##############################################################################
unit_test_backend:
name: Unit tests - Backend
runs-on: ubuntu-latest
needs: [build_test_mariadb]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Mariadb)
uses: actions/download-artifact@v3
with:
name: docker-mariadb-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/mariadb.tar
##########################################################################
# UNIT TESTS BACKEND #####################################################
##########################################################################
- name: backend | docker-compose mariadb
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash
- name: backend | docker-compose database
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database
- name: backend Unit tests | test
run: cd database && yarn && yarn build && cd ../backend && yarn && yarn test
##########################################################################
# DATABASE MIGRATION TEST UP + RESET #####################################
##########################################################################
database_migration_test:
name: Database Migration Test - Up + Reset
runs-on: ubuntu-latest
#needs: [nothing]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v3
##########################################################################
# DOCKER COMPOSE DATABASE UP + RESET #####################################
##########################################################################
- name: database | docker-compose
run: docker-compose -f docker-compose.yml up --detach mariadb
- name: database | up
run: docker-compose -f docker-compose.yml run -T database yarn up
- name: database | reset
run: docker-compose -f docker-compose.yml run -T database yarn reset

81
.github/workflows/test_backend.yml vendored Normal file
View File

@ -0,0 +1,81 @@
name: Gradido Backend Test CI
on: push
jobs:
files-changed:
name: Detect File Changes - Backend
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.changes.outputs.backend }}
database: ${{ steps.changes.outputs.database }}
docker-compose: ${{ steps.changes.outputs.docker-compose }}
mariadb: ${{ steps.changes.outputs.mariadb }}
steps:
- uses: actions/checkout@v3.3.0
- name: Check for frontend file changes
uses: dorny/paths-filter@v2.11.1
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
list-files: shell
build_test:
if: needs.files-changed.outputs.backend == 'true'
name: Docker Build Test - Backend
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Backend | Build 'test' image
run: docker build -f ./backend/Dockerfile --target test -t "gradido/backend:test" .
unit_test:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.mariadb == 'true'
name: Unit tests - Backend
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Backend | docker-compose mariadb
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash
- name: Backend | docker-compose database
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database
- name: Backend | Unit tests
run: cd database && yarn && yarn build && cd ../backend && yarn && yarn test
lint:
if: needs.files-changed.outputs.backend == 'true'
name: Lint - Backend
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Backend | Lint
run: cd database && yarn && cd ../backend && yarn && yarn run lint
locales:
if: needs.files-changed.outputs.backend == 'true'
name: Locales - Backend
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Backend | Locales
run: cd backend && yarn && yarn locales

64
.github/workflows/test_database.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: Gradido Database Test CI
on: push
jobs:
files-changed:
name: Detect File Changes - Database
runs-on: ubuntu-latest
outputs:
database: ${{ steps.changes.outputs.database }}
docker-compose: ${{ steps.changes.outputs.docker-compose }}
mariadb: ${{ steps.changes.outputs.mariadb }}
steps:
- uses: actions/checkout@v3.3.0
- name: Check for frontend file changes
uses: dorny/paths-filter@v2.11.1
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
list-files: shell
build:
if: needs.files-changed.outputs.database == 'true'
name: Docker Build Test - Database up
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Database | Build 'test_up' image
run: docker build --target test_up -t "gradido/database:test_up" database/
database_migration_test:
if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.mariadb == 'true'
name: Database Migration Test - Up + Reset
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Database | docker-compose
run: docker-compose -f docker-compose.yml up --detach mariadb
- name: Database | up
run: docker-compose -f docker-compose.yml run -T database yarn up
- name: Database | reset
run: docker-compose -f docker-compose.yml run -T database yarn reset
lint:
if: needs.files-changed.outputs.database == 'true'
name: Lint - Database Up
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Database | Lint
run: cd database && yarn && yarn run lint

View File

@ -3,14 +3,13 @@ name: Gradido DHT Node Test CI
on: push
jobs:
# only (but most important) job from this workflow required for pull requests
# check results serve as run conditions for all other jobs here
files-changed:
name: Detect File Changes - DHT Node
runs-on: ubuntu-latest
outputs:
database: ${{ steps.changes.outputs.database }}
dht_node: ${{ steps.changes.outputs.dht_node }}
docker: ${{ steps.changes.outputs.docker }}
docker-compose: ${{ steps.changes.outputs.docker-compose }}
steps:
- uses: actions/checkout@v3.3.0
@ -22,12 +21,9 @@ jobs:
filters: .github/file-filters.yml
list-files: shell
##############################################################################
# JOB: DOCKER BUILD TEST #####################################################
##############################################################################
build:
name: Docker Build Test - DHT Node
if: needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker == 'true'
if: needs.files-changed.outputs.dht_node == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
@ -45,9 +41,6 @@ jobs:
name: docker-dht-node-test
path: /tmp/dht-node.tar
##############################################################################
# JOB: LINT ##################################################################
##############################################################################
lint:
name: Lint - DHT Node
if: needs.files-changed.outputs.dht_node == 'true'
@ -60,12 +53,9 @@ jobs:
- name: Lint
run: cd dht-node && yarn && yarn run lint
##############################################################################
# JOB: UNIT TEST #############################################################
##############################################################################
unit_test:
name: Unit Tests - DHT Node
if: needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker == 'true'
if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.mariadb == 'true'
needs: [files-changed, build]
runs-on: ubuntu-latest
steps:

View File

@ -3,13 +3,11 @@ name: Gradido Federation Test CI
on: push
jobs:
# only (but most important) job from this workflow required for pull requests
# check results serve as run conditions for all other jobs here
files-changed:
name: Detect File Changes - Federation
runs-on: ubuntu-latest
outputs:
docker: ${{ steps.changes.outputs.docker }}
docker-compose: ${{ steps.changes.outputs.docker-compose }}
federation: ${{ steps.changes.outputs.federation }}
steps:
- uses: actions/checkout@v3.3.0
@ -22,12 +20,9 @@ jobs:
filters: .github/file-filters.yml
list-files: shell
##############################################################################
# JOB: DOCKER BUILD TEST #####################################################
##############################################################################
build:
name: Docker Build Test - Federation
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.federation == 'true'
if: needs.files-changed.outputs.federation == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
@ -45,9 +40,6 @@ jobs:
name: docker-federation-test
path: /tmp/federation.tar
##############################################################################
# JOB: LINT ##################################################################
##############################################################################
lint:
name: Lint - Federation
if: needs.files-changed.outputs.federation == 'true'
@ -60,12 +52,9 @@ jobs:
- name: Lint
run: cd federation && yarn && yarn run lint
##############################################################################
# JOB: UNIT TEST #############################################################
##############################################################################
unit_test:
name: Unit Tests - Federation
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.federation == 'true'
if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.federation == 'true' || needs.files-changed.outputs.mariadb == 'true'
needs: [files-changed, build]
runs-on: ubuntu-latest
steps:

32
.github/workflows/test_mariadb.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Gradido MariaDB Test CI
on: push
jobs:
files-changed:
name: Detect File Changes - MariaDB
runs-on: ubuntu-latest
outputs:
mariadb: ${{ steps.changes.outputs.mariadb }}
steps:
- uses: actions/checkout@v3.3.0
- name: Check for frontend file changes
uses: dorny/paths-filter@v2.11.1
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
list-files: shell
build_test:
if: needs.files-changed.outputs.mariadb == 'true'
name: Docker Build Test - MariaDB
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: MariaDB | Build 'test' image
run: docker build --target mariadb_server -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./

View File

@ -4,8 +4,72 @@ 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.20.0](https://github.com/gradido/gradido/compare/1.19.1...1.20.0)
- fix(backend): no await for emails [`#2918`](https://github.com/gradido/gradido/pull/2918)
- fix(frontend): no receiver on send by link [`#2933`](https://github.com/gradido/gradido/pull/2933)
- fix(admin): pagination set currentPage by switch tabs [`#2902`](https://github.com/gradido/gradido/pull/2902)
- fix(federation): correct export of the community url [`#2931`](https://github.com/gradido/gradido/pull/2931)
- fix(frontend): displayed decay duration [`#2927`](https://github.com/gradido/gradido/pull/2927)
- fix(frontend): community tab navigation [`#2928`](https://github.com/gradido/gradido/pull/2928)
- fix(frontend): moderator id missing [`#2925`](https://github.com/gradido/gradido/pull/2925)
- fix(frontend): reset button send coins [`#2924`](https://github.com/gradido/gradido/pull/2924)
- refactor(backend): eslint plugin import export style [`#2908`](https://github.com/gradido/gradido/pull/2908)
- fix(backend): vscode intellisense fixes [`#2919`](https://github.com/gradido/gradido/pull/2919)
- refactor(backend): eslint import-no-cycle enabled [`#2905`](https://github.com/gradido/gradido/pull/2905)
- docs(backend): alias rules and conventions [`#2881`](https://github.com/gradido/gradido/pull/2881)
- refactor(backend): get transaction list [`#2923`](https://github.com/gradido/gradido/pull/2923)
- feat(backend): previous balance in transaction [`#2914`](https://github.com/gradido/gradido/pull/2914)
- refactor(backend): eslint update packages [`#2829`](https://github.com/gradido/gradido/pull/2829)
- feat(frontend): send coins via gradido ID [`#2837`](https://github.com/gradido/gradido/pull/2837)
- refactor(database): cleanup database [`#2808`](https://github.com/gradido/gradido/pull/2808)
- refactor(backend): eslint plugin n + fixes [`#2828`](https://github.com/gradido/gradido/pull/2828)
- feat(frontend): add link to download QR-Code [`#2889`](https://github.com/gradido/gradido/pull/2889)
- fix(other): delete node_modules and /tmp/yarn--* on start.sh [`#2904`](https://github.com/gradido/gradido/pull/2904)
- fix(admin): add confirmation modal for user role change and user (un)deletion [`#2880`](https://github.com/gradido/gradido/pull/2880)
- fix(admin): admin open contribution edit button [`#2811`](https://github.com/gradido/gradido/pull/2811)
- fix(backend): import order [`#2911`](https://github.com/gradido/gradido/pull/2911)
- fix(other): use default values for undefined .env database values [`#2910`](https://github.com/gradido/gradido/pull/2910)
- refactor(backend): eslint plugin import + fixes [`#2827`](https://github.com/gradido/gradido/pull/2827)
- refactor(backend): missing event tests [`#2900`](https://github.com/gradido/gradido/pull/2900)
- refactor(backend): unify event names [`#2799`](https://github.com/gradido/gradido/pull/2799)
- feat(backend): events for users [`#2797`](https://github.com/gradido/gradido/pull/2797)
- fix(backend): subscription get's email and languages from user [`#2885`](https://github.com/gradido/gradido/pull/2885)
- refactor(backend): eslint-plugin-jest + fixes [`#2816`](https://github.com/gradido/gradido/pull/2816)
- fix(frontend): fr change ` and ´ to ' [`#2888`](https://github.com/gradido/gradido/pull/2888)
- feat(backend): events for transaction links [`#2792`](https://github.com/gradido/gradido/pull/2792)
- feat(backend): events for contributions [`#2784`](https://github.com/gradido/gradido/pull/2784)
- feat(backend): events for contribution messages [`#2783`](https://github.com/gradido/gradido/pull/2783)
- refactor(backend): upgrade coverage to 85% [`#2884`](https://github.com/gradido/gradido/pull/2884)
- refactor(backend): add klicktipp-api library [`#2883`](https://github.com/gradido/gradido/pull/2883)
- feat(backend): events for contribution links [`#2780`](https://github.com/gradido/gradido/pull/2780)
- refactor(backend): separate events in own files [`#2777`](https://github.com/gradido/gradido/pull/2777)
- refactor(backend): rename `evenProtocolType` to `eventType` [`#2776`](https://github.com/gradido/gradido/pull/2776)
- refactor(other): add yarn installAll on gradido folder [`#2703`](https://github.com/gradido/gradido/pull/2703)
- docs(federation): describe the technical federation architecture [`#2716`](https://github.com/gradido/gradido/pull/2716)
- refactor(admin): admin list contributions for creation transaction list query [`#2791`](https://github.com/gradido/gradido/pull/2791)
- refactor(workflow): separate workflow with file filter for nginx testing [`#2871`](https://github.com/gradido/gradido/pull/2871)
- feat(backend): read communities data from database [`#2807`](https://github.com/gradido/gradido/pull/2807)
- feat(federation): implement a graphql endpoint to answer getpublickey-request [`#2651`](https://github.com/gradido/gradido/pull/2651)
- refactor(workflow): add file filters to dht node and federation workflows [`#2838`](https://github.com/gradido/gradido/pull/2838)
- refactor(workflow): separate test workflow for end-to-end tests [`#2836`](https://github.com/gradido/gradido/pull/2836)
- refactor(workflow): separate test workflow for frontend [`#2835`](https://github.com/gradido/gradido/pull/2835)
- feat(federation): add federation modul to deployment scripts [`#2733`](https://github.com/gradido/gradido/pull/2733)
- refactor(database): event table [`#2720`](https://github.com/gradido/gradido/pull/2720)
- refactor(workflow): separate test workflow with file change filters for admin interface [`#2734`](https://github.com/gradido/gradido/pull/2734)
- fix(admin): fix translation in menu (english) [`#2814`](https://github.com/gradido/gradido/pull/2814)
- refactor(workflow): configure jest to directly check coverage to schlanken the test workflows [`#2790`](https://github.com/gradido/gradido/pull/2790)
- fix(database): removed commands from package.json not working [`#2805`](https://github.com/gradido/gradido/pull/2805)
- fix(other): repair UserProfile.ChangePassword.feature scenario [`#2782`](https://github.com/gradido/gradido/pull/2782)
- feat(backend): test double redeem transaction links [`#2788`](https://github.com/gradido/gradido/pull/2788)
- feat(backend): admin open creations query [`#2813`](https://github.com/gradido/gradido/pull/2813)
- refactor(backend): eslint-plugin-type-graphql + fixes [`#2745`](https://github.com/gradido/gradido/pull/2745)
#### [1.19.1](https://github.com/gradido/gradido/compare/1.19.0...1.19.1)
> 10 March 2023
- chore(other): upgrade version to 1.19.1 [`#2812`](https://github.com/gradido/gradido/pull/2812)
- fix(frontend): admin question clickable [`#2810`](https://github.com/gradido/gradido/pull/2810)
- refactor(frontend): change b-img to b-icon send [`#2809`](https://github.com/gradido/gradido/pull/2809)
- fix(admin): update openCreation in case of tab open. [`#2806`](https://github.com/gradido/gradido/pull/2806)

View File

@ -3,7 +3,7 @@
"description": "Administraion Interface for Gradido",
"main": "index.js",
"author": "Moriz Wahl",
"version": "1.19.1",
"version": "1.20.0",
"license": "Apache-2.0",
"private": false,
"scripts": {
@ -33,6 +33,7 @@
"bootstrap": "4.3.1",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.6.5",
"date-fns": "^2.29.3",
"dotenv-webpack": "^7.0.3",
"express": "^4.17.1",
"graphql": "^15.6.1",

View File

@ -0,0 +1,183 @@
import { mount } from '@vue/test-utils'
import FederationVisualizeItem from './FederationVisualizeItem.vue'
const localVue = global.localVue
const today = new Date()
const createdDate = new Date()
createdDate.setDate(createdDate.getDate() - 3)
let propsData = {
item: {
id: 7590,
foreign: false,
publicKey: 'eaf6a426b24fd54f8fbae11c17700fc595080ca25159579c63d38dbc64284ba7',
url: 'http://localhost/api/2_0',
lastAnnouncedAt: createdDate,
verifiedAt: today,
lastErrorAt: null,
createdAt: createdDate,
updatedAt: null,
},
}
const mocks = {
$i18n: {
locale: 'en',
},
}
describe('FederationVisualizeItem', () => {
let wrapper
const Wrapper = () => {
return mount(FederationVisualizeItem, { localVue, mocks, propsData })
}
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('renders the component', () => {
expect(wrapper.find('div.federation-visualize-item').exists()).toBe(true)
})
describe('rendering item properties', () => {
it('has the url', () => {
expect(wrapper.find('.row > div:nth-child(2) > div').text()).toBe(
'http://localhost/api/2_0',
)
})
it('has the public key', () => {
expect(wrapper.find('.row > div:nth-child(2) > small').text()).toContain(
'eaf6a426b24fd54f8fbae11c17700fc595080ca25159579c63d38dbc64284ba7'.substring(0, 26),
)
})
describe('verified item', () => {
it('has the check icon', () => {
expect(wrapper.find('svg.bi-check').exists()).toBe(true)
})
it('has the text variant "success"', () => {
expect(wrapper.find('.text-success').exists()).toBe(true)
})
})
describe('not verified item', () => {
beforeEach(() => {
propsData = {
item: {
id: 7590,
foreign: false,
publicKey: 'eaf6a426b24fd54f8fbae11c17700fc595080ca25159579c63d38dbc64284ba7',
url: 'http://localhost/api/2_0',
lastAnnouncedAt: createdDate,
verifiedAt: null,
lastErrorAt: null,
createdAt: createdDate,
updatedAt: null,
},
}
wrapper = Wrapper()
})
it('has the x-circle icon', () => {
expect(wrapper.find('svg.bi-x-circle').exists()).toBe(true)
})
it('has the text variant "danger"', () => {
expect(wrapper.find('.text-danger').exists()).toBe(true)
})
})
// describe('with different locales (de, en, fr, es, nl)', () => {
describe('lastAnnouncedAt', () => {
it('computes the time string for different locales (de, en, fr, es, nl)', () => {
wrapper.vm.$i18n.locale = 'de'
wrapper = Wrapper()
expect(wrapper.vm.lastAnnouncedAt).toBe('vor 3 Tagen')
wrapper.vm.$i18n.locale = 'fr'
wrapper = Wrapper()
expect(wrapper.vm.lastAnnouncedAt).toBe('il y a 3 jours')
wrapper.vm.$i18n.locale = 'es'
wrapper = Wrapper()
expect(wrapper.vm.lastAnnouncedAt).toBe('hace 3 días')
wrapper.vm.$i18n.locale = 'nl'
wrapper = Wrapper()
expect(wrapper.vm.lastAnnouncedAt).toBe('3 dagen geleden')
})
describe('lastAnnouncedAt == null', () => {
beforeEach(() => {
propsData = {
item: {
id: 7590,
foreign: false,
publicKey: 'eaf6a426b24fd54f8fbae11c17700fc595080ca25159579c63d38dbc64284ba7',
url: 'http://localhost/api/2_0',
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: createdDate,
updatedAt: null,
},
}
wrapper = Wrapper()
})
it('computes empty string', async () => {
expect(wrapper.vm.lastAnnouncedAt).toBe('')
})
})
})
describe('createdAt', () => {
it('computes the time string for different locales (de, en, fr, es, nl)', () => {
wrapper.vm.$i18n.locale = 'de'
wrapper = Wrapper()
expect(wrapper.vm.createdAt).toBe('vor 3 Tagen')
wrapper.vm.$i18n.locale = 'fr'
wrapper = Wrapper()
expect(wrapper.vm.createdAt).toBe('il y a 3 jours')
wrapper.vm.$i18n.locale = 'es'
wrapper = Wrapper()
expect(wrapper.vm.createdAt).toBe('hace 3 días')
wrapper.vm.$i18n.locale = 'nl'
wrapper = Wrapper()
expect(wrapper.vm.createdAt).toBe('3 dagen geleden')
})
describe('createdAt == null', () => {
beforeEach(() => {
propsData = {
item: {
id: 7590,
foreign: false,
publicKey: 'eaf6a426b24fd54f8fbae11c17700fc595080ca25159579c63d38dbc64284ba7',
url: 'http://localhost/api/2_0',
lastAnnouncedAt: createdDate,
verifiedAt: null,
lastErrorAt: null,
createdAt: null,
updatedAt: null,
},
}
wrapper = Wrapper()
})
it('computes empty string', async () => {
expect(wrapper.vm.createdAt).toBe('')
})
})
})
})
})
})

View File

@ -0,0 +1,63 @@
<template>
<div class="federation-visualize-item">
<b-row>
<b-col cols="1"><b-icon :icon="icon" :variant="variant" class="mr-4"></b-icon></b-col>
<b-col>
<div>{{ item.url }}</div>
<small>{{ `${item.publicKey.substring(0, 26)}` }}</small>
</b-col>
<b-col cols="2">{{ lastAnnouncedAt }}</b-col>
<b-col cols="2">{{ createdAt }}</b-col>
</b-row>
</div>
</template>
<script>
import { formatDistanceToNow } from 'date-fns'
import { de, en, fr, es, nl } from 'date-fns/locale'
const locales = { en, de, es, fr, nl }
export default {
name: 'FederationVisualizeItem',
props: {
item: { type: Object },
},
data() {
return {
formatDistanceToNow,
locale: this.$i18n.locale,
}
},
computed: {
verified() {
return new Date(this.item.verifiedAt) >= new Date(this.item.lastAnnouncedAt)
},
icon() {
return this.verified ? 'check' : 'x-circle'
},
variant() {
return this.verified ? 'success' : 'danger'
},
lastAnnouncedAt() {
if (this.item.lastAnnouncedAt) {
return formatDistanceToNow(new Date(this.item.lastAnnouncedAt), {
includeSecond: true,
addSuffix: true,
locale: locales[this.locale],
})
}
return ''
},
createdAt() {
if (this.item.createdAt) {
return formatDistanceToNow(new Date(this.item.createdAt), {
includeSecond: true,
addSuffix: true,
locale: locales[this.locale],
})
}
return ''
},
},
}
</script>

View File

@ -62,8 +62,12 @@ describe('NavBar', () => {
)
})
it('has a link to /federation', () => {
expect(wrapper.findAll('.nav-item').at(3).find('a').attributes('href')).toBe('/federation')
})
it('has a link to /statistic', () => {
expect(wrapper.findAll('.nav-item').at(3).find('a').attributes('href')).toBe('/statistic')
expect(wrapper.findAll('.nav-item').at(4).find('a').attributes('href')).toBe('/statistic')
})
})
@ -72,7 +76,7 @@ describe('NavBar', () => {
beforeEach(async () => {
delete window.location
window.location = ''
await wrapper.findAll('.nav-item').at(4).find('a').trigger('click')
await wrapper.findAll('.nav-item').at(5).find('a').trigger('click')
})
afterEach(() => {
@ -97,7 +101,7 @@ describe('NavBar', () => {
window.location = {
assign: windowLocationMock,
}
await wrapper.findAll('.nav-item').at(5).find('a').trigger('click')
await wrapper.findAll('.nav-item').at(6).find('a').trigger('click')
})
afterEach(() => {

View File

@ -1,6 +1,6 @@
<template>
<div class="component-nabvar">
<b-navbar toggleable="md" type="dark" variant="success">
<b-navbar toggleable="lg" type="dark" class="bg-dark">
<b-navbar-brand class="mb-2" to="/">
<img src="img/brand/gradido_logo_w.png" class="navbar-brand-img pl-2" alt="..." />
</b-navbar-brand>
@ -19,6 +19,9 @@
<b-nav-item to="/contribution-links">
{{ $t('navbar.automaticContributions') }}
</b-nav-item>
<b-nav-item to="/federation">
{{ $t('navbar.instances') }}
</b-nav-item>
<b-nav-item to="/statistic">{{ $t('navbar.statistic') }}</b-nav-item>
<b-nav-item @click="wallet">{{ $t('navbar.my-account') }}</b-nav-item>
<b-nav-item @click="logout">{{ $t('navbar.logout') }}</b-nav-item>

View File

@ -0,0 +1,17 @@
import gql from 'graphql-tag'
export const getCommunities = gql`
query {
getCommunities {
id
foreign
publicKey
url
lastAnnouncedAt
verifiedAt
lastErrorAt
createdAt
updatedAt
}
}
`

View File

@ -68,6 +68,13 @@
"error": "Fehler",
"expired": "abgelaufen",
"e_mail": "E-Mail",
"federation": {
"createdAt": "Erstellt am",
"gradidoInstances": "Gradido Instanzen",
"lastAnnouncedAt": "letzte Bekanntgabe",
"url": "Url",
"verified": "Verifiziert"
},
"firstname": "Vorname",
"footer": {
"app_version": "App version {version}",
@ -105,6 +112,7 @@
"name": "Name",
"navbar": {
"automaticContributions": "Automatische Beiträge",
"instances": "Instanzen",
"logout": "Abmelden",
"my-account": "Mein Konto",
"statistic": "Statistik",

View File

@ -68,6 +68,13 @@
"error": "Error",
"expired": "expired",
"e_mail": "E-mail",
"federation": {
"createdAt": "Created At ",
"gradidoInstances": "Gradido Instances",
"lastAnnouncedAt": "Last Announced",
"url": "Url",
"verified": "Verified"
},
"firstname": "Firstname",
"footer": {
"app_version": "App version {version}",
@ -105,6 +112,7 @@
"name": "Name",
"navbar": {
"automaticContributions": "Automatic Contributions",
"instances": "Instances",
"logout": "Logout",
"my-account": "My Account",
"statistic": "Statistic",

View File

@ -39,7 +39,7 @@ const mocks = {
const defaultData = () => {
return {
adminListContributions: {
contributionCount: 2,
contributionCount: 30,
contributionList: [
{
id: 1,
@ -407,6 +407,44 @@ describe('CreationConfirm', () => {
statusFilter: ['IN_PROGRESS', 'PENDING', 'CONFIRMED', 'DENIED', 'DELETED'],
})
})
describe('change pagination', () => {
it('has pagination buttons', () => {
expect(wrapper.findComponent({ name: 'BPagination' }).exists()).toBe(true)
})
describe('next page', () => {
beforeEach(() => {
jest.clearAllMocks()
wrapper.findComponent({ name: 'BPagination' }).vm.$emit('input', 2)
})
it('calls the API again', () => {
expect(adminListContributionsMock).toBeCalledWith({
currentPage: 2,
order: 'DESC',
pageSize: 25,
statusFilter: ['IN_PROGRESS', 'PENDING', 'CONFIRMED', 'DENIED', 'DELETED'],
})
})
describe('click tab "open" again', () => {
beforeEach(async () => {
jest.clearAllMocks()
await wrapper.find('a[data-test="open"]').trigger('click')
})
it('refetches contributions with proper filter and current page = 1', () => {
expect(adminListContributionsMock).toBeCalledWith({
currentPage: 1,
order: 'DESC',
pageSize: 25,
statusFilter: ['IN_PROGRESS', 'PENDING'],
})
})
})
})
})
})
})
})

View File

@ -116,6 +116,11 @@ export default {
pageSize: 25,
}
},
watch: {
tabIndex() {
this.currentPage = 1
},
},
methods: {
deleteCreation() {
this.$apollo

View File

@ -0,0 +1,125 @@
import { mount } from '@vue/test-utils'
import FederationVisualize from './FederationVisualize'
import VueApollo from 'vue-apollo'
import { createMockClient } from 'mock-apollo-client'
import { getCommunities } from '@/graphql/getCommunities'
import { toastErrorSpy } from '../../test/testSetup'
const mockClient = createMockClient()
const apolloProvider = new VueApollo({
defaultClient: mockClient,
})
const localVue = global.localVue
localVue.use(VueApollo)
const mocks = {
$t: (key) => key,
$d: jest.fn((d) => d),
$i18n: {
locale: 'en',
t: (key) => key,
},
}
const defaultData = () => {
return {
getCommunities: [
{
id: 1776,
foreign: true,
publicKey: 'c7ca9e742421bb167b8666cb78f90b40c665b8f35db8f001988d44dbb3ce8527',
url: 'http://localhost/api/2_0',
lastAnnouncedAt: '2023-04-07T12:27:24.037Z',
verifiedAt: null,
lastErrorAt: null,
createdAt: '2023-04-07T11:45:06.254Z',
updatedAt: null,
__typename: 'Community',
},
{
id: 1775,
foreign: true,
publicKey: 'c7ca9e742421bb167b8666cb78f90b40c665b8f35db8f001988d44dbb3ce8527',
url: 'http://localhost/api/1_1',
lastAnnouncedAt: '2023-04-07T12:27:24.023Z',
verifiedAt: null,
lastErrorAt: null,
createdAt: '2023-04-07T11:45:06.234Z',
updatedAt: null,
__typename: 'Community',
},
{
id: 1774,
foreign: true,
publicKey: 'c7ca9e742421bb167b8666cb78f90b40c665b8f35db8f001988d44dbb3ce8527',
url: 'http://localhost/api/1_0',
lastAnnouncedAt: '2023-04-07T12:27:24.009Z',
verifiedAt: null,
lastErrorAt: null,
createdAt: '2023-04-07T11:45:06.218Z',
updatedAt: null,
__typename: 'Community',
},
],
}
}
describe('FederationVisualize', () => {
let wrapper
const getCommunitiesMock = jest.fn()
mockClient.setRequestHandler(
getCommunities,
getCommunitiesMock
.mockRejectedValueOnce({ message: 'Ouch!' })
.mockResolvedValue({ data: defaultData() }),
)
const Wrapper = () => {
return mount(FederationVisualize, { localVue, mocks, apolloProvider })
}
describe('mount', () => {
beforeEach(() => {
jest.clearAllMocks()
wrapper = Wrapper()
})
describe('server error', () => {
it('toast error', () => {
expect(toastErrorSpy).toBeCalledWith('Ouch!')
})
})
describe('sever success', () => {
it('sends query to Apollo when created', () => {
expect(getCommunitiesMock).toBeCalled()
})
it('has a DIV element with the class "federation-visualize"', () => {
expect(wrapper.find('div.federation-visualize').exists()).toBe(true)
})
it('has a refresh button', () => {
expect(wrapper.find('[data-test="federation-communities-refresh-btn"]').exists()).toBe(true)
})
it('renders 3 community list items', () => {
expect(wrapper.findAll('.list-group-item').length).toBe(3)
})
describe('cklicking the refresh button', () => {
beforeEach(async () => {
jest.clearAllMocks()
await wrapper.find('[data-test="federation-communities-refresh-btn"]').trigger('click')
})
it('calls the API', async () => {
expect(getCommunitiesMock).toBeCalled()
})
})
})
})
})

View File

@ -0,0 +1,69 @@
<template>
<div class="federation-visualize">
<div class="d-flex justify-content-between align-items-center mb-3">
<span class="h2">{{ $t('federation.gradidoInstances') }}</span>
<b-button>
<b-icon
icon="arrow-clockwise"
font-scale="2"
:animation="animation"
@click="$apollo.queries.GetCommunities.refresh()"
data-test="federation-communities-refresh-btn"
></b-icon>
</b-button>
</div>
<b-list-group>
<b-row>
<b-col cols="1" class="ml-1">{{ $t('federation.verified') }}</b-col>
<b-col class="ml-3">{{ $t('federation.url') }}</b-col>
<b-col cols="2">{{ $t('federation.lastAnnouncedAt') }}</b-col>
<b-col cols="2">{{ $t('federation.createdAt') }}</b-col>
</b-row>
<b-list-group-item
v-for="item in communities"
:key="item.id"
:variant="!item.foreign ? 'primary' : 'warning'"
>
<federation-visualize-item :item="item" />
</b-list-group-item>
</b-list-group>
</div>
</template>
<script>
import { getCommunities } from '@/graphql/getCommunities'
import FederationVisualizeItem from '../components/Fedaration/FederationVisualizeItem.vue'
export default {
name: 'FederationVisualize',
components: {
FederationVisualizeItem,
},
data() {
return {
oldPublicKey: '',
communities: [],
icon: '',
}
},
computed: {
animation() {
return this.$apollo.queries.GetCommunities.loading ? 'spin' : ''
},
},
apollo: {
GetCommunities: {
fetchPolicy: 'network-only',
query() {
return getCommunities
},
update({ getCommunities }) {
this.communities = getCommunities
},
error({ message }) {
this.toastError(message)
},
},
},
}
</script>

View File

@ -45,7 +45,7 @@ describe('router', () => {
describe('routes', () => {
it('has nine routes defined', () => {
expect(routes).toHaveLength(8)
expect(routes).toHaveLength(9)
})
it('has "/overview" as default', async () => {
@ -88,6 +88,13 @@ describe('router', () => {
})
})
describe('federation', () => {
it('loads the "FederationVisualize" page', async () => {
const component = await routes.find((r) => r.path === '/federation').component()
expect(component.default.name).toBe('FederationVisualize')
})
})
describe('not found page', () => {
it('renders the "NotFound" component', async () => {
const component = await routes.find((r) => r.path === '*').component()

View File

@ -31,6 +31,10 @@ const routes = [
path: '*',
component: () => import('@/components/NotFoundPage.vue'),
},
{
path: '/federation',
component: () => import('@/pages/FederationVisualize.vue'),
},
]
export default routes

View File

@ -5038,6 +5038,11 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
date-fns@^2.29.3:
version "2.29.3"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8"
integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==
de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"

View File

@ -5,7 +5,7 @@ module.exports = {
node: true,
},
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint', 'type-graphql', 'jest', 'import', 'n'],
plugins: ['prettier', '@typescript-eslint', 'type-graphql', 'import', 'n', 'promise'],
extends: [
'standard',
'eslint:recommended',
@ -33,12 +33,6 @@ module.exports = {
htmlWhitespaceSensitivity: 'ignore',
},
],
// jest
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'error',
'jest/valid-expect': 'error',
// import
'import/export': 'error',
'import/no-deprecated': 'error',
@ -142,6 +136,21 @@ module.exports = {
'n/prefer-global/url-search-params': 'error',
'n/prefer-promises/dns': 'error',
'n/prefer-promises/fs': 'error',
// promise
'promise/catch-or-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/always-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'warn',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'warn',
'promise/valid-params': 'warn',
'promise/prefer-await-to-callbacks': 'error',
'promise/no-multiple-resolved': 'error',
},
overrides: [
// only for ts files
@ -168,5 +177,18 @@ module.exports = {
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
},
},
{
files: ['*.test.ts'],
plugins: ['jest'],
rules: {
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'error',
'jest/valid-expect': 'error',
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
},
],
}

View File

@ -1,9 +1,14 @@
module.exports = {
semi: false,
printWidth: 100,
singleQuote: true,
trailingComma: "all",
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
quoteProps: "as-needed",
jsxSingleQuote: true,
trailingComma: "all",
bracketSpacing: true,
bracketSameLine: false,
arrowParens: "always",
endOfLine: "auto",
};

View File

@ -8,7 +8,7 @@
"pattern": "yyyy-MM-dd",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
},
"keepFileExt" : true,
"fileNameSep" : "_",
@ -21,7 +21,7 @@
"pattern": "yyyy-MM-dd",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
},
"keepFileExt" : true,
"fileNameSep" : "_",
@ -34,7 +34,7 @@
"pattern": "yyyy-MM-dd",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
},
"keepFileExt" : true,
"fileNameSep" : "_",
@ -47,7 +47,7 @@
"pattern": "yyyy-MM-dd",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
},
"keepFileExt" : true,
"fileNameSep" : "_",
@ -60,7 +60,7 @@
"pattern": "yyyy-MM-dd",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m %s"
},
"keepFileExt" : true,
"fileNameSep" : "_",
@ -77,7 +77,7 @@
"type": "stdout",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
}
},
"apolloOut":
@ -85,7 +85,7 @@
"type": "stdout",
"layout":
{
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
"type": "pattern", "pattern": "%d{ISO8601} %p %c [%X{user}] [%f : %l] - %m"
}
}
},

View File

@ -1,6 +1,6 @@
{
"name": "gradido-backend",
"version": "1.19.1",
"version": "1.20.0",
"description": "Gradido unified backend providing an API-Service for Gradido Transactions",
"main": "src/index.ts",
"repository": "https://github.com/gradido/gradido/backend",

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
@ -9,39 +10,35 @@ import { backendLogger as logger } from '@/server/logger'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
logger.trace('POST', url, payload)
return axios
.post(url, payload)
.then((result) => {
logger.trace('POST-Response', result)
if (result.status !== 200) {
throw new LogError('HTTP Status Error', result.status)
}
if (result.data.state !== 'success') {
throw new Error(result.data.msg)
}
return { success: true, data: result.data }
})
.catch((error) => {
return { success: false, data: error.message }
})
try {
const result = await axios.post(url, payload)
logger.trace('POST-Response', result)
if (result.status !== 200) {
throw new LogError('HTTP Status Error', result.status)
}
if (result.data.state !== 'success') {
throw new LogError(result.data.msg)
}
return { success: true, data: result.data }
} catch (error: any) {
return { success: false, data: error.message }
}
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const apiGet = async (url: string): Promise<any> => {
logger.trace('GET: url=' + url)
return axios
.get(url)
.then((result) => {
logger.trace('GET-Response', result)
if (result.status !== 200) {
throw new LogError('HTTP Status Error', result.status)
}
if (!['success', 'warning'].includes(result.data.state)) {
throw new Error(result.data.msg)
}
return { success: true, data: result.data }
})
.catch((error) => {
return { success: false, data: error.message }
})
try {
const result = await axios.get(url)
logger.trace('GET-Response', result)
if (result.status !== 200) {
throw new LogError('HTTP Status Error', result.status)
}
if (!['success', 'warning'].includes(result.data.state)) {
throw new LogError(result.data.msg)
}
return { success: true, data: result.data }
} catch (error: any) {
return { success: false, data: error.message }
}
}

View File

@ -76,7 +76,7 @@ const email = {
EMAIL_SENDER: process.env.EMAIL_SENDER || 'info@gradido.net',
EMAIL_PASSWORD: process.env.EMAIL_PASSWORD || '',
EMAIL_SMTP_URL: process.env.EMAIL_SMTP_URL || 'mailserver',
EMAIL_SMTP_PORT: process.env.EMAIL_SMTP_PORT || '1025',
EMAIL_SMTP_PORT: Number(process.env.EMAIL_SMTP_PORT) || 1025,
// eslint-disable-next-line no-unneeded-ternary
EMAIL_TLS: process.env.EMAIL_TLS === 'false' ? false : true,
EMAIL_LINK_VERIFICATION:

View File

@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/unbound-method */
import { createTransport } from 'nodemailer'
import { logger, i18n } from '@test/testSetup'
@ -10,7 +9,7 @@ import { sendEmailTranslated } from './sendEmailTranslated'
CONFIG.EMAIL = false
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'
CONFIG.EMAIL_SMTP_PORT = '1234'
CONFIG.EMAIL_SMTP_PORT = 1234
CONFIG.EMAIL_USERNAME = 'user'
CONFIG.EMAIL_PASSWORD = 'pwd'
CONFIG.EMAIL_TLS = true
@ -31,7 +30,7 @@ jest.mock('nodemailer', () => {
})
describe('sendEmailTranslated', () => {
let result: Record<string, unknown> | null
let result: Record<string, unknown> | boolean | null
describe('config email is false', () => {
beforeEach(async () => {

View File

@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import path from 'path'
import Email from 'email-templates'
@ -6,44 +7,46 @@ import i18n from 'i18n'
import { createTransport } from 'nodemailer'
import { CONFIG } from '@/config'
import { LogError } from '@/server/LogError'
import { backendLogger as logger } from '@/server/logger'
export const sendEmailTranslated = async (params: {
export const sendEmailTranslated = async ({
receiver,
template,
locals,
}: {
receiver: {
to: string
cc?: string
}
template: string
locals: Record<string, unknown>
}): Promise<Record<string, unknown> | null> => {
let resultSend: Record<string, unknown> | null = null
}): Promise<Record<string, unknown> | boolean | null> => {
// TODO: test the calling order of 'i18n.setLocale' for example: language of logging 'en', language of email receiver 'es', reset language of current user 'de'
// because language of receiver can differ from language of current user who triggers the sending
const rememberLocaleToRestore = i18n.getLocale()
i18n.setLocale('en') // for logging
logger.info(
`send Email: language=${params.locals.locale} to=${params.receiver.to}` +
(params.receiver.cc ? `, cc=${params.receiver.cc}` : '') +
`, subject=${i18n.__('emails.' + params.template + '.subject')}`,
)
if (!CONFIG.EMAIL) {
logger.info(`Emails are disabled via config...`)
return null
}
// because language of receiver can differ from language of current user who triggers the sending
// const rememberLocaleToRestore = i18n.getLocale()
i18n.setLocale('en') // for logging
logger.info(
`send Email: language=${locals.locale as string} to=${receiver.to}` +
(receiver.cc ? `, cc=${receiver.cc}` : '') +
`, subject=${i18n.__('emails.' + template + '.subject')}`,
)
if (CONFIG.EMAIL_TEST_MODUS) {
logger.info(
`Testmodus=ON: change receiver from ${params.receiver.to} to ${CONFIG.EMAIL_TEST_RECEIVER}`,
`Testmodus=ON: change receiver from ${receiver.to} to ${CONFIG.EMAIL_TEST_RECEIVER}`,
)
params.receiver.to = CONFIG.EMAIL_TEST_RECEIVER
receiver.to = CONFIG.EMAIL_TEST_RECEIVER
}
const transport = createTransport({
host: CONFIG.EMAIL_SMTP_URL,
port: Number(CONFIG.EMAIL_SMTP_PORT),
port: CONFIG.EMAIL_SMTP_PORT,
secure: false, // true for 465, false for other ports
requireTLS: CONFIG.EMAIL_TLS,
auth: {
@ -52,7 +55,7 @@ export const sendEmailTranslated = async (params: {
},
})
i18n.setLocale(params.locals.locale as string) // for email
i18n.setLocale(locals.locale as string) // for email
// TESTING: see 'README.md'
const email = new Email({
@ -64,23 +67,16 @@ export const sendEmailTranslated = async (params: {
// i18n, // is only needed if you don't install i18n
})
// ATTENTION: await is needed, because otherwise on send the email gets send in the language of the current user, because below the language gets reset
await email
const resultSend = await email
.send({
template: path.join(__dirname, 'templates', params.template),
message: params.receiver,
locals: params.locals, // the 'locale' in here seems not to be used by 'email-template', because it doesn't work if the language isn't set before by 'i18n.setLocale'
})
.then((result: Record<string, unknown>) => {
resultSend = result
logger.info('Send email successfully !!!')
logger.info('Result: ', result)
template: path.join(__dirname, 'templates', template),
message: receiver,
locals, // the 'locale' in here seems not to be used by 'email-template', because it doesn't work if the language isn't set before by 'i18n.setLocale'
})
.catch((error: unknown) => {
throw new LogError('Error sending notification email', error)
logger.error('Error sending notification email', error)
return false
})
i18n.setLocale(rememberLocaleToRestore)
return resultSend
}

View File

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { Connection } from '@dbTools/typeorm'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { testEnvironment } from '@test/helpers'
@ -23,8 +24,12 @@ import {
sendTransactionReceivedEmail,
} from './sendEmailVariants'
let con: any
let testEnv: any
let con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment(logger, localization)

View File

@ -13,7 +13,7 @@ export const sendAddedContributionMessageEmail = (data: {
senderFirstName: string
senderLastName: string
contributionMemo: string
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: {
to: `${data.firstName} ${data.lastName} <${data.email}>`,
@ -40,7 +40,7 @@ export const sendAccountActivationEmail = (data: {
language: string
activationLink: string
timeDurationObject: Record<string, unknown>
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'accountActivation',
@ -62,7 +62,7 @@ export const sendAccountMultiRegistrationEmail = (data: {
lastName: string
email: string
language: string
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'accountMultiRegistration',
@ -86,7 +86,7 @@ export const sendContributionConfirmedEmail = (data: {
senderLastName: string
contributionMemo: string
contributionAmount: Decimal
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionConfirmed',
@ -113,7 +113,7 @@ export const sendContributionDeletedEmail = (data: {
senderFirstName: string
senderLastName: string
contributionMemo: string
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionDeleted',
@ -139,7 +139,7 @@ export const sendContributionDeniedEmail = (data: {
senderFirstName: string
senderLastName: string
contributionMemo: string
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'contributionDenied',
@ -164,7 +164,7 @@ export const sendResetPasswordEmail = (data: {
language: string
resetLink: string
timeDurationObject: Record<string, unknown>
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'resetPassword',
@ -191,7 +191,7 @@ export const sendTransactionLinkRedeemedEmail = (data: {
senderEmail: string
transactionMemo: string
transactionAmount: Decimal
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'transactionLinkRedeemed',
@ -220,7 +220,7 @@ export const sendTransactionReceivedEmail = (data: {
senderLastName: string
senderEmail: string
transactionAmount: Decimal
}): Promise<Record<string, unknown> | null> => {
}): Promise<Record<string, unknown> | boolean | null> => {
return sendEmailTranslated({
receiver: { to: `${data.firstName} ${data.lastName} <${data.email}>` },
template: 'transactionReceived',

View File

@ -1,19 +1,18 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Connection } from '@dbTools/typeorm'
import { Community as DbCommunity } from '@entity/Community'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { testEnvironment, cleanDB } from '@test/helpers'
import { logger } from '@test/testSetup'
import { validateCommunities } from './validateCommunities'
let con: any
let testEnv: any
let con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment(logger)

View File

@ -1,8 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { User } from '@entity/User'
import { AuthChecker } from 'type-graphql'
@ -10,9 +5,10 @@ import { INALIENABLE_RIGHTS } from '@/auth/INALIENABLE_RIGHTS'
import { decode, encode } from '@/auth/JWT'
import { RIGHTS } from '@/auth/RIGHTS'
import { ROLE_UNAUTHORIZED, ROLE_USER, ROLE_ADMIN } from '@/auth/ROLES'
import { Context } from '@/server/context'
import { LogError } from '@/server/LogError'
export const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {
export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) => {
context.role = ROLE_UNAUTHORIZED // unauthorized user
// is rights an inalienable right?
@ -47,7 +43,7 @@ export const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {
}
// check for correct rights
const missingRights = (<RIGHTS[]>rights).filter((right) => !context.role.hasRight(right))
const missingRights = (<RIGHTS[]>rights).filter((right) => !context.role?.hasRight(right))
if (missingRights.length !== 0) {
throw new LogError('401 Unauthorized')
}

View File

@ -8,9 +8,7 @@ export class Community {
this.foreign = dbCom.foreign
this.publicKey = dbCom.publicKey.toString()
this.url =
(dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/') +
'api/' +
dbCom.apiVersion
(dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/') + dbCom.apiVersion
this.lastAnnouncedAt = dbCom.lastAnnouncedAt
this.verifiedAt = dbCom.verifiedAt
this.lastErrorAt = dbCom.lastErrorAt

View File

@ -1,21 +1,19 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Connection } from '@dbTools/typeorm'
import { Community as DbCommunity } from '@entity/Community'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { testEnvironment } from '@test/helpers'
import { getCommunities } from '@/seeds/graphql/queries'
let query: any
// to do: We need a setup for the tests that closes the connection
let con: any
let testEnv: any
let query: ApolloServerTestClient['query'], con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment()
@ -36,6 +34,7 @@ describe('CommunityResolver', () => {
let foreignCom1: DbCommunity
let foreignCom2: DbCommunity
let foreignCom3: DbCommunity
describe('with empty list', () => {
it('returns no community entry', async () => {
// const result: Community[] = await query({ query: getCommunities })
@ -56,7 +55,7 @@ describe('CommunityResolver', () => {
homeCom1.foreign = false
homeCom1.publicKey = Buffer.from('publicKey-HomeCommunity')
homeCom1.apiVersion = '1_0'
homeCom1.endPoint = 'http://localhost'
homeCom1.endPoint = 'http://localhost/api'
homeCom1.createdAt = new Date()
await DbCommunity.insert(homeCom1)
@ -64,7 +63,7 @@ describe('CommunityResolver', () => {
homeCom2.foreign = false
homeCom2.publicKey = Buffer.from('publicKey-HomeCommunity')
homeCom2.apiVersion = '1_1'
homeCom2.endPoint = 'http://localhost'
homeCom2.endPoint = 'http://localhost/api'
homeCom2.createdAt = new Date()
await DbCommunity.insert(homeCom2)
@ -72,24 +71,24 @@ describe('CommunityResolver', () => {
homeCom3.foreign = false
homeCom3.publicKey = Buffer.from('publicKey-HomeCommunity')
homeCom3.apiVersion = '2_0'
homeCom3.endPoint = 'http://localhost'
homeCom3.endPoint = 'http://localhost/api'
homeCom3.createdAt = new Date()
await DbCommunity.insert(homeCom3)
})
it('returns three home-community entries', async () => {
it('returns 3 home-community entries', async () => {
await expect(query({ query: getCommunities })).resolves.toMatchObject({
data: {
getCommunities: [
{
id: 1,
foreign: homeCom1.foreign,
id: 3,
foreign: homeCom3.foreign,
publicKey: expect.stringMatching('publicKey-HomeCommunity'),
url: expect.stringMatching('http://localhost/api/1_0'),
url: expect.stringMatching('http://localhost/api/2_0'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: homeCom1.createdAt.toISOString(),
createdAt: homeCom3.createdAt.toISOString(),
updatedAt: null,
},
{
@ -104,14 +103,14 @@ describe('CommunityResolver', () => {
updatedAt: null,
},
{
id: 3,
foreign: homeCom3.foreign,
id: 1,
foreign: homeCom1.foreign,
publicKey: expect.stringMatching('publicKey-HomeCommunity'),
url: expect.stringMatching('http://localhost/api/2_0'),
url: expect.stringMatching('http://localhost/api/1_0'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: homeCom3.createdAt.toISOString(),
createdAt: homeCom1.createdAt.toISOString(),
updatedAt: null,
},
],
@ -128,7 +127,7 @@ describe('CommunityResolver', () => {
foreignCom1.foreign = true
foreignCom1.publicKey = Buffer.from('publicKey-ForeignCommunity')
foreignCom1.apiVersion = '1_0'
foreignCom1.endPoint = 'http://remotehost'
foreignCom1.endPoint = 'http://remotehost/api'
foreignCom1.createdAt = new Date()
await DbCommunity.insert(foreignCom1)
@ -136,7 +135,7 @@ describe('CommunityResolver', () => {
foreignCom2.foreign = true
foreignCom2.publicKey = Buffer.from('publicKey-ForeignCommunity')
foreignCom2.apiVersion = '1_1'
foreignCom2.endPoint = 'http://remotehost'
foreignCom2.endPoint = 'http://remotehost/api'
foreignCom2.createdAt = new Date()
await DbCommunity.insert(foreignCom2)
@ -144,24 +143,24 @@ describe('CommunityResolver', () => {
foreignCom3.foreign = true
foreignCom3.publicKey = Buffer.from('publicKey-ForeignCommunity')
foreignCom3.apiVersion = '1_2'
foreignCom3.endPoint = 'http://remotehost'
foreignCom3.endPoint = 'http://remotehost/api'
foreignCom3.createdAt = new Date()
await DbCommunity.insert(foreignCom3)
})
it('returns 3x home and 3x foreign-community entries', async () => {
it('returns 3 home community and 3 foreign community entries', async () => {
await expect(query({ query: getCommunities })).resolves.toMatchObject({
data: {
getCommunities: [
{
id: 1,
foreign: homeCom1.foreign,
id: 3,
foreign: homeCom3.foreign,
publicKey: expect.stringMatching('publicKey-HomeCommunity'),
url: expect.stringMatching('http://localhost/api/1_0'),
url: expect.stringMatching('http://localhost/api/2_0'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: homeCom1.createdAt.toISOString(),
createdAt: homeCom3.createdAt.toISOString(),
updatedAt: null,
},
{
@ -176,25 +175,25 @@ describe('CommunityResolver', () => {
updatedAt: null,
},
{
id: 3,
foreign: homeCom3.foreign,
id: 1,
foreign: homeCom1.foreign,
publicKey: expect.stringMatching('publicKey-HomeCommunity'),
url: expect.stringMatching('http://localhost/api/2_0'),
url: expect.stringMatching('http://localhost/api/1_0'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: homeCom3.createdAt.toISOString(),
createdAt: homeCom1.createdAt.toISOString(),
updatedAt: null,
},
{
id: 4,
foreign: foreignCom1.foreign,
id: 6,
foreign: foreignCom3.foreign,
publicKey: expect.stringMatching('publicKey-ForeignCommunity'),
url: expect.stringMatching('http://remotehost/api/1_0'),
url: expect.stringMatching('http://remotehost/api/1_2'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: foreignCom1.createdAt.toISOString(),
createdAt: foreignCom3.createdAt.toISOString(),
updatedAt: null,
},
{
@ -209,14 +208,14 @@ describe('CommunityResolver', () => {
updatedAt: null,
},
{
id: 6,
foreign: foreignCom3.foreign,
id: 4,
foreign: foreignCom1.foreign,
publicKey: expect.stringMatching('publicKey-ForeignCommunity'),
url: expect.stringMatching('http://remotehost/api/1_2'),
url: expect.stringMatching('http://remotehost/api/1_0'),
lastAnnouncedAt: null,
verifiedAt: null,
lastErrorAt: null,
createdAt: foreignCom3.createdAt.toISOString(),
createdAt: foreignCom1.createdAt.toISOString(),
updatedAt: null,
},
],

View File

@ -11,7 +11,11 @@ export class CommunityResolver {
@Query(() => [Community])
async getCommunities(): Promise<Community[]> {
const dbCommunities: DbCommunity[] = await DbCommunity.find({
order: { foreign: 'ASC', publicKey: 'ASC', apiVersion: 'ASC' },
order: {
foreign: 'ASC',
createdAt: 'DESC',
lastAnnouncedAt: 'DESC',
},
})
return dbCommunities.map((dbCom: DbCommunity) => new Community(dbCom))
}

View File

@ -1,12 +1,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
import { Event as DbEvent } from '@entity/Event'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { GraphQLError } from 'graphql'
@ -25,8 +22,14 @@ import { listContributionLinks } from '@/seeds/graphql/queries'
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
import { peterLustig } from '@/seeds/users/peter-lustig'
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'],
query: ApolloServerTestClient['query'],
con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment()

View File

@ -1,12 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { Event as DbEvent } from '@entity/Event'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { GraphQLError } from 'graphql'
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
@ -36,8 +35,12 @@ jest.mock('@/emails/sendEmailVariants', () => {
}
})
let mutate: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'], con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
let result: any
beforeAll(async () => {

View File

@ -146,7 +146,7 @@ export class ContributionMessageResolver {
await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution)
}
await sendAddedContributionMessageEmail({
void sendAddedContributionMessageEmail({
firstName: contribution.user.firstName,
lastName: contribution.user.lastName,
email: contribution.user.emailContact.email,

View File

@ -1,23 +1,18 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { Contribution } from '@entity/Contribution'
import { Event as DbEvent } from '@entity/Event'
import { Transaction as DbTransaction } from '@entity/Transaction'
import { User } from '@entity/User'
import { UserInputError } from 'apollo-server-express'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { GraphQLError } from 'graphql'
import { ContributionStatus } from '@enum/ContributionStatus'
import { Order } from '@enum/Order'
import { ContributionListResult } from '@model/Contribution'
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
import {
cleanDB,
resetToken,
@ -63,8 +58,14 @@ import { stephenHawking } from '@/seeds/users/stephen-hawking'
jest.mock('@/emails/sendEmailVariants')
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'],
query: ApolloServerTestClient['query'],
con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
let creation: Contribution | void
let admin: User
let pendingContribution: any
@ -166,7 +167,7 @@ describe('ContributionResolver', () => {
describe('createContribution', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: createContribution,
variables: { amount: 100.0, memo: 'Test Contribution', creationDate: 'not-valid' },
})
@ -191,7 +192,7 @@ describe('ContributionResolver', () => {
it('throws error when memo length smaller than 5 chars', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: createContribution,
variables: {
amount: 100.0,
@ -210,7 +211,7 @@ describe('ContributionResolver', () => {
it('throws error when memo length greater than 255 chars', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: createContribution,
variables: {
amount: 100.0,
@ -227,7 +228,7 @@ describe('ContributionResolver', () => {
it('throws error when creationDate not-valid', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: createContribution,
variables: {
amount: 100.0,
@ -250,7 +251,7 @@ describe('ContributionResolver', () => {
it('throws error when creationDate 3 month behind', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: createContribution,
variables: {
amount: 100.0,
@ -298,7 +299,7 @@ describe('ContributionResolver', () => {
describe('updateContribution', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: 1,
@ -327,7 +328,7 @@ describe('ContributionResolver', () => {
it('throws error', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -348,7 +349,7 @@ describe('ContributionResolver', () => {
it('throws error', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -400,7 +401,7 @@ describe('ContributionResolver', () => {
it('throws an error', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -433,7 +434,7 @@ describe('ContributionResolver', () => {
it('throws an error', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: adminUpdateContribution,
variables: {
id: pendingContribution.data.createContribution.id,
@ -512,7 +513,7 @@ describe('ContributionResolver', () => {
it('throws an error', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -541,7 +542,7 @@ describe('ContributionResolver', () => {
it('throws an error', async () => {
jest.clearAllMocks()
const date = new Date()
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -564,7 +565,7 @@ describe('ContributionResolver', () => {
it('updates contribution', async () => {
const {
data: { updateContribution: contribution },
}: { data: { updateContribution: UnconfirmedContribution } } = await mutate({
} = await mutate({
mutation: updateContribution,
variables: {
contributionId: pendingContribution.data.createContribution.id,
@ -603,7 +604,7 @@ describe('ContributionResolver', () => {
describe('denyContribution', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: 1,
@ -626,7 +627,7 @@ describe('ContributionResolver', () => {
})
it('returns an error', async () => {
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: 1,
@ -651,7 +652,7 @@ describe('ContributionResolver', () => {
describe('wrong contribution id', () => {
it('throws an error', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: -1,
@ -695,7 +696,7 @@ describe('ContributionResolver', () => {
},
})
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: contribution.data.createContribution.id,
@ -740,7 +741,7 @@ describe('ContributionResolver', () => {
variables: { email: 'peter@lustig.de', password: 'Aa12345_' },
})
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: contribution.data.createContribution.id,
@ -785,7 +786,7 @@ describe('ContributionResolver', () => {
},
})
const { errors: errorObjects }: { errors: GraphQLError[] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: denyContribution,
variables: {
id: contribution.data.createContribution.id,
@ -807,7 +808,7 @@ describe('ContributionResolver', () => {
})
const {
data: { denyContribution: isDenied },
}: { data: { denyContribution: boolean } } = await mutate({
} = await mutate({
mutation: denyContribution,
variables: {
id: contributionToDeny.data.createContribution.id,
@ -846,8 +847,8 @@ describe('ContributionResolver', () => {
describe('deleteContribution', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
query: deleteContribution,
const { errors: errorObjects } = await mutate({
mutation: deleteContribution,
variables: {
id: -1,
},
@ -871,7 +872,7 @@ describe('ContributionResolver', () => {
describe('wrong contribution id', () => {
it('returns an error', async () => {
jest.clearAllMocks()
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: deleteContribution,
variables: {
id: -1,
@ -899,7 +900,7 @@ describe('ContributionResolver', () => {
})
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: deleteContribution,
variables: {
id: contributionToDelete.data.createContribution.id,
@ -935,7 +936,7 @@ describe('ContributionResolver', () => {
it('deletes successfully', async () => {
const {
data: { deleteContribution: isDenied },
}: { data: { deleteContribution: boolean } } = await mutate({
} = await mutate({
mutation: deleteContribution,
variables: {
id: contributionToDelete.data.createContribution.id,
@ -974,7 +975,7 @@ describe('ContributionResolver', () => {
mutation: login,
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
})
const { errors: errorObjects }: { errors: [GraphQLError] } = await mutate({
const { errors: errorObjects } = await mutate({
mutation: deleteContribution,
variables: {
id: contributionToConfirm.data.createContribution.id,
@ -998,7 +999,7 @@ describe('ContributionResolver', () => {
describe('listContributions', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await query({
const { errors: errorObjects } = await query({
query: listContributions,
variables: {
currentPage: 1,
@ -1026,7 +1027,7 @@ describe('ContributionResolver', () => {
it('returns creations', async () => {
const {
data: { listContributions: contributionListResult },
}: { data: { listContributions: ContributionListResult } } = await query({
} = await query({
query: listContributions,
variables: {
currentPage: 1,
@ -1078,7 +1079,7 @@ describe('ContributionResolver', () => {
it('returns only unconfirmed creations', async () => {
const {
data: { listContributions: contributionListResult },
}: { data: { listContributions: ContributionListResult } } = await query({
} = await query({
query: listContributions,
variables: {
currentPage: 1,
@ -1128,7 +1129,7 @@ describe('ContributionResolver', () => {
describe('listAllContribution', () => {
describe('unauthenticated', () => {
it('returns an error', async () => {
const { errors: errorObjects }: { errors: [GraphQLError] } = await query({
const { errors: errorObjects } = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1154,7 +1155,7 @@ describe('ContributionResolver', () => {
})
it('throws an error with "NOT_VALID" in statusFilter', async () => {
const { errors: errorObjects }: { errors: [GraphQLError | UserInputError] } = await query({
const { errors: errorObjects } = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1171,7 +1172,7 @@ describe('ContributionResolver', () => {
})
it('throws an error with a null in statusFilter', async () => {
const { errors: errorObjects }: { errors: [Error] } = await query({
const { errors: errorObjects } = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1188,7 +1189,7 @@ describe('ContributionResolver', () => {
})
it('throws an error with null and "NOT_VALID" in statusFilter', async () => {
const { errors: errorObjects }: { errors: [Error] } = await query({
const { errors: errorObjects } = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1210,7 +1211,7 @@ describe('ContributionResolver', () => {
it('returns all contributions without statusFilter', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1274,7 +1275,7 @@ describe('ContributionResolver', () => {
it('returns all contributions for statusFilter = null', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1339,7 +1340,7 @@ describe('ContributionResolver', () => {
it('returns all contributions for statusFilter = []', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1404,7 +1405,7 @@ describe('ContributionResolver', () => {
it('returns all CONFIRMED contributions', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1454,7 +1455,7 @@ describe('ContributionResolver', () => {
it('returns all PENDING contributions', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1492,7 +1493,7 @@ describe('ContributionResolver', () => {
it('returns all IN_PROGRESS Creation', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1530,7 +1531,7 @@ describe('ContributionResolver', () => {
it('returns all DENIED Creation', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1574,7 +1575,7 @@ describe('ContributionResolver', () => {
it('does not return any DELETED Creation', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -1593,7 +1594,7 @@ describe('ContributionResolver', () => {
it('returns all CONFIRMED and PENDING Creation', async () => {
const {
data: { listAllContributions: contributionListObject },
}: { data: { listAllContributions: ContributionListResult } } = await query({
} = await query({
query: listAllContributions,
variables: {
currentPage: 1,
@ -2676,7 +2677,7 @@ describe('ContributionResolver', () => {
it('returns 17 creations in total', async () => {
const {
data: { adminListContributions: contributionListObject },
}: { data: { adminListContributions: ContributionListResult } } = await query({
} = await query({
query: adminListContributions,
})
expect(contributionListObject.contributionList).toHaveLength(17)
@ -2843,7 +2844,7 @@ describe('ContributionResolver', () => {
it('returns two pending creations with page size set to 2', async () => {
const {
data: { adminListContributions: contributionListObject },
}: { data: { adminListContributions: ContributionListResult } } = await query({
} = await query({
query: adminListContributions,
variables: {
currentPage: 1,

View File

@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { IsNull, getConnection } from '@dbTools/typeorm'
import { Contribution as DbContribution } from '@entity/Contribution'
import { ContributionMessage } from '@entity/ContributionMessage'
@ -229,11 +228,11 @@ export class ContributionResolver {
contributionMessage.createdAt = contributionToUpdate.updatedAt
? contributionToUpdate.updatedAt
: contributionToUpdate.createdAt
const changeMessage = `${contributionToUpdate.contributionDate}
const changeMessage = `${contributionToUpdate.contributionDate.toString()}
---
${contributionToUpdate.memo}
---
${contributionToUpdate.amount}`
${contributionToUpdate.amount.toString()}`
contributionMessage.message = changeMessage
contributionMessage.isModerator = false
contributionMessage.userId = user.id
@ -259,7 +258,7 @@ export class ContributionResolver {
@Ctx() context: Context,
): Promise<Decimal[]> {
logger.info(
`adminCreateContribution(email=${email}, amount=${amount}, memo=${memo}, creationDate=${creationDate})`,
`adminCreateContribution(email=${email}, amount=${amount.toString()}, memo=${memo}, creationDate=${creationDate})`,
)
const clientTimezoneOffset = getClientTimezoneOffset(context)
if (!isValidDateString(creationDate)) {

View File

@ -1,10 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Connection } from '@dbTools/typeorm'
import { User as DbUser } from '@entity/User'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { GraphQLError } from 'graphql'
import { testEnvironment, cleanDB } from '@test/helpers'
@ -13,8 +11,14 @@ import { CONFIG } from '@/config'
import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations'
import { queryOptIn } from '@/seeds/graphql/queries'
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'],
query: ApolloServerTestClient['query'],
con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
CONFIG.EMAIL_CODE_VALID_TIME = 1440
CONFIG.EMAIL_CODE_REQUEST_TIME = 10

View File

@ -1,16 +1,13 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
import { Event as DbEvent } from '@entity/Event'
import { Transaction } from '@entity/Transaction'
import { User } from '@entity/User'
import { UserContact } from '@entity/UserContact'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { GraphQLError } from 'graphql'
@ -45,8 +42,14 @@ import { transactionLinkCode } from './TransactionLinkResolver'
jest.mock('@/util/TRANSACTIONS_LOCK')
TRANSACTIONS_LOCK.acquire = jest.fn().mockResolvedValue(jest.fn())
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'],
query: ApolloServerTestClient['query'],
con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
let user: User

View File

@ -1,13 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { Event as DbEvent } from '@entity/Event'
import { Transaction } from '@entity/Transaction'
import { User } from '@entity/User'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { GraphQLError } from 'graphql'
@ -27,13 +25,16 @@ import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
import { peterLustig } from '@/seeds/users/peter-lustig'
import { stephenHawking } from '@/seeds/users/stephen-hawking'
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'], con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment(logger)
mutate = testEnv.mutate
query = testEnv.query
con = testEnv.con
await cleanDB()
})
@ -274,7 +275,7 @@ describe('send coins', () => {
})
// login as admin
await query({ mutation: login, variables: peterData })
await mutate({ mutation: login, variables: peterData })
// confirm the contribution
await mutate({
@ -283,7 +284,7 @@ describe('send coins', () => {
})
// login as bob again
await query({ mutation: login, variables: bobData })
await mutate({ mutation: login, variables: bobData })
})
afterAll(async () => {

View File

@ -149,7 +149,7 @@ export const executeTransaction = async (
} finally {
await queryRunner.release()
}
await sendTransactionReceivedEmail({
void sendTransactionReceivedEmail({
firstName: recipient.firstName,
lastName: recipient.lastName,
email: recipient.emailContact.email,
@ -160,7 +160,7 @@ export const executeTransaction = async (
transactionAmount: amount,
})
if (transactionLink) {
await sendTransactionLinkRedeemedEmail({
void sendTransactionLinkRedeemedEmail({
firstName: sender.firstName,
lastName: sender.lastName,
email: sender.emailContact.email,

View File

@ -2,14 +2,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { Event as DbEvent } from '@entity/Event'
import { TransactionLink } from '@entity/TransactionLink'
import { User } from '@entity/User'
import { UserContact } from '@entity/UserContact'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { GraphQLError } from 'graphql'
import { v4 as uuidv4, validate as validateUUID, version as versionUUID } from 'uuid'
@ -88,8 +88,14 @@ jest.mock('@/apis/KlicktippController', () => {
let admin: User
let user: User
let mutate: any, query: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'],
query: ApolloServerTestClient['query'],
con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment(logger, localization)
@ -236,7 +242,7 @@ describe('UserResolver', () => {
})
describe('user already exists', () => {
let mutation: User
let mutation: any
beforeAll(async () => {
mutation = await mutate({ mutation: createUser, variables })
})
@ -638,7 +644,7 @@ describe('UserResolver', () => {
publisherId: 1234,
}
let result: User
let result: any
afterAll(async () => {
await cleanDB()

View File

@ -245,7 +245,7 @@ export class UserResolver {
user.publisherId = publisherId
logger.debug('partly faked user', user)
const emailSent = await sendAccountMultiRegistrationEmail({
void sendAccountMultiRegistrationEmail({
firstName: foundUser.firstName, // this is the real name of the email owner, but just "firstName" would be the name of the new registrant which shall not be passed to the outside
lastName: foundUser.lastName, // this is the real name of the email owner, but just "lastName" would be the name of the new registrant which shall not be passed to the outside
email,
@ -258,9 +258,6 @@ export class UserResolver {
)
/* uncomment this, when you need the activation link on the console */
// In case EMails are disabled log the activation link for the user
if (!emailSent) {
logger.debug(`Email not send!`)
}
logger.info('createUser() faked and send multi registration mail...')
return user
@ -325,8 +322,7 @@ export class UserResolver {
emailContact.emailVerificationCode.toString(),
).replace(/{code}/g, redeemCode ? '/' + redeemCode : '')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emailSent = await sendAccountActivationEmail({
void sendAccountActivationEmail({
firstName,
lastName,
email,
@ -338,10 +334,6 @@ export class UserResolver {
await EVENT_EMAIL_CONFIRMATION(dbUser)
if (!emailSent) {
logger.debug(`Account confirmation link: ${activationLink}`)
}
await queryRunner.commitTransaction()
logger.addContext('user', dbUser.id)
} catch (e) {
@ -392,8 +384,8 @@ export class UserResolver {
})
logger.info(`optInCode for ${email}=${user.emailContact}`)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emailSent = await sendResetPasswordEmail({
void sendResetPasswordEmail({
firstName: user.firstName,
lastName: user.lastName,
email,
@ -402,13 +394,6 @@ export class UserResolver {
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
})
/* uncomment this, when you need the activation link on the console */
// In case EMails are disabled log the activation link for the user
if (!emailSent) {
logger.debug(
`Reset password link: ${activationLink(user.emailContact.emailVerificationCode)}`,
)
}
logger.info(`forgotPassword(${email}) successful...`)
await EVENT_EMAIL_FORGOT_PASSWORD(user)
@ -804,7 +789,7 @@ export class UserResolver {
await user.emailContact.save()
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emailSent = await sendAccountActivationEmail({
void sendAccountActivationEmail({
firstName: user.firstName,
lastName: user.lastName,
email,
@ -813,10 +798,6 @@ export class UserResolver {
timeDurationObject: getTimeDurationObject(CONFIG.EMAIL_CODE_VALID_TIME),
})
// In case EMails are disabled log the activation link for the user
if (!emailSent) {
logger.info(`Account confirmation link: ${activationLink}`)
}
await EVENT_EMAIL_ADMIN_CONFIRMATION(user, getUser(context))
return true

View File

@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { Decimal } from 'decimal.js-light'
import { cleanDB, testEnvironment, contributionDateFormatter } from '@test/helpers'
@ -23,8 +22,12 @@ import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
import { peterLustig } from '@/seeds/users/peter-lustig'
let mutate: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'], con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment()

View File

@ -1,11 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { Connection } from '@dbTools/typeorm'
import { Contribution } from '@entity/Contribution'
import { User } from '@entity/User'
import { ApolloServerTestClient } from 'apollo-server-testing'
import { testEnvironment, cleanDB, contributionDateFormatter } from '@test/helpers'
@ -16,8 +12,12 @@ import { peterLustig } from '@/seeds/users/peter-lustig'
import { getUserCreation } from './creations'
let mutate: any, con: any
let testEnv: any
let mutate: ApolloServerTestClient['mutate'], con: Connection
let testEnv: {
mutate: ApolloServerTestClient['mutate']
query: ApolloServerTestClient['query']
con: Connection
}
beforeAll(async () => {
testEnv = await testEnvironment()

View File

@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { CONFIG } from './config'
import { startValidateCommunities } from './federation/validateCommunities'
import { createServer } from './server/createServer'

View File

@ -2,9 +2,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Contribution } from '@entity/Contribution'
import { Transaction } from '@entity/Transaction'
import { ApolloServerTestClient } from 'apollo-server-testing'
@ -12,7 +9,6 @@ import { ApolloServerTestClient } from 'apollo-server-testing'
import { findUserByEmail } from '@/graphql/resolver/UserResolver'
import { CreationInterface } from '@/seeds/creation/CreationInterface'
import { login, createContribution, confirmContribution } from '@/seeds/graphql/mutations'
// import CONFIG from '@/config/index'
export const nMonthsBefore = (date: Date, months = 1): string => {
return new Date(date.getFullYear(), date.getMonth() - months, 1).toISOString()

View File

@ -1,10 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { entities } from '@entity/index'
import { createTestClient } from 'apollo-server-testing'
import { name, internet, datatype } from 'faker'
@ -43,10 +36,12 @@ export const cleanDB = async () => {
}
}
const resetEntity = async (entity: any) => {
const [entityTypes] = entities
const resetEntity = async (entity: typeof entityTypes) => {
const items = await entity.find({ withDeleted: true })
if (items.length > 0) {
const ids = items.map((i: any) => i.id)
const ids = items.map((i) => i.id)
await entity.delete(ids)
}
}

View File

@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
import { logger } from '@test/testSetup'
import { LogError } from './LogError'

View File

@ -13,6 +13,7 @@ export interface Context {
role?: Role
user?: dbUser
clientTimezoneOffset?: number
gradidoID?: string
// hack to use less DB calls for Balance Resolver
lastTransaction?: dbTransaction
transactionCount?: number

View File

@ -5,7 +5,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import clonedeep from 'lodash.clonedeep'
const setHeadersPlugin = {

View File

@ -1,12 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { entities } from '@entity/index'
import { createTestClient } from 'apollo-server-testing'
@ -15,6 +7,7 @@ import { createServer } from '@/server/createServer'
import { i18n, logger } from './testSetup'
export const headerPushMock = jest.fn((t) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
context.token = t.value
})
@ -34,7 +27,7 @@ export const cleanDB = async () => {
}
}
export const testEnvironment = async (testLogger: any = logger, testI18n: any = i18n) => {
export const testEnvironment = async (testLogger = logger, testI18n = i18n) => {
const server = await createServer(context, testLogger, testI18n)
const con = server.con
const testClient = createTestClient(server.apollo)
@ -43,10 +36,12 @@ export const testEnvironment = async (testLogger: any = logger, testI18n: any =
return { mutate, query, con }
}
export const resetEntity = async (entity: any) => {
const [entityTypes] = entities
export const resetEntity = async (entity: typeof entityTypes) => {
const items = await entity.find({ withDeleted: true })
if (items.length > 0) {
const ids = items.map((i: any) => i.id)
const ids = items.map((i) => i.id)
await entity.delete(ids)
}
}

View File

@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import { CONFIG } from '@/config'
import { i18n } from '@/server/localization'
import { backendLogger as logger } from '@/server/logger'
@ -10,7 +8,7 @@ CONFIG.EMAIL_TEST_MODUS = false
jest.setTimeout(1000000)
jest.mock('@/server/logger', () => {
const originalModule = jest.requireActual('@/server/logger')
const originalModule = jest.requireActual<typeof logger>('@/server/logger')
return {
__esModule: true,
...originalModule,
@ -27,7 +25,7 @@ jest.mock('@/server/logger', () => {
})
jest.mock('@/server/localization', () => {
const originalModule = jest.requireActual('@/server/localization')
const originalModule = jest.requireActual<typeof i18n>('@/server/localization')
return {
__esModule: true,
...originalModule,

View File

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

View File

@ -58,7 +58,8 @@ WEBHOOK_ELOPAGE_SECRET=secret
# Federation
FEDERATION_DHT_CONFIG_VERSION=v2.2023-02-07
# if you set the value of FEDERATION_DHT_TOPIC, the DHT hyperswarm will start to announce and listen on an hash created from this topic
# if you set the value of FEDERATION_DHT_TOPIC, the DHT hyperswarm will start to announce and listen
# on an hash created from this topic
# FEDERATION_DHT_TOPIC=GRADIDO_HUB
# FEDERATION_DHT_SEED=64ebcb0e3ad547848fef4197c6e2332f
FEDERATION_COMMUNITY_URL=http://stage1.gradido.net

View File

@ -198,11 +198,9 @@ Follow the commands in `./install.sh` as installation pattern.
## Define Cronjob To Compensate Yarn Output In `/tmp`
`yarn` creates output in `/tmp` directory, which must be deleted regularly and will be done per Cron-Job.
`yarn` creates output in `/tmp` directory. This output is generated whenever `yarn start` is called. This is especially problematic on staging systems where instable versions are automatically deployed which can lead to an ever restarting, hence generating a lot of yarn output.
### On `stage1`
An hourly job is necessary on `stage1` by setting the following job in the `crontab` for the `gradido` user.
To solve this you can install the following hourly cron using `crontab` as `gradido` user.
Run:
@ -213,24 +211,11 @@ crontab -e
This opens the crontab in edit-mode and insert the following entry:
```bash
0 * * * * find /tmp -name "yarn--*" -cmin +60 -exec rm -r {} \; > /dev/null
0 * * * * find /tmp -name "yarn--*" -exec rm -r {} \; > /dev/null
```
### On `stage2`
A daily job is necessary on `stage2` by setting the following job in the `crontab` for the `gradido` user.
Run:
```bash
crontab -e
```
This opens the `crontab` in edit-mode and insert the following entry:
```bash
0 4 * * * find /tmp -name "yarn--*" -ctime +1 -exec rm -r {} \; > /dev/null
```
For production systems this is not needed by default since the yarn output is deleted when `start.sh` is executed. If the service runs stable and does not restart frequently, the yarn output to the tmp folder scales with the amount of services running.
## Define Cronjob To start backup script automatically

View File

@ -9,6 +9,9 @@ DB_DATABASE=gradido_community
TYPEORM_LOGGING_RELATIVE_PATH=$TYPEORM_LOGGING_RELATIVE_PATH
# Federation
FEDERATION_DHT_CONFIG_VERSION=$FEDERATION_DHT_CONFIG_VERSION
# if you set the value of FEDERATION_DHT_TOPIC, the DHT hyperswarm will start to announce and listen
# on an hash created from this topic
FEDERATION_DHT_TOPIC=$FEDERATION_DHT_TOPIC
FEDERATION_DHT_SEED=$FEDERATION_DHT_SEED
FEDERATION_COMMUNITY_URL=$FEDERATION_COMMUNITY_URL

View File

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

View File

@ -2194,9 +2194,9 @@ crypto-browserify@^3.0.0:
randomfill "^1.0.3"
cypress@^12.7.0:
version "12.9.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.9.0.tgz#e6ab43cf329fd7c821ef7645517649d72ccf0a12"
integrity sha512-Ofe09LbHKgSqX89Iy1xen2WvpgbvNxDzsWx3mgU1mfILouELeXYGwIib3ItCwoRrRifoQwcBFmY54Vs0zw7QCg==
version "12.8.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.8.1.tgz#0c6e67f34554d553138697aaf349b637d80004eb"
integrity sha512-lIFbKdaSYAOarNLHNFa2aPZu6YSF+8UY4VRXMxJrFUnk6RvfG0AWsZ7/qle/aIz30TNUD4aOihz2ZgS4vuQVSA==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4"

View File

@ -13,3 +13,6 @@ DB_DATABASE=gradido_community
# Federation
FEDERATION_COMMUNITY_URL=$FEDERATION_COMMUNITY_URL
FEDERATION_CONFIG_VERSION=$FEDERATION_CONFIG_VERSION
# comma separated list of api-versions, which cause starting several federation modules
FEDERATION_COMMUNITY_APIS=$FEDERATION_COMMUNITY_APIS

View File

@ -1,6 +1,6 @@
{
"name": "gradido-federation",
"version": "1.0.0",
"version": "1.20.0",
"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",
@ -45,14 +45,16 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"jest": "27.2.4",
"nodemon": "^2.0.7",
"prettier": "^2.3.1",
"ts-jest": "27.0.5",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.1",
"nodemon": "^2.0.7",
"prettier": "^2.3.1",
"typescript": "^4.3.4"
},
"nodemonConfig": {
"ignore": ["**/*.test.ts"]
"ignore": [
"**/*.test.ts"
]
}
}

View File

@ -1,6 +1,6 @@
{
"name": "bootstrap-vue-gradido-wallet",
"version": "1.19.1",
"version": "1.20.0",
"private": true,
"scripts": {
"start": "node run/server.js",
@ -26,6 +26,7 @@
"bootstrap": "^4.5.3",
"bootstrap-vue": "^2.21.2",
"clipboard-polyfill": "^4.0.0-rc1",
"date-fns": "^2.29.3",
"es6-promise": "^4.1.1",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.1.0",
@ -58,7 +59,6 @@
"vue-i18n": "^8.22.4",
"vue-jest": "^3.0.7",
"vue-loading-overlay": "^3.4.2",
"vue-moment": "^4.1.0",
"vue-router": "^3.0.6",
"vue-timers": "^2.0.4",
"vue2-transitions": "^0.2.3",

View File

@ -49,8 +49,8 @@
<b-row>
<b-col>
<b-row>
<b-col cols="12">
<div v-if="radioSelected === sendTypes.send && !gradidoID">
<b-col cols="12" v-if="radioSelected === sendTypes.send">
<div v-if="!gradidoID">
<input-email
:name="$t('form.recipient')"
:label="$t('form.recipient')"
@ -60,7 +60,7 @@
@onValidation="onValidation"
/>
</div>
<div v-else-if="gradidoID" class="mb-4">
<div v-else class="mb-4">
<b-row>
<b-col>{{ $t('form.recipient') }}</b-col>
</b-row>
@ -130,6 +130,7 @@ import InputEmail from '@/components/Inputs/InputEmail'
import InputAmount from '@/components/Inputs/InputAmount'
import InputTextarea from '@/components/Inputs/InputTextarea'
import { user as userQuery } from '@/graphql/queries'
import { isEmpty } from 'lodash'
export default {
name: 'TransactionForm',
@ -176,7 +177,8 @@ export default {
this.form.amount = ''
this.form.memo = ''
this.$refs.formValidator.validate()
if (this.$route.query && !this.$route.query === {}) this.$router.replace({ query: undefined })
if (this.$route.query && !isEmpty(this.$route.query))
this.$router.replace({ query: undefined })
},
},
apollo: {

View File

@ -5,12 +5,17 @@
<div>{{ $t('decay.past_time') }}</div>
</b-col>
<b-col offset="1" offset-md="0" offset-lg="0" class="text-right mr-5">
<span v-if="duration">{{ durationText }}</span>
<span v-if="duration">{{ duration }}</span>
</b-col>
</b-row>
</div>
</template>
<script>
import { formatDistance } from 'date-fns'
import { en, de, es, fr, nl } from 'date-fns/locale'
const locales = { en, de, es, fr, nl }
export default {
name: 'DurationRow',
props: {
@ -25,19 +30,9 @@ export default {
},
computed: {
duration() {
return this.$moment.duration(new Date(this.decayEnd) - new Date(this.decayStart))._data
},
durationText() {
const order = ['years', 'months', 'days', 'hours', 'minutes', 'seconds']
const result = []
order.forEach((timeSpan) => {
if (this.duration[timeSpan] > 0) {
// eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys
const locale = this.$t(`time.${timeSpan}`)
result.push(`${this.duration[timeSpan]} ${locale}`)
}
return formatDistance(new Date(this.decayEnd), new Date(this.decayStart), {
locale: locales[this.$i18n.locale],
})
return result.join(', ')
},
},
}

View File

@ -8,11 +8,9 @@ const routerPushMock = jest.fn()
const mocks = {
$router: {
push: routerPushMock,
history: {
current: {
fullPath: '/transactions',
},
},
},
$route: {
path: '/transactions',
},
}

View File

@ -34,8 +34,8 @@ export default {
},
},
methods: {
tunnelEmail() {
if (this.$router.history.current.fullPath !== '/send') this.$router.push({ path: '/send' })
async tunnelEmail() {
if (this.$route.path !== '/send') await this.$router.push({ path: '/send' })
this.$router.push({ query: { gradidoID: this.linkedUser.gradidoID } })
},
},

View File

@ -98,7 +98,6 @@ const dateTimeFormats = {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
@ -130,7 +129,6 @@ const dateTimeFormats = {
day: 'numeric',
month: 'long',
year: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
@ -162,7 +160,6 @@ const dateTimeFormats = {
day: 'numeric',
month: 'long',
year: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},
@ -194,7 +191,6 @@ const dateTimeFormats = {
day: 'numeric',
month: 'long',
year: 'numeric',
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
},

View File

@ -72,6 +72,7 @@ describe('Community', () => {
messagesCount: 0,
deniedAt: null,
deniedBy: null,
moderatorId: null,
},
{
id: 1550,
@ -88,6 +89,7 @@ describe('Community', () => {
messagesCount: 0,
deniedAt: null,
deniedBy: null,
moderatorId: null,
},
],
contributionCount: 1,

View File

@ -196,7 +196,9 @@ export default {
methods: {
updateTabIndex() {
const index = COMMUNITY_TABS.indexOf(this.$route.params.tab)
this.tabIndex = index > -1 ? index : 0
this.$nextTick(() => {
this.tabIndex = index > -1 ? index : 0
})
this.closeAllOpenCollapse()
},
closeAllOpenCollapse() {

View File

@ -11,8 +11,6 @@ import '@/assets/scss/gradido.scss'
import FlatPickr from 'vue-flatpickr-component'
import 'flatpickr/dist/flatpickr.css'
import VueMoment from 'vue-moment'
import Loading from 'vue-loading-overlay'
import 'vue-loading-overlay/dist/vue-loading.css'
@ -26,7 +24,6 @@ export default {
Vue.use(GlobalDirectives)
Vue.use(BootstrapVue)
Vue.use(IconsPlugin)
Vue.use(VueMoment)
Vue.use(PortalVue)
Vue.use(FlatPickr)
Vue.use(Loading)

View File

@ -10,8 +10,6 @@ import { messages } from 'vee-validate/dist/locale/en.json'
import RegeneratorRuntime from 'regenerator-runtime'
import VueTimers from 'vue-timers'
import VueMoment from 'vue-moment'
// import clickOutside from '@/directives/click-ouside.js'
import { focus } from 'vue-focus'
@ -47,7 +45,6 @@ global.localVue.use(BootstrapVue)
global.localVue.use(Vuex)
global.localVue.use(IconsPlugin)
global.localVue.use(RegeneratorRuntime)
global.localVue.use(VueMoment)
global.localVue.use(VueTimers)
global.localVue.component('validation-provider', ValidationProvider)
global.localVue.component('validation-observer', ValidationObserver)

View File

@ -5557,6 +5557,11 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
date-fns@^2.29.3:
version "2.29.3"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8"
integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==
de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
@ -10324,11 +10329,6 @@ mock-apollo-client@^1.2.1:
resolved "https://registry.yarnpkg.com/mock-apollo-client/-/mock-apollo-client-1.2.1.tgz#e3bfdc3ff73b1fea28fa7e91ec82e43ba8cbfa39"
integrity sha512-QYQ6Hxo+t7hard1bcHHbsHxlNQYTQsaMNsm2Psh/NbwLMi2R4tGzplJKt97MUWuARHMq3GHB4PTLj/gxej4Caw==
moment@^2.19.2:
version "2.29.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
moo-color@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/moo-color/-/moo-color-1.0.2.tgz#837c40758d2d58763825d1359a84e330531eca64"
@ -14386,13 +14386,6 @@ vue-loading-overlay@^3.4.2:
resolved "https://registry.yarnpkg.com/vue-loading-overlay/-/vue-loading-overlay-3.4.2.tgz#34792a83218df1d35dff50121ce9fac2114f1c38"
integrity sha512-xcB+NPjl76eA0uggm707x3ZFgrNosZXpynHipyS3K+rrK1NztOV49R1LY+/4ij5W1KYANp7eRI2EIHrxCpmWAw==
vue-moment@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/vue-moment/-/vue-moment-4.1.0.tgz#092a8ff723a96c6f85a0a8e23ad30f0bf320f3b0"
integrity sha512-Gzisqpg82ItlrUyiD9d0Kfru+JorW2o4mQOH06lEDZNgxci0tv/fua1Hl0bo4DozDV2JK1r52Atn/8QVCu8qQw==
dependencies:
moment "^2.19.2"
vue-router@^3.0.6:
version "3.5.1"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.1.tgz#edf3cf4907952d1e0583e079237220c5ff6eb6c9"

View File

@ -2,8 +2,3 @@
# mariadb server
#########################################################################################################
FROM mariadb/server:10.5 as mariadb_server
# ENV DOCKER_WORKDIR="/docker-entrypoint-initdb.d"
# RUN mkdir -p ${DOCKER_WORKDIR}
# WORKDIR ${DOCKER_WORKDIR}

View File

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