diff --git a/client/src/app/instance/search/components/result/datatable-tab.component.html b/client/src/app/instance/search/components/result/datatable-tab.component.html index 335af332a2aa3007611cbaf8a6f02c00674835a2..f9f6b3aaa6a57531613c217cf6a1ebf3501bc5be 100644 --- a/client/src/app/instance/search/components/result/datatable-tab.component.html +++ b/client/src/app/instance/search/components/result/datatable-tab.component.html @@ -13,6 +13,7 @@ [instance]="instance" [attributeList]="attributeList" [outputList]="outputList" + [queryParams]="queryParams" [dataLength]="dataLength" [data]="data" [dataIsLoading]="dataIsLoading" diff --git a/client/src/app/instance/search/components/result/datatable-tab.component.ts b/client/src/app/instance/search/components/result/datatable-tab.component.ts index 57333dc2b9edc832fc56504aee3bce6018dfc697..a276dec48ebe3974e8494c21d4cda2602d64794b 100644 --- a/client/src/app/instance/search/components/result/datatable-tab.component.ts +++ b/client/src/app/instance/search/components/result/datatable-tab.component.ts @@ -10,7 +10,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { Instance, Attribute, Dataset } from 'src/app/metamodel/models'; -import { Pagination } from 'src/app/instance/store/models'; +import { Pagination, SearchQueryParams } from 'src/app/instance/store/models'; @Component({ selector: 'app-datatable-tab', @@ -27,6 +27,7 @@ export class DatatableTabComponent { @Input() datasetList: Dataset[]; @Input() attributeList: Attribute[]; @Input() outputList: number[]; + @Input() queryParams: SearchQueryParams; @Input() dataLength: number; @Input() data: any[]; @Input() dataIsLoading: boolean; diff --git a/client/src/app/instance/search/containers/result.component.html b/client/src/app/instance/search/containers/result.component.html index f5ede714fb8653399c9cb75611dfd5d35eb5573e..d9b4fdbf2a8260fc9d97ecb02df3294d25a04e9f 100644 --- a/client/src/app/instance/search/containers/result.component.html +++ b/client/src/app/instance/search/containers/result.component.html @@ -76,6 +76,7 @@ [datasetList]="datasetList | async" [attributeList]="attributeList | async" [outputList]="outputList | async" + [queryParams]="queryParams | async" [dataLength]="dataLength | async" [data]="data | async" [dataIsLoading]="dataIsLoading | async" diff --git a/client/src/app/instance/shared-search/components/datatable/datatable.component.html b/client/src/app/instance/shared-search/components/datatable/datatable.component.html index cd7506a1bf9504e609bfcbbbd21ec076f73f6bca..7b7ee23a3405f901e1183f30f59c9dbbbfeceefc 100644 --- a/client/src/app/instance/shared-search/components/datatable/datatable.component.html +++ b/client/src/app/instance/shared-search/components/datatable/datatable.component.html @@ -46,6 +46,7 @@ [value]="datum[attribute.label]" [datasetName]="dataset.name" [instanceSelected]="instance.name" + [queryParams]="queryParams" [config]="getRendererConfig(attribute)"> </app-detail-renderer> </div> diff --git a/client/src/app/instance/shared-search/components/datatable/datatable.component.ts b/client/src/app/instance/shared-search/components/datatable/datatable.component.ts index 9df8e30a8489d7087e508f683e91917fa40dc3ae..1e90851ca9be53f1a232c612002eb5a8ae64981f 100644 --- a/client/src/app/instance/shared-search/components/datatable/datatable.component.ts +++ b/client/src/app/instance/shared-search/components/datatable/datatable.component.ts @@ -10,7 +10,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Instance, Attribute, Dataset, DetailRendererConfig, DownloadRendererConfig, ImageRendererConfig, LinkRendererConfig, RendererConfig } from 'src/app/metamodel/models'; -import { Pagination, PaginationOrder } from 'src/app/instance/store/models'; +import { Pagination, PaginationOrder, SearchQueryParams } from 'src/app/instance/store/models'; @Component({ selector: 'app-datatable', @@ -28,6 +28,7 @@ export class DatatableComponent implements OnInit { @Input() instance: Instance; @Input() attributeList: Attribute[]; @Input() outputList: number[]; + @Input() queryParams: SearchQueryParams; @Input() dataLength: number; @Input() data: any[]; @Input() dataIsLoading: boolean; diff --git a/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.html b/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.html index e597c8db8d29577014847cffbdecd4bed985c234..bb61c20cb79cb4d03d91803916243d0ace474c9c 100644 --- a/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.html +++ b/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.html @@ -1,4 +1,6 @@ -<a routerLink="/instance/{{ instanceSelected }}/search/detail/{{ datasetName }}/{{ value }}" [target]="config.blank == true ? '_blank' : '_self'" +<a routerLink="/instance/{{ instanceSelected }}/search/detail/{{ datasetName }}/{{ value }}" + [target]="config.blank == true ? '_blank' : '_self'" + [queryParams]="queryParams" [ngClass]="{'btn btn-outline-primary btn-sm' : config.display == 'text-button'}"> {{ value }} </a> diff --git a/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.ts b/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.ts index d6df4dfd8384e2931696c6807a5a0c97bfdeaefb..8d148a3fa0c9b5cc7d617ab5a7f4992fcaba8ccf 100644 --- a/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.ts +++ b/client/src/app/instance/shared-search/components/datatable/renderer/detail-renderer.component.ts @@ -9,6 +9,7 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core'; +import { SearchQueryParams } from 'src/app/instance/store/models'; import { DetailRendererConfig } from 'src/app/metamodel/models/renderers/detail-renderer-config.model'; @Component({ @@ -24,5 +25,6 @@ export class DetailRendererComponent { @Input() value: string | number; @Input() datasetName: string; @Input() instanceSelected: string; + @Input() queryParams: SearchQueryParams; @Input() config: DetailRendererConfig; } diff --git a/client/src/app/instance/shared-search/detail/containers/detail.component.ts b/client/src/app/instance/shared-search/detail/containers/detail.component.ts index 7e82b70d031d778c1256f03fb7022e63873c524b..8fd9b25bd9c4b9b4dd2a58267bb806fa73bbcd87 100644 --- a/client/src/app/instance/shared-search/detail/containers/detail.component.ts +++ b/client/src/app/instance/shared-search/detail/containers/detail.component.ts @@ -22,6 +22,7 @@ import * as searchSelector from 'src/app/instance/store/selectors/search.selecto import * as outputFamilySelector from 'src/app/metamodel/selectors/output-family.selector'; import * as outputCategorySelector from 'src/app/metamodel/selectors/output-category.selector'; import * as attributeSelector from 'src/app/metamodel/selectors/attribute.selector'; +import * as searchActions from 'src/app/instance/store/actions/search.actions'; /** * Interface for store state. @@ -87,8 +88,10 @@ export class DetailComponent implements OnInit, OnDestroy { ngOnInit() { // Create a micro task that is processed after the current synchronous code // This micro task prevent the expression has changed after view init error + Promise.resolve(null).then(() => this.store.dispatch(searchActions.initSearch())); this.attributeListIsLoadedSubscription = this.attributeListIsLoaded.subscribe(attributeListIsLoaded => { if (attributeListIsLoaded) { + Promise.resolve(null).then(() => this.store.dispatch(searchActions.loadDefaultFormParameters())); Promise.resolve(null).then(() => this.store.dispatch(detailActions.retrieveObject())); } });