small fixes

This commit is contained in:
VLE2FE 2020-09-02 14:11:00 +02:00
parent cd4e2aa77b
commit 78093ce2ff
7 changed files with 26 additions and 20 deletions

View File

@ -53,7 +53,8 @@ export class AppComponent implements OnInit{
}
bugReportContent() {
return `mailto:lukas.veit@de.bosch.com?subject=Bug report&body=Thanks for sending the report! Your bug will be (hopefully) fixed soon.
return `mailto:${this.d.contact.mail}?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: ${this.window.location}%0D%0A%0D%0AWhat did you do?%0D%0A${encodeURIComponent(this.bugReport.do)}

View File

@ -97,6 +97,8 @@ export class MaterialComponent implements OnInit, AfterContentChecked {
materialSave() {
this.api.put('/material/' + this.material._id, this.material.sendFormat(), () => {
delete this.d.arr.materials;
this.d.load('materials');
this.router.navigate(['/materials']);
});
}

View File

@ -122,14 +122,13 @@ export class RbArrayInputComponent implements ControlValueAccessor, OnInit, Afte
this.values = [this.values[0]];
res = this.values;
}
// if (!res.length) {
// res = [''];
// }
if (!res.length) {
res = [''];
}
this.onChange(res); // trigger ngModel with filled elements
}
writeValue(obj: any) { // add empty value on init
console.log(obj);
if (obj) {
if (this.pushTemplate !== null) {
if (this.pushPath) {

View File

@ -339,6 +339,7 @@ export class SamplesComponent implements OnInit {
updateFilterFields(field) {
const filter = this.filters.filters.find(e => e.field === field);
console.log(filter);
filter.active = !(filter.values.length === 1 && filter.values[0] === '');
}

View File

@ -93,24 +93,23 @@ export class TemplatesComponent implements OnInit {
}
});
if (valid) {
console.log('valid', template);
const sendData = {name: template.name, parameters: template.parameters.map(e => omit(e, ['rangeString']))};
if (first_id === 'null') {
this.api.post<TemplateModel>(`/template/${this.collection}/new`, sendData, data => {
if (data.version > template.version) { // there were actual changes and a new version was created
this.templates.push(data);
}
this.templateFormat();
this.d.idReload(this.collection + 'Templates');
this.api.post<TemplateModel>(`/template/${this.collection}/new`, sendData, () => {
delete this.d.arr[this.collection + 'Templates'];
this.d.load(this.collection + 'Templates', () => {
this.templates = this.d.arr[this.collection + 'Templates'];
this.templateFormat();
});
});
}
else {
this.api.put<TemplateModel>(`/template/${this.collection}/${template.first_id}`, sendData, data => {
if (data.version > template.version) { // there were actual changes and a new version was created
this.templates.push(data);
}
this.templateFormat();
this.d.idReload(this.collection + 'Templates');
this.api.put<TemplateModel>(`/template/${this.collection}/${template.first_id}`, sendData, () => {
delete this.d.arr[this.collection + 'Templates'];
this.d.load(this.collection + 'Templates', () => {
this.templates = this.d.arr[this.collection + 'Templates'];
this.templateFormat();
});
});
}
}

View File

@ -1,7 +1,7 @@
<rb-icon-button icon="add" mode="primary" (click)="addNewUser()">New user</rb-icon-button>
<rb-icon-button icon="add" mode="primary" (click)="addNewUser()" class="space-below">New user</rb-icon-button>
<form *ngIf="newUser" #userForm="ngForm">
<form *ngIf="newUser" #userForm="ngForm" class="space-below">
<rb-form-input name="name" label="user name" appValidate="username" required [(ngModel)]="newUser.name"
#nameInput="ngModel">
<ng-template rbFormValidationMessage="failure">{{nameInput.errors.failure}}</ng-template>

View File

@ -10,3 +10,7 @@ td:last-child rb-icon-button {
width: 100%;
}
}
rb-form-select {
min-width: 150px;
}