diff --git a/src/app/modals/profile/profile.page.scss b/src/app/modals/profile/profile.page.scss index 29909cc5f..4a31f6f60 100644 --- a/src/app/modals/profile/profile.page.scss +++ b/src/app/modals/profile/profile.page.scss @@ -90,7 +90,7 @@ } .icon { - font-size: rem(40); + font-size: rem(35); } .profile-name { diff --git a/src/app/services/native-notification.service.ts b/src/app/services/native-notification.service.ts index b9128cef8..9bc3686b3 100644 --- a/src/app/services/native-notification.service.ts +++ b/src/app/services/native-notification.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Platform } from '@ionic/angular'; -import { LocalNotifications } from '@capacitor/local-notifications'; +//import { LocalNotifications } from '@capacitor/local-notifications'; import { v4 as uuidv4 } from 'uuid' @Injectable({ @@ -63,8 +63,8 @@ export class NativeNotificationService { } async cancelNotification(eventId: number) { - await LocalNotifications.cancel({ notifications: [{ id: eventId }] }); - console.log(`Notification with event ID ${eventId} canceled.`); + //await LocalNotifications.cancel({ notifications: [{ id: eventId }] }); + //console.log(`Notification with event ID ${eventId} canceled.`); } didEventHappenToday(eventTime) { @@ -75,14 +75,14 @@ export class NativeNotificationService { async cancelAllNotification() { - try { - await LocalNotifications.cancel({ - notifications: [] - }); - console.log('All notifications cancelled'); - } catch (error) { - console.error('Error cancelling notifications:', error); - } + // try { + // await LocalNotifications.cancel({ + // notifications: [] + // }); + // console.log('All notifications cancelled'); + // } catch (error) { + // console.error('Error cancelling notifications:', error); + // } } async scheduleNotifications(events: any) { @@ -100,85 +100,85 @@ export class NativeNotificationService { await this.cancelAllNotification(); - for (const event of events) { + // for (const event of events) { - const eventTime = new Date(event.start).getTime(); - const now = new Date().getTime(); + // const eventTime = new Date(event.start).getTime(); + // const now = new Date().getTime(); - // Schedule notifications for 1 hour before and 15 minutes before the event - const oneHourBefore = eventTime - 60 * 60 * 1000; - const fifteenMinutesBefore = eventTime - 15 * 60 * 1000; + // // Schedule notifications for 1 hour before and 15 minutes before the event + // const oneHourBefore = eventTime - 60 * 60 * 1000; + // const fifteenMinutesBefore = eventTime - 15 * 60 * 1000; - const timeDifference = eventTime - now; - const oneHour = 60 * 60 * 1000; // 1 hour in milliseconds - const fifteenMinutes = 15 * 60 * 1000; // 15 minutes in milliseconds + // const timeDifference = eventTime - now; + // const oneHour = 60 * 60 * 1000; // 1 hour in milliseconds + // const fifteenMinutes = 15 * 60 * 1000; // 15 minutes in milliseconds - console.log('notification to notify object', event) - // if (timeDifference <= fifteenMinutes) { + // console.log('notification to notify object', event) + // // if (timeDifference <= fifteenMinutes) { - // console.log({notification: event, e: '15 minutes'}) - // notifications.push({ - // title: 'Event Reminder', - // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} minutes.£`, - // id: this.uuidTo32BitInt(event.event.id) - // }); - // } else if (timeDifference <= oneHour) { + // // console.log({notification: event, e: '15 minutes'}) + // // notifications.push({ + // // title: 'Event Reminder', + // // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} minutes.£`, + // // id: this.uuidTo32BitInt(event.event.id) + // // }); + // // } else if (timeDifference <= oneHour) { - // console.log({notification: event, e: '1 hour.'}) - // notifications.push({ - // title: 'Event Reminder', - // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} hour.£`, - // id: this.uuidTo32BitInt(event.id) - // }); - // } else { - // console.log("Event is more than 1 hour away.") + // // console.log({notification: event, e: '1 hour.'}) + // // notifications.push({ + // // title: 'Event Reminder', + // // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} hour.£`, + // // id: this.uuidTo32BitInt(event.id) + // // }); + // // } else { + // // console.log("Event is more than 1 hour away.") - if (timeDifference >= fifteenMinutes) { - notifications.push({ - title: 'Event Reminder', - body: `Reminder: ${event.event.Subject} 15 minutes`, - id: this.uuidTo32BitInt(event.id)+1, - schedule: { at: new Date(fifteenMinutesBefore) }, - }); - console.log('15m', new Date(fifteenMinutesBefore)) + // if (timeDifference >= fifteenMinutes) { + // notifications.push({ + // title: 'Event Reminder', + // body: `Reminder: ${event.event.Subject} 15 minutes`, + // id: this.uuidTo32BitInt(event.id)+1, + // schedule: { at: new Date(fifteenMinutesBefore) }, + // }); + // console.log('15m', new Date(fifteenMinutesBefore)) - } + // } - if (timeDifference >= oneHour) { - notifications.push({ - title: 'Event Reminder', - body: `Reminder: ${event.event.Subject} 1 hour`, - id: this.uuidTo32BitInt(event.id)+2, - schedule: { at: new Date(oneHourBefore) }, - }); - console.log('1h', new Date(oneHourBefore)) - } + // if (timeDifference >= oneHour) { + // notifications.push({ + // title: 'Event Reminder', + // body: `Reminder: ${event.event.Subject} 1 hour`, + // id: this.uuidTo32BitInt(event.id)+2, + // schedule: { at: new Date(oneHourBefore) }, + // }); + // console.log('1h', new Date(oneHourBefore)) + // } - // } + // // } - } + // } - await LocalNotifications.schedule({ notifications }); + // await LocalNotifications.schedule({ notifications }); } async eventNotification({eventId}) { - await LocalNotifications.schedule({ - notifications: [ - { - title: 'Test Notification 6', - body: 'This is a test notification. 6', - id: this.uuidTo32BitInt(eventId), // Unique ID for the notification - schedule: { at: new Date(Date.now() + 1000 * 10) }, // Schedule to show in 5 seconds - sound: null, - attachments: null, - actionTypeId: '', - extra: null, - }, - ], - }); + // await LocalNotifications.schedule({ + // notifications: [ + // { + // title: 'Test Notification 6', + // body: 'This is a test notification. 6', + // id: this.uuidTo32BitInt(eventId), // Unique ID for the notification + // schedule: { at: new Date(Date.now() + 1000 * 10) }, // Schedule to show in 5 seconds + // sound: null, + // attachments: null, + // actionTypeId: '', + // extra: null, + // }, + // ], + // }); - console.log('send notificatino') + // console.log('send notificatino') } isDesktop() { diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index fcd24a905..37e4b2c2e 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -149,9 +149,7 @@ export class NewEventPage implements OnInit { private dateAdapter: DateAdapter, public ThemeService: ThemeService, private hhtpErrorHandle: HttpErrorHandle, - private processeService: ProcessesService, public TaskService: TaskService, - private contactsService: ContactsService, private changeProfileService: ChangeProfileService, private agendaDataRepository: AgendaDataRepositoryService, public RoleIdService: RoleIdService, @@ -694,7 +692,12 @@ export class NewEventPage implements OnInit { this.contacts = result; console.log('Attendes Email', this.loggeduser.Email) let filterLoggedUserEmail = this.contacts.filter(item => item.RoleId == this.RoleIdService.MD) - console.log('Attendes Email', filterLoggedUserEmail) + console.log('Attendes Email', filterLoggedUserEmail); + + + if(filterLoggedUserEmail.length >= 1) { + filterLoggedUserEmail[0].IsRequired = true + } this.contacts = filterLoggedUserEmail; diff --git a/version/git-version.ts b/version/git-version.ts index 6d7f8ad94..e7ad7ab51 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,11 +1,11 @@ export let versionData = { - "shortSHA": "a26fbbddb", - "SHA": "a26fbbddba771aceca353daa669903c90269e309", + "shortSHA": "4f51cb555", + "SHA": "4f51cb55504b0aa56b477a6b5a857d4979878938", "branch": "feature/agenda-api-peter", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Tue Jul 9 12:36:46 2024 +0100'", - "lastCommitMessage": "add either pattern", - "lastCommitNumber": "5860", - "changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/services/agenda/list-box.service.ts\n\tmodified: version/git-version.ts", + "lastCommitTime": "'Tue Jul 9 13:36:35 2024 +0100'", + "lastCommitMessage": "change long date to short date", + "lastCommitNumber": "5861", + "changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.scss\n\tmodified: src/app/services/native-notification.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file