From 75f576f3ab0868800deda5d4713607492228d40e Mon Sep 17 00:00:00 2001 From: Nicolas N Date: Tue, 4 Jun 2024 10:12:37 +0200 Subject: [PATCH] EY-3728 Tom mal for notat (#268) * EY-3728 Tom mal for notat * tillate brev-api i pdfgen --- apps/ey-pdfgen/.nais/dev.yaml | 2 +- apps/ey-pdfgen/.nais/prod.yaml | 2 +- apps/ey-pdfgen/data/notat/tom_mal.json | 73 ++++++++++++++++++++++ apps/ey-pdfgen/templates/notat/tom_mal.hbs | 59 +++++++++++++++++ 4 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 apps/ey-pdfgen/data/notat/tom_mal.json create mode 100644 apps/ey-pdfgen/templates/notat/tom_mal.hbs diff --git a/apps/ey-pdfgen/.nais/dev.yaml b/apps/ey-pdfgen/.nais/dev.yaml index 188dfda2..e4aaf88c 100644 --- a/apps/ey-pdfgen/.nais/dev.yaml +++ b/apps/ey-pdfgen/.nais/dev.yaml @@ -32,5 +32,5 @@ spec: accessPolicy: inbound: rules: - - application: journalfoer-soeknad - application: etterlatte-gyldig-soeknad + - application: etterlatte-brev-api diff --git a/apps/ey-pdfgen/.nais/prod.yaml b/apps/ey-pdfgen/.nais/prod.yaml index 03b04bb2..9a7e3541 100644 --- a/apps/ey-pdfgen/.nais/prod.yaml +++ b/apps/ey-pdfgen/.nais/prod.yaml @@ -30,5 +30,5 @@ spec: accessPolicy: inbound: rules: - - application: journalfoer-soeknad - application: etterlatte-gyldig-soeknad + - application: etterlatte-brev-api diff --git a/apps/ey-pdfgen/data/notat/tom_mal.json b/apps/ey-pdfgen/data/notat/tom_mal.json new file mode 100644 index 00000000..f10ce06d --- /dev/null +++ b/apps/ey-pdfgen/data/notat/tom_mal.json @@ -0,0 +1,73 @@ +{ + "tittel" : "En slags tittel", + "payload" : [ + { + "type" : "heading-three", + "children" : [ + { + "type" : "paragraph", + "text" : "En tittel" + } + ] + }, + { + "type" : "paragraph", + "children" : [ + { + "type" : "paragraph", + "text" : "Med litt diverse tekst. Ikke mye spennende her. " + } + ] + }, + { + "type" : "heading-three", + "children" : [ + { + "type" : "paragraph", + "text" : "Tittel over liste" + } + ] + }, + { + "type" : "bulleted-list", + "children" : [ + { + "type" : "list-item", + "children" : [ + { + "type" : "paragraph", + "text" : "Her" + } + ] + }, + { + "type" : "list-item", + "children" : [ + { + "type" : "paragraph", + "text" : "er" + } + ] + }, + { + "type" : "list-item", + "children" : [ + { + "type" : "paragraph", + "text" : "en" + } + ] + }, + { + "type" : "list-item", + "children" : [ + { + "type" : "paragraph", + "text" : "liste" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/apps/ey-pdfgen/templates/notat/tom_mal.hbs b/apps/ey-pdfgen/templates/notat/tom_mal.hbs new file mode 100644 index 00000000..5aacda71 --- /dev/null +++ b/apps/ey-pdfgen/templates/notat/tom_mal.hbs @@ -0,0 +1,59 @@ + + + + + {{> eypdfgen/partials_v2/style}} + {{ tittel }} + + + + + +
+ {{#each payload}} + {{#eq type "heading-two"}} + {{#each this.children}} +

{{ this.text }}

+ {{/each}} + {{/eq}} + + {{#eq type "heading-three"}} + {{#each this.children}} +

{{ this.text }}

+ {{/each}} + {{/eq}} + + {{#eq type "paragraph"}} + {{#each this.children}} + {{#eq this.type "bulleted-list"}} + + {{else}} +

{{this.text}}

+ {{/eq}} + {{/each}} + {{/eq}} + + {{#eq type "bulleted-list"}} + {{#each this.children}} + + {{/each}} + {{/eq}} + {{/each}} +
+ + +