mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -22,7 +22,7 @@ import {
|
||||
import { CustomDateFormatter } from './custom-date-formatter.provider';
|
||||
import { NewEventPage } from './new-event/new-event.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { eventSource } from 'src/app/models/agenda/eventSource';
|
||||
@@ -150,7 +150,7 @@ export class AgendaPage implements OnInit {
|
||||
*/
|
||||
IsEvent: "edit" | "add" | "view";
|
||||
viewingEventObject: CalendarEvent ;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edi
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { EmendMessageModalPage } from '../emend-message-modal/emend-message-modal.page';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-actions-popover',
|
||||
@@ -24,7 +25,8 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private popoverController: PopoverController,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,) {
|
||||
private toastService: ToastService,
|
||||
private location: Location) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.instanceId = this.navParams.get('InstanceId');
|
||||
}
|
||||
@@ -37,22 +39,13 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
};
|
||||
}
|
||||
|
||||
goBack(){
|
||||
goBack() {
|
||||
this.closePopover();
|
||||
|
||||
if (window.innerWidth <= 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
} else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
'eventos': true
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
this.location.back()
|
||||
}
|
||||
|
||||
closePopover(){
|
||||
closePopover() {
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
@@ -144,7 +143,6 @@
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
|
||||
>
|
||||
@@ -182,7 +180,6 @@
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
displayFormat="DD MMM YYYY"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2021"
|
||||
max="2045"
|
||||
>
|
||||
</ion-datetime>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -31,8 +31,6 @@ export class NewEventPage implements OnInit {
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
@@ -58,7 +56,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
documents:SearchList[] = [];
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
members:any;
|
||||
|
||||
constructor(
|
||||
@@ -81,8 +79,6 @@ export class NewEventPage implements OnInit {
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
this.taskParticipants = this.navParams.get('attendees');
|
||||
|
||||
console.log(this.taskParticipants);
|
||||
|
||||
this.postEvent.StartDate = new Date()
|
||||
this.postEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header class="ion-no-border" [class.d-md-none]="isModal">
|
||||
<ion-header class="ion-no-border" [class.d-md-none]="isModal" *ngIf="header">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<div *ngIf="loadedAttachments" class="bottom-content width-100">
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-list class="width-100">
|
||||
<ion-item *ngFor="let attach of loadedAttachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
||||
<ion-item *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
||||
<ion-label class="width-100 d-flex " >
|
||||
<p class="flex-grow-1" (click)="viewDocument(attach.SourceId)">
|
||||
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
|
||||
|
||||
@@ -107,13 +107,7 @@ ion-menu{
|
||||
float: left;
|
||||
}
|
||||
|
||||
.label{
|
||||
border-radius: 20px;
|
||||
background: #ffb703;
|
||||
float: right;
|
||||
padding: 5px 13.5px 5px 13.5px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
@@ -298,4 +292,11 @@ ion-menu{
|
||||
width: 25%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.label{
|
||||
border-radius: 20px;
|
||||
background: #ffb703;
|
||||
float: right;
|
||||
padding: 5px 13.5px 5px 13.5px;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AlertController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -9,7 +8,7 @@ import { EditEventPage } from '../edit-event/edit-event.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
import { Location } from '@angular/common'
|
||||
@@ -26,7 +25,6 @@ export class ViewEventPage implements OnInit {
|
||||
isEventEdited: boolean;
|
||||
eventBody: EventBody;
|
||||
loadedAttachments:any;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
|
||||
@@ -43,6 +41,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
dicIndex = 0;
|
||||
isModal = false
|
||||
header = true
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -72,6 +71,10 @@ export class ViewEventPage implements OnInit {
|
||||
if(params["params"].isModal) {
|
||||
this.isModal = params["params"].isModal
|
||||
}
|
||||
|
||||
if(params["params"].header) {
|
||||
this.header = params["params"].header
|
||||
}
|
||||
});
|
||||
|
||||
/* this.activatedRoute.queryParams.subscribe(params => {
|
||||
@@ -86,7 +89,6 @@ export class ViewEventPage implements OnInit {
|
||||
ngOnInit() {
|
||||
|
||||
this.loadEvent();
|
||||
this.getAttachments();
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
@@ -178,7 +180,6 @@ export class ViewEventPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
this.getAttachments();
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
}
|
||||
@@ -186,22 +187,6 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getAttachments() {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
this.attachmentsService.getAttachmentsById(this.eventId).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async editEventDetail() {
|
||||
|
||||
@@ -222,7 +207,6 @@ export class ViewEventPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
this.getAttachments();
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
}
|
||||
@@ -256,7 +240,6 @@ export class ViewEventPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
this.getAttachments();
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import { NavigationStart, NavigationEnd, Router } from '@angular/router';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
|
||||
@@ -91,7 +91,7 @@ export class EditEventPage implements OnInit {
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export class EventDetailPage implements OnInit {
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { EventsPage } from './events.page';
|
||||
|
||||
import { HeaderNoSearchPageModule } from 'src/app/shared/headers/header-no-search/header-no-search.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -19,6 +20,8 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
IonicModule,
|
||||
EventsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
//
|
||||
PdfViewerModule
|
||||
],
|
||||
declarations: [EventsPage],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<p *ngIf="totalEvent!=1"class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||
</ion-label>
|
||||
<div class="next-meeting">
|
||||
<div class="meeting-time">{{currentHoursMinutes | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="currentEvent" class="meeting-description"> "{{currentEvent}}"</div>
|
||||
<div class="meeting-time" *ngIf="currentHoursMinutes">{{currentHoursMinutes | date: 'HH:mm'}}</div>
|
||||
<div class="meeting-description" *ngIf="currentEvent"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
|
||||
</ion-header>
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<ion-list>
|
||||
<ion-item class="cursor-pointer" lines="none" *ngFor = "let task of expedienteStorage.list"
|
||||
<ion-item class="cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.serialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
@@ -102,8 +102,8 @@
|
||||
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.workflowInstanceDataFields.Subject }}</div>
|
||||
<div class="location">{{ task.workflowInstanceDataFields.Sender }}</div>
|
||||
<div class="description">{{ task.Subject }}</div>
|
||||
<div class="location">{{ task.Senders }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
@@ -112,4 +112,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <pdf-viewer [src]="pdfSrc"
|
||||
[render-text]="true"
|
||||
style="display: block;"
|
||||
></pdf-viewer> -->
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -11,10 +11,11 @@ import { ModalController, Platform } from '@ionic/angular';
|
||||
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ExpedienteStorage } from 'src/app/store/expediente-storage-service.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -62,11 +63,13 @@ export class EventsPage implements OnInit {
|
||||
|
||||
// shared data
|
||||
toDayEventStorage = ToDayEventStorage
|
||||
expedienteStorage = ExpedienteStorage
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
@Output() openExpedientListPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
existingScreenOrientation: string;
|
||||
|
||||
@@ -329,21 +332,13 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
LoadList() {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
console.log(result);
|
||||
this.expedienteStorage.reset(result)
|
||||
});
|
||||
break;
|
||||
case 'PR':
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
this.expedienteStorage.reset(result)
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log("Expediente", result);
|
||||
|
||||
const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e))
|
||||
|
||||
this.expedienteGdStore.reset(ExpedienteTask)
|
||||
});
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
|
||||
@@ -12,7 +12,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
|
||||
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
|
||||
import { __awaiter } from 'tslib';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
@@ -45,7 +45,7 @@ export class DespachosPrPage implements OnInit {
|
||||
dicIndex = 0;
|
||||
inicial = false
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
skeletonLoader = true
|
||||
despachoprstore = DespachosprStore
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ export class DespachoPage implements OnInit {
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if( window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
refreshingText="A actualizar...">
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
|
||||
<div >
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<div class="height-100">
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of despachospagestore.list; let i = index"
|
||||
*ngFor = "let task of despachoStore.list; let i = index"
|
||||
(click)="GoToDespacho(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
@@ -68,13 +68,13 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && despachospagestore.list.length == 0 && despachospagestore.list.length == 0"
|
||||
*ngIf="!skeletonLoader && despachoStore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && despachospagestore.list.length == 0">
|
||||
<div *ngIf="skeletonLoader && despachoStore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { CalendarComponent } from 'ionic2-calendar';
|
||||
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { DespachoPageStore } from 'src/app/store/despachos-page-store.service';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos',
|
||||
@@ -15,43 +10,17 @@ import { DespachoPageStore } from 'src/app/store/despachos-page-store.service';
|
||||
})
|
||||
|
||||
export class DespachosPage implements OnInit {
|
||||
//profile:string;
|
||||
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
despachoList:any[] = [];
|
||||
deferimentoList:DailyWorkTask[] = [];
|
||||
|
||||
taskList:customTask[] = [];
|
||||
|
||||
taskType: string;
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loadedAttachments:any;
|
||||
dicIndex = 0;
|
||||
inicial = false
|
||||
skeletonLoader = true
|
||||
despachospagestore = DespachoPageStore;
|
||||
despachoStore = DespachoStore;
|
||||
|
||||
constructor (
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
) {
|
||||
this.profile = 'mdgpr';
|
||||
private despachoRule: DespachoService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
@@ -80,50 +49,13 @@ export class DespachosPage implements OnInit {
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
|
||||
openExpedientDetailPage(data) {
|
||||
this.openExpedientDetail.emit(data);
|
||||
}
|
||||
|
||||
async LoadList() {
|
||||
|
||||
this.skeletonLoader = true
|
||||
|
||||
let result = await this.processes.GetTasksList("Despacho", false).toPromise();
|
||||
//let despachos = result.reverse().filter(data => data.activityInstanceName == "Despacho (Paralelo)");
|
||||
this.despachoList = []
|
||||
|
||||
this.skeletonLoader = false
|
||||
|
||||
await result.filter(data => data.workflowInstanceDataFields.Status == "Active").forEach( (element, index) => {
|
||||
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DispatchDocId,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
this.despachoList.push(task)
|
||||
});
|
||||
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
|
||||
this.despachospagestore.reset(this.despachoList);
|
||||
|
||||
await this.despachoRule.getList({updateStore: true})
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
get skeletonLoader(): boolean {
|
||||
return this.despachoRule.LoaderService.loading
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
@@ -139,9 +71,6 @@ export class DespachosPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
docIndex(index: number) {
|
||||
this.dicIndex = index;
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class="display-none-true">
|
||||
<div class="buttons">
|
||||
<button class="btn-cancel" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Rever</button>
|
||||
<ion-menu-button (click)="openMenu()" autoHide="false">
|
||||
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
|
||||
</ion-menu-button>
|
||||
<button class="btn-ok" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
|
||||
<button hidden class="btn-delete" shape="round" (click)="rejeitar(loadedEvent.serialNumber)">Rejeitar</button>
|
||||
<div class="buttons">
|
||||
<button class="btn-cancel" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Rever</button>
|
||||
<ion-menu-button (click)="openMenu()" autoHide="false">
|
||||
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
|
||||
</ion-menu-button>
|
||||
<button class="btn-ok" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
|
||||
<button hidden class="btn-delete" shape="round" (click)="rejeitar(loadedEvent.serialNumber)">Rejeitar</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ion-footer>
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -112,7 +112,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
formLocationSatus: boolean = false;
|
||||
showAttendees= false;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
|
||||
constructor(
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.pag
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
@@ -84,7 +84,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
taskResult: any = {}
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
toppings = new FormControl();
|
||||
|
||||
Form: FormGroup;
|
||||
|
||||
+9
-15
@@ -19,8 +19,9 @@ import { SearchList } from 'src/app/models/search-document';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||
import { ExpedientesService } from 'src/app/Rules/expedientes.service';
|
||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||
import { TaskService } from 'src/app/Rules/task.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -61,7 +62,8 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private location: Location,
|
||||
private attachmentsService: AttachmentsService,
|
||||
public p: PermissionService,
|
||||
private expedientesService: ExpedientesService
|
||||
private taskService: TaskService,
|
||||
private expedienteService: ExpedienteService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
@@ -301,7 +303,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
viewDocument(DocId:string) {
|
||||
|
||||
this.expedientesService.viewDocument({ApplicationId:'361', DocId})
|
||||
this.expedienteService.viewDocument({ApplicationId:'361', DocId})
|
||||
}
|
||||
|
||||
getAttachments(serialNumber) {
|
||||
@@ -414,21 +416,13 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
if(body == 'descartar') {
|
||||
if(res['data']== 'Yes') {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody)
|
||||
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
@@ -447,7 +441,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.expedientesService.CompleteTask(body).toPromise();
|
||||
await this.expedienteService.CompleteTask(body).toPromise();
|
||||
//this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of expedienteStorage.list"
|
||||
*ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.SerialNumber)"
|
||||
>
|
||||
<div class="item width-100">
|
||||
<div class="exp-top-detail">
|
||||
<div class="subject">
|
||||
<ion-label>{{ task.Folio }}</ion-label>
|
||||
<ion-label>{{ task.Subject }}</ion-label>
|
||||
</div>
|
||||
<div class="exp-icon">
|
||||
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||
@@ -65,13 +65,13 @@
|
||||
</ion-list>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && expedienteStorage.list.length == 0 && expedienteStorage.list.length == 0"
|
||||
*ngIf="!skeletonLoader && expedienteGdStore.list.length == 0 && expedienteGdStore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && expedienteStorage.list.length == 0">
|
||||
<div *ngIf="skeletonLoader && expedienteGdStore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ExpedienteStorage } from 'src/app/store/expediente-storage-service.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
@@ -17,17 +17,17 @@ export class ExpedientePage implements OnInit {
|
||||
//profile:string;
|
||||
showLoader:boolean;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
taskslist = [];
|
||||
serialNumber:string;
|
||||
|
||||
expedienteStorage = ExpedienteStorage
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private router: Router,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -52,39 +52,25 @@ export class ExpedientePage implements OnInit {
|
||||
this.skeletonLoader = true
|
||||
|
||||
try {
|
||||
const expediente: object[] = await this.processes.GetTasksList("Expediente", false).toPromise()
|
||||
|
||||
const expediente: object[] = await this.processes.GetTaskListExpediente(false).toPromise()
|
||||
const result = expediente
|
||||
|
||||
this.taskslist = new Array();
|
||||
let res = result.reverse().filter((data: any) => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
res.forEach((element: any) => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let task: DailyWorkTask = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
}
|
||||
|
||||
let task = this.expedienteTaskPipe.transform(element)
|
||||
this.taskslist.push(task);
|
||||
});
|
||||
|
||||
console.log(this.taskslist);
|
||||
this.expedienteStorage.reset(this.taskslist);
|
||||
this.skeletonLoader = false;
|
||||
this.expedienteGdStore.reset(this.taskslist);
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} finally {
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
@@ -40,7 +40,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
documents: SearchList[] = [];
|
||||
attachments:any;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of expedienteprstore.list"
|
||||
*ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.SerialNumber)"
|
||||
>
|
||||
<div class="item width-100">
|
||||
@@ -62,14 +62,14 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && expedienteprstore.list.length == 0 && expedienteprstore.list.length == 0"
|
||||
*ngIf="!skeletonLoader && expedienteGdStore.list.length == 0 && expedienteGdStore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<!-- Skeleton loader -->
|
||||
<div *ngIf="skeletonLoader && expedienteprstore.list.length == 0">
|
||||
<div *ngIf="skeletonLoader && expedienteGdStore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -6,10 +6,11 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedientes-pr',
|
||||
@@ -20,15 +21,16 @@ export class ExpedientesPrPage implements OnInit {
|
||||
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
taskslist= [];
|
||||
serialNumber:string;
|
||||
showLoader:boolean;
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
skeletonLoader = true
|
||||
expedienteprstore = ExpedienteprStore;
|
||||
expedienteGdStore = ExpedienteGdStore;
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
@@ -64,32 +66,18 @@ export class ExpedientesPrPage implements OnInit {
|
||||
LoadList() {
|
||||
this.skeletonLoader = true
|
||||
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log(result);
|
||||
this.skeletonLoader = false
|
||||
this.showLoader =false
|
||||
this.taskslist = new Array();
|
||||
let res = result.reverse().filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
res.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let task: DailyWorkTask = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
}
|
||||
this.taskslist.push(task);
|
||||
});
|
||||
let task = this.expedienteTaskPipe.transform(element)
|
||||
this.taskslist.push(task);
|
||||
});
|
||||
console.log(this.taskslist);
|
||||
this.expedienteprstore.reset(this.taskslist);
|
||||
this.expedienteGdStore.reset(this.taskslist);
|
||||
this.skeletonLoader = false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -103,7 +103,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.count}} <span class="title1">Documentos</span></p>
|
||||
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
@@ -114,15 +114,6 @@
|
||||
<p class="text-center exp-card-content">{{expedientegbstore.count}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openExpedientesPrPage(); selectedElement = 'Expediente Presidente'" [class.active]="selectedElement == 'Expediente Presidente'" class="exp-card d-md-flex flex-column justify-center white-background">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Expediente Presidente</p>
|
||||
<p class="exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Expediente</p>
|
||||
<p class="text-center exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<!-- <div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" > -->
|
||||
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" >
|
||||
<div class="d-flex justify-center">
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Component, DoCheck, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
|
||||
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
|
||||
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
|
||||
@@ -13,7 +12,6 @@ import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.servic
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
@@ -21,6 +19,8 @@ import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
|
||||
import { TotalDocumentStore } from 'src/app/store/total-document.service';
|
||||
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -83,7 +83,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
serialNumber:string;
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
mdgpr = "MDGPR";
|
||||
pr = "PR";
|
||||
|
||||
@@ -95,7 +95,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
despachoStore = DespachoStore;
|
||||
eventoaprovacaostore = EventoAprovacaoStore;
|
||||
pedidosstore = PedidosStore;
|
||||
expedienteprstore = ExpedienteprStore;
|
||||
// expedienteprstore = ExpedienteprStore;
|
||||
despachoprstore = DespachosprStore;
|
||||
totalDocumentStore = TotalDocumentStore
|
||||
deplomasStore = DeplomasStore
|
||||
@@ -112,12 +112,13 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
constructor(
|
||||
private processesbackend:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
authService: AuthService,
|
||||
public p: PermissionService,
|
||||
public waitForDomService: WaitForDomService
|
||||
public waitForDomService: WaitForDomService,
|
||||
private notificationsService: NotificationsService,
|
||||
private despachoRule: DespachoService
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
@@ -144,7 +145,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
} */
|
||||
}
|
||||
|
||||
closeAllDesktopComponent(){
|
||||
closeAllDesktopComponent() {
|
||||
this.desktopComponent = {
|
||||
showEventList: false,
|
||||
showExpediente: false
|
||||
@@ -451,25 +452,19 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.showLoader = true;
|
||||
|
||||
let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
this.count_all_processes = Object.keys(allPreocesses_).length;
|
||||
let count_all_processes = Object.keys(allPreocesses_).length;
|
||||
this.totalDocumentStore.resetCount(count_all_processes)
|
||||
|
||||
let expedientes = await this.processesbackend.GetTasksList("Expediente", false).toPromise();
|
||||
let expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
||||
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.count_exp_dailywork = Object.keys(expedientes).length;
|
||||
this.expedientegbstore.count = this.count_exp_dailywork;
|
||||
this.expedientegbstore.reset(expedientes)
|
||||
this.expedientegbstore.count = expedientes.length
|
||||
|
||||
let expedientes_pr = await this.processesbackend.GetTasksList("Expediente", false).toPromise();
|
||||
expedientes_pr = expedientes_pr.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.count_exp_pr = Object.keys(expedientes_pr).length;
|
||||
this.expedienteprstore.count = this.count_exp_pr;
|
||||
this.expedienteprstore.reset(expedientes_pr)
|
||||
|
||||
let despachos = await this.processesbackend.GetTasksList("Despacho", false).toPromise();
|
||||
despachos = despachos.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.count_desp_dailywork = Object.keys(despachos).length;
|
||||
this.despachoStore.count = this.count_desp_dailywork
|
||||
this.despachoStore.reset(despachos)
|
||||
let despachos = await this.despachoRule.getList({updateStore: true})
|
||||
if(despachos) {
|
||||
this.despachoStore.reset(despachos)
|
||||
}
|
||||
|
||||
|
||||
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
|
||||
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
||||
@@ -501,6 +496,23 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
const eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||
|
||||
|
||||
|
||||
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
const eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventoaprovacaostore.countPr = eventsPRList.length
|
||||
this.eventoaprovacaostore.resetpr(eventsPRList);
|
||||
|
||||
|
||||
|
||||
let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
this.count_dip_pv = Object.keys(diplomasValidar).length;
|
||||
this.deplomasStore.resetDiplomasReview(diplomasValidar)
|
||||
@@ -518,7 +530,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.processesbackend.GetToApprovedEvents('Agenda','true').subscribe(res=>{
|
||||
this.count_ev_apr = res;
|
||||
});
|
||||
this.eventoaprovacaostore.count;
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
@@ -40,7 +40,7 @@ export class PedidoPage implements OnInit {
|
||||
caller: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
constructor(private activatedRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
import { CalendarComponent } from 'ionic2-calendar';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { customTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
|
||||
@@ -24,7 +23,7 @@ export class PendentesPage implements OnInit {
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
showLoader: boolean;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-content class="text-white">
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="wrapper" *ngIf="!hasSession && !setPin || loginPreference == 'none' && !setPin ">
|
||||
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin || SessionStore.user.LoginPreference == 'None' && SessionStore.hasPin || enterWithPassword">
|
||||
|
||||
<div class="bg-1 d-flex justify-center align-center">
|
||||
<div class="bg-2 d-flex justify-center align-center">
|
||||
@@ -33,35 +33,38 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content height-100" *ngIf="setPin || hasSession && loginPreference == 'pin' ">
|
||||
<div class=" align-center justify-center">
|
||||
<div class="div-top-header">
|
||||
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
|
||||
|
||||
<div class="div-top-header">
|
||||
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-bg.png' alt='logo'>
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-bg-removebg-preview.png' alt='logo'>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=" align-center justify-center d-flex flex-column width-100">
|
||||
<div *ngIf="SessionStore.hasPin" class="title">Digite o PIN</div>
|
||||
<div *ngIf="!SessionStore.hasPin" class="title">Digite o novo PIN</div>
|
||||
|
||||
<div class="terminal">
|
||||
<div class="d-flex pt-25 align-center justify-center pin-4">
|
||||
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 3"></div>
|
||||
<div class="dot"[class.dot-active]="code.length >= 4"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ion-title *ngIf="hasPin" class="title">Digite o PIN</ion-title>
|
||||
<ion-title *ngIf="!hasPin" class="title">Digite o novo PIN</ion-title>
|
||||
|
||||
<div class="d-flex pt-25 align-center justify-center">
|
||||
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 3"></div>
|
||||
<div class="dot"[class.dot-active]="code.length >= 4"></div>
|
||||
</div>
|
||||
<div class="terminal">
|
||||
|
||||
<div class="d-flex">
|
||||
|
||||
<div class="d-flex align-center justify-center">
|
||||
<div class="circle" (click)="setCode('1')">1</div> <div class="circle" (click)="setCode('2')">2</div> <div class="circle" (click)="setCode('3')">3</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="d-flex align-center justify-center">
|
||||
<div class="circle" (click)="setCode('4')">4</div> <div class="circle" (click)="setCode('5')">5</div> <div class="circle" (click)="setCode('6')">6</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="d-flex align-center justify-center">
|
||||
<div class="circle" (click)="setCode('7')">7</div> <div class="circle" (click)="setCode('8')">8</div> <div class="circle" (click)="setCode('9')">9</div>
|
||||
</div>
|
||||
|
||||
@@ -69,20 +72,22 @@
|
||||
<div class="circle" (click)="setCode('0')">0</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="loginPreference = 'none'">
|
||||
Entrar com senha
|
||||
</div>
|
||||
<div *ngIf="SessionStore.hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="enterWithPasswordButton()" >
|
||||
Entrar com senha
|
||||
</div>
|
||||
|
||||
<div id="clear" class="cy-clear voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
<div id="clear" class="cy-clear voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -14,22 +14,28 @@ ion-content{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
background: white !important;
|
||||
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width: 400px;
|
||||
/* width: 400px; */
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
margin: auto !important;
|
||||
/* margin: auto !important; */
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
}
|
||||
|
||||
.logo{
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
background-image: url("/assets/background/auth.svg");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
.bg-1{
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
@@ -106,14 +112,11 @@ ion-item{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.div-top-header{
|
||||
margin: 0 em(20px);
|
||||
padding-top: em(15px);
|
||||
border: 0!important;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.div-logo {
|
||||
@@ -138,28 +141,42 @@ ion-item{
|
||||
justify-content: center;
|
||||
font-size: 19pt;
|
||||
background: #44b5ea;
|
||||
border-radius: 56px;
|
||||
margin-left: 30px;
|
||||
border-radius: 56px;
|
||||
margin-bottom: 15px;
|
||||
user-select: none;
|
||||
margin-right: 15px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
.title{
|
||||
padding-top: 32px;
|
||||
z-index: 1000;
|
||||
height: unset !important;
|
||||
position: relative;
|
||||
top: -30px;
|
||||
}
|
||||
|
||||
.terminal {
|
||||
padding-top: 112px;
|
||||
margin-left: -30px;
|
||||
padding-top: 49px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-image: url(/assets/background/auth.svg);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 100%;
|
||||
padding-bottom: 48px;
|
||||
margin-bottom: -58px;
|
||||
z-index: 100;
|
||||
margin-top: -80px;
|
||||
}
|
||||
|
||||
.clear{
|
||||
color: #44b5ea;
|
||||
font-size: 12pt;
|
||||
z-index: 1000;
|
||||
}
|
||||
.dot-active{
|
||||
background: #44b5ea;
|
||||
@@ -185,12 +202,12 @@ ion-item{
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-image: url("/assets/background/auth.svg");
|
||||
background-size: 686px 674px;
|
||||
background-position: center;
|
||||
background-position-y: 110px;
|
||||
background-repeat: no-repeat;
|
||||
margin: auto;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.voltar{
|
||||
@@ -216,4 +233,10 @@ ion-item{
|
||||
padding-top: 20px;
|
||||
position: unset !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pin-4 {
|
||||
z-index: 1000;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import crypto from 'crypto-js'
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-inactivity',
|
||||
@@ -16,37 +16,35 @@ import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
})
|
||||
export class InactivityPage implements OnInit {
|
||||
|
||||
logstatus: boolean;
|
||||
username: string = environment.defaultuser;
|
||||
password: string = environment.defaultuserpwd;
|
||||
userattempt: UserForm;
|
||||
code = []
|
||||
|
||||
hasPin: boolean
|
||||
loginPreference: string
|
||||
hasSession = false
|
||||
setPin = false
|
||||
SessionStore = SessionStore
|
||||
enterWithPassword = false
|
||||
|
||||
constructor(
|
||||
private notificatinsservice: NotificationsService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
public alertController: AlertController,
|
||||
private localstoreService: LocalstoreService
|
||||
) {
|
||||
public alertController: AlertController
|
||||
) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
async presentAlert(message: string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Mensagem do sistema',
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// clear local storage
|
||||
window.localStorage.clear();
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
|
||||
const loginPreference = userData?.loginPreference
|
||||
const pin = userData?.PIN
|
||||
|
||||
}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateUsername() {
|
||||
@@ -61,42 +59,10 @@ export class InactivityPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
async presentAlert(message: string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Mensagem do sistema',
|
||||
message: message,
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
/* loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": this.username,
|
||||
"password": this.password,
|
||||
}
|
||||
|
||||
this.authService.loginChat(postData).subscribe((res: any) => {
|
||||
console.log(res.data);
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
}, (error: any) => {
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error ' + error);
|
||||
});
|
||||
} */
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
async Login() {
|
||||
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()){
|
||||
if(this.validatePassword()) {
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
@@ -104,19 +70,23 @@ export class InactivityPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt)
|
||||
let attempt = await this.authService.login(this.userattempt, false)
|
||||
|
||||
if (attempt) {
|
||||
this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
this.hasSession = true
|
||||
this.hasPin = false
|
||||
this.setPin = true
|
||||
|
||||
if(!this.hasPin || this.hasPin) {
|
||||
|
||||
// if current attemp is equal to the current user
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
|
||||
this.goback()
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
SessionStore.delete()
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
}
|
||||
|
||||
this.enterWithPassword = false
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -128,6 +98,10 @@ export class InactivityPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
setCode(code: string) {
|
||||
|
||||
if(this.code.length < 4) {
|
||||
@@ -136,10 +110,7 @@ export class InactivityPage implements OnInit {
|
||||
|
||||
if(this.code.length == 4) {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
if(!this.hasPin) {
|
||||
if(!SessionStore.hasPin) {
|
||||
// console.log('storePin')
|
||||
this.storePin()
|
||||
} else {
|
||||
@@ -156,17 +127,11 @@ export class InactivityPage implements OnInit {
|
||||
pinLogin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
const pin = userData?.PIN
|
||||
if( SessionStore.validatePin(code)) {
|
||||
|
||||
//if( encrypted == pin) {
|
||||
|
||||
if( encrypted == this.localstoreService.get('UserData', false)) {
|
||||
|
||||
//this.toastService.successMessage()
|
||||
this.router.navigate(['/home/events']);
|
||||
this.goback()
|
||||
this.clearCode()
|
||||
} else {
|
||||
this.toastService.badRequest('Pin incorreto')
|
||||
this.code = []
|
||||
@@ -174,21 +139,23 @@ export class InactivityPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
goback() {
|
||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||
this.router.navigate([pathName]);
|
||||
}
|
||||
|
||||
storePin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code).toString()
|
||||
let userData: Object = this.localstoreService.get('UserData', {})
|
||||
|
||||
userData['PIN'] = encrypted
|
||||
userData['loginPreference'] = 'none'
|
||||
|
||||
this.localstoreService.set('UserData', userData)
|
||||
|
||||
this.localstoreService.set('PIN', encrypted)
|
||||
SessionStore.setPin(code)
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
|
||||
}
|
||||
|
||||
enterWithPasswordButton() {
|
||||
this.enterWithPassword = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-content class="text-white">
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="wrapper" *ngIf="!hasSession && !setPin || loginPreference == 'none' && !setPin ">
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="bg-1 d-flex justify-center align-center">
|
||||
<div class="bg-2 d-flex justify-center align-center">
|
||||
@@ -33,56 +33,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="main-content height-100" *ngIf="setPin || hasSession && loginPreference == 'pin' ">
|
||||
<div class=" align-center justify-center">
|
||||
<div class="div-top-header">
|
||||
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-bg.png' alt='logo'>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ion-title *ngIf="hasPin" class="title">Digite o PIN</ion-title>
|
||||
<ion-title *ngIf="!hasPin" class="title">Digite o novo PIN</ion-title>
|
||||
|
||||
<div class="d-flex pt-25 align-center justify-center">
|
||||
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 3"></div>
|
||||
<div class="dot"[class.dot-active]="code.length >= 4"></div>
|
||||
</div>
|
||||
<div class="terminal">
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="circle" (click)="setCode('1')">1</div> <div class="circle" (click)="setCode('2')">2</div> <div class="circle" (click)="setCode('3')">3</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="circle" (click)="setCode('4')">4</div> <div class="circle" (click)="setCode('5')">5</div> <div class="circle" (click)="setCode('6')">6</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="circle" (click)="setCode('7')">7</div> <div class="circle" (click)="setCode('8')">8</div> <div class="circle" (click)="setCode('9')">9</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-center justify-center">
|
||||
<div class="circle" (click)="setCode('0')">0</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="loginPreference = 'none'">
|
||||
Entrar com senha
|
||||
</div>
|
||||
|
||||
<div id="clear" class="cy-clear voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import crypto from 'crypto-js'
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -24,8 +25,8 @@ export class LoginPage implements OnInit {
|
||||
|
||||
hasPin: boolean
|
||||
loginPreference: string
|
||||
hasSession = false
|
||||
setPin = false
|
||||
|
||||
sessionStore = SessionStore
|
||||
|
||||
constructor(
|
||||
private notificatinsservice: NotificationsService,
|
||||
@@ -38,20 +39,11 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// clear local storage
|
||||
window.localStorage.clear();
|
||||
|
||||
// App has session
|
||||
if(!this.localstoreService.get('UserData', false)) {
|
||||
this.hasSession = false
|
||||
} else {
|
||||
this.hasSession = true
|
||||
// this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
let userData = this.sessionStore.user
|
||||
|
||||
const loginPreference = userData?.loginPreference
|
||||
const loginPreference = userData?.LoginPreference
|
||||
const pin = userData?.PIN
|
||||
|
||||
if (pin) {
|
||||
@@ -92,26 +84,8 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
/* loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": this.username,
|
||||
"password": this.password,
|
||||
}
|
||||
|
||||
this.authService.loginChat(postData).subscribe((res: any) => {
|
||||
console.log(res.data);
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
}, (error: any) => {
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error ' + error);
|
||||
});
|
||||
} */
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
//console.log('HERE');
|
||||
}
|
||||
|
||||
async Login() {
|
||||
@@ -128,20 +102,11 @@ export class LoginPage implements OnInit {
|
||||
let attempt = await this.authService.login(this.userattempt)
|
||||
|
||||
if (attempt) {
|
||||
this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
this.hasSession = true
|
||||
this.hasPin = false
|
||||
this.setPin = true
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
|
||||
this.router.navigate(['/pin']);
|
||||
|
||||
// if(!this.hasPin || this.hasPin) {
|
||||
// } else {
|
||||
// this.router.navigate(['/home/events']);
|
||||
// }
|
||||
|
||||
this.code = ['1','1','1','1']
|
||||
this.storePin()
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -153,67 +118,4 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
setCode(code: string) {
|
||||
|
||||
if(this.code.length < 4) {
|
||||
this.code.push(code)
|
||||
}
|
||||
|
||||
if(this.code.length == 4) {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
if(!this.hasPin) {
|
||||
// console.log('storePin')
|
||||
this.storePin()
|
||||
} else {
|
||||
// console.log('pinLogin')
|
||||
this.pinLogin()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearCode() {
|
||||
this.code =[]
|
||||
}
|
||||
|
||||
pinLogin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
const pin = userData?.PIN
|
||||
|
||||
//if( encrypted == pin) {
|
||||
|
||||
if( encrypted == this.localstoreService.get('UserData', false)) {
|
||||
|
||||
//this.toastService.successMessage()
|
||||
this.router.navigate(['/home/events']);
|
||||
} else {
|
||||
this.toastService.badRequest('Pin incorreto')
|
||||
this.code = []
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
storePin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
let userData: Object = this.localstoreService.get('UserData', {})
|
||||
|
||||
userData['PIN'] = encrypted
|
||||
userData['loginPreference'] = 'none'
|
||||
|
||||
|
||||
this.localstoreService.set('UserData', userData)
|
||||
this.localstoreService.set('PIN', encrypted)
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -23,8 +24,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private navParams:NavParams,
|
||||
private publications:PublicationsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
private toastService: ToastService,
|
||||
private location: Location ) {
|
||||
|
||||
alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
||||
|
||||
@@ -56,7 +57,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
getPublicationDetail(){
|
||||
getPublicationDetail() {
|
||||
this.showLoader = true;
|
||||
console.log(this.publicationId);
|
||||
/* console.log(this.folderId); */
|
||||
@@ -78,17 +79,21 @@ export class PublicationDetailPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
close() {
|
||||
this.location.back()
|
||||
|
||||
}
|
||||
|
||||
async deletePost(){
|
||||
async deletePost() {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
|
||||
this.toastService.successMessage('Publicação eliminado')
|
||||
if(window['app-view-publications-page-doRefresh']) {
|
||||
window['app-view-publications-page-doRefresh']()
|
||||
}
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Publicação não eliminado')
|
||||
|
||||
@@ -47,6 +47,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
console.log(params["params"]);
|
||||
}
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,7 +74,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublications();
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
doRefresh =(event) => {
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
|
||||
@@ -562,7 +562,8 @@ export class SearchPage implements OnInit {
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: Id,
|
||||
isModal: true
|
||||
isModal: true,
|
||||
header: false
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user