Skip to content

Commit 9bff779

Browse files
author
Edgar Guaman
committed
refactor: TT-304 Handle message: New approach for the ticket
1 parent b927d96 commit 9bff779

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/app/modules/time-entries/pages/time-entries.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
<th class="col"></th>
5555
</tr>
5656
</thead>
57-
<tr *ngIf="checkIfDataSourceIsLoadingorEmpty(dataSource)">
57+
<tr *ngIf="dataSource.isLoading">
5858
<td class="text-center" colspan="7">{{NO_DATA_MESSAGE}}</td>
5959
</tr>
6060
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
6161
<tbody *ngIf="!dataSource.isLoading">
62-
<tr *ngIf="!checkIfDataSourceIsLoadingorEmpty(dataSource)">
62+
<tr *ngIf="!dataSource?.data.length">
6363
<td class="text-center" colspan="7">{{NO_DATA_MESSAGE}}</td>
6464
</tr>
6565
<tr class="d-flex" *ngFor="let entry of dataSource.data">

src/app/modules/time-entries/pages/time-entries.component.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -668,14 +668,4 @@ describe('TimeEntriesComponent', () => {
668668

669669
expect(HTMLTimeEntriesView).not.toBeNull();
670670
});
671-
672-
it('checkIfDataSourceIsLoadingorEmpty should be true when dataSource is Loading and data is not empty', () => {
673-
state.timeEntriesDataSource.isLoading = true;
674-
state.timeEntriesDataSource.data = [];
675-
expect(component.checkIfDataSourceIsLoadingorEmpty(state.timeEntriesDataSource)).toBeTrue();
676-
});
677-
678-
it('checkIfDataSourceIsLoadingorEmpty should be false when just dataSource.data.length is empty', () => {
679-
expect(component.checkIfDataSourceIsLoadingorEmpty(state.timeEntriesDataSource)).toBeFalse();
680-
});
681671
});

src/app/modules/time-entries/pages/time-entries.component.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,4 @@ export class TimeEntriesComponent implements OnInit, OnDestroy {
218218
});
219219
}
220220
}
221-
222-
checkIfDataSourceIsLoadingorEmpty(source?: DataSource<Entry>): boolean {
223-
if (source.isLoading && source.data.length === 0) {
224-
return true;
225-
}
226-
return false;
227-
}
228221
}

0 commit comments

Comments
 (0)