mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
merge brunch feature/calendar
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
export class TopSearch {
|
||||
|
||||
Documents: {
|
||||
Text: string;
|
||||
Hits: number;
|
||||
}[] = [];
|
||||
|
||||
}
|
||||
@@ -35,16 +35,27 @@
|
||||
|
||||
</ion-row>
|
||||
<ion-row class="ion-align-items-center">
|
||||
<div class="arrow">
|
||||
<ion-icon *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons" slot="icon-only"src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
||||
<ion-icon *ngIf="profile == 'pr' " (click)="changeProfile()" class="right-icons" slot="icon-only"src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-icon *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
||||
<ion-icon *ngIf="profile == 'pr' " (click)="changeProfile()" class="right-icons" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||
<ion-icon (click)="viewEventsToApprove()" class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon (click)="openAddEvent()" class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
|
||||
<table class="custom-calendar-header">
|
||||
<thead>
|
||||
<th>S</th>
|
||||
<th>T</th>
|
||||
<th>Q</th>
|
||||
<th>Q</th>
|
||||
<th>S</th>
|
||||
<th>S</th>
|
||||
<th>D</th>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
<calendar class="calendar-component"
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
@@ -62,7 +73,7 @@
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [className]="currentDayEventDisplayBorder(view.dates, row*7+col)" [class.with-event]="view.dates[row*7+col].events.length">
|
||||
@@ -94,7 +105,20 @@
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
|
||||
<table class="custom-calendar-header">
|
||||
<thead>
|
||||
<th>S</th>
|
||||
<th>T</th>
|
||||
<th>Q</th>
|
||||
<th>Q</th>
|
||||
<th>S</th>
|
||||
<th>S</th>
|
||||
<th>D</th>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<calendar class="calendar-component"
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
@@ -145,8 +169,21 @@
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
|
||||
|
||||
<table class="custom-calendar-header">
|
||||
<thead>
|
||||
<th>S</th>
|
||||
<th>T</th>
|
||||
<th>Q</th>
|
||||
<th>Q</th>
|
||||
<th>S</th>
|
||||
<th>S</th>
|
||||
<th>D</th>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<calendar class="calendar-component"
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
@@ -183,16 +220,23 @@
|
||||
<ion-row class="timeline-date">
|
||||
<span *ngIf="timelineIsCurrentDate()">Hoje, </span> {{ timelineDate }}
|
||||
</ion-row>
|
||||
<!-- <ion-row class="filter ion-align-items-center">
|
||||
<div class="filter-name">Todos</div>
|
||||
<ion-icon class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
|
||||
</ion-row> -->
|
||||
<ion-row class="filter ion-align-items-center">
|
||||
<div class="filter-name">{{timelineFilterState}}</div>
|
||||
<!-- Icon -->
|
||||
<ion-icon (click)="showTimelineFilterState=true" class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
|
||||
<!-- 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>
|
||||
</ul>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-content class="timeline">
|
||||
|
||||
<!-- Progress bar -->
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
@@ -202,7 +246,7 @@
|
||||
</ion-refresher>
|
||||
|
||||
<!-- Timeline -->
|
||||
<div *ngIf="showTimeline">
|
||||
<div class="timeline-container" *ngIf="showTimeline">
|
||||
<mwl-demo-utils-calendar-header class="timeline"
|
||||
[(view)]="view"
|
||||
[(viewDate)]="viewDate"
|
||||
@@ -220,6 +264,4 @@
|
||||
</mwl-calendar-day-view>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
@@ -1,8 +1,4 @@
|
||||
.indicator-container {
|
||||
padding-left: 0.5rem;
|
||||
padding-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
|
||||
.event-indicator {
|
||||
background: #333;
|
||||
width: 5px;
|
||||
@@ -11,17 +7,31 @@
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
ion-slide{
|
||||
td{
|
||||
div {
|
||||
padding-left: 7px;
|
||||
border-radius: 28px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
height: 25px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:host ::ng-deep {
|
||||
.monthview-primary-with-event {
|
||||
background-color: white !important;
|
||||
/* background-color: white !important; */
|
||||
}
|
||||
|
||||
.monthview-current{
|
||||
background-color: red;
|
||||
/* background-color: red; */
|
||||
border-bottom: 1px solid lightskyblue !important;
|
||||
}
|
||||
.monthview-selected {
|
||||
background-color: lightskyblue !important;
|
||||
/* background-color: lightskyblue !important; */
|
||||
}
|
||||
.item{
|
||||
/* background: red !important; */
|
||||
@@ -35,16 +45,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.with-event {
|
||||
background-color: #fff;
|
||||
border-radius: 21px;
|
||||
border-left: 3px solid #ffb703;
|
||||
border-bottom: none;
|
||||
border-right: 3px solid #f05d5e;
|
||||
color: black;
|
||||
margin: 0px auto;
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
@@ -255,7 +255,9 @@ label{
|
||||
right: 14px;
|
||||
color: #e16817;
|
||||
}
|
||||
|
||||
td.monthview-primary-with-event {
|
||||
background-color: white !important;
|
||||
}
|
||||
.header-title{
|
||||
width: 300px;
|
||||
font-family: Roboto;
|
||||
@@ -334,31 +336,6 @@ label{
|
||||
|
||||
|
||||
|
||||
.currente-date-timelien{
|
||||
padding: 10px 20px;
|
||||
.timeline-date{
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.filter{
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
.filter-name{
|
||||
color: #0d89d1;
|
||||
}
|
||||
ion-icon{
|
||||
font-size: 35px;
|
||||
color: #0d89d1;
|
||||
}
|
||||
.filter-name{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
margin-left: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.drop-down{
|
||||
@@ -400,7 +377,7 @@ label{
|
||||
padding: 0px 0px;
|
||||
}
|
||||
|
||||
.right-icons{
|
||||
.right-icons, .calendar-profile{
|
||||
padding: 0px 9px
|
||||
}
|
||||
|
||||
@@ -411,5 +388,69 @@ label{
|
||||
|
||||
|
||||
.calendar-tool-tip{
|
||||
padding: 17px 10px 0px 10px;
|
||||
}
|
||||
padding: 20px 10px 30px 10px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.custom-calendar-header{
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
thead{
|
||||
th{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
color: rgba(52, 72, 94, 0.54);
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.currente-date-timelien{
|
||||
padding: 10px 20px;
|
||||
.timeline-date{
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.filter{
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
ion-icon{
|
||||
font-size: 35px;
|
||||
color: #0d89d1;
|
||||
}
|
||||
.filter-name{
|
||||
color: #0d89d1;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
ul{
|
||||
background-color: white !important;
|
||||
position: absolute;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
margin-top: 140px;
|
||||
padding: 0px;
|
||||
box-shadow: 0px 0px 10px gray !important;
|
||||
border-radius: 5px;
|
||||
width: 96px;
|
||||
z-index: 1000000;
|
||||
li{
|
||||
padding: 5px 10px;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
li.active{
|
||||
background-color: rgba(66, 185, 254, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+187
-117
@@ -68,24 +68,11 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
showTimeline: boolean= false;
|
||||
|
||||
events: CalendarEvent[] = [
|
||||
/* {
|
||||
title: '123',
|
||||
start: setHours(setMinutes(new Date(), 0), 3),
|
||||
color: {
|
||||
primary: 'red',
|
||||
secondary: 'yellow'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '123123',
|
||||
start: setHours(setMinutes(new Date(), 0), 5),
|
||||
color: {
|
||||
primary: 'red',
|
||||
secondary: 'yellow'
|
||||
},
|
||||
}, */
|
||||
];
|
||||
// for timeline
|
||||
events: CalendarEvent[] = [];
|
||||
// timeline filter
|
||||
timelineFilterState: string = 'Todos';
|
||||
showTimelineFilterState: boolean= false;
|
||||
|
||||
/* List of events of our calendar */
|
||||
eventSource = [];
|
||||
@@ -131,14 +118,12 @@ export class AgendaPage implements OnInit {
|
||||
private router: Router,
|
||||
private alertCrontroller: AlertService
|
||||
) {
|
||||
this.timelineDate = formatDate(new Date,'dd MMMM yyyy', 'pt');
|
||||
|
||||
setTimeout(()=>{
|
||||
// console.log(JSON.stringify(this.events));
|
||||
// console.log(this.events);
|
||||
},5000)
|
||||
// timeline inicial date
|
||||
this.timelineDate = new Date().toLocaleString();
|
||||
|
||||
//this.timelineDate = formatDate(new Date,'dd MMMM yyyy', 'pt');
|
||||
|
||||
// console.log(setHours(setMinutes(new Date(), 0), 12))
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
@@ -151,6 +136,7 @@ export class AgendaPage implements OnInit {
|
||||
setCookie('searchModalAPPType','0', 99999999);
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -170,11 +156,8 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
timelineIsCurrentDate(): Boolean {
|
||||
return formatDate(new Date(),'dd MMMM yyyy', 'pt') == formatDate(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
|
||||
}
|
||||
|
||||
//Go to the next view of the calendar month/week/day
|
||||
@@ -190,33 +173,6 @@ export class AgendaPage implements OnInit {
|
||||
this.viewTitle = title;
|
||||
}
|
||||
|
||||
currentDayEventDisplayBorder(day: any, id: any){
|
||||
|
||||
const events = day[id].events;
|
||||
if (events.length == 0) {
|
||||
return "";
|
||||
} else if (events.length >= 1) {
|
||||
|
||||
/** @description store all event type */
|
||||
let eventType = {};
|
||||
let eventTypeNum: number;
|
||||
|
||||
events.forEach(element => {
|
||||
eventType[element.calendarName] = 1;
|
||||
});
|
||||
|
||||
eventTypeNum = (Object.keys(eventType)).length
|
||||
|
||||
if (eventTypeNum == 2) {
|
||||
return 'calendar-event-type-both';
|
||||
} else {
|
||||
return 'calendar-event-type-'+(Object.keys(eventType))[0];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
// Show information of the event for timeline
|
||||
eventClicked({ event }: { event: CalendarEvent }): void {
|
||||
console.log('Event clicked', event);
|
||||
@@ -234,18 +190,20 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
onCurrentChanged = (ev: Date) => {
|
||||
// timeline change date
|
||||
this.timelineDate = formatDate(ev,'dd MMMM yyyy', 'pt');
|
||||
this.viewDate = new Date(formatDate(ev,'yyyy-MM-dd', 'pt'));
|
||||
this.timelineDate = new Date(ev).toLocaleString();
|
||||
this.viewDate = new Date(ev);
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
|
||||
this.centralizeTimeline(500);
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
};
|
||||
|
||||
// changedate
|
||||
dropDownChangeDate(id: string){
|
||||
|
||||
const currentCandarDayYear = formatDate(this.eventSelectedDate,'dd -- yyyy', 'pt');
|
||||
/* const currentCandarDayYear = formatDate(this.eventSelectedDate,'dd -- yyyy', 'pt');
|
||||
const newDate = new Date(currentCandarDayYear.replace('--',id));
|
||||
this.onCurrentChanged(newDate);
|
||||
this.onCurrentChanged(newDate); */
|
||||
}
|
||||
|
||||
/* onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => {
|
||||
@@ -293,23 +251,158 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
timeLineTemplate(startTime: string, eventlocation: string, eventDiscription: any, calendarName: string, subject: string): string{
|
||||
|
||||
// for calendar
|
||||
currentDayEventDisplayBorder(day: any, id: any){
|
||||
|
||||
const events = day[id].events;
|
||||
if (events.length == 0) {
|
||||
return "";
|
||||
} else if (events.length >= 1) {
|
||||
|
||||
/** @description store all event type */
|
||||
let eventType = {};
|
||||
let eventTypeNum: number;
|
||||
|
||||
events.forEach(element => {
|
||||
eventType[element.calendarName] = 1;
|
||||
});
|
||||
|
||||
eventTypeNum = (Object.keys(eventType)).length
|
||||
|
||||
if (eventTypeNum == 2) {
|
||||
return ` calendar-event-border calendar-${this.profile}-event-type-both`;
|
||||
} else {
|
||||
return ` calendar-event-border calendar-${this.profile}-event-type-`+(Object.keys(eventType))[0];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
// for timeline
|
||||
centralizeTimeline(timeout: number) {
|
||||
// auto scroll timeline
|
||||
setTimeout(() => {
|
||||
const timelineMarker = document.querySelector('.cal-current-time-marker');
|
||||
const timelineContainer = document.querySelectorAll('ion-content')[2];
|
||||
const shadowRoot = timelineContainer.shadowRoot;
|
||||
|
||||
const scrollContainer = shadowRoot.querySelector('main');
|
||||
|
||||
scrollContainer.scrollTop = timelineMarker['offsetTop'] - ((scrollContainer.offsetHeight/2) - 60);
|
||||
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timelineIsCurrentDate(): Boolean {
|
||||
return true;
|
||||
//return formatDate(new Date(),'dd MMMM yyyy', 'pt') == formatDate(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timeLineTemplate(startTime: string, eventlocation: string, eventDiscription: any, calendarName: string, subject: string, startTimeWisthS: string, endTime: string, eventIndex: number): string{
|
||||
|
||||
const startHours = parseInt(startTimeWisthS.split(':')[0]);
|
||||
const startMinutos = parseInt(startTimeWisthS.split(':')[1]);
|
||||
|
||||
const endHours = parseInt(endTime.split(':')[0]);
|
||||
const endMinutos = parseInt(endTime.split(':')[1]);
|
||||
|
||||
let top = '0';
|
||||
|
||||
if(startHours < endHours){
|
||||
if (startMinutos != 0 ){
|
||||
top = `${ Math.abs((startMinutos - 60)) }`
|
||||
}
|
||||
}
|
||||
|
||||
return `
|
||||
<div class="timeline-box timeline-box-${calendarName}">
|
||||
<div class="timeline-box timeline-box-event-${eventIndex} timeline-${this.profile}-box-${calendarName} calendar-top${top}">
|
||||
<div>
|
||||
<span class="timeline-start-time">${startTime}</span><span class="timeline-location">${eventlocation}</span>
|
||||
<span class="timeline-start-time">${startTimeWisthS}</span><span class="timeline-location">${eventlocation}</span>
|
||||
</div>
|
||||
<div class="timeline-event-discription">
|
||||
${subject}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timelineBoxCorrectHeight(timeout){
|
||||
|
||||
setTimeout(()=>{
|
||||
this.eventSource.forEach((el, eventIndex)=>{
|
||||
|
||||
const startEvent = new Date(el.startTime);
|
||||
const endEvent = new Date(el.endTime);
|
||||
|
||||
var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60;
|
||||
const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60;
|
||||
|
||||
document.querySelectorAll('.timeline-box').forEach(ele => {
|
||||
|
||||
if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
},timeout)
|
||||
}
|
||||
|
||||
// for timeline
|
||||
|
||||
timelineFilter(calendarName){
|
||||
|
||||
this.timelineFilterState = calendarName;
|
||||
|
||||
// remove all event
|
||||
this.events = [];
|
||||
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
// timeline start
|
||||
const startHours = new Date(element.StartDate).getHours().toLocaleString();
|
||||
const EndHours = new Date(element.EndDate).getHours().toLocaleString();
|
||||
|
||||
const startHoursOtherFormate = new Date(element.StartDate).getHours().toLocaleString()+':'+new Date(element.StartDate).getMinutes().toLocaleString();
|
||||
const EndHoursOtherFormate = formatDate(new Date(element.EndDate), 'HH:mm', 'pt');
|
||||
|
||||
if (element.CalendarName == calendarName) {
|
||||
this.events.push({
|
||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex),
|
||||
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
|
||||
end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
|
||||
color: {
|
||||
primary: 'white',
|
||||
secondary: 'white'
|
||||
},
|
||||
id: element.EventId
|
||||
});
|
||||
} else if (calendarName == 'Todos'){
|
||||
this.events.push({
|
||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex),
|
||||
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
|
||||
end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
|
||||
color: {
|
||||
primary: 'white',
|
||||
secondary: 'white'
|
||||
},
|
||||
id: element.EventId
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.onCurrentChanged(this.eventSelectedDate);
|
||||
//
|
||||
this.showTimelineFilterState = false;
|
||||
}
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date){
|
||||
|
||||
console.log('Update date');
|
||||
console.log('start ',startTime,' end', endTime)
|
||||
|
||||
this.showTimeline = false;
|
||||
this.showLoader = true;
|
||||
@@ -319,15 +412,14 @@ export class AgendaPage implements OnInit {
|
||||
case "Combinada":
|
||||
//Inicializa o array eventSource
|
||||
this.eventSource=[];
|
||||
this.events=[];
|
||||
|
||||
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd', 'pt'), formatDate(endTime, 'yyyy-MM-dd', 'pt')).subscribe(
|
||||
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(
|
||||
response => {
|
||||
this.eventsList = response;
|
||||
// loop
|
||||
this.eventsList.forEach(element => {
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -337,39 +429,27 @@ export class AgendaPage implements OnInit {
|
||||
event: element,
|
||||
calendarName: element.CalendarName
|
||||
});
|
||||
|
||||
// timeline start
|
||||
const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
|
||||
const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
|
||||
|
||||
this.events.push({
|
||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject),
|
||||
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
|
||||
end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
|
||||
color: {
|
||||
primary: 'white',
|
||||
secondary: 'white'
|
||||
},
|
||||
id: element.EventId
|
||||
});
|
||||
// timeline end
|
||||
|
||||
});
|
||||
|
||||
// this.timelineFilter(this.timelineFilterState);
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(
|
||||
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(
|
||||
response => {
|
||||
this.eventsList = response;
|
||||
this.eventsList.forEach(element => {
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
@@ -379,30 +459,18 @@ export class AgendaPage implements OnInit {
|
||||
calendarName: element.CalendarName
|
||||
});
|
||||
|
||||
// timeline start
|
||||
const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
|
||||
const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
|
||||
|
||||
this.events.push({
|
||||
|
||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject),
|
||||
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
|
||||
end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
|
||||
color: {
|
||||
primary: 'white',
|
||||
secondary: 'white'
|
||||
},
|
||||
id: element.EventId
|
||||
});
|
||||
// timeline end
|
||||
|
||||
});
|
||||
|
||||
// this.timelineFilter(this.timelineFilterState);
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -411,7 +479,7 @@ export class AgendaPage implements OnInit {
|
||||
//Inicializa o array eventSource
|
||||
this.eventSource=[];
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(response => {
|
||||
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(response => {
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
@@ -428,7 +496,7 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(response => {
|
||||
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(response => {
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
@@ -450,7 +518,7 @@ export class AgendaPage implements OnInit {
|
||||
//Inicializa o array eventSource
|
||||
this.eventSource=[];
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(res => {
|
||||
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(res => {
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
@@ -466,7 +534,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(res => {
|
||||
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(res => {
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
@@ -495,12 +563,13 @@ export class AgendaPage implements OnInit {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
setTimeout(() => {
|
||||
ev.target.complete();
|
||||
}, 250);
|
||||
}, 250)
|
||||
}
|
||||
showAlert(){
|
||||
this.alertCrontroller.presentAlert("Funcionalidade em desenvolvimento.");
|
||||
}
|
||||
changeProfile(){
|
||||
|
||||
if(this.profile == "mdgpr"){
|
||||
console.log('pr');
|
||||
this.profile ="pr";
|
||||
@@ -511,6 +580,10 @@ export class AgendaPage implements OnInit {
|
||||
this.profile ="mdgpr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
// change header profile picture
|
||||
window['header'](this.profile);
|
||||
|
||||
}
|
||||
|
||||
async openAddEvent() {
|
||||
@@ -519,7 +592,7 @@ export class AgendaPage implements OnInit {
|
||||
componentProps:{
|
||||
segment: this.segment,
|
||||
profile: this.profile,
|
||||
eventSelectedDate: this.eventSelectedDate,
|
||||
eventSelectedDate: this.eventSelectedDate
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
@@ -549,7 +622,7 @@ export class AgendaPage implements OnInit {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: eventId,
|
||||
eventId: eventId
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
@@ -573,8 +646,5 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,8 +56,8 @@
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione tipo"
|
||||
[(ngModel)]="postEvent.EventType"
|
||||
selectedText="{{postEvent.EventType}}"
|
||||
[(ngModel)]="postEvent.Categories[0]"
|
||||
selectedText="{{postEvent.Categories[0]}}"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione tipo"
|
||||
[(ngModel)]="postEvent.EventType"
|
||||
[(ngModel)]="postEvent.Categories[0]"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
|
||||
@@ -62,7 +62,7 @@ export class NewEventPage implements OnInit {
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
Categories: ['Reunião'],
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export class NewEventPage implements OnInit {
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
Categories: ['Reunião'],
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -62,11 +62,11 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
loginRocketChat(user: any) {
|
||||
loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": user.username,
|
||||
"password": user.password,
|
||||
"user": this.username,
|
||||
"password": this.password,
|
||||
}
|
||||
this.authService.loginChat(postData).subscribe((res: any) => {
|
||||
console.log(res.data);
|
||||
@@ -128,7 +128,7 @@ export class LoginPage implements OnInit {
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)) {
|
||||
/* this.loginRocketChat(); */
|
||||
this.loginRocketChat();
|
||||
this.storeUserIdANdToken()
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
|
||||
@@ -95,13 +95,8 @@
|
||||
<!-- most searched word-->
|
||||
<div class="most-searched-words" *ngIf="!showDocuments">
|
||||
<p class="title ion-text-center">Palavras mais pesquisadas</p>
|
||||
<div>
|
||||
<angular-tag-cloud class="world-cloud"
|
||||
[data]="data"
|
||||
[width]=width
|
||||
[height]=height
|
||||
[overflow]=true>
|
||||
</angular-tag-cloud>
|
||||
<div class="most-searched-word-container">
|
||||
123
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -197,6 +197,11 @@ ion-slide{
|
||||
text-align: center;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.most-searched-word-container{
|
||||
width: 441px;
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { SearchService } from "../../services/search.service";
|
||||
import { SearchService, } from "../../services/search.service";
|
||||
import { SearchCategory } from "src/app/models/search-category";
|
||||
import { SearchDocument } from "src/app/models/search-document";
|
||||
import { formatDate } from '@angular/common';
|
||||
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
|
||||
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
||||
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
|
||||
import WordCloud from 'src/plugin/wordcloud2.js'
|
||||
|
||||
|
||||
import { NgModel } from '@angular/forms';
|
||||
@Component({
|
||||
@@ -54,12 +56,40 @@ export class SearchPage implements OnInit {
|
||||
speed: 400,
|
||||
}
|
||||
|
||||
|
||||
list = []
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private search: SearchService) {
|
||||
this.ordinance = "recent";
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.search.mostSeachWord("10").subscribe(res=>{
|
||||
|
||||
let list = []
|
||||
|
||||
res.forEach(element => {
|
||||
list.push(Object.values(element))
|
||||
});
|
||||
|
||||
this.list = list
|
||||
|
||||
const elem = document.documentElement.querySelector('.most-searched-word-container');
|
||||
|
||||
|
||||
WordCloud(
|
||||
elem,
|
||||
{
|
||||
list: this.list,
|
||||
Family: 'Times, serif',
|
||||
gridSize: 15
|
||||
},
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Event } from '../models/event.model';
|
||||
import { Observable } from 'rxjs';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { User } from '../models/user.model';
|
||||
import { EventSearch } from "src/app/models/event-search";
|
||||
import { TopSearch } from 'src/app/models/top-search';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -52,4 +53,22 @@ export class SearchService {
|
||||
return this.http.get<EventSearch>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
mostSeachWord(size:string): Observable<TopSearch>{
|
||||
// Endpoint
|
||||
const geturl = environment.apiURL + 'search/top';
|
||||
// store params
|
||||
let params = new HttpParams();
|
||||
// set https params
|
||||
|
||||
params = params.set("size", size);
|
||||
|
||||
|
||||
const options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<TopSearch>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="div-profile">
|
||||
<ion-icon src='assets/images/icons-profile.svg'></ion-icon>
|
||||
<ion-icon *ngIf="profile == 'mdgpr' " src='assets/images/icons-profile.svg'></ion-icon>
|
||||
<ion-icon *ngIf="profile == 'pr' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -9,7 +9,15 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
})
|
||||
export class HeaderPage implements OnInit {
|
||||
|
||||
constructor(private modalController: ModalController) { }
|
||||
profile: string = 'mdgpr';
|
||||
|
||||
constructor(private modalController: ModalController) {
|
||||
|
||||
window['header'] = (profile:string) => {
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user