Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diverse forvaltning og oppdateringer #544

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"plugin:jsx-a11y/recommended",
"prettier"
],
"globals": {
"process": true,
"__dirname": true
},
"settings": {
"react": {
"version": "detect"
Expand All @@ -28,6 +32,7 @@
"semi": ["error", "always"],
"max-len": [1, { "code": 150, "ignoreComments": true, "ignoreStrings": true }],
"indent": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"react/display-name": "off"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
echo "IMAGE_NAME=$(echo ${GITHUB_REPOSITORY##*/})" >> $GITHUB_ENV
echo "IMAGE_VERSION=${IMAGE_VERSION_RAW,,}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=$(echo ${GITHUB_TOKEN})" >> $GITHUB_ENV
echo "PUBLIC_URL=https://cdn.nav.no/personbruker/personopplysninger/$(echo ${IMAGE_VERSION_RAW,,})/build" >> $GITHUB_ENV
echo "PUBLIC_URL=https://cdn.nav.no/personbruker/personopplysninger/$(echo ${IMAGE_VERSION_RAW,,})/build/client" >> $GITHUB_ENV
- name: Define client-side environment
run: |
echo "VITE_ENV=${{ inputs.env }}" >> $GITHUB_ENV
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# production
/build


# misc
.DS_Store
.env
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ FROM node:20-bullseye-slim
ENV NODE_ENV production

WORKDIR usr/src/app
COPY server server/
COPY build build/
COPY server/node_modules build/server/node_modules

WORKDIR server
WORKDIR build/server

EXPOSE 8080

CMD ["node", "./server.js"]

EXPOSE 8080
63 changes: 60 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
"postinstall": "cd server && npm install",
"build": "npm-run-all -p build:*",
"build:server": "cd server && npm run build",
"build:js": "vite build",
"build:css": "less-watch-compiler --run-once",
"test": "vitest",
"analyze": "npx vite-bundle-visualizer"
},
"dependencies": {
"@grafana/faro-react": "1.9.0",
"@grafana/faro-web-sdk": "1.8.2",
"@grafana/faro-web-tracing": "1.8.2",
"@navikt/aksel-icons": "6.13.0",
Expand Down
22 changes: 0 additions & 22 deletions server/dekorator.js

This file was deleted.

22 changes: 22 additions & 0 deletions server/dekorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { injectDecoratorServerSide } from '@navikt/nav-dekoratoren-moduler/ssr';

type DecoratorNaisEnv = 'prod' | 'dev' | 'beta' | 'betaTms' | 'devNext' | 'prodNext';

export const getHtmlWithDecorator = (filePath: string) =>
injectDecoratorServerSide({
env: process.env.ENV as DecoratorNaisEnv,
filePath,
params: {
enforceLogin: false,
breadcrumbs: [
{ url: 'https://www.nav.no/minside/', title: 'Min side' },
{ url: 'https://www.nav.no/person/personopplysninger/', title: 'Personopplysninger' },
],
availableLanguages: [
{ url: 'https://www.nav.no/person/personopplysninger/nb/', locale: 'nb' },
{ url: 'https://www.nav.no/person/personopplysninger/en/', locale: 'en' },
{ url: 'https://www.nav.no/person/personopplysninger/nn/', locale: 'nn' },
],
logoutWarning: true,
},
});
12 changes: 0 additions & 12 deletions server/logger.js

This file was deleted.

11 changes: 11 additions & 0 deletions server/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { LoggerOptions, pino } from 'pino';

const options = {
formatters: {
level: (label) => {
return { level: label };
},
},
} as LoggerOptions;

export const logger = pino(options);
Loading
Loading