mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -95,7 +95,6 @@ export class CreateProcessPage implements OnInit {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.task = this.navParams.get('task');
|
||||
|
||||
console.log('task', this.task)
|
||||
|
||||
this.taskType = this.navParams.get('taskAction');
|
||||
|
||||
@@ -135,7 +134,7 @@ export class CreateProcessPage implements OnInit {
|
||||
this.selectedTypes = ['99999850'];
|
||||
}, 500);
|
||||
|
||||
console.log(this.postData.DispatchFolder.SubjectTypes);
|
||||
|
||||
this.taskDate = new Date(this.task.taskStartDate);
|
||||
}
|
||||
|
||||
@@ -157,7 +156,6 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
getSubjectType() {
|
||||
this.processes.GetSubjectType().subscribe(res=>{
|
||||
console.log(res);
|
||||
this.subjectTypes = res;
|
||||
});
|
||||
}
|
||||
@@ -215,7 +213,6 @@ export class CreateProcessPage implements OnInit {
|
||||
}
|
||||
|
||||
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
console.log(attendees);
|
||||
|
||||
attendees = attendees.map(function(val) {
|
||||
return {
|
||||
@@ -224,7 +221,6 @@ export class CreateProcessPage implements OnInit {
|
||||
};
|
||||
});
|
||||
|
||||
console.log(attendees);
|
||||
|
||||
const DocumentToSave = this.documents.map((e) => {
|
||||
return {
|
||||
|
||||
@@ -751,12 +751,9 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
updateEventListBox() {
|
||||
|
||||
console.log('list',JSON.stringify(this.calendarService.eventSource))
|
||||
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')
|
||||
|
||||
console.log('this.TimelineMDList', this.TimelineMDList)
|
||||
|
||||
}
|
||||
|
||||
eventListBox(list, nice?) {
|
||||
@@ -786,17 +783,12 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
|
||||
|
||||
console.log(new Date(startDate).toLocaleDateString(),'!=' , new Date(endDate).toLocaleDateString())
|
||||
console.log(startDate.toISOString(),'iso' , endDate.toISOString() )
|
||||
console.log(new Date(startDate).toLocaleTimeString('pt'),'time' , new Date(endDate).toLocaleTimeString('pt'))
|
||||
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
console.log(event)
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
@@ -1028,7 +1020,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// open component
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log('View event '+eventId)
|
||||
|
||||
this.router.navigate(['/home/agenda', eventId, 'agenda']);
|
||||
/* console.log(this.profile);
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ export class eventListBox {
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
console.log(event)
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
|
||||
@@ -184,7 +184,6 @@ export class ExpedientePrPage implements OnInit {
|
||||
this.cc = users.filter(user=>{
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
console.log(users);
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header > </app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border">
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
|
||||
import { PublicationListStorage } from 'src/app/store/publication-list.service';
|
||||
@@ -30,7 +29,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
publicationEventFolderStorage = PublicationEventFolderStorage
|
||||
publicationTravelFolderService = PublicationTravelFolderStore
|
||||
|
||||
constructor( private loadingController: LoadingService,
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications: PublicationsService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
@@ -45,7 +44,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = params["params"].folderId;
|
||||
console.log(params["params"]);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,7 +59,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
console.log(this.folderId)
|
||||
|
||||
if(typeof(this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<div class="overflow-y-auto height-100 width-100">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
|
||||
<div *ngIf="despachoList.length >= 0">
|
||||
<div *ngIf="despachoStore.list.length >= 0">
|
||||
<ion-list part="divo">
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of despachoList; let i = index"
|
||||
*ngFor = "let task of despachoStore.list; let i = index"
|
||||
(click)="goToDespacho(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
@@ -60,13 +60,13 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && despachoList.length == 0"
|
||||
*ngIf="!skeletonLoader && despachoStore.list.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && despachoList.length == 0">
|
||||
<div *ngIf="skeletonLoader && despachoStore.list.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
|
||||
import { DespachoStore, DespachoStoreService } from 'src/app/store/despacho-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos',
|
||||
@@ -44,6 +45,7 @@ export class DespachosPage implements OnInit {
|
||||
dicIndex = 0;
|
||||
inicial = false
|
||||
skeletonLoader = true
|
||||
despachoStore = DespachoStore;
|
||||
|
||||
constructor (
|
||||
private processes:ProcessesService,
|
||||
@@ -132,6 +134,7 @@ export class DespachosPage implements OnInit {
|
||||
});
|
||||
|
||||
this.despachoList = this.sortArrayISODate(this.despachoList).reverse();
|
||||
this.despachoStore.reset(this.despachoList);
|
||||
this.skeletonLoader = false
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DespachoStoreService } from './despacho-store.service';
|
||||
|
||||
describe('DespachoStoreService', () => {
|
||||
let service: DespachoStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DespachoStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { localstoreService } from './localstore.service'
|
||||
import { AES, enc, SHA1 } from 'crypto-js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DespachoStoreService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name+ 'home/eventSource')).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = restore.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value) {
|
||||
this._count = value
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
count: this._list
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const DespachoStore = new DespachoStoreService()
|
||||
@@ -29,7 +29,7 @@ export class ToDayEventStorageService {
|
||||
}
|
||||
|
||||
get eventsList() {
|
||||
return this._eventsList
|
||||
return this._eventsList || []
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
|
||||
Reference in New Issue
Block a user