viewer hot-fix

This commit is contained in:
Peter Maquiran
2021-10-08 19:29:21 +01:00
parent 405c989b87
commit 9ceb915fef
37 changed files with 708 additions and 360 deletions
@@ -33,7 +33,6 @@
<span class="date">{{loadedEvent.Location}}</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>
@@ -82,8 +81,8 @@
<h5>Documentos Anexados</h5>
<ion-list class="width-100">
<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)">
<ion-label class="width-100 d-flex align-center" (click)="docIndex(i);LoadDocumentDetails()" >
<p class="flex-grow-1" >
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
<span class="span-left d-block">{{attach.Stakeholders}}</span>
</p>
@@ -13,6 +13,8 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { SearchedDocumentOptionsPage } from '../../popover/searched-document-options/searched-document-options.page';
import { EventDetailsDocumentsOptionsPage } from '../../popover/event-details-documents-options/event-details-documents-options.page';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@Component({
selector: 'app-view-event',
@@ -85,8 +87,7 @@ export class ViewEventPage implements OnInit {
this.dicIndex = index;
}
close(){
console.log(this.isEventEdited);
close() {
this.viewEventDetailDismiss.emit({
type: 'close'
@@ -101,8 +102,6 @@ export class ViewEventPage implements OnInit {
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
}, (error)=> {
// console.log('errer', )
this.viewEventDetailDismiss.emit({
type: 'close'
})
@@ -139,7 +138,6 @@ export class ViewEventPage implements OnInit {
()=>{
loader.remove();
});
}
}
@@ -156,7 +154,6 @@ export class ViewEventPage implements OnInit {
modal.onDidDismiss().then((res) => {
});
}
async editEvent() {
@@ -168,155 +165,115 @@ export class ViewEventPage implements OnInit {
viewDocument(sourceId) {
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
async LoadDocumentDetails() {
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
const applicationId = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
console.log(this.loadedEvent.Attachments[ this.dicIndex])
// this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
// this.LoadedDocument = res;
// this.LoadedDocument.Subject = this.LoadedDocument.Assunto
this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
// let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
// this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.LoadedDocument = res;
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
// let task: ExpedientTaskModalPageNavParamsTask
// let document: SearchDocumentDetails = this.LoadedDocument
// let folder: SearchFolderDetails = this.LoadedDocument
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
// if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
// task = {
// serialNumber: folder.DispatchNumber,
// taskStartDate: folder.DateDispatch,
// isEvent: true,
// workflowInstanceDataFields: {
// FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
// Subject: folder.Assunto,
// SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
// SourceType: 'FOLDER',
// SourceID: folder.folderId,
// DispatchNumber: folder.DispatchNumber
// },
// }
// } else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
// task = {
// serialNumber: document.DocId,
// taskStartDate: document.DocDate,
// isEvent: true,
// workflowInstanceDataFields: {
// FolderID: null,
// Subject: document.Assunto,
// DispatchNumber: null,
// SourceSecFsID: document.ApplicationID || document.ApplicationId,
// SourceType: 'DOC',
// SourceID: document.DocId,
// }
// }
// } else {
// console.log('unexpected ApplicationID')
// }
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
let task: ExpedientTaskModalPageNavParamsTask
let document: SearchDocumentDetails = this.LoadedDocument
let folder: SearchFolderDetails = this.LoadedDocument
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
task = {
serialNumber: folder.DispatchNumber,
taskStartDate: folder.DateDispatch,
isEvent: true,
workflowInstanceDataFields: {
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
Subject: folder.Assunto,
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
SourceType: 'FOLDER',
SourceID: folder.folderId,
DispatchNumber: folder.DispatchNumber
},
}
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
serialNumber: document.DocId,
taskStartDate: document.DocDate,
isEvent: true,
workflowInstanceDataFields: {
FolderID: null,
Subject: document.Assunto,
DispatchNumber: null,
SourceSecFsID: document.ApplicationID || document.ApplicationId,
SourceType: 'DOC',
SourceID: document.DocId,
}
}
} else {
console.log('unexpected ApplicationID')
}
this.task = task
console.log('this.task = task', this.task)
this.task = task
const popover = await this.popoverController.create({
component: SearchedDocumentOptionsPage,
cssClass: 'exp-options',
componentProps: {
task: this.task,
LoadedDocument: this.LoadedDocument
},
translucent: true
});
await popover.present()
// const modal = await this.modalController.create({
// component: ViewDocumentPage,
// componentProps: {
// trustedUrl: '',
// file: {
// title: task.workflowInstanceDataFields.Subject,
// url: '',
// title_link: '',
// },
// Document: this.LoadedDocument,
// applicationId: task.workflowInstanceDataFields.SourceSecFsID,
// docId: this.LoadedDocument.DocId || this.LoadedDocument.DocID,
// folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
// },
// cssClass: 'modal modal-desktop'
// });
// await modal.present();
// });
popover.onDidDismiss().then((res:any) => {
if(res.data.component == 'openBookMeetingModal') {
this.openBookMeetingModal()
} else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction)
} else {
console.log(res.data)
}
});
const selectedDoc = this.loadedEvent.Attachments[ this.dicIndex]
});
console.log('selectedDoc', selectedDoc)
}
async openTaskOptions() {
let task: ExpedientTaskModalPageNavParamsTask
let document: SearchDocumentDetails = this.loadedEvent.Attachments[ this.dicIndex];
let folder: SearchFolderDetails = this.loadedEvent.Attachments[ this.dicIndex];
if(this.loadedEvent.Attachments[this.dicIndex].ApplicationID == 361 || this.loadedEvent.Attachments[this.dicIndex].ApplicationId == 361) {
task = {
serialNumber: folder.DispatchNumber,
taskStartDate: folder.DateDispatch,
isEvent: true,
workflowInstanceDataFields: {
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
Subject: folder.Assunto,
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
SourceType: 'FOLDER',
SourceID: folder.folderId,
DispatchNumber: folder.DispatchNumber
},
}
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
serialNumber: document.DocId,
taskStartDate: document.DocDate,
isEvent: true,
workflowInstanceDataFields: {
FolderID: null,
Subject: document.Assunto,
DispatchNumber: null,
SourceSecFsID: document.ApplicationID || document.ApplicationId,
SourceType: 'DOC',
SourceID: document.DocId,
}
this.task = {
serialNumber: '',
taskStartDate: '',
isEvent: true,
workflowInstanceDataFields: {
FolderID: '',
Subject: selectedDoc.SourceName,
SourceSecFsID: selectedDoc.ApplicationId,
SourceType: 'DOC',
SourceID: selectedDoc.SourceId,
DispatchNumber: ''
}
}
this.task = task
const popover = await this.popoverController.create({
component: SearchedDocumentOptionsPage,
cssClass: 'exp-options',
componentProps: {
task: this.task,
LoadedDocument: this.LoadedDocument
},
translucent: true
});
await popover.present()
popover.onDidDismiss().then((res:any) => {
if(res.data.component == 'openBookMeetingModal') {
this.openBookMeetingModal()
} else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction)
} else {
console.log(res.data)
console.log('component not found')
}
});
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
trustedUrl: '',
file: {
title: this.task.workflowInstanceDataFields.Subject,
url: '',
title_link: '',
},
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
docId: selectedDoc.SourceId,
folderId: ''
},
cssClass: 'modal modal-desktop'
});
await modal.present();
}
@@ -332,7 +289,7 @@ export class ViewEventPage implements OnInit {
component: DocumentSetUpMeetingPage,
componentProps: {
subject: this.task.workflowInstanceDataFields.Subject,
document: this.loadedEvent,
document: this.loadedEvent.Attachments[ this.dicIndex],
},
cssClass: classs,
backdropDismiss: false
@@ -357,8 +314,8 @@ export class ViewEventPage implements OnInit {
componentProps: {
taskAction: taskAction,
task: this.task,
seachDocuments: this.loadedEvent,
aplicationId: this.loadedEvent.ApplicationId || this.loadedEvent.ApplicationID
seachDocuments: this.loadedEvent.Attachments[ this.dicIndex],
aplicationId: this.loadedEvent.Attachments[ this.dicIndex].ApplicationId || this.loadedEvent.Attachments[ this.dicIndex].ApplicationID
},
cssClass: classs,
});
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EventDetailsDocumentsOptionsPage } from './event-details-documents-options.page';
const routes: Routes = [
{
path: '',
component: EventDetailsDocumentsOptionsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class EventDetailsDocumentsOptionsPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { EventDetailsDocumentsOptionsPageRoutingModule } from './event-details-documents-options-routing.module';
import { EventDetailsDocumentsOptionsPage } from './event-details-documents-options.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
EventDetailsDocumentsOptionsPageRoutingModule
],
declarations: [EventDetailsDocumentsOptionsPage]
})
export class EventDetailsDocumentsOptionsPageModule {}
@@ -0,0 +1,10 @@
<ion-content class="container width-100 ">
<div class="buttons">
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
</div>
</ion-content>
@@ -0,0 +1,61 @@
.container{
--padding-top:20px !important;
--padding-bottom:20px !important;
--padding-start:20px !important;
--padding-end:20px !important;
width: 100%;
}
.arrow-right{
display: none;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.solid {
width: 90%;
border-top: 1px solid #bbb;
margin: 0 auto !important;
}
.btn-ok, .btn-cancel{
//width: 50% !important;
margin-bottom: 5px !important;
margin-top: 5px !important;
}
@media only screen and (max-width: 800px) {
.btn-ok, .btn-cancel, .btn-delete{
width: 100% !important;
}
}
@media only screen and (min-width: 1024px) {
.arrow-right{
display: flex;
justify-content: flex-end;
}
.btn-cancel{
width: 100% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
/* .solid{
display: block;
} */
}
.desk{
text-align: left;
background-color: white;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { EventDetailsDocumentsOptionsPage } from './event-details-documents-options.page';
describe('EventDetailsDocumentsOptionsPage', () => {
let component: EventDetailsDocumentsOptionsPage;
let fixture: ComponentFixture<EventDetailsDocumentsOptionsPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ EventDetailsDocumentsOptionsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(EventDetailsDocumentsOptionsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,44 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
import { TaskService } from 'src/app/Rules/task.service'
import { ExpedienteService } from 'src/app/Rules/expediente.service';
import { PermissionService } from 'src/app/services/worker/permission.service';
@Component({
selector: 'app-event-details-documents-options',
templateUrl: './event-details-documents-options.page.html',
styleUrls: ['./event-details-documents-options.page.scss'],
})
export class EventDetailsDocumentsOptionsPage implements OnInit {
constructor(
public p: PermissionService,
private modalController: ModalController,
) {}
ngOnInit() {}
close() {
this.modalController.dismiss();
}
goBack() {
this.modalController.dismiss();
}
async openBookMeetingModal() {
this.modalController.dismiss({component:'openBookMeetingModal', taskAction: ''});
}
async openExpedientActionsModal( taskAction: any) {
this.modalController.dismiss({component:'openExpedientActionsModal', taskAction});
}
async distartExpedientModal(body:any) {}
}
@@ -220,7 +220,6 @@ export class OptsExpedientePage implements OnInit {
});
}
async sendToReview(note:string, documents:any) {
let body = {
"serialNumber": this.task.SerialNumber,
@@ -42,7 +42,6 @@
justify-content: flex-end;
}
.btn-cancel{
display: none;
width: 100% !important;
margin-bottom: 10px !important;
}
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import {PopoverController } from '@ionic/angular';
import { PermissionService } from 'src/app/services/worker/permission.service';
@Component({
@@ -14,15 +14,10 @@ export class SearchedDocumentOptionsPage implements OnInit {
constructor(
private popoverController: PopoverController,
private modalController: ModalController,
private navParams: NavParams,
public p: PermissionService
) { }
) {}
ngOnInit() {
this.task = this.navParams.get('task');
this.LoadedDocument = this.navParams.get('LoadedDocument')
}
ngOnInit() {}
close() {
this.popoverController.dismiss();