mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
git pull made
This commit is contained in:
@@ -6,6 +6,7 @@ import { CustomTaskPipe } from '../pipes/custom-task.pipe';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
import { DespachoStore } from '../store/despacho-store.service';
|
||||
import { LoaderService } from 'src/app/store/loader.service'
|
||||
import { SessionStore } from '../store/session.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -31,7 +32,7 @@ export class DespachoService {
|
||||
public p: PermissionService,
|
||||
public LoaderService: LoaderService
|
||||
) { }
|
||||
|
||||
|
||||
arquivar(note:string, documents:AttachmentList, serialnumber) {
|
||||
|
||||
let body = {
|
||||
@@ -43,10 +44,10 @@ export class DespachoService {
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
|
||||
// reencaminhar(note:string, documents:any, serialnumber) {
|
||||
|
||||
// let body = {
|
||||
@@ -60,9 +61,9 @@ export class DespachoService {
|
||||
// }
|
||||
// return this.processes.CompleteTask(body)
|
||||
// }
|
||||
|
||||
|
||||
executado(note:string, documents:any , serialnumber) {
|
||||
|
||||
|
||||
let body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Conhecimento",
|
||||
@@ -76,30 +77,69 @@ export class DespachoService {
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
solicitarParecer({note ='', documents = [], serialnumber}) {
|
||||
let body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 92,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
solicitarParecer({note ='', documents = [], serialnumber, activityInstanceName}) {
|
||||
let body;
|
||||
if(activityInstanceName == 'Concluir Despacho'
|
||||
|| activityInstanceName == 'Concluir Parecer'
|
||||
|| activityInstanceName == 'Concluir Deferimento'
|
||||
|| activityInstanceName == 'Tarefa de Deferimento'
|
||||
){
|
||||
body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Parecer",
|
||||
"ActionTypeId": 92,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 92,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
|
||||
EfectuarDespacho({note = '', documents = [], serialnumber}) {
|
||||
let body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 94,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
EfectuarDespacho({note = '', documents = [], serialnumber, activityInstanceName}) {
|
||||
let body;
|
||||
if(activityInstanceName == 'Concluir Despacho'
|
||||
|| activityInstanceName == 'Concluir Parecer'
|
||||
|| activityInstanceName == 'Concluir Deferimento'
|
||||
|| activityInstanceName == 'Tarefa de Deferimento'
|
||||
){
|
||||
body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Despacho",
|
||||
"ActionTypeId": 94,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
}
|
||||
else{
|
||||
body = {
|
||||
"serialNumber": serialnumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 94,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
return this.processes.CompleteTask(body)
|
||||
}
|
||||
@@ -190,13 +230,13 @@ export class DespachoService {
|
||||
|
||||
|
||||
async getList({updateStore = false}): Promise<customTask[]> | null {
|
||||
|
||||
|
||||
if (this.LoaderService.loading) {
|
||||
return this.despachoStore.list
|
||||
}
|
||||
|
||||
this.LoaderService.push({})
|
||||
|
||||
|
||||
let result: fullTaskList[] = []
|
||||
let despachoList: customTask[] = [];
|
||||
|
||||
@@ -204,18 +244,18 @@ export class DespachoService {
|
||||
result = await this.processes.GetTasksList("Despacho", false).toPromise();
|
||||
result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
|
||||
result.forEach((element, index) => {
|
||||
|
||||
|
||||
let task: customTask = this.customTaskPipe.transform(element);
|
||||
despachoList.push(task);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
despachoList = this.sortArrayISODate(despachoList).reverse();
|
||||
|
||||
if(updateStore) {
|
||||
this.despachoStore.reset(despachoList);
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
|
||||
} finally {
|
||||
@@ -225,6 +265,20 @@ export class DespachoService {
|
||||
|
||||
}
|
||||
|
||||
async getListPr() {
|
||||
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
|
||||
let despachosPr;
|
||||
switch (SessionStore.user.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
|
||||
@@ -18,9 +18,9 @@ export class AuthGuard implements CanActivate {
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
if(!SessionStore.user.Inactivity) {
|
||||
this.router.navigate(['/inactivity']);
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
else if(window.location.pathname != '' && !SessionStore.exist) {
|
||||
else if(!SessionStore.exist) {
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeGuard } from './home.guard';
|
||||
|
||||
describe('HomeGuard', () => {
|
||||
let guard: HomeGuard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(HomeGuard);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HomeGuard implements CanActivate {
|
||||
constructor(
|
||||
public storageService:StorageService,
|
||||
private router:Router
|
||||
){}
|
||||
|
||||
canActivate(): Promise<boolean>{
|
||||
return new Promise(resolve => {
|
||||
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
|
||||
if(res){
|
||||
resolve(true);
|
||||
}
|
||||
else{
|
||||
this.router.navigate(['']);
|
||||
resolve(false);
|
||||
}
|
||||
}).catch(err =>{
|
||||
resolve(false);
|
||||
}) */
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -9,14 +10,18 @@ import { SessionStore } from '../store/session.service';
|
||||
export class InactivityGuard implements CanActivate {
|
||||
|
||||
constructor(
|
||||
private router:Router
|
||||
private router:Router,
|
||||
private platform: Platform,
|
||||
){}
|
||||
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.router.navigate(['/home/events']);
|
||||
return false
|
||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||
return true
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||
return true
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { IndexGuard } from './index.guard';
|
||||
|
||||
describe('IndexGuard', () => {
|
||||
let guard: IndexGuard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(IndexGuard);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,31 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class IndexGuard implements CanActivate {
|
||||
constructor(
|
||||
public storageService:StorageService,
|
||||
private router:Router
|
||||
){}
|
||||
canActivate(): Promise<boolean> {
|
||||
return new Promise(resolve => {
|
||||
/* this.storageService.get(AuthConnstants.AUTH).then(res => {
|
||||
if(res){
|
||||
this.router.navigate(['home']);
|
||||
resolve(false);
|
||||
}
|
||||
else{
|
||||
resolve(true);
|
||||
}
|
||||
}).catch(err =>{
|
||||
resolve(false);
|
||||
}) */
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +1,35 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { LocalstoreService } from '../store/localstore.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginGuard implements CanActivate {
|
||||
constructor( private router:Router,
|
||||
private localstoreService: LocalstoreService) {
|
||||
constructor( private router:Router, private platform: Platform,) {
|
||||
|
||||
}
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
if(window.location.pathname == '/' && SessionStore.exist ) {
|
||||
// console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
|
||||
|
||||
console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||
this.router.navigate(['/home/events']);
|
||||
return false
|
||||
} else if(SessionStore.exist && !SessionStore.hasPin && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
|
||||
this.router.navigate(['/pin']);
|
||||
return false
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||
this.router.navigate(['/inactivity']);
|
||||
return false
|
||||
} else {
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -382,6 +382,16 @@ const routes: Routes = [
|
||||
],
|
||||
canActivate: [InactivityGuard]
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
children: [
|
||||
{
|
||||
path:'',
|
||||
loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule)
|
||||
},
|
||||
],
|
||||
canActivate: [InactivityGuard]
|
||||
},
|
||||
{
|
||||
path: 'pin',
|
||||
children: [
|
||||
|
||||
@@ -12,13 +12,14 @@
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<ion-tab-button (click)="goto('/home/gabinete-digital')">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge>
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="publications">
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
|
||||
|
||||
+53
-15
@@ -20,6 +20,7 @@ import { SessionStore } from '../store/session.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { Media, MediaObject } from '@ionic-native/media/ngx';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -63,7 +64,6 @@ export class HomePage implements OnInit {
|
||||
synchro = synchro
|
||||
|
||||
status:string="";
|
||||
audioFile:MediaObject = this.media.create(this.file.externalRootDirectory+"/audioGabinete.mp3");
|
||||
audioName:string="";
|
||||
constructor(
|
||||
private zone: NgZone,
|
||||
@@ -78,15 +78,14 @@ export class HomePage implements OnInit {
|
||||
private despachoRule: DespachoService,
|
||||
private inativityService: InativityService,
|
||||
private storageService: StorageService,
|
||||
private media: Media,
|
||||
private file: File ) {
|
||||
private webNotificationPopupService: WebNotificationPopupService) {
|
||||
|
||||
this.webNotificationPopupService.askNotificationPermission()
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
});
|
||||
|
||||
this.updateList()
|
||||
|
||||
window['platform'] = platform
|
||||
window['inactivity/function'] = () => {
|
||||
|
||||
@@ -98,23 +97,20 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url) );
|
||||
|
||||
myWorker.onmessage = function(oEvent) {
|
||||
console.log('Worker said : ' + oEvent.data);
|
||||
}
|
||||
|
||||
myWorker.postMessage('ali');
|
||||
|
||||
}
|
||||
|
||||
goto(url) {
|
||||
this.router.navigate([url])
|
||||
}
|
||||
|
||||
refreshing() {}
|
||||
|
||||
ngOnInit() {
|
||||
/* this.network.checkNetworkConnection;
|
||||
this.network.checkNetworkDisconnection; */
|
||||
console.log('Active route ', this.router.url)
|
||||
// console.log('Active route ', this.router.url)
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.webnotification.webconnection();
|
||||
this.webnotification.register();
|
||||
@@ -123,6 +119,15 @@ export class HomePage implements OnInit {
|
||||
this.notificationsService.onReceviNotification();
|
||||
}
|
||||
|
||||
this.updateList()
|
||||
|
||||
var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url) );
|
||||
|
||||
myWorker.onmessage = function(oEvent) {
|
||||
console.log('Worker said : ' + oEvent.data);
|
||||
}
|
||||
|
||||
myWorker.postMessage('ali');
|
||||
}
|
||||
|
||||
mobilefirstConnect() {
|
||||
@@ -169,10 +174,43 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
)
|
||||
|
||||
synchro.registerCallback('Notification', (notification)=> {
|
||||
console.log('notification====== £=======£==========£======', notification)
|
||||
|
||||
synchro.registerCallback('Online',()=>{
|
||||
|
||||
})
|
||||
|
||||
|
||||
synchro.registerCallback('Offline',()=>{
|
||||
|
||||
})
|
||||
|
||||
|
||||
synchro.registerCallback('Notification', (DataArray)=> {
|
||||
|
||||
this.webNotificationPopupService.sendNotification(DataArray)
|
||||
|
||||
this.storageService.get('Notifications').then((data:any)=>{
|
||||
data.push(DataArray)
|
||||
this.storageService.store("Notifications", data)
|
||||
}).catch(()=>{
|
||||
|
||||
const a = []
|
||||
a.push(DataArray)
|
||||
this.storageService.store("Notifications",a)
|
||||
})
|
||||
|
||||
}, 'any')
|
||||
|
||||
|
||||
|
||||
document.addEventListener('pause', function () {
|
||||
// console.log('App going to background');
|
||||
});
|
||||
|
||||
document.addEventListener('resume', function () {
|
||||
// console.log('App coming to foreground');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { IndexGuard } from '../guards/index.guard';
|
||||
import { LoginGuard } from '../guards/login.guard';
|
||||
import { IndexPage } from './index.page';
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class CreateProcessPage implements OnInit {
|
||||
NumberPDPP = this.fulltask.workflowInstanceDataFields.DispatchNumber
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let SourceId;
|
||||
let SourceType;
|
||||
let SourceSecFsId;
|
||||
@@ -230,7 +230,7 @@ export class CreateProcessPage implements OnInit {
|
||||
this.runValidation()
|
||||
if(this.Form.invalid) return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(this.postData.Priority=='99999861') {
|
||||
this.dispatchFolder.DeadlineType = 'Normal';
|
||||
@@ -279,15 +279,16 @@ export class CreateProcessPage implements OnInit {
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
console.log(this.task.activityInstanceName);
|
||||
|
||||
try {
|
||||
await this.processes.postDespatcho(this.postData).toPromise();
|
||||
await this.despachoService.EfectuarDespacho({serialnumber: this.task.serialNumber}).toPromise();
|
||||
|
||||
await this.despachoService.EfectuarDespacho({serialnumber: this.task.serialNumber, activityInstanceName: this.task.activityInstanceName}).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -307,12 +308,12 @@ export class CreateProcessPage implements OnInit {
|
||||
try {
|
||||
if(this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') {
|
||||
await this.despachoService.createParecer(this.postData).toPromise();
|
||||
await this.despachoService.solicitarParecer({ serialnumber: this.task.serialNumber}).toPromise();
|
||||
await this.despachoService.solicitarParecer({ serialnumber: this.task.serialNumber, activityInstanceName: this.task.activityInstanceName}).toPromise();
|
||||
} else {
|
||||
await this.pedidoService.createParecer(this.postData).toPromise();
|
||||
await this.pedidoService.taskCompleteParecer({serialNumber:this.task.serialNumber}).toPromise();
|
||||
}
|
||||
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Parecer enviado');
|
||||
}
|
||||
@@ -340,7 +341,7 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Deferimento criado');
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
}
|
||||
@@ -368,7 +369,7 @@ export class CreateProcessPage implements OnInit {
|
||||
try {
|
||||
await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
|
||||
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
@@ -393,7 +394,7 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
if(this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') {
|
||||
await this.despachoService.createParecer(this.postData).toPromise();
|
||||
await this.despachoService.solicitarParecer({ serialnumber: this.task.serialNumber}).toPromise();
|
||||
await this.despachoService.solicitarParecer({ serialnumber: this.task.serialNumber, activityInstanceName: this.task.activityInstanceName}).toPromise();
|
||||
} else {
|
||||
await this.pedidoService.createParecer(this.postData).toPromise();
|
||||
await this.pedidoService.taskCompleteParecer({serialNumber:this.task.serialNumber}).toPromise();
|
||||
@@ -442,7 +443,7 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
|
||||
async FinalizarDespacho(loader: HTMLDivElement, message?) {
|
||||
|
||||
|
||||
let body;
|
||||
|
||||
if(this.task.activityInstanceName =='Tarefa de Despacho' ||
|
||||
@@ -461,7 +462,7 @@ export class CreateProcessPage implements OnInit {
|
||||
else if(this.task.activityInstanceName =='Concluir Despacho' ||
|
||||
this.task.activityInstanceName == 'Concluir Parecer' ||
|
||||
this.task.activityInstanceName =='Concluir Deferimento' ||
|
||||
this.task.activityInstanceName =='Reapreciar Deferimento' ||
|
||||
this.task.activityInstanceName =='Reapreciar Deferimento' ||
|
||||
this.task.activityInstanceName == 'Tarefa de Deferimento'
|
||||
) {
|
||||
|
||||
@@ -478,7 +479,7 @@ export class CreateProcessPage implements OnInit {
|
||||
} else {
|
||||
console.log('unexpected activityInstanceName', this.task)
|
||||
}
|
||||
|
||||
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-preference width-100" >
|
||||
<div class="login-preference width-100" *ngIf="!platform.is('desktop') && !platform.is('mobileweb')">
|
||||
<div class="preference">Preferência Login</div>
|
||||
|
||||
<ion-row>
|
||||
@@ -73,11 +73,6 @@
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
<div hidden class="d-flex width-100 justify-center mt-10">
|
||||
<button hidden (click)="addPin()" class="btn-ok buttonSize" fill="clear" color="#fff" >
|
||||
<ion-label>Alterar PIN</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -3,6 +3,8 @@ import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
|
||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Platform } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-profile',
|
||||
@@ -12,9 +14,11 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
export class EditProfilePage implements OnInit {
|
||||
|
||||
SessionStore = SessionStore
|
||||
production = environment.production
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
public platform: Platform,
|
||||
) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class=" bg-blue">
|
||||
<div class="d-flex flex-column height-100 overflow-auto-y">
|
||||
<div class="d-flex flex-column height-100 overflow-y-auto">
|
||||
|
||||
<div class="notifications-content">
|
||||
<div class="notifications-content height-100">
|
||||
|
||||
<ion-list>
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
|
||||
|
||||
@@ -42,24 +42,35 @@ export class ProfilePage implements OnInit {
|
||||
private zone: NgZone,
|
||||
private notificationservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private notificationsService: NotificationsService,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
console.log(this.loggeduser.RoleDescription)
|
||||
|
||||
this.checkState()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
this.getNotificationData();
|
||||
} else {
|
||||
this.getNotificationData();
|
||||
this.getNotificationData();
|
||||
}
|
||||
|
||||
this.notificationsService.registerCallback(
|
||||
'any',
|
||||
() => {
|
||||
setTimeout(()=>{
|
||||
this.getNotificationData();
|
||||
}, 100)
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
@@ -68,7 +79,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
asyncNotification(){}
|
||||
|
||||
async getNotificationData(){
|
||||
async getNotificationData() {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
console.log("Init get store", value)
|
||||
|
||||
@@ -78,6 +89,8 @@ export class ProfilePage implements OnInit {
|
||||
value = JSON.parse(value)
|
||||
console.log("CSDfdvdf",value)
|
||||
}
|
||||
|
||||
this.DataArray = []
|
||||
value.forEach((element,i) => {
|
||||
console.log("ARaaAA", element)
|
||||
let notificationObject;
|
||||
@@ -206,25 +219,13 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
logout() {
|
||||
SessionStore.setInativity(false)
|
||||
|
||||
SessionStore.setUrlBeforeInactivity(this.router.url)
|
||||
setTimeout(() => {
|
||||
this.router.navigate(['/inactivity']);
|
||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||
}, 100)
|
||||
|
||||
}
|
||||
|
||||
checkState() {
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async editProfile() {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
export interface EventListStore {
|
||||
startTime: Date
|
||||
endTime: Date
|
||||
allDay: boolean,
|
||||
event: EventList,
|
||||
calendarName: "Oficial" |"Pessoal"
|
||||
profile: "md" | "pr",
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface EventList {
|
||||
HasAttachments: boolean;
|
||||
IsAllDayEvent: boolean;
|
||||
EventId: string;
|
||||
Subject: string;
|
||||
Location: string;
|
||||
CalendarId: string;
|
||||
CalendarName: string;
|
||||
StartDate: string;
|
||||
EndDate: string;
|
||||
HumanDate: string;
|
||||
}
|
||||
|
||||
|
||||
export interface CustomCalendarEvent {
|
||||
start: Date
|
||||
end: Date
|
||||
id: string
|
||||
event: EventList
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface days {
|
||||
[days: string]: {
|
||||
day: number
|
||||
activeEvent: number
|
||||
events: CustomCalendarEvent[]
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,6 @@ export class Event{
|
||||
EventRecurrence: EventRecurrence;
|
||||
Name?: string
|
||||
Attachments?: Attachment[];
|
||||
|
||||
/* public Event(){
|
||||
this.EventRecurrence = new EventRecurrence();
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="main-content">
|
||||
<!-- Toolbar -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
|
||||
<div>
|
||||
<!-- Calendar is here -->
|
||||
<div class="calendar-segment-{{profile}}" [class.calendar-segment-pr-force]="loggeduser.Profile =='PR'">
|
||||
@@ -180,15 +180,15 @@
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 d-md-none text-black height-100 width-100 overflow-y-auto" >
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="day mt-10" *ngIf="shoeEventDay(events.value)">
|
||||
<div class="EventListBox-container" >
|
||||
<div class="day mt-10" >
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox" >
|
||||
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event) && showEventBox(event)">
|
||||
*ngIf="viewEventMonth <= dateMonth(event) ">
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
|
||||
@@ -219,18 +219,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="day EventListBox-day mt-10" *ngIf="shoeEventDay(events.value)">
|
||||
<div class="EventListBox-container" >
|
||||
<div class="day EventListBox-day mt-10" >
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
<div *ngFor="let event of events.value" class="EventListBox" >
|
||||
|
||||
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event) && showEventBox(event)">
|
||||
<div class="d-flex content-mdgpr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(event)"
|
||||
>
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||
@@ -263,16 +263,15 @@
|
||||
<div class="sd-timeline flex-grow-1 d-none d-md-block timeline-md text-black pl-20 pr-20 width-100 height-100 overflow-y-auto" >
|
||||
<div *ngFor="let events of TimelinePRList | keyvalue;">
|
||||
|
||||
<div class="EventListBox-container" *ngIf="CalendarCurrentDay <= events.key">
|
||||
<div class="EventListBox-container" >
|
||||
|
||||
<div class="day mt-10" *ngIf="shoeEventDay(events.value)">
|
||||
<div class="day mt-10" >
|
||||
{{ TimelineDayEvent(events.key)}}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox" >
|
||||
|
||||
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer" (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event) && showEventBox(event) ">
|
||||
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer item hover" (click)="eventClicked(event)">
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||
@@ -327,7 +326,7 @@
|
||||
</div>
|
||||
|
||||
<!-- New -->
|
||||
<app-new-event *ngIf="mobileComponent.showAddNewEvent"
|
||||
<app-new-event *ngIf="mobileComponent.showAddNewEvent"
|
||||
[profile]="profile"
|
||||
[selectedSegment]=segment
|
||||
[taskParticipants]="taskParticipants"
|
||||
@@ -345,7 +344,7 @@
|
||||
></app-new-event>
|
||||
|
||||
<!-- Edit -->
|
||||
<app-edit-event *ngIf="mobileComponent.showEditEvent"
|
||||
<app-edit-event *ngIf="mobileComponent.showEditEvent"
|
||||
[taskParticipants]="taskParticipants"
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[profile]="profile"
|
||||
@@ -432,4 +431,4 @@
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
</ion-content>
|
||||
|
||||
@@ -25,8 +25,8 @@ 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 { eventListBox as eventListBoxComponent } from './eventListBox'
|
||||
import { CalendarService } from 'src/app/store/calendar.service';
|
||||
import { ListBoxService } from 'src/app/services/ageanda/list-box.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-agenda',
|
||||
@@ -123,8 +123,6 @@ export class AgendaPage implements OnInit {
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
|
||||
eventListBoxComponent = new eventListBoxComponent()
|
||||
|
||||
mobileComponent = {
|
||||
showAddNewEvent: false,
|
||||
showEditEvent: false,
|
||||
@@ -162,7 +160,8 @@ export class AgendaPage implements OnInit {
|
||||
authService: AuthService,
|
||||
private dateAdapter: DateAdapter<any>,
|
||||
private toastService: ToastService,
|
||||
public calendarService: CalendarService
|
||||
public calendarService: CalendarService,
|
||||
private listBoxService: ListBoxService
|
||||
) {
|
||||
this.dateAdapter.setLocale('es');
|
||||
|
||||
@@ -192,6 +191,9 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
}, 1000)
|
||||
|
||||
|
||||
window['year'] = this.changeYear
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -291,6 +293,7 @@ export class AgendaPage implements OnInit {
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
|
||||
this.updateEventListBox()
|
||||
};
|
||||
|
||||
// changedate
|
||||
@@ -359,9 +362,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
get CalendarCurrentDay ():any {
|
||||
|
||||
/* console.log(this.viewDate.getDate(), '0_0') */
|
||||
// console.log(this.viewDate.getDate(), '0_0')
|
||||
|
||||
return this.viewDate.getDate()
|
||||
}
|
||||
|
||||
@@ -457,7 +457,6 @@ export class AgendaPage implements OnInit {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then(
|
||||
|
||||
(response:any) => {
|
||||
console.log(response);
|
||||
|
||||
|
||||
// calendar
|
||||
@@ -466,7 +465,7 @@ export class AgendaPage implements OnInit {
|
||||
// loop
|
||||
this.calendarService.pushEvent(response, 'md');
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -487,7 +486,7 @@ export class AgendaPage implements OnInit {
|
||||
// calendar
|
||||
this.calendarService.pushEvent(response, 'pr');
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -513,7 +512,7 @@ export class AgendaPage implements OnInit {
|
||||
this.calendarService.pushEvent(response, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
@@ -541,7 +540,7 @@ export class AgendaPage implements OnInit {
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -555,17 +554,13 @@ 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.eventSource=[];
|
||||
|
||||
// clear the current month only
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -594,7 +589,7 @@ export class AgendaPage implements OnInit {
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -616,7 +611,7 @@ export class AgendaPage implements OnInit {
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -647,7 +642,7 @@ export class AgendaPage implements OnInit {
|
||||
// loop
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -676,7 +671,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -714,7 +709,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
@@ -741,175 +736,37 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
updateEventListBox() {
|
||||
|
||||
this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
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})
|
||||
|
||||
}
|
||||
|
||||
eventListBox(list, nice?) {
|
||||
let days = {};
|
||||
changeYear = (year) => {
|
||||
const a = this.calendar.currentDate
|
||||
this.calendar.currentDate = new Date(`${year}-${a.getMonth()}-${a.getDay()}`);
|
||||
|
||||
try {
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
} catch(e) {}
|
||||
|
||||
list.forEach( (event:any)=> {
|
||||
this.updateEventListBox()
|
||||
|
||||
var startDate: any = new Date(event.start);
|
||||
|
||||
var endDate: any = this.EventTretment({
|
||||
startTime: startDate,
|
||||
endTime: event.end
|
||||
})
|
||||
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.manyDays = false
|
||||
|
||||
|
||||
event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString()
|
||||
|
||||
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
|
||||
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.other = true
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
days[day].push(event)
|
||||
|
||||
})
|
||||
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
|
||||
if(e.childElementCount == 0) {
|
||||
e.parentElement.style.display = 'none'
|
||||
} else {
|
||||
e.parentElement.style.display = 'block'
|
||||
}
|
||||
})
|
||||
}, 10)
|
||||
|
||||
return days
|
||||
}
|
||||
|
||||
changeMonth = (month) => {
|
||||
const a = this.calendar.currentDate
|
||||
this.calendar.currentDate = new Date(`${a.getFullYear()}-${month}-${a.getDay()}`);
|
||||
|
||||
try {
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
} catch(e) {}
|
||||
|
||||
this.updateEventListBox()
|
||||
}
|
||||
|
||||
|
||||
get viewEventMonth () {
|
||||
return this.viewDate.getMonth()
|
||||
}
|
||||
@@ -941,13 +798,13 @@ export class AgendaPage implements OnInit {
|
||||
if(this.profile == "mdgpr") {
|
||||
this.profile ="pr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.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.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1233,36 +1090,11 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
this.showTimelineFilterState = false;
|
||||
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
|
||||
if(e.childElementCount == 0) {
|
||||
e.parentElement.style.display = 'none'
|
||||
} else {
|
||||
e.parentElement.style.display = 'block'
|
||||
}
|
||||
})
|
||||
}, 10)
|
||||
|
||||
// THIS LINE
|
||||
this.updateEventListBox()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
|
||||
if(e.childElementCount == 0) {
|
||||
e.parentElement.style.display = 'none'
|
||||
} else {
|
||||
e.parentElement.style.display = 'block'
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
|
||||
}
|
||||
|
||||
async showEventBox(event) {
|
||||
|
||||
if ( event.event.CalendarName == this.segment || this.segment == 'Combinado') {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-content class="container">
|
||||
<ion-content class="wrapper">
|
||||
<div class="arrow-right" (click)="closePopover()">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.container{
|
||||
.wrapper{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
@@ -55,4 +55,4 @@
|
||||
/* .solid{
|
||||
display: block;
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
import { eventSource } from 'src/app/models/agenda/eventSource';
|
||||
import { setHours, setMinutes } from 'date-fns';
|
||||
|
||||
export class eventListBox {
|
||||
|
||||
constructor(){}
|
||||
|
||||
EventEndDateTreatment ({startTime, endTime}) {
|
||||
|
||||
const startTimeSamp = new Date(startTime).toLocaleDateString()
|
||||
const endTimeSamp = new Date(endTime).toLocaleDateString()
|
||||
|
||||
const endMinutes = new Date(endTime).getMinutes()
|
||||
const endHours = new Date(endTime).getHours()
|
||||
|
||||
|
||||
if (startTimeSamp < endTimeSamp && (endMinutes + endHours) == 0) {
|
||||
endTime = new Date(endTime);
|
||||
endTime.setSeconds(endTime.getSeconds() - 1);
|
||||
return new Date(endTime)
|
||||
} else {
|
||||
return new Date(endTime)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
filterProfile(eventSource: eventSource[], profile: 'md' | 'pr' | 'all') {
|
||||
return eventSource.filter((e) => e.profile == profile)
|
||||
}
|
||||
|
||||
getEventInsideRange(eventSource: eventSource[], rangeStartDate, randEndDate) {
|
||||
return eventSource.filter((e)=> {
|
||||
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
|
||||
new Date(randEndDate).getTime() >= new Date(e.endTime).getTime()) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
daysBetween(){ }
|
||||
|
||||
list(eventSource: eventSource[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, calendarDate) {
|
||||
|
||||
if(profile != 'all') {
|
||||
eventSource = this.filterProfile(eventSource, profile)
|
||||
}
|
||||
|
||||
eventSource = this.getEventInsideRange(eventSource, rangeStartDate, randEndDate)
|
||||
|
||||
if(profile == 'md') {
|
||||
eventSource = this.encapsulation(eventSource, 'mdgpr');
|
||||
} else {
|
||||
eventSource = this.encapsulation(eventSource, 'pr');
|
||||
}
|
||||
|
||||
return this.display(eventSource)
|
||||
}
|
||||
|
||||
display(list) {
|
||||
let days = {};
|
||||
|
||||
list.forEach( (event:any, index)=> {
|
||||
|
||||
var startDate: any = new Date(event.start);
|
||||
|
||||
var endDate: any = this.EventEndDateTreatment({
|
||||
startTime: startDate,
|
||||
endTime: event.end
|
||||
})
|
||||
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.manyDays = false
|
||||
|
||||
event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString()
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
|
||||
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.other = true
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
days[day].push(event)
|
||||
|
||||
})
|
||||
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.EventListBox-container .EventListBox').forEach((e)=>{
|
||||
if(e.childElementCount == 0) {
|
||||
e.parentElement.style.display = 'none'
|
||||
} else {
|
||||
e.parentElement.style.display = 'block'
|
||||
}
|
||||
})
|
||||
}, 10)
|
||||
return days
|
||||
}
|
||||
|
||||
encapsulation(eventsList, profile) {
|
||||
|
||||
// remove all event
|
||||
let events = [];
|
||||
|
||||
eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
events.push({
|
||||
start: new Date(element.StartDate || element.startTime),
|
||||
end: new Date(element.EndDate || element.endTime),
|
||||
color: {
|
||||
primary: '#0000',
|
||||
secondary: '#0000'
|
||||
},
|
||||
id: element.EventId || element.id,
|
||||
index: eventIndex,
|
||||
profile: profile,
|
||||
CalendarName: element.calendarName,
|
||||
event: element.event,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class="width-100" [ngSwitch]="segment">
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
<ion-item-sliding>
|
||||
<div class="item width-100 d-flex ion-no-padding ion-no-margin"
|
||||
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
|
||||
*ngFor="let dm of userDirectMessages"
|
||||
[class.item-active]="dm._id ==idSelected">
|
||||
<div class="item-icon">
|
||||
@@ -76,7 +76,7 @@
|
||||
<ion-item-sliding>
|
||||
<div *ngFor="let group of allGroups"
|
||||
[class.item-active]="group._id ==idSelected"
|
||||
class="item d-flex">
|
||||
class="item item-hover d-flex">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
<div class="item-title" [class.item-title-active]="group._id ==idSelected">
|
||||
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
|
||||
</div>
|
||||
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</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>
|
||||
@@ -113,6 +113,7 @@
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(openNewEventPage)="openNewEventPage($event)"
|
||||
(getDirectMessages)="getDirectMessages($event)"
|
||||
[style.display]="showMessages ? 'flex' : 'none'"
|
||||
[roomId]="roomId"
|
||||
[showMessages]="showMessages" #messagecontainer>
|
||||
@@ -156,6 +157,7 @@
|
||||
(openGroupContacts)="openGroupContactsPage($event)"
|
||||
(openEditGroupPage)="openEditGroupPage($event)"
|
||||
(openNewEventPage)="openNewEventPage($event)"
|
||||
(getGroups)="getGroups($event)"
|
||||
[style.display]="showGroupMessages ? 'flex' : 'none'"
|
||||
class=" height-100 flex-column"
|
||||
[roomId]="roomId" #messagecontainer>
|
||||
|
||||
@@ -122,6 +122,7 @@ ion-content{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.item-active{
|
||||
color: #fff !important;
|
||||
background-color: #42b9fe !important;
|
||||
|
||||
@@ -120,6 +120,11 @@ export class ChatPage implements OnInit {
|
||||
){
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.headers = new HttpHeaders();
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth > 701){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -374,11 +379,11 @@ hideRefreshButton(){
|
||||
});
|
||||
}
|
||||
|
||||
async getDirectMessages(){
|
||||
async getDirectMessages(event?){
|
||||
|
||||
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
|
||||
|
||||
if(res.ims != 200){
|
||||
if(res != 200){
|
||||
console.log(res.ims);
|
||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
@@ -391,12 +396,17 @@ hideRefreshButton(){
|
||||
console.log("Timer message stop")
|
||||
}
|
||||
else {
|
||||
console.log('TIMER');
|
||||
//Check if modal is opened
|
||||
if(this.segment == "Contactos" && this.showMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getDirectMessages();
|
||||
console.log('Timer contactos list running')
|
||||
}
|
||||
else{
|
||||
console.log('No timer!');
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -452,7 +462,7 @@ hideRefreshButton(){
|
||||
});
|
||||
}
|
||||
|
||||
async getGroups(){
|
||||
async getGroups(event?){
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res:any)=>{
|
||||
|
||||
if(res.groups != 200){
|
||||
@@ -474,7 +484,7 @@ hideRefreshButton(){
|
||||
else {
|
||||
//Check if modal is opened
|
||||
if(this.segment == "Grupos" && this.showGroupMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getGroups();
|
||||
console.log('Timer groups list running')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy } from '@angular/core';
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy, } from '@angular/core';
|
||||
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -10,6 +10,7 @@ import { NewGroupPage } from '../new-group/new-group.page';
|
||||
import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import {Router} from '@angular/router'
|
||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||
import { TimeService } from 'src/app/services/functions/time.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -49,11 +50,17 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private navParams: NavParams,
|
||||
private authService: AuthService,
|
||||
private alertService: AlertService,
|
||||
private route: Router
|
||||
private route: Router,
|
||||
private timeService: TimeService,
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = true;
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth > 701){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -173,7 +180,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
showDateDuration(start:any){
|
||||
let end;
|
||||
return this.timeService.showDateDuration(start);
|
||||
/* let end;
|
||||
end = new Date();
|
||||
start = new Date(start);
|
||||
let customizedDate;
|
||||
@@ -199,7 +207,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
else{
|
||||
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
|
||||
return date;
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
addZero(i) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router'
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -59,6 +60,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}); */
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth > 701){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -151,7 +158,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
loadMessages() {
|
||||
this.showLoader = true;
|
||||
const roomId = this.roomId
|
||||
|
||||
|
||||
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
this.messages = res['messages'].reverse();
|
||||
@@ -254,9 +261,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
async serverLongPull() {
|
||||
|
||||
const roomId = this.roomId
|
||||
|
||||
/* this.chatService.getRoomMessages(roomId).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
}) */
|
||||
|
||||
|
||||
this.chatService.getRoomMessages(roomId).subscribe(async res => {
|
||||
console.log("Chat message",res)
|
||||
|
||||
|
||||
if (res == 502) {
|
||||
// Connection timeout
|
||||
// happens when the synchro was pending for too long
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventsPageRoutingModule } from './events-routing.module';
|
||||
|
||||
import { EventsPage } from './events.page';
|
||||
// import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
import { HeaderNoSearchPageModule } from 'src/app/shared/headers/header-no-search/header-no-search.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="conteiner-box px-20 height-100 overflow-y-auto" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule">
|
||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
@@ -42,12 +42,12 @@
|
||||
></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
|
||||
<!-- {{ toDayEventStorage.eventsList | json}} -->
|
||||
|
||||
<ion-list>
|
||||
<ion-item class="cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
||||
(click)="goToEvent(event.EventId)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
@@ -82,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="schedule">
|
||||
<div class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
@@ -92,10 +92,10 @@
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.serialNumber)">
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
|
||||
@@ -113,7 +113,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <pdf-viewer [src]="pdfSrc"
|
||||
[render-text]="true"
|
||||
style="display: block;"
|
||||
|
||||
@@ -81,7 +81,7 @@ ion-toolbar{
|
||||
margin-right: 5px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
|
||||
.p-small{
|
||||
font-size: 13pt;
|
||||
margin-top: 13px;
|
||||
@@ -90,7 +90,7 @@ ion-toolbar{
|
||||
text-align: right;
|
||||
/* color: #ffffff; */
|
||||
}
|
||||
|
||||
|
||||
/* CONTENT */
|
||||
.item-list-small{
|
||||
font-size: 14px;
|
||||
@@ -98,14 +98,14 @@ ion-toolbar{
|
||||
}
|
||||
.ion-item-class{
|
||||
padding: 0;
|
||||
|
||||
|
||||
}
|
||||
.label-text{
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
//DIV
|
||||
.div-item-Oficial{
|
||||
width: 100%;
|
||||
@@ -146,7 +146,7 @@ ion-toolbar{
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
|
||||
}
|
||||
.div-content-Oficial{
|
||||
width: 85%;
|
||||
@@ -312,7 +312,7 @@ ion-toolbar{
|
||||
color: var(--white);
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
|
||||
.meeting-description {
|
||||
margin-top: 2px;
|
||||
font-family: Roboto;
|
||||
@@ -325,30 +325,38 @@ ion-toolbar{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.schedule {
|
||||
max-width: 400px;
|
||||
font-family: Roboto;
|
||||
margin: 10px 0px;
|
||||
padding: 20px;
|
||||
background-color: white;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
box-shadow: 0 0 10px 0 rgb(0 0 0 / 7%);
|
||||
border: solid 1px #e9e9e9;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 25px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
padding-bottom: 25px;
|
||||
|
||||
.schedule-header{
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
justify-content: space-between;
|
||||
padding: 20px 20px 0px 20px;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon{
|
||||
color: #e8e8e8;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
font-family: Roboto;
|
||||
font-size: 20px;
|
||||
@@ -364,10 +372,15 @@ ion-toolbar{
|
||||
}
|
||||
}
|
||||
.content{
|
||||
//padding: 0px 20px 20px 20px;
|
||||
overflow: auto;
|
||||
|
||||
.item-exp{
|
||||
overflow: auto;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
//padding-top: 5px;
|
||||
//padding-bottom: 5px;
|
||||
padding: 5px 20px 5px 20px;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
ion-list{
|
||||
padding: 0px;
|
||||
@@ -385,6 +398,8 @@ ion-toolbar{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
--background: transparent !important;
|
||||
|
||||
.schedule-time{
|
||||
margin-right: 10px;
|
||||
.time-start{
|
||||
@@ -414,7 +429,7 @@ ion-toolbar{
|
||||
font-size: 13px;
|
||||
color: black;
|
||||
width: 100%;
|
||||
|
||||
|
||||
}
|
||||
.description{
|
||||
width: 100%;
|
||||
@@ -442,7 +457,7 @@ ion-toolbar{
|
||||
padding-bottom: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.resume{
|
||||
@@ -473,6 +488,18 @@ ion-toolbar{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@media only screen and (max-width: 856px) {
|
||||
|
||||
.content, .conteiner-box{
|
||||
height: unset !important;
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (min-width: 804px) {
|
||||
|
||||
.schedule:first-child {
|
||||
@@ -496,4 +523,4 @@ ion-toolbar{
|
||||
ion-title{
|
||||
border: 1px solid red;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
customText = false;
|
||||
totalEvent=0;
|
||||
currentHoursMinutes: Date;
|
||||
currentHoursMinutes: Date | string;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
@@ -95,7 +95,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//console.log('Resize event detected');
|
||||
console.log('Resize event detected');
|
||||
// console.log('Resize event detected');
|
||||
|
||||
});
|
||||
|
||||
@@ -351,7 +351,7 @@ export class EventsPage implements OnInit {
|
||||
this.router.navigate(['/home/events', eventId, 'events']);
|
||||
}
|
||||
|
||||
goToExpediente(SerialNumber:any){
|
||||
goToExpediente(SerialNumber:any) {
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100 px-20">
|
||||
<div class="main-content d-flex height-100 pl-20 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header" >
|
||||
<div class="title-content width-100 d-flex justify-space-between align-center">
|
||||
@@ -40,7 +40,6 @@
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="cc!='' && cc!=' ' ">
|
||||
.. {{ cc | json }} ..
|
||||
|
||||
<h5 *ngIf="cc.length > 0">Com conhecimento</h5>
|
||||
<ion-item *ngIf="cc.length > 0" class="ion-no-margin ion-no-padding">
|
||||
@@ -76,8 +75,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 px-20">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||
<div class="option-desc"> <div>Responder ao PR</div> </div>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
|
||||
<!-- <div class="solid"></div> -->
|
||||
@@ -92,7 +91,7 @@
|
||||
<!-- <div class="solid"></div> -->
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header">
|
||||
<div class="title-content width-100 d-flex justify-space-between align-center">
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' "> <div>Responder ao PR</div> </div>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
|
||||
@@ -52,7 +52,7 @@ export class DespachoPage implements OnInit {
|
||||
private despachoService: DespachoService,
|
||||
private location: Location,
|
||||
public p: PermissionService,
|
||||
|
||||
|
||||
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header">
|
||||
<div class="title-content width-100 d-flex justify-space-between">
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons">
|
||||
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
|
||||
<div class="solid"></div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header">
|
||||
<div class="title-content width-100 d-flex justify-space-between">
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
|
||||
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
|
||||
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
|
||||
|
||||
@@ -44,7 +44,7 @@ export class DiplomaPage implements OnInit {
|
||||
private location: Location,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
// console.log(params["params"]);
|
||||
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialNumber = params["params"].SerialNumber;
|
||||
|
||||
@@ -51,7 +51,7 @@ export class ApproveEventPage implements OnInit {
|
||||
private location: Location,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
// console.log(params["params"]);
|
||||
|
||||
if(params["params"].serialNumber) {
|
||||
this.serialNumber = params["params"].serialNumber;
|
||||
|
||||
+5
-4
@@ -226,7 +226,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.runValidation()
|
||||
if(this.Form.invalid) return false
|
||||
}
|
||||
|
||||
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
this.eventBody={
|
||||
@@ -284,15 +284,16 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
}
|
||||
else if(this.task.FsId == '361') {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
await this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
|
||||
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
|
||||
break;
|
||||
|
||||
case 'PR':
|
||||
await this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise();
|
||||
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise();
|
||||
break;
|
||||
}
|
||||
this.close();
|
||||
@@ -307,7 +308,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
if(true) {
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@
|
||||
<div class="option-desc"> <div>Outras opções</div> </div>
|
||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||
|
||||
+6
-8
@@ -382,19 +382,17 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async(res)=>{
|
||||
alert('AQUI')
|
||||
let body = res['data'];
|
||||
if(res['data']) {
|
||||
|
||||
//await this.distartExpedientModal(body);
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
//this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header" style="overflow: unset !important;">
|
||||
<div class="title-content width-100 d-flex justify-between">
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons">
|
||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="listview">
|
||||
<ion-list *ngIf="allProcessesList">
|
||||
<div
|
||||
class="item-wrapper ion-no-padding cursor-pointer"
|
||||
class="item-wrapper box-hover ion-no-padding cursor-pointer"
|
||||
*ngFor = "let task of allProcessesList"
|
||||
(click)="goToProcess(task.SerialNumber, task.WorkflowName, task.activityInstanceName)">
|
||||
<div class="item width-100">
|
||||
@@ -89,7 +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="exp-card d-flex flex-column" >
|
||||
<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> -->
|
||||
<fa-icon class="icon-selected" icon="align-justify"></fa-icon>
|
||||
@@ -98,7 +98,7 @@
|
||||
<p class="text-center exp-card-content">{{ totalDocumentStore.count }} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
|
||||
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -106,7 +106,7 @@
|
||||
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="box-hover exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-correspondencia.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -115,7 +115,7 @@
|
||||
</div>
|
||||
|
||||
<!-- <div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" > -->
|
||||
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" >
|
||||
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="box-hover exp-card d-flex flex-column justify-center" >
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-pendente.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@
|
||||
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="exp-card d-md-flex flex-column justify-center" >
|
||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="box-hover exp-card d-md-flex flex-column justify-center" >
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -133,7 +133,7 @@
|
||||
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
|
||||
</div>
|
||||
|
||||
<div [class.active]="selectedElement == 'Dispatches'" class="exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -141,7 +141,7 @@
|
||||
<p class="text-center exp-card-content">{{despachoStore.count}} <span class="title1">Documentos</span> </p>
|
||||
</div>
|
||||
|
||||
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="exp-card d-flex flex-column justify-center">
|
||||
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-parecer.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -150,7 +150,7 @@
|
||||
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="exp-card d-flex flex-column justify-center">
|
||||
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-deferimento.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -172,7 +172,7 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="exp-card-long width-100" >
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
||||
<div class="center-div">
|
||||
<div class="exp-card-icon">
|
||||
<ion-icon src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||
@@ -184,7 +184,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="exp-card d-flex flex-column justify-center">
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="exp-card d-flex flex-column justify-center">
|
||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -202,7 +202,7 @@
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="exp-card d-flex flex-column justify-center">
|
||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
@@ -149,6 +149,7 @@ ion-segment-button{
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
background: white;
|
||||
border: 1px solid white;
|
||||
float: left;
|
||||
}
|
||||
.exp-card-long{
|
||||
@@ -156,12 +157,11 @@ ion-segment-button{
|
||||
user-select: none;
|
||||
background: white;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
background: white;
|
||||
width: 360px;
|
||||
margin: 7px 20px;
|
||||
border-radius: 15px;
|
||||
padding: 7px;
|
||||
border: blue !important;
|
||||
border:1px solid white;
|
||||
|
||||
.center-div{
|
||||
width: fit-content;
|
||||
@@ -517,6 +517,7 @@ ion-list{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 801px) {
|
||||
.title{
|
||||
font-size: 25px !important;
|
||||
@@ -559,6 +560,7 @@ ion-list{
|
||||
.active {
|
||||
color: white !important;
|
||||
fill: white !important;
|
||||
border: 1px solid #42b9fe !important;
|
||||
background: #42b9fe !important;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth <= 701){
|
||||
if( window.innerWidth < 701){
|
||||
this.modalController.dismiss();
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
@@ -134,6 +134,10 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
};
|
||||
this.checkRoutes();
|
||||
|
||||
|
||||
// this.eventoaprovacaostore.resetmd([])
|
||||
// this.eventoaprovacaostore.resetpr([])
|
||||
|
||||
}
|
||||
|
||||
ngDoCheck(): void {
|
||||
@@ -159,7 +163,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else{
|
||||
this.segmentVista = "boxview";
|
||||
this.segmentVista = "boxview"
|
||||
}
|
||||
|
||||
const pathname = window.location.pathname
|
||||
@@ -191,7 +195,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
async loadAllProcesses() {
|
||||
let allProcessesList = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
|
||||
|
||||
if(!this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter( element => element.activityInstanceName != 'Assinar Diplomas')
|
||||
} else if (this.p.userRole(['PR'])) {
|
||||
@@ -464,7 +468,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
if(despachos) {
|
||||
this.despachoStore.reset(despachos)
|
||||
}
|
||||
|
||||
|
||||
|
||||
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
|
||||
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
||||
@@ -503,7 +507,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||
|
||||
|
||||
|
||||
|
||||
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
@@ -521,7 +525,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
let diplomasAssinar = despachospr.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
this.count_dip_as = Object.keys(diplomasAssinar).length;
|
||||
this.deplomasStore.resetDiplomasList(diplomasAssinar)
|
||||
|
||||
|
||||
|
||||
let diplomasAssinados = despachospr.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
this.count_dip_as_pr = Object.keys(diplomasAssinados).length;
|
||||
@@ -569,7 +573,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
}
|
||||
|
||||
selectedElementF(element:string) {
|
||||
if (window.innerWidth >= 801) {
|
||||
if (window.innerWidth > 701) {
|
||||
return element == this.selectedElement
|
||||
}
|
||||
return false;
|
||||
@@ -578,7 +582,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
openAllProcessesPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"processes": true,}};
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
}
|
||||
else {
|
||||
@@ -591,7 +595,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
openEventsToApprovePage() {
|
||||
this.closeAllDesktopComponents();
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"eventos": true,}};
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
//this.openEventsToApproveList(profile);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
@@ -606,7 +610,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.closeAllDesktopComponents();
|
||||
switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
//this.openExpedientList();
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
@@ -618,7 +622,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
@@ -645,7 +649,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.segment = 'parecer'
|
||||
}
|
||||
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos'], navigationExtras);
|
||||
}
|
||||
else {
|
||||
@@ -662,7 +666,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openDespachosPage(segment?:string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth <= 801){
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||
}
|
||||
else{
|
||||
@@ -674,7 +678,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openDespachosPrPage(segment?:string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth <= 801){
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/despachos-pr']);
|
||||
}
|
||||
else{
|
||||
@@ -686,7 +690,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openPendentesPage(segment?:string){
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth <= 801){
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
else{
|
||||
@@ -698,7 +702,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openExpedientesPrPage(segment?:string){
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth <= 801) {
|
||||
if( window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
@@ -720,7 +724,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
this.segment = segment;
|
||||
|
||||
if( window.innerWidth <= 801){
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
|
||||
}
|
||||
else{
|
||||
@@ -734,7 +738,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openDiplomasAssinarPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth <= 801){
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100 overflow-hidden">
|
||||
<div class="content d-flex flex-column" *ngIf="task">
|
||||
<div class="main-header ">
|
||||
<div class="title-content width-100 d-flex justify-space-between ">
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="task" class="aside-right flex-column height-100">
|
||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
<div *ngIf="task.WorkflowName == 'Pedido de Deferimento'">
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Deferimento'">
|
||||
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||
|
||||
@@ -60,7 +60,7 @@ export class PedidoPage implements OnInit {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
// console.log(params["params"]);
|
||||
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
|
||||
@@ -1,39 +1,8 @@
|
||||
<ion-content class="text-white">
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin || SessionStore.user.LoginPreference == 'None' && SessionStore.hasPin || enterWithPassword">
|
||||
|
||||
<div class="bg-1 d-flex justify-center align-center">
|
||||
<div class="bg-2 d-flex justify-center align-center">
|
||||
<div class="bg-3 d-flex justify-center align-center">
|
||||
<div class="bg-4 d-flex justify-center align-center">
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/fullLogo.png' alt='logo'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="center text-white">Inicie a sessão</h3>
|
||||
<form class="form">
|
||||
<p class="form-label text-white">Email</p>
|
||||
<ion-item class="form-input">
|
||||
<ion-input type="text" [(ngModel)]="username" name="input-username"></ion-input>
|
||||
</ion-item>
|
||||
<p class="form-label text-white">Palavra-passe</p>
|
||||
<ion-item class="form-input">
|
||||
<ion-input (keyup.enter)="Login()" type="password" [(ngModel)]="password" name="input-password" ></ion-input>
|
||||
</ion-item>
|
||||
<div class="d-flex pt-25">
|
||||
<button class="btn-ok btn-login" fill="clear" expand="block" shape="round" (click)="Login()">Iniciar</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="msg-bottom d-flex">
|
||||
<p class="msg-bottom-p">Uma iniciativa do Gabinete do Presidente da República</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
|
||||
<div class="main-content d-flex flex-column width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' && !enterWithPassword " >
|
||||
|
||||
<div class="div-top-header">
|
||||
|
||||
|
||||
@@ -1,77 +1,79 @@
|
||||
@import '~src/function.scss';
|
||||
:host, app-login {
|
||||
ion-content {
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
}
|
||||
ion-content {
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
}
|
||||
}
|
||||
ion-content{
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
.main-wrapper{
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
background: white !important;
|
||||
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
background: white !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
/* width: 400px; */
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
/* margin: auto !important; */
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
/* width: 400px; */
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
/* margin: auto !important; */
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
}
|
||||
|
||||
.logo{
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
.bg-1{
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #4cb9f825;
|
||||
margin: auto;
|
||||
.bg-2{
|
||||
width: 225px;
|
||||
height: 225px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #61bdf2b4;
|
||||
margin: auto;
|
||||
.bg-3{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #96d3f8be;
|
||||
margin: auto;
|
||||
.bg-4{
|
||||
width: 175px;
|
||||
height: 175px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.918);
|
||||
padding: 15px;
|
||||
margin: auto;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #4cb9f825;
|
||||
margin: auto;
|
||||
.bg-2{
|
||||
width: 225px;
|
||||
height: 225px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #61bdf2b4;
|
||||
margin: auto;
|
||||
.bg-3{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: #96d3f8be;
|
||||
margin: auto;
|
||||
.bg-4{
|
||||
width: 175px;
|
||||
height: 175px;
|
||||
overflow: auto;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.918);
|
||||
padding: 15px;
|
||||
margin: auto;
|
||||
|
||||
.bg-4 img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bg-4 img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.div-logo{
|
||||
width: 200px !important;
|
||||
@@ -133,110 +135,216 @@ ion-item{
|
||||
|
||||
|
||||
.circle{
|
||||
color: white;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 19pt;
|
||||
background: #44b5ea;
|
||||
border-radius: 56px;
|
||||
margin-bottom: 15px;
|
||||
user-select: none;
|
||||
margin-right: 15px;
|
||||
margin-left: 15px;
|
||||
color: white;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 19pt;
|
||||
background: #44b5ea;
|
||||
border-radius: 56px;
|
||||
margin-bottom: 15px;
|
||||
user-select: none;
|
||||
margin-right: 15px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
.title{
|
||||
padding-top: 32px;
|
||||
z-index: 1000;
|
||||
height: unset !important;
|
||||
position: relative;
|
||||
top: -30px;
|
||||
padding-top: 32px;
|
||||
z-index: 1000;
|
||||
height: unset !important;
|
||||
position: relative;
|
||||
top: -30px;
|
||||
}
|
||||
|
||||
.terminal {
|
||||
padding-top: 49px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-image: url(/assets/background/auth.svg);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 100%;
|
||||
padding-bottom: 48px;
|
||||
margin-bottom: -58px;
|
||||
z-index: 100;
|
||||
margin-top: -80px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: url(/assets/background/auth.svg);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
background-size: 610px;
|
||||
}
|
||||
|
||||
.clear{
|
||||
color: #44b5ea;
|
||||
font-size: 12pt;
|
||||
z-index: 1000;
|
||||
color: #44b5ea;
|
||||
font-size: 12pt;
|
||||
z-index: 1000;
|
||||
}
|
||||
.dot-active{
|
||||
background: #44b5ea;
|
||||
background: #44b5ea;
|
||||
}
|
||||
|
||||
.dot{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin: 0 10px 0 0;
|
||||
border: 3px solid #44b5ea;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50px;
|
||||
-webkit-border-radius: 50px;
|
||||
-moz-border-radius: 50px;
|
||||
-ms-border-radius: 50px;
|
||||
-o-border-radius: 50px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin: 0 10px 0 0;
|
||||
border: 3px solid #44b5ea;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50px;
|
||||
-webkit-border-radius: 50px;
|
||||
-moz-border-radius: 50px;
|
||||
-ms-border-radius: 50px;
|
||||
-o-border-radius: 50px;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-size: 686px 674px;
|
||||
background-position: center;
|
||||
background-position-y: 110px;
|
||||
background-repeat: no-repeat;
|
||||
margin: auto;
|
||||
justify-content: space-around;
|
||||
width: 100vw;
|
||||
/* background-color: white; */
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
/* justify-content: center; */
|
||||
background-size: 686px 674px;
|
||||
background-position: center;
|
||||
background-position-y: 110px;
|
||||
background-repeat: no-repeat;
|
||||
margin: auto;
|
||||
/* justify-content: space-around; */
|
||||
}
|
||||
|
||||
.voltar{
|
||||
user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.msg-bottom{
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.msg-bottom-p{
|
||||
width: 220px;
|
||||
position: absolute;
|
||||
bottom: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
.msg-bottom-p{
|
||||
width: 220px;
|
||||
position: absolute;
|
||||
bottom: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-height: 746px){
|
||||
.msg-bottom-p {
|
||||
padding-top: 20px;
|
||||
position: unset !important;
|
||||
}
|
||||
.msg-bottom-p {
|
||||
padding-top: 20px;
|
||||
position: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pin-4 {
|
||||
z-index: 1000;
|
||||
margin-bottom: 36px;
|
||||
z-index: 1000;
|
||||
margin-bottom: 107px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media only screen and (min-height: 168px) {
|
||||
.circle{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-bottom: 7px;
|
||||
margin-right: 7px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
.terminal{
|
||||
margin-top: -33px !important;
|
||||
}
|
||||
|
||||
.pin-4 {
|
||||
position: relative;
|
||||
top: 49px;
|
||||
}
|
||||
|
||||
.clear {
|
||||
padding-top: 10px !important;
|
||||
}
|
||||
|
||||
.div-top-header {
|
||||
position: unset ;
|
||||
top: unset ;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-height: 640px) {
|
||||
.circle{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-bottom: 9px;
|
||||
margin-right: 9px;
|
||||
margin-left: 9px;
|
||||
}
|
||||
.terminal{
|
||||
margin-top: -33px !important;
|
||||
}
|
||||
|
||||
.pin-4 {
|
||||
position: relative;
|
||||
top: 49px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-height: 667px) {
|
||||
.circle{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-bottom: 7px;
|
||||
margin-right: 7px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
.terminal{
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.clear {
|
||||
padding-top: 25px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-height: 731px) {
|
||||
.circle{
|
||||
width: 63px;
|
||||
height: 63px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.terminal{
|
||||
margin-top: -33px !important;
|
||||
}
|
||||
|
||||
.pin-4 {
|
||||
position: relative;
|
||||
top: 35px;
|
||||
}
|
||||
|
||||
.div-top-header {
|
||||
position: absolute !important;
|
||||
top: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-height: 832px) {
|
||||
.circle{
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
margin-bottom: 15px;
|
||||
margin-right: 15px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.terminal{
|
||||
margin-top: -33px !important;
|
||||
}
|
||||
|
||||
.pin-4 {
|
||||
position: relative;
|
||||
top: unset !important;
|
||||
margin-bottom: 107px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,47 @@ export class InactivityPage implements OnInit {
|
||||
public alertController: AlertController
|
||||
) {}
|
||||
|
||||
ngOnInit() {}
|
||||
loop = false
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
// window.addEventListener('resize', (event) => {
|
||||
// if(this.router.url != '/login') return false
|
||||
|
||||
// if(this.loop == false) {
|
||||
// this.loop = true
|
||||
// this.runloop()
|
||||
// }
|
||||
|
||||
// }, true);
|
||||
|
||||
}
|
||||
|
||||
runloop() {
|
||||
// const containerHeight = 651
|
||||
|
||||
// let circleHeight = document.querySelector('.circle')['offsetHeight']
|
||||
// let circleWidth = document.querySelector('.circle')['offsetWidth']
|
||||
// console.log(window.innerHeight, ' < ', containerHeight)
|
||||
|
||||
// console.log(circleHeight)
|
||||
|
||||
// document.querySelectorAll('.circle').forEach(e=>{
|
||||
// e['style']['height'] = (circleHeight -1 )+'px'
|
||||
// e['style']['width'] = (circleWidth -1 )+'px'
|
||||
// })
|
||||
|
||||
|
||||
// if( window.innerHeight< containerHeight) {
|
||||
// setTimeout(()=>{
|
||||
// this.runloop()
|
||||
// }, 100)
|
||||
// } else {
|
||||
// this.loop = false
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
async presentAlert(message: string) {
|
||||
const alert = await this.alertController.create({
|
||||
@@ -70,15 +110,15 @@ export class InactivityPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt, false)
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
|
||||
if (attempt) {
|
||||
|
||||
// if current attemp is equal to the current user
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
SessionStore.setInativity(true)
|
||||
|
||||
this.goback()
|
||||
@@ -131,9 +171,14 @@ export class InactivityPage implements OnInit {
|
||||
const code = this.code.join('')
|
||||
|
||||
if( SessionStore.validatePin(code)) {
|
||||
|
||||
|
||||
SessionStore.setInativity(true)
|
||||
this.goback()
|
||||
this.clearCode()
|
||||
|
||||
setTimeout(()=>{
|
||||
this.clearCode()
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
this.toastService.badRequest('Pin incorreto')
|
||||
this.code = []
|
||||
@@ -143,7 +188,12 @@ export class InactivityPage implements OnInit {
|
||||
|
||||
goback() {
|
||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||
this.router.navigate([pathName]);
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
storePin() {
|
||||
|
||||
@@ -144,7 +144,7 @@ ion-item{
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.title{
|
||||
.title {
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ ion-item{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.msg-bottom-p{
|
||||
.msg-bottom-p {
|
||||
width: 220px;
|
||||
position: absolute;
|
||||
bottom: 0 !important;
|
||||
@@ -211,7 +211,7 @@ ion-item{
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-height: 746px){
|
||||
@media only screen and (max-height: 746px) {
|
||||
.msg-bottom-p {
|
||||
padding-top: 20px;
|
||||
position: unset !important;
|
||||
|
||||
@@ -6,7 +6,6 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
@@ -17,7 +16,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
export class LoginPage implements OnInit {
|
||||
|
||||
logstatus: boolean;
|
||||
username: string = environment.defaultuser;
|
||||
username: string = SessionStore.user.Email || environment.defaultuser;
|
||||
password: string = environment.defaultuserpwd;
|
||||
userattempt: UserForm;
|
||||
code = []
|
||||
@@ -32,31 +31,11 @@ export class LoginPage implements OnInit {
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
public alertController: AlertController,
|
||||
private localstoreService: LocalstoreService
|
||||
public alertController: AlertController
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
let userData = this.sessionStore.user
|
||||
|
||||
const loginPreference = userData?.LoginPreference
|
||||
const pin = userData?.PIN
|
||||
|
||||
if (pin) {
|
||||
this.hasPin = true
|
||||
} else {
|
||||
this.hasPin = false
|
||||
}
|
||||
|
||||
if (loginPreference) {
|
||||
this.loginPreference = loginPreference
|
||||
} else {
|
||||
this.loginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateUsername() {
|
||||
@@ -97,13 +76,25 @@ export class LoginPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt)
|
||||
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
|
||||
if (attempt) {
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
|
||||
this.router.navigate(['/pin']);
|
||||
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
SessionStore.setInativity(true)
|
||||
|
||||
this.goback()
|
||||
} else {
|
||||
SessionStore.delete()
|
||||
window.localStorage.clear();
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
this.router.navigate(['/pin']);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -116,4 +107,15 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
goback() {
|
||||
const pathName = SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,13 +14,14 @@ import { NewActionPageModule } from 'src/app/shared/publication/new-action/new-a
|
||||
import { PublicationDetailPageModule } from 'src/app/shared/publication/view-publications/publication-detail/publication-detail.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
|
||||
FontAwesomeModule,
|
||||
PublicationsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
ViewPublicationsPageModule,
|
||||
|
||||
@@ -39,20 +39,23 @@
|
||||
|
||||
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<!-- <ion-list class="width-100"> -->
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="item width-100 cursor-pointer"
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100 cursor-pointer"
|
||||
*ngFor="let viagem of publicationTravelFolderService.list">
|
||||
<ion-item lines="none"
|
||||
class="width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
|
||||
class="item width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
[class.item-active]="viagem.ProcessId == idSelected"
|
||||
>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
<p class="item-content-date my-5" [class.item-content-date-active]="viagem.ProcessId == idSelected">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10" [class.item-content-title-active]="viagem.ProcessId == idSelected">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5" [class.item-content-detail-active]="viagem.ProcessId == idSelected">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" [class.item-options-active]="viagem.ProcessId == idSelected" autoHide="false">
|
||||
<!-- <ion-icon src="assets/images/icons-menu.svg"></ion-icon> -->
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
@@ -68,38 +71,25 @@
|
||||
</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
<!-- </ion-list> -->
|
||||
<!-- <div class="item width-100 d-flex"
|
||||
*ngFor="let viagem of publicationsTravelFolderList">
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5">De {{viagem.DateBegin}} a {{viagem.DateEnd}}</p>
|
||||
<p class="item-content-title my-10">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="item width-100"
|
||||
*ngFor="let evento of publicationEventFolderStorage.list"
|
||||
>
|
||||
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100"
|
||||
*ngFor="let evento of publicationEventFolderStorage.list">
|
||||
<ion-item lines="none"
|
||||
class="width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
class="item cursor-pointer width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
[class.item-active]="evento.ProcessId == idSelected"
|
||||
(click)="goToPublicationsList(evento.ProcessId)">
|
||||
<div class="item-icon2">
|
||||
<ion-icon slot="end" src='assets/images/icons-nav-actions.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="item-content flex-grow-1">
|
||||
<ion-label>
|
||||
<p class="item-content-date">{{getDate(evento.DateBegin)}}</p>
|
||||
<p class="item-content-title">{{evento.Description}}</p>
|
||||
<p class="item-content-date" [class.item-content-date-active]="evento.ProcessId == idSelected">{{getDate(evento.DateBegin)}}</p>
|
||||
<p class="item-content-title" [class.item-content-title-active]="evento.ProcessId == idSelected">{{evento.Description}}</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div (click)="openOptions(evento.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<div (click)="openOptions(evento.ProcessId)" class="item-options d-none cursor-pointer" [class.item-options-active]="evento.ProcessId == idSelected" autoHide="false">
|
||||
<!-- <ion-icon src="assets/images/icons-menu.svg"></ion-icon> -->
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
@@ -115,22 +105,6 @@
|
||||
</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
<!-- <div class="item width-100 d-flex"
|
||||
*ngFor="let evento of publicationsEventFolderList"
|
||||
(click)="viewPublications(evento)">
|
||||
<div class="item-icon2">
|
||||
<ion-icon slot="end" src='assets/images/icons-nav-actions.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="item-content flex-grow-1">
|
||||
<ion-label>
|
||||
<p class="item-content-date">{{evento.DateBegin}}</p>
|
||||
<p class="item-content-title">{{evento.Description}}</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div (click)="openOptions(evento.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ ion-toolbar{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ion-content{
|
||||
// --background:#0782c9;
|
||||
--border: none;
|
||||
@@ -52,7 +52,7 @@ ion-toolbar{
|
||||
overflow:hidden;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
@@ -93,20 +93,25 @@ ion-toolbar{
|
||||
}
|
||||
|
||||
.aside{
|
||||
padding: 0px 20px 0 20px !important;
|
||||
//padding: 0px 20px 0 20px !important;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
//border: 1px solid red;
|
||||
}
|
||||
}
|
||||
ion-item{
|
||||
--background: transparent;
|
||||
}
|
||||
.item{
|
||||
width: 100% !important;
|
||||
padding: 0px !important;
|
||||
padding: 0px 20px 0 20px !important;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
background-color: transparent;
|
||||
overflow: auto;
|
||||
|
||||
.item-icon{
|
||||
//margin-top: 28px;
|
||||
@@ -129,6 +134,7 @@ ion-toolbar{
|
||||
width: 100%;
|
||||
padding: 15px 0 15px 10px;
|
||||
overflow: auto;
|
||||
margin-right: 5px;
|
||||
|
||||
p{
|
||||
white-space: nowrap;
|
||||
@@ -154,13 +160,24 @@ ion-toolbar{
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-options{
|
||||
color: #42b9fe;
|
||||
width: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.item-content-date-active, .item-content-title-active, .item-content-detail-active, .item-options-active{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-options{
|
||||
.item-active{
|
||||
background-color: #42b9fe !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
width: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.item:hover{
|
||||
background-color: #e6f6ff75;
|
||||
}
|
||||
|
||||
ion-item-options{
|
||||
@@ -207,7 +224,7 @@ ion-toolbar{
|
||||
margin: 12px;
|
||||
border: 1px solid #d30a0a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ export class PublicationsPage implements OnInit {
|
||||
//publication: object;
|
||||
hideRefreshBtn = true;
|
||||
showSlidingOptions = true;
|
||||
idSelected: string;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -213,6 +214,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
goToPublicationsList(folderId: string){
|
||||
this.folderId = folderId
|
||||
this.idSelected = folderId;
|
||||
|
||||
if( window.innerWidth <= 800){
|
||||
this.router.navigate(['/home/publications',folderId]);
|
||||
|
||||
+7
-4
@@ -6,6 +6,7 @@ import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail',
|
||||
@@ -26,6 +27,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -33,7 +35,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
this.publicationId = params["params"].publicationId;
|
||||
console.log(params["params"]);
|
||||
// console.log(params["params"]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -93,7 +95,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
if(this.isModal) {
|
||||
this.close()
|
||||
} else {
|
||||
this.router.navigate(['/home/publications', this.folderId]);
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,14 +106,15 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
|
||||
this.toastService.successMessage('Publicaçao eliminada')
|
||||
this.toastService.successMessage('Publicação eliminada')
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Publicaçao não eliminada')
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.goBack();
|
||||
}
|
||||
this.goBack();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
console.log(params["params"]);
|
||||
// console.log(params["params"]);
|
||||
}
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
@@ -58,9 +58,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
}, 3000);
|
||||
}, 5000);
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
|
||||
res.forEach(element => {
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
@@ -122,6 +122,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
if(error.status == '404'){
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList= [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { ParticipantsPipe } from './participants.pipe';
|
||||
|
||||
describe('ParticipantsPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new ParticipantsPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model'
|
||||
|
||||
@Pipe({
|
||||
name: 'participants'
|
||||
})
|
||||
export class ParticipantsPipe implements PipeTransform {
|
||||
|
||||
transform(EventPerson: EventPerson[]): any {
|
||||
let taskParticipants = [];
|
||||
let taskParticipantsCc = [];
|
||||
|
||||
EventPerson.forEach(e =>{
|
||||
if(e.IsRequired) {
|
||||
taskParticipants.push(e);
|
||||
} else {
|
||||
taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
|
||||
return {taskParticipants, taskParticipantsCc}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,10 +5,11 @@ import { CustomTaskPipe } from './custom-task.pipe';
|
||||
import { EventPipe } from './event.pipe';
|
||||
import { PublicationPipe } from './publication.pipe';
|
||||
import { ExpedienteTaskPipe } from './expediente-task.pipe';
|
||||
import { ParticipantsPipe } from './participants.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe, ExpedienteTaskPipe],
|
||||
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe, ExpedienteTaskPipe, ParticipantsPipe],
|
||||
exports: [FilterPipe],
|
||||
imports: []
|
||||
})
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ListBoxService } from './list-box.service';
|
||||
|
||||
describe('ListBoxService', () => {
|
||||
let service: ListBoxService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ListBoxService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,205 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList';
|
||||
import { DateService } from '../date.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ListBoxService {
|
||||
|
||||
constructor(
|
||||
private dateService: DateService
|
||||
){}
|
||||
|
||||
|
||||
filterProfile(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all') {
|
||||
return eventSource.filter((e) => e.profile == profile)
|
||||
}
|
||||
|
||||
getEventInsideRange(eventSource: EventListStore[], rangeStartDate, randEndDate) {
|
||||
return eventSource.filter((e)=> {
|
||||
if(new Date(rangeStartDate).getTime() <= new Date(e.startTime).getTime() &&
|
||||
new Date(randEndDate).getTime() >= new Date(e.endTime).getTime()) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
|
||||
return eventSource.filter( data => data.calendarName == segment)
|
||||
}
|
||||
|
||||
|
||||
daysBetween(){ }
|
||||
|
||||
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
|
||||
|
||||
// filter range
|
||||
if(selectedDate) {
|
||||
eventSource = eventSource.filter(data =>
|
||||
data.startTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt') &&
|
||||
data.endTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt')
|
||||
)
|
||||
}
|
||||
|
||||
if(segment!='Combinado') {
|
||||
eventSource = this.filterSegment(eventSource, segment)
|
||||
}
|
||||
|
||||
if(profile != 'all') {
|
||||
eventSource = this.filterProfile(eventSource, profile)
|
||||
}
|
||||
|
||||
let newStracture:CustomCalendarEvent[];
|
||||
|
||||
if(profile == 'md') {
|
||||
newStracture = this.encapsulation(eventSource, 'mdgpr');
|
||||
} else {
|
||||
newStracture = this.encapsulation(eventSource, 'pr');
|
||||
}
|
||||
|
||||
return this.display(newStracture, profile, selectedDate)
|
||||
}
|
||||
|
||||
display(list: CustomCalendarEvent[], profile, selectedDate) {
|
||||
let days = {};
|
||||
|
||||
list.forEach( (event:CustomCalendarEvent, index)=> {
|
||||
|
||||
var startDate: any = new Date(event.start);
|
||||
|
||||
var endDate: any = this.dateService.EventEndDateTreatment({
|
||||
startTime: startDate,
|
||||
endTime: event.end
|
||||
})
|
||||
|
||||
const day = this.dateService.getDay(event.start)
|
||||
|
||||
event['manyDays'] = false
|
||||
event['todayOnly'] = this.dateService.isSameDate(event.start, event.end)
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
if (this.dateService.notSameDate(startDate, endDate)) {
|
||||
|
||||
const diffDays = this.dateService.deferenceBetweenDays(endDate, startDate)
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = this.transForm(event, {startMany: true,endMany: false, middle: false, profile})
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
// create event between date
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
let otherDays = this.dateService.getDay(newDate)
|
||||
|
||||
event['other'] = true
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: false, profile})
|
||||
if(this.push(event, selectedDate)) days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
|
||||
const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true, profile})
|
||||
if(this.push(event, selectedDate)) days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
}
|
||||
} else {
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
}
|
||||
}
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
|
||||
})
|
||||
|
||||
// remove days that haven't event
|
||||
Object.entries(days).forEach(([index, value]) => {
|
||||
const _value: any = value
|
||||
|
||||
if(_value.length == 0) {
|
||||
delete days[index]
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return days
|
||||
}
|
||||
|
||||
|
||||
push(event: any, selectedDate: Date) {
|
||||
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
|
||||
new Date(event.start).getFullYear() == selectedDate.getFullYear()
|
||||
}
|
||||
|
||||
encapsulation(eventsList:EventListStore[], profile): CustomCalendarEvent[] {
|
||||
|
||||
// remove all event
|
||||
let events: CustomCalendarEvent[] = [];
|
||||
|
||||
eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
events.push({
|
||||
start: new Date(element.startTime),
|
||||
end: new Date(element.endTime),
|
||||
id: element.id,
|
||||
event: element.event,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
|
||||
transForm(event: CustomCalendarEvent, {startMany, endMany, middle, profile}) {
|
||||
return Object.assign({}, {
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
id: event.id,
|
||||
profile: profile,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export class AuthService {
|
||||
|
||||
}
|
||||
|
||||
async login(user: UserForm, saveSession = true): Promise<LoginUserRespose> {
|
||||
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);
|
||||
|
||||
@@ -99,7 +99,7 @@ export class ChatService {
|
||||
|
||||
let opts = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
params: params,
|
||||
}
|
||||
return this.http.get(environment.apiChatUrl+'im.history', opts);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DateService } from './date.service';
|
||||
|
||||
describe('DateService', () => {
|
||||
let service: DateService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DateService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DateService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
||||
deferenceBetweenDays(start: any, end: any) {
|
||||
const diffTime = Math.abs(end - start);
|
||||
return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
}
|
||||
|
||||
notSameDate(start: any, end: any): boolean {
|
||||
return new Date(start).toLocaleDateString() != new Date(end).toLocaleDateString()
|
||||
}
|
||||
isSameDate(start: any, end: any): boolean {
|
||||
return !this.notSameDate(start, end)
|
||||
}
|
||||
|
||||
EventEndDateTreatment({startTime, endTime}) {
|
||||
|
||||
const startTimeSamp = new Date(startTime).toLocaleDateString()
|
||||
const endTimeSamp = new Date(endTime).toLocaleDateString()
|
||||
|
||||
const endMinutes = new Date(endTime).getMinutes()
|
||||
const endHours = new Date(endTime).getHours()
|
||||
|
||||
|
||||
if (startTimeSamp < endTimeSamp && (endMinutes + endHours) == 0) {
|
||||
endTime = new Date(endTime);
|
||||
endTime.setSeconds(endTime.getSeconds() - 1);
|
||||
return new Date(endTime)
|
||||
} else {
|
||||
return new Date(endTime)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
getDay(date) {
|
||||
return (((new Date (date)).getDate())).toString().padStart(2,'0')
|
||||
}
|
||||
}
|
||||
+129
-107
@@ -4,7 +4,8 @@ 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 } from '../models/user.model';
|
||||
import { LoginUserRespose, UserSession } from '../models/user.model';
|
||||
import { EventList } from '../models/agenda/AgendaEventList';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -13,7 +14,7 @@ import { LoginUserRespose } from '../models/user.model';
|
||||
export class EventsService {
|
||||
|
||||
authheader = {};
|
||||
loggeduser: LoginUserRespose;
|
||||
loggeduser: UserSession;
|
||||
headers: HttpHeaders;
|
||||
|
||||
headersPrOficial: HttpHeaders;
|
||||
@@ -40,7 +41,7 @@ export class EventsService {
|
||||
|
||||
if(this.loggeduser){
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||
if(calendar.CalendarName == 'Oficial') {
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -51,10 +52,10 @@ export class EventsService {
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
|
||||
if(sharedCalendar.CalendarName == 'Oficial') {
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -69,7 +70,7 @@ export class EventsService {
|
||||
});
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -80,11 +81,11 @@ export class EventsService {
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
@@ -98,16 +99,16 @@ export class EventsService {
|
||||
|
||||
params = params.set("StartDate", startdate);
|
||||
params = params.set("EndDate", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
} */
|
||||
|
||||
|
||||
getAllPrOficialEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
getAllPrOficialEvents(startdate:string, enddate:string): Observable<EventList[]>{
|
||||
let geturl = environment.apiURL + 'calendar/pr';
|
||||
geturl = geturl.replace('/V4/','/V5/')
|
||||
|
||||
@@ -115,15 +116,15 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllPrPessoalEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
getAllPrPessoalEvents(startdate:string, enddate:string): Observable<EventList[]>{
|
||||
let geturl = environment.apiURL + 'calendar/pr';
|
||||
geturl = geturl.replace('/V4/','/V5/')
|
||||
|
||||
@@ -131,15 +132,15 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
async getAllPrEvents(startdate:string, enddate:string){
|
||||
async getAllPrEvents(startdate:string, enddate:string): Promise<EventList[]>{
|
||||
let prO = await this.getAllPrOficialEvents(startdate, enddate).toPromise();
|
||||
let prP = await this.getAllPrPessoalEvents(startdate, enddate).toPromise();
|
||||
const resFinal = prO.concat(prP);
|
||||
@@ -148,32 +149,32 @@ export class EventsService {
|
||||
})
|
||||
}
|
||||
|
||||
getAllMdOficialEvents(startdate:string, enddate:string): any{
|
||||
getAllMdOficialEvents(startdate:string, enddate:string): Observable<EventList[]>{
|
||||
let geturl = environment.apiURL + 'calendar/md';
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllMdPessoalEvents(startdate:string, enddate:string): any{
|
||||
let geturl = environment.apiURL + 'calendar/md';
|
||||
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options)
|
||||
}
|
||||
@@ -191,7 +192,7 @@ export class EventsService {
|
||||
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
|
||||
const resFinal = prO.concat(prP);
|
||||
|
||||
|
||||
return new Promise(resolve =>{
|
||||
return resolve(resFinal)
|
||||
});
|
||||
@@ -207,13 +208,13 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
};
|
||||
console.log(options);
|
||||
|
||||
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
@@ -225,10 +226,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -237,8 +238,8 @@ export class EventsService {
|
||||
|
||||
getRecurrenceTypes(): any{
|
||||
const geturl = environment.apiURL + 'Calendar/RecurrenceTypes';
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
@@ -253,10 +254,10 @@ export class EventsService {
|
||||
params = params.set("CalendarName", calendarname);
|
||||
params = params.set("StartDate", startdate);
|
||||
params = params.set("EndDate", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -264,12 +265,12 @@ export class EventsService {
|
||||
getEvent(eventid: string): Observable<Event>{
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
@@ -283,10 +284,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||
params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
@@ -300,10 +301,31 @@ export class EventsService {
|
||||
|
||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||
params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
params.set('CalendarId', event.CalendarId)
|
||||
params.set('CalendarName', event.CalendarName)
|
||||
this.headers['CalendarId'] = event.CalendarId
|
||||
this.headers['CalendarName'] = event.CalendarName
|
||||
|
||||
if(event.CalendarName == 'Oficial'){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.headers = this.headersMdOficial;
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.headers = this.headersPrOficial;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.headers = this.headersMdPessoal;
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.headers = this.headersPrPessoal;
|
||||
}
|
||||
}
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
@@ -311,7 +333,7 @@ export class EventsService {
|
||||
|
||||
changeAgenda(body:any){
|
||||
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
||||
let options = {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.post<any>(`${puturl}`, body, options);
|
||||
@@ -324,14 +346,14 @@ export class EventsService {
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
|
||||
return this.http.post<Event>(`${puturl}`, event, options)
|
||||
} */
|
||||
|
||||
|
||||
postEventMd(event:Event, calendarName:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/md';
|
||||
@@ -343,17 +365,17 @@ export class EventsService {
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -372,21 +394,21 @@ export class EventsService {
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
@@ -399,11 +421,11 @@ export class EventsService {
|
||||
// 0 for occurence and 1 for serie (delete all events)
|
||||
params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
|
||||
return this.http.delete(`${puturl}`, options)
|
||||
}
|
||||
postExpedientEvent(docId:any, body:any, sharedagenda:string, serialNumber:any, applicationID:any){
|
||||
@@ -418,29 +440,29 @@ export class EventsService {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -459,29 +481,29 @@ export class EventsService {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -492,7 +514,7 @@ export class EventsService {
|
||||
postEventToApproveEdit(body: EventToApproveEdit) {
|
||||
const geturl = environment.apiURL + 'Tasks/EditEventTask';
|
||||
|
||||
let options = {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TimeService } from './time.service';
|
||||
|
||||
describe('TimeService', () => {
|
||||
let service: TimeService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(TimeService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TimeService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
showDateDuration(start:any){
|
||||
let end;
|
||||
end = new Date();
|
||||
start = new Date(start);
|
||||
let customizedDate;
|
||||
|
||||
const totalSeconds = Math.floor((end - (start))/1000);;
|
||||
const totalMinutes = Math.floor(totalSeconds/60);
|
||||
const totalHours = Math.floor(totalMinutes/60);
|
||||
const totalDays = Math.floor(totalHours/24);
|
||||
|
||||
const hours = totalHours - ( totalDays * 24 );
|
||||
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
|
||||
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
|
||||
|
||||
if(totalDays == 0){
|
||||
if(start.getDate() == new Date().getDate()){
|
||||
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
|
||||
return time;
|
||||
}
|
||||
else{
|
||||
return 'Ontem';
|
||||
}
|
||||
}
|
||||
else{
|
||||
let date = this.addZero(start.getDate()) + "/" + this.addZero(start.getMonth()+1) + "/" + start.getFullYear();
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
addZero(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export class InativityService {
|
||||
|
||||
function resetTimer() {
|
||||
clearTimeout(t);
|
||||
t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
|
||||
t = setTimeout(userIsNotActive, 60000 * 15); // time is in milliseconds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
self.addEventListener('install', function() {
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener('activate', function(event) {
|
||||
event.waitUntil(clients.claim());
|
||||
});
|
||||
|
||||
self.addEventListener('notificationclick', function(event) {
|
||||
// Close the notification when it is clicked
|
||||
event.notification.close();
|
||||
console.log(event)
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WebNotificationPopupService } from './web-notification-popup.service';
|
||||
|
||||
describe('WebNotificationPopupService', () => {
|
||||
let service: WebNotificationPopupService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WebNotificationPopupService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,81 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WebNotificationPopupService {
|
||||
|
||||
constructor( private platform: Platform) {
|
||||
|
||||
navigator.serviceWorker.register(new URL('./sw.js', import.meta.url));
|
||||
|
||||
}
|
||||
|
||||
|
||||
askNotificationPermission() {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {}
|
||||
else {return false}
|
||||
|
||||
// function to actually ask the permissions
|
||||
function handlePermission(permission) {}
|
||||
|
||||
// Let's check if the browser supports notifications
|
||||
if (!('Notification' in window)) {
|
||||
console.log("This browser does not support notifications.");
|
||||
} else {
|
||||
if(this.checkNotificationPromise()) {
|
||||
Notification.requestPermission()
|
||||
.then((permission) => {
|
||||
handlePermission(permission);
|
||||
})
|
||||
} else {
|
||||
Notification.requestPermission(function(permission) {
|
||||
handlePermission(permission);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private checkNotificationPromise() {
|
||||
try {
|
||||
Notification.requestPermission().then();
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
sendNotification(e) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {}
|
||||
else {return false}
|
||||
|
||||
Notification.requestPermission((result) => {
|
||||
if (result === 'granted') {
|
||||
navigator.serviceWorker.ready.then((registration)=> {
|
||||
|
||||
registration.showNotification(e.Object, {
|
||||
body: e.Service,
|
||||
icon: 'assets/icon/favicon.png',
|
||||
requireInteraction: true,
|
||||
tag: 'require-interaction'+uuidv4(),
|
||||
// actions: [
|
||||
// {action: 'like', title: 'Like', icon: 'https://example/like.png'},
|
||||
// {action: 'reply', title: 'Reply', icon: 'https://example/reply.png'}
|
||||
// ]
|
||||
}).then(e =>{
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import { ToastService } from '../services/toast.service';
|
||||
import { Optional } from '@angular/core';
|
||||
import { JsonStore } from './jsonStore.service';
|
||||
import { synchro } from './socket/synchro.service';
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -27,10 +27,11 @@ export class NotificationsService {
|
||||
callbacks: {
|
||||
type: string,
|
||||
funx: Function
|
||||
id: string
|
||||
}[] = []
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private http: HttpClient,
|
||||
private storageService: StorageService,
|
||||
private modalController: ModalController,
|
||||
public modalCtrl: AlertController,
|
||||
@@ -40,17 +41,39 @@ export class NotificationsService {
|
||||
private toastService: ToastService,
|
||||
private zone: NgZone,
|
||||
private activeroute: ActivatedRoute,
|
||||
private jsonstore: JsonStore) { }
|
||||
private jsonstore: JsonStore) {
|
||||
|
||||
registerCallback(type: string, funx: Function, object: any = {} ) {
|
||||
this.storageService.get("Notifications").then((value) => {
|
||||
|
||||
}).catch(()=>{
|
||||
|
||||
this.storageService.store("Notifications",[])
|
||||
})
|
||||
|
||||
this.callbacks.push({type, funx})
|
||||
if(!object.hasOwnProperty('desktop') && object['desktop'] != false) {
|
||||
synchro.registerCallback('Notification',funx, type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
registerCallback(type: string, funx: Function, object: any = {} ) {
|
||||
|
||||
const id = uuidv4()
|
||||
this.callbacks.push({type, funx, id})
|
||||
if(!object.hasOwnProperty('desktop') && object['desktop'] != false) {
|
||||
synchro.registerCallback('Notification',funx, type)
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
deleteCallback(id) {
|
||||
this.callbacks.forEach((e, index)=>{
|
||||
if(e.id == id) {
|
||||
if (index > -1) {
|
||||
this.callbacks.splice(index, 1);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getTokenByUserIdAndId(user, userID) {
|
||||
const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ export class ProcessesService {
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
|
||||
SetTaskToPending(serialNumber:string): Observable<any>{
|
||||
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
|
||||
|
||||
@@ -79,13 +79,18 @@ class SynchroService {
|
||||
|
||||
private onopen = () =>{
|
||||
|
||||
this.BackgroundService.online()
|
||||
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Online') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
|
||||
if(!this.conected) {
|
||||
|
||||
this.BackgroundService.online()
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Online') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
console.log('open ======================= welcome to socket server')
|
||||
this._connected = true
|
||||
@@ -130,6 +135,7 @@ class SynchroService {
|
||||
|
||||
if(window['platform'].is('desktop') || this.platform.is('mobileweb')) {}
|
||||
else return false
|
||||
|
||||
if(environment.production) return false
|
||||
|
||||
this.callBacks.forEach((e)=> {
|
||||
@@ -169,13 +175,16 @@ class SynchroService {
|
||||
console.log('[close] Connection died');
|
||||
console.log('Reconnect')
|
||||
|
||||
this.BackgroundService.offline();
|
||||
|
||||
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Offline') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
if(this._connected) {
|
||||
this.BackgroundService.offline();
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Offline') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// status
|
||||
this._connected = false
|
||||
|
||||
@@ -1,33 +1,47 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { AnimationController, ModalController,Platform } from '@ionic/angular';
|
||||
import { SHA1 } from 'crypto-js'
|
||||
import { localstoreService } from '../store/localstore.service';
|
||||
/* import { Plugins } from '@capacitor/core';
|
||||
const { Storage } = Plugins; */
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class StorageService {
|
||||
constructor(private storage:Storage,) {}
|
||||
private keyName: string;
|
||||
|
||||
constructor(private storage:Storage,
|
||||
private platform: Platform
|
||||
) {}
|
||||
|
||||
key(key:string): string {
|
||||
return (SHA1('service'+this.constructor.name+key)).toString()
|
||||
}
|
||||
|
||||
// Store the value
|
||||
async store(key: string, value: any){
|
||||
const encryptedValue = btoa(escape(JSON.stringify(value)));
|
||||
await this.storage.set(key, encryptedValue);
|
||||
async store(key: string, value: any) {
|
||||
|
||||
await localstoreService.set(this.key(key), value)
|
||||
|
||||
}
|
||||
// Get the value
|
||||
async get(key: string) {
|
||||
const ret = await this.storage.get(key).then((val) => { return val; });
|
||||
try {
|
||||
return JSON.parse(unescape(atob(ret)));
|
||||
} catch (error) {
|
||||
return unescape(atob(ret))
|
||||
}
|
||||
async get(key: string): Promise<any> {
|
||||
|
||||
return new Promise((resolve, reject)=>{
|
||||
const data = localstoreService.get(this.key(key), false)
|
||||
if(data) resolve(data)
|
||||
else reject(data)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async remove(key: string){
|
||||
await this.storage.remove(key);
|
||||
|
||||
await localstoreService.delete(this.key(key))
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// Get the value
|
||||
async get(storageKey: string) {
|
||||
|
||||
@@ -45,6 +45,31 @@ export class WebNotificationsService {
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* MFPPush.initialize({
|
||||
appId: "com.gpr.gabinetedigital",
|
||||
mfpContextRoot: "/mfp",
|
||||
}); */
|
||||
|
||||
/* MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...");
|
||||
|
||||
setTimeout(()=>{
|
||||
MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
});
|
||||
}, 1000)
|
||||
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
}); */
|
||||
}
|
||||
|
||||
register(){
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
</ion-header> -->
|
||||
|
||||
<ion-content id="main-content">
|
||||
|
||||
<div class="main-content d-flex height-100" *ngIf="loadedEvent">
|
||||
<div class="content d-flex flex-column">
|
||||
<div class="header-content width-100 d-flex justify-space-between">
|
||||
|
||||
@@ -18,10 +18,11 @@ import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
|
||||
import { MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -41,6 +42,7 @@ import { MatDialogModule } from '@angular/material/dialog';
|
||||
MatButtonModule,
|
||||
ReactiveFormsModule,
|
||||
MatDialogModule,
|
||||
AttendeeModalPageModule,
|
||||
],
|
||||
declarations: [EditEventToApprovePage],
|
||||
exports: [EditEventToApprovePage]
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
|
||||
<ion-select disabled placeholder="Selecione agenda*"
|
||||
<ion-select placeholder="Selecione agenda*"
|
||||
class="d-block d-md-none"
|
||||
selectedText="{{eventProcess.workflowInstanceDataFields.Agenda}}"
|
||||
[(ngModel)]="eventProcess.workflowInstanceDataFields.Agenda"
|
||||
@@ -87,7 +87,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
@@ -280,7 +280,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height d-flex">
|
||||
<div class="ion-input-class-no-height d-flex" (click)="addParticipants()">
|
||||
<div class="list-people flex-grow-1">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -289,7 +289,7 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people cursor-pointer" (click)="addParticipants()">
|
||||
<div class="add-people cursor-pointer" >
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
@@ -301,7 +301,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height d-flex">
|
||||
<div class="ion-input-class-no-height d-flex" (click)="addParticipantsCC()">
|
||||
<div class="list-people flex-grow-1">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -310,7 +310,7 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people cursor-pointer" (click)="addParticipantsCC()">
|
||||
<div class="add-people cursor-pointer" >
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
@@ -361,6 +361,7 @@
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
Body: "",
|
||||
OccurrenceType: '',
|
||||
Category: '',
|
||||
LastOccurrence: '',
|
||||
LastOccurrence: new Date(),
|
||||
IsRecurring: false,
|
||||
ParticipantsList: [],
|
||||
Agenda: '',
|
||||
@@ -127,14 +127,10 @@ export class EditEventToApprovePage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log('EDITAR');
|
||||
|
||||
|
||||
if(this.restoreTemporaryData()){
|
||||
this.setOtherData()
|
||||
} else {
|
||||
@@ -150,6 +146,8 @@ export class EditEventToApprovePage implements OnInit {
|
||||
this.processes.GetTask(this.serialNumber).subscribe( (result) =>{
|
||||
this.eventProcess = result
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
// description
|
||||
@@ -338,26 +336,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
// setIntervenient(data){
|
||||
// this.taskParticipants = data;
|
||||
// this.postEvent.Attendees = data;
|
||||
// }
|
||||
|
||||
// setIntervenientCC(data) {
|
||||
// this.taskParticipantsCc = data;
|
||||
// }
|
||||
|
||||
// addParticipants(){
|
||||
// this.adding = 'intervenient'
|
||||
|
||||
// this.openAttendees();
|
||||
// }
|
||||
|
||||
// addParticipantsCC(){
|
||||
|
||||
// this.adding = 'CC'
|
||||
// this.openAttendees();
|
||||
// }
|
||||
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
|
||||
this.taskParticipants = removeDuplicate(taskParticipants) ;
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
123123
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
@@ -117,8 +116,8 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlStart"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
@@ -145,8 +144,8 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
@@ -196,7 +195,7 @@
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="occurrrence"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlOccurrence"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
@@ -214,13 +213,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('participantes').errors?.required">
|
||||
Adicionar participant.
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class=" d-flex width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
@@ -290,7 +283,7 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments; let i = index" >
|
||||
<div class="d-flex container-div width-100" *ngFor="let document of postEvent.Attachments; let i = index" >
|
||||
<ion-list class="width-100 list" *ngIf="!document.remove">
|
||||
<ion-item class="width-100">
|
||||
<ion-label class="width-100">
|
||||
|
||||
@@ -11,7 +11,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import * as moment from 'moment';
|
||||
import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
@@ -31,8 +31,8 @@ export class EditEventPage implements OnInit {
|
||||
eventAttendees: EventPerson[];
|
||||
// minDate: string;
|
||||
loadedEventAttachments: Attachment[]=[];
|
||||
recurringTypes: any;
|
||||
public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh"));
|
||||
recurringTypes = [];
|
||||
selectedRecurringType: any;
|
||||
|
||||
public date: any;
|
||||
public disabled = false;
|
||||
@@ -64,19 +64,8 @@ export class EditEventPage implements OnInit {
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
@Output() clearPostEvent = new EventEmitter<any>();
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
showLoader = false
|
||||
|
||||
get dateStart () {
|
||||
return this.dateControlStart.value
|
||||
}
|
||||
|
||||
get dateEnd () {
|
||||
return this.dateControlEnd.value
|
||||
}
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@@ -87,25 +76,24 @@ export class EditEventPage implements OnInit {
|
||||
{ value: false, label: 'False' }
|
||||
];
|
||||
|
||||
get dateOccurrence () {
|
||||
return this.dateControlOccurrence.value
|
||||
}
|
||||
public listColors = ['primary', 'accent', 'warn'];
|
||||
public stepHours = [1, 2, 3, 4, 5];
|
||||
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
||||
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
||||
|
||||
private participantsPipe = new ParticipantsPipe()
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private toastService: ToastService ) {
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence));
|
||||
|
||||
if(!this.restoreTemporaryData()) {
|
||||
// clear
|
||||
@@ -118,16 +106,9 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
// attendees list
|
||||
if(this.postEvent.Attendees != null) {
|
||||
this.postEvent.Attendees.forEach(e =>{
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
const result = this.participantsPipe.transform(this.postEvent.Attendees)
|
||||
this.taskParticipants = result.taskParticipants
|
||||
this.taskParticipantsCc = result.taskParticipantsCc
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
@@ -145,12 +126,11 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
this.restoreDatepickerData();
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
|
||||
setTimeout(() => {
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
console.log( this.postEvent.EventRecurrence.Type);
|
||||
@@ -199,19 +179,13 @@ export class EditEventPage implements OnInit {
|
||||
Categories: new FormControl(this.postEvent.Category, [
|
||||
Validators.required
|
||||
]),
|
||||
dateStart: new FormControl(this.dateStart, [
|
||||
Validators.required
|
||||
]),
|
||||
dateEnd: new FormControl(this.dateEnd, [
|
||||
Validators.required
|
||||
]),
|
||||
dateOccurrence: new FormControl(this.dateOccurrence, [
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString() < new Date(this.dateControlEnd.value).toLocaleString()? 'ok': null,[
|
||||
Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') < new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
@@ -261,14 +235,14 @@ export class EditEventPage implements OnInit {
|
||||
return false
|
||||
}
|
||||
|
||||
this.getDatepickerData()
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) {
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
if(this.postEvent.EventRecurrence.Type == undefined) {
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
}
|
||||
@@ -357,25 +331,10 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
getDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.postEvent.StartDate = this.dateStart
|
||||
this.postEvent.EndDate = this.dateEnd
|
||||
this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence
|
||||
}
|
||||
}
|
||||
|
||||
restoreDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.dateControlStart = new FormControl(moment(this.postEvent.StartDate));
|
||||
this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate));
|
||||
}
|
||||
}
|
||||
|
||||
saveTemporaryData() {
|
||||
|
||||
this.getDatepickerData()
|
||||
|
||||
window['temp.path:/home/agenda/edit-event.component.ts'] = {
|
||||
postEvent: this.postEvent,
|
||||
eventBody: this.eventBody,
|
||||
@@ -392,8 +351,6 @@ export class EditEventPage implements OnInit {
|
||||
this.eventBody = restoredData.eventBody
|
||||
this.segment = restoredData.segment
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<!-- </div> -->
|
||||
<ion-list class="width-100" *ngSwitchCase="'MDGPR'" >
|
||||
<div
|
||||
class="item ion-no-padding width-100 cursor-pointer"
|
||||
class="item item-hover ion-no-padding width-100 cursor-pointer"
|
||||
*ngFor="let event of eventsMDGPRList"
|
||||
(click)="openApproveModal(event.serialNumber, event)"
|
||||
>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
:host{
|
||||
padding: 30px 20px 0 20px !important;
|
||||
margin: 0;
|
||||
}
|
||||
.header-content{
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
padding: 30px 20px 0 20px !important;
|
||||
}
|
||||
.header-icon-left{
|
||||
font-size: 33px;
|
||||
@@ -20,6 +20,8 @@
|
||||
}
|
||||
|
||||
.main-content{
|
||||
padding: 0px 20px 0 20px !important;
|
||||
|
||||
margin-top: 20px;
|
||||
.item{
|
||||
--inner-padding-end: 0 !important;
|
||||
@@ -100,4 +102,4 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="upper-content">
|
||||
<div class="content-location">
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import { Router } from '@angular/router'
|
||||
import { ChatOptionsPopoverPage } from '../../popover/chat-options-popover/chat-options-popover.page';
|
||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||
import { TimeService } from 'src/app/services/functions/time.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -41,6 +42,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openEditGroupPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openNewEventPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() getGroups:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
@@ -53,7 +55,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
private authService: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private alertService: AlertService,
|
||||
private route: Router
|
||||
private route: Router,
|
||||
private timeService: TimeService,
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = true;
|
||||
@@ -139,6 +142,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
console.log('here watching');
|
||||
return this.roomId;
|
||||
}
|
||||
showDateDuration(start:any){
|
||||
return this.timeService.showDateDuration(start);
|
||||
}
|
||||
|
||||
getRoomInfo(){
|
||||
this.showLoader = true;
|
||||
@@ -457,8 +463,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
if(document.querySelector('app-group-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve,3000));
|
||||
await this.serverLongPull();
|
||||
this.getGroups.emit();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||
import { TimeService } from 'src/app/services/functions/time.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
@@ -37,6 +38,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
@Input() showMessages:string;
|
||||
|
||||
@Output() openNewEventPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() getDirectMessages:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
|
||||
synchro = synchro;
|
||||
@@ -57,7 +59,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private animationController: AnimationController,
|
||||
private alertService: AlertService,
|
||||
private toastService: ToastService,
|
||||
private route: Router
|
||||
private route: Router,
|
||||
private timeService: TimeService,
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
|
||||
@@ -150,6 +153,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.openNewEventPage.emit(data);
|
||||
}
|
||||
|
||||
showDateDuration(start:any){
|
||||
return this.timeService.showDateDuration(start);
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
|
||||
this.synchro.$send({})
|
||||
@@ -371,6 +378,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
if(document.querySelector('app-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
this.getDirectMessages.emit();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="listview">
|
||||
<ion-list *ngIf="allProcessesList">
|
||||
<div
|
||||
class="item-wrapper ion-no-padding cursor-pointer"
|
||||
class="item-wrapper item-hover ion-no-padding cursor-pointer"
|
||||
*ngFor = "let task of allProcessesList"
|
||||
(click)="goToProcess(task.SerialNumber, task.WorkflowName, task.activityInstanceName)">
|
||||
<div class="item width-100">
|
||||
|
||||
@@ -36,12 +36,12 @@ ion-list{
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
border:1px solid #e9e9e9 !important;
|
||||
background-color: #fff !important;
|
||||
//background-color: #fff !important;
|
||||
margin-bottom: 10px !important;
|
||||
padding: 15px;
|
||||
|
||||
.item{
|
||||
background-color: var(--white);
|
||||
//background-color: var(--white);
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Component, OnInit} from '@angular/core';
|
||||
|
||||
import { customTask} from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
|
||||
@@ -18,18 +18,18 @@
|
||||
refreshingText="A actualizar...">
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="width-100 overflow-y-auto height-100">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<div *ngIf="diplomasList.length >= 1">
|
||||
|
||||
|
||||
|
||||
|
||||
<ion-list >
|
||||
<!-- *ngFor = "let task of parecerList; let i = index"
|
||||
(click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
<div
|
||||
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of diplomasList"
|
||||
(click)="goToDiploma(task.SerialNumber)"
|
||||
>
|
||||
@@ -60,19 +60,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && diplomasList.length == 0"
|
||||
<div
|
||||
*ngIf="!skeletonLoader && diplomasList.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && diplomasList.length == 0">
|
||||
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="end">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
.ion-item-class{
|
||||
padding: 0;
|
||||
|
||||
|
||||
}
|
||||
.label-text{
|
||||
width: 100%;
|
||||
@@ -52,7 +52,7 @@ ion-item{
|
||||
--background: none;
|
||||
}
|
||||
.item {
|
||||
background-color: var(--white);
|
||||
//background-color: var(--white);
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ ion-item{
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
|
||||
}
|
||||
.div-content-expediente p, .div-content-pendentes p{
|
||||
font-size: 14pt;
|
||||
@@ -166,7 +166,7 @@ ion-item{
|
||||
.exp-workflow{
|
||||
float: left;
|
||||
margin: 0 !important;
|
||||
|
||||
|
||||
.label{
|
||||
border-radius: 15px;
|
||||
background: #ffb703;
|
||||
@@ -229,4 +229,4 @@ ion-item{
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user