/**
* @file Project details Component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
/** Modal service to initiate the project add @private */
public projectAdd(): void {
- const modalRef: NgbModalRef = this.modalService.open(ProjectCreateUpdateComponent, { backdrop: 'static' });
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
+ const modalRef: NgbModalRef = this.modalService.open(ProjectCreateUpdateComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.projectType = 'Add';
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** smart table listing manipulation @private */
public generateProjectData(projectData: ProjectDetails): ProjectData {
return {
projectName: projectData.name,
- modificationDate: this.sharedService.convertEpochTime(projectData._admin.modified),
- creationDate: this.sharedService.convertEpochTime(projectData._admin.created),
+ modificationDate: this.sharedService.convertEpochTime(!isNullOrUndefined(projectData._admin)
+ ? projectData._admin.modified : null),
+ creationDate: this.sharedService.convertEpochTime(!isNullOrUndefined(projectData._admin) ? projectData._admin.created : null),
id: projectData._id,
- project: projectData._id
+ project: projectData._id,
+ quotas: !isNullOrUndefined(projectData.quotas) && Object.keys(projectData.quotas).length !== 0 ? projectData.quotas : null
};
}
});
this.dataSource.load(this.projectData).then((data: boolean) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;