From 220a25a2566c90bc540e7190342f73824d2ff54a Mon Sep 17 00:00:00 2001 From: mravula Date: Mon, 31 Aug 2020 12:29:32 -0400 Subject: Raptor UI Changes, user profile, folder restructure Issue-ID: PORTAL-902 Change-Id: Ib76bb3fce7efe55504b75d2fc4764bafb9f8e908 Signed-off-by: mravula --- .../db-scripts/EcompSdkDMLMySql_3_3_OS.sql | 4 +- ecomp-sdk/epsdk-app-os/ngappsrc/angular.json | 4 +- .../ngappsrc/src/app/app-routing.module.ts | 10 +-- .../epsdk-app-os/ngappsrc/src/app/app.module.ts | 31 ++++++++- .../src/app/layout/layout-routing.module.ts | 8 ++- .../ngappsrc/src/app/pages/ext/profile/.gitignore | 2 - .../src/app/pages/ext/profile/profile.module.ts | 10 --- .../app/pages/ext/profile/profile.service.spec.ts | 78 ---------------------- .../src/app/pages/ext/profile/profile.service.ts | 69 ------------------- .../ngappsrc/src/app/pages/pages-routing.module.ts | 18 +---- .../ngappsrc/src/app/pages/pages.module.ts | 36 +++------- .../user-profile/profile/profile.service.spec.ts | 78 ++++++++++++++++++++++ .../app/user-profile/profile/profile.service.ts | 73 ++++++++++++++++++++ .../user-profile/user-profile-routing.module.ts | 24 +++++++ .../app/user-profile/user-profile.component.html | 1 + .../app/user-profile/user-profile.component.scss | 0 .../user-profile/user-profile.component.spec.ts | 26 ++++++++ .../src/app/user-profile/user-profile.component.ts | 15 +++++ .../src/app/user-profile/user-profile.module.ts | 36 ++++++++++ ecomp-sdk/epsdk-app-os/ngappsrc/src/polyfills.ts | 27 ++++++-- 20 files changed, 329 insertions(+), 221 deletions(-) delete mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/.gitignore delete mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.module.ts delete mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts delete mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.spec.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile-routing.module.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.html create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.scss create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.spec.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.module.ts (limited to 'ecomp-sdk/epsdk-app-os') diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_3_3_OS.sql b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_3_3_OS.sql index f13a4bb5..6d023a77 100644 --- a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_3_3_OS.sql +++ b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_3_3_OS.sql @@ -41,8 +41,8 @@ UPDATE fn_menu SET `IMAGE_SRC`='icon ion-md-star' WHERE `LABEL`='Admin'; -- updating fn_menu ACTION url UPDATE fn_menu SET ACTION='welcome' WHERE LABEL='Home'; -UPDATE fn_menu SET ACTION='v2/app/userProfile' WHERE LABEL='Search'; -UPDATE fn_menu SET ACTION='v2/app/userProfile/self_profile' WHERE LABEL='Self'; +UPDATE fn_menu SET ACTION='v2/userProfile' WHERE LABEL='Search'; +UPDATE fn_menu SET ACTION='v2/userProfile/self_profile' WHERE LABEL='Self'; UPDATE fn_menu SET ACTION='v2/admin/admin' WHERE LABEL='Roles'; UPDATE fn_menu SET ACTION='v2/admin/role_function_list' WHERE LABEL='Role Functions'; diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/angular.json b/ecomp-sdk/epsdk-app-os/ngappsrc/angular.json index 64b13511..5030cfc4 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/angular.json +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/angular.json @@ -25,7 +25,7 @@ "src/styles/app.scss", "node_modules/ionicons/dist/scss/ionicons.scss" ], - "scripts": [] + "scripts": ["src/app/shared/utils/utils.js","node_modules/chart.js/dist/Chart.js","node_modules/angular7-word-cloud/d3.min.js"] }, "configurations": { "production": { @@ -143,4 +143,4 @@ "prefix": "app" } } -} \ No newline at end of file +} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app-routing.module.ts index 4de2ea84..b1ef789a 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app-routing.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app-routing.module.ts @@ -36,13 +36,13 @@ * */ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import {Routes, RouterModule, PreloadAllModules} from '@angular/router'; const routes: Routes = [ - { path: 'v2', loadChildren: () => import('./layout/layout.module').then(m => m.LayoutModule) }, - { path: 'error', loadChildren: () => import('./server-error/server-error.module').then(m => m.ServerErrorModule) }, - { path: 'access-denied', loadChildren: () => import('./access-denied/access-denied.module').then(m => m.AccessDeniedModule) }, - { path: 'not-found', loadChildren: () => import('./not-found/not-found.module').then(m => m.NotFoundModule) }, + { path: 'v2', loadChildren: './layout/layout.module#LayoutModule' }, + { path: 'error', loadChildren: './server-error/server-error.module#ServerErrorModule' }, + { path: 'access-denied', loadChildren: './access-denied/access-denied.module#AccessDeniedModule' }, + { path: 'not-found', loadChildren: './not-found/not-found.module#NotFoundModule' }, { path: '**', redirectTo: 'not-found' } ]; diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app.module.ts index f03232d9..36b8c5f1 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/app.module.ts @@ -47,8 +47,22 @@ import { SidebarService } from './shared/services/index'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { UserService } from './shared/services/user/user.service'; + +import {MaterialModule} from './material-module'; + +import {GridsterModule} from 'angular-gridster2'; + +import { RouterModule} from '@angular/router'; + import { HeaderInterceptor } from './shared/interceptors/header-interceptor'; import { CookieService } from 'ngx-cookie-service'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import { InformationModalComponent } from './modals/information-modal/information-modal.component'; +import { ConfirmationModalComponent } from './modals/confirmation-modal/confirmation-modal.component'; +import { SuccessModalComponent } from './modals/success-modal/success-modal.component'; +import { ErrorModalComponent } from './modals/error-modal/error-modal.component'; +import {RdpModule} from 'portalsdk-tag-lib'; +import {HttpCacheService} from './shared/services/cache.service'; @NgModule({ imports: [ @@ -60,12 +74,23 @@ import { CookieService } from 'ngx-cookie-service'; FormsModule, MatNativeDateModule, ReactiveFormsModule, + MaterialModule, GridsterModule, + RouterModule, + NgbModule ], - declarations: [AppComponent], - providers: [SidebarService,UserService,CookieService,{ + declarations: [AppComponent, + ConfirmationModalComponent, + InformationModalComponent, + SuccessModalComponent, + ErrorModalComponent], + entryComponents: [ConfirmationModalComponent, + InformationModalComponent, + SuccessModalComponent, + ErrorModalComponent], + providers: [SidebarService,UserService,CookieService,HttpCacheService,{ provide: HTTP_INTERCEPTORS, useClass: HeaderInterceptor, - multi: true, + multi: true }], bootstrap: [AppComponent] }) diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/layout/layout-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/layout/layout-routing.module.ts index a2c44ec6..29ecf653 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/layout/layout-routing.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/layout/layout-routing.module.ts @@ -44,9 +44,11 @@ const routes: Routes = [ path: '', component: LayoutComponent, children: [ - { path: '', loadChildren: () => import('../welcome-module/welcome-module').then(m => m.WelcomeModule) }, - { path: 'admin', loadChildren: () => import('../admin/admin.module').then(m => m.AdminModule) }, - { path: 'app', loadChildren: () => import('../pages/pages.module').then(m => m.PagesModule) }, + { path: '', loadChildren: '../welcome-module/welcome-module#WelcomeModule' }, + { path: 'admin', loadChildren: '../admin/admin.module#AdminModule' }, + { path: 'userProfile', loadChildren: '../user-profile/user-profile.module#UserProfile' }, + { path: 'app', loadChildren: '../pages/pages.module#PagesModule' }, + { path: 'run', loadChildren: '../report-run/report-run.module#ReportRun' } ] } ]; diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/.gitignore b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/.gitignore deleted file mode 100644 index 741b049d..00000000 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -search -self \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.module.ts deleted file mode 100644 index 9cffa3b3..00000000 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -@NgModule({ - declarations: [], - imports: [ - CommonModule - ] -}) -export class ProfileModule { } 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 deleted file mode 100644 index 70e8ac4b..00000000 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.spec.ts +++ /dev/null @@ -1,78 +0,0 @@ -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', () => { - - let service: ProfileService; - - beforeEach(() => {TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], - providers: [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-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts deleted file mode 100644 index 1c631347..00000000 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { environment } from 'src/environments/environment'; - -@Injectable({ - providedIn: 'root' -}) -export class ProfileService { - - constructor(private http:HttpClient) { } - - getUserPagination(){ - return this.http.get(environment.getUserPagination); - } - - getAllUsers(){ - return this.http.get(environment.getAllUsers); - } - - getPostSearch(postSearchBean:any) - { - return this.http.post(environment.postSearch,JSON.stringify({postSearchBean: postSearchBean})); - - } - - importUser(postSearchBean:any) - { - return this.http.post(environment.importSearch,JSON.stringify({postSearchBean: postSearchBean})); - - } - - getPostProfile() - { - return this.http.get(environment.getPostProfile); - - } - - getSelfProfile() - { - return this.http.get(environment.getSelfProfile); - - } - - getProfileById(profileId){ - return this.http.get(environment.getProfileById+"?profile_id="+profileId); - } - - removeRole(data,profileId) - { - return this.http.post(environment.removeUserRole+'?profile_id='+profileId,JSON.stringify({role: data})); - } - - addUserRole(data,profileId) - { - return this.http.post(environment.addUserRole+'?profile_id='+profileId,JSON.stringify({role: data})); - } - - saveProfile(data,profileId) - { - return this.http.post(environment.saveProfile+'?profile_id='+profileId,JSON.stringify({profile: data.profile,selectedCountry:data.selectedCountry, selectedState:data.selectedState, selectedTimeZone:data.selectedTimeZone})); - - } - - toggleProfileActive(profileId){ - return this.http.get(environment.toggleProfileActive+profileId); - } - - -} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts index 20120d6c..fe38e10e 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts @@ -1,29 +1,15 @@ import {NgModule} from '@angular/core'; -import {Routes, RouterModule, ActivatedRoute} from '@angular/router'; -import {RoleFunctionsComponent} from '../admin/role-functions/role-functions.component'; -import {UsageComponent} from '../admin/usage/usage.component'; -import {CacheAdminComponent} from '../admin/cache-admin/cache-admin.component'; -import {RolesComponent} from '../admin/roles/roles.component'; -import {MenusComponent} from '../admin/menus/menus.component'; -import {SearchComponent} from './ext/profile/search/search.component'; -import {SelfComponent} from './ext/profile/self/self.component'; +import {Routes, RouterModule} from '@angular/router'; import {ReportComponent} from './analytics/Report_List/Report/report.component'; -import {RunReportComponent} from './analytics/Report_List/Report/run/run-report/run-report.component'; import {HeaderTabsWrapperComponent} from './analytics/Report_List/header-tabs-wrapper-component/header-tabs-wrapper.component'; -import {RunReportFormFieldsComponent} from './analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component'; + import {RefreshComponent} from './refresh/refresh.component'; const routes: Routes = [ - {path: 'userProfile', component: SearchComponent}, - {path: 'userProfile/self_profile', component: SelfComponent}, {path: 'report-list', component: ReportComponent}, {path: 'create', component: HeaderTabsWrapperComponent}, {path: 'reports/:reportMode/:reportId', component: HeaderTabsWrapperComponent}, - {path: 'run/:reportId', component: RunReportFormFieldsComponent}, - {path: 'run/:reportId/:queryParameters', component: RunReportFormFieldsComponent}, - {path: 'run/:reportId/:queryParameters/:groupSelectValue', component: RunReportFormFieldsComponent}, - {path: 'run', component: RunReportFormFieldsComponent}, {path: 'refresh', component: RefreshComponent}, ]; diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages.module.ts index fb5f8130..ca1297be 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages.module.ts @@ -8,20 +8,15 @@ import {MaterialModule} from '../material-module'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; import {MatTooltipModule} from '@angular/material/tooltip'; import {MatExpansionModule} from '@angular/material/expansion'; -import {SuccessModalComponent} from '../modals/success-modal/success-modal.component'; -import {ErrorModalComponent} from '../modals/error-modal/error-modal.component'; import {MatFormFieldModule} from '@angular/material/form-field'; -import {SearchComponent} from './ext/profile/search/search.component'; -import {SelfComponent} from './ext/profile/self/self.component'; import {DefinitionComponent} from './analytics/Report_List/Report/definition/definition.component'; import {MatTabsModule, MatGridListModule, MatCardModule, MatMenuModule, MatButtonModule} from '@angular/material'; import {SQLComponent} from './analytics/Report_List/Report/sql/sql.component'; import {ColumnsComponent} from './analytics/Report_List/Report/columns/columns.component'; -import {FormFieldsComponent, DialogOverviewExampleDialog} from './analytics/Report_List/Report/form-fields/form-fields.component'; +import {FormFieldsComponent, DialogOverviewExampleDialog, EditGroupDialog} from './analytics/Report_List/Report/form-fields/form-fields.component'; import {ChartWizardComponent} from './analytics/Report_List/Report/chart-wizard/chart-wizard.component'; import {SecurityComponent} from './analytics/Report_List/Report/security/security.component'; import {LogComponent} from './analytics/Report_List/Report/log/log.component'; -import {RunComponent} from './analytics/Report_List/Report/run/run.component'; import {MatButtonToggleModule} from '@angular/material/button-toggle'; import {DefinitionSaveDialogComponent} from './analytics/Report_List/Report/definition/definition-save-dialog/definition-save-dialog.component'; import {SQLSaveChangesDialogComponent} from './analytics/Report_List/Report/sql/sql-save-changes-dialog/sql-save-changes-dialog.component'; @@ -37,14 +32,10 @@ import {MatIconModule} from '@angular/material/icon'; import {ColumnsEditComponent} from './analytics/Report_List/Report/columns/columns-edit-component/columns-edit.component'; import {HeaderTabsComponent} from './analytics/Report_List/header-tabs-component/header-tabs.component'; import {ReportListComponent} from './analytics/Report_List/report-list.component'; -import {RunReportComponent} from './analytics/Report_List/Report/run/run-report/run-report.component'; import {HeaderTabsWrapperComponent} from './analytics/Report_List/header-tabs-wrapper-component/header-tabs-wrapper.component'; import {EditDrillDownLinkComponent} from './analytics/Report_List/Report/columns/columns-edit-component/edit-drill-down-link/edit-drill-down-link.component'; import {FormFieldsAddEditComponent} from './analytics/Report_List/Report/form-fields/form-fields-add-edit/form-fields-add-edit.component'; -import {RunReportFormFieldsComponent} from './analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component'; -import {RunReportResultSetComponent} from './analytics/Report_List/Report/run/run-report-result-set/run-report-result-set.component'; import {GridsterModule} from 'angular-gridster2'; -import {ConfirmationModalComponent } from '../modals/confirmation-modal/confirmation-modal.component'; import {LayoutModule} from '@angular/cdk/layout'; import {Ng6O2ChartModule} from 'ng6-o2-chart'; import {TagCloudModule} from 'angular-tag-cloud-module'; @@ -52,21 +43,16 @@ import {GoogleChartsModule} from 'angular-google-charts'; import {jqxChartModule} from 'jqwidgets-ng/jqxchart'; 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 {NumbersOnlyDirective} from './analytics/Report_List/Report/chart-wizard/numbers-only.directive'; import {ColumnAdvancedDisplayComponent} from './analytics/Report_List/Report/columns/columns-edit-component/column-advanced-display/column-advanced-display.component'; import {RdpModule} from 'portalsdk-tag-lib'; import {RefreshComponent} from './refresh/refresh.component'; +import {ReportRun} from '../report-run/report-run.module'; @NgModule({ declarations: [ PagesComponent, - SearchComponent, - ConfirmationModalComponent, - SelfComponent, - SuccessModalComponent, - ErrorModalComponent, DefinitionComponent, SQLComponent, ColumnsComponent, @@ -74,7 +60,6 @@ import {RefreshComponent} from './refresh/refresh.component'; ChartWizardComponent, SecurityComponent, LogComponent, - RunComponent, DefinitionSaveDialogComponent, SQLSaveChangesDialogComponent, SQLValidateChangesDialogComponent, @@ -85,17 +70,16 @@ import {RefreshComponent} from './refresh/refresh.component'; ColumnsEditComponent, HeaderTabsComponent, ReportListComponent, - RunReportComponent, HeaderTabsWrapperComponent, EditDrillDownLinkComponent, FormFieldsAddEditComponent, - RunReportFormFieldsComponent, - RunReportResultSetComponent, - DashboardReportGridComponent, DataChartComponent, RunDashboardReportComponent, + DashboardReportGridComponent, + DataChartComponent, DialogOverviewExampleDialog, ColumnAdvancedDisplayComponent, NumbersOnlyDirective, - RefreshComponent + RefreshComponent, + EditGroupDialog ], imports: [ CommonModule, @@ -131,11 +115,11 @@ import {RefreshComponent} from './refresh/refresh.component'; GoogleChartsModule.forRoot(), GridsterModule, jqxChartModule, - RdpModule - ], - entryComponents: [DialogOverviewExampleDialog, SuccessModalComponent, ErrorModalComponent, SelfComponent, ConfirmationModalComponent], - exports: [ + RdpModule, + ReportRun ], + entryComponents: [DialogOverviewExampleDialog,EditGroupDialog], + exports: [], providers: [] }) diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.spec.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.spec.ts new file mode 100644 index 00000000..70e8ac4b --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.spec.ts @@ -0,0 +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', () => { + + let service: ProfileService; + + beforeEach(() => {TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [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-os/ngappsrc/src/app/user-profile/profile/profile.service.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.ts new file mode 100644 index 00000000..c40e7618 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/profile/profile.service.ts @@ -0,0 +1,73 @@ +import { Injectable } from '@angular/core'; +import {HttpClient, HttpHeaders } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class ProfileService { + + constructor(private http: HttpClient) { + } + + getUserPagination(){ + return this.http.get(environment.getUserPagination); + } + + getAllUsers(){ + return this.http.get(environment.getAllUsers); + } + + getPostSearch(postSearchBean:any) + { + return this.http.post(environment.postSearch,JSON.stringify({postSearchBean: postSearchBean})); + + } + + importUser(postSearchBean:any) + { + return this.http.post(environment.importSearch,JSON.stringify({postSearchBean: postSearchBean})); + + } + + getPostProfile() + { + return this.http.get(environment.getPostProfile); + + } + + getSelfProfile() + { + return this.http.get(environment.getSelfProfile); + + } + + getProfileById(profileId){ + return this.http.get(environment.getProfileById+"?profile_id="+profileId); + } + + removeRole(data,profileId) + { + return this.http.post(environment.removeUserRole+'?profile_id='+profileId,JSON.stringify({role: data})); + } + + addUserRole(data,profileId) + { + return this.http.post(environment.addUserRole+'?profile_id='+profileId,JSON.stringify({role: data})); + } + + saveProfile(data, profileId) { + return this.http.post(environment.saveProfile + '?profile_id=' + profileId, JSON.stringify({ + profile: data.profile, + selectedCountry: data.selectedCountry, + selectedState: data.selectedState, + selectedTimeZone: data.selectedTimeZone + })); + + } + + toggleProfileActive(profileId){ + return this.http.get(environment.toggleProfileActive+profileId); + } + +} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile-routing.module.ts new file mode 100644 index 00000000..ec4f8194 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile-routing.module.ts @@ -0,0 +1,24 @@ +import {RouterModule, Routes} from '@angular/router'; +import {NgModule} from '@angular/core'; +import {UserProfileComponent} from './user-profile.component'; +import {SearchComponent} from './profile/search/search.component'; +import {SelfComponent} from './profile/self/self.component'; + +const routes: Routes = [ + { + path: '', + component: UserProfileComponent, + children: [ + {path: '', component: SearchComponent}, + {path: 'self_profile', component: SelfComponent}, + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class UserProfileRouting{ + +} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.html b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.html new file mode 100644 index 00000000..0680b43f --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.html @@ -0,0 +1 @@ + diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.scss b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.spec.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.spec.ts new file mode 100644 index 00000000..56240ec5 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.spec.ts @@ -0,0 +1,26 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { UserProfileComponent } from './user-profile.component'; + +describe('UserProfileComponent', () => { + let component: UserProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserProfileComponent ], + imports: [ RouterTestingModule] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.ts new file mode 100644 index 00000000..2856d870 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-user-profile', + templateUrl: './user-profile.component.html', + styleUrls: ['./user-profile.component.scss'] +}) +export class UserProfileComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.module.ts new file mode 100644 index 00000000..9aca44ff --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/user-profile/user-profile.module.ts @@ -0,0 +1,36 @@ +import {NgModule} from '@angular/core'; +import {SelfComponent} from './profile/self/self.component'; +import {SearchComponent} from './profile/search/search.component'; +import {FormsModule} from '@angular/forms'; +import {MatSortModule} from '@angular/material/sort'; +import { + MatFormFieldControl, + MatFormFieldModule, MatInputModule, + MatPaginatorModule, + MatSelectModule, + MatSlideToggleModule, + MatTableModule +} from '@angular/material'; +import {RdpModule} from 'portalsdk-tag-lib'; +import {UserProfileComponent} from './user-profile.component'; +import {UserProfileRouting} from './user-profile-routing.module'; +import {CommonModule} from '@angular/common'; + +@NgModule({ + declarations: [SelfComponent, SearchComponent, UserProfileComponent ], + imports: [ + MatInputModule, + FormsModule, + MatTableModule, + MatFormFieldModule, + MatSlideToggleModule, + MatPaginatorModule, + MatSelectModule, + RdpModule, UserProfileRouting, CommonModule, MatSortModule + + ], + entryComponents: [SelfComponent] +}) +export class UserProfile{ + +} diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/polyfills.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/polyfills.ts index b21ecc3c..572c150d 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/polyfills.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/polyfills.ts @@ -24,21 +24,38 @@ * Googlebot uses a renderer based on Chrome 41. * https://developers.google.com/search/docs/guides/rendering **/ -// import 'core-js/es6/array'; +import 'core-js/es6/array'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. +import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following for the Reflect API. */ import 'core-js/es6/reflect'; import 'core-js/es7/reflect'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; +import 'core-js/es7/array'; +import 'custom-event-polyfill'; + /** * Web Animations `@angular/platform-browser/animations` * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + import 'web-animations-js'; // Run `npm install --save web-animations-js`. /** * By default, zone.js will patch all possible macroTask and DomEvents @@ -53,7 +70,7 @@ import 'core-js/es7/reflect'; * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js * with the following flag, it will bypass `zone.js` patch for IE/Edge */ -// (window as any).__Zone_enable_cross_context_check = true; +(window as any).__Zone_enable_cross_context_check = true; /*************************************************************************************************** * Zone JS is required by default for Angular itself. @@ -62,4 +79,4 @@ import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS - */ + */ \ No newline at end of file -- cgit 1.2.3-korg