toLowerCase cant read propety solved on edit event

This commit is contained in:
Eudes Inácio
2022-12-21 12:26:43 +01:00
9 changed files with 63 additions and 101 deletions
+1
View File
@@ -97,6 +97,7 @@ export class HomePage implements OnInit {
this.router.events.subscribe((val) => { this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove()) document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove()) document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
document.querySelectorAll('.notification').forEach((e: any) => e.remove())
}); });
window['platform'] = platform window['platform'] = platform
@@ -16,6 +16,7 @@ export class AgendaPermission{
} }
} }
get access () { get access () {
return 530
if(this.hasOwnCalendar || this.hasSharedCalendar) { if(this.hasOwnCalendar || this.hasSharedCalendar) {
return 530 return 530
@@ -104,9 +104,11 @@ export class NewEventPage implements OnInit {
this.taskParticipants = this.navParams.get('attendees'); this.taskParticipants = this.navParams.get('attendees');
if(this.eventService.calendarNamesAry['Meu calendario']) { if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario' this.CalendarName = 'Meu calendario'
} else {} } else {
this.CalendarName = this.eventService.calendarNamesAry[0]
}
} }
@@ -178,15 +180,10 @@ export class NewEventPage implements OnInit {
roundTimeQuarterHour() { roundTimeQuarterHour() {
var timeToReturn = new Date(); var timeToReturn = new Date();
// var minutes = timeToReturn.getMinutes();
var minutes = timeToReturn.getMinutes(); var minutes = timeToReturn.getMinutes();
var hours = timeToReturn.getHours(); var hours = timeToReturn.getHours();
// console.log("MINUTOS: " +minutes);
// console.log("BEFORE MINUTES: " +(Math.round(minutes/15) * 15));
var m = (Math.round(minutes/15) * 15) % 60; var m = (Math.round(minutes/15) * 15) % 60;
// console.log("AFTER MINUTES: " +m);
var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours; var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours;
if (m == 0) { if (m == 0) {
+35 -34
View File
@@ -80,54 +80,54 @@ export class EventsPage implements OnInit {
private changeProfileService: ChangeProfileService, private changeProfileService: ChangeProfileService,
) { ) {
// this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
// this.platform.resize.subscribe(async () => { this.platform.resize.subscribe(async () => {
// // //
// // //
// }); });
// window['zipPhoneCallback'] = function (zipphone) { window['zipPhoneCallback'] = function (zipphone) {
// var frame = document.getElementById('home-iframe'); var frame = document.getElementById('home-iframe');
// if(frame) { if(frame) {
// frame['contentWindow']['postMessage']({call:'cookies', value: { cookies: {} }}); frame['contentWindow']['postMessage']({call:'cookies', value: { cookies: {} }});
// } }
// } }
// this.changeProfileService.registerCallback(() => { this.changeProfileService.registerCallback(() => {
// this.listToPresent = []; this.listToPresent = [];
// this.listToPresentexpediente = [] this.listToPresentexpediente = []
// }) })
} }
ngOnInit() { ngOnInit() {
// this.segment = "Combinada"; this.segment = "Combinada";
// this.profile = "mdgpr"; this.profile = "mdgpr";
// this.showGreeting(); this.showGreeting();
// this.router.events.forEach((event) => { this.router.events.forEach((event) => {
// if (event instanceof NavigationEnd && event.url == '/home/events') { if (event instanceof NavigationEnd && event.url == '/home/events') {
// this.RefreshEvents(); this.RefreshEvents();
// setTimeout(() => { setTimeout(() => {
// this.LoadList(); this.LoadList();
// }, 1500) }, 1500)
// } }
// }); });
// this.hideSearch(); this.hideSearch();
// this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
// this.showGreeting(); this.showGreeting();
// this.RefreshEvents(); this.RefreshEvents();
// this.LoadList(); this.LoadList();
// this.hideSearch(); this.hideSearch();
// }); });
} }
@@ -149,6 +149,7 @@ export class EventsPage implements OnInit {
async RefreshEvents() { async RefreshEvents() {
this.currentEvent = ""; this.currentEvent = "";
this.showLoader = true; this.showLoader = true;
@@ -157,7 +158,7 @@ export class EventsPage implements OnInit {
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59"; let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
if(SessionStore.user) { if(SessionStore.user) {
console.log('im here')
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => { let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
console.error(error) console.error(error)
}) })
+3 -3
View File
@@ -117,9 +117,9 @@ export class InactivityPage implements OnInit {
} }
getToken() { getToken() {
// this.notificatinsservice.requestPermissions(); this.notificatinsservice.requestPermissions();
// this.notificatinsservice.registrationError(); this.notificatinsservice.registrationError();
// this.notificatinsservice.getAndpostToken(this.username); this.notificatinsservice.getAndpostToken(this.username);
} }
setCode(code: string) { setCode(code: string) {
+5 -6
View File
@@ -98,9 +98,9 @@ export class LoginPage implements OnInit {
} }
getToken() { getToken() {
// this.notificatinsservice.requestPermissions(); this.notificatinsservice.requestPermissions();
// this.notificatinsservice.registrationError(); this.notificatinsservice.registrationError();
// this.notificatinsservice.getAndpostToken(this.username); this.notificatinsservice.getAndpostToken(this.username);
} }
async Login() { async Login() {
@@ -149,11 +149,10 @@ export class LoginPage implements OnInit {
this.ChatSystemService.clearChat(); this.ChatSystemService.clearChat();
SessionStore.delete(); SessionStore.delete();
window.localStorage.clear(); window.localStorage.clear();
await MessageModel.deleteAll() await MessageModel.deleteAll();
await DeleteMessageModel.deleteAll() await DeleteMessageModel.deleteAll();
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
this.changeProfileService.run(); this.changeProfileService.run();
-4
View File
@@ -48,9 +48,6 @@ export class AuthService {
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
if (SessionStore.exist) { if (SessionStore.exist) {
SessionStore.setInativity(true)
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) { if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
this.loginToChatWs() this.loginToChatWs()
} }
@@ -127,7 +124,6 @@ export class AuthService {
this.ChatSystemService.getAllRooms(); this.ChatSystemService.getAllRooms();
}, 200); }, 200);
// alert('wsLogin')
}).catch((error) => { }).catch((error) => {
console.error(error) console.error(error)
-41
View File
@@ -17,48 +17,7 @@ export class FcmService {
constructor(private router: Router) { } constructor(private router: Router) { }
/* initPush() {
if (Capacitor.platform !== 'web') {
this.registerPush();
}
}
private registerPush() {
PushNotifications.requestPermission().then((permission) => {
if (permission.granted) {
// Register with Apple / Google to receive push via APNS/FCM
PushNotifications.register();
} else {
// No permission for push granted
}
});
PushNotifications.addListener(
'registration',
(token: PushNotificationToken) => {
}
);
PushNotifications.addListener('registrationError', (error: any) => {
});
PushNotifications.addListener(
'pushNotificationReceived',
async (notification: PushNotification) => {
}
);
PushNotifications.addListener(
'pushNotificationActionPerformed',
async (notification: PushNotificationActionPerformed) => {
const data = notification.notification.data;
if (data.detailsId) {
this.router.navigateByUrl(`/home/notifications/notification-detail${data.detaisId}`);
}
}
);
} */
} }
@@ -119,7 +119,7 @@ export class AttendeePage implements OnInit {
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{ const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
if(contact.Name.toLowerCase() == itm.Name.toLowerCase() && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){ if(this.checkStringNull(contact.Name) == this.checkStringNull(itm.Name) && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
index = index; index = index;
return contact; return contact;
} }
@@ -133,7 +133,7 @@ export class AttendeePage implements OnInit {
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{ const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
if(contact.Name.toLowerCase() == itm.Name && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){ if(this.checkStringNull(contact.Name) == itm.Name && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
index = index; index = index;
return contact; return contact;
} }
@@ -199,7 +199,7 @@ export class AttendeePage implements OnInit {
{ {
this.eventPersons.forEach(attendee => { this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => { const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLowerCase() == attendee.EmailAddress.toLowerCase() return this.checkStringNull(cont.EmailAddress) == this.checkStringNull(attendee.EmailAddress)
}); });
result.splice(index, 1); result.splice(index, 1);
@@ -212,4 +212,12 @@ export class AttendeePage implements OnInit {
); );
} }
checkStringNull(value: string) {
if(value) {
return value.toLowerCase();
} else {
return value
}
}
} }