diff --git a/cf_config/headers.conf b/cf_config/headers.conf
index 6a3526d..419a99f 100644
--- a/cf_config/headers.conf
+++ b/cf_config/headers.conf
@@ -1,7 +1,7 @@
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src https://definma-api.apps.de1.bosch-iot-cloud.com; form-action 'none'; frame-ancestors 'none'; base-uri 'self'";
add_header X-Frame-Options DENY;
add_header X-DNS-Prefetch-Control off;
-add_header Strict-Transport-Security "max-age=15552000";
+add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";
add_header X-Download-Options noopen;
add_header X-Content-Type-Options nosniff;
add_header X-Permitted-Cross-Domain-Policies none;
diff --git a/cf_config/nginx.conf b/cf_config/nginx.conf
deleted file mode 100644
index 841957f..0000000
--- a/cf_config/nginx.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-gzip on;
-gzip_disable "msie6";
-
-gzip_vary on;
-gzip_proxied any;
-gzip_comp_level 6;
-gzip_buffers 16 8k;
-gzip_http_version 1.1;
-gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
diff --git a/package-lock.json b/package-lock.json
index 5f6e05a..352f42d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1887,10 +1887,18 @@
}
},
"@inst-iot/bosch-angular-ui-components": {
- "version": "file:../Bosch-UI-Components/bosch-angular-ui-components/dist-lib/inst-iot-bosch-angular-ui-components-0.6.0.tgz",
- "integrity": "sha512-A4nKOvpdKzq+GWSZlL7U511Ii1vdSA905Q0tru7jAzpBzjRaYqCTiCvsAjRDLM+gVPpzgZ8HpMYfNfhMoNlG/w==",
+ "version": "0.7.2",
+ "resolved": "https://rb-artifactory.bosch.com:443/artifactory/api/npm/iot-insights-release-local/@inst-iot/bosch-angular-ui-components/-/@inst-iot/bosch-angular-ui-components-0.7.2.tgz",
+ "integrity": "sha1-X0AkwkMAy9u/UsG69Zky40LaN5c=",
"requires": {
- "tslib": "^1.10.0"
+ "tslib": "^2.0.0"
+ },
+ "dependencies": {
+ "tslib": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz",
+ "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g=="
+ }
}
},
"@istanbuljs/schema": {
diff --git a/package.json b/package.json
index 6c9df32..64c4dca 100644
--- a/package.json
+++ b/package.json
@@ -24,8 +24,7 @@
"@angular/platform-browser-dynamic": "~9.1.7",
"@angular/router": "~9.1.7",
"@hapi/joi": "^17.1.1",
- "@inst-iot/bosch-angular-ui-components":
- "file:../Bosch-UI-Components/bosch-angular-ui-components/dist-lib/inst-iot-bosch-angular-ui-components-0.6.0.tgz",
+ "@inst-iot/bosch-angular-ui-components": "^0.7.2",
"angular-2-local-storage": "^3.0.2",
"chart.js": "^2.9.3",
"chartjs-plugin-datalabels": "^0.7.0",
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 884286d..6244c7f 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -2,8 +2,10 @@
@@ -20,7 +22,19 @@
-
DEVELOPMENTDigital Fingerprint of Plastics
+
diff --git a/src/app/app.component.scss b/src/app/app.component.scss
index dd5d5f3..9a9e4b0 100644
--- a/src/app/app.component.scss
+++ b/src/app/app.component.scss
@@ -9,3 +9,7 @@
grid-template-columns: 1fr;
grid-row-gap: 10px;
}
+
+.bug-textarea {
+ width: 800px;
+}
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 22ec18b..b2a3a5b 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -6,8 +6,10 @@ import {Router} from '@angular/router';
// TODO: validation: DPT: filename
// TODO: filter by not completely filled/no measurements
// TODO: validation of samples
+// TODO: centralize fetching of materials / templates, etc.
+// TODO: PWA
-// TODO: get rid of chart.js (+moment.js) and lodash
+// TODO: get rid of chart.js (+moment.js)
@Component({
selector: 'app-root',
@@ -16,6 +18,8 @@ import {Router} from '@angular/router';
})
export class AppComponent {
+ bugReport = {do: '', work: ''};
+
constructor(
public loginService: LoginService,
private router: Router
@@ -30,4 +34,28 @@ export class AppComponent {
this.loginService.logout();
this.router.navigate(['/']);
}
+
+ bugReportContent() {
+ return `mailto:lukas.veit@de.bosch.com?subject=Bug report&body=Thanks for sending the report! Your bug will be (hopefully) fixed soon.
+%0D%0A%0D%0A--- REPORT DATA ---
+%0D%0A%0D%0ATime: ${new Date().toString()}%0D%0A
+URL: ${window.location}%0D%0A%0D%0AWhat did you do?%0D%0A${encodeURIComponent(this.bugReport.do)}
+%0D%0A%0D%0AWhat did not work?%0D%0A${encodeURIComponent(this.bugReport.work)}%0D%0A%0D%0ABrowser:%0D%0A
+%0D%0AappCodeName: ${navigator.appCodeName}
+%0D%0AappVersion: ${navigator.appVersion}
+%0D%0Alanguage: ${navigator.language}
+%0D%0AonLine: ${navigator.onLine}
+%0D%0Aoscpu: ${navigator.oscpu}
+%0D%0Aplatform: ${navigator.platform}
+%0D%0AuserAgent: ${navigator.userAgent}
+%0D%0AinnerWidth: ${window.innerWidth}
+%0D%0AinnerHeight: ${window.innerHeight}`;
+ }
+
+ closeBugReport(close) {
+ setTimeout(() => close(), 1);
+ }
}
+
+
+
diff --git a/src/app/documentation/documentation.component.html b/src/app/documentation/documentation.component.html
index 3ff12b0..51de978 100644
--- a/src/app/documentation/documentation.component.html
+++ b/src/app/documentation/documentation.component.html
@@ -1,9 +1,67 @@
-
Samples
+
Documentation
- Find the API documentation here: https://definma-api.apps.de1.bosch-iot-cloud.com/api-doc/
+ Find the API documentation here:
+
+ https://definma-api.apps.de1.bosch-iot-cloud.com/api-doc/
+
+
User levels
+
+
+
+ |
+ read sample data |
+ add samples/edit own |
+ read spectral data |
+ edit other's data |
+ maintain templates |
+ edit users |
+
+
+
+ read |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ write |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ dev |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ admin |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
Database model
-
+
diff --git a/src/app/documentation/documentation.component.scss b/src/app/documentation/documentation.component.scss
index 58a9ed8..49f650f 100644
--- a/src/app/documentation/documentation.component.scss
+++ b/src/app/documentation/documentation.component.scss
@@ -1,3 +1,5 @@
+@import "~@inst-iot/bosch-angular-ui-components/styles/variables/colors";
+
p {
margin-bottom: 20px;
}
@@ -5,3 +7,11 @@ p {
img#db-structure {
width: 100%;
}
+
+.rb-ic-checkmark-frame {
+ color: $brand-success;
+}
+
+.rb-ic-abort-frame {
+ color: $brand-danger;
+}
diff --git a/src/app/models/sample.model.ts b/src/app/models/sample.model.ts
index 26cea2b..fd5f741 100644
--- a/src/app/models/sample.model.ts
+++ b/src/app/models/sample.model.ts
@@ -1,4 +1,5 @@
import pick from 'lodash/pick';
+import cloneDeep from 'lodash/cloneDeep';
import {IdModel} from './id.model';
import {MaterialModel} from './material.model';
import {MeasurementModel} from './measurement.model';
@@ -10,12 +11,13 @@ export class SampleModel extends BaseModel {
number = '';
type = '';
batch = '';
- condition: {condition_template: string, [prop: string]: string} | {} = {};
+ condition: {condition_template: string, [prop: string]: string} = {condition_template: null};
material_id: IdModel = null;
material: MaterialModel;
measurements: MeasurementModel[] = [];
note_id: IdModel = null;
user_id: IdModel = null;
+ validate = false;
notes: {
comment: string,
sample_references: {sample_id: IdModel, relation: string}[],
@@ -39,6 +41,14 @@ export class SampleModel extends BaseModel {
}
sendFormat() {
- return pick(this, ['color', 'type', 'batch', 'condition', 'material_id', 'notes']);
+ return pick(this.conditionTemplateCheck(), ['color', 'type', 'batch', 'condition', 'material_id', 'notes']);
+ }
+
+ private conditionTemplateCheck() {
+ const res = cloneDeep(this);
+ if (res.condition.condition_template === null) {
+ res.condition = {};
+ }
+ return res;
}
}
diff --git a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.html b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.html
index 6e4f70d..fdfd5f0 100644
--- a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.html
+++ b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.html
@@ -1,4 +1,4 @@
diff --git a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.scss b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.scss
index e69de29..8cb83b5 100644
--- a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.scss
+++ b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.scss
@@ -0,0 +1,8 @@
+.icon-space {
+ margin-right: 0.1em !important;
+}
+
+button.rb-btn > span:not(.icon-space) {
+ margin-right: -10px;
+ margin-left: -10px;
+}
diff --git a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.ts b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.ts
index 8896e99..413e430 100644
--- a/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.ts
+++ b/src/app/rb-custom-inputs/rb-icon-button/rb-icon-button.component.ts
@@ -11,6 +11,7 @@ export class RbIconButtonComponent implements OnInit {
@Input() icon: string;
@Input() mode: string;
+ @Input() iconOnly;
@Input() disabled;
@Input() type = 'button';
diff --git a/src/app/rb-custom-inputs/rb-table/rb-table.component.html b/src/app/rb-custom-inputs/rb-table/rb-table.component.html
index 5e3c6a4..6bbb804 100644
--- a/src/app/rb-custom-inputs/rb-table/rb-table.component.html
+++ b/src/app/rb-custom-inputs/rb-table/rb-table.component.html
@@ -1,5 +1,4 @@
-
-
+
diff --git a/src/app/sample/sample.component.html b/src/app/sample/sample.component.html
index 5780178..6260eda 100644
--- a/src/app/sample/sample.component.html
+++ b/src/app/sample/sample.component.html
@@ -2,32 +2,33 @@
-