This commit is contained in:
Peter Maquiran
2023-08-15 12:03:37 +01:00
parent 30aba9b182
commit 20c53993bf
8 changed files with 78 additions and 30 deletions
+4
View File
@@ -235,6 +235,10 @@ export class AgendaPage implements OnInit {
this.tigerUpdate()
window['reloadCalendar'] = () => {
this.reloadCalendar()
}
}
@@ -353,6 +353,10 @@ export class EditEventPage implements OnInit {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
if(window['reloadCalendar']) {
window['reloadCalendar']()
}
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
@@ -375,6 +379,10 @@ export class EditEventPage implements OnInit {
} else {
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
if(window['reloadCalendar']) {
window['reloadCalendar']()
}
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
@@ -147,18 +147,37 @@ export class GroupContactsPage implements OnInit {
this.modalController.dismiss();
}
onChange(event){
onChange(event) {
this.textSearch = event.detail.value;
this.users = this.contacts.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase())).sort((a,b) => {
if(a.name < b.name){
const users = this.contacts.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase())).sort((a,b) => {
if(a.name < b.name) {
return -1;
}
if(a.name > b.name){
if(a.name > b.name) {
return 1;
}
return 0;
});
const selectedUsers = this.users.filter( e => e?.isChecked == true)
users.forEach( (user, index) => {
if(user[index]) {
console.log({user, index})
const isCheck = selectedUsers.find( e => e._id == user._id)?.isChecked
if(isCheck) {
user[index].isChecked = isCheck
}
// if(user[index].isChecked) {
// console.log('user[index].isChecked', user[index].isChecked)
// }
}
})
this.users = users
}
@@ -99,10 +99,7 @@
</button>
</ion-buttons>
<ion-buttons slot="end">
<button *ngIf="publicationType == '2' || publicationType == '1'" class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Criar</ion-label>
</button>
<button *ngIf="publicationType == '3'" class="btn-ok" fill="clear" color="#fff" (click)="save()">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>