diff --git a/package-lock.json b/package-lock.json index 112402d9f..470730c03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -175,6 +175,7 @@ "ng-lazyload-image": "^9.1.2", "ng2-pdf-viewer": "^3.0.8", "ngx-cookie-service": "^12.0.3", + "ngx-cropper": "^2.0.0-beta", "ngx-extended-pdf-viewer": "^13.0.0-alpha.2", "ngx-image-compress": "^11.0.3", "ngx-image-cropper": "^5.0.1", @@ -28580,6 +28581,24 @@ "@angular/core": "^12.0.0" } }, + "node_modules/ngx-cropper": { + "version": "2.0.0-beta", + "resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz", + "integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==", + "dependencies": { + "cropperjs": "^1.4.1", + "tslib": "^1.9.0" + }, + "peerDependencies": { + "@angular/common": "^6.0.0-rc.0 || ^6.0.0", + "@angular/core": "^6.0.0-rc.0 || ^6.0.0" + } + }, + "node_modules/ngx-cropper/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/ngx-extended-pdf-viewer": { "version": "13.0.0-alpha.2", "resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz", @@ -66448,6 +66467,22 @@ "tslib": "^2.0.0" } }, + "ngx-cropper": { + "version": "2.0.0-beta", + "resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz", + "integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==", + "requires": { + "cropperjs": "^1.4.1", + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "ngx-extended-pdf-viewer": { "version": "13.0.0-alpha.2", "resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz", diff --git a/package.json b/package.json index 47faba9a2..5cb76409b 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "ng-lazyload-image": "^9.1.2", "ng2-pdf-viewer": "^3.0.8", "ngx-cookie-service": "^12.0.3", + "ngx-cropper": "^2.0.0-beta", "ngx-extended-pdf-viewer": "^13.0.0-alpha.2", "ngx-image-compress": "^11.0.3", "ngx-image-cropper": "^5.0.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6656a722e..57dc07330 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -103,7 +103,7 @@ import { calendarReducer } from './services/Repositorys/Agenda/agenda-memory-sou import {MatMenuModule} from '@angular/material/menu'; import {MatIconModule} from '@angular/material/icon'; - +import { AngularCropperjsModule } from 'angular-cropperjs'; // import { ServiceWorkerModule } from '@angular/service-worker'; // import { AngularFireModule } from '@angular/fire'; // import { AngularFireMessagingModule } from '@angular/fire/messaging'; @@ -191,7 +191,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ ImageCropperModule, MatMenuModule, - MatIconModule, + MatIconModule ], entryComponents: [ DiplomaOptionsPage, diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 40a3a0e5d..e029bd954 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -144,7 +144,7 @@ export class ProfilePage implements OnInit { return time; } - @XTracerAsync({name:'profile/notificationClick', bugPrint: true, module:'notification'}) + @XTracerAsync({name:'profile/notificationClick', bugPrint: true, module:'notification', autoFinish: false}) async notificatinsRoutes (index, item: NotificationTable, tracing?: TracingType) { try { @@ -152,7 +152,9 @@ export class ProfilePage implements OnInit { this.isloading = true if (item.service === "agenda") { + tracing.addEvent('start getEventById') let res = await this.agendaDataRepository.getEventById(item.idObject, tracing) + tracing.addEvent('end getEventById') if(item.idObject) { @@ -168,9 +170,9 @@ export class ProfilePage implements OnInit { this.deleteNotification(item); tracing.setAttribute('outcome', 'success') } else { - tracing.setAttribute('outcome', 'success') - tracing.setAttribute('data.exist', 'false') + tracing.setAttribute('data.exist', 'false') + tracing.setAttribute('outcome', 'success') if (isHttpError(res.error)) { if(res.error.status == 404) { @@ -202,9 +204,10 @@ export class ProfilePage implements OnInit { this.deleteNotification(item); this.isloading = false } else { - tracing.setAttribute('outcome', 'success') + console.log('evento não existe') tracing.setAttribute('data.exist', 'false') + tracing.setAttribute('outcome', 'success') this.objectRead[item.notificationId] = true this.isloading = false } @@ -223,8 +226,11 @@ export class ProfilePage implements OnInit { } else if (item.service === "gabinete-digital") { this.isloading = true + + tracing.addEvent('start getTask') this.processesService.GetTask(item.idObject).subscribe((task) => { + tracing.addEvent('end getTask') if (item.service === "gabinete-digital" && item.object === "expedientes") { this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', item.idObject, 'gabinete-digital'])); } else if (item.service === "gabinete-digital" && item.object === "despachos") { @@ -258,9 +264,29 @@ export class ProfilePage implements OnInit { this.deleteNotification(item); this.isloading = false + tracing.setAttribute('outcome', 'success') + }, (error) => { + tracing.addEvent('end getTask') + tracing.log('gabinete notification not found', { + notificationObject: item + }) + this.objectRead[item.notificationId] = true this.isloading = false + + + if(isHttpError(error)) { + tracing.setAttribute('getTask.http.status.code', error.status?.toString()) + if(error.status == 400) { + tracing.setAttribute('outcome', 'failed') + } else { + tracing.setAttribute('outcome', 'success') + } + } else { + tracing.setAttribute('outcome', 'failed') + } + }) @@ -268,10 +294,14 @@ export class ProfilePage implements OnInit { if (item.service === "accoes" && item.idObject === "accao") { this.zone.run(() => this.router.navigate(['/home/publications', item.idObject])); this.deleteNotification(item); + + tracing.setAttribute('outcome', 'success') } else if (item.service === "accoes" && item.idObject === "publicacao") { this.zone.run(() => this.router.navigate(['/home/publications/view-publications', item.folderId, item.idObject])); this.deleteNotification(item); + + tracing.setAttribute('outcome', 'success') } } else if (item.service === "chat") { @@ -285,22 +315,30 @@ export class ProfilePage implements OnInit { }, 200); + + tracing.setAttribute('outcome', 'success') this.deleteNotification(item); } else { console.log({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId}) + tracing.log('click notification no route', { + notificationObject: item + }) tracing.setAttribute('notification.route', 'false') - tracing.setAttribute('outcome', 'failed') tracing.setAttribute('parameters', JSON.stringify({Service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId})) + tracing.setAttribute('outcome', 'failed') } } catch(error) { console.log({service:item.service, Object, IdObject:item.idObject, FolderId: item.folderId}) - tracing.setAttribute('outcome', 'failed') + tracing.log('click notification catch', { + notificationObject: item + }) tracing.setAttribute('parameters', JSON.stringify({service:item.service, Object, IdObject:item.idObject, FolderId:item.folderId})) tracing.setAttribute('error', JSON.stringify(error)) + tracing.setAttribute('outcome', 'failed') } diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index ce99b0ccb..68cb8861a 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -9,7 +9,7 @@