fix actions and draft data object

This commit is contained in:
Peter Maquiran
2024-01-17 10:25:16 +01:00
parent 69ee75b039
commit 4314ae1bff
35 changed files with 556 additions and 305 deletions
@@ -112,7 +112,8 @@ export class DespachoPrPage implements OnInit {
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"Deadline": res.deadline,
"activityInstanceName": res.activityInstanceName,
"TaskStartDate": res.taskStartDate
"TaskStartDate": res.taskStartDate,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
this.fulltask = res;
let stringDraft = res.workflowInstanceDataFields.DraftIds;
@@ -629,17 +630,17 @@ export class DespachoPrPage implements OnInit {
this.processes.GetDraftByID(element).subscribe((resd) => {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
console.log('List of draff', resd)
@@ -142,8 +142,11 @@ export class DespachoPage implements OnInit {
"activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
"Deadline": res.deadline,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
// console.log({res})
// this.updateProcessOnDB(res);
this.fulltask = res;
@@ -205,17 +208,17 @@ export class DespachoPage implements OnInit {
this.processes.GetDraftByID(element).subscribe((resd) => {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
// console.log('List of draff', resd)
@@ -481,17 +481,17 @@ export class DiplomaAssinarPage implements OnInit {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
};
this.draftArray.push(object);
this.mergedArray.push(object);
@@ -106,7 +106,8 @@ export class DiplomasGerarPage implements OnInit {
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
"Deadline": res.deadline,
"TaskStartDate": res.taskStartDate
"TaskStartDate": res.taskStartDate,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
this.fulltask = res;
@@ -144,6 +144,8 @@ export class DiplomaPage implements OnInit {
let stringDraft = res.workflowInstanceDataFields.DraftIds;
let split_stringDraft = stringDraft?.split(";").filter(Boolean);
console.log({split_stringDraft})
this.mergedArray = []
try {
this.getDraft(split_stringDraft);
@@ -537,17 +539,17 @@ export class DiplomaPage implements OnInit {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
this.DraftNames = this.DraftNames + resd.data.description+";"
@@ -70,7 +70,7 @@ export class GabineteDigitalPage implements OnInit {
SessionStore = SessionStore
expedienteTaskPipe = new ExpedienteTaskPipe();
customTaskPipe = new CustomTaskPipe()
@@ -86,7 +86,7 @@ export class GabineteDigitalPage implements OnInit {
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
hideSearchBtn: boolean = false;
showSearch = true;
searchSubject: string = '';
@@ -160,21 +160,21 @@ export class GabineteDigitalPage implements OnInit {
const ordinance = this.ordinance
if(this.showSearch && this.searchSubject) {
const AllProcess = this.TaskService.AllProcess.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
return subject.includes(this.searchSubject.toLowerCase())
})
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
.filter( task => this.TaskService.filter(task, this.filterName))
}
} else {
const AllProcess = this.TaskService.AllProcess.filter( task => this.TaskService.filter(task, this.filterName))
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
.filter( task => this.TaskService.filter(task, this.filterName))
@@ -198,7 +198,7 @@ export class GabineteDigitalPage implements OnInit {
(async () => {
await this.loadAllProcesses()
this.TaskService.registerCallback({
@@ -208,12 +208,12 @@ export class GabineteDigitalPage implements OnInit {
}
})
})();
this.checkFilter();
this.checkRoutes();
this.dynamicSearch()
const pathname = '/home/gabinete-digital'
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.includes(pathname) && !event.url.includes('/home/gabinete-digital/')) {
@@ -230,13 +230,13 @@ export class GabineteDigitalPage implements OnInit {
// this.LoadCounts();
this.checkFilter()
}
this.mobile()
}
})
}
});
}
ngAfterViewInit(): void {
@@ -247,11 +247,11 @@ export class GabineteDigitalPage implements OnInit {
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
} catch(error) {
}
}
@@ -269,7 +269,7 @@ export class GabineteDigitalPage implements OnInit {
} else {
this.refresh = false
}
}, 100);
}
@@ -291,14 +291,14 @@ export class GabineteDigitalPage implements OnInit {
this.dynamicSearch()
}
// console.log('this.filterName', this.filterName)
}
}
goto(url) {
this.router.navigate([url])
}
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
@@ -349,7 +349,6 @@ export class GabineteDigitalPage implements OnInit {
}
hideRefreshButton() {
console.log(this.router.url)
if (window.innerWidth < 701) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
@@ -363,7 +362,6 @@ export class GabineteDigitalPage implements OnInit {
}
mobile() {
console.log(this.router.url)
if (window.innerWidth < 701 && this.router.url.includes('filter=')) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
@@ -375,7 +373,7 @@ export class GabineteDigitalPage implements OnInit {
checkRoutes() {
this.closeAllDesktopComponents();
// console.log(this.router.url, this.router.url.includes('processes=true'))
// alert('hello')s
if (this.router.url.includes('processes=true')) {
@@ -463,7 +461,7 @@ export class GabineteDigitalPage implements OnInit {
}
async loadAllProcesses() {
// this.skeletonLoader = true
await this.TaskService.LoadTask()
this.dynamicSearch()
@@ -472,14 +470,14 @@ export class GabineteDigitalPage implements OnInit {
doRefreshAside() {
try {
window['gabinete-aside-refresh']()
} catch(error) {}
setTimeout(() => {
this.loadAllProcesses();
}, 1000)
}, 1000)
}
doRefresh(event) {
@@ -494,7 +492,7 @@ export class GabineteDigitalPage implements OnInit {
event?.target?.complete();
} catch(error) {}
} catch(error) {}
}, 2000);
}
else {
@@ -671,7 +669,7 @@ export class GabineteDigitalPage implements OnInit {
this.segment = segment;
if (window.innerWidth < 701) {
let navigationExtras: NavigationExtras = { queryParams: { "gerarDiplomas": true }}
this.router.navigate(['/home/gabinete-digital/diplomas-gerar'], navigationExtras);
@@ -69,7 +69,7 @@ export class PedidoPage implements OnInit {
this.loggeduser = SessionStore.user;
this.activatedRoute.paramMap.subscribe(params => {
//
//
if (params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
@@ -103,9 +103,9 @@ export class PedidoPage implements OnInit {
this.processes.GetTask(this.serialnumber).subscribe(res => {
this.fulltask = res
this.TaskService.loadPedidos();
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
let date = new Date(res.taskStartDate);
@@ -131,7 +131,7 @@ export class PedidoPage implements OnInit {
"Status": res.workflowInstanceDataFields.Status,
"Deadline": res.deadline,
}
// this.updateProcess(res);
}
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
@@ -156,6 +156,7 @@ export class PedidoPage implements OnInit {
"ProcessInstanceID": res.workflowInstanceDataFields.InstanceID,
"activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
// this.updateProcess(res)
}
@@ -164,7 +165,7 @@ export class PedidoPage implements OnInit {
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe((users = []) => {
// this.updateProcessInterveners(users)
this.intervenientes = users.filter(user => {
return user.Type == 'I';
@@ -214,7 +215,7 @@ export class PedidoPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents;
})
}
@@ -345,7 +346,7 @@ export class PedidoPage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -385,7 +386,7 @@ export class PedidoPage implements OnInit {
});
modal.onDidDismiss().then(res => {
this.goBack();
}, (error) => {
console.log(error)
@@ -471,7 +472,7 @@ export class PedidoPage implements OnInit {
// }
async distartExpedientModal() {
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -487,7 +488,7 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/*
/*
this.close();
this.openMenu(); */
}
@@ -500,7 +501,7 @@ export class PedidoPage implements OnInit {
}
async openDelegarModal(task: any) {
let classs;
if (window.innerWidth <= 800) {
@@ -516,7 +517,7 @@ export class PedidoPage implements OnInit {
cssClass: classs,
backdropDismiss: false
});
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
@@ -554,12 +555,12 @@ export class PedidoPage implements OnInit {
(error) => {
console.log(error)
})
await modal.present();
}
async openDarParecer(task: any) {
let classs;
if (window.innerWidth < 701) {