mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
comment develop stuff
This commit is contained in:
@@ -106,7 +106,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
AllProcess = []
|
AllProcess = []
|
||||||
|
|
||||||
workerList : Worker
|
// workerList : Worker
|
||||||
|
|
||||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||||
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
||||||
@@ -128,11 +128,11 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
public NotificationsService: NotificationsService
|
public NotificationsService: NotificationsService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
|
// this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
|
||||||
|
|
||||||
this.workerList.onmessage = (oEvent) => {
|
// this.workerList.onmessage = (oEvent) => {
|
||||||
this.AllProcess = oEvent.data
|
// this.AllProcess = oEvent.data
|
||||||
}
|
// }
|
||||||
|
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
// if not mobile remove all component
|
// if not mobile remove all component
|
||||||
@@ -197,70 +197,78 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.NotificationsService.registerCallback(
|
// this.NotificationsService.registerCallback({
|
||||||
'despachos',
|
// type:'despachos',
|
||||||
() => {
|
// funx:() => {
|
||||||
this.LoadCounts();
|
// // this.loadCount();
|
||||||
console.log('refresh with notification')
|
// console.log('refresh with notification')
|
||||||
}
|
// }
|
||||||
)
|
// })
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'despachos-pr',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'expediente',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'gabinete-digital',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'parecer',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'deferimento',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'diplomas-assinar',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'diplomas',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.NotificationsService.registerCallback(
|
|
||||||
'expedientes-pr',
|
|
||||||
() => {
|
|
||||||
this.LoadCounts();
|
|
||||||
console.log('refresh with notification')
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type:'*',
|
||||||
|
// funx:() => {
|
||||||
|
// // this.LoadCounts();
|
||||||
|
// console.log('refresh with notification *')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type:'despachos-pr',
|
||||||
|
// funx:() => {
|
||||||
|
// // this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type:'expediente',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type:'gabinete-digital',
|
||||||
|
// funx:() => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type:'parecer',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type: 'deferimento',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type: 'diplomas-assinar',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type: 'diplomas',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.NotificationsService.registerCallback({
|
||||||
|
// type: 'expedientes-pr',
|
||||||
|
// funx: () => {
|
||||||
|
// this.LoadCounts();
|
||||||
|
// console.log('refresh with notification')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,7 +586,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
updateAllProcess() {
|
updateAllProcess() {
|
||||||
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
||||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
|
||||||
|
|
||||||
// try{
|
// try{
|
||||||
// this.workerList.postMessage([
|
// this.workerList.postMessage([
|
||||||
@@ -591,8 +599,6 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
// .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
// .concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
||||||
// .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
// .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get getAllProcessCount() {
|
get getAllProcessCount() {
|
||||||
|
|||||||
@@ -27,73 +27,59 @@ export class NotificationsService {
|
|||||||
folderId: string;
|
folderId: string;
|
||||||
DataArray = new Array();
|
DataArray = new Array();
|
||||||
|
|
||||||
callbacks: {
|
|
||||||
|
callbacks: {[key: string]: {
|
||||||
type: notificationObject,
|
type: notificationObject,
|
||||||
funx: Function
|
funx: Function
|
||||||
id: string
|
id: string
|
||||||
}[] = []
|
}} = {}
|
||||||
|
|
||||||
active = false
|
active = false
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
private modalController: ModalController,
|
|
||||||
public modalCtrl: AlertController,
|
public modalCtrl: AlertController,
|
||||||
private animationController: AnimationController,
|
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private toastService: ToastService,
|
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private activeroute: ActivatedRoute,
|
private eventtrigger: EventTrigger,) {
|
||||||
private eventtrigger: EventTrigger,
|
|
||||||
private backgroundservice: BackgroundService,
|
|
||||||
/* private eventTriger: Events, */
|
|
||||||
/* private fcm: FCM */) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
registerCallback(type: notificationObject, funx: Function, object: any = {}) {
|
|
||||||
|
|
||||||
const id = uuidv4()
|
|
||||||
this.callbacks.push({ type, funx, id })
|
|
||||||
if (!object.hasOwnProperty('desktop') && object['desktop'] != false) {
|
|
||||||
this.backgroundservice.registerBackService('Notification', funx, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
// registerCallback({type, funx, id = uuidv4()} : {
|
||||||
}
|
|
||||||
|
|
||||||
// registerCallback({type, funx, id = uuidv4()}:{
|
|
||||||
// type: notificationObject,
|
// type: notificationObject,
|
||||||
// funx: Function
|
// funx: Function
|
||||||
// id?: string
|
// id?: string
|
||||||
// }) {
|
// }) {
|
||||||
|
// this.callbacks[id] = { funx, id, type}
|
||||||
// this.callbacks.push({ type, funx, id })
|
|
||||||
|
|
||||||
// return id;
|
// return id;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private runNotificationCallback(notification) {
|
|
||||||
this.callbacks.forEach((data) => {
|
|
||||||
if(data.type == notification.data.IdObject) {
|
|
||||||
data.funx({notification})
|
|
||||||
} else if (data.type == '*') {
|
|
||||||
|
|
||||||
}
|
// private async runNotificationCallback(notification) {
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteCallback(id) {
|
// for (const [key, value] of Object.entries(this.callbacks)) {
|
||||||
this.callbacks.forEach((e, index) => {
|
// if(value.type == notification.data.Object) {
|
||||||
if (e.id == id) {
|
|
||||||
if (index > -1) {
|
|
||||||
this.callbacks.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
// const dontRepeat = await value.funx(notification)
|
||||||
|
|
||||||
|
// if(dontRepeat) {
|
||||||
|
// delete this.callbacks[key]
|
||||||
|
// }
|
||||||
|
|
||||||
|
// } else if (value.type == '*') {
|
||||||
|
// const dontRepeat = await value.funx(notification)
|
||||||
|
|
||||||
|
// if(dontRepeat) {
|
||||||
|
// delete this.callbacks[key]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
getTokenByUserIdAndId(user, userID) {
|
getTokenByUserIdAndId(user, userID) {
|
||||||
// const geturl = environment.apiURL + 'notifications/user/' + userID;
|
// const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||||||
@@ -120,7 +106,7 @@ export class NotificationsService {
|
|||||||
PushNotifications.addListener('registration',
|
PushNotifications.addListener('registration',
|
||||||
(token: Token) => {
|
(token: Token) => {
|
||||||
|
|
||||||
this.active = false
|
|
||||||
this.storageService.store(username, token.value);
|
this.storageService.store(username, token.value);
|
||||||
this.storageService.get(username).then(value => {
|
this.storageService.get(username).then(value => {
|
||||||
|
|
||||||
@@ -135,6 +121,7 @@ export class NotificationsService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||||
|
this.active = true
|
||||||
//console.log(data)
|
//console.log(data)
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
//console.log(error)
|
//console.log(error)
|
||||||
@@ -163,6 +150,7 @@ export class NotificationsService {
|
|||||||
onReciveForeground() {
|
onReciveForeground() {
|
||||||
PushNotifications.addListener('pushNotificationReceived',
|
PushNotifications.addListener('pushNotificationReceived',
|
||||||
(notification: PushNotificationSchema) => {
|
(notification: PushNotificationSchema) => {
|
||||||
|
this.active = true
|
||||||
console.log(notification)
|
console.log(notification)
|
||||||
//this.DataArray.push(notification)
|
//this.DataArray.push(notification)
|
||||||
//console.log(this.DataArray)
|
//console.log(this.DataArray)
|
||||||
@@ -176,7 +164,7 @@ export class NotificationsService {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.runNotificationCallback(notification)
|
// this.runNotificationCallback(notification)
|
||||||
/* this.eventTriger.publish('notificatioRecive') */
|
/* this.eventTriger.publish('notificatioRecive') */
|
||||||
this.eventtrigger.publishSomeData({
|
this.eventtrigger.publishSomeData({
|
||||||
notification: "recive"
|
notification: "recive"
|
||||||
@@ -188,6 +176,7 @@ export class NotificationsService {
|
|||||||
onReciveBackground() {
|
onReciveBackground() {
|
||||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||||
(notification: ActionPerformed) => {
|
(notification: ActionPerformed) => {
|
||||||
|
this.active = true
|
||||||
console.log(notification)
|
console.log(notification)
|
||||||
/* this.DataArray.push(notification.notification)
|
/* this.DataArray.push(notification.notification)
|
||||||
|
|
||||||
@@ -196,7 +185,7 @@ export class NotificationsService {
|
|||||||
notification: "recive"
|
notification: "recive"
|
||||||
}) */
|
}) */
|
||||||
this.notificatinsRoutes(notification)
|
this.notificatinsRoutes(notification)
|
||||||
this.runNotificationCallback(notification)
|
// this.runNotificationCallback(notification)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
updateAllProcess() {
|
updateAllProcess() {
|
||||||
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
||||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
|
||||||
}
|
}
|
||||||
|
|
||||||
get getAllProcessCount() {
|
get getAllProcessCount() {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "d08eeeba6",
|
"shortSHA": "6195400e0",
|
||||||
"SHA": "d08eeeba6cb3dd25ebc61c4e3491d5de3b31815e",
|
"SHA": "6195400e08d52057dbf000709fab5a00a9bf39fa",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Peter Maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Wed Jan 18 17:11:06 2023 +0100'",
|
"lastCommitTime": "'Wed Jan 18 17:18:08 2023 +0100'",
|
||||||
"lastCommitMessage": "save",
|
"lastCommitMessage": "all process",
|
||||||
"lastCommitNumber": "4655",
|
"lastCommitNumber": "4656",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts",
|
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user