From 8429bcdf93e653061e972689774bbab3966742e2 Mon Sep 17 00:00:00 2001 From: statta Date: Fri, 16 Aug 2019 12:14:10 -0400 Subject: Migrating screens to Angular 7 Issue-ID: PORTAL-706 Change-Id: Ic3feb4019923040aafe6e9a97a60b41165be8b40 Signed-off-by: statta --- .../ngapp/src/app/app-routing.module.ts | 53 +++++++++++ .../epsdk-app-os/ngapp/src/app/app.component.html | 1 + .../epsdk-app-os/ngapp/src/app/app.component.scss | 37 ++++++++ .../ngapp/src/app/app.component.spec.ts | 68 ++++++++++++++ .../epsdk-app-os/ngapp/src/app/app.component.ts | 51 +++++++++++ .../epsdk-app-os/ngapp/src/app/app.module.spec.ts | 13 +++ ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.ts | 66 ++++++++++++++ .../epsdk-app-os/ngapp/src/app/material-module.ts | 98 +++++++++++++++++++++ .../ngapp/src/environments/environment.prod.ts | 3 + .../ngapp/src/environments/environment.ts | 37 ++++++++ ecomp-sdk/epsdk-app-os/ngapp/src/favicon.ico | Bin 0 -> 5430 bytes ecomp-sdk/epsdk-app-os/ngapp/src/karma.conf.js | 51 +++++++++++ ecomp-sdk/epsdk-app-os/ngapp/src/main.ts | 12 +++ ecomp-sdk/epsdk-app-os/ngapp/src/ngwelcome.html | 55 ++++++++++++ ecomp-sdk/epsdk-app-os/ngapp/src/polyfills.ts | 65 ++++++++++++++ ecomp-sdk/epsdk-app-os/ngapp/src/test.ts | 32 +++++++ ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.app.json | 11 +++ .../epsdk-app-os/ngapp/src/tsconfig.spec.json | 18 ++++ ecomp-sdk/epsdk-app-os/ngapp/src/typings.d.ts | 5 ++ 19 files changed, 676 insertions(+) create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app-routing.module.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.html create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.scss create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.spec.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.spec.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/app/material-module.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.prod.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/favicon.ico create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/karma.conf.js create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/main.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/ngwelcome.html create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/polyfills.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/test.ts create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.app.json create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.spec.json create mode 100644 ecomp-sdk/epsdk-app-os/ngapp/src/typings.d.ts (limited to 'ecomp-sdk/epsdk-app-os/ngapp/src') diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app-routing.module.ts new file mode 100644 index 00000000..4de2ea84 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app-routing.module.ts @@ -0,0 +1,53 @@ +/* + * ============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 { Routes, RouterModule } 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: '**', redirectTo: 'not-found' } +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule {} diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.html b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.html new file mode 100644 index 00000000..0680b43f --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.html @@ -0,0 +1 @@ + diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.scss b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.scss new file mode 100644 index 00000000..8cacac55 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.scss @@ -0,0 +1,37 @@ +/* + * ============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============================================ + * + * + */ \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.spec.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.spec.ts new file mode 100644 index 00000000..42dab6ea --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.spec.ts @@ -0,0 +1,68 @@ +/* + * ============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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { APP_BASE_HREF } from '@angular/common'; + +import { AppComponent } from './app.component'; +import { AppModule } from './app.module'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture; + + beforeEach( + async(() => { + TestBed.configureTestingModule({ + imports: [AppModule], + providers: [ + { provide: APP_BASE_HREF, useValue: '/' }, + ] + }).compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.ts new file mode 100644 index 00000000..472404a9 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.component.ts @@ -0,0 +1,51 @@ +/* + * ============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'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] +}) +export class AppComponent implements OnInit { + constructor() { + } + + ngOnInit() { + } +} diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.spec.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.spec.ts new file mode 100644 index 00000000..376189d6 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.spec.ts @@ -0,0 +1,13 @@ +import { AppModule } from './app.module'; + +describe('AppModule', () => { + let appModule: AppModule; + + beforeEach(() => { + appModule = new AppModule(); + }); + + it('should create an instance', () => { + expect(appModule).toBeTruthy(); + }); +}); diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.ts new file mode 100644 index 00000000..a86ea759 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/app.module.ts @@ -0,0 +1,66 @@ +/* + * ============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 { CommonModule } from '@angular/common'; +import { HttpClientModule } from '@angular/common/http'; +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {MatNativeDateModule} from '@angular/material/core'; + +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'; + +@NgModule({ + imports: [ + CommonModule, + BrowserModule, + BrowserAnimationsModule, + HttpClientModule, + AppRoutingModule, + FormsModule, + MatNativeDateModule, + ReactiveFormsModule, + ], + declarations: [AppComponent], + providers: [SidebarService,UserService], + bootstrap: [AppComponent] +}) +export class AppModule {} diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/app/material-module.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/app/material-module.ts new file mode 100644 index 00000000..aa960f39 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/app/material-module.ts @@ -0,0 +1,98 @@ +import {NgModule} from '@angular/core'; +import {A11yModule} from '@angular/cdk/a11y'; +import {DragDropModule} from '@angular/cdk/drag-drop'; +import {PortalModule} from '@angular/cdk/portal'; +import {ScrollingModule} from '@angular/cdk/scrolling'; +import {CdkStepperModule} from '@angular/cdk/stepper'; +import {CdkTableModule} from '@angular/cdk/table'; +import {CdkTreeModule} from '@angular/cdk/tree'; +import {MatAutocompleteModule} from '@angular/material/autocomplete'; +import {MatBadgeModule} from '@angular/material/badge'; +import {MatBottomSheetModule} from '@angular/material/bottom-sheet'; +import {MatButtonModule} from '@angular/material/button'; +import {MatButtonToggleModule} from '@angular/material/button-toggle'; +import {MatCardModule} from '@angular/material/card'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatChipsModule} from '@angular/material/chips'; +import {MatStepperModule} from '@angular/material/stepper'; +import {MatDatepickerModule} from '@angular/material/datepicker'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatDividerModule} from '@angular/material/divider'; +import {MatExpansionModule} from '@angular/material/expansion'; +import {MatFormFieldModule} from '@angular/material'; +import {MatGridListModule} from '@angular/material/grid-list'; +import {MatIconModule} from '@angular/material/icon'; +import {MatInputModule} from '@angular/material/input'; +import {MatListModule} from '@angular/material/list'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatNativeDateModule, MatRippleModule} from '@angular/material/core'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatProgressBarModule} from '@angular/material/progress-bar'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import {MatRadioModule} from '@angular/material/radio'; +import {MatSelectModule} from '@angular/material/select'; +import {MatSidenavModule} from '@angular/material/sidenav'; +import {MatSliderModule} from '@angular/material/slider'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import {MatSnackBarModule} from '@angular/material/snack-bar'; +import {MatSortModule} from '@angular/material/sort'; +import {MatTableModule} from '@angular/material/table'; +import {MatTabsModule} from '@angular/material/tabs'; +import {MatToolbarModule} from '@angular/material/toolbar'; +import {MatTooltipModule} from '@angular/material/tooltip'; +import {MatTreeModule} from '@angular/material/tree'; + + +@NgModule({ + exports: [ + A11yModule, + CdkStepperModule, + CdkTableModule, + CdkTreeModule, + DragDropModule, + MatAutocompleteModule, + MatBadgeModule, + MatBottomSheetModule, + MatButtonModule, + MatButtonToggleModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatStepperModule, + MatDatepickerModule, + MatDialogModule, + MatDividerModule, + MatExpansionModule, + MatFormFieldModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatRippleModule, + MatSelectModule, + MatSidenavModule, + MatSliderModule, + MatSlideToggleModule, + MatSnackBarModule, + MatSortModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + MatTreeModule, + PortalModule, + ScrollingModule, + ] +}) +export class MaterialModule {} + + +/** Copyright 2019 Google Inc. All Rights Reserved. + Use of this source code is governed by an MIT-style license that + can be found in the LICENSE file at http://angular.io/license */ \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.prod.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.prod.ts new file mode 100644 index 00000000..3612073b --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.ts new file mode 100644 index 00000000..eecaec4a --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/environments/environment.ts @@ -0,0 +1,37 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, + baseUrl: 'http://www.sdk.onap.org:8080/epsdk-app-os/', + roleFunctionList: 'http://www.sdk.onap.org:8080/epsdk-app-os/get_role_functions', + addRoleFunction: 'http://www.sdk.onap.org:8080/epsdk-app-os/role_function_list/addRoleFunction', + usageList: 'http://www.sdk.onap.org:8080/epsdk-app-os/get_usage_list', + cachedRegions: 'http://www.sdk.onap.org:8080/epsdk-app-os/get_regions', + getRole:'http://www.sdk.onap.org:8080/epsdk-app-os/get_role', + getFnMenuItems:'http://www.sdk.onap.org:8080/epsdk-app-os/admin_fn_menu', + getUserPagination:'http://www.sdk.onap.org:8080/epsdk-app-os/get_user_pagination', + deleteRole:'http://www.sdk.onap.org:8080/epsdk-app-os/role_list/removeRole', + getTopMenu:'http://www.sdk.onap.org:8080/epsdk-app-os/get_topMenuInfo', + deleteRoleFunction:'http://www.sdk.onap.org:8080/epsdk-app-os/role_function_list/removeRoleFunction', + deleteMenu:'http://www.sdk.onap.org:8080/epsdk-app-os/admin_fn_menu/removeMenuItem.htm', + getRegion:'http://www.sdk.onap.org:8080/epsdk-app-os/jcs_admin/showRegionDetails', + postSearch:'http://www.sdk.onap.org:8080/epsdk-app-os/post_search/search', + importSearch:'http://www.sdk.onap.org:8080/epsdk-app-os/post_search/process', + getPostProfile:'http://www.sdk.onap.org:8080/epsdk-app-os/post_search_sample', + getSelfProfile:'http://www.sdk.onap.org:8080/epsdk-app-os/get_self_profile', + removeUserRole:'http://www.sdk.onap.org:8080/epsdk-app-os/profile/removeRole', + saveProfile :'http://www.sdk.onap.org:8080/epsdk-app-os/profile/saveProfile', + getFunctionalMenuStaticDetail :'http:/www.sdk.onap.org:8080/epsdk-app-att/get_topMenuInfo', + getLeftMenu :'http://www.sdk.onap.org:8080/epsdk-app-att/get_menu' +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/favicon.ico b/ecomp-sdk/epsdk-app-os/ngapp/src/favicon.ico new file mode 100644 index 00000000..8081c7ce Binary files /dev/null and b/ecomp-sdk/epsdk-app-os/ngapp/src/favicon.ico differ diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/karma.conf.js b/ecomp-sdk/epsdk-app-os/ngapp/src/karma.conf.js new file mode 100644 index 00000000..3006a5b7 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/karma.conf.js @@ -0,0 +1,51 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + const defaults = { + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../coverage'), + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + } + + if (process.env.TEST_CI) { + Object.assign(defaults, { + autoWatch: false, + browsers: ['ChromeHeadlessNoSandbox'], + singleRun: true, + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + } + }, + browserNoActivityTimeout: 60000, + }) + } + + config.set(defaults) +}; diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/main.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/main.ts new file mode 100644 index 00000000..c7b673cf --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/ngwelcome.html b/ecomp-sdk/epsdk-app-os/ngapp/src/ngwelcome.html new file mode 100644 index 00000000..d290b96f --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/ngwelcome.html @@ -0,0 +1,55 @@ + + + + + + + Portal SDK + + + + + + + + + + + + diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/polyfills.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/polyfills.ts new file mode 100644 index 00000000..b21ecc3c --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/polyfills.ts @@ -0,0 +1,65 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** +* BROWSER POLYFILLS +*/ + + +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// 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`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + +/** + * 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`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * 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; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/test.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/test.ts new file mode 100644 index 00000000..cd612eeb --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/test.ts @@ -0,0 +1,32 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +declare const __karma__: any; +declare const require: any; + +// Prevent Karma from running prematurely. +__karma__.loaded = function () {}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.app.json b/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.app.json new file mode 100644 index 00000000..190fd300 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +} diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.spec.json b/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.spec.json new file mode 100644 index 00000000..de773363 --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/ecomp-sdk/epsdk-app-os/ngapp/src/typings.d.ts b/ecomp-sdk/epsdk-app-os/ngapp/src/typings.d.ts new file mode 100644 index 00000000..403b22fe --- /dev/null +++ b/ecomp-sdk/epsdk-app-os/ngapp/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} -- cgit 1.2.3-korg