Commit 415c5765 authored by François Agneray's avatar François Agneray
Browse files

Change dataset config and add render detail config

parent d6576528
Pipeline #5304 passed with stages
in 10 minutes and 33 seconds
......@@ -4,8 +4,9 @@
<tr>
<th style="min-width:150px">Name</th>
<th style="width:50px">Visible</th>
<th style="min-width:140px;width:140px;">Display detail</th>
<th style="min-width:150px">Renderer</th>
<th style="min-width:100px;width:100px;">Display detail</th>
<th style="min-width:200px">Renderer config</th>
<th style="width:50px">Save</th>
</tr>
</thead>
......
......@@ -4,6 +4,10 @@
<td>
<input type="checkbox" class="form-control" name="detail" (change)="newFunction()" [formControl]="detailForm.controls.detail">
</td>
<td>
<input *ngIf="detailForm.controls.detail.value" type="number" class="form-control" name="display_detail"
[formControl]="detailForm.controls.display_detail" required>
</td>
<td>
<select *ngIf="detailForm.controls.detail.value" class="form-control" name="renderer_detail"
(change)="rendererDetailOnChange($event.target.value)" [formControl]="detailForm.controls.renderer_detail">
......@@ -13,8 +17,7 @@
</select>
</td>
<td>
<input *ngIf="detailForm.controls.detail.value" type="number" class="form-control" name="display_detail"
[formControl]="detailForm.controls.display_detail" required>
</td>
<td class="text-center align-middle">
<button (click)="emitSave()" [disabled]="detailForm.invalid || detailForm.pristine" class="btn btn-outline-primary">
......
......@@ -29,7 +29,7 @@
<a class="nav-link" routerLink="./" [queryParams]="{tab_selected: 'detail'}" [ngClass]="{'active': tabSelected === 'detail'}">Detail</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="./" [queryParams]="{tab_selected: 'vo'}" [ngClass]="{'active': tabSelected === 'vo'}">VO</a>
<a class="nav-link" routerLink="./" [queryParams]="{tab_selected: 'vo'}" [ngClass]="{'disabled': !getVoEnabled(), 'active': tabSelected === 'vo'}">VO</a>
</li>
<li class="nav-item ml-auto">
<a class="nav-link" routerLink="./" [queryParams]="{tab_selected: 'cfamilies'}" [ngClass]="{'active': tabSelected === 'cfamilies'}">Criteria Families</a>
......
......@@ -4,7 +4,7 @@ import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
import { SettingsSelect, SettingsSelectOption } from '../../../settings/store/model';
import { Attribute, Column, CriteriaFamily, OutputCategory, OutputFamily } from '../../store/model';
import { Attribute, Column, CriteriaFamily, Dataset, OutputCategory, OutputFamily } from '../../store/model';
@Component({
selector: 'app-form-attribute-list',
......@@ -13,6 +13,7 @@ import { Attribute, Column, CriteriaFamily, OutputCategory, OutputFamily } from
changeDetection: ChangeDetectionStrategy.OnPush
})
export class FormAttributeListComponent {
@Input() dataset: Dataset;
@Input() attributeList: Attribute[];
@Input() columnList: Column[];
@Input() optionListGenerated: string[];
......@@ -44,6 +45,10 @@ export class FormAttributeListComponent {
this.modalRef = this.modalService.show(template);
}
getVoEnabled(): boolean {
return this.dataset.config.results_format.vo;
}
alreadyExists(columnName: string): boolean {
return this.attributeList.map(a => a.name).includes(columnName);
}
......
......@@ -83,19 +83,19 @@
</accordion-group>
<accordion-group heading="Page result configuration">
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="results_server_link" name="results_server_link" [ngModel]="getConfig('results_server_link')">
<input class="custom-control-input" type="checkbox" id="results_server_link" name="results_server_link" [ngModel]="getConfigResultPageModules('results_server_link')">
<label class="custom-control-label" for="results_server_link">Display server link to the results</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="opened_datatable" name="opened_datatable" [ngModel]="getConfig('opened_datatable')">
<input class="custom-control-input" type="checkbox" id="opened_datatable" name="opened_datatable" [ngModel]="getConfigResultPageModules('opened_datatable')">
<label class="custom-control-label" for="opened_datatable">Open the results datatable accordion</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="selectable_row" name="selectable_row" [ngModel]="getConfig('selectable_row')">
<input class="custom-control-input" type="checkbox" id="selectable_row" name="selectable_row" [ngModel]="getConfigResultPageModules('selectable_row')">
<label class="custom-control-label" for="selectable_row">Datatable rows selectable</label>
</div>
</accordion-group>
<accordion-group heading="Search and data download">
<accordion-group heading="Results format">
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="download_result_csv" name="download_result_csv" [ngModel]="getConfigDownloadResultFormat('csv')">
<label class="custom-control-label" for="download_result_csv">Display download results button in CSV format</label>
......@@ -104,22 +104,10 @@
<input class="custom-control-input" type="checkbox" id="download_result_ascii" name="download_result_ascii" [ngModel]="getConfigDownloadResultFormat('ascii')">
<label class="custom-control-label" for="download_result_ascii">Display download results button in ASCII format</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="download_result_spectra" name="download_result_spectra" [ngModel]="getConfigDownloadResultFormat('spectra')">
<label class="custom-control-label" for="download_result_spectra">Display download results button in Spectra format</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="download_result_stamp" name="download_result_stamp" [ngModel]="getConfigDownloadResultFormat('stamp')">
<label class="custom-control-label" for="download_result_stamp">Display download results button in Stamp format</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="download_result_vo" name="download_result_vo" [ngModel]="getConfigDownloadResultFormat('vo')">
<label class="custom-control-label" for="download_result_vo">Display download results button in VO format</label>
</div>
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" id="download_result_fits" name="download_result_fits" [ngModel]="getConfigDownloadResultFormat('fits')">
<label class="custom-control-label" for="download_result_fits">Display download results button in FITS format</label>
</div>
</accordion-group>
</accordion>
<div class="form-group mt-3">
......
......@@ -89,16 +89,16 @@ export class FormDatasetComponent {
}
}
getConfig(key: string): boolean {
if (this.model.config && this.model.config[key]) {
return this.model.config[key];
getConfigResultPageModules(key: string): boolean {
if (this.model.config && this.model.config.result_page_modules && this.model.config.result_page_modules[key]) {
return this.model.config.result_page_modules[key];
}
return false;
}
getConfigDownloadResultFormat(format: string): boolean {
if (this.model.config && this.model.config.download_results_format && this.model.config.download_results_format[format]) {
return this.model.config.download_results_format[format];
if (this.model.config && this.model.config.results_format && this.model.config.results_format[format]) {
return this.model.config.results_format[format];
}
return false;
}
......@@ -122,16 +122,15 @@ export class FormDatasetComponent {
column_dec: +this.ngForm.form.value.column_dec,
plot_enabled: this.ngForm.form.value.plot_enabled
},
results_server_link: this.ngForm.form.value.results_server_link,
opened_datatable: this.ngForm.form.value.opened_datatable,
selectable_row: this.ngForm.form.value.selectable_row,
download_results_format: {
result_page_modules: {
results_server_link: this.ngForm.form.value.results_server_link,
opened_datatable: this.ngForm.form.value.opened_datatable,
selectable_row: this.ngForm.form.value.selectable_row
},
results_format: {
csv: this.ngForm.form.value.download_result_csv,
ascii: this.ngForm.form.value.download_result_ascii,
spectra: this.ngForm.form.value.download_result_spectra,
stamp: this.ngForm.form.value.download_result_stamp,
vo: this.ngForm.form.value.download_result_vo,
fits: this.ngForm.form.value.download_result_fits
vo: this.ngForm.form.value.download_result_vo
}
};
this.submitted.emit(datasetEmitted);
......
......@@ -9,15 +9,16 @@
</ol>
</nav>
<div *ngIf="attributeListIsLoading | async" class="row justify-content-center mt-5">
<div *ngIf="(attributeListIsLoading | async) || (datasetListIsLoading | async)" class="row justify-content-center mt-5">
<span class="fas fa-circle-notch fa-spin fa-3x"></span>
<span class="sr-only">Loading...</span>
</div>
<div *ngIf="(attributeListIsLoaded | async)">
<div *ngIf="(attributeListIsLoaded | async) && (datasetListIsLoaded | async)">
<div class="row mt-1">
<div class="col-12">
<app-form-attribute-list
[dataset]="dataset | async"
[attributeList]="attributeList | async"
[columnList]="columnList | async"
[optionListGenerated]="optionListGenerated | async"
......
......@@ -33,10 +33,10 @@ import * as databaseSelector from '../../store/selector/database.selector';
export class AttributeComponent implements OnInit {
public instanceSelected: Observable<string>;
public datasetSelected: Observable<string>;
public tabSelected: Observable<string>;
public dataset: Observable<Dataset>;
public datasetListIsLoading: Observable<boolean>;
public datasetListIsLoaded: Observable<boolean>;
public datasetList: Observable<Dataset[]>;
public tabSelected: Observable<string>;
public attributeList: Observable<Attribute[]>;
public attributeListIsLoading: Observable<boolean>;
public attributeListIsLoaded: Observable<boolean>;
......@@ -53,10 +53,10 @@ export class AttributeComponent implements OnInit {
constructor(private store: Store<{settings: fromSettings.State, metamodel: fromMetamodel.State}>) {
this.instanceSelected = store.select(instanceSelector.getInstanceSelected);
this.datasetSelected = store.select(datasetSelector.getDatasetSelected);
this.tabSelected = store.select(attributeSelector.getTabSelectedQueryParam);
this.dataset = store.select(datasetSelector.getDatasetByRouteName);
this.datasetListIsLoading = store.select(datasetSelector.getDatasetListIsLoading);
this.datasetListIsLoaded = store.select(datasetSelector.getDatasetListIsLoaded);
this.datasetList = store.select(datasetSelector.getDatasetList);
this.tabSelected = store.select(attributeSelector.getTabSelectedQueryParam);
this.attributeList = store.select(attributeSelector.getAttributeList);
this.attributeListIsLoading = store.select(attributeSelector.getAttributeListIsLoading);
this.attributeListIsLoaded = store.select(attributeSelector.getAttributeListIsLoaded);
......
<div class="container-fluid">
<nav aria-label="breadcrumb">
<div *ngIf="(instanceListIsLoading | async)"
class="row justify-content-center mt-5">
<span class="fas fa-circle-notch fa-spin fa-3x"></span>
<span class="sr-only">Loading...</span>
</div>
<nav *ngIf="(instanceListIsLoaded | async)" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a routerLink="/instance-list">Instances</a></li>
<li class="breadcrumb-item active" aria-current="page">Configure instance {{ (instance | async).label }}
......
......@@ -17,6 +17,8 @@ import * as metamodelReducer from '../../store/reducer';
})
export class ConfigureInstanceComponent implements OnInit {
public instance: Observable<Instance>;
public instanceListIsLoading: Observable<boolean>;
public instanceListIsLoaded: Observable<boolean>;
public datasetFamilyListIsLoading: Observable<boolean>;
public datasetFamilyListIsLoaded: Observable<boolean>;
public datasetFamilyList: Observable<DatasetFamily[]>;
......@@ -26,6 +28,8 @@ export class ConfigureInstanceComponent implements OnInit {
constructor(private store: Store<metamodelReducer.State>) {
this.instance = store.select(instanceSelector.getInstanceByRouteName);
this.instanceListIsLoading = store.select(instanceSelector.getInstanceListIsLoading);
this.instanceListIsLoaded = store.select(instanceSelector.getInstanceListIsLoaded);
this.datasetFamilyListIsLoading = store.select(datasetFamilySelector.getDatasetFamilyListIsLoading);
this.datasetFamilyListIsLoaded = store.select(datasetFamilySelector.getDatasetFamilyListIsLoaded);
this.datasetFamilyList = store.select(datasetFamilySelector.getDatasetFamilyList);
......
......@@ -19,16 +19,15 @@ export class Dataset implements Displayable {
column_dec: number;
plot_enabled: boolean;
};
results_server_link: boolean;
opened_datatable: boolean;
selectable_row: boolean;
download_results_format: {
result_page_modules: {
results_server_link: boolean;
opened_datatable: boolean;
selectable_row: boolean;
}
results_format: {
csv: boolean;
ascii: boolean;
spectra: boolean;
stamp: boolean;
vo: boolean;
fits: boolean;
};
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment