From 3f7386d4245f9a05db961440ebf80d97d788f902 Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Fri, 31 Jan 2020 20:08:08 +0530 Subject: Added portal-FE-os components Removed layout from portal-FE-os and added new components in portal-fe-os Issue-ID: PORTAL-795 Change-Id: I3d7f93fa22a7935f9e73ed96802495019aabc129 Signed-off-by: Sudarshan Kumar --- portal-FE-os/src/app/.gitignore | 2 +- .../layout/components/footer/footer.component.html | 45 --- .../layout/components/footer/footer.component.scss | 52 --- .../components/footer/footer.component.spec.ts | 63 ---- .../layout/components/footer/footer.component.ts | 58 ---- .../global-search/global-search.component.html | 109 ------ .../global-search/global-search.component.scss | 74 ---- .../global-search/global-search.component.spec.ts | 62 ---- .../global-search/global-search.component.ts | 114 ------- .../header-menu/header-menu.component.html | 128 ------- .../header-menu/header-menu.component.scss | 150 -------- .../header-menu/header-menu.component.spec.ts | 62 ---- .../header-menu/header-menu.component.ts | 231 ------------- .../layout/components/header/header.component.html | 129 ------- .../layout/components/header/header.component.scss | 84 ----- .../components/header/header.component.spec.ts | 63 ---- .../layout/components/header/header.component.ts | 181 ---------- .../search-users/search-users.component.html | 73 ---- .../search-users/search-users.component.scss | 56 --- .../search-users/search-users.component.spec.ts | 63 ---- .../search-users/search-users.component.ts | 115 ------- .../components/sidebar/sidebar.component.html | 72 ---- .../components/sidebar/sidebar.component.scss | 228 ------------- .../components/sidebar/sidebar.component.spec.ts | 62 ---- .../layout/components/sidebar/sidebar.component.ts | 158 --------- .../src/app/layout/components/tabbar/tab.ts | 12 - .../layout/components/tabbar/tabbar.component.html | 77 ----- .../layout/components/tabbar/tabbar.component.scss | 80 ----- .../components/tabbar/tabbar.component.spec.ts | 63 ---- .../layout/components/tabbar/tabbar.component.ts | 95 ------ .../components/userbar/userbar.component.html | 13 - .../components/userbar/userbar.component.scss | 114 ------- .../components/userbar/userbar.component.spec.ts | 63 ---- .../layout/components/userbar/userbar.component.ts | 134 -------- .../src/app/layout/layout-routing.module.ts | 57 ---- portal-FE-os/src/app/layout/layout.component.html | 45 --- portal-FE-os/src/app/layout/layout.component.scss | 68 ---- .../src/app/layout/layout.component.spec.ts | 62 ---- portal-FE-os/src/app/layout/layout.component.ts | 56 --- portal-FE-os/src/app/layout/layout.module.ts | 65 ---- .../application-details-dialog.component.html | 275 +++++++++++++++ .../application-details-dialog.component.scss | 163 +++++++++ .../application-details-dialog.component.spec.ts | 63 ++++ .../application-details-dialog.component.ts | 380 +++++++++++++++++++++ .../application-onboarding.component.html | 144 ++++++++ .../application-onboarding.component.scss | 59 ++++ .../application-onboarding.component.spec.ts | 63 ++++ .../application-onboarding.component.ts | 188 ++++++++++ portal-FE-os/src/app/pages/pages-routing.module.ts | 89 +++++ portal-FE-os/src/app/pages/pages.component.html | 39 +++ portal-FE-os/src/app/pages/pages.component.scss | 49 +++ portal-FE-os/src/app/pages/pages.component.spec.ts | 62 ++++ portal-FE-os/src/app/pages/pages.component.ts | 52 +++ portal-FE-os/src/app/pages/pages.module.ts | 230 +++++++++++++ .../new-user-modal/new-user-modal.component.html | 125 +++++++ .../new-user-modal/new-user-modal.component.scss | 51 +++ .../new-user-modal.component.spec.ts | 62 ++++ .../new-user-modal/new-user-modal.component.ts | 322 +++++++++++++++++ .../user-details-form.component.html | 118 +++++++ .../user-details-form.component.scss | 0 .../user-details-form.component.spec.ts | 25 ++ .../user-details-form.component.ts | 51 +++ .../app/shared/interceptors/header-interceptor.ts | 73 ++++ portal-FE-os/src/app/shared/utils/utils.js | 21 ++ 64 files changed, 2705 insertions(+), 3437 deletions(-) delete mode 100644 portal-FE-os/src/app/layout/components/footer/footer.component.html delete mode 100644 portal-FE-os/src/app/layout/components/footer/footer.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/footer/footer.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/footer/footer.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/global-search/global-search.component.html delete mode 100644 portal-FE-os/src/app/layout/components/global-search/global-search.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/global-search/global-search.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/global-search/global-search.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/header-menu/header-menu.component.html delete mode 100644 portal-FE-os/src/app/layout/components/header-menu/header-menu.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/header-menu/header-menu.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/header-menu/header-menu.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/header/header.component.html delete mode 100644 portal-FE-os/src/app/layout/components/header/header.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/header/header.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/header/header.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/search-users/search-users.component.html delete mode 100644 portal-FE-os/src/app/layout/components/search-users/search-users.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/search-users/search-users.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html delete mode 100644 portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/tabbar/tab.ts delete mode 100644 portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html delete mode 100644 portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts delete mode 100644 portal-FE-os/src/app/layout/components/userbar/userbar.component.html delete mode 100644 portal-FE-os/src/app/layout/components/userbar/userbar.component.scss delete mode 100644 portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/components/userbar/userbar.component.ts delete mode 100644 portal-FE-os/src/app/layout/layout-routing.module.ts delete mode 100644 portal-FE-os/src/app/layout/layout.component.html delete mode 100644 portal-FE-os/src/app/layout/layout.component.scss delete mode 100644 portal-FE-os/src/app/layout/layout.component.spec.ts delete mode 100644 portal-FE-os/src/app/layout/layout.component.ts delete mode 100644 portal-FE-os/src/app/layout/layout.module.ts create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.scss create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.spec.ts create mode 100644 portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts create mode 100644 portal-FE-os/src/app/pages/pages-routing.module.ts create mode 100644 portal-FE-os/src/app/pages/pages.component.html create mode 100644 portal-FE-os/src/app/pages/pages.component.scss create mode 100644 portal-FE-os/src/app/pages/pages.component.spec.ts create mode 100644 portal-FE-os/src/app/pages/pages.component.ts create mode 100644 portal-FE-os/src/app/pages/pages.module.ts create mode 100644 portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.html create mode 100644 portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.scss create mode 100644 portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.spec.ts create mode 100644 portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.ts create mode 100644 portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html create mode 100644 portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.scss create mode 100644 portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.spec.ts create mode 100644 portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts create mode 100644 portal-FE-os/src/app/shared/interceptors/header-interceptor.ts create mode 100644 portal-FE-os/src/app/shared/utils/utils.js (limited to 'portal-FE-os/src/app') diff --git a/portal-FE-os/src/app/.gitignore b/portal-FE-os/src/app/.gitignore index 961a3847..75b6ddab 100644 --- a/portal-FE-os/src/app/.gitignore +++ b/portal-FE-os/src/app/.gitignore @@ -1,5 +1,5 @@ /ng-material-module.ts -!layout/ +/layout/ /modals/ /shared/ !shared/interceptors/ diff --git a/portal-FE-os/src/app/layout/components/footer/footer.component.html b/portal-FE-os/src/app/layout/components/footer/footer.component.html deleted file mode 100644 index 3a4d72ab..00000000 --- a/portal-FE-os/src/app/layout/components/footer/footer.component.html +++ /dev/null @@ -1,45 +0,0 @@ - -
- - -
\ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/footer/footer.component.scss b/portal-FE-os/src/app/layout/components/footer/footer.component.scss deleted file mode 100644 index deb2b804..00000000 --- a/portal-FE-os/src/app/layout/components/footer/footer.component.scss +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal SDK - * =================================================================== - * Copyright � 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -$topnav-background-color: #222; -.footerText { - background-color: $topnav-background-color; -} - -.copyright-text { - background-color: $topnav-background-color; - color: #fff; - font-size: 11px; - margin-bottom: 0; - line-height: 3rem; - margin-top: 20px; - margin-left: 100px; -} diff --git a/portal-FE-os/src/app/layout/components/footer/footer.component.spec.ts b/portal-FE-os/src/app/layout/components/footer/footer.component.spec.ts deleted file mode 100644 index ea3a67c2..00000000 --- a/portal-FE-os/src/app/layout/components/footer/footer.component.spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 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 { FooterComponent } from './footer.component'; - -describe('FooterComponent', () => { - let component: FooterComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ FooterComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FooterComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/footer/footer.component.ts b/portal-FE-os/src/app/layout/components/footer/footer.component.ts deleted file mode 100644 index bfbc292a..00000000 --- a/portal-FE-os/src/app/layout/components/footer/footer.component.ts +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -import { Component, OnInit } from '@angular/core'; -import { ManifestService } from '../shared/services'; - -@Component({ - selector: 'app-footer', - templateUrl: './footer.component.html', - styleUrls: ['./footer.component.scss'] -}) -export class FooterComponent implements OnInit { - - buildVersion; - constructor(private manifest: ManifestService) { } - - ngOnInit() { - this.manifest.getManifest().subscribe((_res: any) => { - this.buildVersion = _res; - }) - } - -} diff --git a/portal-FE-os/src/app/layout/components/global-search/global-search.component.html b/portal-FE-os/src/app/layout/components/global-search/global-search.component.html deleted file mode 100644 index ff5473be..00000000 --- a/portal-FE-os/src/app/layout/components/global-search/global-search.component.html +++ /dev/null @@ -1,109 +0,0 @@ - -
-
-
-
- -
-   - - -
-
-
- \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/global-search/global-search.component.scss b/portal-FE-os/src/app/layout/components/global-search/global-search.component.scss deleted file mode 100644 index 70f1b34c..00000000 --- a/portal-FE-os/src/app/layout/components/global-search/global-search.component.scss +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - - .search-div { - margin-bottom: -14px; - } - - .search-res-dialog{ - position: fixed; - background: white; - box-shadow: rgba(0, 0, 0, 0.247059) 0px 5px 6px 0px; - top: 2.5em; - border-radius: 0.25rem; - padding: 20px; - opacity: 1; - z-index: 1; - } - .searchUl { - list-style: none; - border-bottom: 1px solid #bbb; - padding-bottom: 20px; - padding-left: 4px; - } - .searchLiHeader { - font-weight: bold; - color: #0574ac; - font-size: 16px; - padding-bottom: 10px; - line-height: 1.5; - font-family: Omnes-ECOMP-W02,Arial; - - } - .searchLiItems{ - cursor: pointer; - font-weight: normal; - font-size: 12px; - color: #444444; - font-family: Omnes-ECOMP-W02,Arial; - } \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/global-search/global-search.component.spec.ts b/portal-FE-os/src/app/layout/components/global-search/global-search.component.spec.ts deleted file mode 100644 index c3771377..00000000 --- a/portal-FE-os/src/app/layout/components/global-search/global-search.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { GlobalSearchComponent } from './global-search.component'; - -describe('GlobalSearchComponent', () => { - let component: GlobalSearchComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ GlobalSearchComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(GlobalSearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/global-search/global-search.component.ts b/portal-FE-os/src/app/layout/components/global-search/global-search.component.ts deleted file mode 100644 index 4a6fb20b..00000000 --- a/portal-FE-os/src/app/layout/components/global-search/global-search.component.ts +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { Component, OnInit, Output, EventEmitter } from '@angular/core'; -import { GlobalSearchService } from 'src/app/shared/services/global-search/global-search.service'; -import { GlobalSearchItem } from 'src/app/shared/model/global-search-item.model'; -import * as $ from 'jquery'; -import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; - -@Component({ - selector: 'app-global-search', - templateUrl: './global-search.component.html', - styleUrls: ['./global-search.component.scss'] -}) -export class GlobalSearchComponent implements OnInit { - searchResDialog: boolean = false; - items: any; - constructor(private globalSearchService: GlobalSearchService,private addTabFuntionService: AddTabFunctionService) { } - - ngOnInit() { - } - - showHideSearchSnippet() { - setTimeout(() => { - $('#mainSearchSnippet').click(); - }, 1000); - setTimeout(() => { - $('mainSearchText').focus(); - }, 1000); - } - - mainSearchEvent = $('#mainSearchDiv').keyup((event) => { - if (event.keyCode == 13) { - - this.getSearchResult($('#mainSearchText').val()); - - // opens the popup - var popupDomObj = $("[content='searchSnippet.html']"); - if (popupDomObj.length == 0) { - this.showHideSearchSnippet(); - } else { - $('#mainSearchSnippet').click(); - this.showHideSearchSnippet(); - } - - - - } - }); - - clickOutSide(event: any) { - - this.searchResDialog = false; - - } - searchDialogToggle(event: any) { - if (event.keyCode == 13) { - this.searchResDialog = true; - this.getSearchResult($('#mainSearchText').val()); - } - } - - getSearchResult(searchString: string) { - //console.log("getSearch Result"); - this.globalSearchService.getSearchResults(searchString).subscribe(data => { - //console.log("Response data" + data); - this.items = data.response; - //console.log("search result data" + JSON.stringify(data)); - - }, error => { - console.log('getSearchResult Error Object' + error); - }); - }; - goToUrl(item: any){ - //console.log('check goto'); - var a = {'test1':'value1','test2':'value3','test3':'value2'}; - this.addTabFuntionService.filter(a); - } - -} diff --git a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.html b/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.html deleted file mode 100644 index b1d4d835..00000000 --- a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.html +++ /dev/null @@ -1,128 +0,0 @@ - -
- - -
\ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.scss b/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.scss deleted file mode 100644 index d69b8580..00000000 --- a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.scss +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - .header-menu-item-div - { - float: left; - margin-right: 5%; - - } - .header-menu-item-li - { - float: left; - margin-right: 2%; - - - } - .header-menu-item-link - { - font-family:"Open Sans", Arial; - font-size:16px; - color:#999; - text-decoration:none; - - } - #parentmenu-tabs:hover { - color: #fff; - } - - - - - .third-level-menu{ - column-count: 4; - line-height: 12px; - overflow-x: hidden; - overflow-y: hidden; - column-gap: 13px; - column-rule: 1px outset #d2d2d2; - margin-left:20px; - } - - - - .third-level-menu a{ - color:black; - } - - .third-level-menu li a { - color: #333; - display: inline-flex; - padding: 7px 15px; - font-family:"Omnes-ECOMP-W02", Arial; - margin-top:5px; - margin-bottom:5px; - } - - .third-level-menu li{ - width:100%; - border-bottom: 1px solid #d2d2d2; - } - - - .b2b-header-tabs .header-secondary .header-subitem a.menu__item{ - font-size:16px; - } - - .third-level-title{ - font-size:15px; - font-weight: 700; - } - .header-secondlevel-menu - { - background-color: #fff; - position: fixed; - right:1%; - width: -webkit-fill-available; - - } - - .header-thirdlevel-menu - { - background-color: #fff; - position: fixed; - left:0; - height: 70%; - width: 100%; - } - - a.menu__item{ - font-size:16px; - font-family:"Open Sans", Arial; - color:#333; - } - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.spec.ts b/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.spec.ts deleted file mode 100644 index 889f499a..00000000 --- a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HeaderMenuComponent } from './header-menu.component'; - -describe('HeaderMenuComponent', () => { - let component: HeaderMenuComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ HeaderMenuComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HeaderMenuComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.ts b/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.ts deleted file mode 100644 index eb8f747a..00000000 --- a/portal-FE-os/src/app/layout/components/header-menu/header-menu.component.ts +++ /dev/null @@ -1,231 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import * as _ from 'underscore'; -import { Component, OnInit } from '@angular/core'; -import { MenusService } from 'src/app/shared/services/menus/menus.service'; -import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-header-menu', - templateUrl: './header-menu.component.html', - styleUrls: ['./header-menu.component.scss'] -}) -export class HeaderMenuComponent implements OnInit { - hideMenus: boolean[] = []; - hideSecondLevelMenus: boolean[][] = []; - hideThirdLevelMenus: boolean[] = []; - megaMenuDataObject: any[]; - favoritesMenuItems: any[]; - favoritesWindow: boolean; - showFavorites: boolean; - emptyFavorites: boolean; - favoriteItemsCount: number; - - constructor(public router: Router, private menusService: MenusService, private addTabFuntionService: AddTabFunctionService) { } - - ngOnInit() { - //this.hideMenus[0] = false; - this.getFunctionalMenuForUser(); - - } - - unflatten(array: any, parent?: any, tree?: any) { - tree = typeof tree !== 'undefined' ? tree : []; - parent = typeof parent !== 'undefined' ? parent : { menuId: null }; - var children = _.filter(array, function (child: any) { - return child.parentMenuId == parent.menuId; - }); - if (!_.isEmpty(children)) { - if (parent.menuId === null) { - tree = children; - } else { - parent['children'] = children - } - _.each(children, function (child: any) { - this.unflatten(array, child) - }, this); - } - - return tree; - } - getFunctionalMenuForUser() { - this.menusService.getFunctionalMenuForUser().subscribe((jsonHeaderMenu: any) => { - this.megaMenuDataObject = this.unflatten(jsonHeaderMenu); - // for (let entry of this.megaMenuDataObject) { - // console.log('First level '+entry.text); - // for (let secondLevel of entry.children) - // { - // if(secondLevel) - // { - // console.log('Second level '+secondLevel.text); - // for (let thirdLevel of secondLevel.children) - // { - // console.log('Third level '+thirdLevel.text); - // } - // } - - // } - - // } - - - }, (err) => { - console.log('HeaderCtrl::GetFunctionalMenuForUser: HeaderCtrl json returned: ' + err); - }); - - } - getFavoriteItems() { - this.menusService.getFavoriteItems().toPromise().then((jsonFavourites: any) => { - this.favoritesMenuItems = jsonFavourites; - if (this.favoritesMenuItems) { - this.favoriteItemsCount = this.favoritesMenuItems.length; - } - }, (err) => { - console.log('HeaderCtrl::getFavoriteItems: HeaderCtrl json returned: ' + err); - }); - } - loadFirstLevel(index: any) { - this.hideMenus = []; - this.hideSecondLevelMenus = []; - for (let firstLevelIndex = 0; firstLevelIndex < this.megaMenuDataObject.length; firstLevelIndex++) { - this.hideMenus.push(false); - this.hideSecondLevelMenus.push(new Array(this.megaMenuDataObject[firstLevelIndex].length).fill(false)); - } - this.hideMenus[index] = true; - if (!this.favoritesMenuItems) { - this.getFavoriteItems(); - } - - } - isUrlFavorite(menuId: any) { - if (this.favoritesMenuItems) { - var jsonMenu = JSON.stringify(this.favoritesMenuItems); - var isMenuFavorite = jsonMenu.indexOf('menuId\":' + menuId); - if (isMenuFavorite == -1) { - return false; - } else { - return true; - } - } - else { - return false; - } - } - submenuLevelAction(index: any, column: any) { - //console.log('index and column' + index + column); - if (index == 'Favorites' && this.favoriteItemsCount != 0) { - this.favoritesWindow = true; - this.showFavorites = true; - this.emptyFavorites = false; - } - if (index == 'Favorites' && this.favoriteItemsCount == 0) { - this.favoritesWindow = true; - this.showFavorites = false; - this.emptyFavorites = true; - } - if (index != 'Favorites') { - this.favoritesWindow = false; - this.showFavorites = false; - this.emptyFavorites = false; - } - } - hideFavoritesWindow() { - this.showFavorites = false; - this.emptyFavorites = false; - } - removeAsFavoriteItem(event: any, menuId: any) { - this.menusService.removeFavoriteItem(menuId).subscribe(() => { - //angular.element('#' + event.target.id).css('color', '#666666'); - this.getFavoriteItems(); - }, (err) => { - console.error('HeaderCtrl::removeAsFavoriteItem: API removeFavoriteItem error: ' + err); - }); - } - hideThirdLevelMenu(firstLevelIndex: any, secondLevelIndex: any) { - this.hideSecondLevelMenus = []; - for (let firstLevelIndex = 0; firstLevelIndex < this.megaMenuDataObject.length; firstLevelIndex++) { - this.hideSecondLevelMenus.push(new Array(this.megaMenuDataObject[firstLevelIndex].length).fill(false)); - } - this.hideSecondLevelMenus[firstLevelIndex][secondLevelIndex] = true; - } - - clickOutSide(event: any) { - this.hideMenus = []; - this.hideSecondLevelMenus = []; - for (let firstLevelIndex = 0; firstLevelIndex < this.megaMenuDataObject.length; firstLevelIndex++) { - this.hideMenus.push(false); - this.hideSecondLevelMenus.push(new Array(this.megaMenuDataObject[firstLevelIndex].length).fill(false)); - } - - } - setAsFavoriteItem(event: any, menuId: any) { - - } - goToUrl(item: any) { - //console.log('Get into URL function' + item.url); - let url = item.url; - let restrictedApp = item.restrictedApp; - if (!url) { - console.log('HeaderCtrl::goToUrl: No url found for this application, doing nothing..'); - return; - } - if (restrictedApp) { - window.open(url, '_blank'); - } else { - if (item.url == "getAccess" || item.url == "contactUs") { - - this.router.navigate(['/' + item.url]); - - } else { - var tabContent = { - id: new Date(), - title: item.text, - url: item.url, - appId: item.appid - }; - this.addTabFuntionService.filter(tabContent); - } - } - - } - auditLog(link: any, action: any) { - - } - -} diff --git a/portal-FE-os/src/app/layout/components/header/header.component.html b/portal-FE-os/src/app/layout/components/header/header.component.html deleted file mode 100644 index d8c938d7..00000000 --- a/portal-FE-os/src/app/layout/components/header/header.component.html +++ /dev/null @@ -1,129 +0,0 @@ - - -
-
- - - - - -
  • - - {{ 'Applications and Roles' }} - -

  • -
    -
    -
    - {{ua.App}}: -
    -
    - - * {{role}} -
    -
    -
    -
    -
    -
    -
    - - - - - - \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/header/header.component.scss b/portal-FE-os/src/app/layout/components/header/header.component.scss deleted file mode 100644 index c1ef2a34..00000000 --- a/portal-FE-os/src/app/layout/components/header/header.component.scss +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * 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============================================ - * - * - */ -$topnav-background-color: #222; -:host { - .navbar { - background-color: $topnav-background-color; - .navbar-brand { - color: #fff; - } - .nav-item > a { - color: #999; - &:hover { - color: #fff; - } - } - } - - .dropdown-menu-right.dropdown-menu.show{ - width: 250px; - } - .dropdown-item-name { - font-weight: bold; - } - - .dropdown-item-value { - font-weight: lighter; - } - - .custom-display-item { - display: block; - width: 100%; - padding: 0.25rem 1.5rem; - clear: both; - font-weight: 400; - color: #212529; - text-align: inherit; - white-space: nowrap; - background-color: transparent; - border: 0; - } - - .custom-display-item.approles { - overflow-y: scroll; - height: 250px; - } - .header-menu-display { - width: 250px; - } -} diff --git a/portal-FE-os/src/app/layout/components/header/header.component.spec.ts b/portal-FE-os/src/app/layout/components/header/header.component.spec.ts deleted file mode 100644 index 1bcd2ffb..00000000 --- a/portal-FE-os/src/app/layout/components/header/header.component.spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HeaderComponent } from './header.component'; - -describe('HeaderComponent', () => { - let component: HeaderComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ HeaderComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HeaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/header/header.component.ts b/portal-FE-os/src/app/layout/components/header/header.component.ts deleted file mode 100644 index 5248200a..00000000 --- a/portal-FE-os/src/app/layout/components/header/header.component.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright � 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { Component, OnInit } from '@angular/core'; -import { Router, NavigationEnd } from '@angular/router'; -import { UserProfileService, MenusService } from 'src/app/shared/services'; -import { CookieService } from 'ngx-cookie-service'; - -@Component({ - selector: 'app-header', - templateUrl: './header.component.html', - styleUrls: ['./header.component.scss'] -}) -export class HeaderComponent implements OnInit { - public pushRightClass: string; - firstName: string; - lastName: string; - loginSnippetUserid: any; - lastLogin: number; - loginSnippetEmail: any; - userapproles: any[]; - displayUserAppRoles: any; - isLoading: boolean; - - constructor(public router: Router, private userProfileService: UserProfileService, private menusService: MenusService, private cookieService: CookieService) { - - this.router.events.subscribe(val => { - if ( - val instanceof NavigationEnd && - window.innerWidth <= 992 && - this.isToggled() - ) { - this.toggleSidebar(); - } - }); - } - - ngOnInit() { - this.pushRightClass = 'push-right'; - this.getUserInformation(); - } - - getUserInformation() { - this.userProfileService.getFunctionalMenuStaticInfo().toPromise().then((res: any) => { - if (res == null || res.firstName == null || res.firstName == '' || res.lastName == null || res.lastName == '') { - // $log.info('HeaderCtrl: failed to get all required data, trying user profile'); - this.userProfileService.getUserProfile().toPromise().then((profile: any) => { - this.firstName = profile.firstName; - this.lastName = profile.lastName; - }, (err) => { - // $log.error('Header Controller:: getUserProfile() failed: ' + err); - }); - } else { - this.firstName = res.firstName; - this.lastName = res.lastName; - this.loginSnippetEmail = res.email; - this.loginSnippetUserid = res.userId; - this.lastLogin = Date.parse(res.last_login); - } - sessionStorage.userId = res.userId; - this.menusService.getFunctionalMenuForUser().toPromise().then((jsonHeaderMenu: any) => { - // $scope.menuItems = unflatten(jsonHeaderMenu); - // $scope.megaMenuDataObject = $scope.menuItems; - }, (err) => { - // $log.error('HeaderCtrl::GetFunctionalMenuForUser: HeaderCtrl json returned: ' + err); - }); - - }, (err) => { - // $log.error('HeaderCtrl::getFunctionalMenuStaticInfo failed: ' + err); - }) - } - - // unflatten = function( array, parent, tree ){ - - // tree = typeof tree !== 'undefined' ? tree : []; - // parent = typeof parent !== 'undefined' ? parent : { menuId: null }; - // var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; }); - - // if( !_.isEmpty( children ) ){ - // if( parent.menuId === null ){ - // tree = children; - // }else{ - // parent['children'] = children - // } - // _.each( children, function( child ){ unflatten( array, child ) } ); - // } - - // return tree; - // } - - getUserApplicationRoles() { - this.userapproles = []; - if (this.displayUserAppRoles) { - this.displayUserAppRoles = false; - } else { - this.displayUserAppRoles = true; - this.isLoading = true; - this.userProfileService.getUserAppRoles(this.loginSnippetUserid) - .subscribe((res: any) => { - this.isLoading = false; - for (var i = 0; i < res.length; i++) { - var userapprole = { - App: res[i].appName, - Roles: res[i].roleNames, - }; - this.userapproles.push(userapprole); - } - }, (err) => { - this.isLoading = false; - }); - } - } - - allAppsLogout() { - this.firstName=""; - this.lastName=""; - this.displayUserAppRoles=false; - var cookieTabs = this.cookieService.get("visInVisCookieTabs").toString; - if(cookieTabs!=null){ - for(var t in cookieTabs){ - - var url = cookieTabs[t].content; - if(url != "") { - this.menusService.logout(url); - } - } - } - // wait for individual applications to log out before the portal logout - setTimeout(function() { - window.location.href = "logout.htm"; - }, 2000); - } - - isToggled(): boolean { - const dom: Element = document.querySelector('body'); - return dom.classList.contains(this.pushRightClass); - } - - toggleSidebar() { - const dom: any = document.querySelector('body'); - dom.classList.toggle(this.pushRightClass); - } - - onLoggedout() { - localStorage.removeItem('isLoggedin'); - } -} diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.html b/portal-FE-os/src/app/layout/components/search-users/search-users.component.html deleted file mode 100644 index 4c318f9f..00000000 --- a/portal-FE-os/src/app/layout/components/search-users/search-users.component.html +++ /dev/null @@ -1,73 +0,0 @@ - - -
    - {{searchTitle}} -
    -
    - - -
    - -
    - -
    -
    -
    - -
    - - - - - - - - -
    Showing {{searchUsersResults.length}} {{txtResults}} - {{element.firstName}} {{element.lastName}}
    {{element.jobTitle}} -
    -
    -
    -

    {{message}} Or Click Here to add New User!

    -
    \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss b/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss deleted file mode 100644 index 95a2a5ec..00000000 --- a/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -@import "../../../pages/pages.component"; - -.mat-row { - cursor: pointer; - background-color: #f2f2f2; -} -.selected { - background-color: #ffffff !important; -} - -.search-user-container { - overflow-y: auto; - height: 250px; -} - -.ecomp-spinner{ - opacity: 10; -} diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts deleted file mode 100644 index 66a966cf..00000000 --- a/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SearchUsersComponent } from './search-users.component'; - -describe('SearchUsersComponent', () => { - let component: SearchUsersComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SearchUsersComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SearchUsersComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts deleted file mode 100644 index 10e4e041..00000000 --- a/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core'; -import { UsersService } from 'src/app/shared/services'; -import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; -import { PortalAdmin } from 'src/app/shared/model/PortalAdmin'; - -@Component({ - selector: 'app-search-users', - templateUrl: './search-users.component.html', - styleUrls: ['./search-users.component.scss'] -}) -export class SearchUsersComponent implements OnInit { - - constructor(private userService: UsersService, private ngModal: NgbModal) { } - @Input() searchTitle: string; - @Input() placeHolder: string; - @Input() isSystemUser: boolean; - @ViewChild(MatSort) sort: MatSort; - @ViewChild(MatPaginator) paginator: MatPaginator; - @Output() passBackSelectedUser: EventEmitter = new EventEmitter(); - @Output() userNotFoundFlag = new EventEmitter(); - searchString: string; - txtResults = 'result'; - searchUsersResults: any; - selected: any; - isLoading: boolean; - showUserTable: boolean; - selectedUser: any; - displayedColumns: string[] = ['firstName']; - dataSourceMap = new MatTableDataSource(this.searchUsersResults); - submitted = false; - message = " No users found with your query. Please change your search and try again."; - - ngOnInit() { - this.searchString = ''; - this.showUserTable = false; - this.isSystemUser = false; - } - - passSystemUserInfo(systemUser: string) { - if (this.isSystemUser) - this.passBackSelectedUser.emit(systemUser); - } - - noUserFlag: boolean = false; - searchUsers() { - if (!this.isSystemUser) { - this.isLoading = true; - this.showUserTable = false; - this.passBackSelectedUser.emit(this.selectedUser = ''); - this.userService.searchUsers(this.searchString).subscribe((_data: PortalAdmin) => { - this.searchUsersResults = _data; - if (this.searchUsersResults == null || this.searchUsersResults.length == 0) { - this.noUserFlag = true; - this.isLoading = false; - } else { - this.noUserFlag = false; - this.showUserTable = true; - this.isLoading = false; - this.dataSourceMap = new MatTableDataSource(this.searchUsersResults); - this.txtResults = (this.searchUsersResults && this.searchUsersResults.length > 1) ? 'results' : 'result'; - } - }); - } - } - - setSelectedUser(user: PortalAdmin) { - this.selectedUser = user; - this.passBackSelectedUser.emit(this.selectedUser); - } - - addNewUser() { - console.log("Emit the value to parent"); - this.userNotFoundFlag.emit(true); - } - -} diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html deleted file mode 100644 index e2f4f3a0..00000000 --- a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html +++ /dev/null @@ -1,72 +0,0 @@ - - - \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss deleted file mode 100644 index fd114bd1..00000000 --- a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss +++ /dev/null @@ -1,228 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * 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============================================ - * - * - */ -$topnav-background-color: #fff; -.sidebar { - border-radius: 0; - position: relative; - z-index: 1000; - //top: 56px; - left: 270px; - width: 270px; - margin-left: -270px; - margin-bottom: 48px; - border: none; - border-radius: 0; - overflow-y: auto; - background-color: $topnav-background-color; - bottom: 0; - overflow-x: hidden; - padding-bottom: 40px; - white-space: nowrap; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - .list-group { - a.list-group-item { - background: $topnav-background-color; - border: 0; - border-top: 1px solid #999; - border-radius: 0; - color: #0568ae; - text-decoration: none; - .icon { - margin-right: 10px; - color: #000; - } - } - a:hover { - background: darken($topnav-background-color, 2%); - color: #000; - } - a.router-link-active { - background: darken($topnav-background-color, 5%); - color: #000; - } - .header-fields { - padding-top: 10px; - - > .list-group-item:first-child { - border-top: 1px solid rgba(255, 255, 255, 0.2); - } - } - } - .sidebar-dropdown { - *:focus { - border-radius: none; - border: none; - } - .panel-title { - font-size: 1rem; - height: 50px; - margin-bottom: 0; - a { - color: #999; - text-decoration: none; - font-weight: 400; - background: $topnav-background-color; - span { - position: relative; - display: block; - padding: 0.75rem 1.5rem; - padding-top: 1rem; - } - } - a:hover, - a:focus { - color: #fff; - outline: none; - outline-offset: -2px; - } - } - .panel-title:hover { - background: darken($topnav-background-color, 5%); - } - .panel-collapse { - border-radious: 0; - border: none; - .panel-body { - .list-group-item { - border-radius: 0; - background-color: $topnav-background-color; - border: 0 solid transparent; - a { - color: #999; - } - a:hover { - color: #fff; - } - } - .list-group-item:hover { - background: darken($topnav-background-color, 5%); - } - } - } - } -} - -.nested-menu { - .list-group-item { - cursor: pointer; - } - .nested { - list-style-type: none; - } - ul.submenu { - display: none; - height: 0; - } - & .expand { - ul.submenu { - display: block; - list-style-type: none; - height: auto; - li { - a { - color: #0568ae; - padding: 10px; - display: block; - } - } - } - } -} -@media screen and (max-width: 992px) { - .sidebar { - top: 54px; - left: 0px; - } -} -@media print { - .sidebar { - display: none !important; - } -} -@media (min-width: 992px) { - .header-fields { - display: none; - } -} - -::-webkit-scrollbar { - width: 8px; -} - -::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 0px rgba(255, 255, 255, 1); - border-radius: 3px; -} - -::-webkit-scrollbar-thumb { - border-radius: 3px; - -webkit-box-shadow: inset 0 0 3px rgba(255, 255, 255, 1); -} - -.toggle-button { - width: 270px; - cursor: pointer; - padding: 12px; - bottom: 0; - color: #0568ae; - background: #fff; - i { - font-size: 23px; - } - &:hover { - background: darken($topnav-background-color, 2%); - color: #000; - } - border-top: 1px solid #999; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} - -.collapsed { - width: 60px; - span { - display: none; - } -} diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts deleted file mode 100644 index 92caeb42..00000000 --- a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SidebarComponent } from './sidebar.component'; - -describe('SidebarComponent', () => { - let component: SidebarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SidebarComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SidebarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts deleted file mode 100644 index d56f4432..00000000 --- a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts +++ /dev/null @@ -1,158 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * 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, Output, EventEmitter, OnInit, Input } from '@angular/core'; -import { Router, NavigationEnd } from '@angular/router'; -import { SidebarService } from '../../../shared/services/index' - -@Component({ - selector: 'app-sidebar', - templateUrl: './sidebar.component.html', - styleUrls: ['./sidebar.component.scss'] -}) -export class SidebarComponent implements OnInit { - @Input() labelName: string; - isActive: boolean; - collapsed: boolean; - showMenu: string; - pushRightClass: string; - result: any; - showOnlyParentMenu: boolean; - leftParentData: any; - leftChildData: any; - menuData: Array = []; - page: any; - - @Output() collapsedEvent = new EventEmitter(); - - constructor(public router: Router, public sidebarService: SidebarService) { - this.router.events.subscribe(val => { - if ( - val instanceof NavigationEnd && - window.innerWidth <= 992 && - this.isToggled() - ) { - this.toggleSidebar(); - } - }); - } - - ngOnInit() { - this.isActive = false; - this.collapsed = false; - this.showMenu = ''; - this.pushRightClass = 'push-right'; - this.sidebarService.getLeftMenu() - .subscribe(data => { - this.result = data; - if (this.result.data && this.result.data2) { - this.leftParentData = JSON.parse(this.result.data); - this.leftChildData = JSON.parse(this.result.data2); - } else { - this.labelName = this.result.label; - this.leftParentData = this.result.navItems; - this.showOnlyParentMenu = true; - } - - for (var i = 0; i < this.leftParentData.length; i++) { - var parentItem = { - name: null, - imageSrc: null, - href: null, - menuItems: [], - state: null - } - if (this.showOnlyParentMenu) { - parentItem.name = this.leftParentData[i].name; - parentItem.imageSrc = this.leftParentData[i].imageSrc; - parentItem.state = '/'+this.leftParentData[i].state; - } else { - parentItem.name = this.leftParentData[i].label; - parentItem.imageSrc = this.leftParentData[i].imageSrc; - } - // Add link to items with no subitems - if (!this.showOnlyParentMenu) { - if (this.leftChildData[i].length == 0) - parentItem.href = this.leftParentData[i].action; - - for (var j = 0; j < this.leftChildData[i].length; j++) { - - var childItem = { - name: null, - href: null - }; - if (this.leftChildData[i][j].label != null && this.leftChildData[i][j].label.length > 0) { - - childItem.name = this.leftChildData[i][j].label; - childItem.href = this.leftChildData[i][j].action; - parentItem.menuItems.push(childItem); - } - } - } - this.menuData.push(parentItem); - } - - }); - - } - eventCalled() { - this.isActive = !this.isActive; - } - - addExpandClass(element: any) { - if (element === this.showMenu) { - this.showMenu = '0'; - } else { - this.showMenu = element; - } - } - - toggleCollapsed() { - this.collapsed = !this.collapsed; - this.collapsedEvent.emit(this.collapsed); - } - - isToggled(): boolean { - const dom: Element = document.querySelector('body'); - return dom.classList.contains(this.pushRightClass); - } - - toggleSidebar() { - const dom: any = document.querySelector('body'); - dom.classList.toggle(this.pushRightClass); - } -} diff --git a/portal-FE-os/src/app/layout/components/tabbar/tab.ts b/portal-FE-os/src/app/layout/components/tabbar/tab.ts deleted file mode 100644 index 0b941c6c..00000000 --- a/portal-FE-os/src/app/layout/components/tabbar/tab.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { SafeUrl } from '@angular/platform-browser'; - -export class Tab { - label: string; - url: SafeUrl; - active: boolean; - - constructor(label: string) { - this.label = label; - } - -} diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html deleted file mode 100644 index 4a704da9..00000000 --- a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html +++ /dev/null @@ -1,77 +0,0 @@ - - -
    -
    - - - - - - - - -
    - -
    -
    -
    - -
    - - - - {{tab.label | elipsis: 13}}   - - - - - - -
    - - - - - - - - -
    \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss deleted file mode 100644 index 807e2d57..00000000 --- a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017 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============================================ - * - * - */ - - .input-label, - .add-tab-button, - .delete-tab-button { - margin: 8px; - } - .search-bar { - position: absolute; - right: 10%; - } - - #mat-tab-label-0-1 { - position: fixed; - right: 1em; - } - - .mat-tab-group{ - margin-top: 55px; - } - - ::ng-deep .mat-tab-label { - font-size: 13px !important; - line-height: 30px !important; - margin: 5px 0px 0 !important; - border-top-left-radius: 88px 205px !important; - border-top-right-radius: 88px 205px !important; - padding: 0 30px 0 25px !important; - height: 35px !important; - background: #d2d2d2 !important; - position: relative !important; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5) !important; - width: 180px !important; - max-width: 200px !important; - min-width: 20px !important; - border: 1px solid #aaa !important; - text-transform: capitalize !important; - text-align: left !important; - } - - - ::ng-deep .mat-tab-label.mat-ripple.ng-star-inserted.mat-tab-label-active { - opacity: 1; - } \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts deleted file mode 100644 index 94866e4e..00000000 --- a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 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 { TabbarComponent } from './tabbar.component'; - -describe('TabbarComponent', () => { - let component: TabbarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TabbarComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TabbarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts deleted file mode 100644 index 7a10e39d..00000000 --- a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { Component, OnInit } from '@angular/core'; -import { FormControl } from '@angular/forms'; -import { DomSanitizer } from '@angular/platform-browser'; -import { Tab } from './tab'; -import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; - -@Component({ - selector: 'app-tabbar', - templateUrl: './tabbar.component.html', - styleUrls: ['./tabbar.component.scss'] -}) -export class TabbarComponent implements OnInit { - - tabs = []; - mainTab = 'Home'; - selected = new FormControl(0); - collapedSideBar: boolean; - - constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService) { - - } - - ngOnInit(): void { - - this.addTabFuntionService.listen().subscribe((m: any) => { - console.log(m); - this.addTab(true, m.title, m.url); - }) - } - - addTab(selectAfterAdding: boolean, label: string, url: string) { - const tab = new Tab(label); - tab.url = this.sanitizer.bypassSecurityTrustResourceUrl(url); - tab.active = true; - this.tabs.push(tab); - - if (selectAfterAdding) { - this.selected.setValue(this.tabs.length); - } - } - - removeTab(index: number) { - this.tabs.splice(index, 1); - } - - receiveCollapsed($event) { - this.collapedSideBar = $event; - } - - tabChanged($event) { - - for (const ttab of this.tabs) { - ttab.active = false; - } - if(this.tabs.length != 0 && $event.index != 0) - this.tabs[$event.index - 1].active = true; - } -} diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.html b/portal-FE-os/src/app/layout/components/userbar/userbar.component.html deleted file mode 100644 index e9a8b822..00000000 --- a/portal-FE-os/src/app/layout/components/userbar/userbar.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss b/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss deleted file mode 100644 index ee9f8279..00000000 --- a/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 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============================================ - * - * - */ - -.usb-item { - background: #fff; - position: fixed; -} - -.usb-item h3 { - color: #ef6f00; - font-size: 14px; - padding: 20px; - margin: 0; - text-align: center; - font-weight: 300; - background: #f8f9fa; -} - -.usb-item a { - display: block; - color: #fff; - font-size: 1.1em; - font-weight: 300; - transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; /* IE 9 */ - -webkit-transition: all 0.2s ease-in-out; /* Safari 3-8 */ -} - -.usb-item a:active { - background: #afdefa; - color: #47a3da; -} - -.usb-item-right { - transition: all 0.5s ease-in-out; - -ms-transition: all 0.5s ease-in-out; /* IE 9 */ - -webkit-transition: all 0.5s ease-in-out; /* Safari 3-8 */ -} - -.usb-item a:hover { - -ms-transform: scale(1.5); /* IE 9 */ - -webkit-transform: scale(1.5); /* Safari 3-8 */ - transform: scale(1.5); -} - -.usb-item-vertical { - margin-top: 105px; - text-align: center; - width: 75px; - height: 79%; - top: 0; - z-index: 1000; - box-shadow: 0 4px 5px rgba(0, 0, 0, 0.2); -} - -.usb-item-vertical a { - padding: 0.5em; -} - -button { - transition: all 0.5s ease-in-out; - -ms-transition: all 0.5s ease-in-out; /* IE 9 */ - -webkit-transition: all 0.5s ease-in-out; /* Safari 3-8 */ - z-index: 9999; - top: 450px; - -ms-transform: rotate(-90deg); /* IE 9 */ - -webkit-transform: rotate(-90deg); /* Safari 3-8 */ - transform: rotate(-90deg); - position: fixed; -} - -.activeUserIcon { - display: block; - margin-left: auto; - margin-right: auto; - height: 55px; - width: 55px; - border-radius: 50%; -} diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts b/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts deleted file mode 100644 index 4115433c..00000000 --- a/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 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 { UserbarComponent } from './userbar.component'; - -describe('UserbarComponent', () => { - let component: UserbarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ UserbarComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(UserbarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts b/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts deleted file mode 100644 index 343305fe..00000000 --- a/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ - -import { Component, OnInit } from '@angular/core'; -import { UserbarService, UserProfileService } from 'src/app/shared/services'; -import { DomSanitizer } from '@angular/platform-browser'; - -@Component({ - selector: 'app-userbar', - templateUrl: './userbar.component.html', - styleUrls: ['./userbar.component.scss'] -}) -export class UserbarComponent implements OnInit { - - userList; - isOpen: boolean; - intervalPromise = null; - updateRate: number; - myservice: UserbarService; - constructor(private sanitizer: DomSanitizer, private userbarService: UserbarService, private userProfileService: UserProfileService) { } - - ngOnInit() { - this.userList = []; - this.myservice = this.userbarService; - this.isOpen = true; - // this.userbarService.getOnlineUserUpdateRate().subscribe((_res: any) => { - // if (_res != null) { - // var rate = parseInt(_res.onlineUserUpdateRate); - // var duration = parseInt(_res.onlineUserUpdateDuration); - // this.userbarService.setMaxRefreshCount((duration / rate) + 1); - // this.userbarService.setRefreshCount(this.userbarService.maxCount); - // if (rate != NaN && duration != NaN) { - // // $log.debug('UserbarCtlr: scheduling function at interval ' + millis); - // this.updateRate = rate; - // this.start(this.updateRate); - // } - // } - // }) - this.updateActiveUsers(); - } - - updateActiveUsers() { - // this.userbarService.decrementRefreshCount(); - this.userProfileService.getActiveUser().subscribe((_res: any) => { - if (_res == null) { - // $log.error('UserbarCtrl::updateActiveUsers: failed to get active user'); - this.stop(); - } else { - var maxItems = 25; - if (_res.length < maxItems) - maxItems = _res.length; - for (var i = 0; i < maxItems; i++) { - var data = { - userId: _res[i], - linkQ: this.sanitizer.bypassSecurityTrustResourceUrl('qto://talk/' + _res[i]), - linkPic: 'https://tspace.web.att.com/profiles/photo.do?uid=' + _res[i] - } - this.userList.push(data); - } - } - - }, (err) => { - this.userList = []; - this.stop(); - }) - - // .add(() => { - // var footerOff = $('#online-userbar').offset().top; - // var headOff = $('#footer').offset().top; - // var defaultOffSet = 45; - // $(".online-user-container").css({ - // "height": headOff - footerOff - defaultOffSet - // }); - // }) - - } - - toggleSidebar() { - this.isOpen = !this.isOpen; - } - - start(rate) { - // stops any running interval to avoid two intervals running at the same time - this.stop(); - // store the interval promise - this.intervalPromise = setInterval(this.updateActiveUsers, rate); - }; - - - stop() { - if (this.intervalPromise != null) { - clearInterval(this.intervalPromise); - this.intervalPromise = null; - } - }; - - - -} diff --git a/portal-FE-os/src/app/layout/layout-routing.module.ts b/portal-FE-os/src/app/layout/layout-routing.module.ts deleted file mode 100644 index 5fa77e3a..00000000 --- a/portal-FE-os/src/app/layout/layout-routing.module.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal SDK - * =================================================================== - * Copyright � 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { LayoutComponent } from './layout.component'; - -const routes: Routes = [ - { - path: '', - component: LayoutComponent, - children: [ - //redirecting to pages module - { path: '', redirectTo: 'app', }, - { path: 'app', loadChildren: () => import('../pages/pages.module').then(m => m.PagesModule) }, ] - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class LayoutRoutingModule {} diff --git a/portal-FE-os/src/app/layout/layout.component.html b/portal-FE-os/src/app/layout/layout.component.html deleted file mode 100644 index 757c9860..00000000 --- a/portal-FE-os/src/app/layout/layout.component.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/layout.component.scss b/portal-FE-os/src/app/layout/layout.component.scss deleted file mode 100644 index a8adf264..00000000 --- a/portal-FE-os/src/app/layout/layout.component.scss +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal SDK - * =================================================================== - * Copyright � 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -* { - -webkit-transition: margin-left 0.2s ease-in-out; - -moz-transition: margin-left 0.2s ease-in-out; - -ms-transition: margin-left 0.2s ease-in-out; - -o-transition: margin-left 0.2s ease-in-out; - transition: margin-left 0.2s ease-in-out; -} -.main-container { - margin-top: 56px; - margin-left: 270px; - padding: 15px; - -ms-overflow-x: hidden; - overflow-x: hidden; - overflow-y: scroll; - position: relative; - overflow: hidden; -} -.collapsed { - margin-left: 60px; -} -@media screen and (max-width: 992px) { - .main-container { - margin-left: 0px !important; - } -} -@media print { - .main-container { - margin-top: 0px !important; - margin-left: 0px !important; - } -} diff --git a/portal-FE-os/src/app/layout/layout.component.spec.ts b/portal-FE-os/src/app/layout/layout.component.spec.ts deleted file mode 100644 index 5184fe43..00000000 --- a/portal-FE-os/src/app/layout/layout.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START========================================== - * ONAP Portal - * =================================================================== - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LayoutComponent } from './layout.component'; - -describe('LayoutComponent', () => { - let component: LayoutComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ LayoutComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(LayoutComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-os/src/app/layout/layout.component.ts b/portal-FE-os/src/app/layout/layout.component.ts deleted file mode 100644 index b512988d..00000000 --- a/portal-FE-os/src/app/layout/layout.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal SDK - * =================================================================== - * Copyright © 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-layout', - templateUrl: './layout.component.html', - styleUrls: ['./layout.component.scss'] -}) -export class LayoutComponent implements OnInit { - - collapedSideBar: boolean; - - constructor() {} - - ngOnInit() {} - - receiveCollapsed($event) { - this.collapedSideBar = $event; - } -} diff --git a/portal-FE-os/src/app/layout/layout.module.ts b/portal-FE-os/src/app/layout/layout.module.ts deleted file mode 100644 index 63a99d86..00000000 --- a/portal-FE-os/src/app/layout/layout.module.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * ============LICENSE_START========================================== - * ONAP Portal SDK - * =================================================================== - * Copyright � 2019 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * - * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); - * you may not use this software except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); - * you may not use this documentation except in compliance with the License. - * You may obtain a copy of the License at - * - * https://creativecommons.org/licenses/by/4.0/ - * - * Unless required by applicable law or agreed to in writing, documentation - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================ - * - * - */ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgMaterialModule } from '../ng-material-module'; -import { LayoutRoutingModule } from './layout-routing.module'; -import { LayoutComponent } from './layout.component'; -import { SidebarComponent } from './components/sidebar/sidebar.component'; -import { HeaderComponent } from './components/header/header.component'; -import { GlobalSearchComponent } from './components/global-search/global-search.component'; -import { ClickOutsideModule } from 'ng-click-outside'; -import { TabbarComponent } from './components/tabbar/tabbar.component'; -import { HeaderMenuComponent } from './components/header-menu/header-menu.component'; -import { UserbarComponent } from './components/userbar/userbar.component'; -import { FooterComponent } from './components/footer/footer.component'; -import { ApplicationPipesModule } from '../shared/pipes/application-pipes.module'; - -@NgModule({ - imports: [ - CommonModule, - NgMaterialModule, - LayoutRoutingModule, - ApplicationPipesModule, - NgbDropdownModule, - ClickOutsideModule - ], - declarations: [LayoutComponent, SidebarComponent, HeaderComponent,GlobalSearchComponent, TabbarComponent, HeaderMenuComponent, UserbarComponent, FooterComponent] -}) -export class LayoutModule {} diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html new file mode 100644 index 00000000..bef37b84 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html @@ -0,0 +1,275 @@ + + +
    + + + + + +
    \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss new file mode 100644 index 00000000..0e042a96 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss @@ -0,0 +1,163 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +.application-details-modal .app-properties-mainapp-properties-main{ + padding-left: 40px; + padding-top: 16px; + padding-bottom: 16px; +} + +.application-details-modal .app-properties-main .left-container{ + display: inline-block; + width: 48%; + +} + +.application-details-modal .app-properties-main .right-container{ + display: inline-block; + width: 48%; + float: right; + margin-right:10px; + +} + +.application-details-modal .app-properties-main .property{ + position: relative; + margin-bottom: 18px; +} +.application-details-modal .app-properties-main .checkbox-label{ + display: inline-block; + padding-left: 3px; +} +.application-details-modal .app-properties-main .checkbox-field{ + padding: 0; + margin: 0; + vertical-align: middle; + position: relative; + top: -1px; +} +.application-details-modal .app-properties-main .preview{ + width: 220px; + margin-top: 22px; + display: block; +} + +.application-details-modal .app-properties-main .left-label{ + display:inline-block; + float: left; +} +.application-details-modal .app-properties-main .remove{ + cursor: pointer; + display: inline-block; + float: right; +} + +.application-details-modal .app-properties-main .input-field{ + width: 220px; +} + +.application-details-modal .app-properties-main .input-file-field{ + width: 220px; + border: 0px solid #d2d2d2; + box-shadow: 0px 0px 2px -2px rgba(0, 0, 0, 0.08) inset; + padding-left: 2px; +} + +.application-details-modal .app-properties-main .image-preview{ + background: gray; + background-size: cover; + width: 220px; + height: 184px; + margin-top: 10px; + border: 2px solid #e8e8e8; + border-radius: 4px; +} + +.application-details-modal .app-properties-main .error-container{ + position: absolute; + width: 220px; + display: block; + height: 12px; + line-height: 12px; +} + +.application-details-modal .app-properties-main .err-message{ + font-size: 10px; +} + +.application-details-modal .app-properties-main .checkbox .skin { + left: 0px; + top: 0px; +} + +.application-details-modal input[type="text"] { + width: 16em; +} + +.application-details-modal input[type="url"] { + width: 16em; +} + +.application-details-modal input[type="number"] { + width: 16em; +} + +.application-details-modal input[type="password"] { + width: 16em; +} + +::ng-deep .modal-dialog { + max-width: 700px; + width: 630px; + overflow-x: auto; + overflow-y: auto; +} + +.required::before { + color: rgb(207, 42, 42); + margin-right: 2px; + content: "* "; + position: absolute; + top: 28px; + left: -10px; +} +.remove{ + cursor: pointer; + color: #007bff; +} + \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts new file mode 100644 index 00000000..0ea27629 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ApplicationDetailsDialogComponent } from './application-details-dialog.component'; + +describe('ApplicationDetailsDialogComponent', () => { + let component: ApplicationDetailsDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ApplicationDetailsDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ApplicationDetailsDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts new file mode 100644 index 00000000..60654461 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts @@ -0,0 +1,380 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { IApplications } from 'src/app/shared/model/applications-onboarding/applications'; +import { ApplicationsService } from 'src/app/shared/services'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; + +@Component({ + selector: 'app-application-details-dialog', + templateUrl: './application-details-dialog.component.html', + styleUrls: ['./application-details-dialog.component.scss'], +}) +export class ApplicationDetailsDialogComponent implements OnInit { + + emptyImg = null; + emptyImgForPreview:string; + conflictMessages = {}; + result: any; + isEditMode: boolean = false; + appImageTypeError: boolean = false; + isSaving: boolean = false; + originalImage: any; + ECOMP_URL_REGEX = "/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i"; + + constructor(public activeModal: NgbActiveModal, public ngbModal: NgbModal, + public applicationsService : ApplicationsService) { } + + @Input() applicationObj: IApplications; + @Output() passEntry: EventEmitter = new EventEmitter(); + + newAppModel = { + 'id': null, + 'name': null, + 'imageUrl': null, + 'description': null, + 'notes': null, + 'url': null, + 'alternateUrl': null, + 'restUrl': null, + 'isOpen': false, + 'username': null, + 'appPassword': null, + 'thumbnail': this.emptyImg, + 'isEnabled': false, + 'restrictedApp': false, + 'nameSpace':null, + 'isCentralAuth': false, + 'uebTopicName':null, + 'uebKey': null, + 'uebSecret': null, + 'imageLink': null + }; + + + ngOnInit() { + if(this.applicationObj.id){ + this.isEditMode = true; + }else{ + this.isEditMode = false; + } + //console.log("isEditMode :: ",this.isEditMode); + this.originalImage = null + this.emptyImgForPreview = '../../../assets/images/default_app_image.gif'; + } + + appImageHandler(event: any){ + var reader = new FileReader(); + if(event.target.files && event.target.files[0]){ + reader.readAsDataURL(event.target.files[0]); // read file as data url + var fileName = event.target.files[0].name; + var validFormats = ['jpg', 'jpeg', 'bmp', 'gif', 'png']; + //Get file extension + var ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase(); + //console.log("fileName::>>",fileName ,ext) + //console.log("fileExtetion::>>",ext) + //Check for valid format + if(validFormats.indexOf(ext) == -1){ + this.newAppModel.thumbnail = this.emptyImg; + this.originalImage = null; + this.applicationObj.imageUrl = null; + this.applicationObj.imageLink = null; + this.applicationObj.thumbnail = null; + if(!this.isEditMode){ + this.newAppModel.imageUrl = null; + this.newAppModel.imageLink = null; + this.newAppModel.thumbnail = null; + } + this.appImageTypeError=true; + }else{ + reader.onload = (event: any) => { // called once readAsDataURL is completed + this.applicationObj.imageLink = event.target.result; + this.applicationObj.imageUrl = event.target.result; + this.applicationObj.thumbnail = event.target.result; + this.originalImage = event.target.result; + if(!this.isEditMode){ + this.newAppModel.imageLink = event.target.result; + this.newAppModel.imageUrl = event.target.result; + this.newAppModel.thumbnail = event.target.result; + this.originalImage = event.target.result; + } + } + } + } + } + + removeImage(){ + let confirmationMsg = 'Are you sure you want to remove the image?'; + this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { + if (result === 'Ok') { + //this.imageApi.clearFile(); + this.applicationObj.thumbnail = this.emptyImg; + this.originalImage = null; + this.applicationObj.imageUrl = null; + this.applicationObj.imageLink = null; + this.emptyImgForPreview = '../../../assets/images/default_app_image.gif'; + } + }, (resut) => { + return; + }) + } + + /** Add/Edit Application Method*/ + saveChanges() { + //console.log("addNewApplication getting called.."); + if(this.applicationObj.isCentralAuth){ + //if valid. + if(!this.applicationObj.isEnabled){ + if(((this.applicationObj.name == 'undefined' || !this.applicationObj.name)||(this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace) ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username))) { + this.openConfirmationModal('','Please fill in all required fields(*) for centralized application'); + return; + } + } + if(this.applicationObj.isEnabled){ + if(((this.applicationObj.name == 'undefined' || !this.applicationObj.name) + ||(this.applicationObj.url == 'undefined'|| !this.applicationObj.url) + ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username)||(this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace))) { + + this.openConfirmationModal('','Please fill in all required fields(*) for centralized active application'); + return; + } + } + }else{ + if(!this.applicationObj.isEnabled) { + if((this.applicationObj.name == 'undefined' || !this.applicationObj.name)){ + this.openConfirmationModal('','Please fill in all required field(*) ApplicationName to Save the applictaion'); + return; + } + }else if(this.applicationObj.isEnabled && !this.applicationObj.restrictedApp){ + if((this.applicationObj.name == 'undefined' || !this.applicationObj.name) + ||(this.applicationObj.url == 'undefined'|| !this.applicationObj.url) + ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username)|| + (this.applicationObj.appPassword== 'undefined' || !this.applicationObj.appPassword)) { + + this.openConfirmationModal('','Please fill in all required fields(*) along with password as the app is not centralized'); + return; + } + }else if(this.applicationObj.isEnabled && this.applicationObj.restrictedApp){ + if((this.applicationObj.name == 'undefined' || !this.applicationObj.name) ||(this.applicationObj.url == 'undefined' + || !this.applicationObj.url)){ + this.openConfirmationModal('','Please fill in all required fields(*)'); + return; + } + } + } + + //URL Validation + if(this.applicationObj.isEnabled){ + if(this.applicationObj.url && this.applicationObj.url !='undefined' && this.applicationObj.url != ''){ + let isValidURL = this.isUrlValid(this.applicationObj.url); + if(!isValidURL){ + this.openConfirmationModal('Error','Application URL must be a valid URL.'); + return; + } + }else{ + this.openConfirmationModal('Error','Application URL is required.'); + return; + } + } + + + this.isSaving = true; + // For a restricted app, null out all irrelevant fields + if(this.applicationObj.restrictedApp) { + this.newAppModel.restUrl = null; + this.newAppModel.isOpen = true; + this.newAppModel.username = null; + this.newAppModel.appPassword = null; + this.newAppModel.uebTopicName = null; + this.newAppModel.uebKey = null; + this.newAppModel.uebSecret = null; + + /**Need to set below fields values based on input provided in the dialog */ + this.newAppModel.restrictedApp = this.applicationObj.restrictedApp; + this.newAppModel.name = this.applicationObj.name; + this.newAppModel.url = this.applicationObj.url; + if(this.applicationObj.isEnabled){ + this.newAppModel.isEnabled = this.applicationObj.isEnabled; + }else{ + this.newAppModel.isEnabled = false; + } + + }else{ + + /**Need to set below fields values based on input provided in the dialog */ + this.newAppModel.restrictedApp = false; + this.newAppModel.name = this.applicationObj.name; + this.newAppModel.url = this.applicationObj.url; + this.newAppModel.restUrl = this.applicationObj.restUrl; + this.newAppModel.username = this.applicationObj.username; + this.newAppModel.appPassword = this.applicationObj.appPassword; + + if(this.applicationObj.isEnabled){ + this.newAppModel.isEnabled = this.applicationObj.isEnabled; + }else{ + this.newAppModel.isEnabled = false; + } + + if(this.applicationObj.isOpen){ + this.newAppModel.isOpen = this.applicationObj.isOpen; + }else{ + this.newAppModel.isOpen = false; + } + //console.log("this.applicationObj.isOpen",this.applicationObj.isOpen); + + if(this.applicationObj.isCentralAuth){ + this.newAppModel.isCentralAuth = this.applicationObj.isCentralAuth; + }else{ + this.newAppModel.isCentralAuth = false; + } + + } + + if (this.applicationObj.nameSpace=="") { + this.newAppModel.nameSpace = null; + } + + if(this.isEditMode){ + this.applicationsService.updateOnboardingApp(this.applicationObj) + .subscribe( _data => { + this.result = _data; + //console.log("update application response :: ",this.result); + if(this.result !=null && this.result.httpStatusCode ==200){ + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }else{ + this.openConfirmationModal('Error','There was a problem updating the application changes. Please try again. If the problem persists, then try again later. Error: '+this.result); + return + } + }, error => { + console.log(error); + if(error.status == 409){ + this.openConfirmationModal('Error', 'There was a problem updating the application changes. ' + + 'The Application Name and URL should be unique. Error: ' + + error.status); + return; + }else if(error.status == 500){ + this.openConfirmationModal('Error', 'There was a problem updating the application information. ' + + 'Please try again later. Error: ' +error.status); + return; + }else if(error.status == 404 || error.status == 403){ + this.openConfirmationModal('Error', 'There was a problem updating the application information. ' + + 'Invalid namespace. Error: ' +error.status); + return; + }else if(error.status == 401){ + this.openConfirmationModal('Error', 'There was a problem updating the application information. ' + + 'Portal Mechid is unauthorized to access the given namespace. Error: ' +error.status); + return; + }else if(error.status == 400){ + this.openConfirmationModal('Error','Bad Request Error: ' + error.status); + return; + } else{ + this.openConfirmationModal('Error', 'There was a problem updating the application changes. ' + + 'Please try again. If the problem persists, then try again later. Error: ' + + error.status); + return; + } + }); + + }else{ + //console.log("Coming inside add application",this.newAppModel); + + this.applicationsService.addOnboardingApp(this.newAppModel) + .subscribe( _data => { + this.result = _data; + //console.log("Add application response :: ",this.result); + if(this.result !=null && this.result.httpStatusCode ==200){ + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }else{ + this.openConfirmationModal('Error','There was a problem adding the application changes. Please try again. If the problem persists, then try again later. Error: '+this.result); + return + } + }, error => { + console.log(error); + if(error.status == 409){ + this.openConfirmationModal('Error', 'There was a problem adding the application changes. ' + + 'The Application Name and URL should be unique. Error: ' + + error.status); + return; + } else if(error.status == 500){ + this.openConfirmationModal('Error', 'There was a problem adding the application information. ' + + 'Please try again later. Error: ' +error.status); + return; + }else if(error.status == 400){ + this.openConfirmationModal('Error','Bad Request Error: ' + error.status); + return; + } else{ + this.openConfirmationModal('Error', 'There was a problem adding the application changes. ' + + 'Please try again. If the problem persists, then try again later. Error: ' + + error.status); + return; + } + }); + } + } + + isUrlValid(userInput){ + //let regexQuery = "/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i"; + let regexQuery = "https?://.+"; + let res = userInput.match(regexQuery); + if(res == null){ + return false; + }else{ + return true; + } + } + + openConfirmationModal(_title: string, _message: string) { + const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + } + + openInformationModal(_title: string, _message: string){ + const modalInfoRef = this.ngbModal.open(InformationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + return modalInfoRef; + } +} diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html new file mode 100644 index 00000000..8a678917 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html @@ -0,0 +1,144 @@ + + +
    +
    +
    +
    +

    Application Onboarding

    +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Thumbnail +
    +
    Application Name {{element.name}} Active {{(element.isEnabled) ? 'yes' : 'no'}} Integration Type {{(element.restrictedApp) ? 'link' : 'standard'}} Guest Access {{(element.isOpen) ? 'yes' : 'no'}} Url {{element.url}} REST Url {{element.restUrl}} Communication Key {{element.uebKey}} Application Namespace {{element.nameSpace}} Central Auth Access {{(element.isCentralAuth) ? 'yes' : 'no'}} Delete + + + +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.scss b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.scss new file mode 100644 index 00000000..6bca524d --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.scss @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + + +.container{ + overflow-y: auto; +} + +.container .apps-table .small-thumbnail { + width: 72px; + height: 60px; + border: 1px solid#d2d2d2; + border-radius: 2px; +} + +.container .apps-table th{ + padding-bottom: 15px; + padding-right: 40px; + font-weight: bold; +} + +.ion-md-trash{ + cursor: pointer; +} \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.spec.ts b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.spec.ts new file mode 100644 index 00000000..8e198387 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ApplicationOnboardingComponent } from './application-onboarding.component'; + +describe('ApplicationOnboardingComponent', () => { + let component: ApplicationOnboardingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ApplicationOnboardingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ApplicationOnboardingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts new file mode 100644 index 00000000..8cbf1d28 --- /dev/null +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts @@ -0,0 +1,188 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, ViewChild, Input} from '@angular/core'; +import { MatTableDataSource } from '@angular/material'; +import { MatSort, MatPaginator } from '@angular/material'; +import { ApplicationsService } from '../../shared/services/index'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { IApplications } from 'src/app/shared/model/applications-onboarding/applications'; +import { environment } from '../../../environments/environment'; +import { ApplicationDetailsDialogComponent } from './application-details-dialog/application-details-dialog.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; + +@Component({ + selector: 'app-application-onboarding', + templateUrl: './application-onboarding.component.html', + styleUrls: ['./application-onboarding.component.scss'] +}) +export class ApplicationOnboardingComponent implements OnInit { + + api = environment.api; + appsList: Array = []; + result: any; + isEditMode: boolean = false; + emptyImgForPreview: string; + isUserSuperAdmin: boolean = false; + displayedColumns: string[] = ['thumbnail', 'applicationName','active', + 'integrationType', 'guestAccess', 'url','restURL', + 'communicationKey', 'applicationNamespace', 'centralAuthAccess']; + dataSource = new MatTableDataSource(this.appsList); + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + + constructor(public applicationsService: ApplicationsService, public ngbModal: NgbModal) { } + + ngOnInit() { + this.emptyImgForPreview = '../../../assets/images/default_app_image.gif'; + this.checkIfUserIsSuperAdmin(); + this.getOnboardingApps(); + } + + getOnboardingApps(){ + //console.log("getOnboardingApps called"); + this.applicationsService.getOnboardingApps() + .subscribe(_data => { + this.result = _data; + if (this.result == null || this.result == 'undefined') { + console.log('WidgetOnboardingService::getOnboardingWidgets Failed: Result or result.data is null'); + }else { + this.appsList = _data; + for (var i = 0; i < this.appsList.length; i++) { + this.appsList[i].imageLink = ''; + if (this.appsList[i].imageUrl){ + this.appsList[i].imageLink = this.api.appThumbnail.replace(':appId', this.appsList[i].id); + this.appsList[i].imageLink = this.appsList[i].imageLink+'?' + new Date().getTime(); + }else{ + this.appsList[i].imageLink = this.emptyImgForPreview; + } + } + this.populateTableData(this.appsList); + } + }, error =>{ + console.log(error); + this.openConfirmationModal('Error', error.message); + }); + } + + applyFilter(filterValue: string) { + this.dataSource.filter = filterValue.trim().toLowerCase(); + }; + + + populateTableData(appsList: Array){ + this.dataSource = new MatTableDataSource(appsList); + this.dataSource.sort = this.sort; + this.dataSource.paginator = this.paginator; + }; + + openAddApplicationModal(rowData: any) { + const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Application Details'; + //console.log("selectedData in parent",rowData); + if(rowData != 'undefined' && rowData){ + modalRef.componentInstance.applicationObj = rowData; + this.isEditMode = true; + }else{ + modalRef.componentInstance.applicationObj = {}; + this.isEditMode = false; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + //console.log("receivedEntry >>> ",receivedEntry); + if(receivedEntry){ + this.appsList.push(receivedEntry); + //this.populateTableData(this.appsList); + this.getOnboardingApps(); + } + }); + } + + deleteApplication(application: IApplications){ + let confirmationMsg = 'You are about to delete this App : ' + application.name+ '. Click OK to continue.'; + this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { + if (result === 'Ok') { + if(!application || application == null){ + console.log('ApplicationOnboardingCtrl::deleteApplication: No apllication or ID... cannot delete'); + return; + } + this.appsList.splice(this.appsList.indexOf(application), 1); + this.applicationsService.deleteOnboardingApp(application.id) + .subscribe( data => { + this.result = data; + this.getOnboardingApps(); + }, error => { + console.log(error); + this.openConfirmationModal('Error', error); + }); + } + }, (resut) => { + return; + }) + } + + checkIfUserIsSuperAdmin(){ + this.applicationsService.checkIfUserIsSuperAdmin() + .subscribe(res => { + if(res) { + this.isUserSuperAdmin = true; + this.displayedColumns = ['thumbnail', 'applicationName','active', + 'integrationType', 'guestAccess', 'url','restURL', + 'communicationKey', 'applicationNamespace', 'centralAuthAccess', 'delete']; + } + //console.log("isUserSuperAdmin :: ",this.isUserSuperAdmin); + }, error =>{ + console.log(error); + this.openConfirmationModal('Error', 'ApplicationsCtrl.checkIfUserIsSuperAdmin:: Failed '+error.message); + }); + } + + openConfirmationModal(_title: string, _message: string) { + const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + } + + openInformationModal(_title: string, _message: string){ + const modalInfoRef = this.ngbModal.open(InformationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + return modalInfoRef; + } + +} diff --git a/portal-FE-os/src/app/pages/pages-routing.module.ts b/portal-FE-os/src/app/pages/pages-routing.module.ts new file mode 100644 index 00000000..d39db03c --- /dev/null +++ b/portal-FE-os/src/app/pages/pages-routing.module.ts @@ -0,0 +1,89 @@ +/* + * ============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'; + +import { AdminsComponent } from './admins/admins.component'; +import { DashboardComponent } from '../pages/dashboard/dashboard.component'; +import { PortalAdminsComponent } from './portal-admins/portal-admins.component'; +import { RoleComponent } from './role/role.component'; +import { UsersComponent } from './users/users.component'; +import { FunctionalMenuComponent } from './functional-menu/functional-menu.component'; +import { UserNotificationAdminComponent } from './user-notification-admin/user-notification-admin.component'; +import { WebAnalyticsComponent } from './web-analytics/web-analytics.component'; +import { ApplicationCatalogComponent } from './application-catalog/application-catalog.component'; +import { WidgetCatalogComponent } from './widget-catalog/widget-catalog.component'; +import { MicroserviceOnboardingComponent } from './microservice-onboarding/microservice-onboarding.component'; +import { ApplicationOnboardingComponent } from './application-onboarding/application-onboarding.component'; +import { WidgetOnboardingComponent } from './widget-onboarding/widget-onboarding.component'; +import { AccountOnboardingComponent } from './account-onboarding/account-onboarding.component'; +import { ContactUsComponent } from './contact-us/contact-us.component'; +import { RoleFunctionsComponent } from './role/role-functions/role-functions.component'; +import { NotificationHistoryComponent } from './notification-history/notification-history.component'; +import { GetAccessComponent } from './get-access/get-access.component'; + +const routes: Routes = [ + { path: '', component: DashboardComponent }, + { path: 'applicationsHome', component: DashboardComponent }, + { path: 'admins', component: AdminsComponent }, + { path: 'portalAdmins', component: PortalAdminsComponent }, + { path: 'appCatalog', component: ApplicationCatalogComponent }, + { path: 'widgetCatalog', component: WidgetCatalogComponent }, + { path: 'roles', component: RoleComponent }, + { path: 'roleFunctions', component: RoleFunctionsComponent }, + { path: 'users', component: UsersComponent }, + { path: 'applications', component: ApplicationOnboardingComponent }, + { path: 'widgetOnboarding', component: WidgetOnboardingComponent }, + { path: 'functionalMenu', component: FunctionalMenuComponent }, + { path: 'userNotifications', component: UserNotificationAdminComponent }, + { path: 'microserviceOnboarding', component: MicroserviceOnboardingComponent }, + { path: 'accountOnboarding', component: AccountOnboardingComponent }, + { path: 'webAnlayticsSource', component: WebAnalyticsComponent }, + { path: 'contactUs', component: ContactUsComponent }, + { path: 'getAccess', component: GetAccessComponent }, + { path: 'recentNotifications', component: NotificationHistoryComponent }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PagesRoutingModule { } + + + diff --git a/portal-FE-os/src/app/pages/pages.component.html b/portal-FE-os/src/app/pages/pages.component.html new file mode 100644 index 00000000..9196ffe5 --- /dev/null +++ b/portal-FE-os/src/app/pages/pages.component.html @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/pages.component.scss b/portal-FE-os/src/app/pages/pages.component.scss new file mode 100644 index 00000000..b7697e62 --- /dev/null +++ b/portal-FE-os/src/app/pages/pages.component.scss @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +/* ecomp page main title */ +.ecomp-main-view-title { + color: #191919; + font-size: 24px; + width: 1170px; + padding-bottom: 15px; + margin: auto; +} + +.heading-page { + margin-bottom: 40px; +} \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/pages.component.spec.ts b/portal-FE-os/src/app/pages/pages.component.spec.ts new file mode 100644 index 00000000..1bef834a --- /dev/null +++ b/portal-FE-os/src/app/pages/pages.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PagesComponent } from './pages.component'; + +describe('PagesComponent', () => { + let component: PagesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PagesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PagesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/pages/pages.component.ts b/portal-FE-os/src/app/pages/pages.component.ts new file mode 100644 index 00000000..69153667 --- /dev/null +++ b/portal-FE-os/src/app/pages/pages.component.ts @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-pages', + templateUrl: './pages.component.html', + styleUrls: ['./pages.component.scss'] +}) +export class PagesComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/portal-FE-os/src/app/pages/pages.module.ts b/portal-FE-os/src/app/pages/pages.module.ts new file mode 100644 index 00000000..7ccb3f95 --- /dev/null +++ b/portal-FE-os/src/app/pages/pages.module.ts @@ -0,0 +1,230 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MatIconModule } from '@angular/material/icon'; +import { MatCheckboxModule } from '@angular/material/checkbox'; + +import { AdminsComponent } from './admins/admins.component'; +import { ApplicationCatalogComponent } from './application-catalog/application-catalog.component'; +import { ApplicationOnboardingComponent } from './application-onboarding/application-onboarding.component'; +import { ApplicationDetailsDialogComponent } from './application-onboarding/application-details-dialog/application-details-dialog.component'; +import { AccountOnboardingComponent } from './account-onboarding/account-onboarding.component'; +import { ApplicationCatalogService } from '../shared/services/application-catalog/application-catalog.service'; +import { ContactUsComponent } from './contact-us/contact-us.component'; +import { ContactUsManageComponent } from './contact-us/contact-us-manage/contact-us-manage.component'; +import { ConfirmationModalComponent } from '../modals/confirmation-modal/confirmation-modal.component'; +import { CatalogModalComponent } from './catalog-modal/catalog-modal.component'; +import { DashboardComponent } from '../pages/dashboard/dashboard.component'; +import { FunctionalMenuComponent } from './functional-menu/functional-menu.component'; +import { GridsterModule } from 'angular-gridster2'; +import { InformationModalComponent } from '../modals/information-modal/information-modal.component'; +import { NgMaterialModule } from '../ng-material-module'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { NewPortalAdminComponent } from './portal-admins/new-portal-admin/new-portal-admin.component'; +import { NotificationHistoryComponent } from './notification-history/notification-history.component'; +import { PagesComponent } from './pages.component'; +import { PagesRoutingModule } from './pages-routing.module'; +import { PortalAdminsComponent } from './portal-admins/portal-admins.component'; +import { RoleComponent } from './role/role.component'; +import { SearchUsersComponent } from '../layout/components/search-users/search-users.component'; +import { SchedulerComponent } from './scheduler/scheduler.component'; +import { UserNotificationAdminComponent } from './user-notification-admin/user-notification-admin.component'; +import { WidgetsComponent } from './widgets/widgets.component'; +import { WidgetCatalogComponent } from './widget-catalog/widget-catalog.component'; +import { WebAnalyticsComponent } from './web-analytics/web-analytics.component'; +import { NewAdminComponent } from './admins/new-admin/new-admin.component'; +import { ExternalRequestAccessService } from '../shared/services/external-request-access-service/external-request-access.service'; +import { UsersService } from '../shared/services/users/users.service'; +import { DynamicWidgetComponent } from './dynamic-widget/dynamic-widget.component'; +import { MicroserviceOnboardingComponent } from './microservice-onboarding/microservice-onboarding.component'; +import { WidgetOnboardingComponent } from './widget-onboarding/widget-onboarding.component'; +import { WebAnalyticsDetailsDialogComponent } from './web-analytics/web-analytics-details-dialog/web-analytics-details-dialog.component'; +import { BulkUploadRoleComponent } from './role/bulk-upload-role/bulk-upload-role.component'; +import { AddRoleComponent } from './role/add-role/add-role.component'; +import { RoleFunctionsComponent } from './role/role-functions/role-functions.component'; +import { RoleFunctionModalComponent } from './role/role-functions/role-function-modal/role-function-modal.component'; +import { NewNotificationModalComponent } from './user-notification-admin/new-notification-modal/new-notification-modal.component'; +import { AccountAddDetailsComponent } from './account-onboarding/account-add-details/account-add-details.component'; +import { MicroserviceAddDetailsComponent } from './microservice-onboarding/microservice-add-details/microservice-add-details.component'; +import { DashboardApplicationCatalogComponent } from './dashboard-application-catalog/dashboard-application-catalog.component'; +import { DashboardWidgetCatalogComponent } from './dashboard-widget-catalog/dashboard-widget-catalog.component'; +import { WidgetDetailsDialogComponent } from './widget-onboarding/widget-details-dialog/widget-details-dialog.component'; +import { FunctionalMenuDialogComponent } from './functional-menu/functional-menu-dialog/functional-menu-dialog.component'; +import { GetAccessComponent } from './get-access/get-access.component'; +import { PluginModule } from '../shared/plugin/plugin.module'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { HTTP_INTERCEPTORS } from '@angular/common/http'; +import { HeaderInterceptor } from '../shared/interceptors/header-interceptor'; +import { ApplicationPipesModule } from '../shared/pipes/application-pipes.module'; +import { UsersComponent } from './users/users.component'; +import { NewUserModalComponent } from './users/new-user-modal/new-user-modal.component'; +import { BulkUserComponent } from './users/bulk-user/bulk-user.component'; +import { UserDetailsFormComponent } from './users/user-details-form/user-details-form.component'; + + +@NgModule({ + declarations: [ + PagesComponent, + DashboardComponent, + PortalAdminsComponent, + AccountOnboardingComponent, + FunctionalMenuComponent, + MicroserviceOnboardingComponent, + NotificationHistoryComponent, + RoleComponent, + SchedulerComponent, + UserNotificationAdminComponent, + UsersComponent, + WidgetCatalogComponent, + WidgetOnboardingComponent, + WidgetsComponent, + WebAnalyticsComponent, + NewAdminComponent, + NewUserModalComponent, + BulkUserComponent, + SearchUsersComponent, + InformationModalComponent, + ConfirmationModalComponent, + AdminsComponent, + NewPortalAdminComponent, + SchedulerComponent, + UserNotificationAdminComponent, + WidgetCatalogComponent, + ApplicationOnboardingComponent, + AccountOnboardingComponent, + ApplicationDetailsDialogComponent, + ContactUsComponent, + ContactUsManageComponent, + WebAnalyticsDetailsDialogComponent, + ApplicationCatalogComponent, + WidgetCatalogComponent, + CatalogModalComponent, + DynamicWidgetComponent, + BulkUploadRoleComponent, + AddRoleComponent, + RoleFunctionsComponent, + RoleFunctionModalComponent, + NewNotificationModalComponent, + AccountAddDetailsComponent, + MicroserviceAddDetailsComponent, + WidgetDetailsDialogComponent, + DashboardApplicationCatalogComponent, + DashboardWidgetCatalogComponent, + FunctionalMenuDialogComponent, + GetAccessComponent, + UserDetailsFormComponent + ], + imports: [ + CommonModule, + NgMaterialModule, + ReactiveFormsModule, + FormsModule, + PagesRoutingModule, + ApplicationPipesModule, + NgbModule, + GridsterModule, + MatIconModule, + MatCheckboxModule, + FormsModule, + PluginModule + ], + entryComponents: [ + SchedulerComponent, + InformationModalComponent, + SearchUsersComponent, + ConfirmationModalComponent, + NewPortalAdminComponent, + NewAdminComponent, + BulkUserComponent, + NewUserModalComponent, + ApplicationDetailsDialogComponent, + ContactUsManageComponent, + CatalogModalComponent, + WebAnalyticsDetailsDialogComponent, + AddRoleComponent, + BulkUploadRoleComponent, + RoleFunctionModalComponent, + NewNotificationModalComponent, + AccountAddDetailsComponent, + MicroserviceAddDetailsComponent, + WidgetDetailsDialogComponent, + FunctionalMenuDialogComponent + ], + providers: [ + { + provide: HTTP_INTERCEPTORS, + useClass: HeaderInterceptor, + multi: true, + }], + + +}) +export class PagesModule { + + constructor(public ngbModalService: NgbModal) { + this.addSchdulerEventListners(); + } + + + addSchdulerEventListners() { + let eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; + let eventer = window[eventMethod]; + let messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message"; + + eventer(messageEvent, function (e) { + if (e.data != null && e.data['widgetName'] == 'Portal-Common-Scheduler') { + this.openAddSchedulerModal(e.data); + } + }.bind(this), false); + + } + + openAddSchedulerModal(rowData: any) { + const modalRef = this.ngbModalService.open(SchedulerComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Scheduler Change'; + console.log("selectedData in parent", rowData); + if (rowData != 'undefined' && rowData) { + modalRef.componentInstance.payload = rowData; + } else { + modalRef.componentInstance.payload = {}; + } + + } +} diff --git a/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.html b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.html new file mode 100644 index 00000000..927b5073 --- /dev/null +++ b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.html @@ -0,0 +1,125 @@ + +
    + + +
    + +
    + +
    +
    + + + +
    diff --git a/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.scss b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.scss new file mode 100644 index 00000000..b919f362 --- /dev/null +++ b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.scss @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +.icon-trash { + cursor: pointer; + font-size: 20px; +} + +.app-item-right-error { + color: red; +} + +::ng-deep .mat-pseudo-checkbox-checked::after { + left: 1px !important; + width: 11px !important; + height: 5px !important; +} \ No newline at end of file diff --git a/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.spec.ts b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.spec.ts new file mode 100644 index 00000000..beb998cf --- /dev/null +++ b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewUserModalComponent } from './new-user-modal.component'; + +describe('NewUserModalComponent', () => { + let component: NewUserModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NewUserModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NewUserModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.ts b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.ts new file mode 100644 index 00000000..76c14f17 --- /dev/null +++ b/portal-FE-os/src/app/pages/users/new-user-modal/new-user-modal.component.ts @@ -0,0 +1,322 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { ApplicationsService, UsersService } from 'src/app/shared/services'; +import { MatTableDataSource, MatRadioChange } from '@angular/material'; +import { UserAdminApps, UserAccessRoles } from 'src/app/shared/model'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import { HttpErrorResponse } from '@angular/common/http'; + +@Component({ + selector: 'app-new-user-modal', + templateUrl: './new-user-modal.component.html', + styleUrls: ['./new-user-modal.component.scss'] +}) +export class NewUserModalComponent implements OnInit { + @Input() dialogState: number; + @Input() userTitle: string; + @Input() disableBack: boolean; + @Input() adminModalData: any; + @Input() userModalData: any; + @Output() passBackNewUserPopup: EventEmitter = new EventEmitter(); + changedSelectedUser: any; + showSpinner: boolean; + isGettingAdminApps: boolean; + adminApps: any; + modelSelectedRoles: any; + appRoles: Array; + numberAppsProcessed: number; + isSystemUserCheck = false; + extRequestValue = false; + searchTitleText = 'Enter First Name, Last Name or Org-ID'; + placeholderText = 'Search'; + ngRepeatDemo = [ + { id: 'userButton', value: 'true', labelValue: 'User' }, + { id: 'systemUserButton', value: 'false', labelValue: 'System' } + ] + selectedvalueradioButtonGroup = { + type: 'true' + } + userRadioSearchButton = this.ngRepeatDemo[0].labelValue; + displayedColumns: string[] = ['applications', 'roles', 'delete']; + userAdminAppsSource = new MatTableDataSource(this.adminApps); + showAppSpinner: boolean; + isError: boolean; + errorMessage: any; + originalSelectedRoles: any; + numberAppsSucceeded: number; + anyChanges: boolean; + orgUserIdValue: string; + constructor(public ngbModal: NgbModal, public activeModal: NgbActiveModal, private applicationsService: ApplicationsService, private usersService: UsersService) { } + + ngOnInit() { + this.appRoles = []; + this.adminApps = []; + this.anyChanges = false; + this.modelSelectedRoles = []; + this.originalSelectedRoles = []; + this.changedSelectedUser = null; + if (this.dialogState === 2) { + this.changedSelectedUser = this.userModalData; + this.orgUserIdValue = this.changedSelectedUser.orgUserId; + this.getUserAppsRoles(); + } + } + + addUserFlag : boolean = false; + + addNewUser(newUserFlag : boolean){ + console.log("New user flag ", newUserFlag); + this.addUserFlag = true; + } + + changeSelectedUser(user: any) { + this.changedSelectedUser = user; + if (this.changedSelectedUser.firstName === undefined || this.changedSelectedUser.lastName === undefined) { + this.userTitle = this.changedSelectedUser; + this.orgUserIdValue = this.changedSelectedUser; + } + else { + this.orgUserIdValue = this.changedSelectedUser.orgUserId; + this.userTitle = `${this.changedSelectedUser.firstName}, ` + ` ${this.changedSelectedUser.lastName} ` + ` (${this.changedSelectedUser.orgUserId})`; + } + } + + searchUserRadioChange($event: MatRadioChange) { + if ($event.value === 'System') { + this.searchTitleText = 'Enter System UserID'; + this.placeholderText = 'xxxxxx@org.com'; + this.isSystemUserCheck = true; + } else { + this.searchTitleText = 'Enter First Name, Last Name or ATTUID'; + this.placeholderText = 'Search'; + this.isSystemUserCheck = false; + } + } + + navigateBack() { + this.anyChanges = false; + this.dialogState = 1; + } + + roleSelectChange(element: any) { // update this.adminApps list when user select roles from dropdown + let existingSelectedRoles = this.modelSelectedRoles; + this.modelSelectedRoles = []; + this.anyChanges = true; + this.adminApps.forEach(_item => { + if (_item.id === element.id) { + _item['isChanged'] = true; + } + let appRoleList = _item.appRoles; + if (appRoleList != undefined) { + appRoleList.forEach(_itemRole => { + if (_itemRole.appId === element.id) { + const index = existingSelectedRoles.indexOf(_itemRole); + if (index != -1) { + _itemRole.isApplied = true; + } else { + _itemRole.isApplied = false; + } + } + if (_itemRole.isApplied) + this.modelSelectedRoles.push(_itemRole); + }); + } + }); + } + + getUserAppsRoles() { + if (this.changedSelectedUser === undefined) { + this.dialogState = 1; + return; + } + this.isGettingAdminApps = true; + this.applicationsService.getAdminApps().subscribe((apps: Array) => { + this.isGettingAdminApps = false; + if (!apps || !apps.length) { + return null; + } + this.adminApps = apps; + this.dialogState = 2; + this.numberAppsProcessed = 0; + this.showSpinner = true; + apps.forEach(app => { + //$log.debug('NewUserModalCtrl::getUserAppsRoles: app: id: ', app.id, 'name: ',app.name); + // Keep track of which app has changed, so we know which apps to update using a BE API + app['isChanged'] = false; + // Each of these specifies a state, which corresponds to a different message and style that gets displayed + app['showSpinner'] = true; + app['isError'] = false; + app['isDeleted'] = false; + app['printNoChanges'] = false; + app['isUpdating'] = false; + app['isErrorUpdating'] = false; + app['isDoneUpdating'] = false; + app['errorMessage'] = ""; + this.usersService.getUserAppRoles(app.id, this.orgUserIdValue, this.extRequestValue, this.isSystemUserCheck).toPromise().then((userAppRolesResult) => { + app['appRoles'] = userAppRolesResult; + app['showSpinner'] = false; + for (var i = 0; i < app['appRoles'].length; i++) { + app['appRoles'][i]['appId'] = app.id; + if (app['appRoles'][i].roleName.indexOf('global_') != -1) { + app['appRoles'][i].roleName = '*' + app['appRoles'][i].roleName; + } + if (app['appRoles'][i].isApplied) + this.modelSelectedRoles.push(app['appRoles'][i]); + } + }).catch((err: HttpErrorResponse) => { + app['isError'] = true; + app['showSpinner'] = false; + if (err.status == 200 || err.message.toLowerCase().includes("rollback")) + app['errorMessage'] = 'Error: ' + 500; + else + app['errorMessage'] = 'Error: ' + err.status; + }).finally(() => { + this.numberAppsProcessed++; + if (this.numberAppsProcessed === this.adminApps.length) { + this.originalSelectedRoles = this.modelSelectedRoles; + this.showSpinner = false; + } + }); + }) + this.userAdminAppsSource = new MatTableDataSource(this.adminApps); + }, (_err) => { + + }) + } + + updateUserAppsRoles() { + this.anyChanges = false; + if (!this.changedSelectedUser || + (this.changedSelectedUser.orgUserId == undefined && !this.isSystemUserCheck) || + !this.adminApps) { + return; + } + this.showSpinner = true; + this.numberAppsProcessed = 0; + this.numberAppsSucceeded = 0; + this.adminApps.forEach(app => { + if (app.isChanged) { + app.isUpdating = true; + for (var i = 0; i < app.appRoles.length; i++) { + if (app.appRoles[i].roleName.indexOf('*global_') != -1) { + app.appRoles[i].roleName = app.appRoles[i].roleName.replace('*', ''); + } + } + var newUserAppRoles = { + orgUserId: this.orgUserIdValue, + appId: app.id, + appRoles: app.appRoles, + appName: app.name, + isSystemUser: this.isSystemUserCheck + }; + this.usersService.updateUserAppRoles(newUserAppRoles).toPromise() + .then((res: any) => { + if (res.status && res.status.toLowerCase() === 'error') { + const modalErrorRef = this.ngbModal.open(ConfirmationModalComponent); + modalErrorRef.componentInstance.message = "Error: " + res.message; + } + app.isUpdating = false; + app.isDoneUpdating = true; + this.numberAppsSucceeded++; + }).catch(err => { + var errorMessage = 'Failed to update the user application roles: ' + err; + if (err.status == 504) { + this.numberAppsSucceeded++; + errorMessage = 'Request is being processed, please check back later!'; + } else { + app.isErrorUpdating = true; + } + const modalErrorRef = this.ngbModal.open(ConfirmationModalComponent); + modalErrorRef.componentInstance.message = errorMessage; + }).finally(() => { + this.numberAppsProcessed++; + if (this.numberAppsProcessed === this.adminApps.length) { + this.showSpinner = false; // hide the spinner + } + if (this.numberAppsSucceeded === this.adminApps.length) { + this.passBackNewUserPopup.emit(); + this.activeModal.close('Close');//close and resolve dialog promise with true (to update the table) + } + }) + } else { + app.noChanges = true; + app.isError = false; //remove the error message; just show the No Changes messages + this.numberAppsProcessed++; + this.numberAppsSucceeded++; + if (this.numberAppsProcessed === this.adminApps.length) { + this.showSpinner = false; // hide the spinner + } + if (this.numberAppsSucceeded === this.adminApps.length) { + this.activeModal.close('Close'); + } + } + }); + } + + deleteApp(app) { + let appMessage = this.changedSelectedUser.firstName + ' ' + this.changedSelectedUser.lastName; + const ngbModalConfirm = this.ngbModal.open(InformationModalComponent); + ngbModalConfirm.componentInstance.title = 'Confirmation'; + ngbModalConfirm.componentInstance.message = 'Are you sure you want to delete ' + appMessage; + ngbModalConfirm.result.then((_res) => { + if (_res === 'Ok') { + this.anyChanges = true; + app.isChanged = true; + app.isDeleted = true; // use this to hide the app in the display + app.appRoles.forEach((role) => { + role.isApplied = false; + }); + // remove app roles if user app delete option is selected + this.modelSelectedRoles.forEach((_role, index) => { + if (_role.appId === app.id) this.modelSelectedRoles.splice(index, 1); + }) + this.roleSelectChange(app); + } + }).catch(err => { + // $log.error('NewUserModalCtrl::deleteApp error: ',err); + const ngbModalError = this.ngbModal.open(InformationModalComponent); + ngbModalError.componentInstance.title = 'Error'; + ngbModalError.componentInstance.message = 'There was a problem deleting the the applications. ' + + 'Please try again later. Error: ' + err.status; + }); + } + +} diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html new file mode 100644 index 00000000..7fc35e44 --- /dev/null +++ b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html @@ -0,0 +1,118 @@ + + diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.scss b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.spec.ts b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.spec.ts new file mode 100644 index 00000000..3262174f --- /dev/null +++ b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserDetailsFormComponent } from './user-details-form.component'; + +describe('UserDetailsFormComponent', () => { + let component: UserDetailsFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserDetailsFormComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserDetailsFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts new file mode 100644 index 00000000..bea0fcdb --- /dev/null +++ b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts @@ -0,0 +1,51 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MustMatch } from 'src/app/shared/helpers/must-match-validator'; +import { UsersService } from 'src/app/shared/services'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-user-details-form', + templateUrl: './user-details-form.component.html', + styleUrls: ['./user-details-form.component.scss'] +}) +export class UserDetailsFormComponent implements OnInit { + addNewUserForm: FormGroup; + submitted = false; + + constructor(private formBuilder: FormBuilder, + private usersService: UsersService, + public activeModal: NgbActiveModal) { } + + ngOnInit() { + this.addNewUserForm = this.formBuilder.group({ + firstName: ['', Validators.required], + middleInitial: [''], + lastName: ['', Validators.required], + email: ['', [Validators.required, Validators.email]], + loginId: ['', Validators.required], + loginPwd: ['', [Validators.required, Validators.minLength(6)]], + confirmPassword: ['', Validators.required] + }, { + validator: MustMatch('loginPwd', 'confirmPassword') + }); + } + + get formValue() { + return this.addNewUserForm.controls; + } + + addUser() { + this.submitted = true; + if (this.addNewUserForm.invalid) { + console.log("Invalid form!!"); + return; + } + console.log("New user Json : " + JSON.stringify(this.addNewUserForm.value)); + console.log("Get Raw value : " + this.addNewUserForm.getRawValue()); + let newUserFormData = JSON.stringify(this.addNewUserForm.getRawValue()); + this.usersService.addNewUser(newUserFormData); + this.activeModal.close(); + } + +} diff --git a/portal-FE-os/src/app/shared/interceptors/header-interceptor.ts b/portal-FE-os/src/app/shared/interceptors/header-interceptor.ts new file mode 100644 index 00000000..bb76e14b --- /dev/null +++ b/portal-FE-os/src/app/shared/interceptors/header-interceptor.ts @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { + HttpEvent, + HttpInterceptor, + HttpHandler, + HttpRequest, + HttpHeaders, +} from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { v4 as uuid } from 'uuid'; +import { Injectable } from '@angular/core'; +declare const getWebJunctionXSRFToken: any; + +@Injectable() +export class HeaderInterceptor implements HttpInterceptor { + intercept(req: HttpRequest, next: HttpHandler): Observable> { + // Clone the request to add the new header + // HttpHeader object immutable - copy values + const headerSettings: { [name: string]: string | string[]; } = {}; + headerSettings['X-ECOMP-RequestID'] = uuid(); + const requestType = req.params.get('requestType'); + + if(requestType!=null && requestType==='fileUpload'){ + //headerSettings['Content-Type'] = 'multipart/form-data'; + }else if(requestType!=null && requestType==='downloadWidgetFile'){ + headerSettings['X-Widgets-Type'] = 'all'; + headerSettings['Content-Type'] = 'application/octet-stream'; + }else{ + headerSettings['Content-Type'] = 'application/json'; + } + const newHeader = new HttpHeaders(headerSettings); + const clonedRequest = req.clone({ headers: newHeader, withCredentials: true }); + // Pass the cloned request instead of the original request to the next handle + return next.handle(clonedRequest); + } +} \ No newline at end of file diff --git a/portal-FE-os/src/app/shared/utils/utils.js b/portal-FE-os/src/app/shared/utils/utils.js new file mode 100644 index 00000000..3c99f4ac --- /dev/null +++ b/portal-FE-os/src/app/shared/utils/utils.js @@ -0,0 +1,21 @@ +function getCookies() { + var cookies = { }; + if (document.cookie && document.cookie != '') { + var split = document.cookie.split(';'); + for (var i = 0; i < split.length; i++) { + var name_value = split[i].split("="); + name_value[0] = name_value[0].replace(/^ /, ''); + cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]); + } + } + return cookies; +} + +function getContextRoot(){ + var pathName = window.location.pathname; + var pathArray = pathName.split( '/' ); + var contextRoot=''; + if(pathArray.length!=0 && pathArray.length>=1) + contextRoot = pathArray[1]; + return contextRoot; +} \ No newline at end of file -- cgit 1.2.3-korg