diff --git a/web/src/app/workplace/models/task.ts b/web/src/app/workplace/models/task.ts index e29b240d8..77e631992 100644 --- a/web/src/app/workplace/models/task.ts +++ b/web/src/app/workplace/models/task.ts @@ -17,10 +17,11 @@ export class Task { public description: string, public note: string, public state: any, - public isRead: boolean, - public isTransferred: boolean, + public read: boolean, + public transferred: boolean, public priority: number, public classificationSummaryResource: Classification, - public workbasketSummaryResource: Workbasket) { + public workbasketSummaryResource: Workbasket, + public custom1: any) { } } diff --git a/web/src/app/workplace/services/rest-connector.service.spec.ts b/web/src/app/workplace/services/rest-connector.service.spec.ts deleted file mode 100644 index e8e748bbf..000000000 --- a/web/src/app/workplace/services/rest-connector.service.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { RestConnectorService } from './rest-connector.service'; - -describe('RestConnectorService', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [RestConnectorService] - }); - }); - - it('should be created', inject([RestConnectorService], (service: RestConnectorService) => { - expect(service).toBeTruthy(); - })); -}); diff --git a/web/src/app/workplace/services/rest-connector.service.ts b/web/src/app/workplace/services/rest-connector.service.ts deleted file mode 100644 index 23312717f..000000000 --- a/web/src/app/workplace/services/rest-connector.service.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; - -import { Workbasket } from 'app/models/workbasket'; -import { Task } from '../models/task'; -import { environment } from 'app/../environments/environment'; -import { Observable } from 'rxjs/Observable'; - -@Injectable() -export class RestConnectorService { - - httpOptions = { - headers: new HttpHeaders({ - 'Content-Type': 'application/json', - 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x' - }) - }; - - constructor(private httpClient: HttpClient) { } - - getAllWorkBaskets(): Observable { - return this.httpClient.get>(environment.taskanaRestUrl + '/v1/workbaskets?requiredPermission=OPEN', - this.httpOptions); - } - - findTaskWithWorkbaskets(basketKey: string): Observable { - return this.httpClient.get>(environment.taskanaRestUrl + '/v1/tasks?workbasketkey=' - + basketKey + '&state=READY&state=CLAIMED', this.httpOptions); - } - - getTask(id: string): Observable { - return this.httpClient.get(environment.taskanaRestUrl + '/v1/tasks/' + id, this.httpOptions); - } - - completeTask(id: string): Observable { - return this.httpClient.post(environment.taskanaRestUrl + '/v1/tasks/' + id + '/complete', '', this.httpOptions); - } - - claimTask(id: string): Observable { - return this.httpClient.post(environment.taskanaRestUrl + '/v1/tasks/' + id + '/claim', 'test', this.httpOptions); - } - - transferTask(taskId: string, workbasketKey: string): Observable { - return this.httpClient.post(environment.taskanaRestUrl + '/v1/tasks/' + taskId - + '/transfer/' + workbasketKey, '', this.httpOptions); - } - -} diff --git a/web/src/app/workplace/taskdetails/taskdetails.component.html b/web/src/app/workplace/taskdetails/taskdetails.component.html index a0f88b754..75002d7de 100644 --- a/web/src/app/workplace/taskdetails/taskdetails.component.html +++ b/web/src/app/workplace/taskdetails/taskdetails.component.html @@ -1,10 +1,14 @@
+
+ +
Details for task '{{ task.name }}' (ID={{ task.taskId }})

{{ task.description }}

Owner: {{ task.owner }}

+

State: {{ task.state }}

Creation Date: {{ task.created | date:'medium' }}

Claim Date: {{ task.claimed | date:'medium' }}

Completion Date: {{ task.completed | date:'medium' }}

@@ -12,7 +16,14 @@

Planning Date: {{ task.planned | date:'medium' }}

Due Date: {{ task.due | date:'medium' }}

Priority: {{ task.priority }}

-

State: {{ task.state }}

+

Creator: {{task.creator}}

+

Note: {{task.note}}

Workbasket: {{ task.workbasketSummaryResource.workbasketId }}

+

Classification: {{task.classificationSummaryResource.classificationId}}

+

BusinessProcessID: {{task.businessProcessId}}

+

ParentBusinessProcessID: {{task.parentBusinessProcessId}}

+

Read: {{task.read}}

+

Transferred: {{task.transferred}}

+

custom1: {{task.custom1}}

diff --git a/web/src/app/workplace/taskdetails/taskdetails.component.ts b/web/src/app/workplace/taskdetails/taskdetails.component.ts index 05aaf0457..c1b443c10 100644 --- a/web/src/app/workplace/taskdetails/taskdetails.component.ts +++ b/web/src/app/workplace/taskdetails/taskdetails.component.ts @@ -1,5 +1,8 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Task } from '../models/task'; +import {Component, OnInit} from '@angular/core'; +import {Task} from '../models/task'; +import {ActivatedRoute} from '@angular/router'; +import {TaskService} from '../services/task.service'; +import {Location} from '@angular/common'; @Component({ selector: 'taskana-task-details', @@ -7,13 +10,25 @@ import { Task } from '../models/task'; styleUrls: ['./taskdetails.component.scss'] }) export class TaskdetailsComponent implements OnInit { - - @Input() task: Task = null; - constructor() { + constructor(private route: ActivatedRoute, + private taskService: TaskService, + private location: Location) { } ngOnInit() { + this.getTask(); + } + + getTask(): void { + const id = this.route.snapshot.paramMap.get('id'); + this.taskService.getTask(id).subscribe(task => { + this.task = task + }); + } + + goBack(): void { + this.location.back(); } } diff --git a/web/src/app/workplace/tasklist/tasklist.component.html b/web/src/app/workplace/tasklist/tasklist.component.html index 541cbe192..34500a381 100644 --- a/web/src/app/workplace/tasklist/tasklist.component.html +++ b/web/src/app/workplace/tasklist/tasklist.component.html @@ -20,10 +20,10 @@ (click)="openTask(task.taskId)"> - + diff --git a/web/src/app/workplace/tasklist/tasklist.component.ts b/web/src/app/workplace/tasklist/tasklist.component.ts index f3fdde3df..35b1648fd 100644 --- a/web/src/app/workplace/tasklist/tasklist.component.ts +++ b/web/src/app/workplace/tasklist/tasklist.component.ts @@ -1,7 +1,6 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { Task } from '../models/task'; -import { Router, ActivatedRoute } from '@angular/router'; -import { TaskService } from '../services/task.service'; +import {Component, Input, OnInit} from '@angular/core'; +import {Task} from '../models/task'; +import {ActivatedRoute, Router} from '@angular/router'; @Component({ selector: 'taskana-task-list', @@ -12,31 +11,21 @@ export class TasklistComponent implements OnInit { private columnForOrdering: string; - @Output() - task = new EventEmitter(); - @Input() tasks: Task[]; - constructor( - private taskService: TaskService, - private router: Router, - private route: ActivatedRoute) { + constructor(private router: Router, + private route: ActivatedRoute) { this.columnForOrdering = 'id'; // default: order tasks by id } ngOnInit() { } - selectTask(task: Task) { - this.task.next(task); - } - orderTasks(column: string) { this.columnForOrdering = column; } openTask(id: string) { - this.taskService.claimTask(id).subscribe(); - this.router.navigate(['tasks/', id], { relativeTo: this.route.parent }); + this.router.navigate(['tasks/', id], {relativeTo: this.route.parent}); } } diff --git a/web/src/app/workplace/tasks/tasks.component.html b/web/src/app/workplace/tasks/tasks.component.html index c66674b38..068b9b1d2 100644 --- a/web/src/app/workplace/tasks/tasks.component.html +++ b/web/src/app/workplace/tasks/tasks.component.html @@ -6,9 +6,5 @@
-
- -
-
- \ No newline at end of file + diff --git a/web/src/app/workplace/tasks/tasks.component.scss b/web/src/app/workplace/tasks/tasks.component.scss index ecd49b02c..e512e4fc0 100644 --- a/web/src/app/workplace/tasks/tasks.component.scss +++ b/web/src/app/workplace/tasks/tasks.component.scss @@ -1,16 +1,3 @@ -.overlay { - width: 100vw; - height: 100vh; - position: fixed; - top: 0; - left: 0; - display: none; -} - -.overlayActive { - display: block; -} - .container-fluid > .row { min-height: 50px; -} \ No newline at end of file +} diff --git a/web/src/app/workplace/tasks/tasks.component.ts b/web/src/app/workplace/tasks/tasks.component.ts index 050a9554c..be39fe96b 100644 --- a/web/src/app/workplace/tasks/tasks.component.ts +++ b/web/src/app/workplace/tasks/tasks.component.ts @@ -8,8 +8,6 @@ import {Task} from '../models/task'; }) export class TasksComponent { - taskDetailEnabled: boolean; - @Input() tasks: Task[]; @@ -21,7 +19,6 @@ export class TasksComponent { } selectTask(task: Task) { - this.taskDetailEnabled = true; this.task = task; } diff --git a/web/src/app/workplace/workbasket-selector/workbasket-selector.component.html b/web/src/app/workplace/workbasket-selector/workbasket-selector.component.html index 1842c6a2f..9d14a1dc1 100644 --- a/web/src/app/workplace/workbasket-selector/workbasket-selector.component.html +++ b/web/src/app/workplace/workbasket-selector/workbasket-selector.component.html @@ -5,7 +5,7 @@ placeholder="Search for Workbasket ..."/> + [disabled]="result.length==0">Go! diff --git a/web/src/app/workplace/workbasket-selector/workbasket-selector.component.ts b/web/src/app/workplace/workbasket-selector/workbasket-selector.component.ts index dc401bd73..c794f5399 100644 --- a/web/src/app/workplace/workbasket-selector/workbasket-selector.component.ts +++ b/web/src/app/workplace/workbasket-selector/workbasket-selector.component.ts @@ -17,7 +17,7 @@ export class SelectorComponent implements OnInit { tasks: Task[] = []; autoCompleteData: string[] = []; - result: string; + result = ''; resultKey: string; workbaskets: Workbasket[]; diff --git a/web/src/app/workplace/workplace-routing.module.ts b/web/src/app/workplace/workplace-routing.module.ts index e8232627a..5b75480de 100644 --- a/web/src/app/workplace/workplace-routing.module.ts +++ b/web/src/app/workplace/workplace-routing.module.ts @@ -1,34 +1,40 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { WorkplaceComponent } from './workplace.component' -import { TasksComponent } from 'app/workplace/tasks/tasks.component'; -import { TaskComponent } from 'app/workplace/task/task.component'; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {WorkplaceComponent} from './workplace.component' +import {TasksComponent} from 'app/workplace/tasks/tasks.component'; +import {TaskComponent} from 'app/workplace/task/task.component'; +import {TaskdetailsComponent} from './taskdetails/taskdetails.component'; const routes: Routes = [ - { - path: '', - component: WorkplaceComponent, - redirectTo: 'tasks', - pathMatch: 'full' - }, - { - path: '', - component: WorkplaceComponent, - children: [ - { - path: 'tasks', - component: TasksComponent - }, - { - path: 'tasks/:id', - component: TaskComponent - } - ] - } + { + path: '', + component: WorkplaceComponent, + redirectTo: 'tasks', + pathMatch: 'full' + }, + { + path: '', + component: WorkplaceComponent, + children: [ + { + path: 'tasks', + component: TasksComponent + }, + { + path: 'tasks/:id', + component: TaskComponent + }, + { + path: 'tasks/taskdetail/:id', + component: TaskdetailsComponent + } + ] + } ]; @NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] }) -export class WorkplaceRoutingModule { } +export class WorkplaceRoutingModule { +} diff --git a/web/src/app/workplace/workplace.component.ts b/web/src/app/workplace/workplace.component.ts index 14b408c38..4a665c620 100644 --- a/web/src/app/workplace/workplace.component.ts +++ b/web/src/app/workplace/workplace.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit, HostListener, OnDestroy } from '@angular/core'; -import { RestConnectorService } from './services/rest-connector.service'; @Component({ selector: 'taskana-workplace', diff --git a/web/src/app/workplace/workplace.module.ts b/web/src/app/workplace/workplace.module.ts index 0ede43950..cfcaab66f 100644 --- a/web/src/app/workplace/workplace.module.ts +++ b/web/src/app/workplace/workplace.module.ts @@ -16,7 +16,6 @@ import { TasksComponent } from './tasks/tasks.component'; import { OrderTasksByPipe } from './util/orderTasksBy.pipe'; -import { RestConnectorService } from './services/rest-connector.service'; import { DataService } from './services/data.service'; import { TaskService } from './services/task.service'; import { WorkbasketService } from './services/workbasket.service'; @@ -45,7 +44,6 @@ const DECLARATIONS = [ declarations: DECLARATIONS, imports: MODULES, providers: [ - RestConnectorService, DataService, TaskService, WorkbasketService