From dda8adbf5f4ad41c441b1d4fcc470487458076b2 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Wed, 21 Sep 2016 14:32:23 +0100 Subject: [PATCH] Show the TaskList when an app is select --- .../activiti/activiti-demo.component.html | 22 +++++++-------- .../activiti/activiti-demo.component.ts | 28 +++++++++++++------ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html index 382a4ec4cf..08cf0aca94 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html @@ -1,20 +1,20 @@
-
-
-
+
+
-
+
@@ -24,7 +24,7 @@
Task List -
@@ -36,7 +36,7 @@
-
+
@@ -61,7 +61,7 @@
-
+
diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts index 08e487dabd..02cb33ae3b 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts @@ -43,8 +43,6 @@ declare var componentHandler; }) export class ActivitiDemoComponent implements AfterViewChecked { - currentChoice: string = 'task-list'; - @ViewChild('activitiapps') activitiapps: ActivitiApps; @@ -66,6 +64,15 @@ export class ActivitiDemoComponent implements AfterViewChecked { @ViewChild('activitiprocessdetails') activitiprocessdetails: any; + @ViewChild('tabmain') + tabMain: any; + + @ViewChild('tabheader') + tabHeader: any; + + @Input() + appId: number; + layoutType: string; currentTaskId: string; currentProcessInstanceId: string; @@ -81,13 +88,6 @@ export class ActivitiDemoComponent implements AfterViewChecked { dataTasks: ObjectDataTableAdapter; dataProcesses: ObjectDataTableAdapter; - @Input() - appId: number; - - setChoice($event) { - this.currentChoice = $event.target.value; - } - isProcessListSelected() { return this.currentChoice === 'process-list'; } @@ -134,6 +134,16 @@ export class ActivitiDemoComponent implements AfterViewChecked { this.processFilter = null; this.currentProcessInstanceId = null; + + this.changeTab('apps','tasks'); + } + + changeTab(origin: string, destination: string) { + this.tabMain.nativeElement.children[origin].classList.remove('is-active'); + this.tabMain.nativeElement.children[destination].classList.add('is-active'); + + this.tabHeader.nativeElement.children[`${origin}-header`].classList.remove('is-active'); + this.tabHeader.nativeElement.children[`${destination}-header`].classList.add('is-active'); } onTaskFilterClick(event: FilterRepresentationModel) {