mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
- improved edit workflow
- add delete functionality
This commit is contained in:
Generated
+5
-15
@@ -2101,13 +2101,6 @@
|
|||||||
"integrity": "sha512-qJcZJtXaXUpwKTMzLc6tGitHJVYQCcSlx2XNQUiKyck47g98Xxo8D0zgHoRiCQvApOqw1iEKzh6xs5PLkmcXqw==",
|
"integrity": "sha512-qJcZJtXaXUpwKTMzLc6tGitHJVYQCcSlx2XNQUiKyck47g98Xxo8D0zgHoRiCQvApOqw1iEKzh6xs5PLkmcXqw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/cordova": "^0.0.34"
|
"@types/cordova": "^0.0.34"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/cordova": {
|
|
||||||
"version": "0.0.34",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
|
||||||
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@ionic-native/file": {
|
"@ionic-native/file": {
|
||||||
@@ -3041,6 +3034,11 @@
|
|||||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
},
|
||||||
"@types/glob": {
|
"@types/glob": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
|
||||||
@@ -3432,14 +3430,6 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"semver": "^5.4.1"
|
"semver": "^5.4.1"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ansi": {
|
"ansi": {
|
||||||
"version": "0.3.1",
|
"version": "0.3.1",
|
||||||
|
|||||||
@@ -339,7 +339,12 @@ export class AgendaPage implements OnInit {
|
|||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss();
|
modal.onDidDismiss().then((res)=>{
|
||||||
|
if(res){
|
||||||
|
console.log(res);
|
||||||
|
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="ion-item-container">
|
<div class="ion-item-container">
|
||||||
<ion-input placeholder="Assunto"></ion-input>
|
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-input placeholder="Localização"></ion-input>
|
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Error messages -->
|
<!-- Error messages -->
|
||||||
@@ -37,7 +37,11 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-select placeholder="Selecione agenda" interface="action-sheet" Cancel-text="Cancelar" required>
|
<ion-select placeholder="Selecione agenda"
|
||||||
|
selectedText="{{postEvent.CalendarName}}"
|
||||||
|
[(ngModel)]="postEvent.CalendarName"
|
||||||
|
interface="action-sheet" Cancel-text="Cancelar"
|
||||||
|
required>
|
||||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
@@ -51,9 +55,15 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-select placeholder="Selecione tipo" interface="action-sheet" Cancel-text="Cancelar" required>
|
<ion-select placeholder="Selecione tipo"
|
||||||
<ion-select-option value="Oficial">Reunião</ion-select-option>
|
[(ngModel)]="postEvent.EventType"
|
||||||
<ion-select-option value="Pessoal">Viagem</ion-select-option>
|
selectedText="{{postEvent.EventType}}"
|
||||||
|
interface="action-sheet"
|
||||||
|
Cancel-text="Cancelar" required>
|
||||||
|
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||||
|
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||||
|
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||||
|
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +77,7 @@
|
|||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Início"
|
placeholder="Início"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
minuteValues="0,15,30,45"
|
minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
@@ -88,7 +98,7 @@
|
|||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Fim"
|
placeholder="Fim"
|
||||||
|
[(ngModel)]="postEvent.EndDate"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
minuteValues="0,15,30,45"
|
minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
@@ -107,7 +117,11 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-select placeholder="Selecione repetição" value="false" interface="action-sheet" Cancel-text="Cancelar" required>
|
<ion-select placeholder="Selecione repetição"
|
||||||
|
[(ngModel)]="postEvent.IsRecurring"
|
||||||
|
selectedText="{{isRecurring}}"
|
||||||
|
interface="action-sheet"
|
||||||
|
Cancel-text="Cancelar" required>
|
||||||
<ion-select-option value="false">Não se repete</ion-select-option>
|
<ion-select-option value="false">Não se repete</ion-select-option>
|
||||||
<ion-select-option value="true">Repete</ion-select-option>
|
<ion-select-option value="true">Repete</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
@@ -120,11 +134,11 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class-no-height">
|
<div (click)="openAttendees()" class="ion-input-class-no-height">
|
||||||
<div class="list-people">
|
<div class="list-people">
|
||||||
<ion-item lines="none">
|
<ion-item lines="none">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-label class="list-people-title">Adicionar intervenientes</ion-label>
|
<ion-label class="list-people-title">Ver ou editar participantes</ion-label>
|
||||||
<ion-label hidden >Text</ion-label>
|
<ion-label hidden >Text</ion-label>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
@@ -136,7 +150,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div hidden class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||||
@@ -163,7 +177,7 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-input placeholder="Detalhes"></ion-input>
|
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ModalController } from '@ionic/angular';
|
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||||
|
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||||
|
import { Attachment } from 'src/app/models/attachment.model';
|
||||||
|
import { EventBody } from 'src/app/models/eventbody.model';
|
||||||
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
import { Event } from '../../../models/event.model';
|
||||||
|
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-event',
|
selector: 'app-edit-event',
|
||||||
@@ -8,17 +17,80 @@ import { ModalController } from '@ionic/angular';
|
|||||||
})
|
})
|
||||||
export class EditEventPage implements OnInit {
|
export class EditEventPage implements OnInit {
|
||||||
|
|
||||||
|
postEvent: Event;
|
||||||
|
isRecurring:string;
|
||||||
|
isEventEdited: boolean;
|
||||||
|
loadedEvent: Event;
|
||||||
|
eventBody: EventBody;
|
||||||
|
segment:string = "true";
|
||||||
|
profile:string;
|
||||||
|
eventAttendees: EventPerson[];
|
||||||
|
selectedSegment: string;
|
||||||
|
selectedDate: Date;
|
||||||
|
minDate: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
) { }
|
private navParams: NavParams,
|
||||||
|
private eventsService: EventsService,
|
||||||
|
private alertService: AlertService,
|
||||||
|
public alertController: AlertController,
|
||||||
|
) {
|
||||||
|
this.isEventEdited = false;
|
||||||
|
this.postEvent = this.navParams.get('event');
|
||||||
|
if(this.postEvent.IsRecurring == false){
|
||||||
|
this.isRecurring = "Não se repete";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.isRecurring = "Repete";
|
||||||
|
}
|
||||||
|
this.profile = this.navParams.get('profile');
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.profile);
|
||||||
|
console.log(this.postEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
close(){
|
close(){
|
||||||
this.modalController.dismiss(null);
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
save(){
|
save(){
|
||||||
|
console.log(this.postEvent);
|
||||||
|
|
||||||
|
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||||
|
this.isEventEdited = true;
|
||||||
|
const alert = await this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Evento actualizado',
|
||||||
|
buttons: ['OK']
|
||||||
|
});
|
||||||
|
await alert.present();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.modalController.dismiss(this.isEventEdited);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async openAttendees()
|
||||||
|
{
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AttendeesPage,
|
||||||
|
componentProps: {
|
||||||
|
eventAttendees: this.postEvent.Attendees
|
||||||
|
},
|
||||||
|
cssClass: 'attendee',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
if (data['data'] != null)
|
||||||
|
{
|
||||||
|
let newattendees: EventPerson[] = data['data'];
|
||||||
|
this.postEvent.Attendees = newattendees;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,15 @@
|
|||||||
<ion-toolbar class="header-toolbar">
|
<ion-toolbar class="header-toolbar">
|
||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<div class="title-content">
|
<div class="title-content">
|
||||||
<app-btn-modal-dismiss></app-btn-modal-dismiss>
|
<div class="left">
|
||||||
|
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||||
|
</div>
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<ion-label class="title">{{loadedEvent.Subject}}</ion-label>
|
<ion-label class="title">{{loadedEvent.Subject}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-icon-right">
|
<div class="div-icon">
|
||||||
<ion-icon slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
<ion-icon class="edit" (click)="editEvent()" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||||
|
<ion-icon class="delete" (click)="deleteEvent()" name="trash-sharp"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +54,7 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bottom-content">
|
<div *ngIf="loadedAttachments" class="bottom-content">
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<h3>Documentos Anexados</h3>
|
<h3>Documentos Anexados</h3>
|
||||||
<ion-item class="ion-no-margin ion-no-padding">
|
<ion-item class="ion-no-margin ion-no-padding">
|
||||||
|
|||||||
@@ -31,8 +31,14 @@ ion-menu{
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
|
.left{
|
||||||
|
width: 37px;
|
||||||
|
float: left;
|
||||||
|
font-size: 35px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.middle{
|
.middle{
|
||||||
width: 270px;
|
width: 220px;
|
||||||
padding: 0!important;
|
padding: 0!important;
|
||||||
float: left;
|
float: left;
|
||||||
margin: 2.5px 0 0 0;
|
margin: 2.5px 0 0 0;
|
||||||
@@ -43,6 +49,24 @@ ion-menu{
|
|||||||
float: right;
|
float: right;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
.div-icon{
|
||||||
|
width: 92px;
|
||||||
|
float: right;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
.div-icon .edit{
|
||||||
|
font-size: 35px;
|
||||||
|
float: right;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
.div-icon .delete{
|
||||||
|
padding: 7px;
|
||||||
|
font-size: 21px;
|
||||||
|
color:#fff;
|
||||||
|
background: #d30606;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title{
|
.title{
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||||
import { Attachment } from 'src/app/models/attachment.model';
|
import { Attachment } from 'src/app/models/attachment.model';
|
||||||
import { EventBody } from 'src/app/models/eventbody.model';
|
import { EventBody } from 'src/app/models/eventbody.model';
|
||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
import { Event } from '../../../models/event.model';
|
import { Event } from '../../../models/event.model';
|
||||||
|
import { EditEventPage } from '../edit-event/edit-event.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-event',
|
selector: 'app-view-event',
|
||||||
@@ -15,6 +16,7 @@ import { Event } from '../../../models/event.model';
|
|||||||
export class ViewEventPage implements OnInit {
|
export class ViewEventPage implements OnInit {
|
||||||
|
|
||||||
loadedEvent: Event;
|
loadedEvent: Event;
|
||||||
|
isEventEdited: boolean;
|
||||||
eventBody: EventBody;
|
eventBody: EventBody;
|
||||||
loadedAttachments:any;
|
loadedAttachments:any;
|
||||||
loadedEventAttachments: Attachment[];
|
loadedEventAttachments: Attachment[];
|
||||||
@@ -36,12 +38,15 @@ export class ViewEventPage implements OnInit {
|
|||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private eventsService: EventsService,
|
private eventsService: EventsService,
|
||||||
private attachmentsService: AttachmentsService,
|
private attachmentsService: AttachmentsService,
|
||||||
) {
|
public alertController: AlertController,
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this.isEventEdited = false;
|
||||||
this.loadedEvent = new Event();
|
this.loadedEvent = new Event();
|
||||||
this.eventBody = { BodyType : "1", Text : ""};
|
this.eventBody = { BodyType : "1", Text : ""};
|
||||||
this.loadedEvent.Body = this.eventBody;
|
this.loadedEvent.Body = this.eventBody;
|
||||||
this.eventId = this.navParams.get('eventId');
|
this.eventId = this.navParams.get('eventId');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
/* console.log(this.eventId); */
|
/* console.log(this.eventId); */
|
||||||
@@ -49,6 +54,10 @@ export class ViewEventPage implements OnInit {
|
|||||||
this.getAttachments();
|
this.getAttachments();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
close(){
|
||||||
|
console.log(this.isEventEdited);
|
||||||
|
this.modalController.dismiss(this.isEventEdited);
|
||||||
|
}
|
||||||
|
|
||||||
loadEvent(){
|
loadEvent(){
|
||||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||||
@@ -61,6 +70,19 @@ export class ViewEventPage implements OnInit {
|
|||||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
deleteEvent(){
|
||||||
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
||||||
|
{
|
||||||
|
const alert = await this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Evento removido',
|
||||||
|
buttons: ['OK']
|
||||||
|
});
|
||||||
|
|
||||||
|
await alert.present();
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getAttachments(){
|
getAttachments(){
|
||||||
this.attachmentsService.getAttachmentsById(this.eventId).subscribe(res=>{
|
this.attachmentsService.getAttachmentsById(this.eventId).subscribe(res=>{
|
||||||
@@ -69,6 +91,33 @@ export class ViewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async editEvent() {
|
||||||
|
/* this.close(); */
|
||||||
|
console.log(this.profile);
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: EditEventPage,
|
||||||
|
componentProps:{
|
||||||
|
event: this.loadedEvent,
|
||||||
|
profile: this.profile,
|
||||||
|
},
|
||||||
|
cssClass: 'modal',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
if(res){
|
||||||
|
setTimeout(() => {
|
||||||
|
/* this.loadEvent(); */
|
||||||
|
this.getAttachments();
|
||||||
|
}, 250);
|
||||||
|
this.isEventEdited = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user