From 721c4c991fe8d40897dbb268e8f3a9617fd6d451 Mon Sep 17 00:00:00 2001 From: lpapadopoulos <lpapadopoulos@ubitech.eu> Date: Mon, 20 May 2024 12:59:09 +0300 Subject: [PATCH] add new fields for location management --- .../edit-individuals.component.html | 86 +++++++++++++++---- .../edit-individuals.component.ts | 25 ++++-- 2 files changed, 85 insertions(+), 26 deletions(-) diff --git a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.html b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.html index 73905be..5518d0a 100644 --- a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.html +++ b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.html @@ -1,10 +1,10 @@ <div class="container py-5"> <div class="row"> <div class="col-12"> - + <form [formGroup]="editForm"> <div class="card card-paper mb-0"> - + <div class="card-header"> <div class="container-fluid"> <div class="row justify-content-between align-items-center"> @@ -43,7 +43,7 @@ <mat-label>Given Name</mat-label> <input matInput formControlName="givenName"> </mat-form-field> - + <mat-form-field class="col-md-6"> <mat-label>Location</mat-label> <input matInput formControlName="location"> @@ -53,7 +53,7 @@ <mat-label>Organization</mat-label> <input matInput [formControl]="customOrganizationCtrl"> </mat-form-field> - + </div> <h6 class="mt-3">Contact Details</h6> @@ -71,27 +71,77 @@ </mat-label> <input matInput formControlName="emailAddress"> </mat-form-field> - + <mat-form-field class="col-md-4"> - <mat-label class="d-flex"> + <mat-label class="d-flex"> <mat-icon matPrefix class="mr-1">phone</mat-icon>Phone </mat-label> <input matInput formControlName="phoneNumber"> </mat-form-field> - - </div> + </div> - <!-- <div class="row mt-2" *ngIf="newOrganization" formArrayName="partyCharacteristic"> - <h6 class="col-12">Initial Party Characteristics</h6> - <div *ngFor="let char of editForm.get('partyCharacteristic')['controls']; let i = index" [formGroupName]="i" class="col-xl-6"> - <mat-form-field class="" > - - <mat-label>{{char.value.name}}</mat-label> - <input matInput formControlName="value"> - </mat-form-field> - </div> - </div> --> + <h6 class="mt-3">Geographic Site Details</h6> + <div class="row align-items-center" formGroupName="geographicSiteInfo"> + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + City + </mat-label> + <input matInput formControlName="locality"> + </mat-form-field> + + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + Email + </mat-label> + <input matInput formControlName="postcode"> + </mat-form-field> + + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + Phone + </mat-label> + <input matInput formControlName="stateOrProvince"> + </mat-form-field> + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + City + </mat-label> + <input matInput formControlName="streetNr"> + </mat-form-field> + + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + Email + </mat-label> + <input matInput formControlName="city"> + </mat-form-field> + + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + Phone + </mat-label> + <input matInput formControlName="country"> + </mat-form-field> + <mat-form-field class="col-md-4"> + <mat-label class="d-flex"> + Phone + </mat-label> + <input matInput formControlName="streetName"> + </mat-form-field> + </div> + + + <!-- <div class="row mt-2" *ngIf="newOrganization" formArrayName="partyCharacteristic"> + <h6 class="col-12">Initial Party Characteristics</h6> + <div *ngFor="let char of editForm.get('partyCharacteristic')['controls']; let i = index" [formGroupName]="i" class="col-xl-6"> + <mat-form-field class="" > + + <mat-label>{{char.value.name}}</mat-label> + <input matInput formControlName="value"> + </mat-form-field> + </div> + </div> --> <div class="container-fluid"> <div class="row justify-content-end"> diff --git a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts index aedc7fb..bead41a 100644 --- a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts +++ b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts @@ -41,9 +41,18 @@ export class EditIndividualsComponent implements OnInit { city: new FormControl(), emailAddress: new FormControl(), phoneNumber: new FormControl() - }) + }), + geographicSiteInfo: new FormGroup({ + locality: new FormControl(), + postcode: new FormControl(), + stateOrProvince: new FormControl(), + streetNr: new FormControl(), + city: new FormControl(), + country: new FormControl(), + streetName: new FormControl(), + }) }) - + predefinedOrganizationCtrl = new FormControl() customOrganizationCtrl = new FormControl() @@ -56,12 +65,12 @@ export class EditIndividualsComponent implements OnInit { newIndividual = false subscriptions = new Subscription() - + ngOnInit() { // this.retrieveOrganizations() this.routerEventsSubscription() - if (this.activatedRoute.snapshot.params.id) + if (this.activatedRoute.snapshot.params.id) { this.individualID = this.activatedRoute.snapshot.params.id if (this.authService.portalUser && this.authService.portalUser.id === this.individualID) { @@ -69,7 +78,7 @@ export class EditIndividualsComponent implements OnInit { } this.retrieveIndividual() } else { - // this.initNewOrganizationFormArray() + // this.initNewOrganizationFormArray() this.newIndividual = true } @@ -118,10 +127,10 @@ export class EditIndividualsComponent implements OnInit { } //prefefined Organization in Related Party - + // } - + ) } @@ -156,7 +165,7 @@ export class EditIndividualsComponent implements OnInit { this.refreshIndividual(updatedIndividual) } ) - } + } else { this.individualService.patchIndividual({id: this.individual.id, individual: updateObj}).subscribe( data => { updatedIndividual = data }, -- GitLab