diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/components/trash-inspections-setting/trash-inspection-settings.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/components/trash-inspections-setting/trash-inspection-settings.component.ts index 4fa38645..b9a60aa6 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/components/trash-inspections-setting/trash-inspection-settings.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/components/trash-inspections-setting/trash-inspection-settings.component.ts @@ -3,6 +3,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import { TrashInspectionPnSettingsService } from '../../services'; import { Router } from '@angular/router'; @@ -22,6 +23,12 @@ import {take} from 'rxjs'; standalone: false }) export class TrashInspectionSettingsComponent implements OnInit { + private trashInspectionPnSettingsService = inject(TrashInspectionPnSettingsService); + private router = inject(Router); + private eFormService = inject(EFormService); + private entitySearchService = inject(EntitySearchService); + private cd = inject(ChangeDetectorRef); + typeahead = new EventEmitter(); settingsModel: TrashInspectionBaseSettingsModel = new TrashInspectionBaseSettingsModel(); templatesModel: TemplateListModel = new TemplateListModel(); @@ -37,13 +44,9 @@ export class TrashInspectionSettingsComponent implements OnInit { return '' }*/ - constructor( - private trashInspectionPnSettingsService: TrashInspectionPnSettingsService, - private router: Router, - private eFormService: EFormService, - private entitySearchService: EntitySearchService, - private cd: ChangeDetectorRef - ) { + + + ngOnInit() { this.typeahead .pipe( skip(1), @@ -57,9 +60,7 @@ export class TrashInspectionSettingsComponent implements OnInit { this.templatesModel = items.model; this.cd.markForCheck(); }); - } - ngOnInit() { this.getSettings(); this.eFormService.getAll(this.templateRequestModel).pipe(take(1)) .subscribe((items) => { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/layouts/trash-inspection-pn-layout.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/layouts/trash-inspection-pn-layout.component.ts index ec38c58c..e4148a87 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/layouts/trash-inspection-pn-layout.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/layouts/trash-inspection-pn-layout.component.ts @@ -1,4 +1,4 @@ -import {AfterContentInit, Component, OnDestroy, OnInit} from '@angular/core'; +import {AfterContentInit, Component, OnDestroy, OnInit, inject} from '@angular/core'; import {TranslateService} from '@ngx-translate/core'; import {translates} from './../i18n/translates'; import {AuthStateService} from 'src/app/common/store'; @@ -15,13 +15,15 @@ import {addPluginToVisited, selectPluginsVisitedPlugins} from 'src/app/state'; }) export class TrashInspectionPnLayoutComponent implements AfterContentInit, OnInit, OnDestroy { + private translateService = inject(TranslateService); + private store = inject(Store); + currentUserLocaleAsyncSub$: Subscription; private pluginName = 'trashinspection'; - constructor( - private translateService: TranslateService, - store: Store - ) { - store.select(selectPluginsVisitedPlugins) + + + ngOnInit() { + this.store.select(selectPluginsVisitedPlugins) .pipe(take(1)) .subscribe(x => { // check current plugin in activated plugin @@ -31,14 +33,11 @@ export class TrashInspectionPnLayoutComponent this.translateService.setTranslation(locale, translates[locale], true); }); // add plugin to visited plugins - store.dispatch(addPluginToVisited(this.pluginName)); + this.store.dispatch(addPluginToVisited(this.pluginName)); } }); } - ngOnInit() { - } - ngAfterContentInit() { } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-create/fraction-create.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-create/fraction-create.component.ts index a41e6de7..39ad06f4 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-create/fraction-create.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-create/fraction-create.component.ts @@ -3,6 +3,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import { debounceTime, switchMap } from 'rxjs/operators'; import { TrashInspectionPnFractionsService } from '../../../../services'; @@ -25,6 +26,14 @@ import {Store} from '@ngrx/store'; standalone: false }) export class FractionCreateComponent implements OnInit { + private authStore = inject(Store); + private trashInspectionPnFractionsService = inject(TrashInspectionPnFractionsService); + private sitesService = inject(SitesService); + private authStateService = inject(AuthStateService); + private eFormService = inject(EFormService); + private cd = inject(ChangeDetectorRef); + public dialogRef = inject(MatDialogRef); + onFractionCreated: EventEmitter = new EventEmitter(); newFractionModel: FractionPnModel = new FractionPnModel(); sitesDto: Array = []; @@ -35,15 +44,9 @@ export class FractionCreateComponent implements OnInit { typeahead = new EventEmitter(); private selectCurrentUserClaimsEformsPairingRead$ = this.authStore.select(selectCurrentUserClaimsEformsPairingRead); - constructor( - private authStore: Store, - private trashInspectionPnFractionsService: TrashInspectionPnFractionsService, - private sitesService: SitesService, - private authStateService: AuthStateService, - private eFormService: EFormService, - private cd: ChangeDetectorRef, - public dialogRef: MatDialogRef, - ) { + + + ngOnInit() { this.typeahead .pipe( debounceTime(200), @@ -58,9 +61,6 @@ export class FractionCreateComponent implements OnInit { }); this.deployModel = new DeployModel(); this.deployViewModel = new DeployModel(); - } - - ngOnInit() { this.loadAllSites(); } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-edit/fraction-edit.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-edit/fraction-edit.component.ts index 8721de81..5c5d2481 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-edit/fraction-edit.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-edit/fraction-edit.component.ts @@ -2,8 +2,8 @@ import { ChangeDetectorRef, Component, EventEmitter, - Inject, OnInit, + inject } from '@angular/core'; import { TrashInspectionPnFractionsService } from '../../../../services'; import { FractionPnModel } from '../../../../models'; @@ -23,18 +23,20 @@ import {take} from 'rxjs'; standalone: false }) export class FractionEditComponent implements OnInit { + private trashInspectionPnFractionsService = inject(TrashInspectionPnFractionsService); + private cd = inject(ChangeDetectorRef); + private eFormService = inject(EFormService); + public dialogRef = inject(MatDialogRef); + private fractionModel = inject(MAT_DIALOG_DATA); + onFractionUpdated: EventEmitter = new EventEmitter(); selectedFractionModel: FractionPnModel = new FractionPnModel(); templateRequestModel: TemplateRequestModel = new TemplateRequestModel(); templatesModel: TemplateListModel = new TemplateListModel(); typeahead = new EventEmitter(); - constructor( - private trashInspectionPnFractionsService: TrashInspectionPnFractionsService, - private cd: ChangeDetectorRef, - private eFormService: EFormService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) fractionModel: FractionPnModel, - ) { + + + ngOnInit() { this.typeahead .pipe( debounceTime(200), @@ -48,10 +50,7 @@ export class FractionEditComponent implements OnInit { this.templatesModel = items.model; this.cd.markForCheck(); }); - this.getSelectedFraction(fractionModel.id); - } - - ngOnInit() { + this.getSelectedFraction(this.fractionModel.id); this.eFormService.getAll(this.templateRequestModel).pipe(take(1)).subscribe((items) => { this.templatesModel = items.model; }); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-import/fractions-import.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-import/fractions-import.component.ts index e9158c03..69487d32 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-import/fractions-import.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-import/fractions-import.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { FileUploader } from 'ng2-file-upload'; import { Papa } from 'ngx-papaparse'; import { TrashInspectionPnFractionsService } from '../../../../services'; @@ -13,6 +13,8 @@ const URL = ''; standalone: false }) export class FractionsImportComponent implements OnInit { + private fractionsService = inject(TrashInspectionPnFractionsService); + public data: any = []; uploader: FileUploader; fractionsImportModel: FractionPnImportModel; @@ -38,7 +40,9 @@ export class FractionsImportComponent implements OnInit { ]; columns: MtxGridColumn[] = []; - constructor(private fractionsService: TrashInspectionPnFractionsService) { + + + ngOnInit() { this.fractionsImportModel = new FractionPnImportModel(); this.options.forEach((option) => { this.fractionsImportModel.headerList = [ @@ -57,9 +61,6 @@ export class FractionsImportComponent implements OnInit { // console.log(fileItem._file); this.myFile = fileItem.file.rawFile; }; - } - - ngOnInit() { this.fileName = 'DummyCustomerData.csv'; this.totalColumns = 4; this.totalRows = 100; diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-page/fractions-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-page/fractions-page.component.ts index 2858b514..e2a8c1fd 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-page/fractions-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/fractions/components/fraction-page/fractions-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import {FractionPnModel, TransporterPnModel} from '../../../../models'; import {TrashInspectionPnClaims} from '../../../../enums'; import {TrashInspectionPnFractionsService} from '../../../../services'; @@ -30,6 +30,14 @@ import { standalone: false }) export class FractionsPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public fractionsStateService = inject(FractionsStateService); + public authStateService = inject(AuthStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private trashInspectionPnFractionsService = inject(TrashInspectionPnFractionsService); + fractionsModel: Paged = new Paged(); tableHeaders: MtxGridColumn[] = [ {header: this.translateService.stream('Id'), field: 'id', sortProp: {id: 'Id'}, sortable: true}, @@ -76,16 +84,7 @@ export class FractionsPageComponent implements OnInit, OnDestroy { public selectFractionsPaginationSort$ = this.store.select(selectFractionsPaginationSort); public selectFractionsPaginationIsSortDsc$ = this.store.select(selectFractionsPaginationIsSortDsc); - constructor( - private store: Store, - public fractionsStateService: FractionsStateService, - public authStateService: AuthStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private trashInspectionPnFractionsService: TrashInspectionPnFractionsService, - ) { - } + ngOnInit() { this.getAllInitialData(); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-create/installation-create.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-create/installation-create.component.ts index 3b951417..6c892c01 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-create/installation-create.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-create/installation-create.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import {InstallationPnCreateModel, InstallationPnModel} from '../../../../models'; import {TrashInspectionPnInstallationsService} from '../../../../services'; @@ -20,6 +21,13 @@ import {Store} from '@ngrx/store'; standalone: false }) export class InstallationCreateComponent implements OnInit { + private authStore = inject(Store); + private trashInspectionPnInstallationsService = inject(TrashInspectionPnInstallationsService); + private sitesService = inject(SitesService); + private authService = inject(AuthService); + public dialogRef = inject(MatDialogRef); + private translateService = inject(TranslateService); + installationCreated: EventEmitter = new EventEmitter(); newInstallationModel: InstallationPnCreateModel = new InstallationPnCreateModel(); sitesDto: Array = []; @@ -33,19 +41,11 @@ export class InstallationCreateComponent implements OnInit { {header: this.translateService.stream('Check to pair'), field: 'deployCheckboxes'}, ]; - constructor( - private authStore: Store, - private trashInspectionPnInstallationsService: TrashInspectionPnInstallationsService, - private sitesService: SitesService, - private authService: AuthService, - public dialogRef: MatDialogRef, - private translateService: TranslateService, - ) { - this.deployViewModel = new DeployModel(); - this.fillCheckboxes(); - } + ngOnInit() { + this.deployViewModel = new DeployModel(); + this.fillCheckboxes(); this.loadAllSites(); } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-edit/installation-edit.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-edit/installation-edit.component.ts index 7110e9d6..0c596973 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-edit/installation-edit.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-edit/installation-edit.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, - Inject, OnInit, + inject } from '@angular/core'; import { InstallationPnModel, @@ -27,6 +27,13 @@ import {Store} from '@ngrx/store'; standalone: false }) export class InstallationEditComponent implements OnInit { + private authStore = inject(Store); + private trashInspectionPnInstallationsService = inject(TrashInspectionPnInstallationsService); + private sitesService = inject(SitesService); + private translateService = inject(TranslateService); + public dialogRef = inject(MatDialogRef); + private installationModel = inject(MAT_DIALOG_DATA); + onInstallationUpdated: EventEmitter = new EventEmitter(); deployViewModel: DeployModel = new DeployModel(); selectedInstallationModel: InstallationPnModel = new InstallationPnModel(); @@ -39,18 +46,10 @@ export class InstallationEditComponent implements OnInit { {header: this.translateService.stream('Related Site'), field: 'deployCheckboxes'}, ]; - constructor( - private authStore: Store, - private trashInspectionPnInstallationsService: TrashInspectionPnInstallationsService, - private sitesService: SitesService, - private translateService: TranslateService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) private installationModel: InstallationPnModel - ) { - this.loadAllSites(); - } + ngOnInit() { + this.loadAllSites(); } getSelectedInstallation(id: number) { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-page/installations-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-page/installations-page.component.ts index c0fa2353..e14c2718 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-page/installations-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/installations/components/installation-page/installations-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import { InstallationPnModel, InstallationsPnModel, @@ -31,6 +31,13 @@ import { standalone: false }) export class InstallationsPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public installationsStateService = inject(InstallationsStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private trashInspectionPnInstallationsService = inject(TrashInspectionPnInstallationsService); + installationsModel: InstallationsPnModel = new InstallationsPnModel(); tableHeaders: MtxGridColumn[] = [ @@ -70,15 +77,7 @@ export class InstallationsPageComponent implements OnInit, OnDestroy { public selectInstallationsPaginationIsSortDsc$ = this.store.select(selectInstallationsPaginationIsSortDsc); public selectInstallationsPagination$ = this.store.select(selectInstallationsPagination); - constructor( - private store: Store, - public installationsStateService: InstallationsStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private trashInspectionPnInstallationsService: TrashInspectionPnInstallationsService - ) { - } + ngOnInit() { this.getAllInitialData(); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-create/producer-create.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-create/producer-create.component.ts index 8accf576..2993d556 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-create/producer-create.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-create/producer-create.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import {ProducerPnModel,} from '../../../../models'; import {TrashInspectionPnProducersService} from '../../../../services'; @@ -14,14 +15,13 @@ import {MatDialogRef} from '@angular/material/dialog'; standalone: false }) export class ProducerCreateComponent implements OnInit { + private trashInspectionPnProducerService = inject(TrashInspectionPnProducersService); + public dialogRef = inject(MatDialogRef); + onProducerCreated: EventEmitter = new EventEmitter(); newProducerModel: ProducerPnModel = new ProducerPnModel(); - constructor( - private trashInspectionPnProducerService: TrashInspectionPnProducersService, - public dialogRef: MatDialogRef, - ) { - } + ngOnInit() { } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-edit/producer-edit.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-edit/producer-edit.component.ts index 5b1288ab..b3bebb54 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-edit/producer-edit.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-edit/producer-edit.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, - Inject, OnInit, + inject } from '@angular/core'; import { ProducerPnModel } from '../../../../models'; import { TrashInspectionPnProducersService } from '../../../../services'; @@ -15,17 +15,17 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; standalone: false }) export class ProducerEditComponent implements OnInit { + private trashInspectionPnProducerService = inject(TrashInspectionPnProducersService); + public dialogRef = inject(MatDialogRef); + private producerModel = inject(MAT_DIALOG_DATA); + onProducerUpdated: EventEmitter = new EventEmitter(); selectedProducer: ProducerPnModel = new ProducerPnModel(); - constructor( - private trashInspectionPnProducerService: TrashInspectionPnProducersService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) producerModel: ProducerPnModel - ) { - this.getSelectedProducer(producerModel.id); - } + - ngOnInit() {} + ngOnInit() { + this.getSelectedProducer(this.producerModel.id); + } getSelectedProducer(id: number) { this.trashInspectionPnProducerService diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-import/producer-import.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-import/producer-import.component.ts index 5f2680b0..aedaffce 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-import/producer-import.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-import/producer-import.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnInit, inject} from '@angular/core'; import {Papa} from 'ngx-papaparse'; import {FileUploader} from 'ng2-file-upload'; import { @@ -19,6 +19,9 @@ const URL = ''; standalone: false }) export class ProducerImportComponent implements OnInit { + private producerService = inject(TrashInspectionPnProducersService); + private router = inject(Router); + public data: any = []; uploader: FileUploader; producerImportModel: ProducerPnImportModel; @@ -46,10 +49,9 @@ export class ProducerImportComponent implements OnInit { ]; columns: MtxGridColumn[] = []; - constructor( - private producerService: TrashInspectionPnProducersService, - private router: Router, - ) { + + + ngOnInit() { this.producerImportModel = new ProducerPnImportModel(); this.producerImportModel.headerList = this.options.map((option) => ({headerValue: null, headerLabel: option.label})); this.uploader = new FileUploader({ @@ -65,9 +67,6 @@ export class ProducerImportComponent implements OnInit { }; } - ngOnInit() { - } - csv2Array(fileInput) { const files = fileInput.target.files; this.papa.parse(files[files.length - 1], { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-page/producer-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-page/producer-page.component.ts index 391fc246..7efa8774 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-page/producer-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/producers/components/producer-page/producer-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import {DeleteModalSettingModel, PaginationModel,} from 'src/app/common/models'; import {ProducerPnModel, ProducersPnModel} from '../../../../models'; import {TrashInspectionPnProducersService} from '../../../../services'; @@ -28,6 +28,13 @@ import { standalone: false }) export class ProducerPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public producersStateService = inject(ProducersStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private trashInspectionPnProducerService = inject(TrashInspectionPnProducersService); + producersModel: ProducersPnModel = new ProducersPnModel(); tableHeaders: MtxGridColumn[] = [ @@ -73,15 +80,7 @@ export class ProducerPageComponent implements OnInit, OnDestroy { public selectProducersPaginationIsSortDsc$ = this.store.select(selectProducersPaginationIsSortDsc); public selectProducersPagination$ = this.store.select(selectProducersPagination); - constructor( - private store: Store, - public producersStateService: ProducersStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private trashInspectionPnProducerService: TrashInspectionPnProducersService - ) { - } + ngOnInit() { this.getAllInitialData(); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-create/segment-create.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-create/segment-create.component.ts index 8b3ad2f8..bc3114a3 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-create/segment-create.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-create/segment-create.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import {SiteNameDto, DeployModel} from 'src/app/common/models'; import {SegmentPnModel,} from '../../../../models'; @@ -19,6 +20,11 @@ import {selectCurrentUserClaimsEformsPairingRead} from 'src/app/state'; standalone: false }) export class SegmentCreateComponent implements OnInit { + private authStore = inject(Store); + private trashInspectionPnSegmentsService = inject(TrashInspectionPnSegmentsService); + private sitesService = inject(SitesService); + public dialogRef = inject(MatDialogRef); + onSegmentCreated: EventEmitter = new EventEmitter(); segmentPnModel: SegmentPnModel = new SegmentPnModel(); sitesDto: Array = []; @@ -26,17 +32,11 @@ export class SegmentCreateComponent implements OnInit { deployViewModel: DeployModel = new DeployModel(); private selectCurrentUserClaimsEformsPairingRead$ = this.authStore.select(selectCurrentUserClaimsEformsPairingRead); - constructor( - private authStore: Store, - private trashInspectionPnSegmentsService: TrashInspectionPnSegmentsService, - private sitesService: SitesService, - public dialogRef: MatDialogRef, - ) { - this.deployModel = new DeployModel(); - this.deployViewModel = new DeployModel(); - } + ngOnInit() { + this.deployModel = new DeployModel(); + this.deployViewModel = new DeployModel(); this.loadAllSites(); } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-edit/segment-edit.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-edit/segment-edit.component.ts index 14c74fe7..1a050b92 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-edit/segment-edit.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-edit/segment-edit.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, - Inject, OnInit, + inject } from '@angular/core'; import {TrashInspectionPnSegmentsService} from '../../../../services'; import {SegmentPnModel} from '../../../../models'; @@ -15,19 +15,18 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; standalone: false }) export class SegmentEditComponent implements OnInit { + private trashInspectionPnSegmentsService = inject(TrashInspectionPnSegmentsService); + public dialogRef = inject(MatDialogRef); + private segmentPnModelParam = inject(MAT_DIALOG_DATA); + onSegmentUpdated: EventEmitter = new EventEmitter(); segmentPnModel: SegmentPnModel = new SegmentPnModel(); typeahead = new EventEmitter(); - constructor( - private trashInspectionPnSegmentsService: TrashInspectionPnSegmentsService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) segmentPnModel: SegmentPnModel, - ) { - this.getSelectedFraction(segmentPnModel.id); - } + ngOnInit() { + this.getSelectedFraction(this.segmentPnModelParam.id); } getSelectedFraction(id: number) { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-page/segments-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-page/segments-page.component.ts index 1ca94074..610bbd67 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-page/segments-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/segments/components/segment-page/segments-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import {SegmentPnModel, SegmentsPnModel,} from '../../../../models'; import {SegmentsStateService} from '../store'; import {DeleteModalSettingModel, PaginationModel} from 'src/app/common/models'; @@ -28,6 +28,13 @@ import { standalone: false }) export class SegmentsPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public segmentsStateService = inject(SegmentsStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private trashInspectionPnSegmentsService = inject(TrashInspectionPnSegmentsService); + segmentsPnModel: SegmentsPnModel = new SegmentsPnModel(); tableHeaders: MtxGridColumn[] = [ @@ -69,15 +76,7 @@ export class SegmentsPageComponent implements OnInit, OnDestroy { public selectSegmentsPaginationIsSortDsc$ = this.store.select(selectSegmentsPaginationIsSortDsc); public selectSegmentsPagination$ = this.store.select(selectSegmentsPagination); - constructor( - private store: Store, - public segmentsStateService: SegmentsStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private trashInspectionPnSegmentsService: TrashInspectionPnSegmentsService, - ) { - } + ngOnInit() { this.getAllInitialData(); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-create/transporter-create.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-create/transporter-create.component.ts index 6325a8a2..93d05c71 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-create/transporter-create.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-create/transporter-create.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, + inject } from '@angular/core'; import {TransporterPnModel} from '../../../../models'; import {TrashInspectionPnTransporterService} from '../../../../services'; @@ -14,14 +15,13 @@ import {MatDialogRef} from '@angular/material/dialog'; standalone: false }) export class TransporterCreateComponent implements OnInit { + private trashInspectionPnTransporterService = inject(TrashInspectionPnTransporterService); + public dialogRef = inject(MatDialogRef); + transporterCreated: EventEmitter = new EventEmitter(); newTransporterModel: TransporterPnModel = new TransporterPnModel(); - constructor( - private trashInspectionPnTransporterService: TrashInspectionPnTransporterService, - public dialogRef: MatDialogRef, - ) { - } + ngOnInit() { } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-edit/transporter-edit.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-edit/transporter-edit.component.ts index f8bfd268..57442e11 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-edit/transporter-edit.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-edit/transporter-edit.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, - Inject, OnInit, + inject } from '@angular/core'; import {ProducerPnModel, TransporterPnModel} from '../../../../models'; import {TrashInspectionPnTransporterService} from '../../../../services'; @@ -15,18 +15,17 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; standalone: false }) export class TransporterEditComponent implements OnInit { + private trashInspectionPnTransporterService = inject(TrashInspectionPnTransporterService); + public dialogRef = inject(MatDialogRef); + private transporterModel = inject(MAT_DIALOG_DATA); + transporterUpdated: EventEmitter = new EventEmitter(); public selectedTransporter: TransporterPnModel = new TransporterPnModel(); - constructor( - private trashInspectionPnTransporterService: TrashInspectionPnTransporterService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) transporterModel: TransporterPnModel, - ) { - this.getSelectedProducer(transporterModel.id); - } + ngOnInit() { + this.getSelectedProducer(this.transporterModel.id); } getSelectedProducer(id: number) { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-import/transporter-import.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-import/transporter-import.component.ts index de407f7c..0ab01c95 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-import/transporter-import.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-import/transporter-import.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { FileUploader } from 'ng2-file-upload'; import { Papa } from 'ngx-papaparse'; import { TrashInspectionPnTransporterService } from '../../../../services'; @@ -20,6 +20,9 @@ const URL = ''; standalone: false }) export class TransporterImportComponent implements OnInit { + private transporterService = inject(TrashInspectionPnTransporterService); + private router = inject(Router); + public data: any = []; uploader: FileUploader; transporterImportModel: TransporterPnImportModel; @@ -48,11 +51,10 @@ export class TransporterImportComponent implements OnInit { columns: MtxGridColumn[] = []; - constructor( - private transporterService: TrashInspectionPnTransporterService, - private router: Router, - ) { - this.transporterImportModel = new ProducerPnImportModel(); + + + ngOnInit() { + this.transporterImportModel = new TransporterPnImportModel(); this.options.forEach((option) => { this.transporterImportModel.headerList = [ ...this.transporterImportModel.headerList, @@ -72,8 +74,6 @@ export class TransporterImportComponent implements OnInit { }; } - ngOnInit() {} - csv2Array(fileInput) { const files = fileInput.target.files; this.papa.parse(files[files.length - 1], { diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-page/transporter-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-page/transporter-page.component.ts index f2706c74..afc1fa21 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-page/transporter-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/transporters/components/transporter-page/transporter-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit,} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import { TransporterPnModel, TransportersPnModel, @@ -31,6 +31,13 @@ import { standalone: false }) export class TransporterPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public transportersStateService = inject(TransportersStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private trashInspectionPnTransporterService = inject(TrashInspectionPnTransporterService); + transportersModel: TransportersPnModel = new TransportersPnModel(); tableHeaders: MtxGridColumn[] = [ {header: this.translateService.stream('Id'), field: 'id', sortProp: {id: 'Id'}, sortable: true}, @@ -76,15 +83,7 @@ export class TransporterPageComponent implements OnInit, OnDestroy { public selectTransportersPaginationIsSortDsc$ = this.store.select(selectTransportersPaginationIsSortDsc); public selectTransportersPagination$ = this.store.select(selectTransportersPagination); - constructor( - private store: Store, - public transportersStateService: TransportersStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private trashInspectionPnTransporterService: TrashInspectionPnTransporterService - ) { - } + ngOnInit() { this.getAllInitialData(); diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-page/trash-inspections-page.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-page/trash-inspections-page.component.ts index a7fe505f..45b43d6b 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-page/trash-inspections-page.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-page/trash-inspections-page.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit, inject} from '@angular/core'; import {TrashInspectionPnModel} from '../../../../models'; import {TrashInspectionPnTrashInspectionsService} from '../../../../services'; import {DeleteModalSettingModel, Paged, PaginationModel} from 'src/app/common/models'; @@ -29,6 +29,13 @@ import { standalone: false }) export class TrashInspectionsPageComponent implements OnInit, OnDestroy { + private store = inject(Store); + public trashInspectionsStateService = inject(TrashInspectionsStateService); + private translateService = inject(TranslateService); + private dialog = inject(MatDialog); + private overlay = inject(Overlay); + private machineAreaPnMachinesService = inject(TrashInspectionPnTrashInspectionsService); + // @ViewChild('createTrashInspectionModal') createTrashInspectionModal; searchSubject = new Subject(); @@ -118,21 +125,13 @@ export class TrashInspectionsPageComponent implements OnInit, OnDestroy { public selectTrashInspectionsNameFilters$ = this.store.select(selectTrashInspectionsNameFilters); public selectTrashInspectionsPagination$ = this.store.select(selectTrashInspectionsPagination); - constructor( - private store: Store, - public trashInspectionsStateService: TrashInspectionsStateService, - private translateService: TranslateService, - private dialog: MatDialog, - private overlay: Overlay, - private machineAreaPnMachinesService: TrashInspectionPnTrashInspectionsService - ) { + + + ngOnInit() { this.searchSubject.pipe(debounceTime(500)).subscribe((val: string) => { this.trashInspectionsStateService.updateNameFilter(val); this.getAllTrashInspections(); }); - } - - ngOnInit() { this.getAllInitialData(); } diff --git a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-version-view/trash-inspection-version-view.component.ts b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-version-view/trash-inspection-version-view.component.ts index 73ea9287..4e139eef 100644 --- a/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-version-view/trash-inspection-version-view.component.ts +++ b/eform-client/src/app/plugins/modules/trash-inspection-pn/modules/trash-inspections/components/trash-inspection-version-view/trash-inspection-version-view.component.ts @@ -1,4 +1,4 @@ -import {Component, Inject, OnInit} from '@angular/core'; +import {Component, OnInit, inject} from '@angular/core'; import { TrashInspectionPnSettingsService, TrashInspectionPnTrashInspectionsService, @@ -16,6 +16,12 @@ import {TranslateService} from '@ngx-translate/core'; standalone: false }) export class TrashInspectionVersionViewComponent implements OnInit { + private trashInspectionPnSettingsService = inject(TrashInspectionPnSettingsService); + private trashInspectionPnTrashInspectionsService = inject(TrashInspectionPnTrashInspectionsService); + private translateService = inject(TranslateService); + public dialogRef = inject(MatDialogRef); + private trashInspectionId = inject(MAT_DIALOG_DATA); + localPageSettings: PageSettingsModel = new PageSettingsModel(); trashInspectionVersionsModel: TrashInspectionVersionsPnModel = new TrashInspectionVersionsPnModel(); @@ -96,17 +102,10 @@ export class TrashInspectionVersionViewComponent implements OnInit { {header: this.translateService.stream('Removed'), field: 'removed', type: 'date', typeParameter: {format: 'dd.MM.y HH:mm:ss'}}, ]; - constructor( - private trashInspectionPnSettingsService: TrashInspectionPnSettingsService, - private trashInspectionPnTrashInspectionsService: TrashInspectionPnTrashInspectionsService, - private translateService: TranslateService, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) trashInspectionId: number - ) { - this.getSelectedVersions(trashInspectionId); - } + ngOnInit() { + this.getSelectedVersions(this.trashInspectionId); } getSelectedVersions(trashInspectionId: number) {