mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Melhorias
Alterar a ordem de apresentação do pop up sobre a recorrencia - Apresentar logo após o click no botão de edição do evento; A app não envia o comentario na revisão de eventos; Ao remover a recorrência do evento a app não remove os eventos da Agenda
This commit is contained in:
@@ -309,8 +309,13 @@ const routes = [
|
||||
{
|
||||
path: 'crop-image',
|
||||
loadChildren: () => import('./modals/crop-image/crop-image.module').then( m => m.CropImagePageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-recurrence',
|
||||
loadChildren: () => import('./modals/event-recurrence/event-recurrence.module').then( m => m.EventRecurrencePageModule)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
path: 'chat',
|
||||
component: ChatPage
|
||||
|
||||
@@ -96,6 +96,8 @@ import { DeplomaOptionsPageModule } from './shared/popover/deploma-options/deplo
|
||||
import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { metricsInterceptor, MetricsInterceptor } from './interceptors/metter.interceptor';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
// import { AngularFireModule } from '@angular/fire';
|
||||
// import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventRecurrencePage } from './event-recurrence.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventRecurrencePage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventRecurrencePageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventRecurrencePageRoutingModule } from './event-recurrence-routing.module';
|
||||
|
||||
import { EventRecurrencePage } from './event-recurrence.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EventRecurrencePageRoutingModule
|
||||
],
|
||||
declarations: [EventRecurrencePage]
|
||||
})
|
||||
export class EventRecurrencePageModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
<ion-content>
|
||||
<div class="pb-30 text-center pt-25">Este é um evento recorrente</div>
|
||||
<div>
|
||||
<ion-buttons slot="start" class="pb-15">
|
||||
<button class="btn-ok" style="width: 240px !important" fill="clear" color="#fff" (click)="close('EditAll')" >
|
||||
<ion-label>Editar todos eventos da serie</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end" class="pb-15">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" style="width: 240px !important" (click)="close('EditOne')">
|
||||
<ion-label>Editar apenas este evento</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" style="width: 240px !important" (click)="close('Cancel')">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventRecurrencePage } from './event-recurrence.page';
|
||||
|
||||
describe('EventRecurrencePage', () => {
|
||||
let component: EventRecurrencePage;
|
||||
let fixture: ComponentFixture<EventRecurrencePage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventRecurrencePage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventRecurrencePage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
|
||||
export type EventRecurrenceComponentReturn = 'EditAll' | 'EditOne' | 'Cancel'
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-recurrence',
|
||||
templateUrl: './event-recurrence.page.html',
|
||||
styleUrls: ['./event-recurrence.page.scss'],
|
||||
})
|
||||
export class EventRecurrencePage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
close(data: EventRecurrenceComponentReturn) {
|
||||
this.modalController.dismiss(data)
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div" *ngIf="postEvent?.EventRecurrence?.frequency">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
|
||||
@@ -200,7 +200,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="postEvent.EventRecurrence.frequency != 'never'" class="container-div">
|
||||
<div *ngIf="postEvent?.EventRecurrence?.frequency != 'never'" class="container-div">
|
||||
<div class="ion-item-class-2 d-flex" >
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
|
||||
@@ -499,7 +499,7 @@
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar px-20">
|
||||
<ion-buttons slot="start">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="validationEditAllEvent()">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save_v2()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
@@ -24,6 +23,7 @@ import { Observable } from 'rxjs';
|
||||
import { RoleIdService } from 'src/app/services/role-id.service'
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { AttendeesLIstChangeDetector } from 'src/app/services/Repositorys/Agenda/async/change/attendeesLIstChangeDetector';
|
||||
import { EventRecurrencePage, EventRecurrenceComponentReturn } from 'src/app/modals/event-recurrence/event-recurrence.page';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -36,6 +36,14 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export interface EditEventPageParams {
|
||||
eventId: string
|
||||
caller?: string
|
||||
closeModal: Boolean
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.page.html',
|
||||
@@ -46,6 +54,8 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
})
|
||||
export class EditEventPage implements OnInit {
|
||||
|
||||
static params: EditEventPageParams
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
@@ -102,6 +112,8 @@ export class EditEventPage implements OnInit {
|
||||
serverCurrentList = []
|
||||
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
editAllEvent = false
|
||||
closeModal = false
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -109,7 +121,6 @@ export class EditEventPage implements OnInit {
|
||||
public eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService,
|
||||
@@ -126,8 +137,11 @@ export class EditEventPage implements OnInit {
|
||||
console.log('this.postEvent', this.postEvent)
|
||||
|
||||
this.caller = this.navParams.get('caller');
|
||||
this.closeModal = this.navParams.get('closeModal');
|
||||
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
this.allDayCheck = this.postEvent.IsAllDayEvent;
|
||||
this.validationEditAllEvent()
|
||||
|
||||
|
||||
|
||||
@@ -243,10 +257,6 @@ export class EditEventPage implements OnInit {
|
||||
this.modalController.dismiss({ action: 'cancel' });
|
||||
}
|
||||
|
||||
goBack() {
|
||||
|
||||
this.router.navigate(['/home', this.caller]);
|
||||
}
|
||||
|
||||
roundTimeQuarterHour(timeToReturn = new Date()) {
|
||||
let date = timeToReturn || new Date();
|
||||
@@ -389,55 +399,41 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
validationEditAllEvent() {
|
||||
if (this.postEvent.IsRecurring && this.postEvent.EventRecurrence.frequency != 'never') {
|
||||
this.alertController.create({
|
||||
header: 'Editar evento?',
|
||||
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
|
||||
inputs: [
|
||||
{
|
||||
name: 'confirm',
|
||||
type: 'checkbox',
|
||||
label: '',
|
||||
value: 'confirm',
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sim',
|
||||
handler: (data) => {
|
||||
// Check if the checkbox is checked
|
||||
if (data.includes('confirm')) {
|
||||
this.save_v2(true)
|
||||
} else {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Não',
|
||||
handler: () => {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
async validationEditAllEvent() {
|
||||
if (this.postEvent.IsRecurring) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventRecurrencePage,
|
||||
componentProps: {},
|
||||
cssClass: 'event-recurrence-modal',
|
||||
|
||||
});
|
||||
} else {
|
||||
this.save_v2(false)
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
const data: EventRecurrenceComponentReturn = res.data
|
||||
if(data =='EditAll') {
|
||||
this.editAllEvent = true
|
||||
} else if (data == 'EditOne') {
|
||||
this.editAllEvent = false
|
||||
} else if(data == 'Cancel') {
|
||||
this.cancel()
|
||||
} else {
|
||||
this.cancel()
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
}
|
||||
}
|
||||
|
||||
@XTracerAsync({name:'mobile/create-event', bugPrint: true, daley: 4000})
|
||||
async save_v2(editAllEvent, tracing?: TracingType) {
|
||||
async save_v2(tracing?: TracingType) {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.Form.invalid) {
|
||||
return false
|
||||
}
|
||||
@@ -447,9 +443,9 @@ export class EditEventPage implements OnInit {
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.goBack();
|
||||
this.close();
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
}, ((error) => {
|
||||
@@ -484,8 +480,6 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
await this.saveDocument()
|
||||
|
||||
if (this.addedAttachmentsList.length > 0) {
|
||||
this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
@@ -519,45 +513,6 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async saveDocument() {
|
||||
|
||||
try {
|
||||
|
||||
for (let e of this.loadedEventAttachments) {
|
||||
const id: any = e.Id
|
||||
const remove = e['remove']
|
||||
|
||||
if (id == 'add') {
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: e.SourceName,
|
||||
ParentId: this.postEvent.EventId,
|
||||
Source: '1',
|
||||
SourceId: e.SourceId,
|
||||
ApplicationId: e.ApplicationId.toString(),
|
||||
Id: '0',
|
||||
Link: '',
|
||||
SerialNumber: '',
|
||||
};
|
||||
|
||||
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
|
||||
|
||||
} else if (remove) {
|
||||
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
this.modalController.dismiss({
|
||||
isEventEdited: this.isEventEdited,
|
||||
postEvent: this.postEvent
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
if (window.innerWidth > 801) {
|
||||
|
||||
@@ -132,7 +132,7 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Revision').subscribe((value) => {
|
||||
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Revision', res.data.note).subscribe((value) => {
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rever')
|
||||
this.TaskService.loadEventosParaAprovacao()
|
||||
this.goBack();
|
||||
@@ -162,7 +162,7 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
const loader = this.toastService.loading();
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Declined').subscribe((value) => {
|
||||
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Declined', '').subscribe((value) => {
|
||||
this.TaskService.loadEventosParaAprovacao()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
|
||||
this.goBack();
|
||||
|
||||
@@ -11,14 +11,10 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { DateService } from 'src/app/services/date.service';
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { isHttpError } from 'src/app/services/http.service';
|
||||
@@ -62,20 +58,15 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
/* private navParams: NavParams, */
|
||||
public eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
public platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
private storage: StorageService,
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private dateService: DateService,
|
||||
private agendaDataRepository: AgendaDataRepositoryService,
|
||||
public p: PermissionService,
|
||||
) {
|
||||
@@ -112,25 +103,6 @@ export class ViewEventPage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.loadEvent();
|
||||
|
||||
// this.backgroundservice.registerBackService('Online', () => {
|
||||
// this.storage.get('eventEdit').then((req) => {
|
||||
// JSON.parse(req).forEach(element => {
|
||||
// this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
|
||||
// this.storage.remove('eventEdit')
|
||||
|
||||
// })
|
||||
// });
|
||||
// })
|
||||
// this.storage.get('eventDelete').then((req) => {
|
||||
// JSON.parse(req).forEach(element => {
|
||||
// this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
|
||||
// this.storage.remove('eventDelete')
|
||||
|
||||
// })
|
||||
// });
|
||||
// })
|
||||
// this.loadEvent();
|
||||
// });
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
@@ -141,25 +113,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
// getEventsFromDB () {
|
||||
|
||||
// return new Promise((resolve, reject) => {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.storage.get('agendaResponse').then((events) => {
|
||||
// resolve(events)
|
||||
// })
|
||||
// } else {
|
||||
// this.sqliteservice.getAllEvents().then((events: any[] = []) => {
|
||||
// resolve(events)
|
||||
|
||||
// })
|
||||
// }
|
||||
// }).catch ((error) => {
|
||||
// console.error(error);
|
||||
// });
|
||||
// }
|
||||
|
||||
openOptions() { }
|
||||
close() {
|
||||
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
@@ -232,37 +186,6 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/* loadEvent1() {
|
||||
|
||||
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res;
|
||||
this.setTimeZone()
|
||||
// this.addEventToDb(res);
|
||||
}, (error) => {
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
if(this.CalendarId) {
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res;
|
||||
this.setTimeZone()
|
||||
|
||||
}, (error) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} */
|
||||
|
||||
deleteYesOrNo() {
|
||||
if (this.loadedEvent.IsRecurring) {
|
||||
this.alertController.create({
|
||||
@@ -350,49 +273,6 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/* if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
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.goBack();
|
||||
this.httpErrorHandle.httpsSucessMessagge('delete event')
|
||||
}, () => { },
|
||||
() => {
|
||||
loader.remove();
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
this.goBack();
|
||||
this.httpErrorHandle.httpsSucessMessagge('delete event')
|
||||
}, (error) => {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
},
|
||||
() => {
|
||||
loader.remove();
|
||||
});
|
||||
|
||||
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
@@ -435,6 +315,7 @@ export class ViewEventPage implements OnInit {
|
||||
componentProps: {
|
||||
eventId: this.loadedEvent.EventId,
|
||||
caller: this.caller,
|
||||
closeModal: true
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
|
||||
@@ -451,10 +332,10 @@ export class ViewEventPage implements OnInit {
|
||||
this.loadEvent()
|
||||
this.isEventEdited = true;
|
||||
|
||||
if (res.data.Attendees?.length >= 1) {
|
||||
this.loadedEvent.HasAttachments = true
|
||||
this.getAttachments()
|
||||
}
|
||||
// if (res.data.Attendees?.length >= 1) {
|
||||
// this.loadedEvent.HasAttachments = true
|
||||
// // this.getAttachments()
|
||||
// }
|
||||
console.log('res', res)
|
||||
}
|
||||
|
||||
@@ -491,11 +372,11 @@ export class ViewEventPage implements OnInit {
|
||||
this.loadEvent()
|
||||
this.isEventEdited = true;
|
||||
|
||||
if (res.data.Attendees?.length >= 1) {
|
||||
this.loadedEvent.HasAttachments = true
|
||||
this.getAttachments()
|
||||
}
|
||||
console.log('res', res)
|
||||
// if (res.data.Attendees?.length >= 1) {
|
||||
// this.loadedEvent.HasAttachments = true
|
||||
// // this.getAttachments()
|
||||
// }
|
||||
// console.log('res', res)
|
||||
}
|
||||
|
||||
});
|
||||
@@ -508,17 +389,6 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
getAttachments() {
|
||||
if (this.loadedEvent.HasAttachments) {
|
||||
this.attachmentsService.getAttachmentsById(this.loadedEvent.EventId).subscribe(res => {
|
||||
this.loadedEvent.Attachments = res;
|
||||
|
||||
}, ((erro) => {
|
||||
console.error('editgetAttchament', erro)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
async LoadDocumentDetails() {
|
||||
|
||||
const docId = this.loadedEvent.Attachments[this.dicIndex].SourceId
|
||||
|
||||
@@ -341,29 +341,6 @@ 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'
|
||||
// }
|
||||
|
||||
// const modal = await this.modalController.create({
|
||||
// component: ViewEventPage,
|
||||
// componentProps: {
|
||||
// eventId: event.id,
|
||||
// CalendarId: event.calendarId
|
||||
// },
|
||||
// cssClass: classs,
|
||||
// });
|
||||
|
||||
// modal.onDidDismiss().then((res) => {
|
||||
|
||||
// });
|
||||
// await modal.present();
|
||||
// }
|
||||
|
||||
ngOnDestroy() {
|
||||
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
||||
}
|
||||
|
||||
@@ -264,6 +264,7 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
} catch (error) {
|
||||
tracing.setAttribute('component.catch', 'true')
|
||||
tracing.setAttribute('component.catch', JSON.stringify(error))
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
|
||||
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Revision').subscribe((value) => {
|
||||
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => {
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rever')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
this.goBack();
|
||||
@@ -229,7 +229,7 @@ export class ApproveEventPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Declined').subscribe((value) => {
|
||||
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Declined', '').subscribe((value) => {
|
||||
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
this.goBack();
|
||||
|
||||
@@ -268,10 +268,10 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
}
|
||||
|
||||
eventToaprovalStatus(eventId, status) {
|
||||
eventToaprovalStatus(eventId, status, comment: string) {
|
||||
let statusObject = {
|
||||
status: this.utils.statusEventAproval(status),
|
||||
comment: ""
|
||||
comment: comment
|
||||
}
|
||||
return this.agendaDataService.updateEventStatus(eventId, statusObject)
|
||||
}
|
||||
@@ -322,6 +322,7 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async clearSharedCalendar() {
|
||||
return await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||
}
|
||||
|
||||
@@ -45,6 +45,22 @@ export class AgendaLocalDataSourceService {
|
||||
}
|
||||
}
|
||||
|
||||
async clearAndAddRecords(data: SharedCalendarListItemOutputDTO[]) {
|
||||
try {
|
||||
await AgendaDataSource.transaction('rw', AgendaDataSource.shareCalendar, async () => {
|
||||
// Clear existing records from myTable
|
||||
await AgendaDataSource.shareCalendar.clear();
|
||||
|
||||
await AgendaDataSource.shareCalendar.bulkAdd(data);
|
||||
|
||||
});
|
||||
console.log('Clear and add operations completed within transaction.');
|
||||
} catch (error) {
|
||||
console.error('Error performing transaction:', error, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async createCalendar(data: SharedCalendarListItemOutputDTO) {
|
||||
// db.eve
|
||||
try {
|
||||
|
||||
@@ -377,7 +377,7 @@ export class ListBoxService {
|
||||
const hours = Math.floor((totalMinutes % (60 * 24)) / 60);
|
||||
const minutes = totalMinutes % 60;
|
||||
|
||||
return `${days}d`
|
||||
return `${days}d ${hours}h ${minutes}m`
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@ export class ApproveEventPage implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private processes: ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
@@ -150,7 +148,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise() */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined').subscribe((value) => {
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "").subscribe((value) => {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rejeitar');
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
}, ((error) => {
|
||||
@@ -240,7 +238,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision').subscribe((value) => {
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
this.close();
|
||||
|
||||
@@ -390,7 +390,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
|
||||
if(calendar.isOk()) {
|
||||
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, false, calendar.value, tracing).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.close()
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
|
||||
@@ -179,11 +179,20 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="_postEvent.EventRecurrence.frequency == 'weekly'" class="container-div ion-item-class-2 d-flex pl-45 pb-20 justify-content-between">
|
||||
<div class="days-to-select">Seg</div>
|
||||
<div class="days-to-select">Ter</div>
|
||||
<div class="days-to-select">Qua</div>
|
||||
<div class="days-to-select">Qui</div>
|
||||
<div class="days-to-select">Sex</div>
|
||||
<div class="days-to-select">Sab</div>
|
||||
<div class="days-to-select">Dom</div>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="_postEvent.EventRecurrence.frequency != 'never'" class="container-div">
|
||||
<div class="ion-item-class-2 d-flex" >
|
||||
<div class="ion-icon-class">
|
||||
@@ -423,7 +432,7 @@
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
|
||||
<ion-buttons slot="start">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="validationEditAllEvent()">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save_v2()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
@@ -17,7 +17,7 @@ ion-content{
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
@@ -90,7 +90,7 @@ ion-content{
|
||||
.list-people{
|
||||
|
||||
float: left;
|
||||
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: rem(45);
|
||||
@@ -149,7 +149,7 @@ ion-content{
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
@@ -157,7 +157,7 @@ ion-content{
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
@@ -171,7 +171,7 @@ ion-content{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.app-name{
|
||||
background: var(--title-text-color);
|
||||
border-radius: 18px;
|
||||
@@ -211,4 +211,23 @@ ion-content{
|
||||
|
||||
.materia-top {
|
||||
padding-top: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.days-to-select{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #ebebeb;
|
||||
border-radius: 50px;
|
||||
box-shadow: 0px 0px 10px #f9f9f9;
|
||||
border: 1px solid #d1d1d1;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
-webkit-border-radius: 50px;
|
||||
-moz-border-radius: 50px;
|
||||
-ms-border-radius: 50px;
|
||||
-o-border-radius: 50px;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-
|
||||
import { RoleIdService } from 'src/app/services/role-id.service'
|
||||
import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { AttendeesLIstChangeDetector } from 'src/app/services/Repositorys/Agenda/async/change/attendeesLIstChangeDetector';
|
||||
import { EventRecurrenceComponentReturn, EventRecurrencePage } from 'src/app/modals/event-recurrence/event-recurrence.page';
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.page.html',
|
||||
@@ -105,6 +106,7 @@ export class EditEventPage implements OnInit {
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
|
||||
dateDifference = 0
|
||||
editAllEvent = false
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -118,6 +120,8 @@ export class EditEventPage implements OnInit {
|
||||
public RoleIdService: RoleIdService,
|
||||
) {
|
||||
this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder()
|
||||
|
||||
|
||||
}
|
||||
|
||||
hasPrCalendar(data: TableSharedCalendar[]) {
|
||||
@@ -148,6 +152,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.allDayCheck = this.postEvent.IsAllDayEvent;
|
||||
if (!this.restoreTemporaryData()) {
|
||||
this.validationEditAllEvent()
|
||||
// clear
|
||||
|
||||
if (this._postEvent) {
|
||||
@@ -366,50 +371,37 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
validationEditAllEvent() {
|
||||
async validationEditAllEvent() {
|
||||
|
||||
if (this.postEvent.IsRecurring ) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EventRecurrencePage,
|
||||
componentProps: {},
|
||||
cssClass: 'event-recurrence-modal',
|
||||
|
||||
if (this.postEvent.IsRecurring && this._postEvent.EventRecurrence.frequency != 'never') {
|
||||
this.alertController.create({
|
||||
header: 'Editar evento?',
|
||||
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
|
||||
inputs: [
|
||||
{
|
||||
name: 'confirm',
|
||||
type: 'checkbox',
|
||||
label: '',
|
||||
value: 'confirm',
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sim',
|
||||
handler: (data) => {
|
||||
// Check if the checkbox is checked
|
||||
if (data.includes('confirm')) {
|
||||
this.save_v2(true)
|
||||
} else {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Não',
|
||||
handler: () => {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
});
|
||||
} else {
|
||||
this.save_v2(false)
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
const data: EventRecurrenceComponentReturn = res.data
|
||||
if(data =='EditAll') {
|
||||
this.editAllEvent = true
|
||||
} else if (data == 'EditOne') {
|
||||
this.editAllEvent = false
|
||||
} else if(data == 'Cancel') {
|
||||
this.close()
|
||||
} else {
|
||||
this.close()
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@XTracerAsync({name:'desktop/edit-event', bugPrint: true, daley: 4000})
|
||||
async save_v2(editAllEvent, tracing?: TracingType) {
|
||||
async save_v2(tracing?: TracingType) {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
@@ -429,7 +421,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.showLoader = true;
|
||||
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
|
||||
@@ -12,7 +12,6 @@ import { SearchList } from 'src/app/models/search-document';
|
||||
import { FileService } from 'src/app/services/functions/file.service';
|
||||
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 { Storage } from '@ionic/storage';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
@@ -175,28 +174,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
} catch (err) { }
|
||||
}
|
||||
|
||||
// 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,
|
||||
// });
|
||||
|
||||
// modal.onDidDismiss().then((res) => {
|
||||
|
||||
// });
|
||||
// await modal.present();
|
||||
// }
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||
|
||||
@@ -392,27 +392,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
return this.timeService.showDateDuration(start);
|
||||
}
|
||||
|
||||
// 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,
|
||||
// });
|
||||
|
||||
// modal.onDidDismiss().then((res) => {
|
||||
|
||||
// });
|
||||
// await modal.present();
|
||||
// }
|
||||
|
||||
sendMessage() {
|
||||
this.ChatSystemService.getDmRoom(this.roomId).send({})
|
||||
|
||||
@@ -6,12 +6,8 @@ import { SearchList } from 'src/app/models/search-document';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Event, EventToApproveEdit } from '../../../models/event.model';
|
||||
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
@@ -320,7 +316,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event,false, calendar.value, tracing).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.httpErroHalde.httpsSucessMessagge('Editar evento')
|
||||
window['approve-event-getTask']()
|
||||
@@ -382,40 +378,6 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* this.loadedAttachments.forEach((document:any)=>{
|
||||
if(document['action'] == 'add') {
|
||||
delete document.action
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||
window['approve-event-getTask'] ()
|
||||
// this.toastService._successMessage();
|
||||
}, error =>{
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest();
|
||||
}
|
||||
});
|
||||
} else if(document['action'] == 'delete') {
|
||||
delete document.action
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||
window['approve-event-getTask'] ()
|
||||
// this.toastService._successMessage()
|
||||
}, error =>{
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}) */
|
||||
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
|
||||
Reference in New Issue
Block a user