mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix button size
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: rem(40);
|
||||
font-size: rem(35);
|
||||
}
|
||||
|
||||
.profile-name {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -149,9 +149,7 @@ export class NewEventPage implements OnInit {
|
||||
private dateAdapter: DateAdapter<any>,
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user