Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Component, EventEmitter, Inject, OnDestroy, OnInit,} from '@angular/core';
import {Component, EventEmitter, OnDestroy, OnInit,
inject
} from '@angular/core';
import {EntityItemModel} from 'src/app/common/models';
import { EntityItemEditNameComponent } from 'src/app/common/modules/eform-shared/components';
import {EntitySelectService} from 'src/app/common/services';
Expand All @@ -16,21 +18,23 @@ import {Subscription} from 'rxjs';
standalone: false
})
export class AreaRuleEntityListModalComponent implements OnInit, OnDestroy {
private entitySelectService = inject(EntitySelectService);
public dialog = inject(MatDialog);
private overlay = inject(Overlay);
public dialogRef = inject(MatDialogRef<AreaRuleEntityListModalComponent>);
private groupId = inject<number | undefined>(MAT_DIALOG_DATA);

entityListChanged: EventEmitter<Array<EntityItemModel>> = new EventEmitter<Array<EntityItemModel>>();
entityList: Array<EntityItemModel> = [];

entityItemEditNameComponentAfterClosedSub$: Subscription;
getEntitySelectableGroupSub$: Subscription;

constructor(
private entitySelectService: EntitySelectService,
public dialog: MatDialog,
private overlay: Overlay,
public dialogRef: MatDialogRef<AreaRuleEntityListModalComponent>,
@Inject(MAT_DIALOG_DATA) groupId?: number
) {
if (groupId) {
this.getEntitySelectableGroupSub$ = this.entitySelectService.getEntitySelectableGroup(groupId)


ngOnInit() {
if (this.groupId) {
this.getEntitySelectableGroupSub$ = this.entitySelectService.getEntitySelectableGroup(this.groupId)
.subscribe(data => {
if (data && data.success && data.model) {
this.entityList = [...data.model.entityGroupItemLst];
Expand All @@ -43,9 +47,7 @@ export class AreaRuleEntityListModalComponent implements OnInit, OnDestroy {
}
})
}
}

ngOnInit() {}
}

hide() {
this.dialogRef.close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Component,
EventEmitter,
Inject,
OnInit,
inject
} from '@angular/core';
import {format} from 'date-fns';
import {
Expand Down Expand Up @@ -32,6 +32,15 @@ import {generateWeeksList} from '../../helpers';
standalone: false
})
export class AreaRulePlanModalComponent implements OnInit {
private translate = inject(TranslateService);
public dialogRef = inject(MatDialogRef<AreaRulePlanModalComponent>);
private model = inject<{
areaRule: AreaRuleSimpleModel | AreaRuleNameAndTypeSpecificFields,
propertyId: number,
area: AreaModel,
areaRulePlan: AreaRulePlanningModel,
}>(MAT_DIALOG_DATA);

updateAreaRulePlan: EventEmitter<AreaRulePlanningModel> = new EventEmitter<AreaRulePlanningModel>();
selectedArea: AreaModel = new AreaModel();
selectedAreaRulePlanning: AreaRulePlanningModel = new AreaRulePlanningModel();
Expand Down Expand Up @@ -104,23 +113,14 @@ export class AreaRulePlanModalComponent implements OnInit {
return this.selectedArea.availableWorkers.filter(x => assignedSites.some(y => y === x.siteId));
}

constructor(
private translate: TranslateService,
public dialogRef: MatDialogRef<AreaRulePlanModalComponent>,
@Inject(MAT_DIALOG_DATA) model: {
areaRule: AreaRuleSimpleModel | AreaRuleNameAndTypeSpecificFields,
propertyId: number,
area: AreaModel,
areaRulePlan: AreaRulePlanningModel,
},
) {
this.setData(model.areaRule, model.propertyId, model.area, model.areaRulePlan);
}


ngOnInit() {
this.setData(this.model.areaRule, this.model.propertyId, this.model.area, this.model.areaRulePlan);

this.repeatTypeDay = R.map(x => {
return {name: x === 1 ? this.translate.instant('Every') : x.toString(), id: x};
}, R.range(1, 31)); // 1, 2, ..., 29, 30.
}, R.range(1, 31)); // 1, 2, ..., 29, 30.
this.repeatTypeWeek = R.map(x => {
return {name: x === 1 ? this.translate.instant('Every') : x.toString(), id: x};
}, R.range(1, 51)); // 1, 2, ..., 49, 50.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
QueryList,
ViewChild,
ViewChildren,
inject
} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {EFormService, CasesService} from 'src/app/common/services';
Expand All @@ -27,6 +28,13 @@ import {Store} from '@ngrx/store';
standalone: false
})
export class BackendConfigurationCasePageComponent implements OnInit {
private activateRoute = inject(ActivatedRoute);
private casesService = inject(CasesService);
private store = inject(Store);
private eFormService = inject(EFormService);
private router = inject(Router);
private backendConfigurationPnCasesService = inject(BackendConfigurationPnCasesService);

@ViewChildren(CaseEditElementComponent)
editElements: QueryList<CaseEditElementComponent>;
@ViewChild('caseConfirmation', { static: false }) caseConfirmation;
Expand All @@ -41,14 +49,9 @@ export class BackendConfigurationCasePageComponent implements OnInit {
maxDate: Date;
initialDate: Date;

constructor(
private activateRoute: ActivatedRoute,
private casesService: CasesService,
private store: Store,
private eFormService: EFormService,
private router: Router,
private backendConfigurationPnCasesService: BackendConfigurationPnCasesService
) {


ngOnInit() {
this.activateRoute.params.subscribe((params) => {
this.id = +params['id'];
this.planningId = +params['planningId'];
Expand All @@ -57,9 +60,7 @@ export class BackendConfigurationCasePageComponent implements OnInit {
this.activateRoute.queryParams.subscribe((queryParams) => {
this.reverseRoute = queryParams['reverseRoute'];
})
}

ngOnInit() {
this.loadTemplateInfo();
this.maxDate = new Date();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Component, OnDestroy, OnInit,
inject
} from '@angular/core';
import {AutoUnsubscribe} from 'ngx-auto-unsubscribe';
import {Subject, Subscription} from 'rxjs';
import {EntityItemModel, Paged} from 'src/app/common/models';
Expand Down Expand Up @@ -33,6 +35,14 @@ import {dialogConfigHelper} from 'src/app/common/helpers';
standalone: false
})
export class PropertiesContainerComponent implements OnInit, OnDestroy {
private propertiesService = inject(BackendConfigurationPnPropertiesService);
public propertiesStateService = inject(PropertiesStateService);
public authStateService = inject(AuthStateService);
private entitySelectService = inject(EntitySelectService);
private translateService = inject(TranslateService);
private dialog = inject(MatDialog);
private overlay = inject(Overlay);

isFarms: boolean = false;
tableHeaders: MtxGridColumn[] = [
{
Expand Down Expand Up @@ -127,26 +137,18 @@ export class PropertiesContainerComponent implements OnInit, OnDestroy {
updateEntitySelectableGroupSub$: Subscription;
nameSearchSubjectSub$: Subscription;

constructor(
private propertiesService: BackendConfigurationPnPropertiesService,
public propertiesStateService: PropertiesStateService,
public authStateService: AuthStateService,
private entitySelectService: EntitySelectService,
private translateService: TranslateService,
private dialog: MatDialog,
private overlay: Overlay,
) {
this.nameSearchSubjectSub$ = this.nameSearchSubject.pipe(debounceTime(500)).subscribe((val) => {
this.propertiesStateService.updateNameFilter(val.toString());
this.getProperties();
});
}


// get backendConfigurationPnClaims() {
// return BackendConfigurationPnClaims;
// }

ngOnInit() {
this.nameSearchSubjectSub$ = this.nameSearchSubject.pipe(debounceTime(500)).subscribe((val) => {
this.propertiesStateService.updateNameFilter(val.toString());
this.getProperties();
});

this.getProperties();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output,} from '@angular/core';
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output,
inject
} from '@angular/core';
import {Paged, TableHeaderElementModel} from 'src/app/common/models';
import {PropertyModel} from '../../../../models/properties';
import {PropertiesStateService} from '../../store';
Expand Down Expand Up @@ -28,6 +30,13 @@ import {
standalone: false
})
export class PropertiesTableComponent implements OnInit {
private store = inject(Store);
public propertiesStateService = inject(PropertiesStateService);
private entitySelectService = inject(EntitySelectService);
public authStateService = inject(AuthStateService);
private iconRegistry = inject(MatIconRegistry);
private sanitizer = inject(DomSanitizer);

@Input() nameSearchSubject = new Subject();
@Input() propertiesModel: Paged<PropertyModel> = new Paged<PropertyModel>();

Expand Down Expand Up @@ -58,17 +67,12 @@ export class PropertiesTableComponent implements OnInit {
return PropertyCompliancesColorBadgesEnum;
}

constructor(
private store: Store,
public propertiesStateService: PropertiesStateService,
private entitySelectService: EntitySelectService,
public authStateService: AuthStateService,
iconRegistry: MatIconRegistry,
sanitizer: DomSanitizer,
) {
iconRegistry.addSvgIconLiteral('file-word', sanitizer.bypassSecurityTrustHtml(WordIcon));

constructor() {
this.iconRegistry.addSvgIconLiteral('file-word', this.sanitizer.bypassSecurityTrustHtml(WordIcon));
}


ngOnInit(): void {
this.tableHeaders = [
{ header: 'ID', field: 'id', sortable: true },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component, EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { Component, EventEmitter, OnDestroy, OnInit,
inject
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { applicationLanguages, applicationLanguagesTranslated } from 'src/app/common/const';
import { PropertyCreateModel } from '../../../../models';
Expand All @@ -16,6 +18,11 @@ import { Subscription } from 'rxjs';
standalone: false
})
export class PropertyCreateModalComponent implements OnInit, OnDestroy {
private fb = inject(FormBuilder);
public authStateService = inject(AuthStateService);
private propertiesService = inject(BackendConfigurationPnPropertiesService);
public dialogRef = inject(MatDialogRef<PropertyCreateModalComponent>);

propertyCreate: EventEmitter<PropertyCreateModel> = new EventEmitter<PropertyCreateModel>();
newPropertyForm: FormGroup;
newProperty: PropertyCreateModel = new PropertyCreateModel();
Expand All @@ -29,12 +36,12 @@ export class PropertyCreateModalComponent implements OnInit, OnDestroy {
return applicationLanguages;
}

constructor(
private fb: FormBuilder,
public authStateService: AuthStateService,
private propertiesService: BackendConfigurationPnPropertiesService,
public dialogRef: MatDialogRef<PropertyCreateModalComponent>
) {


ngOnDestroy(): void {
}

ngOnInit() {
this.propertyIsFarm = false;

// Initialize reactive form
Expand All @@ -47,12 +54,7 @@ export class PropertyCreateModalComponent implements OnInit, OnDestroy {
workorderEnable: [false],
isFarm: [false]
});
}

ngOnDestroy(): void {
}

ngOnInit() {
}

hide() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Component,
EventEmitter,
Inject,
OnInit,
inject
} from '@angular/core';
import { PropertyModel } from '../../../../models';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
Expand All @@ -14,12 +14,12 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
standalone: false
})
export class PropertyDeleteModalComponent implements OnInit {
public dialogRef = inject(MatDialogRef<PropertyDeleteModalComponent>);
public propertyModel = inject<PropertyModel>(MAT_DIALOG_DATA);

propertyDelete: EventEmitter<number> = new EventEmitter<number>();

constructor(
public dialogRef: MatDialogRef<PropertyDeleteModalComponent>,
@Inject(MAT_DIALOG_DATA) public propertyModel: PropertyModel = new PropertyModel()
) {}


ngOnInit() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Component,
Inject,
OnDestroy,
OnInit,
inject
} from '@angular/core';
import {PropertyAreaModel,} from '../../../../models';
import {BackendConfigurationPnPropertiesService, BackendConfigurationPnReportService} from '../../../../services';
Expand All @@ -22,6 +22,12 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
standalone: false
})
export class PropertyDocxReportModalComponent implements OnInit, OnDestroy {
private backendConfigurationPnPropertiesService = inject(BackendConfigurationPnPropertiesService);
private reportService = inject(BackendConfigurationPnReportService);
private toasterService = inject(ToastrService);
public dialogRef = inject(MatDialogRef<PropertyDocxReportModalComponent>);
public propertyId = inject<number>(MAT_DIALOG_DATA);

selectedArea: PropertyAreaModel;
selectedYear: number;
areasList: PropertyAreaModel[] = [];
Expand All @@ -30,23 +36,17 @@ export class PropertyDocxReportModalComponent implements OnInit, OnDestroy {
downloadReportSub$: Subscription;
getPropertyAreasSub$: Subscription;

constructor(
private backendConfigurationPnPropertiesService: BackendConfigurationPnPropertiesService,
private reportService: BackendConfigurationPnReportService,
private toasterService: ToastrService,
public dialogRef: MatDialogRef<PropertyDocxReportModalComponent>,
@Inject(MAT_DIALOG_DATA) public propertyId: number
) {


ngOnInit() {
this.getPropertyAreasSub$ = this.backendConfigurationPnPropertiesService
.getPropertyAreas(propertyId)
.getPropertyAreas(this.propertyId)
.subscribe((data) => {
if (data && data.success && data.model) {
this.areasList = data.model.filter(x => x.activated && x.name === '24. IE-indberetning');
}
});
}

ngOnInit() {
const currentYear = new Date().getFullYear();
this.years = R.range(currentYear - 1, currentYear + 10);
}
Expand Down
Loading
Loading