mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
add deadline to list
This commit is contained in:
@@ -12,5 +12,7 @@ export interface ExpedienteFullTask {
|
||||
workflowDisplayName: string;
|
||||
activityInstanceName: string;
|
||||
totalDocuments: number;
|
||||
deadline: string;
|
||||
taskStatus: string
|
||||
workflowInstanceDataFields: ExpedienteFullTaskWorkflowInstanceDataFields;
|
||||
}
|
||||
@@ -24,6 +24,7 @@ export class fullTask {
|
||||
manager: string,
|
||||
username: string,
|
||||
};
|
||||
deadline: string;
|
||||
serialNumber: string;
|
||||
taskStartDate: string;
|
||||
workflowDisplayName: string;
|
||||
@@ -93,6 +94,7 @@ export interface fullTaskList {
|
||||
workflowDisplayName: string;
|
||||
activityInstanceName: activityInstanceName;
|
||||
totalDocuments: number;
|
||||
deadline: string;
|
||||
workflowInstanceDataFields: {
|
||||
Subject: string;
|
||||
Sender: string;
|
||||
@@ -140,6 +142,8 @@ export class customTask {
|
||||
WorkflowName : string
|
||||
activityInstanceName : string
|
||||
Status : string
|
||||
Deadline: string
|
||||
TaskStartDate: string
|
||||
}
|
||||
|
||||
|
||||
@@ -170,8 +174,9 @@ export interface ExpedienteTask {
|
||||
WorkflowName : string
|
||||
activityInstanceName : string
|
||||
Status : string
|
||||
taskStartDate: string
|
||||
TaskStartDate: string
|
||||
Subject: string
|
||||
Deadline: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"DocId": res.workflowInstanceDataFields.DispatchDocId,
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"Deadline": res.deadline,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
}
|
||||
this.fulltask = res;
|
||||
@@ -197,6 +198,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"Deadline": process[0].deadline,
|
||||
}
|
||||
|
||||
let fulltak = {
|
||||
@@ -213,7 +215,8 @@ export class DespachoPrPage implements OnInit {
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
workflowName: process[0].workflowName,
|
||||
"Deadline": process[0].deadline,
|
||||
}
|
||||
this.fulltask = fulltak;
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ export class DespachoPage implements OnInit {
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
"Deadline": res.deadline
|
||||
}
|
||||
|
||||
this.updateProcessOnDB(res);
|
||||
@@ -209,6 +210,7 @@ export class DespachoPage implements OnInit {
|
||||
"DeadlineType": workflow.DeadlineType,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"Status": workflow.Status,
|
||||
"Deadline": process[0].deadline
|
||||
}
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
@@ -228,7 +230,8 @@ export class DespachoPage implements OnInit {
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
workflowName: process[0].workflowName,
|
||||
deadline: process[0].deadline
|
||||
}
|
||||
this.fulltask = fulltak;
|
||||
|
||||
|
||||
+1
@@ -100,6 +100,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
|
||||
@@ -97,6 +97,7 @@ export class DiplomasGerarPage implements OnInit {
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
|
||||
@@ -36,8 +36,10 @@
|
||||
>
|
||||
<div class="item width-100">
|
||||
<div class="exp-top-detail">
|
||||
<div class="subject">
|
||||
<div class="subject d-flex align-center">
|
||||
<ion-label>{{ task.Subject }}</ion-label>
|
||||
<span class="dead-line ml-10" *ngIf="TaskService.deadlineIsToday(task.Deadline)">Para hoje</span>
|
||||
<span class="new-task ml-10" *ngIf="TaskService.lessThen24Hours(task.taskStartDate)">Nova</span>
|
||||
</div>
|
||||
<div class="exp-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||
|
||||
@@ -233,4 +233,18 @@ ion-item{
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dead-line {
|
||||
font-size: 12px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.new-task {
|
||||
border-radius: 20px;
|
||||
background: #efefef;
|
||||
font-size: 12px;
|
||||
float: right;
|
||||
padding: 2.5px 13.5px 2.5px 13.5px;
|
||||
color: #46465b;
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
||||
import { TaskDeadlineService } from 'src/app/services/task-deadline.service'
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
@@ -43,7 +45,9 @@ export class ExpedientePage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
private storage: Storage,
|
||||
private eventTriger: EventTrigger
|
||||
private eventTriger: EventTrigger,
|
||||
public TaskDeadlineService: TaskDeadlineService,
|
||||
public TaskService: TaskService
|
||||
) {
|
||||
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
|
||||
@@ -170,6 +170,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<span class="label">{{task.activityInstanceName}}</span>
|
||||
</div>
|
||||
<div class="item-date">
|
||||
<ion-label>{{ task.CreateDate || task.taskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||
<ion-label>{{ task.CreateDate || task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -314,7 +314,8 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"workflowID": element.workflowID,
|
||||
"workflowInstanceDataFields": element.workflowInstanceDataFields,
|
||||
"workflowInstanceID": element.workflowInstanceID,
|
||||
"workflowName": element.workflowName
|
||||
"workflowName": element.workflowName,
|
||||
"deadline": element.deadline
|
||||
}
|
||||
|
||||
this.sqliteservice.addProcess(process);
|
||||
@@ -348,6 +349,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||
"deadline": element.deadline,
|
||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
@@ -381,6 +383,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"Status": workflowInstanceDataFields.Status,
|
||||
"Agenda": workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
||||
"deadline": element.deadline
|
||||
}
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
@@ -688,6 +691,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"deadline": element.deadline
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -705,6 +709,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"deadline": element.deadline
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -759,6 +764,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
"deadline": element.deadline
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ export class PedidoPage implements OnInit {
|
||||
"ProcessInstanceID": res.workflowInstanceDataFields.InstanceID,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
this.updateProcess(res);
|
||||
|
||||
@@ -17,6 +17,7 @@ export class CustomTaskPipe implements PipeTransform {
|
||||
"Folio": fullTask.workflowInstanceDataFields.Subject,
|
||||
"Senders": fullTask.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"TaskStartDate": fullTask.taskStartDate,
|
||||
"DocumentURL": fullTask.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": fullTask.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": fullTask.totalDocuments,
|
||||
@@ -25,6 +26,7 @@ export class CustomTaskPipe implements PipeTransform {
|
||||
"WorkflowName": fullTask.workflowDisplayName,
|
||||
"activityInstanceName": fullTask.activityInstanceName,
|
||||
"Status": fullTask.workflowInstanceDataFields.Status,
|
||||
"Deadline": fullTask.deadline,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export class ExpedienteTaskPipe implements PipeTransform {
|
||||
|
||||
return {
|
||||
"SerialNumber": fullTask.serialNumber,
|
||||
"taskStartDate": fullTask.taskStartDate,
|
||||
"TaskStartDate": fullTask.taskStartDate,
|
||||
"Subject": fullTask.workflowInstanceDataFields.Subject,
|
||||
"Folio": fullTask.workflowInstanceDataFields.Subject,
|
||||
"Senders": fullTask.workflowInstanceDataFields.Sender,
|
||||
@@ -23,6 +23,7 @@ export class ExpedienteTaskPipe implements PipeTransform {
|
||||
"WorkflowName": fullTask.workflowDisplayName,
|
||||
"activityInstanceName": fullTask.activityInstanceName,
|
||||
"Status": fullTask.workflowInstanceDataFields.Status,
|
||||
"Deadline": fullTask.deadline
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TaskDeadlineService } from './task-deadline.service';
|
||||
|
||||
describe('TaskDeadlineService', () => {
|
||||
let service: TaskDeadlineService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(TaskDeadlineService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskDeadlineService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
date(isoDateString:string) {
|
||||
return momentG(new Date(), 'dd MMMM yyyy') == momentG(new Date(isoDateString), 'dd MMMM yyyy')
|
||||
}
|
||||
|
||||
lessthen24Hours(isoDateString:string) {
|
||||
const creationDate = new Date(isoDateString)
|
||||
const creationDatePlus24h = new Date(creationDate)
|
||||
creationDatePlus24h.setHours((creationDate.getHours() + 24))
|
||||
|
||||
return creationDatePlus24h.getTime() > creationDate.getTime()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TaskService } from './task.service';
|
||||
|
||||
describe('TaskService', () => {
|
||||
let service: TaskService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(TaskService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
deadlineIsToday(isoDateString:string) {
|
||||
return momentG(new Date(), 'dd MMMM yyyy') == momentG(new Date(isoDateString), 'dd MMMM yyyy')
|
||||
}
|
||||
|
||||
lessThen24Hours(isoDateString:string) {
|
||||
const creationDate = new Date(isoDateString)
|
||||
const creationDatePlus24h = new Date(creationDate)
|
||||
creationDatePlus24h.setHours((creationDate.getHours() + 24))
|
||||
const currentDate = new Date()
|
||||
|
||||
return creationDatePlus24h.getTime() > currentDate.getTime()
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
<span class="label">{{task.activityInstanceName}}</span>
|
||||
</div>
|
||||
<div class="item-date">
|
||||
<ion-label>{{ task.CreateDate || task.taskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||
<ion-label>{{ task.CreateDate || task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user