mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'feature/calendar' of https://bitbucket.org/equilibriumito/gabinete-digital into developer-c
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<div class="bg-blue">
|
||||
<div class="main-content">
|
||||
<!-- Toolbar -->
|
||||
<ion-progress-bar class="calendar-progress-bar" type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<div>
|
||||
<!-- Calendar is here -->
|
||||
<div [ngSwitch]="segment">
|
||||
@@ -224,10 +225,11 @@
|
||||
|
||||
<!-- Calendar currente date -->
|
||||
<ion-row class="timeline-header ion-justify-content-between ion-align-items-center currente-date-timelien">
|
||||
|
||||
<ion-row class="timeline-date align-center">
|
||||
<ion-icon *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false" class="collaps" src="assets/images/icons-collaps-up.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="!showCalendar" (click)="calendarHeight='347px';showCalendar=true" class="collaps" src="assets/images/icons-collaps-down.svg" ></ion-icon>
|
||||
</ion-row>
|
||||
<ion-row class="timeline-date align-center">
|
||||
<span *ngIf="timelineIsCurrentDate()">Hoje, </span> {{ timelineDate }}
|
||||
</ion-row>
|
||||
<ion-row class="filter ion-align-items-center">
|
||||
@@ -242,15 +244,15 @@
|
||||
</ul>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-content class="timeline">
|
||||
<ion-content id="timeline-conteiner" class="timeline">
|
||||
|
||||
<!-- Progress bar -->
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
@@ -479,4 +479,11 @@ td.monthview-primary-with-event {
|
||||
background: #ebebeb;
|
||||
margin: 13px 20px;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
|
||||
.calendar-progress-bar{
|
||||
position: absolute;
|
||||
width: calc(100% - 20px);
|
||||
margin-left: 10px;
|
||||
}
|
||||
@@ -55,21 +55,6 @@ export class AgendaPage implements OnInit {
|
||||
showCalendar: boolean;
|
||||
calendarHeight: string;
|
||||
|
||||
// timeline
|
||||
monthList = [
|
||||
{ name: 'Janeiro', id: 'Jan' },
|
||||
{ name: 'Fevereiro', id: 'Feb' },
|
||||
{ name: 'Março', id: 'Mar' },
|
||||
{ name: 'Abril', id: 'Apr' },
|
||||
{ name: 'Maio', id: 'May' },
|
||||
{ name: 'Junho', id: 'June' },
|
||||
{ name: 'Julho', id: 'July' },
|
||||
{ name: 'Agosto', id: 'Aug' },
|
||||
{ name: 'Setembro', id: 'Sept' },
|
||||
{ name: 'Outubro', id: 'Oct' },
|
||||
{ name: 'Novembro', id: 'Nov' },
|
||||
{ name: 'Dezembro', id: 'Dec' }
|
||||
]
|
||||
|
||||
// for timeline
|
||||
events: CalendarEvent[] = [];
|
||||
@@ -155,10 +140,12 @@ export class AgendaPage implements OnInit {
|
||||
//Go to the next view of the calendar month/week/day
|
||||
next(){
|
||||
this.myCal.slideNext();
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
//Go to the previous view of the calendar
|
||||
back(){
|
||||
this.myCal.slidePrev();
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
//Shows the title of your view
|
||||
onViewTitleChanged(title){
|
||||
@@ -276,20 +263,39 @@ export class AgendaPage implements OnInit {
|
||||
// auto scroll timeline
|
||||
setTimeout(() => {
|
||||
const timelineMarker = document.querySelector('.cal-current-time-marker');
|
||||
const timelineContainer = document.querySelectorAll('ion-content')[2];
|
||||
|
||||
const timelineContainer = document.querySelector('ion-content#timeline-conteiner');
|
||||
|
||||
const shadowRoot = timelineContainer.shadowRoot;
|
||||
|
||||
const scrollContainer = shadowRoot.querySelector('main');
|
||||
|
||||
<<<<<<< HEAD
|
||||
scrollContainer.scrollTop = timelineMarker['offsetTop'] - ((scrollContainer.offsetHeight/2) - 60);
|
||||
=======
|
||||
try {
|
||||
scrollContainer.scroll({
|
||||
top: timelineMarker['offsetTop'] - ((scrollContainer.offsetHeight/2) - 60),
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
} catch (error) {
|
||||
//
|
||||
}
|
||||
|
||||
>>>>>>> 23f5e954c97e86ebfe04040bd90bbf2a7461da2d
|
||||
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timelineIsCurrentDate(): Boolean {
|
||||
<<<<<<< HEAD
|
||||
return true;
|
||||
//return formatDate(new Date(),'dd MMMM yyyy', 'pt') == formatDate(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
|
||||
=======
|
||||
return momentG(new Date(),'dd MMMM yyyy', 'pt') == momentG(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
|
||||
>>>>>>> 23f5e954c97e86ebfe04040bd90bbf2a7461da2d
|
||||
}
|
||||
|
||||
// for timeline
|
||||
@@ -408,6 +414,9 @@ export class AgendaPage implements OnInit {
|
||||
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.eventsList = response;
|
||||
// loop
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
@@ -439,6 +448,9 @@ export class AgendaPage implements OnInit {
|
||||
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 => {
|
||||
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = response;
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
this.eventSource.push({
|
||||
@@ -471,23 +483,29 @@ export class AgendaPage implements OnInit {
|
||||
this.eventSource=[];
|
||||
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.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element
|
||||
});
|
||||
|
||||
this.eventSource=[];
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element
|
||||
});
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.showLoader = false;
|
||||
});
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.showLoader = false;
|
||||
});
|
||||
|
||||
}
|
||||
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 => {
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
@@ -510,7 +528,8 @@ export class AgendaPage implements OnInit {
|
||||
this.eventSource=[];
|
||||
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.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventSource=[];
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -526,6 +545,7 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
}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");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
|
||||
Reference in New Issue
Block a user