This commit is contained in:
Peter Maquiran
2022-05-02 14:36:08 +01:00
157 changed files with 1076 additions and 1144 deletions
+24 -27
View File
@@ -300,7 +300,6 @@ export class AgendaPage implements OnInit {
// show information about the clicked event in timeline
eventClicked(event: CalendarEvent): void {
/* console.log('Event clicked', event); */
//clear
this.setIntervenient([]);
@@ -370,7 +369,6 @@ export class AgendaPage implements OnInit {
}
onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => {
// console.log('Selected time: ' + ev.selectedTime + ', hasEvents: ' + (ev.events !== undefined && ev.events.length !== 0));
this.eventSelectedDate2 = ev.selectedTime;
}
@@ -410,7 +408,7 @@ export class AgendaPage implements OnInit {
// if (startTimeSamp < endTimeSamp && endDay == 29 && (endMinutes + endHours) == 0) {
// // console.log(id, (endMinutes + endHours))
// //
// classs.push(`calendar-event-border`);
// }
@@ -521,7 +519,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllMdEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => {
// console.log('ALL MD EVENTS', response);
this.addEventToDB(response, "md");
@@ -531,13 +528,11 @@ export class AgendaPage implements OnInit {
// loop
this.CalendarStore.pushEvent(response, 'md');
// console.log('CALENDAR STORE', this.CalendarStore.eventSource)
this.listToPresent = this.CalendarStore.eventSource
this.trasnformData(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
this.myCal.update();
this.myCal.loadEvents();
@@ -566,7 +561,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -584,7 +579,6 @@ export class AgendaPage implements OnInit {
else if (this.loggeduser.Profile == 'PR') {
this.eventService.getAllPrEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => {
// console.log('ALL EVENT PR', response)
this.addEventToDB(response, "pr");
// clear the current month only
@@ -598,7 +592,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -619,7 +613,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllOwnEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => {
// ('ALL MD EVENTS', response);
this.addEventToDB(response, "md");
@@ -629,13 +622,13 @@ export class AgendaPage implements OnInit {
// loop
this.CalendarStore.pushEvent(response, 'md');
// console.log('CALENDAR STORE', this.CalendarStore.eventSource)
this.listToPresent = this.CalendarStore.eventSource
this.trasnformData(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -662,7 +655,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -699,7 +692,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -735,7 +728,7 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -781,7 +774,7 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
//
this.myCal.update();
this.myCal.loadEvents();
@@ -845,6 +838,8 @@ export class AgendaPage implements OnInit {
}
}
if(this.loggeduser.SharedCalendars.length != 0) {
@@ -863,6 +858,8 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
//
this.myCal.update();
this.myCal.loadEvents();
@@ -896,7 +893,7 @@ export class AgendaPage implements OnInit {
}
trasnformData(response, profile) {
// console.log('Transform ', response)
response.forEach(element => {
let event = {
startTime: new Date(element.StartDate),
@@ -910,14 +907,14 @@ export class AgendaPage implements OnInit {
this.array.push(event)
});
this.listToPresent = this.array;
// console.log('LIST TO PRESET', this.listToPresent)
}
//Deve ser removido para ficar só um method transform
trasnformDataDB(response) {
if(response) {
// console.log('Transform ', response)
response.forEach(element => {
let event = {
startTime: new Date(element.StartDate),
@@ -931,7 +928,7 @@ export class AgendaPage implements OnInit {
this.array.push(event)
});
this.listToPresent = this.array;
// console.log('LIST TO PRESET', this.listToPresent)
}
}
@@ -957,7 +954,7 @@ export class AgendaPage implements OnInit {
});
this.storage.set('agendaResponse',responseArray).then(() => {
// console.log('Agenda data saved')
})
} else {
if (response.length > 0) {
@@ -984,7 +981,7 @@ export class AgendaPage implements OnInit {
}
getFromDB() {
// console.log('ALL EVENTS FROM DB AGENDA OFFLINE')
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('agendaResponse').then((events) => {
this.trasnformDataDB(events)
@@ -998,7 +995,7 @@ export class AgendaPage implements OnInit {
})
} else {
this.sqliteservice.getAllEvents().then((events: any[]) => {
// console.log('ALL EVENTS FROM DB', events)
let eventArray = [];
this.trasnformDataDB(events)
@@ -1128,7 +1125,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox()
} else {
// console.log('not valid ' + a)
}
@@ -1136,7 +1133,7 @@ export class AgendaPage implements OnInit {
changeMonth = (month) => {
const a = this.calendar.currentDate;
// console.log(a)
const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null';
@@ -1153,7 +1150,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox()
} else {
// console.log('not valid ' + a)
}
}
@@ -1255,7 +1252,7 @@ export class AgendaPage implements OnInit {
async viewEventDetail(eventId: any) {
this.router.navigate(['/home/agenda', eventId, 'agenda']);
/* console.log(this.profile);
/*
const modal = await this.modalCtrl.create({
component: ViewEventPage,
@@ -98,7 +98,7 @@ export class EditEventPage implements OnInit {
this.isEventEdited = false;
/* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */
this.postEvent = this.navParams.get('event');
// console.log(this.postEvent);
this.caller = this.navParams.get('caller');
this.initCalendarName = this.postEvent.CalendarName;
@@ -159,21 +159,21 @@ export class EditEventPage implements OnInit {
}
goBack() {
// console.log(this.caller);
this.router.navigate(['/home',this.caller]);
}
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{
// console.log(res);
this.recurringTypes = res;
});
}
onSelectedRecurringChanged(ev?:any) {
// console.log(ev);
if(ev.length > 1){
// console.log(ev.filter(data => data != '-1'));
this.selectedRecurringType = ev.filter(data => data != '-1');
}
if(ev.length == 0){
@@ -219,7 +219,7 @@ export class EditEventPage implements OnInit {
openInicio() {
let input: any = document.querySelector('#new-inicio')
if(input) {
// console.log(input)
input.click()
}
}
@@ -418,7 +418,7 @@ export class EditEventPage implements OnInit {
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
// console.log('res', res);
});
}
@@ -465,7 +465,7 @@ export class EditEventPage implements OnInit {
SerialNumber: '',
}
// console.log( this.loadedEventAttachments)
this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
}
@@ -49,7 +49,7 @@ export class EventActionsPopoverPage implements OnInit {
async approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading()
try {
@@ -82,7 +82,7 @@ export class EventActionsPopoverPage implements OnInit {
modal.onDidDismiss()
.then( async (res) => {
console.log(res.data);
if(res.data !== ''){
let body = { "serialNumber": this.serialNumber,
@@ -91,7 +91,7 @@ export class EventActionsPopoverPage implements OnInit {
"ReviewUserComment": res.data,
}
}
console.log(body);
const loader = this.toastService.loading()
@@ -114,7 +114,7 @@ export class EventActionsPopoverPage implements OnInit {
async rejeitar(){
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
const loader = this.toastService.loading()
try {
@@ -124,8 +124,8 @@ export class NewEventPage implements OnInit {
this.CalendarName = this.loggeduser.Profile;
this.selectedRecurringType = "-1";
console.log(this.postEvent);
console.log(this.selectedSegment);
this.getRecurrenceTypes();
@@ -181,7 +181,7 @@ export class NewEventPage implements OnInit {
}
};
console.log(this.postEvent);
}
@@ -193,15 +193,15 @@ export class NewEventPage implements OnInit {
getRecurrenceTypes() {
this.eventService.getRecurrenceTypes().subscribe(res=>{
console.log(res);
this.recurringTypes = res;
});
}
onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){
console.log(ev.filter(data => data != '-1'));
this.selectedRecurringType = ev.filter(data => data != '-1');
}
if(ev.length == 0){
@@ -255,7 +255,7 @@ export class NewEventPage implements OnInit {
openInicio() {
let input: any = document.querySelector('#new-inicio')
if(input) {
console.log(input)
input.click()
}
}
@@ -300,16 +300,16 @@ export class NewEventPage implements OnInit {
if(this.loggeduser.Profile == 'MDGPR') {
console.log(this.loggeduser.Profile);
console.log(this.postEvent);
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
console.log(eventId);
}
else if(this.loggeduser.Profile == 'PR') {
console.log(this.loggeduser.Profile);
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
} else {
@@ -333,7 +333,7 @@ export class NewEventPage implements OnInit {
try {
await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
} catch(error) {
console.log('document not save')
}
});
@@ -100,7 +100,7 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit')
console.log('eventEdit synchnize', res)
})
});
})
@@ -108,7 +108,7 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventDelete')
console.log('eventEdit synchnize', res)
})
});
})
@@ -175,13 +175,13 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
this.addEventToDb(res);
console.log('Loaded one event', res)
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error) => {
console.log('errorstatus ss',error.status)
if (error.status === 0) {
this.getFromDb();
@@ -197,19 +197,19 @@ export class ViewEventPage implements OnInit {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
// console.log('View event details', event)
//
if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
this.loadedEvent = res;
this.addEventToDb(res);
console.log('Loaded one event', res)
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error) => {
console.log('errorstatus ss',error.status)
if (error.status === 0) {
this.getFromDb();
@@ -288,7 +288,7 @@ export class ViewEventPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
if (res) {
setTimeout(() => {
@@ -315,7 +315,7 @@ export class ViewEventPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
if (res) {
setTimeout(() => {
@@ -329,7 +329,7 @@ export class ViewEventPage implements OnInit {
}
async editEvent() {
console.log(this.loadedEvent);
let classs;
if (window.innerWidth <= 800) {
@@ -348,7 +348,7 @@ export class ViewEventPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
if (res) {
setTimeout(() => {
@@ -370,7 +370,7 @@ export class ViewEventPage implements OnInit {
const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId
const selectedDoc = this.loadedEvent.Attachments[this.dicIndex]
console.log('selectedDoc', selectedDoc)
this.task = {
serialNumber: '',
@@ -458,7 +458,7 @@ export class ViewEventPage implements OnInit {
addEventToDb(data) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.ionicStorage.set('eventDetails', data).then(() => {
console.log('Details event saved')
})
} else {
let event = {
@@ -496,7 +496,7 @@ export class ViewEventPage implements OnInit {
} else {
this.sqliteservice.getEventById(this.eventId).then((event) => {
let arrayevent = [];
console.log('EVENT ATTENDEES',event[0].Attendees)
let elemet = {
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
Body: JSON.parse(event[0].Body) || "",
@@ -519,7 +519,7 @@ export class ViewEventPage implements OnInit {
}
arrayevent.push(elemet);
this.loadedEvent = arrayevent[0];
console.log("Event ditails local,", elemet)
})
}
+39 -39
View File
@@ -137,7 +137,7 @@ export class ChatPage implements OnInit {
this.authService.userData$.subscribe((res: any) => {
this.loggedUser = res;
console.log(this.loggedUser);
});
this.hideRefreshButton();
@@ -168,7 +168,7 @@ export class ChatPage implements OnInit {
ngOnDestroy() {
this.setStatus('offline');
this.dataService.set("newGroup", false);
console.log('On Destroy')
}
setStatus(status: string) {
@@ -177,7 +177,7 @@ export class ChatPage implements OnInit {
status: status,
}
this.chatService.setUserStatus(body).subscribe(res => {
console.log(res);
})
}
@@ -210,7 +210,7 @@ export class ChatPage implements OnInit {
this.showGroupContacts = false;
this.showNewEvent = false;
this.showAttendees = false;
console.log('All components closed!');
}
showEmptyContainer() {
@@ -241,7 +241,7 @@ export class ChatPage implements OnInit {
}
}
openContactsPage() {
console.log('OK');
this.idSelected = '';
this.closeAllDesktopComponents();
@@ -249,7 +249,7 @@ export class ChatPage implements OnInit {
this.selectContact();
}
else {
console.log('here');
this.showContacts = true;
}
}
@@ -283,7 +283,7 @@ export class ChatPage implements OnInit {
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
console.log(this.roomId);
this.showGroupMessages = true;
}
}
@@ -299,7 +299,7 @@ export class ChatPage implements OnInit {
this.groupRoomId = data.roomId;
this.closeAllDesktopComponents();
if (window.innerWidth < 701) {
console.log('Mobile');
}
else {
this.showNewEvent = true;
@@ -355,7 +355,7 @@ export class ChatPage implements OnInit {
let params = new HttpParams();
params = params.set("types", "c");
this.chatService.customsRooms(params).subscribe(res => {
//console.log(res);
//
});
}
@@ -369,9 +369,9 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages);
//
//console.log('ROOMS FROM DB', rooms)
//
})
this.storageservice.get('chatusers').then((users) => {
@@ -379,7 +379,7 @@ export class ChatPage implements OnInit {
})
} else {
this.sqlservice.getAllChatRoom().then((rooms: any) => {
//console.log('ROOMS FROM DB', rooms)
//
let roomsArray = [];
rooms.forEach(element => {
let roomListDB = {
@@ -399,16 +399,16 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages);
//
//console.log('ROOMS FROM DB', rooms)
//
})
this.sqlservice.getAllChatUsers().then((userslist: any) => {
//console.log('USERS FOM DB 1', userslist)
//
let chatusersArray = [];
userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = {
_id: element.Id,
name: element.Name,
@@ -436,7 +436,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt
}
//console.log(' Web TRANSFORM ROOM LIST', roomList)
//
roomsArray.push(roomList)
});
@@ -453,7 +453,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt
}
//console.log('TRANSFORM ROOM LIST', roomList)
//
this.sqlservice.addChatListRoom(roomList);
});
}
@@ -463,26 +463,26 @@ export class ChatPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
let usersArray = [];
users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element)
//
let chatusers = {
_id: element._id,
name: element.name,
username: element.username
}
//console.log('TRANSFORM USER CHAT 2', chatusers)
//
usersArray.push(chatusers);
});
await this.storageservice.remove('chatusers');
await this.storageservice.store('chatusers',usersArray);
} else {
users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element)
//
let chatusers = {
id: element._id,
name: element.name,
username: element.username
}
//console.log('TRANSFORM USER CHAT 2', chatusers)
//
this.sqlservice.addChatListUsers(chatusers);
});
}
@@ -499,12 +499,12 @@ export class ChatPage implements OnInit {
async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res => {
//console.log('chatusers', res);
//
this.transformDataUserList(res['users'])
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
//console.log(this.dmUsers);
//
}*/
});
@@ -520,7 +520,7 @@ export class ChatPage implements OnInit {
return dateB - dateA;
});
console.log('GROUPS FROM DB', k)
this.allGroups = rooms.sort((a, b) => {
@@ -530,7 +530,7 @@ export class ChatPage implements OnInit {
});
//console.log('GROUPS FROM DB', this.allGroups)
//
})
this.storageservice.get('chatusers').then((users) => {
@@ -559,15 +559,15 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
});
//console.log('Group FROM DB', this.allGroups);
//
})
/* this.sqlservice.getAllChatUsers().then((userslist: any) => {
console.log('USERS FOM DB 1', userslist)
let chatusersArray = [];
userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = {
_id: element.Id,
name: element.Name,
@@ -598,7 +598,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt
}
console.log(' Web TRANSFORM ROOM LIST', roomList)
groupsArray.push(roomList)
});
@@ -617,7 +617,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt
}
console.log('TRANSFORM ROOM LIST', roomList)
this.sqlservice.addChatListRoom(roomList);
});
}
@@ -626,7 +626,7 @@ export class ChatPage implements OnInit {
async getGroups(event?) {
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res: any) => {
//console.log(res);
//
this.showLoader = false;
if (res.groups != 200) {
@@ -634,7 +634,7 @@ export class ChatPage implements OnInit {
this.getGroupsDB();
this.privateGroups = res.groups;
console.log('Chat list group' , res);
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; */
//let all = this.privateGroups.concat(this.publicGroups);
@@ -643,10 +643,10 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
}); */
//console.log(this.allGroups);
//
/* }); */
if (this.route.url != "/home/chat") {
//console.log("Timer message stop")
//
}
else {
//Check if modal is opened
@@ -699,7 +699,7 @@ export class ChatPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res.data);
this.modalController.dismiss(res.data);
});
}
@@ -707,7 +707,7 @@ export class ChatPage implements OnInit {
async openMessagesModal(roomId: any) {
this.closeAllDesktopComponents();
//console.log(roomId);
//
const modal = await this.modalController.create({
component: MessagesPage,
@@ -722,7 +722,7 @@ export class ChatPage implements OnInit {
async openGroupMessagesModal(roomId: any) {
console.log(roomId);
const modal = await this.modalController.create({
component: GroupMessagesPage,
@@ -737,7 +737,7 @@ export class ChatPage implements OnInit {
// this.crop.crop('path/to/image.jpg', {quality: 75})
// .then(
// newImage => console.log('new image path is: ' + newImage),
// newImage =>
// error => console.error('Error cropping image', error)
// );
@@ -34,7 +34,7 @@ export class EditGroupPage implements OnInit {
getRoomInfo(){
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
console.log(this.room);
this.groupName = this.room.name.split('-').join(' ');
});
}
@@ -55,7 +55,7 @@ export class EditGroupPage implements OnInit {
});
}
else{
console.log("Invalid name!");
}
}
_ionChange(event){
@@ -72,13 +72,13 @@ export class EditGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
console.log('button done pressed');
this.selectedDuration = [
value.days.value,
value.hours.value,
value.minutes.value,
]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){
@@ -58,8 +58,8 @@ export class GroupContactsPage implements OnInit {
ngOnInit() {
this.loadUsers();
this.getMembers();
console.log(this.groupName);
console.log(this.isGroupCreated);
}
loadUsers(){
@@ -82,7 +82,7 @@ export class GroupContactsPage implements OnInit {
}
return 0;
});
console.log(this.users);
this.showLoader = false;
});
@@ -124,16 +124,16 @@ export class GroupContactsPage implements OnInit {
"roomId": this.room._id,
"userId": data._id,
}
console.log(body);
if(this.room.t == "p"){
this.chatService.removeGroupMember(body).subscribe(res=>{
console.log(res);
this.getMembers();
});
}
else if(this.room.t == "c"){
this.chatService.removeChannelMember(body).subscribe(res=>{
console.log(res);
this.getMembers();
});
}
@@ -154,7 +154,7 @@ export class GroupContactsPage implements OnInit {
this.textSearch = event.detail.value;
}
clicked(){
console.log('clicked');
}
selectedContact(user:any){
@@ -164,11 +164,11 @@ export class GroupContactsPage implements OnInit {
}
addContacts(room:any){
console.log(room);
this.selectedUserList = this.users.filter(function(contact) {
return contact.isChecked == true;
});
console.log( this.selectedUserList);
this.selectedUserList.forEach(user=>{
let body ={
"roomId":room._id,
@@ -176,7 +176,7 @@ export class GroupContactsPage implements OnInit {
}
this.chatService.addUserToGroup(body).subscribe(res=>{
console.log(res['success']);
});
});
}
@@ -191,7 +191,7 @@ export class GroupContactsPage implements OnInit {
async openGroupMessages(roomId:any){
this.close();
console.log(roomId);
const modal = await this.modalController.create({
component: GroupMessagesPage,
componentProps: {
@@ -132,7 +132,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
console.log(this.roomId);
this.loggedUser = this.loggedUserChat;
this.getRoomInfo();
this.scrollToBottom();
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.getRoomMessageDB(this.roomId);
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
})
VoiceRecorder.requestAudioRecordingPermission();
//this.loadFiles();
@@ -154,7 +154,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
status: status,
}
// this.chatService.setUserStatus(body).subscribe(res => {
// console.log(res);
//
// })
}
@@ -221,19 +221,19 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
path: fileName,
directory: Directory.Data
})
//console.log(audioFile);
//
const base64sound = audioFile.data;
//Converting base64 to blob
const base64 = await fetch(base64sound);
//console.log(base64);
//
const base64Response = await fetch(`data:audio/ogg;base64,${base64sound}`);
//console.log(base64Response);
//
this.audioRecorded = base64Response.url;
console.log(this.audioRecorded);
}
@@ -261,13 +261,13 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log('==================================', result);
this.recording = false;
if (result.value && result.value.recordDataBase64) {
@@ -277,7 +277,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
await this.storage.set('fileName', fileName)
this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved', result);
setTimeout(async () => {
this.loadFiles();
@@ -337,7 +337,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
@@ -375,10 +375,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
async getChatMembers() {
this.chatService.getAllUsers().subscribe(res => {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
console.log(this.allUsers);
});
}
@@ -402,7 +402,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//If group is private call getGroupMembers
if (this.room.t === 'p') {
this.chatService.getGroupMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -410,7 +410,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Otherwise call getChannelMembers for públic groups
else {
this.chatService.getChannelMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -475,7 +475,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -510,11 +510,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data == 'leave') {
console.log('saiu do grupo');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
}
else if (res.data == 'cancel') {
console.log('cancel');
}
else if (res.data == 'edit') {
this.editGroup(this.roomId);
@@ -593,7 +593,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
console.log(this.attendees);
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -700,16 +700,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData();
formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getGroupRoom(roomId).send({
file: {
@@ -726,7 +726,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
} else {
console.log('File type invalid')
}
}
@@ -745,14 +745,14 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
});
}
async openChatOptions(ev?: any) {
console.log(this.members);
const roomId = this.roomId;
const popover = await this.popoverController.create({
@@ -768,7 +768,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
await popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -790,7 +790,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async addContacts() {
console.log(this.members);
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -821,7 +821,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res.data);
this.getRoomInfo();
//this.modalController.dismiss(res.data);
});
@@ -833,18 +833,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
buttons: [{
text: 'Sair do grupo',
handler: () => {
console.log('Delete clicked');
}
}, {
text: 'Alterar nome do grupo1',
handler: () => {
console.log('Alterar nome do grupo');
this.openChangeGroupName()
}
}, {
text: 'Apagar o grupo',
handler: () => {
console.log('Play clicked');
}
},
]
@@ -857,11 +857,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = {
_id: element.Id,
@@ -881,7 +881,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
// this.messages = chatmsgArray;
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
})
}
}
@@ -939,18 +939,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.loadMessages()
let msgOnly = res['messages'].filter(data => data.t != 'au');
//this.messages = msgOnly.reverse();
// console.log('MOBILE MSG ROCKET',this.messages);
//
this.transformDataMSG(msgOnly.reverse());
this.getRoomMessageDB(this.roomId);
// Reconnect in one second
if (this.route.url != "/home/chat") {
console.log("Timer message stop")
} else {
//Check if modal is opened
if (document.querySelector('.isGroupChatOpened')) {
await new Promise(resolve => setTimeout(resolve, 5000));
await this.serverLongPull();
console.log('Timer message running')
}
}
@@ -1040,18 +1040,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else {
pathFile = this.file.externalRootDirectory
}
console.log(pdfString)
console.log(pathFile)
console.log(contentFile)
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
.then(() => console.log('File is opened'))
.catch(e => console.log('Error opening file', e));
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.log('Error writing file', e))
.catch(e => console.error(e))
}
downloadFileMsg(msg: MessageService) {
@@ -1103,7 +1103,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
@@ -55,7 +55,7 @@ export class ContactsPage implements OnInit {
headers: this.headers,
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log('All users',res.users);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
@@ -92,7 +92,7 @@ export class ContactsPage implements OnInit {
}
clicked(){
console.log('clicked');
}
createRoom(username:string){
@@ -100,29 +100,29 @@ export class ContactsPage implements OnInit {
username: username,
}
this.chatService.createRoom(body).subscribe(res => {
console.log(res);
this.room = res['room'];
console.log(this.room._id);
this.getDirectMessage(this.room._id);
this.WsChatMethodsService.getAllRooms()
});
}
getDirectMessage(roomId:any){
console.log(roomId);
this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId);
console.log(result[0]);
this.dm = result[0];
console.log(this.dm);
this.openModal(this.dm._id);
});
}
async openModal(roomId:any){
this.close();
console.log(roomId);
const modal = await this.modalController.create({
component: MessagesPage,
@@ -143,7 +143,7 @@ export class ContactsPage implements OnInit {
this.createRoom(username);
//Get direct messages (dm)
/* this.getDirectMessage(this.room._id); */
console.log(this.dm);
/* const modal = await this.modalController.create({
+33 -33
View File
@@ -134,7 +134,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
console.log('ROOM ID', this.roomId)
window.onresize = (event) => {
if (window.innerWidth > 701) {
@@ -142,7 +142,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
})
//this.loadFiles();
VoiceRecorder.requestAudioRecordingPermission();
@@ -254,13 +254,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log(result);
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
@@ -269,7 +269,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
this.storage.set('fileName', fileName);
this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved');
})
}
})
@@ -354,7 +354,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
@@ -422,12 +422,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
console.log(this.audioRecorded);
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -450,7 +450,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
viewDocument(file: any, url?: string) {
console.log()
if (file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
@@ -462,7 +462,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
/* playSound(url?:any){
alert('here')
console.log(url);
//this.audioDownloaded = this.sanitiser.bypassSecurityTrustResourceUrl(url);
this.audioDownloaded = url;
} */
@@ -601,7 +601,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
console.log(this.attendees);
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -635,7 +635,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const blob = await base64.blob();
const formData = new FormData();
formData.append("blobFile", blob);
console.log('ALL IMAGE', formData)
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -715,9 +715,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resultType: CameraResultType.Base64,
source: CameraSource.Photos
});
console.log('ADDFILECHAT', file)
//const imageData = await this.fileToBase64Service.convert(file)
//console.log('ADDFILECHAT', imageData)
//
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
const blob = await response.blob();
@@ -752,17 +752,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData();
formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -778,7 +778,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
temporaryData: formData
});
} else {
console.log('File type invalid')
}
@@ -793,7 +793,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
});
@@ -801,7 +801,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openChatOptions(ev?: any) {
const roomId = this.roomId
console.log('MOBILE CHAT OPTION', this.members);
const popover = await this.popoverController.create({
component: ChatOptionsPopoverPage,
@@ -816,7 +816,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -843,11 +843,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = {
_id: element.Id,
@@ -867,7 +867,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
console.log('CHAT MSG FROM DB', chatmsgArray)
})
}
}
@@ -958,18 +958,18 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// } else {
// pathFile = this.file.externalRootDirectory
// }
// console.log(pdfString)
// console.log(pathFile)
// console.log(contentFile)
//
//
//
// this.file
// .writeFile(pathFile, fileName, contentFile, { replace: true })
// .then(success => {
// this.fileOpener
// .open(pathFile + fileName, type)
// .then(() => console.log('File is opened'))
// .catch(e => console.log('Error opening file', e));
// .then(() =>
// .catch(e =>
// })
// .catch(e => console.log('Error writing file', e))
// .catch(e =>
}
downloadFileFromBrowser(fileName: string, data: any): void {
@@ -982,7 +982,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openPreview(msg) {
console.log(msg);
if(msg.file.type === "application/webtrix") {
this.viewDocument(msg.file, msg.attachments.image_url)
@@ -1021,7 +1021,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
@@ -86,8 +86,8 @@ export class ContactsPage implements OnInit {
}
return 0;
});
console.log(res);
console.log(this.users);
}); */
this.users = this.contacts.sort((a,b) => {
if(a.first < b.first){
@@ -135,7 +135,7 @@ export class ContactsPage implements OnInit {
}
clicked(){
console.log('clicked');
}
async groupMessages(){
@@ -44,7 +44,7 @@ export class NewGroupPage implements OnInit {
}
ngOnInit() {
console.log(this.documents);
}
_ionChange(event){
@@ -62,7 +62,7 @@ export class NewGroupPage implements OnInit {
}
async createGroup(){
console.log('NEW GROUP', SessionStore.user.UserName)
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
else{
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
this.isGroupCreated = true;
@@ -94,7 +94,7 @@ export class NewGroupPage implements OnInit {
this.close();
let name = this.groupName.split(' ').join('-');
console.log(name);
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
console.log('button done pressed');
let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -139,7 +139,7 @@ export class NewGroupPage implements OnInit {
value.hours.value,
value.minutes.value,
]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){
@@ -72,7 +72,7 @@ export class EditEventPage implements OnInit {
else{
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
console.log(eventid);
}
if (paramMap.has("caller")){
@@ -164,7 +164,7 @@ export class EditEventPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
}
});
@@ -192,7 +192,7 @@ export class EditEventPage implements OnInit {
{
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res;
console.log(res);
});
}
@@ -74,7 +74,7 @@ export class EventDetailModalPage implements OnInit {
else{
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
console.log(eventid);
}
if (paramMap.has("caller")){
@@ -190,10 +190,10 @@ export class EventDetailModalPage implements OnInit {
this.loadedEventAttachments = attachments;
}); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
console.log(res);
},(error) => {
console.log(error);
});
}
@@ -72,7 +72,6 @@ export class EventDetailPage implements OnInit {
else{
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
console.log(eventid);
}
if (paramMap.has("caller")){
@@ -162,7 +161,6 @@ export class EventDetailPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
}
});
@@ -188,11 +186,9 @@ export class EventDetailPage implements OnInit {
loadAttachments()
{
/* console.log(this.pageId); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res;
console.log(res);
});
}
+19 -20
View File
@@ -104,16 +104,15 @@ export class EventsPage implements OnInit {
private storage: Storage,
public p: PermissionService,
) {
/* this.existingScreenOrientation = this.screenOrientation.type;
console.log(this.existingScreenOrientation); */
/* this.existingScreenOrientation = this.screenOrientation.type; */
this.loggeduser = authService.ValidatedUser;
this.prEventList = null;
this.platform.resize.subscribe(async () => {
//console.log('Resize event detected');
// console.log('Resize event detected');
//
//
});
@@ -175,7 +174,7 @@ export class EventsPage implements OnInit {
// Lock to portrait
/* lockToPortrait() {
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
console.log('set');
} */
// Lock to landscape
@@ -191,7 +190,7 @@ export class EventsPage implements OnInit {
/* checkScreenOrientation() {
if (window.innerWidth < 701) {
this.lockToPortrait();
console.log('was here');
}
else {
@@ -263,7 +262,7 @@ export class EventsPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('events', list).then(() => {
// console.log('Init events saved')
//
})
} else {
if (list.length > 0) {
@@ -308,7 +307,7 @@ export class EventsPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('process', list).then(() => {
// console.log('Init process saved')
//
})
} else {
if (list.length > 0) {
@@ -328,17 +327,17 @@ export class EventsPage implements OnInit {
// ('dateeeeee', dateToday)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('events').then((events: any[]) => {
// console.log('Today events',events)
//
let todayEvents = new Array()
this.listToPresent = events
this.totalEvent = this.listToPresent.length
this.currentEvent = this.listToPresent[0].Subject
this.currentHoursMinutes = this.listToPresent[0].StartDate
// console.log("All events from local,", events)
//
})
this.storage.get('process').then((process: any[]) => {
// console.log('OFOFOFOOF22222', process)
//
const ExpedienteTask = process.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask;
})
@@ -372,7 +371,7 @@ export class EventsPage implements OnInit {
Subject: element.Subject
}
let starteDate = momentG(new Date(element.StartDate), 'yyyy-MM-dd');
// console.log('startTOdayyy', starteDate)
//
if (dateToday == starteDate) {
todayEvents.push(eventObject);
}
@@ -381,12 +380,12 @@ export class EventsPage implements OnInit {
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[]) => {
// console.log('OFOFOFOOF', process)
//
if (process.length > 0 || process != undefined) {
@@ -408,7 +407,7 @@ export class EventsPage implements OnInit {
}
})
// console.log('OFOFOFOOF22222', expedientlist)
//
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask;
@@ -440,12 +439,12 @@ export class EventsPage implements OnInit {
changeProfile() {
if (this.profile == "mdgpr") {
// console.log('pr');
//
this.profile = "pr";
this.RefreshEvents();
}
else {
// console.log('mdgpr');
//
this.profile = "mdgpr";
this.RefreshEvents();
}
@@ -457,7 +456,7 @@ export class EventsPage implements OnInit {
}
async openEventDetail1(id: any) {
// console.log(id);
//
const modal = await this.modalController.create({
component: EventDetailPage,
@@ -474,7 +473,7 @@ export class EventsPage implements OnInit {
LoadList() {
this.processes.GetTaskListExpediente(false).subscribe(result => {
// console.log("Expediente", result);
//
this.addProcessToDb(result);
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
@@ -485,7 +484,7 @@ export class EventsPage implements OnInit {
}, ((error) => {
this.showLoader = false;
// console.log('Getlist error', error)
//
this.getEventsFromLocalDb();
}));
}
@@ -76,12 +76,12 @@ export class DespachoPrPage implements OnInit {
}
});
console.log('DespachoPrPage SerialNumber', this.serialNumber)
}
ngOnInit() {
this.profile = "mdgpr";
console.log(this.serialNumber);
this.activateRoute.paramMap.subscribe(paramMap => {
if (!paramMap.has('SerialNumber')) {
@@ -128,9 +128,9 @@ export class DespachoPrPage implements OnInit {
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
this.updateProcessOnDB(res);
let thedate = new Date(this.task.CreateDate);
@@ -184,7 +184,7 @@ export class DespachoPrPage implements OnInit {
getFromDB() {
this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => {
console.log('OFFLINE', process)
this.task = {
"SerialNumber": process[0].serialNumber,
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
@@ -200,7 +200,7 @@ export class DespachoPrPage implements OnInit {
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
"activityInstanceName": process[0].activityInstanceName,
}
console.log("OFFLINE TASK", this.task)
let fulltak = {
Documents: JSON.parse(process[0].Documents),
actions: JSON.parse(process[0].actions),
@@ -218,7 +218,7 @@ export class DespachoPrPage implements OnInit {
workflowName: process[0].workflowName
}
this.fulltask = fulltak;
console.log(this.task);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
@@ -423,7 +423,7 @@ export class DespachoPrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(async (res) => {
console.log(res);
if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
@@ -479,9 +479,9 @@ export class DespachoPrPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then(res => {
console.log(res['data']);
if (res['data'] == 'openDiscart') {
console.log('open discart');
this.distartExpedientModal();
}
@@ -553,7 +553,7 @@ export class DespachoPrPage implements OnInit {
}
async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -569,7 +569,7 @@ export class DespachoPrPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/* console.log('2Expedient Discard closed2');
/*
this.close();
this.openMenu(); */
}
@@ -107,7 +107,7 @@ export class DespachosPrPage implements OnInit {
}
openExpedientDetailPage(data) {
console.log(data);
}
async LoadList() {
@@ -118,7 +118,7 @@ export class DespachosPrPage implements OnInit {
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.despachoList = [];
this.skeletonLoader = false;
console.log(result);
let despachosPr;
let despachos = this.sortService.sortArrayByDate(result);
@@ -131,7 +131,7 @@ export class DespachosPrPage implements OnInit {
break;
}
console.log(despachosPr);
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
despachosPr.forEach((element, index) => {
@@ -168,10 +168,10 @@ export class DespachosPrPage implements OnInit {
getFromDB() {
this.sqliteservice.getAllProcess().then((all) => {
console.log('DESPACHO PR ALL', all)
})
this.sqliteservice.getprocessByworkflow('Despacho do Presidente da República').then(async (process: any[]) => {
console.log('DESPACHO PR', process)
let despachosPr;
switch (this.loggeduser.Profile) {
@@ -179,7 +179,7 @@ export class DespachosPrPage implements OnInit {
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
break;
case 'PR':
console.log(process);
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
break;
@@ -206,7 +206,7 @@ export class DespachosPrPage implements OnInit {
}
this.despachoList.push(task);
console.log(this.despachoList);
});
this.listToPresent = this.despachoList;
@@ -222,7 +222,7 @@ export class DespachosPrPage implements OnInit {
}
async viewExpedientDetail(serialNumber: any) {
console.log(this.profile);
let classs;
if (window.innerWidth <= 800) {
@@ -242,7 +242,7 @@ export class DespachosPrPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log('refresh list');
this.LoadList();
});
}
@@ -130,7 +130,7 @@ export class DespachoPage implements OnInit {
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe((res: fullTask) => {
console.log('despacho detail', res)
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
@@ -157,14 +157,14 @@ export class DespachoPage implements OnInit {
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
this.updateProcessInterveners(users)
console.log('interveniers online', users)
this.intervenientes = users.filter(user => {
console.log('interveniers online 2', users)
return user.Type == 'I';
});
this.cc = users.filter(user => {
console.log('interveniers online 3', users)
return user.Type == 'CC';
});
});
@@ -212,7 +212,7 @@ export class DespachoPage implements OnInit {
origina = JSON.parse(process[0].originator)
}
console.log('sqlite', process)
this.task = {
"SerialNumber": process[0].serialNumber,
@@ -253,13 +253,13 @@ export class DespachoPage implements OnInit {
}
this.fulltask = fulltak;
console.log('interveniers offline', intervine)
this.intervenientes = intervine.filter(user => {
console.log('interveniers offline 2', user)
return user.Type == 'I';
});
this.cc = intervine.filter(user => {
console.log('interveniers offline 3', user)
return user.Type == 'CC';
});
@@ -271,7 +271,7 @@ export class DespachoPage implements OnInit {
async viewDocument(docId: string, Document) {
console.log(this.fulltask)
const modal = await this.modalController.create({
component: ViewDocumentPage,
@@ -474,7 +474,7 @@ export class DespachoPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'openDiscart') {
await this.distartExpedientModal();
@@ -531,7 +531,7 @@ export class DespachoPage implements OnInit {
}
async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -547,7 +547,7 @@ export class DespachoPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/* console.log('2Expedient Discard closed2');
/*
this.close();
this.openMenu(); */
}
@@ -68,7 +68,7 @@ export class DespachosPage implements OnInit {
await this.despachoRule.getList({ updateStore: true }).then((pre) => {
this.listToPresent = pre;
// console.log('despachooo', pre)
//
}).catch(() => {
this.getFromDb()
})
@@ -103,7 +103,7 @@ export class DespachosPage implements OnInit {
});
this.listToPresent = listtopresent;
console.log('Tarefas de despach', this.listToPresent)
})
}
@@ -93,9 +93,9 @@ export class DiplomaAssinarPage implements OnInit {
}
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
@@ -107,7 +107,7 @@ export class DiplomaAssinarPage implements OnInit {
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
console.log(users);
});
this.getDocumentDetails(this.task.FolderId, '361');
@@ -155,8 +155,8 @@ export class DiplomaAssinarPage implements OnInit {
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
@@ -53,7 +53,7 @@ export class DiplomaPage implements OnInit {
public ThemeService: ThemeService
) {
this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]);
//
if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber;
@@ -260,8 +260,8 @@ export class DiplomaPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
@@ -82,10 +82,10 @@ export class DiplomasPage implements OnInit, OnDestroy {
}
/* async loadDiplomas(){
console.log('Load');
this.activatedRoute.data.subscribe(data => {
console.log(data['diplomas']);
switch (this.segment) {
case 'validar':
@@ -157,12 +157,12 @@ export class DiplomasPage implements OnInit, OnDestroy {
async getTotalDocs(DocId: any) {
let res = await this.processes.GetDocumentDetails(DocId, '361').toPromise();
console.log(res.DocumentsTotal);
return res.DocumentsTotal;
}
ngOnDestroy(): void {
console.log('8. on destroy called');
}
segmentChanged(ev: any) {
@@ -224,7 +224,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
diplomasList.push(task);
});
console.log(diplomasList);
this.diplomasList = this.sortService.sortDate(diplomasList, 'taskStartDate');
let diplomasAssinados = process.filter(data => data.activityInstanceName == "Diploma Assinado");
@@ -235,7 +235,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
diplomasAssinadoList.push(task);
});
console.log('diplomasAssinados', diplomasAssinados)
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'taskStartDate')
})
@@ -74,10 +74,8 @@ export class ApproveEventModalPage implements OnInit {
getTask() {
this.processes.GetTask(this.serialNumber).subscribe(res => {
console.log('GET TASK SERIALNUMBER: ', this.serialNumber,'Approve event',res);
this.loadedEvent = res;
this.today = new Date(res.workflowInstanceDataFields.StartDate);
console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.InstanceId = res.workflowInstanceDataFields.InstanceId
@@ -89,7 +87,6 @@ export class ApproveEventModalPage implements OnInit {
viewDocument(docId:string, applicationId:string){
this.processes.GetDocumentUrl(docId, applicationId).subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
@@ -97,9 +94,7 @@ export class ApproveEventModalPage implements OnInit {
}
async approveTask(serialNumber:string) {
console.log('approveTask SERIALNUMBER: ', serialNumber)
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading()
@@ -121,8 +116,6 @@ export class ApproveEventModalPage implements OnInit {
}
emendTask(serialNumber:string){
console.log('emendTask: ',serialNumber)
/* console.log('Emendar'); */
this.menu.close();
this.openEmendMessageModal(serialNumber);
this.modalController.dismiss(null);
@@ -153,7 +146,7 @@ export class ApproveEventModalPage implements OnInit {
async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
console.log(this.loadedAttachments);
}
async openOptions(ev:any) {
@@ -191,7 +184,7 @@ export class ApproveEventModalPage implements OnInit {
}
}
//console.log(body);
//
const loader = this.toastService.loading()
try {
@@ -63,7 +63,7 @@ export class ApproveEventPage implements OnInit {
private storage: Storage
) {
this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]);
//
if (params["params"].serialNumber) {
this.serialNumber = params["params"].serialNumber;
@@ -80,8 +80,8 @@ export class ApproveEventPage implements OnInit {
}
ngOnInit() {
console.log(this.serialNumber);
console.log(this.caller);
this.getTask();
this.backgroundservice.registerBackService('Online', () => {
@@ -108,7 +108,7 @@ export class ApproveEventPage implements OnInit {
addProcessToDB(data) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('approve_event_detils', data).then(() => {
console.log('APPROVE EVENT DETAILS SAVED')
})
} else {
this.sqliteservice.updateProcess(data);
@@ -120,7 +120,7 @@ export class ApproveEventPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('approve_event_detils').then((event) => {
this.loadedEvent = event
console.log('offline event', this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -128,13 +128,13 @@ export class ApproveEventPage implements OnInit {
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.loadedAttachments = this.loadedEvent.Documents;
console.log('Attatara', this.loadedAttachments)
})
} else {
this.platform.ready().then(() => {
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
console.log('event aprove serial', process)
var doc;
var action = [];
@@ -182,7 +182,7 @@ export class ApproveEventPage implements OnInit {
}
this.loadedEvent = task
console.log('offline event', this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -190,13 +190,13 @@ export class ApproveEventPage implements OnInit {
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.loadedAttachments = this.loadedEvent.Documents;
console.log('Attatara', this.loadedAttachments)
})
})
}
console.log('Offlineee')
}
async getTask() {
@@ -204,7 +204,7 @@ export class ApproveEventPage implements OnInit {
this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise();
this.addProcessToDB(this.loadedEvent)
console.log(this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -217,7 +217,7 @@ export class ApproveEventPage implements OnInit {
async approveTask(serialNumber: string) {
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading()
@@ -246,7 +246,7 @@ export class ApproveEventPage implements OnInit {
}
async emendTask(serialNumber: string) {
console.log('Desktop');
const modal = await this.modalController.create({
component: EmendMessageModalPage,
@@ -260,7 +260,7 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss()
.then(async (res) => {
console.log(res.data);
if (res.data !== '') {
let body = {
@@ -270,14 +270,14 @@ export class ApproveEventPage implements OnInit {
"ReviewUserComment": res.data,
}
}
console.log(body);
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise()
.catch(() => {
console.log('Send event to approve for revition')
this.offlineManager.storeRequestData('event-listRever', body);
});
this.toastService._successMessage('Pedido enviado');
@@ -300,7 +300,7 @@ export class ApproveEventPage implements OnInit {
async rejeitar(serialNumber: string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise();
@@ -366,7 +366,7 @@ export class ApproveEventPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(async (res) => {
console.log(res.data);
if (res.data !== '') {
let body = {
@@ -376,7 +376,7 @@ export class ApproveEventPage implements OnInit {
"ReviewUserComment": res.data,
}
}
console.log(body);
const loader = this.toastService.loading()
@@ -102,13 +102,13 @@ export class EventListPage implements OnInit {
this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
//this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null)
console.log('MD event to aprove', this.eventsMDGPRList)
})
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => {
this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
console.log('PR event to aprove', this.eventsPRList)
})
})
@@ -116,7 +116,7 @@ export class EventListPage implements OnInit {
}
console.log('Offlineee')
}
transformaDataDB(events) {
@@ -154,16 +154,16 @@ export class EventListPage implements OnInit {
this.showLoader = true;
this.skeletonLoader = true
console.log(this.segment);
if (this.segment == 'MDGPR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
console.log('MD EVENT TO APROVE ONLINE',this.eventsMDGPRList)
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
console.log(' EVENTMD TO APROVE SAVED')
})
//this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
}
@@ -173,9 +173,9 @@ export class EventListPage implements OnInit {
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
console.log('PR EVENT TO APROVE ONLINE',this.eventsPRList)
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
console.log(' EVENTPR TO APROVE SAVED')
})
//this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
}
@@ -202,7 +202,7 @@ export class EventListPage implements OnInit {
}
goToEventToApproveDetail(serialNumber: string) {
console.log(serialNumber);
/* let navigationExtras: NavigationExtras = {
queryParams: {
@@ -272,7 +272,7 @@ export class BookMeetingModalPage implements OnInit {
}
console.log(this.EventRecurrenceType)
if(this.task.FsId == '8') {
const loader = this.toastService.loading()
@@ -114,7 +114,7 @@ export class ExpedientTaskModalPage implements OnInit {
this.loggeduser = userAuth.ValidatedUser;
this.task = this.navParams.get('task');
console.log('create dispatch with this data', this.task);
this.SearchFolder = this.navParams.get('SearchFolder');
this.aplicationId = this.navParams.get('aplicationId')
@@ -145,7 +145,7 @@ export class ExpedientTaskModalPage implements OnInit {
this.postData.DispatchFolder.Subject = this.task.workflowInstanceDataFields.Subject;
this.profile = this.navParams.get('profile');
console.log(this.postData);
}
async setAdding(type: "intervenient" | "CC") {
@@ -163,9 +163,9 @@ export class ExpedientTaskModalPage implements OnInit {
}
onSelectedTypesChanged(ev:any) {
console.log(ev);
if(ev.length > 1){
console.log(ev.filter(data => data != '99999850'));
this.selectedTypes = ev.filter(data => data != '99999850');
}
if(ev.length == 0){
@@ -180,7 +180,7 @@ export class ExpedientTaskModalPage implements OnInit {
getSubjectType() {
this.processes.GetSubjectType().subscribe(res=>{
console.log(res);
this.subjectTypes = res;
});
}
@@ -322,7 +322,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
console.log(this.postData);
try {
@@ -336,7 +336,7 @@ export class ExpedientTaskModalPage implements OnInit {
loader.remove()
}
console.log('this.taskResult', this.taskResult);
break;
case '1': // Parecer
@@ -380,7 +380,7 @@ export class ExpedientTaskModalPage implements OnInit {
DispatchFolder: this.dispatchFolder,
AttachmentList: docs
}
//console.log(this.postData);
//
let action_deferimento = {
"serialNumber": this.task.serialNumber,
"action": "Tratado",
@@ -401,7 +401,7 @@ export class ExpedientTaskModalPage implements OnInit {
loader.remove()
}
console.log('this.taskResult', this.taskResult);
break;
}
}
@@ -421,7 +421,7 @@ export class ExpedientTaskModalPage implements OnInit {
DispatchFolder: this.dispatchFolder,
AttachmentList: docs,
}
console.log(this.postData);
let action_despacho_pr = {
"serialNumber": this.task.serialNumber,
@@ -491,7 +491,7 @@ export class ExpedientTaskModalPage implements OnInit {
getAttachments() {
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
this.loadedAttachments = res;
console.log(res);
});
}
@@ -568,7 +568,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
async viewExpedientDetail() {
console.log(this.profile);
let classs;
if( window.innerWidth <= 800){
@@ -588,7 +588,6 @@ export class ExpedientTaskModalPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res)=>{
/* console.log('!refresh list'); */
});
}
@@ -92,8 +92,8 @@
<div class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons">
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div *ngIf="loggeduser.Profile == 'MDGPR'">Enviar para o PR</div> </div>
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks]) && loggeduser.Profile == 'MDGPR'" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Outras opções</div> </div>
@@ -32,6 +32,8 @@ import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { DataService } from 'src/app/services/data.service';
import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@Component({
selector: 'app-expediente-detail',
@@ -61,6 +63,8 @@ export class ExpedienteDetailPage implements OnInit {
onlinecheck: boolean;
loggeduser: LoginUserRespose;
constructor(
private processes: ProcessesService,
private iab: InAppBrowser,
@@ -81,8 +85,10 @@ export class ExpedienteDetailPage implements OnInit {
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private dataService: DataService,
private storage: Storage
private storage: Storage,
private userAuth: AuthService,
) {
this.loggeduser = userAuth.ValidatedUser
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber;
@@ -113,7 +119,7 @@ export class ExpedienteDetailPage implements OnInit {
updateProcessDB(res) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('expediente_details',res).then(() =>{
console.log('EXPEDIENTE DETAILS SAVED')
})
} else {
this.sqliteservice.updateProcess(res)
@@ -163,7 +169,7 @@ export class ExpedienteDetailPage implements OnInit {
this.platform.ready().then(() => {
this.onlinecheck = false;
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
console.log("expedient ditail", process)
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
var origina
@@ -227,7 +233,7 @@ export class ExpedienteDetailPage implements OnInit {
"AttachmentList": documents,
}
console.log(body);
const loader = this.toastService.loading()
@@ -287,7 +293,7 @@ export class ExpedienteDetailPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
console.log(res);
if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
return {
@@ -355,7 +361,7 @@ export class ExpedienteDetailPage implements OnInit {
sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
console.log(res);
this.toastService._successMessage('Processo enviado para pendentes')
this.goBack();
},
@@ -367,7 +373,7 @@ export class ExpedienteDetailPage implements OnInit {
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
console.log(res);
this.task = {
"SerialNumber": res.serialNumber,
@@ -403,8 +409,8 @@ export class ExpedienteDetailPage implements OnInit {
});
})
console.log('this.task', this.task.InstanceID)
console.log('this.task.DocumentURL', this.fulltask)
}, (error) => {
@@ -460,11 +466,11 @@ export class ExpedienteDetailPage implements OnInit {
// }
getAttachments(serialNumber) {
console.log(serialNumber);
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
this.attachments = res;
console.log('res', res);
});
}
@@ -567,7 +573,7 @@ export class ExpedienteDetailPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (body == 'descartar') {
if (res['data'] == 'Yes') {
@@ -605,7 +611,7 @@ export class ExpedienteDetailPage implements OnInit {
}
else if (res['data'] == 'No') {
console.log('Update');
const loader = this.toastService.loading()
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
@@ -622,7 +628,7 @@ export class ExpedienteDetailPage implements OnInit {
}
async openBookMeetingModal(task: any) {
console.log(task);
let classs;
if (window.innerWidth < 701) {
@@ -649,7 +655,7 @@ export class ExpedienteDetailPage implements OnInit {
}
async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: ViewEventPage,
@@ -82,7 +82,7 @@ export class ExpedientePage implements OnInit {
this.addProcessTODb(task);
});
this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate')
console.log('expediente list', this.listToPresent)
this.skeletonLoader = false;
}, (error) => {
@@ -108,14 +108,14 @@ export class ExpedientePage implements OnInit {
}
goToExpediente(serialNumber: any) {
//console.log('ABRE');
//
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
}
addProcessTODb(task) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('gabinete-expediente',task).then(() => {
console.log('GABINETE EXPEDIENTE SAVED')
})
} else {
this.sqliteservice.addProcess(task);
@@ -131,7 +131,7 @@ export class ExpedientePage implements OnInit {
} else {
this.taskslist = new Array();
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
console.log("All expedientes from local,", expediente)
expediente.forEach((element) => {
@@ -134,7 +134,7 @@ export class ExpedientePrPage implements OnInit {
sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.toastService._successMessage('Processo enviado para pendentes')
this.goBack();
},
@@ -239,11 +239,11 @@ export class ExpedientePrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
console.log(res);
const data = res.data;
this.documents.push(data.selected);
console.log('RES'+ this.documents);
/* let body = {
"InstanceID":null,
@@ -296,7 +296,7 @@ export class ExpedientePrPage implements OnInit {
"AttachmentList" :documents,
}
console.log(body);
const loader = this.toastService.loading()
@@ -355,7 +355,7 @@ export class ExpedientePrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
console.log(res);
if(res.data){
const DocumentToSave = res.data.documents.map((e:SearchList) => {
return {
@@ -431,7 +431,7 @@ export class ExpedientePrPage implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res)=>{
console.log(res['data']);
if(body == 'descartar') {
if(res['data']== 'Yes'){
@@ -479,7 +479,7 @@ export class ExpedientePrPage implements OnInit {
this.goBack();
}
else if(res['data'] == 'No') {
console.log('Update');
const loader = this.toastService.loading()
@@ -533,7 +533,7 @@ export class ExpedientePrPage implements OnInit {
}
async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: ViewEventPage,
@@ -70,7 +70,7 @@ export class ExpedientesPrPage implements OnInit {
this.skeletonLoader = true
this.processes.GetTaskListExpediente(false).subscribe(result => {
console.log(result);
this.skeletonLoader = false
this.showLoader =false
this.taskslist = new Array();
@@ -79,7 +79,7 @@ export class ExpedientesPrPage implements OnInit {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
});
console.log(this.taskslist);
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.expedienteGdStore.reset(this.taskslist);
@@ -117,7 +117,7 @@ export class ExpedientesPrPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
@@ -224,7 +224,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.platform.ready().then(() => {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('GabineteProcess', data).then(() => {
console.log('Gabinete process saved')
})
} else {
data.forEach(element => {
@@ -257,7 +257,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.hideRefreshButton();
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('GabineteProcess').then((allprocess: any[]) => {
console.log('ALL PROCESS WEB',allprocess )
allprocess.forEach(element => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
@@ -318,7 +318,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
});
console.log("All process from db ", allprocess)
})
}
@@ -352,7 +352,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
if (totalDays == 0) {
if (allday) {
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " (todo dia)";
console.log(customDate);
return customDate;
}
else {
@@ -415,7 +415,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.router.navigate(['/home/gabinete-digital/event-list/approve-event', serialNumber, 'gabinete-digital']);
}
else {
console.log('cant find page for this task')
}
}
@@ -670,7 +670,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
doRefresh(event) {
console.log(event);
this.LoadCounts();
@@ -680,7 +680,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}, 2000);
}
else {
console.log('null');
}
}
@@ -71,7 +71,7 @@ export class PedidoPage implements OnInit {
this.loggeduser = authService.ValidatedUser;
this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]);
//
if (params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
@@ -105,7 +105,7 @@ export class PedidoPage implements OnInit {
this.processes.GetTask(this.serialnumber).subscribe(res => {
this.fulltask = res
console.log('FULLTAK ONLINe', this.fulltask);
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
@@ -130,7 +130,7 @@ export class PedidoPage implements OnInit {
"activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
}
console.log(this.task);
this.updateProcess(res);
}
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
@@ -207,7 +207,7 @@ export class PedidoPage implements OnInit {
} else {
this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
console.log('PROCESS BY ID', process, this.serialnumber)
let fulltak = {
Documents: JSON.parse(process[0].Documents) || [],
@@ -227,7 +227,7 @@ export class PedidoPage implements OnInit {
}
this.fulltask = fulltak;
console.log('FULLTAK OFFLINE', this.fulltask);
if (process[0].workflowDisplayName == 'Pedido de Parecer' || process[0].workflowDisplayName == 'Pedido de Parecer do Presidente') {
let date = new Date(process[0].taskStartDate);
@@ -296,7 +296,7 @@ export class PedidoPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents;
console.log(res['Documents']);
})
}
@@ -453,7 +453,7 @@ export class PedidoPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then(res => {
console.log('Modal closed');
this.goBack();
});
}
@@ -522,7 +522,7 @@ export class PedidoPage implements OnInit {
// }
async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -538,7 +538,7 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/* console.log('2Expedient Discard closed2');
/*
this.close();
this.openMenu(); */
}
@@ -547,7 +547,7 @@ export class PedidoPage implements OnInit {
}
async openDelegarModal(task: any) {
console.log(task);
let classs;
if (window.innerWidth <= 800) {
@@ -596,7 +596,7 @@ export class PedidoPage implements OnInit {
}
async openDarParecer(task: any) {
console.log(task);
let classs;
if (window.innerWidth < 701) {
@@ -119,7 +119,7 @@ export class PedidosPage implements OnInit {
}
openExpedientDetailPage(data) {
console.log(data);
this.openExpedientDetail.emit(data);
}
@@ -136,7 +136,7 @@ export class PedidosPage implements OnInit {
let parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise();
let parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
console.log(parecerPr);
this.skeletonLoader = false
@@ -177,7 +177,7 @@ export class PedidosPage implements OnInit {
this.skeletonLoader = false
console.log(result);
this.deferimentoList = [];
@@ -257,7 +257,7 @@ export class PedidosPage implements OnInit {
}
})
this.listToPresentparecerList = this.sortService.sortArrayISODate(parecerlist);
console.log('parecer', process)
})
this.sqliteservice.getprocessByworkflow("Pedido de Deferimento").then((process: any[]) => {
@@ -284,7 +284,7 @@ export class PedidosPage implements OnInit {
}
})
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(deferimentolist);
console.log('deferimento', process)
})
}
@@ -107,7 +107,7 @@ export class PendentesPage implements OnInit {
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate');
this.listToPresent = pendentesList;
this.storage.set('pendente-list',pendentesList).then(() => {
console.log('Pendente list SAVED')
})
this.skeletonLoader = false;
@@ -130,7 +130,7 @@ export class PendentesPage implements OnInit {
this.platform.ready().then(() => {
this.sqliteservice.getAllProcess().then((process: any[]) => {
var pendingList = []
console.log('Pendentes off off',process )
process.forEach(element => {
var workflow = JSON.parse(element.workflowInstanceDataFields);
if (workflow.Status === "Pending") {
@@ -151,7 +151,7 @@ export class PendentesPage implements OnInit {
pendingList = this.sortService.sortDate(pendingList, 'CreateDate');
this.listToPresent = pendingList;
console.log('pendentes', pendingList)
})
})
@@ -195,7 +195,7 @@ export class PendentesPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
}
else {
console.log('cant find page for this task', WorkflowName, activityInstanceName)
}
}
+4 -4
View File
@@ -57,9 +57,9 @@ export class InactivityPage implements OnInit {
// let circleHeight = document.querySelector('.circle')['offsetHeight']
// let circleWidth = document.querySelector('.circle')['offsetWidth']
// console.log(window.innerHeight, ' < ', containerHeight)
//
// console.log(circleHeight)
//
// document.querySelectorAll('.circle').forEach(e=>{
// e['style']['height'] = (circleHeight -1 )+'px'
@@ -163,10 +163,10 @@ export class InactivityPage implements OnInit {
if(this.code.length == 4) {
if(!SessionStore.hasPin) {
// console.log('storePin')
//
this.storePin()
} else {
// console.log('pinLogin')
//
this.pinLogin()
}
}
+2 -2
View File
@@ -48,7 +48,7 @@ export class LoginPage implements OnInit {
ngOnInit() {
this.storageservice.get('theme').then((theme) =>{
console.log('LOGIN THEME',theme)
this.ThemeService.setTheme(theme)
})
}
@@ -133,7 +133,7 @@ export class LoginPage implements OnInit {
this.changeProfileService.run();
console.log(attempt.ChatData)
if(attempt.ChatData){
await this.authService.loginChat(attempt.ChatData.data);
await this.authService.loginToChatWs();
@@ -97,7 +97,7 @@ export class EditActionPage implements OnInit {
DateEnd: this.folder.DateEnd,
ActionType: this.folder.ActionType,
}
console.log(body);
const loader = this.toastService.loading()
try {
@@ -90,7 +90,7 @@ export class NewActionPage implements OnInit {
}
segmentChanged(ev: any) {
console.log(ev.detail.value);
}
get dateValid() {
@@ -98,7 +98,6 @@ export class NewPublicationPage implements OnInit {
ngOnInit() {
this.setTitle();
console.log(this.folderId);
Filesystem.mkdir({
path: IMAGE_DIR,
directory: Directory.Data,
@@ -221,7 +220,6 @@ export class NewPublicationPage implements OnInit {
if (this.publicationType == '3') {
console.log(this.navParams.get('publication'));
if (this.capturedImage != '') {
this.publication = {
@@ -239,7 +237,6 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading()
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação editada")
@@ -265,13 +262,10 @@ export class NewPublicationPage implements OnInit {
// FileBase64: this.publication.FileBase64,
// FileExtension: 'jpeg',
}
/* console.log('Edit - keep image');
console.log(this.publication); */
const loader = this.toastService.loading()
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado")
@@ -295,8 +289,8 @@ export class NewPublicationPage implements OnInit {
FileExtension: 'jpeg',
}
console.log('Edit change image');
console.log(this.publication);
const loader = this.toastService.loading()
try {
@@ -315,8 +309,8 @@ export class NewPublicationPage implements OnInit {
else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
console.log(date);
console.log(this.folderId);
this.publication = {
@@ -334,7 +328,7 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading()
try {
console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close();
this.toastService.successMessage("Publicação criado")
@@ -372,7 +366,7 @@ export class NewPublicationPage implements OnInit {
this.publicationTitle = 'Editar Publicação';
this.pub = this.navParams.get('publication');
console.log(this.pub, 'pub')
}
}
@@ -395,7 +389,7 @@ export class NewPublicationPage implements OnInit {
resultType: CameraResultType.DataUrl,
source: CameraSource.Camera
});
console.log(image);
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
} */
@@ -458,12 +452,12 @@ export class NewPublicationPage implements OnInit {
path: `${IMAGE_DIR}/${fileName}`,
directory: Directory.Data,
}).then(result => {
console.log('ALL RESULTS', result.files)
let lastphoto = result.files[result.files.length - 1]
this.loadFileData(lastphoto);
},
async (err) => {
console.log('ERROR FILE DOSENT EXIST', err)
// Folder does not yet exists!
await Filesystem.mkdir({
path: IMAGE_DIR,
@@ -477,7 +471,7 @@ export class NewPublicationPage implements OnInit {
}
async loadFileData(fileName: string) {
console.log('ALL PHOTOT FILE', fileName)
const loading = await this.loadingCtrl.create({
message: 'Loading data...',
@@ -497,7 +491,7 @@ export class NewPublicationPage implements OnInit {
data: `data:image/jpeg;base64,${readFile.data}`,
});
console.log('ALL IMAGE', this.images)
this.capturedImage = this.images[0].data
@@ -512,12 +506,12 @@ export class NewPublicationPage implements OnInit {
this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => {
this.imgResultBeforeCompress = image;
console.log('Size in bytes was:', this.imageCompress.byteCount(image));
this.imageCompress.compressFile(image, orientation, 50, 50).then(
result => {
this.imgResultAfterCompress = result;
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
}
);
})
@@ -527,11 +521,11 @@ export class NewPublicationPage implements OnInit {
//this.imgResultBeforeCompress = image;s
this.imageCompress.getOrientation(this.capturedImage).then((orientation) => {
console.log('Size in bytes was:', this.imageCompress.byteCount(this.capturedImage));
this.imageCompress.compressFile(this.capturedImage, orientation, 90, 90).then(
result => {
this.capturedImage = result;
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
}
);
@@ -48,7 +48,6 @@ export class PublicationDetailPage implements OnInit {
}
ngOnInit() {
/* console.log(this.publication.FileBase64); */
this.getPublicationDetail();
}
doRefresh(event) {
@@ -61,10 +60,8 @@ export class PublicationDetailPage implements OnInit {
getPublicationDetail() {
this.showLoader = true;
console.log(this.publicationId);
/* console.log(this.folderId); */
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
console.log(res);
/* this.publication = res; */
this.publication = {
DateIndex: res.DateIndex,
@@ -111,7 +108,7 @@ export class PublicationDetailPage implements OnInit {
async editPost(publicationType:any) {
console.log(this.publication);
const modal = await this.modalController.create({
component: NewPublicationPage,
componentProps:{
@@ -148,7 +148,7 @@ export class PublicationsPage implements OnInit {
this.getFromDB()
this.publications.GetPublicationFolderList().subscribe(async res => {
console.log('accoes', res)
let publicationsEventFolderList = new Array();
let publicationsTravelFolderList = new Array();
@@ -170,7 +170,7 @@ export class PublicationsPage implements OnInit {
publicationsEventFolderList.push(folder);
}
else {
console.log('Viagem', folder)
publicationsTravelFolderList.push(folder);
}
@@ -194,7 +194,7 @@ export class PublicationsPage implements OnInit {
}
addActionToStorage(events, viagens) {
console.log('actionsWEBDB', events, viagens)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('actionsEvents', events);
this.storage.set('actionsViagens', viagens);
@@ -215,7 +215,7 @@ export class PublicationsPage implements OnInit {
this.publicationsEventFolderList = new Array();
this.publicationsTravelFolderList = new Array();
this.storage.get('actionsEvents').then((events) => {
console.log('actionsEvents', events)
events.forEach(data => {
let folder: PublicationFolder = {
ProcessId: data.ProcessId,
@@ -231,7 +231,7 @@ export class PublicationsPage implements OnInit {
});
});
this.storage.get('actionsViagens').then((viagens) => {
console.log('actionsViagens', viagens)
viagens.forEach(data => {
let folder: PublicationFolder = {
ProcessId: data.ProcessId,
@@ -249,7 +249,7 @@ export class PublicationsPage implements OnInit {
} else {
this.sqliteservice.getAllActions().then((actions: any[]) => {
console.log('offline publi', actions)
this.publicationsEventFolderList = new Array();
this.publicationsTravelFolderList = new Array();
@@ -516,7 +516,7 @@ export class PublicationsPage implements OnInit {
// this.crop.crop('path/to/image.jpg', {quality: 75})
// .then(
// newImage => console.log('new image path is: ' + newImage),
// newImage =>
// error => console.error('Error cropping image', error)
// );
@@ -33,11 +33,11 @@ export class PublicationDetailPage implements OnInit {
) {
this.activatedRoute.paramMap.subscribe(params => {
console.log(params);
if(params["params"]) {
this.folderId = params["params"].folderId;
this.publicationId = params["params"].publicationId;
// console.log(params["params"]);
//
}
});
@@ -56,7 +56,6 @@ export class PublicationDetailPage implements OnInit {
}
ngOnInit() {
/* console.log(this.publication.FileBase64); */
this.getPublicationDetail();
}
doRefresh(event) {
@@ -69,10 +68,9 @@ export class PublicationDetailPage implements OnInit {
getPublicationDetail(){
this.showLoader = true;
console.log(this.publicationId);
/* console.log(this.folderId); */
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
console.log(res);
/* this.publication = res; */
this.publication = {
DateIndex: res.DateIndex,
@@ -126,7 +124,7 @@ export class PublicationDetailPage implements OnInit {
}
async editPost(publicationType:any) {
console.log(this.publication);
const modal = await this.modalController.create({
component: NewPublicationPage,
componentProps:{
@@ -48,11 +48,11 @@ export class ViewPublicationsPage implements OnInit {
this.item = new PublicationFolder();
this.activatedRoute.paramMap.subscribe(params => {
console.log(params);
if (params["params"]) {
this.folderId = params["params"].folderId;
// console.log(params["params"]);
//
}
window['app-view-publications-page-doRefresh'] = this.doRefresh
@@ -114,7 +114,7 @@ export class ViewPublicationsPage implements OnInit {
getPublicationDetail() {
this.publications.GetPresidentialAction(this.folderId).subscribe(res => {
console.log(res);
this.item = res;
this.sqliteservice.updatePublicationsDetails(this.folderId, JSON.stringify(res));
});
@@ -128,7 +128,7 @@ export class ViewPublicationsPage implements OnInit {
// this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
// console.log(this.id)
//
// this.publicationList = new Array();
@@ -138,31 +138,31 @@ export class ViewPublicationsPage implements OnInit {
const folderId = this.folderId
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
console.log('publications ids', res)
this.publicationList = new Array();
/* for(let i = 0; i < res.length; i++) {
this.publications.GetPublicationById(res[i]).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item);
})
} */
res.forEach(element => {
console.log('publications elements', element)
this.publications.GetPublicationById(element).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item);
})
});
console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.getpublication = this.publicationList;
this.showLoader = false;
@@ -170,7 +170,7 @@ export class ViewPublicationsPage implements OnInit {
/* this.publicationList = new Array();
res.forEach(element => {
console.log('getPublications', element)
let item: Publication = this.publicationPipe.itemList(element)
this.publicationList.push(item);
});
@@ -190,15 +190,15 @@ export class ViewPublicationsPage implements OnInit {
this.getFromDB();
this.publications.GetPublications(this.folderId).subscribe(res => {
console.log(this.folderId)
this.publicationList = new Array();
res.forEach(element => {
console.log('getPublications', element)
let item: Publication = this.publicationPipe.itemList(element)
this.publicationList.push(item);
console.log('getPublications 222', item)
});
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
@@ -233,7 +233,7 @@ export class ViewPublicationsPage implements OnInit {
getFromDB() {
this.sqliteservice.getActionById(this.folderId).then((publications) => {
console.log('publications', publications)
/* let item = {
ActionType: publications[0].ActionType,
DateBegin: publications[0].DateBegin,
@@ -32,7 +32,6 @@ export class OrganicEntityPage implements OnInit {
getOrganicEntity(){
this.OrganicEntityService.getOrganicEntity().subscribe(res=>{
console.log(res)
this.organicEntities = res;
this.showOrganicEntities = res
});
+4 -4
View File
@@ -82,7 +82,7 @@ export class SearchPage implements OnInit {
} else if (this.currentPath == '/home/publications') {
this.type = "AccoesPresidenciais"
} else {
console.log('search bug!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
}
}
}
@@ -148,7 +148,7 @@ export class SearchPage implements OnInit {
this.list = list
console.log(this.list)
const elem = document.documentElement.querySelector('.most-searched-word-container');
@@ -219,7 +219,7 @@ export class SearchPage implements OnInit {
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => {
e['Active'] = false;
@@ -478,7 +478,7 @@ export class SearchPage implements OnInit {
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => {
e['Active'] = false;
@@ -49,7 +49,6 @@ export class SenderPage implements OnInit {
}
selectUser(username:string){
console.log(username);
this.selectedUser = username;
this.close(this.selectedUser);
}