Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,255 changes: 4,849 additions & 8,406 deletions package-lock.json

Large diffs are not rendered by default.

64 changes: 31 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"version:update": "npm version \"$(ionic config get version | tr -d \\')\" --allow-same-version && config-cordova -config=config.xml set version \"$(ionic config get version | tr -d \\')\" && echo Version: $(ionic config get version)",
"config:demo": "config-cordova -config=config.xml set id \"org.andesDev.mobile\" && cp google-services-demo.json platforms/android/app/google-services.json",
"version:update": "npm version \"$(ionic config get version | tr -d \\')\" --allow-same-version && -config=config.xml set version \"$(ionic config get version | tr -d \\')\" && echo Version: $(ionic config get version)",
"config:demo": " -config=config.xml set id \"org.andesDev.mobile\" && cp google-services-demo.json platforms/android/app/google-services.json",
"prepare:demo": "cordova-res --icon-source resources/demo/icon.png --splash-source resources/demo/splash.png --icon-foreground-source resources/demo/icon.png --icon-background-source resources/demo/icon.png",
"compile:demo:android": "ionic cordova build android --release",
"compile:demo:ios": "ionic cordova build ios --release",
Expand All @@ -21,9 +21,9 @@
"build:demo:android:aab": "npm run config:demo && npm run prepare:demo && npm run bundle:demo:android && npm run sign:demo:aab && npm run zipalign:demo:aab",
"build:demo:android:apk": "npm run config:demo && npm run prepare:demo && npm run compile:demo:android && npm run sign:demo:apk && npm run zipalign:demo:apk",
"build:demo:ios": "npm run config:demo && npm run prepare:demo && npm run compile:demo:ios",
"config:prod": "config-cordova -config=config.xml set id \"org.andesDev.mobile\" && cp google-services-prod.json platforms/android/app/google-services.json",
"config:prod": " -config=config.xml set id \"org.andesDev.mobile\" && cp google-services-prod.json platforms/android/app/google-services.json",
"prepare:prod": "cordova-res",
"config:ios": "config-cordova -config=config.xml set id \"ar.gob.andesDev.mobile\"",
"config:ios": " -config=config.xml set id \"ar.gob.andesDev.mobile\"",
"prepare:demo:ios": "ionic cordova prepare ios",
"config:prod:ios": "ionic cordova prepare ios --configuration production",
"compile:prod:android": "cp google-services-prod.json platforms/android/app/google-services.json && ionic cordova build android --configuration production --release",
Expand Down Expand Up @@ -69,29 +69,29 @@
"@angular/platform-browser-dynamic": "~12.2.17",
"@angular/router": "~12.2.17",
"@auth0/angular-jwt": "5.0.1",
"@awesome-cordova-plugins/barcode-scanner": "^6.8.0",
"@awesome-cordova-plugins/call-number": "^6.8.0",
"@awesome-cordova-plugins/camera": "^6.8.0",
"@awesome-cordova-plugins/core": "^6.8.0",
"@awesome-cordova-plugins/device": "^6.8.0",
"@awesome-cordova-plugins/diagnostic": "^6.8.0",
"@awesome-cordova-plugins/email-composer": "^6.8.0",
"@awesome-cordova-plugins/file": "^6.8.0",
"@awesome-cordova-plugins/file-chooser": "^6.8.0",
"@awesome-cordova-plugins/file-opener": "^6.8.0",
"@awesome-cordova-plugins/file-path": "^6.8.0",
"@awesome-cordova-plugins/file-transfer": "^6.8.0",
"@awesome-cordova-plugins/firebase-messaging": "^6.8.0",
"@awesome-cordova-plugins/geolocation": "^6.8.0",
"@awesome-cordova-plugins/google-plus": "^6.8.0",
"@awesome-cordova-plugins/http": "^6.8.0",
"@awesome-cordova-plugins/image-resizer": "^6.8.0",
"@awesome-cordova-plugins/in-app-browser": "^6.8.0",
"@awesome-cordova-plugins/network": "^6.8.0",
"@awesome-cordova-plugins/photo-viewer": "^6.8.0",
"@awesome-cordova-plugins/splash-screen": "^6.8.0",
"@awesome-cordova-plugins/sqlite": "^6.8.0",
"@awesome-cordova-plugins/status-bar": "^6.8.0",
"@awesome-cordova-plugins/barcode-scanner": "^8.1.0",
"@awesome-cordova-plugins/call-number": "^8.1.0",
"@awesome-cordova-plugins/camera": "^8.1.0",
"@awesome-cordova-plugins/core": "^8.1.0",
"@awesome-cordova-plugins/device": "^8.1.0",
"@awesome-cordova-plugins/diagnostic": "^8.1.0",
"@awesome-cordova-plugins/email-composer": "^8.1.0",
"@awesome-cordova-plugins/file": "^8.1.0",
"@awesome-cordova-plugins/file-chooser": "^8.1.0",
"@awesome-cordova-plugins/file-opener": "^8.1.0",
"@awesome-cordova-plugins/file-path": "^8.1.0",
"@awesome-cordova-plugins/file-transfer": "^8.1.0",
"@awesome-cordova-plugins/firebase-messaging": "^8.1.0",
"@awesome-cordova-plugins/geolocation": "^8.1.0",
"@awesome-cordova-plugins/google-plus": "^8.1.0",
"@awesome-cordova-plugins/http": "^8.1.0",
"@awesome-cordova-plugins/image-resizer": "^8.1.0",
"@awesome-cordova-plugins/in-app-browser": "^8.1.0",
"@awesome-cordova-plugins/network": "^8.1.0",
"@awesome-cordova-plugins/photo-viewer": "^8.1.0",
"@awesome-cordova-plugins/splash-screen": "^8.1.0",
"@awesome-cordova-plugins/sqlite": "^8.1.0",
"@awesome-cordova-plugins/status-bar": "^8.1.0",
"@google/maps": "^1.1.3",
"@ionic/angular": "^5.0.0",
"@ionic/storage-angular": "^3.0.6",
Expand All @@ -101,7 +101,6 @@
"cordova-browser": "6.0.0",
"cordova.plugins.diagnostic": "^6.0.3",
"moment": "^2.29.1",
"mx.ferreyra.callnumber": "0.0.2",
"ng-recaptcha": "^6.1.0",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.6.3",
Expand All @@ -128,20 +127,18 @@
"@typescript-eslint/parser": "^4.28.5",
"@typescript-eslint/utils": "^8.3.0",
"barcodescanner-ec": "^8.1.2",
"call-number": "^1.0.1",
"codelyzer": "^6.0.0",
"com-badrit-base64": "^0.2.0",
"cordova-android": "^14.0.0",
"cordova-android": "^14.0.1",
"cordova-common": "^4.0.2",
"cordova-ios": "^6.2.0",
"cordova-plugin-advanced-http": "^3.2.2",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-camera": "6.0.0",
"cordova-plugin-camera": "^8.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-email-composer": "^0.9.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener": "^1.0.0",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-firebase-analytics": "^6.0.1",
"cordova-plugin-firebase-messaging": "^6.0.0",
Expand All @@ -163,6 +160,7 @@
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"mx.ferreyra.callnumber": "^0.0.2",
"phonegap-plugin-multidex": "^1.0.0",
"properties-parser": "^0.3.1",
"protractor": "~7.0.0",
Expand Down Expand Up @@ -203,13 +201,13 @@
"cordova-plugin-email-composer": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"mx.ferreyra.callnumber": {},
"cordova-plugin-camera": {
"ANDROIDX_CORE_VERSION": "1.6.+"
},
"barcodescanner-ec": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"mx.ferreyra.callnumber": {},
"call-number": {}
},
"platforms": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ToastProvider } from 'src/providers/toast';
import { DomSanitizer } from '@angular/platform-browser';
import { HttpClient, HttpEventType, HttpHeaders, HttpRequest } from '@angular/common/http';
import { Camera, CameraOptions } from '@awesome-cordova-plugins/camera/ngx';
import { File } from '@awesome-cordova-plugins/file/ngx';
import * as moment from 'moment';

@Component({
Expand Down Expand Up @@ -38,7 +39,8 @@ export class ComprobanteProfesionalPage implements OnInit {
private profesionalProvider: ProfesionalProvider,
private camera: Camera,
public authProvider: AuthProvider,
public sanitizer: DomSanitizer
public sanitizer: DomSanitizer,
private file: File
) { }

ngOnInit() {
Expand All @@ -58,19 +60,24 @@ export class ComprobanteProfesionalPage implements OnInit {
const options: CameraOptions = {
quality: 50,
correctOrientation: true,
destinationType: this.camera.DestinationType.DATA_URL,
destinationType: this.camera.DestinationType.FILE_URI,
targetWidth: 400,
targetHeight: 600,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.CAMERA,
cameraDirection: 0
mediaType: this.camera.MediaType.PICTURE
};

this.camera.getPicture(options).then(img64 => {
this.documentoPreview = 'data:image/jpeg;base64,' + img64;
this.camera.getPicture(options).then(async img64 => {
this.documentoPreview = (window as any).Ionic.WebView.convertFileSrc(img64);

const base64 = await this.file.readAsDataURL(
img64.substring(0, img64.lastIndexOf('/') + 1),
img64.substring(img64.lastIndexOf('/') + 1)
);

const rawBase64 = base64.split(',')[1];
const contentType = 'image/jpeg';
const dataBlob = this.base64toBlob(img64);
const dataBlob = this.base64toBlob(rawBase64);

this.portFile(dataBlob, 'jpeg').subscribe(event => {
if (event.type === HttpEventType.UploadProgress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
</div>

<!-- VISTA DE CONFIRMACION FINAL DE LA FOTO -->
<ng-container *ngIf="foto && !editar && !inProgress" (click)="editarFoto()">
<ng-container *ngIf="fotoPreview && !editar && !inProgress" (click)="editarFoto()">
<ion-grid>
<ion-row>
<ion-col>
<p>Confirme si la foto es correcta. Si no es asi, puede editarla.</p>
</ion-col>
</ion-row>

<img [src]="foto" class="img-circle" id="imagen-previa" />
<img [src]="fotoPreview" class="img-circle" id="imagen-previa" />

<ion-row>
<ion-col col-6>
Expand Down
59 changes: 36 additions & 23 deletions src/app/pages/profesional/mis-matriculas/foto-profesional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ProfesionalProvider } from 'src/providers/profesional';
import { ToastProvider } from 'src/providers/toast';
import { Camera, CameraOptions } from '@awesome-cordova-plugins/camera/ngx';
import { DomSanitizer } from '@angular/platform-browser';
import { File } from '@awesome-cordova-plugins/file/ngx';

@Component({
selector: 'app-foto-profesional',
Expand All @@ -20,6 +21,7 @@ export class FotoProfesionalPage implements OnInit {
public profesional: any;
public validado = false;
public foto = null;
public fotoPreview = null; // para la vista
public editar = true;
public extension = ['jpg', 'jpeg', 'png', 'bmp'];
public files: any[] = [];
Expand All @@ -30,7 +32,8 @@ export class FotoProfesionalPage implements OnInit {
private camera: Camera,
private profesionalProvider: ProfesionalProvider,
public authProvider: AuthProvider,
public sanitizer: DomSanitizer
public sanitizer: DomSanitizer,
private file: File
) {
}

Expand All @@ -50,22 +53,47 @@ export class FotoProfesionalPage implements OnInit {
const options: CameraOptions = {
quality: 50,
correctOrientation: true,
destinationType: this.camera.DestinationType.DATA_URL,
destinationType: this.camera.DestinationType.FILE_URI,
targetWidth: 400,
targetHeight: 600,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
cameraDirection: 0
mediaType: this.camera.MediaType.PICTURE
};

this.camera.getPicture(options).then((imageData) => {
this.foto = 'data:image/jpeg;base64,' + imageData;
this.camera.getPicture(options).then(async (imagePath) => {

this.fotoPreview = (window as any).Ionic.WebView.convertFileSrc(imagePath);

const base64 = await this.file.readAsDataURL(
imagePath.substring(0, imagePath.lastIndexOf('/') + 1),
imagePath.substring(imagePath.lastIndexOf('/') + 1)
);
this.foto = base64;

this.cancelarEdicion();
}, () => {
this.toast.danger('El servicio momentaneamente no se encuentra disponible. Utilice la opción "Examinar"');
}).catch(() => {
this.toast.danger(
'El servicio momentáneamente no se encuentra disponible. Utilice la opción "Examinar"'
);
});
}

changeListener($event) {
const file = $event.target;
if (file) {
const ext = this.getExtension(file.files[0].name).toLowerCase();
if (this.extension.indexOf(ext) >= 0) {
this.getBase64(file.files[0]).then((base64File: string) => {
this.foto = base64File;
this.fotoPreview = base64File;
this.cancelarEdicion();
});
} else {
this.toast.danger('TIPO DE ARCHIVO INVALIDO');
}
}
}

confirmarFoto() {
if (this.foto) {
const strImage = this.foto.replace(/^data:image\/[a-z]+;base64,/, '');
Expand All @@ -91,21 +119,6 @@ export class FotoProfesionalPage implements OnInit {
}
}

changeListener($event) {
const file = $event.target;
if (file) {
const ext = this.getExtension(file.files[0].name).toLowerCase();
if (this.extension.indexOf(ext) >= 0) {
this.getBase64(file.files[0]).then((base64File: string) => {
this.foto = base64File;
this.cancelarEdicion();
});
} else {
this.toast.danger('TIPO DE ARCHIVO INVALIDO');
}
}
}

getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
Expand Down
38 changes: 25 additions & 13 deletions src/app/pages/profesional/rup-adjuntar/rup-adjuntar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { RupProvider } from 'src/providers/rup';
import { ToastProvider } from 'src/providers/toast';
import { ActivatedRoute, Router } from '@angular/router';
import { File } from '@awesome-cordova-plugins/file/ngx';

@Component({
selector: 'app-rup-adjuntar',
Expand All @@ -21,6 +22,7 @@ export class RupAdjuntarPage implements OnDestroy {
inProgress = false;
extension = ['png', 'bmp', 'jpg', 'jpeg', 'png', 'pdf'];
files: any[] = [];
public fotoPreview = null; // para la vista

uploading = false;

Expand All @@ -34,7 +36,8 @@ export class RupAdjuntarPage implements OnDestroy {
private camera: Camera,
private sanitizer: DomSanitizer,
private router: Router,
private route: ActivatedRoute
private route: ActivatedRoute,
private file: File
) {

this.onResumeSubscription = platform.resume.subscribe(() => {
Expand Down Expand Up @@ -66,31 +69,40 @@ export class RupAdjuntarPage implements OnDestroy {
const destinationType = this.platform.is('ios') ? 1 : 2;
// const fileName = this.platform.is('ios') ? 'rup-adjuntos' : null;
const options: CameraOptions = {
// quality: 70,
quality: 30,
correctOrientation: true,
destinationType: this.camera.DestinationType.DATA_URL,
destinationType: this.camera.DestinationType.FILE_URI,
targetWidth: 600,
targetHeight: 600,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
this.camera.getPicture(options).then((imageData) => {
item = {
loading: true
};

this.camera.getPicture(options).then(async (imagePath) => {
const item: any = { loading: true };
this.files.push(item);
return 'data:image/jpeg;base64,' + imageData;
}).then((base64File: string) => {
const img: any = this.sanitizer.bypassSecurityTrustResourceUrl(base64File);

const webviewPath = (window as any).Ionic.WebView.convertFileSrc(imagePath);
this.fotoPreview = (window as any).Ionic.WebView.convertFileSrc(imagePath);
// 🔑 Convertir FILE_URI a base64
const base64 = await this.file.readAsDataURL(
imagePath.substring(0, imagePath.lastIndexOf('/') + 1),
imagePath.substring(imagePath.lastIndexOf('/') + 1)
);

item.ext = 'jpg';
item.file = img;
item.plain64 = base64File;
item.file = webviewPath; // para mostrar
item.plain64 = base64; // 👈 para la API
item.path = imagePath;
item.loading = false;

this.files = [...this.files];
}).catch(() => {
this.toast.danger('El servicio momentaneamente no se encuentra disponible. Utilice la opción "Adjuntar"');
this.toast.danger(
'El servicio momentáneamente no se encuentra disponible. Utilice la opción "Adjuntar"'
);
});

}


Expand Down
2 changes: 1 addition & 1 deletion src/providers/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export class AuthProvider {

getDisclaimers(usuario: any) {
if (usuario.email) {
return this.network.get(`modules/gestor-usuarios/usuarios/${usuario.email}/disclaimers`);
return this.network.get(`modules/gestor-usuarios/usuarios/${usuario.documento}/disclaimers`);
}

}
Expand Down