Skip to content

Commit

Permalink
Merge pull request #1013 from aneoconsulting/fix/table-cell-performan…
Browse files Browse the repository at this point in the history
…ce-issues

fix: table-cell performance issues
  • Loading branch information
ngruelaneo authored Mar 27, 2024
2 parents d34daad + ae48aed commit 2ec2945
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/app/components/count-tasks-by-status.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,4 @@ describe('CountTasksByStatusComponent', () => {
it('Should run', () => {
expect(component).toBeTruthy();
});

it('Should unsubscribe when destroyed', () => {
component.ngOnDestroy();
expect(refresh$.closed).toBeTruthy();
});
});
8 changes: 2 additions & 6 deletions src/app/components/count-tasks-by-status.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnDestroy, inject } from '@angular/core';
import { Component, Input, inject } from '@angular/core';
import { Subject, Subscription, switchMap } from 'rxjs';
import { TasksFiltersService } from '@app/tasks/services/tasks-filters.service';
import { TasksGrpcService } from '@app/tasks/services/tasks-grpc.service';
Expand Down Expand Up @@ -28,7 +28,7 @@ import { ViewTasksByStatusComponent } from '@components/view-tasks-by-status.com
ViewTasksByStatusComponent,
]
})
export class CountTasksByStatusComponent implements OnDestroy {
export class CountTasksByStatusComponent {
@Input({ required: true }) statuses: TaskStatusColored[] = [];
@Input({ required: true }) queryParams: Record<string, string> = {};
@Input({ required: true }) refresh: Subject<void>;
Expand Down Expand Up @@ -57,8 +57,4 @@ export class CountTasksByStatusComponent implements OnDestroy {
});
this.refresh.next();
}

ngOnDestroy(): void {
this.refresh.unsubscribe();
}
}
5 changes: 4 additions & 1 deletion src/app/components/table/table-cell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export class TableCellComponent<T extends ArmonikData<DataRaw>, K extends RawCol

@Input({ required: true }) set column(entry: TableColumn<K>) {
this._column = entry;
if (entry.key === 'count') {
this.refreshStatuses = new Subject<void>();
}
}

@Input({ required: true }) set element(entry: T) {
Expand Down Expand Up @@ -68,7 +71,7 @@ export class TableCellComponent<T extends ArmonikData<DataRaw>, K extends RawCol

private _link: string;
private _queryParams: Params | undefined;
refreshStatuses = new Subject<void>();
refreshStatuses: Subject<void>;

get column() {
return this._column;
Expand Down

1 comment on commit 2ec2945

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 90%
90.06% (2748/3051) 73.18% (513/701) 82.58% (645/781)

JUnit

Tests Skipped Failures Errors Time
785 0 💤 0 ❌ 0 🔥 59.514s ⏱️
Files coverage (90%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files90.0673.1882.5890.53 
applications100100100100 
   index.component.ts100100100100 
applications/components92.382.681.8195.16 
   table.component.ts92.382.681.8195.16134, 190, 204
applications/services87.577.7776.1988.23 
   applications-filters.service.ts79.1610062.581.8175–81
   applications-grpc.service.ts9271.4210091.6676–82
   applications-index.service.ts91.366.668090.970–74
components96.1991.392.4896.67 
   actions-toolbar-group.component.ts100100100100 
   actions-toolbar.component.ts100100100100 
   auto-refresh-button.component.html100100100100 
   auto-refresh-button.component.ts1006010010036, 59
   auto-refresh-dialog.component.html100100100100 
   auto-refresh-dialog.component.ts100100100100 
   columns-button.component.ts100100100100 
   columns-modify-dialog.component.html100100100100 
   columns-modify-dialog.component.ts94.599089.4710050
   count-tasks-by-status.component.ts1005010010056
   icon-picker-dialog.component.html100100100100 
   icon-picker-dialog.component.ts92.855010092.5958, 71
   page-header.component.html100100100100 
   page-header.component.ts8010008033
   page-section-header.component.ts8010008031
   page-section.component.ts100100100100 
   refresh-button.component.ts100100100100 
   share-url.component.ts92.851007592.337
   show-action-area.component.html100100100100 
   show-action-area.component.ts100100100100 
   show-actions.component.html100100100100 
   show-actions.component.ts100100100100 
   show-card-content.component.html100100100100 
   show-card-content.component.ts100100100100 
   show-card.component.html100100100100 
   show-card.component.ts90.910066.66100 
   show-page.component.html100100100100 
   show-page.component.ts100100100100 
   spinner.component.ts100100100100 
   table-actions-toolbar.component.html100100100100 
   table-actions-toolbar.component.ts100100100100 
   table-container.component.ts100100100100 
   view-tasks-by-status-dialog.component.html100100100100 
   view-tasks-by-status-dialog.component.ts100100100100 
   view-tasks-by-status.component.ts73.5206072.7259, 88–106
components/filters94.2187.493.5894.24 
   filters-chips.component.html100100100100 
   filters-chips.component.ts100100100100 
   filters-dialog-and.component.html100100100100 
   filters-dialog-and.component.ts100100100100 
   filters-dialog-filter-field.component.html100100100100 
   filters-dialog-filter-field.component.ts92.9487.597.2992.36104, 114, 124, 136–139, 147, 192–194, 201, 334
   filters-dialog-input.component.html100100100100 
   filters-dialog-input.component.ts8278.7871.4283.3357, 85–86, 142–151
   filters-dialog-or.component.html100100100100 
   filters-dialog-or.component.ts100100100100 
   filters-dialog.component.html100100100100 
   filters-dialog.component.ts100100100100 
   filters-toolbar.component.html100100100100 
   filters-toolbar.component.ts100100100100 
components/navigation99.1197.0595.8399.07 
   add-external-service-dialog.component.html100100100100 
   add-external-service-dialog.component.ts100100100100 
   change-language-button.component.html100100100100 
   change-language-button.component.ts97.291009096.9657
   edit-external-service-dialog.component.html100100100100 
   edit-external-service-dialog.component.ts100100100100 
   form-external-service.component.html100100100100 
   form-external-service.component.ts100100100100 
   manage-external-services-dialog.component.html100100100100 
   manage-external-services-dialog.component.ts100100100100 
   navigation.component.html100100100100 
   navigation.component.ts98.1893.3388.8898.14113
   theme-selector.component.html100100100100 
   theme-selector.component.ts100100100100 
components/table7961.1167.8578.78 
   table-actions.component.html100100100100 
   table-actions.component.ts87.5100087.529
   table-cell.component.html100100100100 
   table-cell.component.ts87.9373.3390.4787.9340, 52, 105, 119, 129–133
   table-empty-data.component.ts100100100100 
   table-inspect-object-dialog.component.html100100100100 
   table-inspect-object-dialog.component.ts41.66100041.6626–40
   table-inspect-object.component.html100100100100 
   table-inspect-object.component.ts60006031–50
dashboard89.0135.7193.3388.88 
   index.component.html100100100100 
   index.component.ts88.8835.7193.3388.76166–180, 193, 231
dashboard/components99.210098.5799.19 
   add-line-dialog.component.ts100100100100 
   add-statuses-group-dialog.component.ts100100100100 
   edit-name-line-dialog.component.ts100100100100 
   edit-status-group-dialog.component.ts100100100100 
   form-name-line.component.html100100100100 
   form-name-line.component.ts95.6510083.3395.6586
   form-statuses-group.component.html100100100100 
   form-statuses-group.component.ts100100100100 
   manage-groups-dialog.component.html100100100100 
   manage-groups-dialog.component.ts100100100100 
   reorganize-lines-dialog.component.html100100100100 
   reorganize-lines-dialog.component.ts100100100100 
   split-lines-dialog.component.ts100100100100 
   statuses-group-card.component.html100100100100 
   statuses-group-card.component.ts97.9110010097.72138
dashboard/components/lines98.0188.8895.7497.96 
   applications-line.component.html100100100100 
   applications-line.component.ts97.4390.996.2997.36138–140
   task-by-status-line.component.html100100100100 
   task-by-status-line.component.ts98.7985.719598.76210
dashboard/services100100100100 
   dashboard-index.service.ts100100100100 
   dashboard-storage.service.ts100100100100 
directives50100050 
   no-wrap.directive.ts501000505–6
healthcheck100100100100 
   index.component.html100100100100 
   index.component.ts100100100100 
healthcheck/services100100100100 
   healthcheck-grpc.service.ts100100100100 
   healthcheck-index.service.ts100100100100 
partitions/components96.159088.8896.07 
   table.component.html100100100100 
   table.component.ts96.079088.889674, 121
partitions/services21.730018.18 
   partitions-index.service.ts21.730018.1811–120
pipes250018.18 
   duration.pipe.ts16.660011.767–27
   empty-cell.pipe.ts5000406–10
results/components97.051007596.96 
   table.component.html100100100100 
   table.component.ts96.961007596.8776
results/services34.4808.3329.62 
   results-index.service.ts21.730018.1810–117
   results-statuses.service.ts83.33100508016
services93.5678.1687.0393.61 
   auto-refresh.service.ts100100100100 
   default-config.service.ts10050100100193
   environment.service.ts80100507519
   filters.service.ts50037.55277–93
   grpc-build-request.service.ts64.288.3316.6664.2826, 39, 49, 59, 69
   icons.service.ts100100100100 
   navigation.service.ts10080100100116
   notification.service.ts100100100100 
   query-params.service.ts100100100100 
   share-url.service.ts100100100100 
   storage.service.ts98.1810010098.11109
   table-storage.service.ts500042.8511–31
   table-url.service.ts100100100100 
   table.service.ts100100100100 
   tasks-by-status.service.ts100100100100 
   user-grpc.service.ts100100100100 
   user.service.ts100100100100 
   utils.service.ts97.5694.1110097.43119
   versions-grpc.service.ts100100100100 
   versions.service.ts1007010010014, 25, 32
sessions/components82.470.8353.8487.87 
   table.component.html100100100100 
   table.component.ts82.2470.8353.8487.75128–144, 222–232, 254
sessions/services46.3721.4225.9245.31 
   sessions-filters.service.ts66.66506070168–186
   sessions-index.service.ts17.850014.8111–218
   sessions-statuses.service.ts62.51002557.1418–26
tasks/components76.9242.8554.1681.63 
   table.component.html100100100100 
   table.component.ts76.6942.8554.1681.44131–143, 167–189, 202
tasks/services60.95266060.6 
   tasks-filters.service.ts69.6983.336073.33207–220
   tasks-grpc.service.ts21.210018.7513–155
   tasks-index.service.ts87.09808086.66229, 295–300
   tasks-statuses.service.ts87.507585.7141
tokens100100100100 
   filters.token.ts100100100100 
types100100100100 
   filter-definition.ts100100100100 
types/components89.655088.8892.15 
   table.ts89.655088.8892.1549, 81, 88–89

Please sign in to comment.