13
13
// limitations under the License.
14
14
15
15
import { 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' ;
17
17
import { CoreError } from '@classes/errors/error' ;
18
18
import {
19
19
CoreReportBuilder ,
@@ -37,7 +37,6 @@ import { map } from 'rxjs/operators';
37
37
selector : 'core-report-builder-report-detail' ,
38
38
templateUrl : './report-detail.html' ,
39
39
styleUrls : [ './report-detail.scss' ] ,
40
- changeDetection : ChangeDetectionStrategy . OnPush ,
41
40
} )
42
41
export class CoreReportBuilderReportDetailComponent implements OnInit {
43
42
@@ -55,7 +54,7 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
55
54
new BehaviorSubject < CoreReportBuilderReportDetailState > ( {
56
55
report : null ,
57
56
loaded : false ,
58
- canLoadMoreRows : true ,
57
+ canLoadMoreRows : false ,
59
58
errorLoadingRows : false ,
60
59
cardviewShowFirstTitle : false ,
61
60
cardVisibleColumns : 1 ,
@@ -126,6 +125,7 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
126
125
report,
127
126
cardVisibleColumns : report . details . settingsdata . cardviewVisibleColumns ,
128
127
cardviewShowFirstTitle : report . details . settingsdata . cardviewShowFirstTitle ,
128
+ canLoadMoreRows : report . data . totalrowcount > report . data . rows . length ,
129
129
} ) ;
130
130
131
131
this . logView ( report ) ;
@@ -175,7 +175,6 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
175
175
this . updateState ( { page : 0 , canLoadMoreRows : false } ) ;
176
176
await CoreUtils . ignoreErrors ( this . getReport ( ) ) ;
177
177
await ionRefresher ?. complete ( ) ;
178
- this . updateState ( { canLoadMoreRows : true } ) ;
179
178
}
180
179
181
180
/**
@@ -225,12 +224,12 @@ export class CoreReportBuilderReportDetailComponent implements OnInit {
225
224
] ,
226
225
} ,
227
226
} ,
227
+ canLoadMoreRows : newReport . data . totalrowcount > report . data . rows . length + newReport . data . rows . length ,
228
228
} ) ;
229
229
} catch ( error ) {
230
230
CoreDomUtils . showErrorModalDefault ( error , 'Error loading more reports' ) ;
231
231
232
- this . updateState ( { canLoadMoreRows : false } ) ;
233
- this . updateState ( { errorLoadingRows : true } ) ;
232
+ this . updateState ( { canLoadMoreRows : false , errorLoadingRows : true } ) ;
234
233
}
235
234
236
235
complete ( ) ;
0 commit comments