feedback updates
This commit is contained in:
parent
e4e4679bd5
commit
377b062ace
@ -30,9 +30,9 @@
|
|||||||
<p>{{getContactLabel()}}</p>
|
<p>{{getContactLabel()}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="presaved-address-actions">
|
<div class="presaved-address-actions">
|
||||||
<button type="button" mat-icon-button color="primary" matTooltip="Edit">
|
<!-- <button type="button" mat-icon-button color="primary" matTooltip="Edit">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button> -->
|
||||||
<button type="button" mat-icon-button color="primary" (click)="selectContact()"
|
<button type="button" mat-icon-button color="primary" (click)="selectContact()"
|
||||||
matTooltip="Change contact">
|
matTooltip="Change contact">
|
||||||
<mat-icon>compare_arrows</mat-icon>
|
<mat-icon>compare_arrows</mat-icon>
|
||||||
|
|||||||
@ -76,6 +76,11 @@
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.delivery-estimate {
|
||||||
|
color: #28a745;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { finalize, forkJoin, map, Subject, switchMap, takeUntil, throwError } fr
|
|||||||
import { DeliveryType } from '../../core/models/delivery-type';
|
import { DeliveryType } from '../../core/models/delivery-type';
|
||||||
import { DeliveryMethod } from '../../core/models/delivery-method';
|
import { DeliveryMethod } from '../../core/models/delivery-method';
|
||||||
import { PaymentType } from '../../core/models/payment-type';
|
import { PaymentType } from '../../core/models/payment-type';
|
||||||
import { format, addDays, isAfter, isWeekend } from 'date-fns';
|
import { format, addDays, isAfter, isWeekend, addBusinessDays } from 'date-fns';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ShippingContact } from '../../core/models/carnet/shipping-contact';
|
import { ShippingContact } from '../../core/models/carnet/shipping-contact';
|
||||||
import { ShippingAddress } from '../../core/models/carnet/shipping-address';
|
import { ShippingAddress } from '../../core/models/carnet/shipping-address';
|
||||||
@ -518,36 +518,42 @@ export class ShippingComponent {
|
|||||||
|
|
||||||
let deliveryDate: Date;
|
let deliveryDate: Date;
|
||||||
let message = 'Estimated delivery: ';
|
let message = 'Estimated delivery: ';
|
||||||
|
const isAfterCutoff = isAfter(now, cutoffTime);
|
||||||
|
const isWeekendDay = isWeekend(now);
|
||||||
|
|
||||||
switch (deliveryType) {
|
switch (deliveryType) {
|
||||||
case 'SAME':
|
case 'SAME':
|
||||||
if (isAfter(now, cutoffTime)) {
|
if (isAfterCutoff || isWeekendDay) {
|
||||||
// After cutoff time, deliver next business day
|
deliveryDate = addBusinessDays(now, 1);
|
||||||
deliveryDate = addDays(now, 1);
|
|
||||||
while (isWeekend(deliveryDate)) {
|
|
||||||
deliveryDate = addDays(deliveryDate, 1);
|
|
||||||
}
|
|
||||||
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
||||||
} else {
|
} else {
|
||||||
message += 'Today by end of day';
|
message += format(now, 'EEEE, MMMM do, yyyy');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'STD':
|
case 'STD':
|
||||||
// Standard is 3 business days
|
// Standard is 3 business days
|
||||||
deliveryDate = addDays(now, daysToDelivery);
|
if (isAfterCutoff || isWeekendDay) {
|
||||||
while (isWeekend(deliveryDate)) {
|
// If after cutoff or weekend, add 4 business days
|
||||||
deliveryDate = addDays(deliveryDate, 1);
|
deliveryDate = addBusinessDays(now, daysToDelivery);
|
||||||
|
} else {
|
||||||
|
// Before cutoff on weekday, add 3 business days
|
||||||
|
deliveryDate = addBusinessDays(now, daysToDelivery - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'NBD':
|
case 'NBD':
|
||||||
// Next business day for pickup
|
// Next business day for pickup
|
||||||
deliveryDate = addDays(now, daysToDelivery);
|
if (isAfterCutoff || isWeekendDay) {
|
||||||
while (isWeekend(deliveryDate)) {
|
// If after cutoff or weekend, add 2 business days
|
||||||
deliveryDate = addDays(deliveryDate, 1);
|
deliveryDate = addBusinessDays(now, daysToDelivery);
|
||||||
|
} else {
|
||||||
|
// Before cutoff on weekday, add 1 business day
|
||||||
|
deliveryDate = addBusinessDays(now, daysToDelivery);
|
||||||
}
|
}
|
||||||
|
|
||||||
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
message += format(deliveryDate, 'EEEE, MMMM do, yyyy');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,4 @@
|
|||||||
[userPreferences]="userPreferences"></app-contacts>
|
[userPreferences]="userPreferences"></app-contacts>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
</mat-stepper>
|
</mat-stepper>
|
||||||
|
|
||||||
<div class="additional-actions" *ngIf="currentApplicationDetails">
|
|
||||||
<button mat-raised-button color="accent" (click)="goBackToCarnetApplication()">
|
|
||||||
<mat-icon>chevron_left</mat-icon> Back to application
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@ -1,3 +0,0 @@
|
|||||||
.additional-actions {
|
|
||||||
margin: 12px 0;
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Component, inject } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ReactiveFormsModule } from '@angular/forms';
|
import { ReactiveFormsModule } from '@angular/forms';
|
||||||
@ -10,8 +10,6 @@ import { MatInputModule } from '@angular/material/input';
|
|||||||
import { ContactsComponent } from '../contacts/contacts.component';
|
import { ContactsComponent } from '../contacts/contacts.component';
|
||||||
import { UserPreferences } from '../../core/models/user-preference';
|
import { UserPreferences } from '../../core/models/user-preference';
|
||||||
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
||||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
|
||||||
import { StorageService } from '../../core/services/common/storage.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-add-holder',
|
selector: 'app-add-holder',
|
||||||
@ -34,21 +32,16 @@ export class AddHolderComponent {
|
|||||||
isEditMode = false;
|
isEditMode = false;
|
||||||
holderid: number = 0;
|
holderid: number = 0;
|
||||||
userPreferences: UserPreferences;
|
userPreferences: UserPreferences;
|
||||||
currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
|
|
||||||
|
|
||||||
stepsCompleted = {
|
stepsCompleted = {
|
||||||
holderDetails: false,
|
holderDetails: false,
|
||||||
holderContacts: false
|
holderContacts: false
|
||||||
};
|
};
|
||||||
|
|
||||||
private navigationService = inject(NavigationService);
|
|
||||||
private storageService = inject(StorageService);
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
userPrefenceService: UserPreferencesService
|
userPrefenceService: UserPreferencesService
|
||||||
) {
|
) {
|
||||||
this.userPreferences = userPrefenceService.getPreferences();
|
this.userPreferences = userPrefenceService.getPreferences();
|
||||||
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onStepChange(event: StepperSelectionEvent): void {
|
onStepChange(event: StepperSelectionEvent): void {
|
||||||
@ -59,16 +52,4 @@ export class AddHolderComponent {
|
|||||||
this.holderid = holderid;
|
this.holderid = holderid;
|
||||||
this.stepsCompleted.holderDetails = true;
|
this.stepsCompleted.holderDetails = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
goBackToCarnetApplication(): void {
|
|
||||||
this.storageService.removeItem('currentapplication')
|
|
||||||
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
|
||||||
{
|
|
||||||
state: { isEditMode: true },
|
|
||||||
queryParams: {
|
|
||||||
applicationname: this.currentApplicationDetails?.applicationName,
|
|
||||||
return: 'holder'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,7 @@
|
|||||||
Maximum 20 characters allowed
|
Maximum 20 characters allowed
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<mat-radio-group formControlName="holderType" class="radio-group">
|
<mat-radio-group formControlName="holderType" class="radio-group">
|
||||||
<mat-label>Holder Type </mat-label>
|
<mat-label>Holder Type </mat-label>
|
||||||
<mat-radio-button value="CORP">Corporation</mat-radio-button>
|
<mat-radio-button value="CORP">Corporation</mat-radio-button>
|
||||||
@ -58,9 +57,6 @@
|
|||||||
<mat-radio-button [value]="true">Yes</mat-radio-button>
|
<mat-radio-button [value]="true">Yes</mat-radio-button>
|
||||||
<mat-radio-button [value]="false">No</mat-radio-button>
|
<mat-radio-button [value]="false">No</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-row">
|
|
||||||
<mat-radio-group formControlName="govAgency" class="radio-group">
|
<mat-radio-group formControlName="govAgency" class="radio-group">
|
||||||
<mat-label>Are you belong to Government Agency ?</mat-label>
|
<mat-label>Are you belong to Government Agency ?</mat-label>
|
||||||
<mat-radio-button [value]="true">Yes</mat-radio-button>
|
<mat-radio-button [value]="true">Yes</mat-radio-button>
|
||||||
@ -147,6 +143,10 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
<button mat-raised-button color="accent" *ngIf="currentApplicationDetails" type="button"
|
||||||
|
(click)="goBackToCarnetApplication()">
|
||||||
|
<mat-icon>chevron_left</mat-icon> Back to application
|
||||||
|
</button>
|
||||||
<button mat-raised-button color="primary" type="submit"
|
<button mat-raised-button color="primary" type="submit"
|
||||||
[disabled]="basicDetailsForm.invalid || !basicDetailsForm.dirty">
|
[disabled]="basicDetailsForm.invalid || !basicDetailsForm.dirty">
|
||||||
{{ isEditMode ? 'Update' : 'Save' }}
|
{{ isEditMode ? 'Update' : 'Save' }}
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
.details-form {
|
.details-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-row {
|
.form-row {
|
||||||
@ -60,7 +60,9 @@
|
|||||||
grid-column: span 1;
|
grid-column: span 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mat-radio-group {
|
.mat-mdc-radio-group {
|
||||||
|
padding-bottom: 12px;
|
||||||
|
|
||||||
mat-label {
|
mat-label {
|
||||||
color: var(--mat-sys-on-surface);
|
color: var(--mat-sys-on-surface);
|
||||||
font-family: var(--mat-sys-body-medium-font);
|
font-family: var(--mat-sys-body-medium-font);
|
||||||
|
|||||||
@ -12,6 +12,8 @@ import { Subject, takeUntil } from 'rxjs';
|
|||||||
import { Country } from '../../core/models/country';
|
import { Country } from '../../core/models/country';
|
||||||
import { BasicDetailService } from '../../core/services/holder/basic-detail.service';
|
import { BasicDetailService } from '../../core/services/holder/basic-detail.service';
|
||||||
import { BasicDetail } from '../../core/models/holder/basic-detail';
|
import { BasicDetail } from '../../core/models/holder/basic-detail';
|
||||||
|
import { StorageService } from '../../core/services/common/storage.service';
|
||||||
|
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-basic-detail',
|
selector: 'app-basic-detail',
|
||||||
@ -25,12 +27,13 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
@Input() holderid: number = 0;
|
@Input() holderid: number = 0;
|
||||||
|
|
||||||
@Output() holderIdCreated = new EventEmitter<number>();
|
@Output() holderIdCreated = new EventEmitter<number>();
|
||||||
@Output() holderName = new EventEmitter<string>();
|
// @Output() holderName = new EventEmitter<string>();
|
||||||
|
|
||||||
basicDetailsForm: FormGroup;
|
basicDetailsForm: FormGroup;
|
||||||
countries: Country[] = [];
|
countries: Country[] = [];
|
||||||
regions: Region[] = [];
|
regions: Region[] = [];
|
||||||
states: State[] = [];
|
states: State[] = [];
|
||||||
|
currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
|
||||||
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
countriesHasStates = ['US', 'CA', 'MX'];
|
countriesHasStates = ['US', 'CA', 'MX'];
|
||||||
@ -42,9 +45,12 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
private notificationService = inject(NotificationService);
|
private notificationService = inject(NotificationService);
|
||||||
private commonService = inject(CommonService);
|
private commonService = inject(CommonService);
|
||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
|
private storageService = inject(StorageService);
|
||||||
|
private navigationService = inject(NavigationService);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.basicDetailsForm = this.createForm();
|
this.basicDetailsForm = this.createForm();
|
||||||
|
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication')
|
||||||
}
|
}
|
||||||
|
|
||||||
createForm(): FormGroup {
|
createForm(): FormGroup {
|
||||||
@ -72,7 +78,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.basicDetailService.getBasicDetailByHolderId(this.holderid).subscribe({
|
this.basicDetailService.getBasicDetailByHolderId(this.holderid).subscribe({
|
||||||
next: (basicDetail: BasicDetail) => {
|
next: (basicDetail: BasicDetail) => {
|
||||||
this.patchFormData(basicDetail);
|
this.patchFormData(basicDetail);
|
||||||
this.holderName.emit(basicDetail.holderName);
|
// this.holderName.emit(basicDetail.holderName);
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
},
|
},
|
||||||
error: (error: any) => {
|
error: (error: any) => {
|
||||||
@ -120,9 +126,9 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.holderIdCreated.emit(basicData.HOLDERID);
|
this.holderIdCreated.emit(basicData.HOLDERID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isEditMode) {
|
// if (this.isEditMode) {
|
||||||
this.holderName.emit(basicDetailData.holderName);
|
// this.holderName.emit(basicDetailData.holderName);
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
error: (error: any) => {
|
error: (error: any) => {
|
||||||
let errorMessage = this.errorHandler.handleApiError(error, `Failed to ${this.isEditMode ? 'update' : 'add'} basic details`);
|
let errorMessage = this.errorHandler.handleApiError(error, `Failed to ${this.isEditMode ? 'update' : 'add'} basic details`);
|
||||||
@ -201,4 +207,16 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goBackToCarnetApplication(): void {
|
||||||
|
this.storageService.removeItem('currentapplication')
|
||||||
|
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
||||||
|
{
|
||||||
|
state: { isEditMode: true },
|
||||||
|
queryParams: {
|
||||||
|
applicationname: this.currentApplicationDetails?.applicationName,
|
||||||
|
return: 'holder'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,11 @@
|
|||||||
<button mat-raised-button color="primary" (click)="addNewContact()">
|
<button mat-raised-button color="primary" (click)="addNewContact()">
|
||||||
<mat-icon>add</mat-icon> Add New Contact
|
<mat-icon>add</mat-icon> Add New Contact
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button mat-raised-button color="accent" *ngIf="currentApplicationDetails" type="button"
|
||||||
|
(click)="goBackToCarnetApplication()">
|
||||||
|
<mat-icon>chevron_left</mat-icon> Back to application
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-container mat-elevation-z8">
|
<div class="table-container mat-elevation-z8">
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
button {
|
button {
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-left: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,8 @@ import { Contact } from '../../core/models/holder/contact';
|
|||||||
import { CustomPaginator } from '../../shared/custom-paginator';
|
import { CustomPaginator } from '../../shared/custom-paginator';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/confirm-dialog.component';
|
import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/confirm-dialog.component';
|
||||||
|
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||||
|
import { StorageService } from '../../core/services/common/storage.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-contacts',
|
selector: 'app-contacts',
|
||||||
@ -42,6 +44,7 @@ export class ContactsComponent {
|
|||||||
showForm = false;
|
showForm = false;
|
||||||
showInactiveContacts = false;
|
showInactiveContacts = false;
|
||||||
contacts: Contact[] = [];
|
contacts: Contact[] = [];
|
||||||
|
currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
|
||||||
|
|
||||||
contactReadOnlyFields: any = {
|
contactReadOnlyFields: any = {
|
||||||
lastChangedDate: null,
|
lastChangedDate: null,
|
||||||
@ -55,6 +58,8 @@ export class ContactsComponent {
|
|||||||
private contactService = inject(ContactService);
|
private contactService = inject(ContactService);
|
||||||
private notificationService = inject(NotificationService);
|
private notificationService = inject(NotificationService);
|
||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
|
private navigationService = inject(NavigationService);
|
||||||
|
private storageService = inject(StorageService);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.contactForm = this.fb.group({
|
this.contactForm = this.fb.group({
|
||||||
@ -67,6 +72,8 @@ export class ContactsComponent {
|
|||||||
fax: ['', [Validators.pattern(/^[0-9]{10,15}$/)]],
|
fax: ['', [Validators.pattern(/^[0-9]{10,15}$/)]],
|
||||||
email: ['', [Validators.required, Validators.email, Validators.maxLength(100)]],
|
email: ['', [Validators.required, Validators.email, Validators.maxLength(100)]],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication')
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -229,4 +236,16 @@ export class ContactsComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goBackToCarnetApplication(): void {
|
||||||
|
this.storageService.removeItem('currentapplication')
|
||||||
|
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
||||||
|
{
|
||||||
|
state: { isEditMode: true },
|
||||||
|
queryParams: {
|
||||||
|
applicationname: this.currentApplicationDetails?.applicationName,
|
||||||
|
return: 'holder'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<h2 *ngIf="this.holderName" class="page-header">Manage {{this.holderName}}</h2>
|
<!-- <h2 *ngIf="this.holderName" class="page-header">Manage {{this.holderName}}</h2> -->
|
||||||
|
|
||||||
<div class="holder-action-buttons">
|
<div class="holder-action-buttons">
|
||||||
<button mat-button (click)="accordion().openAll()">Expand All</button>
|
<button mat-button (click)="accordion().openAll()">Expand All</button>
|
||||||
@ -9,8 +9,7 @@
|
|||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title> Basic Details </mat-panel-title>
|
<mat-panel-title> Basic Details </mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
<app-basic-detail [holderid]="holderid" [isEditMode]="isEditMode"
|
<app-basic-detail [holderid]="holderid" [isEditMode]="isEditMode"></app-basic-detail>
|
||||||
(holderName)="onHolderNameUpdate($event)"></app-basic-detail>
|
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
|
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
@ -21,10 +20,4 @@
|
|||||||
<app-contacts [userPreferences]="userPreferences" [holderid]="holderid"
|
<app-contacts [userPreferences]="userPreferences" [holderid]="holderid"
|
||||||
[isEditMode]="isEditMode"></app-contacts>
|
[isEditMode]="isEditMode"></app-contacts>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
|
|
||||||
<div class="additional-actions" *ngIf="currentApplicationDetails">
|
|
||||||
<button mat-raised-button color="accent" (click)="goBackToCarnetApplication()">
|
|
||||||
<mat-icon>chevron_left</mat-icon> Back to application
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@ -1,17 +1,13 @@
|
|||||||
.page-header {
|
// .page-header {
|
||||||
margin: 0.5rem 0px;
|
// margin: 0.5rem 0px;
|
||||||
color: var(--mat-sys-primary);
|
// color: var(--mat-sys-primary);
|
||||||
font-weight: 500;
|
// font-weight: 500;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.holder-action-buttons {
|
.holder-action-buttons {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.additional-actions {
|
|
||||||
margin: 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.holder-headers-align .mat-expansion-panel-header-description {
|
.holder-headers-align .mat-expansion-panel-header-description {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -7,8 +7,6 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
||||||
import { BasicDetailComponent } from '../basic-details/basic-details.component';
|
import { BasicDetailComponent } from '../basic-details/basic-details.component';
|
||||||
import { ContactsComponent } from '../contacts/contacts.component';
|
import { ContactsComponent } from '../contacts/contacts.component';
|
||||||
import { StorageService } from '../../core/services/common/storage.service';
|
|
||||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-holder',
|
selector: 'app-edit-holder',
|
||||||
@ -20,19 +18,15 @@ export class EditHolderComponent {
|
|||||||
accordion = viewChild.required(MatAccordion);
|
accordion = viewChild.required(MatAccordion);
|
||||||
isEditMode = true;
|
isEditMode = true;
|
||||||
holderid = 0;
|
holderid = 0;
|
||||||
holderName: string | null = null;
|
//holderName: string | null = null;
|
||||||
userPreferences: UserPreferences;
|
userPreferences: UserPreferences;
|
||||||
currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
|
|
||||||
|
|
||||||
private route = inject(ActivatedRoute);
|
private route = inject(ActivatedRoute);
|
||||||
private navigationService = inject(NavigationService);
|
|
||||||
private storageService = inject(StorageService);
|
|
||||||
|
|
||||||
constructor(userPrefenceService: UserPreferencesService) {
|
constructor(userPrefenceService: UserPreferencesService) {
|
||||||
this.userPreferences = userPrefenceService.getPreferences();
|
this.userPreferences = userPrefenceService.getPreferences();
|
||||||
this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication')
|
|
||||||
|
|
||||||
afterNextRender(() => {
|
afterNextRender(() => {
|
||||||
|
// Open all panels
|
||||||
this.accordion().openAll();
|
this.accordion().openAll();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -42,19 +36,7 @@ export class EditHolderComponent {
|
|||||||
this.holderid = idParam ? parseInt(idParam, 10) : 0;
|
this.holderid = idParam ? parseInt(idParam, 10) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
onHolderNameUpdate(event: string): void {
|
// onHolderNameUpdate(event: string): void {
|
||||||
this.holderName = event;
|
// this.holderName = event;
|
||||||
}
|
// }
|
||||||
|
|
||||||
goBackToCarnetApplication(): void {
|
|
||||||
this.storageService.removeItem('currentapplication')
|
|
||||||
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
|
||||||
{
|
|
||||||
state: { isEditMode: true },
|
|
||||||
queryParams: {
|
|
||||||
applicationname: this.currentApplicationDetails?.applicationName,
|
|
||||||
return: 'holder'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,8 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"
|
||||||
|
[ngClass]="{'selected-holder': selectedHolderId === row.holderid}"></tr>
|
||||||
|
|
||||||
<tr matNoDataRow *matNoDataRow>
|
<tr matNoDataRow *matNoDataRow>
|
||||||
<td [attr.colspan]="displayedColumns.length" class="no-data-message">
|
<td [attr.colspan]="displayedColumns.length" class="no-data-message">
|
||||||
|
|||||||
@ -63,6 +63,11 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected-holder {
|
||||||
|
color: #28a745;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
.actions-icons {
|
.actions-icons {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
@use '@angular/material' as mat;
|
@use '@angular/material' as mat;
|
||||||
|
|
||||||
html {
|
html {
|
||||||
@include mat.theme((density: -4));
|
@include mat.theme((density: -5));
|
||||||
}
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user