feedback updates
This commit is contained in:
parent
54a4505085
commit
5fd0cd0eaa
@ -15,7 +15,7 @@
|
|||||||
Name is required
|
Name is required
|
||||||
</mat-error>
|
</mat-error>
|
||||||
<mat-error *ngIf="f['name'].errors?.['maxlength']">
|
<mat-error *ngIf="f['name'].errors?.['maxlength']">
|
||||||
Maximum 100 characters allowed
|
Maximum 50 characters allowed
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -67,7 +67,7 @@ export class ApplicationComponent {
|
|||||||
|
|
||||||
createForm(): FormGroup {
|
createForm(): FormGroup {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
name: ['', [Validators.required, Validators.maxLength(100)]],
|
name: ['', [Validators.required, Validators.maxLength(50)]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,8 +122,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator [length]="dataSource.data.length" [pageSizeOptions]="[userPreferences.pageSize!]"
|
<mat-paginator *ngIf="dataSource.data.length > userPreferences.pageSize!" [length]="dataSource.data.length"
|
||||||
[hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
[pageSizeOptions]="[userPreferences.pageSize!]" [hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Item Form -->
|
<!-- Item Form -->
|
||||||
@ -219,10 +219,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button mat-button type="button" (click)="cancelEdit()">Cancel</button>
|
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="itemForm.invalid">
|
<button mat-raised-button color="primary" type="submit" [disabled]="itemForm.invalid">
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-button type="button" (click)="cancelEdit()">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,10 +17,10 @@ import { FormsModule } from '@angular/forms';
|
|||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</mat-dialog-content>
|
</mat-dialog-content>
|
||||||
<mat-dialog-actions>
|
<mat-dialog-actions>
|
||||||
<button mat-button (click)="onCancel()">Cancel</button>
|
|
||||||
<button mat-raised-button color="primary" (click)="onSelect()" [disabled]="!selectedContact">
|
<button mat-raised-button color="primary" (click)="onSelect()" [disabled]="!selectedContact">
|
||||||
Select
|
Select
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-button (click)="onCancel()">Cancel</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
`,
|
`,
|
||||||
styles: [`
|
styles: [`
|
||||||
@ -39,8 +39,10 @@ export class ContactDialogComponent {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<ContactDialogComponent>,
|
public dialogRef: MatDialogRef<ContactDialogComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: { contacts: any[] }
|
@Inject(MAT_DIALOG_DATA) public data: { contacts: any[], currentContact: any }
|
||||||
) { }
|
) {
|
||||||
|
this.selectedContact = data.currentContact;
|
||||||
|
}
|
||||||
|
|
||||||
get contacts() {
|
get contacts() {
|
||||||
return this.data.contacts;
|
return this.data.contacts;
|
||||||
|
|||||||
@ -583,10 +583,11 @@ export class ShippingComponent {
|
|||||||
let shipTo = this.shippingForm.get('shipTo')?.value;
|
let shipTo = this.shippingForm.get('shipTo')?.value;
|
||||||
|
|
||||||
const contacts = shipTo === 'PREPARER' ? this.preparerContacts : this.holderContacts;
|
const contacts = shipTo === 'PREPARER' ? this.preparerContacts : this.holderContacts;
|
||||||
|
const currentContact = shipTo === 'PREPARER' ? this.preparerContact : this.holderContact;
|
||||||
|
|
||||||
const dialogRef = this.dialog.open(ContactDialogComponent, {
|
const dialogRef = this.dialog.open(ContactDialogComponent, {
|
||||||
width: '500px',
|
width: '500px',
|
||||||
data: { contacts }
|
data: { contacts: contacts, currentContact: currentContact }
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(selectedItem => {
|
dialogRef.afterClosed().subscribe(selectedItem => {
|
||||||
|
|||||||
@ -148,6 +148,12 @@ export class TravelPlanComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
takeAction(country: Country): void {
|
takeAction(country: Country): void {
|
||||||
|
|
||||||
|
if (this.IsCountryExists('transit', country)) {
|
||||||
|
this.addVisitCountryToCollection();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||||
width: '560px',
|
width: '560px',
|
||||||
data: {
|
data: {
|
||||||
@ -160,7 +166,9 @@ export class TravelPlanComponent {
|
|||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
this.selectedAvailableTransitCountry = this.selectedAvailableVisitCountry;
|
||||||
this.addVisitCountryToCollection();
|
this.addVisitCountryToCollection();
|
||||||
|
this.addTransitCountryToCollection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -186,6 +194,17 @@ export class TravelPlanComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsCountryExists(countryType: string, country: Country): boolean {
|
||||||
|
|
||||||
|
const existingIndex = countryType === 'transit' ? this.selectedTransitCountries.findIndex(
|
||||||
|
c => c.value === country!.value
|
||||||
|
) : this.selectedVisitCountries.findIndex(
|
||||||
|
c => c.value === country!.value
|
||||||
|
);
|
||||||
|
|
||||||
|
return existingIndex > -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove country from visits
|
// Remove country from visits
|
||||||
removeVisitCountry(): void {
|
removeVisitCountry(): void {
|
||||||
if (!this.selectedVisitCountry) return;
|
if (!this.selectedVisitCountry) return;
|
||||||
|
|||||||
@ -100,8 +100,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator [length]="dataSource.data.length" [pageSizeOptions]="[userPreferences.pageSize || 1]"
|
<mat-paginator *ngIf="dataSource.data.length > userPreferences.pageSize!" [length]="dataSource.data.length"
|
||||||
[hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
[pageSizeOptions]="[userPreferences.pageSize || 1]" [hidePageSize]="true"
|
||||||
|
showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Contact Form -->
|
<!-- Contact Form -->
|
||||||
@ -255,10 +256,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button mat-button type="button" (click)="cancelEdit()">Cancel</button>
|
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="contactForm.invalid">
|
<button mat-raised-button color="primary" type="submit" [disabled]="contactForm.invalid">
|
||||||
{{ isEditing ? 'Update' : 'Save' }}
|
{{ isEditing ? 'Update' : 'Save' }}
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-button type="button" (click)="cancelEdit()">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -77,6 +77,11 @@
|
|||||||
<td mat-cell *matCellDef="let holder" class="actions-cell">
|
<td mat-cell *matCellDef="let holder" class="actions-cell">
|
||||||
|
|
||||||
<div class="actions-icons">
|
<div class="actions-icons">
|
||||||
|
<mat-radio-button matTooltip="Select Holder" class="selectHolder" [value]="holder.holderid"
|
||||||
|
[checked]="selectedHolderId === holder.holderid" (change)="onHolderSelection(holder)"
|
||||||
|
aria-label="Select row" [hidden]="holder.isInactive">
|
||||||
|
</mat-radio-button>
|
||||||
|
|
||||||
<button mat-icon-button color="primary" (click)="onEdit(holder.holderid)" matTooltip="Edit">
|
<button mat-icon-button color="primary" (click)="onEdit(holder.holderid)" matTooltip="Edit">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
@ -89,11 +94,6 @@
|
|||||||
(click)="reactivateHolder(holder.holderid)">
|
(click)="reactivateHolder(holder.holderid)">
|
||||||
<mat-icon>loupe</mat-icon>
|
<mat-icon>loupe</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<mat-radio-button matTooltip="Select Holder" class="selectHolder" [value]="holder.holderid"
|
|
||||||
[checked]="selectedHolderId === holder.holderid" (change)="onHolderSelection(holder)"
|
|
||||||
aria-label="Select row" [hidden]="holder.isInactive">
|
|
||||||
</mat-radio-button>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@ -110,8 +110,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator [length]="dataSource.data.length" [pageSizeOptions]="[userPreferences.pageSize || 2]"
|
<mat-paginator *ngIf="dataSource.data.length > userPreferences.pageSize!" [length]="dataSource.data.length"
|
||||||
[hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
[pageSizeOptions]="[userPreferences.pageSize || 2]" [hidePageSize]="true"
|
||||||
|
showFirstLastButtons></mat-paginator>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<div class="question-row">
|
<div class="question-row">
|
||||||
<mat-radio-group (change)="duplicateCarnet($event)">
|
<mat-radio-group (change)="duplicateCarnet($event)">
|
||||||
<mat-label class="question">Did you lose your carnet? Are you looking for
|
<mat-label class="question">Did you loose your carnet? Are you looking for
|
||||||
duplicates?</mat-label>
|
duplicates?</mat-label>
|
||||||
<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>
|
||||||
@ -138,7 +138,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<mat-paginator [length]="dataSource.data.length" [pageSizeOptions]="[userPreferences.pageSize!]"
|
<mat-paginator *ngIf="dataSource.data.length > userPreferences.pageSize!"
|
||||||
|
[length]="dataSource.data.length" [pageSizeOptions]="[userPreferences.pageSize!]"
|
||||||
[hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
[hidePageSize]="true" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.questions-section {
|
.questions-section {
|
||||||
flex: 0 0 70%;
|
flex: 0 0 65%;
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
margin-bottom: 46px;
|
margin-bottom: 46px;
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
|
|||||||
@ -9,10 +9,10 @@ import { AngularMaterialModule } from '../../module/angular-material.module';
|
|||||||
<h2 mat-dialog-title>{{ data.title }}</h2>
|
<h2 mat-dialog-title>{{ data.title }}</h2>
|
||||||
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
||||||
<mat-dialog-actions align="end">
|
<mat-dialog-actions align="end">
|
||||||
<button mat-button [mat-dialog-close]="false">{{ data.cancelText || 'Cancel' }}</button>
|
|
||||||
<button mat-raised-button color="warn" [mat-dialog-close]="true">
|
<button mat-raised-button color="warn" [mat-dialog-close]="true">
|
||||||
{{ data.confirmText || 'Confirm' }}
|
{{ data.confirmText || 'Confirm' }}
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-button [mat-dialog-close]="false">{{ data.cancelText || 'Cancel' }}</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
`,
|
`,
|
||||||
styles: [`
|
styles: [`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user