summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.html0
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.scss0
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.spec.ts25
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.ts13
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.module.ts12
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.spec.ts130
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts124
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.html50
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.scss66
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.spec.ts75
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.ts65
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.module.ts13
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.html48
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss64
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.spec.ts81
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.ts202
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.module.ts55
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.ts161
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.html137
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.scss71
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts167
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts275
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.html101
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.scss40
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts69
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.ts174
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-function.ts52
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.html48
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.scss57
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts99
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.ts126
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.module.ts16
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.service.ts57
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.html106
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.scss74
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.spec.ts75
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.ts250
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.html103
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.scss110
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts99
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.ts216
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.module.ts11
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.html49
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.scss58
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.spec.ts70
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.ts82
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.module.ts49
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/chart-wizard/chart-wizard.component.html1
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.service.ts2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.spec.ts6
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.ts26
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts6
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.ts2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html4
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.ts12
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component.ts152
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.html14
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts4
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.ts122
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.ts6
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.ts52
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.ts3
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html14
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss10
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts26
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts65
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.html2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.ts12
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.service.ts2
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html10
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss39
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts13
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts2
74 files changed, 374 insertions, 4260 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.html
deleted file mode 100644
index e69de29b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.html
+++ /dev/null
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.scss
deleted file mode 100644
index e69de29b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.scss
+++ /dev/null
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.spec.ts
deleted file mode 100644
index 72e742ff..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { AdminComponent } from './admin.component';
-
-describe('AdminComponent', () => {
- let component: AdminComponent;
- let fixture: ComponentFixture<AdminComponent>;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ AdminComponent ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(AdminComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.ts
deleted file mode 100644
index ad5498c6..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.component.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
- selector: 'app-admin',
- templateUrl: './admin.component.html',
- styleUrls: ['./admin.component.scss']
-})
-export class AdminComponent implements OnInit {
- constructor() { }
- ngOnInit() {
- }
-
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.module.ts
deleted file mode 100644
index e73e3c5a..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.module.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { AdminComponent } from './admin.component';
-
-
-@NgModule({
- declarations: [AdminComponent],
- imports: [
- CommonModule
- ]
-})
-export class AdminModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.spec.ts
deleted file mode 100644
index d23489be..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.spec.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-import { TestBed, async } from '@angular/core/testing';
-import { AdminService } from './admin.service';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { environment } from 'src/environments/environment';
-
-describe('AdminService', () => {
-
- let service:AdminService;
-
- beforeEach(() =>{
- TestBed.configureTestingModule({
- imports:[HttpClientTestingModule],
- providers: [AdminService]
- })
- service = TestBed.get(AdminService);
- });
-
- it('should be created', () => {
- const service: AdminService = TestBed.get(AdminService);
- expect(service).toBeTruthy();
- });
-
- it('should get getUserPagination', () => {
- service.getRoleFunctionList().subscribe((resp) => {
- expect(resp).toBe(environment.roleFunctionList);
- });
- })
-
- it('should test saveRoleFunction',()=>{
- service.saveRoleFunction("roleData").subscribe((resp)=>{
- expect(resp).toBe(environment.addRoleFunction);
- })
- })
-
- it('should test getUsageList',()=>{
- service.getUsageList().subscribe((resp) => {
- expect(resp).toBe(environment.usageList);
- })
- })
-
- it('should test getCacheRegions',()=>{
- service.getCacheRegions().subscribe((resp) => {
- expect(resp).toBe(environment.cachedRegions);
- })
- })
-
- it('should test getRole',()=>{
- service.getRole(1).subscribe((resp) => {
- expect(resp).toBe(environment.cachedRegions);
- })
- })
-
- it('should test getRole',()=>{
- service.getRole(1).subscribe((resp) => {
- expect(resp).toBe(environment.getRole);
- })
- })
-
- it('should test getFnMenuItems',()=>{
- service.getFnMenuItems().subscribe((resp) => {
- expect(resp).toBe(environment.getFnMenuItems);
- })
- })
-
- it('should test updateFnMenuItem',()=>{
- let menuObj: any
- service.updateFnMenuItem(menuObj).subscribe((resp) => {
- expect(resp).toBe(environment.updateFnMenuItem);
- })
- })
-
- it('should test getFunctionCdList',()=>{
- service.getFunctionCdList().subscribe((resp) => {
- expect(resp).toBe(environment.getFunctionCdList);
- })
- })
-
-
- it('should test getParentData',()=>{
- service.getParentData().subscribe((resp) => {
- expect(resp).toBe(environment.getParentList);
- })
- })
-
- it('should test deleteRole',()=>{
- let roleData: any
- service.deleteRole(roleData).subscribe((resp) => {
- expect(resp).toBe(environment.deleteRole);
- })
- })
-
- it('should test deleteRoleFunction',()=>{
- let roleData: any
- service.deleteRoleFunction(roleData).subscribe((resp) => {
- expect(resp).toBe(environment.deleteRoleFunction);
- })
- })
-
- it('should test removeRoleFunction',()=>{
- let roleFunc:any;
- let roleId:any;
- service.removeRoleFunction(roleFunc,roleId).subscribe((resp) => {
- expect(resp).toBe(environment.removeRoleFunction+roleId);
- })
- })
-
- it('should test saveRole',()=>{
- let roleObj:any;
- let roleId:any;
- service.saveRole(roleObj,roleId).subscribe((resp) => {
- expect(resp).toBe(environment.saveRole+roleId);
- })
- })
-
- it('should test deleteMenu',()=>{
- let fnMenuItem: any
- service.deleteMenu(fnMenuItem).subscribe((resp) => {
- expect(resp).toBe(environment.deleteMenu);
- })
- })
-
-
- it('should test getCacheRegionDetails',()=>{
- let cacheName:any
- service.getCacheRegionDetails(cacheName).subscribe((resp) => {
- expect(resp).toBe(environment.getRegion);
- })
- })
-
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts
deleted file mode 100644
index 1240e981..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Injectable } from '@angular/core';
-import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
-import { JsonPipe } from '@angular/common';
-import { environment } from '../../../environments/environment';
-import { Observable } from 'rxjs';
-
-@Injectable({
- providedIn: 'root'
-})
-
-export class AdminService {
-
- constructor(private http:HttpClient) { }
-
- getRoleFunctionList(){
- return this.http.get(environment.roleFunctionList,{ withCredentials: true });
- }
-
- saveRoleFunction(roleData:string){
- return this.http.post(environment.addRoleFunction,roleData);
- }
-
- getUsageList()
- {
- return this.http.get(environment.usageList,{ withCredentials: true });
-
- }
-
- getCacheRegions(){
- return this.http.get(environment.cachedRegions,{ withCredentials: true });
-
- }
-
- getRole(roleId){
- return this.http.get(environment.getRole+'?role_id=' + roleId,{ withCredentials: true });
-
- }
- getFnMenuItems()
- {
- return this.http.get(environment.getFnMenuItems,{ withCredentials: true });
- }
-
- updateFnMenuItem(menuObj: any): Observable<any> {
- let updateMenuURL = environment.updateFnMenuItem;
- return this.http.post(updateMenuURL, menuObj, {withCredentials: true})
- }
-
- getFunctionCdList(): Observable<any>{
- let getFunctionCdListURL = environment.getFunctionCdList;
- return this.http.get(getFunctionCdListURL , { withCredentials: true } );
- }
-
- getParentData(): Observable<any>{
- let getParentDataURL = environment.getParentList;
- return this.http.get(getParentDataURL , { withCredentials: true } );
- }
-
- deleteRole(roleData:any){
- return this.http.post(environment.deleteRole,JSON.stringify({role: roleData}),{ withCredentials: true });
- }
-
- deleteRoleFunction(roleFunc:any)
- {
- return this.http.post(environment.deleteRoleFunction,roleFunc,{ withCredentials: true });
-
- }
-
- removeRoleFunction(roleFunc:any, roleId:any){
- let removeRoleFunctionURL = environment.removeRoleFunction+roleId;
- return this.http.post(removeRoleFunctionURL,JSON.stringify({roleFunction:roleFunc}),{ withCredentials: true });
- }
-
- saveRole(roleObj:any, roleId:any){
- let saveRoleURL = environment.saveRole+roleId;
- return this.http.post(saveRoleURL,JSON.stringify(roleObj),{ withCredentials: true });
- }
-
- deleteMenu(fnMenuItem:any){
- return this.http.post(environment.deleteMenu,JSON.stringify({fnMenuItem: fnMenuItem}),{ withCredentials: true });
- }
-
- getCacheRegionDetails(cacheName:any){
- return this.http.get(environment.getRegion+'?cacheName='+cacheName,{ withCredentials: true });
-
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.html
deleted file mode 100644
index 8aba64c9..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<div id="page-content" style=" width: 100%">
-
- <div>
- <h1 class="heading-page" id="CacheRegions">Cache Regions</h1>
- </div>
-
- <div style="margin-right:20px; text-align:justify; text-align-last:auto;">
- <p>
- These are the regions which are currently defined in the cache. 'Items' and 'Bytes' refer to the elements currently in memory (not spooled).
- You can clear all items for a region by clicking on the Clear icon next to the desired region below. You can also <a href="admin#/jcs_admin" ng-click="clearAllFuncPopUp();">clear all regions</a>
- which empties the entire cache.</p>
- </div>
-
-
-
- <mat-accordion displayMode="flat" multi class="mat-table">
- <section matSort class="mat-header-row">
- <span class="mat-header-cell" >Cache Name</span>
- <span class="mat-header-cell" ># of Items</span>
- <span class="mat-header-cell" >Bytes</span>
- <span class="mat-header-cell" >Status</span>
- <span class="mat-header-cell" >Memory Hits</span>
- <span class="mat-header-cell">Aux Hits</span>
- <span class="mat-header-cell" >Not Expired MissesFound Misses</span>
- <span class="mat-header-cell" >Expired Misses</span>
- <span class="mat-header-cell" >Clear?</span>
- <span class="mat-header-cell" >Items</span>
-
- </section>
-
- <mat-expansion-panel *ngFor="let item of regions">
- <mat-expansion-panel-header >
- <span class="mat-cell"><a href="javascript:;" (click)="showRegionDetails(item.cacheName)">{{item.cacheName}}</a></span>
- <span class="mat-cell">{{item.byteCount}}</span>
- <span class="mat-cell">{{item.status}}</span>
- <span class="mat-cell">{{item.hitCountRam}}</span>
- <span class="mat-cell">{{item.hitCountAux}}</span>
- <span class="mat-cell">{{item.missCountNotFound}}</span>
- <span class="mat-cell">{{item.missCountExpired}}</span>
- <span class="mat-cell">{{item.hitCountRam}}</span>
- <span class="mat-cell">clear</span>
- <span class="mat-cell">delete</span>
-
- </mat-expansion-panel-header>
- <div><pre>{{item.items | json }}</pre></div>
- </mat-expansion-panel>
-
- </mat-accordion>
-
- \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.scss
deleted file mode 100644
index 34516bbf..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.scss
+++ /dev/null
@@ -1,66 +0,0 @@
-table {
- width: 100%;
- }
-
- .mat-form-field {
- font-size: 14px;
- width: 100%;
- }
-
- td, th {
- width: 25%;
- }
-
-
- .mat-accordion .mat-header-row {
- padding-left: 1.5rem;
- padding-right: 2rem;
- border-bottom: none;
- }
-
-
- //copied from https://github.com/angular/material2/blob/master/src/lib/table/table.scss
- $mat-header-row-height: 56px;
- $mat-row-height: 48px;
- $mat-row-horizontal-padding: 24px;
-
-
- .mat-header-row {
- min-height: $mat-header-row-height;
- }
-
- .mat-row {
- min-height: $mat-row-height;
- }
-
- .mat-row, .mat-header-row {
- display: flex;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- align-items: center;
- padding: 0 $mat-row-horizontal-padding;
- box-sizing: border-box;
-
- // Workaround for https://goo.gl/pFmjJD in IE 11. Adds a pseudo
- // element that will stretch the row the correct height. See:
- // https://connect.microsoft.com/IE/feedback/details/802625
- &::after {
- display: inline-block;
- min-height: inherit;
- content: '';
- }
- }
-
- .mat-cell, .mat-header-cell {
- flex: 1;
- overflow: hidden;
- word-wrap: break-word;
- }
-
- .mat-expansion-panel {
- margin: 0;
- border-radius: 4px;
- overflow: hidden;
- transition: margin 225ms cubic-bezier(.4,0,.2,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);
- }
- \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.spec.ts
deleted file mode 100644
index 03d21797..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.spec.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { CacheAdminComponent } from './cache-admin.component';
-import { MatExpansionModule } from '@angular/material';
-import { HttpClientModule } from '@angular/common/http';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { AdminService } from '../admin.service';
-import { Observable } from 'rxjs/Observable';
-import 'rxjs/add/observable/of';
-import { CookieService } from 'ngx-cookie-service';
-import { SuccessModalComponent } from 'src/app/modals/success-modal/success-modal.component';
-import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-
-describe('CacheAdminComponent', () => {
- let component: CacheAdminComponent;
- let fixture: ComponentFixture<CacheAdminComponent>;
- let adminService:AdminService;
-
- var stubData1={"data":'{"data":"cachedRegions"}'};
- var stubData2={"data":"stubData2"};
-
- beforeEach(async(() => {
-
- TestBed.configureTestingModule({
- declarations: [
- CacheAdminComponent,
- SuccessModalComponent,
- ],
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- imports:[
- MatExpansionModule,
- HttpClientModule,
- HttpClientTestingModule,
- NgbModule.forRoot()
- ],
- providers:[CookieService,AdminService],
- })
- TestBed.overrideModule(BrowserDynamicTestingModule,{
- set:{
- entryComponents:[SuccessModalComponent]
- }
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(CacheAdminComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- adminService=TestBed.get(AdminService);
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-
-
- describe('it should test ngOnInit method',()=>{
- it('should test ngOnInit',()=>{
- let spy=spyOn(adminService,'getCacheRegions').and.returnValue(Observable.of(stubData1));
- component.ngOnInit();
- expect(spy).toHaveBeenCalled();
- })
- })
-
- it('it should test showRegionDetails method',()=>{
- let spy=spyOn(adminService,'getCacheRegionDetails').and.returnValue(Observable.of(stubData2));
- component.showRegionDetails("string");
- expect(spy).toHaveBeenCalled();
- })
-
-});
-
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.ts
deleted file mode 100644
index d9f5ca80..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.component.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import {Component, OnInit, ViewChild} from '@angular/core';
-import { AdminService } from '../admin.service';
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { SuccessModalComponent } from 'src/app/modals/success-modal/success-modal.component';
-
-
-@Component({
- selector: 'app-cache-admin',
- templateUrl: './cache-admin.component.html',
- styleUrls: ['./cache-admin.component.scss']
-})
-export class CacheAdminComponent implements OnInit {
-
- constructor(public adminService:AdminService,private ngModal: NgbModal) {
-
- }
-
- response: any;
- regions:any;
- message;any;
-
- ngOnInit() {
-
- let result = this.adminService.getCacheRegions();
- result.subscribe(data => {
- this.response = data;
- this.regions = JSON.parse(this.response.data);
- });
-
- }
-
-
- showRegionDetails(item: any) {
- let response;
-
- this.adminService.getCacheRegionDetails(item).subscribe(data => {
- response = data;
-
-
- let message = response.data;
- let msgParsed = JSON.stringify(message);
-
-
-
- if(message!=null && message!=''){
- var status = response.status;
- var htmlstring = message.toString();
- var htmlStrReplace = htmlstring.replace(/['"]+/g, '');
- var htmlStrReplaceSplit = htmlStrReplace.split('\n');
- var dataStr = htmlStrReplace.replace(/\\n/g, "\n");
- this.message = dataStr;
-
- }
-
-
-
- });
- const modalRef = this.ngModal.open(SuccessModalComponent);
- modalRef.componentInstance.message = this.message;
-
-
- }
-
-}
-
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.module.ts
deleted file mode 100644
index 5974dd7b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/cache-admin/cache-admin.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { CacheAdminComponent } from './cache-admin.component';
-import { MatFormField, MatFormFieldModule } from '@angular/material/form-field';
-
-@NgModule({
- declarations: [CacheAdminComponent],
- imports: [
- CommonModule,
- MatFormFieldModule
- ]
-})
-export class CacheAdminModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.html
deleted file mode 100644
index 25ae9665..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
--->
-<div class="main-container">
- <div id="page-content">
- <div class="ecomp-main-view-title">
- <h3 class="heading-page">Admin Menu Items</h3>
- </div>
- <div ng-show="showLoader" class="span loader-container">
- <i class="icon-primary-spinner" role="img" aria-label="Please wait while we load your content"></i>
- </div>
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
- <rdp-data-table [data]="tableData" [settings]="settings"></rdp-data-table>
- </div>
-</div> \ No newline at end of file
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
deleted file mode 100644
index d5bf6ac0..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.scss
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-table {
- width: 100%;
-}
-
-.mat-form-field {
- font-size: 14px;
- width: 100%;
-}
-
-td, th {
- width: 25%;
-}
-
-td[_ngcontent-c4], th[_ngcontent-c4] {
- width: 7%;
-}
-
-::ng-deep .mat-form-field[_ngcontent-c4][_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/admin/menus/menus.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.spec.ts
deleted file mode 100644
index eb8b63dd..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.spec.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
-import { MatTableModule } from '@angular/material/table';
-import { MatPaginatorModule } from '@angular/material/paginator';
-import { MatSortModule } from '@angular/material/sort';
-import { HttpClientModule } from '@angular/common/http';
-import { NoopAnimationsModule } from '@angular/platform-browser/animations';
-import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
-import { NgbModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-import { MenusComponent } from './menus.component';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { AdminService } from '../admin.service';
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { MenusService } from './menus.service';
-import { CookieService } from 'ngx-cookie-service';
-import { MockBackend } from '@angular/http/testing';
-import { BaseRequestOptions, Http } from '@angular/http';
-import 'rxjs/add/observable/of';
-import { Observable } from 'rxjs/Observable';
-
-describe('MenusComponent', () => {
- let component: MenusComponent;
- let fixture: ComponentFixture<MenusComponent>;
- let modalService: any;
- let adminService:any;
- var stubData={"data":'{"fnMenuItems":{"tableData":{"element":{"active":1}}}}'};
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- schemas:[CUSTOM_ELEMENTS_SCHEMA],
- declarations: [ MenusComponent,
- InformationModalComponent ],
- imports: [ MatTableModule,
- MatPaginatorModule,
- MatSortModule,
- HttpClientModule,
- HttpClientTestingModule,
- NoopAnimationsModule,
- NgbModule.forRoot()
- ],
- providers:[MenusService,CookieService]
- })
- .compileComponents();
- }));
-
- beforeEach(async() => {
- fixture = TestBed.createComponent(MenusComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- modalService = TestBed.get(NgbModal);
- adminService=TestBed.get(AdminService);
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-
- // it('should test getFnMenuItems method inside getMenus',()=>{
- // let spy=spyOn(adminService,'getFnMenuItems').and.returnValue(Observable.of(stubData))
- // component.getMenus();
- // expect(spy).toHaveBeenCalled();
- // })
- describe('test getMenus',()=>{
- it('should test getMenus',()=>{
- let spy=spyOn(adminService,'getParentData').and.returnValue(Observable.of('you object'))
- component.getParentData();
- expect(spy).toHaveBeenCalled();
- })
- })
-
- describe('testing getFunctionCDselectData',()=>{
- it('should test getFunctionCDselectData',()=>{
- let spy=spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.of(1,1));
- component.getFunctionCDselectData();
- expect(spy).toHaveBeenCalled();
- })
- })
-
-
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.ts
deleted file mode 100644
index 5d996964..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.component.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Component, OnInit, ViewChild } from '@angular/core';
-import { MatTableDataSource } from '@angular/material/table';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
-import { AdminService } from '../admin.service';
-import { NgbModal, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { NewMenuComponent } from './new-menu/new-menu.component';
-import { Column, DataTableSettings, RdpCrudInterface , ColumnTypes} from 'portalsdk-tag-lib';
-import { element } from '@angular/core/src/render3';
-import { MenusService } from './menus.service';
-
-@Component({
- selector: 'app-menus',
- templateUrl: './menus.component.html',
- styleUrls: ['./menus.component.scss']
-})
-export class MenusComponent implements OnInit {
-
- constructor(public adminService: AdminService, private ngModal: NgbModal, public menuService : MenusService) { }
-
- // menuHeaders = ["menuId", "label", "paretId", "sortOrder", "action", "functionCd", "active", "servlet", "queryString", "externalUrl", "target", "menuSetCode", "separator", "imageSrc", "Edit", "Delete"];
-
- response: any;
- result: any;
- functionalMenuRes: any;
- tableData;
- dataSource: MatTableDataSource<[]>;
- closeResult: string;
- isEditMode: boolean;
- showSpinner: boolean;
-
- public settings;
- public columns: any = [];
-
- activeStatusOptions = [
- {index: 0, value: 'true', name: 'Y'},
- {index: 1, value: 'false', name: 'N'}
- ];
- separatorStatusOptions = [
- {index: 0, value: 'true', name: 'Y'},
- {index: 1, value: 'false', name: 'N'}
- ];
- functionCDselectData = [];
- parentListSelectData = [];
- parentList = [];
-
- @ViewChild(MatPaginator, {}) paginator: MatPaginator;
- @ViewChild(MatSort, {}) sort: MatSort;
-
- ngOnInit() {
- this.showSpinner = false;
- this.getParentData();
- this.getFunctionCDselectData();
- this.getMenus();
- }
-
- getMenus() {
- console.log(">>>>>>>>>>>>>>> GetMenus calles >>>>>>>>>>>>>>")
- this.showSpinner = true;
- let response;
- this.response = this.adminService.getFnMenuItems();
- this.response.subscribe(data => {
- response = data;
-
- this.functionalMenuRes = JSON.parse(response.data);
- this.tableData = this.functionalMenuRes.fnMenuItems;
- this.tableData.forEach(element => {
- if (element.active) { element.active = "Y"; }
- else { element.active = "N"; }
- if (element.separator) { element.separator = "Y"; }
- else { element.separator = "N"; }
- });
-
- //rdp table data
- let menuIdColumn = new Column("id", "Menu ID", ColumnTypes.TEXT, true, null);
- menuIdColumn.isColumnDisabled = true;
- this.columns.push(menuIdColumn);
-
- let label = new Column("label", "Label", ColumnTypes.TEXT, true, null);
- label.setIsColumnMandatory = true;
- this.columns.push(label);
-
- let parent = new Column("parentId", "ParentId", ColumnTypes.DROPDOWN, true, this.parentList);
- parent.setIsColumnMandatory = true;
- this.columns.push(parent);
-
- let sortOrder = new Column("sortOrder", "Sort Order", ColumnTypes.TEXT, true, null);
- sortOrder.setIsColumnMandatory = true;
- this.columns.push(sortOrder);
-
- let action = new Column("action", "Action", ColumnTypes.TEXT, true, null);
- action.setIsColumnMandatory = true;
- this.columns.push(action);
-
- let functionCd = new Column("functionCd", "Function", ColumnTypes.DROPDOWN, true, this.functionCDselectData);
- functionCd.setIsColumnMandatory = true;
- this.columns.push(functionCd);
-
- let active = new Column("active", "Active", ColumnTypes.DROPDOWN, true, this.activeStatusOptions);
- active.setIsColumnMandatory = true;
- this.columns.push(active);
-
- this.columns.push(new Column("servlet", "Servlet", ColumnTypes.TEXT, true, null));
- this.columns.push(new Column("queryString", " Query String", ColumnTypes.TEXT, true, null));
- this.columns.push(new Column("externalUrl", "External URL", ColumnTypes.TEXT, true, null));
- this.columns.push(new Column("target", "Target", ColumnTypes.TEXT, true, null));
-
- let menuSetCode = new Column("menuSetCode", "Menu Set Code", ColumnTypes.TEXT, false, null);
- menuSetCode.setIsColumnMandatory = true;
- this.columns.push(menuSetCode);
-
- let separator = new Column("separator", "Separator", ColumnTypes.DROPDOWN, false, this.separatorStatusOptions);
- separator.setIsColumnMandatory = true;
- this.columns.push(separator);
- this.columns.push(new Column("imageSrc", "Image Source", ColumnTypes.TEXT, true, null));
-
- this.settings = new DataTableSettings()
- this.settings.columns = this.columns;
- this.settings.isPaginationEnabled = true;
- this.settings.paginationsSize = "5";
- this.settings.isReadOnly = false;
- this.settings.isTableSearchEnabled = true;
- this.settings.applicationService = this.menuService;
-
- this.showSpinner = false;
-
- });
- }
-
- getFunctionCDselectData = function () {
- this.adminService.getFunctionCdList()
- .subscribe(_data => {
- this.result = _data;
- if (_data) {
-
- for(let i = 0; i< _data.length; i++){
- this.functionCDselectData.push({id: i, name: _data[i]});
- }
- }
- }, error => {
- this.showSpinner = false;
- console.log(error);
- this.openConfirmationModal("", "Function Code Data not available !");
- });
- }
-
- getParentData() {
- this.adminService.getParentData()
- .subscribe(_data => {
- this.result = _data;
- if (_data) {
- for(let i = 0; i< _data.length; i++){
- this.parentList.push({id: _data[i][0], name: _data[i][1]});
- }
- console.log("Actual parent list : ", this.parentList);
- }
- }, error => {
- this.showSpinner = false;
- console.log(error);
- });
- }
-
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.module.ts
deleted file mode 100644
index c6f39f6b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.module.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { MenusComponent } from './menus.component';
-import { MaterialModule } from 'src/app/material-module';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { MatFormFieldModule } from '@angular/material/form-field';
-import { NewMenuComponent } from './new-menu/new-menu.component';
-
-@NgModule({
- declarations: [MenusComponent, NewMenuComponent],
- imports: [
- CommonModule,FormsModule,ReactiveFormsModule,MatFormFieldModule
- ],
- exports: [MenusComponent],
- bootstrap: [MenusComponent]
-})
-export class MenusModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.ts
deleted file mode 100644
index aeb8ea49..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { RdpCrudInterface } from 'portalsdk-tag-lib';
-import { environment } from 'src/environments/environment';
-import { AdminService } from '../admin.service';
-import { BehaviorSubject } from 'rxjs';
-
-@Injectable({
- providedIn: 'root'
-})
-export class MenusService implements RdpCrudInterface {
-
- public statusResponse = new BehaviorSubject("");
- public updatedData = new BehaviorSubject<any>({});
-
- loadTableData(filter: any, sortActive: any, sortDirection: any, pageIndex: any, pageSize: any): import("rxjs").Observable<any[]> {
- throw new Error("Method not implemented.");
- }
- getTotalRowCount() {
- throw new Error("Method not implemented.");
- }
-
- parentDataList: any;
- constructor(private http: HttpClient, private adminService: AdminService) {
-
- }
-
-
- menu = {
- action: null,
- active: false,
- activeAsString: "false",
- auditTrail: null,
- auditUserId: null,
- childMenus: [],
- created: null,
- createdId: null,
- externalUrl: null,
- functionCd: null,
- id: null,
- imageSrc: null,
- label: null,
- menuLevel: null,
- menuSetCode: null,
- modified: null,
- modifiedId: null,
- parentId: null,
- parentIdAsString: null,
- parentMenu: null,
- queryString: null,
- rowNum: null,
- separator: false,
- separatorAsString: false,
- servlet: null,
- sortOrder: null,
- target: null
- };
-
- add(data: any) {
- console.log("Add method is getting called from AppServie data:: ", data);
- }
-
-
- update(data: any) {
- data.active = this.updateStatus(data.active);
- data.separator = this.updateStatus(data.separator);
- let keys = Object.keys(data);
- keys.forEach(element => {
- if (data[element] != null || data[element] != undefined) {
- if (element == 'parentId') {
- this.menu[element] = 1;
- } else {
- this.menu[element] = data[element];
- }
- }
- });
- let result = { availableFnMenuItem: this.menu };
- let postData = JSON.stringify(result);
- console.log("postData >>>>>>", postData);
- this.adminService.updateFnMenuItem(postData)
- .subscribe(_data => {
- this.statusResponse.next("200");
- }, error => {
- console.log("Error : ", error);
- });
-
- }
-
- delete(data: any) {
- console.log("Delete method is getting called from AppServie data::>> " + JSON.stringify(data));
- console.log(data.active);
- data.active = this.updateStatus(data.active);
- data.separator = this.updateStatus(data.separator);
- let result = { availableFnMenuItem: data };
- this.adminService.deleteMenu(result).subscribe(response => {
- console.log("Response ", response);
- this.statusResponse.next("200");
- }, error =>{
- console.log("Error : ", error);
- })
- }
-
- private updateStatus(data) {
- if (data == 'N') {
- return false;
- } else {
- return true;
- }
- }
-
- get() {
- console.log("get method is getting called from AppServie data:: ");
- let response = this.adminService.getFnMenuItems();
- let resp;
- response.subscribe(res => {
- console.log("Get Response : ", res);
- resp = res;
- console.log("edited : ",JSON.parse(resp.data).fnMenuItems);
- this.updatedData.next(JSON.parse(resp.data).fnMenuItems);
- })
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.html
deleted file mode 100644
index 6a5426a8..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
--->
-
-<div class="container">
- <!--Modal Headers-->
- <div class="modal-header">
- <h4 class="modal-title">{{(isEditMode) ? 'Edit Menu Item' : 'Add New Menu Item'}}</h4>
- <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
- <span aria-hidden="true">&times;</span>
- </button>
- </div>
-
- <!--Modal Body goes here-->
- <div class="modal-body">
- <div class="elementsContainer">
- <div class="groupItem">
- <label class="item-label">*Label:</label><br>
- <input [(ngModel)]="menu.label" type="text" name="label" id="label">
- </div>
- <div class="groupItem">
- <label class="item-label">*Parent:</label><br>
- <!-- <input [(ngModel)]="menu.parentId" type="text" name="parentId" id="parent"> -->
- <select class="form-field" name="parentSelect" id="parentSelect" [(ngModel)]="menu.parentId">
- <option>{{getParentLabel(menu.parentId, parentListSelectData)}}</option>
- <option *ngFor="let option of parentListSelectData" value="{{option[0]}}">{{option[1]}}</option>
- </select>
- </div>
- <div class="groupItem">
- <label class="item-label">*Sort Order</label><br>
- <input [(ngModel)]="menu.sortOrder" type="text" name="sortOrder" id="sortOrder">
- </div>
- <div class="groupItem">
- <label class="item-label">*Action</label><br>
- <input [(ngModel)]="menu.action" type="text" name="action" id="action">
- </div>
- </div>
-
- <br>
-
- <div class="elementsContainer">
- <div class="groupItem">
- <label class="item-label"><b>*</b>Function:</label><br>
- <select class="form-field" name="repeatSelect" id="repeatSelect" [(ngModel)]="menu.functionCd">
- <option>{{menu.functionCd}}</option>
- <option *ngFor="let item of functionCDselectData" value="{{item}}" >{{item}}</option>
- </select>
- </div>
- <div class="groupItem">
- <label class="item-label"><b>*</b>Active:</label><br>
- <select class="form-field" name="selectActive" ng-model="menu.active">
- <option *ngFor="let active of activeStatusOptions" value="{{active.value}}">{{active.title}}</option>
- </select>
- </div>
- <div class="groupItem">
- <label class="item-label">Servlet:</label><br>
- <input [(ngModel)]="menu.servlet" type="text" name="servlet" id="servlet">
- </div>
- <div class="groupItem">
- <label class="item-label">Query String:</label><br>
- <input [(ngModel)]="menu.queryString" type="text" name="queryString" id="queryString">
- </div>
- </div>
-
- <br>
-
- <div class="elementsContainer">
- <div class="groupItem">
- <label class="item-label">External URL:</label><br>
- <input [(ngModel)]="menu.externalUrl" type="text" name="externalURL" id="externalURL">
- </div>
- <div class="groupItem">
- <label class="item-label">Target:</label><br>
- <input [(ngModel)]="menu.target" type="text" name="target" id="target">
- </div>
- <div class="groupItem">
- <label class="item-label"><b>*</b>Menu Set Code:</label><br>
- <input [(ngModel)]="menu.menuSetCode" type="text" name="menuSetCode" id="menuSetCode">
- </div>
- <div class="groupItem">
- <label class="item-label"><b>*</b>Separator:</label><br>
- <select class="form-field" name="select" ng-model="menu.separator">
- <option *ngFor="let separator of separatorStatusOptions" value="{{separator.value}}">{{separator.title}}</option>
- </select>
- </div>
- </div>
-
- <br>
-
- <div class="elementsContainer">
- <div class="groupItem">
- <label class="item-label">Image Source:</label><br>
- <input [(ngModel)]="menu.imageSrc" type="text" name="imageSource" id="imageSource">
- </div>
- </div>
-
- </div>
- <!--Modal Footer goes Here-->
- <div class="modal-footer">
- <button type="button" class="btn btn-primary" (click)="updateFnMenu()">Save</button> &nbsp;
- <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
- </div>
-</div>
- \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.scss
deleted file mode 100644
index a8b5f966..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.scss
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-::ng-deep .modal-dialog {
- max-width: 1200px;
- width: 883px;
- overflow-x: auto;
- overflow-y: auto;
-}
-
-table {
- width: 100%;
-}
-
-body {
- font-family: Roboto, Arial, sans-serif;
- margin: 0;
-}
-
-.elementsContainer{
- display: inline-flex;
-}
-
-.groupItem{
- margin-right: 11px;
- margin-bottom: 10px;
-}
-
-.form-field{
- height: 30px;
- width: 198px
-}
-
-.item-label{
- margin-bottom: 1px;
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts
deleted file mode 100644
index 1c08a97a..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * * Modification Copyright © 2020 IBM.
- * ===================================================================
-
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import {FormsModule} from '@angular/forms';
-import { NewMenuComponent } from './new-menu.component';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
-import { RouterTestingModule } from '@angular/router/testing';
-import { CookieService } from 'ngx-cookie-service';
-import { MockBackend } from '@angular/http/testing';
-import { BaseRequestOptions, Http } from '@angular/http';
-import { AdminService } from '../../admin.service';
-import 'rxjs/add/operator/toPromise';
-import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { MaterialModule } from 'portalsdk-tag-lib/material-module';
-import 'rxjs/add/observable/of';
-import { Observable } from 'rxjs/Observable';
-import 'rxjs/add/operator/catch';
-import 'rxjs/add/observable/throw';
-import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
-
-
-describe('NewMenuComponent', () => {
- let component: NewMenuComponent;
- let fixture: ComponentFixture<NewMenuComponent>;
- let adminService:AdminService;
- // let entryComponents:any;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ NewMenuComponent,ConfirmationModalComponent ],
- imports:[
- FormsModule,
- HttpClientTestingModule,
- RouterTestingModule,
- NgbModalModule,
- BrowserAnimationsModule
- ],
- providers:[
- AdminService,
- NgbActiveModal,
- CookieService
- ],
- })
- TestBed.overrideModule(BrowserDynamicTestingModule,{
- set:{
- entryComponents:[ConfirmationModalComponent ]
- }
- })
- .compileComponents();
-
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(NewMenuComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- adminService=TestBed.get(AdminService);
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-
- it('testing ngOnInit method for if condition',()=>{
- component.selectedMenu=1;
- component.ngOnInit();
- expect(component.menu).toEqual(component.selectedMenu);
- })
-
- it('testing ngOnInit method for else condition',()=>{
- component.selectedMenu=0;
- component.ngOnInit();
- expect(component.menu.menuSetCode).toEqual('APP');
- })
-
- it('testing sortItems method',()=>{
- let prop: any;
- component.sortItems(prop);
-
- })
-
- it('testing getParentLabel method',()=>{
- component.getParentLabel(1,"data");
- })
-
-
- it('should test getParentData method1 ',()=>{
- const children="children";
- let spy=spyOn(adminService,'getParentData').and.returnValue(Observable.of('you object'));
- component.getParentData();
- expect(spy).toHaveBeenCalled();
- })
-
- it('should test getParentData method2 error part ',()=>{
- const children="children";
- let spy=spyOn(adminService,'getParentData').and.returnValue(Observable.throw({status:404}));
- component.getParentData();
- expect(spy).toHaveBeenCalled();
- })
-
- describe('should test getLeftMenuItems',()=>{
- it('testing getLeftMenuItems',()=>{
- component.getLeftMenuItems();
- })
- })
-
- it('testing getFunctionCDselectData method1',()=>{
- let spy=spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.of('your object'));
- component.getFunctionCDselectData();
- expect(spy).toHaveBeenCalled();
- })
-
- describe('should test getFunctionCDselectData method2',()=>{
- it('testing getFunctionCDselectData',()=>{
- let spy= spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.throw({status:404}))
- component.getFunctionCDselectData();
- expect(spy).toHaveBeenCalled();
- })
- })
-
- it('should test updateFnMenu method',()=>{
- component.menu.label!=null;
- component.updateFnMenu();
- })
-
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts
deleted file mode 100644
index 4acf2252..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { AdminService } from '../../admin.service';
-import { SidebarComponent } from 'src/app/layout/components/sidebar/sidebar.component';
-import { Router } from '@angular/router';
-import { SidebarService } from 'src/app/shared/services';
-import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
-import { CookieService } from 'ngx-cookie-service';
-
-@Component({
- selector: 'app-new-menu',
- templateUrl: './new-menu.component.html',
- styleUrls: ['./new-menu.component.scss']
-})
-export class NewMenuComponent implements OnInit {
-
- menu = {
- action: null,
- active: false,
- activeAsString: "false",
- auditTrail: null,
- auditUserId: null,
- childMenus: [],
- created: null,
- createdId: null,
- externalUrl: null,
- functionCd: null,
- id: null,
- imageSrc: null,
- label: null,
- menuLevel: null,
- menuSetCode: null,
- modified: null,
- modifiedId: null,
- parentId: null,
- parentIdAsString: null,
- parentMenu: null,
- queryString: null,
- rowNum: null,
- separator: false,
- separatorAsString: false,
- servlet: null,
- sortOrder: null,
- target: null
- }
- showSpinner: boolean;
- result: any;
- //menu: any;
- @Input() selectedMenu: any;
- @Input() isEditMode: boolean;
- @Output() passEntry: EventEmitter<any> = new EventEmitter();
-
- statusOptions = [
- {index: 0, value: 'true', title: 'Y'},
- {index: 1, value: 'false', title: 'N'}
- ];
- selectedValue = this.statusOptions[0];
- separator = {
- availableOptions:[
- {value: 'true', name: 'Y'},
- {value: 'false', name: 'N'}
- ],
- selectedOption: {value: 'true', name: 'Y'}
- }
-
- activeStatusOptions = [
- {index: 0, value: 'true', title: 'Y'},
- {index: 1, value: 'false', title: 'N'}
- ];
- activeSelectedValue = this.activeStatusOptions[0];
-
- separatorStatusOptions = [
- {index: 0, value: 'true', title: 'Y'},
- {index: 1, value: 'false', title: 'N'}
- ];
- separatorSelectedValue = this.separatorStatusOptions[1];
-
- active = {
- availableOptions:[
- {value: 'true', name: 'Y'},
- {value: 'false', name: 'N'}
- ],
- selectedOption: {value: 'true', name: 'Y'}
- };
-
- functionCDselectData = [];
- parentListSelectData = [];
- childListSelectData = [];
-
- constructor(public adminService: AdminService, public activeModal: NgbActiveModal,
- public ngmodel: NgbModal, public router: Router, public sidebarService: SidebarService,public cookieService:CookieService) { }
-
- ngOnInit() {
- if(this.selectedMenu){
- this.menu = this.selectedMenu;
- }else{
- this.menu.menuSetCode='APP';
- }
- //console.log("selected menu >>>>",this.menu);
- this.getFunctionCDselectData();
- this.getParentData();
- }
-
- getParentData(){
- this.showSpinner = true;
- this.adminService.getParentData()
- .subscribe( _data => {
- //console.log("getParentData :: _data ",_data);
- this.result = _data;
- if(_data){
- this.parentListSelectData= _data; // data from server
- let menuItems = this.parentListSelectData;
- var heirarchicalMenuItems = [];
- var children = [];
- for ( var i=0; i<menuItems.length; i++){
- for(var j=0; j<menuItems.length; j++){
- if(menuItems[j][2]==menuItems[i][0])
- children.push(
- {
- menuId: menuItems[j][0],
- label: menuItems[j][1]
- }
- );
- }
- if(children.length!=0){
- heirarchicalMenuItems.push(
- {
- menuId: menuItems[i][0],
- label: menuItems[i][1],
- children: children.sort(this.sortItems("label"))
- }
-
- );
- }
- children = [];
- }
- heirarchicalMenuItems.sort(this.sortItems("label"));
- this.childListSelectData = heirarchicalMenuItems;
- //console.log("childListSelectData ::: ",this.childListSelectData);
- //console.log("heirarchicalMenuItems ::: ",heirarchicalMenuItems);
- //console.log("parentListSelectData ::: ",this.parentListSelectData);
- }
- }, error => {
- this.showSpinner = false;
- console.log(error);
- });
- }
-
- sortItems(prop){
- return function(a, b) {
- if (a[prop] > b[prop]) {
- return 1;
- } else if (a[prop] < b[prop]) {
- return -1;
- }
- return 0;
- }
- }
-
- getParentLabel(parentId, parentListSelectData){
- var element;
- element = parentListSelectData[0];
- for (var i=0; i<parentListSelectData.length; i++){
- element = parentListSelectData[i];
- if (element[0] == parentId)
- return element[1];
- else "---";
- }
- }
-
- updateFnMenu(){
- this.showSpinner = true;
- //console.log("updateFnMenu Changes Called..",this.menu);
- if( this.menu && this.menu.imageSrc == "" ) this.menu.imageSrc = "N/A";
- if( this.menu && this.menu.target == "" ) this.menu.target = "N/A";
- if( this.menu && this.menu.externalUrl == "" ) this.menu.externalUrl = "N/A";
- if( this.menu && this.menu.queryString == "" ) this.menu.queryString = "N/A";
- if( this.menu && this.menu.servlet == "" ) this.menu.servlet = "N/A";
-
- let validationRule = /^\S{3,}$/;
- let selectedFunction = this.menu.functionCd;
- var selectedFunctionText = this.menu.functionCd; //selectedFunction.options[selectedFunction.selectedIndex].text;
-
- if((this.menu.label == null || this.menu.label == "" || (this.menu.label && this.menu.label.trim().length == 0) ) ||
- this.menu.parentId == null || this.menu.parentId == "" || this.menu.action == null || this.menu.action == "" ||
- selectedFunctionText == null || selectedFunctionText == "" || this.menu.sortOrder == null || this.menu.sortOrder == "" ||
- this.menu.menuSetCode == null ||this.menu.menuSetCode == ""){
-
- this.openConfirmationModal('','Please provide all the mandatory (*) fields inputs !');
- return;
- }else{
- this.menu.parentId=parseFloat(this.menu.parentId);
- let data ={availableFnMenuItem: this.menu};
- let postData = JSON.stringify(data);
- //console.log("postData >>>>>>",postData);
- this.adminService.updateFnMenuItem(postData)
- .subscribe( _data => {
- this.result = _data;
- this.passEntry.emit(this.result);
- this.ngmodel.dismissAll();
- }, error => {
- this.showSpinner = false;
- console.log(error);
- this.openConfirmationModal("Error",error);
- });
- this.getLeftMenuItems();
- }
-
- }
-
- getLeftMenuItems(){
- //console.log("getLeftMenuItems called after update menu");
- let sidebarComponent = new SidebarComponent(this.router, this.sidebarService,this.cookieService);
- sidebarComponent.ngOnInit();
- }
-
- getFunctionCDselectData = function(){
- this.adminService.getFunctionCdList()
- .subscribe( _data => {
- this.result = _data;
- if(_data){
- this.functionCDselectData = _data;
- }
- }, error => {
- this.showSpinner = false;
- console.log(error);
- this.openConfirmationModal("","Function Code Data not available !");
- });
- }
-
- openConfirmationModal(_title: string, _message: string) {
- const modalInfoRef = this.ngmodel.open(ConfirmationModalComponent);
- modalInfoRef.componentInstance.title = _title;
- modalInfoRef.componentInstance.message = _message;
- }
-
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.html
deleted file mode 100644
index 888deca8..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal- SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
-
- -->
-
- <div class="container">
- <div class="modal-header">
- <h4 class="modal-title">{{title}}</h4>
- <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
- <span aria-hidden="true">&times;</span>
- </button>
- </div>
- <div class="modal-body">
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
- <form>
- <fieldset class="form-group">
- <div class="row">
- <legend class="col-form-label col-sm-2 pt-0">Type</legend>
- <div class="col-sm-10">
- <div class="form-check">
- {{selectedType}}
- <mat-radio-group aria-labelledby="example-radio-group-label" class="example-radio-group"
- [(ngModel)]="selectedType" name="type">
- <mat-radio-button class="example-radio-button" [disabled]="editDisable" *ngFor="let type of typeOptions" [value]="type">
- {{type}} &nbsp;
- </mat-radio-button>
- </mat-radio-group>
- </div>
- </div>
- </div>
- </fieldset>
- <div *ngIf="selectedType === 'other'" class="form-group row">
- <label for="inputOtherType" class="col-sm-2 col-form-label"></label>
- <div class="col-sm-10">
- <input type="text" class="form-control" [disabled]="editDisable" [(ngModel)]="otherTypeValue" name="type2" id="inputOtherType"
- placeholder="Type">
- </div>
- </div>
- <div class="form-group row">
- <label for="inputInstance" class="col-sm-2 col-form-label">Instance</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" [disabled]="editDisable" [(ngModel)]="roleFunction.code" name="code" id="inputInstance"
- placeholder="Instance">
- </div>
- </div>
- <div class="form-group row">
- <label for="inputAction" class="col-sm-2 col-form-label">Action</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" [disabled]="editDisable" [(ngModel)]="roleFunction.action" name="action" id="inputAction"
- placeholder="Action">
- </div>
- </div>
- <div class="form-group row">
- <label for="inputName" class="col-sm-2 col-form-label">Name</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" [(ngModel)]="roleFunction.name" name="name" id="inputName"
- placeholder="Name">
- </div>
- </div>
- </form>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-primary"
- [disabled]="(selectedType === 'other' && otherTypeValue.length === 0 ) || (roleFunction.code.length === 0 || roleFunction.action.length === 0 || roleFunction.name.length === 0)"
- (click)="saveRoleFunction()">Save</button> &nbsp;
- <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
- </div>
- </div> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.scss
deleted file mode 100644
index 56cb1aa3..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.scss
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal - SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
- .ecomp-spinner{
- z-index: 9999;
-} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts
deleted file mode 100644
index ecc0947d..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { NewRoleFunctionComponent } from './new-role-function.component';
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-
-describe('NewRoleFunctionComponent', () => {
- let component: NewRoleFunctionComponent;
- let fixture: ComponentFixture<NewRoleFunctionComponent>;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- schemas:[CUSTOM_ELEMENTS_SCHEMA],
- declarations: [ NewRoleFunctionComponent ],
- imports:[FormsModule,HttpClientTestingModule],
- providers:[NgbActiveModal]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(NewRoleFunctionComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- // it('should create', () => {
- // expect(component).toBeTruthy();
- // });
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.ts
deleted file mode 100644
index d0be5145..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.ts
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { RoleFunction } from '../role-function';
-import { HttpClient } from '@angular/common/http';
-import { AdminService } from '../../admin.service';
-import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
-
-@Component({
- selector: 'app-new-role-function',
- templateUrl: './new-role-function.component.html',
- styleUrls: ['./new-role-function.component.scss']
-})
-export class NewRoleFunctionComponent implements OnInit {
-
- @Input() title: string;
- @Input() appId: any;
- @Input() dialogState: number;
- @Input() currentRoleFunctions: any;
- @Input() editRoleFunction: RoleFunction;
- @Output() passBackRoleFunctionPopup: EventEmitter<any> = new EventEmitter();
- roleFunction: RoleFunction;
- otherTypeValue: string;
- typeOptions: string[] = ['menu', 'url', 'other'];
- api = '';
- isEditing: any;
- editDisable: boolean;
- showSpinner: boolean;
- selectedType: string;
- createOrUpdate: string;
- constructor(public adminService: AdminService, public activeModal: NgbActiveModal, public ngbModal: NgbModal, public http: HttpClient) { }
-
- ngOnInit() {
- this.createOrUpdate = 'create';
- this.selectedType = 'menu';
- this.roleFunction = new RoleFunction(this.selectedType, '', '*', '');
- this.otherTypeValue = '';
- if (this.editRoleFunction) {
- this.createOrUpdate = 'update';
- this.editDisable = true;
- if (this.editRoleFunction.type !== 'menu' && this.editRoleFunction.type !== 'url') {
- this.selectedType = 'other';
- this.otherTypeValue = this.editRoleFunction.type;
- }else{
- this.selectedType = this.editRoleFunction.type;
- }
- this.roleFunction = new RoleFunction(this.editRoleFunction.type, this.editRoleFunction.code, this.editRoleFunction.action, this.editRoleFunction.name);
- }
- }
-
- saveRoleFunction() {
- if (/[^a-zA-Z0-9\-\.\_]/.test(this.roleFunction.type)) {
- this.openConfirmationModal('Confirmation', 'Type can only contain alphanumeric characters, dots(.) and underscores(_)');
- return;
- }
- if (this.roleFunction.action !== '*' && /[^a-zA-Z0-9\-\.\_]/.test(this.roleFunction.action)) {
- this.openConfirmationModal('Confirmation', 'Action can only contain alphanumeric characters, hyphens(-), dots(.) and underscores(_) and single asterisk character(*)');
- return;
- }
- if (/[^a-zA-Z0-9\-\:\_\./*]/.test(this.roleFunction.code)) {
- this.openConfirmationModal('Confirmation', 'Instance can only contain alphanumeric characters, hyphens(-), dots(.), colons(:), forwardSlash(/) , asterisk(*) and underscores(_)');
- return;
- }
- const modalInfoRef = this.ngbModal.open(InformationModalComponent);
- modalInfoRef.componentInstance.title = 'Confirmation';
- modalInfoRef.componentInstance.message = 'You are about to ' + this.createOrUpdate + ' the role function ' + this.roleFunction.name + '. Do you want to continue?';
- modalInfoRef.result.then((_res) => {
- if (_res === 'Ok') {
- this.showSpinner = true;
- var exists = false, x;
- for (x in this.currentRoleFunctions) {
- if (this.currentRoleFunctions[x].type == this.roleFunction.type
- && this.currentRoleFunctions[x].code == this.roleFunction.code
- && this.currentRoleFunctions[x].action == this.roleFunction.action
- && this.currentRoleFunctions[x].name == this.roleFunction.name) {
- this.openConfirmationModal('Confirmation', "Role Function already exist.");
- exists = true;
- this.showSpinner = false;
- break;
- }
- if (!this.editDisable) {
- if (this.currentRoleFunctions[x].type == this.roleFunction.type
- && this.currentRoleFunctions[x].code == this.roleFunction.code
- && this.currentRoleFunctions[x].action == this.roleFunction.action
- ) {
- this.openConfirmationModal('Confirmation', "Please make sure code, type and action is unique. Please create a role function with a different code or type or action to proceed.");
- exists = true;
- this.showSpinner = false;
- break;
- }
- }
- }
-
- if (this.selectedType === 'other'){
- this.roleFunction.type = this.otherTypeValue;
- }else{
- this.roleFunction.type = this.selectedType;
- }
-
- if (!exists && this.roleFunction.name.trim() != '' && this.roleFunction.code.trim() != '') {
- var postData = this.roleFunction;
- //console.log("saveRoleFunction post data :: ",postData);
- this.adminService.saveRoleFunction(JSON.stringify(postData))
- .subscribe(_data => {
- this.showSpinner = false;
- //console.log("saveRoleFunction response",_data);
- if (this.editRoleFunction) {
- this.editRoleFunction.name = this.roleFunction.name;
- this.passBackRoleFunctionPopup.emit(this.editRoleFunction);
- } else{
- this.passBackRoleFunctionPopup.emit(this.roleFunction);
- }
- if (this.editRoleFunction) {
- this.openConfirmationModal('Success', "Role function updated successfully.");
- }else{
- this.openConfirmationModal('Success', "Role function created successfully.");
- }
- }, error =>{
- //console.log(error);
- this.showSpinner = false;
- this.openConfirmationModal('Error', error.message);
- });
- }
- }
- }, (_dismiss) => {
-
- })
- }
-
-
- openConfirmationModal(_title: string, _message: string) {
- const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent);
- modalInfoRef.componentInstance.title = _title;
- modalInfoRef.componentInstance.message = _message;
- }
-
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-function.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-function.ts
deleted file mode 100644
index 9a00995b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-function.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-export class RoleFunction {
- type: string;
- code: string;
- action: string;
- name: string;
-
- //constructor
- constructor(type: string, code: string, action: string, name: string) {
- this.type = type;
- this.code = code;
- this.action = action;
- this.name = name;
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.html
deleted file mode 100644
index 460f69b3..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
- -->
-
-
-<div class="main-container">
- <div class="role-function-title">
- <h3 class="heading-page" id="roleFunction"> Role Functions </h3>
- <span class= "heading-small" *ngIf="isAppCentralized=='true'"><b>Please go to portal to Manage Role Function.</b></span>
- </div>
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
-
- <rdp-data-table [data]="tableData" [settings]="settings"></rdp-data-table>
-</div>
- \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.scss
deleted file mode 100644
index 7379b988..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-table {
- width: 100%;
-}
-
-td, th {
- width: 25%;
-}
-
-td[_ngcontent-c4], th[_ngcontent-c4] {
- width: 15%;
-}
-
-.icon-trash{
- cursor: pointer;
-}
-
-::ng-deep .mat-form-field-infix {
- width: 250px;
- margin-left: 10px;
-} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts
deleted file mode 100644
index 9cb908dd..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- * Modification Copyright © 2020 IBM.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
-
-import { RoleFunctionsComponent } from './role-functions.component';
-import { CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { RdpModule } from 'portalsdk-tag-lib';
-import { FormsModule} from '@angular/forms';
-import { UserService } from 'src/app/shared/services/user/user.service';
-import { AdminService } from '../admin.service';
-import { MatSelectModule} from '@angular/material';
-import { Observable } from 'rxjs';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-
-describe('RoleFunctionsComponent', () => {
- let component: RoleFunctionsComponent;
- let fixture: ComponentFixture<RoleFunctionsComponent>;
- let userService:UserService;
- let adminService:AdminService;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- declarations: [ RoleFunctionsComponent ],
- imports: [HttpClientTestingModule,BrowserAnimationsModule,
- RdpModule,
- FormsModule,
- ],
- providers:[MatSelectModule]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers:[AdminService]
- })
- fixture = TestBed.createComponent(RoleFunctionsComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- userService=TestBed.get(UserService);
- adminService=TestBed.get(AdminService);
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-
- describe('test for subscribe in ngOnInit',()=>{
- it('should test ngOnInit method',()=>{
- let spy=spyOn(userService,'getFunctionalMenuStaticDetailSession').and.returnValue(Observable.of('you object'));
- component.ngOnInit();
- expect(spy).toHaveBeenCalled();
- })
- })
- it('Admin service injection check', inject([AdminService],(injectService:AdminService) =>{
- expect(injectService).toBe(adminService);
- }));
-
-
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.ts
deleted file mode 100644
index 118225d2..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Component, OnInit, Directive, Input, Output, EventEmitter, ViewChildren, QueryList, PipeTransform, ViewChild } from '@angular/core';
-import { AdminService } from '../admin.service';
-import {UserService} from '../../../shared/services/user/user.service'
-import { User } from 'src/app/shared/services/user/user';
-import { of, Observable } from 'rxjs';
-import { RoleFunction } from './role-function';
-import { MatTableDataSource } from '@angular/material/table';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
-import { NewRoleFunctionComponent } from './new-role-function/new-role-function.component';
-import { Column, DataTableSettings, ColumnTypes } from 'portalsdk-tag-lib';
-import { RoleFunctionsService } from './role-functions.service';
-
-@Component({
- selector: 'app-role-functions',
- templateUrl: './role-functions.component.html',
- styleUrls: ['./role-functions.component.scss']
-})
-export class RoleFunctionsComponent implements OnInit {
-
- tableData: Array<RoleFunction> = [];
- response: any;
- result: any;
- function: RoleFunction;
- isEditMode: boolean = false;
- availableRoleFunctions: any;
- showSpinner: boolean;
-
- isAppCentralized: any;
- user: User;
- closeResult: string;
-
- roleFunctionHeaders = ["name", "code", "type", "action", "edit", "delete"];
- dataSource: MatTableDataSource<RoleFunction>;
-
- constructor(public adminService: AdminService,
- public userService: UserService,
- private ngModal: NgbModal,
- private roleFunctionService: RoleFunctionsService) { }
-
- @ViewChild(MatPaginator, {}) paginator: MatPaginator;
- @ViewChild(MatSort, {}) sort: MatSort;
-
- public settings;
- public columns: any = [];
- typeOptions: string[] = ['menu', 'url', 'other'];
-
- ngOnInit() {
- this.showSpinner = false;
- this.availableRoleFunctions = [];
- this.getRoleFunctions();
- let result = this.userService.getFunctionalMenuStaticDetailSession();
- result.subscribe(user => {
- this.user = user;
- this.isAppCentralized = this.user.isAppCentralized;
- });
- }
-
- getRoleFunctions() {
- this.showSpinner = true;
- let response;
- this.response = this.adminService.getRoleFunctionList();
- this.response.subscribe(data => {
- response = data;
- this.result = JSON.parse(response.data);
- this.availableRoleFunctions = this.result.availableRoleFunctions;
- this.tableData = JSON.parse(this.result.availableRoleFunctions);
- //console.log("Table data : ", this.tableData);
- this.columns.push(new Column("name", "Name", ColumnTypes.TEXT, true, null));
- this.columns.push(new Column("code", "Code", ColumnTypes.TEXT, true, null));
- this.columns.push(new Column("type", "Type", ColumnTypes.RADIO, true, this.typeOptions));
- this.columns.push(new Column("action", "Action", ColumnTypes.TEXT, true, null));
-
- this.settings = new DataTableSettings()
- this.settings.columns = this.columns;
- this.settings.isPaginationEnabled = true;
- this.settings.paginationsSize = "5";
- this.settings.isReadOnly = false;
- this.settings.isTableSearchEnabled = true;
- this.settings.applicationService = this.roleFunctionService;
- this.showSpinner = false;
-
- });
-
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.module.ts
deleted file mode 100644
index 3406f5bd..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.module.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { RoleFunctionsComponent } from './role-functions.component';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { MatFormFieldModule } from '@angular/material/form-field';
-import { MatTooltipModule } from '@angular/material/tooltip';
-
-@NgModule({
- declarations: [RoleFunctionsComponent],
- imports: [
- CommonModule,FormsModule,ReactiveFormsModule,MatFormFieldModule,MatTooltipModule
- ],
- exports: [RoleFunctionsComponent],
- bootstrap: [RoleFunctionsComponent]
-})
-export class RoleFunctionsModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.service.ts
deleted file mode 100644
index bd44a63d..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.service.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { Injectable } from '@angular/core';
-import { RdpCrudInterface } from 'portalsdk-tag-lib';
-import { AdminService } from '../admin.service';
-import { BehaviorSubject } from 'rxjs';
-
-@Injectable({
- providedIn: 'root'
-})
-export class RoleFunctionsService implements RdpCrudInterface {
-
- public statusResponse = new BehaviorSubject("");
- public updatedData = new BehaviorSubject<any>({});
-
- loadTableData(filter: any, sortActive: any, sortDirection: any, pageIndex: any, pageSize: any): import("rxjs").Observable<any[]> {
- throw new Error("Method not implemented.");
- }
- getTotalRowCount() {
- throw new Error("Method not implemented.");
- }
-
- constructor(private adminService: AdminService) { }
-
- add(data: any) {
- //console.log("Add method is getting called from RoleFunctionService data:: ", data);
- }
-
-
- update(data: any): any {
- console.log("Update method is getting called from RoleFunctionService data:: ", data);
- return this.adminService.saveRoleFunction(data).subscribe(response => {
- //console.log("Success Response ", response);
- this.statusResponse.next("200");
- }, error => {
- console.log("Error ", error);
- })
- }
-
- delete(data: any) {
- //console.log("Delete method is getting called from RoleFunctionService data::>> " + JSON.stringify(data));
- this.adminService.deleteRoleFunction(data).subscribe(response => {
- //console.log("Repsonse : ", response);
- this.statusResponse.next("200");
-
- })
- }
-
- get() {
- let response = this.adminService.getRoleFunctionList();
- let editedData;
- response.subscribe(res => {
- editedData = res;
- let data = JSON.parse(JSON.parse(editedData.data).availableRoleFunctions);
- //console.log("Get Method called : ", data);
- this.updatedData.next(data);
- })
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.html
deleted file mode 100644
index f3a7f8ea..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
- -->
-<div class="container">
- <!--Modal Headers-->
- <div class="modal-header">
- <h4 class="modal-title">Role</h4>
- <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
- <span aria-hidden="true">&times;</span>
- </button>
- </div>
-
- <!--Modal Body goes here-->
- <div class="modal-body">
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
- <div class="role-properties-main">
- <form id="role-details-form" name="roleDetails" novalidate autocomplete="off" method="post">
- <div class="elementsDiv">
- <div class="item required role-name">
- <div class="item-label">Name :</div>
- <input id="role-details-input-name" class="table-search-field"
- type="text" name="rolename"
- [(ngModel)]="role.name"
- ng-pattern="/^[\w -]*$/" maxlength="100" required />
- </div>
- <div>
- <div class="item-label">Priority :</div>
- <input id="role-details-input-priority" class="table-search-field"
- type="text"
- ng-change="accountAddDetails.updateUsername()" name="priority"
- [(ngModel)]="role.priority"/>
- </div>
- </div>
- </form>
- </div>
-
- <!-- Role Functions List-->
- <div *ngIf="isEditMode" class="role-functions-title">Role Functions</div>
- <div *ngIf="isEditMode" class="rolefunctionTable">
- <table mat-table [dataSource]="roleFunctionDataSource">
- <ng-container matColumnDef="roleFunctionName">
- <th mat-header-cell *matHeaderCellDef id="heading1">Function Name</th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.name}} </td>
- </ng-container>
-
- <!--<ng-container matColumnDef="remove">
- <th mat-header-cell *matHeaderCellDef id="heading1">Remove</th>
- <td id="rowheader_t1_{{i}}" mat-cell *matCellDef="let rowData; let i=index;">
- <span class="icon-trash" id="{{i}}-button-role-remove" (click)="delRoleFunctionConfirmPopUp(rowData,role.id)">
- <i class="icon ion-md-trash"></i>
- </span>
- </td>
- </ng-container>-->
-
- <!-- Active Column -->
- <ng-container matColumnDef="active">
- <th id="col3" mat-header-cell *matHeaderCellDef>Active ?</th>
- <td id="rowheader_t1_{{i}}-userId" mat-cell *matCellDef="let element; let i=index;">
- <mat-slide-toggle [(ngModel)]="element.selected" (change)="toggleRoleFunction(element)"></mat-slide-toggle>
- </td>
- </ng-container>
-
- <tr mat-header-row *matHeaderRowDef="roleFunctionTableHeaders"></tr>
- <tr mat-row *matRowDef="let rowData; columns: roleFunctionTableHeaders;">
- </table>
- </div>
- </div>
- <!--Modal Footer goes Here-->
- <div class="modal-footer">
- <button type="button" class="btn btn-primary" (click)="saveChanges()">Save</button> &nbsp;
- <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
- </div>
-</div>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.scss
deleted file mode 100644
index 972094c7..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.scss
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
- ::ng-deep .modal-dialog {
- max-width: 700px;
- width: 700px;
- overflow-x: auto;
- overflow-y: auto;
-}
-
-::ng-deep .mat-column-roleFunctionName {
- width: 38em !important;
-}
-
-
-.role-properties-main input[type="text"] {
- width: 18em;
-}
-
-.role-properties-main .role-name{
- margin-right: 35px;
-}
-
-.elementsDiv{
- display: inline-flex;
-}
-
-.role-functions-title{
- margin-top: 2em;
-}
-
-.manageRoleFunction{
- margin-top: 2em;
-}
-
-.rolefunctionTable{
- overflow-y: auto;
- height: 440px;
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.spec.ts
deleted file mode 100644
index 4b496f1b..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.spec.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- * Modification Copyright © 2020 IBM.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import {FormsModule} from '@angular/forms';
-import { NewRoleComponent } from './new-role.component';
-import { MatTableModule } from '@angular/material'
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { HttpClient, HttpClientModule } from '@angular/common/http';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-
-describe('NewRoleComponent', () => {
- let component: NewRoleComponent;
- let fixture: ComponentFixture<NewRoleComponent>;
- let role1 = "";
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- providers: [NgbActiveModal],
- schemas: [CUSTOM_ELEMENTS_SCHEMA] ,
- declarations: [ NewRoleComponent ],
- imports: [FormsModule, MatTableModule, HttpClientTestingModule]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(NewRoleComponent);
- component = fixture.componentInstance;
- component.role = role1;
- fixture.detectChanges();
- });
-
- // it('should create', () => {
- // expect(component).toBeTruthy();
- // });
-}); \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.ts
deleted file mode 100644
index 6b1470fa..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/new-role/new-role.component.ts
+++ /dev/null
@@ -1,250 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { AdminService } from '../../admin.service';
-import { UserService } from 'src/app/shared/services/user/user.service';
-import { MatSort } from '@angular/material/sort';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatTableDataSource } from '@angular/material';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
-
-
-@Component({
- selector: 'app-new-role',
- templateUrl: './new-role.component.html',
- styleUrls: ['./new-role.component.scss']
-})
-export class NewRoleComponent implements OnInit {
-
- showSpinner: boolean;
- result: any;
- @Input() role: any;
- @Input() isEditMode: boolean;
- @Input() availableRoles : any;
- @Input() ociavailableRoleFunctions: any;
- roleFunctionTableHeaders: Array<string> = [];
- roleFunctions: Array<Object> = [];
- roleFunctionsLenght: any;
- finalSelectedRoleFunctions: any;
- availableRoleFunctions: any;
- @Output() passEntry: EventEmitter<any> = new EventEmitter();
- @ViewChild(MatPaginator, {}) paginator: MatPaginator;
- @ViewChild(MatSort, {}) sort: MatSort;
- roleFunctionDataSource = new MatTableDataSource(this.roleFunctions);
-
- constructor(public adminService:AdminService, public userService: UserService, public activeModal: NgbActiveModal, public ngbModal: NgbModal) { }
-
- ngOnInit() {
- this.roleFunctionTableHeaders = ["roleFunctionName","active"];
- this.finalSelectedRoleFunctions = [];
- this.availableRoleFunctions = [];
- if(this.isEditMode && this.ociavailableRoleFunctions && this.ociavailableRoleFunctions.length > 0){
- this.availableRoleFunctions = this.setSelectedRoleFucntions(this.ociavailableRoleFunctions);
- this.populateTableData(this.availableRoleFunctions)
- }
- }
-
- setSelectedRoleFucntions(ociavailableRoleFunctions: any) {
- for (var i = 0; i < this.ociavailableRoleFunctions.length; i++) {
- var availableRoleFunction = this.ociavailableRoleFunctions[i];
- availableRoleFunction['selected'] = false;
- for (var j = 0; j < this.role.roleFunctions.length; j++) {
- if (availableRoleFunction.code === this.role.roleFunctions[j].code
- && availableRoleFunction.type === this.role.roleFunctions[j].type
- && availableRoleFunction.action === this.role.roleFunctions[j].action) {
- availableRoleFunction.selected = true;
- }
- }
- this.availableRoleFunctions.push(availableRoleFunction);
- }
- return this.availableRoleFunctions;
- }
-
-
- toggleRoleFunction(_element) {
- if (this.ociavailableRoleFunctions) {
- for (var i = 0; i < this.ociavailableRoleFunctions.length; i++) {
- var availableRoleFunction = this.ociavailableRoleFunctions[i];
- if (availableRoleFunction.selected && !this.finalSelectedRoleFunctions.includes(availableRoleFunction)) {
- this.finalSelectedRoleFunctions.push(availableRoleFunction);
- }
- }
- }
- if (!_element.selected) {
- for (var i = 0; i < this.finalSelectedRoleFunctions.length; i++) {
- var availableRoleFunction = this.finalSelectedRoleFunctions[i];
- if (availableRoleFunction.code == _element.code
- && availableRoleFunction.type == _element.type
- && availableRoleFunction.action == _element.action) {
- this.finalSelectedRoleFunctions.splice(i, 1);
- }
- }
- }
- }
-
- delRoleFunctionConfirmPopUp(roleFunction: any, roleId: any){
- const modalRef = this.ngbModal.open(InformationModalComponent);
- modalRef.componentInstance.title = "Confirmation";
- modalRef.componentInstance.message = 'You are about to delete this Role Function : ' + roleFunction.name+ '. Click OK to continue.';
- modalRef.result.then((result) => {
- if (result === 'Ok') {
- let temproleFunctions = this.role.roleFunctions;
- let index = 0;
- for(let i=0; i<temproleFunctions.length; i++){
- if(temproleFunctions[i].code == roleFunction.code){
- break;
- }
- index = index + 1;
- };
- temproleFunctions.splice(index,1);
- this.populateTableData(temproleFunctions);
- this.adminService.removeRoleFunction(roleFunction , roleId)
- .subscribe(_data => {
- this.result = _data
- this.passEntry.emit(this.result);
- }, error =>{
- this.openConfirmationModal('Error', error.message);
- });
- }
- }, (resut) => {
- this.openConfirmationModal('Error', resut);
- return;
- })
- }
-
- populateTableData(roleFunctionsList: any){
- this.roleFunctionDataSource = new MatTableDataSource(roleFunctionsList);
- this.roleFunctionDataSource.sort = this.sort;
- this.roleFunctionDataSource.paginator = this.paginator;
- }
-
- //Add Or Update Account.
- saveChanges(){
- if(this.isEditMode){
- if (this.role.priority && this.role.priority != '' && isNaN(parseInt(this.role.priority))) {
- let errorMsg = 'Priority must be an integer.';
- this.openConfirmationModal('Error', errorMsg);
- }
- //update the role object
- this.showSpinner = true
- this.role.roleFunctions = this.finalSelectedRoleFunctions;
- let postData={
- role: this.role,
- childRoles: this.role.childRoles,
- roleFunctions : this.role.roleFunctions
- };
- this.adminService.saveRole(postData, this.role.id)
- .subscribe(_data => {
- this.showSpinner = false;
- this.result = _data
- this.passEntry.emit(this.result);
- this.ngbModal.dismissAll();
- }, error =>{
- this.openConfirmationModal('Error', error.message);
- });
- }else{
- //create new Role Object
- if (this.role.priority && this.role.priority != '' && isNaN(parseInt(this.role.priority))) {
- let errorMsg = 'Priority must be an integer.';
- this.openConfirmationModal('Error', errorMsg);
- }
- let newRoleObj = {
- 'id':null,
- 'created':null,
- 'modified':null,
- 'createdId':null,
- 'modifiedId':null,
- 'rowNum':null,
- 'auditUserId':null,
- 'auditTrail':null,
- 'name':this.role.name,
- 'active':true,
- 'priority':this.role.priority,
- 'roleFunctions':null,
- 'childRoles':null,
- 'toggleActiveAltText':"Click to Activate Role ",
- 'toggleActiveImage':" / static fusion images inactive.png ",
- 'editUrl':" role.htm ? role_id = null",
- };
- if(this.isRoleAlreadyExist(this.role.name)){
- //msg Role already exit
- let errorMsg = "Role Name " + this.role.name +" is already present."
- this.openConfirmationModal('Error', errorMsg);
- }else{
- this.showSpinner = true
- newRoleObj.childRoles = [];
- newRoleObj.roleFunctions = [];
- let postData={
- role: newRoleObj,
- childRoles: newRoleObj.childRoles,
- roleFunctions : newRoleObj.roleFunctions
- };
- this.adminService.saveRole(postData, newRoleObj.id)
- .subscribe(_data => {
- this.showSpinner = false;
- this.result = _data
- this.passEntry.emit(this.result);
- this.ngbModal.dismissAll();
- }, error =>{
- this.openConfirmationModal('Error', error.message);
- });
- }
- }
- }
-
- isRoleAlreadyExist(currentRoleName: any){
- let roles = this.availableRoles;
- if(roles && roles.length > 0){
- for(let i=0; i<roles.length; i++){
- if(roles[i].name === currentRoleName){
- return true;
- }
- }
- }
- return false;
- }
-
- openConfirmationModal(_title: string, _message: string) {
- const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent);
- modalInfoRef.componentInstance.title = _title;
- modalInfoRef.componentInstance.message = _message;
- }
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.html
deleted file mode 100644
index 6266ee72..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
- -->
-
-<div class="main-container">
- <div id="page-content">
- <div class="ecomp-main-view-title">
- <h3 class="heading-page">Roles</h3>
- <span class= "heading-small" *ngIf="isAppCentralized=='true'"><b>Please go to portal to Manage Roles.</b></span>
- </div>
-
- <button type="button" *ngIf="isAppCentralized=='false'" class="btn btn-primary new-role-button" (click)="openAddNewRoleModal('')">
- <i class="icon ion-md-person-add"></i>Add New Role
- </button>
-
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
-
- <div class="role-search">
- <mat-form-field>
- <input matInput type="text" (keyup)="applyFilter($event.target.value)" placeholder="Search in entire table">
- </mat-form-field>
- </div>
-
- <table mat-table [dataSource]="dataSource" matSort>
- <ng-container matColumnDef="name">
- <th mat-header-cell *matHeaderCellDef mat-sort-header id="heading1"> Name</th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.name}} </td>
- </ng-container>
-
- <ng-container matColumnDef="priority">
- <th mat-header-cell *matHeaderCellDef id="heading2"> Priority</th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.priority}} </td>
- </ng-container>
-
- <ng-container matColumnDef="Edit">
- <th mat-header-cell *matHeaderCellDef id="heading3">{{roleHeaders[2]}} </th>
- <td id="rowheader_t1_{{i}}" mat-cell *matCellDef="let rowData; let i=index;">
- <span class="icon-trash" id="{{i}}-button-role-edit"
- (click)="openAddNewRoleModal(rowData)">
- <i class="ion ion-md-create"></i>
- </span>
- </td>
- </ng-container>
-
- <ng-container matColumnDef="Active?">
- <th mat-header-cell *matHeaderCellDef id="heading4"> {{roleHeaders[3]}} </th>
- <td mat-cell *matCellDef="let rowData">
- <mat-slide-toggle [(ngModel)]="rowData.active" (change)="toggleRole(rowData)"></mat-slide-toggle>
- </td>
- </ng-container>
-
- <ng-container matColumnDef="Delete?">
- <th mat-header-cell *matHeaderCellDef id="heading6"> {{roleHeaders[4]}} </th>
- <td id="rowheader_t1_{{i}}" mat-cell *matCellDef="let rowData; let i=index;">
- <span class="icon-trash" id="{{i}}-button-role-remove"
- (click)="delRoleConfirmPopUp(rowData)">
- <i class="icon ion-md-trash"></i>
- </span>
- </td>
- </ng-container>
- <tr mat-header-row *matHeaderRowDef="roleHeaders"></tr>
- <tr mat-row *matRowDef="let rowData; columns: roleHeaders;">
- </table>
- <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
- <span class="ecomp-spinner" *ngIf="showSpinner"></span>
- <div>
- <a (click)="getFunctions()" id="functions-link">Manage Role Functions</a><br><br>
- </div>
- </div>
-</div> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.scss
deleted file mode 100644
index a87fb896..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.scss
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
-table {
- width: 100%;
- }
-
- .mat-form-field {
- font-size: 14px;
- width: 100%;
- }
-
- td, th {
- width: 25%;
- }
- .mat-form-field[_ngcontent-c4] {
- font-size: 14px;
- width: 20%;
- float: right;
- }
-
- /*td.mat-cell, td.mat-footer-cell{
- padding: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- border-right-style: solid;
- border-right-color: rgba(0,0,0,.12);
- border-right-width: 1px;
- }
-*/
-
-td[_ngcontent-c4], th[_ngcontent-c4] {
- width: 15%;
-}
-
-.example-h2 {
- margin: 10px;
-}
-
-.example-section {
- display: flex;
- align-content: center;
- align-items: center;
- height: 60px;
-}
-
-.example-margin {
- margin: 10px;
-}
-body {
- font-family: Roboto, Arial, sans-serif;
- margin: 0;
-}
-
-.basic-container {
- padding: 30px;
-}
-
-.version-info {
- font-size: 8pt;
- float: right;
-}
-
-.icon-trash{
- cursor: pointer;
-}
-
-.new-role-button{
- margin-left: 15px;
- float: right;
-}
-#functions-link{
- cursor: pointer; text-decoration: underline; color: #007bff;
-} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts
deleted file mode 100644
index 16c81cc5..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Modification Copyright © 2020 IBM.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { RolesComponent } from './roles.component';
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { MatTableModule } from '@angular/material';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { UserService } from 'src/app/shared/services/user/user.service';
-import { Observable } from 'rxjs';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-
-describe('RolesComponent', () => {
- let component: RolesComponent;
- let fixture: ComponentFixture<RolesComponent>;
- let userService: UserService;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- declarations: [
- RolesComponent,
- InformationModalComponent,
- ],
- imports:[
- MatTableModule,
- HttpClientTestingModule,
- NgbModule.forRoot(),
- RouterTestingModule
- ]
- })
- TestBed.overrideModule(BrowserDynamicTestingModule,{
- set:{
- entryComponents:[InformationModalComponent]
- }
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(RolesComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- userService=TestBed.get(UserService);
- });
-
- it('should test subscribe inside ngOnInit method',()=>{
- let spy=spyOn(userService,'getFunctionalMenuStaticDetailSession').and.returnValue(Observable.of('your data'))
- component.ngOnInit();
- expect(spy).toHaveBeenCalled();
- })
-
- it('should test delRoleConfirmPopUp method',()=>{
- component.delRoleConfirmPopUp('dummyargument');
-
- })
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.ts
deleted file mode 100644
index 8032aa18..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.ts
+++ /dev/null
@@ -1,216 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-import { Component, OnInit, ViewChild } from '@angular/core';
-import { AdminService } from '../admin.service';
-import { MatTableDataSource } from '@angular/material/table';
-import { MatSort } from '@angular/material/sort';
-import { MatPaginator } from '@angular/material/paginator';
-import { User } from 'src/app/shared/services/user/user';
-import { UserService } from 'src/app/shared/services/user/user.service';
-import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
-import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
-import { NewRoleComponent } from './new-role/new-role.component';
-import { Router } from '@angular/router';
-
-
-@Component({
- selector: 'app-roles',
- templateUrl: './roles.component.html',
- styleUrls: ['./roles.component.scss']
-})
-export class RolesComponent implements OnInit {
- tableData: Array<object> = [];
- roleHeaders: Array<string> = [];
- constructor(public adminService:AdminService,public userService: UserService,private ngbModal: NgbModal,private _router: Router) { }
- roleId;
- response:any;
- result:any;
- roleInfo:any;
- roleData:any;
- ociavailableRoleFunctions;
- availableRoleFunctions;
- availableRoles;
- dataSource: MatTableDataSource<[]>;
- user:User;
- isAppCentralized;
- closeResult: string;
- isEditMode: boolean = false;
- showSpinner:boolean;
-
- @ViewChild(MatPaginator, {}) paginator: MatPaginator;
- @ViewChild(MatSort, {}) sort: MatSort;
-
-
- ngOnInit() {
- this.roleHeaders = ["name","priority","Edit","Active?","Delete?"];
- this.showSpinner = false;
- this.roleId=undefined;
- this.getRole(this.roleId);
- let result = this.userService.getFunctionalMenuStaticDetailSession();
- let user;
- result.subscribe(user => {
- this.user = user;
- this.isAppCentralized = this.user.isAppCentralized;
- });
- }
-
- getRole(roleId:any){
- this.showSpinner = true;
- this.response = this.adminService.getRole(roleId);
- this.response.subscribe(data => {
- this.result = data;
- this.roleInfo = JSON.parse(this.result.data);
- this.roleData =JSON.parse(this.roleInfo.role);
- this.ociavailableRoleFunctions =JSON.parse(this.roleInfo.availableRoleFunctions);
- this.availableRoleFunctions=[];
- for( let availableFun of this.ociavailableRoleFunctions){
- let availableRoleFunction = availableFun;
- availableRoleFunction.selected = false;
- for( let availableFunc of this.roleData.roleFunctions){
- if(availableFun.code === availableFunc.code){
- availableRoleFunction.selected = true;
- }
- }
- this.availableRoleFunctions.push(availableRoleFunction);
- }
- this.availableRoles=JSON.parse(this.roleInfo.availableRoles);
- this.dataSource = new MatTableDataSource(this.availableRoles);
- this.dataSource.paginator = this.paginator;
- this.dataSource.sort = this.sort;
- this.showSpinner = false;
- });
- }
-
- delRoleConfirmPopUp(item: any) {
- const modalRef = this.ngbModal.open(InformationModalComponent);
- modalRef.componentInstance.title = 'Confirmation';
- let response;
- modalRef.componentInstance.message = `Are you sure you want to delete ${item.name} ?`;
- modalRef.result.then((result) => {
- if (result === 'Ok') {
- this.adminService.deleteRole(item).subscribe(data => {
- this.showSpinner = true;
- response = data;
- this.availableRoles = response.availableRoles;
- this.dataSource = new MatTableDataSource(this.availableRoles);
- this.dataSource.paginator = this.paginator;
- this.dataSource.sort = this.sort;
- this.showSpinner = false;
- })
- }
- }, (reason) => {
- this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
- });
- }
-
- private getDismissReason(reason: any): string {
- if (reason === ModalDismissReasons.ESC) {
- return 'by pressing ESC';
- } else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
- return 'by clicking on a backdrop';
- } else {
- return `with: ${reason}`;
- }
-
- }
-
- /**
- * openAddNewRoleModal
- * @param rowData
- */
- openAddNewRoleModal(rowData: any){
- const modalRef = this.ngbModal.open(NewRoleComponent, { size: 'lg' });
- modalRef.componentInstance.title = 'Role Details';
- modalRef.componentInstance.availableRoles = this.availableRoles;
- modalRef.componentInstance.ociavailableRoleFunctions = this.ociavailableRoleFunctions;
- if(rowData != 'undefined' && rowData){
- modalRef.componentInstance.role = rowData;
- this.isEditMode = true;
- modalRef.componentInstance.isEditMode = true;
- }else{
- modalRef.componentInstance.role = {};
- this.isEditMode = false;
- modalRef.componentInstance.isEditMode = false;
- }
- modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => {
- if(receivedEntry){
- this.availableRoles = [];
- this.getRole(this.roleId);
- }
- });
- }
-
- toggleRole(_element) {
- let activeOrInactive = (_element.active) ? 'activate' : 'inactivate';
- const modalInfoRef = this.ngbModal.open(InformationModalComponent);
- modalInfoRef.componentInstance.title = 'Confirmation';
- modalInfoRef.componentInstance.message = 'You are about to ' + activeOrInactive + ' the role ' + _element.name + '. Do you want to continue?';
- modalInfoRef.result.then((_res) => {
- if (_res === 'Ok') {
- this.showSpinner = true;
- let postData={
- role: _element,
- childRoles: _element.childRoles,
- roleFunctions : _element.roleFunctions
- };
- this.adminService.saveRole(postData, _element.id)
- .subscribe( _data => {
- this.showSpinner = false;
- }, (response) => {
- _element.active = !_element.active;
- const modalErrorRef = this.ngbModal.open(InformationModalComponent);
- modalErrorRef.componentInstance.title = 'Error';
- modalErrorRef.componentInstance.message = 'Error while saving. ' + response.restCallStatus;
- });
- } else {
- _element.active = !_element.active;
- }
-
- }, (result) => {
-
- })
- }
-
- applyFilter(filterValue: string) {
- this.dataSource.filter = filterValue.trim().toLowerCase();
- }
-
- getFunctions() {
- this._router.navigate(['v2/admin/role_function_list']);
-}
-} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.module.ts
deleted file mode 100644
index cf3547a3..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.module.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { RolesComponent } from './roles.component';
-
-@NgModule({
- declarations: [RolesComponent],
- imports: [
- CommonModule
- ]
-})
-export class RolesModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.html
deleted file mode 100644
index 402d5e0a..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- ============LICENSE_START==========================================
- ONAP Portal SDK
- ===================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- ===================================================================
-
- Unless otherwise specified, all software contained herein is licensed
- under the Apache License, Version 2.0 (the "License");
- 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
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Unless otherwise specified, all documentation contained herein is licensed
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- you may not use this documentation except in compliance with the License.
- You may obtain a copy of the License at
-
- https://creativecommons.org/licenses/by/4.0/
-
- Unless required by applicable law or agreed to in writing, documentation
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ============LICENSE_END============================================
-
--->
-
-<div class="container">
- <div id="page-content">
- <div>
- <h1 class="heading-page" id="Usage">Current Usage</h1>
- </div>
- <h4 class="heading-small">
- The following table shows all current user sessions. Click the icon to end a user's session.
- </h4>
- <!-- RDP datatable -->
- <rdp-data-table [data]="users" [settings]="settings"></rdp-data-table>
- </div>
-</div> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.scss
deleted file mode 100644
index 7dd0a4ec..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.scss
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-table {
- width: 100%;
- }
-
- .mat-form-field {
- font-size: 14px;
- width: 100%;
- }
-
- td, th {
- width: 25%;
- }
- .mat-form-field[_ngcontent-c4] {
- font-size: 14px;
- width: 20%;
- float: right;
- }
-td[_ngcontent-c4], th[_ngcontent-c4] {
- width: 15%;
-} \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.spec.ts
deleted file mode 100644
index 01f31669..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.spec.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Modification Copyright © 2020 IBM.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { UsageComponent } from './usage.component';
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-
-describe('UsageComponent', () => {
- let component: UsageComponent;
- let fixture: ComponentFixture<UsageComponent>;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ UsageComponent ],
- schemas:[CUSTOM_ELEMENTS_SCHEMA],
- imports:[HttpClientTestingModule]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(UsageComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.ts
deleted file mode 100644
index d5121909..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.component.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { Component, OnInit } from '@angular/core';
-import { AdminService } from '../admin.service';
-import { Column, DataTableSettings, ColumnTypes } from 'portalsdk-tag-lib';
-
-@Component({
- selector: 'app-usage',
- templateUrl: './usage.component.html',
- styleUrls: ['./usage.component.scss']
-})
-export class UsageComponent implements OnInit {
-
- response: any;
- result: any;
- users: any;
- public settings;
- public columns: any = [];
-
- constructor(public adminService: AdminService) { }
-
- ngOnInit() {
- this.adminService.getUsageList()
- .subscribe(data => {
- this.response = data;
- this.users = JSON.parse(this.response.data);
- //adding Current Session property to each users
- this.users.forEach(element => {
- Object.assign(element, {"currentSession":"Current Session"});
- });
- this.columns.push(new Column("id", "User Id", ColumnTypes.TEXT, false, null));
- this.columns.push(new Column("lastName", "User Name",ColumnTypes.TEXT, false, null));
- this.columns.push(new Column("email", "Email", ColumnTypes.TEXT, false, null));
- this.columns.push(new Column("lastAccess", " Last Access Time (minutes)", ColumnTypes.TEXT, false, null));
- this.columns.push(new Column("remaining", "Time Remaining (minutes)", ColumnTypes.TEXT, false, null));
- this.columns.push(new Column("currentSession", "Expire User Session?", 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;
- });
- }
-
-}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.module.ts
deleted file mode 100644
index 3c1f1769..00000000
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/usage/usage.module.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
- * 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
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- *
- */
-
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { UsageComponent } from './usage.component';
-
-@NgModule({
- declarations: [UsageComponent],
- imports: [
- CommonModule
- ]
-})
-export class UsageModule { }
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/chart-wizard/chart-wizard.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/chart-wizard/chart-wizard.component.html
index 1c0dc5a2..bc6bf83e 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/chart-wizard/chart-wizard.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/chart-wizard/chart-wizard.component.html
@@ -51,6 +51,7 @@
<mat-form-field>
<mat-label class="b2b-dro">Chart Type:</mat-label>
<mat-select data-select-color="blue" [(ngModel)]="chartJson.chartType" aria-label="reportType" placeholder="Select chart Type">
+ <mat-option value="none">--select--</mat-option>
<mat-option value="BarChart3D" (onSelectionChange)="setBarChartOptions()">Bar Chart</mat-option>
<mat-option value="TimeSeriesChart" (onSelectionChange)="setTimeSeriesChartOptions()">Time Series/Area Chart</mat-option>
<mat-option value="PieChart">Pie Chart</mat-option>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
index 2a8561e6..25f5109c 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
@@ -114,7 +114,7 @@ export class ColumnListComponent implements OnInit {
}
ngOnInit() {
-
+ this.showSpinner = true;
this.displayTable = true;
this._columnService.getColumnList()
.subscribe((response) => {
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.service.ts
index 3cd72584..0c1781bc 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.service.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.service.ts
@@ -12,6 +12,6 @@ export class DashboardReportGridService {
getReportList() : Observable<any>
{
- return this._http.get(environment.baseUrl + "raptor.htm?action=report.search.execute&r_page=0");
+ return this._http.get(environment.baseUrl + "raptor.htm?action=report.search.execute&r_page=0&show_all=true");
}
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.spec.ts
index 762d780f..c5fe0a6c 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.spec.ts
@@ -59,6 +59,7 @@ describe('PilotPageComponent', () => {
it('should test first if condition in saveDefinitionInfo method',()=>{
component.IncomingReportId=-1;
component.reportMode="Create";
+ component.reportTitle='Report';
component.allowScheduler=true;
component.sizedByContent = true;
component.saveDefinitionInfo();
@@ -83,7 +84,7 @@ describe('PilotPageComponent', () => {
expect(component.finalPostObj["dataContainerWidth"]).toEqual(component.widthContainer);
expect(component.finalPostObj["runtimeColSortDisabled"]).toEqual(component.disableColumnSort);
expect(component.finalPostObj["numFormCols"]).toEqual(component.runTimeFormNum);
- expect(component.finalPostObj["reportTitle"]).toEqual(component.reportTitle);
+ expect(component.finalPostObj["reportTitle"]).toEqual('Report');
expect(component.finalPostObj["reportSubTitle"]).toEqual(component.reportSubTitle);
expect(component.finalPostObj["oneTimeRec"]).toEqual(component.oneTime);
expect(component.finalPostObj["hourlyRec"]).toEqual(component.hourly);
@@ -103,6 +104,7 @@ describe('PilotPageComponent', () => {
component.allowScheduler=true;
component.sizedByContent = true;
component.reportType="Dashboard";
+ component.reportTitle='Report';
component.saveDefinitionInfo();
expect(component.finalPostObj["tabName"]).toEqual("Definition");
@@ -123,6 +125,7 @@ describe('PilotPageComponent', () => {
component.IncomingReportId=1;
component.reportMode="Edit";
component.reportType!="dashboard";
+ component.reportTitle='Report';
component.saveDefinitionInfo();
expect(component.finalPostObj["reportTypeList"]).toEqual(null);
expect(component.finalPostObj["dbInfo"]).toEqual(component.dataSrc);
@@ -134,6 +137,7 @@ describe('PilotPageComponent', () => {
component.IncomingReportId=1;
component.reportMode="Edit";
component.showDialog=true;
+ component.reportTitle='Report';
let spy=spyOn(_definitionService,'portDefinitionPageDetails').and.returnValue(Observable.of(''))
component.saveDefinitionInfo();
expect(spy).toHaveBeenCalled()
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.ts
index ccd6dbcb..059c90b5 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/definition/definition.component.ts
@@ -385,7 +385,11 @@ export class DefinitionComponent implements OnInit, OnDestroy {
];
this.finalPostObj['runtimeColSortDisabled'] = this.disableColumnSort;
this.finalPostObj['numFormCols'] = this.runTimeFormNum;
- this.finalPostObj['reportTitle'] = this.reportTitle;
+ if (this.reportTitle.length > 0) {
+ this.finalPostObj['reportTitle'] = this.reportTitle;
+ } else {
+ this.finalPostObj['reportTitle'] = this.reportName;
+ }
this.finalPostObj['reportSubTitle'] = this.reportSubTitle;
this.finalPostObj['oneTimeRec'] = this.oneTime;
this.finalPostObj['hourlyRec'] = this.hourly;
@@ -397,6 +401,13 @@ export class DefinitionComponent implements OnInit, OnDestroy {
this.finalPostObj['sizedByContent'] = (this.sizedByContent == true ? 'Y' : 'N');
this.finalPostObj['repDefType'] = this.reportDefinition;
if (this.reportType === 'Dashboard') {
+ this.dashboardObj = this.dashboardObj.sort(function (a, b) {
+ if (a['x'] === b['x']) {
+ return a['y'] - b['y'];
+ } else {
+ return a['x'] - b['x'];
+ }
+ });
this.finalPostObj['dashboardLayoutJSON'] = JSON.stringify(this.dashboardObj);
this.finalPostObj['dashboardLayoutHTML'] = this.dashboardLayoutHTML;
}
@@ -434,6 +445,13 @@ export class DefinitionComponent implements OnInit, OnDestroy {
this.IncomingReportId = -1;
}
if (this.reportType === 'Dashboard') {
+ this.dashboardObj = this.dashboardObj.sort(function (a, b) {
+ if (a['x'] === b['x']) {
+ return a['y'] - b['y'];
+ } else {
+ return a['x'] - b['x'];
+ }
+ });
this.finalPostObj['dashboardLayoutJSON'] = JSON.stringify(this.dashboardObj);
this.finalPostObj['dashboardLayoutHTML'] = this.dashboardLayoutHTML;
} else {
@@ -496,7 +514,11 @@ export class DefinitionComponent implements OnInit, OnDestroy {
];
this.finalPostObj['runtimeColSortDisabled'] = this.disableColumnSort;
this.finalPostObj['numFormCols'] = this.runTimeFormNum;
- this.finalPostObj['reportTitle'] = this.reportTitle;
+ if ( this.reportTitle.length > 0) {
+ this.finalPostObj['reportTitle'] = this.reportTitle;
+ } else {
+ this.finalPostObj['reportTitle'] = this.reportName;;
+ }
this.finalPostObj['reportSubTitle'] = this.reportSubTitle;
this.finalPostObj['oneTimeRec'] = this.oneTime;
this.finalPostObj['hourlyRec'] = this.hourly;
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
index fc34cccd..e3bab3bb 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/form-fields/form-fields.component.ts
@@ -76,16 +76,20 @@ export class FormFieldsComponent implements OnInit {
}
ngOnInit() {
+ this.showSpinner = true;
this._formFieldsService.getListOfFormFields()
.subscribe((responseFormFields) => {
+ this.showSpinner = true;
for (let m = 0; m < responseFormFields.length; m++) {
responseFormFields[m]["orderSeq"] = m + 1;
this.formFieldsListObj.push(responseFormFields[m]);
}
-
+ this.showSpinner = false;
this._formFieldsService.getFormFieldGroupsData(this.reportId1)
.subscribe((responseGroupsData) => {
+ this.showSpinner = true;
this.Groups = JSON.parse(responseGroupsData["formFieldGroupsJSON"]);
+ this.showSpinner = false;
});
});
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.ts
index 47ec2383..a90a1f8e 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.component.ts
@@ -22,7 +22,7 @@ export class LogComponent implements OnInit {
}
ngOnInit() {
-
+ this.showSpinner = true;
if(this.reportType === "Dashboard")
{
this.stepNo= "3";
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html
index dc6ef1cd..fcfcf4d4 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.html
@@ -146,7 +146,7 @@
<app-run-report [DashboardReportObj]="DashboardReportObj" [TriggerFFArr]="triggerFormFieldArr"
[hitCnt]="hitCnt"
[queryString]="getQueryString()"
- [reportId]="reportId" [reportMode]="reportMode" [runAgain]="runReportAgain" [groupSelectValue]="groupSelectValue" ></app-run-report>
+ [reportId]="reportId" [reportMode]="reportMode" [runAgain]="runReportAgain" [groupSelectValue]="groupSelectValue" [chartType]="chartType" ></app-run-report>
</div>
<div *ngIf="error == true">
@@ -156,4 +156,4 @@
<h1>Stack Trace:</h1>
<p>{{stackTrace}}</p>
-</div> \ No newline at end of file
+</div>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.ts
index d4baba66..c0856b44 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component.ts
@@ -60,6 +60,7 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
commonFormFields: any[];
formFieldListValueMap: any;
saveFormFieldListValueMap: any;
+ chartType = '';
constructor(private _runService: RunService, private _route: ActivatedRoute, private _router: Router) {
this.formFieldListValueArr = [];
@@ -79,6 +80,7 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
this.commonFormFields = [];
this.formFieldListValueMap = new Map<any, any>();
this.saveFormFieldListValueMap = new Map<any, any>();
+ this.chartType = '';
}
ngOnDestroy(): void {
@@ -126,6 +128,7 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
this.commonFormFields = [];
this.formFieldListValueMap = new Map<any, any>();
this.saveFormFieldListValueMap = new Map<any, any>();
+ this.chartType = '';
}
ngOnInit() {
@@ -165,6 +168,7 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
.subscribe((responseDefPage) => {
this.reportName = responseDefPage['reportName'];
this.reportSubTitle = responseDefPage['reportSubTitle'];
+ this.chartType = responseDefPage['chartType'];
if (responseDefPage['reportType'] !== 'Dashboard') {
if (this.calledWithFormFields == false) {
this._runService.getReportData(this.reportId)
@@ -733,7 +737,7 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
}
editReport(reportId: string) {
- this._router.navigate(['v2/reports', 'Edit', reportId]);
+ this._router.navigate(['v2/app/reports', 'Edit', reportId]);
}
showLabelFn() {
@@ -762,8 +766,8 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
localStorage.clear();
localStorage.setItem('id', myItem);
if (this.formFieldGroupObjList != null) {
- this._router.navigateByUrl('v2/refresh', {skipLocationChange: true}).then(() =>
- this._router.navigate(['v2/run', this.reportId]));
+ this._router.navigateByUrl('v2/app/refresh', {skipLocationChange: true}).then(() =>
+ this._router.navigate(['v2/app/run', this.reportId]));
} else {
this.avoidDoCheck = true;
this.formFieldListValueMap = new Map<any, any>();
@@ -785,7 +789,9 @@ export class RunReportFormFieldsComponent implements OnInit, OnDestroy {
for (let ffGrpValue = 0; ffGrpValue < formFieldGroupObjItem['formFieldList'].length; ffGrpValue++) {
this.finalQueryParamsObj[formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId']] = '-1';
this.formFieldListValueMap.delete(formFieldGroupObjItem['formFieldList'][ffGrpValue]['fieldId']);
+ this.triggerFormFieldArr= [];
}
+
}
}
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component.ts
index 3a38eba4..ccf6212a 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component.ts
@@ -9,9 +9,6 @@ import { environment } from '../../../../../../../../environments/environment';
import { DisplayHtml } from '../../../display-html';
import { RunService } from '../../run.service';
import {FormControl} from '@angular/forms';
-
-
-
export interface PeriodicElement {
}
@@ -118,8 +115,8 @@ saveResponseObj:any;
this.postFetchingReportDataFn(JSON.parse(localStorage.getItem(this.inputReportId)));
localStorage.removeItem(this.inputReportId);
} else {
- this._dashboardReportService.getReportDataWithFormFields(this.queryString, this.inputReportId)
- .subscribe((response) => {
+ this._dashboardReportService.getReportDataWithFormFields(this.queryString, this.inputReportId)
+ .subscribe((response) => {
this.postFetchingReportDataFn(response);
});
}
@@ -128,79 +125,79 @@ saveResponseObj:any;
postFetchingReportDataFn(response: any){
this.saveResponseObj = response;
- this.formFieldPresent = false;
- this.responseFormFieldListLength = 0;
- this.reportName = response['reportName'];
- let columnCntr = 0;
- while (response['reportDataColumns'][columnCntr]) {
- this.displayedColumnsArr.push(response['reportDataColumns'][columnCntr]['columnTitle'] + ','
- + response['reportDataColumns'][columnCntr]['colId']);
- columnCntr++;
- }
- let totalCnt = 0;
- while (response['reportTotalDataRows'][totalCnt]) {
- this.displayTotal.push(response['reportTotalDataRows'][totalCnt]);
- totalCnt++;
- }
- let rdr_cntr = 0;
- while (response['reportDataRows'][rdr_cntr]) {
- let dca_cntr = 0;
- const obj = {};
- const reportDataRows = response['reportDataRows'][rdr_cntr];
- while (this.displayedColumnsArr[dca_cntr]) {
- const rowColumnId = this.displayedColumnsArr[dca_cntr].split(',')[1];
- if (reportDataRows[rowColumnId]) {
- let drillDownHtml = '';
- let displayValue = '';
- drillDownHtml = reportDataRows[rowColumnId]['drillDownURL'];
- displayValue = reportDataRows[rowColumnId]['displayValue'];
- if (drillDownHtml !== null &&
- drillDownHtml.length > 0 &&
- !displayValue.includes('linkToReport')) {
- const value = this.convertToLinkToReport(drillDownHtml);
- if (value.length > 0) {
- this.replaceDisplayValue = value + ',' +
- reportDataRows[rowColumnId]['displayValue'];
- } else {
- this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
- }
- } else {
- this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
- }
- let displayObj: DisplayHtml = new class implements DisplayHtml {
- 'background-color': string;
- 'font-family': string;
- 'font-size': string;
- 'font-style': string;
- 'font-weight': string;
- 'text-align': string;
- 'text-decoration': string;
- color: string;
- };
- if (reportDataRows[rowColumnId]['displayValueHtml'].includes('{')) {
- displayObj = JSON.parse(reportDataRows[rowColumnId]['displayValueHtml']);
- }
- displayObj['text-align'] = reportDataRows[rowColumnId]['alignment'];
- if (this.replaceDisplayValue.includes('linkToReport') || this.replaceDisplayValue.includes('linkToFeedback') || this.replaceDisplayValue.includes('linkToMail')) {
- obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
- + '|' + JSON.stringify(displayObj);
- } else {
- obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue
- + '|' + JSON.stringify(displayObj);
- }
- }
- dca_cntr++;
+ this.formFieldPresent = false;
+ this.responseFormFieldListLength = 0;
+ this.reportName = response['reportName'];
+ let columnCntr = 0;
+ while (response['reportDataColumns'][columnCntr]) {
+ this.displayedColumnsArr.push(response['reportDataColumns'][columnCntr]['columnTitle'] + ','
+ + response['reportDataColumns'][columnCntr]['colId']);
+ columnCntr++;
+ }
+ let totalCnt = 0;
+ while (response['reportTotalDataRows'][totalCnt]) {
+ this.displayTotal.push(response['reportTotalDataRows'][totalCnt]);
+ totalCnt++;
+ }
+ let rdr_cntr = 0;
+ while (response['reportDataRows'][rdr_cntr]) {
+ let dca_cntr = 0;
+ const obj = {};
+ const reportDataRows = response['reportDataRows'][rdr_cntr];
+ while (this.displayedColumnsArr[dca_cntr]) {
+ const rowColumnId = this.displayedColumnsArr[dca_cntr].split(',')[1];
+ if (reportDataRows[rowColumnId]) {
+ let drillDownHtml = '';
+ let displayValue = '';
+ drillDownHtml = reportDataRows[rowColumnId]['drillDownURL'];
+ displayValue = reportDataRows[rowColumnId]['displayValue'];
+ if (drillDownHtml !== null &&
+ drillDownHtml.length > 0 &&
+ !displayValue.includes('linkToReport')) {
+ const value = this.convertToLinkToReport(drillDownHtml);
+ if (value.length > 0) {
+ this.replaceDisplayValue = value + ',' +
+ reportDataRows[rowColumnId]['displayValue'];
+ } else {
+ this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
}
- this.displayedRowObj.push(obj);
- rdr_cntr++;
+ } else {
+ this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
}
- for (let pushCounter = 0; pushCounter < this.displayedColumnsArr.length; pushCounter++) {
- this.displayedColumns.push(this.displayedColumnsArr[pushCounter].split(',')[1]);
+ let displayObj: DisplayHtml = new class implements DisplayHtml {
+ 'background-color': string;
+ 'font-family': string;
+ 'font-size': string;
+ 'font-style': string;
+ 'font-weight': string;
+ 'text-align': string;
+ 'text-decoration': string;
+ color: string;
+ };
+ if (reportDataRows[rowColumnId]['displayValueHtml'].includes('{')) {
+ displayObj = JSON.parse(reportDataRows[rowColumnId]['displayValueHtml']);
}
- this.showSpinner = false;
- this.dataSource = new MatTableDataSource<PeriodicElement>(this.displayedRowObj);
- this.dataSource.sort = this.sort;
- this.dataSource.paginator = this.paginator;
+ displayObj['text-align'] = reportDataRows[rowColumnId]['alignment'];
+ if (this.replaceDisplayValue.includes('linkToReport') || this.replaceDisplayValue.includes('linkToFeedback') || this.replaceDisplayValue.includes('linkToMail')) {
+ obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
+ + '|' + JSON.stringify(displayObj);
+ } else {
+ obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue
+ + '|' + JSON.stringify(displayObj);
+ }
+ }
+ dca_cntr++;
+ }
+ this.displayedRowObj.push(obj);
+ rdr_cntr++;
+ }
+ for (let pushCounter = 0; pushCounter < this.displayedColumnsArr.length; pushCounter++) {
+ this.displayedColumns.push(this.displayedColumnsArr[pushCounter].split(',')[1]);
+ }
+ this.showSpinner = false;
+ this.dataSource = new MatTableDataSource<PeriodicElement>(this.displayedRowObj);
+ this.dataSource.sort = this.sort;
+ this.dataSource.paginator = this.paginator;
}
linkToReport(reportID: string, queryParameters: string) {
@@ -212,11 +209,11 @@ saveResponseObj:any;
length++;
sessionStorage.setItem(length.toString(), this.parentId + '|' + this.queryString);
}
- this._router.navigate(['v2/run', reportID, queryParameters]);
+ this._router.navigate(['v2/app/run', reportID, queryParameters]);
}
linkToFeedback(feedBackId: string, queryParameters: string) {
- this._router.navigate(['v2/feedback', feedBackId]);
+ this._router.navigate(['v2/app/feedback', feedBackId]);
}
linkToMail(mailId: string) {
@@ -274,4 +271,5 @@ saveResponseObj:any;
return outPut;
}
+
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.html
index 4b647528..16c15710 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.html
@@ -3,7 +3,7 @@
<div *ngIf="showDashboardReport">
<span *ngIf="download_in_progress" class="ecomp-small-spinner"></span>
Download:
- <a [routerLink]=""><img class="downloadImg" (click)="downloadReport('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx')"
+ <a [routerLink]=""><img class="downloadImg" (click)="downloadReport('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx')"
placement="top" ngbTooltip="Download Dashboard Report"
src="assets/images/xlsx.png"></a>&nbsp;
@@ -36,7 +36,7 @@
<div *ngIf="error == false" [hidden]="isChartAvailable == false" align="center">
<iframe #iframe height="500" style="border: none" width="70%"></iframe>
</div>
-
+
<div>
<div class="field-group">
@@ -65,19 +65,18 @@
<ng-container matColumnDef="{{keys}}">
<th *matHeaderCellDef align="center" mat-header-cell mat-sort-header>
{{displayedColumnsArr[i].split(",")[0]}}</th>
- <td *matCellDef="let row" mat-cell>
- <div *ngIf="row[keys].split('|')[0] == 'linkToReport'"
- [ngStyle]="setStyle(row[keys].split('|')[4])">
+ <td *matCellDef="let row" mat-cell [ngStyle]="setStyle(row[keys])">
+ <div *ngIf="row[keys].split('|')[0] == 'linkToReport'">
<a (click)="linkToReport(row[keys].split('|')[1], row[keys].split('|')[2])"
[routerLink]="">{{row[keys].split('|')[3]}}</a>
</div>
<div *ngIf="row[keys].split('|')[0] == 'linkToFeedback'"
- [ngStyle]="setStyle(row[keys].split('|')[4])">
+ >
<a (click)="linkToFeedback(row[keys].split('|')[1], row[keys].split('|')[2])"
[routerLink]="">{{row[keys].split('|')[3]}}</a>
</div>
<div *ngIf="row[keys].split('|')[0] == 'linkToMail'"
- [ngStyle]="setStyle(row[keys].split('|')[3])">
+ >
<a (click)="linkToMail(row[keys].split('|')[1])"
[routerLink]="">{{row[keys].split('|')[2]}}</a>
</div>
@@ -141,4 +140,3 @@
}
</style>
-
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts
index da718262..e1476421 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.spec.ts
@@ -121,10 +121,6 @@ describe('RunReportComponent', () => {
component.linkToReport("test", "abc");
})
- it('should test linkToFeedback', () => {
- component.linkToFeedback("test", "abc");
- })
-
it('should test linkToMail', () => {
component.linkToMail("test");
})
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.ts
index a2163054..7f1e8331 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run-report/run-report.component.ts
@@ -1,28 +1,28 @@
import {
AfterViewInit,
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
Component,
- OnInit,
- ViewChild,
+ ElementRef,
Input,
- SimpleChange,
+ OnInit,
SimpleChanges,
- ChangeDetectorRef,
- Inject,
- ElementRef
+ ViewChild
} from '@angular/core';
-import {MatPaginator} from '@angular/material/paginator';
-import {MatSort} from '@angular/material/sort';
-import {MatTable, MatTableDataSource} from '@angular/material/table';
-import {ActivatedRoute, Router} from '@angular/router';
-import {HttpClient} from '@angular/common/http';
-import {environment} from '../../../../../../../environments/environment';
-import {RunService} from '../run.service';
-import {GridsterConfig, GridsterItem, GridType} from 'angular-gridster2';
-import {Observable} from 'rxjs';
-import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
-import {displayGrids} from 'angular-gridster2/lib/gridsterConfig.interface';
-import {DisplayHtml} from '../../display-html';
-import {FormControl} from '@angular/forms';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
+import { MatTableDataSource } from '@angular/material/table';
+import { ActivatedRoute, Router } from '@angular/router';
+import { HttpClient } from '@angular/common/http';
+import { environment } from '../../../../../../../environments/environment';
+import { RunService } from '../run.service';
+import { GridsterConfig, GridsterItem, GridType } from 'angular-gridster2';
+import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
+import { DisplayHtml } from '../../display-html';
+import { FormControl } from '@angular/forms';
+import { HeaderService } from 'src/app/shared/services/header/header.service';
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
+import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
export interface PeriodicElement {
@@ -33,7 +33,8 @@ const ELEMENT_DATA: PeriodicElement[] = [{}];
@Component({
selector: 'app-run-report',
templateUrl: './run-report.component.html',
- styleUrls: ['./run-report.component.css']
+ styleUrls: ['./run-report.component.css'],
+ changeDetection: ChangeDetectionStrategy.OnPush
})
export class RunReportComponent implements OnInit, AfterViewInit {
@Input('reportId') inputReportId: string;
@@ -44,9 +45,10 @@ export class RunReportComponent implements OnInit, AfterViewInit {
@Input('hitCnt') hitCnt: number;
@Input('runAgain') runAgain: string;
@Input('groupSelectValue') groupSelectValue: string;
+ @Input('chartType') chartType: string;
@ViewChild('iframe') iframe: ElementRef;
- @ViewChild(MatPaginator, {static: false} as any) paginator: MatPaginator;
- @ViewChild(MatSort, {static: false} as any) sort: MatSort;
+ @ViewChild(MatPaginator, { static: false } as any) paginator: MatPaginator;
+ @ViewChild(MatSort, { static: false } as any) sort: MatSort;
dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
displayedColumns: string[];
IncomingReportId: string;
@@ -218,7 +220,7 @@ export class RunReportComponent implements OnInit, AfterViewInit {
pushItems: true,
disablePushOnDrag: false,
disablePushOnResize: false,
- pushDirections: {north: true, east: true, south: true, west: true},
+ pushDirections: { north: true, east: true, south: true, west: true },
pushResizeItems: true,
disableWindowResize: true,
disableWarnings: false,
@@ -244,7 +246,6 @@ export class RunReportComponent implements OnInit, AfterViewInit {
this.hitCnt = this.runButtonHitCnt;
this.initialQueryString = this.queryString;
this.initCounter++;
-
}
ngAfterViewInit() {
@@ -309,22 +310,22 @@ export class RunReportComponent implements OnInit, AfterViewInit {
this.showMoreVert = true;
localStorage.removeItem(this.inputReportId);
} else {
- this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
- .subscribe((response) => {
- if (response['errormessage']) {
- this.showError(response);
- } else {
- this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
- this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
+ this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
+ .subscribe((response) => {
+ if (response['errormessage']) {
+ this.showError(response);
+ } else {
+ this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
+ this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
this.saveResponseObj = response;
- this.postFetchingReportDataFn(response, false);
- const endDate: Date = new Date();
- const endTime = endDate.getTime();
- this.timeTaken = ((endTime - startTime) / 1000).toString();
- this.showMoreVert = true;
- }
- });
- }
+ this.postFetchingReportDataFn(response, false);
+ const endDate: Date = new Date();
+ const endTime = endDate.getTime();
+ this.timeTaken = ((endTime - startTime) / 1000).toString();
+ this.showMoreVert = true;
+ }
+ });
+ }
}
} else {
this.showMoreVert = true;
@@ -359,7 +360,7 @@ export class RunReportComponent implements OnInit, AfterViewInit {
rdc_cntr++;
}
- if (response['chartWizardAvailable'] === true) {
+ if (response['chartWizardAvailable'] === true && this.chartType !== 'none') {
this.isChartAvailable = true;
this.iframe.nativeElement.setAttribute('src', this.chartRunUrl);
}
@@ -449,13 +450,10 @@ export class RunReportComponent implements OnInit, AfterViewInit {
length++;
sessionStorage.setItem(length.toString(), this.inputReportId + '|' + this.queryString);
}
- this._router.navigate(['v2/run', reportID, queryParameters]);
+ this._router.navigate(['v2/app/run', reportID, queryParameters]);
}
- linkToFeedback(feedBackId: string, queryParameters: string) {
- this._router.navigate(['v2/feedback', feedBackId]);
- }
linkToMail(mailId: string) {
const email = 'mailto:' + mailId;
@@ -503,13 +501,19 @@ export class RunReportComponent implements OnInit, AfterViewInit {
}
downLoadFile(data: any, type: string, extension: string, reportType: string) {
- const blob = new Blob([data], {type: type});
- const dt = new Date();
- const utcDate = dt.getTime();
- let fileName = this.reportName + utcDate + '.' + extension;
+ const blob = new Blob([data], { type: type });
+ const date = new Date();
+ const dateStr =
+ ('00' + (date.getMonth() + 1)).slice(-2) +
+ ('00' + date.getDate()).slice(-2) +
+ date.getFullYear() +
+ ('00' + date.getHours()).slice(-2) +
+ ('00' + date.getMinutes()).slice(-2) +
+ ('00' + date.getMilliseconds());
+ let fileName = this.reportName + dateStr + '.' + extension;
if (reportType === 'Dashboard') {
fileName = '';
- fileName = reportType + '-' + this.inputReportId + '.' + extension;
+ fileName = reportType + '_' + this.inputReportId + '_' + dateStr + '.' + extension;
}
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, fileName);
@@ -533,7 +537,15 @@ export class RunReportComponent implements OnInit, AfterViewInit {
}
}
- setStyle(styles: string) {
+ setStyle(rowData: string) {
+ let styles = '';
+ if (rowData.split('|')[0] === 'linkToReport') {
+ styles = rowData.split('|')[4];
+ } else if (rowData.split('|')[0] === 'linkToMail') {
+ styles = rowData.split('|')[3];
+ } else {
+ styles = rowData.split('|')[1];
+ }
if (styles.includes('{')) {
return JSON.parse(styles);
} else {
@@ -541,6 +553,8 @@ export class RunReportComponent implements OnInit, AfterViewInit {
}
}
+
+
getDisplayTotal(keys: string) {
if (this.displayTotal.length > 0) {
return this.displayTotal[0][keys].displayValue;
@@ -627,7 +641,6 @@ export class RunReportComponent implements OnInit, AfterViewInit {
}
}
const split = value.split('&');
- // const spltFirst = split[0].split('=');
if (split[1].length <= 0) {
return outPut;
}
@@ -645,10 +658,8 @@ export class RunReportComponent implements OnInit, AfterViewInit {
return outPut;
}
-
-
takeToReport(queryString: string, reportID: string) {
- this._router.navigate(['v2/run', reportID, queryString , this.groupSelectValue]);
+ this._router.navigate(['v2/app/run', reportID, queryString, this.groupSelectValue]);
}
goBack() {
@@ -669,8 +680,7 @@ export class RunReportComponent implements OnInit, AfterViewInit {
sessionStorage.removeItem('1');
}
localStorage.removeItem(this.inputReportId);
- this._router.navigate(['v2/run', repId, queryString]);
+ this._router.navigate(['v2/app/run', repId, queryString]);
}
}
-
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.ts
index 46d7af7e..3d339b70 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.component.ts
@@ -38,14 +38,14 @@ export class RunComponent implements OnInit {
runReport()
{
this.toggle = true;
-
+
this._route.params.subscribe(params => {
-
+
this.IncomingReportId = params["reportId"];
this.reportId1 = params["reportId"];
});
- this.router.navigate(['v2/run', this.reportId1]);
+ this.router.navigate(['v2/app/run', this.reportId1]);
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.ts
index 6c994723..b7e14bc6 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.component.ts
@@ -71,7 +71,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseSecurityInfo) => {
this.reportSecurityInfo = responseSecurityInfo;
- //console.log(this.reportSecurityInfo);
+ console.log(this.reportSecurityInfo);
this.reportOwnerId = this.reportSecurityInfo["ownerId"];
@@ -107,7 +107,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseUserList) => {
this.reportUserList = responseUserList;
- //console.log(this.reportUserList);
+ console.log(this.reportUserList);
for(let ru=0; ru<this.reportUserList.length; ru++)
{
@@ -132,7 +132,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseSecurityRoles) => {
this.reportSecurityRoles = responseSecurityRoles;
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
for(let sr=0; sr<this.reportSecurityRoles.length; sr++)
{
@@ -145,13 +145,13 @@ export class SecurityComponent implements OnInit {
this.addRoleEditAccessArr[sr] = true;
}
}
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
this._securityService.getReportRoleList()
.subscribe((responseRoleList) => {
this.reportRoleList = responseRoleList;
- //console.log(this.reportRoleList);
+ console.log(this.reportRoleList);
for(let m=0; m<this.reportSecurityRoles.length; m++)
{
@@ -194,7 +194,7 @@ export class SecurityComponent implements OnInit {
}
}
- //console.log(reportUserId);
+ console.log(reportUserId);
this._securityService.addReportUser(reportUserId)
.subscribe((responseAddUser) => {
@@ -204,7 +204,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseUserList) => {
this.reportUserList = responseUserList;
- //console.log(this.reportUserList);
+ console.log(this.reportUserList);
this.showUserListSpinner = false;
});
@@ -227,7 +227,7 @@ export class SecurityComponent implements OnInit {
}
}
- //console.log(reportUserId);
+ console.log(reportUserId);
this._securityService.removeReportUser(reportUserId)
.subscribe((responseRemoveUser) => {
@@ -237,7 +237,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseUserList) => {
this.reportUserList = responseUserList;
- //console.log(this.reportUserList);
+ console.log(this.reportUserList);
this.showUserListSpinner = false;
});
@@ -248,8 +248,8 @@ export class SecurityComponent implements OnInit {
addUserEditAccess(reportUserId : string, reportUserIndex : number)
{
- //console.log(reportUserId, reportUserIndex);
- //console.log(this.userEditAccessArr);
+ console.log(reportUserId, reportUserIndex);
+ console.log(this.userEditAccessArr);
let readOnly="";
if(this.userEditAccessArr[reportUserIndex] === true)
@@ -273,7 +273,7 @@ export class SecurityComponent implements OnInit {
let roleId;
this.showRoleListSpinner = true;
- //console.log(this.reportRoleList);
+ console.log(this.reportRoleList);
for(let ro=0; ro<this.reportRoleList.length; ro++)
{
@@ -283,7 +283,7 @@ export class SecurityComponent implements OnInit {
}
}
- //console.log(roleId);
+ console.log(roleId);
this._securityService.addReportRole(roleId)
.subscribe((addRoleResponse) => {
@@ -292,13 +292,13 @@ export class SecurityComponent implements OnInit {
.subscribe((responseSecurityRoles) => {
this.reportSecurityRoles = responseSecurityRoles;
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
this._securityService.getReportRoleList()
.subscribe((responseRoleList) => {
this.reportRoleList = responseRoleList;
- //console.log(this.reportRoleList);
+ console.log(this.reportRoleList);
for(let m=0; m<this.reportSecurityRoles.length; m++)
{
@@ -338,13 +338,13 @@ export class SecurityComponent implements OnInit {
.subscribe((responseSecurityRoles) => {
this.reportSecurityRoles = responseSecurityRoles;
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
this._securityService.getReportRoleList()
.subscribe((responseRoleList) => {
this.reportRoleList = responseRoleList;
- //console.log(this.reportRoleList);
+ console.log(this.reportRoleList);
for(let m=0; m<this.reportSecurityRoles.length; m++)
{
@@ -366,7 +366,7 @@ export class SecurityComponent implements OnInit {
addRoleEditAccess(roleId : string, roleIndex : number)
{
- //console.log(this.addRoleEditAccessArr);
+ console.log(this.addRoleEditAccessArr);
let readOnly = "";
if(this.addRoleEditAccessArr[roleIndex] === true)
@@ -391,7 +391,7 @@ export class SecurityComponent implements OnInit {
this.fetchCnt = 0;
let finalPostObj = new Object();
- // //console.log(this.reportOwnerList);
+ // console.log(this.reportOwnerList);
for(let kl=0; kl<this.reportOwnerList.length; kl++)
{
if(this.reportOwnerList[kl]["name"] == this.reportOwner)
@@ -408,7 +408,7 @@ export class SecurityComponent implements OnInit {
{
finalPostObj["isPublic"] = "false";
}
- //console.log(finalPostObj);
+ // console.log(finalPostObj);
this._securityService.saveSecurityTabInfo(finalPostObj)
.subscribe((responseFinalPost) => {
@@ -420,13 +420,13 @@ export class SecurityComponent implements OnInit {
.subscribe((responseOwnerList) => {
this.reportOwnerList = responseOwnerList;
- //console.log(this.reportOwnerList);
+ console.log(this.reportOwnerList);
this._securityService.getReportSecurityInfo()
.subscribe((responseSecurityInfo) => {
this.reportSecurityInfo = responseSecurityInfo;
- //console.log(this.reportSecurityInfo);
+ console.log(this.reportSecurityInfo);
this.reportOwnerId = this.reportSecurityInfo["ownerId"];
@@ -462,7 +462,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseUserList) => {
this.reportUserList = responseUserList;
- //console.log(this.reportUserList);
+ console.log(this.reportUserList);
for(let ru=0; ru<this.reportUserList.length; ru++)
{
@@ -487,7 +487,7 @@ export class SecurityComponent implements OnInit {
.subscribe((responseSecurityRoles) => {
this.reportSecurityRoles = responseSecurityRoles;
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
for(let sr=0; sr<this.reportSecurityRoles.length; sr++)
{
@@ -500,13 +500,13 @@ export class SecurityComponent implements OnInit {
this.addRoleEditAccessArr[sr] = true;
}
}
- //console.log(this.reportSecurityRoles);
+ console.log(this.reportSecurityRoles);
this._securityService.getReportRoleList()
.subscribe((responseRoleList) => {
this.reportRoleList = responseRoleList;
- //console.log(this.reportRoleList);
+ console.log(this.reportRoleList);
for(let m=0; m<this.reportSecurityRoles.length; m++)
{
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.ts
index 62c7d7a4..c1559c75 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.ts
@@ -46,6 +46,7 @@ export class SQLComponent implements OnInit {
}
ngOnInit() {
+ this.showSpinner = true;
this.showSaveSQLDialog = false;
this.SQLPostResponse = true;
this.ValidatePostResponse = {};
@@ -135,7 +136,7 @@ export class SQLComponent implements OnInit {
} else {
this._http.get(environment.baseUrl + 'report/wizard/retrieve_def_tab_wise_data/InSession')
.subscribe((response) => {
- // console.log(response);
+ console.log(response);
this._router.navigate(['v2/reports', 'Edit', response['reportId']]);
});
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html
new file mode 100644
index 00000000..eb07a769
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html
@@ -0,0 +1,14 @@
+
+<div >
+<div class="tab-content">
+ <h3>{{this.menuId}} Reports</h3>
+</div>
+<span class="ecomp-spinner" *ngIf="showSpinner"></span>
+<div>
+
+<ng-container *ngFor="let item of finalRowArr">
+ <li><a href="javascript:void(0);" (click)="runReport(item.reportURL)">{{item.reportName}}</a></li>
+</ng-container>
+
+</div>
+</div>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss
new file mode 100644
index 00000000..bc189348
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss
@@ -0,0 +1,10 @@
+
+button{
+ margin: 0;
+ font-size: 100%;
+ vertical-align: middle;
+ color:white;
+ background-color: #0568ae
+}
+
+ \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts
new file mode 100644
index 00000000..27329a9b
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts
@@ -0,0 +1,26 @@
+// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+// import { DisplayAreaComponent } from './display-area.component';
+
+// describe('DisplayAreaComponent', () => {
+// let component: DisplayAreaComponent;
+// let fixture: ComponentFixture<DisplayAreaComponent>;
+
+// beforeEach(async(() => {
+// TestBed.configureTestingModule({
+// declarations: [ DisplayAreaComponent ]
+// })
+// .compileComponents();
+// }));
+
+// beforeEach(() => {
+// fixture = TestBed.createComponent(DisplayAreaComponent);
+// component = fixture.componentInstance;
+// fixture.detectChanges();
+// });
+
+// it('should create', () => {
+// expect(component).toBeTruthy();
+// });
+// });
+
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts
new file mode 100644
index 00000000..e08190e7
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts
@@ -0,0 +1,65 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
+import { DisplayAreaService } from 'src/app/shared/services/displayArea/display-area.service';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
+import { MatTable, MatTableDataSource } from '@angular/material/table';
+
+@Component({
+ selector: 'app-display-area',
+ templateUrl: './display-area.component.html',
+ styleUrls: ['./display-area.component.scss']
+})
+export class DisplayAreaComponent implements OnInit {
+
+ @ViewChild( MatPaginator, { static: false } as any ) paginator: MatPaginator;
+ @ViewChild( MatSort, { static: false } as any ) sort: MatSort;
+ @ViewChild( MatTable, { static: false } as any ) table: MatTable<any>;
+ menuId:string;
+ showSpinner: boolean;
+ dataSource1: any;
+ displayedColumns = ["reportName", "reportDescr","reportURL"];
+ finalGETObj: {};
+ finalRowArr: any[];
+ rowObj: any;
+ reportId: string;
+
+ constructor(private _route: ActivatedRoute, private _router: Router, private _displayAreaService: DisplayAreaService) { }
+
+ ngOnInit() {
+ this._route.params.subscribe(params => {
+ this.menuId = params['menuId'];
+ console.log("displayArea " +this.menuId);
+ this.initializeReportList(this.menuId);
+ });
+
+
+
+ }
+
+ initializeReportList(menuId:string) {
+ this.showSpinner = true;
+ this.dataSource1 = new MatTableDataSource();
+ this.finalGETObj = new Object();
+//this.finalGETObjRowsArr = new Array();
+ this.finalRowArr = new Array();
+ this._displayAreaService.getMenuIdSpecificReports(this.menuId)
+ .subscribe(( responseObj ) => {
+ this.finalGETObj = responseObj;
+ for (let entry of responseObj) {
+ this.rowObj = new Object();
+ this.rowObj["reportName"] = entry["reportName"];
+ this.rowObj["reportDescr"] = entry["reportDescr"];
+ this.rowObj["reportURL"] = entry["reportURL"];
+ this.finalRowArr.push( this.rowObj );
+ }
+ this.showSpinner = false;
+ } );
+}
+
+runReport( reportId: string ) {
+ this.reportId = reportId;
+ this._router.navigate( [reportId] );
+}
+
+}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.html
index 0295bdd6..7bb6729d 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.html
@@ -84,7 +84,7 @@
[length]="dataSource1?.data.length"
[pageIndex]="0"
[pageSize]="20"
- [pageSizeOptions]="[20]">
+ [pageSizeOptions]="[20,40,60,80,100]">
</mat-paginator>
</div>
</div>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.ts
index 1c2d443e..dfb485e1 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.ts
@@ -42,7 +42,7 @@ export class ReportListComponent implements AfterViewInit, OnInit {
this.delete = false;
this.initializeReportList();
}
-
+
initializeReportList() {
this.showSpinner = true;
this.dataSource = new AllReportsDataSource();
@@ -148,12 +148,12 @@ export class ReportListComponent implements AfterViewInit, OnInit {
displayReport( reportId: string ) {
this.reportId = reportId;
- this._router.navigate( ["v2/reports", "Edit", reportId] );
+ this._router.navigate( ["v2/app/reports", "Edit", reportId] );
}
runReport( reportId: string ) {
this.reportId = reportId;
- this._router.navigate( ['v2/run', reportId] );
+ this._router.navigate( ['v2/app/run', reportId] );
}
applyFilter( filterValue: string ) {
@@ -182,15 +182,15 @@ export class ReportListComponent implements AfterViewInit, OnInit {
this.showDialog = !this.showDialog;
this.closable = false;
}
-
+
openReportSchedule( reportId: string ) {
- this._router.navigate( ['v2/schedule_report', reportId] );
+ this._router.navigate( ['v2/app/schedule_report', reportId] );
}
copydisplayReport(reportId : string)
{
this.reportId = reportId;
- this._router.navigate(["v2/reports", "Copy",reportId]);
+ this._router.navigate(["v2/app/reports", "Copy",reportId]);
}
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.service.ts
index 560bd6e1..aad435f5 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.service.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.service.ts
@@ -15,6 +15,6 @@ export class ReportListService {
return this._http.get(environment.baseUrl + "/raptor.htm?action=report.delete&c_master=" + reportId);
}
getAllReports():Observable<any>{
- return this._http.get(environment.baseUrl + "raptor.htm?action=report.search.execute&r_page=0");
+ return this._http.get(environment.baseUrl + "raptor.htm?action=report.search.execute&r_page=0&show_all=true");
}
}
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html
index 5f131fb6..a6682306 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html
@@ -50,12 +50,12 @@
<ng-container matColumnDef="Last Name">
<th mat-header-cell *matHeaderCellDef id="heading2"> {{userHeaders[1]}} </th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.lastName}} </td>
+ <td mat-cell *matCellDef="let rowData"> {{rowData.last_name}} </td>
</ng-container>
<ng-container matColumnDef="First Name">
<th mat-header-cell *matHeaderCellDef id="heading3">{{userHeaders[2]}} </th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.firstName}}</td>
+ <td mat-cell *matCellDef="let rowData"> {{rowData.first_name}}</td>
</ng-container>
<ng-container matColumnDef="Email">
@@ -63,12 +63,12 @@
<td mat-cell *matCellDef="let rowData" > {{rowData.email}} </td>
</ng-container>
- <ng-container matColumnDef="orgUserId">
+ <ng-container matColumnDef="Org User ID">
<th mat-header-cell *matHeaderCellDef id="heading4"> {{userHeaders[4]}} </th>
<td mat-cell *matCellDef="let rowData" > {{rowData.orgUserId}} </td>
</ng-container>
- <ng-container matColumnDef="orgManagerUserId">
+ <ng-container matColumnDef="Org Manager User ID">
<th mat-header-cell *matHeaderCellDef id="heading4"> {{userHeaders[5]}} </th>
<td mat-cell *matCellDef="let rowData" > {{rowData.orgManagerUserId}} </td>
</ng-container>
@@ -86,7 +86,7 @@
<ng-container matColumnDef="Active?">
<th mat-header-cell *matHeaderCellDef id="heading6"> {{userHeaders[7]}} </th>
<td mat-cell *matCellDef="let rowData">
- <mat-slide-toggle [(ngModel)]="rowData.active" (change)="toggleUserActive(rowData)"></mat-slide-toggle>
+ <mat-slide-toggle [checked]="(rowData.active_yn =='Y' || rowData.active_yn == true) ? true : false" (change)="toggleUserActive(rowData,$event)"></mat-slide-toggle>
</td>
</ng-container>
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss
index 3b9e9d3b..30ba1ff9 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss
@@ -36,36 +36,19 @@
*
*/
-table {
- width: 100%;
- }
-
- .mat-form-field {
- font-size: 14px;
- width: 100%;
- }
-
- td, th {
- width: 25%;
- }
- .mat-form-field[_ngcontent-c4] {
- font-size: 14px;
- width: 20%;
- float: right;
- }
+ table {
+ width: 100%;
+}
- /*td.mat-cell, td.mat-footer-cell{
- padding: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- border-right-style: solid;
- border-right-color: rgba(0,0,0,.12);
- border-right-width: 1px;
- }
-*/
+::ng-deep .mat-header-cell{
+ font-weight: bold;
+ font-size: 14px;
+ color: #343a40;
+}
-td[_ngcontent-c4], th[_ngcontent-c4] {
- width: 15%;
+::ng-deep .mat-form-field[_ngcontent-c4] {
+ font-size: 14px;
+ width: 20%;
}
#edit-button{
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts
index 9ae59ca8..734aaf09 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts
@@ -57,14 +57,13 @@ export class SearchComponent implements OnInit {
response: any;
result: any;
profileList:any;
- userHeaders = ["User ID","Last Name","First Name","Email","orgUserId","orgManagerUserId","Edit","Active?"];
+ userHeaders = ["User ID","Last Name","First Name","Email","Org User ID","Org Manager User ID","Edit","Active?"];
constructor(public profileservice:ProfileService, public ngbModal: NgbModal,private _router: Router) { }
dataSource: MatTableDataSource<[]>;
@ViewChild(MatPaginator, {}) paginator: MatPaginator;
@ViewChild(MatSort, {}) sort: MatSort;
-
ngOnInit() {
this.getUsers();
}
@@ -72,7 +71,7 @@ export class SearchComponent implements OnInit {
getUsers(){
this.showSpinner = true;
let response;
- this.response = this.profileservice.getUserPagination();
+ this.response = this.profileservice.getAllUsers();
this.response.subscribe(data => {
response = data;
this.result = JSON.parse(response.data);
@@ -84,9 +83,9 @@ export class SearchComponent implements OnInit {
});
}
- toggleUserActive(user){
- let activeOrInactive = (user.active) ? 'activate' : 'inactivate';
- let confirmationMsg = 'You are about to ' + activeOrInactive + ' the user ' + user.firstName +" "+user.lastName+ '. Do you want to continue?';
+ toggleUserActive(user, e){
+ let activeOrInactive = (e.checked) ? 'activate' : 'inactivate';
+ let confirmationMsg = 'You are about to ' + activeOrInactive + ' the user ' + user.first_name +" "+user.last_name+ '. Do you want to continue?';
const modalInfoRef = this.ngbModal.open(InformationModalComponent);
modalInfoRef.componentInstance.title = 'Confirmation';
modalInfoRef.componentInstance.message = confirmationMsg;
@@ -104,7 +103,7 @@ export class SearchComponent implements OnInit {
this.openConfirmationModal("Error",error);
});
} else {
- user.active = !user.active;
+ this.ngOnInit();
}
}, (result) => {
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts
index 37231147..45789f27 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts
@@ -67,6 +67,7 @@ import { LayoutModule } from '@angular/cdk/layout';
import { DashboardReportGridComponent } from './analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component';
import { DataChartComponent } from './analytics/Report_List/Report/definition/dashboard-report-grid/data-chart/data-chart.component';
import { RunDashboardReportComponent } from './analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component';
+import { DisplayAreaComponent } from './analytics/Report_List/display-area/display-area.component';
@@ -118,6 +119,7 @@ import { RdpModule } from 'portalsdk-tag-lib';
DashboardReportGridComponent, DataChartComponent, RunDashboardReportComponent,
DialogOverviewExampleDialog,
+ DisplayAreaComponent
],