Skip to content

Commit

Permalink
Issue #444: Gestione del numero di risultati
Browse files Browse the repository at this point in the history
  • Loading branch information
atatarelli committed Jan 31, 2022
1 parent e93cd8b commit 92dfb3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class ListViewComponent implements OnInit, AfterContentChecked {
if(this.sideList) {
let _query:string = this._formQuery(event);

this.sideList.loadMetadati(null, _query);
this.sideList.getList(null, _query);
this.sideList.loadMetadati(null, _query);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
let _dashboard_link_query = UtilService.DASHBOARD_LINKS_PARAMS.params.map((item) => {
return item.controller + '=' + item.value;
}).join('&');
this.loadMetadati(_service, _dashboard_link_query);
this.getList(_service, _dashboard_link_query);
this.loadMetadati(_service, _dashboard_link_query);
}

ngOnDestroy() {
Expand Down Expand Up @@ -202,7 +202,7 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
*/
loadMetadati(service: string = '', query: string = '') {
service = (service || this.rsc.fullPath); // ROUTING - fullPath
// this.__waitForMeta();
this.__waitForMeta();
let _query: string = this.__setupQueryForMeta(service, query);
if(!this._isLoadingMeta) {
this._isLoadingMeta = true;
Expand Down Expand Up @@ -361,13 +361,13 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
}

protected _risultati(_lastResponse: any) {
let txt: string = (!_lastResponse && this._isLoadingMeta)?'Caricamento in corso...':'Nessun risultato.';
let txt: string = (!_lastResponse && this._isLoadingMeta) ? 'Caricamento in corso...' : 'Numero di risultati sconosciuto.';
if (_lastResponse) {
const _value = (_lastResponse.numRisultati || 0);
txt = (_value !== 1)?`Trovati ${_value} risultati`:`Trovato ${_value} risultato`;
// ROUTING - fullPath
if (this.rsc.fullPath === UtilService.URL_PAGAMENTI && _lastResponse.maxRisultati && _lastResponse.numRisultati === _lastResponse.maxRisultati) {
txt = `Trovati più di ${(_lastResponse.maxRisultati - 1)} `;
txt = (_value !== 1) ? `Trovati ${_value} risultati` : `Trovato ${_value} risultato`;

if (_lastResponse.maxRisultati && _lastResponse.numRisultati === _lastResponse.maxRisultati) {
txt = `Trovati oltre ${(_lastResponse.maxRisultati - 1)} risultati`;
}
}
return txt;
Expand Down

0 comments on commit 92dfb3c

Please sign in to comment.