Skip to content

Commit

Permalink
Exclude user data as reference (#773)
Browse files Browse the repository at this point in the history
* user dataset can be selected max n-1 times, as it can not be spatial reference

* user dataset can not be selected as the spatial reference

* explanation added to the tooltip

* release note updated
  • Loading branch information
sheenaze authored Nov 7, 2023
1 parent 747e3dd commit 010bf2f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ export class DatasetComponent implements OnInit {
this.datasets$ = this.allDatasets$.pipe(map<DatasetDto[], DatasetDto[]>(datasets => {
return this.sortById(datasets.filter(dataset => dataset.pretty_name !== 'ISMN'));
}));
} else {
} else if(configs.filter(config => config.datasetModel.selectedDataset.user).length == configs.length - 1 && !this.selectionModel.selectedDataset?.user){
this.datasets$ = this.allDatasets$.pipe(map<DatasetDto[], DatasetDto[]>(datasets => {
return this.sortById(datasets.filter(dataset => !dataset.user));
}));
}
else {
this.datasets$ = this.allDatasets$.pipe(map<DatasetDto[], DatasetDto[]>(datasets => {
return this.sortById(datasets);
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ export class ValidationReferenceComponent implements OnInit {
if (this.referenceType === 'spatialReference$'){
const listOfISMNDatasets = this.validationModel.datasetConfigurations.filter(dataset =>
dataset.datasetModel.selectedDataset?.short_name === 'ISMN');
const listOfServiceDatasets = this.validationModel.datasetConfigurations.filter(dataset =>
!dataset.datasetModel.selectedDataset?.user);
if (listOfISMNDatasets.length !== 0){
this.chosenDatasets$.next(listOfISMNDatasets);
} else if (listOfServiceDatasets.length < this.validationModel.datasetConfigurations.length) {
this.chosenDatasets$.next(listOfServiceDatasets);
}
}
return this.chosenDatasets$;
Expand Down
4 changes: 3 additions & 1 deletion UI/src/app/pages/validate/validate.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ <h5 class="pt-2">
<div class="pt-2">
<label for="spatial-reference"
class="mb-4"
pTooltip="Choose the spatial reference dataset. If the ISMN dataset belongs to the dataset pool, it has to be chosen as the spatial reference."
pTooltip="Choose the spatial reference dataset. If the ISMN dataset belongs to the dataset pool,
it has to be chosen as the spatial reference. Due to technical limitations, user dataset
can't be chosen as the spatial reference."
tooltipPosition="bottom">
<span class="pi pi-question-circle"></span>
Spatial reference
Expand Down
4 changes: 3 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
QA4SM v2.4.4 - Release notes 2023-11-06
QA4SM v2.4.4 - Release notes 2023-11-07
=======================================================
# Updates
1. New dataset filters added
2. New version of ASCAT dataset added
3. ERA Land data period extended
4. User data can not be used as spatial reference

QA4SM v2.4.3 - Release notes 2023-10-18
=======================================================
Expand Down

0 comments on commit 010bf2f

Please sign in to comment.