Added service worker
10
angular.json
|
@ -35,7 +35,8 @@
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets",
|
||||||
|
"src/manifest.webmanifest"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"@angular/material/prebuilt-themes/deeppurple-amber.css",
|
"@angular/material/prebuilt-themes/deeppurple-amber.css",
|
||||||
|
@ -51,7 +52,9 @@
|
||||||
"base64-js",
|
"base64-js",
|
||||||
"js-sha256"
|
"js-sha256"
|
||||||
],
|
],
|
||||||
"localize": true
|
"localize": true,
|
||||||
|
"serviceWorker": true,
|
||||||
|
"ngswConfigPath": "ngsw-config.json"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
|
@ -148,7 +151,8 @@
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets",
|
||||||
|
"src/manifest.webmanifest"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"@angular/material/prebuilt-themes/deeppurple-amber.css",
|
"@angular/material/prebuilt-themes/deeppurple-amber.css",
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
||||||
|
"index": "/index.html",
|
||||||
|
"assetGroups": [
|
||||||
|
{
|
||||||
|
"name": "app",
|
||||||
|
"installMode": "prefetch",
|
||||||
|
"resources": {
|
||||||
|
"files": [
|
||||||
|
"/favicon.ico",
|
||||||
|
"/index.html",
|
||||||
|
"/manifest.webmanifest",
|
||||||
|
"/*.css",
|
||||||
|
"/*.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "assets",
|
||||||
|
"installMode": "lazy",
|
||||||
|
"updateMode": "prefetch",
|
||||||
|
"resources": {
|
||||||
|
"files": [
|
||||||
|
"/assets/**",
|
||||||
|
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -28,6 +28,7 @@
|
||||||
"@angular/platform-browser": "^16.1.0",
|
"@angular/platform-browser": "^16.1.0",
|
||||||
"@angular/platform-browser-dynamic": "^16.1.0",
|
"@angular/platform-browser-dynamic": "^16.1.0",
|
||||||
"@angular/router": "^16.1.0",
|
"@angular/router": "^16.1.0",
|
||||||
|
"@angular/service-worker": "^16.1.0",
|
||||||
"@ngrx/effects": "^16.1.0",
|
"@ngrx/effects": "^16.1.0",
|
||||||
"@ngrx/store": "^16.1.0",
|
"@ngrx/store": "^16.1.0",
|
||||||
"keycloak-angular": "^14.0.0",
|
"keycloak-angular": "^14.0.0",
|
||||||
|
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 711 B |
After Width: | Height: | Size: 857 B |
|
@ -7,10 +7,13 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
<link rel="manifest" href="manifest.webmanifest">
|
||||||
|
<meta name="theme-color" content="#1976d2">
|
||||||
</head>
|
</head>
|
||||||
<body class="mat-typography">
|
<body class="mat-typography">
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
<noscript>Please enable JavaScript to continue using this application.</noscript>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
18
src/main.ts
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import {bootstrapApplication} from "@angular/platform-browser";
|
import {bootstrapApplication} from "@angular/platform-browser";
|
||||||
import {AppComponent} from "./app/app.component";
|
import {AppComponent} from "./app/app.component";
|
||||||
import {APP_INITIALIZER} from "@angular/core";
|
import {APP_INITIALIZER, isDevMode} from "@angular/core";
|
||||||
import {KeycloakBearerInterceptor, KeycloakService} from "keycloak-angular";
|
import {KeycloakBearerInterceptor, KeycloakService} from "keycloak-angular";
|
||||||
import {environment} from "./environments/environment";
|
import {environment} from "./environments/environment";
|
||||||
import {provideRouter, withComponentInputBinding} from "@angular/router";
|
import {provideRouter, withComponentInputBinding} from "@angular/router";
|
||||||
|
@ -13,6 +13,7 @@ import {HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi} from "@ang
|
||||||
import {ROOT_ROUTES} from "./app/app.routes";
|
import {ROOT_ROUTES} from "./app/app.routes";
|
||||||
import "@angular/localize/init";
|
import "@angular/localize/init";
|
||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
|
import {provideServiceWorker} from '@angular/service-worker';
|
||||||
|
|
||||||
function initializeKeycloak(keycloak: KeycloakService, locationService: Location) {
|
function initializeKeycloak(keycloak: KeycloakService, locationService: Location) {
|
||||||
return () =>
|
return () =>
|
||||||
|
@ -24,7 +25,7 @@ function initializeKeycloak(keycloak: KeycloakService, locationService: Location
|
||||||
},
|
},
|
||||||
initOptions: {
|
initOptions: {
|
||||||
onLoad: 'check-sso',
|
onLoad: 'check-sso',
|
||||||
silentCheckSsoRedirectUri:`${window.location.origin}${locationService.prepareExternalUrl('/assets/silent-check-sso.html')}`,
|
silentCheckSsoRedirectUri: `${window.location.origin}${locationService.prepareExternalUrl('/assets/silent-check-sso.html')}`,
|
||||||
flow: "standard"
|
flow: "standard"
|
||||||
},
|
},
|
||||||
shouldAddToken: (request) => {
|
shouldAddToken: (request) => {
|
||||||
|
@ -43,19 +44,20 @@ bootstrapApplication(AppComponent, {
|
||||||
multi: true,
|
multi: true,
|
||||||
deps: [KeycloakService, Location],
|
deps: [KeycloakService, Location],
|
||||||
},
|
},
|
||||||
provideRouter(ROOT_ROUTES,
|
provideRouter(ROOT_ROUTES, withComponentInputBinding()),
|
||||||
withComponentInputBinding()),
|
|
||||||
provideStore(),
|
provideStore(),
|
||||||
provideEffects(),
|
provideEffects(),
|
||||||
provideAnimations(),
|
provideAnimations(),
|
||||||
provideHttpClient(
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
withInterceptorsFromDi()
|
|
||||||
),
|
|
||||||
KeycloakService,
|
KeycloakService,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: KeycloakBearerInterceptor,
|
useClass: KeycloakBearerInterceptor,
|
||||||
multi: true
|
multi: true
|
||||||
}
|
},
|
||||||
|
provideServiceWorker('ngsw-worker.js', {
|
||||||
|
enabled: !isDevMode(),
|
||||||
|
registrationStrategy: 'registerWhenStable:30000'
|
||||||
|
})
|
||||||
]
|
]
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
"name": "wahlrecht-frontend",
|
||||||
|
"short_name": "wahlrecht-frontend",
|
||||||
|
"theme_color": "#1976d2",
|
||||||
|
"background_color": "#fafafa",
|
||||||
|
"display": "standalone",
|
||||||
|
"scope": "./",
|
||||||
|
"start_url": "./",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-128x128.png",
|
||||||
|
"sizes": "128x128",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-152x152.png",
|
||||||
|
"sizes": "152x152",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/icons/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable any"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|