diff options
Diffstat (limited to 'portal-FE-common')
21 files changed, 153 insertions, 347 deletions
diff --git a/portal-FE-common/src/app/layout/components/header/header.component.html b/portal-FE-common/src/app/layout/components/header/header.component.html index f3b3a5f7..97f4a260 100644 --- a/portal-FE-common/src/app/layout/components/header/header.component.html +++ b/portal-FE-common/src/app/layout/components/header/header.component.html @@ -76,7 +76,7 @@ <li class="dropdown-item" style="font-weight: lighter"> {{firstName}}, {{lastName}} </li> -<li class="dropdown-item"> +<li class="dropdown-item" *ngIf=(!isSystemUser)> <span class="dropdown-item-name"> {{ 'Email'}}: </span> <div> <span class="dropdown-item-value"> @@ -85,7 +85,8 @@ </div> </li> <li class="dropdown-item"> - <span class="dropdown-item-name"> {{ 'User Id' }}: </span> + <span class="dropdown-item-name" *ngIf=(!isSystemUser)> {{ 'User Id' }}: </span> + <span class="dropdown-item-name" *ngIf=(isSystemUser)> {{ 'System Id' }}: </span> <div> <span class="dropdown-item-value"> {{loginSnippetUserid}} diff --git a/portal-FE-common/src/app/layout/components/header/header.component.ts b/portal-FE-common/src/app/layout/components/header/header.component.ts index 09dd4c1a..429587d9 100644 --- a/portal-FE-common/src/app/layout/components/header/header.component.ts +++ b/portal-FE-common/src/app/layout/components/header/header.component.ts @@ -59,6 +59,7 @@ export class HeaderComponent implements OnInit { api = environment.api; brandName: string; brandLogoImagePath: string; + isSystemUser: boolean = false; constructor(public router: Router, private userProfileService: UserProfileService, private menusService: MenusService, private cookieService: CookieService) { @@ -90,7 +91,7 @@ export class HeaderComponent implements OnInit { getUserInformation() { this.userProfileService.getFunctionalMenuStaticInfo().toPromise().then((res: any) => { - if (res == null || res.firstName == null || res.firstName == '' || res.lastName == null || res.lastName == '') { + 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; @@ -105,6 +106,9 @@ export class HeaderComponent implements OnInit { this.loginSnippetUserid = res.userId; this.lastLogin = Date.parse(res.last_login); } + if(res != null && res.isSystemUser === 'true'){ + this.isSystemUser = true; + } sessionStorage.userId = res.userId; this.menusService.getFunctionalMenuForUser().toPromise().then((jsonHeaderMenu: any) => { // $scope.menuItems = unflatten(jsonHeaderMenu); diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.html b/portal-FE-common/src/app/layout/components/search-users/search-users.component.html deleted file mode 100644 index 03624491..00000000 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.html +++ /dev/null @@ -1,70 +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============================================ - - - --> - -<form> - {{searchTitle}} - <div class="form-row"> - <div class="col-md-6 my-1"> - <label for="inputSearch" class="sr-only"></label> - <input id="inputSearch" pattern="[a-zA-Z0-9-'\s]{3,}" [(ngModel)]="searchString" (keyup)="passSystemUserInfo($event.srcElement.value)" maxlength="80" - required="true" name="searchString" #searchInput auto-focus tabindex="0" autocomplete="off" type="text" - class="form-control" value="searchString" placeholder="{{placeHolder}}"> - </div> - - <div class="col-auto my-1"> - <button id="button-search-users" *ngIf="!isSystemUser" [disabled]="!searchInput.validity.valid || isLoading " type="submit" - class="btn btn-primary mb-2" (click)="searchUsers()"> Search - </button> - </div> - </div> -</form> -<span class="ecomp-spinner" *ngIf="isLoading"></span> -<div class="search-user-container" *ngIf="showUserTable && !isSystemUser"> - <table mat-table [dataSource]="dataSourceMap"> - <!-- Search Result Column--> - <ng-container matColumnDef="firstName"> - <th id="rowheader-result" mat-header-cell *matHeaderCellDef> Showing {{searchUsersResults.length}} {{txtResults}} </th> - <td id="table-data-{{i}}" mat-cell *matCellDef="let element; let i = index;"> - {{element.firstName}} {{element.lastName}} <br> {{element.jobTitle}} - </td> - </ng-container> - <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> - <tr mat-row (click)="setSelectedUser(row)" id="table-row-{{i}}" [ngClass]="{ 'selected': row === selectedUser }" - *matRowDef="let row; columns: displayedColumns; let i = index;"></tr> - </table> -</div>
\ No newline at end of file diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.scss b/portal-FE-common/src/app/layout/components/search-users/search-users.component.scss deleted file mode 100644 index 95a2a5ec..00000000 --- a/portal-FE-common/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-common/src/app/layout/components/search-users/search-users.component.spec.ts b/portal-FE-common/src/app/layout/components/search-users/search-users.component.spec.ts deleted file mode 100644 index 9db3e395..00000000 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.spec.ts +++ /dev/null @@ -1,67 +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'; -import { NgMaterialModule } from 'src/app/ng-material-module'; -import { FormsModule } from '@angular/forms'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; - -describe('SearchUsersComponent', () => { - let component: SearchUsersComponent; - let fixture: ComponentFixture<SearchUsersComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SearchUsersComponent ], - imports: [FormsModule,NgMaterialModule,HttpClientTestingModule] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SearchUsersComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.ts b/portal-FE-common/src/app/layout/components/search-users/search-users.component.ts deleted file mode 100644 index b93ffd61..00000000 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.ts +++ /dev/null @@ -1,107 +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<any> = new EventEmitter(); - searchString: string; - txtResults = 'result'; - searchUsersResults: any; - selected: any; - isLoading: boolean; - showUserTable: boolean; - selectedUser: any; - displayedColumns: string[] = ['firstName']; - dataSourceMap = new MatTableDataSource(this.searchUsersResults); - - ngOnInit() { - this.searchString = ''; - this.showUserTable = false; - this.isSystemUser = false; - } - - passSystemUserInfo(systemUser: string) { - if (this.isSystemUser) - this.passBackSelectedUser.emit(systemUser); - } - - 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) { - const modelRef = this.ngModal.open(ConfirmationModalComponent) - modelRef.componentInstance.title = "Confirmation"; - modelRef.componentInstance.message = " No users found with your query. Please change your search and try again." - this.isLoading = false; - } else { - 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); - } - -} diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html index 31bb197c..d43328d5 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html @@ -38,7 +38,7 @@ <div style="display: flex; flex-direction:column"> <mat-tab-group [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)" - (selectedTabChange)="tabChanged($event)"> + (selectedTabChange)="tabChanged($event);auditLog($event)" > <mat-tab [label]="mainTab"> <!-- <mat-grid-list cols="5"> @@ -59,7 +59,7 @@ <div style="display: flex; flex-direction:row;"> <app-sidebar (collapsedEvent)="receiveCollapsed($event)"></app-sidebar> <app-userbar></app-userbar> - <div class="container" style="margin-left: 370px;"> + <div class="container" [ngStyle]="setStyle()"> <router-outlet></router-outlet> </div> </div> @@ -68,10 +68,10 @@ </mat-tab> - <mat-tab *ngFor="let tab of tabs; let index = index"> + <mat-tab *ngFor="let tab of tabs; let index = index" > <ng-template mat-tab-label> {{tab.label | elipsis: 13}} - <i class="icon ion-md-close-circle" (click)="removeTab(index)"></i> + <i class="icon ion-md-close-circle" (click)="removeTab(index);removeAppObject(index)"></i> </ng-template> @@ -86,9 +86,9 @@ <div *ngFor="let tab of tabs; let index = index" [style.display]='tab.active? "inline" : "none"' [style.position]='tab.active? "static" : "absolute"' - [style.height]='tab.active? "calc(100vh)" : "calc(0vh)"'> + [style.height]='tab.active? "45rem" : "45rem"'> - <iframe id="tabframe-{{tab.label.split(' ').join('-')}}" scrolling='yes' frameBorder='0' width='100%' + <iframe id="tabframe-{{tab.label.split(' ').join('-')}}-{{index}}" scrolling='yes' frameBorder='0' width='100%' scrolling='yes' frameBorder='0' width='100%' height='90%' [src]='tab.url'></iframe> </div> diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts index 76aaa3e7..066d73ff 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts @@ -43,6 +43,7 @@ import { NgMaterialModule } from 'src/app/ng-material-module'; import { Component } from '@angular/core'; import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { HttpClientTestingModule} from '@angular/common/http/testing'; describe('TabbarComponent', () => { let component: TabbarComponent; @@ -51,7 +52,7 @@ describe('TabbarComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ TabbarComponent, AppSideBarStubComponent, AppUserBarStubComponent,RouterOutletStubComponent,AppFooterBarStubComponent,ElipsisPipe], - imports: [NgMaterialModule,BrowserAnimationsModule] + imports: [NgMaterialModule,BrowserAnimationsModule,HttpClientTestingModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts index 7a10e39d..b157abbc 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts @@ -40,6 +40,7 @@ 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'; +import { AuditLogService } from 'src/app/shared/services/auditLog/audit-log.service'; @Component({ selector: 'app-tabbar', @@ -49,11 +50,12 @@ import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-funct export class TabbarComponent implements OnInit { tabs = []; + tabsInfoObject = []; mainTab = 'Home'; selected = new FormControl(0); collapedSideBar: boolean; - constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService) { + constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService, private auditLogService: AuditLogService) { } @@ -61,7 +63,9 @@ export class TabbarComponent implements OnInit { this.addTabFuntionService.listen().subscribe((m: any) => { console.log(m); + this.createAppObject(m); this.addTab(true, m.title, m.url); + }) } @@ -76,6 +80,15 @@ export class TabbarComponent implements OnInit { } } + createAppObject(app:any) { + this.tabsInfoObject.push(app); + } + + removeAppObject(index:number) { + this.tabsInfoObject.splice(index, 1); + + } + removeTab(index: number) { this.tabs.splice(index, 1); } @@ -85,6 +98,7 @@ export class TabbarComponent implements OnInit { } tabChanged($event) { + console.log("$event.index "+$event.value); for (const ttab of this.tabs) { ttab.active = false; @@ -92,4 +106,27 @@ export class TabbarComponent implements OnInit { if(this.tabs.length != 0 && $event.index != 0) this.tabs[$event.index - 1].active = true; } + + setStyle() { + const style = { + 'margin-left': this.collapedSideBar ? '80px' : '370px', + }; + return style; + } + + auditLog($event) { + var app = this.tabsInfoObject[$event.index - 1]; + var comment = ''; + if(app.content==null || app.content==''){ + comment= app.title; + } + else{ + comment = app.content; + } + this.auditLogService.storeAudit(app.appId, 'tab', comment).subscribe(data => { + console.log('Tab action Saved'); + }, error => { + console.log('auditLog Save Error' + error); + }); + } } diff --git a/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss b/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss index 451adfc7..7e0edc10 100644 --- a/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss +++ b/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss @@ -108,8 +108,8 @@ button { display: block; margin-left: auto; margin-right: auto; - height: 55px; - width: 55px; + height: 45px; + width: 45px; border-radius: 50%; } diff --git a/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts b/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts index 2136abb2..d3680c9c 100644 --- a/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts +++ b/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts @@ -82,7 +82,7 @@ export class UserbarComponent implements OnInit { // $log.error('UserbarCtrl::updateActiveUsers: failed to get active user'); this.stop(); } else { - var maxItems = 25; + var maxItems = 5; if (_res.length < maxItems) maxItems = _res.length; for (var i = 0; i < maxItems; i++) { diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts index f571dcaa..4d919b44 100644 --- a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts @@ -101,6 +101,7 @@ export class ApplicationCatalogComponent implements OnInit { this.appCatalogData = data; for (let entry of this.appCatalogData) { //console.log("Check the URL" + environment.api.appThumbnail); + if(entry.applicationType != "3"){ var appCatalog = { x: -1, y: -1, @@ -108,7 +109,7 @@ export class ApplicationCatalogComponent implements OnInit { name: entry.name, mlAppName: entry.mlAppName, imageLink: environment.api.appThumbnail.replace(':appId', <string><any>entry.id), - restricted: entry.restricted, + applicationType: entry.applicationType, select: entry.select, access: entry.access, pending: entry.pending, @@ -116,6 +117,7 @@ export class ApplicationCatalogComponent implements OnInit { }; this.applicationCatalogService.addItem(appCatalog); } + } }, error => { console.log('getAppCatalogServices Error Object' + error); }); @@ -148,7 +150,7 @@ export class ApplicationCatalogComponent implements OnInit { }; openAddRoleModal(item: any) { //console.log("OpenModal check" + item.id); - if ((!item.restricted) && (item.mlproperty)) { + if ((item.applicationType == "1") && (item.mlproperty)) { this.modal.open(CatalogModalComponent); } } diff --git a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html index 3169fa01..4c02d0cc 100644 --- a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html +++ b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html @@ -70,7 +70,7 @@ 'background-color':'white', 'background-repeat': 'no-repeat', 'background-size': '168px 118px', - 'height': '80%'}" (click)="openAddRoleModal(item)"> + 'height': '80%'}" (click)="openAddRoleModal(item);auditLog(item)"> </div> </div> diff --git a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts index be4c09e2..bd6500bd 100644 --- a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts +++ b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts @@ -46,6 +46,7 @@ import { CatalogModalComponent } from '../catalog-modal/catalog-modal.component' import { ExternalRequestAccessService } from 'src/app/shared/services/external-request-access-service/external-request-access.service'; import { UsersService } from 'src/app/shared/services/users/users.service'; import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; +import { AuditLogService } from 'src/app/shared/services/auditLog/audit-log.service'; @Component({ selector: 'app-dashboard-application-catalog', @@ -67,7 +68,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { return this.applicationCatalogService.options; } get layout(): GridsterItem[] { return this.applicationCatalogService.layout; - } constructor(private applicationCatalogService: ApplicationCatalogService, private externalRequestAccessService: ExternalRequestAccessService, private userService: UsersService,private addTabFuntionService: AddTabFunctionService) { + } constructor(private applicationCatalogService: ApplicationCatalogService, private externalRequestAccessService: ExternalRequestAccessService, private userService: UsersService,private addTabFuntionService: AddTabFunctionService, private auditLogService: AuditLogService) { this.sortOptions = [{ index: 0, value: 'N', @@ -169,6 +170,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { this.applicationCatalogService.layout = []; for (let entry of data) { //console.log("Check the URL" + environment.api.appThumbnail); + if(entry.applicationType != '3'){ var appCatalog = { x: -1, y: -1, @@ -176,7 +178,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { name: entry.name, subHeaderText: entry.notes, imageLink: environment.api.appThumbnail.replace(':appId', <string><any>entry.id), - restrictedApp: entry.restrictedApp, + applicationType: entry.applicationType, select: entry.select, access: entry.access, pending: entry.pending, @@ -186,6 +188,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { }; this.applicationCatalogService.addItem(appCatalog); } + } } }, error => { console.log('getAppCatalogServices Error Object' + error); @@ -199,7 +202,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { openAddRoleModal(item: any) { //console.log("OpenModal check" + item.id+" "+item.url); - if (item.restrictedApp) { + if (item.applicationType =='2') { // Link-based apps open in their own browser tab window.open(item.url, '_blank'); } else{ @@ -212,4 +215,12 @@ export class DashboardApplicationCatalogComponent implements OnInit { this.addTabFuntionService.filter(tabContent); } } + + auditLog(app:any) { + this.auditLogService.storeAudit(app.appId, 'app', app.url).subscribe(data => { + console.log('App action Saved'); + }, error => { + console.log('auditLog Save Error' + error); + }); + } }
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/role/role.component.ts b/portal-FE-common/src/app/pages/role/role.component.ts index 0ed39569..6cd14bd7 100644 --- a/portal-FE-common/src/app/pages/role/role.component.ts +++ b/portal-FE-common/src/app/pages/role/role.component.ts @@ -245,7 +245,7 @@ export class RoleComponent implements OnInit { this.roleDataSource = new MatTableDataSource(this.availableRoles); this.applicationsService.getSingleAppInfoById(val).subscribe((res: any) => { this.appName = res.name; - if (res.centralAuth == true) { + if (res.rolesInAAF == true) { this.syncRolesApplied = true; } }); diff --git a/portal-FE-common/src/app/pages/users/users.component.ts b/portal-FE-common/src/app/pages/users/users.component.ts index 935be921..39bf9223 100644 --- a/portal-FE-common/src/app/pages/users/users.component.ts +++ b/portal-FE-common/src/app/pages/users/users.component.ts @@ -212,6 +212,8 @@ export class UsersComponent implements OnInit { this.accountUsers = accountUsers; if (!accountUsers || accountUsers.length === 0) { this.noUsersInApp = true; + this.showSpinner = false; + return null; } this.showSpinner = false; this.adminsDataSource = new MatTableDataSource(this.accountUsers); diff --git a/portal-FE-common/src/app/shared/model/application-catalog.model.ts b/portal-FE-common/src/app/shared/model/application-catalog.model.ts index a0f368c4..46344b79 100644 --- a/portal-FE-common/src/app/shared/model/application-catalog.model.ts +++ b/portal-FE-common/src/app/shared/model/application-catalog.model.ts @@ -41,7 +41,7 @@ export interface IApplicationCatalog { mlAppName: string; imageUrl: string; url: string; - restricted: boolean; + applicationType: string; open: boolean; access: boolean; select: boolean; diff --git a/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts b/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts index a0a93a22..895e4ea2 100644 --- a/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts +++ b/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts @@ -37,27 +37,40 @@ */ export interface IApplications { - id ?: any; - name ?: any; - imageUrl ?: any; - imageLink ?: any; - description ?: any; - notes ?: any; - url ?: any - alternateUrl ?: any; - restUrl ?: any; - isOpen ?: any; - isEnabled ?: any; - motsId ?: any; - myLoginsAppName ?: any; - myLoginsAppOwner ?: any; - username ?: any; - appPassword ?: any; - thumbnail ?: any; - uebTopicName ?: any; - uebKey ?: any; - uebSecret ?: any; - restrictedApp ?: any; - isCentralAuth ?: any; - nameSpace ?: any + id?: any; + appName?: any; + imageUrl?: any; + imageLink?: any; + appDescription?: any; + appNotes?: any; + landingPage?: any + alternateUrl?: any; + restUrl?: any; + isOpen?: any; + isEnabled?: any; + motsId?: any; + myLoginsAppName?: any; + myLoginsAppOwner?: any; + appBasicAuthUsername?: any; + appBasicAuthPassword?: any; + thumbnail?: any; + uebTopicName?: any; + uebKey?: any; + uebSecret?: any; + applicationType?: any; + rolesInAAF?: any; + // ---- start ----to be removed + restrictedApp?: any; + name?: any; + isCentralAuth?: any; + description?: any; + notes?: any; + url?: any; + username?: any; + appPassword?: any; + // ---- end ----to be removed + nameSpace?: any; + usesCadi?: any; + modeOfIntegration?: any; + appAck?: any; }
\ No newline at end of file diff --git a/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts new file mode 100644 index 00000000..1295915d --- /dev/null +++ b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts @@ -0,0 +1,13 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuditLogService } from './audit-log.service'; +import { HttpClientTestingModule} from '@angular/common/http/testing'; + +describe('AuditLogService', () => { + beforeEach(() => TestBed.configureTestingModule({imports: [HttpClientTestingModule]})); + + it('should be created', () => { + const service: AuditLogService = TestBed.get(AuditLogService); + expect(service).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts new file mode 100644 index 00000000..0504fb9f --- /dev/null +++ b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +@Injectable({ + providedIn: 'root' +}) +export class AuditLogService { + + constructor(private api: HttpClient) { } + + storeAudit(affectedAppId:any,type:any,comment:any): Observable<any> { + var url = environment.api.storeAuditLog+'?affectedAppId=' + affectedAppId; + if(type!=''){ + url= url+'&type='+type; + } + if(comment!=''){ + url= url+'&comment='+comment; + } + return this.api.get(url); + } +} diff --git a/portal-FE-common/src/app/shared/services/users/users.service.ts b/portal-FE-common/src/app/shared/services/users/users.service.ts index 38ebedd8..d977f724 100644 --- a/portal-FE-common/src/app/shared/services/users/users.service.ts +++ b/portal-FE-common/src/app/shared/services/users/users.service.ts @@ -78,8 +78,7 @@ export class UsersService { addNewUser(newUserData){ console.log("User service : ", newUserData); - return this.http.post(this.api.saveNewUser, newUserData).subscribe((response)=>{ - }); + return this.http.post(this.api.saveNewUser, newUserData); } } |