mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -4,4 +4,5 @@ export class AuthConnstants{
|
||||
public static readonly AUTH = 'userDataKey';
|
||||
public static readonly PROFILE = 'profile';
|
||||
public static readonly USER = 'userId';
|
||||
public static readonly USERCHAT = 'userChat';
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-input>
|
||||
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,7 +62,7 @@ export class DarParecerPage implements OnInit {
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.modalController.dismiss();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
|
||||
@@ -75,6 +75,9 @@ export class DelegarPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
cancelTask(){
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
@@ -100,7 +103,7 @@ export class DelegarPage implements OnInit {
|
||||
(error)=>{
|
||||
this.badRequest()
|
||||
});
|
||||
this.close();
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label *ngFor="let user of dm.usernames">
|
||||
<span *ngIf="user !=loggedUser.me.username">
|
||||
<span *ngIf="user !=loggedUserChat.me.username">
|
||||
{{user}}
|
||||
</span>
|
||||
</ion-label>
|
||||
|
||||
@@ -90,6 +90,8 @@ export class ChatPage implements OnInit {
|
||||
|
||||
|
||||
/* Fim websockets variables*/
|
||||
loggedUserChat:any;
|
||||
|
||||
constructor(
|
||||
private http:HttpClient,
|
||||
private chatService: ChatService,
|
||||
@@ -98,11 +100,14 @@ export class ChatPage implements OnInit {
|
||||
private storage:Storage,
|
||||
private resolver: ComponentFactoryResolver,
|
||||
){
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.headers = new HttpHeaders();
|
||||
this.loadMessage();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.loggedUserChat);
|
||||
|
||||
this.segment = "Contactos";
|
||||
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
@@ -255,7 +260,7 @@ sendMsg() {
|
||||
}
|
||||
getChatMembers(){
|
||||
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUserChat.me.username)
|
||||
});
|
||||
}
|
||||
getGroups(){
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="main-header">
|
||||
<app-btn-modal-dismiss (click)="goBack()" ></app-btn-modal-dismiss>
|
||||
<div class="thetitle">
|
||||
<ion-label *ngIf="loggeduser.Profile =='MDGPR'" >Despachos Presidenciais</ion-label>
|
||||
<ion-label *ngIf="loggeduser.Profile =='MDGPR'" >Despachos Presidenciais !!</ion-label>
|
||||
<ion-label *ngIf="loggeduser.Profile =='PR'" >Despachos</ion-label>
|
||||
</div>
|
||||
<div class="theicon">
|
||||
@@ -36,7 +36,7 @@
|
||||
(click)="goToDespachoPr(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
<div class="item width-100" *ngIf="task.Status == 'Active'">
|
||||
<div class="item width-100">
|
||||
<div class="exp-top-detail">
|
||||
<div class="exp-date">
|
||||
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
|
||||
|
||||
@@ -64,8 +64,6 @@ export class DespachosPrPage implements OnInit {
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
this.LoadList();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadList();
|
||||
@@ -97,36 +95,48 @@ export class DespachosPrPage implements OnInit {
|
||||
}
|
||||
|
||||
async LoadList() {
|
||||
|
||||
this.despachoList = new Array();
|
||||
|
||||
this.loading = true;
|
||||
|
||||
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
|
||||
console.log(result);
|
||||
|
||||
await result.forEach( (element, index) => {
|
||||
|
||||
this.loading = true;
|
||||
|
||||
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
console.log(result);
|
||||
|
||||
let despachosPr;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
}
|
||||
console.log(despachosPr);
|
||||
|
||||
despachosPr.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": 0,
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
|
||||
this.despachoList.push(task)
|
||||
|
||||
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": 0,
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
|
||||
this.despachoList.push(task);
|
||||
console.log(this.despachoList);
|
||||
});
|
||||
console.log(this.despachoList);
|
||||
|
||||
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
|
||||
|
||||
@@ -139,10 +149,10 @@ export class DespachosPrPage implements OnInit {
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.loading = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
|
||||
@@ -84,22 +84,7 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
|
||||
// this.activatedRoute.queryParams.subscribe(params => {
|
||||
// if(params["from"] == 'pendentes') {
|
||||
// this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
// } else {
|
||||
// let navigationExtras: NavigationExtras = {
|
||||
// queryParams: {
|
||||
// "despachos": true,
|
||||
// }
|
||||
// };
|
||||
// this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
|
||||
// }
|
||||
// });
|
||||
|
||||
window.history.back()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-input>
|
||||
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
-35
@@ -2,41 +2,6 @@
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<!-- <ion-menu autoHide="false" side="end" content-id="main-content">
|
||||
<ion-header>
|
||||
<ion-toolbar translucent>
|
||||
<ion-title>Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item (click)="openExpedientActionsModal('0', fulltask)">
|
||||
<ion-icon name="documents" slot="start"></ion-icon>
|
||||
<ion-label>Efectuar Despacho</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openExpedientActionsModal('1', fulltask)">
|
||||
<ion-icon name="arrow-undo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Parecer</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openExpedientActionsModal('2', fulltask)">
|
||||
<ion-icon name="arrow-redo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Deferimento</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="openBookMeetingModal(fulltask)">
|
||||
<ion-icon name="calendar" slot="start"></ion-icon>
|
||||
<ion-label>Marcar reunião</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="discartExpedient()">
|
||||
<ion-icon name="trash" slot="start"></ion-icon>
|
||||
<ion-label>Descartar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item hidden disabled>
|
||||
<ion-icon name="paper-plane" slot="start"></ion-icon>
|
||||
<ion-label>Enviar para pendentes</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-menu> -->
|
||||
<div class="ion-page d-none" id="main-content">
|
||||
<ion-menu-button></ion-menu-button>
|
||||
</div>
|
||||
|
||||
+3
-4
@@ -227,20 +227,19 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
console.log(body);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 94,
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
@@ -255,7 +254,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
//await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
|
||||
@@ -313,21 +313,20 @@ export class ExpedientePrPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
console.log(body);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": body.serialNumber,
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 94,
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
await this.processes.CompleteTask(otherbody).toPromise();
|
||||
this.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
@@ -343,7 +342,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
//await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
|
||||
@@ -139,8 +139,8 @@
|
||||
<p class="text-center exp-card-title">Diplomas para Assinar</p>
|
||||
<p class="text-center exp-card-content">{{count_dip_as}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Aside right -->
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
||||
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Parecer'">
|
||||
|
||||
@@ -41,7 +41,6 @@ export class PedidoPage implements OnInit {
|
||||
fulltask: any;
|
||||
eventsList: Event[];
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
loggeduser: User;
|
||||
@@ -61,15 +60,11 @@ export class PedidoPage implements OnInit {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
// console.log(params["serialNumber"]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
// console.log(this.serialnumber);
|
||||
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
}
|
||||
|
||||
@@ -255,7 +250,6 @@ export class PedidoPage implements OnInit {
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: this.fulltask,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
@@ -286,13 +280,11 @@ export class PedidoPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId: any) {
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
@@ -370,6 +362,7 @@ export class PedidoPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
@@ -384,25 +377,22 @@ export class PedidoPage implements OnInit {
|
||||
cssClass: classs,
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
|
||||
if(res.data){
|
||||
if(actionName == 'Solicitar Reapreciação') {
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
<div class="exp-remetente">
|
||||
<ion-label>{{task.Remetente}}</ion-label>
|
||||
</div>
|
||||
<div class="exp-workflow">
|
||||
<span class="label">{{task.activityInstanceName}}</span>
|
||||
</div>
|
||||
<div class="exp-icon">
|
||||
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||
<label></label>
|
||||
@@ -87,7 +90,7 @@
|
||||
<ion-label>{{task.Remetente}}</ion-label>
|
||||
</div>
|
||||
<div class="exp-workflow">
|
||||
<span class="label">{{task.WorkflowName}}</span>
|
||||
<span class="label">{{task.activityInstanceName}}</span>
|
||||
</div>
|
||||
<div class="exp-icon">
|
||||
<ion-menu-button style="width: 35px; height: 41px;" autoHide="false">
|
||||
|
||||
@@ -32,7 +32,6 @@ export class PedidosPage implements OnInit {
|
||||
taskType: string;
|
||||
serialNumber:string;
|
||||
|
||||
@Input() profile:string;
|
||||
@Input() segment:string;
|
||||
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@@ -43,7 +42,6 @@ export class PedidosPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.profile = 'mdgpr';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -100,22 +98,25 @@ export class PedidosPage implements OnInit {
|
||||
this.openExpedientDetail.emit(data);
|
||||
}
|
||||
|
||||
LoadList(){
|
||||
async LoadList(){
|
||||
if(this.segment == 'parecer'){
|
||||
this.taskType = "Pedido de Parecer";
|
||||
this.processes.GetTasksList("Pedido de Parecer", false).subscribe(result => {
|
||||
this.taskslist = result;
|
||||
console.log(result);
|
||||
|
||||
this.parecerList = new Array();
|
||||
let res = result.reverse();
|
||||
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 parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise();
|
||||
let parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
||||
|
||||
let task = {
|
||||
let allParecer = parecer.concat(parecerPr).reverse();
|
||||
console.log(allParecer);
|
||||
|
||||
this.parecerList = new Array();
|
||||
|
||||
allParecer.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 = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.originator.email,
|
||||
@@ -126,14 +127,13 @@ export class PedidosPage implements OnInit {
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
console.log(this.parecerList);
|
||||
|
||||
}
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
console.log(this.parecerList);
|
||||
|
||||
}
|
||||
else if(this.segment == 'deferimento'){
|
||||
else if(this.segment == 'deferimento') {
|
||||
this.taskType = "Pedido de Deferimento";
|
||||
this.processes.GetTasksList("Pedido de Deferimento", false).subscribe(result => {
|
||||
this.taskslist = result;
|
||||
@@ -143,12 +143,11 @@ export class PedidosPage implements OnInit {
|
||||
this.deferimentoList = new Array();
|
||||
let res = result.reverse();
|
||||
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();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
let task = {
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
@@ -159,7 +158,7 @@ export class PedidosPage implements OnInit {
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
}
|
||||
this.deferimentoList.push(task);
|
||||
});
|
||||
console.log(this.deferimentoList);
|
||||
@@ -176,28 +175,11 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewPedidoDetail(serialNumber:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
// const modal = await this.modalController.create({
|
||||
// component: PedidoPage,
|
||||
// componentProps:{
|
||||
// enterAnimation: "",
|
||||
// serialNumber: serialNumber,
|
||||
// profile: this.profile,
|
||||
// },
|
||||
// cssClass: 'modal modal-desktop',
|
||||
// });
|
||||
// await modal.present();
|
||||
// modal.onDidDismiss().then((res)=>{
|
||||
// console.log('refresh list');
|
||||
// this.LoadList();
|
||||
// });
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
enterAnimation: "",
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras);
|
||||
|
||||
@@ -59,7 +59,6 @@ export class LoginPage implements OnInit {
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
@@ -72,7 +71,6 @@ export class LoginPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
async presentAlert(message: string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
@@ -84,7 +82,7 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
loginRocketChat() {
|
||||
/* loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": this.username,
|
||||
@@ -99,7 +97,7 @@ export class LoginPage implements OnInit {
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error ' + error);
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
getToken() {
|
||||
// this.notificatinsservice.getAndpostToken(this.username);
|
||||
@@ -115,7 +113,8 @@ export class LoginPage implements OnInit {
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)) {
|
||||
this.loginRocketChat();
|
||||
//this.loginRocketChat();
|
||||
this.authService.loginChat(this.userattempt);
|
||||
//this.getToken();
|
||||
|
||||
if(!this.pin) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { HttpService } from './http.service';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -16,13 +17,15 @@ export class AuthService {
|
||||
userId$ = new BehaviorSubject<any>('');
|
||||
headers: HttpHeaders;
|
||||
public ValidatedUser:User;
|
||||
public ValidatedUserChat:any;
|
||||
opts:any;
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private httpService: HttpService,
|
||||
private storageService:StorageService,
|
||||
private router:Router
|
||||
private router:Router,
|
||||
public alertController: AlertController,
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -30,6 +33,9 @@ export class AuthService {
|
||||
if (localStorage.getItem("user") != null) {
|
||||
this.ValidatedUser = JSON.parse(localStorage.getItem('user'));
|
||||
}
|
||||
if (localStorage.getItem("userChat") != null) {
|
||||
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,12 +81,30 @@ export class AuthService {
|
||||
}
|
||||
|
||||
//Login to rocketChat server
|
||||
loginChat(postData: any):Observable<any> {
|
||||
console.log(postData);
|
||||
|
||||
return this.httpService.post('login', postData);
|
||||
async loginChat(user: UserForm): Promise<boolean> {
|
||||
let postData = {
|
||||
"user": user.username,
|
||||
"password": user.password,
|
||||
}
|
||||
|
||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
||||
if(responseChat){
|
||||
console.log('Login to Rocket chat OK');
|
||||
this.ValidatedUserChat = responseChat;
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Get user data from RocketChat | global object
|
||||
getUserData(){
|
||||
this.storageService.get(AuthConnstants.AUTH).then(res=>{
|
||||
@@ -108,4 +132,14 @@ export class AuthService {
|
||||
}) */
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class ChatService {
|
||||
|
||||
SERVER_URL = 'wss://www.tabularium.pt/websocket';
|
||||
public messages: Subject<any>;
|
||||
|
||||
loggedUserChat:any;
|
||||
|
||||
constructor(
|
||||
private http:HttpClient,
|
||||
@@ -33,11 +33,10 @@ export class ChatService {
|
||||
private wsService: WebsocketService,
|
||||
)
|
||||
{
|
||||
this.loggedUserChat = authService.ValidatedUserChat;
|
||||
this.headers = new HttpHeaders();
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.headers = this.headers.set('X-User-Id', res.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', res.authToken);
|
||||
});
|
||||
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
@@ -48,25 +47,6 @@ export class ChatService {
|
||||
return (JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
|
||||
/* getUser(){
|
||||
this.storage.get('user').then((val) => {
|
||||
let user = JSON.parse(unescape(atob(val))).data;
|
||||
|
||||
this.headers = this.headers.set('X-User-Id', user.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', user.authToken);
|
||||
|
||||
this.options1 = {
|
||||
headers: this.headers,
|
||||
};
|
||||
console.log(this.options1);
|
||||
|
||||
this.http.get(environment.apiChatUrl+'users.presence', this.options1).subscribe(res => {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
});
|
||||
} */
|
||||
|
||||
getAllChannels(){
|
||||
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
|
||||
@@ -108,7 +88,6 @@ export class ChatService {
|
||||
|
||||
//Load messages from roomId
|
||||
getAllDirectMessages(){
|
||||
console.log(this.options);
|
||||
return this.http.get(environment.apiChatUrl+'im.list', this.options);
|
||||
}
|
||||
//Load messages from roomId
|
||||
|
||||
Reference in New Issue
Block a user