get tiago work back 1

This commit is contained in:
Paulo Pinto
2020-08-25 14:17:33 +01:00
parent b57a27e466
commit 3ae6946118
6 changed files with 54 additions and 106 deletions
+2
View File
@@ -41,6 +41,8 @@ export class AgendaPage implements OnInit {
constructor(
private alertCtrl: AlertController,
@Inject(LOCALE_ID) private locale: string,
private modalCtrl: ModalController,
private eventService: EventsService,
private router: Router
@@ -1,16 +1,17 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="/events"></ion-back-button>
<ion-back-button defaultHref="/home/events"></ion-back-button>
</ion-buttons>
<ion-title>Visualizar Evento</ion-title>
</ion-toolbar>
</ion-header>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-content padding>
<ion-item-group>
<ion-item>
<ion-label position="stacked">Assunto</ion-label>
<!-- <ion-input value='{{event.Subject}}'></ion-input> -->
<ion-input [(ngModel)]="loadedEvent.Subject"></ion-input>
</ion-item>
<ion-item>
@@ -21,55 +22,36 @@
<ion-label position="stacked">Localização</ion-label>
<ion-input [(ngModel)]='loadedEvent.Location'></ion-input>
</ion-item>
<ion-item-sliding>
<ion-item
[routerLink]="['/home/attendees']">
<ion-label position="stacked">Pessoas</ion-label>
</ion-item>
</ion-item-sliding>
<ion-item>
<ion-label position="stacked">Agenda</ion-label>
<ion-select [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
</ion-select>
<ion-label position="stacked">Intervenientes</ion-label>
<ion-list>
<ion-item *ngFor="let inter of loadedEvent.RequiredAttendees">
<ion-input [(ngModel)]='inter.Name'></ion-input>
</ion-item>
</ion-list>
</ion-item>
<ion-item>
<ion-label position="stacked">Selecione o tipo de evento</ion-label>
<ion-select [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<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-label position="stacked">Calendário</ion-label>
<ion-input [(ngModel)]='loadedEvent.CalendarName'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Início</ion-label>
<ion-datetime [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
<ion-label position="stacked">Tipo do evento</ion-label>
<ion-input [(ngModel)]='loadedEvent.EventType'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Início: </ion-label>
<ion-input [(ngModel)]='loadedEvent.StartDate'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Fim</ion-label>
<ion-datetime [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
<ion-input [(ngModel)]='loadedEvent.EndDate'></ion-input>
</ion-item>
<ion-list>
<ion-item-sliding>
<ion-item lines="none" [routerLink]="['/home/attachments', loadedEvent.EventId]">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon class="ion-icon-attach" slot="end" name="attach-outline"></ion-icon>
</div>
<div class="div-content-attachment">
<h3>Ver anexos</h3>
</div>
</div>
</div>
</ion-item>
</ion-item-sliding>
<ion-list-header>Anexos</ion-list-header>
<ion-item>
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>Lei do orçamento geral do Estado</ion-label>
</ion-item>
</ion-list>
</ion-item-group>
<div class="event-detail-buttons">
@@ -1,14 +1,11 @@
import { Component, OnInit, Injectable } from '@angular/core';
import { ActivatedRoute, NavigationExtras } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { EventsService } from 'src/app/services/events.service';
import { Router } from '@angular/router';
import { Event } from '../../../models/event.model';
import { Observable } from 'rxjs';
import { EventBody } from 'src/app/models/eventbody.model';
import { AlertController } from '@ionic/angular';
import { Attachment } from 'src/app/models/attachment.model';
import { ActionSheetController } from '@ionic/angular';
@Component({
selector: 'app-event-detail',
@@ -17,12 +14,10 @@ import { ActionSheetController } from '@ionic/angular';
})
export class EventDetailPage implements OnInit {
public loadedEvent: Event;
loadedEventAttachments: Attachment[];
showLoader: boolean = true;
loadedEvent: Event;
eventItem: Observable<Event>;
constructor(public actionSheetController: ActionSheetController, public alertController: AlertController, private router: Router, private activatedRoute: ActivatedRoute,
public eventsService: EventsService) {
constructor(public alertController: AlertController, private router: Router, private activatedRoute: ActivatedRoute, private eventsService: EventsService) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
@@ -34,18 +29,18 @@ export class EventDetailPage implements OnInit {
//Redirect
return;
}
this.loadEvent(paramMap.get('eventId'));
});
}
const eventId = paramMap.get('eventId');
loadEvent(eventid:string)
{
this.showLoader = true;
this.eventsService.getEvent(eventid).subscribe(event => {
this.loadedEvent = event;
this.showLoader = false;
this.eventsService.loadedEvent = this.loadedEvent;
/* Load my event detail */
/* this.loadedEvent = this.eventsService.getEvent(eventId); */
this.eventItem = this.eventsService.getEvent(eventId);
/* console.log(this.eventItem); */
this.eventsService.getEvent(eventId).subscribe(response =>
{
this.loadedEvent = response;
});
});
}
@@ -60,7 +55,7 @@ export class EventDetailPage implements OnInit {
text: 'Não',
role: 'cancel',
cssClass: 'secondary',
handler: () => { }
handler: (blah) => { }
}, {
text: 'Sim',
handler: () => {
@@ -75,7 +70,7 @@ export class EventDetailPage implements OnInit {
Delete()
{
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async response =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
@@ -91,7 +86,7 @@ export class EventDetailPage implements OnInit {
Save()
{
this.eventsService.putEvent(this.loadedEvent, 2, 3).subscribe(async () =>
this.eventsService.putEvent(this.loadedEvent, 2, 3).subscribe(async response =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
@@ -105,12 +100,4 @@ export class EventDetailPage implements OnInit {
});
}
openDetailsWithQueryParams() {
let navigationExtras: NavigationExtras = {
queryParams: {
special: JSON.stringify(this.loadedEvent.Attendees)
}
};
this.router.navigate(['details'], navigationExtras);
}
}
+6 -8
View File
@@ -1,5 +1,4 @@
<div class="header-toolbar">
<ion-header translucent="true" >
<ion-header translucent="true">
<ion-toolbar>
<ion-title>
<ion-item class="ion-text-header-top" lines="none">
@@ -23,7 +22,6 @@
</ion-title>
</ion-toolbar>
</ion-header>
</div>
<ion-content>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -36,7 +34,7 @@
</ion-refresher-content>
</ion-refresher>
<!-- TABS -->
<ion-toolbar>
<ion-toolbar >
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
<ion-segment-button value="Combinada">
Combinada
@@ -57,7 +55,7 @@
<ion-item lines="none"
*ngFor="let event of eventsList"
[routerLink]="['/home/events', event.EventId]">
<div class="div-item-{{event.CalendarName}}">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
@@ -90,7 +88,7 @@
<ion-item lines="none"
*ngFor="let event of officialeventsList"
[routerLink]="['/home/events', event.EventId]">
<div class="div-item-{{event.CalendarName}}">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
@@ -108,7 +106,7 @@
<p class="item-list-small">{{event.Location}}</p>
</div>
<div class="div-botton-right">
<ion-icon *ngIf="event.HasAttachments" class="ion-icon-attach" slot="end" name="attach-outline"></ion-icon>
<ion-icon class="ion-icon-attach" slot="end" name="attach-outline"></ion-icon>
</div>
</div>
</div>
@@ -123,7 +121,7 @@
<ion-item lines="none"
*ngFor="let event of personaleventsList"
[routerLink]="['/home/events', event.EventId]">
<div class="div-item-{{event.CalendarName}}">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
+2 -23
View File
@@ -1,8 +1,3 @@
.header-toolbar{
/* background: #f5f5f5;
border: 1px solid red; */
}
/* HEADER */
.ion-text-header-top{
text-align: center;
@@ -53,26 +48,11 @@
}
//DIV
.div-item-Oficial{
.div-item{
width: 100%;
overflow: auto;
border-bottom: 1px solid #ccc;
margin: 10px 0 5px 0;
overflow: auto;
background: #cab0dc;
padding: 5px;
border-radius: 10PX;
}
.div-item-Pessoal{
width: 100%;
overflow: auto;
margin: 10px 0 5px 0;
overflow: auto;
background: #cbeecb;
padding: 5px;
border-radius: 10PX;
}
.div-up{
width: 100%;
@@ -100,7 +80,6 @@
float: left;
border-left: 4px solid #cab0dc;
padding: 0 0 0 12px;
}
.div-content-Pessoal{
width: 85%;