build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+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 });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user