|
|
@ -8,7 +8,6 @@ import { |
|
|
Input, |
|
|
Input, |
|
|
LOCALE_ID, |
|
|
LOCALE_ID, |
|
|
OnChanges, |
|
|
OnChanges, |
|
|
OnDestroy, |
|
|
|
|
|
Output, |
|
|
Output, |
|
|
SimpleChanges, |
|
|
SimpleChanges, |
|
|
TemplateRef, |
|
|
TemplateRef, |
|
|
@ -16,7 +15,7 @@ import { |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
import { AsyncPipe, formatDate, NgComponentOutlet, NgTemplateOutlet } from '@angular/common'; |
|
|
import { AsyncPipe, formatDate, NgComponentOutlet, NgTemplateOutlet } from '@angular/common'; |
|
|
|
|
|
|
|
|
import { combineLatest, Observable, map } from 'rxjs'; |
|
|
import { Observable, map } from 'rxjs'; |
|
|
|
|
|
|
|
|
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; |
|
|
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; |
|
|
import { NgxDatatableModule } from '@swimlane/ngx-datatable'; |
|
|
import { NgxDatatableModule } from '@swimlane/ngx-datatable'; |
|
|
@ -131,8 +130,6 @@ export class ExtensibleTableComponent<R = any> implements OnChanges { |
|
|
this.actionList.toArray().map(action => ({ requiredPolicy: action.permission })), |
|
|
this.actionList.toArray().map(action => ({ requiredPolicy: action.permission })), |
|
|
).length > 0; |
|
|
).length > 0; |
|
|
this.setColumnWidths(DEFAULT_ACTIONS_COLUMN_WIDTH); |
|
|
this.setColumnWidths(DEFAULT_ACTIONS_COLUMN_WIDTH); |
|
|
|
|
|
|
|
|
this.subscribeLoading(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private setColumnWidths(actionsColumn: number | undefined) { |
|
|
private setColumnWidths(actionsColumn: number | undefined) { |
|
|
@ -237,33 +234,4 @@ export class ExtensibleTableComponent<R = any> implements OnChanges { |
|
|
|
|
|
|
|
|
return visibleActions.length > 0; |
|
|
return visibleActions.length > 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
subscribeLoading() { |
|
|
|
|
|
this.subscriptionService.addOne( |
|
|
|
|
|
combineLatest([this.listService.isLoading$, this.routerWaitService.getLoading$()]), |
|
|
|
|
|
([listLoading, routerLoading]) => { |
|
|
|
|
|
if (listLoading || routerLoading) { |
|
|
|
|
|
this.startLoading(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.stopLoading(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
startLoading() { |
|
|
|
|
|
if (this.isLoading) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.isLoading = true; |
|
|
|
|
|
this.cdRef.detectChanges(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
stopLoading() { |
|
|
|
|
|
this.isLoading = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() { |
|
|
|
|
|
this.subscriptionService.closeAll(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|