Commit adb96ae3 authored by Tifenn Guillas's avatar Tifenn Guillas

Dataset label instead of dataset name => DONE, Update tests and comments =>...

Dataset label instead of dataset name => DONE, Update tests and comments => DONE, Update changelog => DONE
parent fda5d5df
......@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.6.0] - 2021-xx
### Changed
- #155 => Display dataset label instead of dataset name in result page
## [3.5.0] - 2020-12
### Added
- #140 => Add description tooltip on search multiple datasets page
......
<div *ngIf="dataLengthIsLoaded" class="jumbotron mb-4 py-4">
<div class="lead">Dataset <span class="bold">{{ datasetName }}</span> selected with <span
<div class="lead">Dataset <span class="bold">{{ getDatasetLabel() }}</span> selected with <span
class="bold">{{ dataLength }}</span> objects found.</div>
<hr class="my-4">
<div class="row">
......
......@@ -26,6 +26,12 @@ describe('[Search][Result] Component: DownloadComponent', () => {
component.ngOnInit();
});
it('#getDatasetLabel() should return the dataset label', () => {
component.datasetList = DATASET_LIST;
component.datasetName = 'cat_1';
expect(component.getDatasetLabel()).toEqual('Cat 1');
});
it('#getConfigDownloadResultFormat() should return if download button for the given format has to be displayed', () => {
component.datasetList = DATASET_LIST;
component.datasetName = 'cat_1';
......
......@@ -40,6 +40,16 @@ export class DownloadComponent implements OnInit {
this.getDataLength.emit();
}
/**
* Returns dataset label.
*
* @return string
*/
getDatasetLabel(): string {
const dataset = this.datasetList.find(dataset => dataset.name === this.datasetName);
return dataset.label;
}
/**
* Checks if the download format is allowed by Anis Admin configuration.
*
......
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