mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Attendee Modal
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AttendeeModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AttendeeModalPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
AttendeeModalPageRoutingModule
|
||||
],
|
||||
declarations: [AttendeeModalPage]
|
||||
})
|
||||
export class AttendeeModalPageModule {}
|
||||
@@ -0,0 +1,30 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>attendee-modal</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-searchbar [(ngModel)]="searchCountryString" (input)="searchCountry($event)" placeholder="Search"></ion-searchbar>
|
||||
<ion-list>
|
||||
<button ion-item *ngFor="let attendee of eventAttendees">
|
||||
{{attendee.Name}}
|
||||
</button>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar color="primary">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeeModalPage } from './attendee-modal.page';
|
||||
|
||||
describe('AttendeeModalPage', () => {
|
||||
let component: AttendeeModalPage;
|
||||
let fixture: ComponentFixture<AttendeeModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttendeeModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AttendeeModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendee-modal',
|
||||
templateUrl: './attendee-modal.page.html',
|
||||
styleUrls: ['./attendee-modal.page.scss'],
|
||||
})
|
||||
export class AttendeeModalPage implements OnInit {
|
||||
|
||||
constructor(private modalCtrl: ModalController) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
save(){
|
||||
//this.eventService.postEvent(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
this.modalCtrl.dismiss();
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalCtrl.dismiss();
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
console.log(evt);
|
||||
}
|
||||
|
||||
searchCountry(searchbar) {
|
||||
// reset countries list with initial call
|
||||
//this.eventAttendees = this.eventAttendeesInitial;
|
||||
|
||||
// set q to the value of the searchbar
|
||||
var q = searchbar.value;
|
||||
|
||||
// if the value is an empty string don't filter the items
|
||||
// if (q.trim() == '') {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// this.eventAttendees = this.eventAttendees.filter((v) => {
|
||||
// if (v.Name.toLowerCase().indexOf(q.toLowerCase()) > -1) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,18 +3,8 @@
|
||||
<ion-title>attendees</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-searchbar [(ngModel)]="searchCountryString" (input)="searchCountry($event)" placeholder="Search"></ion-searchbar>
|
||||
<ion-list>
|
||||
<button ion-item *ngFor="let attendee of eventAttendees">
|
||||
{{attendee.Name}}
|
||||
</button>
|
||||
</ion-list>
|
||||
|
||||
|
||||
<!--
|
||||
<ion-toolbar >
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
|
||||
<ion-segment-button value="required">
|
||||
Necessários
|
||||
@@ -25,10 +15,6 @@
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-searchbar
|
||||
[showCancelButton]=""
|
||||
(ionChange)="onChange($event)">
|
||||
</ion-searchbar>
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none" *ngFor="let attendee of eventAttendees">
|
||||
@@ -43,5 +29,10 @@
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</div>TABS -->
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-button (click)="addAttendees()" expand="block">
|
||||
<ion-lable>Adicionar intervenientes</ion-lable>
|
||||
</ion-button>
|
||||
</ion-footer>
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendees',
|
||||
@@ -16,7 +18,7 @@ export class AttendeesPage implements OnInit {
|
||||
|
||||
searchCountryString = ''; // initialize your searchCountryString string empty
|
||||
|
||||
constructor(private eventService: EventsService) {
|
||||
constructor(private eventService: EventsService, private modalCtrl: ModalController) {
|
||||
}
|
||||
|
||||
|
||||
@@ -28,26 +30,6 @@ export class AttendeesPage implements OnInit {
|
||||
this.loadAttendees();
|
||||
}
|
||||
|
||||
searchCountry(searchbar) {
|
||||
// reset countries list with initial call
|
||||
this.eventAttendees = this.eventAttendeesInitial;
|
||||
|
||||
// set q to the value of the searchbar
|
||||
var q = searchbar.value;
|
||||
|
||||
// if the value is an empty string don't filter the items
|
||||
// if (q.trim() == '') {
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.eventAttendees = this.eventAttendees.filter((v) => {
|
||||
if (v.Name.toLowerCase().indexOf(q.toLowerCase()) > -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
loadAttendees(){
|
||||
let isRequired: boolean = (this.segment == "required");
|
||||
this.eventAttendees = this.eventService.lastloadedevent.Attendees.filter(function(person) {
|
||||
@@ -55,8 +37,16 @@ export class AttendeesPage implements OnInit {
|
||||
});
|
||||
this.eventAttendeesInitial = this.eventAttendees;
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
console.log(evt);
|
||||
|
||||
async addAttendees()
|
||||
{
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeeModalPage,
|
||||
cssClass: 'attendee-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,9 +51,11 @@
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<div class="event-detail-buttons">
|
||||
<ion-button fill="outline" class="ion-button-left" (click)="deleteConfirm()">Apagar</ion-button>
|
||||
<ion-button class="ion-button-right" (click)="Save()">Gravar</ion-button>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-footer>
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'attendees',
|
||||
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attendee-modal',
|
||||
loadChildren: () => import('./attendee-modal/attendee-modal.module').then( m => m.AttendeeModalPageModule)
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/v1/api/',
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/v2/api/',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'tiago.kayaya',
|
||||
defaultuser: 'paulo.pinto',
|
||||
defaultuserpwd: 'tabteste@006'
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user