mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
remove console logs
This commit is contained in:
+207
-207
@@ -76,14 +76,14 @@ export class EventsService {
|
||||
private offlinemanager: OfflineManagerService) {
|
||||
|
||||
try {
|
||||
this.setHeader()
|
||||
//this.setHeader()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
try {
|
||||
this.setHeader()
|
||||
//this.setHeader()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
@@ -407,55 +407,55 @@ export class EventsService {
|
||||
}
|
||||
|
||||
|
||||
DetectCalendars(CalendarId) {
|
||||
const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars)
|
||||
return calendars.find((e) => e.CalendarId == CalendarId)
|
||||
}
|
||||
// DetectCalendars(CalendarId) {
|
||||
// const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars)
|
||||
// return calendars.find((e) => e.CalendarId == CalendarId)
|
||||
// }
|
||||
|
||||
makeHeader(calendar: calendarInterface) {
|
||||
let header = new HttpHeaders();;
|
||||
header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
header = header.set('CalendarId', calendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', calendar.CalendarName);
|
||||
// makeHeader(calendar: calendarInterface) {
|
||||
// let header = new HttpHeaders();;
|
||||
// header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
// header = header.set('CalendarId', calendar.CalendarId);
|
||||
// header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
// header = header.set('CalendarName', calendar.CalendarName);
|
||||
|
||||
return header
|
||||
}
|
||||
// return header
|
||||
// }
|
||||
|
||||
|
||||
isMyCalendar(CalendarId) {
|
||||
return this.myCalendarNames[CalendarId] || ""
|
||||
}
|
||||
// isMyCalendar(CalendarId) {
|
||||
// return this.myCalendarNames[CalendarId] || ""
|
||||
// }
|
||||
|
||||
getCalendarOwnNameByCalendarId(CalendarId) {
|
||||
return this.calendarNames[CalendarId] || ""
|
||||
}
|
||||
// getCalendarOwnNameByCalendarId(CalendarId) {
|
||||
// return this.calendarNames[CalendarId] || ""
|
||||
// }
|
||||
|
||||
|
||||
isMyEvent(event: any) {
|
||||
// isMyEvent(event: any) {
|
||||
|
||||
const data: any = event
|
||||
return data.owner.wxUserId == SessionStore.user.UserId
|
||||
// const data: any = event
|
||||
// return data.owner.wxUserId == SessionStore.user.UserId
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
detectCalendarNameByCalendarId(calendarId) {
|
||||
// detectCalendarNameByCalendarId(calendarId) {
|
||||
|
||||
for ( const property in this.calendarNamesType) {
|
||||
if(this.calendarNamesType[property]?.['Oficial']) {
|
||||
if(this.calendarNamesType[property]['OficialId'] == calendarId) {
|
||||
return property
|
||||
}
|
||||
}
|
||||
if (this.calendarNamesType[property]?.['Pessoal']) {
|
||||
if(this.calendarNamesType[property]['PessoalId'] == calendarId) {
|
||||
return property
|
||||
}
|
||||
}
|
||||
}
|
||||
// for ( const property in this.calendarNamesType) {
|
||||
// if(this.calendarNamesType[property]?.['Oficial']) {
|
||||
// if(this.calendarNamesType[property]['OficialId'] == calendarId) {
|
||||
// return property
|
||||
// }
|
||||
// }
|
||||
// if (this.calendarNamesType[property]?.['Pessoal']) {
|
||||
// if(this.calendarNamesType[property]['PessoalId'] == calendarId) {
|
||||
// return property
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
// getAllPrOficialEvents(startdate: string, enddate: string): Observable<EventList[]> {
|
||||
@@ -854,28 +854,28 @@ export class EventsService {
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
genericGetEvent(eventid: string, calendarId: string) {
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
// genericGetEvent(eventid: string, calendarId: string) {
|
||||
// let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
// let params = new HttpParams();
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
// params = params.set("EventId", eventid);
|
||||
|
||||
const calendar = this.DetectCalendars(calendarId)
|
||||
const header = this.makeHeader(calendar)
|
||||
// const calendar = this.DetectCalendars(calendarId)
|
||||
// const header = this.makeHeader(calendar)
|
||||
|
||||
if(header) {
|
||||
let options = {
|
||||
headers: header,
|
||||
params: params
|
||||
}
|
||||
// if(header) {
|
||||
// let options = {
|
||||
// headers: header,
|
||||
// params: params
|
||||
// }
|
||||
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
} else {
|
||||
// return this.http.get<Event>(`${geturl}`, options);
|
||||
// } else {
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
throw('error')
|
||||
}
|
||||
// throw('error')
|
||||
// }
|
||||
|
||||
// putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable<Event> {
|
||||
// const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent');
|
||||
@@ -1019,154 +1019,154 @@ export class EventsService {
|
||||
// return this.http.post<any>(`${puturl}`, body, options);
|
||||
// }
|
||||
|
||||
postEventMd(event: Event, calendarName: string) {
|
||||
const puturl = environment.apiURL + 'calendar/md';
|
||||
let params = new HttpParams();
|
||||
// postEventMd(event: Event, calendarName: string) {
|
||||
// const puturl = environment.apiURL + 'calendar/md';
|
||||
// let params = new HttpParams();
|
||||
|
||||
const now = new Date();
|
||||
event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]
|
||||
// const now = new Date();
|
||||
// event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
// params = params.set("CalendarName", calendarName);
|
||||
|
||||
let options: any;
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
// let options: any;
|
||||
// switch (calendarName) {
|
||||
// case 'Oficial':
|
||||
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
// options = {
|
||||
// headers: this.headersMdOficial,
|
||||
// params: params
|
||||
// };
|
||||
// break;
|
||||
|
||||
case 'Pessoal':
|
||||
// case 'Pessoal':
|
||||
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
// options = {
|
||||
// headers: this.headersMdPessoal,
|
||||
// params: params
|
||||
// };
|
||||
// break;
|
||||
// }
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
// return this.http.post<string>(`${puturl}`, event, options)
|
||||
// }
|
||||
|
||||
postEventPr(event: Event, calendarName: string) {
|
||||
const puturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
// postEventPr(event: Event, calendarName: string) {
|
||||
// const puturl = environment.apiURL + 'calendar/pr';
|
||||
// let params = new HttpParams();
|
||||
|
||||
const now = new Date();
|
||||
event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]
|
||||
// const now = new Date();
|
||||
// event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
params = params.set("notifyUsers", true)
|
||||
// params = params.set("CalendarName", calendarName);
|
||||
// params = params.set("notifyUsers", true)
|
||||
|
||||
let options: any;
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
// let options: any;
|
||||
// switch (calendarName) {
|
||||
// case 'Oficial':
|
||||
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
// options = {
|
||||
// headers: this.headersPrOficial,
|
||||
// params: params
|
||||
// };
|
||||
// break;
|
||||
|
||||
case 'Pessoal':
|
||||
// case 'Pessoal':
|
||||
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
// options = {
|
||||
// headers: this.headersPrPessoal,
|
||||
// params: params
|
||||
// };
|
||||
// break;
|
||||
// }
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
// return this.http.post<string>(`${puturl}`, event, options)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
postEventGeneric(event: Event, calendarName: string, CalendarId) {
|
||||
const puturl = environment.apiURL + 'Calendar/PostEvent';
|
||||
let params = new HttpParams();
|
||||
// postEventGeneric(event: Event, calendarName: string, CalendarId) {
|
||||
// const puturl = environment.apiURL + 'Calendar/PostEvent';
|
||||
// let params = new HttpParams();
|
||||
|
||||
const now = new Date();
|
||||
// const now = new Date();
|
||||
|
||||
event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1];
|
||||
event.Organizer = {
|
||||
"Id": SessionStore.user.UserId,
|
||||
"EmailAddress": SessionStore.user.Email,
|
||||
"Name": SessionStore.user.UserName,
|
||||
"IsRequired": true,
|
||||
"UserType": "GD"
|
||||
}
|
||||
// event.TimeZone = now.toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1];
|
||||
// event.Organizer = {
|
||||
// "Id": SessionStore.user.UserId,
|
||||
// "EmailAddress": SessionStore.user.Email,
|
||||
// "Name": SessionStore.user.UserName,
|
||||
// "IsRequired": true,
|
||||
// "UserType": "GD"
|
||||
// }
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
params = params.set("notifyUsers", true)
|
||||
// params = params.set("CalendarName", calendarName);
|
||||
// params = params.set("notifyUsers", true)
|
||||
|
||||
let options: any;
|
||||
// let options: any;
|
||||
|
||||
const calendar = this.DetectCalendars(CalendarId)
|
||||
const header = this.makeHeader(calendar)
|
||||
// const calendar = this.DetectCalendars(CalendarId)
|
||||
// const header = this.makeHeader(calendar)
|
||||
|
||||
options = {
|
||||
headers: header,
|
||||
params: params
|
||||
};
|
||||
// options = {
|
||||
// headers: header,
|
||||
// params: params
|
||||
// };
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
// return this.http.post<string>(`${puturl}`, event, options)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
|
||||
let arrayReq = [];
|
||||
let Object = {
|
||||
eventid: eventid,
|
||||
eventDeleteType: eventDeleteType,
|
||||
calendarName: calendarName
|
||||
}
|
||||
arrayReq.push(Object)
|
||||
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
||||
let params = new HttpParams();
|
||||
// deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
|
||||
// let arrayReq = [];
|
||||
// let Object = {
|
||||
// eventid: eventid,
|
||||
// eventDeleteType: eventDeleteType,
|
||||
// calendarName: calendarName
|
||||
// }
|
||||
// arrayReq.push(Object)
|
||||
// const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
||||
// let params = new HttpParams();
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
// 0 for occurence and 1 for serie (delete all events)
|
||||
params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||
// params = params.set("EventId", eventid);
|
||||
// // 0 for occurence and 1 for serie (delete all events)
|
||||
// params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||
|
||||
let options;
|
||||
// let options;
|
||||
|
||||
switch (SessionStore.user.Profile) {
|
||||
case 'MDGPR':
|
||||
if (calendarName == 'Pessoal') {
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if (calendarName == 'Oficial') {
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if (calendarName == 'Pessoal') {
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if (calendarName == 'Oficial') {
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
// switch (SessionStore.user.Profile) {
|
||||
// case 'MDGPR':
|
||||
// if (calendarName == 'Pessoal') {
|
||||
// options = {
|
||||
// headers: this.headersMdPessoal,
|
||||
// params: params
|
||||
// };
|
||||
// }
|
||||
// else if (calendarName == 'Oficial') {
|
||||
// options = {
|
||||
// headers: this.headersMdOficial,
|
||||
// params: params
|
||||
// };
|
||||
// }
|
||||
// break;
|
||||
// case 'PR':
|
||||
// if (calendarName == 'Pessoal') {
|
||||
// options = {
|
||||
// headers: this.headersPrPessoal,
|
||||
// params: params
|
||||
// };
|
||||
// }
|
||||
// else if (calendarName == 'Oficial') {
|
||||
// options = {
|
||||
// headers: this.headersPrOficial,
|
||||
// params: params
|
||||
// };
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
return this.http.delete(`${puturl}`, options)
|
||||
}
|
||||
// return this.http.delete(`${puturl}`, options)
|
||||
// }
|
||||
|
||||
|
||||
// genericDeleteEvent(eventid: string, eventDeleteType: number, calendarName: string, calendarId: string) {
|
||||
@@ -1308,24 +1308,24 @@ export class EventsService {
|
||||
// return this.http.post<any>(`${geturl}`, body, options)
|
||||
// }
|
||||
|
||||
genericPostExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, CalendarId) {
|
||||
const geturl = environment.apiURL + 'calendar/expediente';
|
||||
let params = new HttpParams();
|
||||
let options;
|
||||
// genericPostExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, CalendarId) {
|
||||
// const geturl = environment.apiURL + 'calendar/expediente';
|
||||
// let params = new HttpParams();
|
||||
// let options;
|
||||
|
||||
params = params.set("DocId", docId);
|
||||
params = params.set("SerialNumber", serialNumber);
|
||||
params = params.set("applicationID", applicationID);
|
||||
// params = params.set("DocId", docId);
|
||||
// params = params.set("SerialNumber", serialNumber);
|
||||
// params = params.set("applicationID", applicationID);
|
||||
|
||||
const calendar = this.DetectCalendars(CalendarId)
|
||||
const header = this.makeHeader(calendar)
|
||||
// const calendar = this.DetectCalendars(CalendarId)
|
||||
// const header = this.makeHeader(calendar)
|
||||
|
||||
options = {
|
||||
headers: header,
|
||||
params: params
|
||||
}
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
// options = {
|
||||
// headers: header,
|
||||
// params: params
|
||||
// }
|
||||
// return this.http.post<any>(`${geturl}`, body, options)
|
||||
// }
|
||||
|
||||
// createTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) {
|
||||
// const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/dispatch';
|
||||
@@ -1372,38 +1372,38 @@ export class EventsService {
|
||||
|
||||
|
||||
|
||||
genericCreateTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, CalendarId) {
|
||||
const geturl = environment.apiURL + 'calendar/dispatch';
|
||||
let params = new HttpParams();
|
||||
let options;
|
||||
// genericCreateTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, CalendarId) {
|
||||
// const geturl = environment.apiURL + 'calendar/dispatch';
|
||||
// let params = new HttpParams();
|
||||
// let options;
|
||||
|
||||
params = params.set("FolderId", folderId);
|
||||
params = params.set("SerialNumber", serialNumber);
|
||||
params = params.set("applicationID", applicationID);
|
||||
params = params.set("notifyUsers", true)
|
||||
// params = params.set("FolderId", folderId);
|
||||
// params = params.set("SerialNumber", serialNumber);
|
||||
// params = params.set("applicationID", applicationID);
|
||||
// params = params.set("notifyUsers", true)
|
||||
|
||||
const calendar = this.DetectCalendars(CalendarId)
|
||||
let header;
|
||||
console.log('calendar')
|
||||
// const calendar = this.DetectCalendars(CalendarId)
|
||||
// let header;
|
||||
// console.log('calendar')
|
||||
|
||||
try {
|
||||
// try {
|
||||
|
||||
header = this.makeHeader(calendar)
|
||||
// header = this.makeHeader(calendar)
|
||||
|
||||
|
||||
} catch (error) {}
|
||||
// } catch (error) {}
|
||||
|
||||
|
||||
console.log('header')
|
||||
// console.log('header')
|
||||
|
||||
options = {
|
||||
headers: header,
|
||||
params: params
|
||||
}
|
||||
// options = {
|
||||
// headers: header,
|
||||
// params: params
|
||||
// }
|
||||
|
||||
console.log('post')
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
// console.log('post')
|
||||
// return this.http.post<any>(`${geturl}`, body, options)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user