build(frontend): merged code from master (#3367)

* fix

* fix test

* update docker compose call

* update e2e test

* change docker-compose to docker compose in all workflows

* use mariadb container with enabled external_network

* add sleep to test_database

* add maybe new parameter --service-ports needed for docker compose run else there weren't any open ports

* try another approach

* save change (._.);

* fix(frontend): fix e2e setup & add additional check in validation rules.

* fix(frontend): fix e2e setup

---------

Co-authored-by: einhornimmond <info@einhornimmond.de>
Co-authored-by: einhornimmond <dario.rekowski@gmx.de>
This commit is contained in:
MateuszMichalowski 2024-09-12 21:00:08 +02:00 committed by GitHub
parent e8277861ec
commit 45f4207537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 100 additions and 37 deletions

View File

@ -43,13 +43,13 @@ jobs:
uses: actions/checkout@v3
- name: Database | docker-compose
run: docker compose -f docker-compose.yml up --detach mariadb
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mariadb
- name: Database | up
run: docker compose -f docker-compose.yml run -T database yarn up
run: docker compose -f docker-compose.yml up --no-deps database
- name: Database | reset
run: docker compose -f docker-compose.yml run -T database yarn reset
run: docker compose -f docker-compose.yml -f docker-compose.reset.yml up --no-deps database
lint:
if: needs.files-changed.outputs.database == 'true'

View File

@ -71,14 +71,14 @@ jobs:
- name: Load Docker Image
run: docker load < /tmp/dht-node.tar
- name: docker compose mariadb
- name: 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: docker compose database
- name: docker-compose database
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database
- name: Sleep for 30 seconds

View File

@ -61,7 +61,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: DLT-Connector | docker compose mariadb
- name: DLT-Connector | 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

View File

@ -70,14 +70,14 @@ jobs:
- name: Load Docker Image
run: docker load < /tmp/federation.tar
- name: docker compose mariadb
- name: 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: docker compose database
- name: docker-compose database
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database
- name: Sleep for 30 seconds

View File

@ -8,7 +8,6 @@ export const updateContributionLink = gql`
$cycle: String!
$validFrom: String
$validTo: String
$maxAmountPerMonth: Decimal
$maxPerCycle: Int! = 1
$id: Int!
) {
@ -19,7 +18,6 @@ export const updateContributionLink = gql`
cycle: $cycle
validFrom: $validFrom
validTo: $validTo
maxAmountPerMonth: $maxAmountPerMonth
maxPerCycle: $maxPerCycle
id: $id
) {
@ -32,7 +30,6 @@ export const updateContributionLink = gql`
createdAt
validFrom
validTo
maxAmountPerMonth
cycle
maxPerCycle
}

View File

@ -3,8 +3,6 @@
# To use it it is required to explicitly define if you want to build with it:
# > docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.apple-m1.override.yml up
version: "3.4"
services:
########################################################
# FRONTEND #############################################

View File

@ -1,5 +1,3 @@
version: "3.4"
services:
########################################################

70
docker-compose.reset.yml Normal file
View File

@ -0,0 +1,70 @@
# This file defines the production settings. It is overwritten by docker-compose.override.yml,
# which defines the development settings. The override.yml is loaded by default. Therefore it
# is required to explicitly define if you want an production build:
# > docker-compose -f docker-compose.yml up
services:
########################################################
# DATABASE #############################################
########################################################
database:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: gradido/database:local-production_reset
build:
context: ./database
target: production_reset
depends_on:
- mariadb
networks:
- internal-net
- external-net # this is required to fetch the packages
environment:
# Envs used in Dockerfile
# - DOCKER_WORKDIR="/app"
- BUILD_DATE
- BUILD_VERSION
- BUILD_COMMIT
- NODE_ENV="production"
- DB_HOST=mariadb
# Application only envs
#env_file:
# - ./frontend/.env
########################################################
# DLT-DATABASE #############################################
########################################################
dlt-database:
# name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there
image: gradido/dlt-database:local-production_reset
build:
context: ./dlt-database
target: production_reset
depends_on:
- mariadb
networks:
- internal-net
- external-net # this is required to fetch the packages
environment:
# Envs used in Dockerfile
# - DOCKER_WORKDIR="/app"
- BUILD_DATE
- BUILD_VERSION
- BUILD_COMMIT
- NODE_ENV="production"
- DB_HOST=mariadb
# Application only envs
#env_file:
# - ./frontend/.env
networks:
external-net:
internal-net:
internal: true
volumes:
db_vol:

View File

@ -1,5 +1,3 @@
version: "3.4"
services:
########################################################
# FRONTEND #############################################

View File

@ -3,8 +3,6 @@
# is required to explicitly define if you want an production build:
# > docker-compose -f docker-compose.yml up
version: "3.4"
services:
########################################################
@ -67,7 +65,7 @@ services:
context: ./mariadb
target: mariadb_server
environment:
- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
- MARIADB_ALLOW_EMPTY_PASSWORD=1
- MARIADB_USER=root
networks:
- internal-net

1
e2e-tests/.nvmrc Normal file
View File

@ -0,0 +1 @@
v19.5.0

View File

@ -2,9 +2,9 @@
export class Toasts {
// selectors
toastSlot = '.b-toaster-slot'
toastTypeSuccess = '.b-toast-success'
toastTypeError = '.b-toast-danger'
toastSlot = '#__BVID__toaster-container'
toastTypeSuccess = '.toast.text-bg-success'
toastTypeError = '.toast.text-bg-danger'
toastTitle = '.gdd-toaster-title'
toastMessage = '.gdd-toaster-body'
}

View File

@ -42,6 +42,7 @@ When('the user enters the e-mail address {string}', (email: string) => {
When('the user submits the e-mail form', () => {
forgotPasswordPage.submitEmail()
cy.get(forgotPasswordPage.successComponent).debug()
cy.get(forgotPasswordPage.successComponent).should('be.visible')
})

View File

@ -7,7 +7,6 @@ const profilePage = new ProfilePage()
When('the user opens the change password menu', () => {
cy.get(profilePage.openChangePassword).click()
cy.get(profilePage.newPasswordRepeatInput).should('be.visible')
cy.get(profilePage.submitNewPasswordBtn).should('have.class','btn-light')
})
When('the user fills the password form with:', (table: DataTable) => {

View File

@ -71,27 +71,33 @@ export const loadAllRules = (i18nCallback, apollo) => {
})
defineRule('containsLowercaseCharacter', (value) => {
return !!value.match(/[a-z]+/) || i18nCallback.t('site.signup.lowercase')
const isMatch = value && !!value.match(/[a-z]+/)
return isMatch || i18nCallback.t('site.signup.lowercase')
})
defineRule('containsUppercaseCharacter', (value) => {
return !!value.match(/[A-Z]+/) || i18nCallback.t('site.signup.uppercase')
const isMatch = value && !!value.match(/[A-Z]+/)
return isMatch || i18nCallback.t('site.signup.uppercase')
})
defineRule('containsNumericCharacter', (value) => {
return !!value.match(/[0-9]+/) || i18nCallback.t('site.signup.one_number')
const isMatch = value && !!value.match(/[0-9]+/)
return isMatch || i18nCallback.t('site.signup.one_number')
})
defineRule('atLeastEightCharacters', (value) => {
return !!value.match(/.{8,}/) || i18nCallback.t('site.signup.minimum')
const isMatch = value && !!value.match(/.{8,}/)
return isMatch || i18nCallback.t('site.signup.minimum')
})
defineRule('atLeastOneSpecialCharacter', (value) => {
return !!value.match(/[^a-zA-Z0-9 \t\n\r]/) || i18nCallback.t('site.signup.special-char')
const isMatch = value && !!value.match(/[^a-zA-Z0-9 \t\n\r]/)
return isMatch || i18nCallback.t('site.signup.special-char')
})
defineRule('noWhitespaceCharacters', (value) => {
return !value.match(/[ \t\n\r]+/) || i18nCallback.t('site.signup.no-whitespace')
const isMatch = value && !value.match(/[ \t\n\r]+/)
return isMatch || i18nCallback.t('site.signup.no-whitespace')
})
defineRule('samePassword', (value, [pwd], ctx) => {
@ -99,16 +105,13 @@ export const loadAllRules = (i18nCallback, apollo) => {
})
defineRule('usernameAllowedChars', (value) => {
return (
!!value.match(/^[a-zA-Z0-9_-]+$/) || i18nCallback.t('form.validation.username-allowed-chars')
)
const isMatch = value && !!value.match(/^[a-zA-Z0-9_-]+$/)
return isMatch || i18nCallback.t('form.validation.username-allowed-chars')
})
defineRule('usernameHyphens', (value) => {
return (
!!value.match(/^[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+?)*$/) ||
i18nCallback.t('form.validation.username-hyphens')
)
const isMatch = value && !!value.match(/^[a-zA-Z0-9]+(?:[_-][a-zA-Z0-9]+?)*$/)
return isMatch || i18nCallback.t('form.validation.username-hyphens')
})
defineRule('usernameUnique', async (value) => {