All changes i made

This commit is contained in:
Eudes Inácio
2023-02-27 09:34:36 +01:00
77 changed files with 8025 additions and 6717 deletions
@@ -21,6 +21,7 @@ import { PedidoService } from 'src/app/Rules/pedido.service'
import { fullTask } from 'src/app/models/dailyworktask.model';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -98,6 +99,7 @@ export class CreateProcessPage implements OnInit {
private despachoService: DespachoService,
private pedidoService: PedidoService,
public ThemeService: ThemeService,
private httpsErrorHanlde: HttpErrorHandle
) {
this.loggeduser = SessionStore.user;
this.task = this.navParams.get('task');
@@ -297,14 +299,9 @@ export class CreateProcessPage implements OnInit {
await this.despachoService.EfectuarDespacho({note: this.dispatchFolder.Message, serialnumber: this.task.serialNumber, activityInstanceName: this.task.activityInstanceName}).toPromise();
this.modalController.dismiss();
this.toastService._successMessage('Despacho criado');
this.httpsErrorHanlde.httpsSucessMessagge('Efetuar Despacho')
} 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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove()
@@ -333,15 +330,10 @@ export class CreateProcessPage implements OnInit {
}
this.modalController.dismiss();
this.toastService._successMessage('Pedido de Parecer enviado');
this.httpsErrorHanlde.httpsSucessMessagge('Solicitar Parecer')
}
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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -363,15 +355,10 @@ export class CreateProcessPage implements OnInit {
await this.pedidoService.taskCompleteDeferimento({note: this.postData.DispatchFolder.Message,serialNumber:this.task.serialNumber}).toPromise();
this.modalController.dismiss();
this.toastService._successMessage('Pedido de Deferimento criado');
this.httpsErrorHanlde.httpsSucessMessagge('Pedido de Deferimento')
}
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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -397,14 +384,9 @@ export class CreateProcessPage implements OnInit {
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber, note: this.dispatchFolder.Message}).toPromise();
this.modalController.dismiss();
this.toastService._successMessage('Despacho criado');
this.httpsErrorHanlde.httpsSucessMessagge('Efetuar Despacho')
} 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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove();
}
@@ -437,15 +419,10 @@ export class CreateProcessPage implements OnInit {
}
this.modalController.dismiss();
this.toastService._successMessage('Pedido de Parecer criado');
this.httpsErrorHanlde.httpsSucessMessagge('Solicitar Parecer')
}
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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -467,15 +444,10 @@ export class CreateProcessPage implements OnInit {
await this.pedidoService.taskCompleteDeferimento({note: this.postData.DispatchFolder.Message, serialNumber:this.task.serialNumber}).toPromise();
this.modalController.dismiss();
this.toastService._successMessage('Pedido de Deferimento criado');
this.httpsErrorHanlde.httpsSucessMessagge('Pedido de Deferimento')
}
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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -528,14 +500,9 @@ export class CreateProcessPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage(message);
this.httpsErrorHanlde.httpsSucessMessagge('Efetuar Despacho')
} 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 efectuado');
}
this.httpsErrorHanlde.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -4,7 +4,8 @@ import { SearchList } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { ThemeService } from 'src/app/services/theme.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-dar-parecer',
@@ -23,7 +24,8 @@ export class DarParecerPage implements OnInit {
private navParams: NavParams,
private animationController: AnimationController,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHanlde: HttpErrorHandle
) {
this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('ProcessInstanceID');
@@ -66,13 +68,9 @@ export class DarParecerPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.modalController.dismiss('sucess');
this.toastService._successMessage('Parecer enviado');
this.httpErroHanlde.httpsSucessMessagge('Dar o meu Parecer')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Parecer não solicitado");
}
this.httpErroHanlde.httpStatusHandle(error)
} finally {
loader.remove()
}
+5 -7
View File
@@ -13,6 +13,7 @@ import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.pag
import { SearchList } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -52,7 +53,8 @@ export class DelegarPage implements OnInit {
public alertController: AlertController,
private animationController: AnimationController,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
this.task = this.navParams.get('task');
this.postData = new Event();
@@ -103,15 +105,11 @@ export class DelegarPage implements OnInit {
const loader = this.toastService.loading()
this.processes.DelegateTask(body).subscribe(res=>{
this.toastService._successMessage('Processo delegado')
this.httpErrorHandle.httpsSucessMessagge('Delegar')
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 delegado")
}
this.httpErrorHandle.httpStatusHandle(error)
},
()=>{
loader.remove()
@@ -35,7 +35,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postData.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postData.Location"></ion-input>
</div>
</div>
</div>
+5 -8
View File
@@ -16,6 +16,7 @@ import { SearchList } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -55,7 +56,8 @@ export class ForwardPage implements OnInit {
private alertService: AlertService,
private animationController: AnimationController,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
) {
this.task = this.navParams.get('task');
this.postData = new Event();
@@ -147,16 +149,11 @@ export class ForwardPage implements OnInit {
"AttachmentList" :docs,
}
this.processes.CompleteParecerPrTask(body).subscribe(res=>{
this.toastService._successMessage('Processo Reencaminhado');
this.httpErroHandle.httpsSucessMessagge('Reencaminhar')
this.goBack();
},
(error)=>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest("Processo não delegado")
}
this.httpErroHandle.httpStatusHandle(error)
});
}
}
@@ -38,7 +38,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
</div>
</div>
</div>
@@ -350,6 +350,6 @@
<ion-footer class="background-whit">
<div class="buttons">
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Enviar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Gravar</button>
</div>
</ion-footer>
@@ -15,6 +15,7 @@ import { ThemeService } from 'src/app/services/theme.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -90,7 +91,8 @@ export class EditEventPage implements OnInit {
private attachmentsService: AttachmentsService,
private toastService: ToastService,
private router: Router,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
/* this.postEvent = new Event(); */
@@ -343,15 +345,10 @@ export class EditEventPage implements OnInit {
}
this.toastService._successMessage();
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
}, 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)
});
} else {
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
@@ -371,15 +368,10 @@ export class EditEventPage implements OnInit {
}
this.toastService._successMessage();
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
}, 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)
});
}
@@ -6,6 +6,7 @@ import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edi
import { EmendMessageModalPage } from '../emend-message-modal/emend-message-modal.page';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -25,6 +26,7 @@ export class EventActionsPopoverPage implements OnInit {
private popoverController: PopoverController,
private toastService: ToastService,
private RouteService: RouteService,
private httpErrorHandle: HttpErrorHandle,
public ThemeService: ThemeService) {
this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('InstanceId');
@@ -57,15 +59,10 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService._successMessage('Evento aprovar')
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovar')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -81,15 +78,10 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService._successMessage('Evento enviado para revisão');
this.httpErrorHandle.httpsSucessMessagge('Rever')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -128,15 +120,10 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage('Evento enviado para revisão');
this.httpErrorHandle.httpsSucessMessagge('Rever')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
this.httpErrorHandle.httpStatusHandle(error)
this.toastService.badRequest();
}
finally {
@@ -159,15 +146,10 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage('Evento rejeitado')
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove();
@@ -54,7 +54,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
</div>
</div>
</div>
@@ -329,7 +329,7 @@
<ion-title></ion-title>
<ion-buttons slot="end">
<button class="btn-ok cursor-pointer" fill="clear" color="#fff" (click)="save()">
<ion-label>Enviar</ion-label>
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -18,6 +18,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SessionStore } from 'src/app/store/session.service';
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -97,6 +98,7 @@ export class NewEventPage implements OnInit {
public ThemeService: ThemeService,
private platform: Platform,
private chatMethodService: ChatMethodsService,
private hhtpErrorHandle: HttpErrorHandle
) {
this.loggeduser = SessionStore.user;
this.postEvent = new Event();
@@ -440,17 +442,12 @@ export class NewEventPage implements OnInit {
this.chatMethodService.sendMessage(this.roomId, data1);
}
this.toastService._successMessage()
this.hhtpErrorHandle.httpsSucessMessagge('new event');
let data = Object.assign(this.postEvent,{id:eventId})
this.modalController.dismiss(data);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.hhtpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -19,6 +19,7 @@ import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import { SessionStore } from 'src/app/store/session.service';
import { CalendarService } from 'src/app/store/calendar.service';
import { HttpErrorHandle} from 'src/app/services/http-error-handle.service'
@Component({
@@ -72,6 +73,7 @@ export class ViewEventPage implements OnInit {
private RouteService: RouteService,
private ionicStorage: Storage,
private CalendarService: CalendarService,
private httpErrorHandle: HttpErrorHandle
) {
@@ -199,7 +201,7 @@ export class ViewEventPage implements OnInit {
if (error.status === 0) {
this.getFromDb();
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
this.httpErrorHandle.httpStatusHandle(error)
loader.remove()
this.modalController.dismiss('Eevent not Foud');
this.RouteService.goBack();
@@ -277,7 +279,7 @@ export class ViewEventPage implements OnInit {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService._successMessage('Evento apagado');
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, () => { },
() => {
loader.remove();
@@ -188,9 +188,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
let containerHeight = windowHeight - e.srcElement.clientHeight;
if (scroll > this.currentPosition) {
//alert('BOTTOM');
} else {
//alert('UP');
this.scrollingOnce = false;
}
if ((containerHeight - 100) > scroll) {
+1 -4
View File
@@ -362,9 +362,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
let containerHeight = windowHeight - e.srcElement.clientHeight;
if (scroll > this.currentPosition) {
//alert('BOTTOM');
} else {
//alert('UP');
this.scrollingOnce = false;
}
if ((containerHeight - 100) > scroll) {
@@ -647,7 +645,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async takePicture() {
// alert("!");
const roomId = this.roomId
@@ -656,7 +653,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const lastphoto: any = await this.fileService.loadFiles();
const { capturedImage, capturedImageTitle } = await this.fileService.loadFileData(lastphoto);
// alert('!!');
const base64 = await fetch(capturedImage);
const blob = await base64.blob();
const formData = new FormData();
@@ -13,6 +13,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { AttachmentsPage } from '../attachments/attachments.page';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -45,11 +46,13 @@ export class EventDetailPage implements OnInit {
private alertService: AlertService,
private attachamentsService: AttachmentsService,
private route: Router,
private iab: InAppBrowser) {
private iab: InAppBrowser,
private httpErrorHandle: HttpErrorHandle) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
ngOnInit() {
this.loadEvent();
this.loadAttachments();
@@ -81,6 +84,8 @@ export class EventDetailPage implements OnInit {
);
this.eventsService.getEvent(eventid).subscribe(response => {
this.loadedEvent = response;
},(error) => {
this.httpErrorHandle.httpStatusHandle(error)
});
}
@@ -25,6 +25,7 @@ import { BackgroundService } from 'src/app/services/background.service';
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 { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-despacho-pr',
@@ -66,6 +67,7 @@ export class DespachoPrPage implements OnInit {
public ThemeService: ThemeService,
private RouteService: RouteService,
public p: PermissionService,
private httpErroHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
@@ -157,7 +159,7 @@ export class DespachoPrPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
this.httpErroHandle.httpStatusHandle(error)
}
});
@@ -272,14 +274,9 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Executado')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -302,14 +299,9 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('Processo arquivado')
this.httpErroHandle.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.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -329,14 +321,9 @@ export class DespachoPrPage implements OnInit {
documents
}).toPromise()
this.toastService._successMessage('Processo criado')
this.httpErroHandle.httpsSucessMessagge('Gerar Diploma')
} 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 criado')
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -359,14 +346,9 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('')
this.httpErroHandle.httpsSucessMessagge('Concluir')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -389,14 +371,9 @@ export class DespachoPrPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Reexecução')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -412,17 +389,12 @@ export class DespachoPrPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
this.popoverController.dismiss('close')
this.toastService._successMessage('Processo enviado para pendentes')
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
this.goBack()
loader.remove()
}, (error) => {
loader.remove()
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.httpErroHandle.httpStatusHandle(error)
});
}
@@ -127,7 +127,7 @@
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' "> <div>Responder ao PR</div> </div>
<button (click)="tstemethod(executadoText)" class="btn-cancel" shape="round" >Executado</button>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' ">Reencaminhar para Área Jurídica</div>
<button (click)="openAddNoteModal('Gerar Diploma')" *ngIf="task.WorkflowName == 'Despacho do Presidente da República'" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' " >Outras opções</div>
@@ -140,7 +140,7 @@
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
<button (click)="tstemethod('Executado')" class="btn-cancel" shape="round" >Executado</button>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
@@ -23,6 +23,7 @@ import { Platform } from '@ionic/angular';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -66,6 +67,7 @@ export class DespachoPage implements OnInit {
private platform: Platform,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
@@ -154,7 +156,7 @@ export class DespachoPage implements OnInit {
} catch (e) {
this.RouteService.goBack();
}
this.toastService.badRequest('Processo não encontrado')
this.httpErrorHandle.httpStatusHandle(error)
}
});
}
@@ -279,15 +281,10 @@ export class DespachoPage implements OnInit {
try {
await this.despachoService.executado(note, documents, this.serialnumber).toPromise();
this.toastService._successMessage('Processo criado')
this.httpErrorHandle.httpsSucessMessagge('Executado')
this.close();
} 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 criado")
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -300,15 +297,10 @@ export class DespachoPage implements OnInit {
try {
await this.despachoService.arquivar(note, documents, this.serialnumber).toPromise()
this.toastService._successMessage('Processo descartado')
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
this.close();
} 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()
@@ -331,16 +323,11 @@ export class DespachoPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Reexecução')
this.close();
} 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()
@@ -363,15 +350,10 @@ export class DespachoPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Gerar Diploma')
this.close();
} 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()
}
@@ -388,17 +370,17 @@ export class DespachoPage implements OnInit {
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
this.goBack();
loader.remove()
this.toastService.successMessage()
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
},
error => {
loader.remove()
this.toastService.badRequest("Processo não enviado para despacho")
this.httpErrorHandle.httpStatusHandle(error)
});
// loader.remove()
}
tstemethod(value: string) {
alert(value)
}
async openAddNoteModal(actionName: string) {
@@ -9,6 +9,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import {HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-diploma-assinar',
@@ -36,7 +37,8 @@ export class DiplomaAssinarPage implements OnInit {
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -110,21 +112,12 @@ export class DiplomaAssinarPage implements OnInit {
}, (error)=>{
try {
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.httpErroHandle.httpStatusHandle(error)
this.goBack()
} catch (e) {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.httpErroHandle.httpStatusHandle(error)
}
});
@@ -177,16 +170,11 @@ export class DiplomaAssinarPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage(false, ()=>{
this.httpErroHandle.httpsSucessMessagge('Assinado',() => {
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.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -13,6 +13,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { DiplomasGerarOptionsPage } from 'src/app/shared/popover/diplomas-gerar-options/diplomas-gerar-options.page';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
@Component({
selector: 'app-diplomas-gerar',
@@ -43,7 +44,8 @@ export class DiplomasGerarPage implements OnInit {
private RouteService: RouteService,
public ThemeService: ThemeService,
private despachoService: DespachoService,
) {
private httpErroHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
@@ -118,16 +120,12 @@ export class DiplomasGerarPage implements OnInit {
}, (error)=>{
try {
this.toastService._badRequest('Processo não encontrado')
this.httpErroHandle.httpStatusHandle(error)
this.goBack()
} catch (e) {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.httpErroHandle.httpStatusHandle(error)
}
});
@@ -250,15 +248,10 @@ export class DiplomasGerarPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.modalController.dismiss('sucess');
this.toastService._successMessage();
this.httpErroHandle.httpsSucessMessagge('Gerar Diploma')
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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -79,6 +79,8 @@
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
<button (click)="tempMethod('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="tempMethod('Despacho')" class="btn-cancel" shape="round" >Efectuar Despacho</button>
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
@@ -15,6 +15,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -50,7 +51,8 @@ export class DiplomaPage implements OnInit {
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private platform: Platform,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
//
@@ -162,12 +164,7 @@ export class DiplomaPage implements OnInit {
} catch (e) {
window.history.back();
}
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)
}
});
@@ -286,17 +283,12 @@ export class DiplomaPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage(false, () => {
this.httpErrorHandle.httpsSucessMessagge('Solicitar Assinatura',() => {
this.close();
})
} 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()
@@ -317,14 +309,9 @@ export class DiplomaPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Solicitar alteraçã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()
@@ -348,14 +335,9 @@ export class DiplomaPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
this.httpErrorHandle.httpsSucessMessagge('Concluir')
} 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()
@@ -441,5 +423,9 @@ export class DiplomaPage implements OnInit {
this.modalController.dismiss();
}
tempMethod(actionname) {
console.log(actionname)
}
}
@@ -17,6 +17,7 @@ import { OfflineManagerService } from 'src/app/services/offline-manager.service'
import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import config from 'capacitor.config';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-approve-event',
@@ -58,7 +59,8 @@ export class ApproveEventPage implements OnInit {
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private offlineManager: OfflineManagerService,
private storage: Storage
private storage: Storage,
private httpErrorHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
//
@@ -216,7 +218,11 @@ export class ApproveEventPage implements OnInit {
}
}, (error) => {
this.getProcessFromDB();
if(error.status == 0) {
this.getProcessFromDB();
} else {
this.httpErrorHandle.httpStatusHandle(error)
}
})
}
@@ -229,15 +235,10 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.goBack();
this.toastService._successMessage('Evento aprovado')
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -280,15 +281,10 @@ export class ApproveEventPage implements OnInit {
this.offlineManager.storeRequestData('event-listRever', body);
});
this.toastService._successMessage('Evento enviado para revisão');
this.httpErrorHandle.httpsSucessMessagge('Rever')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -308,15 +304,10 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise();
await this.toastService._successMessage('Processo rejeitado');
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -19,7 +19,7 @@
<!-- <ion-segment-button value="MDGPR">
Minha agenda
</ion-segment-button> -->
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : 'PR'">
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId">
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
@@ -40,14 +40,14 @@
<div class="main-content d-flex height-100" >
<div class="content height-100 d-flex flex-column">
<div [ngSwitch]="segment">
<ion-list class="width-100 height-100" *ngSwitchCase="'MDGPR'">
<div *ngIf="eventoaprovacaostore.listmd" class="overflow-y-auto height-100">
<div >
<ion-list class="width-100 height-100" >
<div class="overflow-y-auto height-100">
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
*ngFor="let event of eventoaprovacaostore.listmd" (click)="goToEventToApproveDetail(event.serialNumber)">
*ngFor="let event of eventoaprovacaostore.get(segment)" (click)="goToEventToApproveDetail(event.serialNumber)">
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="content-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
@@ -65,51 +65,19 @@
</ion-item-sliding>
</div>
</ion-list>
<ion-label></ion-label>
<ion-list *ngSwitchCase="'PR'">
<div *ngIf="eventoaprovacaostore.listpr" class="overflow-y-auto height-100">
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
*ngFor="let event of eventoaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)">
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
<div *ngIf="event.activityInstanceName">
<div class="label-event-type"> {{ event.activityInstanceName }} </div>
</div>
</div>
</div>
</ion-item>
</ion-item-sliding>
</div>
</ion-list>
</div>
<div class="height-100" [ngSwitch]="segment">
<div *ngSwitchCase="'MDGPR'" class="d-flex height-100 align-center justify-content-center" >
<div class="height-100" >
<div class="d-flex height-100 align-center justify-content-center" >
<div
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
*ngIf="!skeletonLoader && (eventoaprovacaostore.get(segment).length == 0)"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
</div>
<div *ngSwitchCase="'PR'" class="d-flex height-100 align-center justify-content-center">
<div
*ngIf="!skeletonLoader && (!eventoaprovacaostore.listmd || eventoaprovacaostore.listmd.length == 0)"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
</div>
</div>
</div>
@@ -16,6 +16,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import { EventsService } from 'src/app/services/events.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-event-list',
@@ -36,8 +37,9 @@ export class EventListPage implements OnInit {
serialnumber: string;
skeletonLoader = true
eventaprovacaostore = EventoAprovacaoStore;
eventoaprovacaostore = EventoAprovacaoStore;
eventsList: any = []
color: 'pr' | 'mdgpr'
constructor(
private processes: ProcessesService,
@@ -56,7 +58,13 @@ export class EventListPage implements OnInit {
ngOnInit() {
this.segment = 'MDGPR';
if(!this.segment) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.segment = 'Meu calendario';
} else {
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
}
}
const location = window.location
const pathname = location.pathname + location.search
@@ -150,47 +158,53 @@ export class EventListPage implements OnInit {
}
async LoadToApproveEvents() {
// this.processes.GetTasksList('Agenda Oficial MDGPR', false).subscribe(async res => {
this.showLoader = true;
this.skeletonLoader = true
this.showLoader = true;
this.skeletonLoader = true
const segment = this.segment
if(this.segment == 'Meu calendario') {
// color
if(SessionStore.user.Profile == 'PR') {
this.color = 'pr'
} else {
this.color = 'mdgpr'
}
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
try {
this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
this.eventsList = [];
}
this.eventoaprovacaostore.save(segment, this.eventsList)
if (this.segment != 'PR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial
} else {
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
this.eventoaprovacaostore.resetmd(this.eventsMDGPRList);
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
})
}
else if (this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
this.color = 'pr'
this.eventsPRList = prEventsOficial
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
this.eventoaprovacaostore.resetpr(this.eventsPRList);
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
})
let allEvents = await this.processes.eventsToApprove(segment).toPromise()
try {
this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
this.eventsList = []
}
this.eventsList = this.eventsList
this.eventsList = this.eventsList
this.showLoader = false;
this.skeletonLoader = false
this.eventoaprovacaostore.save(segment, this.eventsList)
}
this.showLoader = false;
this.skeletonLoader = false
// }, (error) => {
// this.getEventToAproveFromDB();
// })
}
toDateString(e) {
return new Date(e).toDateString()
}
async openApproveModal(eventSerialNumber, event) {
const modal = await this.modalController.create({
@@ -61,7 +61,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postData.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postData.Location"></ion-input>
</div>
</div>
</div>
@@ -314,7 +314,7 @@
<ion-footer>
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Enviar</button>
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
</div>
</ion-footer>
@@ -20,6 +20,7 @@ import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-pick
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { RoleIdService } from 'src/app/services/role-id.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const moment = _rollupMoment || _moment;
@@ -120,7 +121,8 @@ export class BookMeetingModalPage implements OnInit {
private toastService: ToastService,
public ThemeService: ThemeService,
public eventService: EventsService,
public RoleIdService: RoleIdService
public RoleIdService: RoleIdService,
private httpErroHandle: HttpErrorHandle
) {
@@ -304,15 +306,10 @@ export class BookMeetingModalPage implements OnInit {
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
this.modalController.dismiss();
this.toastService._successMessage('Reunião criada');
this.httpErroHandle.httpsSucessMessagge('Marcar Reunião')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Reunião não criada')
}
this.httpErroHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -329,14 +326,10 @@ export class BookMeetingModalPage implements OnInit {
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
this.close();
this.toastService._successMessage('Reunião criada');
this.httpErroHandle.httpsSucessMessagge('Marcar Reunião')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -24,6 +24,7 @@ import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -111,6 +112,7 @@ export class ExpedientTaskModalPage implements OnInit {
private despachoService: DespachoService,
public ThemeService: ThemeService,
public p: PermissionService,
private httpErroHandle: HttpErrorHandle,
) {
this.loggeduser = SessionStore.user;
@@ -325,16 +327,11 @@ export class ExpedientTaskModalPage implements OnInit {
try {
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
await this.toastService._successMessage('Processo efetuado');
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
this.modalController.dismiss(action_despacho);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -364,16 +361,12 @@ export class ExpedientTaskModalPage implements OnInit {
try {
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
await this.toastService._successMessage('Pedido enviado');
await this.httpErroHandle.httpsSucessMessagge('Solicitar Parecer')
this.modalController.dismiss(action_parecer);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -401,15 +394,10 @@ export class ExpedientTaskModalPage implements OnInit {
try {
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
this.toastService._successMessage('Processo efetuado');
this.httpErroHandle.httpsSucessMessagge('Pedido de Deferimento')
this.modalController.dismiss(action_deferimento);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -444,15 +432,10 @@ export class ExpedientTaskModalPage implements OnInit {
if(this.postData.DispatchFolder.Message){
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService._successMessage('Processo efetuado');
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
//loader.remove()
}
@@ -486,15 +469,10 @@ export class ExpedientTaskModalPage implements OnInit {
try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService._successMessage('Pedido enviado');
await this.httpErroHandle.httpsSucessMessagge('Solicitar Parecer')
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -35,6 +35,7 @@ import { Storage } from '@ionic/storage';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-expediente-detail',
@@ -88,6 +89,7 @@ export class ExpedienteDetailPage implements OnInit {
private dataService: DataService,
private storage: Storage,
private userAuth: AuthService,
private httpErroHandle: HttpErrorHandle
) {
this.loggeduser = SessionStore.user
console.log('SessionStore', SessionStore)
@@ -242,14 +244,9 @@ export class ExpedienteDetailPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.close();
this.toastService._successMessage('Processo aprovado')
this.httpErroHandle.httpsSucessMessagge('Avaliação Superiror')
} 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 aprovado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -272,14 +269,9 @@ export class ExpedienteDetailPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
this.httpErroHandle.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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -402,17 +394,12 @@ export class ExpedienteDetailPage implements OnInit {
this.getFromDB();
} else {
try {
this.toastService._badRequest('Processo não encontrado')
this.httpErroHandle.httpStatusHandle(error)
this.goBack()
} catch (e) {
window.history.back();
}
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.httpErroHandle.httpStatusHandle(error)
}
});
@@ -545,12 +532,7 @@ export class ExpedienteDetailPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -22,6 +22,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
import { ThemeService } from 'src/app/services/theme.service'
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-expediente-pr',
@@ -60,7 +61,8 @@ export class ExpedientePrPage implements OnInit {
private toastService: ToastService,
private attachmentsService: AttachmentsService,
private RouteService: RouteService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
) {
this.loggeduser = SessionStore.user;
@@ -137,18 +139,13 @@ export class ExpedientePrPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
this.toastService._successMessage('Processo enviado para pendentes')
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendente')
this.goBack();
loader.remove()
},
(error)=>{
loader.remove()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não enviado para pendentes')
}
this.httpErroHandle.httpStatusHandle(error)
});
}
@@ -193,16 +190,12 @@ export class ExpedientePrPage implements OnInit {
}, (error)=>{
try {
this.toastService._badRequest('Processo não encontrado')
this.httpErroHandle.httpStatusHandle(error)
this.goBack()
} catch (e) {
window.history.back();
} finally {
if(error.status == 0) {
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.httpErroHandle.httpStatusHandle(error)
}
});
}
@@ -312,14 +305,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise();
this.close();
this.toastService._successMessage('Processo aprovado')
this.httpErroHandle.httpsSucessMessagge('Aprovar')
} 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 aprovado')
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -342,14 +330,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
this.httpErroHandle.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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -468,15 +451,10 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
this.toastService._successMessage('Processo descartado');
this.httpErroHandle.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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -242,7 +242,7 @@
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
</div>
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countAll}} <span class="title1">Documentos</span></p>
</div>
<!-- List -->
@@ -33,6 +33,8 @@ import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { SessionStore } from 'src/app/store/session.service';
import { NotificationsService } from 'src/app/services/notifications.service'
import { environment } from 'src/environments/environment';
import { EventsService } from 'src/app/services/events.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-gabinete-digital',
templateUrl: './gabinete-digital.page.html',
@@ -126,7 +128,9 @@ export class GabineteDigitalPage implements OnInit {
private sortService: SortService,
private storage: Storage,
public p: PermissionService,
public NotificationsService: NotificationsService
public NotificationsService: NotificationsService,
public eventService: EventsService,
private httpErroHandle: HttpErrorHandle
) {
// this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
@@ -598,7 +602,7 @@ export class GabineteDigitalPage implements OnInit {
updateAllProcess = () => {
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.contactList).concat(this.despachoStore.list)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
// try{
@@ -732,21 +736,48 @@ export class GabineteDigitalPage implements OnInit {
this.updateAllProcess()
}
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
let eventsMDGPRList = mdEventsOficial
eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
for(let calendar of this.eventService.calendarNamesAry) {
if(calendar == 'Meu calendario') {
// color
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
eventsList = [];
}
this.eventoaprovacaostore.save(calendar, eventsList)
} else {
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId).toPromise()
let eventsList
try {
eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
eventsList = []
}
this.eventoaprovacaostore.save(calendar, eventsList)
}
}
// let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
// let eventsMDGPRList = mdEventsOficial
// eventsMDGPRList = eventsMDGPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
this.updateAllProcess()
// this.eventoaprovacaostore.countMd = eventsMDGPRList.length
// this.eventoaprovacaostore.resetmd(eventsMDGPRList);
// this.updateAllProcess()
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
let eventsPRList = prEventsOficial
eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
// let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
// let eventsPRList = prEventsOficial
// eventsPRList = eventsPRList.filter((item) => item.activityInstanceName != 'Editar Evento')
this.eventoaprovacaostore.countPr = eventsPRList.length
this.eventoaprovacaostore.resetpr(eventsPRList);
// this.eventoaprovacaostore.countPr = eventsPRList.length
// this.eventoaprovacaostore.resetpr(eventsPRList);
this.updateAllProcess()
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
@@ -29,6 +29,7 @@ import { DataService } from 'src/app/services/data.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-pedido',
@@ -68,7 +69,7 @@ export class PedidoPage implements OnInit {
private platform: Platform,
public ThemeService: ThemeService,
private dataService: DataService,
) {
private htppErroHandle: HttpErrorHandle ) {
this.loggeduser = SessionStore.user;
this.activatedRoute.paramMap.subscribe(params => {
@@ -178,9 +179,8 @@ export class PedidoPage implements OnInit {
}, (error) => {
if (error.status == 0) {
this.getfromDb();
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
this.htppErroHandle.httpsSucessMessagge(error)
try {
this.goBack()
this.close()
@@ -358,7 +358,6 @@ export class PedidoPage implements OnInit {
this.goBack()
}
// alert(JSON.stringify(res)+' nada')
}))
}
@@ -379,15 +378,10 @@ export class PedidoPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.htppErroHandle.httpsSucessMessagge('Solicitar alteração')
this.close();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.htppErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -404,15 +398,10 @@ export class PedidoPage implements OnInit {
note
}).toPromise()
this.toastService._successMessage()
this.htppErroHandle.httpsSucessMessagge('Arquivar')
this.close();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.htppErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -456,12 +445,7 @@ export class PedidoPage implements OnInit {
loader.remove()
}, (error) => {
loader.remove()
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.htppErroHandle.httpStatusHandle(error)
});
}
@@ -16,6 +16,7 @@ import { Platform } from '@ionic/angular';
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -49,7 +50,8 @@ export class PendentesPage implements OnInit {
private platform: Platform,
private backgroundservices: BackgroundService,
private sortService: SortService,
private storage: Storage
private storage: Storage,
private httpErroHandle: HttpErrorHandle
) {
this.loggeduser = SessionStore.user;
this.profile = 'mdgpr';
@@ -116,6 +118,8 @@ export class PendentesPage implements OnInit {
}, (error) => {
if(error.status == 0) {
this.getFromDb();
} else {
this.httpErroHandle.httpStatusHandle(error)
}
})
@@ -96,7 +96,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1">
<ion-textarea [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -5,6 +5,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle} from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-edit-action',
@@ -41,6 +42,7 @@ export class EditActionPage implements OnInit {
private toastService: ToastService,
private navParams: NavParams,
private modalController: ModalController,
private httpErrorHandle: HttpErrorHandle
) {
this.folder = new PublicationFolder();
this.folderId = this.navParams.get('folderId');
@@ -117,14 +119,9 @@ export class EditActionPage implements OnInit {
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
this.close();
this.updateDesktopComponent.emit();
this.toastService._successMessage('Acção presidencial atualizada')
this.httpErrorHandle.httpsSucessMessagge('Editar publicação');
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -88,7 +88,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -7,6 +7,7 @@ import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -65,7 +66,8 @@ export class NewActionPage implements OnInit {
constructor(
private modalController: ModalController,
private publication: PublicationsService,
private toastService: ToastService
private toastService: ToastService,
private httpErroHandle: HttpErrorHandle
) {
@@ -138,11 +140,11 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise();
this.toastService._successMessage("Acção criada");
this.httpErroHandle.httpsSucessMessagge('Acção criada')
this.close();
} catch (error) {
this.toastService._badRequest("Acção não criada");
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -18,6 +18,7 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera
import { Filesystem, Directory } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress";
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const IMAGE_DIR = 'stored-images';
@@ -85,6 +86,7 @@ export class NewPublicationPage implements OnInit {
private platform: Platform,
private loadingCtrl: LoadingController,
public imageCompress: NgxImageCompressService,
private httpErrorHandle: HttpErrorHandle
) {
this.publicationType = this.navParams.get('publicationType');
@@ -198,14 +200,14 @@ export class NewPublicationPage implements OnInit {
this.Form = new FormGroup({
Subject: new FormControl(this.pub.Title, [
//Validators.required,
Validators.required,
// Validators.minLength(4)
]),
capturedImage: new FormControl(this.capturedImage, [
]),
Message: new FormControl(this.pub.Message, [
// Validators.required
Validators.required,
Validators.maxLength(1000)
])
@@ -241,11 +243,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage("Publicação editada")
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
this.close();
} catch (error) {
this.toastService._badRequest("Publicação não editada")
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -269,11 +271,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage("Publicação criado")
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
this.close();
} catch (error) {
this.toastService._badRequest("Publicação não criado")
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -297,11 +299,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage("Publicação criado")
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
this.close();
} catch (error) {
this.toastService._badRequest("Publicação não criado")
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -333,12 +335,12 @@ export class NewPublicationPage implements OnInit {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close();
this.toastService._successMessage("Publicação criado")
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
this.close();
} catch (error) {
this.toastService._badRequest("Publicação não criado")
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -9,6 +9,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-publication-detail',
@@ -30,6 +31,7 @@ export class PublicationDetailPage implements OnInit {
private RouteService: RouteService,
public ThemeService: ThemeService,
public p:PermissionService,
private httpErrorHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
@@ -87,6 +89,9 @@ export class PublicationDetailPage implements OnInit {
FileExtension: 'jpeg',
}
this.showLoader = false;
}, (error) => {
this.httpErrorHandle.httpStatusHandle(error)
this.goBack();
});
}
@@ -109,7 +114,7 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService._successMessage('Publicação removida')
this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação')
if(window['app-view-publications-page-doRefresh']) {
window['app-view-publications-page-doRefresh']()
@@ -117,7 +122,7 @@ export class PublicationDetailPage implements OnInit {
this.goBack();
} catch (error) {
this.toastService._badRequest('Publicaçao não removida')
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -13,6 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { forkJoin } from 'rxjs';
import { ToastService } from 'src/app/services/toast.service';
import { PermissionService } from 'src/app/services/permission.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-view-publications',
@@ -44,7 +45,8 @@ export class ViewPublicationsPage implements OnInit {
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private toastService: ToastService,
public p: PermissionService,) {
public p: PermissionService,
private httpErroHandle: HttpErrorHandle) {
this.item = new PublicationFolder();
this.activatedRoute.paramMap.subscribe(params => {
@@ -119,6 +121,8 @@ export class ViewPublicationsPage implements OnInit {
this.item = res;
this.sqliteservice.updatePublicationsDetails(this.folderId, JSON.stringify(res));
}, (error) => {
this.httpErroHandle.httpStatusHandle(error)
});
}
@@ -161,7 +165,12 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = false;
}, (error) => {
this.getFromDB()
if(error.status == 0) {
this.getFromDB()
} else {
this.httpErroHandle.httpStatusHandle(error)
}
});
}
@@ -196,6 +205,8 @@ export class ViewPublicationsPage implements OnInit {
if (error.status == '404') {
this.error = 'Sem publicações disponíveis!';
this.publicationList = [];
} else {
this.httpErroHandle.httpStatusHandle(error)
}
this.showLoader = false;
});
+4 -2
View File
@@ -13,6 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { Router } from '@angular/router';
import { environment } from 'src/environments/environment';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-search',
@@ -65,7 +66,8 @@ export class SearchPage implements OnInit {
private modalCtrl: ModalController,
private navParams: NavParams,
public ThemeService: ThemeService,
private router: Router)
private router: Router,
private httpErrorhandle: HttpErrorHandle)
{
this.ordinance = "recent";
this.currentPath= window.location.pathname;
@@ -287,6 +289,7 @@ export class SearchPage implements OnInit {
},error => {
this.showLoader = false;
// this.searchResult = "Registo não encontrado"
this.httpErrorhandle.httpStatusHandle(error)
console.log(error)
});
}
@@ -334,7 +337,6 @@ export class SearchPage implements OnInit {
this.loadWordCloud();
},error => {
this.searchResult = "Registo não encontrado"
counter++;
console.log('application 8 failed', error)
if(counter ==2) {
-3
View File
@@ -4,7 +4,6 @@ import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
import { environment } from 'src/environments/environment';
import { BehaviorSubject } from 'rxjs';
import { AuthConnstants } from '../config/auth-constants';
import { AlertController } from '@ionic/angular';
import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
@@ -141,7 +140,6 @@ export class AuthService {
const formData = message.temporaryData
try {
// alert('upload try')
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path
@@ -217,7 +215,6 @@ export class AuthService {
SessionStore.setInativity(false)
SessionStore.setUrlBeforeInactivity(this.router.url);
setTimeout(() => {
// alert('logout')
this.router.navigateByUrl('/', { replaceUrl: true });
}, 100)
+1 -2
View File
@@ -20,9 +20,8 @@ export class ClearStoreService {
clear() {
EventoAprovacaoStore.clear();
DespachoStore.reset([])
EventoAprovacaoStore.resetmd([])
EventoAprovacaoStore.resetpr([])
ExpedienteGdStore.reset([])
PendentesStore.reset([])
PedidosStore.resetdeferimento([])
+13 -10
View File
@@ -258,10 +258,12 @@ export class EventsService {
this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName
if(!this.calendarNamesAry.find(x => x.Role == e.Role)) {
let objectShared = {
"Fullname": e.FullName,
"Role": e.Role,
"OwnerUserId": sharedCalendar.OwnerUserId,
"RoleId": sharedCalendar.CalendarRoleId
}
@@ -864,16 +866,17 @@ export class EventsService {
let options: any;
const headers = [
this.headerSharedOficial,
this.headerSharedPessoal,
this.headerOwnPessoal,
this.headerOwnOficial
]
const header = headers.find((header)=> {
return header?.get('CalendarId')?.includes(CalendarId)
const Selectedcalendar = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars).find((calendar) =>{
return calendar.CalendarId == CalendarId
})
let header = new HttpHeaders();
header = header.set('Authorization',SessionStore.user.BasicAuthKey);
header = header.set('CalendarId', Selectedcalendar.CalendarId);
header = header.set('CalendarRoleId', Selectedcalendar.CalendarRoleId);
console.log(Selectedcalendar)
options = {
headers: header,
+11 -2
View File
@@ -9,6 +9,10 @@ export class SortService {
constructor(private ObjectService: ObjectService) { }
sortArrayISODate(myArray: any) {
if(!Array.isArray(myArray)) {
myArray = []
}
if(myArray.length > 0){
return myArray.sort(function (a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
@@ -17,7 +21,9 @@ export class SortService {
}
sortArrayByDate(myArray: any) {
if(!Array.isArray(myArray)) {
myArray = []
}
if(myArray.length > 0){
return myArray.sort(function (a, b) {
return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0);
@@ -26,7 +32,10 @@ export class SortService {
}
sortDate(array = [], path: string) {
if(!Array.isArray(array)) {
array = []
}
return array.sort( (a,b)=> {
return (new Date(this.ObjectService.deepFind(a, path)) < new Date(this.ObjectService.deepFind(b, path))) ? -1 : ((new Date(this.ObjectService.deepFind(a, path)) > new Date(this.ObjectService.deepFind(b, path))) ? 1 : 0);
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HttpErrorHandle } from './http-error-handle.service';
describe('HttpErrorHandle.ServiceService', () => {
let service: HttpErrorHandle;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HttpErrorHandle);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,145 @@
import { Injectable } from '@angular/core';
import { ToastService } from 'src/app/services/toast.service';
@Injectable({
providedIn: 'root'
})
export class HttpErrorHandle {
constructor(
private toastService: ToastService
) { }
httpStatusHandle(error) {
switch (error.status
) {
case 0:
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
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('Ocorreu um problema, por favor valide o username e password');
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;
}
}
httpsSucessMessagge(service: string, callback?: any) {
switch (service) {
case 'new event':
this.toastService._successMessage('Evento criado!')
break;
case 'Editar evento':
this.toastService._successMessage('Evento editado!')
break
case 'delete event':
this.toastService._successMessage('Evento eliminado!')
break;
case 'Executado':
this.toastService._successMessage('Despacho executado!')
break;
case 'Gerar Diploma':
this.toastService._successMessage('Diploma gerado!')
break;
case 'Efetuar Despacho':
this.toastService._successMessage('Despacho efetuado!')
break;
case 'Solicitar Parecer':
this.toastService._successMessage('Pedido de parecer solicitado!')
break;
case 'Delegar':
this.toastService._successMessage('Tarefa delegada!')
break;
case 'Marcar Reunião':
this.toastService._successMessage('Evento criado!')
break;
case 'Enviar para Pendentes':
this.toastService._successMessage('Enviado com sucesso!')
break;
case 'Aprovar':
this.toastService._successMessage('Evento aprovado!')
break;
case 'Rever':
this.toastService._successMessage('Evento enviado para revisão!')
break;
case 'Avaliação Superiror':
this.toastService._successMessage('Enviado para avaliação!')
break;
case 'Mandar para Revisão':
this.toastService._successMessage('Enviado para revisão!')
break;
case 'Pedido de Deferimento':
this.toastService._successMessage('Enviado com sucesso!')
break;
case 'Arquivar':
this.toastService._successMessage('Tarefa Arquivada!')
break
case 'Concluir':
this.toastService._successMessage('Diploma concluido')
case 'Reexecução':
this.toastService._successMessage('Enviado para reexecução!')
break;
case 'Assinado':
this.toastService._successMessage('Diploma assinado!')
break;
case 'Solicitar Assinatura':
this.toastService._successMessage('Solicitação enviada!')
break;
case 'Solicitar alteração':
this.toastService._successMessage('Solicitação enviada!')
break;
case 'Evento aprovação':
this.toastService._successMessage('Evento aprovado!')
break;
case 'Rejeitar':
this.toastService._successMessage('Evento Rejeitado!')
break;
case 'Dar o meu Parecer':
this.toastService._successMessage('Parecer enviado!')
break;
case 'Reencaminhar':
this.toastService._successMessage('Reencaminhado!')
break;
case 'Eliminar publicação':
this.toastService._successMessage('Publicação Eliminada!')
break;
case 'Editar publicação':
this.toastService._successMessage('Publicação Editada!')
break;
case 'Criar publicação':
this.toastService._successMessage('Publicação criada!')
break;
case 'Acção criada':
this.toastService._successMessage('Acção criada!')
break;
case 'Editar Acção':
this.toastService._successMessage('Acção editada!')
break;
case 'Eliminar Acção':
this.toastService._successMessage('Acção eliminada!')
break;
default:
this.toastService._successMessage('Processo efetuado!')
break;
}
}
}
-1
View File
@@ -23,7 +23,6 @@ export class InativityService {
function userIsNotActive() {
// your function for too long inactivity goes here
SessionStore.setInativity(false)
// alert('go out')
try {
window['inactivity/function']()
} catch (error) {}
+16
View File
@@ -69,6 +69,22 @@ export class ProcessesService {
return this.http.get<fullTaskList[]>(`${geturl}`, options);
}
eventsToApprove(userid) {
const geturl = environment.apiURL + 'tasks/events-to-approve';
let params = new HttpParams();
params = params.set("pageNum", 1);
params = params.set("pageSize", 500);
params = params.set("userid", userid);
let options = {
headers: this.headers,
params: params
};
return this.http.get<fullTaskList[]>(`${geturl}`, options);
}
GetTaskListExpediente(onlycount1): Observable<ExpedienteFullTask[]> {
const processname = "Expediente"
const onlycount = false
@@ -38,7 +38,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="eventProcess.workflowInstanceDataFields.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="eventProcess.workflowInstanceDataFields.Location"></ion-input>
</div>
</div>
@@ -34,7 +34,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
</div>
</div>
<!-- Error messages -->
@@ -321,7 +321,7 @@
<ion-title></ion-title>
<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>
@@ -14,6 +14,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-edit-event',
@@ -92,7 +93,8 @@ export class EditEventPage implements OnInit {
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {}
ngOnInit() {
@@ -332,7 +334,7 @@ export class EditEventPage implements OnInit {
} catch (e) {}
}
this.showLoader = false;
this.toastService.successMessage()
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
} else {
await this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
@@ -346,13 +348,13 @@ export class EditEventPage implements OnInit {
} catch (e) {}
}
this.showLoader = false;
this.toastService.successMessage()
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
}
} catch(error) {
this.showLoader = false
this.toastService.badRequest()
this.httpErrorHandle.httpStatusHandle(error)
}
this.clearPostEvent.emit();
@@ -10,10 +10,7 @@
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<!-- <ion-segment-button value="MDGPR">
Minha agenda
</ion-segment-button> -->
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : 'PR'">
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId ">
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
@@ -30,39 +27,17 @@
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventsMDGPRList">
<div class="main-content overflow-y-auto height-100" >
<!-- <div class="header-content width-100"> -->
<!-- </div> -->
<ion-list class="width-100" *ngSwitchCase="'MDGPR'" >
<div
class="item item-hover ion-no-padding width-100 cursor-pointer"
*ngFor="let event of eventsMDGPRList"
(click)="openApproveModal(event.serialNumber, event)"
>
<div class="event-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
<div *ngIf="event.activityInstanceName">
<div class="label-event-type"> {{ event.activityInstanceName }} </div>
</div>
</div>
</div>
</div>
</ion-list>
<ion-list class="width-100" *ngSwitchCase="'PR'">
<div class="width-100" *ngIf="eventsPRList">
<ion-list class="width-100">
<div class="width-100" >
<div
class="item ion-no-padding width-100 cursor-pointer"
*ngFor="let event of eventsPRList"
*ngFor="let event of eventoaprovacaostore.get(segment)"
(click)="openApproveModal(event.serialNumber, event)"
>
<div class="event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="event-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
@@ -78,30 +53,9 @@
</div>
</div>
</div>
</ion-list>
<ion-list class="width-100" *ngSwitchCase="'Unknown'">
<div class="width-100" *ngIf="eventsGenericList">
<div
class="item ion-no-padding width-100 cursor-pointer"
*ngFor="let event of eventsGenericList"
(click)="openApproveModal(event.serialNumber, event)"
>
<div class="event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
<div *ngIf="event.activityInstanceName">
<div class="label-event-type"> {{ event.activityInstanceName }} </div>
</div>
</div>
</div>
</div>
</div>
</ion-list>
</div>
</ion-content>
@@ -7,6 +7,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service';
import { EventsService } from 'src/app/services/events.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
@Component({
selector: 'app-event-list',
@@ -17,15 +18,16 @@ export class EventListPage implements OnInit {
// [desktop] event list to approve
showLoader: boolean;
eventsPRList: any = []
eventsMDGPRList: any = []
eventsGenericList: any = []
eventsList: any = []
eventPerson: EventPerson;
eventBody: EventBody;
categories: string[];
serialnumber:string;
loggeduser: LoginUserRespose;
segment:string;
eventoaprovacaostore = EventoAprovacaoStore;
color: 'pr' | 'mdgpr'
@Input() profile:string;
@Input() showComponent:string;
@@ -44,11 +46,13 @@ export class EventListPage implements OnInit {
ngOnInit() {
this.segment = this.loggeduser.Profile;
if(this.segment != "PR" && this.segment != "MDGPR") {
this.segment = "Unknown";
if(!this.segment) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.segment = 'Meu calendario';
} else {
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
}
}
const pathname = window.location.pathname
this.router.events.forEach((event) => {
@@ -75,83 +79,54 @@ export class EventListPage implements OnInit {
async LoadToApproveEvents() {
this.showLoader = true;
try {
if(this.segment == 'MDGPR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
let allEvents = mdEventsOficial.concat(mdEventsPessoal);
if(allEvents.length > 0) {
this.eventsMDGPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
}
else if(this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
let allEvents = prEventsOficial
if(allEvents.length > 0) {
this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
const segment = this.segment
if(this.segment == 'Meu calendario') {
// color
if(SessionStore.user.Profile == 'PR') {
this.color = 'pr'
} else {
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
if(genericEvents.length > 0) {
this.eventsGenericList = this.sortService.sortArrayByDate(genericEvents).reverse();
}
this.showLoader = false;
this.color = 'mdgpr'
}
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
try {
this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
this.eventsList = [];
}
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.color = 'pr'
let allEvents = await this.processes.eventsToApprove(segment).toPromise()
try {
this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
this.eventsList = []
}
} catch(erro) {
this.showLoader = false;
this.eventsList = this.eventsList
this.eventsList = this.eventsList
this.eventoaprovacaostore.save(segment, this.eventsList)
}
this.showLoader = false;
}
async LoadToApproveEventsNoLoader() {
try {
if(this.segment == 'MDGPR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
let allEvents = mdEventsOficial
if(allEvents.length > 0) {
this.eventsMDGPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
}
else if(this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
let allEvents = prEventsOficial
if(allEvents.length > 0) {
this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
} else {
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
if(genericEvents.length > 0) {
this.eventsGenericList = this.sortService.sortArrayByDate(genericEvents).reverse();
}
this.showLoader = false;
}
} catch(erro) {
this.showLoader = false;
}
this.LoadToApproveEvents()
}
async openApproveModal(eventSerialNumber, data) {
let a = this.eventsMDGPRList.filter((elem) => {
//
return eventSerialNumber == elem.serialNumber
});
this.approveEventDismiss.emit({
"serialNumber": eventSerialNumber,
"action": "Aprovar",
@@ -66,7 +66,7 @@
</div>
<div class="ion-input-class flex-grow-1 width-100" [class.input-error]="Form?.get('Location')?.invalid && validateFrom " >
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" type="text" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" type="text" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
</div>
</div>
@@ -341,7 +341,7 @@
<ion-title></ion-title>
<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>
@@ -27,6 +27,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
import { ServerConnectionService } from 'src/app/services/server-connection.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -130,8 +131,9 @@ export class NewEventPage implements OnInit {
private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService,
private chatMethodService: ChatMethodsService,
private ServerConnectionService: ServerConnectionService
private ServerConnectionService: ServerConnectionService,
// private translate: TranslateService
private hhtpErrorHandle: HttpErrorHandle
) {
this.dateAdapter.setLocale('pt');
this.loggeduser = SessionStore.user;
@@ -521,7 +523,7 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0) {
this.afterSave();
}
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
@@ -540,12 +542,7 @@ export class NewEventPage implements OnInit {
console.log(error, 'error')
loader.remove()
this.showLoader = false
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
this.hhtpErrorHandle.httpStatusHandle(error)
});
}
@@ -585,7 +582,7 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
@@ -597,17 +594,11 @@ export class NewEventPage implements OnInit {
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},(error) => {
//const connectionToServer = this.ServerConnectionService.BaseAPI()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
this.hhtpErrorHandle.httpStatusHandle(error)
loader.remove()
this.showLoader = false
@@ -651,7 +642,7 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
this.toastService._successMessage('Evento criado');
this.hhtpErrorHandle.httpsSucessMessagge('new event')
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
@@ -663,16 +654,11 @@ export class NewEventPage implements OnInit {
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},(error)=>{
loader.remove()
this.showLoader = false
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não criado')
}
this.hhtpErrorHandle.httpStatusHandle(error)
});
}
@@ -14,6 +14,7 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
@Component({
@@ -58,6 +59,7 @@ export class ViewEventPage implements OnInit {
public popoverController: PopoverController,
private toastService: ToastService,
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
this.isEventEdited = false;
this.loadedEvent = new Event();
@@ -115,11 +117,7 @@ export class ViewEventPage implements OnInit {
type: 'close'
})
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
this.httpErrorHandle.httpStatusHandle(error)
});
} else {
@@ -141,11 +139,7 @@ export class ViewEventPage implements OnInit {
type: 'close'
})
if(error.status == 0) {
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
this.httpErrorHandle.httpStatusHandle(error)
});
}
}
@@ -182,9 +176,11 @@ export class ViewEventPage implements OnInit {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
this.toastService._successMessage('Evento eliminado');
this.httpErrorHandle.httpsSucessMessagge('delete event')
this.close();
},()=>{},
},(error)=>{
this.httpErrorHandle.httpStatusHandle(error)
},
()=>{
loader.remove();
});
@@ -192,9 +188,11 @@ export class ViewEventPage implements OnInit {
if(this.CalendarId) {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.CalendarId).subscribe(async () => {
this.toastService._successMessage('Evento eliminado');
this.httpErrorHandle.httpsSucessMessagge('delete event');
this.close();
},()=>{},
},(error)=>{
this.httpErrorHandle.httpStatusHandle(error)
},
()=>{
loader.remove();
});
@@ -208,17 +206,21 @@ export class ViewEventPage implements OnInit {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
this.toastService._successMessage('Evento eliminado');
this.httpErrorHandle.httpsSucessMessagge('delete event');
this.close();
},()=>{},
},(error)=>{
this.httpErrorHandle.httpStatusHandle(error)
},
()=>{
loader.remove();
});
} else {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.CalendarId).subscribe(async () => {
this.toastService._successMessage('Evento eliminado');
this.httpErrorHandle.httpsSucessMessagge('delete event');
this.close();
},()=>{},
},(error)=>{
this.httpErrorHandle.httpStatusHandle(error)
},
()=>{
loader.remove();
});
@@ -211,9 +211,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
let containerHeight = windowHeight - e.srcElement.clientHeight;
if (scroll > this.currentPosition) {
//alert('BOTTOM');
} else {
//alert('UP');
this.scrollingOnce = false;
}
if ((containerHeight - 100) > scroll) {
@@ -242,9 +242,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
let containerHeight = windowHeight - e.srcElement.clientHeight;
if (scroll > this.currentPosition) {
//alert('BOTTOM');
} else {
//alert('UP');
this.scrollingOnce = false;
}
if ((containerHeight - 100) > scroll) {
@@ -83,7 +83,7 @@ export class AllProcessesPage implements OnInit {
updateAllProcess = () => {
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.contactList).concat(this.despachoStore.list)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList).concat(this.pendentesstore.list)
}
@@ -26,7 +26,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-input placeholder="Localização*" [(ngModel)]="eventProcess.workflowInstanceDataFields.Location"></ion-input>
<ion-input placeholder="Localização" [(ngModel)]="eventProcess.workflowInstanceDataFields.Location"></ion-input>
</div>
</div>
<!-- Error messages -->
@@ -324,6 +324,6 @@
<ion-footer class="background-whit">
<div class="buttons">
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Enviar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Gravar</button>
</div>
</ion-footer>
@@ -13,6 +13,7 @@ import { Event, EventToApproveEdit } from '../../../models/event.model';
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { NavigationExtras, Router } from '@angular/router';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -117,7 +118,8 @@ export class EditEventToApproveComponent implements OnInit {
private processes:ProcessesService,
private toastService: ToastService,
private router:Router,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHalde: HttpErrorHandle
) {
// Edit event to approve
this.serialNumber = this.navParams.get('serialNumber');
@@ -153,7 +155,7 @@ export class EditEventToApproveComponent implements OnInit {
this.getAttachments()
} catch (error) {
this.httpErroHalde.httpStatusHandle(error)
}
@@ -310,14 +312,9 @@ export class EditEventToApproveComponent implements OnInit {
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService._successMessage('Evento editado');
this.httpErroHalde.httpsSucessMessagge('Editar evento')
}, error =>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não editado');
}
this.httpErroHalde.httpStatusHandle(error)
})
@@ -12,11 +12,12 @@
<!-- <ion-segment-button value="MDGPR">
Minha agenda
</ion-segment-button> -->
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : 'PR'">
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId">
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR {{ i.OwnerUserIds }}</div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.Fullname }} </div>
</ion-segment-button>
</ion-segment>
</ion-toolbar>
@@ -27,20 +28,20 @@
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content overflow-y-auto height-100" [ngSwitch]="segment" *ngIf="eventaprovacaostore.listpr">
<div class="main-content overflow-y-auto height-100" >
<div *ngSwitchCase="'MDGPR'" class="height-100">
<div class="height-100">
<div *ngIf="eventaprovacaostore.listmd">
<div >
<ion-list class="width-100" *ngIf="eventaprovacaostore.listmd.length != 0" >
<ion-list class="width-100" >
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listmd"
*ngFor="let event of eventoaprovacaostore.get(segment)"
(click)="goToEventDetail(event)"
>
<!-- (click)="openApproveModal(event)" -->
<div class="event-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="event-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
@@ -55,10 +56,10 @@
</ion-list>
</div>
<div *ngIf="eventaprovacaostore.listmd" class="centered-div">
<div *ngIf="eventoaprovacaostore.get(segment)" class="centered-div">
<div *ngIf="eventaprovacaostore.listmd.length == 0">
<div *ngSwitchCase="'MDGPR'">
<div *ngIf="eventoaprovacaostore.get(segment).length == 0">
<div >
<div class="d-flex height-90 align-center justify-content-center"
>
Lista vazia
@@ -67,41 +68,7 @@
</div>
</div>
</div>
<div *ngSwitchCase="'PR'">
<div *ngIf="eventaprovacaostore.listpr.length != 0">
<ion-list class="width-100" *ngSwitchCase="'PR'">
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor="let event of eventaprovacaostore.listpr"
(click)="goToEventDetail(event)"
>
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) != toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="toDateString(event.workflowInstanceDataFields.StartDate) == toDateString(event.workflowInstanceDataFields.EndDate)">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div *ngIf="eventaprovacaostore.listpr.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
<div *ngSwitchCase="'PR'" >
<div class="d-flex align-center justify-content-center"
*ngIf="eventaprovacaostore.listpr.length < 1">
Lista vazia
</div>
</div>
</div>
</div>
</div>
</ion-content>
@@ -27,10 +27,13 @@ export class EventsToApprovePage implements OnInit {
eventBody: EventBody;
categories: string[];
serialnumber:string;
loggeduser: LoginUserRespose;
segment:string;
eventaprovacaostore = EventoAprovacaoStore;
eventsList: any = []
color: 'pr' | 'mdgpr'
eventoaprovacaostore = EventoAprovacaoStore;
constructor(
private processes:ProcessesService,
private modalController: ModalController,
@@ -40,12 +43,17 @@ export class EventsToApprovePage implements OnInit {
private storage: Storage,
public eventService: EventsService,
)
{
this.loggeduser = SessionStore.user;
}
{}
ngOnInit() {
this.segment = this.loggeduser.Profile;
if(!this.segment) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.segment = 'Meu calendario';
} else {
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
}
}
this.LoadToApproveEvents();
this.router.events.forEach((event) => {
@@ -68,37 +76,50 @@ export class EventsToApprovePage implements OnInit {
async LoadToApproveEvents() {
this.showLoader = true;
this.getFromDB();
if(this.segment != 'PR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR,Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
this.eventsMDGPRList = ( this.eventsMDGPRList || []).filter(function(item) {
const segment = this.segment
if(this.segment == 'Meu calendario') {
// color
if(SessionStore.user.Profile == 'PR') {
this.color = 'pr'
} else {
this.color = 'mdgpr'
}
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
try {
this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse();
} catch (error) {
this.eventsList = [];
}
this.eventsList = this.eventsList.filter(function(item) {
return item.activityInstanceName != 'Editar Evento'
}) || []
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
})
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
}
else if(this.segment == 'PR') {
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
// console.log(prEventsOficial)
// console.log(prEventsPessoal)
this.eventsPRList = prEventsOficial
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
this.eventsPRList = (this.eventsPRList || []).filter(function(item) {
this.color = 'pr'
let allEvents = await this.processes.eventsToApprove(segment).toPromise()
try {
this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
} catch(error) {
this.eventsList = []
}
this.eventsList = this.eventsList.filter(function(item) {
return item.activityInstanceName != 'Editar Evento'
})
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
})
this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
}) || []
this.eventsList = this.eventsList
this.eventsList = this.eventsList
this.showLoader = false;
this.eventoaprovacaostore.save(segment, this.eventsList)
}
this.showLoader = false;
}
@@ -11,6 +11,7 @@ import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
import { PermissionService } from 'src/app/services/permission.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-despachos-options',
@@ -32,6 +33,7 @@ export class DespachosOptionsPage implements OnInit {
public p: PermissionService,
public ThemeService: ThemeService,
private RouteService: RouteService,
private httpErrorHandle: HttpErrorHandle,
) {
this.task = this.navParams.get('task')
this.fulltask = this.navParams.get('fulltask')
@@ -74,18 +76,13 @@ export class DespachosOptionsPage implements OnInit {
const loader = this.toastService.loading()
this.popoverController.dismiss();
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
loader.remove()
this.close();
},(error)=>{
loader.remove()
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)
});
}
@@ -96,7 +96,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -4,6 +4,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-edit-action',
@@ -40,6 +41,7 @@ export class EditActionPage implements OnInit {
constructor(
private publicationsService: PublicationsService,
private toastService: ToastService,
private httpErrorHandle: HttpErrorHandle,
) {
this.folder = new PublicationFolder();
}
@@ -107,15 +109,11 @@ export class EditActionPage implements OnInit {
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
this.close();
this.updateDesktopComponent.emit();
this.toastService._successMessage('Acção presidencial atualizada')
this.httpErrorHandle.httpsSucessMessagge('Editar Acção')
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -101,7 +101,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção*"></ion-textarea>
</div>
</div>
</div>
@@ -4,6 +4,7 @@ import * as moment from 'moment';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -36,7 +37,8 @@ export class NewActionPage implements OnInit {
constructor(
private publication: PublicationsService,
private toastService: ToastService
private toastService: ToastService,
private httpErrorHandle: HttpErrorHandle,
) {
this.folder = new PublicationFolder();
@@ -121,16 +123,11 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.close();
this.toastService._successMessage('Acção presidencial criada')
this.httpErrorHandle.httpsSucessMessagge('Acção criada')
this.getActions.emit()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -23,7 +23,7 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
</div>
</div>
</div>
@@ -8,6 +8,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource} from '@capacitor/camera';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-new-publication',
templateUrl: './new-publication.page.html',
@@ -48,7 +49,8 @@ export class NewPublicationPage implements OnInit {
public photoService: PhotoService,
private publications: PublicationsService,
private toastService: ToastService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle
) {
this.publicationTitle = 'Nova Publicação';
}
@@ -115,11 +117,11 @@ export class NewPublicationPage implements OnInit {
this.Form = new FormGroup({
Subject: new FormControl(this.pub.Title, [
// Validators.required,
Validators.required,
// Validators.minLength(4)
]),
Message: new FormControl(this.pub.Message, [
// Validators.required
Validators.required,
Validators.maxLength(1000)
])
})
@@ -131,7 +133,11 @@ export class NewPublicationPage implements OnInit {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
if(this.Form.invalid) {
return false
} else {
}
if(this.publicationType == '3') {
@@ -155,15 +161,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -188,15 +190,11 @@ export class NewPublicationPage implements OnInit {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -220,15 +218,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
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.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -255,15 +249,11 @@ export class NewPublicationPage implements OnInit {
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
this.toastService._successMessage()
this.httpErroHandle.httpsSucessMessagge('Criar 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()
}
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
+58 -71
View File
@@ -9,109 +9,96 @@ import { isArray } from 'ionic-angular/umd/util/util';
export class EventoaprovacaoStoreService {
// main data
private _listPr: any[] = []
private _listMd: any[] = []
private _list: {[key: string]: any[]} = {}
private _concatList = []
// local storage keyName
private keyNamemd: string;
private keyNamepr: string;
private _count = 0
private _countPr = 0
private _countMd = 0
private keyNameAll: string;
private _counts : {[key: string]: number} = {}
private _countsAll = 0
constructor() {
this.keyNamemd = (SHA1("EventoaprovacaoStoreService"+"md")).toString()
this.keyNamepr = (SHA1("EventoaprovacaoStoreService"+"pr")).toString()
this.keyNameAll = (SHA1("EventoaprovacaoStoreService"+"all")).toString()
setTimeout(()=>{
let restoreMd = localstoreService.get(this.keyNamemd, [])
let restorePr = localstoreService.get(this.keyNamepr, [])
let {list , counts} = localstoreService.get(this.keyNameAll, {})
this._listPr = restorePr.listPr || []
this._listMd = restoreMd.lisMd || []
this._countMd = parseInt(restoreMd.countListMd) || 0
this._countPr = parseInt(restorePr.countListPr) || 0
this._count = (this._countMd + this._countPr) || 0
this._list = list || {}
this.updateCount();
}, 10)
}
get listpr() { return this._listPr || [] }
get listmd() { return this._listMd || [] }
get count() { return this._count || 0 }
set count(value: number) {
this._count = value
get countAll() {
return this._countsAll
}
get countPr() { return this._countPr || 0 }
set countPr (value: number) {
this._countPr = value
get contactList() {
return this._concatList
}
get countMd() { return this._countMd || 0 }
set countMd (value) {
this._countMd = value
}
resetpr(eventsList: any) {
if(Array.isArray(eventsList)) {
this._listPr = eventsList
save(segment, value: []) {
this.countPr = this._listPr.length
this.count = this.countPr + this.countMd
this.savePr()
if(window['all-process']) {
window['all-process']()
}
if(window['all-process-gabinete']) {
window['all-process-gabinete']()
}
if(!this._list[segment]) {
this._list[segment] = []
this._counts[segment] = 0
}
}
resetmd(eventsList: any) {
if(Array.isArray(eventsList)) {
this._listMd = eventsList
this._list[segment] = value
this._counts[segment] = value.length
this.countMd = this._listMd.length
this.count = this.countPr + this.countMd
this.saveMd()
this.updateCount();
setTimeout(() => {
localstoreService.set(this.keyNameAll,{
list: this._list,
counts: this._counts
})
}, 10)
if(window['all-process']) {
window['all-process']()
}
if(window['all-process-gabinete']) {
window['all-process-gabinete']()
}
if(window['all-process']) {
window['all-process']()
}
if(window['all-process-gabinete']) {
window['all-process-gabinete']()
}
}
private saveMd() {
setTimeout(()=>{
localstoreService.set(this.keyNamemd,{
lisMd: this._listMd,
countListMd: this._countMd
clear() {
this._list = {}
this._counts = {}
setTimeout(() => {
localstoreService.set(this.keyNameAll,{
list: this._list,
counts: this._counts
})
}, 10)
}
private savePr() {
setTimeout(()=>{
localstoreService.set(this.keyNamepr,{
listPr: this._listPr,
countListPr: this._countPr
})
}, 10)
get(segment) {
return this._list[segment] || []
}
updateCount() {
let allList = []
for(let [name, value] of Object.entries(this._list)) {
allList = allList.concat(value)
}
this._countsAll = allList.length
this._concatList = allList
}
}
export const EventoAprovacaoStore = new EventoaprovacaoStoreService()