diff --git a/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.ts index 04331bea8..83f9710f4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.ts @@ -7,6 +7,7 @@ import { ListingComponent, listingProvidersFactory, LoadingService, + SortingOrders, TableColumnConfig, } from '@iqser/common-ui'; import { DOSSIER_TEMPLATE_ID, Justification } from '@red/domain'; @@ -31,8 +32,8 @@ export class JustificationsScreenComponent extends ListingComponent[] = [ - { label: _('justifications-listing.table-col-names.name'), width: '2fr' }, - { label: _('justifications-listing.table-col-names.reason') }, + { label: _('justifications-listing.table-col-names.name'), width: '2fr', sortByKey: 'name' }, + { label: _('justifications-listing.table-col-names.reason'), sortByKey: 'reason' }, { label: _('justifications-listing.table-col-names.description'), width: '2fr' }, ]; readonly #currentUser = getCurrentUser(); @@ -54,6 +55,10 @@ export class JustificationsScreenComponent extends ListingComponent { this._loadingService.start(); await firstValueFrom(this._justificationService.loadAll(this.#dossierTemplateId)); + this.sortingService.setSortingOption({ + column: 'name', + order: SortingOrders.asc, + }); this._loadingService.stop(); }