This commit is contained in:
tiago.kayaya
2021-09-02 16:25:04 +01:00
23 changed files with 81 additions and 353 deletions
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { HomeGuard } from './home.guard';
describe('HomeGuard', () => {
let guard: HomeGuard;
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(HomeGuard);
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});
-32
View File
@@ -1,32 +0,0 @@
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { AuthConnstants } from '../config/auth-constants';
import { StorageService } from '../services/storage.service';
@Injectable({
providedIn: 'root'
})
export class HomeGuard implements CanActivate {
constructor(
public storageService:StorageService,
private router:Router
){}
canActivate(): Promise<boolean>{
return new Promise(resolve => {
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
if(res){
resolve(true);
}
else{
this.router.navigate(['']);
resolve(false);
}
}).catch(err =>{
resolve(false);
}) */
});
}
}
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { IndexGuard } from './index.guard';
describe('IndexGuard', () => {
let guard: IndexGuard;
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(IndexGuard);
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});
-31
View File
@@ -1,31 +0,0 @@
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { AuthConnstants } from '../config/auth-constants';
import { StorageService } from '../services/storage.service';
@Injectable({
providedIn: 'root'
})
export class IndexGuard implements CanActivate {
constructor(
public storageService:StorageService,
private router:Router
){}
canActivate(): Promise<boolean> {
return new Promise(resolve => {
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
if(res){
this.router.navigate(['home']);
resolve(false);
}
else{
resolve(true);
}
}).catch(err =>{
resolve(false);
}) */
});
}
}
+3 -2
View File
@@ -1,9 +1,8 @@
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { LocalstoreService } from '../store/localstore.service';
import { SessionStore } from '../store/session.service';
import { AlertController, Platform } from '@ionic/angular';
import { Platform } from '@ionic/angular';
@Injectable({
providedIn: 'root'
@@ -16,6 +15,8 @@ export class LoginGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
// console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
this.router.navigate(['/home/events']);
return false
-1
View File
@@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { IndexGuard } from '../guards/index.guard';
import { LoginGuard } from '../guards/login.guard';
import { IndexPage } from './index.page';
+2 -2
View File
@@ -33,9 +33,9 @@
</ion-header>
<ion-content class=" bg-blue">
<div class="d-flex flex-column height-100 overflow-auto-y">
<div class="d-flex flex-column height-100 overflow-y-auto">
<div class="notifications-content">
<div class="notifications-content height-100">
<ion-list>
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
+11 -8
View File
@@ -1,11 +1,10 @@
export interface EventListStore {
title: string
startTime: Date
endTime: Date
allDay: boolean,
event: EventList,
calendarName: string
calendarName: "Oficial" |"Pessoal"
profile: "md" | "pr",
id: string
}
@@ -27,12 +26,16 @@ export interface EventList {
export interface CustomCalendarEvent {
start: Date
end: Date
color: {
primary: string,
secondary: string
},
id: string
index: number,
CalendarName: string
event: EventList
}
export interface days {
[days: string]: {
day: number
activeEvent: number
events: CustomCalendarEvent[]
}
}
+9 -6
View File
@@ -223,14 +223,13 @@
<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 class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
<div class="day EventListBox-day mt-10" *ngIf="shoeEventDay(events.value)">
<div class="EventListBox-container" >
<div class="day EventListBox-day mt-10" >
{{ TimelineDayEvent(events.key)}}
</div>
<div *ngFor="let event of events.value" class="EventListBox" >
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(event)"
*ngIf="viewEventMonth <= dateMonth(event) && showEventBox(event)">
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(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>
@@ -263,16 +262,20 @@
<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 class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
<div class="EventListBox-container" >
<div class="day mt-10" *ngIf="shoeEventDay(events.value)">
<div class="day mt-10" >
{{ TimelineDayEvent(events.key)}}
</div>
<div *ngFor="let event of events.value" class="EventListBox" >
<<<<<<< HEAD
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(event)"
*ngIf="viewEventMonth <= dateMonth(event) && showEventBox(event) ">
=======
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)">
>>>>>>> 5de16776a2d0d5cddbb186151ec203ae12509873
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
+16 -194
View File
@@ -290,6 +290,7 @@ export class AgendaPage implements OnInit {
// calendar change date
this.eventSelectedDate = new Date(ev);
this.updateEventListBox()
};
// changedate
@@ -461,7 +462,7 @@ export class AgendaPage implements OnInit {
// loop
this.calendarService.pushEvent(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -482,7 +483,7 @@ export class AgendaPage implements OnInit {
// calendar
this.calendarService.pushEvent(response, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -508,7 +509,7 @@ export class AgendaPage implements OnInit {
this.calendarService.pushEvent(response, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
@@ -536,7 +537,7 @@ export class AgendaPage implements OnInit {
this.calendarService.pushEvent(eventsList, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -556,7 +557,7 @@ export class AgendaPage implements OnInit {
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
this.calendarService.pushEvent(eventsList, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -607,7 +608,7 @@ export class AgendaPage implements OnInit {
this.calendarService.pushEvent(eventsList, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -638,7 +639,7 @@ export class AgendaPage implements OnInit {
// loop
this.calendarService.pushEvent(eventsList, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -667,7 +668,7 @@ export class AgendaPage implements OnInit {
this.calendarService.pushEvent(eventsList, 'pr');
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
this.myCal.loadEvents();
@@ -705,7 +706,7 @@ export class AgendaPage implements OnInit {
this.calendarService.pushEvent(eventsList, 'pr');
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update();
@@ -732,174 +733,11 @@ export class AgendaPage implements OnInit {
updateEventListBox() {
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
}
eventListBox(list, nice?) {
let days = {};
list.forEach( (event:any)=> {
var startDate: any = new Date(event.start);
var endDate: any = this.EventTretment({
startTime: startDate,
endTime: event.end
})
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
event.manyDays = false
event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString()
if(!days.hasOwnProperty(day)) {
days[day] = []
}
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
// difference
const diffTime = Math.abs(endDate - startDate);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
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)
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
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)
}
}
} else {
days[day].push(event)
}
} else {
days[day].push(event)
}
}
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()
@@ -932,13 +770,13 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr") {
this.profile ="pr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
}
else {
this.profile ="mdgpr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
}
}
@@ -1224,26 +1062,10 @@ export class AgendaPage implements OnInit {
}
this.showTimelineFilterState = false;
setTimeout(()=>{
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
if(e.childElementCount == 0) {
e.parentElement.style.display = 'none'
} else {
e.parentElement.style.display = 'block'
}
})
}, 10)
// THIS LINE
this.updateEventListBox()
setTimeout(()=>{
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
if(e.childElementCount == 0) {
e.parentElement.style.display = 'none'
} else {
e.parentElement.style.display = 'block'
}
})
}, 100)
}
@@ -2,7 +2,7 @@
<app-header></app-header>
</ion-header>
<ion-content>
<div class="main-content d-flex height-100 px-20">
<div class="main-content d-flex height-100 pl-20 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header" >
<div class="title-content width-100 d-flex justify-space-between align-center">
@@ -76,8 +76,8 @@
</div>
<div *ngIf="task" class="aside-right flex-column height-100 px-20">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div class="option-desc"> <div>Responder ao PR</div> </div>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
<!-- <div class="solid"></div> -->
@@ -92,7 +92,7 @@
<!-- <div class="solid"></div> -->
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="main-content d-flex height-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between align-center">
@@ -83,7 +83,7 @@
<div *ngIf="task" class="aside-right flex-column height-100">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' "> <div>Responder ao PR</div> </div>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="main-content d-flex height-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between">
@@ -74,7 +74,7 @@
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons">
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
<div class="solid"></div>
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="main-content d-flex height-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between">
@@ -73,7 +73,7 @@
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
@@ -95,7 +95,7 @@
<div class="option-desc"> <div>Outras opções</div> </div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
@@ -7,7 +7,7 @@
</div>
<ion-content>
<div class="main-content d-flex height-100">
<div class="main-content d-flex height-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header" style="overflow: unset !important;">
<div class="title-content width-100 d-flex justify-between">
@@ -104,7 +104,7 @@
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons">
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="main-content d-flex height-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header ">
<div class="title-content width-100 d-flex justify-space-between ">
@@ -78,7 +78,7 @@
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Deferimento'">
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
@@ -6,6 +6,7 @@ import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
import { NewPublicationPage } from '../../new-publication/new-publication.page';
import { Location } from '@angular/common';
@Component({
selector: 'app-publication-detail',
@@ -26,6 +27,7 @@ export class PublicationDetailPage implements OnInit {
private toastService: ToastService,
private activatedRoute: ActivatedRoute,
private router: Router,
private location: Location,
) {
this.activatedRoute.paramMap.subscribe(params => {
@@ -93,7 +95,7 @@ export class PublicationDetailPage implements OnInit {
if(this.isModal) {
this.close()
} else {
this.router.navigate(['/home/publications', this.folderId]);
this.location.back();
}
}
@@ -110,8 +112,9 @@ export class PublicationDetailPage implements OnInit {
this.toastService.badRequest('Publicaçao não eliminada')
} finally {
loader.remove()
this.goBack();
}
this.goBack();
}
+17 -23
View File
@@ -26,10 +26,26 @@ export class ListBoxService {
})
}
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
return eventSource.filter( data => data.calendarName == segment)
}
daysBetween(){ }
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'todo'}) {
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
if(selectedDate) {
eventSource = eventSource.filter(data =>
data.startTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt') &&
data.startTime.getMonth() == selectedDate.getMonth()
)
}
if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment)
}
if(profile != 'all') {
eventSource = this.filterProfile(eventSource, profile)
}
@@ -49,7 +65,6 @@ export class ListBoxService {
display(list: CustomCalendarEvent[]) {
let days = {};
console.log(list)
list.forEach( (event:CustomCalendarEvent, index)=> {
@@ -127,15 +142,6 @@ export class ListBoxService {
})
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
}
@@ -149,18 +155,10 @@ export class ListBoxService {
events.push({
start: new Date(element.startTime),
end: new Date(element.endTime),
color: {
primary: '#0000',
secondary: '#0000'
},
id: element.id,
index: eventIndex,
CalendarName: element.calendarName,
event: element.event,
});
console.log('element.event', element.event)
});
return events;
@@ -169,14 +167,10 @@ export class ListBoxService {
transForm(event: CustomCalendarEvent, {startMany, endMany, middle}) {
return Object.assign({}, {
title: event.event.Subject,
start: event.start,
end: event.end,
color: event.color,
id: event.id,
index: event.index,
profile: event,
CalendarName: event.CalendarName,
event: {
Subject: event.event.Subject,
StartDate: event.event.StartDate,
@@ -18,7 +18,7 @@
</div>
<div class="flex-grow-1 width-50 pl-10">
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
<button (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para pendentes</button>
</div>
@@ -17,7 +17,7 @@
</div>
<div class="flex-grow-1 width-50 pl-10">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
</div>
@@ -16,7 +16,7 @@
</div>
<div class="flex-grow-1">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
-2
View File
@@ -22,7 +22,6 @@ export class CalendarService {
setTimeout(()=>{
restore.forEach((element:EventListStore, eventIndex) => {
this._eventSource.push({
title: element.title,
startTime: new Date(element.startTime),
endTime: new Date(element.endTime),
allDay: element.allDay,
@@ -67,7 +66,6 @@ export class CalendarService {
let news = []
eventsList.forEach((element, eventIndex) => {
news.push({
title: element.Subject,
startTime: new Date(element.StartDate),
endTime: new Date(element.EndDate),
allDay: false,