Last git pull made

This commit is contained in:
Eudes Inácio
2021-10-07 17:05:14 +01:00
41 changed files with 695 additions and 351 deletions
@@ -3,7 +3,7 @@
<div class="main-header">
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar Evento</ion-label>
<ion-label class="title">Editar Evento aganda</ion-label>
</div>
</div>
<ion-progress-bar class="calendar-progress-bar" type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -13,8 +13,6 @@
<ion-content>
<div class="main-content">
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
</div>
@@ -284,7 +282,7 @@
</ion-label>
</div>
<div class="d-flex container-div width-100" *ngFor="let document of postEvent.Attachments; let i = index" >
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments; let i = index" >
<ion-list class="width-100 list" *ngIf="!document.remove">
<ion-item class="width-100">
<ion-label class="width-100">
@@ -296,7 +294,6 @@
<span class="close-button text-black cursor-pointer" (click)="deleteAttachment(document.Id, i)" >
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
</span>
</p>
<p><span class="span-left">{{document.Stakeholders}}</span><span class="span-right"> {{document.CreateDate | date: 'dd-MM-yyyy HH:mm'}} </span></p>
</ion-label>
@@ -125,6 +125,8 @@ export class EditEventPage implements OnInit {
}
this.loadedEventAttachments = this.loadedEventAttachments.concat(this.postEvent.Attachments)
this.getRecurrenceTypes();
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
@@ -268,15 +270,18 @@ export class EditEventPage implements OnInit {
this.clearPostEvent.emit();
this.deleteTemporaryData();
this.close();
this.saveDocument()
await this.saveDocument()
this.close();
}
saveDocument() {
async saveDocument() {
this.loadedEventAttachments.forEach((e)=>{
console.log(this.loadedEventAttachments)
await this.loadedEventAttachments.forEach( async (e)=>{
const id: any = e.Id
const remove = e['remove']
@@ -329,8 +334,6 @@ export class EditEventPage implements OnInit {
}
saveTemporaryData() {
window['temp.path:/home/agenda/edit-event.component.ts'] = {
@@ -413,7 +416,6 @@ export class EditEventPage implements OnInit {
console.log( this.loadedEventAttachments)
this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
}
});
}
@@ -92,7 +92,7 @@
<span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</span>
</div>
<div (click)="docIndex(i);openTaskOptions()" class="doc-options">
<div (click)="docIndex(i);LoadDocumentDetails()" class="doc-options">
<ion-icon src="assets/images/icons-menu.svg" ></ion-icon>
</div>
@@ -100,8 +100,7 @@
</li>
</ion-list>
</div>
<!-- <div class="line"></div> -->
</div>
</ion-content>
@@ -6,9 +6,13 @@ 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';
import { ProcessesService } from 'src/app/services/processes.service';
import { OptsExpedientePage } from '../../popover/opts-expediente/opts-expediente.page';
import { ToastService } from 'src/app/services/toast.service';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
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';
@Component({
selector: 'app-view-event',
@@ -17,14 +21,15 @@ import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-eve
})
export class ViewEventPage implements OnInit {
loadedEvent: Event;
loadedEvent: any;
isEventEdited: boolean;
eventBody: EventBody;
loadedAttachments:any;
pageId: string;
showLoader: boolean;
task: ExpedientTaskModalPageNavParamsTask;
minDate: Date;
LoadedDocument:any = null;
customDate:any;
today:any;
@@ -47,9 +52,8 @@ export class ViewEventPage implements OnInit {
private processes: ProcessesService,
private modalController: ModalController,
public popoverController: PopoverController,
private toastService: ToastService,
)
{
private toastService: ToastService
) {
this.isEventEdited = false;
this.loadedEvent = new Event();
this.eventBody = { BodyType : "1", Text : ""};
@@ -57,19 +61,16 @@ export class ViewEventPage implements OnInit {
}
ngOnInit() {
/* console.log(this.eventId); */
this.loadEvent();
//this.getAttachments();
}
doRefresh(ev){
doRefresh(ev) {
this.loadEvent();
ev.target.complete();
}
ngOnChanges(changes: any): void {
this.loadedAttachments = null;
this.loadedEvent.Attachments = null;
this.loadEvent();
}
@@ -100,7 +101,7 @@ 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', )
// console.log('errer', )
this.viewEventDetailDismiss.emit({
type: 'close'
@@ -118,12 +119,27 @@ export class ViewEventPage implements OnInit {
async deleteEvent() {
if (this.loadedEvent.IsRecurring) {
const loader = this.toastService.loading()
} else {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
this.toastService.successMessage('Evento apagado');
this.close();
},()=>{},
()=>{
loader.remove();
});
} else {
const loader = this.toastService.loading()
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
this.toastService.successMessage('Evento apagado');
this.close();
},()=>{},
()=>{
loader.remove();
});
}
}
@@ -143,7 +159,6 @@ export class ViewEventPage implements OnInit {
}
async editEvent() {
this.viewEventDetailDismiss.emit({
type: 'edit',
@@ -161,51 +176,195 @@ export class ViewEventPage implements OnInit {
});
}
async LoadDocumentDetails() {
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
const applicationId = 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
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
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()
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)
}
});
});
}
async openTaskOptions() {
const doc = this.loadedAttachments[ this.dicIndex];
let task: ExpedientTaskModalPageNavParamsTask
let document: SearchDocumentDetails = this.loadedEvent.Attachments[ this.dicIndex];
let folder: SearchFolderDetails = this.loadedEvent.Attachments[ this.dicIndex];
let customTask;
if(doc.ApplicationID == 361 || doc.ApplicationId == 361) {
customTask = {
serialNumber: doc.DispatchNumber,
taskStartDate: doc.DateDispatch,
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: {
FsId: doc.ApplicationID,
FolderID: null,
DocId: doc.DispatchNumber,
Subject: doc.Assunto
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 (doc.ApplicationID == 8 || doc.ApplicationId == 8) {
customTask = {
serialNumber: doc.DocId,
taskStartDate: doc.DocDate,
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
serialNumber: document.DocId,
taskStartDate: document.DocDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationID || doc.ApplicationId,
FolderID: null,
DocId: doc.DocId,
Subject: doc.Assunto
Subject: document.Assunto,
DispatchNumber: null,
SourceSecFsID: document.ApplicationID || document.ApplicationId,
SourceType: 'DOC',
SourceID: document.DocId,
}
}
}
console.log(doc)
customTask.Status = ''
this.task = task
const popover = await this.modalController.create({
component: OptsExpedientePage,
cssClass: 'model aside-modal search-submodal',
const popover = await this.popoverController.create({
component: SearchedDocumentOptionsPage,
cssClass: 'exp-options',
componentProps: {
fulltask: customTask,
task: customTask
task: this.task,
LoadedDocument: this.LoadedDocument
},
//translucent: true
translucent: true
});
return await popover.present();
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')
}
});
}
async openBookMeetingModal() {
let classs;
if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DocumentSetUpMeetingPage,
componentProps: {
subject: this.task.workflowInstanceDataFields.Subject,
document: this.loadedEvent,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
//this.location.back();
});
}
// efetuar despacho
async openExpedientActionsModal( taskAction: any) {
let classs;
if( window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: this.task,
seachDocuments: this.loadedEvent,
aplicationId: this.loadedEvent.ApplicationId || this.loadedEvent.ApplicationID
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then( async(res)=>{});
}
}
@@ -59,10 +59,11 @@
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<div class="file-details add-ellipsis" *ngIf="msg.file">
<span (click)="viewDocument(file.title_link)" class="cursor-pointer">
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
</span>
<ion-label class="file-title">{{file.title}}</ion-label>
@@ -126,9 +127,31 @@
<ion-footer>
<div class="container width-100 d-flex">
<div>
<button class="btn-no-color" (click)="openSendGroupMessageOptions()">
<!-- <button class="btn-no-color" (click)="openSendGroupMessageOptions()">
<ion-icon class="chat-icon-options" src="assets/images/icons-add-new-event.svg"></ion-icon>
</button>
</button> -->
<ion-fab horizontal="start" vertical="bottom" slot="fixed">
<ion-fab-button color="light" size="small">
<ion-icon name="add"></ion-icon>
</ion-fab-button>
<ion-fab-list side="top">
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
<div class="width-80">
<ion-item class="ion-no-padding type-message" lines="none">
@@ -17,6 +17,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from 'src/app/services/processes.service';
import { FileService } from 'src/app/services/functions/file.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
/*
@@ -89,7 +90,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnChanges(changes: SimpleChanges): void {
//this.getRoomInfo();
this.getRoomInfo();
//this.scrollToBottom();
}
@@ -607,8 +608,48 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
}
viewDocument(url:string){
this.fileService.viewDocumentByUrl(url);
viewDocument(file:any){
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link;
this.fileService.viewDocumentByUrl(fullUrl);
}
else{
this.fileService.viewDocumentByUrl(file.title_link);
//this.openViewDocumentModal(file);
}
}
async openViewDocumentModal(file:any){
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
file: file,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
}
addFileWebtrix(){
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
}
bookMeeting(){
let data = {
roomId: this.roomId,
members: this.members
}
this.openNewEventPage.emit(data);
}
async _openChatOptions() {
@@ -51,8 +51,8 @@
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<div class="file-details add-ellipsis" *ngIf="msg.file">
<span *ngIf="msg.file.type" (click)="viewDocument(file.title_link)" class="cursor-pointer">
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
@@ -99,9 +99,33 @@
<ion-footer>
<div class="container width-100 d-flex">
<div>
<button class="btn-no-color" (click)="openSendMessageOptions()">
<!-- <button class="btn-no-color" (click)="openSendMessageOptions()">
<ion-icon class="chat-icon-options" src="assets/images/icons-add-new-event.svg"></ion-icon>
</button>
</button> -->
<ion-fab horizontal="start" vertical="bottom" slot="fixed">
<ion-fab-button color="light" size="small">
<ion-icon name="add"></ion-icon>
</ion-fab-button>
<ion-fab-list side="top">
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
<div class="width-80">
<ion-item class="ion-no-padding type-message" lines="none">
+48 -3
View File
@@ -14,6 +14,8 @@ import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
import { TimeService } from 'src/app/services/functions/time.service';
import { FileService } from 'src/app/services/functions/file.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@Component({
selector: 'app-messages',
@@ -68,13 +70,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private timeService: TimeService,
private fileService: FileService,
private gestureController: GestureController,
private http:HttpClient,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
/* this.dm = this.navParams.get('dm'); */
}
ngOnChanges(changes: SimpleChanges): void {
this.load();
//this.load();
//throw new Error('Method not implemented.');
}
@@ -239,8 +242,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
}
viewDocument(url:string){
this.fileService.viewDocumentByUrl(url);
viewDocument(file:any){
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link;
this.fileService.viewDocumentByUrl(fullUrl);
}
else{
this.fileService.viewDocumentByUrl(file.title_link);
//this.openViewDocumentModal(file);
}
}
async openViewDocumentModal(file:any){
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
file: file,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
getChatMembers() {
@@ -356,6 +379,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
}
addFileWebtrix(){
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
}
bookMeeting(){
let data = {
roomId: this.roomId,
members: this.members
}
this.openNewEventPage.emit(data);
}
async _openChatOptions() {
const enterAnimation = (baseEl: any) => {
@@ -8,7 +8,7 @@
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar evento por aprovar::.</ion-label>
<ion-label class="title">Editar evento por aprovar</ion-label>
</div>
</div>
</ion-header>