mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add either pattern
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
// {
|
||||
// "serialNumber": "47026_169",
|
||||
// "taskStatus": null,
|
||||
// "originator": {
|
||||
// "email": "dlima@gabinetedigital.local",
|
||||
// "manager": "",
|
||||
// "displayName": "",
|
||||
// "fqn": "K2:gabinetedigital\\dlima",
|
||||
// "username": "gabinetedigital\\dlima"
|
||||
// },
|
||||
// "isDelegated": false,
|
||||
// "isExtended": false,
|
||||
// "hasTakenAcknowledge": false,
|
||||
// "actions": [
|
||||
// "Reenviar",
|
||||
// "Descartar"
|
||||
// ],
|
||||
// "activityInstanceName": "Editar Evento",
|
||||
// "workflowInstanceFolio": "MTk4",
|
||||
// "taskStartDate": "2024-04-10T14:30:39.58",
|
||||
// "deadline": null,
|
||||
// "workflowID": 24744,
|
||||
// "workflowInstanceID": 47026,
|
||||
// "workflowName": "Agenda\\Agenda Oficial MDGPR",
|
||||
// "workflowDisplayName": "Agenda Oficial MDGPR",
|
||||
// "formURL": "http://bpmdev.gabinetedigital.local/Runtime/Runtime/Form/Exchange+Calendar+Meeting+Edition/?SerialNo=47026_169&ProcessInstanceID=&InstanceId=",
|
||||
// "workflowInstanceDataFields": {
|
||||
// "Body": "safsafas",
|
||||
// "Location": "Luanda",
|
||||
// "Subject": "Event to approve MD",
|
||||
// "StartDate": "2024-04-10 00:00:00",
|
||||
// "EndDate": "2024-04-11 05:00:00",
|
||||
// "Participants": "evilarinho@gabinetedigital.local",
|
||||
// "CC": "",
|
||||
// "ReviewUserComment": "{\r\n \"option\": \"save\",\r\n \"note\": \"\"\r\n}",
|
||||
// "Role": 100000011,
|
||||
// "MDName": "Eduardo Vilarinho",
|
||||
// "MDEmail": "evilarinho@gabinetedigital.local",
|
||||
// "OriginatorComments": "",
|
||||
// "Status": "Active",
|
||||
// "TimeZone": "",
|
||||
// "Agenda": "Oficial",
|
||||
// "EventType": "Reunião",
|
||||
// "EventID": "",
|
||||
// "HasAttachments": true,
|
||||
// "ParticipantsList": [
|
||||
// {
|
||||
// "EmailAddress": "evilarinho@gabinetedigital.local",
|
||||
// "Name": "Eduardo Vilarinho (evilarinho@gabinetedigital.local)",
|
||||
// "IsRequired": true,
|
||||
// "UserType": "GD"
|
||||
// }
|
||||
// ],
|
||||
// "EventOrganizer": "{\"$type\":\"GabineteDigital.k2RESTidentifier_EventPerson, GabineteDigital, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"EmailAddress\":\"agenda.mdgpr@gabinetedigital.local\",\"Name\":\"Agenda do Ministro e Director do Gabinete do PR\",\"IsRequired\":true}",
|
||||
// "CreateEvent": "",
|
||||
// "IsAllDayEvent": false,
|
||||
// "SerializedItem": "",
|
||||
// "MDwxUserID": 198,
|
||||
// "DeserializedItem": "",
|
||||
// "Message": "Foi adicionado para a sua agenda um evento com o assunto: Event to approve MD, para a vossa aprovação",
|
||||
// "InstanceId": "AGD_dlima_2024-04-10_14:30:39.453",
|
||||
// "For Each Result": "",
|
||||
// "For Each Index": 0,
|
||||
// "Header": "",
|
||||
// "RecurringString": "",
|
||||
// "LastOccurrence": "",
|
||||
// "OccurrenceType": "-1",
|
||||
// "SerialNumber": "",
|
||||
// "For Each Result 1": "false",
|
||||
// "For Each Index 1": 0,
|
||||
// "UserEmail": "",
|
||||
// "LastActivInstanceID": "78",
|
||||
// "IsRecurring": false,
|
||||
// "CalendarId": "AQMkAGVhZWZkOGM0LWNiZjMtNGE4Ny05NTY4LWZjMTEANTE2MWU4YmUALgAAAwkDRuPtBKJItLDcu6efhYABACLK19NpGvtHh8oQYZPTW2sAAAIBSgAAAA==",
|
||||
// "wxUserID": 312
|
||||
// },
|
||||
// "totalDocuments": null,
|
||||
// "Documents": null,
|
||||
// "PrivateMessage": null
|
||||
// }
|
||||
|
||||
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
const ParticipantSchema = z.object({
|
||||
EmailAddress: z.string(),
|
||||
Name: z.string(),
|
||||
IsRequired: z.boolean(),
|
||||
UserType: z.string()
|
||||
});
|
||||
|
||||
const WorkflowInstanceDataFieldsSchema = z.object({
|
||||
Body: z.string(),
|
||||
Location: z.string(),
|
||||
Subject: z.string(),
|
||||
StartDate: z.string(),
|
||||
EndDate: z.string(),
|
||||
Participants: z.string(),
|
||||
CC: z.string().nullable(),
|
||||
ReviewUserComment: z.string(),
|
||||
Role: z.number(),
|
||||
MDName: z.string(),
|
||||
MDEmail: z.string(),
|
||||
OriginatorComments: z.string().nullable(),
|
||||
Status: z.string(),
|
||||
TimeZone: z.string().nullable(),
|
||||
Agenda: z.string(),
|
||||
EventType: z.string(),
|
||||
EventID: z.string().nullable(),
|
||||
HasAttachments: z.boolean(),
|
||||
ParticipantsList: z.array(ParticipantSchema),
|
||||
EventOrganizer: z.string(),
|
||||
CreateEvent: z.string().nullable(),
|
||||
IsAllDayEvent: z.boolean(),
|
||||
SerializedItem: z.string().nullable(),
|
||||
MDwxUserID: z.number(),
|
||||
DeserializedItem: z.string().nullable(),
|
||||
Message: z.string(),
|
||||
InstanceId: z.string(),
|
||||
Header: z.string().nullable(),
|
||||
RecurringString: z.string().nullable(),
|
||||
LastOccurrence: z.string().nullable(),
|
||||
OccurrenceType: z.number(),
|
||||
SerialNumber: z.string().nullable(),
|
||||
UserEmail: z.string().nullable(),
|
||||
LastActivInstanceID: z.string(),
|
||||
IsRecurring: z.boolean(),
|
||||
CalendarId: z.string(),
|
||||
wxUserID: z.number()
|
||||
});
|
||||
|
||||
const OriginatorSchema = z.object({
|
||||
email: z.string(),
|
||||
manager: z.string().nullable(),
|
||||
displayName: z.string().nullable(),
|
||||
fqn: z.string(),
|
||||
username: z.string()
|
||||
});
|
||||
|
||||
|
||||
|
||||
const Attachments = z.object({
|
||||
Id: z.number().optional(),
|
||||
ParentId: z.string().optional(),
|
||||
Source: z.number().optional(),
|
||||
SourceId: z.string().optional(),
|
||||
Description: z.string().optional(),
|
||||
SourceName: z.string().optional(),
|
||||
CreateDate: z.string().optional(),
|
||||
Stakeholders: z.string().optional(),
|
||||
Link: z.string().optional(),
|
||||
Data: z.null().optional(),
|
||||
ApplicationId: z.number().optional(),
|
||||
FileSize: z.number().optional(),
|
||||
});
|
||||
|
||||
|
||||
const EventToApproveDetails = z.object({
|
||||
serialNumber: z.string(),
|
||||
taskStatus: z.string().nullable(),
|
||||
originator: OriginatorSchema,
|
||||
isDelegated: z.boolean(),
|
||||
isExtended: z.boolean(),
|
||||
hasTakenAcknowledge: z.boolean(),
|
||||
actions: z.array(z.string()),
|
||||
activityInstanceName: z.string(),
|
||||
workflowInstanceFolio: z.string(),
|
||||
taskStartDate: z.string(),
|
||||
deadline: z.string().nullable(),
|
||||
workflowID: z.number(),
|
||||
workflowInstanceID: z.number(),
|
||||
workflowName: z.string(),
|
||||
workflowDisplayName: z.string(),
|
||||
formURL: z.string().url(),
|
||||
workflowInstanceDataFields: WorkflowInstanceDataFieldsSchema,
|
||||
totalDocuments: z.number().nullable(),
|
||||
Documents: z.array(z.unknown()).nullable(),
|
||||
PrivateMessage: z.string().nullable(),
|
||||
Attachments: z.array(Attachments)
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type EventToApproveDetails = z.infer<typeof EventToApproveDetails>
|
||||
@@ -637,48 +637,55 @@ export class AgendaPage implements OnInit {
|
||||
let load = 0;
|
||||
for (const selectedCalendar of selectedCalendarIds) {
|
||||
|
||||
this.AgendaDataRepositoryService.EventList({userId: selectedCalendar.OwnerUserId, calendarOwnerName: selectedCalendar['FullName'] }).subscribe( response => {
|
||||
(async () => {
|
||||
|
||||
let label;
|
||||
|
||||
if (SessionStore.user.Profile == 'PR') {
|
||||
label = "pr"
|
||||
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
|
||||
label = 'md'
|
||||
const response = await this.AgendaDataRepositoryService.EventList({userId: selectedCalendar.OwnerUserId, calendarOwnerName: selectedCalendar['FullName'] })
|
||||
|
||||
if(response.isOk()) {
|
||||
let label;
|
||||
|
||||
if (SessionStore.user.Profile == 'PR') {
|
||||
label = "pr"
|
||||
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
|
||||
label = 'md'
|
||||
} else {
|
||||
label = "pr"
|
||||
}
|
||||
|
||||
let eventsList = response.value;
|
||||
this.CalendarStore.pushEvent(eventsList, label);
|
||||
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
|
||||
this.showTimelinePR = true;
|
||||
|
||||
load++
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
label = "pr"
|
||||
load++
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
console.log('111b')
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
this.updateEventListBox()
|
||||
}
|
||||
|
||||
let eventsList = response;
|
||||
this.CalendarStore.pushEvent(eventsList, label);
|
||||
})()
|
||||
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
this.updateEventListBox()
|
||||
|
||||
this.showTimelinePR = true;
|
||||
|
||||
load++
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.updateEventListBox()
|
||||
}, () => {
|
||||
|
||||
load++
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
console.log('111b')
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
this.updateEventListBox()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { TaskService } from 'src/app/services/task.service';
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
@@ -90,7 +92,8 @@ export class EventsPage implements OnInit {
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
public AgendaDataRepositoryService: AgendaDataRepositoryService
|
||||
) {
|
||||
|
||||
window['zipPhoneCallback'] = function (zipphone) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { EventListToApproveMapper } from './mapper/eventToApproveListMapper';
|
||||
import { err, ok } from 'neverthrow';
|
||||
import { of } from 'rxjs';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { EventToApproveDetailsMapper } from './mapper/EventToApproveDetailsMapper';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -22,20 +23,45 @@ export class AgendaDataRepositoryService {
|
||||
private utils: Utils
|
||||
) { }
|
||||
|
||||
getEventById(id: string) {
|
||||
return this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
return EventMapper.toDomain(response.data)
|
||||
})
|
||||
)
|
||||
async getEventById(id: string) {
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
return EventMapper.toDomain(response.data)
|
||||
})
|
||||
).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
EventList({userId = null, startDate = null, endDate = null, status= 2, category= null, type= null, calendarOwnerName = ''}) {
|
||||
return this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
|
||||
map((response) => {
|
||||
return ListEventMapper.toDomain(response.data, calendarOwnerName, userId)
|
||||
}
|
||||
))
|
||||
async getEventToApproveById(id: string) {
|
||||
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
return EventToApproveDetailsMapper.toDomain(response.data)
|
||||
})
|
||||
).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async EventList({userId = null, startDate = null, endDate = null, status= 2, category= null, type= null, calendarOwnerName = ''}) {
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
|
||||
map((response) => {
|
||||
return ListEventMapper.toDomain(response.data, calendarOwnerName, userId)
|
||||
}
|
||||
)).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
eventToApproveList({userId, startDate = null, endDate = null, status = 0, category= null, type= null, calendarOwnerName = ''}) {
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import { EventToApproveDetails } from "src/app/models/entiry/agenda/eventToApproveDetails"
|
||||
import { EventOutputDTO } from "../model/eventDTOOutput"
|
||||
|
||||
export class EventToApproveDetailsMapper {
|
||||
|
||||
constructor() {}
|
||||
static toDomain(dto: EventOutputDTO): EventToApproveDetails {
|
||||
|
||||
return {
|
||||
"serialNumber": dto.id,
|
||||
"taskStatus": dto.status,
|
||||
"originator": {
|
||||
"email": dto.organizer.wxeMail,
|
||||
"manager": "",
|
||||
"displayName": "",
|
||||
// "fqn": "K2:gabinetedigital\\dlima",
|
||||
// "username": "gabinetedigital\\dlima"
|
||||
},
|
||||
// "isDelegated": false,
|
||||
// "isExtended": false,
|
||||
// "hasTakenAcknowledge": false,
|
||||
// "actions": [
|
||||
// "Reenviar",
|
||||
// "Descartar"
|
||||
// ],
|
||||
"activityInstanceName": "Editar Evento",
|
||||
// "workflowInstanceFolio": "MTk4",
|
||||
// "taskStartDate": "2024-04-10T14:30:39.58",
|
||||
// "deadline": null,
|
||||
// "workflowID": 24744,
|
||||
// "workflowInstanceID": 47026,
|
||||
//"workflowName": "Agenda\\Agenda Oficial MDGPR",
|
||||
"workflowDisplayName": "Agenda Oficial MDGPR",
|
||||
//"formURL": "http://bpmdev.gabinetedigital.local/Runtime/Runtime/Form/Exchange+Calendar+Meeting+Edition/?SerialNo=47026_169&ProcessInstanceID=&InstanceId=",
|
||||
"workflowInstanceDataFields": {
|
||||
"Body": "safsafas",
|
||||
"Location": "Luanda",
|
||||
"Subject": "Event to approve MD",
|
||||
"StartDate": "2024-04-10 00:00:00",
|
||||
"EndDate": "2024-04-11 05:00:00",
|
||||
// "Participants": "evilarinho@gabinetedigital.local",
|
||||
// "CC": "",
|
||||
// "ReviewUserComment": "{\r\n \"option\": \"save\",\r\n \"note\": \"\"\r\n}",
|
||||
// "Role": 100000011,
|
||||
// "MDName": "Eduardo Vilarinho",
|
||||
// "MDEmail": "evilarinho@gabinetedigital.local",
|
||||
// "OriginatorComments": "",
|
||||
"Status": "Active",
|
||||
//"TimeZone": "",
|
||||
"Agenda": "Oficial",
|
||||
"EventType": "Reunião",
|
||||
//"EventID": "",
|
||||
//"HasAttachments": true,
|
||||
"ParticipantsList": [
|
||||
...dto.attendees.map( e => ({
|
||||
Name: e.name,
|
||||
EmailAddress: e.emailAddress,
|
||||
IsRequired: e.attendeeType == '0' ? true : false,
|
||||
UserType: "GD",
|
||||
}))
|
||||
],
|
||||
//"EventOrganizer": "{\"$type\":\"GabineteDigital.k2RESTidentifier_EventPerson, GabineteDigital, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\",\"EmailAddress\":\"agenda.mdgpr@gabinetedigital.local\",\"Name\":\"Agenda do Ministro e Director do Gabinete do PR\",\"IsRequired\":true}",
|
||||
"CreateEvent": "",
|
||||
"IsAllDayEvent": false,
|
||||
//"SerializedItem": "",
|
||||
//"MDwxUserID": 198,
|
||||
//"DeserializedItem": "",
|
||||
//"Message": "Foi adicionado para a sua agenda um evento com o assunto: Event to approve MD, para a vossa aprovação",
|
||||
//"InstanceId": "AGD_dlima_2024-04-10_14:30:39.453",
|
||||
//"For Each Result": "",
|
||||
//"For Each Index": 0,
|
||||
//"Header": "",
|
||||
//"RecurringString": "",
|
||||
//"LastOccurrence": "",
|
||||
//"OccurrenceType": "-1",
|
||||
//"SerialNumber": "",
|
||||
//"For Each Result 1": "false",
|
||||
//"For Each Index 1": 0,
|
||||
//"UserEmail": "",
|
||||
//"LastActivInstanceID": "78",
|
||||
"IsRecurring": false,
|
||||
//"CalendarId": "AQMkAGVhZWZkOGM0LWNiZjMtNGE4Ny05NTY4LWZjMTEANTE2MWU4YmUALgAAAwkDRuPtBKJItLDcu6efhYABACLK19NpGvtHh8oQYZPTW2sAAAIBSgAAAA==",
|
||||
//"wxUserID": 312
|
||||
},
|
||||
"totalDocuments": null,
|
||||
"Documents": null,
|
||||
"PrivateMessage": null,
|
||||
Attachments: dto.attachments.map( e => ({
|
||||
DocId: '',
|
||||
Description: '',
|
||||
Stakeholders: '',
|
||||
CreateDate: '',
|
||||
ApplicationId: 0,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
static toDTO(data: any): any {
|
||||
return {}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ export class DateService {
|
||||
}
|
||||
|
||||
|
||||
fixDate(res: EventList) {
|
||||
fixDate(res: EventList): any {
|
||||
if(res.IsAllDayEvent && this.deferenceBetweenDays(new Date(res.StartDate), new Date(res.EndDate)) >= 1) {
|
||||
|
||||
const date = new Date(res.EndDate);
|
||||
|
||||
@@ -11,7 +11,9 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
import { EventToApproveDetails } from 'src/app/models/entiry/agenda/eventToApproveDetails';
|
||||
import { HttpResponseBase } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
@@ -21,7 +23,7 @@ import { TaskService } from 'src/app/services/task.service'
|
||||
export class ApproveEventPage implements OnInit {
|
||||
|
||||
event: Event;
|
||||
@Input() loadedEvent:any;
|
||||
@Input() loadedEvent: EventToApproveDetails;
|
||||
loadedAttachments:any;
|
||||
customDate:any;
|
||||
today:any;
|
||||
@@ -51,7 +53,8 @@ export class ApproveEventPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
public AgendaDataRepositoryService: AgendaDataRepositoryService
|
||||
) {
|
||||
// Event to approve list
|
||||
|
||||
@@ -76,15 +79,19 @@ export class ApproveEventPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
getTask() {
|
||||
this.processes.GetTask(this.serialNumber).subscribe(res => {
|
||||
|
||||
this.loadedEvent = res;
|
||||
this.today = new Date(res.workflowInstanceDataFields.StartDate);
|
||||
//
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
async getTask() {
|
||||
|
||||
const res = await this.AgendaDataRepositoryService.getEventToApproveById(this.serialNumber)
|
||||
|
||||
if(res.isOk()) {
|
||||
this.loadedEvent = res.value;
|
||||
this.today = new Date(res.value.workflowInstanceDataFields.StartDate);
|
||||
//
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
} else {
|
||||
console.log(res.error.status)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
async approveTask(serialNumber:string) {
|
||||
@@ -109,7 +116,7 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejectTask(serialNumber:string) {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -119,7 +126,7 @@ export class ApproveEventPage implements OnInit {
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.close()
|
||||
@@ -133,7 +140,7 @@ export class ApproveEventPage implements OnInit {
|
||||
} catch (error) {
|
||||
console.error('getAttchaments',error)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -151,7 +158,7 @@ export class ApproveEventPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.loadedEvent.FolderId,
|
||||
// folderId: this.loadedEvent.FolderId,
|
||||
task: this.loadedEvent
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
@@ -179,7 +186,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async emendTask(serialNumber:string) {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps:{
|
||||
@@ -193,9 +200,9 @@ export class ApproveEventPage implements OnInit {
|
||||
modal.onDidDismiss()
|
||||
.then( async (res) => {
|
||||
|
||||
if(res.data.option == 'save') {
|
||||
if(res.data.option == 'save') {
|
||||
|
||||
|
||||
|
||||
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
@@ -203,7 +210,7 @@ export class ApproveEventPage implements OnInit {
|
||||
"ReviewUserComment": res.data,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
try {
|
||||
@@ -216,11 +223,11 @@ export class ApproveEventPage implements OnInit {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<ion-toolbar class="header-toolbar" >
|
||||
<div class="main-header px-20" style="overflow: unset !important;">
|
||||
<div class="title-content d-flex">
|
||||
<div class="left">
|
||||
|
||||
@@ -127,22 +127,17 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
async loadEvent() {
|
||||
|
||||
try {
|
||||
let res = await this.agendaDataRepository.getEventById(this.eventId)
|
||||
|
||||
let res = await this.agendaDataRepository.getEventById(this.eventId).toPromise()
|
||||
console.log('Loaded Event', res)
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res as any;
|
||||
this.setTimeZone()
|
||||
// this.addEventToDb(res);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
if(res.isOk()) {
|
||||
console.log('Loaded Event', res.value)
|
||||
let changeDate = this.dateService.fixDate(res.value as any) as any
|
||||
this.loadedEvent = changeDate as any;
|
||||
this.setTimeZone()
|
||||
} else {
|
||||
this.viewEventDetailDismiss.emit({
|
||||
type: 'close'
|
||||
})
|
||||
|
||||
// this.httpErrorHandle.httpStatusHandle(error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user