- +
@@ -34,7 +34,7 @@
- +
@@ -80,7 +80,7 @@
- + Agenda {{ calendars }} @@ -100,7 +100,7 @@ - + Reunião @@ -130,7 +130,7 @@ @@ -158,10 +158,10 @@
--> -
+
@@ -210,9 +210,9 @@
- +
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index e95bfd286..db2417803 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -14,6 +14,7 @@ import { ParticipantsPipe } from 'src/app/pipes/participants.pipe'; import { ThemeService } from 'src/app/services/theme.service' import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; +import { ContactsService } from 'src/app/services/contacts.service' @Component({ selector: 'app-edit-event', @@ -73,6 +74,9 @@ export class EditEventPage implements OnInit { @ViewChild('inicio') inicio: any; @ViewChild('picker1') picker1: any; + + @Input() _postEvent: Event; + public options = [ { value: true, label: 'True' }, { value: false, label: 'False' } @@ -95,24 +99,39 @@ export class EditEventPage implements OnInit { public alertController: AlertController, private attachmentsService: AttachmentsService, public ThemeService: ThemeService, - private httpErrorHandle: HttpErrorHandle + private httpErrorHandle: HttpErrorHandle, + private contactsService: ContactsService ) {} ngOnInit() { - + this._postEvent = this.postEvent if(!this.restoreTemporaryData()) { // clear - if(this.postEvent) { - if( this.postEvent.Body){ - if(typeof(this.postEvent.Body.Text) == 'string'){ - this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, ''); + if(this._postEvent) { + if( this._postEvent.Body){ + if(typeof(this._postEvent.Body.Text) == 'string'){ + this._postEvent.Body.Text = this._postEvent.Body.Text.replace(/<[^>]+>/g, ''); } } } - if (this.postEvent.Attendees != null) { - const result = this.participantsPipe.transform(this.postEvent.Attendees) + + + for(const index in this._postEvent.Attendees) { + const user = this._postEvent.Attendees[index] + + const userData = this.contactsService.constacts.find(e => user.EmailAddress == e.EmailAddress) + if(userData) { + this._postEvent.Attendees[index].UserType = userData.UserType + } else { + console.log('user not set') + } + + } + + if (this._postEvent.Attendees != null) { + const result = this.participantsPipe.transform(this._postEvent.Attendees) this.taskParticipants = result.taskParticipants this.taskParticipantsCc = result.taskParticipantsCc @@ -124,23 +143,25 @@ export class EditEventPage implements OnInit { } } - this.initCalendarName = this.postEvent.CalendarName; + this.initCalendarName = this._postEvent.CalendarName; this.getRecurrenceTypes(); setTimeout(() => { - this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); + this._postEvent.EventRecurrence.Type = this._postEvent.EventRecurrence.Type.toString(); }, 500); - this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this.postEvent.CalendarId) + this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this._postEvent.CalendarId) this.changeAgenda() + + } ngOnChanges(changes: any): void { - this.loadedEventAttachments = this.postEvent.Attachments + this.loadedEventAttachments = this._postEvent.Attachments } close() { @@ -166,30 +187,30 @@ export class EditEventPage implements OnInit { injectValidation() { - if (typeof(this.postEvent.EventRecurrence.Type) == 'number') { - const str: any = this.postEvent.EventRecurrence.Type.toString() - this.postEvent.EventRecurrence.Type = str + if (typeof(this._postEvent.EventRecurrence.Type) == 'number') { + const str: any = this._postEvent.EventRecurrence.Type.toString() + this._postEvent.EventRecurrence.Type = str } this.Form = new FormGroup({ - Subject: new FormControl(this.postEvent.Subject, [ + Subject: new FormControl(this._postEvent.Subject, [ Validators.required, // Validators.minLength(4) ]), - Location: new FormControl(this.postEvent.Location, [ + Location: new FormControl(this._postEvent.Location, [ Validators.required, ]), - CalendarName: new FormControl(this.postEvent.CalendarName), - Categories: new FormControl(this.postEvent.Category, [ + CalendarName: new FormControl(this._postEvent.CalendarName), + Categories: new FormControl(this._postEvent.Category, [ Validators.required ]), - dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [ + dateOccurrence: new FormControl(this._postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this._postEvent.EventRecurrence.LastOccurrence && new Date(this._postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this._postEvent.EndDate).getTime() ? 'ok': null, [ Validators.required ]), participantes: new FormControl(this.taskParticipants, [ // Validators.required ]), - Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') <= new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[ + Date: new FormControl( new Date(this._postEvent.StartDate).toLocaleString('pt') <= new Date(this._postEvent.EndDate).toLocaleString('pt')? 'ok': null,[ Validators.required ]), @@ -254,10 +275,10 @@ export class EditEventPage implements OnInit { if(ev.length > 1){ - this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); + this._postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); } if(ev.length == 0){ - this.postEvent.EventRecurrence.Type = "-1"; + this._postEvent.EventRecurrence.Type = "-1"; } } @@ -282,10 +303,10 @@ export class EditEventPage implements OnInit { defineLastOccurrence(valor:number, opcao:boolean){ - var time = new Date(this.postEvent.EndDate); + var time = new Date(this._postEvent.EndDate); if (opcao == true) { time.setDate(time.getDate() + valor); - this.postEvent.EventRecurrence.LastOccurrence = time; + this._postEvent.EventRecurrence.LastOccurrence = time; } else { time = new Date( time.getFullYear() + valor, @@ -294,7 +315,7 @@ export class EditEventPage implements OnInit { time.getHours(), time.getMinutes() ); - this.postEvent.EventRecurrence.LastOccurrence = time; + this._postEvent.EventRecurrence.LastOccurrence = time; } } @@ -309,27 +330,27 @@ export class EditEventPage implements OnInit { return false } - this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); + this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) { - this.postEvent.EventRecurrence.Type = '-1' + if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) { + this._postEvent.EventRecurrence.Type = '-1' } else { } - if(this.postEvent.EventRecurrence.Type == undefined) { - this.postEvent.EventRecurrence.Type = '-1' + if(this._postEvent.EventRecurrence.Type == undefined) { + this._postEvent.EventRecurrence.Type = '-1' } this.showLoader = true; try { if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise() - if(this.initCalendarName != this.postEvent.CalendarName) { + await this.eventsService.editEvent(this._postEvent, 2, 3).toPromise() + if(this.initCalendarName != this._postEvent.CalendarName) { let body = { - "EventId": this.postEvent.EventId, - "CalendarDestinationName": this.postEvent.CalendarName, + "EventId": this._postEvent.EventId, + "CalendarDestinationName": this._postEvent.CalendarName, } try { @@ -339,11 +360,11 @@ export class EditEventPage implements OnInit { this.showLoader = false; this.httpErrorHandle.httpsSucessMessagge('Editar evento') } else { - await this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).toPromise() - if(this.initCalendarName != this.postEvent.CalendarName) { + await this.eventsService.editEvent(this._postEvent, 2, 3, this._postEvent.CalendarId).toPromise() + if(this.initCalendarName != this._postEvent.CalendarName) { let body = { - "EventId": this.postEvent.EventId, - "CalendarDestinationName": this.postEvent.CalendarName, + "EventId": this._postEvent.EventId, + "CalendarDestinationName": this._postEvent.CalendarName, } try { @@ -382,7 +403,7 @@ export class EditEventPage implements OnInit { //data.selected const DocumentToSave = { SourceTitle: e.SourceName, - ParentId: this.postEvent.EventId, + ParentId: this._postEvent.EventId, Source: '1', SourceId: e.SourceId, ApplicationId: e.ApplicationId.toString(), @@ -429,7 +450,7 @@ export class EditEventPage implements OnInit { saveTemporaryData() { window['temp.path:/home/agenda/edit-event.component.ts'] = { - postEvent: this.postEvent, + postEvent: this._postEvent, eventBody: this.eventBody, segment: this.segment } @@ -440,7 +461,7 @@ export class EditEventPage implements OnInit { const restoredData = window['temp.path:/home/agenda/edit-event.component.ts'] if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){ - this.postEvent = restoredData.postEvent + this._postEvent = restoredData.postEvent this.eventBody = restoredData.eventBody this.segment = restoredData.segment @@ -456,7 +477,7 @@ export class EditEventPage implements OnInit { } async getAttachments(eventId: string){ - if(this.postEvent.HasAttachments) { + if(this._postEvent.HasAttachments) { let rest: any; try { rest = this.attachmentsService.getAttachmentsById(eventId).toPromise() @@ -497,7 +518,7 @@ export class EditEventPage implements OnInit { const ApplicationIdDocumentToSave: any = { SourceName: data.selected.Assunto, - ParentId: this.postEvent.EventId, + ParentId: this._postEvent.EventId, SourceId: data.selected.Id, Stakeholders: data.selected.Stakeholders | data.selected.EntidadeOrganicaNome, ApplicationId: data.selected.ApplicationType.toString(), @@ -528,11 +549,11 @@ export class EditEventPage implements OnInit { } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) { this.CalendarNamesOptions = ['Oficial'] - this.postEvent.CalendarName = 'Oficial' + this._postEvent.CalendarName = 'Oficial' } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) { this.CalendarNamesOptions = ['Pessoal'] - this.postEvent.CalendarName = 'Pessoal' + this._postEvent.CalendarName = 'Pessoal' } else { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] diff --git a/version/git-version.ts b/version/git-version.ts index aa66797d1..10e78a90a 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "54a6fb5b6", - "SHA": "54a6fb5b6eb5d1afc53a6067dfd64519c3c3fa87", + "shortSHA": "a26f7c4f7", + "SHA": "a26f7c4f7507ee84a621083e23ee50d3c5ecc092", "branch": "developer-catch-merge", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Mon Jul 24 13:52:48 2023 +0100'", - "lastCommitMessage": "change", - "lastCommitNumber": "5107", + "lastCommitTime": "'Tue Jul 25 13:47:48 2023 +0100'", + "lastCommitMessage": "fix aparecer", + "lastCommitNumber": "5108", "change": "", - "changeStatus": "On branch developer-catch-merge\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/models/Excludetask.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: version/git-version.ts", + "changeStatus": "On branch developer-catch-merge\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/services/contacts.service.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.html\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file From 9e8bb92b9661c6ce4fbb415f07891e2cca809137 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 25 Jul 2023 16:49:51 +0100 Subject: [PATCH 3/3] fix issue 27 --- .../diplomas/diploma/diploma.page.ts | 53 +++++++++++-------- src/app/services/processes.service.ts | 6 +-- version/git-version.ts | 12 ++--- 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts index b9a9ee327..1d1283f9c 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -44,6 +44,10 @@ export class DiplomaPage implements OnInit { customDate: any; mergedArray: any = []; + + DraftNames = "" + DraftIds = "" + constructor( private processes: ProcessesService, public popoverController: PopoverController, @@ -520,29 +524,34 @@ export class DiplomaPage implements OnInit { this.mergedArray.push(docObject); }); } - getDraft(split_stringDraft: string[]) { - split_stringDraft.forEach(element => { - console.log('List of ids', element) - this.processes.GetDraftByID(element).subscribe((resd) => { - let object = { - "ApplicationId": "", - "Assunto": resd.data.description, - "DocDate": "", - "DocId": resd.data.id, - "DocNumber": "", - "FolderId": "", - "Sender": "", - "SourceDocId": "", - "content": resd.data.content, - "path": resd.data.path, - "ownerId": resd.data.ownerId, - "status": resd.data.status, - } - this.mergedArray.push(object) - console.log('List of draff', resd) - }) + async getDraft(split_stringDraft: string[]) { + this.DraftNames = "" - }); + for(const strg of split_stringDraft) { + console.log('List of ids', strg) + const resd = await this.processes.GetDraftByID(strg).toPromise() + + let object = { + "ApplicationId": "", + "Assunto": resd.data.description, + "DocDate": "", + "DocId": resd.data.id, + "DocNumber": "", + "FolderId": "", + "Sender": "", + "SourceDocId": "", + "content": resd.data.content, + "path": resd.data.path, + "ownerId": resd.data.ownerId, + "status": resd.data.status, + } + this.mergedArray.push(object) + this.DraftNames = this.DraftNames + resd.data.description+";" + console.log('List of draff', resd) + } + + this.DraftNames = this.DraftNames.slice(0, -1); + this.DraftIds = this.DraftIds.slice(0, -1); } diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index d07df3825..5e2408f94 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -276,10 +276,6 @@ export class ProcessesService { CompleteTask(body:Excludetask) { - if(!body.dataFields.DraftIds) { - body.dataFields.DraftIds = "" - } - // double check const geturl = environment.apiURL + 'Tasks/CompleteTask'; @@ -289,7 +285,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - CompleteParecerPrTask(body:any){ + CompleteParecerPrTask(body:any) { const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr'; let options = { diff --git a/version/git-version.ts b/version/git-version.ts index 10e78a90a..772c9508b 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "a26f7c4f7", - "SHA": "a26f7c4f7507ee84a621083e23ee50d3c5ecc092", + "shortSHA": "2628bc91e", + "SHA": "2628bc91e881fa3ee5f559cac57dace1fa1ccf41", "branch": "developer-catch-merge", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Tue Jul 25 13:47:48 2023 +0100'", - "lastCommitMessage": "fix aparecer", - "lastCommitNumber": "5108", + "lastCommitTime": "'Tue Jul 25 15:56:42 2023 +0100'", + "lastCommitMessage": "clear", + "lastCommitNumber": "5109", "change": "", - "changeStatus": "On branch developer-catch-merge\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/services/contacts.service.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.html\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts", + "changeStatus": "On branch developer-catch-merge\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts\n\tmodified: src/app/services/processes.service.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file