diff --git a/client/src/app/instance/search-multiple/components/index.ts b/client/src/app/instance/search-multiple/components/index.ts index 53355e402864869e82505c5ac93da6e6c7da61ec..f96bfa83836d525bd1d0d20a35c99aacd4fce382 100644 --- a/client/src/app/instance/search-multiple/components/index.ts +++ b/client/src/app/instance/search-multiple/components/index.ts @@ -1,11 +1,9 @@ import { ProgressBarMultipleComponent } from './progress-bar-multiple.component'; -import { SummaryMultipleComponent } from './summary-multiple.component'; import { datasetsComponents } from './datasets'; import { resultComponents } from './result'; export const dummiesComponents = [ ProgressBarMultipleComponent, - SummaryMultipleComponent, datasetsComponents, resultComponents ]; diff --git a/client/src/app/instance/search-multiple/components/summary-multiple.component.html b/client/src/app/instance/search-multiple/components/summary-multiple.component.html deleted file mode 100644 index 3d60496597bb4fde521dab330da270201431178a..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search-multiple/components/summary-multiple.component.html +++ /dev/null @@ -1,59 +0,0 @@ -<div class="border rounded"> - <p class="lead text-center border-bottom bg-light py-3">Search summary</p> - - <!-- Position --> - <p class="text-center font-italic"> - Position - </p> - <span *ngIf="coneSearch" class="pl-5"> - Cone search: - <ul class="ml-3 pl-5 list-unstyled"> - <li>RA = {{ coneSearch.ra }}°</li> - <li>DEC = {{ coneSearch.dec }}°</li> - <li>radius = {{ coneSearch.radius }} arcsecond</li> - </ul> - </span> - <p *ngIf="!coneSearch" class="pl-5 text-danger font-weight-bold"> - Not valid position! - </p> - <hr> - - <!-- Dataset List --> - <p class="text-center font-italic"> - Datasets - </p> - <div> - <p *ngIf="selectedDatasets.length < 1" class="pl-5 text-danger font-weight-bold"> - At least 1 dataset required! - </p> - <div *ngIf="selectedDatasets.length > 0"> - <!-- Accordion Dataset families --> - <accordion [isAnimated]="true"> - <accordion-group *ngFor="let datasetFamily of getDatasetFamilyList()" #ag panelClass="abstract-accordion" [isOpen]="accordionFamilyIsOpen" class="pl-5"> - <button class="btn btn-link btn-block clearfix pb-1 text-primary" accordion-heading> - <div class="pull-left float-left"> - {{ datasetFamily.label }} - - <span *ngIf="ag.isOpen"> - <span class="fas fa-chevron-up"></span> - </span> - <span *ngIf="!ag.isOpen"> - <span class="fas fa-chevron-down"></span> - </span> - </div> - </button> - - <!-- Selected Datasets --> - <ul *ngIf="getSelectedDatasetsByFamily(datasetFamily.id).length > 0; else noDataset" class="mb-0 pl-4 list-unstyled"> - <li *ngFor="let dataset of getSelectedDatasetsByFamily(datasetFamily.id)" class="pb-1"> - {{ dataset.label }} - </li> - </ul> - <ng-template #noDataset> - <p class="mb-1 pl-4">No selected dataset</p> - </ng-template> - </accordion-group> - </accordion> - </div> - </div> -</div> diff --git a/client/src/app/instance/search-multiple/components/summary-multiple.component.scss b/client/src/app/instance/search-multiple/components/summary-multiple.component.scss deleted file mode 100644 index c837d14e1ce994aeb0857803139aaad3fd7f8d6d..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search-multiple/components/summary-multiple.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file is part of Anis Client. - * - * @copyright Laboratoire d'Astrophysique de Marseille / CNRS - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -li>span { - cursor: pointer; -} diff --git a/client/src/app/instance/search-multiple/components/summary-multiple.component.spec.ts b/client/src/app/instance/search-multiple/components/summary-multiple.component.spec.ts deleted file mode 100644 index 37133619d27c1201b33d16de6774f0e9243e0cb2..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search-multiple/components/summary-multiple.component.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - -import { AccordionModule } from 'ngx-bootstrap/accordion'; -import { TooltipModule } from 'ngx-bootstrap/tooltip'; - -import { SummaryMultipleComponent } from './summary-multiple.component'; -import { DATASET, DATASET_FAMILY_LIST, DATASET_LIST } from '../../../../test-data'; - -describe('[Instance][SearchMultiple][Component] SummaryMultipleComponent', () => { - let component: SummaryMultipleComponent; - let fixture: ComponentFixture<SummaryMultipleComponent>; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [SummaryMultipleComponent], - imports: [ - AccordionModule.forRoot(), - TooltipModule.forRoot(), - BrowserAnimationsModule - ] - }); - fixture = TestBed.createComponent(SummaryMultipleComponent); - component = fixture.componentInstance; - }); - - it('should create the component', () => { - expect(component).toBeTruthy(); - }); - - it('#getDatasetFamilyList() should return list of dataset families that contains datasets with cone search enabled', () => { - component.datasetFamilyList = DATASET_FAMILY_LIST; - component.datasetList = [DATASET]; - expect(component.getDatasetFamilyList()[0].label).toBe('My first dataset family'); - }); - - it('#getSelectedDatasetsByFamily() should return list of selected datasets for the given dataset family', () => { - component.datasetList = DATASET_LIST; - component.selectedDatasets = ['myDataset']; - expect(component.getSelectedDatasetsByFamily(1).length).toEqual(1); - expect(component.getSelectedDatasetsByFamily(1)[0].name).toEqual('myDataset'); - }); -}); diff --git a/client/src/app/instance/search-multiple/components/summary-multiple.component.ts b/client/src/app/instance/search-multiple/components/summary-multiple.component.ts deleted file mode 100644 index fb6900bee9918b8a0ff344e25a881f3b67224841..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search-multiple/components/summary-multiple.component.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * This file is part of Anis Client. - * - * @copyright Laboratoire d'Astrophysique de Marseille / CNRS - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; - -import { SearchMultipleQueryParams, ConeSearch } from 'src/app/instance/store/models'; -import { Dataset, DatasetFamily } from 'src/app/metamodel/models'; - -/** - * @class - * @classdesc Summary multiple component. - */ -@Component({ - selector: 'app-summary-multiple', - templateUrl: 'summary-multiple.component.html', - styleUrls: ['summary-multiple.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class SummaryMultipleComponent { - @Input() currentStep: string; - @Input() coneSearch: ConeSearch; - @Input() selectedDatasets: string[]; - @Input() queryParams: SearchMultipleQueryParams; - @Input() datasetFamilyList: DatasetFamily[]; - @Input() datasetList: Dataset[]; - - accordionFamilyIsOpen = true; - - /** - * Returns dataset families that contains datasets with cone search enabled. - * - * @return Family[] - */ - getDatasetFamilyList(): DatasetFamily[] { - const familiesId: number[] = []; - this.datasetList.forEach(d => { - if (!familiesId.includes(d.id_dataset_family)) { - familiesId.push(d.id_dataset_family); - } - }); - return this.datasetFamilyList.filter(f => familiesId.includes(f.id)); - } - - /** - * Returns dataset list for the given dataset family ID. - * - * @param {number} familyId - The family ID. - * - * @return Dataset[] - */ - getSelectedDatasetsByFamily(familyId: number): Dataset[] { - return this.datasetList - .filter(d => d.id_dataset_family === familyId) - .filter(d => this.selectedDatasets.includes(d.name)); - } -} diff --git a/client/src/app/instance/search-multiple/containers/datasets.component.html b/client/src/app/instance/search-multiple/containers/datasets.component.html index 3a2a1fa0eba99a1d529c638d24465179bf335a32..5852145ab4bee6d555c60a46f0b84f6eb06f553c 100644 --- a/client/src/app/instance/search-multiple/containers/datasets.component.html +++ b/client/src/app/instance/search-multiple/containers/datasets.component.html @@ -2,7 +2,7 @@ </app-spinner> <div *ngIf="(datasetFamilyListIsLoaded | async) && (datasetListIsLoaded | async)" class="row mt-4"> - <div class="col-12 col-md-8 col-lg-9"> + <div class="col-12"> <div class="border rounded my-2"> <p class="border-bottom bg-light text-primary mb-0 py-4 pl-4">Datasets</p> <div class="px-3"> @@ -15,16 +15,6 @@ </div> </div> </div> - <div class="col-12 col-md-4 col-lg-3 pt-2"> - <app-summary-multiple - [currentStep]="currentStep | async" - [coneSearch]="coneSearch | async" - [selectedDatasets]="selectedDatasets | async" - [queryParams]="queryParams | async" - [datasetFamilyList]="datasetFamilyList | async" - [datasetList]="datasetList | async"> - </app-summary-multiple> - </div> </div> <div class="row mt-5 justify-content-between"> diff --git a/client/src/app/instance/search-multiple/containers/position.component.html b/client/src/app/instance/search-multiple/containers/position.component.html index c12f7eee58be2fcc472afa3b853db897c874d433..24f6ec30ba505fd245e759129ca9373e3dba7bf5 100644 --- a/client/src/app/instance/search-multiple/containers/position.component.html +++ b/client/src/app/instance/search-multiple/containers/position.component.html @@ -2,7 +2,7 @@ </app-spinner> <div *ngIf="!(pristine | async) && (datasetFamilyListIsLoaded | async) && (datasetListIsLoaded | async)" class="row mt-4"> - <div class="col-12 col-md-8 col-lg-9"> + <div class="col-12"> <div class="border rounded my-2"> <p class="border-bottom bg-light text-primary mb-0 py-4 pl-4">Cone Search</p> <div class="row p-4"> @@ -26,16 +26,6 @@ </div> </div> </div> - <div class="col-12 col-md-4 col-lg-3 pt-2"> - <app-summary-multiple - [currentStep]="currentStep | async" - [coneSearch]="coneSearch | async" - [selectedDatasets]="selectedDatasets | async" - [queryParams]="queryParams | async" - [datasetFamilyList]="datasetFamilyList | async" - [datasetList]="datasetList | async"> - </app-summary-multiple> - </div> </div> <div *ngIf="coneSearch | async" class="row mt-5 justify-content-end"> diff --git a/client/src/app/instance/search/components/index.ts b/client/src/app/instance/search/components/index.ts index b14cc655237ef765f98ca6cdfa7be0f2edec429f..f4057d78828f281aaaf1903fdc286bdd24d240bd 100644 --- a/client/src/app/instance/search/components/index.ts +++ b/client/src/app/instance/search/components/index.ts @@ -1,5 +1,4 @@ import { ProgressBarComponent } from './progress-bar.component'; -import { SummaryComponent } from './summary.component'; import { AttributeLabelComponent } from './attribute-label.component'; import { datasetComponents } from './dataset'; import { criteriaComponents } from './criteria'; @@ -9,7 +8,6 @@ import { detailsComponents } from './detail'; export const dummiesComponents = [ ProgressBarComponent, - SummaryComponent, AttributeLabelComponent, datasetComponents, criteriaComponents, diff --git a/client/src/app/instance/search/components/summary.component.html b/client/src/app/instance/search/components/summary.component.html deleted file mode 100644 index 540ae349931a491fb589cea647bd0453b8f15073..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search/components/summary.component.html +++ /dev/null @@ -1,96 +0,0 @@ -<div class="border rounded"> - <p class="lead text-center border-bottom bg-light py-3">Search summary</p> - - <!-- Dataset --> - <p class="text-center font-italic"> - Dataset - </p> - <p *ngIf="datasetSelected && datasetList.length > 0" class="pl-5">{{ getDataset().label }}</p> - <hr> - - <!-- Criteria --> - <p class="text-center font-italic" [tooltip]="summaryCriteria" containerClass="custom-tooltip"> - Criteria <span class="far fa-question-circle fa-xs"></span> - </p> - <p *ngIf="noCriteria()" class="pl-5 font-weight-bold"> - No selected criteria - </p> - <span *ngIf="coneSearch" class="pl-5"> - Cone search: - <ul class="ml-3 pl-5 list-unstyled"> - <li>RA = {{ coneSearch.ra }}°</li> - <li>DEC = {{ coneSearch.dec }}°</li> - <li>radius = {{ coneSearch.radius }} arcsecond</li> - </ul> - </span> - <ul *ngIf="criteriaList.length > 0" class="pl-5 list-unstyled"> - <li *ngFor="let criterion of criteriaList"> - {{ getAttribute(criterion.id).form_label }} {{ printCriterion(criterion) }} - </li> - </ul> - <hr> - - <!-- Outputs --> - <p class="text-center font-italic"> - Output - </p> - <p *ngIf="outputList.length < 1; else outputListAccordion" class="pl-5 text-danger font-weight-bold"> - At least 1 output required! - </p> - <ng-template #outputListAccordion> - <!-- Accordion families --> - <accordion [isAnimated]="true"> - <accordion-group *ngFor="let family of outputFamilyList" #ag panelClass="abstract-accordion" [isOpen]="accordionFamilyIsOpen" class="pl-5"> - <button class="btn btn-link btn-block clearfix pb-1 text-primary" accordion-heading> - <div class="pull-left float-left"> - {{ family.label }} - - <span *ngIf="ag.isOpen"> - <span class="fas fa-chevron-up"></span> - </span> - <span *ngIf="!ag.isOpen"> - <span class="fas fa-chevron-down"></span> - </span> - </div> - </button> - - <!-- Accordion categories --> - <accordion [isAnimated]="true"> - <accordion-group *ngFor="let category of getCategoryByFamilySortedByDisplay(family.id)" #ag panelClass="abstract-accordion" [isOpen]="currentStep === 'output' || outputList.length < 10" class="pl-4"> - <button class="btn btn-link btn-block clearfix pb-1" accordion-heading> - <div class="pull-left float-left text-primary"> - {{ category.label }} - - <span *ngIf="ag.isOpen"> - <span class="fas fa-chevron-up"></span> - </span> - <span *ngIf="!ag.isOpen"> - <span class="fas fa-chevron-down"></span> - </span> - </div> - </button> - - <!-- Output list --> - <ul *ngIf="getSelectedOutputByCategory(category.id).length > 0; else noOutputs" class="mb-0 pl-4 list-unstyled"> - <li *ngFor="let output of getSelectedOutputByCategory(category.id)" class="pb-1"> - <app-attribute-label [label]="output.form_label" [description]="output.description"></app-attribute-label> - </li> - </ul> - <ng-template #noOutputs> - <p class="mb-1 pl-4">No selected output</p> - </ng-template> - </accordion-group> - </accordion> - </accordion-group> - </accordion> - </ng-template> -</div> - -<ng-template #summaryCriteria> - <strong>Criteria family list:</strong> - <ul class="list-unstyled text-left"> - <li *ngFor="let family of criteriaFamilyList"> - {{ family.label }} - </li> - </ul> -</ng-template> diff --git a/client/src/app/instance/search/components/summary.component.spec.ts b/client/src/app/instance/search/components/summary.component.spec.ts deleted file mode 100644 index 4b23c2d51fa526668215b47220db72fea86ef0f7..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search/components/summary.component.spec.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - -import { AccordionModule } from 'ngx-bootstrap/accordion'; -import { TooltipModule } from 'ngx-bootstrap/tooltip'; - -import { SummaryComponent } from './summary.component'; -import { FieldCriterion } from '../../store/models/criterion'; -import { OutputCategory } from '../../../metamodel/models'; - -describe('[Instance][Search][Component] SummaryComponent', () => { - let component: SummaryComponent; - let fixture: ComponentFixture<SummaryComponent>; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [SummaryComponent], - imports: [ - AccordionModule.forRoot(), - TooltipModule.forRoot(), - BrowserAnimationsModule - ] - }); - fixture = TestBed.createComponent(SummaryComponent); - component = fixture.componentInstance; - }); - - it('should create the component', () => { - expect(component).toBeTruthy(); - }); - - it('#getDataset() should return the dataset with the given name', () => { - component.datasetList = [ - { - name: 'myDataset', - table_ref: '', - label: '', - description: '', - display: 1, - data_path: '', - public: true, - download_json: true, - download_csv: true, - download_ascii: true, - download_vo: true, - server_link_enabled: true, - datatable_enabled: true, - datatable_selectable_rows: true, - cone_search_config_id: 1, - id_database: 1, - id_dataset_family: 1, - full_data_path: '' - }, - { - name: 'anotherDataset', - table_ref: '', - label: '', - description: '', - display: 1, - data_path: '', - public: true, - download_json: true, - download_csv: true, - download_ascii: true, - download_vo: true, - server_link_enabled: true, - datatable_enabled: true, - datatable_selectable_rows: true, - cone_search_config_id: 1, - id_database: 1, - id_dataset_family: 1, - full_data_path: '' - } - ]; - component.datasetSelected = 'myDataset'; - expect(component.getDataset()).toBe(component.datasetList[0]); - }); - - it('#noCriteria() should return if there is criteria or not', () => { - component.criteriaList = []; - expect(component.noCriteria()).toBeTruthy(); - component.criteriaList = [ - { id: 1, type: 'field', operator: 'eq', value: 'fd_crit_1' } as FieldCriterion, - { id: 2, type: 'field', operator: 'eq', value: 'fd_crit_2' } as FieldCriterion - ] - ; - expect(component.noCriteria()).toBeFalsy(); - component.coneSearch = { ra: 1, dec: 2, radius: 3 }; - expect(component.noCriteria()).toBeFalsy(); - component.criteriaList = []; - expect(component.noCriteria()).toBeFalsy(); - }); - - it('#getAttribute() should return the attribute with the given id', () => { - component.attributeList = [ - { - id: 1, - name: 'att1', - label: 'attribute1', - form_label: 'Attribute 1', - description: null, - primary_key: true, - type: 'string', - search_type: 'field', - operator: 'eq', - dynamic_operator: false, - min: 'one', - max: null, - placeholder_min: null, - placeholder_max: null, - criteria_display: 1, - output_display: 1, - selected: true, - renderer: null, - renderer_config: null, - order_by: true, - archive: false, - detail: true, - display_detail: 1, - renderer_detail: null, - renderer_detail_config: null, - options: null, - vo_utype: null, - vo_ucd: null, - vo_unit: null, - vo_description: null, - vo_datatype: null, - vo_size: null, - id_criteria_family: 1, - id_output_category: 1 - }, - { - id: 2, - name: 'att2', - label: 'attribute2', - form_label: 'Attribute 2', - description: null, - primary_key: true, - type: 'string', - search_type: 'field', - operator: 'eq', - dynamic_operator: false, - min: 'two', - max: null, - placeholder_min: null, - placeholder_max: null, - criteria_display: 1, - output_display: 1, - selected: true, - renderer: null, - renderer_config: null, - order_by: true, - archive: false, - detail: true, - display_detail: 1, - renderer_detail: null, - renderer_detail_config: null, - options: null, - vo_utype: null, - vo_ucd: null, - vo_unit: null, - vo_description: null, - vo_datatype: null, - vo_size: null, - id_criteria_family: 2, - id_output_category: 2 - } - ]; - expect(component.getAttribute(1).name).toBe('att1'); - }); - - it('#printCriterion() should return pretty criterion', () => { - const criterion = { id: 1, type: 'field', operator: 'eq', value: 'fd_crit_1' } as FieldCriterion; - expect(component.printCriterion(criterion)).toBe('= fd_crit_1'); - }); - - it('#getCategoryByFamilySortedByDisplay(idFamily) should sort by display categories belonging to idFamily', () => { - component.outputCategoryList = [ - { - id: 3, - label: 'The last output category', - display: 30, - id_output_family: 2 - }, - { - id: 1, - label: 'Another output category', - display: 10, - id_output_family: 1 - }, - { - id: 2, - label: 'Default output category', - display: 20, - id_output_family: 1 - } - ]; - const sortedCategoryList: OutputCategory[] = component.getCategoryByFamilySortedByDisplay(1); - expect(sortedCategoryList.length).toBe(2); - expect(sortedCategoryList[0].id).toBe(1); - expect(sortedCategoryList[1].id).toBe(2); - }); - - it('#getSelectedOutputByCategory() should return selected attributes belonging to the given category', () => { - component.attributeList = [ - { - id: 1, - name: 'att1', - label: 'attribute1', - form_label: 'Attribute 1', - description: null, - primary_key: true, - type: 'string', - search_type: 'field', - operator: 'eq', - dynamic_operator: false, - min: 'one', - max: null, - placeholder_min: null, - placeholder_max: null, - criteria_display: 1, - output_display: 1, - selected: true, - renderer: null, - renderer_config: null, - order_by: true, - archive: false, - detail: true, - display_detail: 1, - renderer_detail: null, - renderer_detail_config: null, - options: null, - vo_utype: null, - vo_ucd: null, - vo_unit: null, - vo_description: null, - vo_datatype: null, - vo_size: null, - id_criteria_family: 1, - id_output_category: 1 - }, - { - id: 2, - name: 'att2', - label: 'attribute2', - form_label: 'Attribute 2', - description: null, - primary_key: true, - type: 'string', - search_type: 'field', - operator: 'eq', - dynamic_operator: false, - min: 'two', - max: null, - placeholder_min: null, - placeholder_max: null, - criteria_display: 1, - output_display: 1, - selected: true, - renderer: null, - renderer_config: null, - order_by: true, - archive: false, - detail: true, - display_detail: 1, - renderer_detail: null, - renderer_detail_config: null, - options: null, - vo_utype: null, - vo_ucd: null, - vo_unit: null, - vo_description: null, - vo_datatype: null, - vo_size: null, - id_criteria_family: 2, - id_output_category: 2 - } - ]; - component.outputList = [1]; - expect(component.getSelectedOutputByCategory(1).length).toEqual(1); - component.outputList = []; - expect(component.getSelectedOutputByCategory(1).length).toEqual(0); - }); -}); diff --git a/client/src/app/instance/search/components/summary.component.ts b/client/src/app/instance/search/components/summary.component.ts deleted file mode 100644 index dffa980e1f1ce337b5f230426d58028702817094..0000000000000000000000000000000000000000 --- a/client/src/app/instance/search/components/summary.component.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * This file is part of Anis Client. - * - * @copyright Laboratoire d'Astrophysique de Marseille / CNRS - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; - -import { Criterion, ConeSearch, SearchQueryParams, getPrettyCriterion } from '../../store/models'; -import { Attribute, Dataset, CriteriaFamily, OutputFamily, OutputCategory } from 'src/app/metamodel/models'; - -/** - * @class - * @classdesc Search summary component. - */ -@Component({ - selector: 'app-summary', - templateUrl: 'summary.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - encapsulation: ViewEncapsulation.None -}) -export class SummaryComponent { - @Input() currentStep: string; - @Input() datasetSelected: string; - @Input() datasetList: Dataset[]; - @Input() attributeList: Attribute[]; - @Input() criteriaFamilyList: CriteriaFamily[]; - @Input() outputFamilyList: OutputFamily[]; - @Input() outputCategoryList: OutputCategory[]; - @Input() criteriaList: Criterion[]; - @Input() outputList: number[]; - @Input() queryParams: SearchQueryParams; - @Input() coneSearch: ConeSearch; - - accordionFamilyIsOpen = true; - - /** - * Returns dataset selected for the search. - * - * @return Dataset - */ - getDataset(): Dataset { - return this.datasetList.find(dataset => dataset.name === this.datasetSelected); - } - - /** - * Checks if there is no criteria added to the search. - * - * @return boolean - */ - noCriteria(): boolean { - if (this.coneSearch || this.criteriaList.length > 0) { - return false - } - return true; - } - - /** - * Returns attribute for the given attribute ID. - * - * @param {number} id - The attribute ID. - * - * @return Attribute - */ - getAttribute(id: number): Attribute { - return this.attributeList.find(attribute => attribute.id === id); - } - - /** - * Returns pretty print of the given criterion. - * - * @param {Criterion} criterion - The criterion. - * - * @return string - */ - printCriterion(criterion: Criterion): string { - return getPrettyCriterion(criterion); - } - - /** - * Returns category list sorted by display, for the given output family ID. - * - * @param {number} idFamily - The family ID. - * - * @return OutputCategory[] - */ - getCategoryByFamilySortedByDisplay(idFamily: number): OutputCategory[] { - return this.outputCategoryList.filter(category => category.id_output_family === idFamily) - } - - /** - * Returns output list sorted by display, that belongs to the given category ID. - * - * @param {number} idCategory - The category ID. - * - * @return Attribute[] - */ - getSelectedOutputByCategory(idCategory: number): Attribute[] { - const outputListByCategory = this.attributeList.filter(attribute => attribute.id_output_category === idCategory); - return outputListByCategory.filter(attribute => this.outputList.includes(attribute.id)); - } -} diff --git a/client/src/app/instance/search/containers/criteria.component.html b/client/src/app/instance/search/containers/criteria.component.html index 58ddc16892946e2638a01798476c58e66b012931..794cadbcf9f73c66ce62cb55fd214ad3ea8b5690 100644 --- a/client/src/app/instance/search/containers/criteria.component.html +++ b/client/src/app/instance/search/containers/criteria.component.html @@ -8,7 +8,7 @@ && (criteriaFamilyListIsLoaded | async) && (attributeListIsLoaded | async) && (coneSearchConfigIsLoaded | async)" class="row mt-4"> - <div class="col-12 col-md-8 col-lg-9"> + <div class="col-12"> <app-cone-search-tab [datasetSelected]="datasetSelected | async" [datasetList]="datasetList | async" diff --git a/client/src/app/instance/search/containers/dataset.component.html b/client/src/app/instance/search/containers/dataset.component.html index f7f0ada9e6d712595faeccd452b12890a873ca72..01ff2cfdfc346de58394400fee0ee724f54a423c 100644 --- a/client/src/app/instance/search/containers/dataset.component.html +++ b/client/src/app/instance/search/containers/dataset.component.html @@ -15,7 +15,7 @@ </div> </ng-container> <ng-container *ngIf="(datasetList | async).length > 0"> - <div class="col-12 col-md-8 col-lg-9"> + <div class="col-12"> <app-dataset-tabs [datasetList]="datasetList | async" [datasetFamilyList]="datasetFamilyList | async" diff --git a/client/src/app/instance/search/containers/output.component.html b/client/src/app/instance/search/containers/output.component.html index f42b7b03d5ff86dd89ffe074e91347698280b875..74e628a1421d9a20f76f7d5fa992f156954cec90 100644 --- a/client/src/app/instance/search/containers/output.component.html +++ b/client/src/app/instance/search/containers/output.component.html @@ -6,7 +6,7 @@ <div *ngIf="(attributeListIsLoaded | async) && (outputFamilyListIsLoaded | async) && (outputCategoryListIsLoaded | async)" class="row mt-4"> - <div class="col-12 col-md-8 col-lg-9"> + <div class="col-12"> <app-output-tabs [attributeList]="attributeList | async | sortByOutputDisplay" [outputFamilyList]="outputFamilyList | async"