mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3866] Fix several bugs in Task List Cloud component (#4181)
* [ADF-3866] Fix several bugs in Task List Cloud component * [ADF-3866] Remove comment and improve logic
This commit is contained in:
committed by
Eugenio Romano
parent
6fffeef5c6
commit
0348b8ed9c
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cloud-layout',
|
||||
@@ -27,13 +28,22 @@ export class CloudLayoutComponent implements OnInit {
|
||||
displayMenu = true;
|
||||
applicationName: string;
|
||||
|
||||
constructor(private router: Router, private route: ActivatedRoute) {
|
||||
}
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private cloudLayoutService: CloudLayoutService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe((params) => {
|
||||
this.applicationName = params.applicationName;
|
||||
});
|
||||
|
||||
this.route.queryParams.subscribe((params) => {
|
||||
if (params.id) {
|
||||
this.cloudLayoutService.setCurrentTaskFilterParam({ id: params.id });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onStartTask() {
|
||||
|
@@ -20,12 +20,15 @@ import { TaskListCloudComponent, TaskListCloudSortingModel, TaskFilterCloudModel
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'tasks-cloud-demo.component.html',
|
||||
styleUrls: ['tasks-cloud-demo.component.scss']
|
||||
})
|
||||
export class TasksCloudDemoComponent implements OnInit {
|
||||
|
||||
public static ACTION_SAVE_AS = 'SAVE_AS';
|
||||
|
||||
@ViewChild('taskCloud')
|
||||
taskCloud: TaskListCloudComponent;
|
||||
|
||||
@@ -70,10 +73,13 @@ export class TasksCloudDemoComponent implements OnInit {
|
||||
|
||||
onFilterChange(filter: any) {
|
||||
this.editedFilter = Object.assign({}, filter);
|
||||
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order})];
|
||||
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
|
||||
}
|
||||
|
||||
onTaskFilterAction(filter: any) {
|
||||
this.cloudLayoutService.setCurrentTaskFilterParam({id: filter.id});
|
||||
onTaskFilterAction(filterAction: any) {
|
||||
this.cloudLayoutService.setCurrentTaskFilterParam({ id: filterAction.filter.id });
|
||||
if (filterAction.actionType === TasksCloudDemoComponent.ACTION_SAVE_AS) {
|
||||
this.router.navigate([`/cloud/${this.applicationName}/tasks/`], { queryParams: filterAction.filter });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user