remove unused files

This commit is contained in:
Peter Maquiran
2024-06-08 17:18:38 +01:00
parent ef30adcf46
commit cca859b6c4
69 changed files with 1022 additions and 6024 deletions
+41 -45
View File
@@ -1,46 +1,42 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AgendaPage } from './agenda.page';
const routes: Routes = [
{
path: '',
component: AgendaPage
},
{
path: 'approve-event-modal',
loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
},
{
path: 'event-actions-popover',
loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule)
},
{
path: 'emend-message-modal',
loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
},
{
path: 'new-event',
loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule)
},
{
path: 'edit-event',
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
},
{
path: 'view-event',
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
},
{
path: 'evandre',
loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule)
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
import { AgendaPage } from './agenda.page';
const routes: Routes = [
{
path: '',
component: AgendaPage
},
{
path: 'approve-event-modal',
loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
},
{
path: 'event-actions-popover',
loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule)
},
{
path: 'emend-message-modal',
loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
},
{
path: 'new-event',
loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule)
},
{
path: 'edit-event',
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
},
{
path: 'view-event',
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AgendaPageRoutingModule {}
@@ -418,87 +418,87 @@ export class EditEventPage implements OnInit {
}
async save() {
// async save() {
this.injectValidation()
this.runValidation()
// this.injectValidation()
// this.runValidation()
if (this.Form.invalid) return false;
if (this.selectedRecurringType != '-1') {
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
}
// if (this.Form.invalid) return false;
// if (this.selectedRecurringType != '-1') {
// this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
// }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */;
this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */;
this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */;
// this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
// this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */;
// this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */;
// this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */;
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
// this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.editEvent(this.postEvent, 2, 3, null).subscribe(async () => {
// if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
// this.eventsService.editEvent(this.postEvent, 2, 3, null).subscribe(async () => {
if (window['reloadCalendar']) {
window['reloadCalendar']()
}
// if (window['reloadCalendar']) {
// window['reloadCalendar']()
// }
if (this.initCalendarName != this.postEvent.CalendarName) {
// if (this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (error) { }
finally {
}
// let body = {
// "EventId": this.postEvent.EventId,
// "CalendarDestinationName": this.postEvent.CalendarName,
// }
// try {
// await this.eventsService.changeAgenda(body).toPromise();
// } catch (error) { }
// finally {
// }
}
// }
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
// this.httpErrorHandle.httpsSucessMessagge('Editar evento')
}, error => {
this.httpErrorHandle.httpStatusHandle(error)
});
} else {
console.log('edid calendar id', this.postEvent.CalendarId);
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
// }, error => {
// this.httpErrorHandle.httpStatusHandle(error)
// });
// } else {
// console.log('edid calendar id', this.postEvent.CalendarId);
// this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
if (window['reloadCalendar']) {
window['reloadCalendar']()
}
// if (window['reloadCalendar']) {
// window['reloadCalendar']()
// }
if (this.initCalendarName != this.postEvent.CalendarName) {
// if (this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (error) { }
finally {
}
// let body = {
// "EventId": this.postEvent.EventId,
// "CalendarDestinationName": this.postEvent.CalendarName,
// }
// try {
// await this.eventsService.changeAgenda(body).toPromise();
// } catch (error) { }
// finally {
// }
}
// }
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
// this.httpErrorHandle.httpsSucessMessagge('Editar evento')
}, error => {
this.httpErrorHandle.httpStatusHandle(error)
});
}
// }, error => {
// this.httpErrorHandle.httpStatusHandle(error)
// });
// }
this.isEventEdited = true;
// this.isEventEdited = true;
await this.saveDocument()
// await this.saveDocument()
this.goBack();
}
// this.goBack();
// }
async saveDocument() {
@@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EvandrePage } from './evandre.page';
const routes: Routes = [
{
path: '',
component: EvandrePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class EvandrePageRoutingModule {}
@@ -1,20 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { EvandrePageRoutingModule } from './evandre-routing.module';
import { EvandrePage } from './evandre.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
EvandrePageRoutingModule
],
declarations: [EvandrePage]
})
export class EvandrePageModule {}
@@ -1,9 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-title>evandre</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>
@@ -1,24 +0,0 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { EvandrePage } from './evandre.page';
describe('EvandrePage', () => {
let component: EvandrePage;
let fixture: ComponentFixture<EvandrePage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ EvandrePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(EvandrePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-evandre',
templateUrl: './evandre.page.html',
styleUrls: ['./evandre.page.scss'],
})
export class EvandrePage implements OnInit {
constructor() { }
ngOnInit() {
}
}
+210 -210
View File
@@ -453,116 +453,116 @@ export class NewEventPage implements OnInit {
}
async save() {
// async save() {
this.injectValidation()
this.runValidation()
// this.injectValidation()
// this.runValidation()
if (this.Form.invalid) {
return false
}
// if (this.Form.invalid) {
// return false
// }
if (this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
}
if (this.selectedRecurringType != '-1') {
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
}
// if (this.documents.length >= 0) {
// this.postEvent.HasAttachments = true;
// }
// if (this.selectedRecurringType != '-1') {
// this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
// }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ); */
this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ); */
this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ); */
// this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
// this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ); */
// this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ); */
// this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ); */
let eventId: any;
// let eventId: any;
const loader = this.toastService.loading()
// const loader = this.toastService.loading()
try {
// try {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
// const CalendarId = this.selectedCalendarId()
// this.postEvent.CalendarId = CalendarId
if (this.loggeduser.Profile == 'MDGPR') {
// if (this.loggeduser.Profile == 'MDGPR') {
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.hhtpErrorHandle.httpsSucessMessagge('new event')
// eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
// this.hhtpErrorHandle.httpsSucessMessagge('new event')
}
else if (this.loggeduser.Profile == 'PR') {
// }
// else if (this.loggeduser.Profile == 'PR') {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
// const CalendarId = this.selectedCalendarId()
// this.postEvent.CalendarId = CalendarId
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.hhtpErrorHandle.httpsSucessMessagge('new event')
// eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
// this.hhtpErrorHandle.httpsSucessMessagge('new event')
} else if (this.loggeduser.Profile == 'SGGPR') {
// } else if (this.loggeduser.Profile == 'SGGPR') {
this.saveAproveEvent();
// this.saveAproveEvent();
} else {
// } else {
const CalendarId = this.selectedCalendarId()
this.postEvent.CalendarId = CalendarId
// const CalendarId = this.selectedCalendarId()
// this.postEvent.CalendarId = CalendarId
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
this.hhtpErrorHandle.httpsSucessMessagge('new event')
// eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
// this.hhtpErrorHandle.httpsSucessMessagge('new event')
}
// }
//foi adicionado este if para não ter de fazer muitas alterações sobre a criação dos eventos. Deve ser refatorado
if (this.loggeduser.Profile != 'SGGPR') {
// //foi adicionado este if para não ter de fazer muitas alterações sobre a criação dos eventos. Deve ser refatorado
// if (this.loggeduser.Profile != 'SGGPR') {
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
// const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
// return {
// SourceTitle: e.Assunto,
// ParentId: eventId,
// Source: '1',
// SourceId: e.Id,
// ApplicationId: e.ApplicationType.toString(),
// Id: '',
// Link: '',
// SerialNumber: ''
// };
// });
await DocumentToSave.forEach(async (attachments, i) => {
try {
await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
} catch (error) {
// await DocumentToSave.forEach(async (attachments, i) => {
// try {
// await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
// } catch (error) {
}
// }
});
// });
let data1 = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": eventId,
"calendarId": CalendarId
}
// let data1 = {
// "subject": this.postEvent.Subject,
// "start": this.postEvent.StartDate,
// "end": this.postEvent.EndDate,
// "venue": this.postEvent.Location,
// "id": eventId,
// "calendarId": CalendarId
// }
if (this.roomId) {
this.chatMethodService.sendMessage(this.roomId, data1);
}
// if (this.roomId) {
// this.chatMethodService.sendMessage(this.roomId, data1);
// }
this.hhtpErrorHandle.httpsSucessMessagge('new event');
let data = Object.assign(this.postEvent, { id: eventId })
this.modalController.dismiss(data);
}
// this.hhtpErrorHandle.httpsSucessMessagge('new event');
// let data = Object.assign(this.postEvent, { id: eventId })
// this.modalController.dismiss(data);
// }
} catch (error) {
this.hhtpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
// } catch (error) {
// this.hhtpErrorHandle.httpStatusHandle(error)
// } finally {
// loader.remove()
// }
}
// }
//This method return calendar id
@@ -717,177 +717,177 @@ export class NewEventPage implements OnInit {
}
//Deve ser removido posteriormente
async saveAproveEvent() {
// async saveAproveEvent() {
// console.log(this.postEvent)
// console.log(this.postEvent.CalendarName)
// console.log(this.CalendarName)
// console.log(this.eventService.calendarNamesAry)
const CalendarId = this.selectedCalendarId()
// // console.log(this.postEvent)
// // console.log(this.postEvent.CalendarName)
// // console.log(this.CalendarName)
// // console.log(this.eventService.calendarNamesAry)
// const CalendarId = this.selectedCalendarId()
let selectedCalendar
try {
selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName)
} catch (error) {
// let selectedCalendar
// try {
// selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName)
// } catch (error) {
}
// console.log('selectedCalendar', selectedCalendar)
// }
// // console.log('selectedCalendar', selectedCalendar)
if (selectedCalendar) {
if (selectedCalendar.Role = 'Presidente da República') {
let loader = this.toastService.loading();
// if (selectedCalendar) {
// if (selectedCalendar.Role = 'Presidente da República') {
// let loader = this.toastService.loading();
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
// const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
// return {
// SourceTitle: e.Assunto,
// ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
// Source: '1',
// SourceId: e.Id,
// ApplicationId: e.ApplicationType.toString(),
// Id: '',
// Link: '',
// SerialNumber: ''
// };
// });
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => {
loader.remove()
this.modalController.dismiss();
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
// let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
// await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => {
// loader.remove()
// this.modalController.dismiss();
// this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
/* DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
if (DocumentToSave.length == (i + 1)) {
this.afterSave();
}
});
});
// /* DocumentToSave.forEach((attachments, i) => {
// this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
// if (DocumentToSave.length == (i + 1)) {
// this.afterSave();
// }
// });
// });
if (DocumentToSave.length == 0) {
this.afterSave();
} */
// if (DocumentToSave.length == 0) {
// this.afterSave();
// } */
}, (error) => {
loader.remove()
this.hhtpErrorHandle.httpStatusHandle(error)
});
// }, (error) => {
// loader.remove()
// this.hhtpErrorHandle.httpStatusHandle(error)
// });
} else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') {
let loader = this.toastService.loading();
// } else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') {
// let loader = this.toastService.loading();
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
// const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
// return {
// SourceTitle: e.Assunto,
// ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
// Source: '1',
// SourceId: e.Id,
// ApplicationId: e.ApplicationType.toString(),
// Id: '',
// Link: '',
// SerialNumber: ''
// };
// });
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => {
loader.remove()
this.modalController.dismiss();
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
// let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
// await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => {
// loader.remove()
// this.modalController.dismiss();
// this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
/* DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
if (DocumentToSave.length == (i + 1)) {
this.afterSave();
}
});
});
// /* DocumentToSave.forEach((attachments, i) => {
// this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
// if (DocumentToSave.length == (i + 1)) {
// this.afterSave();
// }
// });
// });
if (DocumentToSave.length == 0) {
this.afterSave();
} */
// if (DocumentToSave.length == 0) {
// this.afterSave();
// } */
}, (error) => {
loader.remove()
this.hhtpErrorHandle.httpStatusHandle(error)
});
// }, (error) => {
// loader.remove()
// this.hhtpErrorHandle.httpStatusHandle(error)
// });
}
// }
}
// }
if (!selectedCalendar && this.CalendarName == "Meu calendario") {
console.log('SG generic')
this.postEvent.CalendarName
// if (!selectedCalendar && this.CalendarName == "Meu calendario") {
// console.log('SG generic')
// this.postEvent.CalendarName
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
// const CalendarId = this.selectedCalendarId()
// let loader = this.toastService.loading();
this.postEvent.CalendarId = CalendarId
// this.postEvent.CalendarId = CalendarId
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
loader.remove();
// this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
// (id) => {
// loader.remove();
const eventId: any = id;
// const eventId: any = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
// const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
// return {
// SourceTitle: e.Assunto,
// ParentId: eventId,
// Source: '1',
// SourceId: e.Id,
// ApplicationId: e.ApplicationType.toString(),
// Id: '',
// Link: '',
// SerialNumber: ''
// };
// });
DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
if (DocumentToSave.length == (i + 1)) {
}
});
});
// DocumentToSave.forEach((attachments, i) => {
// this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
// if (DocumentToSave.length == (i + 1)) {
// }
// });
// });
if (DocumentToSave.length == 0) {
}
// if (DocumentToSave.length == 0) {
// }
this.hhtpErrorHandle.httpsSucessMessagge('new event')
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": id,
"calendarId": CalendarId
}
if (this.roomId) {
this.chatMethodService.sendMessage(this.roomId, data);
}
// this.hhtpErrorHandle.httpsSucessMessagge('new event')
// let data = {
// "subject": this.postEvent.Subject,
// "start": this.postEvent.StartDate,
// "end": this.postEvent.EndDate,
// "venue": this.postEvent.Location,
// "id": id,
// "calendarId": CalendarId
// }
// if (this.roomId) {
// this.chatMethodService.sendMessage(this.roomId, data);
// }
let dataa = Object.assign(this.postEvent, { id: eventId })
this.modalController.dismiss(dataa);
}, (error) => {
// let dataa = Object.assign(this.postEvent, { id: eventId })
// this.modalController.dismiss(dataa);
// }, (error) => {
loader.remove()
this.hhtpErrorHandle.httpStatusHandle(error)
});
// loader.remove()
// this.hhtpErrorHandle.httpStatusHandle(error)
// });
}
// }
}
// }
// Deve ser removido posteriormente
eventToaproveBody(event, calendarId, role, userId, attachments) {
@@ -15,7 +15,7 @@ import { NewEventPage } from '../../agenda/new-event/new-event.page';
import { EventPerson } from 'src/app/models/eventperson.model';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
// import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { FileType } from 'src/app/models/fileType';
import { Storage } from '@ionic/storage';
@@ -341,28 +341,28 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.loadFiles();
}
async goToEvent(event: any) {
let classs;
if (window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
// async goToEvent(event: any) {
// let classs;
// if (window.innerWidth < 701) {
// classs = 'modal modal-desktop'
// } else {
// classs = 'modal modal-desktop showAsideOptions'
// }
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: event.id,
CalendarId: event.calendarId
},
cssClass: classs,
});
// const modal = await this.modalController.create({
// component: ViewEventPage,
// componentProps: {
// eventId: event.id,
// CalendarId: event.calendarId
// },
// cssClass: classs,
// });
modal.onDidDismiss().then((res) => {
// modal.onDidDismiss().then((res) => {
});
await modal.present();
}
// });
// await modal.present();
// }
ngOnDestroy() {
window.removeEventListener('scroll', this.scrollChangeCallback, true);
@@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EventDetailModalPage } from './event-detail-modal.page';
const routes: Routes = [
{
path: '',
component: EventDetailModalPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class EventDetailModalPageRoutingModule {}
@@ -1,20 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { EventDetailModalPageRoutingModule } from './event-detail-modal-routing.module';
import { EventDetailModalPage } from './event-detail-modal.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
EventDetailModalPageRoutingModule
],
declarations: [EventDetailModalPage]
})
export class EventDetailModalPageModule {}
@@ -1,215 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
</ion-buttons>
<ion-title>Visualizar Evento</ion-title>
<ion-buttons slot="end">
<button (click)="deleteConfirm()" class="ion-icon-delete">
<ion-icon name="trash"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div *ngIf="loadedEvent">
<ion-item-group>
<ion-item-sliding>
<!-- <form [formGroup]="ionicForm" novalidate>
<ion-item>
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
</ion-item>
//Error messages
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
Campo obrigatório
</span>
</form> -->
<ion-item>
<ion-label position="stacked">Descrição</ion-label>
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Localização</ion-label>
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Calendário</ion-label>
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label position="stacked">Tipo do evento</ion-label>
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<ion-select-option value="Reunião">Reunião</ion-select-option>
<ion-select-option value="Viagem">Viagem</ion-select-option>
<ion-select-option value="Conferência">Conferência</ion-select-option>
<ion-select-option value="Encontro">Encontro</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Início</ion-label>
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Fim</ion-label>
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
displayFormat="D MMM YYYY HH:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
</ion-item>
<div class="div-attach" >
<ion-item>
<ion-buttons slot="end" (click)="openAttendees()">
<ion-label color="secondary">Editar</ion-label>
</ion-buttons>
<ion-label class="attach-label">Intervenientes</ion-label>
</ion-item>
<div *ngIf="loadedEvent.Attendees">
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
<div *ngIf="i<1">
<ion-list >
<ion-item class="attendees" lines="none" >
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="loadedEvent.Attendees.length > 1">
<button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
<ion-label color="secondary">Ver mais...</ion-label>
</button>
</div>
</div>
</div>
<div class="div-attach">
<ion-item>
<ion-buttons slot="end" (click)="showAlert()">
<ion-label color="secondary">Editar</ion-label>
</ion-buttons>
<ion-label class="attach-label">Anexos</ion-label>
</ion-item>
<div *ngIf="loadedEventAttachments">
<div *ngFor="let att of loadedEventAttachments; let j=index">
<div *ngIf="j<2">
<ion-list *ngIf="loadedEvent.HasAttachments">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-item lines="none" (click)="viewDocument(att.Link)">
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>
<p>{{ att.Description }}</p>
<p>{{ att.CreateDate }}</p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="loadedEventAttachments.length > 1">
<button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
<ion-label color="secondary">Ver mais...</ion-label>
</button>
</div>
</div>
<!-- Skeleton Attachment -->
<ion-list *ngIf="!loadedEventAttachments">
<ion-item lines="none" >
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
<!-- No attachment message -->
<ion-list *ngIf="!loadedEvent.HasAttachments">
<ion-item lines="none" >
<ion-label>
Sem anexos
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-item-sliding>
</ion-item-group>
</div>
<!-- Skeleton screen -->
<div *ngIf="!loadedEvent">
<div class="ion-padding custom-skeleton">
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
<ion-skeleton-text animated></ion-skeleton-text>
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</div>
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-avatar>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
<ion-footer>
<ion-toolbar>
<div class="event-detail-buttons">
<ion-button shape="round" (click)="Save()">Enviar</ion-button>
</div>
</ion-toolbar>
</ion-footer>
@@ -1,97 +0,0 @@
@import '~src/function.scss';
ion-item-group{
margin: 15px;
}
.div-item{
width: 100%;
overflow: auto;
border-bottom: 1px solid #ccc;
margin: 10px 0 5px 0;
}
.div-up{
width: 100%;
overflow: auto;
}
.div-up h3{
margin: 0;
padding: 0;
font-size: rem(17);
width: 100%;
}
.div-icon{
width: 10%;
font-size: rem(22);
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-attachment{
width: 85%;
float: left;
padding: 0 0 0 12px;
}
.ion-icon-attach{
color: #666666;
font-size: rem(20);
}
.btn-attach{
margin: 15px 0 0 0;
--color: #333;
--border-color:#333;
}
.div-card-button{
width: 100%;
overflow: auto;
padding: 0 !important;
}
ion-card{
margin: 2.5% !important;
width: 45%;
float: left;
}
.center{
text-align: center;
float: center;
}
/* FFOTER */
.event-detail-buttons{
width: 90%;
margin: 10px auto;
}
.event-detail-buttons ion-button{
width: 90%;
margin: 0 auto;
display: block;
margin-bottom: 25px;
}
.ion-icon-delete{
font-size: rem(22);
color: red;
background-color: white;
padding-right: 5px;
}
.error{
color:red;
font-size: rem(12);
font-weight: bold;
padding-bottom: 20px;
}
/* .event-detail-buttons{
margin-bottom: 80px;
margin-top: 10px;
} */
.attendees-icon{
font-size: rem(14);
}
.see-more-button{
text-transform: initial;
font-size: rem(16);
}
@@ -1,24 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { EventDetailModalPage } from './event-detail-modal.page';
describe('EventDetailModalPage', () => {
let component: EventDetailModalPage;
let fixture: ComponentFixture<EventDetailModalPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EventDetailModalPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(EventDetailModalPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,250 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { AlertController, ModalController } from '@ionic/angular';
import { Attachment } from 'src/app/models/attachment.model';
import { Event } from 'src/app/models/event.model';
import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { AttachmentsPage } from '../attachments/attachments.page';
import { AttendeesPageModal } from '../attendees/attendees.page';
@Component({
selector: 'app-event-detail-modal',
templateUrl: './event-detail-modal.page.html',
styleUrls: ['./event-detail-modal.page.scss'],
})
export class EventDetailModalPage implements OnInit {
loadedEvent: Event;
loadedEventAttachments: Attachment[];
pageId: string;
showLoader: boolean;
backURL: string;
ionicForm: FormGroup;
isSubmitted = false;
minDate: Date;
profile:string;
constructor(
public formBuilder: FormBuilder,
public alertController: AlertController,
private router: Router,
private activatedRoute: ActivatedRoute,
private eventsService: EventsService,
private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService,
private route: Router,) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
ngOnInit() {
this.loadEvent();
this.loadAttachments();
this.ionicForm = this.formBuilder.group({
subject: ['', [Validators.required]]
})
// this.setDefaultTime()
}
// setDefaultTime() {
// this.loadedEvent.StartDate = new Date()
// this.loadedEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000))
// }
get errorControl() {
return this.ionicForm.controls;
}
loadEvent(){
let eventid: string;
this.activatedRoute.paramMap.subscribe(paramMap =>
{
if (!paramMap.has("eventId")){
return;
}
else{
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
}
if (paramMap.has("caller")){
this.backURL = "/home/" + paramMap.get('caller');
}
}
);
this.eventsService.getEvent(eventid).subscribe(response => {
this.loadedEvent = response;
});
}
async openAttendees(){
const modal = await this.modalCtrl.create({
component: AttendeesPageModal,
componentProps: {
eventAttendees: this.loadedEvent.Attendees
},
cssClass: 'attendee modal-desktop',
backdropDismiss: false
});
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
});
await modal.present();
}
getEventAttendees(): EventPerson[]
{
return this.loadedEvent.Attendees;
}
setEventAttendees(newattendes: EventPerson[])
{
this.loadedEvent.Attendees = newattendes;
}
async deleteConfirm()
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Apagar evento!',
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
buttons: [
{
text: 'Não',
role: 'cancel',
cssClass: 'secondary',
handler: () => { }
}, {
text: 'Sim',
handler: () => {
this.Delete();
}
}
]
});
await alert.present();
}
Delete()
{
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(()=>{
alert.dismiss();
}, 1500);
this.router.navigate(['/home/events']);
});
}
Save()
{
if (this.ionicForm.valid)
{
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
});
setTimeout(()=>{
alert.dismiss();
}, 1500);
});
}
}
showAlert(){
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
}
loadAttachments()
{
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
this.loadedEventAttachments = attachments;
}); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
/* const browser = this.iab.create(url,"_blank");
browser.show(); */
}
back()
{
//this.back();
}
doRefresh(event){
/* this.RefreshEvents(); */
try {
event?.target?.complete();
} catch(error) {}
setTimeout(() => {
try {
event?.target?.complete();
} catch(error) {}
}, 2000);
}
navigateTo(ev){
this.route.navigate(['/home/events',ev]);
}
async openAttachments() {
const modal = await this.modalCtrl.create({
component: AttachmentsPage,
componentProps: {
eventId: this.pageId,
attachments: this.loadedEventAttachments
},
cssClass: 'attachments',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
});
}
}
@@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EventDetailPage } from './event-detail.page';
const routes: Routes = [
{
path: '',
component: EventDetailPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class EventDetailPageRoutingModule {}
@@ -1,22 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { EventDetailPageRoutingModule } from './event-detail-routing.module';
import { EventDetailPage } from './event-detail.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ReactiveFormsModule,
EventDetailPageRoutingModule
],
declarations: [EventDetailPage]
})
export class EventDetailPageModule {}
@@ -1,215 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
</ion-buttons>
<ion-title class="header-title">Visualizar Evento</ion-title>
<ion-buttons slot="end">
<button (click)="deleteConfirm()" class="ion-icon-delete">
<ion-icon name="trash"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div *ngIf="loadedEvent">
<ion-item-group>
<ion-item-sliding>
<form [formGroup]="ionicForm" novalidate>
<ion-item>
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
</ion-item>
<!-- Error messages -->
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
Campo obrigatório
</span>
</form>
<ion-item>
<ion-label position="stacked">Descrição</ion-label>
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Localização</ion-label>
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Calendário</ion-label>
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label position="stacked">Tipo do evento</ion-label>
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
<ion-select-option value="Reunião">Reunião</ion-select-option>
<ion-select-option value="Viagem">Viagem</ion-select-option>
<ion-select-option value="Conferência">Conferência</ion-select-option>
<ion-select-option value="Encontro">Encontro</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Início</ion-label>
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
displayFormat="D MMM YYYY H:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
</ion-item>
<ion-item>
<ion-label position="stacked">Data Fim</ion-label>
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
displayFormat="D MMM YYYY HH:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
</ion-item>
<div class="div-attach" >
<ion-item>
<ion-buttons slot="end" (click)="openAttendees()">
<ion-label color="secondary">Editar</ion-label>
</ion-buttons>
<ion-label class="attach-label">Intervenientes</ion-label>
</ion-item>
<div *ngIf="loadedEvent.Attendees">
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
<div *ngIf="i<1">
<ion-list >
<ion-item class="attendees" lines="none" >
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="loadedEvent.Attendees.length > 1">
<button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
<ion-label color="secondary">Ver mais...</ion-label>
</button>
</div>
</div>
</div>
<div class="div-attach">
<ion-item>
<ion-buttons slot="end" (click)="showAlert()">
<ion-label color="secondary">Editar</ion-label>
</ion-buttons>
<ion-label class="attach-label">Anexos</ion-label>
</ion-item>
<div *ngIf="loadedEventAttachments">
<div *ngFor="let att of loadedEventAttachments; let j=index">
<div *ngIf="j<2">
<ion-list *ngIf="loadedEvent.HasAttachments">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-item lines="none" (click)="viewDocument(att.Link)">
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>
<p>{{ att.Description }}</p>
<p>{{ att.CreateDate }}</p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="loadedEventAttachments.length > 1">
<button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
<ion-label color="secondary">Ver mais...</ion-label>
</button>
</div>
</div>
<!-- Skeleton Attachment -->
<!-- <ion-list *ngIf="!loadedEventAttachments">
<ion-item lines="none" >
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list> -->
<!-- No attachment message -->
<ion-list *ngIf="!loadedEvent.HasAttachments">
<ion-item lines="none" >
<ion-label>
Sem anexos
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-item-sliding>
</ion-item-group>
</div>
<!-- Skeleton screen -->
<div *ngIf="!loadedEvent">
<div class="ion-padding custom-skeleton">
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
<ion-skeleton-text animated></ion-skeleton-text>
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</div>
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-avatar>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
<ion-footer>
<ion-toolbar>
<div class="event-detail-buttons">
<button class="btn-ok" fill="clear" color="#fff" shape="round" (click)="Save()">Enviar</button>
</div>
</ion-toolbar>
</ion-footer>
@@ -1,119 +0,0 @@
@import '~src/function.scss';
ion-item-group{
margin: 15px;
}
.div-item{
width: 100%;
overflow: auto;
border-bottom: 1px solid #ccc;
margin: 10px 0 5px 0;
}
.div-up{
width: 100%;
overflow: auto;
}
.div-up h3{
margin: 0;
padding: 0;
font-size: rem(17);
width: 100%;
}
.div-icon{
width: 10%;
font-size: rem(22);
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-attachment{
width: 85%;
float: left;
padding: 0 0 0 12px;
}
.ion-icon-attach{
color: #666666;
font-size: rem(20);
}
.btn-attach{
margin: 15px 0 0 0;
--color: #333;
--border-color:#333;
}
.div-card-button{
width: 100%;
overflow: auto;
padding: 0 !important;
}
ion-card{
margin: 2.5% !important;
width: 45%;
float: left;
}
.center{
text-align: center;
float: center;
}
/* FFOTER */
.event-detail-buttons{
width: 90%;
margin: 10px auto;
}
.event-detail-buttons ion-button{
width: 90%;
margin: 0 auto;
display: block;
margin-bottom: 25px;
}
.ion-icon-delete{
font-size: rem(22);
color: red;
background-color: white;
padding-right: 5px;
}
.error{
color:red;
font-size: rem(12);
font-weight: bold;
padding-bottom: 20px;
}
/* .event-detail-buttons{
margin-bottom: 80px;
margin-top: 10px;
} */
.attendees-icon{
font-size: rem(14);
}
.see-more-button{
text-transform: initial;
font-size: rem(16);
}
.header-content{
overflow: auto;
margin: 0 auto;
padding-top: 25px;
}
.header-icon-left{
width: 36px;
font-size: rem(33);
color: #42b9fe;
float: left;
border: 1px solid red;
}
.header-title{
width: 300px;
font-family: Roboto;
font-size: rem(25);
margin: 0 5px 0 5px;
padding: 0;
color:#000;
float: left;
}
@@ -1,24 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { EventDetailPage } from './event-detail.page';
describe('EventDetailPage', () => {
let component: EventDetailPage;
let fixture: ComponentFixture<EventDetailPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EventDetailPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(EventDetailPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,254 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { EventsService } from 'src/app/services/events.service';
import { Router } from '@angular/router';
import { Event } from '../../../models/event.model';
import { EventBody } from 'src/app/models/eventbody.model';
import { AlertController, ModalController } from '@ionic/angular';
import { EventPerson } from 'src/app/models/eventperson.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { AlertService } from 'src/app/services/alert.service';
import { Attachment } from 'src/app/models/attachment.model';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { AttachmentsPage } from '../attachments/attachments.page';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-event-detail',
templateUrl: './event-detail.page.html',
styleUrls: ['./event-detail.page.scss'],
})
export class EventDetailPage implements OnInit {
loadedEvent: Event;
loadedEventAttachments: Attachment[];
pageId: string;
showLoader: boolean;
backURL: string;
ionicForm: FormGroup;
isSubmitted = false;
minDate: Date;
profile:string;
constructor(
public formBuilder: FormBuilder,
public alertController: AlertController,
private router: Router,
private activatedRoute: ActivatedRoute,
private eventsService: EventsService,
private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService,
private route: Router,
private iab: InAppBrowser,
private httpErrorHandle: HttpErrorHandle) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
ngOnInit() {
this.loadEvent();
this.loadAttachments();
this.ionicForm = this.formBuilder.group({
subject: ['', [Validators.required]]
})
}
get errorControl() {
return this.ionicForm.controls;
}
loadEvent(){
let eventid: string;
this.activatedRoute.paramMap.subscribe(paramMap =>
{
if (!paramMap.has("eventId")){
return;
}
else{
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
}
if (paramMap.has("caller")){
this.backURL = "/home/" + paramMap.get('caller');
}
}
);
this.eventsService.getEvent(eventid).subscribe(response => {
this.loadedEvent = response;
},(error) => {
this.httpErrorHandle.httpStatusHandle(error)
});
}
async openAttendees(){
const modal = await this.modalCtrl.create({
component: AttendeesPageModal,
componentProps: {
eventAttendees: this.loadedEvent.Attendees
},
cssClass: 'attendee modal-desktop',
backdropDismiss: false
});
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
});
await modal.present();
}
getEventAttendees(): EventPerson[]
{
return this.loadedEvent.Attendees;
}
setEventAttendees(newattendes: EventPerson[])
{
this.loadedEvent.Attendees = newattendes;
}
async deleteConfirm()
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Apagar evento!',
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
buttons: [
{
text: 'Não',
role: 'cancel',
cssClass: 'secondary',
handler: () => { }
}, {
text: 'Sim',
handler: () => {
this.Delete();
}
}
]
});
await alert.present();
}
Delete()
{
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
{
/* const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
await alert.present(); */
this.router.navigate(['/home/events']);
});
}
Save()
{
// if (this.ionicForm.valid){
// this.activatedRoute.paramMap.subscribe(paramMap =>{
// if (paramMap.has("profile")){
// }
// });
// this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
// {
// const alert = await this.alertController.create({
// cssClass: 'my-custom-class',
// header: 'Evento actualizado',
// buttons: ['OK']
// });
// setTimeout(()=>{
// alert.dismiss();
// }, 1500);
// });
// }
}
showAlert(){
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
}
loadAttachments()
{
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res;
},((erro) => {
console.error('loadAttchament', erro)
}));
}
async viewDocument(documenturl:string)
{
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
}
back()
{
//this.back();
}
doRefresh(event){
/* this.RefreshEvents(); */
try {
event?.target?.complete();
} catch(error) {}
setTimeout(() => {
try {
event?.target?.complete();
} catch(error) {}
}, 2000);
}
navigateTo(ev){
this.route.navigate(['/home/events',ev]);
}
async openAttachments(){
const modal = await this.modalCtrl.create({
component: AttachmentsPage,
componentProps: {
eventId: this.pageId,
attachments: this.loadedEventAttachments
},
cssClass: 'attachments',
backdropDismiss: false
});
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
});
await modal.present();
}
}
@@ -8,10 +8,6 @@ const routes: Routes = [
path: '',
component: EventsPage
},
{
path: 'event-detail',
loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule)
},
{
path: 'attachments',
loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule)
@@ -20,10 +16,6 @@ const routes: Routes = [
path: 'attendees',
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
},
{
path: 'event-detail-modal',
loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule)
},
{
path: 'edit-event',
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
-17
View File
@@ -3,7 +3,6 @@ import { EventsService } from 'src/app/services/events.service';
import { NavigationExtras, Router } from '@angular/router';
import { ActivatedRoute, NavigationEnd } from '@angular/router';
import { ModalController, Platform } from '@ionic/angular';
import { EventDetailPage } from './event-detail/event-detail.page';
import { ProcessesService } from '../../services/processes.service';
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
@@ -324,22 +323,6 @@ export class EventsPage implements OnInit {
}
}
async openEventDetail1(id: any) {
//
const modal = await this.modalController.create({
component: EventDetailPage,
componentProps: {
eventId: id,
},
cssClass: 'event-detail',
backdropDismiss: false
});
modal.onDidDismiss();
await modal.present();
}
async openEventDetail(id: any) {
//