mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
merge
This commit is contained in:
@@ -22,7 +22,7 @@ export class AESEncrypt {
|
||||
|
||||
//Decrypting the string contained in cipherParams using the PBKDF2 key
|
||||
var decrypted = CryptoJS.AES.encrypt(encryptData, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 });
|
||||
// console.log('AES encrypt',decrypted.toString());
|
||||
//
|
||||
|
||||
return decrypted.toString();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class ListBoxService {
|
||||
|
||||
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
|
||||
|
||||
// console.log('eventSource', eventSource ,'rangeStartDate', new Date(rangeStartDate).toLocaleDateString('pt') , 'randEndDate', new Date(randEndDate).toLocaleDateString('pt'))
|
||||
//
|
||||
|
||||
// // filter range
|
||||
// if(selectedDate) {
|
||||
|
||||
@@ -51,7 +51,7 @@ export class AlertService {
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => {
|
||||
//console.log('Confirm Cancel');
|
||||
//
|
||||
}
|
||||
}, {
|
||||
text: 'Apagar',
|
||||
|
||||
@@ -13,12 +13,12 @@ export class AppProcessStatusService {
|
||||
|
||||
private events() {
|
||||
document.addEventListener('pause', () => {
|
||||
// console.log('App going to background');
|
||||
//
|
||||
this.status = 'pause'
|
||||
});
|
||||
|
||||
document.addEventListener('resume', () => {
|
||||
// console.log('App going to background');
|
||||
//
|
||||
this.status = 'resume'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export class AttachmentsService {
|
||||
|
||||
uploadFile(formData:any) {
|
||||
|
||||
console.log('UPLOAD file', formData)
|
||||
|
||||
|
||||
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
||||
const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
|
||||
@@ -82,8 +82,8 @@ export class AttachmentsService {
|
||||
).subscribe((fileBlob: Uint8Array) => {
|
||||
/** File - @ionic-native/file/ngx */
|
||||
vm.file.writeFile(downloadPath, "YourFileName.pdf", fileBlob, {replace: true});
|
||||
console.log(downloadPath +"/"+"YourFileName.pdf")
|
||||
console.log(fileBlob)
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ export class AuthService {
|
||||
|
||||
try {
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
console.log(response);
|
||||
|
||||
|
||||
if(saveSession) {
|
||||
this.SetSession(response, user)
|
||||
@@ -96,8 +96,8 @@ export class AuthService {
|
||||
SetSession(response: LoginUserRespose, user:UserForm) {
|
||||
const session: UserSession = Object.assign(SessionStore.user, response)
|
||||
|
||||
console.log('SETSESSION', response, user)
|
||||
console.log('SETSESSION 2', session)
|
||||
|
||||
|
||||
|
||||
|
||||
if (response) {
|
||||
@@ -132,7 +132,7 @@ export class AuthService {
|
||||
session.BasicAuthKey = user.BasicAuthKey
|
||||
|
||||
|
||||
console.log(session)
|
||||
|
||||
|
||||
SessionStore.reset(session)
|
||||
this.ValidatedUser = SessionStore.user;
|
||||
@@ -164,13 +164,13 @@ export class AuthService {
|
||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
||||
|
||||
if(responseChat) {
|
||||
console.log()
|
||||
|
||||
this.ValidatedUserChat = responseChat;
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
}
|
||||
else{
|
||||
console.log('Network error');
|
||||
|
||||
this.presentAlert('Network error');
|
||||
}
|
||||
|
||||
@@ -185,22 +185,22 @@ export class AuthService {
|
||||
|
||||
loginToChatWs() {
|
||||
setTimeout(()=>{
|
||||
console.log('loginToChatWs')
|
||||
|
||||
this.WsChatService.connect();
|
||||
this.WsChatService.login().then((message: any) => {
|
||||
console.log('loginToChatWs',message)
|
||||
|
||||
|
||||
SessionStore.user.RochetChatUserId = message.result.id
|
||||
SessionStore.save()
|
||||
|
||||
// console.log('user session', SessionStore.user)
|
||||
//
|
||||
|
||||
|
||||
this.WsChatService.setStatus('online')
|
||||
// alert('wsLogin')
|
||||
|
||||
}).catch((message) => {
|
||||
console.log('rocket chat login failed', message)
|
||||
|
||||
// alert('ws login failed')
|
||||
})
|
||||
|
||||
@@ -216,9 +216,9 @@ export class AuthService {
|
||||
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
||||
message.file.guid = guid.path
|
||||
|
||||
console.log('========================================',guid)
|
||||
|
||||
// await this.storage.set(guid.path, message.file.image_url).then(() => {
|
||||
// console.log('add picture to chat IMAGE SAVED')
|
||||
//
|
||||
// // message.getFileFromDb()
|
||||
// });
|
||||
|
||||
@@ -226,7 +226,7 @@ export class AuthService {
|
||||
|
||||
return true
|
||||
} catch(e) {
|
||||
console.log('failed to upload to server', e)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ export class AuthService {
|
||||
return true
|
||||
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -251,16 +251,16 @@ export class AuthService {
|
||||
|
||||
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
|
||||
|
||||
// console.log('FILE TYPE', message.file.type)
|
||||
//
|
||||
let downloadFile = "";
|
||||
if (message.file.type == "application/img") {
|
||||
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
|
||||
|
||||
console.log('FILE TYPE 22', message.file.guid)
|
||||
|
||||
|
||||
if (event.type === HttpEventType.DownloadProgress) {
|
||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
||||
// console.log('FILE TYPE 33', message.file.type)
|
||||
//
|
||||
return true
|
||||
} else if (event.type === HttpEventType.Response) {
|
||||
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||
@@ -272,7 +272,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
await this.storage.set(message.file.guid, downloadFile).then(() => {
|
||||
// console.log('IMAGE SAVED')
|
||||
//
|
||||
});
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export class CameraService {
|
||||
|
||||
return new Promise<Photo>(async (resolve, reject)=>{
|
||||
|
||||
console.log('add camera to picture')
|
||||
|
||||
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
|
||||
@@ -38,7 +38,7 @@ export class ChatService {
|
||||
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
// console.log(this.loggedUserChat)
|
||||
//
|
||||
this.headers = this.headers.set('X-User-Id', this.loggedUserChat.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat.authToken);
|
||||
this.options = {
|
||||
@@ -210,7 +210,7 @@ export class ChatService {
|
||||
|
||||
/* GROUPS */
|
||||
addGroup(body:any){
|
||||
console.log(body);
|
||||
|
||||
return this.http.post(environment.apiChatUrl+'groups.create', body, this.options);
|
||||
}
|
||||
setGroupCustomFields(body:any){
|
||||
@@ -320,7 +320,7 @@ export class ChatService {
|
||||
}
|
||||
|
||||
async subscribe(roomId:any) {
|
||||
console.log('Subcrive')
|
||||
|
||||
let params = new HttpParams();
|
||||
params = params.set("roomId", roomId);
|
||||
let opts = {
|
||||
@@ -329,7 +329,7 @@ export class ChatService {
|
||||
}
|
||||
|
||||
this.http.get(environment.apiChatUrl+'im.messages', opts).subscribe(async res => {
|
||||
console.log("Subcrive", res)
|
||||
|
||||
|
||||
if (res == 502) {
|
||||
// Connection timeout
|
||||
|
||||
@@ -32,7 +32,7 @@ export class ChatStorageService {
|
||||
})
|
||||
|
||||
this.storage.set('chatmsg' + roomId, messages).then((value) => {
|
||||
// console.log('MSG SAVED ON STORAGE', value)
|
||||
//
|
||||
});
|
||||
|
||||
})
|
||||
@@ -66,7 +66,7 @@ export class ChatStorageService {
|
||||
|
||||
await this.storage.set('chatmsg' + roomId, messages)
|
||||
} else {
|
||||
// console.log('failed to update', identificator, ':',ChatMessage)
|
||||
//
|
||||
}
|
||||
|
||||
})
|
||||
@@ -101,14 +101,14 @@ export class ChatStorageService {
|
||||
messages[index] = Object.assign(messages[index], ChatMessage)
|
||||
|
||||
// if(messages[index].msg.includes('***********')) {
|
||||
// console.log('storage update')
|
||||
// console.log(JSON.stringify(messages[index]))
|
||||
// console.log(JSON.stringify(ChatMessage))
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
await this.storage.set('chatmsg' + roomId, messages)
|
||||
} else {
|
||||
console.log('failed to update', identificator)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -130,10 +130,10 @@ export class ChatStorageService {
|
||||
|
||||
delete ChatMessage.temporaryData
|
||||
messages.push(ChatMessage)
|
||||
console.log('no ID')
|
||||
|
||||
|
||||
await this.storage.set('chatmsg' + roomId, messages)
|
||||
// console.log('add to DB', ChatMessage)
|
||||
//
|
||||
|
||||
} else {
|
||||
const find = messages.find((message)=> {
|
||||
@@ -144,9 +144,9 @@ export class ChatStorageService {
|
||||
delete ChatMessage.temporaryData
|
||||
messages.push(ChatMessage)
|
||||
await this.storage.set('chatmsg' + roomId, messages)
|
||||
// console.log('add to DB', ChatMessage)
|
||||
//
|
||||
} else {
|
||||
console.log('duplicate')
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export class ChatStorageService {
|
||||
|
||||
delete ChatMessage.temporaryData
|
||||
messages.push(ChatMessage)
|
||||
// console.log('add to DB')
|
||||
//
|
||||
|
||||
} else {
|
||||
const find = messages.find((message)=> {
|
||||
@@ -176,7 +176,7 @@ export class ChatStorageService {
|
||||
if(!find) {
|
||||
delete ChatMessage.temporaryData
|
||||
messages.push(ChatMessage)
|
||||
// console.log('add to DB')
|
||||
//
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -242,14 +242,14 @@ export class MessageService {
|
||||
} else if (this.file.type != "application/img") {
|
||||
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
console.log(downloadFile)
|
||||
|
||||
} /* else if (this.file.type == 'application/audio') {
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
} */
|
||||
|
||||
console.log('Download file ',downloadFile )
|
||||
|
||||
|
||||
this.attachments[0] = {
|
||||
image_url: downloadFile,
|
||||
@@ -331,7 +331,7 @@ export class MessageService {
|
||||
|
||||
async save() {
|
||||
const message = this.getChatObj()
|
||||
console.log(message);
|
||||
|
||||
|
||||
await MessageModel.update(message)
|
||||
|
||||
|
||||
@@ -242,12 +242,12 @@ export class RoomService {
|
||||
|
||||
if (typeof args[1] != 'object') {
|
||||
this.userThatIsTyping = this.usernameToDisplayName(args[0])
|
||||
console.log(this.userThatIsTyping, 'this.userThatIsTyping')
|
||||
|
||||
this.isTyping = args[1]
|
||||
this.otherUserType = args[1]
|
||||
this.readAllMessage()
|
||||
|
||||
// console.log(JSON.stringify(args))
|
||||
//
|
||||
// alert(JSON.stringify(args))
|
||||
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
|
||||
|
||||
@@ -255,7 +255,7 @@ export class RoomService {
|
||||
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
|
||||
|
||||
// alert('delete')
|
||||
// console.log(args[0], 'receive delete message::()')
|
||||
//
|
||||
this.deleteMessage(args[1]?.method?._id)
|
||||
|
||||
} else {
|
||||
@@ -395,7 +395,7 @@ export class RoomService {
|
||||
return true
|
||||
|
||||
} else {
|
||||
// console.log(_id,'==',this.messages[i]?._id, false)
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ export class RoomService {
|
||||
|
||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
|
||||
// console.log('load chatHistory', JSON.stringify(chatHistory))
|
||||
//
|
||||
|
||||
const messagesId = this.messages.map((message)=> message._id)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class WebsocketService {
|
||||
public connect(url): Rx.Subject<MessageEvent> {
|
||||
if(!this.subject){
|
||||
this.subject = this.create(url);
|
||||
console.log("Sucessful connect :"+url);
|
||||
|
||||
}
|
||||
return this.subject;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ export class WsChatMethodsService {
|
||||
try {
|
||||
const rooms = await this.storage.get('Rooms');
|
||||
|
||||
console.log('restore',rooms)
|
||||
|
||||
|
||||
if(rooms) {
|
||||
await rooms.result.update.forEach( async (roomData: room) => {
|
||||
@@ -172,7 +172,7 @@ export class WsChatMethodsService {
|
||||
async getAllRooms () {
|
||||
this.loadingWholeList = true
|
||||
const rooms = await this.WsChatService.getRooms();
|
||||
console.log('get all rooms', this.loggedUser)
|
||||
|
||||
await this.storage.remove('Rooms');
|
||||
|
||||
await rooms.result.update.forEach( async (roomData: room, index) => {
|
||||
@@ -210,7 +210,7 @@ export class WsChatMethodsService {
|
||||
|
||||
});
|
||||
|
||||
console.log('save rooms', rooms)
|
||||
|
||||
await this.storage.set('Rooms', rooms);
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ export class WsChatMethodsService {
|
||||
}
|
||||
|
||||
this.WsChatService.streamNotifyLogged().then((subscription=>{
|
||||
console.log('streamRoomMessages', subscription)
|
||||
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -275,14 +275,14 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
private defaultSubtribe(id: any) {
|
||||
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
|
||||
//console.log('streamRoomMessages', subscription)
|
||||
//
|
||||
})
|
||||
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false)
|
||||
|
||||
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
|
||||
//console.log('streamNotifyRoomDeleteMessage', subscription);
|
||||
//
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ export class WsChatService {
|
||||
}
|
||||
|
||||
const requestId = uuidv4()
|
||||
// console.log('Login true', SessionStore.user)
|
||||
//
|
||||
const message = {
|
||||
msg: "method",
|
||||
method: "login",
|
||||
@@ -70,12 +70,12 @@ export class WsChatService {
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// console.log('MESSAGE:ID', requestId)
|
||||
//
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
// console.log('MESSAGE:ID', message)
|
||||
//
|
||||
if(message.id == requestId ) { // same request send
|
||||
// console.log('MESSAGE:ID', message.id, requestId)
|
||||
// console.log('LOGIN WS',message)
|
||||
//
|
||||
//
|
||||
if(message.result) {
|
||||
if(message.result.token) {
|
||||
|
||||
@@ -87,11 +87,11 @@ export class WsChatService {
|
||||
}, 10)
|
||||
|
||||
resolve(message)
|
||||
// console.log('LOGIN WS',message)
|
||||
//
|
||||
}
|
||||
} else {
|
||||
this.isLogin = false
|
||||
// console.log('Register FAIl', message)
|
||||
//
|
||||
reject(message)
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ export class WsChatService {
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
if(message.id == requestId) { // same request send
|
||||
resolve(message)
|
||||
// console.log('getRooms', message)
|
||||
//
|
||||
return true
|
||||
}
|
||||
}})
|
||||
@@ -206,7 +206,7 @@ export class WsChatService {
|
||||
}]
|
||||
}
|
||||
|
||||
// console.log('send message to rocketchat ', message)
|
||||
//
|
||||
|
||||
this.ws.send({message, requestId});
|
||||
|
||||
@@ -312,7 +312,7 @@ export class WsChatService {
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
if(message.id == requestId ) { // same request send
|
||||
resolve(message)
|
||||
// console.log(message);
|
||||
//
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -478,7 +478,7 @@ export class WsChatService {
|
||||
|
||||
return new Promise<chatHistory>((resolve, reject) => {
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
// console.log(message)
|
||||
//
|
||||
if(message.id == requestId ) { // same request send
|
||||
resolve(message)
|
||||
return true
|
||||
@@ -536,7 +536,7 @@ export class WsChatService {
|
||||
this.ws.registerCallback({
|
||||
type:'Onmessage',
|
||||
funx:(message)=>{
|
||||
//console.log(message);
|
||||
//
|
||||
|
||||
if(message.msg =='changed' && message.collection == collection) {
|
||||
if(message.fields.args[0].rid == roomId) {
|
||||
@@ -674,7 +674,7 @@ export class WsChatService {
|
||||
registerCallback:(params: wsCallbacksParams) => {
|
||||
|
||||
let id = params.requestId || params.key || uuidv4()
|
||||
// console.log('register id', params)
|
||||
//
|
||||
this.wsCallbacks[id] = params
|
||||
this.n++
|
||||
return id
|
||||
@@ -690,7 +690,7 @@ export class WsChatService {
|
||||
onopen: async ()=> {
|
||||
this.ws.connected = true
|
||||
|
||||
console.log('================== welcome to socket server =====================')
|
||||
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
@@ -719,11 +719,11 @@ export class WsChatService {
|
||||
for (const [key, item] of Object.entries(this.wsMsgQueue)) {
|
||||
|
||||
if(item.loginRequired == true && this.isLogin == true) {
|
||||
//console.log('run msgQueue ', key)
|
||||
//
|
||||
this.ws.send(item);
|
||||
delete this.wsMsgQueue[key]
|
||||
} else if(item.loginRequired == false) {
|
||||
//console.log('run msgQueue ', key)
|
||||
//
|
||||
this.ws.send(item);
|
||||
delete this.wsMsgQueue[key]
|
||||
}
|
||||
@@ -732,13 +732,13 @@ export class WsChatService {
|
||||
send: ({message, requestId = uuidv4(), loginRequired = true}:send) => {
|
||||
|
||||
if (this.ws.connected == false || loginRequired == true && this.isLogin == false) { // save data to send when back online
|
||||
// console.log('save msgQueue this.ws.connected == false || loginRequired == true && this.isLogin == false',this.ws.connected, loginRequired, this.isLogin)
|
||||
//console.log('save msgQueue', requestId, message)
|
||||
//
|
||||
//
|
||||
|
||||
this.wsMsgQueue[requestId] = {message, requestId, loginRequired}
|
||||
} else {
|
||||
let messageStr = JSON.stringify(message)
|
||||
// console.log('messageStr', messageStr)
|
||||
//
|
||||
|
||||
this.socket.send(messageStr)
|
||||
}
|
||||
@@ -748,7 +748,7 @@ export class WsChatService {
|
||||
onmessage: async (event: any)=> {
|
||||
const data = JSON.parse(event.data)
|
||||
|
||||
// console.log('onmessage', data)
|
||||
//
|
||||
|
||||
for (const [key, value] of Object.entries(this.wsCallbacks)) {
|
||||
if(value.type== 'Onmessage') {
|
||||
@@ -772,11 +772,11 @@ export class WsChatService {
|
||||
this.connect()
|
||||
this.login()
|
||||
|
||||
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
|
||||
|
||||
},
|
||||
|
||||
onerror: (event: any) => {
|
||||
console.log(`[error] ${event.message}`);
|
||||
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -47,6 +47,15 @@ export class EventsService {
|
||||
hasOwnOficial: boolean = false;
|
||||
hasOwnPessoal: boolean = false;
|
||||
|
||||
|
||||
|
||||
userCalendarNameSharedOficial = '';
|
||||
userCalendarNameSharedPessoal = '';
|
||||
userCalendarNameOwnOficial = '';
|
||||
userCalendarNameOwnPessoal = '';
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
public user: AuthService,
|
||||
@@ -56,7 +65,8 @@ export class EventsService {
|
||||
private backgroundservice: BackgroundService) {
|
||||
|
||||
this.loggeduser = this.user.ValidatedUser;
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headersMdOficial = new HttpHeaders();
|
||||
this.headersMdPessoal = new HttpHeaders();
|
||||
|
||||
@@ -82,7 +92,7 @@ export class EventsService {
|
||||
|
||||
}
|
||||
|
||||
setHeader() {
|
||||
async setHeader () {
|
||||
|
||||
this.hasSharedCalendar = false
|
||||
this.hasSharedOficial = false
|
||||
@@ -92,13 +102,22 @@ export class EventsService {
|
||||
this.hasOwnOficial = false
|
||||
this.hasOwnPessoal = false
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
this.headerOwnOficial= new HttpHeaders();
|
||||
this.headerOwnPessoal= new HttpHeaders();
|
||||
|
||||
this.headerSharedOficial= new HttpHeaders();
|
||||
this.headerSharedPessoal= new HttpHeaders();
|
||||
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
this.userCalendarNameSharedOficial = '';
|
||||
this.userCalendarNameSharedPessoal = '';
|
||||
this.userCalendarNameOwnOficial = '';
|
||||
this.userCalendarNameOwnPessoal = '';
|
||||
|
||||
this.calendarIds = []
|
||||
this.calendarIds = [];
|
||||
|
||||
if (this.loggeduser) {
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
@@ -226,10 +245,15 @@ export class EventsService {
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
||||
}
|
||||
|
||||
|
||||
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,6 +352,23 @@ export class EventsService {
|
||||
return this.http.get<any>(`${geturl}`, options)
|
||||
}
|
||||
|
||||
|
||||
GetCalendarName(userid:string) {
|
||||
|
||||
let geturl = environment.apiURL + 'userauthentication/single';
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("id", userid);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
}
|
||||
|
||||
return this.http.get<any>(`${geturl}`, options)
|
||||
}
|
||||
|
||||
async getAllMdEvents(startdate: string, enddate: string) {
|
||||
|
||||
let prO = [], prP = [];
|
||||
@@ -341,6 +382,8 @@ export class EventsService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async getAllOwnEvents(startdate: string, enddate: string) {
|
||||
|
||||
let ownO = [], ownP = [];
|
||||
@@ -469,7 +512,7 @@ export class EventsService {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
};
|
||||
console.log(options);
|
||||
|
||||
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -642,7 +685,7 @@ export class EventsService {
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options).pipe(
|
||||
catchError(err => {
|
||||
console.log('Event edit saved offline')
|
||||
|
||||
this.offlinemanager.storeRequestData('eventEdit', arrayReq);
|
||||
throw new Error(err);
|
||||
})
|
||||
@@ -667,7 +710,7 @@ export class EventsService {
|
||||
let options: any;
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
@@ -675,14 +718,14 @@ export class EventsService {
|
||||
break;
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
console.log(options);
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
@@ -695,7 +738,7 @@ export class EventsService {
|
||||
let options: any;
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
@@ -703,7 +746,7 @@ export class EventsService {
|
||||
break;
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
@@ -816,7 +859,7 @@ export class EventsService {
|
||||
|
||||
return this.http.delete(`${puturl}`, options).pipe(
|
||||
catchError(err => {
|
||||
console.log('Event edit saved offline')
|
||||
|
||||
this.offlinemanager.storeRequestData('eventDelete', arrayReq);
|
||||
throw new Error(err);
|
||||
})
|
||||
@@ -891,7 +934,7 @@ export class EventsService {
|
||||
|
||||
return this.http.delete(`${puturl}`, options).pipe(
|
||||
catchError(err => {
|
||||
console.log('Event edit saved offline')
|
||||
|
||||
this.offlinemanager.storeRequestData('eventDelete', arrayReq);
|
||||
throw new Error(err);
|
||||
})
|
||||
|
||||
@@ -70,7 +70,7 @@ export class EditEventPage implements OnInit {
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
@@ -162,7 +162,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
@@ -184,11 +184,10 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
@@ -184,10 +184,10 @@ export class EventDetailModalPage implements OnInit {
|
||||
this.loadedEventAttachments = attachments;
|
||||
}); */
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
console.log(res);
|
||||
|
||||
|
||||
},(error) => {
|
||||
console.log(error);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export class EventDetailPage implements OnInit {
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
@@ -160,7 +160,7 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
@@ -182,11 +182,10 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,15 +85,15 @@ export class EventsPage implements OnInit {
|
||||
public platform: Platform,
|
||||
) {
|
||||
this.existingScreenOrientation = this.screenOrientation.type;
|
||||
console.log(this.existingScreenOrientation);
|
||||
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.prEventList = null;
|
||||
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//console.log('Resize event detected');
|
||||
// console.log('Resize event detected');
|
||||
//
|
||||
//
|
||||
|
||||
});
|
||||
|
||||
@@ -136,7 +136,7 @@ export class EventsPage implements OnInit {
|
||||
// Lock to portrait
|
||||
lockToPortrait(){
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
|
||||
console.log('set');
|
||||
|
||||
}
|
||||
|
||||
// Lock to landscape
|
||||
@@ -152,7 +152,7 @@ export class EventsPage implements OnInit {
|
||||
checkScreenOrientation(){
|
||||
if( window.innerWidth < 701) {
|
||||
this.lockToPortrait();
|
||||
console.log('was here');
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
@@ -232,8 +232,8 @@ export class EventsPage implements OnInit {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
console.log(this.eventsList);
|
||||
console.log(this.eventsList);
|
||||
|
||||
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
@@ -296,12 +296,12 @@ export class EventsPage implements OnInit {
|
||||
|
||||
changeProfile(){
|
||||
if(this.profile == "mdgpr"){
|
||||
console.log('pr');
|
||||
|
||||
this.profile ="pr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
else{
|
||||
console.log('mdgpr');
|
||||
|
||||
this.profile ="mdgpr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
@@ -314,7 +314,7 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openEventDetail1(id:any){
|
||||
console.log(id);
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailPage,
|
||||
@@ -331,7 +331,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
LoadList() {
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log("Expediente", result);
|
||||
|
||||
|
||||
const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e))
|
||||
|
||||
|
||||
@@ -34,25 +34,25 @@ export class FcmService {
|
||||
PushNotifications.addListener(
|
||||
'registration',
|
||||
(token: PushNotificationToken) => {
|
||||
console.log('My token: ' + JSON.stringify(token));
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
PushNotifications.addListener('registrationError', (error: any) => {
|
||||
console.log('Error: ' + JSON.stringify(error));
|
||||
|
||||
});
|
||||
|
||||
PushNotifications.addListener(
|
||||
'pushNotificationReceived',
|
||||
async (notification: PushNotification) => {
|
||||
console.log('Push received: ' + JSON.stringify(notification));
|
||||
|
||||
}
|
||||
);
|
||||
PushNotifications.addListener(
|
||||
'pushNotificationActionPerformed',
|
||||
async (notification: PushNotificationActionPerformed) => {
|
||||
const data = notification.notification.data;
|
||||
console.log('Action performed: ' + JSON.stringify(notification.notification));
|
||||
|
||||
if (data.detailsId) {
|
||||
this.router.navigateByUrl(`/home/notifications/notification-detail${data.detaisId}`);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CustomImageCachePage implements OnInit {
|
||||
|
||||
@Input()
|
||||
set src(imageUrl: string){
|
||||
console.log('SET SOURCE', imageUrl)
|
||||
|
||||
|
||||
const imageName = imageUrl.split('/').pop()
|
||||
const fileType = imageName.split('.').pop()
|
||||
@@ -30,7 +30,7 @@ export class CustomImageCachePage implements OnInit {
|
||||
Filesystem.readFile({
|
||||
directory: Directory.Cache,
|
||||
path: `${CACHE_FOLDER}/${imageName}`}).then(readFile =>{
|
||||
console.log('LOCAL FILE: ', readFile)
|
||||
|
||||
// set to SRC
|
||||
this._src = `data:image/${fileType};base64ToFile, ${readFile.data}`
|
||||
}).catch(async e =>{
|
||||
|
||||
@@ -25,7 +25,7 @@ export class FileLoaderService {
|
||||
// input.onchange = () => {
|
||||
// // you can use this method to get file and perform respective operations
|
||||
// let files = Array.from(input.files);
|
||||
// console.log(files);
|
||||
//
|
||||
// };
|
||||
|
||||
|
||||
|
||||
@@ -78,12 +78,12 @@ export class FileService {
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
console.log('ALL RESULTS', result.files[0])
|
||||
|
||||
let lastphoto = result.files[result.files.length - 1]
|
||||
resolve(lastphoto)
|
||||
},
|
||||
async (err) => {
|
||||
console.log('ERROR FILE DOSENT EXIST', err)
|
||||
|
||||
reject('ERROR FILE DOSENT EXIST')
|
||||
// Folder does not yet exists!
|
||||
await Filesystem.mkdir({
|
||||
@@ -127,7 +127,7 @@ export class FileService {
|
||||
|
||||
//new method 4
|
||||
async loadFileData(fileName: string) {
|
||||
console.log('ALL PHOTOT FILE', fileName)
|
||||
|
||||
// for (let f of fileNames) {
|
||||
const filePath = `${IMAGE_DIR}/${fileName}`;
|
||||
|
||||
@@ -139,7 +139,7 @@ export class FileService {
|
||||
data: `data:image/jpeg;base64,${readFile.data}`,
|
||||
};
|
||||
|
||||
console.log('ALL IMAGE', image)
|
||||
|
||||
|
||||
const capturedImage = image.data
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export class SortService {
|
||||
}
|
||||
|
||||
sortArrayByDate(myArray: any) {
|
||||
console.log(myArray[0].taskStartDate);
|
||||
|
||||
if(myArray.length > 0){
|
||||
return myArray.sort(function (a, b) {
|
||||
return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0);
|
||||
@@ -29,10 +29,6 @@ export class SortService {
|
||||
|
||||
return array.sort( (a,b)=> {
|
||||
|
||||
/* console.log("AAA"+new Date(this.ObjectService.deepFind(a, path)));
|
||||
|
||||
console.log("BB"+new Date(this.ObjectService.deepFind(b, path))); */
|
||||
|
||||
return (new Date(this.ObjectService.deepFind(a, path)) < new Date(this.ObjectService.deepFind(b, path))) ? -1 : ((new Date(this.ObjectService.deepFind(a, path)) > new Date(this.ObjectService.deepFind(b, path))) ? 1 : 0);
|
||||
|
||||
//return new Date(this.ObjectService.deepFind(b, path)).getTime() - new Date(this.ObjectService.deepFind(a, path)).getTime();
|
||||
|
||||
@@ -60,12 +60,12 @@ export class TimeService {
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -93,12 +93,12 @@ export class TimeService {
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,12 +22,12 @@ export class JsonStore {
|
||||
|
||||
.then(function () {
|
||||
WL.Logger.debug('Init done');
|
||||
console.log('Init done');
|
||||
|
||||
return WL.JSONStore.get(collectionName).add(data, addOptions);
|
||||
|
||||
}).fail(function (err) {
|
||||
WL.Logger.error(err);
|
||||
console.log(err)
|
||||
|
||||
});
|
||||
|
||||
} */
|
||||
@@ -51,16 +51,16 @@ export class JsonStore {
|
||||
/* WL.JSONStore.init(JSONStoreCollections)
|
||||
.then(function () {
|
||||
WL.Logger.debug('Find all colletion data');
|
||||
console.log('Find all colletion data');
|
||||
|
||||
|
||||
|
||||
}).fail(function (err) {
|
||||
WL.Logger.error(err);
|
||||
console.log("JsonStore getColletion error ",err)
|
||||
|
||||
});
|
||||
|
||||
const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => {
|
||||
console.log('Find all colletion data', value);
|
||||
|
||||
return JSON.parse(value);
|
||||
});
|
||||
|
||||
@@ -91,14 +91,14 @@ export class JsonStore {
|
||||
/* WL.JSONStore.init(JSONStoreCollections)
|
||||
.then(function () {
|
||||
WL.Logger.debug('Find colletion data by id');
|
||||
console.log('Find colletion data by id');
|
||||
|
||||
|
||||
return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => {
|
||||
console.log('Find colletion data by id', value);
|
||||
|
||||
});
|
||||
}).fail(function (err) {
|
||||
WL.Logger.error(err);
|
||||
console.log(err)
|
||||
|
||||
}); */
|
||||
|
||||
}
|
||||
@@ -110,9 +110,9 @@ export class JsonStore {
|
||||
var options = {};
|
||||
|
||||
/* WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) {
|
||||
console.log("JsonStore replace document sucess: ", numberOfDocsReplaced)
|
||||
|
||||
}).fail(function (error) {
|
||||
console.log("JsonStore replace document error: ", error)
|
||||
|
||||
}); */
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ export class JsonStore {
|
||||
/* var query = { _id: 1 }; Exemple of query
|
||||
var options = { exact: true };
|
||||
/* WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) {
|
||||
console.log("JsonStore remove document sucess: ", numberOfDocsRemoved)
|
||||
|
||||
}).fail(function (error) {
|
||||
console.log("JsonStore remove document erro: ", error)
|
||||
|
||||
}); */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ export class NativeNotificationService {
|
||||
LocalNotifications.requestPermissions()
|
||||
|
||||
LocalNotifications.checkPermissions().then((data)=>{
|
||||
// console.log('success', data)
|
||||
//
|
||||
}).catch((data)=>{
|
||||
// console.log('error', data)
|
||||
//
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export class NetworkConnectionService {
|
||||
|
||||
constructor(){
|
||||
Network.addListener('networkStatusChange', status => {
|
||||
console.log('Network status changed', status);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export class WebNotificationPopupService {
|
||||
|
||||
// Let's check if the browser supports notifications
|
||||
if (!('Notification' in window)) {
|
||||
console.log("This browser does not support notifications.");
|
||||
|
||||
} else {
|
||||
if(this.checkNotificationPromise()) {
|
||||
Notification.requestPermission()
|
||||
@@ -67,7 +67,7 @@ export class WebNotificationPopupService {
|
||||
// {action: 'reply', title: 'Reply', icon: 'https://example/reply.png'}
|
||||
// ]
|
||||
}).then(e =>{
|
||||
console.log(e)
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
@@ -98,17 +98,17 @@ export class NotificationsService {
|
||||
|
||||
getAndpostToken(username) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
|
||||
} else {
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
console.log('token: ', token.value)
|
||||
|
||||
this.storageService.store(username, token.value);
|
||||
this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
@@ -118,9 +118,9 @@ export class NotificationsService {
|
||||
};
|
||||
|
||||
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
|
||||
}, (error) => {
|
||||
console.log('Post token to backend', error)
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
@@ -134,7 +134,7 @@ export class NotificationsService {
|
||||
registrationError() {
|
||||
PushNotifications.addListener('registrationError',
|
||||
(error: any) => {
|
||||
console.log('Error on registration: ' + JSON.stringify(error));
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -142,9 +142,9 @@ export class NotificationsService {
|
||||
onReciveForeground() {
|
||||
PushNotifications.addListener('pushNotificationReceived',
|
||||
(notification: PushNotificationSchema) => {
|
||||
console.log('Push received: ' + JSON.stringify(notification));
|
||||
|
||||
this.DataArray.push(notification)
|
||||
console.log("On ReceiveNotification", this.DataArray)
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
@@ -156,9 +156,9 @@ export class NotificationsService {
|
||||
onReciveBackground() {
|
||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||
(notification: ActionPerformed) => {
|
||||
console.log('Push action performed: ' + JSON.stringify(notification));
|
||||
|
||||
/* this.DataArray.push(notification.notification)
|
||||
console.log("On ReceiveNotification", this.DataArray)
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
@@ -175,10 +175,10 @@ export class NotificationsService {
|
||||
|
||||
notificatinsRoutes = (notification) => {
|
||||
|
||||
console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
|
||||
|
||||
|
||||
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||
console.log("Id Lenght", notification.notification.data.IdObject.length)
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
|
||||
}
|
||||
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
|
||||
|
||||
@@ -54,7 +54,7 @@ export class ObjectQueryService {
|
||||
}
|
||||
|
||||
print() {
|
||||
console.log(this.data)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export class OfflineManagerService {
|
||||
JSON.parse(req).forEach(element => {
|
||||
this.eventservice.editEvent(element, 2, 3).subscribe((res) => {
|
||||
this.storage.remove('eventEdit')
|
||||
console.log('eventEdit synchnize', res)
|
||||
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
@@ -59,10 +59,10 @@ export class PhotoService {
|
||||
fileFormat: capturedPhoto.format,
|
||||
});
|
||||
|
||||
console.log(capturedPhoto);
|
||||
|
||||
|
||||
console.log(this.photos[0]);
|
||||
|
||||
|
||||
|
||||
} */
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ export class ProcessesService {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
console.log(options);
|
||||
|
||||
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class PublicationsService {
|
||||
};
|
||||
|
||||
return this.http.put<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ GetPublicationByIdNext( publicationId:any){
|
||||
return true
|
||||
}else{
|
||||
const navigation = this.router.getCurrentNavigation()
|
||||
console.log('nav:', navigation)
|
||||
|
||||
|
||||
if(navigation){
|
||||
geturl = navigation.extractedUrl.toString()
|
||||
|
||||
@@ -39,7 +39,7 @@ export class RouteService {
|
||||
* @param url [string] incase no history to go back */
|
||||
goBack(url = null) {
|
||||
if(this.history.length >= 2) {
|
||||
console.log(this.history);
|
||||
|
||||
|
||||
this.history.pop();
|
||||
const url = this.history.pop();
|
||||
@@ -83,7 +83,7 @@ export class RouteService {
|
||||
params[key] = value
|
||||
}
|
||||
|
||||
console.log('params', params)
|
||||
|
||||
return params
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class SearchService {
|
||||
// store params
|
||||
let params = new HttpParams();
|
||||
// set https params
|
||||
console.log(subject);
|
||||
|
||||
|
||||
params = params.set("assunto", subject);
|
||||
params = params.set("data", date);
|
||||
@@ -78,7 +78,7 @@ export class SearchService {
|
||||
// store params
|
||||
let params = new HttpParams();
|
||||
// set https params
|
||||
console.log(subject);
|
||||
|
||||
|
||||
params = params.set("assunto", subject);
|
||||
params = params.set("data", date);
|
||||
|
||||
@@ -32,18 +32,18 @@ export class SqliteService {
|
||||
}
|
||||
|
||||
databaseConn() {
|
||||
console.log('SQLDBConnect')
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
console.log('SQLDBConnect22')
|
||||
|
||||
this.platform.ready().then(async () => {
|
||||
console.log('SQLDBConnect33')
|
||||
|
||||
this.sqlite.create({
|
||||
name: this.db_name,
|
||||
location: 'default'
|
||||
}).then(async (sqLite: SQLiteObject) => {
|
||||
this.dbInstance = sqLite;
|
||||
console.log('SQLITE INSTACE ',this.dbInstance);
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.events} (
|
||||
EventId varchar(255) PRIMARY KEY,
|
||||
@@ -70,9 +70,9 @@ export class SqliteService {
|
||||
HumanDate varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess Events Table created: ", res)
|
||||
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.expedientes} (
|
||||
@@ -92,9 +92,9 @@ export class SqliteService {
|
||||
workflowName varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess Espedientes Table created: ", res)
|
||||
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.allprocess} (
|
||||
@@ -115,9 +115,9 @@ export class SqliteService {
|
||||
interveners Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess AllProcess Table created: ", res)
|
||||
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.actions} (
|
||||
@@ -131,9 +131,9 @@ export class SqliteService {
|
||||
publicationsDetails Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess action Table created: ", res)
|
||||
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatlistroom} (
|
||||
@@ -146,9 +146,8 @@ export class SqliteService {
|
||||
name varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess chat list room Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatlistUsers} (
|
||||
@@ -158,9 +157,8 @@ export class SqliteService {
|
||||
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess chat list users Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatmsg} (
|
||||
@@ -177,32 +175,31 @@ export class SqliteService {
|
||||
image_url Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess chat msg Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
console.log('Platform ready error', error)
|
||||
console.error( error)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//addactions
|
||||
public addactions(data) {
|
||||
console.log('Action insert', data)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications,publicationsDetails)
|
||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}','${data.publicationsDetails}')`, [])
|
||||
.then(() => {
|
||||
console.log("action add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -213,10 +210,10 @@ export class SqliteService {
|
||||
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
|
||||
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
|
||||
.then(() => {
|
||||
console.log("event add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -227,10 +224,10 @@ export class SqliteService {
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${data.Documents}','${data.actions}','${data.activityInstanceName}','${data.formURL}','${data.originator}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${data.workflowInstanceDataFields}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("expediente add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -241,52 +238,52 @@ export class SqliteService {
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("process add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistroom
|
||||
public addChatListRoom(data) {
|
||||
console.log('INSIDE DB CHAT LIST ROOM',data,)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.chatlistroom} (Id,Uids,Usernames,LastMessage,UpdatedAt,customFields,name)
|
||||
VALUES ('${data.id}','${JSON.stringify(data.uids)}','${JSON.stringify(data.usernames)}','${JSON.stringify(data.lastMessage)}','${data.updatedat}','${JSON.stringify(data.customFields)}','${data.name}')`, [])
|
||||
.then(() => {
|
||||
console.log("chat room add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistusers
|
||||
public addChatListUsers(data) {
|
||||
console.log('INSIDE DB CHAT LIST ROOM',data,)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.chatlistUsers} (Id,Name,Username)
|
||||
VALUES ('${data.id}','${data.name}','${data.username}')`, [])
|
||||
.then(() => {
|
||||
console.log("chat users add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistusers
|
||||
public addChatMSG(data) {
|
||||
console.log('INSIDE DB CHAT MSG',data,)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.chatmsg} (Id,Attachments,Channels,File,Mentions,Msg,Rid, Ts ,U, UpdatedAt)
|
||||
VALUES ('${data._id}','${JSON.stringify(data.attachments)}','${JSON.stringify(data.channels)}','${JSON.stringify(data.file)}','${JSON.stringify(data.mentions)}','${data.msg}','${data.rid}','${data.ts}','${JSON.stringify(data.u)}','${JSON.stringify(data._updatedAt)}')`, [])
|
||||
.then(() => {
|
||||
console.log("chat msg add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -297,24 +294,24 @@ export class SqliteService {
|
||||
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
|
||||
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
|
||||
.then(() => {
|
||||
console.log("event update with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//updateActions
|
||||
public updateactions(id, data) {
|
||||
try {
|
||||
console.log("update action data", data)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET publications = ? WHERE ProcessId = ${id}`, [data])
|
||||
.then(() => {
|
||||
console.log("action update with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
@@ -323,14 +320,14 @@ export class SqliteService {
|
||||
//updatePublicationsDetails
|
||||
public updatePublicationsDetails(id, data) {
|
||||
try {
|
||||
console.log("update action data", data)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET publicationsDetails = ? WHERE ProcessId = ${id}`, [data])
|
||||
.then(() => {
|
||||
console.log("action update with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
@@ -341,14 +338,14 @@ export class SqliteService {
|
||||
let jsonId = JSON.stringify(id)
|
||||
let jsondata = JSON.stringify(data)
|
||||
try {
|
||||
console.log("update action data", data)
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.chatmsg} SET image_url = ? WHERE Id = ${jsonId}`, [jsondata])
|
||||
.then(() => {
|
||||
console.log("ChatMsg update with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
@@ -362,10 +359,10 @@ export class SqliteService {
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("process add with Success");
|
||||
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -373,14 +370,14 @@ export class SqliteService {
|
||||
updateUser(id, document,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET Documents = ? WHERE serialNumber = ${id}`, [document]).then(() => {
|
||||
console.log("process attachment updated")
|
||||
|
||||
})
|
||||
}
|
||||
//updateAttachment
|
||||
updateProcessInterveners(id, interveners,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET interveners = ? WHERE serialNumber = ${id}`, [interveners]).then(() => {
|
||||
console.log("process interveners updated")
|
||||
|
||||
})
|
||||
}
|
||||
//getAllEvents
|
||||
@@ -435,7 +432,7 @@ export class SqliteService {
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all events error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -449,7 +446,7 @@ export class SqliteService {
|
||||
return this.EXPEDIENTES;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all expedientes error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -463,7 +460,7 @@ export class SqliteService {
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -478,7 +475,7 @@ export class SqliteService {
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all actions error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -493,7 +490,7 @@ export class SqliteService {
|
||||
return this.ALLChatROOM;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all chat room error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -508,7 +505,7 @@ export class SqliteService {
|
||||
return this.ALLChatUSERs;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all chat users error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -523,7 +520,7 @@ export class SqliteService {
|
||||
return this.ALLCHATMSG;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all chat users error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
//getlistOfEventAprove
|
||||
@@ -537,7 +534,7 @@ export class SqliteService {
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -552,7 +549,7 @@ export class SqliteService {
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -563,12 +560,12 @@ export class SqliteService {
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
console.log('getEXPEDIENTE DB LOOP')
|
||||
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -583,7 +580,7 @@ export class SqliteService {
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -597,7 +594,7 @@ export class SqliteService {
|
||||
return this.PROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get process by serial error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -612,7 +609,7 @@ export class SqliteService {
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get actions by processId error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -690,7 +687,7 @@ export class SqliteService {
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get events by id error", JSON.stringify(e));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -700,30 +697,30 @@ export class SqliteService {
|
||||
this.deleteactionsTable();
|
||||
this.deletepublicationsTable();
|
||||
|
||||
console.log('All tables deleted')
|
||||
|
||||
}
|
||||
|
||||
deleteeventsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.events).then((res) => {
|
||||
console.log('DELETE EVENT TABLE RESULT ', res)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deleteallprocessTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.allprocess).then((res) => {
|
||||
console.log('DELETE ALLPROCESS TABLE RESULT ', res)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deleteactionsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.actions).then((res) => {
|
||||
console.log('DELETE actions TABLE RESULT ', res)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deletepublicationsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.publications).then((res) => {
|
||||
console.log('DELETE publications TABLE RESULT ', res)
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ThemeService {
|
||||
document.body.classList.remove("tribunal");
|
||||
document.body.classList.add(theme);
|
||||
this.currentTheme = theme
|
||||
console.log('Current theme', theme);
|
||||
|
||||
this.storageservice.store('theme',theme);
|
||||
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ export class ToastService {
|
||||
</div>
|
||||
`;
|
||||
|
||||
// console.log(document.querySelector('body').classList)
|
||||
//
|
||||
document.body.append(loader)
|
||||
|
||||
loader.addEventListener('click', ()=>{
|
||||
|
||||
@@ -45,22 +45,22 @@ export class WebNotificationsService {
|
||||
|
||||
/* MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...");
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...");
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
|
||||
});
|
||||
}, 1000)
|
||||
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
|
||||
}); */
|
||||
}
|
||||
|
||||
@@ -72,32 +72,32 @@ export class WebNotificationsService {
|
||||
|
||||
/* getAndpostToken(username) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
|
||||
} else {
|
||||
|
||||
const geturl = environment.apiURL + 'notifications/token'; */
|
||||
/*
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully Service intialized: " + successResponse);
|
||||
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure Service intialized: " + failureResponse);
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
MFPPush.registerDevice(null, (successResponse) => {
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse));
|
||||
console.log('token: ', successResponse.deviceId)
|
||||
|
||||
|
||||
this.storageService.store(username, successResponse.deviceId);
|
||||
this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
@@ -106,19 +106,19 @@ export class WebNotificationsService {
|
||||
Service: 1
|
||||
};
|
||||
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Successfully failue: " + JSON.stringify(failureResponse));
|
||||
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -128,23 +128,23 @@ export class WebNotificationsService {
|
||||
async onReceviNotification() {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully intialized: " + successResponse);
|
||||
|
||||
MFPPush.registerNotificationsCallback(notificationReceived);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure intialized: " + failureResponse);
|
||||
|
||||
}
|
||||
);
|
||||
var notificationReceived = (message) => {
|
||||
console.log(message);
|
||||
|
||||
var data = JSON.parse(message.payload);
|
||||
console.log(data.Service);
|
||||
console.log(data.IdObject);
|
||||
console.log(data.Object);
|
||||
|
||||
|
||||
|
||||
|
||||
if(message.actionName){
|
||||
this.notificatinsRoutes(data);
|
||||
@@ -154,8 +154,8 @@ export class WebNotificationsService {
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
} */
|
||||
|
||||
@@ -13,13 +13,13 @@ export class WebsocketService {
|
||||
private subject: Rx.Subject<MessageEvent>;
|
||||
|
||||
constructor() {
|
||||
console.log("CHAT WEBSOCKET");
|
||||
|
||||
}
|
||||
|
||||
public connect(url): Rx.Subject<MessageEvent> {
|
||||
if (!this.subject) {
|
||||
this.subject = this.create(url);
|
||||
console.log("Successfully connected: " + url);
|
||||
|
||||
}
|
||||
return this.subject;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export class WebsocketService {
|
||||
private create(url): Rx.Subject<MessageEvent> {
|
||||
let ws = new WebSocket(url);
|
||||
|
||||
console.log(ws);
|
||||
|
||||
|
||||
|
||||
let observable = Rx.Observable.create((obs: Rx.Observer<MessageEvent>) => {
|
||||
|
||||
Reference in New Issue
Block a user