build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class ShareAccountActionsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {sharesService} SharesService Shares service.
|
||||
*/
|
||||
constructor(private sharesService: SharesService) { }
|
||||
constructor(private sharesService: SharesService) {}
|
||||
|
||||
/**
|
||||
* Returns the Shares account actions data.
|
||||
@@ -37,5 +36,4 @@ export class ShareAccountActionsResolver implements Resolve<Object> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class SharesAccountAndTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SharesService} SharesService Shares service.
|
||||
*/
|
||||
constructor(private sharesService: SharesService) { }
|
||||
constructor(private sharesService: SharesService) {}
|
||||
|
||||
/**
|
||||
* Returns the Shares Account data and template.
|
||||
@@ -28,5 +27,4 @@ export class SharesAccountAndTemplateResolver implements Resolve<Object> {
|
||||
const shareAccountId = route.paramMap.get('shareAccountId');
|
||||
return this.sharesService.getSharesAccountData(shareAccountId, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class SharesAccountViewResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SharesService} SharesService Shares service.
|
||||
*/
|
||||
constructor(private sharesService: SharesService) { }
|
||||
constructor(private sharesService: SharesService) {}
|
||||
|
||||
/**
|
||||
* Returns the Shares Account data.
|
||||
@@ -28,5 +27,4 @@ export class SharesAccountViewResolver implements Resolve<Object> {
|
||||
const shareAccountId = route.paramMap.get('shareAccountId') || route.parent.paramMap.get('shareAccountId');
|
||||
return this.sharesService.getSharesAccountData(shareAccountId, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class SharesAccountTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SharesService} SharesService Shares service.
|
||||
*/
|
||||
constructor(private sharesService: SharesService) { }
|
||||
constructor(private sharesService: SharesService) {}
|
||||
|
||||
/**
|
||||
* Returns the Shares Account Template.
|
||||
@@ -28,5 +27,4 @@ export class SharesAccountTemplateResolver implements Resolve<Object> {
|
||||
const clientId = route.parent.parent.paramMap.get('clientId');
|
||||
return this.sharesService.getSharesAccountTemplate(clientId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('CreateSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CreateSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CreateSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -21,18 +21,19 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./create-shares-account.component.scss']
|
||||
})
|
||||
export class CreateSharesAccountComponent {
|
||||
|
||||
/** Shares Account Template */
|
||||
sharesAccountTemplate: any;
|
||||
/** Shares Account Product Template */
|
||||
sharesAccountProductTemplate: any;
|
||||
|
||||
/** Shares Account Details Step */
|
||||
@ViewChild(SharesAccountDetailsStepComponent, { static: true }) sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
|
||||
@ViewChild(SharesAccountDetailsStepComponent, { static: true })
|
||||
sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
|
||||
/** Shares Account Terms Step */
|
||||
@ViewChild(SharesAccountTermsStepComponent, { static: true }) sharesAccountTermsStep: SharesAccountTermsStepComponent;
|
||||
/** Shares Account Charges Step */
|
||||
@ViewChild(SharesAccountChargesStepComponent, { static: true }) sharesAccountChargesStep: SharesAccountChargesStepComponent;
|
||||
@ViewChild(SharesAccountChargesStepComponent, { static: true })
|
||||
sharesAccountChargesStep: SharesAccountChargesStepComponent;
|
||||
|
||||
/**
|
||||
* Fetches shares account template from `resolve`
|
||||
@@ -42,11 +43,13 @@ export class CreateSharesAccountComponent {
|
||||
* @param {SharesService} sharesService Shares Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { sharesAccountTemplate: any }) => {
|
||||
this.sharesAccountTemplate = data.sharesAccountTemplate;
|
||||
});
|
||||
@@ -78,10 +81,7 @@ export class CreateSharesAccountComponent {
|
||||
* Checks validity of overall shares account form.
|
||||
*/
|
||||
get sharesAccountFormValid() {
|
||||
return (
|
||||
this.sharesAccountDetailsForm.valid &&
|
||||
this.sharesAccountTermsForm.valid
|
||||
);
|
||||
return this.sharesAccountDetailsForm.valid && this.sharesAccountTermsForm.valid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,8 +113,13 @@ export class CreateSharesAccountComponent {
|
||||
locale
|
||||
};
|
||||
this.sharesService.createSharesAccount(sharesAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('EditSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -21,18 +21,19 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./edit-shares-account.component.scss']
|
||||
})
|
||||
export class EditSharesAccountComponent {
|
||||
|
||||
/** Shares Account and Template */
|
||||
sharesAccountAndTemplate: any;
|
||||
/** Shares Account Product Template */
|
||||
sharesAccountProductTemplate: any;
|
||||
|
||||
/** Shares Account Details Step */
|
||||
@ViewChild(SharesAccountDetailsStepComponent, { static: true }) sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
|
||||
@ViewChild(SharesAccountDetailsStepComponent, { static: true })
|
||||
sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
|
||||
/** Shares Account Terms Step */
|
||||
@ViewChild(SharesAccountTermsStepComponent, { static: true }) sharesAccountTermsStep: SharesAccountTermsStepComponent;
|
||||
/** Shares Account Charges Step */
|
||||
@ViewChild(SharesAccountChargesStepComponent, { static: true }) sharesAccountChargesStep: SharesAccountChargesStepComponent;
|
||||
@ViewChild(SharesAccountChargesStepComponent, { static: true })
|
||||
sharesAccountChargesStep: SharesAccountChargesStepComponent;
|
||||
|
||||
/**
|
||||
* Fetches shares account template from `resolve`
|
||||
@@ -42,11 +43,13 @@ export class EditSharesAccountComponent {
|
||||
* @param {SharesService} sharesService Shares Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { sharesAccountAndTemplate: any }) => {
|
||||
this.sharesAccountAndTemplate = data.sharesAccountAndTemplate;
|
||||
});
|
||||
@@ -81,11 +84,9 @@ export class EditSharesAccountComponent {
|
||||
return (
|
||||
this.sharesAccountDetailsForm.valid &&
|
||||
this.sharesAccountTermsForm.valid &&
|
||||
(
|
||||
!this.sharesAccountDetailsForm.pristine ||
|
||||
(!this.sharesAccountDetailsForm.pristine ||
|
||||
!this.sharesAccountTermsForm.pristine ||
|
||||
!this.sharesAccountChargesStep.pristine
|
||||
)
|
||||
!this.sharesAccountChargesStep.pristine)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -117,9 +118,10 @@ export class EditSharesAccountComponent {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.sharesService.updateSharesAccount(this.sharesAccountAndTemplate.id , sharesAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.sharesService
|
||||
.updateSharesAccount(this.sharesAccountAndTemplate.id, sharesAccount)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ActivateSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActivateSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ActivateSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+12
-9
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./activate-shares-account.component.scss']
|
||||
})
|
||||
export class ActivateSharesAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ActivateSharesAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,10 @@ export class ActivateSharesAccountComponent implements OnInit {
|
||||
*/
|
||||
createActivateSharesAccountForm() {
|
||||
this.activateSharesAccountForm = this.formBuilder.group({
|
||||
'activatedDate': ['', Validators.required]
|
||||
activatedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,5 +86,4 @@ export class ActivateSharesAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('ApplySharesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApplySharesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApplySharesComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./apply-shares.component.scss']
|
||||
})
|
||||
export class ApplySharesComponent implements OnInit {
|
||||
|
||||
/** Shares account data. */
|
||||
sharesAccountData: any;
|
||||
|
||||
@@ -38,12 +37,14 @@ export class ApplySharesComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||
this.sharesAccountData = data.shareAccountActionData;
|
||||
@@ -66,9 +67,15 @@ export class ApplySharesComponent implements OnInit {
|
||||
*/
|
||||
createApplySharesAccountForm() {
|
||||
this.applySharesForm = this.formBuilder.group({
|
||||
'requestedDate': ['', Validators.required],
|
||||
'requestedShares': ['', Validators.required],
|
||||
'unitPrice': [{value: '', disabled: true}]
|
||||
requestedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
requestedShares: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
unitPrice: [{ value: '', disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -94,5 +101,4 @@ export class ApplySharesComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./approve-shares-account.component.scss']
|
||||
})
|
||||
export class ApproveSharesAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ApproveSharesAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class ApproveSharesAccountComponent implements OnInit {
|
||||
*/
|
||||
createApproveSharesAccountForm() {
|
||||
this.approveSharesAccountForm = this.formBuilder.group({
|
||||
'approvedDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
approvedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class ApproveSharesAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveShareDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveShareDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveShareDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./approve-share-dialog.component.scss']
|
||||
})
|
||||
export class ApproveShareDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data Provides a deleteContext.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<ApproveShareDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ApproveShareDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveSharesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveSharesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveSharesComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -23,7 +23,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./approve-shares.component.scss']
|
||||
})
|
||||
export class ApproveSharesComponent implements OnInit {
|
||||
|
||||
/** Shares account data. */
|
||||
sharesAccountData: any;
|
||||
|
||||
@@ -32,7 +31,13 @@ export class ApproveSharesComponent implements OnInit {
|
||||
/** Shares account data. */
|
||||
sharesData: any[];
|
||||
/** Columns to be displayed in shares table. */
|
||||
displayedColumns: string[] = ['transactionDate', 'totalShares', 'redeemedPrice', 'status', 'approve'];
|
||||
displayedColumns: string[] = [
|
||||
'transactionDate',
|
||||
'totalShares',
|
||||
'redeemedPrice',
|
||||
'status',
|
||||
'approve'
|
||||
];
|
||||
/** Data source for shares table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
@@ -49,10 +54,12 @@ export class ApproveSharesComponent implements OnInit {
|
||||
* @param {MatDialog} dialog Dialog reference.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||
this.sharesAccountData = data.shareAccountActionData;
|
||||
@@ -63,8 +70,9 @@ export class ApproveSharesComponent implements OnInit {
|
||||
* Sets the shares table.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.sharesData = this.sharesAccountData.purchasedShares
|
||||
.filter((share: any) => share.status.value === 'Pending Approval');
|
||||
this.sharesData = this.sharesAccountData.purchasedShares.filter(
|
||||
(share: any) => share.status.value === 'Pending Approval'
|
||||
);
|
||||
this.setShares();
|
||||
}
|
||||
|
||||
@@ -90,19 +98,20 @@ export class ApproveSharesComponent implements OnInit {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const data = {
|
||||
requestedShares: [{id}],
|
||||
requestedShares: [{ id }],
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.sharesService.executeSharesAccountCommand(this.accountId, 'approveadditionalshares', data).subscribe(() => {
|
||||
const share = this.sharesData.find(element => element.id === id);
|
||||
const index = this.sharesData.indexOf(share);
|
||||
this.sharesData.splice(index, 1);
|
||||
this.dataSource.data = this.sharesData;
|
||||
this.sharesTableRef.renderRows();
|
||||
});
|
||||
this.sharesService
|
||||
.executeSharesAccountCommand(this.accountId, 'approveadditionalshares', data)
|
||||
.subscribe(() => {
|
||||
const share = this.sharesData.find((element) => element.id === id);
|
||||
const index = this.sharesData.indexOf(share);
|
||||
this.sharesData.splice(index, 1);
|
||||
this.dataSource.data = this.sharesData;
|
||||
this.sharesTableRef.renderRows();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CloseSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CloseSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CloseSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./close-shares-account.component.scss']
|
||||
})
|
||||
export class CloseSharesAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class CloseSharesAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class CloseSharesAccountComponent implements OnInit {
|
||||
*/
|
||||
createCloseSharesAccountForm() {
|
||||
this.closeSharesAccountForm = this.formBuilder.group({
|
||||
'closedDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
closedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class CloseSharesAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('RedeemSharesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RedeemSharesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RedeemSharesComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./redeem-shares.component.scss']
|
||||
})
|
||||
export class RedeemSharesComponent implements OnInit {
|
||||
|
||||
/** Shares account data. */
|
||||
sharesAccountData: any;
|
||||
|
||||
@@ -38,12 +37,14 @@ export class RedeemSharesComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||
this.sharesAccountData = data.shareAccountActionData;
|
||||
@@ -66,9 +67,15 @@ export class RedeemSharesComponent implements OnInit {
|
||||
*/
|
||||
createRedeemSharesAccountForm() {
|
||||
this.redeemSharesForm = this.formBuilder.group({
|
||||
'requestedDate': ['', Validators.required],
|
||||
'requestedShares': ['', Validators.required],
|
||||
'unitPrice': [{value: '', disabled: true}]
|
||||
requestedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
requestedShares: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
unitPrice: [{ value: '', disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -94,5 +101,4 @@ export class RedeemSharesComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RejectSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./reject-shares-account.component.scss']
|
||||
})
|
||||
export class RejectSharesAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class RejectSharesAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class RejectSharesAccountComponent implements OnInit {
|
||||
*/
|
||||
createRejectSharesAccountForm() {
|
||||
this.rejectSharesAccountForm = this.formBuilder.group({
|
||||
'rejectedDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
rejectedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class RejectSharesAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RejectSharesDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectShareDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectShareDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./reject-share-dialog.component.scss']
|
||||
})
|
||||
export class RejectShareDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data Provides a deleteContext.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<RejectShareDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<RejectShareDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('RejectSharesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectSharesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectSharesComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -23,7 +23,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./reject-shares.component.scss']
|
||||
})
|
||||
export class RejectSharesComponent implements OnInit {
|
||||
|
||||
/** Shares account data. */
|
||||
sharesAccountData: any;
|
||||
|
||||
@@ -32,7 +31,13 @@ export class RejectSharesComponent implements OnInit {
|
||||
/** Shares account data. */
|
||||
sharesData: any[];
|
||||
/** Columns to be displayed in shares table. */
|
||||
displayedColumns: string[] = ['transactionDate', 'totalShares', 'redeemedPrice', 'status', 'reject'];
|
||||
displayedColumns: string[] = [
|
||||
'transactionDate',
|
||||
'totalShares',
|
||||
'redeemedPrice',
|
||||
'status',
|
||||
'reject'
|
||||
];
|
||||
/** Data source for shares table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
@@ -49,10 +54,12 @@ export class RejectSharesComponent implements OnInit {
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||
this.sharesAccountData = data.shareAccountActionData;
|
||||
@@ -63,8 +70,9 @@ export class RejectSharesComponent implements OnInit {
|
||||
* Sets the shares table.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.sharesData = this.sharesAccountData.purchasedShares
|
||||
.filter((share: any) => share.status.value === 'Pending Approval');
|
||||
this.sharesData = this.sharesAccountData.purchasedShares.filter(
|
||||
(share: any) => share.status.value === 'Pending Approval'
|
||||
);
|
||||
this.setShares();
|
||||
}
|
||||
|
||||
@@ -90,12 +98,12 @@ export class RejectSharesComponent implements OnInit {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const data = {
|
||||
requestedShares: [{id}],
|
||||
requestedShares: [{ id }],
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.sharesService.executeSharesAccountCommand(this.accountId, 'rejectadditionalshares', data).subscribe(() => {
|
||||
const share = this.sharesData.find(element => element.id === id);
|
||||
const share = this.sharesData.find((element) => element.id === id);
|
||||
const index = this.sharesData.indexOf(share);
|
||||
this.sharesData.splice(index, 1);
|
||||
this.dataSource.data = this.sharesData;
|
||||
@@ -104,5 +112,4 @@ export class RejectSharesComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('SharesAccountActionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountActionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountActionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -14,25 +14,24 @@ import { SharesService } from '../shares.service';
|
||||
styleUrls: ['./shares-account-actions.component.scss']
|
||||
})
|
||||
export class SharesAccountActionsComponent {
|
||||
|
||||
/** Shares Account Data */
|
||||
sharesAccountData: any;
|
||||
/** Flag object to store possible actions and render appropriate UI to the user */
|
||||
actions: {
|
||||
'Approve': boolean
|
||||
'Reject': boolean
|
||||
'Close': boolean
|
||||
'Activate': boolean
|
||||
'Undo Approval': boolean
|
||||
'Apply Additional Shares': boolean
|
||||
'Redeem Shares': boolean
|
||||
'Approve Additional Shares': boolean
|
||||
'Reject Additional Shares': boolean
|
||||
Approve: boolean;
|
||||
Reject: boolean;
|
||||
Close: boolean;
|
||||
Activate: boolean;
|
||||
'Undo Approval': boolean;
|
||||
'Apply Additional Shares': boolean;
|
||||
'Redeem Shares': boolean;
|
||||
'Approve Additional Shares': boolean;
|
||||
'Reject Additional Shares': boolean;
|
||||
} = {
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
'Close': false,
|
||||
'Activate': false,
|
||||
Approve: false,
|
||||
Reject: false,
|
||||
Close: false,
|
||||
Activate: false,
|
||||
'Undo Approval': false,
|
||||
'Apply Additional Shares': false,
|
||||
'Redeem Shares': false,
|
||||
@@ -47,5 +46,4 @@ export class SharesAccountActionsComponent {
|
||||
const name = this.route.snapshot.params['name'];
|
||||
this.actions[name] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UndoApprovalSharesAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoApprovalSharesAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UndoApprovalSharesAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+5
-5
@@ -14,7 +14,6 @@ import { SharesService } from 'app/shares/shares.service';
|
||||
styleUrls: ['./undo-approval-shares-account.component.scss']
|
||||
})
|
||||
export class UndoApprovalSharesAccountComponent {
|
||||
|
||||
/** Shares Account Id */
|
||||
accountId: any;
|
||||
|
||||
@@ -23,9 +22,11 @@ export class UndoApprovalSharesAccountComponent {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private sharesService: SharesService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||
}
|
||||
|
||||
@@ -38,5 +39,4 @@ export class UndoApprovalSharesAccountComponent {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountChargesStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountChargesStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountChargesStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+14
-7
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
styleUrls: ['./shares-account-charges-step.component.scss']
|
||||
})
|
||||
export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Shares Account Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** Shares Account Template */
|
||||
@@ -38,13 +37,21 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
/** For Edit Shares Account Form */
|
||||
isChargesPatched = false;
|
||||
/** Display columns for charges table */
|
||||
displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action'];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType',
|
||||
'action'
|
||||
];
|
||||
|
||||
/**
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private dialog: MatDialog,
|
||||
private translateService: TranslateService) { }
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.currencyCode.valueChanges.subscribe(() => {
|
||||
@@ -85,8 +92,9 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
label: this.translateService.instant('labels.inputs.Amount'),
|
||||
value: charge.amount || charge.amountOrPercentage,
|
||||
type: 'number',
|
||||
required: false,
|
||||
}),
|
||||
required: false
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: this.translateService.instant('labels.heading.Edit Charge'),
|
||||
@@ -127,5 +135,4 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
get sharesAccountCharges() {
|
||||
return { charges: this.chargesDataSource };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountDetailsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountDetailsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountDetailsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+19
-11
@@ -15,7 +15,6 @@ import { SharesService } from 'app/shares/shares.service';
|
||||
styleUrls: ['./shares-account-details-step.component.scss']
|
||||
})
|
||||
export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
|
||||
/** Shares Account Template */
|
||||
@Input() sharesAccountTemplate: any;
|
||||
|
||||
@@ -37,9 +36,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
* @param {SharesService} sharesService Shares Service.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createSharesAccountDetailsForm();
|
||||
}
|
||||
|
||||
@@ -50,9 +51,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
this.productData = this.sharesAccountTemplate.productOptions;
|
||||
if (this.sharesAccountTemplate.productId) {
|
||||
this.sharesAccountDetailsForm.patchValue({
|
||||
'productId': this.sharesAccountTemplate.productId,
|
||||
'submittedDate': this.sharesAccountTemplate.timeline.submittedOnDate && new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
|
||||
'externalId': this.sharesAccountTemplate.externalId
|
||||
productId: this.sharesAccountTemplate.productId,
|
||||
submittedDate:
|
||||
this.sharesAccountTemplate.timeline.submittedOnDate &&
|
||||
new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
|
||||
externalId: this.sharesAccountTemplate.externalId
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -63,9 +66,15 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
*/
|
||||
createSharesAccountDetailsForm() {
|
||||
this.sharesAccountDetailsForm = this.formBuilder.group({
|
||||
'productId': ['', Validators.required],
|
||||
'submittedDate': ['', Validators.required],
|
||||
'externalId': ['']
|
||||
productId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
submittedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
externalId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,5 +96,4 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
get sharesAccountDetails() {
|
||||
return this.sharesAccountDetailsForm.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountPreviewStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountPreviewStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountPreviewStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+7
-4
@@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
styleUrls: ['./shares-account-preview-step.component.scss']
|
||||
})
|
||||
export class SharesAccountPreviewStepComponent {
|
||||
|
||||
/** Shares Account Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** Shares Account Template */
|
||||
@@ -21,11 +20,15 @@ export class SharesAccountPreviewStepComponent {
|
||||
@Input() sharesAccount: any;
|
||||
|
||||
/** Display columns for charges table. */
|
||||
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
|
||||
chargesDisplayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType'
|
||||
];
|
||||
|
||||
/** Form submission event */
|
||||
@Output() submitEvent = new EventEmitter();
|
||||
|
||||
constructor() { }
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountTermsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountTermsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountTermsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+44
-29
@@ -13,7 +13,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./shares-account-terms-step.component.scss']
|
||||
})
|
||||
export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
|
||||
/** Shares Account and Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** [Optional] Shares Account Template */
|
||||
@@ -40,8 +39,10 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createSharesAccountTermsForm();
|
||||
}
|
||||
|
||||
@@ -49,11 +50,11 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
if (this.sharesAccountProductTemplate) {
|
||||
this.currency = this.sharesAccountProductTemplate.currency;
|
||||
this.sharesAccountTermsForm.patchValue({
|
||||
'currencyCode': this.sharesAccountProductTemplate.currency.code,
|
||||
'decimal': this.sharesAccountProductTemplate.currency.decimalPlaces,
|
||||
'currencyMultiple': this.sharesAccountProductTemplate.currency.inMultiplesOf,
|
||||
'unitPrice': this.sharesAccountProductTemplate.currentMarketPrice,
|
||||
'savingsAccountId': ''
|
||||
currencyCode: this.sharesAccountProductTemplate.currency.code,
|
||||
decimal: this.sharesAccountProductTemplate.currency.decimalPlaces,
|
||||
currencyMultiple: this.sharesAccountProductTemplate.currency.inMultiplesOf,
|
||||
unitPrice: this.sharesAccountProductTemplate.currentMarketPrice,
|
||||
savingsAccountId: ''
|
||||
});
|
||||
this.setOptions();
|
||||
if (this.sharesAccountTemplate) {
|
||||
@@ -69,13 +70,18 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
if (this.sharesAccountTemplate) {
|
||||
this.sharesAccountTermsForm.patchValue({
|
||||
'requestedShares': this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
|
||||
'minimumActivePeriod': this.sharesAccountTemplate.minimumActivePeriod,
|
||||
'minimumActivePeriodFrequencyType': this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
|
||||
'lockinPeriodFrequency': this.sharesAccountTemplate.lockinPeriod,
|
||||
'lockinPeriodFrequencyType': this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
|
||||
'applicationDate': this.sharesAccountTemplate.purchasedShares[0].purchasedDate && new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
|
||||
'allowDividendCalculationForInactiveClients': this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
|
||||
requestedShares: this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
|
||||
minimumActivePeriod: this.sharesAccountTemplate.minimumActivePeriod,
|
||||
minimumActivePeriodFrequencyType:
|
||||
this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
|
||||
lockinPeriodFrequency: this.sharesAccountTemplate.lockinPeriod,
|
||||
lockinPeriodFrequencyType:
|
||||
this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
|
||||
applicationDate:
|
||||
this.sharesAccountTemplate.purchasedShares[0].purchasedDate &&
|
||||
new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
|
||||
allowDividendCalculationForInactiveClients:
|
||||
this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -85,18 +91,27 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
*/
|
||||
createSharesAccountTermsForm() {
|
||||
this.sharesAccountTermsForm = this.formBuilder.group({
|
||||
'currencyCode': [{value: '', disabled: true}],
|
||||
'decimal': [{value: '', disabled: true}],
|
||||
'requestedShares': ['', Validators.required],
|
||||
'unitPrice': [{value: '', disabled: true}],
|
||||
'currencyMultiple': [{value: '', disabled: true}],
|
||||
'savingsAccountId': ['', Validators.required],
|
||||
'minimumActivePeriod': [''],
|
||||
'minimumActivePeriodFrequencyType': [''],
|
||||
'lockinPeriodFrequency': [''],
|
||||
'lockinPeriodFrequencyType': [''],
|
||||
'applicationDate': ['', Validators.required],
|
||||
'allowDividendCalculationForInactiveClients': [false]
|
||||
currencyCode: [{ value: '', disabled: true }],
|
||||
decimal: [{ value: '', disabled: true }],
|
||||
requestedShares: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
unitPrice: [{ value: '', disabled: true }],
|
||||
currencyMultiple: [{ value: '', disabled: true }],
|
||||
savingsAccountId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
minimumActivePeriod: [''],
|
||||
minimumActivePeriodFrequencyType: [''],
|
||||
lockinPeriodFrequency: [''],
|
||||
lockinPeriodFrequencyType: [''],
|
||||
applicationDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
allowDividendCalculationForInactiveClients: [false]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -104,7 +119,8 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
* Sets all select dropdown options.
|
||||
*/
|
||||
setOptions() {
|
||||
this.minimumActivePeriodFrequencyTypeData = this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
|
||||
this.minimumActivePeriodFrequencyTypeData =
|
||||
this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
|
||||
this.lockinPeriodFrequencyTypeData = this.sharesAccountProductTemplate.lockinPeriodFrequencyTypeOptions;
|
||||
this.savingsAccountsData = this.sharesAccountProductTemplate.clientSavingsAccounts;
|
||||
}
|
||||
@@ -122,5 +138,4 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChargesTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ChargesTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./charges-tab.component.scss']
|
||||
})
|
||||
export class ChargesTabComponent implements OnInit {
|
||||
|
||||
/** Shares Account Data */
|
||||
sharesAccountData: any;
|
||||
/** Charges Data */
|
||||
@@ -20,7 +19,17 @@ export class ChargesTabComponent implements OnInit {
|
||||
/** Data source for charges table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
/** Columns to be displayed in charges table. */
|
||||
displayedColumns: string[] = ['name', 'feeOrPenalty', 'paymentDueAt', 'calculationType', 'due', 'paid', 'waived', 'outstanding', 'actions' ];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'feeOrPenalty',
|
||||
'paymentDueAt',
|
||||
'calculationType',
|
||||
'due',
|
||||
'paid',
|
||||
'waived',
|
||||
'outstanding',
|
||||
'actions'
|
||||
];
|
||||
|
||||
/**
|
||||
* Retrieves shares account aata from `resolve`.
|
||||
@@ -35,8 +44,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : [];
|
||||
const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : [];
|
||||
this.dataSource = new MatTableDataSource(activeCharges);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('DividendsTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DividendsTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [DividendsTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./dividends-tab.component.scss']
|
||||
})
|
||||
export class DividendsTabComponent implements OnInit {
|
||||
|
||||
/** Shares Account Data */
|
||||
shareAccountData: any;
|
||||
/** Dividends Data */
|
||||
@@ -41,5 +40,4 @@ export class DividendsTabComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.dataSource = new MatTableDataSource(this.dividendsData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GeneralTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GeneralTabComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GeneralTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -19,5 +19,4 @@ export class GeneralTabComponent {
|
||||
this.sharesAccountData = data.sharesAccountData;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('SharesAccountViewComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountViewComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountViewComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -21,7 +21,6 @@ import { SharesButtonsConfiguration } from './shares-buttons.config';
|
||||
styleUrls: ['./shares-account-view.component.scss']
|
||||
})
|
||||
export class SharesAccountViewComponent implements OnInit {
|
||||
|
||||
/** Shares Account Data */
|
||||
sharesAccountData: any;
|
||||
/** Button Configurations */
|
||||
@@ -36,10 +35,12 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
* @param {SharesService} sharesService Shares Service
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private sharesService: SharesService,
|
||||
public dialog: MatDialog) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private sharesService: SharesService,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { sharesAccountData: any }) => {
|
||||
this.sharesAccountData = data.sharesAccountData;
|
||||
});
|
||||
@@ -77,7 +78,10 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
const purchasedShares: any[] = this.sharesAccountData.purchasedShares;
|
||||
let sharesPendingForApproval = false;
|
||||
purchasedShares.forEach((share: any) => {
|
||||
if (share.status.code === 'purchasedSharesStatusType.applied' && share.type.code === 'purchasedSharesType.purchased') {
|
||||
if (
|
||||
share.status.code === 'purchasedSharesStatusType.applied' &&
|
||||
share.type.code === 'purchasedSharesType.purchased'
|
||||
) {
|
||||
sharesPendingForApproval = true;
|
||||
}
|
||||
});
|
||||
@@ -129,5 +133,4 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/** Shares Account Buttons Configuration */
|
||||
export class SharesButtonsConfiguration {
|
||||
|
||||
optionArray: {
|
||||
name: string,
|
||||
taskPermissionName: string,
|
||||
name: string;
|
||||
taskPermissionName: string;
|
||||
}[];
|
||||
|
||||
buttonsArray: {
|
||||
name: string,
|
||||
icon: string,
|
||||
taskPermissionName: string,
|
||||
name: string;
|
||||
icon: string;
|
||||
taskPermissionName: string;
|
||||
}[];
|
||||
|
||||
constructor(status: string) {
|
||||
@@ -86,7 +85,7 @@ export class SharesButtonsConfiguration {
|
||||
|
||||
setOptions(status: string) {
|
||||
switch (status) {
|
||||
case 'Active':
|
||||
case 'Active':
|
||||
this.optionArray = [
|
||||
{
|
||||
name: 'Close',
|
||||
@@ -112,14 +111,13 @@ export class SharesButtonsConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
addOption(option: {name: string, taskPermissionName: string}) {
|
||||
addOption(option: { name: string; taskPermissionName: string }) {
|
||||
this.optionArray.push(option);
|
||||
}
|
||||
|
||||
removeButton(name: string) {
|
||||
const buttonNames = this.buttonsArray.map(entry => entry.name);
|
||||
const buttonNames = this.buttonsArray.map((entry) => entry.name);
|
||||
const index = buttonNames.indexOf(name);
|
||||
this.buttonsArray.splice(index, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TransactionsTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [TransactionsTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./transactions-tab.component.scss']
|
||||
})
|
||||
export class TransactionsTabComponent implements OnInit {
|
||||
|
||||
/** Shares Account Data */
|
||||
shareAccountData: any;
|
||||
/** Transactions Data */
|
||||
@@ -43,5 +42,4 @@ export class TransactionsTabComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.dataSource = new MatTableDataSource(this.transactionsData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ const routes: Routes = [
|
||||
data: { title: 'Shares Account General', breadcrumb: 'General', routeParamBreadcrumb: false },
|
||||
resolve: {
|
||||
sharesAccountData: SharesAccountViewResolver
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
@@ -90,7 +90,7 @@ const routes: Routes = [
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
@@ -108,4 +108,4 @@ const routes: Routes = [
|
||||
ShareAccountActionsResolver
|
||||
]
|
||||
})
|
||||
export class SharesRoutingModule { }
|
||||
export class SharesRoutingModule {}
|
||||
|
||||
@@ -67,6 +67,6 @@ import { GeneralTabComponent } from './shares-account-view/general-tab/general-t
|
||||
RejectShareDialogComponent,
|
||||
GeneralTabComponent
|
||||
],
|
||||
providers: [ ]
|
||||
providers: []
|
||||
})
|
||||
export class SharesModule { }
|
||||
export class SharesModule {}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { Observable } from 'rxjs';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SharesService {
|
||||
|
||||
/**
|
||||
* @param {HttpClient} http Http Client
|
||||
*/
|
||||
@@ -74,5 +73,4 @@ export class SharesService {
|
||||
const httpParams = new HttpParams().set('command', command);
|
||||
return this.http.post(`/accounts/share/${accountId}`, data, { params: httpParams });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user