diff --git a/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.html b/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.html index 8935485..745466c 100644 --- a/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.html +++ b/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.html @@ -1 +1 @@ - + diff --git a/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.ts b/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.ts index ca42fa0..62e04be 100644 --- a/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.ts +++ b/src/app/backoffice/home/components/certificates-in-time-chart/certificates-in-time-chart.component.ts @@ -1,5 +1,7 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { CommonModule, TitleCasePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ChartData, ChartDataset, ChartOptions } from 'chart.js'; @@ -8,7 +10,6 @@ import { Observable, combineLatest, filter, map, startWith } from 'rxjs'; import { CertificateStateModule } from 'src/app/backoffice/tables/certificate/state/certificate-state.module'; import { certificateActions } from 'src/app/backoffice/tables/certificate/state/certificate.actions'; import { certificateReducer } from 'src/app/backoffice/tables/certificate/state/certificate.reducer'; -import { Language } from 'src/app/backoffice/tables/language/models/language.model'; import { TranslationProvider } from 'src/app/shared/models/translation-provider.model'; import { LanguagesModule } from 'src/app/shared/modules/languages.module'; import { publicLanguageReducer } from 'src/app/shared/state/languages/public-language.reducer'; @@ -27,7 +28,7 @@ export class CertificatesInTimeChartComponent extends TranslationProvider implem private translateSrv = inject(TranslateService); private titleCasePipe = inject(TitleCasePipe); - language$: Observable = this.store.select(publicLanguageReducer.getOne); + language$ = this.store.select(publicLanguageReducer.getOne); chartOptions$: Observable = this.translateSrv.onLangChange.pipe( startWith(this.translateSrv.currentLang), map(() => ({ @@ -84,6 +85,8 @@ export class CertificatesInTimeChartComponent extends TranslationProvider implem }, })), ); + chartOptions$$ = toSignal(this.chartOptions$); + chartData$: Observable> = combineLatest([ this.store.select(certificateReducer.getAll), this.language$, @@ -135,8 +138,9 @@ export class CertificatesInTimeChartComponent extends TranslationProvider implem return res; }), ); + chartData$$ = toSignal(this.chartData$); - ngOnInit(): void { + ngOnInit() { this.store.dispatch(certificateActions.loadAll({})); } } diff --git a/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.html b/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.html index 8935485..745466c 100644 --- a/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.html +++ b/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.html @@ -1 +1 @@ - + diff --git a/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.ts b/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.ts index a4a57f3..0e1c1f5 100644 --- a/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.ts +++ b/src/app/backoffice/home/components/positions-in-time-chart/positions-in-time-chart.component.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { CommonModule, TitleCasePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ChartData, ChartDataset, ChartOptions } from 'chart.js'; import { ChartModule } from 'primeng/chart'; import { Observable, combineLatest, map, startWith } from 'rxjs'; -import { Language } from 'src/app/backoffice/tables/language/models/language.model'; import { PositionStateModule } from 'src/app/backoffice/tables/position/state/position-state.module'; import { positionActions } from 'src/app/backoffice/tables/position/state/position.actions'; import { positionReducer } from 'src/app/backoffice/tables/position/state/position.reducer'; @@ -28,7 +28,7 @@ export class PositionsInTimeChartComponent extends TranslationProvider implement private translateSrv = inject(TranslateService); private titleCasePipe = inject(TitleCasePipe); - language$: Observable = this.store.select(publicLanguageReducer.getOne); + language$ = this.store.select(publicLanguageReducer.getOne); chartOptions$: Observable = this.translateSrv.onLangChange.pipe( startWith(this.translateSrv.currentLang), map(() => ({ @@ -89,6 +89,8 @@ export class PositionsInTimeChartComponent extends TranslationProvider implement }, })), ); + chartOptions$$ = toSignal(this.chartOptions$); + chartData$: Observable> = combineLatest([ this.store.select(positionReducer.getAll), this.language$, @@ -130,8 +132,9 @@ export class PositionsInTimeChartComponent extends TranslationProvider implement return res; }), ); + chartData$$ = toSignal(this.chartData$); - ngOnInit(): void { + ngOnInit() { this.store.dispatch(positionActions.loadAll({})); } } diff --git a/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.html b/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.html index c9e9f2f..479313d 100644 --- a/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.html +++ b/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.html @@ -1 +1 @@ - + diff --git a/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.ts b/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.ts index 5f1c31e..50089b0 100644 --- a/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.ts +++ b/src/app/backoffice/home/components/salary-in-time-chart/salary-in-time-chart.component.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { CommonModule, TitleCasePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { ChartData, ChartDataset, ChartOptions } from 'chart.js'; import { ChartModule } from 'primeng/chart'; import { Observable, combineLatest, map, startWith } from 'rxjs'; -import { Language } from 'src/app/backoffice/tables/language/models/language.model'; import { PositionStateModule } from 'src/app/backoffice/tables/position/state/position-state.module'; import { positionActions } from 'src/app/backoffice/tables/position/state/position.actions'; import { positionReducer } from 'src/app/backoffice/tables/position/state/position.reducer'; @@ -28,7 +28,7 @@ export class SalaryInTimeChartComponent extends TranslationProvider implements O private translateSrv = inject(TranslateService); private titleCasePipe = inject(TitleCasePipe); - language$: Observable = this.store.select(publicLanguageReducer.getOne); + language$ = this.store.select(publicLanguageReducer.getOne); chartOptions$: Observable = this.translateSrv.onLangChange.pipe( startWith(this.translateSrv.currentLang), map(() => ({ @@ -85,6 +85,8 @@ export class SalaryInTimeChartComponent extends TranslationProvider implements O }, })), ); + chartOptions$$ = toSignal(this.chartOptions$); + chartData$: Observable> = combineLatest([ this.store.select(positionReducer.getAll), this.language$, @@ -114,8 +116,9 @@ export class SalaryInTimeChartComponent extends TranslationProvider implements O return res; }), ); + chartData$$ = toSignal(this.chartData$); - ngOnInit(): void { + ngOnInit() { this.store.dispatch(positionActions.loadAll({})); } } diff --git a/src/app/backoffice/layout/backoffice/header/header.component.html b/src/app/backoffice/layout/backoffice/header/header.component.html index 8355110..9d97051 100644 --- a/src/app/backoffice/layout/backoffice/header/header.component.html +++ b/src/app/backoffice/layout/backoffice/header/header.component.html @@ -5,12 +5,12 @@

Personal Web

-

{{ (user$ | async)?.email }}

+

{{ user$$()?.email }}