lot of changes

This commit is contained in:
Eudes Inácio
2023-10-19 16:51:12 +01:00
parent ff52c56cde
commit 57f51903bc
51 changed files with 43514 additions and 1079 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ export class AuthService {
}
} catch (error) {
this.errorHandler.handleError(error);
this.httpErroHandle.httpStatusHandle(error)
this.httpErroHandle.loginHttpStatusHandle(error)
captureException(error);
} finally {
return response
@@ -78,16 +78,17 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="d-flex">
<ion-buttons class="flex-grow-1" slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
<ion-icon name="close" slot="start"></ion-icon>
</button>
</ion-buttons>
<ion-buttons class="flex-grow-1" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
<ion-icon name="checkmark" slot="start"></ion-icon>
</button>
</ion-buttons>
<ion-buttons class="flex-grow-1" slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
<ion-icon name="close" slot="start"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
@@ -5,6 +5,7 @@ import { ContactsService } from 'src/app/services/contacts.service';
import { ThemeService } from 'src/app/services/theme.service'
import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-attendees',
@@ -25,22 +26,27 @@ export class AttendeesPageModal implements OnInit {
taskParticipantsCc:EventPerson[] = [];
loggeduser: LoginUserRespose;
@Input() loggedAttendSon: boolean;
taskType: any;
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService,
private navParams: NavParams,
private modalController: ModalController,
public ThemeService: ThemeService) {
public ThemeService: ThemeService,
private router: Router,) {
this.adding = this.navParams.get('adding');
this.taskParticipants = this.navParams.get('taskParticipants');
this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');
this.taskType = this.navParams.get('taskType');
this.loggeduser = SessionStore.user;
}
ngOnInit() {
console.log('Pesquisa de contactos current path2',this.router.url)
this.fetchContacts("");
if(this.taskParticipants == null || this.taskParticipants == undefined){
@@ -13,6 +13,44 @@ export class HttpErrorHandle {
) { }
async httpStatusHandle(error) {
switch (error.status
) {
case 0:
const result = await this.backgroundService.offline()
if(result) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
}
break;
case 400:
this.toastService._badRequest('Lamentamos, mas houve um problema com sua solicitação. Por favor, tente novamente')
break;
case 401:
this.toastService._badRequest('Lamento, parece que não tem acesso a essas informações. Entre em contacto com o administrador.');
break;
case 403:
this.toastService._badRequest('Lamentamos, você não tem permissão para acessar este serviço.')
break;
case 404:
this.toastService._badRequest('Lamentamos, não encontramos o que procura.')
break;
case 500:
this.toastService._badRequest('Lamentamos, mas houve um erro interno do servidor. Por favor, tente novamente mais tarde.')
break;
case 502:
this.toastService._badRequest('Lamentamos, houve um problema com o servidor. Por favor, tente novamente mais tarde.')
break;
case 503:
this.toastService._badRequest('Lamentamos, o serviço está indisponível no momento. Por favor, tente novamente mais tarde.')
break
default:
break;
}
}
async loginHttpStatusHandle(error) {
switch (error.status
) {
case 0:
@@ -50,6 +88,18 @@ export class HttpErrorHandle {
}
}
validationMessagge(service: string, callback?: any) {
switch (service) {
case 'diplomaAsDraft':
this.toastService._badRequest('Este diploma não contem um draft para ser assinado!')
break;
default:
this.toastService._badRequest('')
break;
}
}
httpsSucessMessagge(service: string, callback?: any) {
switch (service) {
case 'new event':
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Platform } from '@ionic/angular';
import { CapacitorConfig } from '@capacitor/cli';
import { LocalNotifications, LocalNotificationSchema } from '@capacitor/local-notifications';
/* import { LocalNotifications, LocalNotificationSchema } from '@capacitor/local-notifications'; */
@Injectable({
+6 -4
View File
@@ -42,7 +42,7 @@ export class SearchService {
}
basicSearch(subject:string, date:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
basicSearch(subject:string, date:string = null, dateend:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
// Endpoint
const geturl = environment.apiURL + 'search';
// store params
@@ -51,7 +51,8 @@ export class SearchService {
params = params.set("assunto", subject);
params = params.set("data", date);
params = params.set("StartDate", date);
params = params.set("EndDate", dateend);
params = params.set("remetente", sender);
params = params.set("entidadeOrganica", organicEntity);
params = params.set("docTypeId", docTypeId);
@@ -67,7 +68,7 @@ export class SearchService {
}
basicSearchPublication(subject:string, date:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
basicSearchPublication(subject:string, date:string = null, dateEnd:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
// Endpoint
const geturl = environment.apiURL + 'search';
// store params
@@ -76,7 +77,8 @@ export class SearchService {
params = params.set("assunto", subject);
params = params.set("data", date);
params = params.set("StartDate", date);
params = params.set("EndDate", dateEnd);
params = params.set("remetente", sender);
params = params.set("entidadeOrganica", organicEntity);
params = params.set("docTypeId", docTypeId);