mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
pull made
This commit is contained in:
+2
-1
@@ -77,4 +77,5 @@ _www/
|
|||||||
www2020
|
www2020
|
||||||
android copy/
|
android copy/
|
||||||
report.*
|
report.*
|
||||||
src/plugin/src/
|
src/plugin/src/
|
||||||
|
_node_modules/
|
||||||
Generated
+699
-58
File diff suppressed because it is too large
Load Diff
@@ -28,12 +28,14 @@
|
|||||||
"@angular/cdk": "^11.2.13",
|
"@angular/cdk": "^11.2.13",
|
||||||
"@angular/common": "^12.1.2",
|
"@angular/common": "^12.1.2",
|
||||||
"@angular/core": "^12.1.2",
|
"@angular/core": "^12.1.2",
|
||||||
|
"@angular/fire": "^7.5.0",
|
||||||
"@angular/forms": "~12.1.2",
|
"@angular/forms": "~12.1.2",
|
||||||
"@angular/localize": "^12.1.2",
|
"@angular/localize": "^12.1.2",
|
||||||
"@angular/material": "^11.2.13",
|
"@angular/material": "^11.2.13",
|
||||||
"@angular/material-moment-adapter": "^12.0.5",
|
"@angular/material-moment-adapter": "^12.0.5",
|
||||||
"@angular/platform-browser": "~12.1.2",
|
"@angular/platform-browser": "~12.1.2",
|
||||||
"@angular/platform-browser-dynamic": "~12.1.2",
|
"@angular/platform-browser-dynamic": "~12.1.2",
|
||||||
|
"@angular/pwa": "^15.1.4",
|
||||||
"@angular/router": "~12.1.2",
|
"@angular/router": "~12.1.2",
|
||||||
"@awesome-cordova-plugins/core": "^5.40.0",
|
"@awesome-cordova-plugins/core": "^5.40.0",
|
||||||
"@awesome-cordova-plugins/document-viewer": "^5.41.0",
|
"@awesome-cordova-plugins/document-viewer": "^5.41.0",
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ export class HomePage implements OnInit {
|
|||||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||||
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
||||||
document.querySelectorAll('.loading-blocker').forEach((e: any) => e.remove())
|
document.querySelectorAll('.loading-blocker').forEach((e: any) => e.remove())
|
||||||
|
document.querySelectorAll('ion-popover').forEach((e: any) => e.remove())
|
||||||
});
|
});
|
||||||
|
|
||||||
window['platform'] = platform
|
window['platform'] = platform
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<!-- Progress bar -->
|
<!-- Progress bar -->
|
||||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
|
||||||
<ion-refresher-content>
|
|
||||||
</ion-refresher-content>
|
|
||||||
</ion-refresher>
|
|
||||||
|
|
||||||
<ion-content id="timeline-conteiner agenda-container pt-20" class="timeline ">
|
<ion-content id="timeline-conteiner agenda-container pt-20" class="timeline ">
|
||||||
|
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
|
<ion-refresher-content>
|
||||||
|
</ion-refresher-content>
|
||||||
|
</ion-refresher>
|
||||||
|
|
||||||
<div class="d-flex container-wrapper">
|
<div class="d-flex container-wrapper">
|
||||||
|
|
||||||
<div class="calendar-timeline d-flex flex-column height-100 bg-blue">
|
<div class="calendar-timeline d-flex flex-column height-100 bg-blue">
|
||||||
|
|||||||
+2
-2
@@ -206,13 +206,13 @@ export class ApproveEventModalPage implements OnInit {
|
|||||||
try {
|
try {
|
||||||
await this.processes.PostTaskAction(body).toPromise()
|
await this.processes.PostTaskAction(body).toPromise()
|
||||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||||
this.toastService._successMessage()
|
this.toastService._successMessage('Evento enviado para revisão');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if(error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest()
|
this.toastService._badRequest('Evento não enviado para revisão');
|
||||||
}
|
}
|
||||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,13 +216,14 @@ export class ApproveEventPage implements OnInit {
|
|||||||
await this.processes.PostTaskAction(body).toPromise()
|
await this.processes.PostTaskAction(body).toPromise()
|
||||||
this.toastService._successMessage();
|
this.toastService._successMessage();
|
||||||
this.goBack();
|
this.goBack();
|
||||||
|
this.toastService._successMessage('Evento Aprovar')
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if(error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest()
|
this.toastService._badRequest('Evento não aprovar')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -266,14 +267,14 @@ export class ApproveEventPage implements OnInit {
|
|||||||
|
|
||||||
this.offlineManager.storeRequestData('event-listRever', body);
|
this.offlineManager.storeRequestData('event-listRever', body);
|
||||||
});
|
});
|
||||||
this.toastService._successMessage('Pedido enviado');
|
this.toastService._successMessage('Evento enviado para revisão');
|
||||||
this.goBack();
|
this.goBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if(error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest();
|
this.toastService._badRequest('Evento não enviado para revisão');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
@@ -299,7 +300,7 @@ export class ApproveEventPage implements OnInit {
|
|||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest()
|
this.toastService._badRequest('Evento não rejeitado')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
@@ -379,13 +380,14 @@ export class ApproveEventPage implements OnInit {
|
|||||||
await this.processes.PostTaskAction(body).toPromise();
|
await this.processes.PostTaskAction(body).toPromise();
|
||||||
this.toastService._successMessage();
|
this.toastService._successMessage();
|
||||||
this.goBack();
|
this.goBack();
|
||||||
|
this.toastService._successMessage('Evento enviado para revisão');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if(error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest();
|
this.toastService._badRequest('Evento não enviado para revisão');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.LoadCounts();
|
this.LoadCounts();
|
||||||
|
this.updateAllProcess()
|
||||||
|
|
||||||
const pathname = window.location.pathname
|
const pathname = window.location.pathname
|
||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
@@ -176,9 +177,11 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
if(this.NotificationsService.active === false) {
|
if(this.NotificationsService.active === false) {
|
||||||
this.checkRoutes();
|
this.checkRoutes();
|
||||||
this.LoadCounts();
|
this.LoadCounts();
|
||||||
|
this.updateAllProcess()
|
||||||
} else {
|
} else {
|
||||||
this.checkRoutes();
|
this.checkRoutes();
|
||||||
this.LoadCounts();
|
this.LoadCounts();
|
||||||
|
this.updateAllProcess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -786,7 +789,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
event.target.complete();
|
event?.target?.complete();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export class BackgroundService {
|
|||||||
e.funx()
|
e.funx()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.status = 'offline'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paint() {
|
paint() {
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import { EventTrigger } from '../services/eventTrigger.service';
|
|||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
||||||
import { notificationObject } from '../models/notifications';
|
import { notificationObject } from '../models/notifications';
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
import { Capacitor } from '@capacitor/core';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -30,6 +31,7 @@ export class NotificationsService {
|
|||||||
}} = {}
|
}} = {}
|
||||||
|
|
||||||
active = false
|
active = false
|
||||||
|
isPushNotificationsAvailable = Capacitor.isPluginAvailable('PushNotifications');
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
@@ -83,44 +85,53 @@ export class NotificationsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
requestPermissions() {
|
requestPermissions() {
|
||||||
PushNotifications.requestPermissions().then(result => {
|
if(!this.isPushNotificationsAvailable) {
|
||||||
if (result.receive === 'granted') {
|
return false
|
||||||
// Register with Apple / Google to receive push via APNS/FCM
|
}
|
||||||
PushNotifications.register();
|
|
||||||
} else {
|
PushNotifications.requestPermissions().then(result => {
|
||||||
// Show some error
|
if (result.receive === 'granted') {
|
||||||
}
|
// Register with Apple / Google to receive push via APNS/FCM
|
||||||
});
|
PushNotifications.register();
|
||||||
|
} else {
|
||||||
|
// Show some error
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getAndpostToken(username) {
|
getAndpostToken(username) {
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if(!this.isPushNotificationsAvailable) {
|
||||||
|
return false
|
||||||
} else {
|
}
|
||||||
const geturl = environment.apiURL + 'notifications/token';
|
|
||||||
PushNotifications.addListener('registration',
|
|
||||||
(token: Token) => {
|
|
||||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
|
||||||
const body = {
|
|
||||||
UserId: SessionStore.user.UserId,
|
|
||||||
TokenId: token.value,
|
|
||||||
Status: 1,
|
|
||||||
Service: 1
|
|
||||||
};
|
|
||||||
|
|
||||||
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
const geturl = environment.apiURL + 'notifications/token';
|
||||||
this.active = true
|
PushNotifications.addListener('registration',
|
||||||
console.log(data)
|
(token: Token) => {
|
||||||
}, (error) => {
|
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||||
console.log(error)
|
const body = {
|
||||||
})
|
UserId: SessionStore.user.UserId,
|
||||||
}
|
TokenId: token.value,
|
||||||
);
|
Status: 1,
|
||||||
}
|
Service: 1
|
||||||
|
};
|
||||||
|
|
||||||
|
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||||
|
this.active = true
|
||||||
|
console.log(data)
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registrationError() {
|
registrationError() {
|
||||||
|
if(!this.isPushNotificationsAvailable) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
PushNotifications.addListener('registrationError',
|
PushNotifications.addListener('registrationError',
|
||||||
(error: any) => {
|
(error: any) => {
|
||||||
this.active = false
|
this.active = false
|
||||||
@@ -129,6 +140,10 @@ export class NotificationsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onReciveForeground() {
|
onReciveForeground() {
|
||||||
|
if(!this.isPushNotificationsAvailable) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
console.log('foregrund');
|
console.log('foregrund');
|
||||||
PushNotifications.addListener('pushNotificationReceived',
|
PushNotifications.addListener('pushNotificationReceived',
|
||||||
(notification: PushNotificationSchema) => {
|
(notification: PushNotificationSchema) => {
|
||||||
@@ -156,6 +171,10 @@ export class NotificationsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onReciveBackground() {
|
onReciveBackground() {
|
||||||
|
if(!this.isPushNotificationsAvailable) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
console.log('fbackgrund');
|
console.log('fbackgrund');
|
||||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||||
(notification: ActionPerformed) => {
|
(notification: ActionPerformed) => {
|
||||||
|
|||||||
@@ -87,9 +87,14 @@ export class ApproveEventPage implements OnInit {
|
|||||||
try {
|
try {
|
||||||
await this.processes.PostTaskAction(body).toPromise()
|
await this.processes.PostTaskAction(body).toPromise()
|
||||||
this.modalController.dismiss(serialNumber);
|
this.modalController.dismiss(serialNumber);
|
||||||
this.toastService._successMessage()
|
this.toastService._successMessage('Evento aprovar')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService._badRequest()
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Evento não aprovar')
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.close()
|
this.close()
|
||||||
loader.remove()
|
loader.remove()
|
||||||
@@ -108,7 +113,13 @@ export class ApproveEventPage implements OnInit {
|
|||||||
await this.processes.PostTaskAction(body).toPromise()
|
await this.processes.PostTaskAction(body).toPromise()
|
||||||
this.toastService._successMessage('Evento rejeitado')
|
this.toastService._successMessage('Evento rejeitado')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService._badRequest('Processo não efectuado')
|
if(error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Evento não rejeitado')
|
||||||
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
this.close()
|
this.close()
|
||||||
@@ -196,7 +207,7 @@ export class ApproveEventPage implements OnInit {
|
|||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest();
|
this.toastService._badRequest('Evento não enviado para revisão');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ export class EventsToApprovePage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// console.log('ERROR LEGN',this.eventsMDGPRList.length)
|
|
||||||
this.segment = this.loggeduser.Profile;
|
this.segment = this.loggeduser.Profile;
|
||||||
this.LoadToApproveEvents();
|
this.LoadToApproveEvents();
|
||||||
|
|
||||||
@@ -127,7 +126,7 @@ export class EventsToApprovePage implements OnInit {
|
|||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
if (event) {
|
if (event) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
event.target.complete();
|
event?.target?.complete();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { localstoreService } from './localstore.service'
|
import { localstoreService } from './localstore.service'
|
||||||
import { AES, enc, SHA1 } from 'crypto-js'
|
import { AES, enc, SHA1 } from 'crypto-js'
|
||||||
|
import { isArray } from 'ionic-angular/umd/util/util';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -24,8 +25,8 @@ export class EventoaprovacaoStoreService {
|
|||||||
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
let restoreMd = localstoreService.get(this.keyNamemd, {})
|
let restoreMd = localstoreService.get(this.keyNamemd, [])
|
||||||
let restorePr = localstoreService.get(this.keyNamepr, {})
|
let restorePr = localstoreService.get(this.keyNamepr, [])
|
||||||
|
|
||||||
this._listPr = restorePr.listPr || []
|
this._listPr = restorePr.listPr || []
|
||||||
this._listMd = restoreMd.lisMd || []
|
this._listMd = restoreMd.lisMd || []
|
||||||
@@ -36,8 +37,8 @@ export class EventoaprovacaoStoreService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get listpr() { return this._listPr }
|
get listpr() { return this._listPr || [] }
|
||||||
get listmd() { return this._listMd }
|
get listmd() { return this._listMd || [] }
|
||||||
|
|
||||||
get count() { return this._count || 0 }
|
get count() { return this._count || 0 }
|
||||||
set count(value: number) {
|
set count(value: number) {
|
||||||
@@ -55,20 +56,24 @@ export class EventoaprovacaoStoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resetpr(eventsList: any) {
|
resetpr(eventsList: any) {
|
||||||
this._listPr = eventsList
|
if(Array.isArray(eventsList)) {
|
||||||
|
this._listPr = eventsList
|
||||||
|
|
||||||
this.countPr = this._listPr.length
|
this.countPr = this._listPr.length
|
||||||
this.count = this.countPr + this.countMd
|
this.count = this.countPr + this.countMd
|
||||||
|
|
||||||
this.savePr()
|
this.savePr()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resetmd(eventsList: any) {
|
resetmd(eventsList: any) {
|
||||||
this._listMd = eventsList
|
if(Array.isArray(eventsList)) {
|
||||||
|
this._listMd = eventsList
|
||||||
|
|
||||||
this.countMd = this._listMd.length
|
this.countMd = this._listMd.length
|
||||||
this.count = this.countPr + this.countMd
|
this.count = this.countPr + this.countMd
|
||||||
this.saveMd()
|
this.saveMd()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private saveMd() {
|
private saveMd() {
|
||||||
|
|||||||
@@ -149,6 +149,35 @@ class SessionService {
|
|||||||
return initials;
|
return initials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
clearPermission() {
|
||||||
|
this.permission = {
|
||||||
|
Agenda: {
|
||||||
|
access: false
|
||||||
|
},
|
||||||
|
Gabinete: {
|
||||||
|
access: false,
|
||||||
|
pr_tasks: false,
|
||||||
|
md_tasks: false,
|
||||||
|
aprove_event: false
|
||||||
|
},
|
||||||
|
Actions: {
|
||||||
|
access : false,
|
||||||
|
create : false,
|
||||||
|
delete : false,
|
||||||
|
edit : false,
|
||||||
|
createPost : false,
|
||||||
|
deletePost : false,
|
||||||
|
editPost : false
|
||||||
|
},
|
||||||
|
Chat: {
|
||||||
|
access: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setPermission() {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
if ('serviceWorker' in navigator) {
|
|
||||||
navigator.serviceWorker.register('./firebase-messaging-sw.js')
|
|
||||||
.then(function(registration) {
|
|
||||||
}).catch(function(err) {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Scripts for firebase and firebase messaging
|
|
||||||
|
|
||||||
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js');
|
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js');
|
||||||
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js');
|
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js');
|
||||||
|
|
||||||
@@ -36,4 +28,33 @@ messaging.onBackgroundMessage(function(payload) {
|
|||||||
|
|
||||||
self.registration.showNotification(notificationTitle,
|
self.registration.showNotification(notificationTitle,
|
||||||
notificationOptions);
|
notificationOptions);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
self.addEventListener('install', function(event) {
|
||||||
|
self.skipWaiting();
|
||||||
|
console.log('Installed', event);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('activate', function(event) {
|
||||||
|
console.log('Activated', event);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('push', function(event) {
|
||||||
|
|
||||||
|
var uid = "EXISTS_IN_CORE.JS";
|
||||||
|
var token = "ALSO_EXISTS_IN_CORE.JS";
|
||||||
|
|
||||||
|
console.log("Push recieved - we need to know the uid and token here, from core.js");
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('message', function(event){
|
||||||
|
var data = JSON.parse(event.data);
|
||||||
|
|
||||||
|
console.log("SW Received Message:");
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
self.userID = data.uid;
|
||||||
|
self.userToken = data.token;
|
||||||
|
|
||||||
|
});
|
||||||
@@ -48,36 +48,6 @@
|
|||||||
}
|
}
|
||||||
</script> -->
|
</script> -->
|
||||||
|
|
||||||
<script>
|
|
||||||
if (navigator.serviceWorker) {
|
|
||||||
navigator.serviceWorker.register("assets/firebase-messaging-sw.js").then(function(reg) {
|
|
||||||
window.pushReg = reg;
|
|
||||||
if (reg.installing) {
|
|
||||||
console.info('Service worker installing');
|
|
||||||
} else if (reg.waiting) {
|
|
||||||
console.info('Service worker installed');
|
|
||||||
} else if (reg.active) {
|
|
||||||
console.info('Service worker active');
|
|
||||||
}
|
|
||||||
if (!(reg.showNotification)) {
|
|
||||||
console.info('Notifications aren\'t supported on service workers.');
|
|
||||||
}
|
|
||||||
// Check if push messaging is supported
|
|
||||||
if (!('PushManager' in window)) {
|
|
||||||
console.info("Push messaging isn't supported.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Notification.permission === 'denied') {
|
|
||||||
console.info('The user has blocked notifications.');
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.error(JSON.stringify(err));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.info("Service workers aren't supported in this browser.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-hight, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-hight, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
<meta name="format-detection" content="telephone=no" />
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "cddddf982",
|
"shortSHA": "dcff11581",
|
||||||
"SHA": "cddddf982b924dbca51d9deba781dc1182d4b2b5",
|
"SHA": "dcff11581665a569e10ccab0aeaf1dc7f04d3d3a",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Eudes Inácio'",
|
"lastCommitAuthor": "'Eudes Inácio'",
|
||||||
"lastCommitTime": "'Fri Feb 3 14:45:16 2023 +0100'",
|
"lastCommitTime": "'Mon Feb 6 09:44:43 2023 +0100'",
|
||||||
"lastCommitMessage": "merge with Peter changes",
|
"lastCommitMessage": "Code refactore on pedido mobile",
|
||||||
"lastCommitNumber": "4721",
|
"lastCommitNumber": "4722",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nYour branch is behind 'origin/no_bug_movemente' by 2 commits, and can be fast-forwarded.\n (use \"git pull\" to update your local branch)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts\n\tdeleted: www.rar",
|
"changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 1 and 2 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: .gitignore\n\tmodified: package-lock.json\n\tmodified: package.json\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/background.service.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.ts\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts\n\tmodified: src/app/store/eventoaprovacao-store.service.ts\n\tmodified: src/app/store/session.service.ts\n\tmodified: src/assets/firebase-messaging-sw.js\n\tmodified: src/index.html\n\tmodified: version/git-version.ts",
|
||||||
"changeAuthor": "eudes.inacio"
|
"changeAuthor": "eudes.inacio"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user