prepare basic and contact updates
This commit is contained in:
parent
94334c8804
commit
7c6a9996bc
@ -1,4 +1,4 @@
|
||||
export interface ContactLogin {
|
||||
clientContactId: number;
|
||||
password: string;
|
||||
//password: string;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ export class ContactService {
|
||||
P_SPID: this.userService.getUserSpid(),
|
||||
P_CLIENTCONTACTID: data.clientContactId,
|
||||
P_ENABLEPASSWORDPOLICY: 'Y',
|
||||
P_PASSWORD: data.password,
|
||||
//P_PASSWORD: data.password,
|
||||
P_USERID: this.userService.getUser()
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +69,8 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
||||
console.error('Error loading basic details:', error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.loadStates('US');
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +87,7 @@ export class BasicDetailsComponent implements OnInit, OnDestroy {
|
||||
address2: ['', Validators.maxLength(100)],
|
||||
city: ['', [Validators.required, Validators.maxLength(50)]],
|
||||
state: ['', Validators.required],
|
||||
country: ['', Validators.required],
|
||||
country: ['US', Validators.required],
|
||||
zip: ['', [Validators.required, ZipCodeValidator('country')]],
|
||||
carnetIssuingRegion: ['', Validators.required],
|
||||
revenueLocation: ['', Validators.required],
|
||||
|
||||
@ -279,12 +279,12 @@
|
||||
|
||||
<!-- Contact Login Form -->
|
||||
<div class="form-container" *ngIf="showLoginForm">
|
||||
<form [formGroup]="contactLoginForm" (ngSubmit)="saveLogin()">
|
||||
<!-- <form [formGroup]="contactLoginForm" (ngSubmit)="saveLogin()"> -->
|
||||
<div class="form-header">
|
||||
<h3>Create Login</h3>
|
||||
</div>
|
||||
|
||||
<div *ngIf="isEditing" class="readonly-section bottom-divider">
|
||||
<div *ngIf="isEditing" class="readonly-section">
|
||||
<div class="readonly-fields">
|
||||
<div class="field-column">
|
||||
<!-- Email -->
|
||||
@ -297,7 +297,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="form-row">
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Password</mat-label>
|
||||
@ -307,14 +307,14 @@
|
||||
Password is required
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-actions">
|
||||
<button mat-raised-button color="primary" type="submit" [disabled]="contactLoginForm.invalid">
|
||||
Save
|
||||
<button mat-raised-button color="primary" type="button" (click)="saveLogin()">
|
||||
Create
|
||||
</button>
|
||||
<button mat-button type="button" (click)="cancelEdit()">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
@ -32,7 +32,7 @@ export class ContactsComponent {
|
||||
displayedColumns: string[] = ['firstName', 'lastName', 'title', 'phone', 'mobile', 'email', 'defaultContact', 'actions'];
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
contactForm: FormGroup;
|
||||
contactLoginForm: FormGroup;
|
||||
// contactLoginForm: FormGroup;
|
||||
isEditing = false;
|
||||
currentContactId: number | null = null;
|
||||
isLoading = false;
|
||||
@ -79,9 +79,9 @@ export class ContactsComponent {
|
||||
defaultContact: [false]
|
||||
});
|
||||
|
||||
this.contactLoginForm = this.fb.group({
|
||||
password: ['', [Validators.required]]
|
||||
});
|
||||
// this.contactLoginForm = this.fb.group({
|
||||
// password: ['', [Validators.required]]
|
||||
// });
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -278,14 +278,14 @@ export class ContactsComponent {
|
||||
}
|
||||
|
||||
saveLogin(): void {
|
||||
if (this.contactLoginForm.invalid) {
|
||||
this.contactLoginForm.markAllAsTouched();
|
||||
return;
|
||||
}
|
||||
// if (this.contactLoginForm.invalid) {
|
||||
// this.contactLoginForm.markAllAsTouched();
|
||||
// return;
|
||||
// }
|
||||
|
||||
const contactLoginData: ContactLogin = {
|
||||
clientContactId: this.currentContactId!,
|
||||
password: this.contactLoginForm.value.password
|
||||
// password: this.contactLoginForm.value.password
|
||||
};
|
||||
|
||||
this.contactService.createContactLogin(contactLoginData).subscribe({
|
||||
@ -308,7 +308,7 @@ export class ContactsComponent {
|
||||
this.isEditing = false;
|
||||
this.currentContactId = null;
|
||||
this.contactForm.reset();
|
||||
this.contactLoginForm.reset();
|
||||
// this.contactLoginForm.reset();
|
||||
}
|
||||
|
||||
// setDefaultContact(contactId: string): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user