Issue-ID: NONRTRIC-555
Signed-off-by: ychacon <yennifer.chacon@est.tech>
Change-Id: Ia3c3915c37d3d3105812b1d75072957d8b37a594
</mat-header-cell>
<mat-cell *matCellDef="let job"> {{job.status}} </mat-cell>
</ng-container>
</mat-header-cell>
<mat-cell *matCellDef="let job"> {{job.status}} </mat-cell>
</ng-container>
- <mat-header-row *matHeaderRowDef="['jobId', 'prodIds', 'typeId', 'owner', 'targetUri', 'status']"></mat-header-row>
+
+ <ng-container matColumnDef="noRecordsFound">
+ <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
+ </ng-container>
+
+ <mat-header-row *matHeaderRowDef="['jobId', 'prodIds', 'typeId', 'owner', 'targetUri', 'status']" [ngClass]="{'display-none': !this.hasJobs()}">
+ </mat-header-row>
<mat-row *matRowDef="let row; columns: ['jobId', 'prodIds', 'typeId', 'owner', 'targetUri', 'status'];"></mat-row>
<mat-row *matRowDef="let row; columns: ['jobId', 'prodIds', 'typeId', 'owner', 'targetUri', 'status'];"></mat-row>
+
+ <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasJobs()}">
+ </mat-footer-row>
+
- <mat-paginator [length]="jobs()?.length" [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]" showFirstLastButtons
+ <mat-paginator [length]="this.jobsNumber()" [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]" showFirstLastButtons
class="ei-coordinator-table mat-elevation-z8"></mat-paginator>
</div>
\ No newline at end of file
class="ei-coordinator-table mat-elevation-z8"></mat-paginator>
</div>
\ No newline at end of file
.polling-checkbox{\r
margin: 0 10px;\r
font-size: 0.75em;\r
.polling-checkbox{\r
margin: 0 10px;\r
font-size: 0.75em;\r
+}\r
+\r
+.display-none {\r
+ display: none;\r
+ }\r
+\r
+.spinner-container mat-spinner {\r
+margin: 0 auto 0 auto;\r
}
\ No newline at end of file
}
\ No newline at end of file
this.refresh$.next("");
}
this.refresh$.next("");
}
+ jobsNumber() : number {
+ return this.jobsDataSource.data.length;
+ }
+
- return this.jobs().length > 0;
+ return this.jobsNumber() > 0;
<mat-cell *matCellDef="let producer"> {{this.getProducerStatus(producer)}} </mat-cell>
</ng-container>
<mat-cell *matCellDef="let producer"> {{this.getProducerStatus(producer)}} </mat-cell>
</ng-container>
- <mat-header-row *matHeaderRowDef="['id', 'types', 'status']"></mat-header-row>
+ <ng-container matColumnDef="noRecordsFound">
+ <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
+ </ng-container>
+
+ <mat-header-row *matHeaderRowDef="['id', 'types', 'status']" [ngClass]="{'display-none': !this.hasProducers()}">
+ </mat-header-row>
<mat-row *matRowDef="let row; columns: ['id', 'types', 'status'];"></mat-row>
<mat-row *matRowDef="let row; columns: ['id', 'types', 'status'];"></mat-row>
+
+ <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasProducers()}">
+ </mat-footer-row>
+
.mat-form-field {
font-size: 14px;
width: 100%;
.mat-form-field {
font-size: 14px;
width: 100%;
+}
+.display-none {
+ display: none;
+}
+.spinner-container mat-spinner {
+ margin: 0 auto 0 auto;
}
\ No newline at end of file
}
\ No newline at end of file
} as Producer;
setServiceSpy();
} as Producer;
setServiceSpy();
component.loadProducers();
const actualProducers: Producer[] = component.producers();
component.loadProducers();
const actualProducers: Producer[] = component.producers();
+ expect(actualProducers.length).toEqual(2);
expect(actualProducers).toEqual([producer1, producer2]);
});
expect(actualProducers).toEqual([producer1, producer2]);
});
}
hasProducers(): boolean {
}
hasProducers(): boolean {
- return this.producers().length > 0;
+ return this.producersDataSource.data.length > 0;