fix button size

This commit is contained in:
Peter Maquiran
2024-07-11 12:47:36 +01:00
parent 4f51cb5550
commit 5cf4054047
4 changed files with 86 additions and 83 deletions
+1 -1
View File
@@ -90,7 +90,7 @@
} }
.icon { .icon {
font-size: rem(40); font-size: rem(35);
} }
.profile-name { .profile-name {
+74 -74
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Platform } from '@ionic/angular'; import { Platform } from '@ionic/angular';
import { LocalNotifications } from '@capacitor/local-notifications'; //import { LocalNotifications } from '@capacitor/local-notifications';
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
@Injectable({ @Injectable({
@@ -63,8 +63,8 @@ export class NativeNotificationService {
} }
async cancelNotification(eventId: number) { async cancelNotification(eventId: number) {
await LocalNotifications.cancel({ notifications: [{ id: eventId }] }); //await LocalNotifications.cancel({ notifications: [{ id: eventId }] });
console.log(`Notification with event ID ${eventId} canceled.`); //console.log(`Notification with event ID ${eventId} canceled.`);
} }
didEventHappenToday(eventTime) { didEventHappenToday(eventTime) {
@@ -75,14 +75,14 @@ export class NativeNotificationService {
async cancelAllNotification() { async cancelAllNotification() {
try { // try {
await LocalNotifications.cancel({ // await LocalNotifications.cancel({
notifications: [] // notifications: []
}); // });
console.log('All notifications cancelled'); // console.log('All notifications cancelled');
} catch (error) { // } catch (error) {
console.error('Error cancelling notifications:', error); // console.error('Error cancelling notifications:', error);
} // }
} }
async scheduleNotifications(events: any) { async scheduleNotifications(events: any) {
@@ -100,85 +100,85 @@ export class NativeNotificationService {
await this.cancelAllNotification(); await this.cancelAllNotification();
for (const event of events) { // for (const event of events) {
const eventTime = new Date(event.start).getTime(); // const eventTime = new Date(event.start).getTime();
const now = new Date().getTime(); // const now = new Date().getTime();
// Schedule notifications for 1 hour before and 15 minutes before the event // // Schedule notifications for 1 hour before and 15 minutes before the event
const oneHourBefore = eventTime - 60 * 60 * 1000; // const oneHourBefore = eventTime - 60 * 60 * 1000;
const fifteenMinutesBefore = eventTime - 15 * 60 * 1000; // const fifteenMinutesBefore = eventTime - 15 * 60 * 1000;
const timeDifference = eventTime - now; // const timeDifference = eventTime - now;
const oneHour = 60 * 60 * 1000; // 1 hour in milliseconds // const oneHour = 60 * 60 * 1000; // 1 hour in milliseconds
const fifteenMinutes = 15 * 60 * 1000; // 15 minutes in milliseconds // const fifteenMinutes = 15 * 60 * 1000; // 15 minutes in milliseconds
console.log('notification to notify object', event) // console.log('notification to notify object', event)
// if (timeDifference <= fifteenMinutes) { // // if (timeDifference <= fifteenMinutes) {
// console.log({notification: event, e: '15 minutes'}) // // 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.")
// if (timeDifference >= fifteenMinutes) {
// notifications.push({ // notifications.push({
// title: 'Event Reminder', // title: 'Event Reminder',
// body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} minutes`, // body: `Reminder: ${event.event.Subject} 15 minutes`,
// id: this.uuidTo32BitInt(event.event.id) // id: this.uuidTo32BitInt(event.id)+1,
// schedule: { at: new Date(fifteenMinutesBefore) },
// }); // });
// } else if (timeDifference <= oneHour) { // console.log('15m', new Date(fifteenMinutesBefore))
// 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 >= 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}) { async eventNotification({eventId}) {
await LocalNotifications.schedule({ // await LocalNotifications.schedule({
notifications: [ // notifications: [
{ // {
title: 'Test Notification 6', // title: 'Test Notification 6',
body: 'This is a test notification. 6', // body: 'This is a test notification. 6',
id: this.uuidTo32BitInt(eventId), // Unique ID for the notification // id: this.uuidTo32BitInt(eventId), // Unique ID for the notification
schedule: { at: new Date(Date.now() + 1000 * 10) }, // Schedule to show in 5 seconds // schedule: { at: new Date(Date.now() + 1000 * 10) }, // Schedule to show in 5 seconds
sound: null, // sound: null,
attachments: null, // attachments: null,
actionTypeId: '', // actionTypeId: '',
extra: null, // extra: null,
}, // },
], // ],
}); // });
console.log('send notificatino') // console.log('send notificatino')
} }
isDesktop() { isDesktop() {
@@ -149,9 +149,7 @@ export class NewEventPage implements OnInit {
private dateAdapter: DateAdapter<any>, private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private hhtpErrorHandle: HttpErrorHandle, private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService,
public TaskService: TaskService, public TaskService: TaskService,
private contactsService: ContactsService,
private changeProfileService: ChangeProfileService, private changeProfileService: ChangeProfileService,
private agendaDataRepository: AgendaDataRepositoryService, private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService, public RoleIdService: RoleIdService,
@@ -694,7 +692,12 @@ export class NewEventPage implements OnInit {
this.contacts = result; this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email) console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleId == this.RoleIdService.MD) 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; this.contacts = filterLoggedUserEmail;
+6 -6
View File
@@ -1,11 +1,11 @@
export let versionData = { export let versionData = {
"shortSHA": "a26fbbddb", "shortSHA": "4f51cb555",
"SHA": "a26fbbddba771aceca353daa669903c90269e309", "SHA": "4f51cb55504b0aa56b477a6b5a857d4979878938",
"branch": "feature/agenda-api-peter", "branch": "feature/agenda-api-peter",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Tue Jul 9 12:36:46 2024 +0100'", "lastCommitTime": "'Tue Jul 9 13:36:35 2024 +0100'",
"lastCommitMessage": "add either pattern", "lastCommitMessage": "change long date to short date",
"lastCommitNumber": "5860", "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 <file>...\" to unstage)\n\tmodified: src/app/services/agenda/list-box.service.ts\n\tmodified: version/git-version.ts", "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 <file>...\" 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" "changeAuthor": "peter.maquiran"
} }