diff --git a/config.xml b/config.xml
index e9aeeda7b..438ba0ed4 100644
--- a/config.xml
+++ b/config.xml
@@ -135,7 +135,7 @@
0
- 8.0.0.00-20210308-063916
+ 8.0.0.00-20210214-154410
diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts
index c7d46b26f..c3d154bc0 100644
--- a/src/app/home/home.page.ts
+++ b/src/app/home/home.page.ts
@@ -75,10 +75,11 @@ export class HomePage implements OnInit {
}
ngOnInit() {
+ this.count();
- //Add a test
- //this.pushCordova();
- //Initialize profile as mdgpr
+ }
+
+ async count(){
let date = new Date();
date.setMonth(date.getMonth() + 1);
@@ -87,16 +88,18 @@ export class HomePage implements OnInit {
this.profile = "mdgpr";
if (this.profile == "mdgpr") {
- this.eventService.getAllMdEvents(start, end).subscribe(res => {
- this.eventsList = res;
- this.totalEvent = this.eventsList.length;
- });
+
+ let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
+ let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
+ this.eventsList = mdOficialEvents.concat(mdPessoalEvents)
+ this.totalEvent = this.eventsList.length;
+
}
else {
- this.eventService.getAllPrEvents(start, end).subscribe(res => {
- this.eventsList = res;
- this.totalEvent = this.eventsList.length;
- });
+ let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
+ let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
+ this.eventsList = prOficialEvents.concat(prPessoalEvents)
+ this.totalEvent = this.eventsList.length;
}
diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts
index c8a464b2c..e24bf1e2e 100644
--- a/src/app/models/user.model.ts
+++ b/src/app/models/user.model.ts
@@ -14,15 +14,19 @@ export class User {
FullName: string
OwnerCalendars: {
CalendarId: string
- CalendarName: "Oficial" | "Pessoal"
- Id: 1
+ CalendarName: "Oficial" | "Pessoal";
+ CalendarRoleId: string;
+ Id: number;
}[]
RoleDescription: string
RoleID: number
SharedCalendars: {
CalendarId: string
- CalendarName: "Oficial" | "Pessoal"
- Id: 1
+ CalendarName: "Oficial" | "Pessoal";
+ CalendarRoleId: string;
+ Id: number;
+ OwnerUserId: string;
+ TypeShare: number;
}[]
UserName: string
Profile: any;
diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts
index f84d707ba..d2494fb88 100644
--- a/src/app/pages/agenda/agenda.page.ts
+++ b/src/app/pages/agenda/agenda.page.ts
@@ -515,7 +515,7 @@ export class AgendaPage implements OnInit {
return ((new Date(this.timelineDate)).getDate()).toString().padStart(2,'0')
}
- loadRangeEvents(startTime: Date, endTime: Date){
+ async loadRangeEvents(startTime: Date, endTime: Date){
this.eventSelectedDate = new Date(startTime);
@@ -531,13 +531,14 @@ export class AgendaPage implements OnInit {
//this.eventSource=[];
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
- this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
- response => {
+
+ 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();
// calendar
this.eventSource=[];
- this.eventsList = response;
+ this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
// loop
this.eventsList.forEach((element, eventIndex) => {
@@ -572,17 +573,17 @@ export class AgendaPage implements OnInit {
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')).subscribe(
- response => {
+ 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();
// calendar
this.eventSource=[];
- this.eventsList = response;
+ this.eventsList = prOficialEvents.concat(prPessoalEvents);
// calendar
this.eventsList.forEach((element, eventIndex) => {
@@ -616,8 +617,6 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
-
- });
}
break;
@@ -625,7 +624,7 @@ export class AgendaPage implements OnInit {
//Inicializa o array eventSource
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
- this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
+ this.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.eventSource=[];
this.eventsListPessoal= [];
@@ -666,10 +665,11 @@ export class AgendaPage implements OnInit {
}
else{
- this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
+ 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.eventSource=[];
- this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
+ this.eventsListPessoal = prPessoalEvents.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
title: element.Subject,
@@ -699,7 +699,7 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
- });
+
}
break;
@@ -709,7 +709,7 @@ export class AgendaPage implements OnInit {
this.eventsListOficial = [];
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
- this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
+ this.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.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
@@ -743,9 +743,9 @@ export class AgendaPage implements OnInit {
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')).subscribe(res => {
+ 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.eventSource=[];
- this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
+ this.eventsListOficial = prOficialEvents.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({
title: element.Subject,
@@ -775,7 +775,6 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
- });
}
break;
@@ -789,15 +788,16 @@ export class AgendaPage implements OnInit {
let counter = 0;
if(this.loggeduser.Profile == 'MDGPR') {
- this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
- response => {
+
+ 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();
if(this.segment == 'Oficial') {
- this.eventsList = response.filter(data => data.CalendarName == "Oficial");
+ this.eventsList = mdOficialEvents;
} else if (this.segment == 'Pessoal') {
- this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
+ this.eventsList = mdPessoalEvents;
} else {
- this.eventsList = response;
+ this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
}
this.eventSource= this.eventSource.filter(e => e.profile != 'md');
@@ -840,18 +840,18 @@ export class AgendaPage implements OnInit {
this.centralizeTimeline(500);
}
- });
+
}
- this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
- response => {
+ 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();
if(this.segment == 'Oficial') {
- this.eventsList = response.filter(data => data.CalendarName == "Oficial");
+ this.eventsList = prOficialEvents;
} else if (this.segment == 'Pessoal') {
- this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
+ this.eventsList = prPessoalEvents;
} else {
- this.eventsList = response;
+ this.eventsList = prOficialEvents.concat(prPessoalEvents);
}
this.eventSource = this.eventSource.filter(e => e.profile != 'pr');
@@ -890,8 +890,6 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
}
-
- });
}
}
diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts
index 5508e2f65..e1f3fda85 100644
--- a/src/app/pages/events/events.page.ts
+++ b/src/app/pages/events/events.page.ts
@@ -114,7 +114,7 @@ export class EventsPage implements OnInit {
this.RefreshEvents();
}
- RefreshEvents(){
+ async RefreshEvents(){
this.currentEvent = "";
this.showLoader = true;
@@ -127,43 +127,49 @@ export class EventsPage implements OnInit {
{
case "Combinada":
if(this.loggeduser.Profile == 'MDGPR'){
- this.eventService.getAllMdEvents(start, end).subscribe(res => {
- this.eventsList = res;
+
+ let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
+ let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
+
+ this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
- if(res.length > 0){
- this.currentEvent = res[0].Subject;
- this.currentHoursMinutes = res[0].StartDate;
+ 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{
- this.eventService.getAllPrEvents(start, end).subscribe(res => {
- this.eventsList = res;
- console.log(this.eventsList);
- console.log(res);
- console.log(res[0]);
+
+ }
+ else{
- if(res.length > 0){
- this.currentEvent = res[0].Subject;
- this.currentHoursMinutes = res[0].StartDate;
- }
+ 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);
+ console.log(this.eventsList);
- this.totalEvent = this.eventsList.length;
- this.showLoader = false;
- });
+ 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;
+
}
break;
case "Pessoal":
if(this.loggeduser.Profile == 'MDGPR'){
- this.eventService.getAllMdEvents(start, end).subscribe(res => {
+ this.eventService.getAllMdPessoalEvents(start, end).subscribe(res => {
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
this.showLoader = false;
});
- }else{
- this.eventService.getAllPrEvents(start, end).subscribe(res => {
+ }
+ else{
+ this.eventService.getAllPrPessoalEvents(start, end).subscribe(res => {
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
this.showLoader = false;
});
@@ -172,12 +178,13 @@ export class EventsPage implements OnInit {
break;
case "Oficial":
if(this.loggeduser.Profile == 'MDGPR'){
- this.eventService.getAllMdEvents(start, end).subscribe(res => {
+ this.eventService.getAllMdOficialEvents(start, end).subscribe(res => {
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
this.showLoader = false;
});
- }else{
- this.eventService.getAllPrEvents(start, end).subscribe(res => {
+ }
+ else{
+ this.eventService.getAllPrOficialEvents(start, end).subscribe(res => {
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
this.showLoader = false;
});
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
index 416663076..7f30eccd7 100644
--- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
@@ -218,14 +218,8 @@ export class ExpedientTaskModalPage implements OnInit {
console.log(this.postData);
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
- await this.toastService.successMessage('Processo efetuado', () =>{
- console.log('Hoje Teste T');
- this.modalController.dismiss(action_despacho);
- });
- /* setInterval(()=>{
- console.log('Hoje Teste T');
- this.modalController.dismiss(action_despacho);
- }, 7000); */
+ await this.toastService.successMessage('Processo efetuado');
+ this.modalController.dismiss();
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
@@ -253,11 +247,9 @@ export class ExpedientTaskModalPage implements OnInit {
"Note": "",
}
}
- //this.taskResult = await this.processes.postParecer(this.postData).toPromise();
+ this.taskResult = await this.processes.postParecer(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
- setInterval(()=>{
- this.modalController.dismiss(action_parecer);
- }, 7000);
+ this.modalController.dismiss(action_parecer);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
@@ -284,9 +276,8 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
- await this.toastService.successMessage('Processo efetuado', () =>{
- this.modalController.dismiss(action_deferimento);
- });
+ await this.toastService.successMessage('Processo efetuado');
+ this.modalController.dismiss(action_deferimento);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
}
@@ -309,7 +300,6 @@ export class ExpedientTaskModalPage implements OnInit {
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: docs,
- //SubjectTypes: [],
}
console.log(this.postData);
try {
@@ -323,9 +313,9 @@ export class ExpedientTaskModalPage implements OnInit {
}
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
- await this.toastService.successMessage('Processo efetuado', () =>{
- this.modalController.dismiss(action_despacho_pr);
- });
+ await this.toastService.successMessage('Processo efetuado');
+ this.modalController.dismiss(action_despacho_pr);
+
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
}
@@ -354,9 +344,9 @@ export class ExpedientTaskModalPage implements OnInit {
}
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
- await this.toastService.badRequest('Processo efetuado', () =>{
- this.modalController.dismiss(action_parecer_pr);
- })
+ await this.toastService.badRequest('Processo efetuado');
+ this.modalController.dismiss(action_parecer_pr);
+
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
}
@@ -406,17 +396,7 @@ export class ExpedientTaskModalPage implements OnInit {
this.showAttendees = true
}
}
-
- /* setIntervenient(data){
- this.taskParticipants = data;
- //this.postData.UsersSelected = data;
- }
-
- setIntervenientCC(data){
- this.taskParticipantsCc = data;
- } */
-
async setIntervenient(data) {
this.taskParticipants = data;
}
@@ -530,50 +510,4 @@ export class ExpedientTaskModalPage implements OnInit {
}
-
- async successMessage(message?: any, callback?) {
-
- var notification = document.createElement('div')
- notification.id = 'notification'
- notification.innerHTML = `
-
-
-
-
-
{{ message }}
-
-
-
- `
-
- document.body.append(notification)
- notification.querySelector('.text').innerHTML = message
- setTimeout(()=>{
- notification.remove()
- },7000)
-
- }
-
- async badRequest(message?: string, callback?) {
-
- var notification = document.createElement('div')
- notification.id = 'notification'
- notification.innerHTML = `
-
-
-
-
{{ message }}
-
-
-
- `
-
- document.body.append(notification)
- notification.querySelector('.text').innerHTML = message
- setTimeout(()=>{
- notification.remove()
- },7000)
-
- }
-
}
\ No newline at end of file
diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
index afa3def5c..a9cd0da1e 100644
--- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
@@ -147,7 +147,7 @@ export class ExpedienteDetailPage implements OnInit {
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": res.workflowInstanceDataFields.FsId,
- "DocId": res.workflowInstanceDataFields.DocId,
+ "DocId": res.workflowInstanceDataFields.DocID,
"WorkflowName": res.workflowDisplayName,
}
diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts
index 9b91a5fc0..93a765bf9 100644
--- a/src/app/services/events.service.ts
+++ b/src/app/services/events.service.ts
@@ -15,12 +15,59 @@ export class EventsService {
authheader = {};
loggeduser: User;
headers: HttpHeaders;
+
+ headersOwnerOficial: HttpHeaders;
+ headersOwnerPessoal: HttpHeaders;
+
+ headersSharedOficial: HttpHeaders;
+ headersSharedPessoal: HttpHeaders;
//lastloadedevent: Event;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
+
+ this.headersOwnerOficial = new HttpHeaders();
+ this.headersOwnerPessoal = new HttpHeaders();
+ this.headersSharedOficial = new HttpHeaders();
+ this.headersSharedPessoal = new HttpHeaders();
+
+
+
+ if(this.loggeduser.Profile == 'MDGPR'){
+ this.headersOwnerOficial = this.headersOwnerOficial.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
+ this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId);
+
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarId', this.loggeduser.OwnerCalendars[1].CalendarId);
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarRoleId', this.loggeduser.OwnerCalendars[1].CalendarRoleId);
+
+ this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', this.loggeduser.SharedCalendars[0].CalendarId);
+ this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', this.loggeduser.SharedCalendars[0].CalendarRoleId);
+
+ this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', this.loggeduser.SharedCalendars[1].CalendarId);
+ this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', this.loggeduser.SharedCalendars[1].CalendarRoleId);
+
+ }
+ else if(this.loggeduser.Profile == 'PR'){
+ this.headersOwnerOficial = this.headersOwnerOficial.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
+ this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId);
+
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarId', this.loggeduser.OwnerCalendars[1].CalendarId);
+ this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarRoleId', this.loggeduser.OwnerCalendars[1].CalendarRoleId);
+ }
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
+ /* this.headers = this.headers.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
+ this.headers = this.headers.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId); */
+
+
+
+
}
getAllEvents(startdate:string, enddate:string): Observable{
@@ -36,7 +83,9 @@ export class EventsService {
};
return this.http.get(`${geturl}`, options);
}
- getAllPrEvents(startdate:string, enddate:string): Observable{
+
+
+ getAllPrOficialEvents(startdate:string, enddate:string): Observable{
const geturl = environment.apiURL + 'calendar/pr';
let params = new HttpParams();
@@ -44,12 +93,27 @@ export class EventsService {
params = params.set("End", enddate);
let options = {
- headers: this.headers,
+ headers: this.headersOwnerOficial,
params: params
};
return this.http.get(`${geturl}`, options);
}
- getAllMdEvents(startdate:string, enddate:string): Observable{
+
+ getAllPrPessoalEvents(startdate:string, enddate:string): Observable{
+ const geturl = environment.apiURL + 'calendar/pr';
+ let params = new HttpParams();
+
+ params = params.set("Start", startdate);
+ params = params.set("End", enddate);
+
+ let options = {
+ headers: this.headersOwnerPessoal,
+ params: params
+ };
+ return this.http.get(`${geturl}`, options);
+ }
+
+ getAllMdOficialEvents(startdate:string, enddate:string): Observable{
const geturl = environment.apiURL + 'calendar/md';
let params = new HttpParams();
@@ -57,7 +121,51 @@ export class EventsService {
params = params.set("End", enddate);
let options = {
- headers: this.headers,
+ headers: this.headersOwnerOficial,
+ params: params
+ };
+ return this.http.get(`${geturl}`, options);
+ }
+
+ getAllMdPessoalEvents(startdate:string, enddate:string): Observable{
+ const geturl = environment.apiURL + 'calendar/md';
+ let params = new HttpParams();
+
+ params = params.set("Start", startdate);
+ params = params.set("End", enddate);
+
+ let options = {
+ headers: this.headersOwnerPessoal,
+ params: params
+ };
+ return this.http.get(`${geturl}`, options);
+ }
+
+
+
+ getAllSharedOficialEvents(startdate:string, enddate:string): Observable{
+ const geturl = environment.apiURL + 'calendar/pr';
+ let params = new HttpParams();
+
+ params = params.set("Start", startdate);
+ params = params.set("End", enddate);
+
+ let options = {
+ headers: this.headersSharedOficial,
+ params: params
+ };
+ return this.http.get(`${geturl}`, options);
+ }
+
+ getAllSharedPessoalEvents(startdate:string, enddate:string): Observable{
+ const geturl = environment.apiURL + 'calendar/pr';
+ let params = new HttpParams();
+
+ params = params.set("Start", startdate);
+ params = params.set("End", enddate);
+
+ let options = {
+ headers: this.headersSharedPessoal,
params: params
};
return this.http.get(`${geturl}`, options);
diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts
index 04b4726e4..008d25598 100644
--- a/src/app/services/toast.service.ts
+++ b/src/app/services/toast.service.ts
@@ -24,94 +24,47 @@ export class ToastService {
async successMessage(message?: any, callback?) {
- const enterAnimation = (baseEl: any) => {
- const backdropAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('ion-backdrop')!)
- .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
+ var notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
- const wrapperAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('.modal-wrapper')!)
- .keyframes([
- { offset: 0, opacity: '1', right: '-100%' },
- { offset: 1, opacity: '1', right: '0px' }
- ]);
+
+
+
+
{{ message }}
+
+
+
+ `
- 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message
setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
+ 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' }
- ]);
+ var notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
+
+
+
+
{{ message }}
+
+
+
+ `
- 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()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message
setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
+ notification.remove()
},7000)
+
}
}