diff options
author | 2020-07-07 17:03:35 +0000 | |
---|---|---|
committer | 2020-07-07 17:03:35 +0000 | |
commit | 73cc84364b43eddb1757194a29aec75593d0c764 (patch) | |
tree | 4b07e013110dca45a04a13b95326893d03d2ddd6 /portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts | |
parent | d14317e21822c6693bc442f6041560432eeae950 (diff) | |
parent | 0964afff41ff186eb0bb2bd679a34513e90d1015 (diff) |
Merge "Audit log,resolved merge conflict"
Diffstat (limited to 'portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts')
-rw-r--r-- | portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts | 32 |
1 files changed, 31 insertions, 1 deletions
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 b0b882d3..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; @@ -99,4 +113,20 @@ export class TabbarComponent implements OnInit { }; 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); + }); + } } |