to many changes

This commit is contained in:
Eudes Inácio
2023-02-27 17:39:10 +01:00
parent fcd1989334
commit 46387d4977
30 changed files with 329 additions and 160 deletions
@@ -104,7 +104,7 @@ export class ApproveEventPage implements OnInit {
async rejectTask(serialNumber:string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
let body = { "serialNumber": serialNumber, "action": "Descartar" }
const loader = this.toastService.loading()
@@ -14,6 +14,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-opts-expediente-pr',
@@ -50,6 +51,7 @@ export class OptsExpedientePrPage implements OnInit {
private RouteService: RouteService,
public ThemeService: ThemeService,
public p: PermissionService,
private httpErrorHandle: HttpErrorHandle
) {
@@ -141,14 +143,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Aprovar exp')
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -183,15 +180,10 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
this.toastService._successMessage('Processo descartado');
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -207,15 +199,10 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
// this.toastService.successMessage('Processo descartado');
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado');
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -227,15 +214,10 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
this.toastService._successMessage();
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest();
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -261,14 +243,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.close();
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Rever')
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHandle.httpsSucessMessagge(error)
} finally {
loader.remove()
}
@@ -280,14 +257,10 @@ export class OptsExpedientePrPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
loader.remove()
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
this.close();
}, (error) => {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.httpErrorHandle.httpStatusHandle(error)
loader.remove()
});
}
@@ -325,11 +298,7 @@ export class OptsExpedientePrPage implements OnInit {
// this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado');
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -18,6 +18,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { RouteService } from 'src/app/services/route.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-opts-expediente',
@@ -48,7 +49,8 @@ export class OptsExpedientePage implements OnInit {
private attachmentsService: AttachmentsService,
private RouteService: RouteService,
private expedienteService: ExpedienteService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHanlde: HttpErrorHandle
) {
}
@@ -171,12 +173,7 @@ export class OptsExpedientePage implements OnInit {
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
this.toastService._successMessage()
}, (error) => {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHanlde.httpStatusHandle(error)
},()=> {
loader.remove()
});
@@ -12,6 +12,7 @@ import { PedidoService } from 'src/app/Rules/pedido.service';
import { PermissionService } from 'src/app/services/permission.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -37,6 +38,7 @@ export class RequestOptionsPage implements OnInit {
private toastService: ToastService,
public p: PermissionService,
private pedidoService: PedidoService,
private httpErrorHandle: HttpErrorHandle
) {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -88,13 +90,13 @@ export class RequestOptionsPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
this.close();
loader.remove()
}, ()=> {
}, (error)=> {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
this.httpErrorHandle.httpStatusHandle(error)
});
}
@@ -195,14 +197,9 @@ export class RequestOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Solicitar Reapreciação')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHandle.httpStatusHandle(error);
}
finally {
loader.remove()
@@ -270,14 +267,9 @@ export class RequestOptionsPage implements OnInit {
note
}).toPromise()
this.toastService._successMessage('Processo arquivado')
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não arquivado')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -115,7 +115,7 @@
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Enviar</ion-label>
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -22,7 +22,7 @@
<div class="content-container">
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Description" placeholder="Assunto" ></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Description" placeholder="Assunto*" ></ion-input>
</div>
<div class="container-div">
@@ -95,7 +95,7 @@
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Enviar</ion-label>
<ion-label>Criar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -7,6 +7,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-publication-detail-shared',
@@ -30,6 +31,7 @@ export class PublicationDetailPage implements OnInit {
private toastService: ToastService,
public ThemeService: ThemeService,
public p:PermissionService,
private httpErrorHandle: HttpErrorHandle
) {
/* this.folderId = this.navParams.get('folderIdId'); */
@@ -89,14 +91,10 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService._successMessage("Publicação eliminado")
this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação')
this.goBackToViewPublications.emit();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Publicação não eliminado")
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
laoder.remove()
}
@@ -11,6 +11,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page';
import { Storage } from '@ionic/storage';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-view-publications',
@@ -44,6 +45,7 @@ export class ViewPublicationsPage implements OnInit {
private toastService: ToastService,
private storage: Storage,
public p:PermissionService,
private httpErrorHandle: HttpErrorHandle
) {
this.item = new PublicationFolder();
}
@@ -220,14 +222,9 @@ export class ViewPublicationsPage implements OnInit {
const loader = this.toastService.loading();
try {
await this.publications.DeletePresidentialAction(folderId).toPromise();
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Eliminar Acção')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()