diff --git a/src/app/backoffice/tables/certificate-group/certificate-group-list/certificate-group-list.component.ts b/src/app/backoffice/tables/certificate-group/certificate-group-list/certificate-group-list.component.ts index 7a9f266..785a869 100644 --- a/src/app/backoffice/tables/certificate-group/certificate-group-list/certificate-group-list.component.ts +++ b/src/app/backoffice/tables/certificate-group/certificate-group-list/certificate-group-list.component.ts @@ -1,12 +1,12 @@ import { TitleCasePipe } from '@angular/common'; -import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject, signal } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ResolveFn, Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ConfirmationService, MessageService } from 'primeng/api'; import { TableLazyLoadEvent } from 'primeng/table'; -import { BehaviorSubject, Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; +import { Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; import { appRootTitle } from 'src/app/app.component'; import { GenericFieldType, @@ -70,8 +70,7 @@ export class CertificateGroupListComponent implements OnInit, OnDestroy, EntityL initialValue: 0, }); - tableConfig$ = new BehaviorSubject | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(certificateGroupReducer.getAction); @@ -160,7 +159,7 @@ export class CertificateGroupListComponent implements OnInit, OnDestroy, EntityL optionButtons.push({ action: 'edit', icon: 'pi pi-pencil' }); optionButtons.push({ action: 'delete', icon: 'pi pi-trash' }); - this.tableConfig$.next({ + this.tableConfig.set({ ...defaultGenericTableConfig, title: this.titleCasePipe.transform( this.translateSrv.instant(`tables.${this.names.name(Naming.CAMEL_CASE, NumberMode.SINGULAR)}.plural`), diff --git a/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.html b/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.html index 8a8f060..c82d563 100644 --- a/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.html +++ b/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.html @@ -1,8 +1,8 @@ diff --git a/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.ts b/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.ts index 015bf5d..9fa3ac0 100644 --- a/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.ts +++ b/src/app/backoffice/tables/certificate-type/certificate-type-list/certificate-type-list.component.ts @@ -1,12 +1,12 @@ import { TitleCasePipe } from '@angular/common'; -import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject, signal } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ResolveFn, Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ConfirmationService, MessageService } from 'primeng/api'; import { TableLazyLoadEvent } from 'primeng/table'; -import { BehaviorSubject, Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; +import { Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; import { appRootTitle } from 'src/app/app.component'; import { GenericFieldType, @@ -71,8 +71,7 @@ export class CertificateTypeListComponent implements OnInit, OnDestroy, EntityLi initialValue: 0, }); - tableConfig$ = new BehaviorSubject | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(certificateTypeReducer.getAction); @@ -163,7 +162,7 @@ export class CertificateTypeListComponent implements OnInit, OnDestroy, EntityLi optionButtons.push({ action: 'edit', icon: 'pi pi-pencil' }); optionButtons.push({ action: 'delete', icon: 'pi pi-trash' }); - this.tableConfig$.next({ + this.tableConfig.set({ ...defaultGenericTableConfig, title: this.titleCasePipe.transform( this.translateSrv.instant(`tables.${this.names.name(Naming.CAMEL_CASE, NumberMode.SINGULAR)}.plural`), diff --git a/src/app/backoffice/tables/certificate/certificate-list/certificate-list.component.ts b/src/app/backoffice/tables/certificate/certificate-list/certificate-list.component.ts index d2d64bb..16e2600 100644 --- a/src/app/backoffice/tables/certificate/certificate-list/certificate-list.component.ts +++ b/src/app/backoffice/tables/certificate/certificate-list/certificate-list.component.ts @@ -1,12 +1,12 @@ import { TitleCasePipe } from '@angular/common'; -import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject, signal } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ResolveFn, Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ConfirmationService, MessageService } from 'primeng/api'; import { TableLazyLoadEvent } from 'primeng/table'; -import { BehaviorSubject, Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; +import { Subject, filter, map, startWith, switchMap, takeUntil } from 'rxjs'; import { appRootTitle } from 'src/app/app.component'; import { GenericFieldType, @@ -71,8 +71,7 @@ export class CertificateListComponent implements OnInit, OnDestroy, EntityList | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(certificateReducer.getAction); @@ -163,7 +162,7 @@ export class CertificateListComponent implements OnInit, OnDestroy, EntityList | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(companyReducer.getAction); @@ -163,7 +162,7 @@ export class CompanyListComponent implements OnInit, OnDestroy, EntityList | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(languageReducer.getAction); @@ -163,7 +162,7 @@ export class LanguageListComponent implements OnInit, OnDestroy, EntityList | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(positionReducer.getAction); @@ -163,7 +162,7 @@ export class PositionListComponent implements OnInit, OnDestroy, EntityList | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(skillTypeReducer.getAction); @@ -164,7 +163,7 @@ export class SkillTypeListComponent implements OnInit, OnDestroy, EntityList initialValue: 0, }); - tableConfig$ = new BehaviorSubject | undefined>(undefined); - tableConfig = toSignal(this.tableConfig$); + tableConfig = signal | undefined>(undefined); action$ = this.store.select(skillReducer.getAction); @@ -163,7 +162,7 @@ export class SkillListComponent implements OnInit, OnDestroy, EntityList optionButtons.push({ action: 'edit', icon: 'pi pi-pencil' }); optionButtons.push({ action: 'delete', icon: 'pi pi-trash' }); - this.tableConfig$.next({ + this.tableConfig.set({ ...defaultGenericTableConfig, title: this.titleCasePipe.transform( this.translateSrv.instant(`tables.${this.names.name(Naming.CAMEL_CASE, NumberMode.SINGULAR)}.plural`), diff --git a/src/app/shared/models/entity-list.model.ts b/src/app/shared/models/entity-list.model.ts index b35efef..c2f22bb 100644 --- a/src/app/shared/models/entity-list.model.ts +++ b/src/app/shared/models/entity-list.model.ts @@ -1,6 +1,6 @@ import { Signal } from '@angular/core'; import { TableLazyLoadEvent } from 'primeng/table'; -import { BehaviorSubject, Observable } from 'rxjs'; +import { Observable } from 'rxjs'; import { GenericTableConfig, TableEvent } from 'src/app/shared/components/generic-table/models/generic-table.models'; import { CommonNames, Naming, NumberMode } from 'src/app/shared/state/common/common.names'; import { Action } from '../state/common/common-state'; @@ -16,7 +16,6 @@ export interface EntityList { count$: Observable; count: Signal; - tableConfig$: BehaviorSubject | undefined>; tableConfig: Signal | undefined>; action$: Observable;