refractor(df/locale):shares module (#1300)

This commit is contained in:
Abhishek Kumar
2021-08-08 13:19:47 +05:30
committed by GitHub
parent 88ee1b4fcd
commit 18ab9cf128
10 changed files with 62 additions and 30 deletions
@@ -12,6 +12,7 @@ import { RejectShareDialogComponent } from './reject-share-dialog/reject-share-d
/** Custom Serices */
import { SharesService } from 'app/shares/shares.service';
import { SettingsService } from 'app/settings/settings.service';
/**
* Reject shares component.
@@ -46,10 +47,12 @@ export class RejectSharesComponent implements OnInit {
* @param {SharesService} sharesService Shares Service
* @param {ActivatedRoute} route Activated Route
* @param {MatDialog} dialog Mat Dialog
* @param {SettingsService} settingsService Settings Service.
*/
constructor(private sharesService: SharesService,
private route: ActivatedRoute,
public dialog: MatDialog) {
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;
@@ -84,8 +87,8 @@ export class RejectSharesComponent implements OnInit {
});
rejectSharesDialogRef.afterClosed().subscribe((response: any) => {
if (response.reject) {
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
const data = {
requestedShares: [{id}],
dateFormat,