mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Added alert messages in login page, Edited event list border color, And few updates at the agenda module.
This commit is contained in:
@@ -4,6 +4,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -21,7 +22,8 @@ export class LoginPage implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService) { }
|
||||
private toastService: ToastService,
|
||||
public alertController: AlertController) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -41,6 +43,17 @@ export class LoginPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
async presentAlert(message:string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Mensagem do sistema',
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
async Login(){
|
||||
//Go to our home in home/feed.
|
||||
if(this.validateInput()){
|
||||
@@ -50,11 +63,13 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
else
|
||||
{
|
||||
this.toastService.presentToast('Não foi possível fazer login"');
|
||||
/* this.toastService.presentToast('Não foi possível fazer login"'); */
|
||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.toastService.presentToast('Preencha todos campos');
|
||||
/* this.toastService.presentToast('Preencha todos campos'); */
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user