mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #793 from Alfresco/dev-mvitale-784
FilterList is shown twice
This commit is contained in:
commit
d18af7cb09
@ -1,20 +1,20 @@
|
|||||||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||||
<header class="mdl-layout__header">
|
<header class="mdl-layout__header">
|
||||||
<!-- Tabs -->
|
<!-- Tabs -->
|
||||||
<div class="mdl-layout__tab-bar mdl-js-ripple-effect">
|
<div class="mdl-layout__tab-bar mdl-js-ripple-effect" #tabheader>
|
||||||
<a href="#scroll-tab-0" class="mdl-layout__tab is-active">APPS</a>
|
<a id="apps-header" href="#apps" class="mdl-layout__tab is-active">APPS</a>
|
||||||
<a href="#scroll-tab-1" class="mdl-layout__tab">TASK LIST</a>
|
<a id="tasks-header" href="#tasks" class="mdl-layout__tab">TASK LIST</a>
|
||||||
<a href="#scroll-tab-2" class="mdl-layout__tab">PROCESS LIST</a>
|
<a id="processes-header" href="#processes" class="mdl-layout__tab">PROCESS LIST</a>
|
||||||
<a href="#scroll-tab-3" class="mdl-layout__tab">REPORT</a>
|
<a id="report-header" href="#report" class="mdl-layout__tab">REPORT</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main class="mdl-layout__content activiti">
|
<main class="mdl-layout__content activiti" #tabmain>
|
||||||
<section class="mdl-layout__tab-panel is-active" id="scroll-tab-0">
|
<section class="mdl-layout__tab-panel is-active" id="apps">
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<activiti-apps [layoutType]="layoutType" (appClick)="onAppClick($event)" #activitiapps></activiti-apps>
|
<activiti-apps [layoutType]="layoutType" (appClick)="onAppClick($event)" #activitiapps></activiti-apps>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="mdl-layout__tab-panel" id="scroll-tab-1">
|
<section class="mdl-layout__tab-panel" id="tasks">
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="mdl-grid">
|
<div class="mdl-grid">
|
||||||
<div class="mdl-cell mdl-cell--2-col task-column mdl-shadow--2dp">
|
<div class="mdl-cell mdl-cell--2-col task-column mdl-shadow--2dp">
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp">
|
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp">
|
||||||
<span>Task List</span>
|
<span>Task List</span>
|
||||||
<activiti-tasklist *ngIf="isTaskListSelected()" [taskFilter]="taskFilter" [data]="dataTasks"
|
<activiti-tasklist [taskFilter]="taskFilter" [data]="dataTasks"
|
||||||
(rowClick)="onTaskRowClick($event)" (onSuccess)="onSuccessTaskList($event)"
|
(rowClick)="onTaskRowClick($event)" (onSuccess)="onSuccessTaskList($event)"
|
||||||
#activititasklist></activiti-tasklist>
|
#activititasklist></activiti-tasklist>
|
||||||
</div>
|
</div>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="mdl-layout__tab-panel" id="scroll-tab-2">
|
<section class="mdl-layout__tab-panel" id="processes">
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="mdl-grid">
|
<div class="mdl-grid">
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="mdl-layout__tab-panel" id="scroll-tab-3">
|
<section class="mdl-layout__tab-panel" id="report">
|
||||||
<div class="page-content"><!-- Your content goes here --></div>
|
<div class="page-content"><!-- Your content goes here --></div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
@ -43,8 +43,6 @@ declare var componentHandler;
|
|||||||
})
|
})
|
||||||
export class ActivitiDemoComponent implements AfterViewChecked {
|
export class ActivitiDemoComponent implements AfterViewChecked {
|
||||||
|
|
||||||
currentChoice: string = 'task-list';
|
|
||||||
|
|
||||||
@ViewChild('activitiapps')
|
@ViewChild('activitiapps')
|
||||||
activitiapps: ActivitiApps;
|
activitiapps: ActivitiApps;
|
||||||
|
|
||||||
@ -66,6 +64,15 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
|||||||
@ViewChild('activitiprocessdetails')
|
@ViewChild('activitiprocessdetails')
|
||||||
activitiprocessdetails: any;
|
activitiprocessdetails: any;
|
||||||
|
|
||||||
|
@ViewChild('tabmain')
|
||||||
|
tabMain: any;
|
||||||
|
|
||||||
|
@ViewChild('tabheader')
|
||||||
|
tabHeader: any;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
appId: number;
|
||||||
|
|
||||||
layoutType: string;
|
layoutType: string;
|
||||||
currentTaskId: string;
|
currentTaskId: string;
|
||||||
currentProcessInstanceId: string;
|
currentProcessInstanceId: string;
|
||||||
@ -81,13 +88,6 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
|||||||
dataTasks: ObjectDataTableAdapter;
|
dataTasks: ObjectDataTableAdapter;
|
||||||
dataProcesses: ObjectDataTableAdapter;
|
dataProcesses: ObjectDataTableAdapter;
|
||||||
|
|
||||||
@Input()
|
|
||||||
appId: number;
|
|
||||||
|
|
||||||
setChoice($event) {
|
|
||||||
this.currentChoice = $event.target.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
isProcessListSelected() {
|
isProcessListSelected() {
|
||||||
return this.currentChoice === 'process-list';
|
return this.currentChoice === 'process-list';
|
||||||
}
|
}
|
||||||
@ -134,6 +134,16 @@ export class ActivitiDemoComponent implements AfterViewChecked {
|
|||||||
|
|
||||||
this.processFilter = null;
|
this.processFilter = null;
|
||||||
this.currentProcessInstanceId = 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) {
|
onTaskFilterClick(event: FilterRepresentationModel) {
|
||||||
|
@ -82,7 +82,7 @@ export class ActivitiProcessFilters implements OnInit, OnChanges {
|
|||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
let appId = changes['appId'];
|
let appId = changes['appId'];
|
||||||
if (appId && appId.currentValue) {
|
if (appId && (appId.currentValue || appId.currentValue === null)) {
|
||||||
this.load();
|
this.load();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,6 @@ export class ActivitiProcessFilters implements OnInit, OnChanges {
|
|||||||
* @param tasks
|
* @param tasks
|
||||||
*/
|
*/
|
||||||
private load() {
|
private load() {
|
||||||
this.resetFilter();
|
|
||||||
if (this.appName) {
|
if (this.appName) {
|
||||||
this.filterByAppName();
|
this.filterByAppName();
|
||||||
} else {
|
} else {
|
||||||
@ -104,6 +103,7 @@ export class ActivitiProcessFilters implements OnInit, OnChanges {
|
|||||||
private filterByAppId(appId) {
|
private filterByAppId(appId) {
|
||||||
this.activiti.getProcessFilters(appId).subscribe(
|
this.activiti.getProcessFilters(appId).subscribe(
|
||||||
(res: FilterRepresentationModel[]) => {
|
(res: FilterRepresentationModel[]) => {
|
||||||
|
this.resetFilter();
|
||||||
res.forEach((filter) => {
|
res.forEach((filter) => {
|
||||||
this.filterObserver.next(filter);
|
this.filterObserver.next(filter);
|
||||||
});
|
});
|
||||||
|
@ -82,7 +82,7 @@ export class ActivitiFilters implements OnInit, OnChanges {
|
|||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
let appId = changes['appId'];
|
let appId = changes['appId'];
|
||||||
if (appId) {
|
if (appId && (appId.currentValue || appId.currentValue === null)) {
|
||||||
this.load();
|
this.load();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,6 @@ export class ActivitiFilters implements OnInit, OnChanges {
|
|||||||
* @param tasks
|
* @param tasks
|
||||||
*/
|
*/
|
||||||
private load() {
|
private load() {
|
||||||
this.resetFilter();
|
|
||||||
if (this.appName) {
|
if (this.appName) {
|
||||||
this.filterByAppName();
|
this.filterByAppName();
|
||||||
} else {
|
} else {
|
||||||
@ -104,6 +103,7 @@ export class ActivitiFilters implements OnInit, OnChanges {
|
|||||||
private filterByAppId(appId) {
|
private filterByAppId(appId) {
|
||||||
this.activiti.getTaskListFilters(appId).subscribe(
|
this.activiti.getTaskListFilters(appId).subscribe(
|
||||||
(res: FilterRepresentationModel[]) => {
|
(res: FilterRepresentationModel[]) => {
|
||||||
|
this.resetFilter();
|
||||||
res.forEach((filter) => {
|
res.forEach((filter) => {
|
||||||
this.filterObserver.next(filter);
|
this.filterObserver.next(filter);
|
||||||
this.selectFirstFilter();
|
this.selectFirstFilter();
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
<activiti-people [people]="taskPeople"></activiti-people>
|
<activiti-people [people]="taskPeople"></activiti-people>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
<div class="mdl-cell mdl-cell--4-col">
|
||||||
<activiti-comments [taskId]="taskId" #activiticomments></activiti-comments>
|
<activiti-comments [taskId]="taskDetails.id" #activiticomments></activiti-comments>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
<div class="mdl-cell mdl-cell--4-col">
|
||||||
<activiti-checklist [taskId]="taskId" #activitichecklist></activiti-checklist>
|
<activiti-checklist [taskId]="taskDetails.id" #activitichecklist></activiti-checklist>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<activiti-form *ngIf="hasFormKey()" [taskId]="taskId"
|
<activiti-form *ngIf="hasFormKey()" [taskId]="taskDetails.id"
|
||||||
[showTitle]="showTitle"
|
[showTitle]="showTitle"
|
||||||
[showRefreshButton]="showRefreshButton"
|
[showRefreshButton]="showRefreshButton"
|
||||||
[showCompleteButton]="showCompleteButton"
|
[showCompleteButton]="showCompleteButton"
|
||||||
|
@ -10,9 +10,5 @@
|
|||||||
{{taskDetails?.dueDate ? taskDetails.dueDate : ('TASK_DETAILS.DUE.NONE' |translate) }}
|
{{taskDetails?.dueDate ? taskDetails.dueDate : ('TASK_DETAILS.DUE.NONE' |translate) }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--4-col">
|
|
||||||
<span class="activiti-label">{{ 'TASK_DETAILS.LABELS.FORM' | translate }}</span>:
|
|
||||||
{{taskForm?.name ? taskForm.name : ('TASK_DETAILS.FORM.NONE' | translate) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -15,10 +15,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||||
import { TaskDetailsModel } from '../models/task-details.model';
|
import { TaskDetailsModel } from '../models/task-details.model';
|
||||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
|
||||||
|
|
||||||
declare let componentHandler: any;
|
declare let componentHandler: any;
|
||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
@ -27,23 +26,19 @@ declare let __moduleName: string;
|
|||||||
selector: 'activiti-task-header',
|
selector: 'activiti-task-header',
|
||||||
moduleId: __moduleName,
|
moduleId: __moduleName,
|
||||||
templateUrl: './activiti-task-header.component.html',
|
templateUrl: './activiti-task-header.component.html',
|
||||||
styleUrls: ['./activiti-task-header.component.css'],
|
styleUrls: ['./activiti-task-header.component.css']
|
||||||
providers: [ FormService ]
|
|
||||||
})
|
})
|
||||||
export class ActivitiTaskHeader implements OnInit, OnChanges {
|
export class ActivitiTaskHeader implements OnInit {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
taskDetails: TaskDetailsModel;
|
taskDetails: TaskDetailsModel;
|
||||||
|
|
||||||
taskForm: FormModel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param auth
|
* @param auth
|
||||||
* @param translate
|
* @param translate
|
||||||
*/
|
*/
|
||||||
constructor(private auth: AlfrescoAuthenticationService,
|
constructor(private auth: AlfrescoAuthenticationService,
|
||||||
private activitiForm: FormService,
|
|
||||||
private translate: AlfrescoTranslationService) {
|
private translate: AlfrescoTranslationService) {
|
||||||
|
|
||||||
if (translate) {
|
if (translate) {
|
||||||
@ -52,29 +47,7 @@ export class ActivitiTaskHeader implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.taskDetails && this.taskDetails.formKey) {
|
|
||||||
this.load(this.taskDetails.id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(change) {
|
|
||||||
if (this.taskDetails && this.taskDetails.formKey) {
|
|
||||||
this.load(this.taskDetails.id);
|
|
||||||
} else {
|
|
||||||
this.taskForm = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public load(taskId: string) {
|
|
||||||
if (taskId) {
|
|
||||||
this.activitiForm.getTaskForm(taskId).subscribe(
|
|
||||||
(response) => {
|
|
||||||
this.taskForm = response;
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user