diff --git a/README.md b/README.md index 00b887f..b098ff9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Digital fingerprint of plastics - UI +# DeFinMa - UI This is the Angular front end for the digital fingerprint of plastics web page hosted in the bic diff --git a/angular.json b/angular.json index 023e2a4..5917785 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "UI": { + "definma": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/UI", + "outputPath": "dist/definma", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", @@ -30,7 +30,8 @@ "glob": "**/*", "input": "./node_modules/@inst-iot/bosch-angular-ui-components/assets", "output": "./assets" - } + }, + "src/manifest.webmanifest" ], "styles": [ "src/styles.scss" @@ -64,26 +65,28 @@ "maximumWarning": "6kb", "maximumError": "10kb" } - ] + ], + "serviceWorker": true, + "ngswConfigPath": "ngsw-config.json" } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "UI:build", + "browserTarget": "definma:build", "proxyConfig": "src/proxy.conf.json" }, "configurations": { "production": { - "browserTarget": "UI:build:production" + "browserTarget": "definma:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "UI:build" + "browserTarget": "definma:build" } }, "test": { @@ -95,7 +98,8 @@ "karmaConfig": "karma.conf.js", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/manifest.webmanifest" ], "styles": [ "src/styles.scss" @@ -120,15 +124,15 @@ "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "UI:serve" + "devServerTarget": "definma:serve" }, "configurations": { "production": { - "devServerTarget": "UI:serve:production" + "devServerTarget": "definma:serve:production" } } } } }}, - "defaultProject": "UI" + "defaultProject": "definma" } diff --git a/cf_config/Staticfile b/cf_config/Staticfile index 9357ba4..aceedb5 100644 --- a/cf_config/Staticfile +++ b/cf_config/Staticfile @@ -1,4 +1,4 @@ pushstate: enabled force_https: true -root: UI +root: definma location_include: ../../*.conf diff --git a/karma.conf.js b/karma.conf.js index 09aabe9..7603521 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -13,10 +13,13 @@ module.exports = function (config) { require('@angular-devkit/build-angular/plugins/karma') ], client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser + clearContext: false, // leave Jasmine Spec Runner output visible in browser + jasmine: { + random: false + } }, coverageIstanbulReporter: { - dir: require('path').join(__dirname, './coverage/UI'), + dir: require('path').join(__dirname, './coverage/definma'), reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, diff --git a/ngsw-config.json b/ngsw-config.json new file mode 100644 index 0000000..4ddf1a7 --- /dev/null +++ b/ngsw-config.json @@ -0,0 +1,29 @@ +{ + "$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/**", + "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)" + ] + } + } + ] +} diff --git a/package-lock.json b/package-lock.json index 352f42d..79fc0f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "ui", - "version": "0.0.0", + "name": "definma", + "version": "0.5.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -630,6 +630,11 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-9.1.7.tgz", "integrity": "sha512-ycrkhkCbfOMCe9PngFjnyk8nH5jt0Kyb2NPtjmaGOtSCuZBZ0kOU0rQGmQnj3d2PiT0Yir59S8eEAf3Fh0iDuw==" }, + "@angular/service-worker": { + "version": "9.1.12", + "resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-9.1.12.tgz", + "integrity": "sha512-UsmhPfhIYq9LanuFT6V7Kmkr5Vjl2CMjKkL1gqhChkywNW4vavAYsBkuVji8P76ZKliq41TCG01z6xIAWji8QA==" + }, "@babel/code-frame": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", diff --git a/package.json b/package.json index 813ed91..cd4c5ad 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@angular/platform-browser": "~9.1.7", "@angular/platform-browser-dynamic": "~9.1.7", "@angular/router": "~9.1.7", + "@angular/service-worker": "~9.1.7", "@hapi/joi": "^17.1.1", "@inst-iot/bosch-angular-ui-components": "^0.7.2", "angular-2-local-storage": "^3.0.2", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d3701e4..4a0fcd0 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -10,11 +10,13 @@ import {SettingsComponent} from './settings/settings.component'; import {UsersComponent} from './users/users.component'; import {ChangelogComponent} from './changelog/changelog.component'; import {DocumentationDatabaseComponent} from './documentation-database/documentation-database.component'; +import {PredictionComponent} from './prediction/prediction.component'; const routes: Routes = [ {path: '', component: HomeComponent}, {path: 'home', component: HomeComponent}, + {path: 'prediction', component: PredictionComponent}, {path: 'samples', component: SamplesComponent, canActivate: [LoginService]}, {path: 'samples/new', component: SampleComponent, canActivate: [LoginService]}, {path: 'samples/edit/:id', component: SampleComponent, canActivate: [LoginService]}, diff --git a/src/app/app.component.html b/src/app/app.component.html index 59d68bc..29b9944 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,6 +1,7 @@