changes and bugfixes
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="com.unam.acatan.sintomapp" version="0.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<widget id="com.unam.acatan.sintomapp" version="0.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<name>SintomApp-Acatlan</name>
|
||||
<description>An app for control an visualizatión of a pandemic data like simphtoms evolution and sumarized data in the 'FES Acatán UNAM'</description>
|
||||
<author email="aisgxvso@comunidad.unam.com" href="http://ionicframework.com/">Axel Iván Solano González</author>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">192.168.0.8</domain>
|
||||
<domain includeSubdomains="true">192.168.0.13</domain>
|
||||
<domain includeSubdomains="true">132.248.80.77</domain>
|
||||
<trust-anchors>
|
||||
<certificates src="system"/>
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
<ion-header [translucent]="true">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="login"></ion-back-button>
|
||||
<ion-back-button defaultHref="loggin"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>
|
||||
Datos Secretario
|
||||
|
||||
@@ -70,7 +70,23 @@ noCtaStudent:Number;
|
||||
}
|
||||
}
|
||||
},{
|
||||
text: 'Cancel',
|
||||
text: 'Alumno Saludable',
|
||||
icon: 'medkit-outline',
|
||||
handler: () => {
|
||||
this.noCtaStudent=stu.user.username;
|
||||
console.log("value to compare",this.noCtaStudent);
|
||||
var studentFinal = this.students.find(student => student.user.username==this.noCtaStudent);
|
||||
const request =this.auth.store.update("secretary/healthy",studentFinal.id);
|
||||
this.loader.do(request, 'Validando información');
|
||||
if(studentFinal.infected){
|
||||
var index = this.students.indexOf(studentFinal);
|
||||
studentFinal.infected=false;
|
||||
this.students[index]=studentFinal;
|
||||
this.presentToast(studentFinal.name);
|
||||
}
|
||||
}
|
||||
},{
|
||||
text: 'Cancelar',
|
||||
icon: 'close',
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
|
||||
@@ -22,7 +22,7 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/admintabs/info',
|
||||
redirectTo: '/admintabs/data',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -23,6 +23,14 @@ const routes: Routes = [
|
||||
path: 'admin',
|
||||
loadChildren: () => import('./admin-page/admin-page.module').then( m => m.AdminPagePageModule)
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
loadChildren: () => import('./tab1/tab1.module').then( m => m.Tab1PageModule)
|
||||
},
|
||||
{
|
||||
path: 'simtoms',
|
||||
loadChildren: () => import('./tab2/tab2.module').then( m => m.Tab2PageModule)
|
||||
}
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
||||
@@ -78,24 +78,24 @@ export class LogginPage implements OnInit {
|
||||
|
||||
switch (errorResponse.error.message) {
|
||||
case 'Bad credentials':
|
||||
this.errorMessage = 'El usuario o la contraseña son inválidos';
|
||||
//this.errorMessage = 'El usuario o la contraseña son inválidos';
|
||||
this.presentAlertErrores('El usuario o la contraseña son inválidos')
|
||||
break;
|
||||
default:
|
||||
this.presentAlertErrores(errorResponse.error.message)
|
||||
this.errorMessage = 'Intentelo de nuevo más tarde.';
|
||||
/*this.errorMessage = 'Intentelo de nuevo más tarde.';
|
||||
if (errorResponse.error.message) {
|
||||
this.errorMessage = this.errorMessage + ` [${errorResponse.error.message}]`;
|
||||
} else {
|
||||
this.errorMessage = this.errorMessage + ` [${errorResponse.message}]`;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
routeDirector(userRole){
|
||||
console.log(userRole.details.authorities)
|
||||
if(userRole.details.authorities[0]==="ROLE_USER"){
|
||||
this.nav.navigateForward('/tabs/user');
|
||||
this.nav.navigateForward('/user');
|
||||
} else if (userRole.details.authorities[0]==="ROLE_SECRETARY"){
|
||||
this.nav.navigateForward('/admintabs');
|
||||
} else if (userRole.details.authorities[0]==="ROLE_ADMIN"){
|
||||
@@ -105,7 +105,7 @@ export class LogginPage implements OnInit {
|
||||
|
||||
onGoToNextPage(data){
|
||||
if(data.details.authorities[0]=== "ROLE_USER"){
|
||||
this.router.navigate(['/tabs/user'],{
|
||||
this.router.navigate(['/user'],{
|
||||
queryParams: {
|
||||
value : JSON.stringify(data)
|
||||
},
|
||||
@@ -133,6 +133,9 @@ export class LogginPage implements OnInit {
|
||||
message: 'Para ingresar deberás utilizar las mismas credenciales que usas en servicios escolares.',
|
||||
buttons: ['OK']
|
||||
});
|
||||
await alert.present();
|
||||
const { role } = await alert.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
async presentAlertErrores(message) {
|
||||
const alert = await this.alertController.create({
|
||||
@@ -141,5 +144,8 @@ export class LogginPage implements OnInit {
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
});
|
||||
await alert.present();
|
||||
const { role } = await alert.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
const STORAGE_KEY = 'my_images';
|
||||
|
||||
@@ -17,7 +17,8 @@ export class PhotoPage implements OnInit {
|
||||
private file: File;
|
||||
|
||||
constructor(
|
||||
private auth:AuthService) {
|
||||
private auth:AuthService,
|
||||
public alertController: AlertController) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -30,14 +31,40 @@ export class PhotoPage implements OnInit {
|
||||
async submitForm() {
|
||||
let formData = new FormData();
|
||||
formData.append("file", this.file, this.file.name);
|
||||
|
||||
console.log("file weight:", this.file.size)
|
||||
this.auth.store.create("file", formData).subscribe((response) =>
|
||||
{if(response){
|
||||
this.presentAlert();
|
||||
console.log("exito");
|
||||
}else{
|
||||
this.presentAlertFail();
|
||||
console.log("error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async presentAlert() {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Foto enviada',
|
||||
message: 'Tu foto fue enviada, el secretario técnico podrá validar en breve, si deseas enviar otro archivo puedes hacerlo',
|
||||
buttons: ['OK']
|
||||
});
|
||||
await alert.present();
|
||||
const { role } = await alert.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
async presentAlertFail() {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Foto enviada',
|
||||
message: 'Tu foto no fue enviada, si deseas enviar otro archivo puedes hacerlo',
|
||||
buttons: ['OK']
|
||||
});
|
||||
await alert.present();
|
||||
const { role } = await alert.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="login"></ion-back-button>
|
||||
<ion-back-button defaultHref="admintabs"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>{{ data.user.name }}</ion-title>
|
||||
</ion-toolbar>
|
||||
@@ -47,6 +47,15 @@
|
||||
<ion-icon name="fitness-outline" color="secondary"></ion-icon>
|
||||
<ion-label color="ligth">Infectado: {{ data.infected }}</ion-label>
|
||||
</ion-item>
|
||||
<ion-item color="translucent">
|
||||
<ion-icon name="pulse-outline" color="secondary"></ion-icon>
|
||||
<ion-label color="ligth">Sintomas </ion-label>
|
||||
</ion-item>
|
||||
<ion-list class="list-bg">
|
||||
<ion-item color="none" *ngFor="let simptom of simpthoms">
|
||||
{{ simptom.symptoms.description}}
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<ion-list class="list-bg">
|
||||
<ion-item color="none" *ngFor="let photo of photos" >
|
||||
<ion-img [src]=photo ></ion-img>
|
||||
|
||||
@@ -11,6 +11,7 @@ export class StudentPage implements OnInit {
|
||||
data=
|
||||
{email:"", phone:"", street:"", noExt:0, noInt:0, suburb:"",cp:"", state:"",infected:false, user:{name:""}}
|
||||
photos = []
|
||||
simpthoms = []
|
||||
constructor(
|
||||
public activatedRoute : ActivatedRoute,
|
||||
private auth : AuthService) {
|
||||
@@ -20,6 +21,10 @@ export class StudentPage implements OnInit {
|
||||
console.log(all);
|
||||
this.photos = all;
|
||||
});
|
||||
this.auth.store.get(`secretary/evolution/${JSON.parse(res.value).user.name}`).subscribe( all =>{
|
||||
console.log(all);
|
||||
this.simpthoms = all;
|
||||
});
|
||||
});
|
||||
}
|
||||
ngOnInit(): void {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-header >
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="login"></ion-back-button>
|
||||
<ion-back-button defaultHref="loggin"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>
|
||||
Datos
|
||||
@@ -19,7 +19,7 @@
|
||||
<ion-item color="translucent">
|
||||
<ion-icon name="mail" color="secondary"></ion-icon>
|
||||
<ion-label>Correo: </ion-label>
|
||||
<ion-input placeholder="Correo" type="email" name="email" pattern="email" [(ngModel)]="data.email" color="ligth" required></ion-input>
|
||||
<ion-input placeholder="Correo" type="email" name="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" [(ngModel)]="data.email" color="ligth" required></ion-input>
|
||||
</ion-item>
|
||||
<ion-item color="translucent">
|
||||
<ion-icon name="call-outline" color="secondary"></ion-icon>
|
||||
@@ -59,9 +59,11 @@
|
||||
<ion-footer>
|
||||
<div class="ion-padding">
|
||||
<ion-button (click)="sendUpdate()">
|
||||
<ion-icon name="save-outline"></ion-icon>
|
||||
Guardar
|
||||
</ion-button>
|
||||
<ion-button [disabled]="ngForm.invalid" (click)="moveOn()">
|
||||
<ion-button [disabled]="!ngForm.valid" (click)="moveOn()">
|
||||
<ion-icon name="thermometer-outline"></ion-icon>
|
||||
Sintomas
|
||||
</ion-button>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@ export class Tab1Page implements OnInit{
|
||||
}
|
||||
|
||||
moveOn(){
|
||||
this.nav.navigateForward('/tabs/simptoms')
|
||||
this.nav.navigateForward('/simtoms')
|
||||
}
|
||||
|
||||
dailyNotification(){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-header [translucent]="true">
|
||||
<ion-toolbar>
|
||||
<ion-back-button slot="start" defaultHref="login"></ion-back-button>
|
||||
<ion-back-button slot="start" defaultHref="loggin"></ion-back-button>
|
||||
<ion-button slot="end" (click)="loadData()">
|
||||
<ion-icon slot="end" name="paper-plane"></ion-icon>
|
||||
Enviar
|
||||
|
||||
@@ -29,6 +29,17 @@ export class Tab2Page implements OnInit{
|
||||
})
|
||||
}
|
||||
);
|
||||
this.auth.store.get("evolution").subscribe(
|
||||
res => {
|
||||
res.forEach(element => {
|
||||
this.form.forEach(formElement => {
|
||||
if(formElement.id == element.id){
|
||||
formElement.isChecked=true;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
loadData(){
|
||||
@@ -36,14 +47,16 @@ export class Tab2Page implements OnInit{
|
||||
console.log(request);
|
||||
this.loader.do(request, 'Guardando información');
|
||||
this.presentToast();
|
||||
this.nav.navigateBack('/user');
|
||||
}
|
||||
|
||||
async presentToast() {
|
||||
const toast = await this.toast.create({
|
||||
message: 'Sintomas enviados, gracias',
|
||||
duration: 30000
|
||||
duration: 5000
|
||||
});
|
||||
toast.present();
|
||||
|
||||
}
|
||||
movePhoto(){
|
||||
this.nav.navigateForward('/photo')
|
||||
|
||||
Reference in New Issue
Block a user