added condition checkbox in JSON download link dialog

This commit is contained in:
VLE2FE 2020-08-11 16:25:09 +02:00
parent 79a2ad59f2
commit 40afc348e1
2 changed files with 9 additions and 2 deletions

View File

@ -111,7 +111,10 @@
<rb-form-checkbox class="space-right" name="download-spectra" [(ngModel)]="downloadSpectra">
add spectra
</rb-form-checkbox>
<rb-form-checkbox name="download-flatten" [(ngModel)]="downloadFlatten">
<rb-form-checkbox class="space-right" name="download-conditions" [(ngModel)]="downloadCondition">
add conditions
</rb-form-checkbox>
<rb-form-checkbox class="space-right" name="download-flatten" [(ngModel)]="downloadFlatten">
flatten object
</rb-form-checkbox>
<rb-icon-button icon="clipboard" mode="secondary" (click)="clipboard()">Copy to clipboard</rb-icon-button>

View File

@ -34,7 +34,8 @@ export class SamplesComponent implements OnInit {
@ViewChild('pageSizeSelection') pageSizeSelection: ElementRef<HTMLElement>;
@ViewChild('linkarea') linkarea: ElementRef<HTMLTextAreaElement>;
downloadSpectra = false;
downloadSpectra = false; // TODO: streamline these options after csv option handling is clear
downloadCondition = false;
downloadFlatten = true;
samples: SampleModel[] = [];
totalSamples = 0; // total number of samples
@ -236,6 +237,9 @@ export class SamplesComponent implements OnInit {
if (this.downloadSpectra) {
query.push('fields[]=measurements.spectrum.dpt');
}
if (this.downloadCondition) {
query.push('fields[]=condition');
}
}
return (options.host && isDevMode() ? window.location.host : '') +
(options.export ? this.api.hostName : '') +