Skip to content

Commit

Permalink
Upgrade to angular v19
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
andrbo and maeb authored Feb 18, 2025
1 parent 9930030 commit e070ccd
Show file tree
Hide file tree
Showing 234 changed files with 6,811 additions and 5,553 deletions.
14 changes: 0 additions & 14 deletions .browserslistrc

This file was deleted.

6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {}
},
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": [
"*.html"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: docker/metadata-action@v3
- uses: docker/metadata-action@v5
name: Extract metadata (tags, labels) and establish version
id: meta
with:
Expand All @@ -30,13 +30,13 @@ jobs:
type=ref,event=branch
- name: Log in to the container registry (${{ env.REGISTRY }})
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v6
name: Build and push image
with:
build-args: |
Expand All @@ -50,9 +50,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: docker/metadata-action@v3
- uses: docker/metadata-action@v5
name: Extract metadata (tags, labels) and establish version
id: meta
with:
Expand All @@ -63,13 +63,13 @@ jobs:
type=ref,event=pr
- name: Log in to the container registry (${{ env.REGISTRY }})
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v6
name: Build and push image
with:
build-args: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

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

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

- name: Test
run: yarn test -- --watch=false --browsers=ChromeHeadless
run: yarn test --watch=false --browsers=ChromeHeadless

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

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

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

- uses: actions/cache@v2
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -71,17 +71,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: docker/metadata-action@v3
- uses: docker/metadata-action@v5
name: Extract metadata (tags, labels) and establish version
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-docs
tags: |
type=ref,event=pr
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v6
name: Build and push image
with:
build-args: |
Expand Down
2 changes: 0 additions & 2 deletions .yarnrc

This file was deleted.

22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
FROM node:20.11-alpine as build
FROM node:20-alpine as build

ARG BASE_HREF=/veidemann/
ARG VERSION

# Install git because git dependency in package.json
# Install gettext because envsubst
RUN apk add --update --no-cache git gettext

COPY package.json yarn.lock .yarnrc /usr/src/app/
WORKDIR /usr/src/app

COPY package.json yarn.lock ./

RUN yarn install --non-interactive --frozen-lockfile

COPY . .

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

RUN yarn ng build \
--configuration production \
--base-href=${BASE_HREF} \
--output-path=dist/${BASE_HREF}

# Configure nginx location
RUN envsubst \$BASE_HREF < nginx/default.template.conf > nginx/default.conf
RUN yarn ng build --configuration production


FROM nginx:stable-alpine
LABEL maintainer="[email protected]"

COPY --from=build /usr/src/app/dist /usr/share/nginx/app
COPY --from=build /usr/src/app/dist /usr/share/nginx

COPY --from=build /usr/src/app/nginx/default.conf /etc/nginx/conf.d/
4 changes: 3 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"baseHref": "/veidemann/",
"outputPath": {
"base": "dist"
"base": "dist/app",
"browser": "veidemann"
},
"index": "src/index.html",
"tsConfig": "tsconfig.app.json",
Expand Down
4 changes: 2 additions & 2 deletions nginx/default.template.conf → nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server {
root /usr/share/nginx/app;
index index.html;

location ${BASE_HREF} {
try_files $uri $uri/ ${BASE_HREF}/index.html =404;
location /veidemann {
try_files $uri $uri/ /veidemann/index.html =404;
}
}
87 changes: 40 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,78 +16,71 @@
"extract-i18n": "ng xi18n --output-path src/locale --locale no && xliffmerge --profile xliffmerge.json no en"
},
"dependencies": {
"@angular-material-components/datetime-picker": "^16.0.1",
"@angular-material-components/moment-adapter": "^16.0.1",
"@angular/animations": "^18.1.4",
"@angular/cdk": "^18.1.4",
"@angular/common": "^18.1.4",
"@angular/compiler": "^18.1.4",
"@angular/core": "^18.1.4",
"@angular/animations": "^19.1.5",
"@angular/cdk": "^19.1.3",
"@angular/common": "^19.1.5",
"@angular/compiler": "^19.1.5",
"@angular/core": "^19.1.5",
"@angular/flex-layout": "^15.0.0-beta.42",
"@angular/forms": "^18.1.4",
"@angular/localize": "^18.1.4",
"@angular/material": "^18.1.4",
"@angular/material-moment-adapter": "^18.1.4",
"@angular/platform-browser": "^18.1.4",
"@angular/platform-browser-dynamic": "^18.1.4",
"@angular/router": "^18.1.4",
"@casl/ability": "^6.7.1",
"@casl/angular": "^8.2.7",
"@fullcalendar/angular": "^6.1.15",
"@angular/forms": "^19.1.5",
"@angular/localize": "^19.1.5",
"@angular/material": "^19.1.3",
"@angular/platform-browser": "^19.1.5",
"@angular/platform-browser-dynamic": "^19.1.5",
"@angular/router": "^19.1.5",
"@casl/ability": "^6.7.3",
"@casl/angular": "^9.0.3",
"@fullcalendar/angular": "^6.1.16",
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/timegrid": "^6.1.15",
"@materia-ui/ngx-monaco-editor": "^6.0.0",
"@ngneat/spectator": "^19.0.0",
"@types/moment-duration-format": "^2.2.6",
"@types/prismjs": "^1.26.4",
"angular-oauth2-oidc": "~17.0.2",
"@ngneat/spectator": "^19.4.1",
"@types/prismjs": "^1.26.5",
"angular-oauth2-oidc": "~19.0.0",
"angular-oauth2-oidc-jwks": "^17.0.2",
"chroma-js": "^2.6.0",
"cron-parser": "^4.9.0",
"echarts": "^5.5.1",
"dayjs": "^1.11.13",
"echarts": "^5.6.0",
"filesize": "^9.0.11",
"google-protobuf": "^3.21.2",
"google-protobuf": "^3.21.4",
"grpc-web": "^1.5.0",
"hammerjs": "^2.0.8",
"ip-address": "^9.0.5",
"minimist": "~1.2.8",
"moment": "^2.30.1",
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.45",
"monaco-editor": "^0.50.0",
"monaco-editor": "^0.52.2",
"ng-keyboard-shortcuts": "^13.0.8",
"ng-mocks": "^14.13.0",
"ngx-echarts": "^18.0.0",
"ng-mocks": "^14.13.2",
"ngx-echarts": "^19.0.0",
"ngx-filesize": "^3.0.4",
"prismjs": "^1.29.0",
"rxjs": "~7.8.1",
"tslib": "^2.6.3",
"zone.js": "~0.14.10"
"tslib": "^2.8.1",
"zone.js": "~0.15.0"
},
"resolutions": {
"minimist": "~1.2.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.1.4",
"@angular-eslint/builder": "^18.3.0",
"@angular-eslint/eslint-plugin": "^18.3.0",
"@angular-eslint/eslint-plugin-template": "^18.3.0",
"@angular-eslint/schematics": "^18.2.0",
"@angular-eslint/template-parser": "^18.3.0",
"@angular/cli": "^18.1.4",
"@angular/compiler-cli": "^18.1.4",
"@angular/language-service": "^18.1.4",
"@angular-devkit/build-angular": "^19.1.6",
"@angular-eslint/builder": "^19.1.0",
"@angular-eslint/eslint-plugin": "^19.1.0",
"@angular-eslint/eslint-plugin-template": "^19.1.0",
"@angular-eslint/schematics": "^19.1.0",
"@angular-eslint/template-parser": "^19.1.0",
"@angular/cli": "^19.1.6",
"@angular/compiler-cli": "^19.1.5",
"@angular/language-service": "^19.1.5",
"@juggle/resize-observer": "^3.4.0",
"@types/google-protobuf": "^3.15.12",
"@types/jasmine": "~5.1.4",
"@types/jasmine": "~5.1.5",
"@types/jasminewd2": "~2.0.13",
"@types/node": "^20.8.9",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"eslint": "^9.9.0",
"jasmine-core": "~5.2.0",
"@types/node": "^22.0.3",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"eslint": "^9.20.0",
"jasmine-core": "~5.6.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.4",
"karma-chrome-launcher": "~3.2.0",
Expand Down
7 changes: 4 additions & 3 deletions src/app/components/about-dialog/about-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import {Component} from '@angular/core';
import {environment} from '../../../environments/environment';

@Component({
selector: 'app-about-dialog',
templateUrl: './about-dialog.component.html',
styleUrls: ['./about-dialog.component.css']
selector: 'app-about-dialog',
templateUrl: './about-dialog.component.html',
styleUrls: ['./about-dialog.component.css'],
standalone: false
})

export class AboutDialogComponent {
Expand Down
Loading

0 comments on commit e070ccd

Please sign in to comment.