pull made

This commit is contained in:
Eudes Inácio
2021-09-29 17:02:13 +01:00
449 changed files with 126943 additions and 407 deletions
+3
View File
@@ -47,3 +47,6 @@ _platforms
src/app/store/notification.service.spec.ts
src/app/store/notification.service.ts
src/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf
+3 -3
View File
@@ -3,10 +3,10 @@
<name>gabinete digital</name>
<description>An awesome Ionic/Cordova app.</description>
<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:8100" />
<access origin="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
+10 -3
View File
@@ -21486,6 +21486,13 @@
"requires": {
"pdfjs-dist": "~2.7.570",
"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": {
@@ -22398,9 +22405,9 @@
}
},
"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=="
"version": "2.9.359",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.9.359.tgz",
"integrity": "sha512-P2nYtkacdlZaNNwrBLw1ZyMm0oE2yY/5S/GDCAmMJ7U4+ciL/D0mrlEC/o4HZZc/LNE3w8lEVzBEyVgEQlPVKQ=="
},
"pend": {
"version": "1.2.0",
+1
View File
@@ -63,6 +63,7 @@
"@logisticinfotech/ionic4-datepicker": "^1.4.4",
"@ng-bootstrap/ng-bootstrap": "^9.1.2",
"@ngx-translate/core": "^13.0.0",
"@pdftron/pdfjs-express": "^8.0.1",
"@types/jest-environment-puppeteer": "^4.4.1",
"@types/puppeteer": "^5.4.4",
"angular-calendar": "^0.28.22",
@@ -3,6 +3,7 @@
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</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-config>
</network-security-config>
+4
View File
@@ -191,12 +191,16 @@ const routes = [
{
path: 'chat-options-features',
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)
},
/*
path: 'chat',
+1
View File
@@ -187,6 +187,7 @@ export class HomePage implements OnInit {
console.log('Offlineee')
})
synchro.conected
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();
}
}
+22 -21
View File
@@ -20,6 +20,7 @@
<div>
<!-- Calendar is here -->
<div class="calendar-segment-{{profile}}" [class.calendar-segment-pr-force]="loggeduser.Profile =='PR'">
<div class="calendar-container" [style.height]="calendarHeight">
@@ -44,7 +45,7 @@
</h2>
<div class="dropdown-scroll-weel" *ngIf="dropdownScrollWeal">
<div class="dropdown-scroll-weel" *ngIf="dropdownScrollWeal" >
<div class="flex-grow-1 height-100 overflow-y-auto">
<ul>
<li (click)="changeMonth(0)" [class.active]="monthNum==0" ><span>Jan</span></li>
@@ -137,7 +138,7 @@
<calendar
class="calendar-component"
[eventSource]="calendarService.eventSource"
[eventSource]="CalendarStore.eventSource"
[calendarMode]="calendar.mode"
[currentDate]="calendar.currentDate"
(onEventSelected)="onEventSelected($event)"
@@ -223,7 +224,6 @@
</div>
<div class="timeline-wrapper flex-grow-1 height-100" >
<!-- Timeline -->
<div class="height-100">
@@ -412,6 +412,25 @@
(setIntervenientCC)="setIntervenientCC($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 -->
<app-view-event *ngIf="mobileComponent.showEventDetails"
[profile]="profile"
@@ -446,24 +465,6 @@
>
</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
[footer]="true"
+74 -47
View File
@@ -25,8 +25,9 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { DateAdapter } from '@angular/material/core';
import { ToastService } from 'src/app/services/toast.service';
import { eventSource } from 'src/app/models/agenda/eventSource';
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 { ChangeProfileService } from 'src/app/services/change-profile.service';
@Component({
selector: 'app-agenda',
@@ -102,8 +103,8 @@ export class AgendaPage implements OnInit {
postEvent: any;
// temporary data
taskParticipants: any = [];
taskParticipantsCc: any = [];
taskParticipants: any[] = [];
taskParticipantsCc: any[] = [];
adding: "intervenient" | "CC" = "intervenient";
@ViewChild(CalendarComponent) myCal: CalendarComponent;
@@ -153,6 +154,7 @@ export class AgendaPage implements OnInit {
yearNum;
dropdownScrollWeal = false
CalendarStore = CalendarStore
constructor(
private alertCtrl: AlertController,
@@ -165,15 +167,32 @@ export class AgendaPage implements OnInit {
authService: AuthService,
private dateAdapter: DateAdapter<any>,
private toastService: ToastService,
public calendarService: CalendarService,
private listBoxService: ListBoxService
private listBoxService: ListBoxService,
private changeProfileService: ChangeProfileService
) {
this.dateAdapter.setLocale('es');
this.dateAdapter.setLocale('es');
this.locale = 'pt'
this.loggeduser = authService.ValidatedUser;
this.changeProfileService.registerCallback(()=>{
this.tigerUpdate()
if(this.loggeduser.Profile == 'MDGPR') {
this.mobileComponent.showEventList = true;
this.profile = "mdgpr";
} else {
this.profile = "pr";
}
})
if(this.loggeduser.Profile == 'MDGPR') {
this.mobileComponent.showEventList = true;
this.profile = "mdgpr";
} else {
this.profile = "pr";
}
this.calendarHeight = "320px";
this.showCalendar = true;
this.timelineDate = momentG(new Date(),'dd MMMM yyyy');
@@ -182,10 +201,14 @@ export class AgendaPage implements OnInit {
this.showTimelineFilterState = false;
this.showTimeline = false;
if(this.loggeduser.Profile == 'MDGPR') {
this.mobileComponent.showEventList = true;
this.tigerUpdate()
window['year'] = this.changeYear
}
tigerUpdate() {
setTimeout(()=>{
try {
this.myCal.update();
@@ -195,15 +218,10 @@ export class AgendaPage implements OnInit {
this.updateEventListBox()
}, 1000)
window['year'] = this.changeYear
}
ngOnInit() {
this.profile = "mdgpr";
const pathname = window.location.pathname
@@ -481,12 +499,12 @@ export class AgendaPage implements OnInit {
// calendar
this.calendarService.removeRange(startTime, endTime, 'md')
this.CalendarStore.removeRange(startTime, endTime, 'md')
// 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.loadEvents();
@@ -503,11 +521,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.calendarService.removeRange(startTime, endTime, 'pr')
this.CalendarStore.removeRange(startTime, endTime, 'pr')
// 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.loadEvents();
@@ -528,12 +546,12 @@ export class AgendaPage implements OnInit {
// this.eventSource=[];
// 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();
@@ -554,14 +572,14 @@ export class AgendaPage implements OnInit {
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.calendarService.removeRange(startTime, endTime, 'md')
this.CalendarStore.removeRange(startTime, endTime, 'md')
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
// 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.loadEvents();
@@ -576,12 +594,12 @@ export class AgendaPage implements OnInit {
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.calendarService.removeRange(startTime, endTime, 'pr')
this.CalendarStore.removeRange(startTime, endTime, 'pr')
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.loadEvents();
@@ -603,14 +621,14 @@ export class AgendaPage implements OnInit {
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.calendarService.removeRange(startTime, endTime, 'md')
this.CalendarStore.removeRange(startTime, endTime, 'md')
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.loadEvents();
@@ -626,13 +644,13 @@ export class AgendaPage implements OnInit {
// this.eventSource=[];
this.calendarService.removeRange(startTime, endTime, 'pr')
this.CalendarStore.removeRange(startTime, endTime, 'pr')
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.loadEvents();
@@ -658,12 +676,12 @@ export class AgendaPage implements OnInit {
let eventsList = response;
this.calendarService.removeRange(startTime, endTime, 'md')
this.CalendarStore.removeRange(startTime, endTime, 'md')
// 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.loadEvents();
@@ -688,11 +706,11 @@ export class AgendaPage implements OnInit {
let eventsList = response;
// 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.loadEvents();
@@ -726,11 +744,11 @@ export class AgendaPage implements OnInit {
}
// 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();
@@ -757,8 +775,8 @@ export class AgendaPage implements OnInit {
updateEventListBox() {
this.TimelinePRList = this.listBoxService.list(this.calendarService.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.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', 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 +859,13 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr") {
this.profile ="pr";
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 {
this.profile ="mdgpr";
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 +1044,9 @@ export class AgendaPage implements OnInit {
EditApproveEventDismiss() {
this.cloneAllmobileComponent();
this.mobileComponent.showEditEventToApprove = true;
this.taskParticipants = []
this.taskParticipantsCc = []
}
async cloneAllmobileComponent() {
@@ -1105,12 +1126,18 @@ export class AgendaPage implements OnInit {
}
async setIntervenient(data) {
setTimeout(()=>{
this.taskParticipants = removeDuplicate(data)
}, 10)
}
async setIntervenientCC(data) {
setTimeout(()=>{
this.taskParticipantsCc = removeDuplicate(data)
}, 10)
}
// Emitters
+2 -1
View File
@@ -28,13 +28,14 @@ import { EmptyChatPageModule } from 'src/app/shared/chat/empty-chat/empty-chat.m
import { HeaderPageModule } from 'src/app/shared/header/header.module';
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
FontAwesomeModule,
PipesModule,
ChatPageRoutingModule,
RouterModule,
+22 -2
View File
@@ -67,6 +67,16 @@
</div>
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
<ion-label *ngIf="dm.lastMessage.file">
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
<span> {{dm.lastMessage.file.name}}</span>
</ion-label>
<ion-label *ngIf="dm.lastMessage.attachments">
<div *ngIf="dm.lastMessage.attachments[0].image_url">
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
<span> Fotografia</span>
</div>
</ion-label>
</div>
</div>
</div>
@@ -88,8 +98,18 @@
</div>
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{showDateDuration(group._updatedAt)}}</div>
</div>
<div class="item-description" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
<div class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
<div class="item-message">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
<div class="item-files" *ngIf="group.lastMessage.file">
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
<span> {{group.lastMessage.file.name}}</span>
</div>
<div class="item-files" *ngIf="group.lastMessage.attachments">
<div *ngIf="group.lastMessage.attachments[0].image_url">
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
<span> Fotografia</span>
</div>
</div>
</div>
</div>
</div>
+13 -4
View File
@@ -86,7 +86,7 @@ ion-content{
}
}
.item-content{
width: 317px;
//width: 317px;
float:right;
}
@@ -96,7 +96,7 @@ ion-content{
margin-top: 10px;
}
.item-title{
width: 80%;
width: calc(100% - 75px);
float: left;
font-size: 15px;
color: #0d89d1;
@@ -105,7 +105,7 @@ ion-content{
color: #fff;
}
.item-date{
width: 20%;
width: 75px;
float: right;
font-size: 13px;
color: #797979;
@@ -114,9 +114,19 @@ ion-content{
.item-date-active{
color: #fff;
}
.item-description{
font-size: 13px;
color: #000;
overflow: auto;
.item-message{
float: left;
padding-right: 5px;
}
.item-files{
float: left;
}
}
.item-description-active{
color: #fff;
@@ -130,7 +140,6 @@ ion-content{
@media only screen and (min-width: 701px) {
.main-content{
.aside-wrapper{
width: 35%;
border-right: 1px solid #d8d8d8;
@@ -139,9 +139,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
let scroll = e.srcElement.scrollTop;
let windowHeight = e.srcElement.scrollHeight;
let containerHeight = windowHeight - e.srcElement.clientHeight;
console.log(this.startPosition);
console.log(windowHeight);
if (scroll > this.currentPosition) {
//alert('BOTTOM');
@@ -156,7 +153,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.scrollToBottomBtn = false;
}
this.currentPosition = scroll;
console.log(this.currentPosition);
}
-6
View File
@@ -108,10 +108,4 @@
</div>
</div>
</div>
<!-- <pdf-viewer [src]=pdfSrc
[render-text]="true"
style="display: block;"
></pdf-viewer> -->
</ion-content>
+1
View File
@@ -135,6 +135,7 @@ export class EventsPage implements OnInit {
this.getEventsFromLocalDb();
//this.checkScreenOrientation();
}
hideSearch() {
@@ -15,7 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { Location } from '@angular/common'
import { fullTask } from 'src/app/models/dailyworktask.model';
import { Attachment, AttachmentList } from 'src/app/models/Excludetask';
import { AttachmentList } from 'src/app/models/Excludetask';
import { PermissionService } from 'src/app/OtherService/permission.service';
@Component({
@@ -51,10 +51,8 @@ export class DespachoPage implements OnInit {
private toastService: ToastService,
private despachoService: DespachoService,
private location: Location,
public p: PermissionService,
public p: PermissionService) {
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
@@ -160,10 +158,10 @@ export class DespachoPage implements OnInit {
});
}
viewDocument(docId:string){
viewDocument(docId:string) {
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
const browser = this.iab.create('https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=https://equilibrium.dyndns.info/FileShare/merged_fastview.pdf', "_blank", 'location=yes,x=0,y=200,width=437,height=650,fullscreen=no');
browser.show();
});
}
@@ -79,7 +79,8 @@ export class ApproveEventPage implements OnInit {
console.log(this.serialNumber);
console.log(this.caller);
this.getProcessFromDB();
this.getTask();
console.log("Aprove enet")
//this.getTask();
}
goBack() {
@@ -43,8 +43,9 @@ export class ExpedientePage implements OnInit {
const pathname = location.pathname + location.search
this.getEventsFromLocalDb();
console.log("segrsgre")
if (this.onlinecheck) {
this.LoadList()
this.router.events.forEach((event) => {
@@ -56,7 +57,6 @@ export class ExpedientePage implements OnInit {
}
}
});
}
}
@@ -89,6 +89,7 @@
<!-- This is the box view -->
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100">
<div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" >
<div class="d-flex justify-center">
<!-- <ion-icon src="assets/images/icons-agenda.svg"></ion-icon> -->
@@ -21,6 +21,7 @@ import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { NotificationsService } from 'src/app/services/notifications.service';
import { DespachoService } from 'src/app/Rules/despacho.service';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
import { SqliteService } from '../../services/sqlite.service';
import { synchro } from '../../services/socket/synchro.service';
@@ -126,7 +127,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
private notificationsService: NotificationsService,
private despachoRule: DespachoService,
private sqliteservice: SqliteService,
private platform: Platform
private platform: Platform,
private changeProfileService: ChangeProfileService
) {
this.loggeduser = authService.ValidatedUser;
@@ -212,7 +214,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Diploma Assinado')
}
console.log(allProcessesList);
console.log('allProcessesList', allProcessesList);
this.addProcessToDB(allProcessesList)
this.skeletonLoader = true;
@@ -18,7 +18,7 @@
Parecer
</ion-segment-button>
<ion-segment-button value="deferimento">
Defereimento
Deferimento
</ion-segment-button>
</ion-segment>
</ion-toolbar>
+13 -2
View File
@@ -7,7 +7,8 @@ import { environment } from 'src/environments/environment';
import { AlertController } from '@ionic/angular';
import { NotificationsService } from 'src/app/services/notifications.service';
import { SessionStore } from 'src/app/store/session.service';
import { SqliteService } from '../../services/sqlite.service';
import { ClearStoreService } from 'src/app/services/clear-store.service';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
@Component({
selector: 'app-login',
@@ -33,7 +34,8 @@ export class LoginPage implements OnInit {
private authService: AuthService,
private toastService: ToastService,
public alertController: AlertController,
private sqliteservice: SqliteService
private clearStoreService: ClearStoreService,
private changeProfileService: ChangeProfileService
) {
}
@@ -81,8 +83,12 @@ export class LoginPage implements OnInit {
BasicAuthKey: ""
}
const loader = this.toastService.loading()
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
loader.remove()
if (attempt) {
if (attempt.UserId == SessionStore.user.UserId) {
@@ -93,9 +99,14 @@ export class LoginPage implements OnInit {
this.goback()
} else {
this.clearStoreService.clear()
SessionStore.delete()
window.localStorage.clear();
await this.authService.SetSession(attempt, this.userattempt);
this.changeProfileService.run()
await this.authService.loginChat(this.userattempt);
this.router.navigate(['/pin']);
}
@@ -95,6 +95,7 @@ export class PublicationDetailPage implements OnInit {
if(this.isModal) {
this.close()
} else {
// alert('go back')
this.location.back();
}
@@ -108,11 +109,15 @@ export class PublicationDetailPage implements OnInit {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage('Publicação eliminada')
if(window['app-view-publications-page-doRefresh']) {
window['app-view-publications-page-doRefresh']()
}
this.goBack();
} catch (error) {
this.toastService.badRequest('Publicaçao não eliminada')
} finally {
loader.remove()
this.goBack();
}
+31
View File
@@ -1,5 +1,7 @@
import { Injectable } from '@angular/core';
import { AlertController, AnimationController } from '@ionic/angular';
import { ChatService } from './chat.service';
import { ToastService } from './toast.service';
@Injectable({
providedIn: 'root'
@@ -9,6 +11,8 @@ export class AlertService {
constructor(
public alertController: AlertController,
private animationController: AnimationController,
private chatService: ChatService,
private toastService: ToastService,
) { }
async presentAlert(message:string) {
@@ -36,4 +40,31 @@ export class AlertService {
}, 2500);
}
async confirmDeleteMessage(body:any) {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Apagar a mensagem?',
buttons: [
{
text: 'Cancelar',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
//console.log('Confirm Cancel');
}
}, {
text: 'Apagar',
handler: () => {
const loader = this.toastService.loading();
this.chatService.deleteMessage(body).subscribe(res=>{
loader.remove();
});
}
}
]
});
await alert.present();
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ export class AuthService {
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
this.opts = {
headers: this.headers,
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ChangeProfileService } from './change-profile.service';
describe('ChangeProfileService', () => {
let service: ChangeProfileService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ChangeProfileService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,42 @@
import { Injectable } from '@angular/core';
import { v4 as uuidv4 } from 'uuid'
@Injectable({
providedIn: 'root'
})
export class ChangeProfileService {
callbacks: {
funx: Function
id: string
}[] = []
constructor() { }
registerCallback(funx: Function, object: any = {} ) {
const id = uuidv4()
this.callbacks.push({funx, id})
return id;
}
deleteCallback(id) {
this.callbacks.forEach((e, index)=> {
if(e.id == id) {
if (index > -1) {
this.callbacks.splice(index, 1)
}
}
})
}
run() {
this.callbacks.forEach((e, index)=> {
e.funx()
})
}
}
+10
View File
@@ -52,6 +52,7 @@ export class ChatService {
getAllChannels(){
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
}
getAllUserChannels(){
return this.http.get(environment.apiChatUrl+'channels.list.joined', this.options);
}
@@ -59,6 +60,7 @@ export class ChatService {
getAllRooms(){
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
}
getRoomInfo(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
@@ -110,6 +112,14 @@ export class ChatService {
}
return this.http.post(environment.apiChatUrl+'chat.sendMessage', body, opts);
}
deleteMessage(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'chat.delete', body, opts);
}
leaveRoom(body:any){
let opts = {
headers: this.headers,
@@ -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();
});
});
+40
View File
@@ -0,0 +1,40 @@
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';
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
import { TotalDocumentStore } from 'src/app/store/total-document.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()
CalendarStore.ResetList([])
ToDayEventStorage.reset([])
TotalDocumentStore.resetCount(0)
}
}
+20 -6
View File
@@ -4,8 +4,9 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { LoginUserRespose, UserSession } from '../models/user.model';
import { UserSession } from '../models/user.model';
import { EventList } from '../models/agenda/AgendaEventList';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
@@ -25,10 +26,14 @@ export class EventsService {
headersSharedOficial: HttpHeaders;
headersSharedPessoal: HttpHeaders;
//lastloadedevent: Event;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
constructor(
private http: HttpClient,
public user: AuthService,
private changeProfileService: ChangeProfileService)
{
this.loggeduser = this.user.ValidatedUser;
this.headersMdOficial = new HttpHeaders();
this.headersMdPessoal = new HttpHeaders();
@@ -39,6 +44,17 @@ export class EventsService {
this.headersSharedOficial = new HttpHeaders();
this.headersSharedPessoal = new HttpHeaders();
this.setHeader()
this.changeProfileService.registerCallback(()=>{
this.loggeduser = this.user.ValidatedUser;
this.setHeader()
})
}
setHeader() {
if(this.loggeduser){
if(this.loggeduser.Profile == 'MDGPR') {
@@ -89,8 +105,6 @@ export class EventsService {
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
}
/* getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
+35 -2
View File
@@ -9,6 +9,7 @@ import { Excludetask } from '../models/Excludetask';
import { ExpedienteFullTask } from '../models/Expediente';
import { GetTasksListType } from '../models/GetTasksListType';
import { fullTaskList } from '../models/dailyworktask.model';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -19,8 +20,25 @@ export class ProcessesService {
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
constructor(
private http: HttpClient,
public user: AuthService,
private changeProfileService: ChangeProfileService
) {
this.loggeduser = this.user.ValidatedUser;
this.setHeader()
this.changeProfileService.registerCallback(()=>{
this.loggeduser = this.user.ValidatedUser;
this.setHeader()
})
}
setHeader() {
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
@@ -307,4 +325,19 @@ export class ProcessesService {
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
@@ -38,7 +38,9 @@ class SynchroService {
}[] = []
private msgQueue = []
constructor(){}
constructor() {
// alert(SessionStore.user.FullName)
}
get connected() {
return this._connected
@@ -153,6 +153,7 @@ export class EditEventToApprovePage implements OnInit {
// description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.eventProcess.workflowInstanceDataFields.Category = this.eventProcess.workflowInstanceDataFields.EventType
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments()
@@ -171,7 +172,6 @@ export class EditEventToApprovePage implements OnInit {
}
onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){
console.log(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.setIntervenient.emit([]);
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
this.clearContact.emit(); */
this.clearContact.emit();
//this.deleteTemporaryData();
}
@@ -89,9 +89,7 @@ export class EditEventPage implements OnInit {
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private toastService: ToastService,
) {
}
) {}
ngOnInit() {
@@ -13,6 +13,7 @@ import { ChatPopoverPageModule } from '../../popover/chat-popover/chat-popover.m
import { NewEventPageModule } from '../../agenda/new-event/new-event.module';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import {MatMenuModule} from '@angular/material/menu';
@NgModule({
imports: [
@@ -23,6 +24,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
PdfViewerModule,
ChatPopoverPageModule,
GroupMessagesPageRoutingModule,
MatMenuModule
//
],
exports: [GroupMessagesPage],
@@ -32,14 +32,20 @@
</ion-refresher-content>
</ion-refresher>
<div class="messages overflow-y-auto" #scrollMe>
<div class="messages" #scrollMe>
<div class="welcome-text">
<ion-label> Esta conversa passou a grupo</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="container-width-100" *ngFor="let msg of messages; let last = last" #scrollMe>
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last">
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" >
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
@@ -131,8 +131,18 @@
.messages{
font-size: 13px;
font-family: Roboto;
overflow: auto;
//set scroll do bottom
position: absolute;
top: 0;
left: 0;
overflow-x: hidden;
overflow-y: auto;
width: 100%;
height: 100%;
word-wrap: break-word;
-webkit-overflow-scrolling: touch;
.incoming-true, .incoming-false{
padding: 15px 20px;
@@ -319,6 +319,16 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
this.message = "";
}
deleteMessage(msgId:string){
let body = {
"roomId": this.roomId,
"msgId": msgId,
"asUser": false,
}
this.alertService.confirmDeleteMessage(body);
}
async openGroupMessagesOptions() {
const enterAnimation = (baseEl: any) => {
@@ -9,6 +9,8 @@ import { MessagesPageRoutingModule } from './messages-routing.module';
import { MessagesPage } from './messages.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { MatButtonModule } from '@angular/material/button';
import {MatMenuModule} from '@angular/material/menu';
@NgModule({
imports: [
@@ -16,7 +18,10 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
FormsModule,
IonicModule,
FontAwesomeModule,
MessagesPageRoutingModule
MessagesPageRoutingModule,
MatButtonModule,
MatMenuModule
],
exports: [MessagesPage],
declarations: [MessagesPage]
@@ -34,14 +34,10 @@
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="message-item-options d-flex justify-content-end">
<fa-icon (click)="mesageItemDropdownOptions=true" icon="chevron-down" class="message-options-icon"></fa-icon>
<!-- <div class="mesage-item-dropdown-options" *ngIf="mesageItemDropdownOptions">
<ion-label>Apagar mensagem</ion-label>
</div> -->
<ion-select hidden class="message-options-icon" interface="popover">
<ion-select-option value="nes">Apagar mensagem</ion-select-option>
</ion-select>
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
+15 -7
View File
@@ -141,10 +141,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
let scroll = e.srcElement.scrollTop;
let windowHeight = e.srcElement.scrollHeight;
let containerHeight = windowHeight - e.srcElement.clientHeight;
console.log(containerHeight);
console.log(e.srcElement.clientHeight);
if (scroll > this.currentPosition) {
//alert('BOTTOM');
@@ -196,6 +192,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.message = "";
}
deleteMessage(msgId:string){
let body = {
"roomId": this.roomId,
"msgId": msgId,
"asUser": false,
}
this.alertService.confirmDeleteMessage(body);
/* this.chatService.deleteMessage(body).subscribe(res=>{
console.log(res);
}); */
}
loadMessages(){
//this.showLoader = true;
const roomId = this.roomId
@@ -404,17 +412,17 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId;
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
console.log(res['success']);
//console.log(res['success']);
if (res['success'] == true) {
// Show Error
//showMessage(response.statusText);
//this.loadMessages()
this.loadMessages()
this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages);
//console.log(this.messages);
// Reconnect in one second
if(this.route.url != "/home/chat"){
console.log("Timer message stop")
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border px-20">
<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-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>
@@ -3,7 +3,6 @@ import { ModalController } from '@ionic/angular';
import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { slugify } from 'src/plugin/javascript-remove-accents.js';
@Component({
selector: 'app-attendee-modal',
@@ -64,10 +63,10 @@ export class AttendeePage implements OnInit {
}
save(){
save() {
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
this.setIntervenient.emit(removeDuplicate(this.LtaskParticipants));
this.setIntervenientCC.emit(removeDuplicate(this.LtaskParticipantsCc));
this.closeComponent.emit();
}
@@ -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>
@@ -330,28 +330,26 @@ export class EditEventToApproveComponent implements OnInit {
}
}
setIntervenient(data){
setIntervenient(data = []) {
this.taskParticipants = data;
this.postEvent.Attendees = data;
}
setIntervenientCC(data) {
setIntervenientCC(data = []) {
this.taskParticipantsCc = data;
}
addParticipants(){
addParticipants() {
this.adding = 'intervenient'
this.openAttendees();
}
addParticipantsCC(){
addParticipantsCC() {
this.adding = 'CC'
this.openAttendees();
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
}
@@ -367,7 +365,7 @@ export class EditEventToApproveComponent implements OnInit {
this.loadedAttachments = result
console.log('this.loadedAttachments', this.loadedAttachments, result)
// console.log('this.loadedAttachments', this.loadedAttachments, result)
}
deleteAttachment(attachment: Attachment, index) {
@@ -88,12 +88,16 @@ export class PublicationDetailPage implements OnInit {
async deletePost(){
const laoder = this.toastService.loading()
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.toastService.successMessage("Publicação eliminado")
this.goBackToViewPublications.emit();
} catch (error) {
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 { eventSource } from '../models/agenda/eventSource';
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';
@Injectable({
@@ -13,11 +13,13 @@ export class CalendarService {
private _eventSource : EventListStore[] = []
private keyName: string;
constructor(private localstoreService: LocalstoreService) {
localstoreService = localstoreService
constructor() {
this.keyName = (SHA1(this.constructor.name+ 'eventSource')).toString()
let restore = localstoreService.get(this.keyName, [])
let restore = this.localstoreService.get(this.keyName, [])
setTimeout(()=>{
restore.forEach((element:EventListStore, eventIndex) => {
@@ -46,7 +48,7 @@ export class CalendarService {
}
get eventSource() {
return this._eventSource
return this._eventSource || []
}
@@ -93,4 +95,11 @@ export class CalendarService {
}, 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.

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