ced812d21050cd79fecc3a46552242f8f0645c75
[portal/sdk.git] /
1 import {ChangeDetectorRef, Component, HostListener, OnInit, Input, SimpleChange, SystemJsNgModuleLoader, OnDestroy} from '@angular/core';
2 import {RunService} from '../run.service';
3 import {ActivatedRoute, Router} from '@angular/router';
4 import * as cloneDeep from 'lodash/cloneDeep';
5 import {environment} from 'src/environments/environment';
6 import {HttpCacheService} from '../../../shared/services/cache.service';
7
8 @Component({
9     selector: 'app-run-report-form-fields',
10     templateUrl: './run-report-form-fields.component.html',
11     styleUrls: ['./run-report-form-fields.component.css']
12 })
13 export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
14     @Input('formFieldList') formFieldList: {}[];
15     @Input('reportId') reportId: string;
16     staticFormFieldList: {}[] = [];
17     formFieldListValueArr: any[];
18     saveFormFieldGroups: any[];
19     finalQueryParamsObj: {};
20     navigateToRun: boolean;
21     reportMode: string;
22     queryString: string;
23     reportName: string;
24     reportSubTitle: string;
25     showSpinner: boolean;
26     showLabel: boolean;
27     runDashboardReport: boolean;
28     DashboardReportObj: {}[] = [];
29     triggerFormFieldArr = [];
30     initialObject = {};
31     formFieldGroupObjList: {}[] = [];
32     toggleFormFieldRenderArr: {}[] = [];
33     groupSelectValue = '';
34     oldGroupSelectValue = '';
35     unCommonCnt = 0;
36     commonCount = 0;
37     totalCommonCount = 0;
38     totalCount = 0;
39     errorMessage = '';
40     stackTrace = '';
41     error = false;
42     iSDashboardReport = '';
43     hitCnt = 0;
44     directCallQueryParams: any = '';
45     calledWithFormFields = false;
46     showformFiledSpinner = false;
47     actualformFieldValues: any[];
48     allowEdit: boolean;
49     runReportAgain: boolean;
50     tempFieldValues = [];
51     firstRun = false;
52     saveFormFieldListValueArr: any[];
53     saveGroupSelectValue = '';
54     avoidDoCheck = false;
55     toolTipPosition = 'right';
56     isResetAllowed: boolean;
57     save: {}[];
58     unCommonGropusList: any[];
59     commonFormFields: any[];
60     formFieldListValueMap: any;
61     saveFormFieldListValueMap: any;
62     chartType = '';
63     showRunButton = false;
64     showBackButton = false;
65     downloadPrevReport = '';
66     timeStampArray: any[];
67     hoursArray : any[];
68     constructor(private _runService: RunService,
69                 private _route: ActivatedRoute,
70                 private _router: Router,
71                 private changeDetectorRefs: ChangeDetectorRef,
72                 private httpCacheService: HttpCacheService) {
73         this.formFieldListValueArr = [];
74         this.saveFormFieldListValueArr = [];
75         this.saveFormFieldGroups = [];
76         this.finalQueryParamsObj = {};
77         this.navigateToRun = false;
78         this.queryString = '';
79         this.showSpinner = false;
80         this.showLabel = false;
81         this.runDashboardReport = false;
82         this.showformFiledSpinner = false;
83         this.runReportAgain = false;
84         this.tempFieldValues = [];
85         this.isResetAllowed = false;
86         this.unCommonGropusList = [];
87         this.commonFormFields = [];
88         this.formFieldListValueMap = new Map<any, any>();
89         this.saveFormFieldListValueMap = new Map<any, any>();
90         this.chartType = '';
91         this.showRunButton = false;
92         this.showBackButton = false;
93         this.downloadPrevReport = '';
94         this.timeStampArray = [];
95         this.hoursArray = [];
96
97     }
98
99     @HostListener('click') onClick() {
100         this.changeDetectorRefs.detectChanges();
101     }
102
103     ngOnDestroy(): void {
104         this.createNewObject();
105         this.showSpinner = false;
106     }
107
108     createNewObject() {
109         this.staticFormFieldList = [];
110         this.formFieldListValueArr = [];
111         this.saveFormFieldGroups = [];
112         this.saveFormFieldListValueArr = [];
113         this.finalQueryParamsObj = {};
114         this.navigateToRun = false;
115         this.reportMode = '';
116         this.queryString = '';
117         this.reportName = '';
118         this.reportSubTitle = '';
119         this.showSpinner = true;
120         this.showLabel = false;
121         this.runDashboardReport = false;
122         this.DashboardReportObj = [];
123         this.triggerFormFieldArr = [];
124         this.initialObject = {};
125         this.formFieldGroupObjList = [];
126         this.toggleFormFieldRenderArr = [];
127         this.groupSelectValue = '';
128         this.oldGroupSelectValue = '';
129         this.unCommonCnt = 0;
130         this.totalCommonCount = 0;
131         this.commonCount = 0;
132         this.totalCount = 0;
133         this.errorMessage = '';
134         this.stackTrace = '';
135         this.error = false;
136         this.iSDashboardReport = '';
137         this.hitCnt = 0;
138         this.directCallQueryParams = '';
139         this.calledWithFormFields = false;
140         this.showformFiledSpinner = false;
141         this.allowEdit = false;
142         this.runReportAgain = false;
143         this.isResetAllowed = false;
144         this.unCommonGropusList = [];
145         this.commonFormFields = [];
146         this.formFieldListValueMap = new Map<any, any>();
147         this.saveFormFieldListValueMap = new Map<any, any>();
148         this.chartType = '';
149         this.showRunButton = false;
150         this.downloadPrevReport = '';
151     }
152
153     ngOnInit() {
154
155         this.showSpinner = true;
156         this.navigateToRun = false;
157         this.getTime();
158         this.getHours();
159         this._route.params.subscribe(params => {
160             this.createNewObject();
161             this.reportId = params['reportId'];
162             const checkOfCache = this.httpCacheService.getPreviousId(this.reportId) || null;
163             if (!checkOfCache) {
164                 this.httpCacheService.clearCache();
165             }
166             const backButton = params['showBackButton'];
167             const downloadPrevReport = params['downloadPrevReport'];
168             if (downloadPrevReport && downloadPrevReport === 'true') {
169                 this.downloadPrevReport = 'true';
170             }
171             if (backButton && backButton === 'true') {
172                 this.showBackButton = true;
173             } else if (backButton && backButton === 'false') {
174                 this.showBackButton = false;
175             } else {
176                 this.showBackButton = false;
177             }
178             this.groupSelectValue = params['groupSelectValue'];
179             if (this.groupSelectValue === undefined) {
180                 this.groupSelectValue = '';
181             }
182             if (params['queryParameters']) {
183                 this.directCallQueryParams = params['queryParameters'];
184                 this.calledWithFormFields = true;
185                 this.populateQueryParams(params['queryParameters']);
186             }
187             this.loadPage();
188         });
189
190     }
191
192     populateQueryParams(queryParams: any) {
193         this.actualformFieldValues = this.directCallQueryParams.substring(1, this.directCallQueryParams.length).split('&');
194         for (const ff of this.actualformFieldValues) {
195             const formfiledArray = ff.split('=');
196             const formFieldId = formfiledArray[0];
197             const formFieldObj = formfiledArray[1];
198             this.finalQueryParamsObj[formFieldId] = formFieldObj;
199         }
200         this.queryString = this.directCallQueryParams;
201     }
202
203     loadPage() {
204         this._runService.getDefinitionPageDetails(+this.reportId)
205             .subscribe((responseDefPage) => {
206                 this.reportName = responseDefPage['reportName'];
207                 this.reportSubTitle = responseDefPage['reportSubTitle'];
208                 this.chartType = responseDefPage['chartType'];
209                 if (responseDefPage['reportType'] !== 'Dashboard') {
210                     if (this.calledWithFormFields == false) {
211                         this._runService.getReportData(this.reportId)
212                             .subscribe((response) => {
213                                 if (response['errormessage']) {
214                                     this.allowEdit = response['allowEdit'];
215                                     this.showError(response);
216                                 } else {
217                                     this.allowEdit = response['allowEdit'];
218                                     this.reportName = response['reportName'];
219                                     if (response['formFieldList'].length > 0) {
220                                         this.fetchAndPopulateFormFields(response, this.reportId);
221                                         this.showformFiledSpinner = true;
222                                     } else {
223                                         this.formFieldList = response['formFieldList'];
224                                         this.reportMode = 'Regular';
225                                         this.httpCacheService.setRouteCache(this.reportId, this.getQueryString());
226                                         this.httpCacheService.setRouteGroupCache(this.reportId, this.groupSelectValue);
227                                         this.navigateToRun = true;
228                                         this.showformFiledSpinner = false;
229
230                                     }
231                                     this.showSpinner = false;
232                                 }
233                             });
234                     } else if (this.calledWithFormFields == true) {
235                         this._runService.getReportData(this.reportId)
236                             .subscribe((response) => {
237                                 if (response['errormessage']) {
238                                     this.showError(response);
239                                 } else {
240                                     this.error = false;
241                                     this.reportName = response['reportName'];
242                                     this.allowEdit = response['allowEdit'];
243                                     if (response['formFieldList'].length > 0) {
244                                         this.setDefaultFieldGroupValueForNonSelected(response['formFieldList']);
245                                         this.generateQueryString();
246                                         this.fetchAndPopulateFormFields(response, this.reportId);
247                                         this.formFieldListValueMap = new Map<any, any>();
248                                         for (const ff of response['formFieldList']) {
249                                             if (this.finalQueryParamsObj[ff.fieldId]) {
250                                                 if (ff.validationType == 'DATE') {
251                                                     const dateVal = this.finalQueryParamsObj[ff.fieldId];
252                                                     this.formFieldListValueMap.set(ff.fieldId, new Date(dateVal.toString().replace(/%2F/g, '/')));
253                                                 } else if (ff.fieldType == 'LIST_MULTI_SELECT') {
254                                                     const multiSelectArray = [];
255                                                     let multiVal = this.finalQueryParamsObj[ff.fieldId];
256                                                     multiVal = multiVal.toString().replace(/%2F/g, '/');
257                                                     multiVal = multiVal.toString().replace(/%20/g, ' ');
258                                                     multiVal = multiVal.toString().replace(/%28/g, '(');
259                                                     multiVal = multiVal.toString().replace(/%29/g, ')');
260                                                     multiVal = multiVal.toString().replace('+', ' ');
261                                                     if (multiVal.split('|').length > 1) {
262                                                         let tempArray = multiVal.split('|');
263                                                         for (let arr = 0; arr < tempArray.length; arr++) {
264                                                             multiSelectArray.push(tempArray[arr]);
265                                                         }
266                                                     } else {
267                                                         multiSelectArray.push(multiVal);
268                                                     }
269                                                     this.formFieldListValueMap.set(ff.fieldId, multiSelectArray);
270                                                 } else {
271                                                     let multiVal = this.finalQueryParamsObj[ff.fieldId];
272                                                     multiVal = multiVal.toString().replace(/%2F/g, '/');
273                                                     multiVal = multiVal.toString().replace(/%20/g, ' ');
274                                                     multiVal = multiVal.toString().replace(/%28/g, '(');
275                                                     multiVal = multiVal.toString().replace(/%29/g, ')');
276                                                     multiVal = multiVal.toString().split('+').join(' ');
277                                                     this.formFieldListValueMap.set(ff.fieldId, multiVal);
278                                                 }
279                                             } else {
280                                                 if (ff.fieldType == 'LIST_MULTI_SELECT') {
281                                                     const multiSelectArray = [];
282                                                     this.formFieldListValueMap.set(ff.fieldId, multiSelectArray);
283                                                 } else {
284                                                     this.formFieldListValueMap.set(ff.fieldId, '');
285                                                 }
286                                             }
287                                         }
288                                         this.error = false;
289                                         this.httpCacheService.setRouteCache(this.reportId, this.getQueryString());
290                                         this.httpCacheService.setRouteGroupCache(this.reportId, this.groupSelectValue);
291                                         this.navigateToRun = true;
292                                         this.showformFiledSpinner = true;
293                                         this.directCallQueryParams = '';
294                                     } else {
295                                         this.reportMode = 'Regular';
296                                         this.navigateToRun = true;
297                                         this.showformFiledSpinner = false;
298
299                                     }
300                                     this.showSpinner = false;
301
302                                 }
303                             });
304                     } else {
305                         this.reportMode = 'FormField';
306                         this.navigateToRun = true;
307                         this.showSpinner = false;
308                         this.showformFiledSpinner = true;
309                     }
310                 } else {
311                     if (this.calledWithFormFields == false) {
312                         this.iSDashboardReport = 'Dashboard';
313                         this.reportName = responseDefPage['reportName'];
314                         this.DashboardReportObj = JSON.parse(responseDefPage['dashboardLayoutJSON']);
315                         let i = 0;
316                         let subReportId = '';
317                         const tempDashboardArray = [];
318                         for (let dash = 0; dash < this.DashboardReportObj.length; dash++) {
319                             if (this.DashboardReportObj[dash]['hasContent']['hideDisplay'] !== true) {
320                                 tempDashboardArray.push(this.DashboardReportObj[dash]);
321                             }
322                         }
323                         this.DashboardReportObj = [];
324                         this.DashboardReportObj = tempDashboardArray;
325                         while (this.DashboardReportObj[i]) {
326                             subReportId = this.DashboardReportObj[i]['hasContent']['id'].split('#')[1];
327                             i++;
328                             break;
329                         }
330                         this._runService.getReportData(subReportId)
331                             .subscribe((response) => {
332                                 if (response['errormessage']) {
333                                     this.showError(response);
334                                     this.allowEdit = response['allowEdit'];
335                                 } else {
336                                     this.allowEdit = response['allowEdit'];
337                                     if (response['formFieldList'].length > 0) {
338                                         this.fetchAndPopulateFormFields(response, subReportId);
339                                     } else {
340                                         this.navigateToRun = true;
341                                     }
342                                     this.runDashboardReport = true;
343                                     this.showSpinner = false;
344                                     this.showformFiledSpinner = true;
345                                 }
346                             });
347                         this.showSpinner = false;
348                         this.showformFiledSpinner = true;
349                     } else if (this.calledWithFormFields == true) {
350                         this.httpCacheService.setRouteCache(this.reportId, this.getQueryString());
351                         this.httpCacheService.setRouteGroupCache(this.reportId, this.groupSelectValue);
352                         this.iSDashboardReport = 'Dashboard';
353                         this.reportName = responseDefPage['reportName'];
354                         this.DashboardReportObj = JSON.parse(responseDefPage['dashboardLayoutJSON']);
355                         const tempDashboardArray = [];
356                         for (let dash = 0; dash < this.DashboardReportObj.length; dash++) {
357                             if (this.DashboardReportObj[dash]['hasContent']['hideDisplay'] !== true) {
358                                 tempDashboardArray.push(this.DashboardReportObj[dash]);
359                             }
360                         }
361                         this.DashboardReportObj = [];
362                         this.DashboardReportObj = tempDashboardArray;
363                             let subReportId1 = '';
364                             let i = 0;
365                             while (this.DashboardReportObj[i]) {
366                                 subReportId1 = this.DashboardReportObj[i]['hasContent']['id'].split('#')[1];
367                                 i++;
368                                 break;
369                             }
370                             this._runService.getReportData(subReportId1)
371                                 .subscribe((response) => {
372                                     if (response['errormessage']) {
373                                         this.showError(response);
374                                         this.allowEdit = response['allowEdit'];
375                                     } else {
376                                         this.allowEdit = response['allowEdit'];
377                                         if (response['formFieldList'].length > 0) {
378                                             this.fetchAndPopulateFormFields(response, subReportId1);
379                                             this.formFieldListValueMap = new Map<any, any>();
380                                             for (const ff of response['formFieldList']) {
381                                                 if (this.finalQueryParamsObj[ff.fieldId]) {
382                                                     if (ff.validationType == 'DATE') {
383                                                         const dateVal = this.finalQueryParamsObj[ff.fieldId];
384                                                         this.formFieldListValueMap.set(ff.fieldId, new Date(dateVal.toString().replace(/%2F/g, '/')));
385                                                     } else if (ff.fieldType == 'LIST_MULTI_SELECT') {
386                                                         const multiSelectArray = [];
387                                                         let multiVal = this.finalQueryParamsObj[ff.fieldId];
388                                                         multiVal = multiVal.toString().replace(/%2F/g, '/');
389                                                         multiVal = multiVal.toString().replace(/%20/g, ' ');
390                                                         multiVal = multiVal.toString().replace(/%28/g, '(');
391                                                         multiVal = multiVal.toString().replace(/%29/g, ')');
392                                                         multiVal = multiVal.toString().replace('+', ' ');
393                                                         if (multiVal.split('|').length > 1) {
394                                                             let tempArray = multiVal.split('|');
395                                                             for (let arr = 0; arr < tempArray.length; arr++) {
396                                                                 multiSelectArray.push(tempArray[arr]);
397                                                             }
398                                                         } else {
399                                                             multiSelectArray.push(multiVal);
400                                                         }
401                                                         this.formFieldListValueMap.set(ff.fieldId, multiSelectArray);
402                                                     } else {
403                                                         let multiVal = this.finalQueryParamsObj[ff.fieldId];
404                                                         multiVal = multiVal.toString().replace(/%2F/g, '/');
405                                                         multiVal = multiVal.toString().replace(/%20/g, ' ');
406                                                         multiVal = multiVal.toString().replace(/%28/g, '(');
407                                                         multiVal = multiVal.toString().replace(/%29/g, ')');
408                                                         multiVal = multiVal.toString().split('+').join(' ');
409                                                         if (multiVal == 'NULL') {
410                                                             this.formFieldListValueMap.set(ff.fieldId, '');
411                                                         } else {
412                                                             this.formFieldListValueMap.set(ff.fieldId, multiVal);
413                                                         }
414                                                     }
415                                                 } else {
416                                                     if (ff.fieldType == 'LIST_MULTI_SELECT') {
417                                                         const multiSelectArray = [];
418                                                         this.formFieldListValueMap.set(ff.fieldId, multiSelectArray);
419                                                     } else {
420                                                         this.formFieldListValueMap.set(ff.fieldId, '');
421                                                     }
422                                                 }
423                                             }
424                                         } else {
425                                             this.navigateToRun = true;
426                                         }
427                                         let subReportId = '';
428                                         for (const dashboard of this.DashboardReportObj) {
429                                             let temp = '';
430                                             temp = dashboard['hasContent']['id'].split('#')[1];
431                                             subReportId = temp;
432                                             this.directCallQueryParams = '';
433                                             this.runDashboardReport = true;
434                                             this.navigateToRun = true;
435                                             this.showSpinner = false;
436                                         }
437                                     }
438                                 });
439
440                         }
441
442                 }
443             });
444     }
445
446     toggleChangeWhenCalledWithFromFields() {
447         this.calledWithFormFields = false;
448     }
449
450     async ngDoCheck() {
451
452         if (this.formFieldList !== undefined) {
453
454             if (this.groupSelectValue !== this.oldGroupSelectValue) {
455                 //  this.formFieldListValueArr.splice(this.commonCount-1, this.formFieldListValueArr.length)
456                 this.removePrevioustoggleGroupData();
457                 this.oldGroupSelectValue = this.groupSelectValue;
458                 this.formFieldGroupObjList = [];
459                 this.saveFormFieldGroups = [];
460                 this.formFieldGroupObjList = cloneDeep(this.save);
461                 this.saveFormFieldGroups = cloneDeep(this.save);
462                 for (const formFieldGroupObjItem of this.formFieldGroupObjList) {
463                     if (formFieldGroupObjItem['name'] == this.groupSelectValue) {
464                         this.toggleFormFieldRenderArr = formFieldGroupObjItem['formFieldList'];
465                     }
466
467                 }
468                 if (this.toggleFormFieldRenderArr.length > 0) {
469                     for (let i = 0; i < this.toggleFormFieldRenderArr.length; i++) {
470                         const formFieldObj = this.toggleFormFieldRenderArr[i];
471                         if (formFieldObj['triggerOtherFormFields'] === true) {
472                             const formFieldId = formFieldObj['fieldId'];
473                             this.triggerFormFieldArr.push(formFieldId);
474                             this.initialObject[formFieldId] = '1';
475                             this.finalQueryParamsObj[formFieldId] = '1';
476                         }
477                     }
478                 }
479
480                 if (this.calledWithFormFields != true) {
481                     for (const formFieldGroupObjItem of this.saveFormFieldGroups) {
482                         if (formFieldGroupObjItem['name'] == this.groupSelectValue) {
483                             this.toggleFormFieldRenderArr = formFieldGroupObjItem['formFieldList'];
484                             for (let ffGrpValue = 0; ffGrpValue < formFieldGroupObjItem['formFieldList'].length; ffGrpValue++) {
485                                 if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length > 0) {
486                                     for (let ffValue = 0; ffValue < formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length; ffValue++) {
487                                         if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldType'] == 'LIST_BOX' && formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length > 0) {
488                                             let isAdded = false;
489                                             for (let ffValue = 0; ffValue < formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length; ffValue++) {
490                                                 if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['defaultValue'] == true) {
491                                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['id']);
492                                                     isAdded = true;
493                                                 }
494                                             }
495                                             if (!isAdded) {
496                                                 this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], '');
497                                             }
498                                         } else if ((formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldType'] == 'LIST_MULTI_SELECT' || formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldType'] == 'TEXT') && formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length > 0) {
499                                             let isAdded = false;
500                                             for (let ffValue = 0; ffValue < formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length; ffValue++) {
501
502                                                 if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['defaultValue'] == true) {
503                                                     const multiSelectArray = [];
504                                                     multiSelectArray.push(formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['id']);
505                                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], multiSelectArray);
506                                                     isAdded = true;
507                                                 }
508                                             }
509                                             if (!isAdded) {
510                                                 this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], '');
511                                             }
512                                         } else if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldType'] == 'Select Field Type' && formFieldGroupObjItem['formFieldList'][ffGrpValue]['validationType'] == 'NONE') {
513                                             let isAdded = false;
514                                             for (let ffValue = 0; ffValue < formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length; ffValue++) {
515
516                                                 if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['defaultValue'] == true) {
517                                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['id']);
518                                                     isAdded = true;
519                                                 }
520                                             }
521                                             if (!isAdded) {
522                                                 this.formFieldListValueArr[this.totalCommonCount + ffGrpValue] = '';
523                                             }
524                                         } else {
525                                             this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], '');
526                                         }
527                                     }
528                                 } else {
529                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], '');
530                                 }
531                             }
532                         }
533                     }
534                 }
535                 if (this.formFieldGroupObjList.length > 0) {
536                     for (let ffl = 0; ffl < this.formFieldList.length; ffl++) {
537                         for (let ffgl = 0; ffgl < this.formFieldGroupObjList.length; ffgl++) {
538                             const inList = this.formFieldGroupObjList[ffgl]['formFieldList'];
539
540                             for (let inl = 0; inl < inList.length; inl++) {
541                                 let cntr = 0;
542                                 if (inList[inl]['fieldId'] == this.formFieldList[ffl]['fieldId']) {
543                                     cntr++;
544                                 }
545                                 if (cntr == 0) {
546                                     this.finalQueryParamsObj[inList[inl]['fieldId']] = '-1';
547                                 }
548                             }
549
550                         }
551                     }
552                 }
553             }
554             for (const tffr of this.toggleFormFieldRenderArr) {
555                 if (this.formFieldListValueMap.get(tffr['fieldId']) || this.formFieldListValueMap.get(tffr['fieldId']) == '') {
556                     if (tffr['validationType'] == 'DATE') {
557                         this.finalQueryParamsObj[tffr['fieldId']] = this.convertDate(this.formFieldListValueMap.get(tffr['fieldId']));
558                     } else if (this.formFieldListValueMap.get(tffr['fieldId']) == '') {
559
560                         if (tffr['fieldType'] == 'LIST_MULTI_SELECT') {
561                             let multiSelectValue = '';
562                             if (multiSelectValue != '') {
563                                 multiSelectValue = multiSelectValue.substring(0, multiSelectValue.length - 1);
564                             }
565                             this.finalQueryParamsObj[tffr['fieldId']] = multiSelectValue;
566
567                         } else {
568                             this.finalQueryParamsObj[tffr['fieldId']] = '';
569                         }
570                     } else {
571                         this.finalQueryParamsObj[tffr['fieldId']] = this.formFieldListValueMap.get(tffr['fieldId']);
572                         if (this.initialObject[tffr['fieldId']] !== this.finalQueryParamsObj[tffr['fieldId']]) {
573                             this.initialObject[tffr['fieldId']] = this.finalQueryParamsObj[tffr['fieldId']];
574                             this.generateQueryString();
575                             await this.delay(1000);
576                             console.log('Afterp:  ' + new Date().toString());
577                             if ( tffr['triggerOtherFormFields'] == true) {
578                                     this._runService.refreshFormFields(this.reportId, this.queryString)
579                                         .subscribe((responseRefreshFF) => {
580                                             for (let rrff = 0; rrff < responseRefreshFF['formFieldList'].length; rrff++) {
581                                                 for (let innerTFRR = 0; innerTFRR < this.toggleFormFieldRenderArr.length; innerTFRR++) {
582                                                     if (responseRefreshFF['formFieldList'][rrff]['fieldId'] == this.toggleFormFieldRenderArr[innerTFRR]['fieldId']) {
583                                                         this.toggleFormFieldRenderArr[innerTFRR] = responseRefreshFF['formFieldList'][rrff];
584                                                     }
585                                                 }
586                                             }
587                                         });
588                               
589                             }
590                             this.initialObject[tffr['fieldId']] = this.finalQueryParamsObj[tffr['fieldId']];
591                         }
592                     }
593                 }
594             }
595
596             if (this.reportMode !== 'Regular' && this.reportMode !== 'Dashboard') {
597                 for (const ffvalue of this.formFieldList) {
598                     if (this.formFieldListValueMap.get(ffvalue['fieldId']) === '' || this.formFieldListValueMap.get(ffvalue['fieldId']) ) {
599                         if (ffvalue['validationType'] == 'DATE' && this.formFieldListValueMap.get(ffvalue['fieldId']) !== '' ) {
600                             this.finalQueryParamsObj[ffvalue['fieldId']] = this.convertDate(this.formFieldListValueMap.get(ffvalue['fieldId']));
601                         }else if (ffvalue['validationType'] == 'TIMESTAMP_SEC' && this.formFieldListValueMap.get(ffvalue['fieldId']) !== ''){
602                             if(this.formFieldListValueMap.get(ffvalue['fieldId'])[0] != ''){
603                             this.finalQueryParamsObj[ffvalue['fieldId']] = this.convertDate(this.formFieldListValueMap.get(ffvalue['fieldId'])[0]);
604                         } else {
605                                 this.finalQueryParamsObj[ffvalue['fieldId']] = this.formFieldListValueMap.get(ffvalue['fieldId'])[0];
606                             }
607                             this.finalQueryParamsObj[ffvalue['fieldId']+'_Hr'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[1];
608                             this.finalQueryParamsObj[ffvalue['fieldId']+'_Min'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[2];
609                             this.finalQueryParamsObj[ffvalue['fieldId']+'_Sec'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[3];
610                         }else if (ffvalue['validationType'] == 'TIMESTAMP_MIN' && this.formFieldListValueMap.get(ffvalue['fieldId']) !== ''){
611                             if(this.formFieldListValueMap.get(ffvalue['fieldId'])[0] != ''){
612                                 this.finalQueryParamsObj[ffvalue['fieldId']] = this.convertDate(this.formFieldListValueMap.get(ffvalue['fieldId'])[0]);
613                                 }else{
614                                     this.finalQueryParamsObj[ffvalue['fieldId']] = this.formFieldListValueMap.get(ffvalue['fieldId'])[0];
615                                 }
616                             this.finalQueryParamsObj[ffvalue['fieldId']+'_Hr'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[1];
617                             this.finalQueryParamsObj[ffvalue['fieldId']+'_Min'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[2];
618                         }else if (ffvalue['validationType'] == 'TIMESTAMP_HOUR' && this.formFieldListValueMap.get(ffvalue['fieldId']) !== ''){
619                             if(this.formFieldListValueMap.get(ffvalue['fieldId'])[0] != ''){
620                                 this.finalQueryParamsObj[ffvalue['fieldId']] = this.convertDate(this.formFieldListValueMap.get(ffvalue['fieldId'])[0]);
621                                 }else{
622                                     this.finalQueryParamsObj[ffvalue['fieldId']] = this.formFieldListValueMap.get(ffvalue['fieldId'])[0];
623                                 }                            
624                                 this.finalQueryParamsObj[ffvalue['fieldId']+'_Hr'] = this.formFieldListValueMap.get(ffvalue['fieldId'])[1];
625                         }                    
626                         else {
627                             this.finalQueryParamsObj[ffvalue['fieldId']] = this.formFieldListValueMap.get(ffvalue['fieldId']);
628                         }
629                             for (const trigElement of this.triggerFormFieldArr) {
630                                 if (this.initialObject[trigElement] !== this.finalQueryParamsObj[trigElement]) {
631                                     this.initialObject[trigElement] = this.finalQueryParamsObj[trigElement];
632                                     this.generateQueryString();
633                                     await this.delay(1000);
634                                     console.log('Afterp:  ' + new Date().toString());
635                                           if (ffvalue['triggerOtherFormFields'] == true) {
636                                               this._runService.refreshFormFields(this.reportId, this.queryString)
637                                                   .subscribe((responseRefreshFF) => {
638                                                       for (let rrff = 0; rrff < responseRefreshFF['formFieldList'].length; rrff++) {
639                                                           for (let innerFFL = 0; innerFFL < this.formFieldList.length; innerFFL++) {
640                                                               if (responseRefreshFF['formFieldList'][rrff]['fieldId'] == this.formFieldList[innerFFL]['fieldId']) {
641                                                                   this.formFieldList[innerFFL] = responseRefreshFF['formFieldList'][rrff];
642                                                               }
643                                                           }
644                                                       }
645                                                   });
646                                           }      
647                                
648                             }
649
650                         }
651                     }
652                 }
653
654             }
655         }
656         if (this.firstRun) {
657             this.saveGroupSelectValue = this.groupSelectValue;
658             this.saveFormFieldListValueMap = cloneDeep(this.formFieldListValueMap);
659         }
660         this.firstRun = false;
661     }
662
663     convertDate(str) {
664         const date = new Date(str),
665             mnth = ('0' + (date.getMonth() + 1)).slice(-2),
666             day = ('0' + date.getDate()).slice(-2);
667         return [mnth, day, date.getFullYear()].join('/');
668     }
669
670     getQueryString() {
671         if (this.directCallQueryParams !== '') {
672             return this.directCallQueryParams;
673         } else {
674             return this.queryString;
675         }
676     }
677
678     fetchAndPopulateFormFields(respObj: any, ffReportId: string) {
679         this._runService.getFormFieldGroupsData(ffReportId)
680             .subscribe((responseFormFieldGroups) => {
681                 this.firstRun = true;
682                 this.showformFiledSpinner = false;
683                 this.formFieldGroupObjList = JSON.parse(responseFormFieldGroups['formFieldGroupsJSON']);
684                 this.saveFormFieldGroups = JSON.parse(responseFormFieldGroups['formFieldGroupsJSON']);
685                 this.formFieldList = respObj['formFieldList'];
686                 if (this.formFieldList.length === 1 && this.formFieldList[0]['visible'] === false) {
687                     this.showRunButton = false;
688                 } else if (this.formFieldList.length > 0) {
689                     this.showRunButton = true;
690                 }
691                 this.staticFormFieldList = respObj['formFieldList'];
692                 this.reportMode = 'FormField';
693                 this.totalCount = this.formFieldList.length;
694                 if (this.formFieldGroupObjList !== null) {
695                     for (let ffgl = 0; ffgl < this.formFieldGroupObjList.length; ffgl++) {
696                         for (let itemFFGL = 0; itemFFGL < this.formFieldGroupObjList[ffgl]['formFieldList'].length; itemFFGL++) {
697                             const formFieldGroupItem = this.formFieldGroupObjList[ffgl]['formFieldList'][itemFFGL];
698                             for (let fflg = 0; fflg < this.formFieldList.length; fflg++) {
699                                 if (formFieldGroupItem['id'] == this.formFieldList[fflg]['fieldId']) {
700                                     this.formFieldGroupObjList[ffgl]['formFieldList'][itemFFGL] = this.formFieldList[fflg];
701                                     this.saveFormFieldGroups[ffgl]['formFieldList'][itemFFGL] = this.formFieldList[fflg];
702
703                                     if (this.formFieldList[fflg]['triggerOtherFormFields'] === true) {
704                                         const formFieldId = this.formFieldList[fflg]['fieldId'];
705                                         this.triggerFormFieldArr.push(formFieldId);
706                                         this.initialObject[formFieldId] = [];
707                                         this.finalQueryParamsObj[formFieldId] = [];
708                                     }
709                                     this.formFieldList.splice(fflg, 1);
710                                     this.unCommonGropusList.push(formFieldGroupItem);
711                                     this.unCommonCnt++;
712                                 }
713                             }
714                         }
715                     }
716                 }
717                 if (this.calledWithFormFields != true) {
718                     for (let checkRadio = 0; checkRadio < this.formFieldList.length; checkRadio++) {
719                         if (this.formFieldList[checkRadio]['fieldDisplayName'] == 'selectCriteria') {
720                             for (let ffValue = 0; ffValue < this.formFieldList[checkRadio]['formFieldValues'].length; ffValue++) {
721                                 if (this.formFieldList[checkRadio]['formFieldValues'][ffValue]['defaultValue'] == true) {
722                                     this.groupSelectValue = this.formFieldList[checkRadio]['formFieldValues'][ffValue]['name'];
723                                 }
724                             }
725                             this.oldGroupSelectValue = this.groupSelectValue;
726                         }
727                     }
728                 }
729                 this.commonCount = this.totalCount - this.unCommonCnt;
730                 this.totalCommonCount = this.commonCount;
731                 console.log(this.unCommonGropusList);
732                 console.log(this.formFieldList);
733                 for (let i = 0; i < this.formFieldList.length; i++) {
734                     const formFieldObj = this.formFieldList[i];
735                     if (formFieldObj['formFieldValues'] != null && this.calledWithFormFields != true) {
736                         if ((formFieldObj['validationType'] == 'DATE' && formFieldObj['formFieldValues'].length > 0) || formFieldObj['validationType'] == 'TIMESTAMP_SEC' || formFieldObj['validationType'] == 'TIMESTAMP_MIN' || formFieldObj['validationType'] == 'TIMESTAMP_HOUR') {
737                             if (formFieldObj['validationType'] == 'TIMESTAMP_SEC') {
738                                 const multiSelectArray = [];
739
740                                 if (formFieldObj['formFieldValues'].length > 0) {
741                                     const date = formFieldObj['formFieldValues'][0]['id'];
742                                     let tempDate = new Date(date);
743                                     multiSelectArray.push(tempDate);
744                                     multiSelectArray.push(tempDate.getHours());
745                                     multiSelectArray.push(tempDate.getMinutes());
746                                     multiSelectArray.push(tempDate.getSeconds());
747                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
748                                 } else {
749                                     multiSelectArray.push('');
750                                     multiSelectArray.push('0');
751                                     multiSelectArray.push('0');
752                                     multiSelectArray.push('0');
753                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
754                                 }
755                             }
756                             else if (formFieldObj['validationType'] == 'TIMESTAMP_MIN') {
757                                 const multiSelectArray = [];
758                                 if (formFieldObj['formFieldValues'].length > 0) {
759                                     const date = formFieldObj['formFieldValues'][0]['id'];
760                                     let tempDate = new Date(date);
761                                     multiSelectArray.push(tempDate);
762                                     multiSelectArray.push(tempDate.getHours());
763                                     multiSelectArray.push(tempDate.getMinutes());
764                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
765                                 } else {
766                                     multiSelectArray.push('');
767                                     multiSelectArray.push('0');
768                                     multiSelectArray.push('0');
769                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
770                                 }
771                             } else if (formFieldObj['validationType'] == 'TIMESTAMP_HOUR') {
772                                 const multiSelectArray = [];
773
774                                 if (formFieldObj['formFieldValues'].length > 0) {
775                                     const date = formFieldObj['formFieldValues'][0]['id'];
776
777                                     let tempDate = new Date(date);
778                                     multiSelectArray.push(tempDate);
779                                     multiSelectArray.push(tempDate.getHours());
780                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
781                                 } else {
782                                     multiSelectArray.push('');
783                                     multiSelectArray.push('0');
784                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
785                                 }
786                             }
787                                else{
788                             const date = formFieldObj['formFieldValues'][0]['id'];
789                             this.formFieldListValueMap.set(formFieldObj['fieldId'], new Date(date));
790                             }
791                         } else if (formFieldObj['fieldType'] == 'LIST_BOX' && formFieldObj['formFieldValues'].length > 0) {
792                             let isAdded = false;
793                             for (let ffValue = 0; ffValue < formFieldObj['formFieldValues'].length; ffValue++) {
794                                 if (formFieldObj['formFieldValues'][ffValue]['defaultValue'] == true) {
795                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], formFieldObj['formFieldValues'][ffValue]['id']);
796                                     isAdded = true;
797                                 }
798                             }
799                             if (!isAdded) {
800                                 this.formFieldListValueMap.set(formFieldObj['fieldId'], '');
801                             }
802                         } else if ((formFieldObj['fieldType'] == 'LIST_MULTI_SELECT' || formFieldObj['fieldType'] == 'TEXT') && formFieldObj['formFieldValues'].length > 0) {
803                             let isAdded = false;
804                             const multiSelectArray = [];
805                             for (let ffValue = 0; ffValue < formFieldObj['formFieldValues'].length; ffValue++) {
806                                 if (formFieldObj['formFieldValues'][ffValue]['defaultValue'] == true) {
807                                     multiSelectArray.push(formFieldObj['formFieldValues'][ffValue]['id']);
808                                     this.formFieldListValueMap.set(formFieldObj['fieldId'], multiSelectArray);
809                                     isAdded = true;
810                                 }
811                             }
812                             if (!isAdded) {
813                                 this.formFieldListValueMap.set(formFieldObj['fieldId'], '');
814                             }
815                         } else if (formFieldObj['fieldDisplayName'] == 'DefaultRadio') {
816                             this.formFieldListValueMap.set(formFieldObj['fieldId'], '');
817
818                         } else {
819                             this.formFieldListValueMap.set(formFieldObj['fieldId'], '');
820                         }
821                     }
822
823                     if (formFieldObj['triggerOtherFormFields'] === true) {
824                         const formFieldId = formFieldObj['fieldId'];
825                         this.triggerFormFieldArr.push(formFieldId);
826                         this.initialObject[formFieldId] = [];
827                         this.finalQueryParamsObj[formFieldId] = [];
828                     }
829                 }
830
831                 console.log(this.formFieldListValueMap);
832
833                 if (this.calledWithFormFields != true) {
834                     if (this.formFieldGroupObjList !== null) {
835                         for (const formFieldGroupObjItem of this.formFieldGroupObjList) {
836                             if (formFieldGroupObjItem['name'] == this.groupSelectValue) {
837                                 this.toggleFormFieldRenderArr = formFieldGroupObjItem['formFieldList'];
838                                 for (let ffGrpValue = 0; ffGrpValue < formFieldGroupObjItem['formFieldList'].length; ffGrpValue++) {
839                                     if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length > 0) {
840                                         for (let ffValue = 0; ffValue < formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'].length; ffValue++) {
841                                             if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['defaultValue'] == true) {
842                                                 if (formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldType'] == 'LIST_MULTI_SELECT') {
843                                                     const multiSelectArray = [];
844                                                     multiSelectArray.push(formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['id']);
845                                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], multiSelectArray);
846                                                 } else {
847                                                     this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], formFieldGroupObjItem['formFieldList'][ffGrpValue]['formFieldValues'][ffValue]['id']);
848                                                 }
849                                             }
850                                         }
851                                     } else {
852                                         this.formFieldListValueMap.set(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId'], '');
853
854                                     }
855                                 }
856                             }
857
858                         }
859                     }
860                 }
861                 console.log('finalMap', this.formFieldListValueMap);
862                 if (this.formFieldGroupObjList !== null) {
863                     if (this.formFieldGroupObjList.length > 0) {
864                         for (let ffl = 0; ffl < this.formFieldList.length; ffl++) {
865                             for (let ffgl = 0; ffgl < this.formFieldGroupObjList.length; ffgl++) {
866                                 const inList = this.formFieldGroupObjList[ffgl]['formFieldList'];
867
868                                 for (let inl = 0; inl < inList.length; inl++) {
869                                     let cntr = 0;
870                                     if (inList[inl]['fieldId'] == this.formFieldList[ffl]['fieldId']) {
871                                         cntr++;
872                                     }
873                                     if (cntr == 0) {
874                                         this.finalQueryParamsObj[inList[inl]['fieldId']] = '-1';
875                                     }
876                                 }
877
878                             }
879                         }
880                     }
881                 }
882                 this.save = cloneDeep(this.formFieldGroupObjList);
883             });
884     }
885
886     generateQueryString() {
887
888         this.queryString = '';
889         for (let k = 0; k < Object.keys(this.finalQueryParamsObj).length; k++) {
890             if (typeof (this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]]) == 'object') {
891                 const key = Object.keys(this.finalQueryParamsObj)[k];
892                 let qstr = '';
893                 let l = 0;
894                 while (this.finalQueryParamsObj[key][l]) {
895                     if (l === 0) {
896                         qstr = qstr + this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]][l];
897                     } else {
898                         qstr = qstr + '|' + this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]][l];
899                     }
900                     l++;
901                 }
902                 if (qstr !== '') {
903                     this.queryString = this.queryString + '&' + Object.keys(this.finalQueryParamsObj)[k] + '=' + qstr;
904                 }
905             } else {
906                 if (typeof (this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]]) == 'string') {
907                     this.queryString = this.queryString + '&' + Object.keys(this.finalQueryParamsObj)[k] + '=' + this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]];
908                 } else {
909                     this.queryString = this.queryString + '&' + Object.keys(this.finalQueryParamsObj)[k] + '=' + this.finalQueryParamsObj[Object.keys(this.finalQueryParamsObj)[k]];
910                 }
911             }
912
913         }
914
915     }
916
917     showError(Errresponse: any) {
918         this.errorMessage = Errresponse['errormessage'];
919         this.stackTrace = Errresponse['stacktrace'];
920         this.error = true;
921         this.showSpinner = false;
922     }
923
924     runReport() {
925         this.hitCnt++;
926         this.showSpinner = true;
927         if (this.iSDashboardReport !== 'Dashboard') {
928             if (this.formFieldList.length > 0) {
929                 this.reportMode = 'FormField';
930                 this.generateQueryString();
931             } else {
932                 this.reportMode = 'Regular';
933             }
934             this.showSpinner = false;
935         } else {
936             this.generateQueryString();
937             this.showSpinner = false;
938         }
939         this.httpCacheService.setRouteCache(this.reportId, this.getQueryString());
940         this.httpCacheService.setRouteGroupCache(this.reportId, this.groupSelectValue);
941         this.runReportAgain = !this.runReportAgain;
942         this.navigateToRun = true;
943     }
944
945     editReport(reportId: string) {
946         this._router.navigate(['v2/app/reports', 'Edit', reportId]);
947     }
948
949     showLabelFn() {
950         this.showLabel = !this.showLabel;
951     }
952
953     setDefaultFieldGroupValueForNonSelected(formFieldsList: any) {
954         this.tempFieldValues = [];
955         const map = new Map<string, string>();
956         for (const value in this.finalQueryParamsObj) {
957             map.set(value, this.finalQueryParamsObj[value]);
958         }
959         for (const ffl of formFieldsList) {
960             if (!map.get(ffl['fieldId']) && ffl['formFieldValues'].length === 1) {
961                 this.tempFieldValues = ffl['formFieldValues'];
962                 if (ffl['fieldDisplayName'] == this.tempFieldValues[0]['name']) {
963                     this.finalQueryParamsObj[ffl['fieldId']] = '-1';
964                 }
965             }
966         }
967     }
968
969     resetFormFieldValues() {
970         this.httpCacheService.clearCache();
971         this._router.navigateByUrl('v2/app/refresh', {skipLocationChange: true}).then(() =>
972             this._router.navigate(['v2/run', this.reportId]));
973     }
974
975     goBack() {
976         const prevId = this.httpCacheService.getPreviousId(this.reportId) || null;
977         const prevIdParent = this.httpCacheService.getPreviousId(prevId) || null;
978         if (prevId) {
979             if (prevIdParent && prevIdParent === 'parent') {
980                 this._router.navigate(['v2/run', prevId, this.httpCacheService.getRouteCache(prevId), this.httpCacheService.getRouteGroupCache(prevId), 'false', 'true']);
981             } else {
982                 this._router.navigate(['v2/run', prevId, this.httpCacheService.getRouteCache(prevId), this.httpCacheService.getRouteGroupCache(prevId), 'true', 'true']);
983             }
984         }
985     }
986
987     private delay(ms: number) {
988         return new Promise(resolve => setTimeout(resolve, ms));
989     }
990
991     private removePrevioustoggleGroupData() {
992         for (const formFieldGroupObjItem of this.formFieldGroupObjList) {
993             if (formFieldGroupObjItem['name'] == this.oldGroupSelectValue) {
994                 for (let ffGrpValue = 0; ffGrpValue < formFieldGroupObjItem['formFieldList'].length; ffGrpValue++) {
995                     this.finalQueryParamsObj[formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId']] = '-1';
996                     this.formFieldListValueMap.delete(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId']);
997                     this.triggerFormFieldArr = [];
998                 }
999
1000             }
1001         }
1002     }
1003
1004     getTime(){
1005        for(let i=0; i<=59; i++){
1006         this.timeStampArray.push(i);
1007        }
1008     }
1009
1010     getHours(){
1011         for(let i=0; i<=23; i++){
1012          this.hoursArray.push(i);
1013         }
1014      }
1015 }