summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts68
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/dashboard/dashboard.component.spec.ts8
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.ts27
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.service.ts41
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts21
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts49
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts94
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts113
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.spec.ts29
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html34
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts13
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts26
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts35
-rw-r--r--ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts14
-rw-r--r--ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html1
-rw-r--r--ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts53
-rw-r--r--ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/public_api.ts3
17 files changed, 537 insertions, 92 deletions
diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts
index 95b69880..7ac3eb5a 100644
--- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts
@@ -1,12 +1,78 @@
import { TestBed } from '@angular/core/testing';
import { ProfileService } from './profile.service';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
describe('ProfileService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
+
+ let service: ProfileService;
+
+ beforeEach(() => {TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [ HttpClientTestingModule, HttpClient, ProfileService]
+ })
+ service = TestBed.get(ProfileService);
+});
it('should be created', () => {
const service: ProfileService = TestBed.get(ProfileService);
expect(service).toBeTruthy();
});
+
+ it('should get getUserPagination', () => {
+ service.getUserPagination().subscribe((resp) => {
+ expect(resp).toBe(environment.getUserPagination);
+ });
+ });
+
+ it('should get getPostSearch', () => {
+ let test : any;
+ service.getPostSearch(test).subscribe((resp) => {
+ expect(resp).toBe(environment.postSearch);
+ });
+ });
+
+ it('should get importUser', () => {
+ let test : any;
+ service.importUser(test).subscribe((resp) => {
+ expect(resp).toBe(environment.importSearch);
+ });
});
+
+it('should get getPostProfile', () => {
+ service.getPostProfile().subscribe((resp) => {
+ expect(resp).toBe(environment.getPostProfile);
+ });
+});
+
+it('should get getSelfProfile', () => {
+ service.getSelfProfile().subscribe((resp) => {
+ expect(resp).toBe(environment.getSelfProfile);
+ });
+});
+
+it('should get removeRole', () => {
+ let data, id;
+ service.removeRole(data, id).subscribe((resp) => {
+ expect(resp).toBe(environment.removeUserRole);
+ });
+});
+
+it('should get addUserRole', () => {
+ let data, id;
+ service.addUserRole(data, id).subscribe((resp) => {
+ expect(resp).toBe(environment.addUserRole);
+ });
+});
+
+it('should get toggleProfileActive', () => {
+ let data, id;
+ service.toggleProfileActive(id).subscribe((resp) => {
+ expect(resp).toBe(environment);
+ });
+});
+
+});
+
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/dashboard/dashboard.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/dashboard/dashboard.component.spec.ts
index ba1583d8..1c883519 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/dashboard/dashboard.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/dashboard/dashboard.component.spec.ts
@@ -4,7 +4,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DashboardComponent } from './dashboard.component';
import { DashboardModule } from './dashboard.module';
-import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
import { HttpClientTestingModule } from '@angular/common/http/testing';
describe('DashboardComponent', () => {
@@ -32,4 +31,11 @@ describe('DashboardComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('should test the closeAlert method', () =>{
+ component.alerts=[1,2,3,4,5];
+ component.closeAlert(2);
+ expect(component.alerts).toEqual([1,3,4,5]);
+ })
+
});
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
index 1b22cf28..9df51b51 100644
--- 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
@@ -42,12 +42,23 @@ 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) {
@@ -108,6 +119,7 @@ export class MenusService implements RdpCrudInterface {
this.adminService.updateFnMenuItem(postData)
.subscribe(_data => {
console.log("Response : ", _data);
+ this.statusResponse.next("200");
}, error => {
console.log("Error : ", error);
});
@@ -122,6 +134,9 @@ export class MenusService implements RdpCrudInterface {
let result = { availableFnMenuItem: data };
this.adminService.deleteMenu(result).subscribe(response => {
console.log("Response ", response);
+ this.statusResponse.next("200");
+ }, error =>{
+ console.log("Error : ", error);
})
}
@@ -133,7 +148,15 @@ export class MenusService implements RdpCrudInterface {
}
}
- get(data: any) {
- console.log("get method is getting called from AppServie data:: ", data);
+ 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/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
index 9d931d1d..b0595361 100644
--- 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
@@ -1,34 +1,57 @@
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 AppServie data:: ", data);
+ console.log("Add method is getting called from RoleFunctionService data:: ", data);
}
- update(data: any) {
- console.log("Update method is getting called from MenusService data:: ", data);
- this.adminService.saveRoleFunction(data).subscribe(response => {
- console.log(response);
+ 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 AppServie data::>> " + JSON.stringify(data));
+ console.log("Delete method is getting called from RoleFunctionService data::>> " + JSON.stringify(data));
this.adminService.deleteRoleFunction(data).subscribe(response => {
- console.log("Repsonse : ",response);
+ console.log("Repsonse : ", response);
+ this.statusResponse.next("200");
+
})
}
- get(data: any) {
- console.log("get method is getting called from AppServie data:: ", data);
+ 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/analytics/Report_List/Report/log/log.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts
index d7b3b648..872a5de4 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/log/log.service.spec.ts
@@ -2,15 +2,32 @@ import { TestBed } from '@angular/core/testing';
import { LogService } from './log.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
describe('LogService', () => {
+
+ let service: LogService
+
beforeEach(() =>
+ {
TestBed.configureTestingModule({
- imports: [HttpClientTestingModule]
- }));
+ imports: [HttpClientTestingModule],
+ providers: [LogService, HttpClient, HttpClientTestingModule]
+ })
+ service = TestBed.get(LogService);
+
+});
it('should be created', () => {
const service: LogService = TestBed.get(LogService);
expect(service).toBeTruthy();
});
+
+ it('should getLogData', () => {
+ service.getLogData("test").subscribe((res) => {
+ expect(res).toBe(environment.baseUrl);
+ });
+ });
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts
index b50fc923..45bf2433 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/run/run.service.spec.ts
@@ -2,15 +2,60 @@ import { TestBed } from '@angular/core/testing';
import { RunService } from './run.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
describe('RunService', () => {
+ let service: RunService;
+
beforeEach(() =>
+ {
TestBed.configureTestingModule({
- imports: [HttpClientTestingModule]
- }));
+ imports: [HttpClientTestingModule],
+ providers: [HttpClient, HttpClientTestingModule, RunService]
+ });
+
+ service = TestBed.get(RunService);
+});
it('should be created', () => {
const service: RunService = TestBed.get(RunService);
expect(service).toBeTruthy();
});
+
+ it('should getReportData', () => {
+ service.getReportData("test").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should getReportDataWithFormFields', () => {
+ service.getReportDataWithFormFields("just", "testing").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should getDefinitionPageDetails', () => {
+ service.getDefinitionPageDetails(1).subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should refreshFormFields', () => {
+ service.refreshFormFields("just", "testing").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should getFormFieldGroupsData', () => {
+ service.getFormFieldGroupsData("test").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should downloadReportExcel', () => {
+ service.downloadReportExcel("test").subscribe((res) => {
+ expect(res).toBe(new Blob);
+ });
+ });
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts
index 3c495ce1..f339dcac 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.spec.ts
@@ -1,12 +1,104 @@
import { TestBed } from '@angular/core/testing';
import { SecurityService } from './security.service';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { environment } from 'src/environments/environment';
+import { HttpClient } from '@angular/common/http';
describe('SecurityService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
+ let service: SecurityService;
+
+ beforeEach(() =>{ TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [SecurityService, HttpClientTestingModule, HttpClient]
+ })
+ service = TestBed.get(SecurityService);
+});
it('should be created', () => {
const service: SecurityService = TestBed.get(SecurityService);
expect(service).toBeTruthy();
});
+
+ it('should get reportOwnerList', () => {
+ service.getReportOwnerList().subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportOwner");
+ });
+ });
+
+ it('should get getReportRoleList', () => {
+ service.getReportRoleList().subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportRoleList");
+ });
+});
+
+it('should get getReportSecurityInfo', () => {
+ service.getReportSecurityInfo().subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/wizard/security/getReportSecurityInfo");
+ });
+});
+
+it('should get getReportUserList', () => {
+ service.getReportUserList().subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/wizard/security/retrieveReportUserList");
+ });
+});
+
+it('should get getReportSecurityRoles', () => {
+ service.getReportSecurityRoles().subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/wizard/security/getReportSecurityRoles");
+ });
+});
+
+it('should get addReportUser', () => {
+ let userId = "test"
+ service.addReportUser(userId).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/addReportUser");
+ });
+});
+
+it('should get removeReportUser', () => {
+ let userId = "test"
+ service.removeReportUser(userId).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/removeReportUser");
+ });
+});
+
+it('should get addUserEditAccess', () => {
+ let userId = "test"
+ let readOnly = "dummy"
+ service.addUserEditAccess(userId, readOnly).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/toggleUserEditAccess/");
+ });
+});
+
+it('should get addReportRole', () => {
+ let userId = "test"
+ service.addReportRole(userId).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/addReportRole");
+ });
+});
+
+it('should get removeReportRole', () => {
+ let userId = "test"
+ service.removeReportRole(userId).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/removeReportRole");
+ });
+});
+
+it('should get addRoleEditAccess', () => {
+ let userId = "test"
+ let readOnly = "dummy"
+ service.addRoleEditAccess(userId, readOnly).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/toggleRoleEditAccess/");
+ });
+});
+
+it('should get saveSecurityTabInfo', () => {
+ let test : any;
+ service.saveSecurityTabInfo(test).subscribe((resp) => {
+ expect(resp).toBe(environment.baseUrl + "report/security/updateReportSecurityInfo");
+ });
+});
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts
index 0f09e4eb..795afc25 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.component.spec.ts
@@ -1,25 +1,136 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SQLComponent } from './sql.component';
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { FormsModule } from '@angular/forms';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { RouterTestingModule } from '@angular/router/testing';
+import { SqlService } from './sql.service';
+import { Observable, of } from 'rxjs';
+import { element } from '@angular/core/src/render3';
describe('SQLComponentComponent', () => {
+ let sqlService: SqlService;
let component: SQLComponent;
let fixture: ComponentFixture<SQLComponent>;
+ const reportId = "test";
+ const finalGetObj = {"query":"dummyQuery"}
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ SQLComponent ]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ declarations: [ SQLComponent ],
+ imports: [FormsModule, HttpClientTestingModule, RouterTestingModule],
+ providers: [SqlService]
})
.compileComponents();
+ sqlService = TestBed.get(SqlService);
}));
beforeEach(() => {
+
fixture = TestBed.createComponent(SQLComponent);
component = fixture.componentInstance;
+ component.reportId1 = reportId;
+ component.finalGetObj = finalGetObj;
+ sqlService = TestBed.get(SqlService);
fixture.detectChanges();
+
});
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('should test ngOnInit method', () => {
+
+ fixture.detectChanges();
+ component.ngOnInit();
+ expect(component.showSaveSQLDialog).toEqual(false);
+ expect(component.SQLPostResponse).toEqual(true);
+ expect(component.ValidatePostResponse).toEqual({});
+
+ (done: DoneFn)=> {
+ sqlService.getSQLTabData("test").subscribe(value => {
+ expect(component.showSpinner).toEqual(true);
+ expect(component.finalGetObj).toEqual(value);
+ expect(component.sqlText).toEqual(component.finalGetObj.query);
+ expect(component.showSpinner).toEqual(false);
+ done();
+ })
+ }
+
+ });
+
+ it('should test ngOnChanges method', () => {
+
+ fixture.detectChanges();
+ component.ngOnChanges();
+ expect(component.showSaveSQLDialog).toEqual(false);
+ expect(component.SQLPostResponse).toEqual(true);
+ expect(component.ValidatePostResponse).toEqual({});
+
+ sqlService.getSQLTabData("test").subscribe((response) => {
+ expect(component.showSpinner).toBe(true);
+ expect(component.finalGetObj).toBe(response);
+ expect(component.sqlText).toEqual(component.finalGetObj.query);
+ expect(component.showSpinner).toEqual(false);
+
+ });
+
+ });
+
+ it('should test saveSQL method', () => {
+ component.SQLPostResponse === true;
+ component.saveSQL();
+ expect(component.SQLstatus).toEqual("Success!");
+ expect(component.SQLmessage).toEqual("Your change has been saved! Definition is updated.");
+ expect(component.showSaveSQLDialog).toEqual(component.showSaveSQLDialog);
+ expect(component.SQLclosable).toEqual(true);
+ });
+
+ it('should test validate method', () => {
+
+ component.validate();
+
+ sqlService.postSQLValidateAndSave("test").subscribe((Response) => {
+ expect(component.showSpinner).toEqual(true);
+ expect(component.ValidateResponseString).toEqual(Response["data"]["elements"]);
+ expect(component.ValidatePostResponse).toEqual(JSON.parse(Response["data"]["elements"]));
+
+ component.ValidatePostResponse["query"] !== undefined;
+
+ expect(component.showModal).toEqual(true);
+ expect(component.Validatestatus).toEqual("SQL Test Run - Executed!");
+ expect(component.showValidateSQLDialog).toEqual(component.showValidateSQLDialog);
+ expect(component.Validateclosable).toEqual(true);
+ })
+ });
+
+ it('should test closeSaveModal method', () => {
+ component.closeSaveModal();
+ expect(component.showSaveSQLDialog).toEqual(component.showSaveSQLDialog);
+ expect(component.SQLclosable).toEqual(false);
+ });
+
+ it('should test closeValidateModal method', () => {
+ component.reportMode === "Create";
+ component.Validatestatus == "SQL Test Run - Failed!";
+
+ component.closeValidateModal();
+ expect(component.sqlText).toEqual(component.sqlText);
+ expect(component.showValidateSQLDialog).toEqual(component.showValidateSQLDialog);
+ expect(component.Validateclosable).toEqual(false);
+ });
+
+ it('should test SetValidateResponseString method', () => {
+ component.SetValidateResponseString("testing");
+ expect(component.ValidateResponseString).toEqual("testing");
+ });
+
+ it('should test GetValidateResponseString method', () => {
+ component.ValidateResponseString = 'test';
+ expect(component.GetValidateResponseString()).toEqual("test");
+ });
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.spec.ts
index 57db6fb6..68978d90 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.spec.ts
@@ -2,15 +2,36 @@ import { TestBed } from '@angular/core/testing';
import { SqlService } from './sql.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClient } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
describe('SqlService', () => {
- beforeEach(() =>
- TestBed.configureTestingModule({
- imports: [HttpClientTestingModule]
- }));
+
+ let service: SqlService;
+
+ beforeEach(() => {TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [SqlService, HttpClient, HttpClientTestingModule]
+ })
+ service = TestBed.get(SqlService);
+});
it('should be created', () => {
const service: SqlService = TestBed.get(SqlService);
expect(service).toBeTruthy();
});
+
+ it('should getSQLTabData', () => {
+ service.getSQLTabData("test").subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should postSQLValidateAndSave', () => {
+ service.postSQLValidateAndSave("test").subscribe((res) => {
+ expect(res).toBe(environment)
+ });
+ });
+
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html
index c0611493..846dae52 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html
@@ -59,14 +59,16 @@
</div>
</div>
<div class="form-row">
- <label for="textinputID-3a">Organization User ID</label>&nbsp;
+ <label for="textinputID-3a">Organization User ID</label>&nbsp;<a style="cursor: hand;" target="_new"
+ href="http://webphone.att.com/cgi-bin/webphones.pl?id={{profile.orgUserId}}">wephone</a>
<input [(ngModel)]="profile.orgUserId" type="text" name="orgUserId" class="form-control" id="orgUserId"
style="width: 100%;" disabled="true">
</div>
<div class="form-row">
<label for="textinputID-3a">Organization Manager ID</label>
- &nbsp;
+ &nbsp;<a style="cursor: hand;" target="_new"
+ href="http://webphone.att.com/cgi-bin/webphones.pl?id={{profile.orgManagerUserId}}">wephone</a>
<input [(ngModel)]="profile.orgManagerUserId" type="text" name="orgManagerUserId" class="form-control"
id="orgManagerUserId" style="
@@ -195,33 +197,7 @@
</div>
- <table mat-table [dataSource]="dataSource" matSort>
- <ng-container matColumnDef="name">
- <th mat-header-cell *matHeaderCellDef id="heading1"> Name</th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.name}} </td>
- </ng-container>
-
- <!--<ng-container matColumnDef="delete">
- <th mat-header-cell *matHeaderCellDef id="heading2"> Delete</th>
- <td id="rowheader_t1_{{i}}" mat-cell *matCellDef="let rowData; let i=index;">
- <span class="icon-trash" id="{{i}}-button-role-remove" (click)="removeRole(rowData)">
- <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)="toggleRoles(element)"></mat-slide-toggle>
- </td>
- </ng-container>
-
- <tr mat-header-row *matHeaderRowDef="userRolesHeader"></tr>
- <tr mat-row *matRowDef="let rowData; columns: userRolesHeader;">
-
- </table>
+ <rdp-data-table [data]="ociavailableRoles" [settings]="settings"></rdp-data-table>
<span class="ecomp-spinner" *ngIf="showSpinner"></span>
</div>
</div> \ No newline at end of file
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
index 23a2bb07..45210f80 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.ts
@@ -45,6 +45,7 @@ import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
import { ErrorModalComponent } from 'src/app/modals/error-modal/error-modal.component';
import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
+import { Column, ColumnTypes, DataTableSettings } from 'portalsdk-tag-lib';
@Component({
selector: 'app-self',
@@ -92,6 +93,9 @@ export class SelfComponent implements OnInit {
selectedTimeZone;
finalSelectedRoles: any;
+ public settings;
+ public columns: any = [];
+
ngOnInit() {
this.showSpinner = false;
@@ -145,7 +149,14 @@ export class SelfComponent implements OnInit {
}
}
- this.dataSource = new MatTableDataSource(this.ociavailableRoles);
+ console.log("Data : ", this.ociavailableRoles);
+ this.columns.push(new Column("name", "Name", ColumnTypes.TEXT, false, null));
+ this.settings = new DataTableSettings()
+ this.settings.columns = this.columns;
+ this.settings.isPaginationEnabled = false;
+ this.settings.isReadOnly = true;
+ this.settings.isTableSearchEnabled = false;
+ this.settings.isToggleEnabled = true;
if (this.ociavailableRoles != null) {
for (let role of this.ociavailableRoles) {
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts
index c93a83fb..c6a2de49 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts
@@ -1,17 +1,35 @@
import { TestBed } from '@angular/core/testing';
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientModule, HttpClient, HttpXhrBackend } from '@angular/common/http';
import { HeaderService } from './header.service';
+import { environment } from 'src/environments/environment';
+import { HttpTestingController } from '@angular/common/http/testing';
+import { get } from 'http';
+
describe('HeaderService', () => {
- beforeEach(() => TestBed.configureTestingModule({
- imports:[HttpClientModule]
- }));
+ let service: HeaderService;
+ let httpMock: HttpTestingController;
+
+ beforeEach(() =>{ TestBed.configureTestingModule({
+ imports:[HttpClientModule],
+ providers: [HttpClient, HeaderService, HttpTestingController],
+ });
+ service = TestBed.get(HeaderService);
+ httpMock = TestBed.get(HttpTestingController);
+});
it('should be created', () => {
const service: HeaderService = TestBed.get(HeaderService);
expect(service).toBeTruthy();
});
+
+ it('should test getTopMenuItems', () => {
+ service.getTopMenuItems().subscribe((res) => {
+ expect(res).toBe(environment.getTopMenu);
+ });
+ })
+
});
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts
index 6e8a3ba6..255e4d81 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts
@@ -4,6 +4,8 @@
* ===================================================================
* 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");
@@ -36,17 +38,42 @@
*
*/
import { TestBed } from '@angular/core/testing';
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientModule, HttpClient } from '@angular/common/http';
import { SidebarService } from './sidebar.service';
+import { environment } from 'src/environments/environment';
+import { inject } from '@angular/core';
+import { HttpTestingController } from '@angular/common/http/testing';
describe('SidenavService', () => {
- beforeEach(() => TestBed.configureTestingModule({
- imports: [HttpClientModule]
- }));
+
+ let service: SidebarService;
+ let httpMock: HttpTestingController;
+
+ beforeEach(() => { TestBed.configureTestingModule({
+ imports: [HttpClientModule],
+ providers: [SidebarService, HttpTestingController, HttpClient]
+ });
+
+ service = TestBed.get(SidebarService);
+ httpMock = TestBed.get(HttpTestingController);
+});
it('should be created', () => {
const service: SidebarService = TestBed.get(SidebarService);
expect(service).toBeTruthy();
});
+
+ it('should test getLeftMenu method', () =>{
+ service.getLeftMenu().subscribe((res) => {
+ expect(res).toBe(environment);
+ });
+ });
+
+ it('should test getPage method', () =>{
+ service.getPage("test").subscribe((res) => {
+ expect(res).toBe(environment.baseUrl+"test");
+ });
+});
+
});
diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts
index ede8aa25..d92ce320 100644
--- a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts
+++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts
@@ -12,6 +12,7 @@ export class RdpDataTableEditComponent implements OnInit {
@Input() settings: any;
@Input() rowdata: any;
@Input() isEditMode: boolean;
+ @Input() applicationService: any;
@Output() passEntry: EventEmitter<any> = new EventEmitter();
modalPopupTitle: string;
selectedRowData: any;
@@ -35,7 +36,18 @@ export class RdpDataTableEditComponent implements OnInit {
}
saveChanges() {
- this.passEntry.emit(this.rowdata);
+ this.applicationService.update(this.rowdata);
+ this.applicationService.statusResponse.subscribe(responseData => {
+ if (responseData == "200") {
+ console.log("Success")
+ this.applicationService.get();
+ this.applicationService.updatedData.subscribe(val => {
+ if (val) {
+ this.passEntry.emit(val);
+ }
+ })
+ }
+ })
this.activeModal.close();
}
diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html
index a87a7b70..4f98abd5 100644
--- a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html
+++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html
@@ -8,6 +8,7 @@
<i class="icon ion-md-person-add"></i>&nbsp;Add
</button>
</div>
+ <span class="rdp-spinner" *ngIf="showSpinner"></span>
<!-- <rdp-scroll-container [more]="hasMore()" [scrollOffset]="2500" [scrollDelay]="3000" (scrolled)="handleScroll($event)"
[class.full]="full" [class.part]="!full"> -->
<table mat-table #table [dataSource]="dataSource" style="width: 100%" matSort>
diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts
index 7187ca07..b833c6fb 100644
--- a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts
+++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts
@@ -77,7 +77,7 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
showAddButton: boolean = true;
result : any;
totalRowsCount: any;
-
+ showSpinner: boolean;
constructor(public dataTableService: RdpDataTableService, private rdpModal: RdpModalService) { }
@@ -221,36 +221,31 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
* @param rowData
*/
openEditModalPopup(rowData: any) {
+ this.showSpinner = true;
+ console.log("Row data : ", rowData);
this.cloneObject = Object.assign({}, rowData)
- console.log("Copied Object : ", this.cloneObject);
- if (this.cloneObject) {
- const modalRef = this.rdpModal.open(RdpDataTableEditComponent, { size: 'lg' });
- modalRef.componentInstance.title = 'Edit';
- modalRef.componentInstance.settings = this.settings;
- if (this.cloneObject != 'undefined' && this.cloneObject) {
- modalRef.componentInstance.rowdata = this.cloneObject;
- modalRef.componentInstance.isEditMode = true;
- this.isEditMode = true;
- } else {
- modalRef.componentInstance.rowdata = {};
- modalRef.componentInstance.isEditMode = false;
- this.isEditMode = false;
- }
- modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => {
- if (receivedEntry) {
- console.log("Original Object : ", rowData);
- let response = this.updateRow(receivedEntry);
- console.log("Response form application ",response);
- console.log("Entry : ",receivedEntry);
- rowData = receivedEntry;
- if(this.dataTableService.response == "Success"){
- console.log("Result is success, update the tabel");
- this.columnsInfoList.push(receivedEntry);
- console.log("Updtae column info list : ", this.columnsInfoList);
- }
- }
- });
+ console.log("Update or Add functionality intialized");
+ const modalRef = this.rdpModal.open(RdpDataTableEditComponent, { size: 'lg' });
+ modalRef.componentInstance.title = 'Edit';
+ modalRef.componentInstance.settings = this.settings;
+ if (this.cloneObject.data != 'undefined' && this.cloneObject) {
+ modalRef.componentInstance.rowdata = this.cloneObject;
+ modalRef.componentInstance.applicationService = this.applicationService;
+ modalRef.componentInstance.isEditMode = true;
+ this.isEditMode = true;
+ } else {
+ modalRef.componentInstance.rowdata = {};
+ modalRef.componentInstance.isEditMode = false;
+ this.isEditMode = false;
}
+ modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => {
+ if (receivedEntry) {
+ this.data = receivedEntry;
+ this.setData(this.data);
+ }
+ this.showSpinner = false;
+ });
+
}
handleScroll = (scrolled: boolean) => {
diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/public_api.ts b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/public_api.ts
index 47cda350..4856082b 100644
--- a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/public_api.ts
+++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/public_api.ts
@@ -13,4 +13,5 @@ export * from './lib/rdp/rdp-scroll-container/rdp-scroll-container.component';
export * from './lib/rdp/model/column';
export * from './lib/rdp/model/data-table-settings';
export * from './lib/rdp/rdp.module';
-export * from './lib/rdp/shared/rdpCrudInterface'; \ No newline at end of file
+export * from './lib/rdp/shared/rdpCrudInterface';
+export * from './lib/rdp/services/rdp-modal.service'; \ No newline at end of file