fix notification remove, create event of task from attachment

This commit is contained in:
Peter Maquiran
2023-11-01 12:24:34 +01:00
parent a6517da1e0
commit f3efe630c8
5 changed files with 43 additions and 40 deletions
@@ -223,7 +223,7 @@ export class DocumentDetailPage implements OnInit {
backdropDismiss: false
});
modal.onDidDismiss().then(res=>{
modal.onDidDismiss().then(res => {
//this.RouteService.goBack();
}, (error) => {
console.log(error)
@@ -58,7 +58,7 @@ export class ViewDocumentPage implements OnInit {
ngOnInit() {
this.processes.GetViewer(this.docId, this.applicationId).subscribe(async(res)=> {
const link: string = res.replace('//pdfjs/web/', '/pdfjs/web/')
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
@@ -125,7 +125,7 @@ export class ViewDocumentPage implements OnInit {
}
async openBookMeetingModal() {
console.log('this.Document', this.Document)
console.log('this.Document----------', this.Document)
let classs;
if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop'
@@ -164,6 +164,8 @@ export class ViewDocumentPage implements OnInit {
classs = 'modal modal-desktop showAsideOptions'
}
// check passing
console.log('this.Document----------openExpedientActionsModal', this.Document)
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
@@ -175,7 +177,7 @@ export class ViewDocumentPage implements OnInit {
cssClass: classs,
});
modal.onDidDismiss().then(
modal.onDidDismiss().then(
async(res)=>{}
, (error) => {
console.log(error)
@@ -124,35 +124,28 @@ export class ExpedientTaskModalPage implements OnInit {
this.SearchFolder = this.navParams.get('SearchFolder');
this.aplicationId = this.navParams.get('aplicationId')
// this.document = this.navParams.get('document')
this.document = this.navParams.get('document')
this.taskType = this.navParams.get('taskAction');
// if(this.document) {
// const doc: any = this.document
// this.documents.push({
// ApplicationId: (doc.ApplicationType || doc.ApplicationId),
// ApplicationType: (doc.ApplicationType || doc.ApplicationId),
// SourceId: (doc.Id || doc.DocId || doc.SourceId),
// Id: (doc.Id || doc.DocId || doc.SourceId),
// EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
// Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
// Data: (doc.DocDate || doc.Data),
// DocDate: (doc.DocDate || doc.Data),
// Assunto: doc.Assunto,
// } as any)
// }
const DocumentToSave = this.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id
try {
if(this.document) {
const doc: any = this.document
this.documents.push({
ApplicationId: (doc.ApplicationType || doc.ApplicationId),
ApplicationType: (doc.ApplicationType || doc.ApplicationId),
SourceId: (doc.Id || doc.DocId || doc.SourceId),
Id: (doc.Id || doc.DocId || doc.SourceId),
EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
Data: (doc.DocDate || doc.Data),
DocDate: (doc.DocDate || doc.Data),
Assunto: doc.Assunto,
} as any)
}
});
} catch (error) {
console.log(error)
}
console.log('this.document', this.document)
+2
View File
@@ -319,6 +319,8 @@ export class MessageService {
if(params?.attachments) {
if(params?.attachments[0]?.image_url) {
delete params?.attachments[0]?.image_url
delete params?.file?.image_url
// delete
}
}
+17 -11
View File
@@ -43,11 +43,15 @@ export class NotificationHolderService {
notificationObject(notification) {
const element = notification
const i = this._notificationList.length + 1
let notificationObject;
if (element.notification) {
notificationObject = {
id: notification?.id,
id: notification?.id || uuidv4(),
index: i,
title: element.notification.title,
Service: element.data.Service,
Object: element.data.Object,
@@ -65,7 +69,8 @@ export class NotificationHolderService {
} else if (element.data) {
notificationObject = {
id: notification?.id,
id: notification?.id || uuidv4(),
index: i,
title: element.title,
Service: element.data.Service,
Object: element.data.Object,
@@ -84,19 +89,20 @@ export class NotificationHolderService {
} else {
{
notificationObject = {
id: notification?.id,
title: element.title,
Service: element.Service,
Object: element.Object,
IdObject: element.IdObject,
id: notification?.id || uuidv4(),
FolderId: element.FolderId,
body: element.body,
dateInit: element.dateInit,
dateEnd: element.dateEnd,
IdObject: element.IdObject,
Location: element.Location,
TypeAgenda: element.TypeAgenda,
Object: element.Object,
Role: element.Role,
Service: element.Service,
Status: element.Status,
TypeAgenda: element.TypeAgenda,
body: element.body,
dateEnd: element.dateEnd,
dateInit: element.dateInit,
index: element.index,
title: element.title,
read: false,
}
}