Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/updated-docker-image-on-forms-ba…
Browse files Browse the repository at this point in the history
…ckend' into updated-docker-image-on-forms-backend
  • Loading branch information
skifahrer committed Sep 24, 2024
2 parents f7c0001 + d4b3722 commit 60ee4f8
Show file tree
Hide file tree
Showing 38 changed files with 3,620 additions and 718 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-conditions-konto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
jobs:
changes:
name: Checking for directory changes in repository
runs-on: ubuntu-latest
runs-on: ["self-hosted", "Linux", "X64", "bratislava"]
outputs:
forms-shared: ${{ steps.filter.outputs.forms-shared }}
next: ${{ steps.filter.outputs.next }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
conditions:
name: Checking build conditions
needs: changes
runs-on: ubuntu-latest
runs-on: ["self-hosted", "Linux", "X64", "bratislava"]
env:
COUNT: 0
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cluster-deploy-conditions-konto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ on:
jobs:
conditions:
name: Checking konto deployment conditions
runs-on: ubuntu-latest
runs-on: ["self-hosted", "Linux", "X64", "bratislava"]
env:
COUNT: 0
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build-forms-shared:
name: Build and push specific forms-shared image
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: forms-shared/
build_image_no_registry: ''
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/validate-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

build-forms-shared:
name: Build image of forms-shared and push it to harbor
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: forms-shared/
build_image_no_registry: ''
Expand All @@ -39,7 +39,7 @@ jobs:
name: build next
needs: [conditions, validate-next]
if: needs.conditions.outputs.next == 'true' || needs.conditions.outputs.forms-shared == 'true'
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: next/
build_arg: '--build_arg="FORMS_SHARED_TAG=${{ github.sha }}"'
Expand All @@ -52,7 +52,7 @@ jobs:
name: build Strapi
needs: conditions
if: needs.conditions.outputs.strapi == 'true'
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: strapi/
debug: --debug
Expand All @@ -71,7 +71,7 @@ jobs:
name: build nest-forms-backend
needs: [conditions, validate-nest-forms-backend]
if: needs.conditions.outputs.nest-forms-backend == 'true' || needs.conditions.outputs.forms-shared == 'true'
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: nest-forms-backend/
build_arg: '--build_arg="FORMS_SHARED_TAG=${{ github.sha }}"'
Expand All @@ -92,7 +92,7 @@ jobs:
name: build nest-clamav-scanner
needs: [conditions, validate-nest-clamav-scanner]
if: needs.conditions.outputs.nest-clamav-scanner == 'true'
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli.yml@stable
uses: bratislava/github-actions/.github/workflows/build-with-bratiska-cli-inhouse.yml@stable
with:
directory: nest-clamav-scanner/
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-forms-shared-konto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
test:
name: Forms-shared tests
runs-on: ubuntu-latest
runs-on: ["self-hosted", "Linux", "X64", "bratislava"]
defaults:
run:
working-directory: ${{ inputs.directory }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-nest-prisma-konto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
jobs:
test:
name: Unit tests and lint
runs-on: ubuntu-latest
runs-on: ["self-hosted", "Linux", "X64", "bratislava"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
44 changes: 11 additions & 33 deletions forms-shared/src/definitions/devFormDefinitions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { FormDefinition, FormDefinitionType } from './formDefinitionTypes'
import { generalTermsAndConditions } from './termsAndConditions'
import mimoriadnyOdvozALikvidaciaOdpadu from '../schemas/olo/mimoriadnyOdvozALikvidaciaOdpadu'
import zevoMechanickaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia from '../schemas/olo/zevoMechanickaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia'
import zevoRucnaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia from '../schemas/olo/zevoRucnaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia'
import zevoPodrvenieAZhodnotenieOdpaduVysypanimDoZasobnika from '../schemas/olo/zevoPodrvenieAZhodnotenieOdpaduVysypanimDoZasobnika'
import zevoUzatvorenieZmluvyONakladaniSOdpadom from '../schemas/olo/zevoUzatvorenieZmluvyONakladaniSOdpadom'
import mimoriadnyOdvozAZhodnotenieOdpadu from '../schemas/olo/mimoriadnyOdvozAZhodnotenieOdpadu'
import energetickeZhodnotenieOdpaduVZevo from '../schemas/olo/energetickeZhodnotenieOdpaduVZevo'
import uzatvorenieZmluvyONakladaniSOdpadom from '../schemas/olo/uzatvorenieZmluvyONakladaniSOdpadom'
import docisteniStanovistaZbernychNadob from '../schemas/olo/docisteniStanovistaZbernychNadob'
import odvozOdpaduVelkokapacitnymAleboLisovacimKontajnerom from '../schemas/olo/odvozOdpaduVelkokapacitnymAleboLisovacimKontajnerom'
import koloTaxi from '../schemas/olo/koloTaxi'
Expand All @@ -17,49 +15,29 @@ import triedenyZberPapieraPlastovASklaPreSpravcovskeSpolocnosti from '../schemas
export const devFormDefinitions: FormDefinition[] = [
{
type: FormDefinitionType.Email,
slug: 'olo-mimoriadny-odvoz-a-likvidacia-odpadu',
title: 'Mimoriadny odvoz a likvidácia odpadu',
schemas: mimoriadnyOdvozALikvidaciaOdpadu,
slug: 'olo-mimoriadny-odvoz-a-zhodnotenie-odpadu',
title: 'Mimoriadny odvoz a zhodnotenie odpadu',
schemas: mimoriadnyOdvozAZhodnotenieOdpadu,
email: '',
termsAndConditions: generalTermsAndConditions,
messageSubjectDefault: '',
embedded: 'olo',
},
{
type: FormDefinitionType.Email,
slug: 'olo-zevo-mechanicka-vykladka-a-zhodnotenie-odpadu-podla-integrovaneho-povolenia',
title: 'Mechanická vykládka a zhodnotenie odpadu podľa integrovaného povolenia',
schemas: zevoMechanickaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia,
slug: 'olo-energeticke-zhodnotenie-odpadu-v-zevo',
title: 'Energetické zhodnotenie odpadu v ZEVO',
schemas: energetickeZhodnotenieOdpaduVZevo,
email: '',
termsAndConditions: generalTermsAndConditions,
messageSubjectDefault: '',
embedded: 'olo',
},
{
type: FormDefinitionType.Email,
slug: 'olo-zevo-rucna-vykladka-a-zhodnotenie-odpadu-podla-integrovaneho-povolenia',
title: 'Ručná vykládka a zhodnotenie odpadu podľa integrovaného povolenia',
schemas: zevoRucnaVykladkaAZhodnotenieOdpaduPodlaIntegrovanehoPovlenia,
email: '',
termsAndConditions: generalTermsAndConditions,
messageSubjectDefault: '',
embedded: 'olo',
},
{
type: FormDefinitionType.Email,
slug: 'olo-zevo-podrvenie-a-zhodnotenie-odpadu-vysypanim-do-zasobnika',
title: 'Podrvenie a zhodnotenie odpadu vysypaním do zásobníka',
schemas: zevoPodrvenieAZhodnotenieOdpaduVysypanimDoZasobnika,
email: '',
termsAndConditions: generalTermsAndConditions,
messageSubjectDefault: '',
embedded: 'olo',
},
{
type: FormDefinitionType.Email,
slug: 'olo-zevo-uzatvorenie-zmluvy-o-nakladani-s-odpadom',
slug: 'olo-uzatvorenie-zmluvy-o-nakladani-s-odpadom',
title: 'Uzatvorenie zmluvy o nakladaní s odpadom',
schemas: zevoUzatvorenieZmluvyONakladaniSOdpadom,
schemas: uzatvorenieZmluvyONakladaniSOdpadom,
email: '',
termsAndConditions: generalTermsAndConditions,
messageSubjectDefault: '',
Expand Down
12 changes: 9 additions & 3 deletions forms-shared/src/generator/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,21 @@ export const schema = (
description?: string
},
uiOptions: SchemaUiOptions,
steps: ReturnType<typeof step | typeof conditionalStep>[],
steps: (ReturnType<typeof step | typeof conditionalStep> | null)[],
): Schemas => {
const filteredSteps = steps.filter((stepInner) => stepInner != null) as ReturnType<
typeof step | typeof conditionalStep
>[]

return {
schema: removeUndefinedValues({
...options,
allOf: steps.map((stepInner) => stepInner.schema),
allOf: filteredSteps.map((stepInner) => stepInner.schema),
}) as RJSFSchema,
uiSchema: removeUndefinedValues({
...Object.fromEntries(steps.map((stepInner) => [stepInner.property, stepInner.uiSchema])),
...Object.fromEntries(
filteredSteps.map((stepInner) => [stepInner.property, stepInner.uiSchema]),
),
'ui:options': uiOptions,
'ui:hideError': true,
}) as UiSchema,
Expand Down
197 changes: 195 additions & 2 deletions forms-shared/src/schemas/olo/docisteniStanovistaZbernychNadob.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,198 @@
import { schema, step } from '../../generator/functions'
import {
checkbox,
conditionalFields,
customComponentsField,
datePicker,
input,
object,
radioGroup,
schema,
select,
step,
textArea,
} from '../../generator/functions'
import { createCondition, createStringOptions } from '../../generator/helpers'
import { sharedAddressField, sharedPhoneNumberField } from '../shared/fields'

export default schema({ title: 'Dočistenie stanovišťa zberných nádob' }, {}, [
step('ziadatel', { title: 'Žiadateľ' }, []),
step('ziadatel', { title: 'Žiadateľ' }, [
radioGroup(
'ziadatelTyp',
{
type: 'string',
title: 'Žiadateľ',
required: true,
options: createStringOptions(['Obyvateľ', 'Právnická osoba', 'Správcovská spoločnosť']),
},
{ variant: 'boxed', orientations: 'column' },
),
conditionalFields(createCondition([[['ziadatelTyp'], { const: 'Obyvateľ' }]]), [
object(
'menoPriezvisko',
{ required: true },
{
columns: true,
columnsRatio: '1/1',
},
[
input('meno', { title: 'Meno', required: true, type: 'text' }, {}),
input('priezvisko', { title: 'Priezvisko', required: true, type: 'text' }, {}),
],
),
sharedAddressField('adresaObyvatel', 'Adresa trvalého pobytu', true),
]),
conditionalFields(
createCondition([[['ziadatelTyp'], { enum: ['Právnická osoba', 'Správcovská spoločnosť'] }]]),
[
input('nazov', { type: 'text', title: 'Názov organizácie', required: true }, {}),
sharedAddressField('adresaPravnickaOsoba', 'Adresa sídla', true),
input('ico', { type: 'text', title: 'IČO', required: true }, {}),
input('dic', { type: 'text', title: 'DIČ', required: true }, {}),
checkbox(
'platcaDph',
{ title: 'Som platca DPH?', required: true },
{ checkboxLabel: 'Som platca DPH?', variant: 'boxed' },
),
conditionalFields(createCondition([[['platcaDph'], { const: true }]]), [
input('icDph', { type: 'text', title: 'IČ DPH', required: true }, {}),
]),
],
),
conditionalFields(createCondition([[['ziadatelTyp'], { const: 'Právnická osoba' }]]), [
input('konatel', { type: 'text', title: 'Konateľ (meno, priezvisko)', required: true }, {}),
input(
'zastupeny',
{ type: 'text', title: 'Zastúpený - na základe splnomocnenia (meno, priezvisko)' },
{},
),
]),
conditionalFields(
createCondition([[['ziadatelTyp'], { enum: ['Právnická osoba', 'Správcovská spoločnosť'] }]]),
[
input(
'kontaktnaOsoba',
{ type: 'text', title: 'Meno kontaktnej osoby', required: true },
{},
),
],
),
sharedPhoneNumberField('telefon', true),
conditionalFields(
createCondition([[['ziadatelTyp'], { enum: ['Právnická osoba', 'Správcovská spoločnosť'] }]]),
[input('email', { title: 'E-mail', required: true, type: 'email' }, {})],
),
conditionalFields(createCondition([[['ziadatelTyp'], { enum: ['Obyvateľ'] }]]), [
input('emailObyvatel', { title: 'E-mail', type: 'email' }, {}),
]),
object('fakturacia', { required: true }, { objectDisplay: 'boxed', title: 'Fakturácia' }, [
input('iban', { type: 'ba-iban', title: 'IBAN', required: true }, {}),
checkbox(
'elektronickaFaktura',
{
title: 'Zasielanie faktúry elektronicky',
required: true,
},
{
helptextHeader:
'V prípade vyjadrenia nesúhlasu bude zákazníkovi za zasielanie faktúry poštou účtovaný poplatok 10 € bez DPH. Osobitné ustanovenia o zasielaní faktúry v elektronickej podobe v zmysle bodu 5.9 VOP.',
checkboxLabel: 'Súhlasím so zaslaním elektronickej fakúry',
variant: 'boxed',
},
),
conditionalFields(createCondition([[['elektronickaFaktura'], { const: true }]]), [
input(
'emailPreFaktury',
{
type: 'email',
title: 'E-mail pre zasielanie elektronických faktúr',
required: true,
},
{},
),
]),
]),
]),
step('sluzba', { title: 'Služba' }, [
input(
'miestoDodania',
{
type: 'text',
title: 'Miesto dodania / výkonu služby',
required: true,
},
{
helptextHeader: 'Presná adresa',
},
),
select(
'komodita',
{
title: 'Vyberte komoditu',
required: true,
options: createStringOptions(
[
'Papier',
'Plast',
'Zmesový komunálny odpad',
'Kuchynský biologicky rozložiteľný odpad',
'Biologicky rozložiteľný odpad',
],
false,
),
},
{
helptextHeader: 'Poplatok je účtovaný za množstvo naložených a vysypaných nádob',
},
),
datePicker(
'preferovanyDatum',
{
title: 'Preferovaný dátum vykonania služby',
required: true,
},
{
helptextHeader:
'Vami zvolený dátum má iba informačný charakter. Objednávku je potrebné podať minimálne 2 pracovné dni pred zvoleným termínom. V prípade, ak vami zvolený termín nebude voľný, budeme vás kontaktovať.',
size: 'medium',
},
),
textArea(
'doplnujuceInfo',
{
title: 'Doplňujúce info',
required: true,
},
{
helptextHeader: 'Špecifikujte individuálne požiadavky.',
},
),
]),
step('suhlasy', { title: 'Súhlasy' }, [
checkbox(
'suhlas',
{
title: 'Súhlas s TODO',
required: true,
constValue: true,
},
{
checkboxLabel: 'Súhlasím s TODO',
variant: 'boxed',
},
),
customComponentsField(
{
type: 'additionalLinks',
props: {
links: [
{
title: 'TODO',
href: 'https://olo.sk',
},
],
},
},
{},
),
]),
])
Loading

0 comments on commit 60ee4f8

Please sign in to comment.