Merge branch 'feature/calendar' into developer

This commit is contained in:
tiago.kayaya
2021-04-14 10:39:05 +01:00
10 changed files with 301 additions and 133 deletions
+113 -53
View File
@@ -108,26 +108,54 @@
</div>
</ng-template>
</div>
<div class="calendar-container" *ngSwitchCase="'Pessoal'">
<ion-row>
<!-- Move back one screen of the slides -->
<ion-col size="2">
<ion-button fill="clear" (click)="back()" class="btn-no-color">
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
</ion-button>
</ion-col>
<!-- The title of the calendar in the middle -->
<ion-col size="8" class="ion-text-center">
<div class="calendar-container" *ngSwitchCase="'Pessoal'" [style.height]="calendarHeight">
<ion-row class="ion-justify-content-between calendar-tool-tip">
<ion-row class="ion-align-items-center">
<!-- Move back one screen of the slides -->
<div class="arrow">
<button (click)="back()" class="btn-no-color" >
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon>
</button>
</div>
<!-- Move forward one screen of the slides -->
<h2 class="capitaliseText">{{ viewTitle }}</h2>
</ion-col>
<!-- Move forward one screen of the slides -->
<ion-col size="2">
<ion-button fill="clear" (click)="next()" class="btn-no-color">
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
</ion-button>
</ion-col>
</ion-row>
<!-- <div class="drop-down">
<ion-icon slot="icon-only" class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
<div class="drop-down-container">
<ul>
<li *ngFor="let month of monthList" (click)="dropDownChangeDate(month.id)" >{{ month.name }}</li>
</ul>
</div>
</div> -->
<!-- Move forward one screen of the slides -->
<div (click)="next()" class="arrow">
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
</div>
</ion-row>
<ion-row class="ion-align-items-center">
<button *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons d-md-none btn-no-color">
<ion-icon src="assets/images/icons-profile-calendar-md.svg">ddddddd</ion-icon>
</button>
<button *ngIf="profile == 'pr' " (click)="changeProfile()" class="btn-no-color">
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg">dddddddd</ion-icon>
</button>
<button class="btn-no-color" (click)="viewEventsToApprove()">
<ion-icon class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
</button>
<button class="btn-no-color" (click)="clearContact();openAddEvent();">
<ion-icon class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
</button>
</ion-row>
</ion-row>
<table class="custom-calendar-header">
@@ -165,35 +193,64 @@
<!-- Adding a customized ng-template -->
<ng-template #template let-view="view" let-row="row" let-col="col">
<div [class.with-event]="view.dates[row*7+col].events.length">
{{view.dates[row*7+col].label}}
<div class="indicator-container">
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
</div>
<div [className]="currentDayEventDisplayBorder(view.dates, row*7+col)" class="d-flex justify-center align-center" [class.with-event]="view.dates[row*7+col].events.length">
<div class="day">
{{ view.dates[row*7+col].label }}
</div>
</div>
</ng-template>
</ng-template>
</div>
<div class="calendar-container" *ngSwitchCase="'Oficial'">
<ion-row>
<!-- Move back one screen of the slides -->
<ion-col size="2">
<ion-button fill="clear" (click)="back()">
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
</ion-button>
</ion-col>
<!-- The title of the calendar in the middle -->
<ion-col size="8" class="ion-text-center">
<div class="calendar-container" *ngSwitchCase="'Oficial'" [style.height]="calendarHeight">
<ion-row class="ion-justify-content-between calendar-tool-tip">
<ion-row class="ion-align-items-center">
<!-- Move back one screen of the slides -->
<div class="arrow">
<button (click)="back()" class="btn-no-color" >
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon>
</button>
</div>
<!-- Move forward one screen of the slides -->
<h2 class="capitaliseText">{{ viewTitle }}</h2>
</ion-col>
<!-- Move forward one screen of the slides -->
<ion-col size="2">
<ion-button fill="clear" (click)="next()">
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
</ion-button>
</ion-col>
</ion-row>
<!-- <div class="drop-down">
<ion-icon slot="icon-only" class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
<div class="drop-down-container">
<ul>
<li *ngFor="let month of monthList" (click)="dropDownChangeDate(month.id)" >{{ month.name }}</li>
</ul>
</div>
</div> -->
<!-- Move forward one screen of the slides -->
<div (click)="next()" class="arrow">
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
</div>
</ion-row>
<ion-row class="ion-align-items-center">
<button *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons d-md-none btn-no-color">
<ion-icon src="assets/images/icons-profile-calendar-md.svg">ddddddd</ion-icon>
</button>
<button *ngIf="profile == 'pr' " (click)="changeProfile()" class="btn-no-color">
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg">dddddddd</ion-icon>
</button>
<button class="btn-no-color" (click)="viewEventsToApprove()">
<ion-icon class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
</button>
<button class="btn-no-color" (click)="clearContact();openAddEvent();">
<ion-icon class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
</button>
</ion-row>
</ion-row>
<table class="custom-calendar-header">
@@ -228,15 +285,17 @@
>
</calendar>
<!-- Adding a customized ng-template -->
<!-- Adding a customized ng-template -->
<ng-template #template let-view="view" let-row="row" let-col="col">
<div [class.with-event]="view.dates[row*7+col].events.length">
{{view.dates[row*7+col].label}}
<div class="indicator-container">
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
</div>
<div [className]="currentDayEventDisplayBorder(view.dates, row*7+col)" class="d-flex justify-center align-center" [class.with-event]="view.dates[row*7+col].events.length">
<div class="day">
{{ view.dates[row*7+col].label }}
</div>
</div>
</ng-template>
</ng-template>
</div>
</div>
@@ -270,10 +329,11 @@
<!-- List -->
<ul *ngIf="showTimelineFilterState">
<li [class.active]="timelineFilterState == 'Todos' " (click)="timelineFilter('Todos')">Todos</li>
<li [class.active]="timelineFilterState == 'Oficial' " (click)="timelineFilter('Oficial')">Oficial</li>
<li [class.active]="timelineFilterState == 'Pessoal' " (click)="timelineFilter('Pessoal')">Pessoal</li>
<li [class.active]="segment == 'Combinado' " (click)="changeSegment('Combinado')">Todos</li>
<li [class.active]="segment == 'Oficial' " (click)="changeSegment('Oficial')">Oficial</li>
<li [class.active]="segment == 'Pessoal' " (click)="changeSegment('Pessoal')">Pessoal</li>
</ul>
</ion-row>
</ion-row>
+129 -33
View File
@@ -351,6 +351,7 @@ export class AgendaPage implements OnInit {
})
} catch (error) {
//
this.selectFirstEventOfTheDay();
}
}, timeout);
@@ -474,10 +475,6 @@ export class AgendaPage implements OnInit {
this.showTimelineFilterState = false;
/* if( profile =='md'){
console.log('eventsList: ', eventsList);
} */
eventsList.forEach((element, eventIndex) => {
// timeline start
@@ -491,7 +488,6 @@ export class AgendaPage implements OnInit {
console.log('mdEvent:', element,eventIndex);
}
// console.log( element.CalendarName);
events.push({
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex, profile),
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
@@ -502,18 +498,22 @@ export class AgendaPage implements OnInit {
},
id: element.EventId,
index: eventIndex,
profile: profile
profile: profile,
CalendarName: element.CalendarName,
});
});
// this.onCurrentChanged(this.eventSelectedDate);
return events;
}
eventFilter(){}
loadRangeEvents(startTime: Date, endTime: Date){
this.eventSelectedDate = new Date(startTime);
this.showLoader = true;
if(window.innerWidth < 1024){
@@ -526,7 +526,7 @@ export class AgendaPage implements OnInit {
this.eventSource=[];
if(this.profile == "mdgpr"){
if(this.profile == "mdgpr") {
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
response => {
@@ -543,13 +543,15 @@ export class AgendaPage implements OnInit {
allDay: false,
event: element,
calendarName: element.CalendarName,
profile: 'md'
profile: 'md',
id: element.EventId,
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
this.events = list;
// optional
this.TimelineMD = list;
this.myCal.update();
@@ -560,11 +562,10 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}
else{
else {
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
response => {
@@ -582,7 +583,8 @@ export class AgendaPage implements OnInit {
allDay: false,
event: element,
calendarName: element.CalendarName,
profile: 'pr'
profile: 'pr',
id: element.EventId,
});
});
@@ -596,11 +598,13 @@ export class AgendaPage implements OnInit {
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}
@@ -609,28 +613,33 @@ export class AgendaPage implements OnInit {
case "Pessoal":
//Inicializa o array eventSource
this.eventSource=[];
if(this.profile == "mdgpr"){
if(this.profile == "mdgpr") {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventSource=[];
this.eventsListPessoal= [];
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
// loop
this.eventsListPessoal.forEach((element, eventIndex) => {
this.eventSource.push({
title: element.Subject,
startTime: new Date(element.StartDate),
endTime: new Date(element.EndDate),
allDay: false,
event: element,
profile: 'md'
calendarName: element.CalendarName,
profile: 'md',
id: element.EventId,
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md');
const list = this.timelineFilter(this.timelineFilterState, this.eventsListPessoal, 'md');
this.events = list;
this.TimelineMD = list;
this.myCal.update();
this.myCal.loadEvents();
@@ -654,12 +663,25 @@ export class AgendaPage implements OnInit {
endTime: new Date(element.EndDate),
allDay: false,
event: element,
profile: 'pr'
profile: 'pr',
id: element.EventId,
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsListPessoal, 'pr');
this.events = list;
// optional
this.TimelinePR = list;
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}
break;
@@ -667,10 +689,13 @@ export class AgendaPage implements OnInit {
case "Oficial":
//Inicializa o array eventSource
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventsListOficial = [];
if(this.profile == "mdgpr") {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({
title: element.Subject,
@@ -678,11 +703,12 @@ export class AgendaPage implements OnInit {
endTime: new Date(element.EndDate),
allDay: false,
event: element,
profile: 'pr'
profile: 'md',
id: element.EventId,
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
const list = this.timelineFilter(this.timelineFilterState, this.eventsListOficial, 'md');
this.events = list;
this.TimelinePR = list;
@@ -696,7 +722,7 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}else{
} else {
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
@@ -707,12 +733,27 @@ export class AgendaPage implements OnInit {
endTime: new Date(element.EndDate),
allDay: false,
event: element,
profile: 'pr'
profile: 'pr',
id: element.EventId,
});
});
const list = this.timelineFilter(this.timelineFilterState, this.eventsListOficial, 'pr');
this.events = list;
// optional
this.TimelinePR = list;
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
}
break;
@@ -731,8 +772,15 @@ export class AgendaPage implements OnInit {
this.TimelineMD = [];
this.eventsList = response;
// loop
if(this.segment == 'Oficial') {
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
} else if (this.segment == 'Pessoal') {
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
} else {
this.eventsList = response;
}
// loop
this.eventsList.forEach((element, eventIndex) => {
// calendar
@@ -744,7 +792,8 @@ export class AgendaPage implements OnInit {
allDay: false,
event: element,
calendarName: element.CalendarName,
profile: 'md'
profile: 'md',
id: element.EventId,
});
});
@@ -768,7 +817,14 @@ export class AgendaPage implements OnInit {
this.TimelinePR = [];
this.eventsList = response;
if(this.segment == 'Oficial') {
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
} else if (this.segment == 'Pessoal') {
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
} else {
this.eventsList = response;
}
this.eventsList.forEach((element, eventIndex) => {
// calendar
@@ -780,7 +836,8 @@ export class AgendaPage implements OnInit {
allDay: false,
event: element,
calendarName: element.CalendarName,
profile:'pr'
profile:'pr',
id: element.EventId,
});
});
@@ -796,15 +853,41 @@ export class AgendaPage implements OnInit {
this.centralizeTimeline(500);
this.showLoader = false;
});
}
}
// for timeline select the first event in the timeline
selectFirstEventOfTheDay(){
setTimeout(()=>{
let sortedDate = this.eventSource.sort((a,b) =>{
return (b.startTime) -(a.startTime);
});
let filterDate = sortedDate.filter((e) => {
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
});
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
const scrollContainer = document.querySelector('.timeline-wrapper');
scrollContainer.scroll({
top: firstEventStartHours*60,
left: 0,
behavior: 'smooth'
})
}, 500);
}
actions(){
}
actions(){}
doRefresh(ev: any){
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
@@ -1064,4 +1147,17 @@ export class AgendaPage implements OnInit {
this.postEvent = false;
}
async changeSegment(segments: "Combinado" | "Pessoal" | "Oficial") {
this.segment = segments;
if(segments=='Combinado'){
this.timelineFilterState = 'Todos'
} else {
this.timelineFilterState = segments
}
}
}
@@ -133,51 +133,51 @@
</div>
</div>
<div class="width-100">
<div class="container-div width-50">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
<div class="container-div width-100">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipants();showAttendees=true">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
<div class="add-people" (click)="addParticipants();showAttendees=true">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
<div class="container-div width-50">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipantsCC();showAttendees=true">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
</div>
</div>
<div class="container-div width-100">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people" (click)="addParticipantsCC();showAttendees=true">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
</div>
</div>
<div class="container-div width-100 pb-20">
@@ -71,6 +71,7 @@ export class EditEventPage implements OnInit {
ngOnInit() {
window.onresize = (event) => {
// if not mobile remove all component
if( window.innerWidth >= 800){
+1 -1
View File
@@ -39,7 +39,7 @@
<div class="meeting-description"> "{{currentEvent}}"</div>
</div> -->
<div class="conteiner-box" ng-swipe-up="swipe($event)">
<div class="conteiner-box px-20" ng-swipe-up="swipe($event)">
<div class="schedule">
<div class="schedule-header">
<div class="title">
@@ -183,7 +183,7 @@
</div>
<div class="aside-righ">
<div class="aside-righ flex-grow-1">
<app-attendee-modal class=" d-flex flex-column height-100"
*ngIf="showAttendees"
[taskParticipants]="taskParticipants"
@@ -81,6 +81,10 @@ export class BookMeetingModalPage implements OnInit {
this.modalController.dismiss(null);
}
saveTask(){
// issue12323423
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.eventBody={
BodyType: '1',
Text: this.postData.Body.Text,
@@ -95,7 +99,7 @@ export class BookMeetingModalPage implements OnInit {
StartDate: this.postData.StartDate,
EndDate: this.postData.EndDate,
EventType: 'Reunião',
Attendees: this.eventAttendees,
Attendees: Attendees,
IsMeeting: false,
IsRecurring: false,
AppointmentState: 0,
@@ -117,6 +121,8 @@ export class BookMeetingModalPage implements OnInit {
async addParticipants(){
this.adding = "intervenient";
if(window.innerWidth <= 800){
const modal = await this.modalController.create({
component: AddParticipantsModalPage,
+6 -4
View File
@@ -168,7 +168,7 @@ export class SearchPage implements OnInit {
/**
* @description Basic search
*/
basicSearch(){
basicSearch(){
if(window.location.pathname == '/home/agenda'){
@@ -205,9 +205,12 @@ export class SearchPage implements OnInit {
this.showLoader = true;
this.searchCategories = [];
this.searchDocuments = [];
this.showSearchDocuments = [];
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => {
e['Active'] = false;
@@ -234,14 +237,12 @@ export class SearchPage implements OnInit {
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => {
e['Active'] = false;
this.searchCategories.push(e)
});
// bind respose
this.sortArrayISODate(res.Documents).forEach(e => {
this.searchDocuments.push(e)
@@ -259,6 +260,7 @@ export class SearchPage implements OnInit {
this.showLoader = false;
this.loadWordCloud();
});
} else if (window.location.pathname == '/home/publications'){
this.showLoader = true;