Skip to content

Commit ed452f8

Browse files
committed
Legger til parametre for dekoratøren og oppdaterer Hotbff
1 parent 3c489fb commit ed452f8

File tree

6 files changed

+44
-19
lines changed

6 files changed

+44
-19
lines changed

client/vite.config.mts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,35 @@ const htmlPlugin = ({ development }: { development?: boolean }): Plugin => ({
99
if (development) {
1010
const decorator = await fetchDecoratorHtml({
1111
env: 'dev',
12-
context: 'samarbeidspartner',
13-
chatbot: false,
14-
language: 'nb',
15-
availableLanguages: [
16-
{
17-
locale: 'nb',
18-
handleInApp: true,
19-
},
20-
{
21-
locale: 'nn',
22-
handleInApp: true,
23-
},
24-
],
12+
params: {
13+
context: 'samarbeidspartner',
14+
chatbot: false,
15+
language: 'nb',
16+
availableLanguages: [
17+
{
18+
locale: 'nb',
19+
handleInApp: true,
20+
},
21+
{
22+
locale: 'nn',
23+
handleInApp: true,
24+
},
25+
],
26+
},
2527
})
28+
const {
29+
DECORATOR_HEAD_ASSETS: HeadAssets,
30+
DECORATOR_HEADER: Header,
31+
DECORATOR_FOOTER: Footer,
32+
DECORATOR_SCRIPTS: Scripts,
33+
} = decorator
2634
return {
27-
html: Mustache.render(html, decorator),
35+
html: Mustache.render(html.replace(/\{\{\./g, '{{{').replace(/\}\}/g, '}}}'), {
36+
HeadAssets,
37+
Header,
38+
Footer,
39+
Scripts,
40+
}),
2841
tags: [
2942
{
3043
tag: 'script',

server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hm-brilleactale-frontend

server/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module hm-brilleavtale-frontend
22

33
go 1.25.1
44

5-
require github.com/navikt/hotbff v0.0.0-20251001103456-d89b1ab1ab76 // indirect
5+
require github.com/navikt/hotbff v0.0.0-20251017082313-b08710c21fdc

server/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/navikt/hotbff v0.0.0-20251001103456-d89b1ab1ab76 h1:UhTprNGGFmivqFAex5ZA8GNlzdXoA+9gSoUv8AWVJ0o=
2-
github.com/navikt/hotbff v0.0.0-20251001103456-d89b1ab1ab76/go.mod h1:W8egrk/ttVU95TJeFlbqWGXgazM+t/WkUNiFeVO2z/A=
1+
github.com/navikt/hotbff v0.0.0-20251017082313-b08710c21fdc h1:VqJ3ntwBeIfNHcB7ZGKJTqfoGqNYuhQ7cmLUgjn2eTY=
2+
github.com/navikt/hotbff v0.0.0-20251017082313-b08710c21fdc/go.mod h1:W8egrk/ttVU95TJeFlbqWGXgazM+t/WkUNiFeVO2z/A=

server/hm-brilleavtale-frontend

11.8 MB
Binary file not shown.

server/main.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ func main() {
2525
BasePath: "/hjelpemidler/brilleavtale/",
2626
RootDir: "dist",
2727
DecoratorOpts: &decorator.Options{
28-
Context: "samarbeidspartner",
29-
Chatbot: new(bool),
28+
Context: "samarbeidspartner",
29+
Chatbot: new(bool),
30+
Language: "nb",
31+
AvailableLanguages: []decorator.AvailableLanguage{
32+
{
33+
Locale: "nb",
34+
HandleInApp: true,
35+
},
36+
{
37+
Locale: "nn",
38+
HandleInApp: true,
39+
},
40+
},
3041
},
3142
Proxy: proxy.Map{
3243
"/api/": &proxy.Options{

0 commit comments

Comments
 (0)