summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2020-07-27 15:04:23 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-27 15:04:23 +0000
commit5e143ef255badb5e0304dd4370461c5b5b158bde (patch)
treeedb03b7ff3f729c58be3003d2860d253517974a9
parentf241a11c8783c6a230a93d28101a62509af9e640 (diff)
parentc1cda6283174db9ab610ce7142222c8a00be5bc9 (diff)
Merge "App Onboarding - Delete app not working"
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java11
-rw-r--r--ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml7
-rw-r--r--portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html2
-rw-r--r--portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts10
4 files changed, 26 insertions, 4 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
index 54510d2c..a4463c7f 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
@@ -75,6 +75,7 @@ import org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference;
import org.onap.portalapp.portal.domain.EPUserAppsSortPreference;
import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference;
import org.onap.portalapp.portal.domain.EcompApp;
+import org.onap.portalapp.portal.domain.MicroserviceData;
import org.onap.portalapp.portal.domain.UserRole;
import org.onap.portalapp.portal.domain.UserRoles;
import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
@@ -975,6 +976,16 @@ public class EPAppCommonServiceImpl implements EPAppService {
}
final Map<String, Long> params = new HashMap<>();
params.put("app_id", appid);
+
+ //Checking if App is associated with any exiting microservices- ep_microservice:
+ final Map<String, Long> queryparams = new HashMap<>();
+ queryparams.put("applicationId", appid);
+ List<MicroserviceData> microservicesList = dataAccessService.executeNamedQuery( "getMicroservicesByAppId", queryparams, null);
+ if(microservicesList!=null && microservicesList.size()>0) {
+ fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return fieldsValidator;
+ }
+
List<EPUserAppRolesRequest> EPUserAppRolesRequestList= new ArrayList<>();
EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null);
for(int i=0;i<EPUserAppRolesRequestList.size();i++)
diff --git a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
index 5909036e..14156f46 100644
--- a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
+++ b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
@@ -2609,4 +2609,11 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
UPDATE fn_user fu SET fu.language_id=:language_id WHERE fu.login_id=:login_id
]]>
</sql-query>
+
+ <sql-query name="getMicroservicesByAppId">
+ <return alias="getMicroservicesByAppId" class="org.onap.portalapp.portal.domain.MicroserviceData" />
+ <![CDATA[
+ SELECT * FROM ep_microservice WHERE appId =:applicationId
+ ]]>
+ </sql-query>
</hibernate-mapping>
diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html
index d43328d5..65ccf1dc 100644
--- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html
+++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html
@@ -86,7 +86,7 @@
<div *ngFor="let tab of tabs; let index = index"
[style.display]='tab.active? "inline" : "none"'
[style.position]='tab.active? "static" : "absolute"'
- [style.height]='tab.active? "45rem" : "45rem"'>
+ [style.height]='tab.active? "calc(100vh)" : "calc(0vh)"'>
<iframe id="tabframe-{{tab.label.split(' ').join('-')}}-{{index}}" scrolling='yes' frameBorder='0' width='100%'
scrolling='yes' frameBorder='0' width='100%' height='90%' [src]='tab.url'></iframe>
diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts
index a2c759dc..5903d654 100644
--- a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts
+++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts
@@ -114,7 +114,7 @@ export class ApplicationOnboardingComponent implements OnInit {
openAddApplicationModal(rowData: any, action:any) {
console.log("Action : ", action);
- const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg' });
+ 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);
@@ -136,7 +136,7 @@ export class ApplicationOnboardingComponent implements OnInit {
}
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){
@@ -150,7 +150,11 @@ export class ApplicationOnboardingComponent implements OnInit {
this.getOnboardingApps();
}, error => {
console.log(error);
- this.openConfirmationModal('Error', error);
+ 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) => {