From: ychacon Date: Mon, 18 Oct 2021 07:01:41 +0000 (+0200) Subject: Adding 'no records found' when table is empty X-Git-Tag: 2.3.0~3 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=9d04d0c0cf25d5d97a81de143511215757a44c77;p=portal%2Fnonrtric-controlpanel.git Adding 'no records found' when table is empty Issue-ID: NONRTRIC-555 Signed-off-by: ychacon Change-Id: Ia3c3915c37d3d3105812b1d75072957d8b37a594 --- diff --git a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.html b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.html index 619011d..a54e763 100644 --- a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.html +++ b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.html @@ -103,9 +103,19 @@ limitations under the License. {{job.status}} - + + + No records found. + + + + + + + + - \ No newline at end of file diff --git a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.scss b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.scss index 18f2410..c131630 100644 --- a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.scss +++ b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.scss @@ -33,4 +33,12 @@ .polling-checkbox{ margin: 0 10px; font-size: 0.75em; +} + +.display-none { + display: none; + } + +.spinner-container mat-spinner { +margin: 0 auto 0 auto; } \ No newline at end of file diff --git a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.ts b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.ts index 097e450..fce9e61 100644 --- a/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.ts +++ b/webapp-frontend/src/app/ei-coordinator/jobs-list/jobs-list.component.ts @@ -280,8 +280,12 @@ export class JobsListComponent implements OnInit { this.refresh$.next(""); } + jobsNumber() : number { + return this.jobsDataSource.data.length; + } + hasJobs(): boolean { - return this.jobs().length > 0; + return this.jobsNumber() > 0; } } diff --git a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.html b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.html index 37b405a..cd79b6e 100644 --- a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.html +++ b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.html @@ -63,7 +63,16 @@ limitations under the License. {{this.getProducerStatus(producer)}} - + + No records found. + + + + + + + + diff --git a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.scss b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.scss index a94c1a5..56c891d 100644 --- a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.scss +++ b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.scss @@ -27,4 +27,10 @@ .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 diff --git a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.spec.ts b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.spec.ts index 5846ffd..cc3b255 100644 --- a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.spec.ts +++ b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.spec.ts @@ -73,8 +73,10 @@ describe('ProducersListComponent', () => { } as Producer; setServiceSpy(); + component.loadProducers(); const actualProducers: Producer[] = component.producers(); + expect(actualProducers.length).toEqual(2); expect(actualProducers).toEqual([producer1, producer2]); }); diff --git a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.ts b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.ts index 5fe0c85..64f4ef2 100644 --- a/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.ts +++ b/webapp-frontend/src/app/ei-coordinator/producers-list/producers-list.component.ts @@ -171,7 +171,7 @@ export class ProducersListComponent implements OnInit { } hasProducers(): boolean { - return this.producers().length > 0; + return this.producersDataSource.data.length > 0; } }