emptyImgForPreview: string;
isUserSuperAdmin: boolean = false;
displayedColumns: string[] = ['thumbnail', 'applicationName','active',
- 'integrationType', 'guestAccess', 'url','restURL',
+ 'integrationType', 'modeOfIntegration', 'guestAccess', 'landingPage','restURL',
'communicationKey', 'applicationNamespace', 'centralAuthAccess'];
dataSource = new MatTableDataSource(this.appsList);
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatPaginator) paginator: MatPaginator;
+ showEcompSpinner:boolean = false;
constructor(public applicationsService: ApplicationsService, public ngbModal: NgbModal) { }
getOnboardingApps(){
//console.log("getOnboardingApps called");
+ this.showEcompSpinner = true;
this.applicationsService.getOnboardingApps()
.subscribe(_data => {
this.result = _data;
if (this.result == null || this.result == 'undefined') {
console.log('WidgetOnboardingService::getOnboardingWidgets Failed: Result or result.data is null');
+ this.showEcompSpinner = false;
}else {
this.appsList = _data;
for (var i = 0; i < this.appsList.length; i++) {
}
}
this.populateTableData(this.appsList);
+ this.showEcompSpinner = false;
}
}, error =>{
console.log(error);
+ this.showEcompSpinner = false;
this.openConfirmationModal('Error', error.message);
});
+ this.showEcompSpinner = false;
}
applyFilter(filterValue: string) {
this.dataSource.paginator = this.paginator;
};
- openAddApplicationModal(rowData: any) {
- const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg' });
+ openAddApplicationModal(rowData: any, action:any) {
+ console.log("Action : ", action);
+ const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg', backdrop: 'static', keyboard: false });
modalRef.componentInstance.title = 'Application Details';
+ modalRef.componentInstance.action = action;
//console.log("selectedData in parent",rowData);
if(rowData != 'undefined' && rowData){
modalRef.componentInstance.applicationObj = rowData;
}
deleteApplication(application: IApplications){
- let confirmationMsg = 'You are about to delete this App : ' + application.name+ '. Click OK to continue.';
+ let confirmationMsg = 'You are about to delete this App : ' + application.appName+ '. Click OK to continue.';
this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => {
if (result === 'Ok') {
if(!application || application == null){
console.log('ApplicationOnboardingCtrl::deleteApplication: No apllication or ID... cannot delete');
return;
}
+ this.showEcompSpinner = true;
this.appsList.splice(this.appsList.indexOf(application), 1);
this.applicationsService.deleteOnboardingApp(application.id)
.subscribe( data => {
this.result = data;
this.getOnboardingApps();
+ this.showEcompSpinner = false;
}, error => {
console.log(error);
- this.openConfirmationModal('Error', error);
+ this.showEcompSpinner = false;
+ if(error && error.status == 405){
+ this.openConfirmationModal('', 'Application : ' + application.appName+ ' can not be deleted as it is associsted with one of the Microservices.');
+ }else{
+ this.openConfirmationModal('Error', error.message);
+ }
});
}
}, (resut) => {
if(res) {
this.isUserSuperAdmin = true;
this.displayedColumns = ['thumbnail', 'applicationName','active',
- 'integrationType', 'guestAccess', 'url','restURL',
+ 'integrationType', 'modeOfIntegration', 'guestAccess', 'landingPage','restURL',
'communicationKey', 'applicationNamespace', 'centralAuthAccess', 'delete'];
}
//console.log("isUserSuperAdmin :: ",this.isUserSuperAdmin);