This commit is contained in:
tiago.kayaya
2021-08-30 09:06:21 +01:00
154 changed files with 1370 additions and 1456 deletions
@@ -4,7 +4,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 { DeplomasStore } from '../store/deplomas.service';
@@ -18,22 +17,22 @@ export class DocumentCounterService {
despachoStore = DespachoStore;
eventoAprovacaoStore = EventoAprovacaoStore;
pedidosStore = PedidosStore;
expedientePrStore = ExpedienteprStore;
// expedientePrStore = ExpedienteprStore;
despachoPrStore = DespachosprStore;
deplomasStore = DeplomasStore
constructor() { }
// falta a contagem dos deplomas
get mdTotalDocument() {
return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasListCount
get mdTotalDocument(): number {
return this.despachoStore.count + /** this.expedientePrStore.count + */ this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedienteGbStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
}
get prTotalDocument() {
return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasListCount
get prTotalDocument(): number {
return this.despachoStore.count + /** this.expedientePrStore.count + */ this.pedidosStore.countdeferimento
+ this.pedidosStore.countparecer + this.expedienteGbStore.count + this.despachoPrStore.count + this.pendentesStore.count
+ this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
}
}
+3 -3
View File
@@ -1,12 +1,12 @@
import { Injectable } from '@angular/core';
import { UserStore } from 'src/app/store/user.service'
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
})
export class PermissionService {
userStore = UserStore
SessionStore = SessionStore
constructor() { }
@@ -16,7 +16,7 @@ export class PermissionService {
args = [args]
}
return args.includes(this.userStore.user.Profile)
return args.includes(this.SessionStore.user.Profile)
}
role(args: any) {
+8
View File
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { CustomTaskPipe } from '../pipes/custom-task.pipe';
import { ProcessesService } from '../services/processes.service';
@Injectable({
@@ -20,6 +21,8 @@ export class DeplomaService {
]
}
customTaskPipe = new CustomTaskPipe()
constructor(
private processes: ProcessesService,
) { }
@@ -83,4 +86,9 @@ export class DeplomaService {
return this.processes.CompleteTask(body)
}
async getList() {
}
}
+57 -4
View File
@@ -1,8 +1,11 @@
import { Injectable } from '@angular/core';
import { customTask, fullTask } from '../models/dailyworktask.model';
import { AttachmentList } from '../models/Excludetask';
import { PermissionService } from '../OtherService/permission.service';
import { CustomTaskPipe } from '../pipes/custom-task.pipe';
import { ProcessesService } from '../services/processes.service';
import { DespachoStore } from '../store/despacho-store.service';
import { LoaderService } from 'src/app/store/loader.service'
@Injectable({
providedIn: 'root'
})
@@ -20,10 +23,14 @@ export class DespachoService {
'Tarefa do Despacho': 'Tarefa de Despacho' | 'Concluir' | 'rexecucao'
}
constructor(
customTaskPipe = new CustomTaskPipe()
despachoStore = DespachoStore;
constructor(
private processes: ProcessesService,
public p: PermissionService
) { }
public p: PermissionService,
public LoaderService: LoaderService
) { }
arquivar(note:string, documents:AttachmentList, serialnumber) {
@@ -181,4 +188,50 @@ export class DespachoService {
return this.processes.CompleteTask(body)
}
async getList({updateStore = false}): Promise<customTask[]> {
if (this.LoaderService.loading) {
return this.despachoStore.list
}
this.LoaderService.push({})
let result: fullTask[] = []
try {
result = await this.processes.GetTasksList("Despacho", false).toPromise();
} catch (error) {
} finally {
this.LoaderService.pop({})
}
result = result.filter(data => data.workflowInstanceDataFields.Status == "Active")
let despachoList: customTask[] = new Array();
result.forEach((element, index) => {
let task: customTask = this.customTaskPipe.transform(element);
despachoList.push(task);
});
despachoList = this.sortArrayISODate(despachoList).reverse();
if(updateStore) {
this.despachoStore.reset(despachoList);
}
return despachoList
}
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
}
+33 -2
View File
@@ -1,9 +1,40 @@
import { Injectable } from '@angular/core';
import { ProcessesService } from '../services/processes.service';
import { ProcessDocumentService } from './process-document.service';
@Injectable({
providedIn: 'root'
})
export class ExpedienteService {
constructor() { }
constructor(
private processes: ProcessesService,
private processDocumentService: ProcessDocumentService,
) { }
discard({SerialNumber, Note =''}) {
let otherbody = {
"serialNumber": SerialNumber,
"action": "Passivo",
"ActionTypeId": 99999877,
"dataFields": {
"Note": Note,
}
}
return this.processes.CompleteTask(otherbody)
}
viewDocument({DocId, ApplicationId}) {
this.processDocumentService.viewDocument({DocId, ApplicationId})
}
CompleteTask({body}) {
return this.processes.CompleteTask(body)
}
UpdateTaskStatus({FolderId}){
return this.processes.UpdateTaskStatus(FolderId)
}
}
-30
View File
@@ -1,30 +0,0 @@
import { Injectable } from '@angular/core';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ProcessesService } from '../services/processes.service';
import { ProcessDocumentService } from './process-document.service';
@Injectable({
providedIn: 'root'
})
export class ExpedientesService {
constructor(
private iab: InAppBrowser,
private processDocumentService: ProcessDocumentService,
private processes: ProcessesService,
) { }
viewDocument({DocId, ApplicationId}) {
this.processDocumentService.viewDocument({DocId, ApplicationId})
}
CompleteTask({body}) {
return this.processes.CompleteTask(body)
}
UpdateTaskStatus({FolderId}){
return this.processes.UpdateTaskStatus(FolderId)
}
}
@@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { UserService } from './user.service';
import { TaskService } from './task.service';
describe('UserService', () => {
let service: UserService;
describe('TaskService', () => {
let service: TaskService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(UserService);
service = TestBed.inject(TaskService);
});
it('should be created', () => {
+15
View File
@@ -0,0 +1,15 @@
import { Injectable } from '@angular/core';
import { ProcessesService } from '../services/processes.service';
@Injectable({
providedIn: 'root'
})
export class TaskService {
constructor(
private processes: ProcessesService,
) { }
}
+5
View File
@@ -54,6 +54,9 @@ import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { PdfViewerModule } from 'ng2-pdf-viewer';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
@@ -84,6 +87,8 @@ import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
MatSelectModule,
MatDialogModule,
//
PdfViewerModule
],
providers: [
{ provide: MAT_DATE_LOCALE, useValue: 'pt' },
+2 -1
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { LocalstoreService } from '../store/localstore.service';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -16,7 +17,7 @@ export class AuthGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if(window.location.pathname != '' && !this.localstoreService.get('UserData', false)) {
if(window.location.pathname != '' && !SessionStore.exist) {
this.router.navigate(['/']);
return false
} else {
+16
View File
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { InactivityGuard } from './inactivity.guard';
describe('InactivityGuard', () => {
let guard: InactivityGuard;
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(InactivityGuard);
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});
+33
View File
@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
})
export class InactivityGuard implements CanActivate {
constructor(
private router:Router
){}
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin) {
// alert('stay set pin')
return true
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
// alert('stay conform')
return true
} else {
this.router.navigate(['/home/events']);
return false
}
}
}
+2 -1
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { LocalstoreService } from '../store/localstore.service';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -15,7 +16,7 @@ export class LoginGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if(window.location.pathname == '/' && this.localstoreService.get('UserData', null) != null ) {
if(window.location.pathname == '/' && SessionStore.exist ) {
this.router.navigate(['/home/events']);
return false
} else {
+22 -11
View File
@@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '../guards/auth.guard';
import { InactivityGuard } from '../guards/inactivity.guard';
import { UserDataResolver } from '../resolvers/userData.resolver';
import { HomePage } from './home.page';
@@ -368,20 +369,30 @@ const routes: Routes = [
],
},
{
path: 'inactivity',
children: [
{
path:'',
loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule)
},
],
},
],
canActivate: [AuthGuard]
},
{
path: 'inactivity',
children: [
{
path:'',
loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule)
},
],
canActivate: [InactivityGuard]
},
{
path: 'pin',
children: [
{
path:'',
loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule)
},
],
canActivate: [InactivityGuard]
}
},
];
@NgModule({
+5 -5
View File
@@ -3,25 +3,25 @@
<ion-tab-button tab="events">
<!-- <ion-icon name="home"></ion-icon> -->
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
<ion-badge color="danger">{{toDayEventStorage.eventsList.length}}</ion-badge>
<ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge>
<ion-label>Início</ion-label>
</ion-tab-button>
<ion-tab-button tab="agenda">
<!-- <ion-icon name="calendar"></ion-icon> -->
<ion-icon class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
<ion-label class="overflow-visible">Agenda</ion-label>
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
</ion-tab-button>
<ion-tab-button tab="gabinete-digital">
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
<ion-badge color="danger" *ngIf="p.userRole(['MDGPR'])" >{{ totalDocumentStore.count }}</ion-badge>
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ totalDocumentStore.count }}</ion-badge>
<ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge>
<ion-label>Gabinete</ion-label>
</ion-tab-button>
<ion-tab-button tab="publications">
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-label class="overflow-visible">Ações</ion-label>
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
</ion-tab-button>
<ion-tab-button tab="chat">
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
+47 -15
View File
@@ -2,18 +2,22 @@
/* tslint:disable */
///<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
///<reference path="../../../plugins/cordova-plugin-mfp-push/typings/mfppush.d.ts" />
import { Component, OnInit, NgZone, Inject } from '@angular/core';
import { EventsService } from '../services/events.service';
import { Component, OnInit, NgZone } from '@angular/core';
import { Event } from '../models/event.model';
import { ProcessesService } from '../services/processes.service';
import { NotificationsService } from '../services/notifications.service';
import { WebNotificationsService } from '../services/webnotifications.service';
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
import { Router, ActivatedRoute } from '@angular/router';
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
import { DocumentCounterService } from 'src/app/OtherService/document-counter.service'
import { PermissionService } from '../OtherService/permission.service';
import { TotalDocumentService, TotalDocumentStore } from '../store/total-document.service';
// import { NetworkService } from '../services/network.service';
import { TotalDocumentStore } from '../store/total-document.service';
import { connection } from '../services/socket/synchro.service';
import { DespachoService } from '../Rules/despacho.service';
import { ExpedienteGdStore } from '../store/expedientegd-store.service';
import { InativityService } from '../services/inativity.service';
import { SessionStore } from '../store/session.service';
// import * as Sentry from "@sentry/browser";
@@ -45,6 +49,7 @@ export class HomePage implements OnInit {
toDayEventStorage = ToDayEventStorage
totalDocumentStore = TotalDocumentStore
expedienteGdStore = ExpedienteGdStore
adding: "intervenient" | "CC" = "intervenient";
mobileComponent = {
@@ -67,20 +72,37 @@ export class HomePage implements OnInit {
postEvent: any;
folderId: string;
constructor(private zone: NgZone,
connection = connection
constructor(
private zone: NgZone,
private router: Router,
public modalCtrl: AlertController,
private notificatinsservice: NotificationsService,
private notificationsService: NotificationsService,
private platform: Platform,
private activeroute: ActivatedRoute,
private webnotification: WebNotificationsService,
public p: PermissionService,
public documentCounterService: DocumentCounterService,
// private network: NetworkService,
public p: PermissionService) {
private despachoRule: DespachoService,
private inativityService: InativityService) {
this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
});
this.updateList()
window['inactivity/function'] = () => {
if(window.location.pathname != '/inactivity') {
const pathname = window.location.pathname
SessionStore.setUrlBeforeInactivity(pathname)
this.router.navigate(['/inactivity']);
}
}
// if (typeof Worker !== 'undefined') {
// // Create a new
@@ -94,10 +116,11 @@ export class HomePage implements OnInit {
// // You should add a fallback so that your program still executes correctly.
// }
{
//this.folderId = this.navParams.get('folderId');
}
}
refreshing() {
}
ngOnInit() {
@@ -105,11 +128,12 @@ export class HomePage implements OnInit {
this.network.checkNetworkDisconnection; */
console.log('Active route ', this.router.url)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
this.webnotification.webconnection();
this.webnotification.onReceviNotificationWeb();
} else {
this.mobilefirstConnect();
this.notificatinsservice.getAndpostToken2();
this.notificatinsservice.onReceviNotification();
this.notificationsService.getAndpostToken2();
this.notificationsService.onReceviNotification();
}
}
@@ -149,8 +173,16 @@ export class HomePage implements OnInit {
});
}
}
}
updateList() {
this.notificationsService.registerCallback(
'despachos',
() => {
this.despachoRule.getList({updateStore: true})
}
)
}
@@ -10,7 +10,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { SearchList } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { User } from 'src/app/models/user.model';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms';
@@ -80,7 +80,7 @@ export class CreateProcessPage implements OnInit {
documents:SearchList[] = [];
loggeduser: User;
loggeduser: LoginUserRespose;
toppings = new FormControl();
@@ -282,10 +282,13 @@ export class CreateProcessPage implements OnInit {
try {
await this.processes.postDespatcho(this.postData).toPromise();
await this.FinalizarDespacho(loader, 'Despacho criado');
await this.despachoService.EfectuarDespacho({serialnumber: this.task.serialNumber}).toPromise();
this.modalController.dismiss();
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
} finally {
loader.remove()
}
@@ -505,7 +508,7 @@ export class CreateProcessPage implements OnInit {
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
},
cssClass: 'modal attendee',
cssClass: 'modal attendee modal-desktop',
backdropDismiss: false
});
+1 -1
View File
@@ -129,7 +129,7 @@ export class DelegarPage implements OnInit {
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
},
cssClass: 'modal attendee',
cssClass: 'modal attendee modal-desktop',
backdropDismiss: false
});
@@ -5,7 +5,7 @@ import { Event } from 'src/app/models/event.model'
import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocumentDetails, SearchFolderDetails, SearchFolderDetailsDocuments, 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';
@@ -82,7 +82,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
formLocationSatus: boolean = false;
showAttendees= false;
loggeduser: User;
loggeduser: LoginUserRespose;
emptyTextDescription = "Sem intervenientes selecionados";
document: SearchFolderDetails | SearchDocumentDetails | any;
+1 -1
View File
@@ -167,7 +167,7 @@ export class ForwardPage implements OnInit {
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
},
cssClass: 'modal attendee',
cssClass: 'modal attendee modal-desktop',
backdropDismiss: false
});
@@ -28,7 +28,7 @@
</div>
<div class="profile-info">
<div class="user-role">{{loggeduser.RoleDescription}}</div>
<div class="user-role">{{SessionStore.user.RoleDescription}}</div>
<div class="container-div width-100">
<div class="ion-item-class-2">
@@ -36,7 +36,7 @@
<ion-icon slot="start" name="person"></ion-icon>
</div>
<div class="ion-input-class">
<ion-input disabled placeholder="Nome" [(ngModel)]="loggeduser.FullName"></ion-input>
<ion-input disabled placeholder="Nome" [(ngModel)]="SessionStore.user.FullName"></ion-input>
</div>
</div>
</div>
@@ -47,19 +47,19 @@
<ion-icon slot="start" name="mail"></ion-icon>
</div>
<div class="ion-input-class">
<ion-input disabled placeholder="Email" [(ngModel)]="loggeduser.Email"></ion-input>
<ion-input disabled placeholder="Email" [(ngModel)]="SessionStore.user.Email"></ion-input>
</div>
</div>
</div>
</div>
<div hidden class="login-preference width-100" (mouseover)="checkState()" (click)="checkState()">
<div class="login-preference width-100" >
<div class="preference">Preferência Login</div>
<ion-row>
<ion-col class="align-center d-flex">
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
<div class="d-flex align-center" (click)="LoginPreferenceMethod('Pin')">
<ion-checkbox [checked]="SessionStore.user.LoginPreference=='Pin' " class="checkBox" ></ion-checkbox>
PIN
</div>
@@ -1,11 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
import { PinPage } from 'src/app/shared/pin/pin.page';
import { LocalstoreService } from 'src/app/store/localstore.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-edit-profile',
@@ -14,22 +11,11 @@ import { LocalstoreService } from 'src/app/store/localstore.service';
})
export class EditProfilePage implements OnInit {
loggeduser: User;
userLoginPreference = ''
SessionStore = SessionStore
constructor(private modalController:ModalController,
private authService: AuthService,
private animationController: AnimationController,
private router: Router,
private localstoreService: LocalstoreService
) {
this.loggeduser = authService.ValidatedUser;
console.log(this.loggeduser.RoleDescription)
this.checkState()
}
private animationController: AnimationController
) {}
ngOnInit() {}
@@ -74,7 +60,6 @@ export class EditProfilePage implements OnInit {
modal.present();
}
async addFingerprint() {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
@@ -112,47 +97,14 @@ export class EditProfilePage implements OnInit {
modal.present();
}
logout() {
// clear local storage
window.localStorage.clear();
LoginPreferenceMethod(type: 'None' | 'Password' | 'Pin' | null) {
setTimeout(()=>{
window.location.pathname = '/'
location.reload();
}, 1000)
}
LoginPreferenceMethod(type: string) {
let userData = this.localstoreService.get('UserData', {})
if (userData.hasOwnProperty('loginPreference')) {
if (userData.loginPreference != type) {
if (type) {
userData.loginPreference = type
}
} else {
userData.loginPreference = 'none'
if (this.SessionStore.user.LoginPreference != type) {
if (type) {
this.SessionStore.setLoginPreference(type)
}
} else {
userData.loginPreference = 'none'
}
this.localstoreService.set('UserData', userData)
}
checkState() {
let userData = this.localstoreService.get('UserData', {})
if (userData.hasOwnProperty('loginPreference')) {
this.userLoginPreference = userData.loginPreference
} else {
this.userLoginPreference = ''
this.SessionStore.setLoginPreference('None')
}
}
+41 -34
View File
@@ -1,5 +1,4 @@
<ion-content class=" bg-blue">
<ion-header class=" bg-blue ion-no-border">
<div class="profile-header width-100">
<div class="div-logo d-md-none">
<div class="logo height-fit-content">
@@ -10,9 +9,10 @@
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
</ion-header>
<ion-header class=" bg-blue ion-no-border">
<div class="profile-content">
<div class="profile-title d-flex justify-content-center width-100">
<ion-label >{{loggeduser.RoleDescription}}</ion-label>
</div>
@@ -28,39 +28,46 @@
</ion-buttons>
</div>
<div class="line"></div>
</div>
<div class="notifications-content">
<ion-label>{{notificationdata.length}} novas notificações</ion-label>
<ion-list>
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
*ngFor = "let item of notificationdata; let i = index"
(click)="notificatinsRoutes(item.index,item.Service,item.Object,item.IdObject,item.FolderId)"
>
<div class="item-conten-{{item.Service}}-{{item.TypeAgenda}}-{{item.Role}}">
<div class="notification-item">
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-accoes-active.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'chat'" src="assets/images/icons-nav-agenda-active.svg" >
</div>
</ion-header>
<ion-content class=" bg-blue">
<div class="d-flex flex-column height-100 overflow-auto-y">
<div class="notifications-content">
<ion-list>
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
*ngFor = "let item of notificationdata; let i = index"
(click)="notificatinsRoutes(item.index,item.Service,item.Object,item.IdObject,item.FolderId)"
>
<div class="item-conten-{{item.Service}}-{{item.TypeAgenda}}-{{item.Role}}">
<div class="notification-item">
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-accoes-active.svg" >
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'chat'" src="assets/images/icons-nav-agenda-active.svg" >
</div>
<div class="approve-event-time">
<p *ngIf = "item.Service == 'agenda'">{{item.dateInit}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateEnd}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf = "item.Service == 'agenda'">{{item.Location}}</p>
<h3 id="profile-title">{{item.alert}}</h3>
<p *ngIf = "item.Service != 'agenda'">{{item.desc}}</p>
</div>
<!-- <div class="notification-label-MD-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000011'" ></div>
<div class="notification-label-MD-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000011'" ></div>
<div class="notification-label-PR-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000014'" ></div>
<div class="notification-label-PR-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000014'" ></div> -->
</div>
<div class="approve-event-time">
<p *ngIf = "item.Service == 'agenda'">{{item.dateInit}}</p>
<p *ngIf = "item.Service == 'agenda'">{{item.dateEnd}}</p>
</div>
<div class="approve-event-detail">
<p *ngIf = "item.Service == 'agenda'">{{item.Location}}</p>
<h3 id="profile-title">{{item.alert}}</h3>
<p *ngIf = "item.Service != 'agenda'">{{item.desc}}</p>
</div>
<!-- <div class="notification-label-MD-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000011'" ></div>
<div class="notification-label-MD-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000011'" ></div>
<div class="notification-label-PR-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000014'" ></div>
<div class="notification-label-PR-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000014'" ></div> -->
</div>
</div>
</ion-list>
</ion-list>
</div>
</div>
</ion-content>
-2
View File
@@ -3,7 +3,6 @@
// background-color: #0782c9;
padding: 20px 20px;
border: 0!important;
overflow: auto;
.div-logo{
background: transparent;
@@ -67,7 +66,6 @@ ion-list{
.notifications-content{
padding: 0px 20px;
.item{
display: flex;
border-radius: 15px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
border: solid 1px #e9e9e9;
+2 -2
View File
@@ -3,7 +3,7 @@
import { Component, OnInit, NgZone } from '@angular/core';
import { Router, NavigationExtras } from '@angular/router';
import { AnimationController, ModalController,Platform } from '@ionic/angular';
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 { LocalstoreService } from 'src/app/store/localstore.service';
import { EditProfilePage } from './edit-profile/edit-profile.page';
@@ -18,7 +18,7 @@ import { NotificationsService } from '../../services/notifications.service';
})
export class ProfilePage implements OnInit {
loggeduser: User;
loggeduser: LoginUserRespose;
userLoginPreference = ''
notificationdata: any[] = [];
DataArray: Array<Object> = [];
+16
View File
@@ -0,0 +1,16 @@
export interface ExpedienteFullTaskWorkflowInstanceDataFields {
FolderID: number;
Sender: string;
Subject: string;
Status: string;
}
export interface ExpedienteFullTask {
serialNumber: string;
taskStartDate: string;
workflowDisplayName: string;
activityInstanceName: string;
totalDocuments: number;
workflowInstanceDataFields: ExpedienteFullTaskWorkflowInstanceDataFields;
}
+12
View File
@@ -0,0 +1,12 @@
export let GetTasksListType:
"" |
"Pedido de Parecer" |
"Pedido de Parecer do Presidente" |
"Pedido de Deferimento" |
"Despacho do Presidente da República" |
"Agenda Oficial MDGPR" |
"Agenda Pessoal MDGPR" |
"Agenda Pessoal PR" |
"Agenda Oficial PR" |
"image/x-icon" |
"Despacho"
+14
View File
@@ -113,4 +113,18 @@ export interface expedienteTask {
DispatchNumber: any
AttachmentsProcessLastInstanceID: any
InstanceID: any
}
export interface ExpedienteTask {
SerialNumber: string
Senders : string
CreateDate : string
DocumentsQty : number
WorkflowName : string
activityInstanceName : string
Status : string
taskStartDate: string
Subject: string
}
+2
View File
@@ -1,3 +1,4 @@
import { Attachment } from './attachment.model';
import { EventBody } from './eventbody.model';
import { EventPerson } from './eventperson.model';
@@ -31,6 +32,7 @@ export class Event{
HasAttachments: boolean;
EventRecurrence: EventRecurrence;
Name?: string
Attachments?: Attachment[];
/* public Event(){
this.EventRecurrence = new EventRecurrence();
+32 -1
View File
@@ -6,7 +6,7 @@ export class UserForm {
}
export class User {
export class LoginUserRespose {
BasicAuthKey: string;
UserId: number;
Authorization: string;
@@ -30,4 +30,35 @@ export class User {
}[]
UserName: string
Profile: any;
}
export class UserSession {
BasicAuthKey: string;
UserId: number;
Authorization: string;
Email: string
FullName: string
OwnerCalendars: {
CalendarId: string
CalendarName: "Oficial" | "Pessoal";
CalendarRoleId: string;
Id: number;
}[]
RoleDescription: string
RoleID: number
SharedCalendars: {
CalendarId: string
CalendarName: "Oficial" | "Pessoal";
CalendarRoleId: string;
Id: number;
OwnerUserId: string;
TypeShare: number;
}[]
UserName: string
Profile: any;
LoginPreference: 'None' | 'Password' | 'Pin' | null;
PIN: string
Inactivity: boolean
UrlBeforeInactivity: string
}
+2 -2
View File
@@ -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;
}
+1
View File
@@ -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
});
+3
View File
@@ -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]
+12 -5
View File
@@ -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>
+14 -19
View File
@@ -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>
@@ -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(
@@ -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;
@@ -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;
+33 -28
View File
@@ -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>
+36 -13
View File
@@ -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;
}
+50 -83
View File
@@ -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 -51
View File
@@ -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>
+9 -107
View File
@@ -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();
+2 -1
View File
@@ -562,7 +562,8 @@ export class SearchPage implements OnInit {
component: ViewEventPage,
componentProps:{
eventId: Id,
isModal: true
isModal: true,
header: false
},
cssClass: 'modal modal-desktop',
});
@@ -0,0 +1,8 @@
import { ExpedienteTaskPipe } from './expediente-task.pipe';
describe('ExpedienteTaskPipe', () => {
it('create an instance', () => {
const pipe = new ExpedienteTaskPipe();
expect(pipe).toBeTruthy();
});
});
+28
View File
@@ -0,0 +1,28 @@
import { Pipe, PipeTransform } from '@angular/core';
import { ExpedienteTask } from '../models/dailyworktask.model';
import { ExpedienteFullTask } from '../models/Expediente';
@Pipe({
name: 'expedienteTask'
})
export class ExpedienteTaskPipe implements PipeTransform {
transform(fullTask: ExpedienteFullTask): ExpedienteTask {
let date = new Date(fullTask.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
return {
"SerialNumber": fullTask.serialNumber,
"taskStartDate": fullTask.taskStartDate,
"Subject": fullTask.workflowInstanceDataFields.Subject,
"Senders": fullTask.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentsQty": fullTask.totalDocuments,
"WorkflowName": fullTask.workflowDisplayName,
"activityInstanceName": fullTask.activityInstanceName,
"Status": fullTask.workflowInstanceDataFields.Status,
}
}
}
+2 -1
View File
@@ -4,10 +4,11 @@ import { SearchDocumentPipe } from './search-document.pipe';
import { CustomTaskPipe } from './custom-task.pipe';
import { EventPipe } from './event.pipe';
import { PublicationPipe } from './publication.pipe';
import { ExpedienteTaskPipe } from './expediente-task.pipe';
@NgModule({
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe],
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe, ExpedienteTaskPipe],
exports: [FilterPipe],
imports: []
})
@@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { SenderService } from './sender.service';
import { AESEncrypt } from './aesencrypt.service';
describe('SenderService', () => {
let service: SenderService;
describe('AuthService', () => {
let service: AESEncrypt;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SenderService);
service = TestBed.inject(AESEncrypt);
});
it('should be created', () => {
+60
View File
@@ -0,0 +1,60 @@
import { Injectable } from '@angular/core';
import CryptoJS from 'crypto-js';
@Injectable({
providedIn: 'root'
})
export class AESEncrypt {
ivArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
constructor() { }
encrypt(encryptData, pass) {
var text = "Pro-it te espera!!!!";
//Creating the Vector Key
var iv = CryptoJS.enc.Hex.parse(this.toHexString(this.ivArray));
//Encoding the Password in from UTF8 to byte array
var Pass = CryptoJS.enc.Utf8.parse(pass);
//Encoding the Salt in from UTF8 to byte array
var Salt = CryptoJS.enc.Utf8.parse("gabinetedigital");
//Creating the key in PBKDF2 format to be used during the decryption
var key128Bits1000Iterations = CryptoJS.PBKDF2(Pass.toString(CryptoJS.enc.Utf8), Salt, { keySize: 128 / 32, iterations: 1000 });
//Decrypting the string contained in cipherParams using the PBKDF2 key
var decrypted = CryptoJS.AES.encrypt(encryptData, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 });
console.log('AES encrypt',decrypted.toString());
return decrypted.toString();
}
decrypt(deceyptData,pass) {
//Creating the Vector Key
var iv = CryptoJS.enc.Hex.parse(this.toHexString(this.ivArray));
//Encoding the Password in from UTF8 to byte array
var Pass = CryptoJS.enc.Utf8.parse(pass);
//Encoding the Salt in from UTF8 to byte array
var Salt = CryptoJS.enc.Utf8.parse("gabinetedigital");
//Creating the key in PBKDF2 format to be used during the decryption
var key128Bits1000Iterations = CryptoJS.PBKDF2(Pass.toString(CryptoJS.enc.Utf8), Salt, { keySize: 128 / 32, iterations: 1000 });
//Enclosing the test to be decrypted in a CipherParams object as supported by the CryptoJS libarary
var cipherParams = CryptoJS.lib.CipherParams.create({
ciphertext: CryptoJS.enc.Base64.parse(deceyptData)
})
//Decrypting the string contained in cipherParams using the PBKDF2 key
var decrypted = CryptoJS.AES.decrypt(cipherParams, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 });
console.log('AES decrypt',decrypted.toString(CryptoJS.enc.Utf8));
return decrypted.toString(CryptoJS.enc.Utf8);
}
toHexString(byteArray) {
return Array.from(byteArray, (value: any) => {
return ('0' + (value & 0xFF).toString(16)).slice(-2);
}).join('')
}
}
+2 -2
View File
@@ -4,14 +4,14 @@ import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
@Injectable({
providedIn: 'root'
})
export class AttachmentsService {
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
+38 -65
View File
@@ -1,17 +1,14 @@
import { Injectable } from '@angular/core';
import { StorageService } from './storage.service';
import { Router } from '@angular/router';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { User, UserForm } from '../models/user.model';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
import { environment } from 'src/environments/environment';
import { HttpService } from './http.service';
import { BehaviorSubject, Observable } from 'rxjs';
import { BehaviorSubject } from 'rxjs';
import { AuthConnstants } from '../config/auth-constants';
import { AlertController } from '@ionic/angular';
import { LocalstoreService } from '../store/localstore.service';
import { ToastService } from './toast.service';
import { UserStore } from 'src/app/store/user.service'
import { SHA1, SHA256, AES, enc } from 'crypto-js'
import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
@Injectable({
providedIn: 'root'
@@ -20,25 +17,22 @@ export class AuthService {
userData$ = new BehaviorSubject<any>('');
userId$ = new BehaviorSubject<any>('');
headers: HttpHeaders;
public ValidatedUser: User;
public ValidatedUser: UserSession;
public ValidatedUserChat:any;
opts:any;
userStore = UserStore
constructor(
private http: HttpClient,
private httpService: HttpService,
private storageService:StorageService,
private router:Router,
public alertController: AlertController,
private localstoreService: LocalstoreService,
private toastService: ToastService,
private aesencrypt: AESEncrypt,
) {
this.headers = new HttpHeaders();
if (this.localstoreService.get('user', null) != null) {
this.ValidatedUser = this.localstoreService.get('user',{});
if (SessionStore.exist) {
this.ValidatedUser = SessionStore.user
}
if (localStorage.getItem("userChat") != null) {
@@ -47,12 +41,8 @@ export class AuthService {
}
async login(user: UserForm): Promise<boolean> {
// user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password);
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + user.password); //conversão em base64 das credenciais inseridas
console.log('Basic ' + btoa(user.username + ':' + SHA1(user.password).toString())); //conversão em base64 das credenciais inseridas
async login(user: UserForm, saveSession = true): Promise<LoginUserRespose> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
this.opts = {
@@ -62,41 +52,39 @@ export class AuthService {
let response: any;
try {
response = await this.http.post<User>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
console.log(response);
if (response) {
if( response.RoleID == 100000014) {
response.Profile = 'PR'
} else if(response.RoleID == 100000011) {
response.Profile = 'MDGPR'
}
response.BasicAuthKey = user.BasicAuthKey
this.ValidatedUser = response;
// console.log('response', response)
this.localstoreService.set('user', response)
this.userStore.reset(response)
this.storageService.store(AuthConnstants.USER, response);
return true;
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
if(saveSession) {
this.SetSession(response, user)
}
} catch (error) {
if(error.status == 0) {
this.toastService.badRequest('Verifique a sua conexão com a internet e volte a tentar')
} else {
this.toastService.badRequest('O email e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar');
}
return false;
} finally {
return response
}
}
logout(){
SetSession(response: LoginUserRespose, user:UserForm) {
const session: UserSession = Object.assign(SessionStore.user, response)
if (response) {
if( session.RoleID == 100000014) {
session.Profile = 'PR'
} else if(session.RoleID == 100000011) {
session.Profile = 'MDGPR'
}
session.BasicAuthKey = user.BasicAuthKey
SessionStore.reset(session)
this.ValidatedUser = SessionStore.user;
this.storageService.store(AuthConnstants.USER, response);
return true;
}
}
logout() {
this.ValidatedUser = null;
}
@@ -124,27 +112,12 @@ export class AuthService {
}
}
//Get user data from RocketChat | global object
getUserData(){
this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res);
});
}
//Get user Id | global object
getUserId(){
/* this.storageService.get(AuthConnstants.USER).then(res=>{
this.userId$.next(res);
}); */
}
getProfile(){
/* this.storageService.get(AuthConnstants.PROFILE).then(res=>{
return res;
}); */
}
logoutChat(){
//this.storageService.clear();
@@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { ExpedientesService } from './expedientes.service';
import { BackgroundService } from './background.service';
describe('ExpedientesService', () => {
let service: ExpedientesService;
describe('BackgroundService', () => {
let service: BackgroundService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ExpedientesService);
service = TestBed.inject(BackgroundService);
});
it('should be created', () => {
+25
View File
@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class BackgroundService {
constructor() { }
online() {
document.body.style.setProperty(`--color`, "#0782C9");
document.body.style.setProperty(`--color2`, "#45BAFF");
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
}
offline() {
document.body.style.setProperty(`--color`, "#ffb703");
document.body.style.setProperty(`--color2`, "#ffb703");
document.body.style.setProperty(`--color3`, "#ffb703");
document.body.style.setProperty(`--color4`, "#ffb703");
document.body.style.setProperty(`--color5`, "#ffb703");
}
}
+2 -2
View File
@@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
@Injectable({
providedIn: 'root'
@@ -12,7 +12,7 @@ import { User } from '../models/user.model';
export class ContactsService {
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
-9
View File
@@ -1,9 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class DatabaseService {
constructor() { }
}
+2 -4
View File
@@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
@Injectable({
@@ -13,7 +13,7 @@ import { User } from '../models/user.model';
export class EventsService {
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
headersPrOficial: HttpHeaders;
@@ -150,7 +150,6 @@ export class EventsService {
getAllMdOficialEvents(startdate:string, enddate:string): any{
let geturl = environment.apiURL + 'calendar/md';
geturl = geturl.replace('/V4/','/V5/')
let params = new HttpParams();
@@ -166,7 +165,6 @@ export class EventsService {
getAllMdPessoalEvents(startdate:string, enddate:string): any{
let geturl = environment.apiURL + 'calendar/md';
geturl = geturl.replace('/V4/','/V5/')
let params = new HttpParams();
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { InativityService } from './inativity.service';
describe('InativityService', () => {
let service: InativityService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(InativityService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+35
View File
@@ -0,0 +1,35 @@
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
})
export class InativityService {
constructor(
private router: Router,
) {
var t;
window.onload = resetTimer;
window.onmousemove = resetTimer;
window.onmousedown = resetTimer; // catches touchscreen presses as well
window.ontouchstart = resetTimer; // catches touchscreen swipes as well
window.onclick = resetTimer; // catches touchpad clicks as well
window.onkeydown = resetTimer;
window.addEventListener('scroll', resetTimer, true); // improved; see comments
function userIsNotActive() {
// your function for too long inactivity goes here
SessionStore.setInativity(false)
// alert('go out')
window['inactivity/function']()
}
function resetTimer() {
clearTimeout(t);
t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
}
}
}
+23 -5
View File
@@ -23,6 +23,11 @@ export class NotificationsService {
folderId: string;
DataArray: Array<String> = [];
callbacks: {
type: string,
funx: Function
}[] = []
constructor(
private http: HttpClient,
private storageService: StorageService,
@@ -34,7 +39,14 @@ export class NotificationsService {
private toastService: ToastService,
private zone: NgZone,
private activeroute: ActivatedRoute,
private jsonstore: JsonStore) { }
private jsonstore: JsonStore) {
}
registerCallback(type: string, funx: Function ) {
this.callbacks.push({type, funx})
}
getTokenByUserIdAndId(user, userID) {
const geturl = environment.apiURL + 'notifications/user/' + userID;
@@ -204,9 +216,9 @@ export class NotificationsService {
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
console.log('data.Service', data.Service); // module
console.log('data.IdObject', data.IdObject); // Object id
console.log('data.Object', data.Object); // details
if(message.actionName){
this.notificatinsRoutes(data);
@@ -215,7 +227,13 @@ export class NotificationsService {
//this.notificatinsRoutes(data);
console.log(data)
}
this.callbacks.forEach( e=> {
if(e.type == data.Object) {
e.funx()
}
})
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
+2 -2
View File
@@ -4,7 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model';
@Injectable({
@@ -13,7 +13,7 @@ import { OrganicEntity } from 'src/app/models/organic-entity.model';
export class OrganicEntityService {
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
+23 -3
View File
@@ -1,11 +1,13 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
import { environment } from 'src/environments/environment';
import { Observable } from 'rxjs';
import { DocumentSetUpMeeting } from '../models/CallMeeting';
import { Excludetask } from '../models/Excludetask';
import { ExpedienteFullTask } from '../models/Expediente';
import { GetTasksListType } from '../models/GetTasksListType';
@Injectable({
providedIn: 'root'
@@ -13,7 +15,7 @@ import { Excludetask } from '../models/Excludetask';
export class ProcessesService {
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
@@ -22,7 +24,7 @@ export class ProcessesService {
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
GetTasksList(processname:string, onlycount:boolean): Observable<any>
GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable<any>
{
const geturl = environment.apiURL + 'tasks/List';
let params = new HttpParams();
@@ -38,6 +40,24 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetTaskListExpediente(onlycount1): Observable<ExpedienteFullTask[]> {
const processname = "Expediente"
const onlycount = false
const geturl = environment.apiURL + 'tasks/List';
let params = new HttpParams();
params = params.set("ProcessName", processname);
params = params.set("OnlyCount", onlycount.toString());
let options = {
headers: this.headers,
params: params
};
return this.http.get<ExpedienteFullTask[]>(`${geturl}`, options);
}
GetTask(serialnumber:string): Observable<any>{
const geturl = environment.apiURL + 'Tasks/FindTask';
let params = new HttpParams();
+2 -2
View File
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators'
import { Publication } from '../models/publication';
@@ -13,7 +13,7 @@ import { Publication } from '../models/publication';
export class PublicationsService {
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
+2 -2
View File
@@ -4,7 +4,7 @@ import { Event } from '../models/event.model';
import { from, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { LoginUserRespose } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search';
@@ -14,7 +14,7 @@ import { TopSearch } from 'src/app/models/top-search';
export class SearchService {
// state
authheader = {};
loggeduser: User;
loggeduser: LoginUserRespose;
headers: HttpHeaders;
categories= Array;
-9
View File
@@ -1,9 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SenderService {
constructor() { }
}
+38 -14
View File
@@ -1,14 +1,15 @@
import { Injectable } from '@angular/core';
import { v4 as uuidv4 } from 'uuid'
import { BackgroundService } from '../background.service';
export interface wss{
url: string,
type: 'reflect' | 'emit'
header: {
id: string
bluePrint: string,
jwt: string
id: string
bluePrint: string,
jwt: string
}
}
@@ -25,6 +26,11 @@ export class SynchroService {
private url: string = ''
callback = function(){}
private _connected = false;
private BackgroundService = new BackgroundService()
private callBacks: {
type: 'Offline' | 'Online'
funx: Function
}[] = []
constructor(){}
@@ -49,6 +55,13 @@ export class SynchroService {
this.url = `${wss.url}${wss.header.id}/${wss.header.jwt}/${wss.header.bluePrint}/${this.id}/`
}
registerCallback(type: 'Offline' | 'Online', funx: Function) {
this.callBacks.push({
type,
funx
})
}
connect() {
this.connection = new WebSocket(this.url);
@@ -60,11 +73,15 @@ export class SynchroService {
}
private onopen = () =>{
document.body.style.setProperty(`--color`, "#0782C9");
document.body.style.setProperty(`--color2`, "#45BAFF");
document.body.style.setProperty(`--color3`, "#0782C9");
document.body.style.setProperty(`--color4`, "#0782c9f0");
document.body.style.setProperty(`--color5`, "#45BAFF");
this.BackgroundService.online()
this.callBacks.forEach((e)=>{
if(e.type == 'Online') {
e.funx()
}
})
console.log('open ======================= welcome to socket server')
this._connected = true
@@ -96,12 +113,18 @@ export class SynchroService {
// event.code is usually 1006 in this case
console.log('[close] Connection died');
console.log('Reconnect')
document.body.style.setProperty(`--color`, "#ffb703");
document.body.style.setProperty(`--color2`, "#ffb703");
document.body.style.setProperty(`--color3`, "#ffb703");
document.body.style.setProperty(`--color4`, "#ffb703");
document.body.style.setProperty(`--color5`, "#ffb703");
this.BackgroundService.offline();
this.callBacks.forEach((e)=>{
if(e.type == 'Offline') {
e.funx()
}
})
// status
this._connected = false
// reconnect
this.connect()
}
@@ -116,4 +139,5 @@ export class SynchroService {
export const connection = new SynchroService()
connection.setUrl()
connection.connect()
connection.connect()
+4 -2
View File
@@ -32,10 +32,10 @@ export class WebNotificationsService {
webconnection() {
MFPPush.initialize({
/* MFPPush.initialize({
appId: "com.gpr.gabinetedigital",
mfpContextRoot: "/mfp",
});
}); */
MFPPush.registerDevice()
.then((res) => {
@@ -72,7 +72,9 @@ async onReceviNotificationWeb() {
if(message.actionName){
//this.notificatinsRoutes(data);
console.log("Web notification")
} else {
console.log("Web notification")
//this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
}
@@ -6,7 +6,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController, NavParams } from '@ionic/angular';
import { NavigationEnd, 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';
@Component({
selector: 'app-event-list',
@@ -23,7 +23,7 @@ export class EventListPage implements OnInit {
eventBody: EventBody;
categories: string[];
serialnumber:string;
loggeduser: User;
loggeduser: LoginUserRespose;
segment:string;
@Input() profile:string;
@@ -108,7 +108,6 @@
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
[(ngModel)]="postEvent.StartDate"
[min]="minDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
@@ -140,7 +139,6 @@
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
[(ngModel)]="postEvent.EndDate"
[min]="endMinDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
@@ -186,11 +184,11 @@
<mat-select placeholder="Selecione repetição*"
[(ngModel)]="postEvent.EventRecurrence.Type"
(ngModelChange)="onSelectedRecurringChanged($event)">
<!-- <mat-option
<mat-option
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
>
{{recurring.Description}}
</mat-option> -->
</mat-option>
</mat-select>
</mat-form-field>
@@ -207,8 +205,7 @@
<mat-form-field class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="occurrrence"
placeholder="Choose a date"
[formControl]="dateControlOccurrence"
[min]="endMinDate"
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
[disabled]="disabled"
>
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
@@ -11,7 +11,7 @@ import { SearchList } from "src/app/models/search-document";
import { EventAttachment } from 'src/app/models/attachment.model';
import { ToastService } from 'src/app/services/toast.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 {DateAdapter} from '@angular/material/core';
@@ -21,10 +21,9 @@ import { FormControl } from '@angular/forms';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { ThemePalette } from '@angular/material/core';
import { NgZone, ViewChild } from '@angular/core';
import { ViewChild } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
const moment = _rollupMoment || _moment;
@@ -61,13 +60,11 @@ 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;
public color: ThemePalette = 'primary';
recurringTypes: any;
recurringTypes = []
selectedRecurringType: any;
@Input() profile:string;
@@ -90,7 +87,7 @@ export class NewEventPage implements OnInit {
// minDate: string;
loggeduser: User;
loggeduser: LoginUserRespose;
@ViewChild('picker') picker: any;
@ViewChild('fim') fim: any;
@ViewChild('inicio') inicio: any;
@@ -110,13 +107,9 @@ export class NewEventPage implements OnInit {
public stepMinutes = [1, 5, 10, 15, 20, 25];
public stepSeconds = [1, 5, 10, 15, 20, 25];
public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh"));
showLoader = false
get dateOccurrence () {
return this.dateControlOccurrence.value
}
constructor(
private modalController: ModalController,
@@ -131,7 +124,7 @@ export class NewEventPage implements OnInit {
this.loggeduser = userService.ValidatedUser;
this.postEvent = new Event();
this.postEvent.StartDate = new Date();
this.postEvent.StartDate = new Date()
this.postEvent.EndDate = new Date(new Date().getTime() + 15 * 60000);
}
@@ -216,7 +209,6 @@ export class NewEventPage implements OnInit {
this.date = new Date(2021,9,4,5,6,7);
this.getDatepickerData()
this.injectValidation();
@@ -251,7 +243,7 @@ export class NewEventPage implements OnInit {
dateEnd: new FormControl(this.postEvent.EndDate, [
Validators.required
]),
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.dateOccurrence, [
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence, [
Validators.required
]),
participantes: new FormControl(this.taskParticipants, [
@@ -334,17 +326,6 @@ export class NewEventPage implements OnInit {
}
}
getDatepickerData() {
if (this.postEvent) {
this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence
}
}
restoreDatepickerData() {
if (this.postEvent) {
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence, "DD MM YYYY HH:mm"))
}
}
@@ -358,7 +339,6 @@ export class NewEventPage implements OnInit {
return false
}
this.getDatepickerData()
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -483,7 +463,6 @@ export class NewEventPage implements OnInit {
}
afterSave() {
this.getDatepickerData()
this.deleteTemporaryData();
this.onAddEvent.emit(this.postEvent);
@@ -521,7 +500,6 @@ export class NewEventPage implements OnInit {
}
saveTemporaryData() {
this.getDatepickerData()
window['temp.path:/home/agenda/new-event.component.ts'] = {
postEvent: this.postEvent,
eventBody: this.eventBody,
@@ -545,7 +523,7 @@ export class NewEventPage implements OnInit {
this.segment = restoredData.segment
// restore dater for date and hours picker
this.restoreDatepickerData()
return true;
} else {
@@ -33,14 +33,16 @@
<span class="date">{{loadedEvent.Location}}</span>
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
</div>
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Ministro e Director do Gabinete do PR' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
<div *ngIf="loadedEvent.Organizer">
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
</div>
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Ministro e Director do Gabinete do PR' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
</div>
</div>
</div>
@@ -75,10 +77,10 @@
</div>
</div>
<div *ngIf="loadedAttachments" class="bottom-content width-100">
<div *ngIf="loadedEvent.Attachments" class="bottom-content width-100">
<h5>Documentos Anexados</h5>
<ion-list class="width-100">
<li *ngFor="let attach of loadedAttachments; let i = index" class="width-100" lines="none" class="ion-no-margin ion-no-padding pa-0">
<li *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" lines="none" class="ion-no-margin ion-no-padding pa-0">
<ion-label class="width-100 d-flex align-center" >
<p class="flex-grow-1" (click)="viewDocument(attach.SourceId)">
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
@@ -116,7 +116,7 @@ ion-content{
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
}
}
.location-detail{
@@ -2,7 +2,6 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { AlertController, ModalController, PopoverController } from '@ionic/angular';
import { Attachment } from 'src/app/models/attachment.model';
import { EventBody } from 'src/app/models/eventbody.model';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { Event } from 'src/app/models/event.model';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@@ -22,7 +21,6 @@ export class ViewEventPage implements OnInit {
isEventEdited: boolean;
eventBody: EventBody;
loadedAttachments:any;
loadedEventAttachments: Attachment[];
pageId: string;
showLoader: boolean;
@@ -44,7 +42,6 @@ export class ViewEventPage implements OnInit {
constructor(
private eventsService: EventsService,
private attachmentsService: AttachmentsService,
public alertController: AlertController,
private iab: InAppBrowser,
private processes: ProcessesService,
@@ -96,7 +93,6 @@ export class ViewEventPage implements OnInit {
this.loadedEvent = res;
this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.getAttachments(this.loadedEvent.EventId);
}, (error)=> {
console.log('errer', )
@@ -142,12 +138,6 @@ export class ViewEventPage implements OnInit {
}
getAttachments(eventId){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedAttachments = res;
console.log(res);
});
}
async editEvent() {
this.viewEventDetailDismiss.emit({
@@ -156,7 +146,7 @@ export class ViewEventPage implements OnInit {
})
}
viewDocument(sourceId){
viewDocument(sourceId) {
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
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 { ProcessesService } from 'src/app/services/processes.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
@@ -14,7 +14,7 @@ export class AllProcessesPage implements OnInit {
skeletonLoader = true;
allProcessesList:any[] = [];
loggeduser: User;
loggeduser: LoginUserRespose;
constructor(
private processesService: ProcessesService,
@@ -4,7 +4,7 @@ import { customTask} from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
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 { NavigationStart, Router } from '@angular/router';
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -19,7 +19,7 @@ export class DespachosPrPage implements OnInit {
customTaskPipe = new CustomTaskPipe()
skeletonLoader = true
loggeduser: User;
loggeduser: LoginUserRespose;
despachosprstore = DespachosprStore;
constructor (
@@ -1,9 +1,8 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { customTask, DailyWorkTask, fullTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { Component, OnInit } from '@angular/core';
import { customTask } from '../../../models/dailyworktask.model';
import { NavigationStart, Router } from '@angular/router';
import { DespachoStore } from 'src/app/store/despacho-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DespachoService } from 'src/app/Rules/despacho.service';
@Component({
selector: 'app-despachos',
@@ -12,16 +11,11 @@ import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
})
export class DespachosPage implements OnInit {
segment:string;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
skeletonLoader = true
despachoStore = DespachoStore;
customTaskPipe = new CustomTaskPipe()
constructor (
private processes:ProcessesService,
private router: Router,
private despachoRule: DespachoService
) {}
ngOnInit() {
@@ -45,30 +39,11 @@ export class DespachosPage implements OnInit {
async LoadList() {
this.skeletonLoader = true
let result: fullTask[] = await this.processes.GetTasksList("Despacho", false).toPromise();
result = result.filter(data => data.workflowInstanceDataFields.Status == "Active")
let despachoList = new Array();
result.forEach((element, index) => {
let task = this.customTaskPipe.transform(element);
despachoList.push(task);
});
despachoList = this.sortArrayISODate(despachoList).reverse();
this.despachoStore.reset(despachoList);
this.skeletonLoader = false
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() {

Some files were not shown because too many files have changed in this diff Show More