mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
ITOTEAM-525 send the rigth category and ownertype
This commit is contained in:
@@ -7,7 +7,6 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
@@ -18,12 +17,12 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
import { Utils } from 'src/app/services/Repositorys/Agenda/utils';
|
||||
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RoleIdService } from 'src/app/services/role-id.service'
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -61,7 +60,6 @@ export class EditEventPage implements OnInit {
|
||||
selectedDate: Date;
|
||||
initCalendarName: string;
|
||||
caller: string;
|
||||
recurringTypes: any;
|
||||
selectedRecurringType: any;
|
||||
|
||||
CalendarNameOwnerName = ''
|
||||
@@ -108,12 +106,10 @@ export class EditEventPage implements OnInit {
|
||||
public eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService,
|
||||
private agendaDataRepository: AgendaDataRepositoryService,
|
||||
private utils: Utils,
|
||||
public RoleIdService: RoleIdService,
|
||||
@@ -193,7 +189,6 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log('this.postEvent', this.postEvent)
|
||||
this.selectedUserCalendar = this.postEvent.owner.wxUserId
|
||||
|
||||
if (!this.postEvent.IsRecurring) {
|
||||
@@ -202,8 +197,7 @@ export class EditEventPage implements OnInit {
|
||||
this.postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency)
|
||||
}
|
||||
this.postEvent.Category = this.setEventType(this.postEvent.Category)
|
||||
console.log(this.postEvent?.Attachments)
|
||||
console.log(this.loadedEventAttachments)
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if (window.innerWidth >= 1024) {
|
||||
@@ -214,7 +208,6 @@ export class EditEventPage implements OnInit {
|
||||
this.showAttendees = true;
|
||||
}
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
setTimeout(() => {
|
||||
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
|
||||
}, 500);
|
||||
@@ -250,13 +243,6 @@ export class EditEventPage implements OnInit {
|
||||
this.router.navigate(['/home', this.caller]);
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.eventsService.getRecurrenceTypes().subscribe(res => {
|
||||
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
|
||||
roundTimeQuarterHour(timeToReturn = new Date()) {
|
||||
let date = timeToReturn || new Date();
|
||||
const minutes = date.getMinutes();
|
||||
@@ -438,7 +424,9 @@ export class EditEventPage implements OnInit {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
async save_v2(editAllEvent) {
|
||||
|
||||
@XTracerAsync({name:'desktop/create-event', bugPrint: true, daley: 4000})
|
||||
async save_v2(editAllEvent, tracing?: TracingType) {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
@@ -448,15 +436,16 @@ export class EditEventPage implements OnInit {
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
try {
|
||||
|
||||
const events = []
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, editAllEvent, calendar.value).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.goBack();
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
}, ((error) => {
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
console.log('edit event error: ', error)
|
||||
}));
|
||||
|
||||
@@ -482,6 +471,7 @@ export class EditEventPage implements OnInit {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('remove attachment error: ', error)
|
||||
tracing.setAttribute('failed.remove.attachment', 'true')
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -501,89 +491,6 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
// async save() {
|
||||
|
||||
// this.injectValidation()
|
||||
// this.runValidation()
|
||||
|
||||
// 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.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 (window['reloadCalendar']) {
|
||||
// window['reloadCalendar']()
|
||||
// }
|
||||
|
||||
// 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 {
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// 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 () => {
|
||||
|
||||
// if (window['reloadCalendar']) {
|
||||
// window['reloadCalendar']()
|
||||
// }
|
||||
|
||||
// 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 {
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
|
||||
// }, error => {
|
||||
// this.httpErrorHandle.httpStatusHandle(error)
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// this.isEventEdited = true;
|
||||
|
||||
|
||||
// await this.saveDocument()
|
||||
|
||||
// this.goBack();
|
||||
// }
|
||||
|
||||
|
||||
async saveDocument() {
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user