mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Notification delete feature added
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<name>gabinete digital</name>
|
<name>gabinete digital</name>
|
||||||
<description>An awesome Ionic/Cordova app.</description>
|
<description>An awesome Ionic/Cordova app.</description>
|
||||||
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
||||||
<content src="index.html" />
|
<content original-src="index.html" src="http://localhost:8100" />
|
||||||
<access origin="*" />
|
<access origin="*" />
|
||||||
<allow-navigation href="http://*/*" />
|
<allow-navigation href="http://*/*" />
|
||||||
<allow-navigation href="https://*/*" />
|
<allow-navigation href="https://*/*" />
|
||||||
|
|||||||
@@ -42,27 +42,49 @@ export class ProfilePage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.storageservice.get("Notifications").then((value) => {
|
this.storageservice.get("Notifications").then((value) => {
|
||||||
|
console.log("Init get store", value)
|
||||||
|
|
||||||
var data = JSON.parse(value);
|
var data = JSON.parse(value);
|
||||||
data.forEach((element, i) => {
|
console.log("Init store parse", data)
|
||||||
|
data.forEach((element,i) => {
|
||||||
console.log("ARaaAA", element)
|
console.log("ARaaAA", element)
|
||||||
var payload = JSON.parse(element.payload)
|
let notificationObject;
|
||||||
let notificationObject = {
|
if(element.payload){
|
||||||
index: i,
|
var payload = JSON.parse(element.payload)
|
||||||
alert: element.alert,
|
notificationObject = {
|
||||||
Service: payload.Service,
|
index: i,
|
||||||
Object: payload.Object,
|
alert: element.alert,
|
||||||
IdObject: payload.IdObject,
|
Service: payload.Service,
|
||||||
FolderId: payload.FolderId,
|
Object: payload.Object,
|
||||||
desc: payload.desc,
|
IdObject: payload.IdObject,
|
||||||
dateInit: payload.dateInit,
|
FolderId: payload.FolderId,
|
||||||
dateEnd: payload.dateEnd,
|
desc: payload.desc,
|
||||||
Location: payload.Location,
|
dateInit: payload.dateInit,
|
||||||
TypeAgenda: payload.TypeAgenda,
|
dateEnd: payload.dateEnd,
|
||||||
Status: payload.Status
|
Location: payload.Location,
|
||||||
|
TypeAgenda: payload.TypeAgenda,
|
||||||
|
Status: payload.Status
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notificationObject = {
|
||||||
|
index: i,
|
||||||
|
alert: element.alert,
|
||||||
|
Service: element.Service,
|
||||||
|
Object: element.Object,
|
||||||
|
IdObject: element.IdObject,
|
||||||
|
FolderId: element.FolderId,
|
||||||
|
desc: element.desc,
|
||||||
|
dateInit: element.dateInit,
|
||||||
|
dateEnd: element.dateEnd,
|
||||||
|
Location: element.Location,
|
||||||
|
TypeAgenda: element.TypeAgenda,
|
||||||
|
Status: element.Status
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.DataArray.push(notificationObject)
|
this.DataArray.push(notificationObject)
|
||||||
});
|
});
|
||||||
this.notificationdata = this.DataArray
|
this.notificationdata = this.DataArray
|
||||||
@@ -70,6 +92,8 @@ export class ProfilePage implements OnInit {
|
|||||||
})
|
})
|
||||||
console.log("Notificaaa", this.notificationdata)
|
console.log("Notificaaa", this.notificationdata)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@@ -124,16 +148,21 @@ export class ProfilePage implements OnInit {
|
|||||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital']));
|
||||||
}
|
}
|
||||||
|
|
||||||
const indexx = this.notificationdata.indexOf(index, 0);
|
this.deleteNotification(index);
|
||||||
if (indexx > -1) {
|
|
||||||
this.notificationdata.splice(index, 1);
|
|
||||||
console.log('This notificatio', this.notificationdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.notificationservice.removeDepartment(index);
|
|
||||||
console.log('This notificatio 2', this.notificationdata);
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteNotification(index){
|
||||||
|
console.log("Delete notification first stata", this.notificationdata)
|
||||||
|
this.notificationdata = this.notificationdata.filter(item=>item.index !=index );
|
||||||
|
|
||||||
|
this.storageservice.store("Notifications",JSON.stringify(this.notificationdata)).then(() =>{
|
||||||
|
this.storageservice.get("Notifications").then((value) =>{
|
||||||
|
console.log("notfication state", value, )
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log("Delete notification last stata", this.notificationdata)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export class NotificationsService {
|
|||||||
var notificationReceived = (message) => {
|
var notificationReceived = (message) => {
|
||||||
//this.jsonstore.createCollection('Notifications',message);
|
//this.jsonstore.createCollection('Notifications',message);
|
||||||
this.DataArray.push(message)
|
this.DataArray.push(message)
|
||||||
console.log("On ReceiveNotification", message)
|
console.log("On ReceiveNotification", this.DataArray)
|
||||||
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
|
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
|
||||||
|
|
||||||
console.log(message);
|
console.log(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user