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

#37 => done

parent 848de695
Pipeline #2636 passed with stages
in 13 minutes and 4 seconds
......@@ -57,6 +57,24 @@
</div>
</div>
</div>
<hr>
<h4>Cone-Search : </h4>
<div class="form-group">
<div class="form-row">
<div class="col-auto">
<label for="cone_search">Enabled</label>
<input type="checkbox" class="form-control" name="cone_search" [ngModel]="getConfigConeSearchEnabled()">
</div>
<div class="col-auto">
<label for="column_ra">Column RA</label>
<input type="number" class="form-control" name="column_ra" [ngModel]="getConfigColumnRa()">
</div>
<div class="col-auto">
<label for="column_dec">Column DEC</label>
<input type="number" class="form-control" name="column_dec" [ngModel]="getConfigColumnDec()">
</div>
</div>
</div>
<div class="form-group">
<ng-content></ng-content>
</div>
......
......@@ -25,6 +25,30 @@ export class FormDatasetComponent {
this.changeProject.emit(this.projectList.find(project => project.name === projectName).id_database);
}
getConfigConeSearchEnabled() {
if (this.model.config.cone_search) {
return this.model.config.cone_search.enabled;
} else {
return false;
}
}
getConfigColumnRa() {
if (this.model.config.cone_search) {
return this.model.config.cone_search.column_ra;
} else {
return 0;
}
}
getConfigColumnDec() {
if (this.model.config.cone_search) {
return this.model.config.cone_search.column_dec;
} else {
return 0;
}
}
emit(dataset: Dataset) {
let datasetEmitted: Dataset;
(this.model.name) ? datasetEmitted = {name: this.model.name, ...dataset} : datasetEmitted = dataset;
......@@ -40,7 +64,13 @@ export class FormDatasetComponent {
if (this.idDatasetFamilyQueryParam > 0) {
datasetEmitted.id_dataset_family = this.idDatasetFamilyQueryParam;
}
datasetEmitted.config = {};
datasetEmitted.config = {
cone_search: {
enabled: this.ngForm.form.value.cone_search,
column_ra: this.ngForm.form.value.column_ra,
column_dec: this.ngForm.form.value.column_dec
}
};
this.submitted.emit(datasetEmitted);
}
}
......@@ -10,7 +10,13 @@ export class Dataset implements Displayable {
vo: boolean;
data_path: string;
selectable_row: boolean;
config: {};
config: {
cone_search: {
enabled: boolean;
column_ra: number;
column_dec: number;
}
};
project_name: string;
id_dataset_family: number;
}
Supports Markdown
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