diff --git a/package-lock.json b/package-lock.json index f924bc8cd..0356fc6d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10584,9 +10584,9 @@ } }, "cordova-plugin-camera": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-5.0.1.tgz", - "integrity": "sha512-9gXyZvI8u9KzsZuqmB8Yw+uheF+7f+usMAwvOMw7L7pqbykg+bm9US5zjhJbwit3A1cSblgZkpBafe5cFiMcTA==" + "version": "git+https://github.com/PieterVanPoyer/cordova-plugin-camera.git#3911ae8a5a7a21a7bef8c80acd7dc4bb65a2163a", + "from": "git+https://github.com/PieterVanPoyer/cordova-plugin-camera.git#bugfix/issue-665-save-instance-restore-bug", + "dev": true }, "cordova-plugin-compat": { "version": "1.2.0", diff --git a/package.json b/package.json index 156e8d886..8e99fe4b8 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "build": "0.1.4", "ci": "^2.1.1", "cordova": "^10.0.0", - "cordova-plugin-camera": "^5.0.1", "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-okhttp": "^2.0.0", "cordova-res": "^0.15.3", @@ -125,6 +124,7 @@ "cordova-ios": "^6.2.0", "cordova-plugin-androidx": "^3.0.0", "cordova-plugin-androidx-adapter": "^1.1.3", + "cordova-plugin-camera": "git+https://github.com/PieterVanPoyer/cordova-plugin-camera.git#bugfix/issue-665-save-instance-restore-bug", "cordova-plugin-compat": "^1.2.0", "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2", @@ -165,9 +165,6 @@ "cordova-plugin-splashscreen": {}, "cordova-plugin-ionic-keyboard": {}, "cordova-plugin-inappbrowser": {}, - "cordova-plugin-camera": { - "ANDROID_SUPPORT_V4_VERSION": "27.+" - }, "cordova-sqlite-storage": {}, "cordova-plugin-compat": {}, "cordova-plugin-mfp": {}, @@ -178,7 +175,10 @@ "cordova-plugin-mfp-jsonstore": {}, "cordova-plugin-ionic-webview": {}, "cordova-plugin-screen-orientation": {}, - "cordova-plugin-network-information": {} + "cordova-plugin-network-information": {}, + "cordova-plugin-camera": { + "ANDROID_SUPPORT_V4_VERSION": "27.+" + } }, "platforms": [ "browser", diff --git a/readme.md b/readme.md index b56034849..09df7201d 100644 --- a/readme.md +++ b/readme.md @@ -25,6 +25,19 @@ cordova plugin add cordova-plugin-mfp set NODE_OPTIONS=--max_old_space_size=10096 ``` +## BUG + +Fix cordova-plugin-camera crash + +```bash +## uninstall +npx cordova plugin remove cordova-plugin-camera +## install + +npx cordova plugin add https://github.com/PieterVanPoyer/cordova-plugin-camera/#bugfix/issue-665-save-instance-restore-bug + +``` + ## Start the development server ```bash diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index c8a37503f..8415ed43f 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -8,13 +8,12 @@ import { Event } from '../models/event.model'; import { ProcessesService } from '../services/processes.service'; import { NotificationsService } from '../services/notifications.service'; import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; -import { NavigationExtras, Router, ActivatedRoute } from '@angular/router'; -import { ToastService } from '../services/toast.service'; +import { Router, ActivatedRoute } from '@angular/router'; import { ToDayEventStorage } from '../store/to-day-event-storage.service'; import { DocumentCounterService } from 'src/app/OtherService/document-counter.service' import { PermissionService } from '../OtherService/permission.service'; import { TotalDocumentService, TotalDocumentStore } from '../store/total-document.service'; -import { NetworkService } from '../services/network.service'; +// import { NetworkService } from '../services/network.service'; // import * as Sentry from "@sentry/browser"; @@ -75,7 +74,7 @@ export class HomePage implements OnInit { private platform: Platform, private activeroute: ActivatedRoute, public documentCounterService: DocumentCounterService, - private network: NetworkService, + // private network: NetworkService, public p: PermissionService) { this.router.events.subscribe((val) => { diff --git a/src/app/models/publication.ts b/src/app/models/publication.ts index 98e726232..6e8e65a88 100644 --- a/src/app/models/publication.ts +++ b/src/app/models/publication.ts @@ -10,4 +10,5 @@ export class Publication{ OriginalFileName?: string; FileBase64?:string; FileExtension?: string; + OrganicEntityId?: number; } \ No newline at end of file diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 0820cbb7b..524a9532c 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -1,7 +1,6 @@ import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router' import { ModalController, NavParams, PopoverController } from '@ionic/angular'; -import { Status } from 'src/app/models/chat/status.model'; import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page'; import { AlertService } from 'src/app/services/alert.service'; import { AuthService } from 'src/app/services/auth.service'; diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 540433382..c8836cf9f 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -70,16 +70,16 @@ - + diff --git a/src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page.ts b/src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page.ts index 803ddd2aa..936b0f32e 100644 --- a/src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page.ts +++ b/src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page.ts @@ -1,7 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { ModalController, NavParams } from '@ionic/angular'; -import { ProcessesService } from 'src/app/services/processes.service'; +import { ModalController } from '@ionic/angular'; @Component({ selector: 'app-discart-expedient-modal', @@ -9,23 +7,22 @@ import { ProcessesService } from 'src/app/services/processes.service'; styleUrls: ['./discart-expedient-modal.page.scss'], }) export class DiscartExpedientModalPage implements OnInit { + serialNumber:string; folderId:string; action:string; + constructor( - private modalController: ModalController, - private processes:ProcessesService, - private router:Router, - ) { - } + private modalController: ModalController + ) { } - ngOnInit() { - } - close(){ + ngOnInit() {} + + close() { this.modalController.dismiss('No'); } - save(){ + save() { this.modalController.dismiss('Yes'); } diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index e0d039108..5d967d6a3 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -212,7 +212,7 @@ export class PedidoPage implements OnInit { this.goBack() } - alert(JSON.stringify(res)+' nada') + // alert(JSON.stringify(res)+' nada') })) } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 55fe93adf..0c85a3de9 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd } from '@angular/router'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { ModalController } from '@ionic/angular'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; import { NewActionPage } from './new-action/new-action.page'; diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 36d7382f5..7465e4a73 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { ModalController } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; import { PublicationFolder } from 'src/app/models/publicationfolder'; +import { PublicationPipe } from 'src/app/pipes/publication.pipe'; import { PublicationsService } from 'src/app/services/publications.service'; import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service'; import { PublicationListStorage } from 'src/app/store/publication-list.service'; @@ -33,7 +34,8 @@ export class ViewPublicationsPage implements OnInit { private modalController: ModalController, private publications: PublicationsService, private activatedRoute: ActivatedRoute, - private router: Router ) + private router: Router, + private publicationPipe: PublicationPipe ) { this.item = new PublicationFolder(); @@ -55,9 +57,10 @@ export class ViewPublicationsPage implements OnInit { } this.getPublicationDetail(); - setTimeout(() => { - this.getPublications(); - }, 3000); + setTimeout(() => { + this.getPublications(); + }, 3000); + } ngOnChanges() { @@ -101,35 +104,15 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = true; const folderId = this.folderId this.publications.GetPublications(this.folderId).subscribe(res=>{ - console.log(res); - let data = []; + this.publicationList = new Array(); + res.forEach(element => { - let itemImage = { - title: 'Title', - url: "data:image/jpg;base64," + element.FileBase64, - format: 'png' - } - let item: Publication = { - "DateIndex": element.DateIndex, - "DocumentId":element.DocumentId, - "ProcessId":element.ProcessId, - "Title":element.Title, - "Message": element.Message, - "DatePublication": element.DatePublication, - /* image:itemImage, */ - "FileBase64": "data:image/jpg;base64," + element.FileBase64, - "OriginalFileName": '', - "FileExtension": '', - } + let item: Publication = this.publicationPipe.itemList(element) this.publicationList.push(item); - data.push(item) - }); - console.log(folderId); - this.publicationListStorage.add(folderId, this.publicationList) this.showLoader = false; diff --git a/src/app/pipes/pipes.module.ts b/src/app/pipes/pipes.module.ts index 11b36ec89..6d5416e45 100644 --- a/src/app/pipes/pipes.module.ts +++ b/src/app/pipes/pipes.module.ts @@ -3,10 +3,11 @@ import { FilterPipe } from './filter.pipe'; import { SearchDocumentPipe } from './search-document.pipe'; import { CustomTaskPipe } from './custom-task.pipe'; import { EventPipe } from './event.pipe'; +import { PublicationPipe } from './publication.pipe'; @NgModule({ - declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe], + declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe], exports: [FilterPipe], imports: [] }) diff --git a/src/app/pipes/publication.pipe.spec.ts b/src/app/pipes/publication.pipe.spec.ts new file mode 100644 index 000000000..26fc30029 --- /dev/null +++ b/src/app/pipes/publication.pipe.spec.ts @@ -0,0 +1,8 @@ +import { PublicationPipe } from './publication.pipe'; + +describe('PublicationPipe', () => { + it('create an instance', () => { + const pipe = new PublicationPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/pipes/publication.pipe.ts b/src/app/pipes/publication.pipe.ts new file mode 100644 index 000000000..6a52ba4cb --- /dev/null +++ b/src/app/pipes/publication.pipe.ts @@ -0,0 +1,29 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { Publication } from 'src/app/models/publication'; + +@Pipe({ + name: 'publication' +}) +export class PublicationPipe implements PipeTransform { + + transform(value: unknown, ...args: unknown[]): unknown { + return null; + } + + itemList(element ): Publication { + return { + "DateIndex": element.DateIndex, + "DocumentId":element.DocumentId, + "ProcessId":element.ProcessId, + "Title":element.Title, + "Message": element.Message, + "DatePublication": element.DatePublication, + /* image:itemImage, */ + "FileBase64": "data:image/jpg;base64," + element.FileBase64, + "OriginalFileName": '', + "FileExtension": '', + "OrganicEntityId": element.OrganicEntityId + } + } + +} diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index f89044eaf..8ca9e4145 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -5,6 +5,7 @@ import { AuthService } from '../services/auth.service'; import { User } from '../models/user.model'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators' +import { Publication } from '../models/publication'; @Injectable({ providedIn: 'root' @@ -38,7 +39,7 @@ export class PublicationsService { return this.http.get(`${geturl}`, options); } - UpdatePresidentialAction(body:any){ + UpdatePresidentialAction(body:any) { const geturl = environment.apiURL + 'presidentialActions'; let options = { @@ -86,7 +87,7 @@ export class PublicationsService { headers: this.headers, params: params }; - return this.http.get(`${geturl}`, options) + return this.http.get(`${geturl}`, options) } GetPublicationById( publicationId:any){ diff --git a/src/app/shared/gabinete-digital/despachos/despachos.page.html b/src/app/shared/gabinete-digital/despachos/despachos.page.html index d2896f812..c161a0c78 100644 --- a/src/app/shared/gabinete-digital/despachos/despachos.page.html +++ b/src/app/shared/gabinete-digital/despachos/despachos.page.html @@ -17,7 +17,6 @@ refreshingSpinner="circles" refreshingText="A actualizar..."> - +
diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts index 1cb557183..93477dfb9 100644 --- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts @@ -80,6 +80,9 @@ export class PendentesPage implements OnInit { } async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTask) { + + console.log(SerialNumber, WorkflowName, activityInstanceName) + if(WorkflowName == 'Despacho') { this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']); } diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts index ff2211654..7e4c141b8 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -72,13 +72,7 @@ export class RequestOptionsPage implements OnInit { } close() { - if( window.innerWidth < 801) { - this.modalController.dismiss('close'); - } else { - this.modalController.dismiss('close'); - } - - // this.router.navigate(['/home/gabinete-digital/pedidos']); + this.popoverController.dismiss('close') } sendExpedienteToPending() { diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 3555473d5..93b6c5c8a 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -9,6 +9,7 @@ import { NewPublicationPage } from 'src/app/pages/publications/new-publication/n import { PublicationListStorage } from 'src/app/store/publication-list.service' import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service'; import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service'; +import { PublicationPipe } from 'src/app/pipes/publication.pipe'; @Component({ selector: 'app-view-publications', templateUrl: './view-publications.page.html', @@ -31,7 +32,6 @@ export class ViewPublicationsPage implements OnInit { @Output() goBacktoPublicationDetails = new EventEmitter(); - publicationListStorage = PublicationListStorage // publicationEventFolderStorage = PublicationEventFolderStorage @@ -41,6 +41,7 @@ export class ViewPublicationsPage implements OnInit { private loadingController: LoadingService, private modalController: ModalController, private publications: PublicationsService, + private publicationPipe: PublicationPipe ) { this.item = new PublicationFolder(); } @@ -82,38 +83,23 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) - this.item = allActions.find((e)=> e.ProcessId == this.folderId); + + setTimeout(() => { + let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) + this.item = allActions.find((e)=> e.ProcessId == this.folderId); + },100); } getPublications() { this.showLoader = true; - const folderId = this.folderId - this.publications.GetPublications(folderId).subscribe(res=> { this.publicationList = new Array(); res.forEach(element => { - let itemImage = { - title: 'Title', - url: "data:image/jpg;base64," + element.FileBase64, - format: 'png' - } - let item: Publication = { - "DateIndex": element.DateIndex, - "DocumentId":element.DocumentId, - "ProcessId":element.ProcessId, - "Title":element.Title, - "Message": element.Message, - "DatePublication": element.DatePublication, - /* image:itemImage, */ - "FileBase64": "data:image/jpg;base64," + element.FileBase64, - "OriginalFileName": '', - "FileExtension": '', - } + let item: Publication = this.publicationPipe.itemList(element) this.publicationList.push(item); });