mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' into developer_mobilefirst
This commit is contained in:
@@ -99,12 +99,14 @@
|
||||
|
||||
<!-- 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="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 class="day-container">
|
||||
<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">
|
||||
<div class="number"> {{ view.dates[row*7+col].label }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
@@ -116,12 +118,12 @@
|
||||
</div>
|
||||
|
||||
<!-- Calendar currente date -->
|
||||
<ion-row class="timeline-header ion-justify-content-between ion-align-items-center currente-date-timelien pb-5">
|
||||
<ion-row class="timeline-header pb-0 ion-justify-content-between ion-align-items-center currente-date-timelien">
|
||||
<ion-row class="timeline-date align-center">
|
||||
<button class="btn-no-color" *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false">
|
||||
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-up.svg" ></ion-icon>
|
||||
</button>
|
||||
<button class="collaps btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='333px';showCalendar=true">
|
||||
<button class="collaps btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='317px';showCalendar=true">
|
||||
<ion-icon src="assets/images/icons-collaps-down.svg" ></ion-icon>
|
||||
</button >
|
||||
|
||||
@@ -147,7 +149,7 @@
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
<div class="pb-5 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
||||
<div>Própria</div>
|
||||
</div>
|
||||
@@ -171,7 +173,7 @@
|
||||
|
||||
<!-- Timeline -->
|
||||
<div class="height-100">
|
||||
<div class="timeline-container height-100 d-flex pt-20 pa-20 filter-{{segment}}" >
|
||||
<div class="timeline-container height-100 d-flex pt-20 pl-20 pl-20 filter-{{segment}}" >
|
||||
|
||||
<!-- <div [ngSwitch]="view" class="ss-timeline timeline-mobile flex-grow-1 d-md-none">
|
||||
<mwl-calendar-day-view
|
||||
@@ -213,18 +215,18 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 d-md-none text-black height-100 width-100 overflow-y-auto" >
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 d-md-none text-black height-100 width-100 overflow-y-auto" >
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||
|
||||
<div *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="day mt-10">
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" >
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox">
|
||||
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)" >
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event)">
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
|
||||
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||
@@ -252,22 +254,20 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||
|
||||
<div *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="day mt-10">
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="day EventListBox-day mt-10">
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" >
|
||||
|
||||
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)">
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox" >
|
||||
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event)">
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="event.endMany && !event.middle" class="time-start">--</div>
|
||||
@@ -290,25 +290,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sd-timeline flex-grow-1 d-none d-md-block timeline-md text-black pl-20 width-100 height-100 overflow-y-auto" >
|
||||
<div class="sd-timeline flex-grow-1 d-none d-md-block timeline-md text-black pl-20 pr-20 width-100 height-100 overflow-y-auto" >
|
||||
<div *ngFor="let events of TimelinePRList | keyvalue;">
|
||||
|
||||
<div *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
|
||||
<div class="day mt-10">
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" >
|
||||
<div *ngFor="let event of events.value" class="EventListBox">
|
||||
|
||||
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)">
|
||||
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event)">
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="event.endMany && !event.middle" class="time-start">--</div>
|
||||
|
||||
@@ -7,19 +7,6 @@
|
||||
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 {
|
||||
@@ -388,11 +375,13 @@ td.monthview-primary-with-event {
|
||||
}
|
||||
|
||||
|
||||
.custom-calendar-header{
|
||||
.custom-calendar-header {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
thead{
|
||||
th{
|
||||
thead {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
th {
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
color: rgba(52, 72, 94, 0.54);
|
||||
@@ -403,8 +392,6 @@ td.monthview-primary-with-event {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.currente-date-timelien{
|
||||
padding: 10px 20px;
|
||||
.timeline-date{
|
||||
@@ -706,7 +693,7 @@ app-approve-event{
|
||||
|
||||
|
||||
.fs-timeline {
|
||||
border-right: 2px solid #909090;
|
||||
border-right: 1px solid #909090;
|
||||
}
|
||||
|
||||
|
||||
@@ -721,4 +708,5 @@ app-approve-event{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+269
-315
@@ -162,7 +162,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.calendarHeight = "333px";
|
||||
this.calendarHeight = "317px";
|
||||
this.showCalendar = true;
|
||||
this.timelineDate = momentG(new Date(),'dd MMMM yyyy');
|
||||
|
||||
@@ -173,8 +173,7 @@ export class AgendaPage implements OnInit {
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.mobileComponent.showEventList = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -194,7 +193,6 @@ export class AgendaPage implements OnInit {
|
||||
window.onresize = (event) => {
|
||||
// if not table remove all component
|
||||
if( window.innerWidth <= 1024){
|
||||
console.log('mobile')
|
||||
this.cloneAllmobileComponent();
|
||||
}
|
||||
};
|
||||
@@ -204,12 +202,10 @@ 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){
|
||||
@@ -254,7 +250,6 @@ export class AgendaPage implements OnInit {
|
||||
//Show information of the event
|
||||
async onEventSelected(ev: { event: Event}){
|
||||
/* this.viewEventDetail(ev.event.EventId); */
|
||||
console.log('DOVE');
|
||||
|
||||
this.router.navigate(["/home/agenda", ev.event.EventId, 'agenda']);
|
||||
}
|
||||
@@ -266,8 +261,6 @@ export class AgendaPage implements OnInit {
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
|
||||
this.centralizeTimeline(500);
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
};
|
||||
|
||||
// changedate
|
||||
@@ -278,7 +271,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => {
|
||||
console.log('Selected time: ' + ev.selectedTime + ', hasEvents: ' + (ev.events !== undefined && ev.events.length !== 0));
|
||||
// console.log('Selected time: ' + ev.selectedTime + ', hasEvents: ' + (ev.events !== undefined && ev.events.length !== 0));
|
||||
this.eventSelectedDate2 = ev.selectedTime;
|
||||
}
|
||||
|
||||
@@ -290,7 +283,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
// for calendar
|
||||
currentDayEventDisplayBorder(day: any, id: any){
|
||||
currentDayEventDisplayBorder(day: any, id: any) {
|
||||
|
||||
const events = day[id].events;
|
||||
|
||||
@@ -318,36 +311,13 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
// for timeline
|
||||
centralizeTimeline(timeout: number) {
|
||||
// auto scroll timeline
|
||||
|
||||
if(!this.showLoader) {
|
||||
setTimeout(() => {
|
||||
const timelineMarker = document.querySelector('.cal-current-time-marker');
|
||||
const scrollContainer = document.querySelector('.timeline-wrapper');
|
||||
|
||||
try {
|
||||
scrollContainer.scroll({
|
||||
top: parseInt(timelineMarker['style']['top'].replace('px','')) - ((scrollContainer['offsetHeight']/2) - 60),
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
} catch (error) {
|
||||
//
|
||||
if(!this.showLoader) {
|
||||
//this.selectFirstEventOfTheDay();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
get CalendarCurrentDay ():any {
|
||||
|
||||
console.log(this.viewDate.getDate(), '0_0')
|
||||
/* console.log(this.viewDate.getDate(), '0_0') */
|
||||
// console.log(this.viewDate.getDate(), '0_0')
|
||||
|
||||
return this.viewDate.getDate()
|
||||
}
|
||||
|
||||
@@ -393,75 +363,6 @@ export class AgendaPage implements OnInit {
|
||||
`
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timelineBoxCorrectHeight(timeout){
|
||||
|
||||
setTimeout(()=>{
|
||||
|
||||
if(window.innerWidth <= 1024){
|
||||
this.events.forEach((el:any, eventIndex)=>{
|
||||
|
||||
const startEvent = new Date(el.startTime| el.start);
|
||||
const endEvent = new Date(el.endTime | el.end);
|
||||
|
||||
var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60;
|
||||
// const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60;
|
||||
|
||||
document.querySelectorAll('.ss-timeline .timeline-box').forEach(ele => {
|
||||
|
||||
if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
|
||||
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
} else {
|
||||
this.TimelineMD.forEach((el:any, eventIndex)=>{
|
||||
|
||||
const startEvent = new Date(el.startTime| el.start);
|
||||
const endEvent = new Date(el.endTime | el.end);
|
||||
|
||||
var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60;
|
||||
// const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60;
|
||||
|
||||
document.querySelectorAll('.fs-timeline .timeline-box').forEach(ele => {
|
||||
|
||||
if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
|
||||
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},timeout)
|
||||
|
||||
setTimeout(()=>{
|
||||
this.TimelinePR.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('.sd-timeline .timeline-box').forEach(ele => {
|
||||
|
||||
if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
|
||||
ele.setAttribute('style',`height:${minutes}px`);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
},timeout)
|
||||
}
|
||||
|
||||
// for timeline
|
||||
timelineFilter(calendarName, eventsList, profile){
|
||||
@@ -515,7 +416,7 @@ export class AgendaPage implements OnInit {
|
||||
return ((new Date(this.timelineDate)).getDate()).toString().padStart(2,'0')
|
||||
}
|
||||
|
||||
async loadRangeEvents(startTime: Date, endTime: Date){
|
||||
loadRangeEvents(startTime: Date, endTime: Date){
|
||||
|
||||
this.eventSelectedDate = new Date(startTime);
|
||||
|
||||
@@ -529,16 +430,17 @@ export class AgendaPage implements OnInit {
|
||||
case "Combinado":
|
||||
//Inicializa o array eventSource
|
||||
//this.eventSource=[];
|
||||
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then(
|
||||
|
||||
(response:any) => {
|
||||
|
||||
// calendar
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
this.eventsList = response;
|
||||
// loop
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
@@ -571,19 +473,18 @@ export class AgendaPage implements OnInit {
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
else if(this.profile == "pr" && this.loggeduser.Profile == 'MDGPR'){
|
||||
console.log('HERE PR');
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then(
|
||||
(response:any) => {
|
||||
|
||||
// calendar
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
this.eventsList = response;
|
||||
|
||||
// calendar
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
@@ -614,9 +515,53 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then(
|
||||
(response:any) => {
|
||||
|
||||
// calendar
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = response;
|
||||
|
||||
// calendar
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element,
|
||||
calendarName: element.CalendarName,
|
||||
profile: 'pr',
|
||||
id: element.EventId,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
|
||||
|
||||
this.TimelineMDList = this.eventListBox(list)
|
||||
|
||||
this.events = list;
|
||||
|
||||
this.TimelinePR = list;
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -624,7 +569,7 @@ export class AgendaPage implements OnInit {
|
||||
//Inicializa o array eventSource
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
this.eventSource=[];
|
||||
this.eventsListPessoal= [];
|
||||
@@ -659,17 +604,14 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsListPessoal = prPessoalEvents.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -697,9 +639,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -709,7 +649,7 @@ export class AgendaPage implements OnInit {
|
||||
this.eventsListOficial = [];
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
this.eventSource=[];
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
|
||||
@@ -739,13 +679,11 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
} else {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
this.eventSource=[];
|
||||
this.eventsListOficial = prOficialEvents.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -773,8 +711,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -788,16 +725,17 @@ export class AgendaPage implements OnInit {
|
||||
let counter = 0;
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).toPromise();
|
||||
|
||||
console.log('MDGPR');
|
||||
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then( (response:any) => {
|
||||
|
||||
|
||||
if(this.segment == 'Oficial') {
|
||||
this.eventsList = mdOficialEvents;
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
} else if (this.segment == 'Pessoal') {
|
||||
this.eventsList = mdPessoalEvents;
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
} else {
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
this.eventsList = response;
|
||||
}
|
||||
|
||||
this.eventSource= this.eventSource.filter(e => e.profile != 'md');
|
||||
@@ -821,8 +759,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
const MDEventList = this.timelineFilter(this.timelineFilterState, this.eventsList, 'mdgpr');
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBox(MDEventList, 'md')
|
||||
|
||||
this.events = MDEventList;
|
||||
@@ -836,22 +772,72 @@ export class AgendaPage implements OnInit {
|
||||
counter++;
|
||||
if(counter==2){
|
||||
this.showLoader = false;
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
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.eventSource = this.eventSource.filter(e => e.profile != 'pr');
|
||||
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
// calendar
|
||||
this.eventSource.push({
|
||||
index: eventIndex,
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element,
|
||||
calendarName: element.CalendarName,
|
||||
profile:'pr',
|
||||
id: element.EventId,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
this.TimelinePR = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr');
|
||||
|
||||
|
||||
this.TimelinePRList = this.eventListBox(this.TimelinePR)
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showTimelinePR = true;
|
||||
|
||||
counter++;
|
||||
|
||||
if(counter==2 || this.loggeduser.Profile == 'PR') {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
console.log('PR');
|
||||
|
||||
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
if(this.segment == 'Oficial') {
|
||||
this.eventsList = prOficialEvents;
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
} else if (this.segment == 'Pessoal') {
|
||||
this.eventsList = prPessoalEvents;
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
} else {
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
this.eventsList = response;
|
||||
}
|
||||
|
||||
this.eventSource = this.eventSource.filter(e => e.profile != 'pr');
|
||||
@@ -887,9 +873,11 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
if(counter==2 || this.loggeduser.Profile == 'PR') {
|
||||
this.showLoader = false;
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -899,193 +887,163 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
list.forEach( (event:any)=> {
|
||||
|
||||
var startDate = new Date(event.start);
|
||||
var endDate = new Date(event.end);
|
||||
var startDate: any = new Date(event.start);
|
||||
var endDate: any = new Date(event.end);
|
||||
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.manyDays = false
|
||||
|
||||
if ( (new Date (this.viewDate).getMonth()) == (new Date(event.start).getMonth()) ) {
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
var Difference_In_Days = endDate.getDate() - startDate.getDate()
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if ( endDate.getTime() > startDate.getTime() && Difference_In_Days <= 50 && !event.event.IsAllDayEvent ) {
|
||||
if (Difference_In_Days >= 1) {
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
if(nice == 'md') {
|
||||
console.log('md', event)
|
||||
}
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
|
||||
event.other = true
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
event.other = true
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
} else {
|
||||
days[day].push(event)
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
|
||||
if(e.childElementCount == 0) {
|
||||
e.parentElement.style.display = 'none'
|
||||
} else {
|
||||
e.parentElement.style.display = 'block'
|
||||
}
|
||||
})
|
||||
}, 10)
|
||||
|
||||
return days
|
||||
}
|
||||
|
||||
get viewEventMonth () {
|
||||
return this.viewDate.getMonth()
|
||||
}
|
||||
|
||||
dateMonth(event: any) {
|
||||
return new Date(event.start).getMonth()
|
||||
}
|
||||
|
||||
eventListVisible(event) {
|
||||
return momentG(event,'MMMM yyyy') == momentG(this.calendar.currentDate, 'MMMM yyyy')
|
||||
}
|
||||
|
||||
log(event) {
|
||||
console.log(event)
|
||||
}
|
||||
|
||||
// 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) => {
|
||||
//console.log( e.startTime.toLocaleDateString('en-US'),' == ',this.eventSelectedDate.toLocaleDateString('en-US'));
|
||||
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
|
||||
});
|
||||
|
||||
// console.log('Event -- ',filterDate[filterDate.length - 1], filterDate['startTime']);
|
||||
|
||||
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
|
||||
|
||||
// console.log('firstEventStartHours-- ', firstEventStartHours)
|
||||
|
||||
if(firstEventStartHours) {
|
||||
const scrollContainer = document.querySelector('.timeline-wrapper');
|
||||
|
||||
scrollContainer.scroll({
|
||||
top: firstEventStartHours*60,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}, 500);
|
||||
|
||||
}
|
||||
|
||||
actions(){}
|
||||
|
||||
@@ -1103,19 +1061,14 @@ export class AgendaPage implements OnInit {
|
||||
changeProfile() {
|
||||
|
||||
if(this.profile == "mdgpr"){
|
||||
console.log('pr');
|
||||
this.profile ="pr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
else{
|
||||
console.log('mdgpr');
|
||||
this.profile ="mdgpr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
// change header profile picture
|
||||
// window['header'](this.profile);
|
||||
|
||||
}
|
||||
|
||||
async openAddEvent() {
|
||||
@@ -1359,6 +1312,7 @@ export class AgendaPage implements OnInit {
|
||||
} else {
|
||||
this.timelineFilterState = segments
|
||||
}
|
||||
this.showTimelineFilterState = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -177,6 +177,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="middle-content">
|
||||
<div *ngIf="postEvent.Body.Text">
|
||||
<h5>Detalhes</h5>
|
||||
<ion-item lines="none" class="ion-no-margin ion-no-padding">
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
|
||||
</ion-item>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex container-div width-100 ion-item-container-no-border" >
|
||||
<ion-label (click)="getDoc()" class="cursor-pointer">
|
||||
<div class="attach-icon">
|
||||
|
||||
@@ -241,72 +241,4 @@ export class EditEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,6 @@
|
||||
<button class="btn-ok" shape="round" (click)="approveTask()">Aprovar</button>
|
||||
<div class="solid"></div>
|
||||
<button class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
|
||||
<button class="btn-delete" shape="round" (click)="deleteTask()">Rejeitar</button>
|
||||
<button class="btn-delete" shape="round" (click)="rejeitar()">Rejeitar</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -35,44 +35,53 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
goBack(){
|
||||
this.closePopover();
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
|
||||
closePopover(){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
|
||||
approveTask() {
|
||||
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.toastService.successMessage()
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
emendarTask() {
|
||||
|
||||
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.toastService.successMessage()
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
deleteTask(){
|
||||
|
||||
async rejeitar(){
|
||||
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
async editTask() {
|
||||
console.log(this.serialNumber);
|
||||
console.log(this.instanceId);
|
||||
@@ -93,73 +102,4 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { NewEventPage } from './new-event.page';
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
NewEventPageRoutingModule
|
||||
NewEventPageRoutingModule,
|
||||
],
|
||||
declarations: [NewEventPage]
|
||||
})
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<!-- <input type="text" ngbDatepicker #d="ngbDatepicker"/> -->
|
||||
|
||||
<div class="ion-item-container">
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@ import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
@@ -36,6 +38,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
@@ -43,11 +47,13 @@ export class NewEventPage implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
userService: AuthService,
|
||||
) {
|
||||
this.loggeduser = userService.ValidatedUser;
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.profile = this.navParams.get('profile');
|
||||
/* this.profile = this.navParams.get('profile'); */
|
||||
|
||||
this.selectedSegment = this.navParams.get('segment');
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
@@ -126,14 +132,20 @@ export class NewEventPage implements OnInit {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
|
||||
let eventId: string;
|
||||
let eventId: any;
|
||||
|
||||
try {
|
||||
|
||||
if(this.profile=='mdgpr') {
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
console.log(this.loggeduser.Profile);
|
||||
|
||||
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
console.log(eventId);
|
||||
|
||||
}
|
||||
else if(this.profile=='pr'){
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
console.log(this.loggeduser.Profile);
|
||||
|
||||
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
}
|
||||
|
||||
@@ -170,74 +182,6 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<button class="btn-no-color" (click)="openNewGroupPage()">
|
||||
<ion-icon slot="end" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
|
||||
</button>
|
||||
<button class="btn-no-color" (click)="doRefresh()">
|
||||
<button *ngIf="hideRefreshBtn" class="btn-no-color" (click)="doRefresh()">
|
||||
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -91,6 +91,7 @@ export class ChatPage implements OnInit {
|
||||
|
||||
/* Fim websockets variables*/
|
||||
loggedUserChat:any;
|
||||
hideRefreshBtn = true;
|
||||
|
||||
constructor(
|
||||
private http:HttpClient,
|
||||
@@ -120,7 +121,25 @@ export class ChatPage implements OnInit {
|
||||
//this.sendMsg();
|
||||
|
||||
/* Fim websocket functions */
|
||||
this.hideRefreshButton();
|
||||
}
|
||||
|
||||
hideRefreshButton(){
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 801) {
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
else{
|
||||
this.hideRefreshBtn = true;
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 801){
|
||||
console.log('YASS');
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
loadMessage(){
|
||||
this.chatService.messages.subscribe(msg => {
|
||||
console.log("Response from websocket: " + msg);
|
||||
|
||||
@@ -184,6 +184,9 @@ export class EventDetailModalPage implements OnInit {
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
console.log(res);
|
||||
|
||||
},(error) => {
|
||||
console.log(error);
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
|
||||
@@ -123,13 +123,48 @@ export class EventsPage implements OnInit {
|
||||
let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59";
|
||||
|
||||
switch (this.segment)
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
console.log(this.eventsList);
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* switch (this.segment)
|
||||
{
|
||||
case "Combinada":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
@@ -190,7 +225,7 @@ export class EventsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
showGreeting(){
|
||||
|
||||
@@ -466,70 +466,5 @@ export class DespachoPrPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,70 +446,4 @@ export class DespachoPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(7000)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
}
|
||||
|
||||
-46
@@ -166,50 +166,4 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -279,49 +279,5 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-46
@@ -221,50 +221,4 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ export class ApproveEventPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getTask() {
|
||||
@@ -97,10 +96,8 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.toastService.successMessage('Evento aprovado', ()=>{
|
||||
this.goBack();
|
||||
});
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
@@ -126,22 +123,23 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejeitar(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
this.toastService.successMessage('Process');
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
await this.toastService.successMessage('Processo rejeitado', ()=>{
|
||||
this.goBack();
|
||||
});
|
||||
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async getAttachments(instanceId:string){
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
|
||||
try {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
viewDocument(sourceId){
|
||||
@@ -242,50 +240,4 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventsMDGPRList" (click)="goToEventDetail(event)">
|
||||
*ngFor="let event of eventsMDGPRList" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
|
||||
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
@@ -57,7 +57,7 @@
|
||||
<div *ngIf="eventsPRList">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventsPRList" (click)="goToEventDetail(event)">
|
||||
*ngFor="let event of eventsPRList" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
|
||||
@@ -37,7 +37,7 @@ export class EventListPage implements OnInit {
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,27 +75,15 @@ export class EventListPage implements OnInit {
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
goToEventDetail(eventToAprove){
|
||||
let InstanceId;
|
||||
|
||||
if(!eventToAprove.workflowInstanceDataFields.hasOwnProperty('InstanceId')){
|
||||
InstanceId = ''
|
||||
} else {
|
||||
InstanceId =eventToAprove.workflowInstanceDataFields.InstanceId
|
||||
}
|
||||
|
||||
goToEventToApproveDetail(serialNumber:string){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": eventToAprove.serialNumber,
|
||||
"serialNumber": serialNumber,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/event-list/approve-event'], navigationExtras)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
doRefresh() {
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
|
||||
+1
-1
@@ -192,7 +192,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
if(data){
|
||||
if(data) {
|
||||
data = data['data'];
|
||||
|
||||
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||
|
||||
+1
-1
@@ -344,7 +344,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
|
||||
await this.toastService.badRequest('Processo efetuado');
|
||||
await this.toastService.badRequest('Processo não efetuado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
+2
-2
@@ -35,14 +35,14 @@
|
||||
|
||||
<div class="overflow-y-auto">
|
||||
<div class="middle-content">
|
||||
<h5 *ngIf="intervenientes">Intervenientes</h5>
|
||||
<!-- <h5 *ngIf="intervenientes">Intervenientes</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label>
|
||||
<div *ngFor="let interveniente of intervenientes">
|
||||
<p>{{interveniente.Name}}</p>
|
||||
</div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-item> -->
|
||||
<div *ngIf="cc.length > 0">
|
||||
<h5>Com conhecimento</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
|
||||
@@ -361,51 +361,4 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,28 +82,16 @@ export class ExpedientePage implements OnInit {
|
||||
|
||||
doRefresh() {
|
||||
this.LoadList();
|
||||
|
||||
setTimeout(() => {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
goBack() {
|
||||
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any) {
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
"caller": "gabinete"
|
||||
}
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -442,51 +442,4 @@ export class ExpedientePrPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,18 +3,19 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="height-100">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<div class="main-content d-flex height-100">
|
||||
|
||||
<!-- Aside left -->
|
||||
<div class="aside-wrapper d-flex flex-column justify-center width-md-40 flex-grow-1 ">
|
||||
<div class="title-container">
|
||||
<ion-label class="title">Gabinete Digital</ion-label>
|
||||
<button class="btn-no-color btn-refresh" (click)="doRefresh()">
|
||||
<button *ngIf="hideRefreshBtn" class="btn-no-color btn-refresh" (click)="doRefresh($event)">
|
||||
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -74,6 +74,8 @@ export class GabineteDigitalPage implements OnInit {
|
||||
mdgpr = "MDGPR";
|
||||
pr = "PR";
|
||||
|
||||
hideRefreshBtn = true;
|
||||
|
||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
||||
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
||||
@@ -124,6 +126,22 @@ export class GabineteDigitalPage implements OnInit {
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
}
|
||||
|
||||
hideRefreshButton(){
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 801) {
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
else{
|
||||
this.hideRefreshBtn = true;
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 801){
|
||||
console.log('YASS');
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
}
|
||||
|
||||
checkRoutes(){
|
||||
@@ -260,7 +278,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
doRefresh(event) {
|
||||
this.closeAllDesktopComponents();
|
||||
switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
@@ -276,8 +294,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
this.LoadCounts();
|
||||
//this.refreshExpedientes();
|
||||
|
||||
setTimeout(() => {
|
||||
}, 2000);
|
||||
event.target.complete();
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
||||
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button>
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Parecer'">
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { DailyWorkTask } from '../../../../models/dailyworktask.model';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
@@ -12,19 +11,17 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedido',
|
||||
@@ -171,7 +168,6 @@ export class PedidoPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
|
||||
async openOptions(taskAction?: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: RequestOptionsPage,
|
||||
@@ -187,7 +183,6 @@ export class PedidoPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
|
||||
async repreciar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
@@ -206,8 +201,6 @@ export class PedidoPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
@@ -228,9 +221,26 @@ export class PedidoPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
async assignar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reencaminhar",
|
||||
"ActionTypeId": 98,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
@@ -344,6 +354,27 @@ export class PedidoPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async openForwardModal(task: any) {
|
||||
console.log(task);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: ForwardPage,
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async openDarParecer(task: any) {
|
||||
console.log(task);
|
||||
|
||||
@@ -404,65 +435,25 @@ export class PedidoPage implements OnInit {
|
||||
else if(actionName == 'Arquivar'){
|
||||
this.arquivar(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Assignar'){
|
||||
this.assignar(res.data.note, docs);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
goBack() {
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pedidos": true,
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos']);
|
||||
} else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pedidos": true,
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
|
||||
<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>
|
||||
@@ -24,7 +24,7 @@
|
||||
<button class="btn-no-color" (click)="AddPublicationFolder()">
|
||||
<ion-icon slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
|
||||
</button>
|
||||
<button class="btn-no-color" (click)="doRefresh()">
|
||||
<button *ngIf="hideRefreshBtn" class="btn-no-color" (click)="doRefresh($event)">
|
||||
<ion-icon slot="icon-only" class="title-icon" name="reload-circle" title="Actualizar"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="main-content overflow-auto-y">
|
||||
<div class="item d-flex"
|
||||
*ngFor="let viagem of publicationsTravelFolderList"
|
||||
(click)="viewPublications(viagem.ProcessId)">
|
||||
(click)="goToPublicationsList(viagem.ProcessId)">
|
||||
<div class="item-icon">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@ ion-toolbar{
|
||||
}
|
||||
}
|
||||
.item{
|
||||
padding: 0 0px 0 0px;
|
||||
padding: 0 0px 0 0px !important;
|
||||
margin: 0px auto;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
@@ -116,14 +116,20 @@ ion-toolbar{
|
||||
.item-content-date{
|
||||
color: #797979;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-title{
|
||||
color: #0d89d1;
|
||||
font-size: 15px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-detail{
|
||||
color: #000000;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
// from publication details
|
||||
//publication: object;
|
||||
hideRefreshBtn = true;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -67,14 +68,31 @@ export class PublicationsPage implements OnInit {
|
||||
this.getActions();
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
}
|
||||
doRefresh() {
|
||||
/* this.getActions(); */
|
||||
|
||||
hideRefreshButton(){
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 801) {
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
else{
|
||||
this.hideRefreshBtn = true;
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 801){
|
||||
console.log('YASS');
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
this.getActions();
|
||||
|
||||
setTimeout(() => {
|
||||
this.getActions();
|
||||
/* event.target.complete(); */
|
||||
}, 2000);
|
||||
event.target.complete();
|
||||
}, 250);
|
||||
}
|
||||
|
||||
get windowInnerWidth(): number {
|
||||
@@ -125,7 +143,7 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
this.doRefresh();
|
||||
this.getActions();
|
||||
});
|
||||
} else {
|
||||
this.desktopComponent.showAddActions = true;
|
||||
@@ -134,6 +152,17 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
goToPublicationsList(folderId: string){
|
||||
if( window.innerWidth <= 800){
|
||||
this.router.navigate(['/home/publications',folderId]);
|
||||
} else {
|
||||
this.closeDesktopComponent();
|
||||
this.folderId = folderId
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async viewPublications(folderId: string) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ViewPublicationsPageRoutingModule } from './view-publications-routing.m
|
||||
|
||||
import { ViewPublicationsPage } from './view-publications.page';
|
||||
import { ComponentsModule } from 'src/app/components/components.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -15,7 +16,8 @@ import { ComponentsModule } from 'src/app/components/components.module';
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ComponentsModule,
|
||||
ViewPublicationsPageRoutingModule
|
||||
ViewPublicationsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage]
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
|
||||
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border">
|
||||
<!-- <ion-toolbar class="bg-blue"> -->
|
||||
<div class="main-header">
|
||||
<div class="title-content d-flex">
|
||||
<div class="back-icon" (click)="close()">
|
||||
<div class="back-icon" (click)="goBack()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title flex-grow-1">
|
||||
@@ -18,7 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<!-- </ion-toolbar> -->
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}
|
||||
ion-content{
|
||||
--background: transparent;
|
||||
transform: translate3d(0, 5px, 0);
|
||||
//transform: translate3d(0, 5px, 0);
|
||||
--border-radius: 30px;
|
||||
}
|
||||
ion-toolbar{
|
||||
@@ -52,7 +52,6 @@
|
||||
overflow:hidden;
|
||||
padding: 25px 20px 0px 20px;
|
||||
color:#000;
|
||||
|
||||
}
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
@@ -60,7 +59,6 @@
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
|
||||
padding: 15px 20px 0 20px;
|
||||
}
|
||||
.content-top{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
@@ -24,11 +25,20 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private loadingController: LoadingService,
|
||||
private modalController: ModalController,
|
||||
private publications: PublicationsService,
|
||||
private navParams: NavParams,
|
||||
) {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
)
|
||||
{
|
||||
this.item = new PublicationFolder();
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
}
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params);
|
||||
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
console.log(params["params"]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.folderId);
|
||||
@@ -48,6 +58,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
goBack(){
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
getPublicationDetail(){
|
||||
this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
Reference in New Issue
Block a user