1313// limitations under the License.
1414
1515import { toBoolean } from '@/core/transforms/boolean' ;
16- import { ChangeDetectionStrategy , Component , EventEmitter , Input , OnInit , Output } from '@angular/core' ;
16+ import { Component , EventEmitter , Input , OnInit , Output } from '@angular/core' ;
1717import { CoreError } from '@classes/errors/error' ;
1818import {
1919 CoreReportBuilder ,
@@ -37,7 +37,6 @@ import { map } from 'rxjs/operators';
3737 selector : 'core-report-builder-report-detail' ,
3838 templateUrl : './report-detail.html' ,
3939 styleUrls : [ './report-detail.scss' ] ,
40- changeDetection : ChangeDetectionStrategy . OnPush ,
4140} )
4241export class CoreReportBuilderReportDetailComponent implements OnInit {
4342
@@ -55,7 +54,7 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
5554 new BehaviorSubject < CoreReportBuilderReportDetailState > ( {
5655 report : null ,
5756 loaded : false ,
58- canLoadMoreRows : true ,
57+ canLoadMoreRows : false ,
5958 errorLoadingRows : false ,
6059 cardviewShowFirstTitle : false ,
6160 cardVisibleColumns : 1 ,
@@ -126,6 +125,7 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
126125 report,
127126 cardVisibleColumns : report . details . settingsdata . cardviewVisibleColumns ,
128127 cardviewShowFirstTitle : report . details . settingsdata . cardviewShowFirstTitle ,
128+ canLoadMoreRows : report . data . totalrowcount > report . data . rows . length ,
129129 } ) ;
130130
131131 this . logView ( report ) ;
@@ -175,7 +175,6 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
175175 this . updateState ( { page : 0 , canLoadMoreRows : false } ) ;
176176 await CoreUtils . ignoreErrors ( this . getReport ( ) ) ;
177177 await ionRefresher ?. complete ( ) ;
178- this . updateState ( { canLoadMoreRows : true } ) ;
179178 }
180179
181180 /**
@@ -225,12 +224,12 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
225224 ] ,
226225 } ,
227226 } ,
227+ canLoadMoreRows : newReport . data . totalrowcount > report . data . rows . length + newReport . data . rows . length ,
228228 } ) ;
229229 } catch ( error ) {
230230 CoreDomUtils . showErrorModalDefault ( error , 'Error loading more reports' ) ;
231231
232- this . updateState ( { canLoadMoreRows : false } ) ;
233- this . updateState ( { errorLoadingRows : true } ) ;
232+ this . updateState ( { canLoadMoreRows : false , errorLoadingRows : true } ) ;
234233 }
235234
236235 complete ( ) ;
0 commit comments