diff --git a/src/app/Rules/despacho.service.ts b/src/app/Rules/despacho.service.ts index 1d07c2698..89d801ddf 100644 --- a/src/app/Rules/despacho.service.ts +++ b/src/app/Rules/despacho.service.ts @@ -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 | 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); diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index 83859aead..b493d2813 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -18,9 +18,9 @@ export class AuthGuard implements CanActivate { state: RouterStateSnapshot): Observable | Promise | 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 { diff --git a/src/app/guards/home.guard.spec.ts b/src/app/guards/home.guard.spec.ts deleted file mode 100644 index b14fb3fe3..000000000 --- a/src/app/guards/home.guard.spec.ts +++ /dev/null @@ -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(); - }); -}); diff --git a/src/app/guards/home.guard.ts b/src/app/guards/home.guard.ts deleted file mode 100644 index 133cd1b45..000000000 --- a/src/app/guards/home.guard.ts +++ /dev/null @@ -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{ - 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); - }) */ - }); - } - -} diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts index 59e88cb68..d23bfb54e 100644 --- a/src/app/guards/inactivity.guard.ts +++ b/src/app/guards/inactivity.guard.ts @@ -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 | Promise | 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 diff --git a/src/app/guards/index.guard.spec.ts b/src/app/guards/index.guard.spec.ts deleted file mode 100644 index 7c19426b5..000000000 --- a/src/app/guards/index.guard.spec.ts +++ /dev/null @@ -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(); - }); -}); diff --git a/src/app/guards/index.guard.ts b/src/app/guards/index.guard.ts deleted file mode 100644 index e3ffa3eff..000000000 --- a/src/app/guards/index.guard.ts +++ /dev/null @@ -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 { - 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); - }) */ - }); - } - -} diff --git a/src/app/guards/login.guard.ts b/src/app/guards/login.guard.ts index 848df6137..8b7a734d3 100644 --- a/src/app/guards/login.guard.ts +++ b/src/app/guards/login.guard.ts @@ -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 | Promise | 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 } } - + } diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 014635651..564db5b3e 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -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: [ diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 1cdc523ab..bfcabdb5c 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -12,13 +12,14 @@ Agenda - + {{ documentCounterService.mdTotalDocument }} {{ documentCounterService.prTotalDocument }} Gabinete + Ações diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 0b5d39cf4..e1ce8dd83 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -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'); + }); + } } diff --git a/src/app/index/index-routing.module.ts b/src/app/index/index-routing.module.ts index 6d90f05c2..5abed4edd 100644 --- a/src/app/index/index-routing.module.ts +++ b/src/app/index/index-routing.module.ts @@ -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'; diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 2b27f0440..ddb43255c 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -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 { diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.html b/src/app/modals/profile/edit-profile/edit-profile.page.html index d1ed6cfd8..6d3fc6052 100644 --- a/src/app/modals/profile/edit-profile/edit-profile.page.html +++ b/src/app/modals/profile/edit-profile/edit-profile.page.html @@ -53,7 +53,7 @@ - diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.ts b/src/app/modals/profile/edit-profile/edit-profile.page.ts index 1a295dee2..e535c7127 100644 --- a/src/app/modals/profile/edit-profile/edit-profile.page.ts +++ b/src/app/modals/profile/edit-profile/edit-profile.page.ts @@ -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() {} diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index 326672ecc..0b9b583db 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -33,9 +33,9 @@ -
+
-
+
{ + 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) => { diff --git a/src/app/models/agenda/AgendaEventList.ts b/src/app/models/agenda/AgendaEventList.ts new file mode 100644 index 000000000..a40eba19b --- /dev/null +++ b/src/app/models/agenda/AgendaEventList.ts @@ -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[] + } +} \ No newline at end of file diff --git a/src/app/models/event.model.ts b/src/app/models/event.model.ts index dfa36d7d0..fb1e5b581 100644 --- a/src/app/models/event.model.ts +++ b/src/app/models/event.model.ts @@ -33,10 +33,6 @@ export class Event{ EventRecurrence: EventRecurrence; Name?: string Attachments?: Attachment[]; - - /* public Event(){ - this.EventRecurrence = new EventRecurrence(); - } */ } diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 736ecbf38..6711edcf9 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -17,7 +17,7 @@
- +
@@ -180,15 +180,15 @@
-
-
+
+
{{ TimelineDayEvent(events.key)}}
+ *ngIf="viewEventMonth <= dateMonth(event) ">
@@ -219,18 +219,18 @@
- +
-
-
+
+
{{ TimelineDayEvent(events.key)}}
-
+
{{event.event.StartDate | date: 'HH:mm'}}
@@ -263,16 +263,15 @@
-
+
-
+
{{ TimelineDayEvent(events.key)}}
-
+
{{event.event.StartDate | date: 'HH:mm'}}
@@ -327,7 +326,7 @@
- - - \ No newline at end of file + diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 931a0390b..f3a6069eb 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -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, 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 } diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html index f8dd72530..ca44e45ca 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html @@ -1,4 +1,4 @@ - +
-
+
-
@@ -82,7 +82,7 @@
-
+
@@ -92,10 +92,10 @@
-
+
- +
{{task.taskStartDate | date: 'dd-MM-yyyy'}}
@@ -113,7 +113,6 @@
- @@ -92,7 +91,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 9e1e95c68..8d26f9959 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -3,7 +3,7 @@ -
+
@@ -83,7 +83,7 @@ -
+
Responder ao PR
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 1c7e55605..262b21dc0 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -52,7 +52,7 @@ export class DespachoPage implements OnInit { private despachoService: DespachoService, private location: Location, public p: PermissionService, - + ) { this.activatedRoute.paramMap.subscribe(params => { diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html index 0b9a620eb..ddf004b10 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html @@ -3,7 +3,7 @@ -
+
@@ -74,7 +74,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html index eeaa42369..bb70c7582 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html @@ -3,7 +3,7 @@ -
+
@@ -73,7 +73,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts index 8c40c45e9..1f8dd62fa 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -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; diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index bd44c675e..6e05b6c58 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -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; diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index b525a8cd9..a563b56ee 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -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) { - // + // } } diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index 112d7f4de..980592aa6 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -95,7 +95,7 @@
Outras opções
- + diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index 35dc124fa..7d7fc1a75 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -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{ diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html index 05f4a3b9f..5399ee8c5 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html @@ -7,7 +7,7 @@
-
+
@@ -104,7 +104,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 5dae4bfa1..210a03648 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -39,7 +39,7 @@
@@ -89,7 +89,7 @@
-
+
@@ -98,7 +98,7 @@

{{ totalDocumentStore.count }} Documentos

-
+
@@ -106,7 +106,7 @@

{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} Documentos

-
+
@@ -115,7 +115,7 @@
-
+
@@ -124,7 +124,7 @@

{{pendentesstore.count}} Documentos

-
+
@@ -133,7 +133,7 @@

{{ despachoprstore.count }} Documentos

-
+
@@ -141,7 +141,7 @@

{{despachoStore.count}} Documentos

-
+
@@ -150,7 +150,7 @@

{{pedidosstore.countparecer}} Documentos

-
+
@@ -172,7 +172,7 @@
--> -
+
@@ -184,7 +184,7 @@
-
+
@@ -193,7 +193,7 @@

{{ deplomasStore.deplomasReviewCount }} Documentos

-
+
@@ -202,7 +202,7 @@

{{ deplomasStore.countDiplomasAssinadoListCount }} Documentos

-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index 85eb31969..20f96d556 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -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; diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index dccb3d085..d3414e37c 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -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{ diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html index f9a7c35d0..8d4abe6d3 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html @@ -3,7 +3,7 @@ -
+
@@ -78,7 +78,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index b4efdf65b..53d32bbb2 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -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; diff --git a/src/app/pages/inactivity/inactivity.page.html b/src/app/pages/inactivity/inactivity.page.html index 5c971a7cd..ed7075b3e 100644 --- a/src/app/pages/inactivity/inactivity.page.html +++ b/src/app/pages/inactivity/inactivity.page.html @@ -1,39 +1,8 @@
-
-
-
-
-
- -
-
-
-
-

Inicie a sessão

-
-

Email

- - - -

Palavra-passe

- - - -
- -
-
-
-

Uma iniciativa do Gabinete do Presidente da República

-
-
- -
+
diff --git a/src/app/pages/inactivity/inactivity.page.scss b/src/app/pages/inactivity/inactivity.page.scss index b7c588f44..8756fb1f0 100644 --- a/src/app/pages/inactivity/inactivity.page.scss +++ b/src/app/pages/inactivity/inactivity.page.scss @@ -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; + } + + } diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index bcccf0249..7ae1e66c6 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -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() { diff --git a/src/app/pages/login/login.page.scss b/src/app/pages/login/login.page.scss index 88f9eae74..103042085 100644 --- a/src/app/pages/login/login.page.scss +++ b/src/app/pages/login/login.page.scss @@ -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; diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index ee388ca95..b453225dc 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -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']); + } + + } + } diff --git a/src/app/pages/publications/publications.module.ts b/src/app/pages/publications/publications.module.ts index 0a65732bf..dbb7e19a7 100644 --- a/src/app/pages/publications/publications.module.ts +++ b/src/app/pages/publications/publications.module.ts @@ -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, diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 25305ce60..2d76756ae 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -39,20 +39,23 @@
- + class="item width-100 d-flex ion-no-border ion-no-margin ion-no-padding" + [class.item-active]="viagem.ProcessId == idSelected" + >
- -

{{viagem.Description}}

-

{{viagem.Detail}}

+ +

{{viagem.Description}}

+

{{viagem.Detail}}

-
- +
+ +
@@ -68,38 +71,25 @@ - - - + +
- -

{{evento.Description}}

+ +

{{evento.Description}}

-
- +
+ +
@@ -115,22 +105,6 @@ -
diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 1a9c5cd92..9c7c8c04b 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -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; } - + diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 0c85a3de9..799c6f822 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -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]); diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index d70b37f90..da624457b 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -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(); + } diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index c4d58a5a6..776316e26 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -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; diff --git a/src/app/pipes/participants.pipe.spec.ts b/src/app/pipes/participants.pipe.spec.ts new file mode 100644 index 000000000..bffcde3cd --- /dev/null +++ b/src/app/pipes/participants.pipe.spec.ts @@ -0,0 +1,8 @@ +import { ParticipantsPipe } from './participants.pipe'; + +describe('ParticipantsPipe', () => { + it('create an instance', () => { + const pipe = new ParticipantsPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/pipes/participants.pipe.ts b/src/app/pipes/participants.pipe.ts new file mode 100644 index 000000000..9856911c6 --- /dev/null +++ b/src/app/pipes/participants.pipe.ts @@ -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} + } + +} diff --git a/src/app/pipes/pipes.module.ts b/src/app/pipes/pipes.module.ts index 3e5ccac18..f2017b539 100644 --- a/src/app/pipes/pipes.module.ts +++ b/src/app/pipes/pipes.module.ts @@ -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: [] }) diff --git a/src/app/services/ageanda/list-box.service.spec.ts b/src/app/services/ageanda/list-box.service.spec.ts new file mode 100644 index 000000000..8f319b4ec --- /dev/null +++ b/src/app/services/ageanda/list-box.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/ageanda/list-box.service.ts b/src/app/services/ageanda/list-box.service.ts new file mode 100644 index 000000000..04066f1da --- /dev/null +++ b/src/app/services/ageanda/list-box.service.ts @@ -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 + }) + } + + +} diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index b5339cc31..8f848e0a8 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -41,7 +41,7 @@ export class AuthService { } - async login(user: UserForm, saveSession = true): Promise { + async login(user: UserForm, {saveSession = true}): Promise { user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username )); this.headers = this.headers.set('Authorization',user.BasicAuthKey); diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index 8d21e8119..440a2e978 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -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); } diff --git a/src/app/services/date.service.spec.ts b/src/app/services/date.service.spec.ts new file mode 100644 index 000000000..c90b9f927 --- /dev/null +++ b/src/app/services/date.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/date.service.ts b/src/app/services/date.service.ts new file mode 100644 index 000000000..2895fea2d --- /dev/null +++ b/src/app/services/date.service.ts @@ -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') + } +} diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index 79769d4c7..833d4323f 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -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(`${geturl}`, options); } */ - getAllPrOficialEvents(startdate:string, enddate:string): Observable{ + getAllPrOficialEvents(startdate:string, enddate:string): Observable{ 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(`${geturl}`, options); + return this.http.get(`${geturl}`, options); } - getAllPrPessoalEvents(startdate:string, enddate:string): Observable{ + getAllPrPessoalEvents(startdate:string, enddate:string): Observable{ 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(`${geturl}`, options); + return this.http.get(`${geturl}`, options); } - async getAllPrEvents(startdate:string, enddate:string){ + async getAllPrEvents(startdate:string, enddate:string): Promise{ 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{ 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(`${geturl}`, options); + return this.http.get(`${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(`${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(`${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(`${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(`${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(`${geturl}`, options); } @@ -264,12 +265,12 @@ export class EventsService { getEvent(eventid: string): Observable{ 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(`${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(`${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(`${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(`${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(`${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(`${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, }; diff --git a/src/app/services/functions/time.service.spec.ts b/src/app/services/functions/time.service.spec.ts new file mode 100644 index 000000000..c906c0a8f --- /dev/null +++ b/src/app/services/functions/time.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/functions/time.service.ts b/src/app/services/functions/time.service.ts new file mode 100644 index 000000000..33e8719cc --- /dev/null +++ b/src/app/services/functions/time.service.ts @@ -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; + } + +} diff --git a/src/app/services/inativity.service.ts b/src/app/services/inativity.service.ts index 1ea52ceca..a93c50a3f 100644 --- a/src/app/services/inativity.service.ts +++ b/src/app/services/inativity.service.ts @@ -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 } } } diff --git a/src/app/services/notification/sw.js b/src/app/services/notification/sw.js new file mode 100644 index 000000000..79be69284 --- /dev/null +++ b/src/app/services/notification/sw.js @@ -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) +}); + + + \ No newline at end of file diff --git a/src/app/services/notification/web-notification-popup.service.spec.ts b/src/app/services/notification/web-notification-popup.service.spec.ts new file mode 100644 index 000000000..e45f02163 --- /dev/null +++ b/src/app/services/notification/web-notification-popup.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/notification/web-notification-popup.service.ts b/src/app/services/notification/web-notification-popup.service.ts new file mode 100644 index 000000000..48c8e83da --- /dev/null +++ b/src/app/services/notification/web-notification-popup.service.ts @@ -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) + }) + + }); + + } + }); + + + + } +} diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 6ac10b458..69a023564 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -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; diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index f84e7e025..7b7edec8e 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -71,6 +71,7 @@ export class ProcessesService { }; return this.http.get(`${geturl}`, options); } + SetTaskToPending(serialNumber:string): Observable{ const geturl = environment.apiURL + 'Tasks/SetTaskPending'; diff --git a/src/app/services/socket/synchro.service.ts b/src/app/services/socket/synchro.service.ts index 8d9d4fbf6..dd19ac1f2 100644 --- a/src/app/services/socket/synchro.service.ts +++ b/src/app/services/socket/synchro.service.ts @@ -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 diff --git a/src/app/services/storage.service.ts b/src/app/services/storage.service.ts index 884c6407c..31efdf205 100644 --- a/src/app/services/storage.service.ts +++ b/src/app/services/storage.service.ts @@ -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 { + + 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) { diff --git a/src/app/services/webnotifications.service.ts b/src/app/services/webnotifications.service.ts index e4546a742..f5d8321b8 100644 --- a/src/app/services/webnotifications.service.ts +++ b/src/app/services/webnotifications.service.ts @@ -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(){ diff --git a/src/app/shared/agenda/approve-event/approve-event.page.html b/src/app/shared/agenda/approve-event/approve-event.page.html index f8a57ae31..0869990f7 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.html +++ b/src/app/shared/agenda/approve-event/approve-event.page.html @@ -13,6 +13,7 @@ --> +
diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.module.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.module.ts index db637c541..208cad591 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.module.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.module.ts @@ -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] diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html index 22078a985..1c484cf20 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html @@ -58,7 +58,7 @@
-
-
+
@@ -280,7 +280,7 @@
-
+
@@ -289,7 +289,7 @@
-
+
@@ -301,7 +301,7 @@
-
+
@@ -310,7 +310,7 @@
-
+
@@ -361,6 +361,7 @@
+
diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index 0f85c7b4e..ed9222302 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -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) ; diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 1c7c50fc6..ddea0f9c0 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -55,7 +55,6 @@
- 123123
@@ -117,8 +116,8 @@ @@ -145,8 +144,8 @@ @@ -196,7 +195,7 @@ @@ -214,13 +213,7 @@
- +
@@ -290,7 +283,7 @@
-
+
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index fdef4a5bd..308b74d4b 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -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(); @Output() clearPostEvent = new EventEmitter(); - 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; diff --git a/src/app/shared/agenda/event-list/event-list.page.html b/src/app/shared/agenda/event-list/event-list.page.html index 348467823..71ac37fc9 100644 --- a/src/app/shared/agenda/event-list/event-list.page.html +++ b/src/app/shared/agenda/event-list/event-list.page.html @@ -33,7 +33,7 @@
diff --git a/src/app/shared/agenda/event-list/event-list.page.scss b/src/app/shared/agenda/event-list/event-list.page.scss index 4c04f8508..0d1e3c664 100644 --- a/src/app/shared/agenda/event-list/event-list.page.scss +++ b/src/app/shared/agenda/event-list/event-list.page.scss @@ -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; } -} \ No newline at end of file +} diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 73d6f0bb3..bcc74b0c2 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -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'; diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index be905a8f3..a2e90819c 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -26,6 +26,7 @@ +
diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 3db44986d..db2c8cbe4 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -42,7 +42,7 @@
{{msg.u.name}} - {{msg._updatedAt | date: 'HH:mm' }} + {{showDateDuration(msg._updatedAt)}}
{{msg.msg}} diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 362468177..a266277f4 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -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 = new EventEmitter(); @Output() openEditGroupPage:EventEmitter = new EventEmitter(); @Output() openNewEventPage:EventEmitter = new EventEmitter(); + @Output() getGroups:EventEmitter = new EventEmitter(); @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{ diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 552158990..14bbc4c1a 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -35,7 +35,7 @@
{{msg.u.name}} - {{msg._updatedAt | date: 'HH:mm' }} + {{showDateDuration(msg._updatedAt)}}
{{msg.msg}} diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index d3d9c75a3..3e8bccfc4 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -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 = new EventEmitter(); + @Output() getDirectMessages:EventEmitter = new EventEmitter(); 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') } } diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.html b/src/app/shared/gabinete-digital/all-processes/all-processes.page.html index 45c681abf..c1c5b30a6 100644 --- a/src/app/shared/gabinete-digital/all-processes/all-processes.page.html +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.html @@ -28,7 +28,7 @@
diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss b/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss index 0cbc30bb6..b33103830 100644 --- a/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.scss @@ -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; diff --git a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts index cbc419510..079995aa6 100644 --- a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts +++ b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts @@ -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'; diff --git a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html index 5a42d4af1..36f91d6e7 100644 --- a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html +++ b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html @@ -18,18 +18,18 @@ refreshingText="A actualizar..."> - - + +
- - + + -
@@ -60,19 +60,19 @@
- +
-
Lista vazia
- + diff --git a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss index 69e7608e5..517d76d7c 100644 --- a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss +++ b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.scss @@ -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; -} \ No newline at end of file +} diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html index 06e93b8cf..056dec629 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html @@ -26,7 +26,7 @@
@@ -63,7 +63,7 @@
@@ -94,15 +94,15 @@
-
Lista vazia
- + diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss b/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss index f93c4bd0f..6a305a0f1 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.scss @@ -25,7 +25,7 @@ } .ion-item-class{ padding: 0; - + } .label-text{ width: 100%; @@ -40,7 +40,7 @@ ion-item{ //border-radius: 15px; //box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); //Sborder: solid 1px #e9e9e9; - background-color: var(--white); + //background-color: var(--white); margin: 0 auto; //padding: 10px; overflow: hidden; @@ -75,7 +75,7 @@ ion-item{ .div-icon ion-icon{ display: block; margin: 0 auto; - + } .div-content-expediente p, .div-content-pendentes p{ font-size: 14pt; @@ -157,7 +157,7 @@ ion-item{ .exp-workflow{ float: left; margin: 0 !important; - + .label{ border-radius: 15px; background: #ffb703; @@ -220,4 +220,4 @@ ion-item{ font-size: 45px; float: right; margin-right: 10px; -} \ No newline at end of file +} diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.module.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.module.ts index eb34ada4f..dab3db7f9 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.module.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.module.ts @@ -18,10 +18,10 @@ 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 +41,7 @@ import { MatDialogModule } from '@angular/material/dialog'; MatButtonModule, ReactiveFormsModule, MatDialogModule, + AttendeeModalPageModule, ], declarations: [ EditEventToApproveComponent diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html index b20c12395..22d37ee80 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html @@ -68,13 +68,12 @@
-
-
+
-
+
-
+
@@ -305,7 +304,7 @@
-
+
diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts index 49cc677c1..169268a04 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts @@ -69,7 +69,7 @@ export class EditEventToApproveComponent implements OnInit { Body: "", OccurrenceType: '', Category: '', - LastOccurrence: '', + LastOccurrence: new Date(), ParticipantsList: [], Agenda: '', EndDate: '', @@ -134,9 +134,10 @@ export class EditEventToApproveComponent implements OnInit { const result = await this.processes.GetTask(this.serialNumber).toPromise(); console.log(result); - + this.eventProcess = result this.eventProcess.workflowInstanceDataFields.Category = result.workflowInstanceDataFields.EventType + this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence) this.startDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate); this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); @@ -259,7 +260,6 @@ export class EditEventToApproveComponent implements OnInit { Category: this.eventProcess.workflowInstanceDataFields.Category } - console.log(event); this.eventsService.postEventToApproveEdit(event).subscribe(()=>{ this.toastService.successMessage('Evento editado'); @@ -342,7 +342,6 @@ export class EditEventToApproveComponent implements OnInit { addParticipants(){ this.adding = 'intervenient' this.openAttendees(); - console.log('LOGS'); } diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html index 8890497cd..c3d4f6f0c 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html @@ -32,7 +32,7 @@
@@ -66,7 +66,7 @@
diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.scss b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.scss index e55a1817c..d0a8dbd65 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.scss +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.scss @@ -1,5 +1,4 @@ :host{ - padding: 30px 20px 0 20px !important; margin: 0; } .title-container{ @@ -12,6 +11,7 @@ } } .title{ + padding: 30px 20px 0 20px !important; font-family: Roboto; font-size: 25px; color:#000; @@ -21,6 +21,7 @@ margin-top: 5px; } .main-content{ + padding: 0px 20px 0 20px !important; margin-top: 20px; .item{ --inner-padding-end: 0 !important; diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html index b85b72640..4ba4bac60 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html @@ -9,13 +9,13 @@
- -
+ +
@@ -47,15 +47,15 @@ -
Lista vazia
- + diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss index 706482f8a..1a0dc6200 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.scss @@ -1,7 +1,6 @@ @import '~src/function.scss'; -/* CONTENT */ +//CONTENT :host{ - padding: 30px 20px 0 20px !important; margin: 0; } .title{ @@ -9,6 +8,7 @@ font-size: 25px; color:#000; overflow: auto; + padding: 30px 20px 0 20px !important; .thetitle{ width: fit-content; @@ -19,19 +19,6 @@ float: right; } } -.item-list-small{ - font-size: 11px; - overflow: auto; - } - .ion-item-class{ - padding: 0; - - } - .label-text{ - width: 100%; - padding: 0; - margin: 0; - } //DIV ion-item{ --background: none; @@ -40,76 +27,28 @@ ion-item{ //border-radius: 15px; //box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); //Sborder: solid 1px #e9e9e9; - background-color: var(--white); + //background-color: var(--white); margin: 0 auto; //padding: 10px; overflow: auto; } -.div-content-expediente{ - width: 100%; - float: left; - border-left: 3px solid #dae3f3; - padding:5px 5px 15px 5px; - margin: 10px 0 10px 0; - background: #dae3f3; - border-radius: 20px; -} -.div-content-pendentes{ - width: 100%; - float: left; - border-left: 3px solid #d9d9d9; - padding: 5px; -} - .div-content-expediente h3, .div-content-pendentes h3{ - margin: 0; - padding: 0; - font-size: 14pt; - width: 100%; - } - .div-icon{ - width: 10%; - font-size: 20px; - float: left; - color: #808080; - } - .div-icon ion-icon{ - display: block; - margin: 0 auto; - - } - .div-content-expediente p, .div-content-pendentes p{ - font-size: 14pt; - color: rgb(94, 92, 92); - padding: 0; - margin: 0; - } - .span-left{ - /* border: 1px solid red; */ - float: left; - font-size: 12px; - padding-left: 18px; - } - .span-right{ - /* border: 1px solid blue; */ - text-align: right; - float: right; - font-size: 12px; - padding-right: 18px; -} /* New CSS */ +.content{ + padding: 0px 20px 0 20px !important; +} .expediente{ border-radius: 15px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); border:1px solid #e9e9e9 !important; - background-color: var(--white); + //background-color: transparent; margin-bottom: 10px !important; padding: 15px; } .exp-list-item{ //width: 368px; overflow: auto; - /* border-bottom: 1px solid gray; */ + //border-bottom: 1px solid gray; margin: 10px auto; } @@ -130,7 +69,7 @@ ion-item{ .exp-icon{ width: fit-content; float: right; - /* font-size: 13px; */ + //font-size: 13px; margin: 0 !important; padding: 0 !important; @@ -156,11 +95,11 @@ ion-item{ .exp-workflow{ float: left; margin: 0 !important; - + .label{ border-radius: 15px; background: #ffb703; - /* font-size: 12px; */ + //font-size: 12px; float: right; padding: 2.5px 13.5px 2.5px 13.5px; color: #fff; @@ -188,11 +127,11 @@ ion-item{ .exp-remetente{ //width: 200px; font-family: Roboto; - /* font-size: 13px; */ + //font-size: 13px; font-weight: normal; color: #000000; float: left; - /* border: 1px solid red; */ + //border: 1px solid red; } } .div-top-header{ @@ -219,4 +158,4 @@ ion-item{ font-size: 45px; float: right; margin-right: 10px; -} \ No newline at end of file +} diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.html b/src/app/shared/gabinete-digital/expedients/expedients.page.html index 621163895..1c65289ef 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.html +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.html @@ -1,6 +1,6 @@
-
Expediente
+
Expediente11
- -
- -
- -
-
- - - - diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.scss b/src/app/shared/headers/header-no-search/profile/profile.page.scss deleted file mode 100644 index acab1b075..000000000 --- a/src/app/shared/headers/header-no-search/profile/profile.page.scss +++ /dev/null @@ -1,64 +0,0 @@ -.profile-content{ - padding: 20px 20px; -} - -.icon{ - font-size: 35px; -} - -.go-back{ - font-family: Roboto; - font-size: 25px; - .icon{ - margin-right: 7px; - } -} - -.profile-pic{ - width: 200px; - height: 200px; - border-radius: 20px; - margin: 0px auto; -} - -.profile-info{ - .label-text{ - font-size: 15px; - font-weight: bold; - color: white; - margin-bottom: 10px; - } - - .user-role{ - background-color: white; - border-radius: 5px; - padding: 12px; - font-family: Roboto; - font-size: 13px; - color: black; - text-align: center; - } - - .email { - margin-top: 15px; - } - -} - -.login-preference{ - margin-top: 44px; - - .preference{ - font-family: Roboto; - font-size: 15px; - margin-bottom: 20px; - font-weight: bold; - } - .checkBox{ - margin-right: 10px; - } -} - -.buttonSize { - width: 100% !important; -} \ No newline at end of file diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.spec.ts b/src/app/shared/headers/header-no-search/profile/profile.page.spec.ts deleted file mode 100644 index e3f18689f..000000000 --- a/src/app/shared/headers/header-no-search/profile/profile.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { ProfileComponent } from './profile.page'; - -describe('ProfilePage', () => { - let component: ProfileComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [ ProfileComponent ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(ProfileComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.ts b/src/app/shared/headers/header-no-search/profile/profile.page.ts deleted file mode 100644 index 6a2a5029c..000000000 --- a/src/app/shared/headers/header-no-search/profile/profile.page.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { AnimationController, ModalController } from '@ionic/angular'; -import { LoginUserRespose } from 'src/app/models/user.model'; -import { AuthService } from 'src/app/services/auth.service'; -import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page'; -import { PinPage } from 'src/app/shared/pin/pin.page'; -import { LocalstoreService } from 'src/app/store/localstore.service'; - -@Component({ - selector: 'app-profile', - templateUrl: './profile.page.html', - styleUrls: ['./profile.page.scss'], -}) -export class ProfileComponent implements OnInit { - - loggeduser: LoginUserRespose; - userLoginPreference = '' - - constructor(private modalController:ModalController, - private authService: AuthService, - private animationController: AnimationController, - private router: Router, - private localstoreService: LocalstoreService - ) { - - this.loggeduser = authService.ValidatedUser; - - // console.log(this.loggeduser.RoleDescription) - - this.checkState() - } - - ngOnInit() {} - - close() { - this.modalController.dismiss(); - } - - async addPin() { - const enterAnimation = (baseEl: any) => { - const backdropAnimation = this.animationController.create() - .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); - - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); - - return this.animationController.create() - .addElement(baseEl) - .easing('ease-out') - .duration(500) - .addAnimation([backdropAnimation, wrapperAnimation]); - } - - const leaveAnimation = (baseEl: any) => { - return enterAnimation(baseEl).direction('reverse'); - } - - - const modal = await this.modalController.create({ - enterAnimation, - leaveAnimation, - component: PinPage, - cssClass: 'model profile-modal', - componentProps: { - } - }); - - modal.present(); - } - - - async addFingerprint() { - const enterAnimation = (baseEl: any) => { - const backdropAnimation = this.animationController.create() - .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); - - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); - - return this.animationController.create() - .addElement(baseEl) - .easing('ease-out') - .duration(500) - .addAnimation([backdropAnimation, wrapperAnimation]); - } - - const leaveAnimation = (baseEl: any) => { - return enterAnimation(baseEl).direction('reverse'); - } - - - const modal = await this.modalController.create({ - enterAnimation, - leaveAnimation, - component: FingerprintPage, - cssClass: 'model profile-modal', - componentProps: { - } - }); - - modal.present(); - } - - logout() { - // clear local storage - window.localStorage.clear(); - - setTimeout(()=> { - this.router.navigateByUrl('/', { replaceUrl: true }); - },100) - - } - - LoginPreferenceMethod(type: string) { - - let userData = this.localstoreService.get('UserData', {}) - - if (userData.hasOwnProperty('loginPreference')) { - if (userData.loginPreference != type) { - if (type) { - userData.loginPreference = type - } - } else { - userData.loginPreference = 'none' - } - - } else { - userData.loginPreference = 'none' - } - - - this.localstoreService.set('UserData', userData) - } - - checkState() { - - let userData = this.localstoreService.get('UserData', {}) - - if (userData.hasOwnProperty('loginPreference')) { - this.userLoginPreference = userData.loginPreference - } else { - this.userLoginPreference = '' - } - - } - -} diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.scss b/src/app/shared/popover/deploma-options/deploma-options.page.scss index 41abf3ba8..3f1718b98 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.scss +++ b/src/app/shared/popover/deploma-options/deploma-options.page.scss @@ -25,11 +25,11 @@ border-top: 1px solid #bbb; margin: 0 auto !important; } - .btn-ok, .btn-cancel{ - //width: 50% !important; - margin-bottom: 5px !important; - margin-top: 5px !important; -} + .btn-ok, .btn-cancel, .btn-delete{ + width: calc(50% - 10px) !important; + margin: 5px 5px 5px 5px !important; + } + @media only screen and (max-width: 800px) { .btn-ok, .btn-cancel, .btn-delete{ width: 47% !important; @@ -53,4 +53,4 @@ /* .solid{ display: block; } */ -} \ No newline at end of file +} diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 28969ca9c..0bc89a61c 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -18,7 +18,7 @@
- +
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.scss b/src/app/shared/popover/despachos-options/despachos-options.page.scss index 7ad4b7bbf..5ea5fa2c7 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.scss +++ b/src/app/shared/popover/despachos-options/despachos-options.page.scss @@ -3,6 +3,7 @@ --padding-bottom:20px !important; --padding-start:20px !important; --padding-end:20px !important; + } .arrow-right { display: none; @@ -25,11 +26,10 @@ border-top: 1px solid #bbb; margin: 0 auto !important; } - .btn-ok, .btn-cancel{ - //width: 50% !important; - margin-bottom: 5px !important; - margin-top: 5px !important; -} + .btn-ok, .btn-cancel, .btn-delete{ + width: calc(50% - 10px) !important; + margin: 5px 5px 5px 5px !important; + } .pr-options { .btn-ok, .btn-cancel{ @@ -45,7 +45,7 @@ width: 30%; } } - + @media only screen and (min-width: 1140px){ .content{ width: 75%; @@ -54,9 +54,9 @@ width: 25%; } } - + .desk{ text-align: left; background-color: white; -} \ No newline at end of file +} diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html index 77a0beb7c..fdf88d42e 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html @@ -17,9 +17,10 @@
- + +
@@ -28,11 +29,12 @@ +
-
- +
diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.scss b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.scss index 6108784b8..91b87ddc7 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.scss +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.scss @@ -58,4 +58,4 @@ .desk{ text-align: left; background-color: white; -} \ No newline at end of file +} diff --git a/src/app/shared/popover/messages-options/messages-options.page.scss b/src/app/shared/popover/messages-options/messages-options.page.scss index dd61665a1..29fe1e464 100644 --- a/src/app/shared/popover/messages-options/messages-options.page.scss +++ b/src/app/shared/popover/messages-options/messages-options.page.scss @@ -25,6 +25,10 @@ border-top: 1px solid #bbb; margin: 0 auto !important; } + /* .btn-ok, .btn-cancel, .btn-delete{ + width: calc(50% - 10px) !important; + margin: 5px 5px 5px 5px !important; + } */ @media only screen and (min-width: 701px) { .arrow-right{ display: flex; diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index 08f3c65f2..298db9f25 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -16,7 +16,7 @@
- + diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts index aefca0253..8cea8c836 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts @@ -87,7 +87,7 @@ export class OptsExpedientePage implements OnInit { } else { this.location.back() - + /* this.activatedRoute.paramMap.subscribe(params => { console.log('YES'); @@ -166,7 +166,7 @@ export class OptsExpedientePage implements OnInit { }); }); - + this.popoverController.dismiss() } @@ -325,12 +325,9 @@ export class OptsExpedientePage implements OnInit { console.log(res['data']); let body = res['data']; if(res['data']){ - console.log('open discart') - //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') diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index a343f7758..31045eda0 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -1,10 +1,4 @@ - -
- -
- +
@@ -15,6 +9,7 @@ +
@@ -25,6 +20,7 @@ +
@@ -36,15 +32,17 @@ +
- +
+
@@ -54,6 +52,7 @@ +
- +
diff --git a/src/app/shared/popover/request-options/request-options.page.scss b/src/app/shared/popover/request-options/request-options.page.scss index 6d4e6714f..1dfc3209f 100644 --- a/src/app/shared/popover/request-options/request-options.page.scss +++ b/src/app/shared/popover/request-options/request-options.page.scss @@ -1,8 +1,7 @@ -.container{ - --padding-top:20px !important; - --padding-bottom:20px !important; - --padding-start:20px !important; - --padding-end:20px !important; +.wrapper{ + width: 100% !important; + padding-top:20px !important; + padding-bottom:20px !important; } .arrow-right{ display: none; @@ -15,9 +14,11 @@ } } .buttons{ + width: 100% !important; display: flex; flex-wrap: wrap; justify-content: space-around; + margin: 0 auto !important; } .solid { display: none; @@ -31,11 +32,18 @@ margin-top: 5px !important; } @media only screen and (max-width: 800px) { + .container{ + width: 100% !important; + } .btn-ok, .btn-cancel, .btn-delete{ width: 47% !important; } } @media only screen and (min-width: 1024px) { + .container{ + width: 100% !important; + + } .arrow-right{ display: flex; justify-content: flex-end; @@ -53,4 +61,4 @@ /* .solid{ display: block; } */ -} \ No newline at end of file +} diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts index cf4b91daf..074609703 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -22,8 +22,8 @@ export class RequestOptionsPage implements OnInit { task:any; fulltask: any; profile:string; - serialNumber : string - showEnviarPendentes = false + serialNumber : string; + showEnviarPendentes = false; constructor( private popoverController: PopoverController, @@ -39,7 +39,7 @@ export class RequestOptionsPage implements OnInit { this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); this.serialNumber = this.navParams.get('serialNumber'); - + this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { this.serialNumber = params["serialNumber"]; @@ -62,7 +62,7 @@ export class RequestOptionsPage implements OnInit { ngOnInit() { console.log(this.task); this.profile = "mdgpr"; - + window.onresize = (event) => { if( window.innerWidth >= 800){ this.popoverController.dismiss(); @@ -73,6 +73,9 @@ export class RequestOptionsPage implements OnInit { close() { this.popoverController.dismiss('close') } + cancel(){ + this.popoverController.dismiss(); + } sendExpedienteToPending() { this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{ @@ -83,7 +86,7 @@ export class RequestOptionsPage implements OnInit { this.toastService.badRequest('Processo não encontrado') }); - + } async openBookMeetingModal(task: any) { @@ -130,7 +133,7 @@ export class RequestOptionsPage implements OnInit { console.log(res['data']); if(res['data']=='openDiscart') { console.log('open discart'); - + } else { this.popoverController.dismiss('close') } @@ -139,8 +142,8 @@ export class RequestOptionsPage implements OnInit { } async repreciar(note:string, documents:any) { - let body = { - "serialNumber": this.serialNumber, + let body = { + "serialNumber": this.serialNumber, "action": "Reapreciação", "ActionTypeId": 100000009, "dataFields": { @@ -151,13 +154,13 @@ export class RequestOptionsPage implements OnInit { const loader = this.toastService.loading() - try { + try { await this.processes.CompleteTask(body).toPromise() this.close(); this.toastService.successMessage() } catch (error) { this.toastService.badRequest() - } + } finally { loader.remove() } @@ -180,9 +183,9 @@ export class RequestOptionsPage implements OnInit { cssClass: classs, backdropDismiss: true }); - + await modal.present(); - + modal.onDidDismiss().then(async (res) => { @@ -192,7 +195,7 @@ export class RequestOptionsPage implements OnInit { SourceId: e.Id, } }); - + let docs = { ProcessInstanceID: "", Attachments: DocumentToSave, @@ -217,7 +220,7 @@ export class RequestOptionsPage implements OnInit { const loader = this.toastService.loading() - try { + try { await this.pedidoService.arquivar({serialNumber: this.serialNumber, documents, note @@ -233,7 +236,7 @@ export class RequestOptionsPage implements OnInit { } async openDarParecer(task: any) { - + let classs; if( window.innerWidth <= 800){ classs = 'book-meeting-modal modal modal-desktop' @@ -258,7 +261,7 @@ export class RequestOptionsPage implements OnInit { async openDelegarModal(task: any) { - + let classs; if( window.innerWidth <= 800){ classs = 'book-meeting-modal modal modal-desktop' @@ -275,7 +278,7 @@ export class RequestOptionsPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then( async (res)=> { - + if(res['data']=='close') { this.popoverController.dismiss('close'); } diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 70016f30e..910bed35e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -113,7 +113,8 @@ export class ViewPublicationsPage implements OnInit { (error)=>{ if(error.status == '404') { this.error = 'Sem publicações disponíveis!'; - // this.publicationList = null; + this.publicationList= []; + this.publicationListStorage.add(folderId, this.publicationList) } this.showLoader = false; diff --git a/src/app/store/calendar.service.ts b/src/app/store/calendar.service.ts index 9028b36bf..bd9919f8e 100644 --- a/src/app/store/calendar.service.ts +++ b/src/app/store/calendar.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { eventSource } from '../models/agenda/eventSource'; import { SHA1, SHA256, AES, enc } from 'crypto-js' import { LocalstoreService } from './localstore.service' +import { EventList, EventListStore } from '../models/agenda/AgendaEventList'; @Injectable({ providedIn: 'root' @@ -9,7 +10,7 @@ import { LocalstoreService } from './localstore.service' export class CalendarService { - private _eventSource : eventSource[] = [] + private _eventSource : EventListStore[] = [] private keyName: string; constructor(private localstoreService: LocalstoreService) { @@ -19,9 +20,8 @@ export class CalendarService { let restore = localstoreService.get(this.keyName, []) setTimeout(()=>{ - restore.forEach((element, eventIndex) => { + restore.forEach((element:EventListStore, eventIndex) => { this._eventSource.push({ - title: element.title, startTime: new Date(element.startTime), endTime: new Date(element.endTime), allDay: element.allDay, @@ -36,7 +36,7 @@ export class CalendarService { } - ResetList(eventSource: eventSource[]) { + ResetList(eventSource: EventListStore[]) { this._eventSource = eventSource setTimeout(() => { @@ -61,12 +61,11 @@ export class CalendarService { }) } - pushEvent(eventsList, profile: 'pr' | 'md') { + pushEvent(eventsList: EventList[], profile: 'pr' | 'md') { let news = [] eventsList.forEach((element, eventIndex) => { news.push({ - title: element.Subject, startTime: new Date(element.StartDate), endTime: new Date(element.EndDate), allDay: false, diff --git a/src/app/store/despacho-store.service.ts b/src/app/store/despacho-store.service.ts index 1cd097920..6f19a114d 100644 --- a/src/app/store/despacho-store.service.ts +++ b/src/app/store/despacho-store.service.ts @@ -36,13 +36,13 @@ export class DespachoStoreService { // (update:customTask) => update.Folio = 'Formação 5' // ) - // this.Query().Update( - // (select:customTask): boolean => select.Folio == 'Formação', - // (update:customTask) => { - // update.Folio = 'Formação 7'; - // update.DocumentURL = 'peter'; - // } - // ) + // this.Query().Update( + // (select:customTask): boolean => select.Folio == 'Formação', + // (update:customTask) => { + // update.Folio = 'Formação 7'; + // update.DocumentURL = 'peter'; + // } + // ) // this.Query().Update( // (select:customTask): boolean => select.Folio == 'Formação', diff --git a/src/app/store/localstore.service.ts b/src/app/store/localstore.service.ts index 7626ff8e7..8b0b434f7 100644 --- a/src/app/store/localstore.service.ts +++ b/src/app/store/localstore.service.ts @@ -6,7 +6,7 @@ import { AES, enc, SHA1 } from 'crypto-js' }) export class LocalstoreService { - private prefix = 'v16-' + private prefix = 'v17-' constructor() { @@ -14,11 +14,11 @@ export class LocalstoreService { this.set(key, this.prefix) } - getKey(keyName) { + getKey(keyName:string) { return this.prefix + keyName } - get( keyName, safe) { + get( keyName:string, safe) { keyName = this.getKey(keyName) @@ -40,7 +40,7 @@ export class LocalstoreService { } } - set(keyName, value) { + set(keyName:string, value) { keyName = this.getKey(keyName) @@ -55,7 +55,7 @@ export class LocalstoreService { localStorage.setItem(keyName, encoded) } - delete(keyName) { + delete(keyName:string) { keyName = this.getKey(keyName) localStorage.removeItem(keyName) @@ -63,6 +63,4 @@ export class LocalstoreService { } -export const localstoreService = new LocalstoreService() - -console.log( AES.encrypt( 'pode ser qualquer', 'ayrton').toString() ) +export const localstoreService = new LocalstoreService() \ No newline at end of file diff --git a/src/app/store/publication-list.service.ts b/src/app/store/publication-list.service.ts index 48e3e4a26..a84ed779d 100644 --- a/src/app/store/publication-list.service.ts +++ b/src/app/store/publication-list.service.ts @@ -31,7 +31,7 @@ export class PublicationListService { return this._document[folderId] } - add(folderId, document) { + add(folderId, document = []) { this._document[folderId] = document setTimeout(()=> { diff --git a/src/app/store/session.service.ts b/src/app/store/session.service.ts index d2e8f225e..3e480e7bc 100644 --- a/src/app/store/session.service.ts +++ b/src/app/store/session.service.ts @@ -58,6 +58,7 @@ class SessionService { setInativity(value: boolean) { this._user.Inactivity = value + this._user.UrlBeforeInactivity = '' this.save() } diff --git a/src/app/store/to-day-event-storage.service.ts b/src/app/store/to-day-event-storage.service.ts index 70f1fa2ad..0868c059d 100644 --- a/src/app/store/to-day-event-storage.service.ts +++ b/src/app/store/to-day-event-storage.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { Event } from '../models/event.model'; import { localstoreService } from './localstore.service' import { AES, enc, SHA1 } from 'crypto-js' +import { EventList } from '../models/agenda/AgendaEventList'; @Injectable({ providedIn: 'root' @@ -10,7 +11,7 @@ import { AES, enc, SHA1 } from 'crypto-js' export class ToDayEventStorageService { // main data - private _eventsList: Event[] = [] + private _eventsList:EventList[] = [] // local storage keyName private keyName: string; private _count = 0 @@ -39,7 +40,7 @@ export class ToDayEventStorageService { this.save() } - reset(eventsList: Event[]) { + reset(eventsList: EventList[]) { this._eventsList = eventsList this.count = this._eventsList.length diff --git a/src/theme/variables.scss b/src/theme/variables.scss index b7b9788f3..9da84140a 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -367,6 +367,16 @@ $app-theme: mat-light-theme(( /* .event-actions-popover ion-list{ } */ + +.item-hover:hover{ + background-color: #e6f6ff75 !important; +} + +.box-hover:hover{ + background-color: #e6f6ff75 !important; + border: 1px solid #42b9fe !important; +} + .Rectangle { border-radius: 15px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);