mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
improve counter
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DocumentCounterService } from './document-counter.service';
|
||||
|
||||
describe('DocumentCounterService', () => {
|
||||
let service: DocumentCounterService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(DocumentCounterService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DocumentCounterService {
|
||||
|
||||
expedientegbstore = ExpedienteGdStore;
|
||||
pendentesstore = PendentesStore;
|
||||
despachoStore = DespachoStore;
|
||||
eventoaprovacaostore = EventoAprovacaoStore;
|
||||
pedidosstore = PedidosStore;
|
||||
expedienteprstore = ExpedienteprStore;
|
||||
despachoprstore = DespachosprStore;
|
||||
|
||||
constructor() { }
|
||||
|
||||
get mdTotalDocument() {
|
||||
return this.despachoStore.count + this.expedientegbstore.count + this.pedidosstore.countdeferimento
|
||||
+ this.pedidosstore.countparecer + this.expedienteprstore.count + this.despachoprstore.count + this.pendentesstore.count
|
||||
+ this.eventoaprovacaostore.count
|
||||
}
|
||||
|
||||
get prTotalDocument() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,8 @@
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{totalExpediente}}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['MDGPR'])" >{{documentCounterService.mdTotalDocument}}</ion-badge>
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >0</ion-badge>
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="publications">
|
||||
|
||||
@@ -11,6 +11,8 @@ import { ModalController, AlertController, AnimationController, Platform } from
|
||||
import { NavigationExtras,Router,ActivatedRoute } from '@angular/router';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
|
||||
import { DocumentCounterService } from 'src/app/OtherService/document-counter.service'
|
||||
import { PermissionService } from '../OtherService/permission.service';
|
||||
|
||||
// import * as Sentry from "@sentry/browser";
|
||||
// import { Integrations } from "@sentry/tracing";
|
||||
@@ -68,7 +70,9 @@ export class HomePage implements OnInit {
|
||||
public modalCtrl: AlertController,
|
||||
private notificatinsservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private activeroute: ActivatedRoute) {
|
||||
private activeroute: ActivatedRoute,
|
||||
public documentCounterService: DocumentCounterService,
|
||||
public p: PermissionService) {
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
|
||||
Reference in New Issue
Block a user