From fb1bd07ad0a5ba460b84408f87a08f72604cb41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 6 Sep 2023 21:23:21 +0100 Subject: [PATCH] a lot of changes --- src/app/Rules/despacho.service.ts | 95 ++-- .../create-process/create-process.page.html | 2 +- .../create-process/create-process.page.ts | 4 + src/app/models/eventToAprove.model.ts | 202 ++++++++ src/app/models/user.model.ts | 2 +- .../agenda/edit-event/edit-event.page.ts | 7 +- .../pages/agenda/new-event/new-event.page.ts | 445 ++++++++++++----- src/app/pages/events/events.page.html | 4 +- .../diploma-assinar/diploma-assinar.page.html | 6 +- .../approve-event-modal.page.html | 1 + .../approve-event-modal.page.ts | 4 +- .../expediente-detail.page.ts | 89 ++-- src/app/services/auth.service.ts | 4 +- src/app/services/http-error-handle.service.ts | 2 +- src/app/services/processes.service.ts | 136 +++--- .../approve-event/approve-event.page.ts | 2 +- .../agenda/edit-event/edit-event.page.ts | 2 +- .../shared/agenda/new-event/new-event.page.ts | 452 +++++++++++++----- .../group-messages/group-messages.page.ts | 23 +- src/app/shared/chat/messages/messages.page.ts | 87 ++-- src/app/shared/header/header.page.html | 2 +- src/app/shared/header/header.page.scss | 83 ++-- .../deploma-options/deploma-options.page.html | 2 +- .../deploma-options/deploma-options.page.ts | 1 + version/git-version.ts | 12 +- 25 files changed, 1187 insertions(+), 482 deletions(-) create mode 100644 src/app/models/eventToAprove.model.ts diff --git a/src/app/Rules/despacho.service.ts b/src/app/Rules/despacho.service.ts index 7bddae1c2..4e5ef779a 100644 --- a/src/app/Rules/despacho.service.ts +++ b/src/app/Rules/despacho.service.ts @@ -36,9 +36,9 @@ export class DespachoService { public p: PermissionService, public LoaderService: LoaderService, private sortService: SortService, - ) {} + ) { } - arquivar(note:string, documents:AttachmentList, serialnumber) { + arquivar(note: string, documents: AttachmentList, serialnumber) { let body = { "serialNumber": serialnumber, @@ -47,13 +47,13 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } return this.processes.CompleteTask(body) } - executado(note:string, documents:any , serialnumber) { + executado(note: string, documents: any, serialnumber) { let body = { "serialNumber": serialnumber, @@ -62,19 +62,19 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } return this.processes.CompleteTask(body) } - solicitarParecer({note, documents = [], serialnumber, activityInstanceName}) { + solicitarParecer({ note, documents = [], serialnumber, activityInstanceName }) { let body; - if(activityInstanceName == 'Concluir Despacho' - || activityInstanceName == 'Concluir Parecer' - || activityInstanceName == 'Concluir Deferimento' - || activityInstanceName == 'Tarefa de Deferimento' - ){ + if (activityInstanceName == 'Concluir Despacho' + || activityInstanceName == 'Concluir Parecer' + || activityInstanceName == 'Concluir Deferimento' + || activityInstanceName == 'Tarefa de Deferimento' + ) { body = { "serialNumber": serialnumber, "action": "Parecer", @@ -82,11 +82,11 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } } - else{ + else { body = { "serialNumber": serialnumber, "action": "Conhecimento", @@ -94,7 +94,7 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } } @@ -102,13 +102,15 @@ export class DespachoService { return this.processes.CompleteTask(body) } - EfectuarDespacho({note, documents = [], serialnumber, activityInstanceName}) { + EfectuarDespacho({ note, documents = [], serialnumber, activityInstanceName }) { + console.log('activityInstanceName', activityInstanceName) let body; - if(activityInstanceName == 'Concluir Despacho' - || activityInstanceName == 'Concluir Parecer' - || activityInstanceName == 'Concluir Deferimento' - || activityInstanceName == 'Tarefa de Deferimento' - ){ + if (activityInstanceName == 'Concluir Despacho' + || activityInstanceName == 'Concluir Parecer' + || activityInstanceName == 'Concluir Deferimento' + || activityInstanceName == 'Tarefa de Deferimento' + || activityInstanceName == 'Diploma Assinado' + ) { body = { "serialNumber": serialnumber, "action": "Despacho", @@ -116,10 +118,19 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } - } - else{ + } else if (activityInstanceName == 'Revisar Diploma') { + body = { + "serialNumber": serialnumber, + "action": "Aprovar", + "ActionTypeId": 94, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList": documents, + } + } else { body = { "serialNumber": serialnumber, "action": "Conhecimento", @@ -127,15 +138,15 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } } - + return this.processes.CompleteTask(body) } - reexecute({note, documents, serialnumber}) { + reexecute({ note, documents, serialnumber }) { let body = { "serialNumber": serialnumber, "action": "Reexecução", @@ -143,7 +154,7 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } return this.processes.CompleteTask(body) @@ -152,7 +163,7 @@ export class DespachoService { /** * @description efetuar despacho */ - CompleteTask({serialNumber, note}) { + CompleteTask({ serialNumber, note }) { const body = { "serialNumber": serialNumber, @@ -161,7 +172,7 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :null, + "AttachmentList": null, } return this.processes.CompleteTask(body) @@ -190,7 +201,7 @@ export class DespachoService { * @description for both profile PR and MDGPR */ createDespacho(body: any) { - if(this.p.userRole(['PR'])) { + if (this.p.userRole(['PR'])) { return this.processes.postDespatchoPr(body) } else { return this.processes.postDespatcho(body) @@ -198,14 +209,14 @@ export class DespachoService { } createParecer(body: any) { - if(this.p.userRole(['PR'])) { + if (this.p.userRole(['PR'])) { return this.processes.postParecerPr(body) } else { return this.processes.postParecer(body) } } - generateDiploma({note = '', documents = [], serialnumber}) { + generateDiploma({ note = '', documents = [], serialnumber }) { let body = { "serialNumber": serialnumber, "action": "Reencaminhar", @@ -213,14 +224,14 @@ export class DespachoService { "dataFields": { "ReviewUserComment": note, }, - "AttachmentList" :documents, + "AttachmentList": documents, } return this.processes.CompleteTask(body) } - async getList({updateStore = false}) { + async getList({ updateStore = false }) { if (this.LoaderService.loading) { return this.despachoStore.list @@ -234,7 +245,7 @@ export class DespachoService { try { result = await this.processes.GetTasksList("Despacho", false).toPromise(); - result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active") + result = result.filter((data: fullTaskList) => data.workflowInstanceDataFields.Status == "Active") result.forEach((element, index) => { let task: customTask = this.customTaskPipe.transform(element); @@ -244,7 +255,7 @@ export class DespachoService { despachoList = this.sortService.sortDate(despachoList, 'CreateDate') - if(updateStore) { + if (updateStore) { this.despachoStore.reset(despachoList); } @@ -253,7 +264,7 @@ export class DespachoService { } finally { this.LoaderService.pop({}) // this.loader.pop() - return this.despachoStore.list + return this.despachoStore.list } } @@ -265,18 +276,18 @@ export class DespachoService { try { result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise(); - } catch(error) { + } catch (error) { // this.loader.pop() } - + // this.loader.pop() let despachosPr; - let despachos = this.sortService.sortArrayByDate(result); + let despachos = this.sortService.sortArrayByDate(result); - if(SessionStore.user.Profile != 'PR') { + if (SessionStore.user.Profile != 'PR') { despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho"); - } else if(SessionStore.user.Profile == 'PR') { + } else if (SessionStore.user.Profile == 'PR') { despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho"); } diff --git a/src/app/modals/create-process/create-process.page.html b/src/app/modals/create-process/create-process.page.html index 3a2b4c69a..e74b9650f 100644 --- a/src/app/modals/create-process/create-process.page.html +++ b/src/app/modals/create-process/create-process.page.html @@ -69,7 +69,7 @@ appearance="fill" class="width-100 d-block" appearance="none"> - + {{type.Description}} diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 621b6b7e0..8767490d4 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -175,6 +175,7 @@ export class CreateProcessPage implements OnInit { } ngOnInit() { + console.log('crete process') this.getSubjectType(); setTimeout(() => { this.selectedTypes = ['99999850']; @@ -199,6 +200,7 @@ export class CreateProcessPage implements OnInit { getSubjectType() { this.processes.GetSubjectType().subscribe(res => { + console.log('subjectTypes',res) this.subjectTypes = res; }); } @@ -315,6 +317,7 @@ export class CreateProcessPage implements OnInit { } else { if (this.loggeduser.Profile != 'PR') { + console.log('Despacho MD'); switch (this.taskType) { case '0': // Despacho this.postData = { @@ -399,6 +402,7 @@ export class CreateProcessPage implements OnInit { break; } } else if (this.loggeduser.Profile == 'PR') { + console.log('Despacho PR'); switch (this.taskType) { case '0': // Despacho PR diff --git a/src/app/models/eventToAprove.model.ts b/src/app/models/eventToAprove.model.ts new file mode 100644 index 000000000..870fd03a6 --- /dev/null +++ b/src/app/models/eventToAprove.model.ts @@ -0,0 +1,202 @@ +import { Attachment } from './attachment.model'; +import { EventBody } from './eventbody.model'; +import { EventPerson } from './eventperson.model'; + + +export interface EventRecurrence { + Type: number | string; + Day?: number; + DayOfWeek?: number; + Month?: number | string; + LastOccurrence?: Date | string; +} + +export class EventToAprove { + EventProcess: { + EventId: string; + Subject: string; + Body: EventBody; + Location: string; + CalendarId: string; + CalendarName: string; + StartDate: Date; + EndDate: Date; + EventType: string; + ParticipantsList: EventPerson[]; + IsAllDayEvent: boolean; + IsMeeting: boolean; + IsRecurring: boolean; + AppointmentState: number; + TimeZone: string; + Organizer: any + Category: string; + HasAttachments: boolean; + EventRecurrence: EventRecurrence; + Status: string; + wxUserID: number; + Role: number + } + Attachments?: Attachment[]; + InstanceID: string +} + + + + +// event to approve details ================================================ +export interface Originator { + email: string; + manager: string; + displayName: string; + fqn: string; + username: string; +} + +export interface WorkflowInstanceDataFields { + Body: string; + Location: string; + Subject: string; + StartDate: string; + EndDate: string; + Participants?: string; + CC?: string; + ReviewUserComment?: string; + Role?: number; + MDName: string; + MDEmail: string; + OriginatorComments?: string; + Status?: string; + TimeZone?: string; + Agenda: string; + EventType: string; + EventID?: string; + IsRecurring?: any; + HasAttachments?: boolean; + ParticipantsList?: any; + EventOrganizer?: string; + CreateEvent?: string; + IsAllDayEvent: boolean; + SerializedItem?: string; + MDwxUserID?: number; + DeserializedItem?: string; + Message: string; + InstanceId: string; + Header?: string; + RecurringString?: string; + LastOccurrence: string; + OccurrenceType: string; + SerialNumber?: string; + UserEmail?: string; + PREmail?: string; +} + +export interface EventToApproveDetails { + serialNumber: string; + originator?: Originator; + actions?: string[]; + activityInstanceName?: string; + workflowInstanceFolio?: string; + taskStartDate?: string; + workflowID?: number; + workflowInstanceID?: number; + workflowName?: string; + workflowDisplayName?: string; + formURL?: string; + workflowInstanceDataFields: WorkflowInstanceDataFields; + totalDocuments?: any; + Documents?: any; +} +// ================================================================================ + + +// event event to approve ================ +export interface ParticipantsList { + Id: number; + EmailAddress: string; + Name: string; + IsRequired: boolean; +} + + +export interface EventToApproveEdit { + SerialNumber: string; + Body: string; + Location: string; + Subject: string; + StartDate: Date | string; + EndDate: Date | string; + ReviewUserComment: string; + MDName: string; + MDEmail: string; + IsAllDayEvent: boolean; + Status: string; + Category: string + EventType: string; + IsRecurring: boolean; + ParticipantsList: ParticipantsList[]; + Message: string; + EventRecurrence: EventRecurrence; + Participants?: string; + CC?: string; + Agenda: string; + HasAttachments?: boolean; + EventOrganizer?: string; + InstanceId?: string; +} + +// // ================================================================================ +// export interface EventToApproveDetails { +// serialNumber: string; +// originator: { +// email: string; +// manager: string; +// displayName: string; +// fqn: string; +// username: string; +// }[] +// actions: string[]; +// activityInstanceName: string; +// workflowInstanceFolio: string; +// taskStartDate: string; +// workflowID: number; +// workflowInstanceID: number; +// workflowName: string; +// workflowDisplayName: string; +// formURL: string; +// workflowInstanceDataFields: { +// Body: string; +// Location: string; +// Subject: string; +// StartDate: string; +// EndDate: string; +// Participants: string; +// CC: string; +// Private: boolean; +// ReviewUserComment: string; +// MDName: string; +// MDEmail: string; +// OriginatorComments: string; +// Agenda: string; +// EventType: string; +// TimeZone: string; +// EventID: string; +// HasAttachments: boolean; +// ParticipantsList: { +// $type?: any; +// EmailAddress: string; +// Name: string; +// IsRequired: boolean; +// }[] +// EventOrganizer: string; +// CreatEvent: string; +// IsAllDayEvent: boolean; +// MDwxUserID: number; +// SerializedItem: string; +// DeserializedItem: string; +// Status: string; +// Message: string; +// InstanceId: string; +// } +// totalDocuments?: any; +// Documents?: any; +// } diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts index c0b04b2bc..8a6664b29 100644 --- a/src/app/models/user.model.ts +++ b/src/app/models/user.model.ts @@ -90,7 +90,7 @@ export class UserSession { UserName: string Password: string RochetChatUserId: string - Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Unknown' ; + Profile: 'PR' | 'MDGPR' | 'Consultant' | 'SGGPR' | 'Unknown' ; LoginPreference: 'None' | 'Password' | 'Pin' | null; PIN: string Inactivity: boolean diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 96cc5f8a3..052aaf203 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -190,6 +190,10 @@ export class EditEventPage implements OnInit { }) }, 1000); + ngOnChanges(changes: any): void { + this.loadedEventAttachments = this.postEvent?.Attachments + } + close() { this.modalController.dismiss(); } @@ -421,7 +425,7 @@ export class EditEventPage implements OnInit { this.isEventEdited = true; - await this.saveDocument() + /* await this.saveDocument() */ this.goBack(); } @@ -595,6 +599,7 @@ export class EditEventPage implements OnInit { this.loadedEventAttachments.push(ApplicationIdDocumentToSave) + this.postEvent.Attachments = this.loadedEventAttachments; } }) diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 0999f2aa5..c8c780d3e 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -20,6 +20,7 @@ import { SessionStore } from 'src/app/store/session.service'; import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { environment } from 'src/environments/environment'; +import { ProcessesService } from 'src/app/services/processes.service'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -59,8 +60,8 @@ export class NewEventPage implements OnInit { postEvent: Event; eventBody: EventBody; - segment:string = "true"; - profile:string; + segment: string = "true"; + profile: string; eventAttendees: EventPerson[]; selectedSegment: string; selectedDate: Date; @@ -73,10 +74,10 @@ export class NewEventPage implements OnInit { taskParticipants: any = []; taskParticipantsCc: any = []; - documents:SearchList[] = []; + documents: SearchList[] = []; loggeduser: LoginUserRespose; - members:any; + members: any; CalendarName; SessionStore = SessionStore; @@ -88,7 +89,7 @@ export class NewEventPage implements OnInit { autoStartTime; autoEndTime; CalendarNamesOptions = ['Oficial', 'Pessoal'] - roomId:string; + roomId: string; globalEnd = new Date('1999') environment = environment @@ -101,12 +102,13 @@ export class NewEventPage implements OnInit { public ThemeService: ThemeService, private platform: Platform, private chatMethodService: ChatMethodsService, - private hhtpErrorHandle: HttpErrorHandle + private hhtpErrorHandle: HttpErrorHandle, + private processeService: ProcessesService ) { this.loggeduser = SessionStore.user; this.postEvent = new Event(); - this.postEvent.EventRecurrence = {Type:'-1'}; - this.eventBody = { BodyType : "1", Text : ""}; + this.postEvent.EventRecurrence = { Type: '-1' }; + this.eventBody = { BodyType: "1", Text: "" }; this.postEvent.Body = this.eventBody; this.roomId = this.navParams.get('roomId'); @@ -121,9 +123,9 @@ export class NewEventPage implements OnInit { // this.taskParticipants = []; } - if(!this.CalendarName) { + if (!this.CalendarName) { console.log('true', this.eventService.calendarNamesAry.includes('Meu calendario')) - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { + if (this.eventService.calendarNamesAry.includes('Meu calendario')) { this.CalendarName = 'Meu calendario'; console.log(this.eventService.calendarNamesAry) } else { @@ -136,7 +138,7 @@ export class NewEventPage implements OnInit { this.getRecurrenceTypes(); - if(this.selectedSegment != "Combinada"){ + if (this.selectedSegment != "Combinada") { this.postEvent = { EventId: '', Subject: '', @@ -155,10 +157,10 @@ export class NewEventPage implements OnInit { Organizer: '', Category: 'Reunião', HasAttachments: false, - EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, + EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, }; } - else{ + else { this.postEvent = { EventId: '', Subject: '', @@ -177,15 +179,15 @@ export class NewEventPage implements OnInit { Organizer: '', Category: 'Reunião', HasAttachments: false, - EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, + EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, }; } window.onresize = (event) => { - if( window.innerWidth >= 1024) { + if (window.innerWidth >= 1024) { this.modalController.dismiss(); } - }; + }; this.setDefaultTime() @@ -199,8 +201,8 @@ export class NewEventPage implements OnInit { } myInterval = setInterval(() => { - document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { - if(e) { + document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => { + if (e) { e.disabled = true; } }) @@ -221,8 +223,8 @@ export class NewEventPage implements OnInit { const minutes = date.getMinutes(); date.setSeconds(0); - if(minutes % 15 != 0) { - + if (minutes % 15 != 0) { + if (minutes > 45) { date.setMinutes(60) } else if (minutes > 30) { @@ -233,65 +235,65 @@ export class NewEventPage implements OnInit { date.setMinutes(15) } - } + } return date } - roundTimeQuarterHourPlus15(date:Date) { + roundTimeQuarterHourPlus15(date: Date) { const _date = new Date(date); - const minutes = _date .getMinutes(); - _date .setMinutes(minutes + 15) - return _date + const minutes = _date.getMinutes(); + _date.setMinutes(minutes + 15) + return _date } - + setStartDate() { - if(!this.postEvent.StartDate) { + if (!this.postEvent.StartDate) { this.postEvent.StartDate = this.roundTimeQuarterHour(); } } - setEndDate(){ - if(!this.postEvent.EndDate) { + setEndDate() { + if (!this.postEvent.EndDate) { this.postEvent.EndDate = this.postEvent.StartDate; } } getRecurrenceTypes() { - this.eventService.getRecurrenceTypes().subscribe( res => { - + this.eventService.getRecurrenceTypes().subscribe(res => { + this.recurringTypes = res; }); } - onSelectedRecurringChanged(ev:any) { + onSelectedRecurringChanged(ev: any) { this.calculetedLastOccurrence(ev); - - if(ev.length > 1) { - + + if (ev.length > 1) { + this.selectedRecurringType = ev.filter(data => data != '-1'); } - if(ev.length == 0) { + if (ev.length == 0) { this.selectedRecurringType = "-1"; } } - calculetedLastOccurrence(type:number){ + calculetedLastOccurrence(type: number) { // console.log(type); - var valor; + var valor; var opcao: boolean; if (type == 0) { valor = 7; opcao = true; - } else if(type == 1){ + } else if (type == 1) { valor = 30; opcao = true; - } else if(type == 2){ + } else if (type == 2) { valor = 1; opcao = false; - }else if(type == 3){ + } else if (type == 3) { valor = 5; opcao = false; } @@ -299,28 +301,28 @@ export class NewEventPage implements OnInit { } - defineLastOccurrence(valor:number, opcao:boolean){ + defineLastOccurrence(valor: number, opcao: boolean) { var time = new Date(this.postEvent.EndDate); if (opcao == true) { time.setDate(time.getDate() + valor); this.postEvent.EventRecurrence.LastOccurrence = time; } else { time = new Date( - time.getFullYear() + valor, - time.getMonth(), - time.getDate(), - time.getHours(), + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), time.getMinutes() ); this.postEvent.EventRecurrence.LastOccurrence = time; } - + } runValidation() { - this.validateFrom = true; - if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){ + this.validateFrom = true; + if (new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()) { this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento") } } @@ -328,7 +330,7 @@ export class NewEventPage implements OnInit { get dateValid() { if (window.innerWidth <= 800) { - return this.postEvent.StartDate < this.postEvent.EndDate? ['ok']: [] + return this.postEvent.StartDate < this.postEvent.EndDate ? ['ok'] : [] } else { return ['ok'] } @@ -347,7 +349,7 @@ export class NewEventPage implements OnInit { CalendarName: new FormControl(this.postEvent.CalendarName, [ Validators.required ]), - Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()? 'ok': null,[ + Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required ]), Categories: new FormControl(this.postEvent.Category, [ @@ -356,76 +358,83 @@ export class NewEventPage implements OnInit { participantes: new FormControl(this.taskParticipants, [ 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 ]), - + }) } openInicio() { let input: any = document.querySelector('#new-inicio') - if(input) { - + if (input) { + input.click() } } openFim() { let input: any = document.querySelector('#new-fim') - if(input) { + if (input) { input.click() } } openLastOccurrence() { let input: any = document.querySelector('#last-occurrence') - if(input) { + if (input) { input.click() } } async save() { + this.injectValidation() this.runValidation() - if(this.Form.invalid) { + if (this.Form.invalid) { return false } - if(this.documents.length >= 0) { + if (this.documents.length >= 0) { this.postEvent.HasAttachments = true; } - if(this.selectedRecurringType != '-1') { + if (this.selectedRecurringType != '-1') { this.postEvent.EventRecurrence.Type = this.selectedRecurringType; } this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - let eventId: any; + let eventId: any; - const loader = this.toastService.loading() + const loader = this.toastService.loading() try { 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') } - else if(this.loggeduser.Profile == 'PR') { - + else if (this.loggeduser.Profile == 'PR') { + 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') + } else if (this.loggeduser.Profile == 'SGGPR') { + + + this.saveAproveEvent(); + + } else { const CalendarId = this.selectedCalendarId() @@ -433,50 +442,54 @@ export class NewEventPage implements OnInit { eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise(); this.hhtpErrorHandle.httpsSucessMessagge('new event') - + } - 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: '' - }; - }); + //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') { - await DocumentToSave.forEach( async (attachments, i) => { - try { - await this.attachmentsService.setEventAttachmentById(attachments).toPromise(); - } catch(error) { - + 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) { + + } + + }); + + 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); + } - let data1 = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": eventId, - "calendarId": CalendarId + this.hhtpErrorHandle.httpsSucessMessagge('new event'); + let data = Object.assign(this.postEvent, { id: eventId }) + this.modalController.dismiss(data); } - 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); - } catch (error) { - this.hhtpErrorHandle.httpStatusHandle(error) + this.hhtpErrorHandle.httpStatusHandle(error) } finally { loader.remove() } @@ -484,7 +497,7 @@ export class NewEventPage implements OnInit { } - selectedCalendarId () { + selectedCalendarId() { if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') { return this.eventService.calendarNamesType[this.CalendarName]['OficialId'] @@ -502,18 +515,18 @@ export class NewEventPage implements OnInit { setTimeout(() => { - if(this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - + if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - + } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { this.CalendarNamesOptions = ['Oficial'] this.postEvent.CalendarName = 'Oficial' - + } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { this.CalendarNamesOptions = ['Pessoal'] this.postEvent.CalendarName = 'Pessoal' - + } else { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } @@ -525,7 +538,7 @@ export class NewEventPage implements OnInit { const modal = await this.modalController.create({ component: AttendeesPageModal, - componentProps: { + componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc @@ -538,9 +551,9 @@ export class NewEventPage implements OnInit { modal.onDidDismiss().then((data) => { - if(data) { + if (data) { data = data['data']; - if(data) { + if (data) { const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; @@ -589,8 +602,8 @@ export class NewEventPage implements OnInit { } }); - modal.onDidDismiss().then((res)=>{ - if(res){ + modal.onDidDismiss().then((res) => { + if (res) { const data = res.data; this.documents.push(data.selected); } @@ -601,19 +614,219 @@ export class NewEventPage implements OnInit { removeAttachment(index: number) { - this.documents = this.documents.filter( (e, i) => index != i); + this.documents = this.documents.filter((e, i) => index != i); } checkRoleInArray() { for (let index = 0; index < this.eventService.calendarNamesAry.length; index++) { console.log('ROLE1', this.eventService.calendarNamesAry[index]) - + } for (let index = 0; index < this.eventService.calendarRole.length; index++) { - console.log('ROLE2',this.eventService.calendarRole[index]) - + console.log('ROLE2', this.eventService.calendarRole[index]) + } } + + //Deve ser removido posteriormente + async saveAproveEvent() { + + 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) { + + } + console.log('selectedCalendar', selectedCalendar) + + 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: '' + }; + }); + + 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(); + } + }); + }); + + if (DocumentToSave.length == 0) { + this.afterSave(); + } */ + + }, (error) => { + loader.remove() + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + + + } 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: '' + }; + }); + + 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(); + } + }); + }); + + if (DocumentToSave.length == 0) { + this.afterSave(); + } */ + + }, (error) => { + loader.remove() + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + + } + + + + } + + if (!selectedCalendar && this.CalendarName == "Meu calendario") { + console.log('SG generic') + this.postEvent.CalendarName + + const CalendarId = this.selectedCalendarId() + let loader = this.toastService.loading(); + + this.postEvent.CalendarId = CalendarId + + this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( + (id) => { + loader.remove(); + + 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: '' + }; + }); + + DocumentToSave.forEach((attachments, i) => { + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { + } + }); + }); + + 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); + } + + let dataa = Object.assign(this.postEvent, { id: eventId }) + this.modalController.dismiss(dataa); + }, (error) => { + + loader.remove() + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + } + + } + + // Deve ser removido posteriormente + eventToaproveBody(event, calendarId, role, userId, attachments) { + let toAproveObject = { + "EventProcess": { + "Body": event.Body, + "Location": event.Location, + "Subject": event.Subject, + "StartDate": event.StartDate, + "EndDate": event.EndDate, + "Status": "Active", + "IsAllDayEvent": event.IsRecurring, + "EventType": event.EventType, + "ParticipantsList": event.Attendees, + "EventRecurrence": event.EventRecurrence, + "HasAttachments": event.HasAttachments, + "CalendarId": calendarId, + "Role": role, + "wxUserID": userId, + "TimeZone": "W. Central Africa Standard Time" + }, + "Attachments": attachments, + "InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate() + } + + return toAproveObject; + } } diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 313aabf90..af111bdc6 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -245,8 +245,8 @@
-
{{event.Subject}}
-
+
{{event.Subject}}
+

{{event.Location}}

diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html index a349f843b..5d9bba4c9 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html @@ -22,11 +22,11 @@
-
+
- -
+ +
diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html index 171621ffd..5f02fa00a 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html @@ -113,5 +113,6 @@ + diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 76682aa1a..9c5a8bac7 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -127,14 +127,14 @@ export class ApproveEventModalPage implements OnInit { async rejectTask(serialNumber:string) { - let body = { "serialNumber": serialNumber, "action": "Descartar" } + let body = { "serialNumber": serialNumber, "action": "Rejeitar" } const loader = this.toastService.loading() try { await this.processes.PostTaskAction(body).toPromise() - this.toastService._successMessage('Evento rejeitado', () =>{ + this.toastService._successMessage('Evento Eliminado!', () =>{ this.router.navigate(['/home/gabinete-digital/event-list']); }) } catch (error) { diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index c3a357641..f4fd3ccbf 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -62,7 +62,7 @@ export class ExpedienteDetailPage implements OnInit { onlinecheck: boolean; loggeduser: LoginUserRespose; - + constructor( private processes: ProcessesService, private router: Router, @@ -84,7 +84,7 @@ export class ExpedienteDetailPage implements OnInit { ) { this.loggeduser = SessionStore.user // console.log('SessionStore', SessionStore) - + this.activatedRoute.paramMap.subscribe(params => { if (params["params"].SerialNumber) { this.serialNumber = params["params"].SerialNumber; @@ -114,13 +114,13 @@ export class ExpedienteDetailPage implements OnInit { // updateProcessDB(res) { // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { // this.storage.set('expediente_details',res).then(() =>{ - + // }) // } else { // //this.sqliteservice.updateProcess(res) // } // } - + // getFromDB() { // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { // this.storage.get('expediente_details').then((process) => { @@ -165,7 +165,7 @@ export class ExpedienteDetailPage implements OnInit { // this.platform.ready().then(() => { // this.onlinecheck = false; // this.sqliteservice.getProcessById(this.serialNumber).then((process) => { - + // var workflow = JSON.parse(process[0].workflowInstanceDataFields); // var origina @@ -229,7 +229,7 @@ export class ExpedienteDetailPage implements OnInit { "AttachmentList": documents, } - + const loader = this.toastService.loading() @@ -283,7 +283,7 @@ export class ExpedienteDetailPage implements OnInit { component: AddNotePage, componentProps: { showAttachmentBtn: false, - actionName:actionName + actionName: actionName }, cssClass: classs, //backdropDismiss: true @@ -292,7 +292,7 @@ export class ExpedienteDetailPage implements OnInit { modal.onDidDismiss().then(res => { - + if (res.data) { const DocumentToSave = res.data.documents.map((e) => { return { @@ -337,7 +337,7 @@ export class ExpedienteDetailPage implements OnInit { sendExpedienteToPending() { const loader = this.toastService.loading() this.processes.SetTaskToPending(this.serialNumber).subscribe(res => { - + this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes') this.TaskService.loadExpedientes() this.goBack(); @@ -352,7 +352,7 @@ export class ExpedienteDetailPage implements OnInit { async LoadTaskDetail(serial: string) { this.processes.GetTask(serial).subscribe(res => { - + this.TaskService.loadExpedientes(); this.task = { @@ -444,11 +444,11 @@ export class ExpedienteDetailPage implements OnInit { // } getAttachments(serialNumber) { - + this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => { this.attachments = res; - + }); } @@ -472,9 +472,10 @@ export class ExpedienteDetailPage implements OnInit { if (res) { const data = res.data; this.documents.push(data.selected); - await this.documents.forEach( async (element: any) => { + let body + await this.documents.forEach(async (element: any) => { - let body = { + body = { "InstanceID": this.task.InstanceID, "WorkflowDisplayName": this.task.WorkflowName, "FolderID": this.task.FolderId, @@ -485,22 +486,22 @@ export class ExpedienteDetailPage implements OnInit { const Attachments = this.searchDocumentPipe.transformToAttachment(element) body.Attachments = Attachments; - - const loader = this.toastService.loading() - - try { - loader.remove() - await this.attachmentsService.AddAttachment(body).toPromise() - this.toastService._successMessage() - } catch(error) { - if(error.status == 0) { - this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') - } else { - - this.toastService._badRequest() - } - } }); + + const loader = this.toastService.loading() + + try { + loader.remove() + await this.attachmentsService.AddAttachment(body).toPromise() + this.toastService._successMessage() + } catch (error) { + if (error.status == 0) { + this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + } else { + + this.toastService._badRequest() + } + } } setTimeout(() => { this.LoadTaskDetail(this.serialNumber); @@ -563,8 +564,8 @@ export class ExpedienteDetailPage implements OnInit { }); modal.onDidDismiss().then(async (res) => { - - + + if (body == 'descartar') { this.TaskService.loadExpedientes() @@ -577,10 +578,10 @@ export class ExpedienteDetailPage implements OnInit { this.toastService._successMessage('Processo descartado'); this.goBack(); } catch (error) { - if(error.status == 0) { + if (error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest('Processo não descartado') } } finally { @@ -601,10 +602,10 @@ export class ExpedienteDetailPage implements OnInit { //this.toastService._successMessage('Processo descartado'); this.goBack(); } catch (error) { - if(error.status == 0) { + if (error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest('Processo não descartado') } } finally { @@ -613,17 +614,17 @@ export class ExpedienteDetailPage implements OnInit { } else if (res['data'] == 'No') { - + const loader = this.toastService.loading() try { await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise(); this.toastService._successMessage(); this.goBack(); } catch (error) { - if(error.status == 0) { + if (error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest() } } finally { @@ -639,7 +640,7 @@ export class ExpedienteDetailPage implements OnInit { } async openBookMeetingModal(task: any) { - + let classs; if (window.innerWidth < 701) { @@ -651,7 +652,7 @@ export class ExpedienteDetailPage implements OnInit { component: BookMeetingModalPage, componentProps: { task: this.task, - fulltask:this.fulltask + fulltask: this.fulltask }, cssClass: classs, backdropDismiss: false @@ -671,7 +672,7 @@ export class ExpedienteDetailPage implements OnInit { } async viewEventDetail(eventId: any) { - + const modal = await this.modalController.create({ component: ViewEventPage, @@ -722,7 +723,7 @@ export class ExpedienteDetailPage implements OnInit { this.dataService.set("newGroupName", this.task.Folio); this.dataService.set("documents", this.fulltask.Documents); this.dataService.set("link", window.location.pathname); - setTimeout(()=> { + setTimeout(() => { this.router.navigate(['/home/chat']); }, 100) } @@ -739,12 +740,12 @@ export class ExpedienteDetailPage implements OnInit { }); modal.onDidDismiss().then( - ()=>{}, + () => { }, (error) => { console.log(error) }) - await modal.present(); + await modal.present(); } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 1dda9c0d1..18a3ca937 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -147,7 +147,9 @@ export class AuthService { session.Profile = 'MDGPR' } else if(session.RoleID == 99999872) { session.Profile = 'Consultant' - } else { + } else if(session.RoleID == 99999886) { + session.Profile = 'SGGPR' + }else { session.Profile = 'Unknown' } diff --git a/src/app/services/http-error-handle.service.ts b/src/app/services/http-error-handle.service.ts index dbb3acd7e..dfa5eed97 100644 --- a/src/app/services/http-error-handle.service.ts +++ b/src/app/services/http-error-handle.service.ts @@ -122,7 +122,7 @@ export class HttpErrorHandle { this.toastService._successMessage('Evento aprovado!') break; case 'Rejeitar': - this.toastService._successMessage('Evento Rejeitado!') + this.toastService._successMessage('Evento Eliminado!') break; case 'Dar o meu Parecer': this.toastService._successMessage('Parecer enviado!') diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index df472d429..73890a34a 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -20,8 +20,8 @@ export class ProcessesService { loggeduser: LoginUserRespose; headers: HttpHeaders; headers2: HttpHeaders; - - + + constructor( private http: HttpClient, @@ -31,12 +31,12 @@ export class ProcessesService { this.loggeduser = SessionStore.user; this.setHeader() - this.changeProfileService.registerCallback(()=>{ + this.changeProfileService.registerCallback(() => { this.loggeduser = SessionStore.user; this.setHeader() }) - + } @@ -50,11 +50,11 @@ export class ProcessesService { this.headers2 = new HttpHeaders(); - this.headers2 = this.headers2.set('Authorization',"Bearer "+ CPSession.AuthorizationJwt); + this.headers2 = this.headers2.set('Authorization', "Bearer " + CPSession.AuthorizationJwt); } - uploadFile(formData:any){ + uploadFile(formData: any) { //const geturl = environment.apiURL + 'Tasks/DelegateTask'; const geturl = environment.apiURL + 'lakefs/UploadFiles'; @@ -66,8 +66,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, formData, options); } - GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable - { + GetTasksList(processname: typeof GetTasksListType, onlycount: boolean): Observable { const geturl = environment.apiURL + 'tasks/List'; let params = new HttpParams(); @@ -119,7 +118,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetTask(serialnumber:string): Observable { + GetTask(serialnumber: string): Observable { const geturl = environment.apiURL + 'Tasks/FindTask'; let params = new HttpParams(); @@ -133,7 +132,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetDraftByID(id:string): Observable { + GetDraftByID(id: string): Observable { const geturl = environment.apiPCURL + `Documents/${id}`; let params = new HttpParams(); @@ -147,7 +146,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - SaveDraftByID(id:string, object): Observable { + SaveDraftByID(id: string, object): Observable { const geturl = environment.apiPCURL + `Documents/${id}`; let params = new HttpParams(); @@ -160,7 +159,7 @@ export class ProcessesService { return this.http.put(`${geturl}`, object, options); } - SetTaskToPending(serialNumber:string): Observable{ + SetTaskToPending(serialNumber: string): Observable { const geturl = environment.apiURL + 'Tasks/SetTaskPending'; let params = new HttpParams(); @@ -170,10 +169,10 @@ export class ProcessesService { headers: this.headers, params: params }; - return this.http.post(`${geturl}`,'', options); + return this.http.post(`${geturl}`, '', options); } - GetPendingTasks(onlyCount: boolean){ + GetPendingTasks(onlyCount: boolean) { const geturl = environment.apiURL + 'Tasks/ListPending'; let params = new HttpParams(); @@ -187,7 +186,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - DelegateTask(body:any){ + DelegateTask(body: any) { const geturl = environment.apiURL + 'Tasks/DelegateTask'; let options = { @@ -196,7 +195,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options); } - GetTaskParticipants(folderId): Observable{ + GetTaskParticipants(folderId): Observable { const geturl = environment.apiURL + 'Processes/GetUsersInDispash'; let params = new HttpParams(); @@ -209,8 +208,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - FindTaskDocId(serialnumber:string): Observable - { + FindTaskDocId(serialnumber: string): Observable { const geturl = environment.apiURL + 'Tasks/FindExpedienteDocId'; let params = new HttpParams(); @@ -223,8 +221,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetMDOficialTasks(): Observable - { + GetMDOficialTasks(): Observable { const geturl = environment.apiURL + 'tasks/GetMDOficialTasks'; let options = { headers: this.headers, @@ -232,8 +229,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetMDPersonalTasks(): Observable - { + GetMDPersonalTasks(): Observable { const geturl = environment.apiURL + 'tasks/GetMDPersonalTasks'; let options = { headers: this.headers, @@ -241,8 +237,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetToApprovedEvents(categoryname:string, count:string): Observable - { + GetToApprovedEvents(categoryname: string, count: string): Observable { const geturl = environment.apiURL + 'Tasks/ListByCategory'; let params = new HttpParams(); @@ -256,7 +251,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - PostTaskAction(body:any){ + PostTaskAction(body: any) { const geturl = environment.apiURL + 'Tasks/Complete'; let options = { @@ -274,7 +269,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - CompleteTask(body:Excludetask) { + CompleteTask(body: Excludetask) { // double check const geturl = environment.apiURL + 'Tasks/CompleteTask'; @@ -285,7 +280,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 = { @@ -294,7 +289,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - UpdateTaskStatus(FolderId:any): Observable{ + UpdateTaskStatus(FolderId: any): Observable { const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus'; let params = new HttpParams(); @@ -304,10 +299,10 @@ export class ProcessesService { headers: this.headers, params: params }; - return this.http.post(`${geturl}`,'', options); + return this.http.post(`${geturl}`, '', options); } - GetDocumentUrl(DocId:string, FsId:string): Observable{ + GetDocumentUrl(DocId: string, FsId: string): Observable { const geturl = environment.apiURL + 'ecm/document/viewrequestshort'; let params = new HttpParams(); @@ -321,7 +316,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - postDespatcho(body:any) { + postDespatcho(body: any) { const geturl = environment.apiURL + 'Processes/CreateDispatch'; let options = { headers: this.headers, @@ -329,7 +324,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - postDespatchoPr(body:any) { + postDespatchoPr(body: any) { const geturl = environment.apiURL + 'Processes/CreateDispatchPR'; let options = { headers: this.headers, @@ -337,24 +332,24 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - postParecer(body:any) { + postParecer(body: any) { try { - if(!body.AttachmentList) { + if (!body.AttachmentList) { body.AttachmentList = {} } - if(!body?.dataFields) { + if (!body?.dataFields) { body.dataFields = {} } - if(!body.dataFields?.DraftIds) { + if (!body.dataFields?.DraftIds) { body.dataFields.DraftIds = "" } - if(!body.AttachmentList?.DraftIds) { + if (!body.AttachmentList?.DraftIds) { body.AttachmentList.DraftIds = "" } - } catch (error) {} + } catch (error) { } + - const geturl = environment.apiURL + 'Processes/CreateParecer'; let options = { headers: this.headers, @@ -362,22 +357,22 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - postParecerPr(body:any) { - try { - if(!body.AttachmentList) { + postParecerPr(body: any) { + try { + if (!body.AttachmentList) { body.AttachmentList = {} } - if(!body?.dataFields) { + if (!body?.dataFields) { body.dataFields = {} } - if(!body.dataFields?.DraftIds) { + if (!body.dataFields?.DraftIds) { body.dataFields.DraftIds = "" } - if(!body.AttachmentList?.DraftIds) { + if (!body.AttachmentList?.DraftIds) { body.AttachmentList.DraftIds = "" } - } catch(error) {} - + } catch (error) { } + const geturl = environment.apiURL + 'Processes/CreateParecerPR'; let options = { @@ -386,7 +381,7 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - postDeferimento(body:any){ + postDeferimento(body: any) { const geturl = environment.apiURL + 'Processes/CreateDeferimento'; let options = { headers: this.headers, @@ -394,12 +389,12 @@ export class ProcessesService { return this.http.post(`${geturl}`, body, options) } - GetActionsList(){ + GetActionsList() { const geturl = environment.apiURL + 'presidentialActions'; let options = { headers: this.headers, }; - + return this.http.get(`${geturl}`, options); } @@ -412,7 +407,7 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - GetDocumentDetails(DocId:string, FsId:string){ + GetDocumentDetails(DocId: string, FsId: string) { const geturl = environment.apiURL + 'search/documents'; let params = new HttpParams(); @@ -430,15 +425,15 @@ export class ProcessesService { documentSetUpMeeting(body: DocumentSetUpMeeting) { let url = environment.apiURL + 'Processes/CallMeeting'; - url = url.replace('/V4/','/V5/') + url = url.replace('/V4/', '/V5/') let options: any = { headers: this.headers, } - return this.http.post(`${url}`,body, options); + return this.http.post(`${url}`, body, options); } - DocumentDetail(DocId:string, FsId:string){ + DocumentDetail(DocId: string, FsId: string) { const geturl = environment.apiURL + 'ecm/GetDocument'; let params = new HttpParams(); @@ -472,7 +467,7 @@ export class ProcessesService { - GetViewer(DocId:string, FsId:string){ + GetViewer(DocId: string, FsId: string) { const geturl = environment.apiURL + 'ecm/document/viewfile'; let params = new HttpParams(); @@ -493,7 +488,36 @@ export class ProcessesService { let options = { headers: this.headers, }; - return this.http.post(`${geturl}`,file, options); + return this.http.post(`${geturl}`, file, options); + } + + createEventToAprove(calendarType, agenda, body) { + + const geturl = environment.apiURL + 'Processes/CreateEvent/' + agenda; + let params = new HttpParams(); + params = params.set('calendarName', calendarType); + let options = { + headers: this.headers, + params: params + }; + return this.http.post(`${geturl}`, body, options); + } + + generateInstaceFormatDate(): string { + const data = new Date(); + + const ano = data.getFullYear().toString().padStart(4, '0'); + const mes = (data.getMonth() + 1).toString().padStart(2, '0'); + const dia = data.getDate().toString().padStart(2, '0'); + + const horas = data.getHours().toString().padStart(2, '0'); + const minutos = data.getMinutes().toString().padStart(2, '0'); + const segundos = data.getSeconds().toString().padStart(2, '0'); + const milissegundos = data.getMilliseconds().toString().padStart(3, '0'); + + const dataFormatada = `${ano}-${mes}-${dia}_${horas}:${minutos}:${segundos}.${milissegundos}`; + + return dataFormatada; } } diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index dec1f2a5a..e152e85a0 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -108,7 +108,7 @@ export class ApproveEventPage implements OnInit { async rejectTask(serialNumber:string) { - let body = { "serialNumber": serialNumber, "action": "Descartar" } + let body = { "serialNumber": serialNumber, "action": "Rejeitar" } const loader = this.toastService.loading() 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 0d68bda7f..4625091dc 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -397,7 +397,7 @@ export class EditEventPage implements OnInit { this.clearPostEvent.emit(); this.deleteTemporaryData(); - await this.saveDocument() + /* await this.saveDocument() */ this.close(); } diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 3d583d500..b21b67aff 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -8,12 +8,12 @@ import { ModalController } from '@ionic/angular'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchList } from "src/app/models/search-document"; -import { EventAttachment } from 'src/app/models/attachment.model'; +import { EventAttachment } from 'src/app/models/attachment.model'; import { ToastService } from 'src/app/services/toast.service'; import { LoginUserRespose } from 'src/app/models/user.model'; -import {DateAdapter} from '@angular/material/core'; +import { DateAdapter } from '@angular/material/core'; import * as _moment from 'moment'; import * as _rollupMoment from 'moment'; import { FormControl } from '@angular/forms'; @@ -21,7 +21,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker' import { ThemePalette } from '@angular/material/core'; import { ViewChild } from '@angular/core'; -import { FormGroup, Validators } from '@angular/forms'; +import { FormGroup, Validators } from '@angular/forms'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { ThemeService } from 'src/app/services/theme.service' import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service'; @@ -29,6 +29,9 @@ import { ServerConnectionService } from 'src/app/services/server-connection.serv 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 { EventToAprove } from 'src/app/models/eventToAprove.model'; +import { ProcessesService } from 'src/app/services/processes.service'; +import { Subject } from 'rxjs'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -55,7 +58,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { export class NewEventPage implements OnInit { eventBody: EventBody; - segment:string = "true"; + segment: string = "true"; public date: any; public disabled = false; @@ -74,8 +77,8 @@ export class NewEventPage implements OnInit { mostrarModal = false; @Input() attendees: [] - @Input() profile:string; - @Input() roomId:string; + @Input() profile: string; + @Input() roomId: string; @Input() selectedSegment: string; @Input() selectedDate: Date; @Input() CalendarDate: Date; @@ -86,14 +89,15 @@ export class NewEventPage implements OnInit { @Output() setIntervenientCC = new EventEmitter(); postEvent: Event; + postEventToAprove: EventToAprove; @Output() onAddEvent = new EventEmitter(); @Output() openAttendeesComponent = new EventEmitter(); @Output() clearContact = new EventEmitter(); - @Output() GoBackEditOrAdd = new EventEmitter(); + @Output() GoBackEditOrAdd = new EventEmitter(); @Output() cloneAllmobileComponent = new EventEmitter(); @Output() backToChat = new EventEmitter(); - documents:SearchList[] = []; + documents: SearchList[] = []; // minDate: string; @@ -107,7 +111,7 @@ export class NewEventPage implements OnInit { Form: FormGroup; validateFrom = false; autoStartTime; - autoEndTime; + autoEndTime; public options = [ { value: true, label: 'True' }, @@ -135,7 +139,8 @@ export class NewEventPage implements OnInit { private dateAdapter: DateAdapter, public ThemeService: ThemeService, private chatMethodService: ChatMethodsService, - private hhtpErrorHandle: HttpErrorHandle + private hhtpErrorHandle: HttpErrorHandle, + private processeService: ProcessesService, ) { this.dateAdapter.setLocale('pt'); this.loggeduser = SessionStore.user; @@ -145,8 +150,8 @@ export class NewEventPage implements OnInit { ngOnInit() { - if(!this.CalendarName) { - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { + if (!this.CalendarName) { + if (this.eventService.calendarNamesAry.includes('Meu calendario')) { this.CalendarName = 'Meu calendario'; } else { this.CalendarName = this.eventService.calendarNamesAry[0] @@ -154,12 +159,12 @@ export class NewEventPage implements OnInit { } this.getRecurrenceTypes(); - if(!this.restoreTemporaryData()) { + if (!this.restoreTemporaryData()) { // clear - this.eventBody = { BodyType : "1", Text : ""}; + this.eventBody = { BodyType: "1", Text: "" }; this.postEvent.Body = this.eventBody; - if(this.selectedSegment != "Combinada") { + if (this.selectedSegment != "Combinada") { this.postEvent = { EventId: '', Subject: '', @@ -178,10 +183,10 @@ export class NewEventPage implements OnInit { Organizer: '', Category: 'Reunião', HasAttachments: false, - EventRecurrence: { Type:'-1', LastOccurrence: this.autoEndTime }, + EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, }; } - else{ + else { this.postEvent = { EventId: '', Subject: '', @@ -200,13 +205,13 @@ export class NewEventPage implements OnInit { Organizer: '', Category: 'Reunião', HasAttachments: false, - EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, + EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, } } - if(this.postEvent.Attendees != null) { + if (this.postEvent.Attendees != null) { this.postEvent.Attendees.forEach(e => { - if(e.IsRequired) { + if (e.IsRequired) { this.taskParticipants.push(e); } else { this.taskParticipantsCc.push(e); @@ -222,8 +227,8 @@ export class NewEventPage implements OnInit { this.setDefaultTime(); } - - this.date = new Date(2021,9,4,5,6,7); + + this.date = new Date(2021, 9, 4, 5, 6, 7); this.injectValidation(); this.changeAgenda() @@ -236,14 +241,14 @@ export class NewEventPage implements OnInit { } roundTimeQuarterHour(timeToReturn = new Date()): Date { - + let date = new Date(timeToReturn) || new Date(); const minutes = date.getMinutes(); date.setSeconds(0); - if(minutes % 15 != 0) { - + if (minutes % 15 != 0) { + if (minutes > 45) { date.setMinutes(60) } else if (minutes > 30) { @@ -253,26 +258,26 @@ export class NewEventPage implements OnInit { } else if (minutes > 0) { date.setMinutes(15) } - - } + + } return date } - roundTimeQuarterHourPlus15(date:Date) { + roundTimeQuarterHourPlus15(date: Date) { const _date = new Date(date); - const minutes = _date .getMinutes(); - _date .setMinutes(minutes + 15) - return _date + const minutes = _date.getMinutes(); + _date.setMinutes(minutes + 15) + return _date } - roundTimeQuarterHour1 (timeToReturn) { + roundTimeQuarterHour1(timeToReturn) { let date: any = new Date(timeToReturn) || new Date(); const minutes = date.getMinutes(); date.setSeconds(0); - if((minutes % 15) != 0 ) { + if ((minutes % 15) != 0) { let a = (Math.floor(minutes / 15) + 1) * 15 date.setMinutes(a) } @@ -280,24 +285,24 @@ export class NewEventPage implements OnInit { return date } - setStartDate(){ + setStartDate() { // this.postEvent.StartDate = this.roundTimeQuarterHour(); } - setEndDate(){ + setEndDate() { // this.postEvent.EndDate = this.postEvent.StartDate; } runValidation() { - this.validateFrom = true; - if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){ + this.validateFrom = true; + if (new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()) { this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento") } } injectValidation() { - if (typeof(this.postEvent.EventRecurrence.Type) == 'number') { + if (typeof (this.postEvent.EventRecurrence.Type) == 'number') { const str: any = this.postEvent.EventRecurrence.Type.toString() this.postEvent.EventRecurrence.Type = str } @@ -320,13 +325,13 @@ export class NewEventPage implements OnInit { dateEnd: new FormControl(this.postEvent.EndDate, [ 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).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok': null,[ + Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required ]), }) @@ -336,15 +341,15 @@ export class NewEventPage implements OnInit { openInicio() { let input: any = document.querySelector('#new-inicio') - if(input) { - + if (input) { + input.click() } } openFim() { let input: any = document.querySelector('#new-fim') - if(input) { + if (input) { input.click() } } @@ -353,32 +358,36 @@ export class NewEventPage implements OnInit { this.CalendarNameShow = false - setTimeout(()=>{ + setTimeout(() => { this.CalendarNameShow = true - if(this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - + if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - + console.log(this.postEvent.CalendarName) + } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { this.CalendarNamesOptions = ['Oficial'] this.postEvent.CalendarName = 'Oficial' - + console.log(this.postEvent.CalendarName) + } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { this.CalendarNamesOptions = ['Pessoal'] this.postEvent.CalendarName = 'Pessoal' - + console.log(this.postEvent.CalendarName) + } else { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] + console.log(this.postEvent.CalendarName) } }, 50) } - + openLastOccurrence() { let input: any = document.querySelector('#last-occurrence') - if(input) { + if (input) { input.click() } } @@ -395,7 +404,7 @@ export class NewEventPage implements OnInit { }); modal.onDidDismiss().then((res) => { - if(res){ + if (res) { const data = res.data; this.documents.push(data.selected); } @@ -411,45 +420,45 @@ export class NewEventPage implements OnInit { this.setIntervenient.emit([]); this.setIntervenientCC.emit([]); // chat exit - this.backToChat.emit({roomId:this.roomId}) + this.backToChat.emit({ roomId: this.roomId }) // agenda exit this.cloneAllmobileComponent.emit({}) } getRecurrenceTypes() { - this.eventService.getRecurrenceTypes().subscribe(res=>{ - + this.eventService.getRecurrenceTypes().subscribe(res => { + this.recurringTypes = res; }); } - onSelectedRecurringChanged(ev:any){ - + onSelectedRecurringChanged(ev: any) { + this.calculetedLastOccurrence(ev); - - if(ev.length > 1){ - + + if (ev.length > 1) { + this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); } - if(ev.length == 0){ + if (ev.length == 0) { this.postEvent.EventRecurrence.Type = "-1"; } } - calculetedLastOccurrence(type:number){ + calculetedLastOccurrence(type: number) { - var valor; + var valor; var opcao: boolean; if (type == 0) { valor = 7; opcao = true; - } else if(type == 1){ + } else if (type == 1) { valor = 30; opcao = true; - } else if(type == 2){ + } else if (type == 2) { valor = 1; opcao = false; - }else if(type == 3){ + } else if (type == 3) { valor = 5; opcao = false; } @@ -457,22 +466,22 @@ export class NewEventPage implements OnInit { } - defineLastOccurrence(valor:number, opcao:boolean){ + defineLastOccurrence(valor: number, opcao: boolean) { var time = new Date(this.postEvent.EndDate); if (opcao == true) { time.setDate(time.getDate() + valor); this.postEvent.EventRecurrence.LastOccurrence = time; } else { time = new Date( - time.getFullYear() + valor, - time.getMonth(), - time.getDate(), - time.getHours(), + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), time.getMinutes() ); this.postEvent.EventRecurrence.LastOccurrence = time; } - + } async save() { @@ -480,30 +489,30 @@ export class NewEventPage implements OnInit { this.injectValidation() this.runValidation() - if(this.Form.invalid) { - + if (this.Form.invalid) { + return false } this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - - if(this.documents.length >= 0) { + + if (this.documents.length > 0) { this.postEvent.HasAttachments = true; } - if(this.postEvent.EventRecurrence.Type == undefined) { + if (this.postEvent.EventRecurrence.Type == undefined) { this.postEvent.EventRecurrence.Type = '-1' } - - if(this.loggeduser.Profile == 'MDGPR') { + + if (this.loggeduser.Profile == 'MDGPR') { const CalendarId = this.selectedCalendarId() this.showLoader = true; this.postEvent.CalendarId = CalendarId - + let loader = this.toastService.loading(); - + this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( async (id) => { loader.remove() @@ -522,13 +531,13 @@ export class NewEventPage implements OnInit { }; }); await DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{ - if(DocumentToSave.length == (i+1)) { + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { this.afterSave(); } }); }); - if(DocumentToSave.length == 0) { + if (DocumentToSave.length == 0) { this.afterSave(); } this.hhtpErrorHandle.httpsSucessMessagge('new event') @@ -541,30 +550,30 @@ export class NewEventPage implements OnInit { "calendarId": CalendarId } - if(this.roomId) { - this.chatMethodService.sendMessage(this.roomId,data); + if (this.roomId) { + this.chatMethodService.sendMessage(this.roomId, data); } - + }, error => { loader.remove() this.showLoader = false this.hhtpErrorHandle.httpStatusHandle(error) - }); + }); } - else if(this.loggeduser.Profile == 'PR') { - + else if (this.loggeduser.Profile == 'PR') { + const CalendarId = this.selectedCalendarId() let loader = this.toastService.loading(); this.postEvent.CalendarId = CalendarId - + 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 { @@ -580,14 +589,14 @@ export class NewEventPage implements OnInit { }); DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{ - if(DocumentToSave.length == (i+1)){ + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { this.afterSave(); } }); }); - if(DocumentToSave.length == 0){ + if (DocumentToSave.length == 0) { this.afterSave(); } this.hhtpErrorHandle.httpsSucessMessagge('new event') @@ -599,10 +608,10 @@ export class NewEventPage implements OnInit { "id": id, "calendarId": CalendarId } - if(this.roomId) { - this.chatMethodService.sendMessage(this.roomId,data); + if (this.roomId) { + this.chatMethodService.sendMessage(this.roomId, data); } - },(error) => { + }, (error) => { //const connectionToServer = this.ServerConnectionService.BaseAPI() @@ -610,22 +619,201 @@ export class NewEventPage implements OnInit { loader.remove() this.showLoader = false - + }); + + } else if (this.loggeduser.Profile == 'SGGPR') { + + console.log(this.postEventToAprove) + 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) { + + } + console.log('selectedCalendar', selectedCalendar) + + 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: '' + }; + }); + + 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.afterSave(); + this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') + + + + + /* DocumentToSave.forEach((attachments, i) => { + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { + this.afterSave(); + } + }); + }); + + if (DocumentToSave.length == 0) { + this.afterSave(); + } */ + + }, (error) => { + loader.remove() + this.showLoader = false + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + + + } 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: '' + }; + }); + + 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.afterSave(); + this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') + + + + /* DocumentToSave.forEach((attachments, i) => { + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { + this.afterSave(); + } + }); + }); + + if (DocumentToSave.length == 0) { + this.afterSave(); + } */ + + }, (error) => { + loader.remove() + this.showLoader = false + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + + } + + + + } + + if (!selectedCalendar && this.CalendarName == "Meu calendario") { + console.log('SG generic') + this.postEvent.CalendarName + + const CalendarId = this.selectedCalendarId() + let loader = this.toastService.loading(); + + this.postEvent.CalendarId = CalendarId + + this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( + (id) => { + loader.remove(); + + 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: '' + }; + }); + + DocumentToSave.forEach((attachments, i) => { + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { + this.afterSave(); + } + }); + }); + + if (DocumentToSave.length == 0) { + this.afterSave(); + } + + 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); + } + }, (error) => { + + loader.remove() + this.showLoader = false + this.hhtpErrorHandle.httpStatusHandle(error) + }); + + } + + + + + + } else { - + this.postEvent.CalendarName const CalendarId = this.selectedCalendarId() let loader = this.toastService.loading(); this.postEvent.CalendarId = CalendarId - + 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 { @@ -641,14 +829,14 @@ export class NewEventPage implements OnInit { }); DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{ - if(DocumentToSave.length == (i+1)){ + this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { + if (DocumentToSave.length == (i + 1)) { this.afterSave(); } }); }); - if(DocumentToSave.length == 0){ + if (DocumentToSave.length == 0) { this.afterSave(); } @@ -661,20 +849,20 @@ export class NewEventPage implements OnInit { "id": id, "calendarId": CalendarId } - if(this.roomId) { - this.chatMethodService.sendMessage(this.roomId,data); + if (this.roomId) { + this.chatMethodService.sendMessage(this.roomId, data); } - },(error)=>{ + }, (error) => { - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); + loader.remove() + this.showLoader = false + this.hhtpErrorHandle.httpStatusHandle(error) + }); } } - selectedCalendarId () { + selectedCalendarId() { if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') { @@ -704,12 +892,12 @@ export class NewEventPage implements OnInit { } removeAttachment(index: number) { - this.documents = this.documents.filter( (e, i) => index != i); + this.documents = this.documents.filter((e, i) => index != i); } async addParticipants() { - + this.saveTemporaryData(); @@ -749,9 +937,9 @@ export class NewEventPage implements OnInit { */ restoreTemporaryData(): boolean { - const restoredData = window['temp.path:/home/agenda/new-event.component.ts'] + const restoredData = window['temp.path:/home/agenda/new-event.component.ts'] - if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) { + if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) { this.postEvent = restoredData.postEvent this.eventBody = restoredData.eventBody this.segment = restoredData.segment @@ -763,7 +951,7 @@ export class NewEventPage implements OnInit { return true; } else { - + } } @@ -771,5 +959,31 @@ export class NewEventPage implements OnInit { window['temp.path:/home/agenda/new-event.component.ts'] = {} } + eventToaproveBody(event, calendarId, role, userId, attachments) { + let toAproveObject = { + "EventProcess": { + "Body": event.Body, + "Location": event.Location, + "Subject": event.Subject, + "StartDate": event.StartDate, + "EndDate": event.EndDate, + "Status": "Active", + "IsAllDayEvent": event.IsRecurring, + "EventType": event.EventType, + "ParticipantsList": event.Attendees, + "EventRecurrence": event.EventRecurrence, + "HasAttachments": event.HasAttachments, + "CalendarId": calendarId, + "Role": role, + "wxUserID": userId, + "TimeZone": "W. Central Africa Standard Time" + }, + "Attachments": attachments, + "InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate() + } + + return toAproveObject; + } + } diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 9a600ba69..bd5b2cb40 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -907,13 +907,26 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => { console.error(error); }))); - const blob = this.fileService.base64toBlob(encodedData, file.type) - + let blob; + let formData + let fileBase64 + if (this.platform.is("tablet")) { - const fileBase64 = await this._getBase64(file) + blob = this.fileService.base64toBlob(encodedData, file.type) + console.log('BLOB BLOB', blob) - const formData = new FormData(); - formData.append('blobFile', blob); + formData = new FormData(); + formData.append('blobFile', blob); + /* console.log('add file', fileBase64) */ + + } else { + blob = this.fileService.base64toBlob(encodedData, file.type) + + fileBase64 = await this._getBase64(file) + + formData = new FormData(); + formData.append('blobFile', blob); + } this.ChatSystemService.getGroupRoom(roomId).send({ file: { diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index ee1447331..98303bd66 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -150,7 +150,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } async ChatMessageDebuggingPage() { - + const modal = await this.modalController.create({ component: ChatMessageDebuggingPage, cssClass: 'model profile-modal search-submodal', @@ -612,25 +612,25 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy // convert base64 to raw binary data held in a string // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this var byteString = atob(dataURI.split(',')[1]); - + // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] - + // write the bytes of the string to an ArrayBuffer var ab = new ArrayBuffer(byteString.length); - + // create a view into the buffer var ia = new Uint8Array(ab); - + // set the bytes of the buffer to the correct values for (var i = 0; i < byteString.length; i++) { - ia[i] = byteString.charCodeAt(i); + ia[i] = byteString.charCodeAt(i); } - + // write the ArrayBuffer to a blob, and you're done - var blob = new Blob([ab], {type: mimeString}); + var blob = new Blob([ab], { type: mimeString }); return blob; - + } async takePictureMobile() { @@ -645,7 +645,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy source: CameraSource.Camera }); - var base64 = 'data:image/jpeg;base64,' + file.base64String + var base64 = 'data:image/jpeg;base64,' + file.base64String const compressedImage = await this.compressImageBase64( base64, 800, // maxWidth @@ -785,7 +785,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy //const imageData = await this.fileToBase64Service.convert(file) // - var base64 = 'data:image/jpeg;base64,' + file.base64String + var base64 = 'data:image/jpeg;base64,' + file.base64String const compressedImage = await this.compressImageBase64( base64, 800, // maxWidth @@ -795,7 +795,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy console.log('Selected: ', picture) base64 = picture }); - + const response = await fetch(base64); const blob = await response.blob(); @@ -827,23 +827,42 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy async addFileToChat(types: typeof FileType[]) { + const roomId = this.roomId const file: any = await this.fileService.getFileFromDevice(types); + console.log(file.type) if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { - const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => { + const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => { console.error(error); }))); - const blob = this.fileService.base64toBlob(encodedData, file.type) - const fileBase64 = await this._getBase64(file) + let blob; + let formData + let fileBase64 + if (this.platform.is("tablet")) { + + blob = this.fileService.base64toBlob(encodedData, file.type) + console.log('BLOB BLOB', blob) + + formData = new FormData(); + formData.append('blobFile', blob); + /* console.log('add file', fileBase64) */ + + } else { + blob = this.fileService.base64toBlob(encodedData, file.type) + + fileBase64 = await this._getBase64(file) + + formData = new FormData(); + formData.append('blobFile', blob); + } + - const formData = new FormData(); - formData.append('blobFile', blob); this.ChatSystemService.getDmRoom(roomId).send({ @@ -872,7 +891,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } _getBase64(file) { - return new Promise((resolve, reject)=>{ + return new Promise((resolve, reject) => { var reader = new FileReader(); reader.readAsDataURL(file); reader.onload = function () { @@ -882,7 +901,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy console.log('Error: ', error); }; }) - } + } getFileReader(): FileReader { const fileReader = new FileReader(); const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"]; @@ -991,7 +1010,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy }); await modal.present(); - + } @@ -1094,7 +1113,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy this.downloadFileMsg(msg) } else { - + var str = msg.attachments[0].image_url str = str.substring(1, ((str.length) - 1)); @@ -1176,14 +1195,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy if (this.room.name) { try { this.roomName = this.room.name.split('-').join(' '); - } catch(error) { + } catch (error) { this.roomName = this.room.name; - } - - } - + } - if(SessionStore.user.ChatData.data.userId == this.room.u._id){ + } + + + if (SessionStore.user.ChatData.data.userId == this.room.u._id) { this.isAdmin = true } else { this.isAdmin = false @@ -1199,32 +1218,32 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy return new Promise((resolve, reject) => { const image = new (window as any).Image(); image.src = base64String; - + image.onload = async () => { const canvas = document.createElement('canvas'); let newWidth = image.width; let newHeight = image.height; - + if (newWidth > maxWidth) { newHeight *= maxWidth / newWidth; newWidth = maxWidth; } - + if (newHeight > maxHeight) { newWidth *= maxHeight / newHeight; newHeight = maxHeight; } - + canvas.width = newWidth; canvas.height = newHeight; - + const context = canvas.getContext('2d'); context?.drawImage(image, 0, 0, newWidth, newHeight); - + const compressedBase64 = canvas.toDataURL('image/jpeg', quality); resolve(compressedBase64); }; - + image.onerror = (error) => { reject(error); }; diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 08a33ca51..1ab20e815 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -226,7 +226,7 @@
- +
diff --git a/src/app/shared/header/header.page.scss b/src/app/shared/header/header.page.scss index ddfd82478..67809cdea 100644 --- a/src/app/shared/header/header.page.scss +++ b/src/app/shared/header/header.page.scss @@ -1,22 +1,22 @@ -@import '~src/function.scss'; +@import "~src/function.scss"; -.div-top-header{ +.div-top-header { margin: 0 em(20); // background-color: #0782c9; //padding-top: em(15px); - border: 0!important; + border: 0 !important; } +.profile-image { + vertical-align: middle; + width: 40px; + height: 40px; + border-radius: 50%; + display: block; /* Torna a imagem um elemento de bloco */ + margin: 0 auto; +} - - .profile-image { - border-radius: 80%; /* Tornar a imagem circular */ - width: 100%; - height: 25.33%; - overflow: auto; - } - -.div-logo{ +.div-logo { background: transparent; width: em(140); justify-content: center; @@ -34,17 +34,17 @@ } } - .logo-description{ + .logo-description { width: 74.67%; margin: 0 auto; overflow: auto; font-size: 8.5px; font-family: Bahnschrift; - .logo-description-content{ + .logo-description-content { width: 100%; - .logo-description-text{ + .logo-description-text { font-weight: 700; text-align: center; width: 100%; @@ -52,32 +52,31 @@ padding: 0 !important; } - .add-line{ + .add-line { width: 100%; border-bottom: 1px solid #000; margin-bottom: 2.5px !important; padding: 0 !important; } - .add-line-white{ + .add-line-white { width: 100%; border-bottom: 1px solid #fff; margin-bottom: 2.5px !important; padding: 0 !important; } } - .color-white{ + .color-white { color: #fff !important; } - .add-botton-border{ + .add-botton-border { border-bottom: 1px solid #000; } - .add-botton-border-white{ + .add-botton-border-white { border-bottom: 1px solid #fff; } - } } @@ -87,15 +86,15 @@ } .div-profile { - height: fit-content; + width: 40px; + height: 40px; + text-align: center; background-color: transparent; - overflow: auto; display: flex !important; - justify-content: end; - max-width: 45px; + justify-content:space-around; border-radius: 50px; - .icon{ + .icon { position: relative; border: none !important; } @@ -105,15 +104,15 @@ font-size: rem(12); color: white; text-align: center; - width:20px; - height:20px; + width: 20px; + height: 20px; border-radius: 35%; position: absolute; /* changed */ top: 5px; /* changed */ right: 27px; /* changed */ } - .profile-text{ + .profile-text { font-size: rem(20); font-weight: 300; width: fit-content; @@ -125,43 +124,40 @@ //border: 1px solid red; } -.desktop { +.desktop { display: none; } @media only screen and (min-width: 1366px) { - - .mobile{ + .mobile { display: none !important; } - .desktop{ + .desktop { display: block; } - } -.tab{ +.tab { height: 65px; cursor: pointer; user-select: none; } -.tab:hover{ +.tab:hover { border-top: 7px solid var(--header-tab-text-white); } -.active{ +.active { border-top: 7px solid var(--header-tab-text-white); - span{ + span { font-weight: 650; } } - -.search-input-container{ +.search-input-container { background-color: white; border-radius: 27.5px; border: solid 1px #ebebeb; - .icon{ + .icon { color: #797979; width: rem(45); height: rem(45); @@ -170,15 +166,14 @@ font-size: rem(25); align-items: center; } - .input-text{ + .input-text { width: 100%; } - .icon-z{ + .icon-z { width: 20px; } } - .tab { color: var(--header-tab-text-white); } diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.html b/src/app/shared/popover/deploma-options/deploma-options.page.html index 732c3d167..faae9cef3 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.html +++ b/src/app/shared/popover/deploma-options/deploma-options.page.html @@ -27,7 +27,7 @@
-
+
diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index db020344d..f55b6b723 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -53,6 +53,7 @@ export class DiplomaOptionsPage implements OnInit { } ngOnInit() { + console.log(this.task.activityInstanceName) } diff --git a/version/git-version.ts b/version/git-version.ts index 035bc9bb7..9f74c0913 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "90e01839b", - "SHA": "90e01839b7f38ed5a568a0e24fa0970836a1ce2b", + "shortSHA": "9de301944", + "SHA": "9de30194464b9511a9aa14a85b5b60894aeb860b", "branch": "developer-prod", "lastCommitAuthor": "'Eudes Inácio'", - "lastCommitTime": "'Thu Aug 31 16:39:13 2023 +0100'", - "lastCommitMessage": "time picker of create secret grupo remove 0 minutes", - "lastCommitNumber": "5255", + "lastCommitTime": "'Thu Aug 31 17:35:39 2023 +0100'", + "lastCommitMessage": "new erro hendle", + "lastCommitNumber": "5256", "change": "", - "changeStatus": "On branch developer-prod\nYour branch is ahead of 'origin/developer-prod' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/services/http-error-handle.service.ts", + "changeStatus": "On branch developer-prod\nYour branch is ahead of 'origin/developer-prod' by 2 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/Rules/despacho.service.ts\n\tmodified: src/app/modals/create-process/create-process.page.html\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tnew file: src/app/models/eventToAprove.model.ts\n\tmodified: src/app/models/user.model.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/events/events.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/http-error-handle.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/header/header.page.scss\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.html\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.ts", "changeAuthor": "eudes.inacio" } \ No newline at end of file