bugs solved

This commit is contained in:
Eudes Inácio
2023-08-11 16:14:25 +01:00
parent 2bfec82113
commit 408f68b22e
20 changed files with 263 additions and 129 deletions
@@ -30,6 +30,7 @@ import {
MAT_MOMENT_DATE_ADAPTER_OPTIONS
} from '@angular/material-moment-adapter';
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
@NgModule({
@@ -55,7 +56,8 @@ import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/
//MatRadioModule,
//MatCheckboxModule,
MatButtonModule,
ReactiveFormsModule
ReactiveFormsModule,
AttendeeModalPageModule
],
declarations: [NewEventPage],
providers: [
@@ -327,9 +327,18 @@
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="mostrarModal">
<app-attendee-modal [loggedAttendSon]="loggedAttendDad"></app-attendee-modal>
</div>
</ion-content>
<ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar">
@@ -344,5 +353,10 @@
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
<!-- <app-new-event
[loggedAttend]="loggedAttend"
></app-new-event> -->
</ion-toolbar>
</ion-footer>
@@ -70,6 +70,8 @@ export class NewEventPage implements OnInit {
public color: ThemePalette = 'primary';
recurringTypes = []
selectedRecurringType: any;
loggedAttendDad: boolean = true;
mostrarModal = false;
@Input() attendees: []
@Input() profile:string;
@@ -701,6 +703,7 @@ export class NewEventPage implements OnInit {
}
async addParticipants() {
this.saveTemporaryData();
@@ -709,6 +712,7 @@ export class NewEventPage implements OnInit {
});
this.clearContact.emit();
this.mostrarModal = true;
}
async addParticipantsCc() {
@@ -6,6 +6,8 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { ThemeService } from 'src/app/services/theme.service'
import { ViewChild } from '@angular/core';
import { Searchbar } from 'ionic-angular';
import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-attendee-modal',
@@ -16,6 +18,7 @@ export class AttendeePage implements OnInit {
// Defined by the API
contacts: EventPerson[];
filterEmptyEmail: EventPerson[];
showLoader: boolean = false;
eventPersons: EventPerson[];
inputFilter = ''
@@ -30,6 +33,7 @@ export class AttendeePage implements OnInit {
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
@Input() loggedAttendSon: boolean;
@Input() footer: boolean;
@@ -37,26 +41,34 @@ export class AttendeePage implements OnInit {
LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = [];
loggeduser: LoginUserRespose;
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService,
public ThemeService: ThemeService ) {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.loggeduser = SessionStore.user;
}
ngOnChanges() {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
console.log('PARTE PARTE',this.loggedAttendSon)
}
currentPath = window.location.pathname;
@Input() adding: "intervenient" | "CC";
ngOnInit() {
setTimeout(() => {
console.log('PARTE PARTE',this.loggedAttendSon)
});
this.fetchContacts("");
if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
@@ -211,8 +223,20 @@ export class AttendeePage implements OnInit {
});
}
this.contacts = this.sort(result as any);
if(this.loggedAttendSon) {
this.contacts = this.sort(result as any);
this.showLoader = false;
} else {
this.contacts = this.sort(result as any);
console.log('Attendes Email',this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts)
this.showLoader = false;
}
}
);
}