This commit is contained in:
Tiago Kayaya
2020-09-04 14:28:00 +01:00
parent b801fbbf0e
commit 2b7af8ddc8
11 changed files with 74 additions and 508 deletions
+1 -2
View File
@@ -134,12 +134,11 @@ export class AgendaPage implements OnInit {
});
this.myCal.update();
this.myCal.loadEvents();
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
});
/* this.loading(); */
}
async loadRangeEvents(startTime: Date, endTime: Date){
this.showLoader = true;
+25 -16
View File
@@ -13,42 +13,48 @@
<div class="div-ion-content">
<form [formGroup]="ionicForm" novalidate>
<ion-item>
<ion-label position="floating">Assunto</ion-label>
<ion-label position="floating">Assunto <span class="span-color">*</span></ion-label>
<ion-input formControlName="subject" type="text" [(ngModel)]="postEvent.Subject" required></ion-input>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
<span class="error ion-padding" *ngIf="formSubjectSatus">
Campo obrigatório
</span>
<ion-item>
<ion-label position="floating">Descrição</ion-label>
<ion-label position="floating">Descrição <span class="span-color">*</span></ion-label>
<ion-input formControlName="description" type="text" [(ngModel)]="postEvent.Body.Text" required></ion-input>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
<span class="error ion-padding" *ngIf="formDescriptionSatus">
Campo obrigatório
</span>
<ion-item>
<ion-label position="floating">Localização</ion-label>
<ion-label position="floating">Localização <span class="span-color">*</span></ion-label>
<ion-input formControlName="location" type="text" [(ngModel)]="postEvent.Location" required></ion-input>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
<span class="error ion-padding" *ngIf="formLocationSatus">
Campo obrigatório
</span>
<!-- <span class="error ion-padding" *ngIf="errorControl.location.errors?.required">
Campo obrigatório
</span> -->
<ion-item>
<ion-label position="floating">Selecione a Agenda</ion-label>
<ion-label position="floating">Selecione a Agenda <span class="span-color">*</span></ion-label>
<ion-select selectedText="{{postEvent.CalendarName}}" formControlName="agenda" [(ngModel)]="postEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar" required>
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
</ion-select>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.agenda.errors?.required">
<span class="error ion-padding" *ngIf="formEventTypeSatus">
Campo obrigatório
</span>
<!-- <span class="error ion-padding" *ngIf="errorControl.agenda.errors?.required">
Campo obrigatório
</span> -->
<ion-item>
<ion-label position="floating">Tipo de evento</ion-label>
<ion-label position="floating">Tipo de evento <span class="span-color">*</span></ion-label>
<ion-select formControlName="eventtype" [(ngModel)]="postEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option>
<ion-select-option value="Viagem">Viagem</ion-select-option>
@@ -57,11 +63,14 @@
</ion-select>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
<span class="error ion-padding" *ngIf="formEventTypeSatus">
Campo obrigatório
</span>
<!-- <span class="error ion-padding" *ngIf="errorControl.eventtype.errors?.required">
Campo obrigatório
</span> -->
<ion-item>
<ion-label position="floating">Data Início</ion-label>
<ion-label position="floating">Data Início <span class="span-color">*</span></ion-label>
<ion-datetime placeholder="{{postEvent.StartDate | date: 'dd MMM yyyy H:mm'}}" formControlName="startdate" [(ngModel)]="postEvent.StartDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
@@ -69,20 +78,20 @@
</ion-datetime>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
<!-- <span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
Campo obrigatório
</span>
</span> -->
<ion-item>
<ion-label position="floating">Data Fim</ion-label>
<ion-label position="floating">Data Fim <span class="span-color">*</span></ion-label>
<ion-datetime placeholder="{{postEvent.EndDate | date: 'dd MMM yyyy H:mm'}}" formControlName="enddate" [(ngModel)]="postEvent.EndDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
required></ion-datetime>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.enddate.errors?.required">
<!-- <span class="error ion-padding" *ngIf="errorControl.enddate.errors?.required">
Campo obrigatório
</span>
</span> -->
</form>
<div class="div-attach">
<ion-item lines="none">
@@ -26,3 +26,6 @@
width: 100%;
float: left;
} */
.span-color{
color:red;
}
+38 -8
View File
@@ -38,6 +38,11 @@ export class CalModalPage implements OnInit {
ionicForm: FormGroup;
isSubmitted = false;
formSubjectSatus: boolean = false;
formDescriptionSatus: boolean = false;
formLocationSatus: boolean = false;
formEventTypeSatus: boolean = false;
constructor(public formBuilder: FormBuilder, private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
private navParams: NavParams) {
this.postEvent = new Event();
@@ -67,7 +72,7 @@ export class CalModalPage implements OnInit {
CalendarName: this.selectedSegment,
StartDate: selectedStartdDate,
EndDate: new Date(selectedEndDate),
EventType: '',
EventType: 'Reunião',
Attendees: null,
IsMeeting: false,
IsRecurring: false,
@@ -85,10 +90,10 @@ export class CalModalPage implements OnInit {
Body: this.eventBody,
Location: '',
CalendarId: '',
CalendarName: '',
CalendarName: 'Oficial',
StartDate: selectedStartdDate,
EndDate: new Date(selectedEndDate),
EventType: '',
EventType: 'Reunião',
Attendees: null,
IsMeeting: false,
IsRecurring: false,
@@ -126,6 +131,35 @@ export class CalModalPage implements OnInit {
this.eventService.postEvent(this.postEvent, this.postEvent.CalendarName).subscribe();
this.modalCtrl.dismiss(this.postEvent);
}
else{
this.validateFormInputs();
}
}
validateFormInputs(){
let formSubject = this.postEvent.Subject.trim();
let formDescription = this.postEvent.Body.Text.trim();
let formLocation = this.postEvent.Location.trim();
if (!this.postEvent.Subject && formSubject.length <= 0){
this.formSubjectSatus=true;
}
else{
this.formSubjectSatus=false;
if(!this.postEvent.Body.Text && formDescription.length <= 0){
this.formDescriptionSatus=true;
}
else{
this.formDescriptionSatus=false;
if (!this.postEvent.Location && formLocation.length <= 0){
this.formLocationSatus=true;
}
else{
this.formLocationSatus=false;
}
}
}
/* return (this.postEvent.Subject && formSubject.length > 0); */
}
onViewTitleChanged(title){
@@ -142,8 +176,6 @@ export class CalModalPage implements OnInit {
/* this.modalCtrl.dismiss(this.postEvent); */
}
async addAttendees()
{
const modal = await this.modalCtrl.create({
@@ -206,8 +238,6 @@ export class CalModalPage implements OnInit {
}
});
}
example(){
console.log("Mensagem");
}
}
-17
View File
@@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FeedPage } from './feed.page';
const routes: Routes = [
{
path: '',
component: FeedPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class FeedPageRoutingModule {}
-23
View File
@@ -1,23 +0,0 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { FeedPageRoutingModule } from './feed-routing.module';
import { FeedPage } from './feed.page';
/* import { ComponentsModule } from 'src/app/components/components.module'; */
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
/* ComponentsModule, */
FeedPageRoutingModule
],
declarations: [FeedPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class FeedPageModule {}
-227
View File
@@ -1,227 +0,0 @@
<ion-header translucent="true">
<!-- <ion-buttons *ngIf="!showSearchbar" slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons> -->
<ion-toolbar>
<ion-title>
<ion-item class="ion-text-header-top" lines="none">
<div class="div-logo">
<img src='assets/images/logo.png' alt='logo'>
</div>
<ion-label>
<h6 class="header-xsmall">Presidente da República</h6>
<h2 class="header-large">GABINETE DIGITAL</h2>
</ion-label>
</ion-item>
<ion-item class="ion-text-right" lines="none">
<ion-label class="ion-text-wrap">
<h3 class="header-medium"> {{greetting}} Sua Excelência <br />
Minístro Director do Gabinete do<br />
Presidente da República
</h3>
<p class="p-small">{{customDate}}</p>
<!-- <p>{{timeDate}}</p> -->
</ion-label>
</ion-item>
</ion-title>
<!-- <ion-segment *ngIf="ios" [(ngModel)]="segment">
<ion-segment-button value="combinada">
Combinada
</ion-segment-button>
<ion-segment-button value="oficial">
Oficial
</ion-segment-button>
<ion-segment-button value="pessoal">
Pessoal
</ion-segment-button>
</ion-segment>-->
</ion-toolbar>
<!-- TABS -->
</ion-header>
<ion-content>
<ion-toolbar > <!-- *ngIf="!ios" -->
<ion-segment [(ngModel)]="segment">
<ion-segment-button value="combinada">
Combinada
</ion-segment-button>
<ion-segment-button value="oficial">
Oficial
</ion-segment-button>
<ion-segment-button value="pessoal">
Pessoal
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<!-- List of Text Items -->
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'combinada'">
<ion-item-group>
<!-- <ion-item-divider>
<ion-label>8:00 am</ion-label>
</ion-item-divider> -->
<ion-item-sliding>
<ion-item lines="none">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
</div>
<div class="div-content-oficial">
<h3>Reunião de Conselho de Ministros</h3>
<p>08:30 - 10:30</p>
</div>
</div>
<div class="div-botton">
<div class="div-botton-left">
<ion-icon class="ion-icon-location" slot="start" name="location"></ion-icon>
</div>
<div class="div-botton-middle">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</div>
<div class="div-botton-right">
<ion-icon class="ion-icon-attach" slot="end" name="attach-outline"></ion-icon>
</div>
</div>
</div>
</ion-item>
<!-- <ion-item-divider>
<ion-label>9:00 am</ion-label>
</ion-item-divider> -->
<ion-item lines="none">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
</div>
<div class="div-content-pessoal">
<h3>Conference call Particular</h3>
<p>11:00 - 12:30</p>
</div>
</div>
<div class="div-botton">
<div class="div-botton-left">
<ion-icon class="ion-icon-location" slot="start" name="location"></ion-icon>
</div>
<div class="div-botton-middle">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</div>
<div class="div-botton-right">
<ion-icon class="ion-icon-attach" slot="end" name="attach"></ion-icon>
</div>
</div>
</div>
</ion-item>
<ion-item lines="none">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
</div>
<div class="div-content-pessoal">
<h3>Conference call Particular</h3>
<p>11:00 - 12:30</p>
</div>
</div>
<div class="div-botton">
<div class="div-botton-left">
<ion-icon class="ion-icon-location" slot="start" name="location"></ion-icon>
</div>
<div class="div-botton-middle">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</div>
<div class="div-botton-right">
<ion-icon class="ion-icon-attach" slot="end" name="attach"></ion-icon>
</div>
</div>
</div>
</ion-item>
</ion-item-sliding>
</ion-item-group>
</ion-list>
<!-- OFICIAL -->
<ion-list *ngSwitchCase="'oficial'">
<ion-item-group>
<ion-item-sliding>
<ion-item-divider>
<ion-label>8:00 am</ion-label>
</ion-item-divider>
<ion-item lines="none">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
</div>
<div class="div-content-oficial">
<h3>Reunião de Conselho de Ministros</h3>
<p>08:30 - 10:30</p>
</div>
</div>
<div class="div-botton">
<div class="div-botton-left">
<ion-icon class="ion-icon-location" slot="start" name="location"></ion-icon>
</div>
<div class="div-botton-middle">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</div>
<div class="div-botton-right">
<ion-icon class="ion-icon-attach" slot="end" name="attach"></ion-icon>
</div>
</div>
</div>
</ion-item>
<!--
<ion-item lines="none">
<ion-icon slot="start" name="chatbox"></ion-icon>
<ion-label>
<h3>Conference call Particular</h3>
<p>11:00 - 12:30</p>
</ion-label>
</ion-item>
<ion-item class="ion-item-class" lines="none">
<ion-icon class="ion-icon-size" slot="start" name="location"></ion-icon>
<ion-label class="label-text">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</ion-label>
<ion-icon class="ion-icon-size" slot="end" name="attach-outline"></ion-icon>
</ion-item>
-->
</ion-item-sliding>
</ion-item-group>
</ion-list>
<ion-list *ngSwitchCase="'pessoal'">
<ion-item-group>
<ion-item-sliding>
<ion-item-divider>
<ion-label>9:00 am</ion-label>
</ion-item-divider>
<ion-item lines="none">
<div class="div-item">
<div class="div-up">
<div class="div-icon">
<ion-icon slot="start" name="reader"></ion-icon>
</div>
<div class="div-content-pessoal">
<h3>Conference call Particular</h3>
<p>11:00 - 12:30</p>
</div>
</div>
<div class="div-botton">
<div class="div-botton-left">
<ion-icon class="ion-icon-location" slot="start" name="location"></ion-icon>
</div>
<div class="div-botton-middle">
<p class="item-list-small">Luanda, Palácio presidencial</p>
</div>
<div class="div-botton-right">
<ion-icon class="ion-icon-attach" slot="end" name="attach"></ion-icon>
</div>
</div>
</div>
</ion-item>
</ion-item-sliding>
</ion-item-group>
</ion-list>
</div>
</ion-content>
-136
View File
@@ -1,136 +0,0 @@
/* HEADER */
.ion-text-header-top{
text-align: center;
padding-top: 20px;
}
.div-logo{
width: 98px;
}
.div-logo img{
width: 100%;
}
.header-large{
font-family: Arial, Helvetica, sans-serif;
font-size: 16pt;
/* font-weight: 600; */
}
.header-medium{
font-size: 16pt;
font-family: roboto;
}
.header-xsmall{
font-family: Arial, Helvetica, sans-serif;
font-size: 12.7pt;
font-weight: bold;
padding-bottom: 3.5px;
margin-bottom: 3.5px;
border-bottom: 1px solid #ccc;
}
.p-small{
font-size: 12pt;
margin-top: 25px;
color:#000;
}
/* CONTENT */
.item-list-small{
font-size: 14px;
overflow: auto;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
.div-item{
width: 100%;
overflow: auto;
border-bottom: 1px solid #ccc;
margin: 10px 0 5px 0;
}
.div-up{
width: 100%;
overflow: auto;
}
.div-up h3{
margin: 0;
padding: 0;
font-size: 17px;
width: 100%;
}
.div-icon{
width: 10%;
font-size: 22px;
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-oficial{
width: 85%;
float: left;
border-left: 3px solid #cab0dc;
padding: 0 0 0 12px;
}
.div-content-pessoal{
width: 85%;
float: left;
border-left: 3px solid #cbeecb;
padding: 0 0 0 12px;
}
.div-content-oficial h3, .div-content-pessoal h3{
font-size: 16pt;
/* border: 1px solid red; */
}
.div-content-oficial p, .div-content-pessoal p{
font-size: 14pt;
color: rgb(94, 92, 92);
padding: 0 !important;
margin: 0 !important;
}
.div-botton{
width: 100%;
overflow: auto;
margin: 10px 0 5px 0;
}
.div-botton-left{
width: 10%;
float: left;
}
.ion-icon-location{
text-align: center;
display: block;
color: #000;
font-size: 16px;
margin: 0 auto;
}
.div-botton-middle{
width: 75%;
float: left;
margin-top: 0.5px;
}
.div-botton-middle p{
padding: 0;
margin: 0;
}
.div-botton-right{
width: 10%;
float: left;
margin: 0;
padding: 0;
}
.ion-icon-attach{
color: #666666;
font-size: 20px;
}
-24
View File
@@ -1,24 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { FeedPage } from './feed.page';
describe('FeedPage', () => {
let component: FeedPage;
let fixture: ComponentFixture<FeedPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FeedPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(FeedPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
-48
View File
@@ -1,48 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-feed',
templateUrl: './feed.page.html',
styleUrls: ['./feed.page.scss'],
})
export class FeedPage implements OnInit {
/* Get current system date */
today = new Date();
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
customDate = this.days[this.today.getDay()]+ ", "
+ this.today.getDate() +" de "
+ ( this.months[this.today.getMonth()]);
/* Setting appropriate greeting according to the time */
grettings = ["Bom dia", "Boa tarde", "Boa noite"];
greetting='';
/* hora
Dia 06 - 12:00
Tarde 12:01 - 18:00
Noite 18:00 - 06:00
*/
timeDate = this.today.getHours() + ":" + this.today.getMinutes();
showGreeting(){
if(this.today.getHours() >= 6 && this.today.getHours() < 12){
this.greetting = this.grettings[0];
}
else if(this.today.getHours() >= 12 && this.today.getHours() < 18){
this.greetting = this.grettings[1];
}
else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */{
this.greetting = this.grettings[2];
}
}
segment:string;
constructor() { }
ngOnInit() {
//Inicializar segment
this.segment = "combinada";
this.showGreeting();
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ export const environment = {
production: false,
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/v2/api/',
domain: 'gabinetedigital.local',
defaultuser: '',
defaultuser: 'paulo.pinto',
defaultuserpwd: 'tabteste@006'
};