merge with branchBug

This commit is contained in:
Eudes Inácio
2021-09-29 17:10:18 +01:00
24 changed files with 1329 additions and 735 deletions
+58 -52
View File
@@ -67,9 +67,8 @@ export class EventsPage implements OnInit {
toDayEventStorage = ToDayEventStorage
expedienteGdStore = ExpedienteGdStore
pdfSrc = "https://www.tabularium.pt/file-upload/FSovLiyEa8Hqy2iDA/TK-Justificativo.pdf";
listToPresent
listToPresent = [];
listToPresentexpediente =[]
expedienteTaskPipe = new ExpedienteTaskPipe()
@@ -120,18 +119,6 @@ export class EventsPage implements OnInit {
this.segment = "Combinada";
this.profile = "mdgpr";
this.showGreeting();
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == '/home/events') {
this.RefreshEvents();
setTimeout(()=>{
this.LoadList();
}, 1500)
}
});
this.hideSearch();
this.getEventsFromLocalDb();
//this.checkScreenOrientation();
@@ -199,17 +186,16 @@ export class EventsPage implements OnInit {
const list = mdOficialEvents.concat(mdPessoalEvents);
console.log("getAllMdOficialPessoalEvents", list)
this.SqliteAddEvent(list);
this.listToPresent = this.toDayEventStorage.eventsList
this.toDayEventStorage.reset(list)
this.listToPresent = list
if (this.toDayEventStorage.eventsList.length > 0) {
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
if (list.length > 0) {
this.currentEvent = list[0].Subject;
this.currentHoursMinutes = list[0].StartDate;
}
this.totalEvent = this.toDayEventStorage.eventsList.length;
this.totalEvent = list.length;
this.showLoader = false;
}
@@ -221,15 +207,14 @@ export class EventsPage implements OnInit {
const list = prOficialEvents.concat(prPessoalEvents);
console.log("getAllPrOficialPessoalEvents", list)
this.SqliteAddEvent(list);
this.toDayEventStorage.reset(list)
if (this.toDayEventStorage.eventsList.length > 0) {
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
if (list.length > 0) {
this.currentEvent = list[0].Subject;
this.currentHoursMinutes = list[0].StartDate;
}
this.listToPresent = this.toDayEventStorage.eventsList;
this.totalEvent = this.toDayEventStorage.eventsList.length;
this.listToPresent = list;
this.totalEvent = list.length;
this.showLoader = false;
}
@@ -329,7 +314,7 @@ export class EventsPage implements OnInit {
Body: ""
}
if(!event.Organizer){
if (!event.Organizer) {
this.sqliteservice.addEvent(data);
console.log("Events page add event sqllite")
}
@@ -339,31 +324,49 @@ export class EventsPage implements OnInit {
getEventsFromLocalDb() {
synchro.registerCallback('Online', () => {
if (synchro.connected === true) {
this.showGreeting();
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == '/home/events') {
this.RefreshEvents();
this.LoadList();
setTimeout(() => {
this.LoadList();
}, 1500)
}
});
console.log('Onlineee')
})
synchro.registerCallback('Offline', () => {
this.platform.ready().then(() => {
this.sqliteservice.getAllEvents().then((event) => {
this.listToPresent = event
this.totalEvent = this.listToPresent.length
this.currentEvent = this.listToPresent[0].Subject
this.currentHoursMinutes = this.listToPresent[0].StartDate
console.log("All events from local,", event)
})
console.log('Offlineee')
this.hideSearch();
} else {
this.sqliteservice.getAllEvents().then((event:any[]) => {
this.listToPresent = event
this.totalEvent = this.listToPresent.length
this.currentEvent = this.listToPresent[0].Subject
this.currentHoursMinutes = this.listToPresent[0].StartDate
console.log("All events from local,", event)
})
})
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
var expedientlist = [];
process.forEach((element) => {
let task = {
CreateDate: element.taskStartDate,
DocumentsQty: element.totalDocuments,
Senders: JSON.parse(element.workflowInstanceDataFields).Sender,
SerialNumber: element.serialNumber,
Status: JSON.parse(element.workflowInstanceDataFields).Status,
Subject: JSON.parse(element.workflowInstanceDataFields).Subject,
WorkflowName: element.workflowDisplayName,
activityInstanceName: element.activityInstanceName,
taskStartDate: element.taskStartDate,
}
expedientlist.push(task);
})
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask;
})
}
}
@@ -421,10 +424,13 @@ export class EventsPage implements OnInit {
LoadList() {
this.processes.GetTaskListExpediente(false).subscribe(result => {
console.log("Expediente", result);
this.sqliteservice.addProcess(result)
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
this.expedienteGdStore.reset(ExpedienteTask)
console.log("Expediente 2", ExpedienteTask);
this.listToPresentexpediente = ExpedienteTask;
});
}
@@ -447,9 +453,9 @@ export class EventsPage implements OnInit {
}
}
viewExpedientListPage(){
if(this.loggeduser.Profile == 'MDGPR'){
if( window.innerWidth < 701){
viewExpedientListPage() {
if (this.loggeduser.Profile == 'MDGPR') {
if (window.innerWidth < 701) {
this.router.navigate(['/home/gabinete-digital/expediente']);
}
else {
@@ -457,8 +463,8 @@ export class EventsPage implements OnInit {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
else if(this.loggeduser.Profile == 'PR'){
if( window.innerWidth < 701){
else if (this.loggeduser.Profile == 'PR') {
if (window.innerWidth < 701) {
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
}
else {