This commit is contained in:
Peter Maquiran
2021-09-27 16:23:41 +01:00
parent c13080d2ad
commit 50bb9120b5
423 changed files with 126597 additions and 312 deletions
+3 -3
View File
@@ -3,10 +3,10 @@
<name>gabinete digital</name> <name>gabinete digital</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" /> <content original-src="index.html" src="http://localhost:8101" />
<access origin="*" /> <access origin="*" />
<allow-navigation href="http://*/*" /> <allow-navigation href="*" />
<allow-navigation href="https://*/*" /> <allow-navigation href="*" />
<allow-intent href="http://*/*" /> <allow-intent href="http://*/*" />
<allow-intent href="https://*/*" /> <allow-intent href="https://*/*" />
<allow-intent href="tel:*" /> <allow-intent href="tel:*" />
+15 -3
View File
@@ -6732,6 +6732,11 @@
} }
} }
}, },
"@pdftron/pdfjs-express": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/@pdftron/pdfjs-express/-/pdfjs-express-8.0.1.tgz",
"integrity": "sha512-zSX8i2CwouW3bjrRHm7i1oeYPYWKQpUs3sprGm0qYcvMytpGJ2F2nKJ3iQLlUxyfgUJB3akolAmjlQuPjEwk2g=="
},
"@scarf/scarf": { "@scarf/scarf": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.0.tgz",
@@ -21759,6 +21764,13 @@
"requires": { "requires": {
"pdfjs-dist": "~2.7.570", "pdfjs-dist": "~2.7.570",
"tslib": "^2.0.0" "tslib": "^2.0.0"
},
"dependencies": {
"pdfjs-dist": {
"version": "2.7.570",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.7.570.tgz",
"integrity": "sha512-/ZkA1FwkEOyDaq11JhMLazdwQAA0F9uwrP7h/1L9Akt9KWh1G5/tkzS+bPuUELq2s2GDFnaT+kooN/aSjT7DXQ=="
}
} }
}, },
"ngx-socket-io": { "ngx-socket-io": {
@@ -22627,9 +22639,9 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
}, },
"pdfjs-dist": { "pdfjs-dist": {
"version": "2.7.570", "version": "2.9.359",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.7.570.tgz", "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.9.359.tgz",
"integrity": "sha512-/ZkA1FwkEOyDaq11JhMLazdwQAA0F9uwrP7h/1L9Akt9KWh1G5/tkzS+bPuUELq2s2GDFnaT+kooN/aSjT7DXQ==" "integrity": "sha512-P2nYtkacdlZaNNwrBLw1ZyMm0oE2yY/5S/GDCAmMJ7U4+ciL/D0mrlEC/o4HZZc/LNE3w8lEVzBEyVgEQlPVKQ=="
}, },
"pend": { "pend": {
"version": "1.2.0", "version": "1.2.0",
+2
View File
@@ -62,6 +62,7 @@
"@logisticinfotech/ionic4-datepicker": "^1.4.4", "@logisticinfotech/ionic4-datepicker": "^1.4.4",
"@ng-bootstrap/ng-bootstrap": "^9.1.2", "@ng-bootstrap/ng-bootstrap": "^9.1.2",
"@ngx-translate/core": "^13.0.0", "@ngx-translate/core": "^13.0.0",
"@pdftron/pdfjs-express": "^8.0.1",
"@types/jest-environment-puppeteer": "^4.4.1", "@types/jest-environment-puppeteer": "^4.4.1",
"@types/puppeteer": "^5.4.4", "@types/puppeteer": "^5.4.4",
"angular-calendar": "^0.28.22", "angular-calendar": "^0.28.22",
@@ -95,6 +96,7 @@
"moment": "^2.29.1", "moment": "^2.29.1",
"ng2-pdf-viewer": "^7.0.1", "ng2-pdf-viewer": "^7.0.1",
"ngx-socket-io": "^3.2.0", "ngx-socket-io": "^3.2.0",
"pdfjs-dist": "^2.9.359",
"puppeteer": "^10.1.0", "puppeteer": "^10.1.0",
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7", "rxjs-compat": "^6.6.7",
@@ -3,6 +3,7 @@
<domain-config cleartextTrafficPermitted="true"> <domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain> <domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">192.168.0.244</domain> <domain includeSubdomains="true">192.168.0.244</domain>
<domain includeSubdomains="true">laptop-46</domain>
<domain includeSubdomains="true">gpr-dev-10.gabinetedigital.local</domain> <domain includeSubdomains="true">gpr-dev-10.gabinetedigital.local</domain>
</domain-config> </domain-config>
</network-security-config> </network-security-config>
+4
View File
@@ -191,12 +191,16 @@ const routes = [
{ {
path: 'chat-options-features', path: 'chat-options-features',
loadChildren: () => import('./modals/chat-options-features/chat-options-features.module').then( m => m.ChatOptionsFeaturesPageModule) loadChildren: () => import('./modals/chat-options-features/chat-options-features.module').then( m => m.ChatOptionsFeaturesPageModule)
},
{
path: 'document-viewer',
loadChildren: () => import('./modals/document-viewer/document-viewer.module').then( m => m.DocumentViewerPageModule) loadChildren: () => import('./modals/document-viewer/document-viewer.module').then( m => m.DocumentViewerPageModule)
}, },
/* /*
path: 'chat', path: 'chat',
+1
View File
@@ -181,6 +181,7 @@ export class HomePage implements OnInit {
}) })
synchro.conected
synchro.registerCallback('Notification', (DataArray)=> { synchro.registerCallback('Notification', (DataArray)=> {
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DocumentViewerPage } from './document-viewer.page';
const routes: Routes = [
{
path: '',
component: DocumentViewerPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DocumentViewerPageRoutingModule {}
@@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DocumentViewerPageRoutingModule } from './document-viewer-routing.module';
import { DocumentViewerPage } from './document-viewer.page';
import { PdfViewerModule } from 'ng2-pdf-viewer';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DocumentViewerPageRoutingModule,
//
PdfViewerModule
],
declarations: [DocumentViewerPage]
})
export class DocumentViewerPageModule {}
@@ -0,0 +1,22 @@
<ion-header class="ion-no-border">
<ion-toolbar class="d-flex">
<div class="d-flex px-20 pt-20">
<div class="cursor-pointer" (click)="close()">
<ion-icon class="font-35" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div class="font-25">{{ fileName }}</div>
</div>
</ion-toolbar>
</ion-header>
<ion-content class="pt-10 height-100">
<div *ngIf="pdfSrc" class="height-100">
<iframe id="iframe" src="https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=https://equilibrium.dyndns.info/FileShare/merged_fastview.pdf" height="100%" width="100%" title="Iframe Example"></iframe>
</div>
</ion-content>
@@ -0,0 +1,14 @@
ion-content {
background-color: #ececec;
}
.ng2-pdf-viewer-container {
padding-top: 10px;
}
#pdf-container {
canvas {
width: 100%;
height: 100%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DocumentViewerPage } from './document-viewer.page';
describe('DocumentViewerPage', () => {
let component: DocumentViewerPage;
let fixture: ComponentFixture<DocumentViewerPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DocumentViewerPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DocumentViewerPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,212 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
@Component({
selector: 'app-document-viewer',
templateUrl: './document-viewer.page.html',
styleUrls: ['./document-viewer.page.scss'],
})
export class DocumentViewerPage implements OnInit {
pdfSrc = 'http://laptop-46/FileShare/Test_25MB.pdf';
task = null
DocId = null
fileName = ''
link = ''
constructor(
private modalController: ModalController,
private navParams: NavParams,
private processes: ProcessesService) {
this.task = this.navParams.get('task') || null;
this.DocId = this.navParams.get('DocId');
if(this.navParams.get('pdfSrc')) {
this.pdfSrc = this.navParams.get('pdfSrc') || null;
}
}
ngOnInit() {
this.processes.getFileBase64(this.DocId).subscribe((res: any) => {
console.log(res)
this.pdfSrc= 'data:application/pdf;base64,'+ res.file
this.fileName = res.name
})
// this.setPdfViewer()
// setTimeout(() => {
// document.getElementById('iframe')['contentWindow'].postMessage(
// {
// sender: "get_page_button1",
// message: 'url'
// }, "*")
// }, 3000)
}
setPdfViewer() {
setTimeout( async () => {
// If absolute URL from the remote server is provided, configure the CORS
// header on that server.
var url = 'http://192.168.0.87:3000/000634977.pdf';
const pdfjsWorker = await import('pdfjs-dist/build/pdf.worker.entry');
// Loaded via <script> tag, create shortcut to access PDF.js exports.
var pdfjsLib = await import('pdfjs-dist/build/pdf');
// The workerSrc property shall be specified.
// pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
var pdfDoc = null,
pageNum = 1,
pageRendering = false,
pageNumPending = null,
scale = 0.8,
canvas: any = document.getElementById('the-canvas'),
ctx = canvas.getContext('2d');
/**
* Get page info from document, resize canvas accordingly, and render page.
* @param num Page number.
*/
function renderPage(num) {
pageRendering = true;
// Using promise to fetch the page
pdfDoc.getPage(num).then(function(page) {
var viewport = page.getViewport({scale: scale});
canvas.height = viewport.height;
canvas.width = viewport.width;
// Render PDF page into canvas context
var renderContext = {
canvasContext: ctx,
viewport: viewport
};
var renderTask = page.render(renderContext);
// Wait for rendering to finish
renderTask.promise.then(function() {
pageRendering = false;
if (pageNumPending !== null) {
// New page rendering is pending
renderPage(pageNumPending);
pageNumPending = null;
}
});
});
// Update page counters
// document.getElementById('page_num').textContent = num;
}
/**
* If another page rendering in progress, waits until the rendering is
* finised. Otherwise, executes rendering immediately.
*/
function queueRenderPage(num) {
if (pageRendering) {
pageNumPending = num;
} else {
renderPage(num);
}
}
/**
* Displays previous page.
*/
function onPrevPage() {
if (pageNum <= 1) {
return;
}
pageNum--;
queueRenderPage(pageNum);
}
document.getElementById('prev').addEventListener('click', onPrevPage);
/**
* Displays next page.
*/
function onNextPage() {
if (pageNum >= pdfDoc.numPages) {
return;
}
pageNum++;
queueRenderPage(pageNum);
}
document.getElementById('next').addEventListener('click', onNextPage);
var currPage = 1; //Pages are 1-based not 0-based
var numPages = 0;
var thePDF = null;
function handlePages(page)
{
//This gives us the page's dimensions at full scale
var viewport = page.getViewport( 1 );
//We'll create a canvas for each page to draw it on
var canvas = document.createElement( "canvas" );
canvas.style.display = "block";
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
//Draw it on the canvas
page.render({canvasContext: context, viewport: viewport});
//Add it to the web page
document.querySelector('#pdf-container').appendChild( canvas );
//Move to next page
currPage++;
if ( thePDF !== null && currPage <= numPages )
{
thePDF.getPage( currPage ).then( handlePages );
}
}
/**
* Asynchronously downloads PDF.
*/
pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) {
pdfDoc = pdfDoc_;
thePDF = pdfDoc_
pdfDoc.getPage(1).then(function(page) {
// you can now use *page* here
alert('first page')
});
// Initial/first page rendering
renderPage(pageNum);
numPages = pdfDoc.numPages;
pdfDoc.getPage( 1 ).then( handlePages );
});
}, 100)
}
close() {
this.modalController.dismiss();
}
}
+20 -20
View File
@@ -137,7 +137,7 @@
<calendar <calendar
class="calendar-component" class="calendar-component"
[eventSource]="calendarService.eventSource" [eventSource]="CalendarStore.eventSource"
[calendarMode]="calendar.mode" [calendarMode]="calendar.mode"
[currentDate]="calendar.currentDate" [currentDate]="calendar.currentDate"
(onEventSelected)="onEventSelected($event)" (onEventSelected)="onEventSelected($event)"
@@ -223,7 +223,6 @@
</div> </div>
<div class="timeline-wrapper flex-grow-1 height-100" > <div class="timeline-wrapper flex-grow-1 height-100" >
<!-- Timeline --> <!-- Timeline -->
<div class="height-100"> <div class="height-100">
@@ -412,6 +411,25 @@
(setIntervenientCC)="setIntervenientCC($event)" (setIntervenientCC)="setIntervenientCC($event)"
></app-edit-event> ></app-edit-event>
<!-- Edit event to approve -->
<app-edit-event-to-approve
class="d-flex flex-column height-100"
*ngIf="mobileComponent.showEditEventToApprove"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[saveData] = "eventToaprove.saveData"
[serialNumber] = "eventToaprove.serialNumber"
(setContact)="setContact($event)"
(clearContact)="clearContact()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(closeComponent)="approveEventDismissGoBack()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(closeEventToApprove)="closeEventToApproveGoBack()"
></app-edit-event-to-approve>
<!-- View --> <!-- View -->
<app-view-event *ngIf="mobileComponent.showEventDetails" <app-view-event *ngIf="mobileComponent.showEventDetails"
[profile]="profile" [profile]="profile"
@@ -446,24 +464,6 @@
> >
</app-approve-event> </app-approve-event>
<!-- Edit event to approve -->
<app-edit-event-to-approve
class="d-flex flex-column height-100"
*ngIf="mobileComponent.showEditEventToApprove"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[saveData] = "eventToaprove.saveData"
[serialNumber] = "eventToaprove.serialNumber"
(setContact)="setContact($event)"
(clearContact)="clearContact()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(closeComponent)="approveEventDismissGoBack()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(closeEventToApprove)="closeEventToApproveGoBack()"
></app-edit-event-to-approve>
<app-attendee-modal <app-attendee-modal
[footer]="true" [footer]="true"
+47 -38
View File
@@ -25,7 +25,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { DateAdapter } from '@angular/material/core'; import { DateAdapter } from '@angular/material/core';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { eventSource } from 'src/app/models/agenda/eventSource'; import { eventSource } from 'src/app/models/agenda/eventSource';
import { CalendarService } from 'src/app/store/calendar.service'; import { CalendarStore } from 'src/app/store/calendar.service';
import { ListBoxService } from 'src/app/services/agenda/list-box.service'; import { ListBoxService } from 'src/app/services/agenda/list-box.service';
@Component({ @Component({
@@ -102,8 +102,8 @@ export class AgendaPage implements OnInit {
postEvent: any; postEvent: any;
// temporary data // temporary data
taskParticipants: any = []; taskParticipants: any[] = [];
taskParticipantsCc: any = []; taskParticipantsCc: any[] = [];
adding: "intervenient" | "CC" = "intervenient"; adding: "intervenient" | "CC" = "intervenient";
@ViewChild(CalendarComponent) myCal: CalendarComponent; @ViewChild(CalendarComponent) myCal: CalendarComponent;
@@ -153,6 +153,7 @@ export class AgendaPage implements OnInit {
yearNum; yearNum;
dropdownScrollWeal = false dropdownScrollWeal = false
CalendarStore = CalendarStore
constructor( constructor(
private alertCtrl: AlertController, private alertCtrl: AlertController,
@@ -165,7 +166,6 @@ export class AgendaPage implements OnInit {
authService: AuthService, authService: AuthService,
private dateAdapter: DateAdapter<any>, private dateAdapter: DateAdapter<any>,
private toastService: ToastService, private toastService: ToastService,
public calendarService: CalendarService,
private listBoxService: ListBoxService private listBoxService: ListBoxService
) { ) {
this.dateAdapter.setLocale('es'); this.dateAdapter.setLocale('es');
@@ -481,12 +481,12 @@ export class AgendaPage implements OnInit {
// calendar // calendar
this.calendarService.removeRange(startTime, endTime, 'md') this.CalendarStore.removeRange(startTime, endTime, 'md')
// loop // loop
this.calendarService.pushEvent(response, 'md'); this.CalendarStore.pushEvent(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -503,11 +503,11 @@ export class AgendaPage implements OnInit {
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
// calendar // calendar
this.calendarService.pushEvent(response, 'pr'); this.CalendarStore.pushEvent(response, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -528,12 +528,12 @@ export class AgendaPage implements OnInit {
// this.eventSource=[]; // this.eventSource=[];
// clear the current month only // clear the current month only
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
this.calendarService.pushEvent(response, 'pr'); this.CalendarStore.pushEvent(response, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
@@ -554,14 +554,14 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
this.calendarService.removeRange(startTime, endTime, 'md') this.CalendarStore.removeRange(startTime, endTime, 'md')
const eventsList = response.filter(data => data.CalendarName == "Pessoal"); const eventsList = response.filter(data => data.CalendarName == "Pessoal");
// loop // loop
this.calendarService.pushEvent(eventsList, 'md'); this.CalendarStore.pushEvent(eventsList, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -576,12 +576,12 @@ export class AgendaPage implements OnInit {
else{ else{
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => { this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
const eventsList = response.filter(data => data.CalendarName == "Pessoal"); const eventsList = response.filter(data => data.CalendarName == "Pessoal");
this.calendarService.pushEvent(eventsList, 'pr'); this.CalendarStore.pushEvent(eventsList, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -603,14 +603,14 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => { this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
this.calendarService.removeRange(startTime, endTime, 'md') this.CalendarStore.removeRange(startTime, endTime, 'md')
const eventsList = res.filter(data => data.CalendarName == "Oficial"); const eventsList = res.filter(data => data.CalendarName == "Oficial");
this.calendarService.pushEvent(eventsList, 'md'); this.CalendarStore.pushEvent(eventsList, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -626,13 +626,13 @@ export class AgendaPage implements OnInit {
// this.eventSource=[]; // this.eventSource=[];
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
const eventsList = res.filter(data => data.CalendarName == "Oficial"); const eventsList = res.filter(data => data.CalendarName == "Oficial");
this.calendarService.pushEvent(eventsList, 'pr'); this.CalendarStore.pushEvent(eventsList, 'pr');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -658,12 +658,12 @@ export class AgendaPage implements OnInit {
let eventsList = response; let eventsList = response;
this.calendarService.removeRange(startTime, endTime, 'md') this.CalendarStore.removeRange(startTime, endTime, 'md')
// loop // loop
this.calendarService.pushEvent(eventsList, 'md'); this.CalendarStore.pushEvent(eventsList, 'md');
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -688,11 +688,11 @@ export class AgendaPage implements OnInit {
let eventsList = response; let eventsList = response;
// clear the current month only // clear the current month only
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
this.calendarService.pushEvent(eventsList, 'pr'); this.CalendarStore.pushEvent(eventsList, 'pr');
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -726,11 +726,11 @@ export class AgendaPage implements OnInit {
} }
// clear the current month only // clear the current month only
this.calendarService.removeRange(startTime, endTime, 'pr') this.CalendarStore.removeRange(startTime, endTime, 'pr')
this.calendarService.pushEvent(eventsList, 'pr'); this.CalendarStore.pushEvent(eventsList, 'pr');
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.myCal.update(); this.myCal.update();
@@ -757,8 +757,8 @@ export class AgendaPage implements OnInit {
updateEventListBox() { updateEventListBox() {
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
} }
@@ -841,13 +841,13 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr") { if(this.profile == "mdgpr") {
this.profile ="pr"; this.profile ="pr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
} }
else { else {
this.profile ="mdgpr"; this.profile ="mdgpr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate}) this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
} }
} }
@@ -1026,6 +1026,9 @@ export class AgendaPage implements OnInit {
EditApproveEventDismiss() { EditApproveEventDismiss() {
this.cloneAllmobileComponent(); this.cloneAllmobileComponent();
this.mobileComponent.showEditEventToApprove = true; this.mobileComponent.showEditEventToApprove = true;
this.taskParticipants = []
this.taskParticipantsCc = []
} }
async cloneAllmobileComponent() { async cloneAllmobileComponent() {
@@ -1105,12 +1108,18 @@ export class AgendaPage implements OnInit {
} }
async setIntervenient(data) { async setIntervenient(data) {
setTimeout(()=>{
this.taskParticipants = removeDuplicate(data) this.taskParticipants = removeDuplicate(data)
}, 10)
} }
async setIntervenientCC(data) { async setIntervenientCC(data) {
setTimeout(()=>{
this.taskParticipantsCc = removeDuplicate(data) this.taskParticipantsCc = removeDuplicate(data)
}, 10)
} }
// Emitters // Emitters
-6
View File
@@ -108,10 +108,4 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <pdf-viewer [src]=pdfSrc
[render-text]="true"
style="display: block;"
></pdf-viewer> -->
</ion-content> </ion-content>
+1
View File
@@ -122,6 +122,7 @@ export class EventsPage implements OnInit {
this.hideSearch(); this.hideSearch();
//this.checkScreenOrientation(); //this.checkScreenOrientation();
} }
hideSearch(){ hideSearch(){
+9 -1
View File
@@ -7,6 +7,7 @@ import { environment } from 'src/environments/environment';
import { AlertController } from '@ionic/angular'; import { AlertController } from '@ionic/angular';
import { NotificationsService } from 'src/app/services/notifications.service'; import { NotificationsService } from 'src/app/services/notifications.service';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { ClearStoreService } from 'src/app/services/clear-store.service';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
@@ -31,7 +32,8 @@ export class LoginPage implements OnInit {
private router: Router, private router: Router,
private authService: AuthService, private authService: AuthService,
private toastService: ToastService, private toastService: ToastService,
public alertController: AlertController public alertController: AlertController,
private clearStoreService: ClearStoreService
) { ) {
} }
@@ -77,8 +79,12 @@ export class LoginPage implements OnInit {
BasicAuthKey: "" BasicAuthKey: ""
} }
const loader = this.toastService.loading()
let attempt = await this.authService.login(this.userattempt, {saveSession: false}) let attempt = await this.authService.login(this.userattempt, {saveSession: false})
loader.remove()
if (attempt) { if (attempt) {
if (attempt.UserId == SessionStore.user.UserId) { if (attempt.UserId == SessionStore.user.UserId) {
@@ -89,6 +95,8 @@ export class LoginPage implements OnInit {
this.goback() this.goback()
} else { } else {
this.clearStoreService.clear()
SessionStore.delete() SessionStore.delete()
window.localStorage.clear(); window.localStorage.clear();
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
@@ -107,12 +107,11 @@ export class PublicationDetailPage implements OnInit {
try { try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage('Publicação eliminada') this.toastService.successMessage('Publicação eliminada')
this.goBack();
} catch (error) { } catch (error) {
this.toastService.badRequest('Publicaçao não eliminada') this.toastService.badRequest('Publicaçao não eliminada')
} finally { } finally {
loader.remove() loader.remove()
this.goBack();
} }
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ClearStoreService } from './clear-store.service';
describe('ClearStoreService', () => {
let service: ClearStoreService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ClearStoreService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+33
View File
@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import { DespachoStore } from 'src/app/store/despacho-store.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
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 { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { DeplomasStore } from '../store/deplomas.service';
import { CalendarStore } from 'src/app/store/calendar.service';
@Injectable({
providedIn: 'root'
})
export class ClearStoreService {
constructor() { }
clear() {
DespachoStore.reset([])
EventoAprovacaoStore.resetmd([])
EventoAprovacaoStore.resetpr([])
ExpedienteGdStore.reset([])
PendentesStore.reset([])
PedidosStore.resetdeferimento([])
PedidosStore.resetparecer([])
DespachosprStore.reset([])
DeplomasStore.resetDiplomasAssinadoList([])
DeplomasStore.resetDiplomasList([])
DeplomasStore.resetDiplomasReview([])
CalendarStore.delete()
}
}
+15
View File
@@ -307,4 +307,19 @@ export class ProcessesService {
return this.http.post<any>(`${url}`,body, options); return this.http.post<any>(`${url}`,body, options);
} }
getFileBase64(DocId: string | number) {
let url = environment.apiURL + 'ecm/document/file';
let params = new HttpParams();
params = params.set("docid", DocId);
let options: any = {
headers: this.headers,
params
}
return this.http.get<any>(`${url}`, options);
}
} }
+3 -1
View File
@@ -36,7 +36,9 @@ class SynchroService {
}[] = [] }[] = []
private msgQueue = [] private msgQueue = []
constructor(){} constructor() {
// alert(SessionStore.user.FullName)
}
get connected() { get connected() {
return this._connected return this._connected
@@ -153,6 +153,7 @@ export class EditEventToApprovePage implements OnInit {
// description // description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body this.eventProcess.workflowInstanceDataFields.Body = body
this.eventProcess.workflowInstanceDataFields.Category = this.eventProcess.workflowInstanceDataFields.EventType
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments() this.getAttachments()
@@ -171,7 +172,6 @@ export class EditEventToApprovePage implements OnInit {
} }
onSelectedRecurringChanged(ev:any){ onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){ if(ev.length > 1){
console.log(ev.filter(data => data != '-1')); console.log(ev.filter(data => data != '-1'));
this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1'); this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1');
@@ -215,9 +215,9 @@ export class EditEventToApprovePage implements OnInit {
this.closeEventToApprove.emit(); this.closeEventToApprove.emit();
/* this.setIntervenient.emit([]); this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]); this.setIntervenientCC.emit([]);
this.clearContact.emit(); */ this.clearContact.emit();
//this.deleteTemporaryData(); //this.deleteTemporaryData();
} }
@@ -89,9 +89,7 @@ export class EditEventPage implements OnInit {
public alertController: AlertController, public alertController: AlertController,
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
private toastService: ToastService, private toastService: ToastService,
) { ) {}
}
ngOnInit() { ngOnInit() {
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border px-20"> <ion-header class="ion-no-border px-20">
<ion-toolbar class="px-10"> <ion-toolbar class="px-10">
<ion-title class="pa-0">Adicionar intervenientes</ion-title> <ion-title class="pa-0">Adicionar intervenientes aganda</ion-title>
</ion-toolbar> </ion-toolbar>
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" --> <ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -3,7 +3,6 @@ import { ModalController } from '@ionic/angular';
import { ContactsService } from 'src/app/services/contacts.service'; import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { slugify } from 'src/plugin/javascript-remove-accents.js';
@Component({ @Component({
selector: 'app-attendee-modal', selector: 'app-attendee-modal',
@@ -66,8 +65,8 @@ export class AttendeePage implements OnInit {
save() { save() {
this.setIntervenient.emit(this.LtaskParticipants); this.setIntervenient.emit(removeDuplicate(this.LtaskParticipants));
this.setIntervenientCC.emit(this.LtaskParticipantsCc); this.setIntervenientCC.emit(removeDuplicate(this.LtaskParticipantsCc));
this.closeComponent.emit(); this.closeComponent.emit();
} }
@@ -88,12 +88,16 @@ export class PublicationDetailPage implements OnInit {
async deletePost(){ async deletePost(){
const laoder = this.toastService.loading()
try { try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage("Publicação eliminado") this.toastService.successMessage("Publicação eliminado")
this.goBackToViewPublications.emit(); this.goBackToViewPublications.emit();
} catch (error) { } catch (error) {
this.toastService.badRequest("Publicação não eliminado") this.toastService.badRequest("Publicação não eliminado")
} finally {
laoder.remove()
} }
} }
+13 -4
View File
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { eventSource } from '../models/agenda/eventSource'; import { eventSource } from '../models/agenda/eventSource';
import { SHA1, SHA256, AES, enc } from 'crypto-js' import { SHA1, SHA256, AES, enc } from 'crypto-js'
import { LocalstoreService } from './localstore.service' import { localstoreService } from './localstore.service'
import { EventList, EventListStore } from '../models/agenda/AgendaEventList'; import { EventList, EventListStore } from '../models/agenda/AgendaEventList';
@Injectable({ @Injectable({
@@ -13,11 +13,13 @@ export class CalendarService {
private _eventSource : EventListStore[] = [] private _eventSource : EventListStore[] = []
private keyName: string; private keyName: string;
constructor(private localstoreService: LocalstoreService) { localstoreService = localstoreService
constructor() {
this.keyName = (SHA1(this.constructor.name+ 'eventSource')).toString() this.keyName = (SHA1(this.constructor.name+ 'eventSource')).toString()
let restore = localstoreService.get(this.keyName, []) let restore = this.localstoreService.get(this.keyName, [])
setTimeout(()=>{ setTimeout(()=>{
restore.forEach((element:EventListStore, eventIndex) => { restore.forEach((element:EventListStore, eventIndex) => {
@@ -46,7 +48,7 @@ export class CalendarService {
} }
get eventSource() { get eventSource() {
return this._eventSource return this._eventSource || []
} }
@@ -93,4 +95,11 @@ export class CalendarService {
}, 10) }, 10)
} }
delete() {
this._eventSource = []
} }
}
export const CalendarStore = new CalendarService()
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEáCNS2-H
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEá ETen-B5-H` ^
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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