fixed changelog paging

This commit is contained in:
VLE2FE
2020-08-28 16:58:35 +02:00
parent 52e0d94e61
commit 08d5ac8366
26 changed files with 251 additions and 87 deletions

View File

@ -13,13 +13,14 @@
[rbFormInputAutocomplete]="autocomplete.bind(this, materialNames)" appValidate="stringOf"
(keydown)="preventDefault($event)" (ngModelChange)="findMaterial($event)" ngModel
[appValidateArgs]="[materialNames]" required [(ngModel)]="material.name" [autofocus]="true"
*ngIf="baseSample.material.name !== undefined || mode === 'new'"
*ngIf="mode === 'new' || (baseSample.material && baseSample.material.name !== undefined)"
title="trade name of the material, eg. Ultradur B4300 G6">
<ng-template rbFormValidationMessage="required">Cannot be empty</ng-template>
<ng-template rbFormValidationMessage="failure">Unknown material, add properties for new material</ng-template>
</rb-form-input>
<rb-icon-button class="set-new-material space-below" icon="add" mode="secondary"
(click)="setNewMaterial(!newMaterial)" *ngIf="baseSample.material.name !== undefined">
(click)="setNewMaterial(!newMaterial)"
*ngIf="mode === 'new' || (baseSample.material && baseSample.material.name !== undefined)">
New material
</rb-icon-button>
</div>

View File

@ -118,6 +118,7 @@ export class SampleComponent implements OnInit, AfterContentChecked {
) { }
ngOnInit(): void {
console.log(this.baseSample);
this.mode = this.router.url === '/samples/new' ? 'new' : '';
this.loading = 7;
this.d.load('materials', () => {
@ -378,8 +379,6 @@ export class SampleComponent implements OnInit, AfterContentChecked {
cmSave() { // save measurements and conditions
this.samples.forEach(sample => {
if (sample.condition.condition_template) { // condition was set
console.log(sample.condition);
console.log(this.d.id.conditionTemplates[sample.condition.condition_template]);
this.api.put('/sample/' + sample._id,
{condition: pick(sample.condition,
['condition_template', ...this.d.id.conditionTemplates[sample.condition.condition_template].parameters.map(e => e.name)]