Skip to content

Commit e070ccd

Browse files
andrbomaeb
andauthored
Upgrade to angular v19
* build: remove unecessary file .yarnrc * build: remove browserlist configuration * build: simplify configuration * ci: update actions * test: fix wrong expected date * fix: -- is deprecated in yarn test * feat: replace moment with dayjs * fix: remove non-null assertion in dayjs test * update angular core and cli * upgrade angular-material * feat: localization of time and date using dayjs * feat: replace deprecated ngx-matdatetimepicker with material Date and Timepicker * refactor: removed workaround. * chore: update dependencies and remove dependencies no longer in use * fix: format duration to same format with dayjs as with moment. update tests * fix: change oicd response type * feat: use casl abilityService instead of able pipe * chore: update dependencies * fix: settings format in dateadapter to match calendar input. Update tests to support changes * fix: update after changing casl ability implementation * fix: update tests to work with new dayjs dateadapter * cleanup: remove console.log statements * fix: replace logo image with smaller size images to get rid of warning during render * fix: dayjs-date-adapter * feat: remove deprecated APP_INITIALIZER * fix: turn off eslint prefer standalone Turned off prefer-standalone option in eslint to pass linting step. Can be turned back on again if we at some point refactor all components ++ to be standalone. * fix: remove unused lifecycle hook to please linter * fix: remove optional locale in _createDayJs. Set locale to nb instead of nb-NO in tests --------- Co-authored-by: Marius André Elsfjordstrand Beck <marius.beck@nb.no>
1 parent 9930030 commit e070ccd

File tree

234 files changed

+6811
-5553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+6811
-5553
lines changed

.browserslistrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.eslintrc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
"plugin:@angular-eslint/recommended",
1919
"plugin:@angular-eslint/template/process-inline-templates"
2020
],
21-
"rules": {}
22-
},
21+
"rules": {
22+
"@angular-eslint/prefer-standalone": "off"
23+
}
24+
},
2325
{
2426
"files": [
2527
"*.html"

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: docker/metadata-action@v3
23+
- uses: docker/metadata-action@v5
2424
name: Extract metadata (tags, labels) and establish version
2525
id: meta
2626
with:
@@ -30,13 +30,13 @@ jobs:
3030
type=ref,event=branch
3131
3232
- name: Log in to the container registry (${{ env.REGISTRY }})
33-
uses: docker/login-action@v1
33+
uses: docker/login-action@v3
3434
with:
3535
registry: ${{ env.REGISTRY }}
3636
username: ${{ github.actor }}
3737
password: ${{ secrets.GITHUB_TOKEN }}
3838

39-
- uses: docker/build-push-action@v2
39+
- uses: docker/build-push-action@v6
4040
name: Build and push image
4141
with:
4242
build-args: |
@@ -50,9 +50,9 @@ jobs:
5050

5151
steps:
5252
- name: Checkout
53-
uses: actions/checkout@v2
53+
uses: actions/checkout@v4
5454

55-
- uses: docker/metadata-action@v3
55+
- uses: docker/metadata-action@v5
5656
name: Extract metadata (tags, labels) and establish version
5757
id: meta
5858
with:
@@ -63,13 +63,13 @@ jobs:
6363
type=ref,event=pr
6464
6565
- name: Log in to the container registry (${{ env.REGISTRY }})
66-
uses: docker/login-action@v1
66+
uses: docker/login-action@v3
6767
with:
6868
registry: ${{ env.REGISTRY }}
6969
username: ${{ github.actor }}
7070
password: ${{ secrets.GITHUB_TOKEN }}
7171

72-
- uses: docker/build-push-action@v2
72+
- uses: docker/build-push-action@v6
7373
name: Build and push image
7474
with:
7575
build-args: |

.github/workflows/test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818

1919
- name: Use Node.js
20-
uses: actions/setup-node@v2
20+
uses: actions/setup-node@v4
2121
with:
22-
node-version: 18.x
22+
node-version: 20.x
2323

2424
- id: yarn-cache-dir-path
2525
run: echo "::set-output name=dir::$(yarn cache dir)"
2626

27-
- uses: actions/cache@v2
27+
- uses: actions/cache@v4
2828
id: yarn-cache
2929
with:
3030
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -36,23 +36,23 @@ jobs:
3636
run: yarn install --non-interactive --frozen-lockfile --prefer-offline
3737

3838
- name: Test
39-
run: yarn test -- --watch=false --browsers=ChromeHeadless
39+
run: yarn test --watch=false --browsers=ChromeHeadless
4040

4141
lint:
4242
runs-on: ubuntu-latest
4343

4444
steps:
45-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v4
4646

4747
- name: Use Node.js
48-
uses: actions/setup-node@v2
48+
uses: actions/setup-node@v4
4949
with:
50-
node-version: 18.x
50+
node-version: 20.x
5151

5252
- id: yarn-cache-dir-path
5353
run: echo "::set-output name=dir::$(yarn cache dir)"
5454

55-
- uses: actions/cache@v2
55+
- uses: actions/cache@v4
5656
id: yarn-cache
5757
with:
5858
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -71,17 +71,17 @@ jobs:
7171

7272
steps:
7373
- name: Checkout
74-
uses: actions/checkout@v2
74+
uses: actions/checkout@v4
7575

76-
- uses: docker/metadata-action@v3
76+
- uses: docker/metadata-action@v5
7777
name: Extract metadata (tags, labels) and establish version
7878
id: meta
7979
with:
8080
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-docs
8181
tags: |
8282
type=ref,event=pr
8383
84-
- uses: docker/build-push-action@v2
84+
- uses: docker/build-push-action@v6
8585
name: Build and push image
8686
with:
8787
build-args: |

.yarnrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

Dockerfile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
1-
FROM node:20.11-alpine as build
1+
FROM node:20-alpine as build
22

3-
ARG BASE_HREF=/veidemann/
43
ARG VERSION
54

6-
# Install git because git dependency in package.json
7-
# Install gettext because envsubst
8-
RUN apk add --update --no-cache git gettext
9-
10-
COPY package.json yarn.lock .yarnrc /usr/src/app/
115
WORKDIR /usr/src/app
6+
7+
COPY package.json yarn.lock ./
8+
129
RUN yarn install --non-interactive --frozen-lockfile
1310

1411
COPY . .
1512

16-
# Give the application a version
1713
RUN sed -i "s/version: ''/version: '${VERSION}'/" src/environments/*.ts
1814

19-
RUN yarn ng build \
20-
--configuration production \
21-
--base-href=${BASE_HREF} \
22-
--output-path=dist/${BASE_HREF}
23-
24-
# Configure nginx location
25-
RUN envsubst \$BASE_HREF < nginx/default.template.conf > nginx/default.conf
15+
RUN yarn ng build --configuration production
2616

2717

2818
FROM nginx:stable-alpine
2919
LABEL maintainer="nettarkivet@nb.no"
3020

31-
COPY --from=build /usr/src/app/dist /usr/share/nginx/app
21+
COPY --from=build /usr/src/app/dist /usr/share/nginx
3222

3323
COPY --from=build /usr/src/app/nginx/default.conf /etc/nginx/conf.d/

angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:application",
1919
"options": {
20+
"baseHref": "/veidemann/",
2021
"outputPath": {
21-
"base": "dist"
22+
"base": "dist/app",
23+
"browser": "veidemann"
2224
},
2325
"index": "src/index.html",
2426
"tsConfig": "tsconfig.app.json",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server {
33
root /usr/share/nginx/app;
44
index index.html;
55

6-
location ${BASE_HREF} {
7-
try_files $uri $uri/ ${BASE_HREF}/index.html =404;
6+
location /veidemann {
7+
try_files $uri $uri/ /veidemann/index.html =404;
88
}
99
}

package.json

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,71 @@
1616
"extract-i18n": "ng xi18n --output-path src/locale --locale no && xliffmerge --profile xliffmerge.json no en"
1717
},
1818
"dependencies": {
19-
"@angular-material-components/datetime-picker": "^16.0.1",
20-
"@angular-material-components/moment-adapter": "^16.0.1",
21-
"@angular/animations": "^18.1.4",
22-
"@angular/cdk": "^18.1.4",
23-
"@angular/common": "^18.1.4",
24-
"@angular/compiler": "^18.1.4",
25-
"@angular/core": "^18.1.4",
19+
"@angular/animations": "^19.1.5",
20+
"@angular/cdk": "^19.1.3",
21+
"@angular/common": "^19.1.5",
22+
"@angular/compiler": "^19.1.5",
23+
"@angular/core": "^19.1.5",
2624
"@angular/flex-layout": "^15.0.0-beta.42",
27-
"@angular/forms": "^18.1.4",
28-
"@angular/localize": "^18.1.4",
29-
"@angular/material": "^18.1.4",
30-
"@angular/material-moment-adapter": "^18.1.4",
31-
"@angular/platform-browser": "^18.1.4",
32-
"@angular/platform-browser-dynamic": "^18.1.4",
33-
"@angular/router": "^18.1.4",
34-
"@casl/ability": "^6.7.1",
35-
"@casl/angular": "^8.2.7",
36-
"@fullcalendar/angular": "^6.1.15",
25+
"@angular/forms": "^19.1.5",
26+
"@angular/localize": "^19.1.5",
27+
"@angular/material": "^19.1.3",
28+
"@angular/platform-browser": "^19.1.5",
29+
"@angular/platform-browser-dynamic": "^19.1.5",
30+
"@angular/router": "^19.1.5",
31+
"@casl/ability": "^6.7.3",
32+
"@casl/angular": "^9.0.3",
33+
"@fullcalendar/angular": "^6.1.16",
3734
"@fullcalendar/core": "^6.1.15",
3835
"@fullcalendar/daygrid": "^6.1.15",
3936
"@fullcalendar/interaction": "^6.1.15",
4037
"@fullcalendar/timegrid": "^6.1.15",
4138
"@materia-ui/ngx-monaco-editor": "^6.0.0",
42-
"@ngneat/spectator": "^19.0.0",
43-
"@types/moment-duration-format": "^2.2.6",
44-
"@types/prismjs": "^1.26.4",
45-
"angular-oauth2-oidc": "~17.0.2",
39+
"@ngneat/spectator": "^19.4.1",
40+
"@types/prismjs": "^1.26.5",
41+
"angular-oauth2-oidc": "~19.0.0",
4642
"angular-oauth2-oidc-jwks": "^17.0.2",
4743
"chroma-js": "^2.6.0",
4844
"cron-parser": "^4.9.0",
49-
"echarts": "^5.5.1",
45+
"dayjs": "^1.11.13",
46+
"echarts": "^5.6.0",
5047
"filesize": "^9.0.11",
51-
"google-protobuf": "^3.21.2",
48+
"google-protobuf": "^3.21.4",
5249
"grpc-web": "^1.5.0",
53-
"hammerjs": "^2.0.8",
5450
"ip-address": "^9.0.5",
5551
"minimist": "~1.2.8",
56-
"moment": "^2.30.1",
57-
"moment-duration-format": "^2.3.2",
58-
"moment-timezone": "^0.5.45",
59-
"monaco-editor": "^0.50.0",
52+
"monaco-editor": "^0.52.2",
6053
"ng-keyboard-shortcuts": "^13.0.8",
61-
"ng-mocks": "^14.13.0",
62-
"ngx-echarts": "^18.0.0",
54+
"ng-mocks": "^14.13.2",
55+
"ngx-echarts": "^19.0.0",
6356
"ngx-filesize": "^3.0.4",
6457
"prismjs": "^1.29.0",
6558
"rxjs": "~7.8.1",
66-
"tslib": "^2.6.3",
67-
"zone.js": "~0.14.10"
59+
"tslib": "^2.8.1",
60+
"zone.js": "~0.15.0"
6861
},
6962
"resolutions": {
7063
"minimist": "~1.2.5"
7164
},
7265
"devDependencies": {
73-
"@angular-devkit/build-angular": "^18.1.4",
74-
"@angular-eslint/builder": "^18.3.0",
75-
"@angular-eslint/eslint-plugin": "^18.3.0",
76-
"@angular-eslint/eslint-plugin-template": "^18.3.0",
77-
"@angular-eslint/schematics": "^18.2.0",
78-
"@angular-eslint/template-parser": "^18.3.0",
79-
"@angular/cli": "^18.1.4",
80-
"@angular/compiler-cli": "^18.1.4",
81-
"@angular/language-service": "^18.1.4",
66+
"@angular-devkit/build-angular": "^19.1.6",
67+
"@angular-eslint/builder": "^19.1.0",
68+
"@angular-eslint/eslint-plugin": "^19.1.0",
69+
"@angular-eslint/eslint-plugin-template": "^19.1.0",
70+
"@angular-eslint/schematics": "^19.1.0",
71+
"@angular-eslint/template-parser": "^19.1.0",
72+
"@angular/cli": "^19.1.6",
73+
"@angular/compiler-cli": "^19.1.5",
74+
"@angular/language-service": "^19.1.5",
8275
"@juggle/resize-observer": "^3.4.0",
8376
"@types/google-protobuf": "^3.15.12",
84-
"@types/jasmine": "~5.1.4",
77+
"@types/jasmine": "~5.1.5",
8578
"@types/jasminewd2": "~2.0.13",
86-
"@types/node": "^20.8.9",
87-
"@typescript-eslint/eslint-plugin": "^8.1.0",
88-
"@typescript-eslint/parser": "^8.1.0",
89-
"eslint": "^9.9.0",
90-
"jasmine-core": "~5.2.0",
79+
"@types/node": "^22.0.3",
80+
"@typescript-eslint/eslint-plugin": "^8.24.0",
81+
"@typescript-eslint/parser": "^8.24.0",
82+
"eslint": "^9.20.0",
83+
"jasmine-core": "~5.6.0",
9184
"jasmine-spec-reporter": "~7.0.0",
9285
"karma": "~6.4.4",
9386
"karma-chrome-launcher": "~3.2.0",

src/app/components/about-dialog/about-dialog.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {Component} from '@angular/core';
22
import {environment} from '../../../environments/environment';
33

44
@Component({
5-
selector: 'app-about-dialog',
6-
templateUrl: './about-dialog.component.html',
7-
styleUrls: ['./about-dialog.component.css']
5+
selector: 'app-about-dialog',
6+
templateUrl: './about-dialog.component.html',
7+
styleUrls: ['./about-dialog.component.css'],
8+
standalone: false
89
})
910

1011
export class AboutDialogComponent {

0 commit comments

Comments
 (0)