summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java32
-rw-r--r--ecomp-sdk/epsdk-app-common/pom.xml7
-rw-r--r--ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts4
-rw-r--r--ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.prod.ts31
-rw-r--r--ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.ts1
-rw-r--r--ecomp-sdk/epsdk-app-os/pom.xml6
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss4
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.spec.ts5
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts129
10 files changed, 154 insertions, 67 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java
index b42bdf9c..d77e6bc7 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START==========================================
* ONAP Portal SDK
- * ===================================================================
+ * ===================================================================
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
@@ -10,7 +10,7 @@
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -124,7 +124,7 @@ import org.onap.portalsdk.analytics.view.ReportData;
import org.onap.portalsdk.analytics.view.RowHeader;
import org.onap.portalsdk.analytics.view.RowHeaderCol;
import org.onap.portalsdk.analytics.xmlobj.DataColumnType;
-import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
/**
* @author mwliu and sundar
@@ -161,7 +161,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{
int returnValue = 0;
ReportRuntime rr = null;
- if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME);
+ if(rr==null)
+ rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME);
boolean isDashboard = false;
if ((request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID)!=null) && ( ((String) request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID)).equals(rr.getReportID())) ) {
@@ -247,17 +248,21 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{
//ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME);
//ReportData rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA);
rr = null;
- ReportData rd = null;
+ ReportData rd = null;
String parent = "";
int parentFlag = 0;
- if(!nvl(request.getParameter("parent"), "").equals("N")) parent = nvl(request.getParameter("parent"), "");
- if(parent.startsWith("parent_")) parentFlag = 1;
+ if(!nvl(request.getParameter("parent"), "").equals("N"))
+ parent = nvl(request.getParameter("parent"), "");
+ if(parent.startsWith("parent_"))
+ parentFlag = 1;
if(parentFlag == 1) {
rr = (ReportRuntime) request.getSession().getAttribute(parent+"_rr");
rd = (ReportData) request.getSession().getAttribute(parent+"_rd");
}
- if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME);
- if(rd==null) rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA);
+ if(rr==null)
+ rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME);
+ if(rd==null)
+ rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA);
pb = preparePdfBean(request,rr);
FONT_FAMILY = rr.getPDFFont();
@@ -738,9 +743,11 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{
//System.out.println("chartGroupOrg " + chartGroupOrg);
if(nvl(chartGroupOrg).length()>0)
tempChartGroupCurrent = chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|"));
- if(i>0) tempChartGroupPrev = ((String) lGroups.get(i-1)).substring(0,((String) lGroups.get(i-1)).lastIndexOf("|"));
+ if(i>0)
+ tempChartGroupPrev = ((String) lGroups.get(i-1)).substring(0,((String) lGroups.get(i-1)).lastIndexOf("|"));
//System.out.println("TEMPCHARTGROUP " + tempChartGroupCurrent + " " + tempChartGroupPrev);
- if(tempChartGroupCurrent.equals(tempChartGroupPrev)) continue;
+ if(tempChartGroupCurrent.equals(tempChartGroupPrev))
+ continue;
//System.out.println("CHARTGROUPORG " + chartGroupOrg + " " + lGroups) ;
//String chartGroup = chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|"));
String chartGroup = chartGroupOrg;
@@ -1422,7 +1429,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{
DataRow dr = rd.reportDataRows.getNext();
for(dr.resetNext();dr.hasNext();) {
DataValue dv = dr.getNext();
- if(!dv.isVisible()) totalVisbleColumn--;
+ if(!dv.isVisible())
+ totalVisbleColumn--;
}
break;
diff --git a/ecomp-sdk/epsdk-app-common/pom.xml b/ecomp-sdk/epsdk-app-common/pom.xml
index 21a56f01..8995afc2 100644
--- a/ecomp-sdk/epsdk-app-common/pom.xml
+++ b/ecomp-sdk/epsdk-app-common/pom.xml
@@ -368,5 +368,12 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>20.0</version>
+ </dependency>
+
</dependencies>
</project>
diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts
index 111cf3f4..7d14ee39 100644
--- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts
+++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts
@@ -38,6 +38,10 @@ export class ProfileService {
}
+ getProfileById(profileId){
+ return this.http.get(environment.getProfileById+"?profile_id="+profileId, {withCredentials: true });
+ }
+
removeRole(data,profileId)
{
return this.http.post(environment.removeUserRole+'?profile_id='+profileId,JSON.stringify({role: data}),{ withCredentials: true });
diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.prod.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.prod.ts
index 3612073b..e53aeb67 100644
--- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.prod.ts
+++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.prod.ts
@@ -1,3 +1,32 @@
export const environment = {
- production: true
+ production: true,
+ baseUrl: '',
+ roleFunctionList: 'get_role_functions',
+ addRoleFunction: 'role_function_list/addRoleFunction',
+ usageList: 'get_usage_list',
+ cachedRegions: 'get_regions',
+ getRole:'get_role',
+ getFnMenuItems:'admin_fn_menu',
+ updateFnMenuItem:'admin_fn_menu/updateFnMenu.htm',
+ getFunctionCdList:'admin_fn_menu/get_function_cd_list',
+ getParentList:'admin_fn_menu/get_parent_list',
+ getUserPagination:'get_user_pagination?pageNum=0&viewPerPage=0',
+ deleteRole:'role_list/removeRole',
+ getTopMenu:'get_topMenuInfo',
+ deleteRoleFunction:'role_function_list/removeRoleFunction',
+ deleteMenu:'admin_fn_menu/removeMenuItem.htm',
+ getRegion:'jcs_admin/showRegionDetails',
+ postSearch:'post_search/search',
+ importSearch:'post_search/process',
+ getPostProfile:'post_search_sample',
+ getSelfProfile:'get_self_profile',
+ getProfileById: 'get_profile',
+ removeUserRole:'profile/removeRole',
+ addUserRole:'profile/addNewRole',
+ saveProfile :'profile/saveProfile',
+ getFunctionalMenuStaticDetail :'http:/www.sdk.onap.org:8080/epsdk-app-os/get_topMenuInfo',
+ getLeftMenu :'get_menu',
+ removeRoleFunction:'role/removeRoleFunction.htm?role_id=',
+ saveRole:'role/saveRole.htm?role_id=',
+ toggleProfileActive: 'profile/toggleProfileActive?profile_id='
};
diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.ts
index 294d41e9..0114df00 100644
--- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.ts
+++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/environments/environment.ts
@@ -24,6 +24,7 @@ export const environment = {
importSearch:'http://www.sdk.onap.org:8080/epsdk-app-os/post_search/process',
getPostProfile:'http://www.sdk.onap.org:8080/epsdk-app-os/post_search_sample',
getSelfProfile:'http://www.sdk.onap.org:8080/epsdk-app-os/get_self_profile',
+ getProfileById: 'http://www.sdk.onap.org:8080/epsdk-app-os/get_profile',
removeUserRole:'http://www.sdk.onap.org:8080/epsdk-app-os/profile/removeRole',
addUserRole:'http://www.sdk.onap.org:8080/epsdk-app-os/profile/addNewRole',
saveProfile :'http://www.sdk.onap.org:8080/epsdk-app-os/profile/saveProfile',
diff --git a/ecomp-sdk/epsdk-app-os/pom.xml b/ecomp-sdk/epsdk-app-os/pom.xml
index 251ba507..6527d5cd 100644
--- a/ecomp-sdk/epsdk-app-os/pom.xml
+++ b/ecomp-sdk/epsdk-app-os/pom.xml
@@ -587,6 +587,12 @@
<version>${jacoco.version}</version>
<classifier>runtime</classifier>
</dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>20.0</version>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts
index f06719fc..7bf5c649 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts
@@ -78,7 +78,7 @@ export class HeaderComponent implements OnInit {
}
this.pushRightClass = 'push-right';
- this.appName= 'ONAP ENMT' ;
+ this.appName= 'ONAP Portal' ;
let result = this.headerService.getTopMenuItems();
result.subscribe(res => {
this.response = res;
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss
index 0f868ab4..d5bf6ac0 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss
@@ -57,4 +57,8 @@ td[_ngcontent-c4], th[_ngcontent-c4] {
font-size: 14px;
width: 20%;
float: left;
+}
+
+rdp-data-table{
+ overflow-x : scroll;
} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.spec.ts
index 7481acc8..97e164df 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.spec.ts
@@ -48,6 +48,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { UserService } from 'src/app/shared/services/user/user.service';
import { Observable } from 'rxjs';
+import { ActivatedRoute } from '@angular/router';
+import { RouterTestingModule } from '@angular/router/testing';
describe('SelfComponent', () => {
let component: SelfComponent;
@@ -66,7 +68,8 @@ describe('SelfComponent', () => {
MatSelectModule,
MatSlideToggleModule,
BrowserAnimationsModule,
- HttpClientTestingModule
+ HttpClientTestingModule,
+ RouterTestingModule
]
})
.compileComponents();
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
index 45210f80..61b2a343 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
@@ -46,6 +46,7 @@ import { InformationModalComponent } from 'src/app/modals/information-modal/info
import { ErrorModalComponent } from 'src/app/modals/error-modal/error-modal.component';
import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
import { Column, ColumnTypes, DataTableSettings } from 'portalsdk-tag-lib';
+import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-self',
@@ -54,7 +55,10 @@ import { Column, ColumnTypes, DataTableSettings } from 'portalsdk-tag-lib';
})
export class SelfComponent implements OnInit {
- constructor(public userService: UserService, public profileService: ProfileService, private ngModal: NgbModal) { }
+ constructor(public userService: UserService,
+ public profileService: ProfileService,
+ private ngModal: NgbModal,
+ private route: ActivatedRoute) { }
user: User;
isAppCentralized;
@@ -98,6 +102,11 @@ export class SelfComponent implements OnInit {
ngOnInit() {
+ this.profileId = "";
+ console.log("ngOnInit called ",this.profileId);
+ if(this.route.snapshot.queryParams['profile_id']){
+ this.profileId = this.route.snapshot.queryParams['profile_id'];
+ }
this.showSpinner = false;
this.finalSelectedRoles = [];
let result = this.userService.getFunctionalMenuStaticDetailSession();
@@ -106,7 +115,11 @@ export class SelfComponent implements OnInit {
this.user = user;
this.isAppCentralized = this.user.isAppCentralized;
});
- this.getSelfProfileDetail();
+ if (this.profileId != undefined && this.profileId != "") {
+ this.getProfileById(this.profileId);
+ } else {
+ this.getSelfProfileDetail();
+ }
}
/**
@@ -116,65 +129,77 @@ export class SelfComponent implements OnInit {
this.showSpinner = true;
this.response = this.profileService.getSelfProfile();
this.response.subscribe(data => {
- let res;
- res = data;
- this.result = JSON.parse(res.data);
- this.profile = JSON.parse(this.result.profile);
- this.oriProfile = JSON.parse(this.result.profile); /*original value*/
+ this.assignProfileDetails(data);
+ });
+ this.showSpinner = false;
+ }
- this.profileId = this.profile.id;
- this.ociavailableRoles = JSON.parse(this.result.availableRoles);
- this.ociTimeZones = JSON.parse(this.result.timeZones);
- this.ociCountries = JSON.parse(this.result.countries);
- this.stateList = JSON.parse(this.result.stateList);
+ /**
+ * Get Profile Details by ProfileId
+ */
+ getProfileById(profileId) {
+ this.showSpinner = true;
+ this.profileService.getProfileById(profileId).subscribe(response => {
+ this.assignProfileDetails(response);
+ })
+ this.showSpinner = false;
+ }
- for( let state of this.stateList)
- {
- if(state.value == this.profile.state){
- this.profile.state= state.value;
- }
- }
+ assignProfileDetails(data) {
+ let res;
+ res = data;
+ this.result = JSON.parse(res.data);
+
+ this.profile = JSON.parse(this.result.profile);
+ this.oriProfile = JSON.parse(this.result.profile); /*original value*/
- for( let country of this.ociCountries)
- {
- if(country.value == this.profile.country){
- this.profile.country= country.value;
- }
- }
+ this.profileId = this.profile.id;
+ this.ociavailableRoles = this.profile.roles;
+ console.log("Profile specific roles : ", this.ociavailableRoles);
+ this.ociTimeZones = JSON.parse(this.result.timeZones);
+ this.ociCountries = JSON.parse(this.result.countries);
+ this.stateList = JSON.parse(this.result.stateList);
- for( let timeZone of this.ociTimeZones)
- {
- if(timeZone.value == this.profile.timeZoneId){
- this.profile.timeZoneId= timeZone.value;
- }
- }
+ for (let state of this.stateList) {
+ if (state.value == this.profile.state) {
+ this.profile.state = state.value;
+ }
+ }
+
+ for (let country of this.ociCountries) {
+ if (country.value == this.profile.country) {
+ this.profile.country = country.value;
+ }
+ }
+
+ for (let timeZone of this.ociTimeZones) {
+ if (timeZone.value == this.profile.timeZoneId) {
+ this.profile.timeZoneId = timeZone.value;
+ }
+ }
- console.log("Data : ", this.ociavailableRoles);
- this.columns.push(new Column("name", "Name", ColumnTypes.TEXT, false, null));
- this.settings = new DataTableSettings()
- this.settings.columns = this.columns;
- this.settings.isPaginationEnabled = false;
- this.settings.isReadOnly = true;
- this.settings.isTableSearchEnabled = false;
- this.settings.isToggleEnabled = true;
+ this.columns.push(new Column("name", "Name", ColumnTypes.TEXT, false, null));
+ this.settings = new DataTableSettings()
+ this.settings.columns = this.columns;
+ this.settings.isPaginationEnabled = false;
+ this.settings.isReadOnly = true;
+ this.settings.isTableSearchEnabled = false;
+ this.settings.isToggleEnabled = true;
- if (this.ociavailableRoles != null) {
- for (let role of this.ociavailableRoles) {
- role.selected = false;
- for (let profileRole of this.profile.roles) {
- if (profileRole.id === role.id) {
- role.selected = true;
- }
- if (role.id === 1) {
- this.isUserSystemAdmin = true;
- }
+ if (this.ociavailableRoles != null) {
+ for (let role of this.ociavailableRoles) {
+ role.selected = false;
+ for (let profileRole of this.profile.roles) {
+ if (profileRole.id === role.id) {
+ role.selected = true;
+ }
+ if (role.id === 1) {
+ this.isUserSystemAdmin = true;
}
- this.availableRoles.push(role);
}
+ this.availableRoles.push(role);
}
-
- });
- this.showSpinner = false;
+ }
}
/**