mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
changed xcalendario to agenda
This commit is contained in:
+15
-15
@@ -3,36 +3,36 @@
|
|||||||
|
|
||||||
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && SessionStore.user.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])" class="bottoms" slot="bottom">
|
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && SessionStore.user.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])" class="bottoms" slot="bottom">
|
||||||
|
|
||||||
<ion-tab-button *ngIf="SessionStore.user.OwnerCalendars.length >= 1 || p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/events')" tab="events" [class.active]="pathname === '/home/events'">
|
<ion-tab-button *ngIf="SessionStore.user.OwnerCalendars.length >= 1 || p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/events')" tab="events" [class.active]="ActiveTabService.pages.home">
|
||||||
<!-- <ion-icon name="home"></ion-icon> -->
|
<!-- <ion-icon name="home"></ion-icon> -->
|
||||||
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
<ion-icon *ngIf="!ActiveTabService.pages.home" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
|
<ion-icon *ngIf="ActiveTabService.pages.home" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
|
||||||
<ion-label>Início</ion-label>
|
<ion-label>Início</ion-label>
|
||||||
</ion-tab-button>
|
</ion-tab-button>
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access])" (click)="goto('/home/agenda')" tab="agenda" [class.active]="pathname === '/home/agenda' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access])" (click)="goto('/home/agenda')" tab="agenda" [class.active]="ActiveTabService.pages.agenda">
|
||||||
<!-- <ion-icon name="calendar"></ion-icon> -->
|
<!-- <ion-icon name="calendar"></ion-icon> -->
|
||||||
<ion-icon *ngIf="pathname != '/home/agenda'" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
<ion-icon *ngIf="!ActiveTabService.pages.agenda" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/agenda'" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon>
|
<ion-icon *ngIf="ActiveTabService.pages.agenda" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon>
|
||||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
|
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
|
||||||
</ion-tab-button>
|
</ion-tab-button>
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/gabinete-digital')" [class.active]="ActiveTabService.pages.gabinete">
|
||||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||||
<ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
<ion-icon *ngIf="!ActiveTabService.pages.gabinete" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
|
<ion-icon *ngIf="ActiveTabService.pages.gabinete" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
|
||||||
<ion-label>Gabinete</ion-label>
|
<ion-label>Gabinete</ion-label>
|
||||||
</ion-tab-button>
|
</ion-tab-button>
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions.access])" tab="publications" [class.active]="pathname === '/home/publications' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions.access])" tab="publications" [class.active]="ActiveTabService.pages.publication">
|
||||||
<ion-icon *ngIf="pathname != '/home/publications'" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
<ion-icon *ngIf="!ActiveTabService.pages.publication" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/publications'" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon>
|
<ion-icon *ngIf="ActiveTabService.pages.publication" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon>
|
||||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Acções</ion-label>
|
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Acções</ion-label>
|
||||||
</ion-tab-button>
|
</ion-tab-button>
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="pathname === '/home/chat' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="ActiveTabService.pages.chat">
|
||||||
<ion-icon *ngIf="pathname != '/home/chat'" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
<ion-icon *ngIf="!ActiveTabService.pages.chat" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/chat'" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon>
|
<ion-icon *ngIf="ActiveTabService.pages.chat" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon>
|
||||||
<ion-label>Chat</ion-label>
|
<ion-label>Chat</ion-label>
|
||||||
</ion-tab-button>
|
</ion-tab-button>
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { EventsService } from 'src/app/services/events.service';
|
|||||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { ActiveTabService } from 'src/app/services/active-tab.service';
|
||||||
import { Device } from '@capacitor/device';
|
import { Device } from '@capacitor/device';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service';
|
import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service';
|
||||||
@@ -89,6 +90,7 @@ export class HomePage implements OnInit {
|
|||||||
private RochetChatConnectorService: RochetChatConnectorService,
|
private RochetChatConnectorService: RochetChatConnectorService,
|
||||||
private NetworkServiceService: NetworkServiceService,
|
private NetworkServiceService: NetworkServiceService,
|
||||||
public eventService: EventsService,
|
public eventService: EventsService,
|
||||||
|
public ActiveTabService: ActiveTabService
|
||||||
) {
|
) {
|
||||||
if (SessionStore.exist) {
|
if (SessionStore.exist) {
|
||||||
this.user = SessionStore.user;
|
this.user = SessionStore.user;
|
||||||
@@ -224,10 +226,6 @@ export class HomePage implements OnInit {
|
|||||||
const info = await Device.getInfo();
|
const info = await Device.getInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
get pathname() {
|
|
||||||
return window.location.pathname
|
|
||||||
}
|
|
||||||
|
|
||||||
updateList() {
|
updateList() {
|
||||||
|
|
||||||
document.addEventListener('pause', function () {
|
document.addEventListener('pause', function () {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container-div">
|
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private despachoService: DespachoService,
|
private despachoService: DespachoService,
|
||||||
private pedidoService: PedidoService,
|
private pedidoService: PedidoService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.task = this.navParams.get('task');
|
this.task = this.navParams.get('task');
|
||||||
@@ -199,6 +199,13 @@ export class CreateProcessPage implements OnInit {
|
|||||||
this.validateFrom = true
|
this.validateFrom = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultParticipants () {
|
||||||
|
if(this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {
|
||||||
|
return ['MDGPR']
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|
||||||
this.Form = new FormGroup({
|
this.Form = new FormGroup({
|
||||||
@@ -212,7 +219,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
Priority: new FormControl(this.postData.Priority, [
|
Priority: new FormControl(this.postData.Priority, [
|
||||||
Validators.required,
|
Validators.required,
|
||||||
]),
|
]),
|
||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.defaultParticipants() || this.taskParticipants, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
selectedTypes: new FormControl(this.selectedTypes, [
|
selectedTypes: new FormControl(this.selectedTypes, [
|
||||||
|
|||||||
@@ -67,9 +67,11 @@
|
|||||||
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
||||||
|
|
||||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
|
||||||
<mat-option *ngFor="let calendars of _eventService.calendarNamesAry" value="{{calendars}}">
|
<mat-option *ngFor="let calendars of _eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||||
<div *ngIf="calendars != 'Meu calendario' "> Agenda de {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars == 'Meu calendario'"> Agenda de {{loggeduser.FullName}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
CalendarName;
|
CalendarName;
|
||||||
CalendarNameShow = true
|
CalendarNameShow = true
|
||||||
CalendarNamesOptions
|
CalendarNamesOptions
|
||||||
|
testeFormDefaul = "Eudes"
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import * as internal from "stream";
|
||||||
|
|
||||||
export class DailyWorkTask{
|
export class DailyWorkTask{
|
||||||
SerialNumber: string;
|
SerialNumber: string;
|
||||||
Folio: string;
|
Folio: string;
|
||||||
@@ -67,11 +69,29 @@ export class fullTask {
|
|||||||
workflowName: string
|
workflowName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const activityInstanceNameArray = [
|
||||||
|
'Concluir Despacho',
|
||||||
|
'Tarefa de Despacho','Reexecutar Despacho','Concluir Parecer',
|
||||||
|
'Concluir Deferimento',
|
||||||
|
'Reapreciar Deferimento',
|
||||||
|
'Tarefa de Deferimento',
|
||||||
|
'Assinar Diploma',
|
||||||
|
'Diploma Assinado',
|
||||||
|
'Retificar Diploma',
|
||||||
|
'Gerar Diploma',
|
||||||
|
'Editar Evento',
|
||||||
|
'Revisar Diploma',
|
||||||
|
'Tarefa de Parecer'
|
||||||
|
] as const; // TS3.4 syntax
|
||||||
|
|
||||||
|
|
||||||
|
export type activityInstanceName = typeof activityInstanceNameArray[number];
|
||||||
|
|
||||||
export interface fullTaskList {
|
export interface fullTaskList {
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
taskStartDate: string;
|
taskStartDate: string;
|
||||||
workflowDisplayName: string;
|
workflowDisplayName: string;
|
||||||
activityInstanceName: string;
|
activityInstanceName: activityInstanceName;
|
||||||
totalDocuments: number;
|
totalDocuments: number;
|
||||||
workflowInstanceDataFields: {
|
workflowInstanceDataFields: {
|
||||||
Subject: string;
|
Subject: string;
|
||||||
@@ -142,6 +162,7 @@ export interface expedienteTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ExpedienteTask {
|
export interface ExpedienteTask {
|
||||||
|
Folio: string
|
||||||
SerialNumber: string
|
SerialNumber: string
|
||||||
Senders : string
|
Senders : string
|
||||||
CreateDate : any
|
CreateDate : any
|
||||||
@@ -152,3 +173,22 @@ export interface ExpedienteTask {
|
|||||||
taskStartDate: string
|
taskStartDate: string
|
||||||
Subject: string
|
Subject: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface PedidoDeDeferimento {
|
||||||
|
serialNumber: string;
|
||||||
|
taskStartDate: Date;
|
||||||
|
deadline: Date | null;
|
||||||
|
workflowDisplayName: string;
|
||||||
|
activityInstanceName: string;
|
||||||
|
totalDocuments: number;
|
||||||
|
workflowInstanceDataFields: PedidoDeDeferimentoWorkflowInstanceDataFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PedidoDeDeferimentoWorkflowInstanceDataFields {
|
||||||
|
Sender: string;
|
||||||
|
Subject: string;
|
||||||
|
FolderID: number;
|
||||||
|
Status: string;
|
||||||
|
originator: string;
|
||||||
|
}
|
||||||
@@ -218,8 +218,8 @@
|
|||||||
<!-- List -->
|
<!-- List -->
|
||||||
<ul *ngIf="showTimelineFilterState">
|
<ul *ngIf="showTimelineFilterState">
|
||||||
<li class="changeText" [class.active]="segment == 'Combinado' " (click)="changeSegment('Combinado')" class="cursor-pointer">Todos</li>
|
<li class="changeText" [class.active]="segment == 'Combinado' " (click)="changeSegment('Combinado')" class="cursor-pointer">Todos</li>
|
||||||
<li class="changeText" [class.active]="segment == 'Oficial' " (click)="changeSegment('Oficial')" class="cursor-pointer">Calendário Oficial</li>
|
<li class="changeText" [class.active]="segment == 'Oficial' " (click)="changeSegment('Oficial')" class="cursor-pointer">Agenda Oficial</li>
|
||||||
<li class="changeText" [class.active]="segment == 'Pessoal' " (click)="changeSegment('Pessoal')" class="cursor-pointer">Calendário Pessoal</li>
|
<li class="changeText" [class.active]="segment == 'Pessoal' " (click)="changeSegment('Pessoal')" class="cursor-pointer">Agenda Pessoal</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</ion-row>
|
</ion-row>
|
||||||
@@ -233,10 +233,11 @@
|
|||||||
<div class="calendar-title-description text-black align-center" *ngIf="eventService.hasSharedCalendar">
|
<div class="calendar-title-description text-black align-center" *ngIf="eventService.hasSharedCalendar">
|
||||||
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
||||||
|
|
||||||
<mat-option *ngFor="let calendars of eventService.calendarNamesAry.slice(0, 2)" value="{{calendars}}">
|
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||||
<div *ngIf="calendars != 'Meu calendario' && checkRoleInArray('Presidente da República')"> Agenda do PR </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && checkRoleInArray('Ministro e Director do Gabinete do PR')"> Agenda do MDGPR </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && checkRoleInArray('Presidente da República') && checkRoleInArray('Ministro e Director do Gabinete do PR')"> Agenda do {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
|
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
this.listToPresent = []
|
this.listToPresent = []
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
@@ -233,6 +234,9 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
window['year'] = this.changeYear
|
window['year'] = this.changeYear
|
||||||
|
|
||||||
|
console.log('SessionStore.user', SessionStore.user)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tigerUpdate() {
|
tigerUpdate() {
|
||||||
|
|||||||
@@ -64,10 +64,10 @@
|
|||||||
<mat-form-field appearance="none" floatLabel="never" class="width-100 " >
|
<mat-form-field appearance="none" floatLabel="never" class="width-100 " >
|
||||||
<mat-select placeholder="Selecione agenda*" [(ngModel)]="postEvent.CalendarName" >
|
<mat-select placeholder="Selecione agenda*" [(ngModel)]="postEvent.CalendarName" >
|
||||||
<mat-option value="Oficial">
|
<mat-option value="Oficial">
|
||||||
Calendário Oficial
|
Agenda Oficial
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<mat-option value="Pessoal">
|
<mat-option value="Pessoal">
|
||||||
Calendário Pessoal
|
Agenda Pessoal
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -29,10 +29,17 @@
|
|||||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||||
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
|
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
|
||||||
|
|
||||||
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars}}">
|
<!-- <mat-option *ngFor="let calendars of _eventService.calendarNamesAry; let i = index" value="{{calendars}}">
|
||||||
<div *ngIf="calendars != 'Meu calendario' "> Agenda de {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars == 'Meu calendario'"> Agenda de {{loggeduser.FullName}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
||||||
|
|
||||||
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
|
||||||
|
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
@@ -41,7 +48,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
@@ -63,7 +69,7 @@
|
|||||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||||
<mat-select [(value)]="postEvent.CalendarName" >
|
<mat-select [(value)]="postEvent.CalendarName" >
|
||||||
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
||||||
Calendário {{ calendars }}
|
Agenda {{ calendars }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!this.CalendarName) {
|
if(!this.CalendarName) {
|
||||||
|
console.log('true', this.eventService.calendarNamesAry.includes('Meu calendario'))
|
||||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||||
this.CalendarName = 'Meu calendario';
|
this.CalendarName = 'Meu calendario';
|
||||||
console.log(this.eventService.calendarNamesAry)
|
console.log(this.eventService.calendarNamesAry)
|
||||||
|
|||||||
@@ -83,9 +83,12 @@ export class DiplomasAssinarPage implements OnInit {
|
|||||||
|
|
||||||
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
|
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||||
|
|
||||||
|
let format = diplomasAssinar.map(element => {
|
||||||
|
return this.customTaskPipe.transform(element)
|
||||||
|
});
|
||||||
|
|
||||||
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
this.deplomasStore.resetDiplomasParaAssinar(format)
|
||||||
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
|
this.diplomasList = this.sortService.sortDate(format, 'CreateDate')
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { SortService } from 'src/app/services/functions/sort.service';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
||||||
|
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -28,6 +29,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
skeletonLoader = true
|
skeletonLoader = true
|
||||||
deplomasStore = DeplomasStore
|
deplomasStore = DeplomasStore
|
||||||
|
customTaskPipe = new CustomTaskPipe()
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
@@ -124,13 +126,10 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate');
|
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate');
|
||||||
|
|
||||||
let diplomasAssinados = diplomas.filter(data => data.activityInstanceName == "Diploma Assinado");
|
let diplomasAssinados = diplomas.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
let diplomasAssinadoList = [];
|
|
||||||
|
|
||||||
diplomasAssinados.forEach(async element => {
|
|
||||||
|
|
||||||
let task = this.pipeTask(element);
|
let diplomasAssinadoList = diplomasAssinados.map( element => {
|
||||||
diplomasAssinadoList.push(task);
|
return this.pipeTask(element);
|
||||||
// console.log('DIPLOMAS ASSINADOS', task)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
|
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
|
||||||
@@ -138,7 +137,10 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
|
|
||||||
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
|
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||||
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
|
||||||
|
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar.map(element => {
|
||||||
|
return this.customTaskPipe.transform(element)
|
||||||
|
}))
|
||||||
|
|
||||||
// console.log('DIPLOMAS ASSINADOS', this.diplomasAssinadoList)
|
// console.log('DIPLOMAS ASSINADOS', this.diplomasAssinadoList)
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,12 @@
|
|||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||||
<ion-segment-button value="MDGPR">
|
<ion-segment-button value="MDGPR">
|
||||||
Meu Calendário
|
Minha agenda
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry" value="PR">
|
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry" value="PR">
|
||||||
<!-- <ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry" value="PR">
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Presidente da República'"> Agenda do PR </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div> -->
|
|
||||||
Calendário Partilhado
|
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|||||||
+12
-7
@@ -33,14 +33,19 @@
|
|||||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||||
|
|
||||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||||
<mat-select [(value)]="CalendarOwnerName" (selectionChange)="changeAgenda()">
|
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
|
||||||
|
|
||||||
<mat-option *ngFor="let calendars of calendarService.calendarNamesAry" value="{{calendars}}">
|
<!-- <mat-option *ngFor="let calendars of _eventService.calendarNamesAry; let i = index" value="{{calendars}}">
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar == 'Presidente da República'"> Agenda do PR </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar != 'Ministro e Director do Gabinete do PR' && calendar != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
||||||
|
|
||||||
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
|
||||||
|
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||||
|
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
@@ -71,7 +76,7 @@
|
|||||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||||
<mat-select [(value)]="CalendarName" >
|
<mat-select [(value)]="CalendarName" >
|
||||||
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
||||||
{{ calendars }}
|
Calendário {{ calendars }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|||||||
+2
-2
@@ -129,7 +129,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div" >
|
<div class="container-div" *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div" *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||||
|
|||||||
+12
-3
@@ -23,7 +23,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service';
|
|||||||
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
import { SearchDocumentPipe } from 'src/app/pipes/search-document.pipe';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -109,7 +109,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
private userAuth: AuthService,
|
private userAuth: AuthService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private despachoService: DespachoService,
|
private despachoService: DespachoService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
public p: PermissionService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
@@ -194,6 +195,14 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
this.validateFrom = true;
|
this.validateFrom = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultParticipants () {
|
||||||
|
if(this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {
|
||||||
|
return ['MDGPR']
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|
||||||
this.Form = new FormGroup({
|
this.Form = new FormGroup({
|
||||||
@@ -210,7 +219,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
Priority: new FormControl(this.postData.Priority, [
|
Priority: new FormControl(this.postData.Priority, [
|
||||||
Validators.required,
|
Validators.required,
|
||||||
]),
|
]),
|
||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.defaultParticipants() || this.taskParticipants, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|||||||
@@ -395,8 +395,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
|
|
||||||
if (error.status == 0) {
|
if (error.status == 0) {
|
||||||
|
|||||||
@@ -141,6 +141,8 @@
|
|||||||
<!-- This is the box view -->
|
<!-- This is the box view -->
|
||||||
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100">
|
<div *ngSwitchCase="'boxview'" class="aside overflow-y-auto d-flex flex-wrap width-100 height-100">
|
||||||
<div *ngIf="loadCount">
|
<div *ngIf="loadCount">
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
<div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" >
|
<div *ngIf="hideInMobile" (click)="openAllProcessesPage()" [class.active]="selectedElement == 'allProcessesTag'" class="box-hover exp-card d-flex flex-column" >
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<!-- <ion-icon src="assets/images/icons-agenda.svg"></ion-icon> -->
|
<!-- <ion-icon src="assets/images/icons-agenda.svg"></ion-icon> -->
|
||||||
@@ -149,77 +151,8 @@
|
|||||||
<p class="text-center exp-card-title ">Todas as tarefas</p>
|
<p class="text-center exp-card-title ">Todas as tarefas</p>
|
||||||
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"> {{ getAllProcessCount }} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
|
|
||||||
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence'" class="box-hover exp-card d-flex flex-column justify-center">
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-correspondencia.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-correspondencia.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Correspondence'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-correspondencia-hover.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p class="text-center exp-card-title ">Expediente</p>
|
|
||||||
<p class="text-center exp-card-content"> {{expedientegbstore.count}} <span class="title1">Documentos</span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="box-hover exp-card d-flex flex-column justify-center" >
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-pendente.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-pendente.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Pending'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-pendente-hover.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pendentes</p>
|
|
||||||
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes</p>
|
|
||||||
<p class="text-center exp-card-content"> <span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Dispatches'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente-hover.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p class="text-center exp-card-title ">Despachos</p>
|
|
||||||
<p class="text-center exp-card-content"> {{despachoStore.count}} <span class="title1">Documentos</span> </p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="box-hover exp-card d-flex flex-column justify-center">
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-parecer.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-parecer.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-parecer-hover.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer</p>
|
|
||||||
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
|
|
||||||
<p class="text-center exp-card-content"> {{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="box-hover exp-card d-flex flex-column justify-center">
|
|
||||||
<div class="d-flex justify-center">
|
|
||||||
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-deferimento.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'RequestForApproval'" src="assets/images/theme/gov/icons-expediente-deferimento.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestForApproval'" src="assets/images/theme/gov/icons-expediente-deferimento-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-deferimento.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'RequestForApproval'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-deferimento-hover.svg"></ion-icon>
|
|
||||||
</div>
|
|
||||||
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
|
|
||||||
<p class="text-center exp-card-content"> {{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
||||||
<div class="center-div">
|
<div class="center-div">
|
||||||
<div class="exp-card-icon">
|
<div class="exp-card-icon">
|
||||||
@@ -237,6 +170,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p class="text-center exp-card-title">Diplomas por Assinar </p>
|
||||||
|
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||||
@@ -248,6 +195,8 @@
|
|||||||
<p class="text-center exp-card-content"> {{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
<p class="text-center exp-card-content"> {{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
@@ -259,6 +208,20 @@
|
|||||||
<p class="text-center exp-card-content"> {{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"> {{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p class="text-center exp-card-title">Diplomas para Assinar</p>
|
||||||
|
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
<div *ngIf="SessionStore.user.Profile == 'Consultant' && environment.presidencial" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="SessionStore.user.Profile == 'Consultant' && environment.presidencial" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
@@ -273,30 +236,88 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
<!-- List -->
|
||||||
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma.svg"></ion-icon>
|
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center exp-card-title">Diplomas para Assinar</p>
|
<p class="text-center exp-card-title ">Eventos para Aprovação</p>
|
||||||
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"> {{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
<!-- List -->
|
||||||
|
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-correspondencia.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Correspondence'" src="assets/images/theme/gov/icons-correspondencia-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-correspondencia.svg"></ion-icon>
|
||||||
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-diploma-hover.svg"></ion-icon>
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Correspondence'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-correspondencia-hover.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center exp-card-title">Diplomas por Assinar </p>
|
<p class="text-center exp-card-title ">Expediente</p>
|
||||||
<p class="text-center exp-card-content"> {{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"> {{expedientegbstore.count}} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Dispatches'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-despachos-presidente-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p class="text-center exp-card-title ">Despachos</p>
|
||||||
|
<p class="text-center exp-card-content"> {{despachoStore.count}} <span class="title1">Documentos</span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div (click)="openPedidosPage('parecer'); selectedElement='RequestsForOpinion'" [class.active]="selectedElement == 'RequestsForOpinion'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-parecer.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-parecer.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-parecer-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer</p>
|
||||||
|
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
|
||||||
|
<p class="text-center exp-card-content"> {{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div (click)="openPedidosPage('deferimento'); selectedElement = 'RequestForApproval'" [class.active]="selectedElement == 'RequestForApproval'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-deferimento.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'RequestForApproval'" src="assets/images/theme/gov/icons-expediente-deferimento.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestForApproval'" src="assets/images/theme/gov/icons-expediente-deferimento-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-deferimento.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'RequestForApproval'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-deferimento-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
|
||||||
|
<p class="text-center exp-card-content"> {{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- List -->
|
||||||
|
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="box-hover exp-card d-flex flex-column justify-center" >
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-pendente.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-pendente.svg"></ion-icon>
|
||||||
|
<ion-icon hidden *ngIf="ThemeService.currentTheme == 'doneIt' && selectedElement == 'Pending'" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-expediente-pendente-hover.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pendentes</p>
|
||||||
|
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes</p>
|
||||||
|
<p class="text-center exp-card-content"> <span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!loadCount" class="width-100">
|
<div *ngIf="!loadCount" class="width-100">
|
||||||
|
|||||||
@@ -705,12 +705,12 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
this.pendentesstore.reset(pendentes);
|
this.pendentesstore.reset(pendentes);
|
||||||
this.updateAllProcess()
|
this.updateAllProcess()
|
||||||
|
|
||||||
let depachoAPI: any = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
let depachoAPI = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||||
|
|
||||||
|
|
||||||
if(SessionStore.user.Profile != 'PR') {
|
if(SessionStore.user.Profile != 'PR') {
|
||||||
|
|
||||||
let depacho = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
let depacho: any = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||||
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||||
|
|
||||||
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
||||||
@@ -719,7 +719,7 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
this.updateAllProcess()
|
this.updateAllProcess()
|
||||||
} else if(SessionStore.user.Profile == 'PR') {
|
} else if(SessionStore.user.Profile == 'PR') {
|
||||||
|
|
||||||
let depacho = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
let depacho: any = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||||
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
||||||
this.despachoprstore.reset(depacho)
|
this.despachoprstore.reset(depacho)
|
||||||
this.updateAllProcess()
|
this.updateAllProcess()
|
||||||
@@ -771,13 +771,15 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
let diplomasAssinar = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
|
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||||
|
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
|
||||||
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
||||||
|
|
||||||
let diplomasAssinados = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
|
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
|
||||||
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
||||||
|
|
||||||
|
|
||||||
this.updateAllProcess()
|
this.updateAllProcess()
|
||||||
this.loadCount = true
|
this.loadCount = true
|
||||||
}
|
}
|
||||||
@@ -789,7 +791,10 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
event?.target?.complete();
|
event?.target?.complete();
|
||||||
|
} catch(error) {}
|
||||||
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export class ExpedienteTaskPipe implements PipeTransform {
|
|||||||
"SerialNumber": fullTask.serialNumber,
|
"SerialNumber": fullTask.serialNumber,
|
||||||
"taskStartDate": fullTask.taskStartDate,
|
"taskStartDate": fullTask.taskStartDate,
|
||||||
"Subject": fullTask.workflowInstanceDataFields.Subject,
|
"Subject": fullTask.workflowInstanceDataFields.Subject,
|
||||||
|
"Folio": fullTask.workflowInstanceDataFields.Subject,
|
||||||
"Senders": fullTask.workflowInstanceDataFields.Sender,
|
"Senders": fullTask.workflowInstanceDataFields.Sender,
|
||||||
"CreateDate": date,
|
"CreateDate": date,
|
||||||
"DocumentsQty": fullTask.totalDocuments,
|
"DocumentsQty": fullTask.totalDocuments,
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ActiveTabService } from './active-tab.service';
|
||||||
|
|
||||||
|
describe('ActiveTabService', () => {
|
||||||
|
let service: ActiveTabService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(ActiveTabService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ActiveTabService {
|
||||||
|
|
||||||
|
pages = {
|
||||||
|
chat: false,
|
||||||
|
agenda: false,
|
||||||
|
publication: false,
|
||||||
|
home: false,
|
||||||
|
gabinete: false
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(private router: Router) {
|
||||||
|
|
||||||
|
this.detectActiveTab()
|
||||||
|
|
||||||
|
this.router.events.subscribe((val) => {
|
||||||
|
this.detectActiveTab()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
detectActiveTab() {
|
||||||
|
this.setFalseToAllPage();
|
||||||
|
const pathName = window.location.pathname
|
||||||
|
|
||||||
|
if(pathName.startsWith('/home/agenda')) {
|
||||||
|
this.pages.agenda = true
|
||||||
|
} else if (pathName.startsWith('/home/events')) {
|
||||||
|
this.pages.home = true
|
||||||
|
} else if (pathName.startsWith('/home/gabinete-digital')) {
|
||||||
|
this.pages.gabinete = true
|
||||||
|
} else if (pathName.startsWith('/home/publications')) {
|
||||||
|
this.pages.publication = true
|
||||||
|
} else if (pathName.startsWith('/home/chat')) {
|
||||||
|
this.pages.chat = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setFalseToAllPage() {
|
||||||
|
for( const page in this.pages) {
|
||||||
|
this.pages[page] = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -95,6 +95,13 @@ export class ChatSystemService {
|
|||||||
this.loadChat();
|
this.loadChat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener('resume', function () {
|
||||||
|
if(this._dm?.length == 0 && this._group?.length == 0) {
|
||||||
|
this.getAllRooms();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadChat() {
|
loadChat() {
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ export class MessageService {
|
|||||||
return SessionStore.user.ChatData.data.userId == this.u._id
|
return SessionStore.user.ChatData.data.userId == this.u._id
|
||||||
}
|
}
|
||||||
|
|
||||||
private getChatObj() {
|
getChatObj() {
|
||||||
return {
|
return {
|
||||||
channels: this.channels,
|
channels: this.channels,
|
||||||
mentions: this.mentions,
|
mentions: this.mentions,
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export class RoomService {
|
|||||||
this.hasLoadHistory = false
|
this.hasLoadHistory = false
|
||||||
this.subscribeAttempt = false
|
this.subscribeAttempt = false
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,10 +174,6 @@ export class RoomService {
|
|||||||
|
|
||||||
this.calDateDuration();
|
this.calDateDuration();
|
||||||
|
|
||||||
(async () => {
|
|
||||||
await this.restoreMessageFromDB()
|
|
||||||
await this.loadHistory({})
|
|
||||||
})()
|
|
||||||
|
|
||||||
if(this.customFields?.countDownDate) {
|
if(this.customFields?.countDownDate) {
|
||||||
this.countDownDate(this.customFields.countDownDate);
|
this.countDownDate(this.customFields.countDownDate);
|
||||||
@@ -327,7 +323,7 @@ export class RoomService {
|
|||||||
if(!found) {
|
if(!found) {
|
||||||
|
|
||||||
ChatMessage.origin = 'stream'
|
ChatMessage.origin = 'stream'
|
||||||
const message = await this.prepareCreate({message: ChatMessage, save: true});
|
const message = await this.prepareCreate({message: ChatMessage, save: false});
|
||||||
this.registerSendMessage(message)
|
this.registerSendMessage(message)
|
||||||
|
|
||||||
message.from = 'stream'
|
message.from = 'stream'
|
||||||
@@ -348,7 +344,10 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this.hasLoadHistory == true) {
|
if(this.hasLoadHistory == true) {
|
||||||
|
this.messages.push(message)
|
||||||
await message.addMessageDB()
|
await message.addMessageDB()
|
||||||
|
} else {
|
||||||
|
this.messagesBeforeOfflineAPI.push(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.chatOpen == false) {
|
if(this.chatOpen == false) {
|
||||||
@@ -503,7 +502,6 @@ export class RoomService {
|
|||||||
|
|
||||||
if(previousLastMessage) {
|
if(previousLastMessage) {
|
||||||
this.lastMessage = previousLastMessage;
|
this.lastMessage = previousLastMessage;
|
||||||
// console.log("last message"+ previousLastMessage)
|
|
||||||
this.calDateDuration(previousLastMessage._updatedAt)
|
this.calDateDuration(previousLastMessage._updatedAt)
|
||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
}
|
}
|
||||||
@@ -736,12 +734,11 @@ export class RoomService {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollDown()
|
this.scrollDown()
|
||||||
}, 50)
|
}, 50)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// runs onces only
|
// runs onces only
|
||||||
|
loadHistoryCount = 0
|
||||||
async loadHistory({limit = 1000, forceUpdate = false }) {
|
async loadHistory({limit = 1000, forceUpdate = false }) {
|
||||||
|
|
||||||
if(forceUpdate == false) {
|
if(forceUpdate == false) {
|
||||||
@@ -752,15 +749,15 @@ export class RoomService {
|
|||||||
|
|
||||||
this.hasLoadHistory = true
|
this.hasLoadHistory = true
|
||||||
|
|
||||||
|
await this.restoreMessageFromDB()
|
||||||
const chatHistory: chatHistory = await this.RochetChatConnectorService.loadHistory(this.id, limit)
|
const chatHistory: chatHistory = await this.RochetChatConnectorService.loadHistory(this.id, limit)
|
||||||
|
|
||||||
if(chatHistory?.result?.messages) {
|
if(chatHistory?.result?.messages) {
|
||||||
const messagesId = this.messages.map((message)=> message._id)
|
|
||||||
|
|
||||||
const users = this.getUsersByStatus('online')
|
const users = this.getUsersByStatus('online')
|
||||||
|
|
||||||
for(let message of chatHistory.result.messages.reverse()) {
|
for(let message of chatHistory.result.messages.reverse()) {
|
||||||
if (!messagesId.includes(message._id)) {
|
|
||||||
message.origin = 'history'
|
message.origin = 'history'
|
||||||
message.from = 'History'
|
message.from = 'History'
|
||||||
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
|
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
|
||||||
@@ -768,16 +765,20 @@ export class RoomService {
|
|||||||
|
|
||||||
messagesToSave.received = users.map((user) => user._id)
|
messagesToSave.received = users.map((user) => user._id)
|
||||||
messagesToSave.addMessageDB()
|
messagesToSave.addMessageDB()
|
||||||
|
|
||||||
// console.log('add history', message)
|
|
||||||
} else {
|
|
||||||
// console.log('exit')
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// console.log('exit')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for( const message of this.messagesBeforeOfflineAPI) {
|
||||||
|
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
|
||||||
|
if(messagesToSave != null) {
|
||||||
|
|
||||||
|
messagesToSave.received = users.map((user) => user._id)
|
||||||
|
messagesToSave.addMessageDB()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.messagesBeforeOfflineAPI = []
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollDown()
|
this.scrollDown()
|
||||||
@@ -824,7 +825,9 @@ export class RoomService {
|
|||||||
wewMessage.setData(message)
|
wewMessage.setData(message)
|
||||||
wewMessage.loadHistory = this.hasLoadHistory
|
wewMessage.loadHistory = this.hasLoadHistory
|
||||||
|
|
||||||
|
if(save) {
|
||||||
this.messages.push(wewMessage)
|
this.messages.push(wewMessage)
|
||||||
|
}
|
||||||
|
|
||||||
return wewMessage
|
return wewMessage
|
||||||
}
|
}
|
||||||
@@ -842,7 +845,7 @@ export class RoomService {
|
|||||||
|
|
||||||
private findMessageBy_id (id) {
|
private findMessageBy_id (id) {
|
||||||
for( let m of this.messages) {
|
for( let m of this.messages) {
|
||||||
if(m._id == id) {
|
if(m?._id == id) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -852,7 +855,7 @@ export class RoomService {
|
|||||||
|
|
||||||
private findMessageBy_localReference (localReference) {
|
private findMessageBy_localReference (localReference) {
|
||||||
for( let m of this.messages) {
|
for( let m of this.messages) {
|
||||||
if(m.localReference == localReference) {
|
if(m?.localReference == localReference) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -893,7 +896,7 @@ export class RoomService {
|
|||||||
async prepareMessageCreateIfNotExist({message}) {
|
async prepareMessageCreateIfNotExist({message}) {
|
||||||
message = this.fix_updatedAt(message)
|
message = this.fix_updatedAt(message)
|
||||||
|
|
||||||
let found = await this.findMessageBy_id(message._id) || this.findMessageBy_localReference(message.localReference)
|
let found = await this.findMessageBy_id(message._id) || await this.findMessageBy_localReference(message.localReference)
|
||||||
// || await this.findMessageInDBByData({_id:message._id, localReference:message.localReference })
|
// || await this.findMessageInDBByData({_id:message._id, localReference:message.localReference })
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ export class EventsService {
|
|||||||
|
|
||||||
console.log('ROLE',e.Role, e.FullName)
|
console.log('ROLE',e.Role, e.FullName)
|
||||||
|
|
||||||
if(!this.calendarNamesAry.includes(e.FullName)) {
|
if(!this.calendarNamesAry.find(x => x.Role == e.Role)) {
|
||||||
/* if(e.Role == "Presidente da República") {
|
/* if(e.Role == "Presidente da República") {
|
||||||
this.calendarNamesAry.push(e.Role)
|
this.calendarNamesAry.push(e.Role)
|
||||||
console.log('PR ROLE',this.calendarNamesAry)
|
console.log('PR ROLE',this.calendarNamesAry)
|
||||||
@@ -271,13 +271,21 @@ export class EventsService {
|
|||||||
console.log('NORMAL ROLE',this.calendarNamesAry)
|
console.log('NORMAL ROLE',this.calendarNamesAry)
|
||||||
} */
|
} */
|
||||||
//this.calendarRole.push(e.Role)
|
//this.calendarRole.push(e.Role)
|
||||||
|
let objectShared = {
|
||||||
|
"Fullname": e.FullName,
|
||||||
|
"Role": e.Role
|
||||||
|
}
|
||||||
|
|
||||||
|
this.calendarNamesAry.push(objectShared)
|
||||||
|
|
||||||
|
|
||||||
|
console.log('objectShared',this.calendarNamesAry)
|
||||||
this.calendarNamesType[e.FullName] = {}
|
this.calendarNamesType[e.FullName] = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true
|
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true
|
||||||
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
|
this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
|
||||||
|
this.calendarNamesType[e.FullName]['RoleId'] = sharedCalendar.CalendarRoleId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,11 +298,13 @@ export class EventsService {
|
|||||||
|
|
||||||
if(!this.calendarNamesAry.includes('Meu calendario')) {
|
if(!this.calendarNamesAry.includes('Meu calendario')) {
|
||||||
this.calendarNamesAry.push('Meu calendario')
|
this.calendarNamesAry.push('Meu calendario')
|
||||||
|
console.log(this.calendarNamesAry)
|
||||||
this.calendarNamesType['Meu calendario'] = {}
|
this.calendarNamesType['Meu calendario'] = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true
|
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true
|
||||||
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
|
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
|
||||||
|
this.calendarNamesType['Meu calendario']['RoleId'] = sharedCalendar.CalendarRoleId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,12 @@
|
|||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||||
<ion-segment-button value="MDGPR">
|
<ion-segment-button value="MDGPR">
|
||||||
Meu Calendário
|
Minha agenda
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button value="PR">
|
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry" value="PR">
|
||||||
Calendário Partilhado
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { NavigationEnd, Router } from '@angular/router';
|
|||||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-event-list',
|
selector: 'app-event-list',
|
||||||
@@ -36,6 +37,7 @@ export class EventListPage implements OnInit {
|
|||||||
private processes:ProcessesService,
|
private processes:ProcessesService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
|
public eventService: EventsService,
|
||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,16 @@
|
|||||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||||
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
|
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
|
||||||
|
|
||||||
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars}}">
|
<!-- <mat-option *ngFor="let calendars of _eventService.calendarNamesAry; let i = index" value="{{calendars}}">
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar == 'Presidente da República'"> Agenda do PR </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Presidente da República'"> Agenda do PR </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
<div *ngIf="calendars != 'Meu calendario' && calendar != 'Ministro e Director do Gabinete do PR' && calendar != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
|
||||||
|
|
||||||
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
|
||||||
|
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="thetitle"><ion-label >Diplomas para assinar</ion-label></div>
|
<div class="thetitle"><ion-label >Diplomas para assinar</ion-label></div>
|
||||||
<!-- <div class="theicon">
|
<div class="theicon">
|
||||||
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
|
<button title="Atualizar" class="btn-no-color" (click)="doRefresh($event)">
|
||||||
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
|
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="item width-100">
|
<div class="item width-100">
|
||||||
<div class="exp-top-detail">
|
<div class="exp-top-detail">
|
||||||
<div class="subject">
|
<div class="subject">
|
||||||
<ion-label>{{ task.Folio }}</ion-label>
|
<ion-label>{{ task.Folio || task.workflowInstanceDataFields.Subject }}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-icon">
|
<div class="exp-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||||
|
|||||||
@@ -71,9 +71,8 @@ export class DiplomasAssinarPage implements OnInit {
|
|||||||
|
|
||||||
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
|
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||||
|
|
||||||
diplomasAssinar.forEach(element => {
|
this.diplomasList = diplomasAssinar.map(element => {
|
||||||
let task: customTask = this.customTaskPipe.transform(element)
|
return this.customTaskPipe.transform(element)
|
||||||
this.diplomasList.push(task);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
|
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
|
||||||
|
|||||||
@@ -66,29 +66,23 @@ export class DiplomasPage implements OnInit {
|
|||||||
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||||
|
|
||||||
this.diplomasList = [];
|
this.diplomasList = [];
|
||||||
let diplomasList = [];
|
|
||||||
|
|
||||||
// let diplomasReview = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
// let diplomasReview = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
|
|
||||||
diplomas.forEach(element => {
|
let diplomasList = diplomas.map(element => {
|
||||||
|
return this.pipeTask(element)
|
||||||
let task = this.pipeTask(element)
|
|
||||||
diplomasList.push(task);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
diplomasList = diplomasList.filter(data => data.activityInstanceName != "Tarefa de Despacho");
|
diplomasList = diplomasList.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||||
|
|
||||||
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate')
|
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate')
|
||||||
|
|
||||||
this.deplomasStore.resetDiplomasReview(this.diplomasList)
|
this.deplomasStore.resetDiplomasReview(this.diplomasList)
|
||||||
|
|
||||||
let diplomasAssinadoList = []
|
|
||||||
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||||
|
|
||||||
diplomasAssinados.forEach(async element => {
|
let diplomasAssinadoList = diplomasAssinados.map(element => {
|
||||||
|
return this.pipeTask(element)
|
||||||
let task = this.pipeTask(element)
|
|
||||||
diplomasAssinadoList.push(task);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
|
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
|
||||||
|
|||||||
@@ -10,10 +10,12 @@
|
|||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||||
<ion-segment-button value="MDGPR">
|
<ion-segment-button value="MDGPR">
|
||||||
Meu Calendário
|
Minha agenda
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button value="PR">
|
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry" value="PR">
|
||||||
Calendário Partilhado
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||||
|
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.FullName}} </div>
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.servic
|
|||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events-to-approve',
|
selector: 'app-events-to-approve',
|
||||||
@@ -35,7 +37,8 @@ export class EventsToApprovePage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private userAuth: AuthService,
|
private userAuth: AuthService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
private storage: Storage
|
private storage: Storage,
|
||||||
|
public eventService: EventsService,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
<div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])">
|
<div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])">
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
||||||
[class.active]="locationPathname() == '/home/events'">
|
[class.active]="ActiveTabService.pages.home">
|
||||||
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-active-black.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-active-black.svg'></ion-icon>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
||||||
[class.active]="locationPathname() == '/home/agenda'">
|
[class.active]="ActiveTabService.pages.agenda">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
||||||
[class.active]="locationPathname() == '/home/gabinete-digital'">
|
[class.active]="ActiveTabService.pages.gabinete">
|
||||||
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-dk.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-dk.svg'></ion-icon>
|
||||||
@@ -99,14 +99,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Actions.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
<div *ngIf="p.userPermission([permissionList.Actions.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
||||||
[class.active]="locationPathname() == '/home/publications'">
|
[class.active]="ActiveTabService.pages.publication">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
|
||||||
<span>Acções</span>
|
<span>Acções</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Chat.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
<div *ngIf="p.userPermission([permissionList.Chat.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
||||||
[class.active]="locationPathname() == '/home/chat'">
|
[class.active]="ActiveTabService.pages.chat">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
||||||
<span>Chat</span>
|
<span>Chat</span>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { EventTrigger } from 'src/app/services/eventTrigger.service'
|
import { EventTrigger } from 'src/app/services/eventTrigger.service'
|
||||||
/* import { Events } from 'ionic-angular' */
|
import { ActiveTabService } from 'src/app/services/active-tab.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
@@ -48,6 +48,7 @@ export class HeaderPage implements OnInit {
|
|||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private eventTriger: EventTrigger,
|
private eventTriger: EventTrigger,
|
||||||
|
public ActiveTabService: ActiveTabService
|
||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
router.events.subscribe((val) => {
|
router.events.subscribe((val) => {
|
||||||
@@ -98,27 +99,6 @@ export class HeaderPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
locationPathname(): string {
|
|
||||||
let path = window.location.pathname;
|
|
||||||
if(path.includes('/home/events')){
|
|
||||||
return '/home/events';
|
|
||||||
}
|
|
||||||
else if(path.includes('/home/agenda')){
|
|
||||||
return '/home/agenda';
|
|
||||||
}
|
|
||||||
else if(path.includes('/home/gabinete-digital')){
|
|
||||||
return '/home/gabinete-digital';
|
|
||||||
}
|
|
||||||
else if(path.includes('/home/publications')){
|
|
||||||
return '/home/publications';
|
|
||||||
}
|
|
||||||
else if(path.includes('/home/chat')){
|
|
||||||
return '/home/chat';
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async openSearch() {
|
async openSearch() {
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { DatabaseSchema } from '../../models/register-modal.interface.js';
|
import { DatabaseSchema } from '../../models/register-modal.interface.js';
|
||||||
export declare class IndexedDBConnection {
|
export declare class IndexedDBConnection {
|
||||||
constructor();
|
constructor();
|
||||||
connect(config: DatabaseSchema): Promise<IDBDatabase>;
|
static connect(config: DatabaseSchema): Promise<IDBDatabase>;
|
||||||
migrate(config: DatabaseSchema): Promise<boolean>;
|
static migrate(config: DatabaseSchema): Promise<boolean>;
|
||||||
private runMigrations;
|
private runMigrations;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,13 @@ export class IndexedDBConnection {
|
|||||||
reject(e.target.error.name);
|
reject(e.target.error.name);
|
||||||
};
|
};
|
||||||
request.onupgradeneeded = async (e) => {
|
request.onupgradeneeded = async (e) => {
|
||||||
throw ('need to migrate first');
|
console.log('need to migrate first');
|
||||||
|
await this.migrate(config);
|
||||||
|
return await this.connect(config);
|
||||||
};
|
};
|
||||||
|
// request.onblocked = async (e: any) => {
|
||||||
|
// reject(e.target.error.name);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reject("IDBDatabase not supported inside webworker");
|
reject("IDBDatabase not supported inside webworker");
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ declare class _indexedDB {
|
|||||||
getOneByIndex: (keyPath: string, value: string | number) => Promise<any>;
|
getOneByIndex: (keyPath: string, value: string | number) => Promise<any>;
|
||||||
getManyByIndex: (keyPath: string, value: string | number) => Promise<any[]>;
|
getManyByIndex: (keyPath: string, value: string | number) => Promise<any[]>;
|
||||||
getAll: () => Promise<any[]>;
|
getAll: () => Promise<any[]>;
|
||||||
add: (value: Object, key?: any) => Promise<number>;
|
add: (value: Object, key?: any) => Promise<number | Object>;
|
||||||
update: (value: any, key?: any) => Promise<any>;
|
update: (value: any, key?: any) => Promise<any>;
|
||||||
deleteByID: (id: any) => Promise<any>;
|
deleteByID: (id: any) => Promise<any>;
|
||||||
deleteAll: () => Promise<any>;
|
deleteAll: () => Promise<any>;
|
||||||
|
|||||||
@@ -77,6 +77,13 @@ class _indexedDB {
|
|||||||
var _a, _b;
|
var _a, _b;
|
||||||
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
|
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
|
||||||
resolve(e.target.result);
|
resolve(e.target.result);
|
||||||
|
db.transaction;
|
||||||
|
};
|
||||||
|
request.onerror = (e) => {
|
||||||
|
let data = {
|
||||||
|
error: e.target['error']
|
||||||
|
};
|
||||||
|
resolve(data);
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
@@ -94,11 +101,6 @@ class _indexedDB {
|
|||||||
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
|
(_b = (_a = tx) === null || _a === void 0 ? void 0 : _a.commit) === null || _b === void 0 ? void 0 : _b.call(_a);
|
||||||
resolve(e.target.result);
|
resolve(e.target.result);
|
||||||
};
|
};
|
||||||
|
|
||||||
request.onerror = (e) => {
|
|
||||||
console.log(value, key)
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
@@ -152,6 +154,7 @@ class _indexedDB {
|
|||||||
request.onsuccess = e => {
|
request.onsuccess = e => {
|
||||||
cursorCallback(e);
|
cursorCallback(e);
|
||||||
resolve();
|
resolve();
|
||||||
|
// db.close();
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
@@ -278,7 +281,6 @@ class _indexedDB {
|
|||||||
delete: async (methods) => {
|
delete: async (methods) => {
|
||||||
if (methods[methods.length - 1].methodName == 'delete' &&
|
if (methods[methods.length - 1].methodName == 'delete' &&
|
||||||
methods[methods.length - 1].arguments == null) {
|
methods[methods.length - 1].arguments == null) {
|
||||||
|
|
||||||
const customMethods = Object.create(methods);
|
const customMethods = Object.create(methods);
|
||||||
customMethods[methods.length - 1].methodName = 'execute';
|
customMethods[methods.length - 1].methodName = 'execute';
|
||||||
const result = await this.requestHandler(TableSchema, config, queryId).select(customMethods);
|
const result = await this.requestHandler(TableSchema, config, queryId).select(customMethods);
|
||||||
@@ -293,15 +295,11 @@ class _indexedDB {
|
|||||||
}
|
}
|
||||||
else if (methods[methods.length - 1].methodName == 'delete' &&
|
else if (methods[methods.length - 1].methodName == 'delete' &&
|
||||||
typeof methods[methods.length - 1].arguments == 'object') {
|
typeof methods[methods.length - 1].arguments == 'object') {
|
||||||
|
|
||||||
const IdInObject = methods[methods.length - 1].arguments;
|
const IdInObject = methods[methods.length - 1].arguments;
|
||||||
const idValue = IdInObject[TableSchema.id.keyPath];
|
const idValue = IdInObject[TableSchema.id.keyPath];
|
||||||
|
|
||||||
const result = await this.getActions(TableSchema.name, config).deleteByID(idValue)
|
|
||||||
console.log('delete7', IdInObject,idValue, result.type == 'success', result.type)
|
|
||||||
return {
|
return {
|
||||||
queryId: queryId,
|
queryId: queryId,
|
||||||
value: result.type == 'success'
|
value: await this.getActions(TableSchema.name, config).deleteByID(idValue)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (methods[methods.length - 1].methodName == 'delete' &&
|
else if (methods[methods.length - 1].methodName == 'delete' &&
|
||||||
@@ -310,8 +308,6 @@ class _indexedDB {
|
|||||||
queryId: queryId,
|
queryId: queryId,
|
||||||
value: await this.getActions(TableSchema.name, config).deleteAll()
|
value: await this.getActions(TableSchema.name, config).deleteAll()
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
console.log('delete else')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
insert: async (methods) => {
|
insert: async (methods) => {
|
||||||
@@ -319,19 +315,19 @@ class _indexedDB {
|
|||||||
const rows = methods[0].arguments;
|
const rows = methods[0].arguments;
|
||||||
for (let insert of rows) {
|
for (let insert of rows) {
|
||||||
const id = await this.getActions(TableSchema.name, config).add(insert);
|
const id = await this.getActions(TableSchema.name, config).add(insert);
|
||||||
createdObjKeys.push(id);
|
insert[TableSchema.id.keyPath] = id;
|
||||||
}
|
}
|
||||||
// return first element
|
// return first element
|
||||||
if (rows.length == 1) {
|
if (rows.length == 1) {
|
||||||
return {
|
return {
|
||||||
queryId: queryId,
|
queryId: queryId,
|
||||||
value: await this.getActions(TableSchema.name, config).getByID(createdObjKeys[0])
|
value: rows[0]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return {
|
return {
|
||||||
queryId: queryId,
|
queryId: queryId,
|
||||||
value: createdObjKeys
|
value: rows
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
export declare type actionParam = 'insert' | 'update' | 'delete' | 'select';
|
export declare type actionParam = 'insert' | 'update' | 'delete' | 'select';
|
||||||
export declare type dbType = 'indexedDB';
|
export declare type dbType = 'indexedDB' | 'localStorage';
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { indexedDB } from './indexedDb/indexedb.js';
|
import { indexedDB } from './indexedDb/indexedb.js';
|
||||||
onmessage = async (oEvent) => {
|
onmessage = async (oEvent) => {
|
||||||
const { TableSchema, DBconfig, queryId, action, arg } = oEvent.data;
|
const { TableSchema, DBconfig, queryId, action, arg } = oEvent.data;
|
||||||
const result = await indexedDB.requestHandler(TableSchema, DBconfig, queryId)[action](arg);
|
indexedDB.requestHandler(TableSchema, DBconfig, queryId)[action](arg).then((result) => {
|
||||||
|
|
||||||
console.log('return response', result)
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
postMessage(result);
|
postMessage(result);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
@@ -14,4 +11,16 @@ onmessage = async (oEvent) => {
|
|||||||
value: undefined
|
value: undefined
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}).catch((result)=> {
|
||||||
|
try {
|
||||||
|
postMessage(result);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
postMessage({
|
||||||
|
queryId: result.queryId,
|
||||||
|
value: undefined
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
+4
-2
@@ -1,6 +1,7 @@
|
|||||||
import { Model } from './models/model.js';
|
import { Model } from './models/model.js';
|
||||||
|
import { LocalStorage } from './models/model.js';
|
||||||
import { ModelReader } from './models/model.reader.js';
|
import { ModelReader } from './models/model.reader.js';
|
||||||
import { registerModel } from './models/register-model.js';
|
import { registerModel, migrate } from './models/register-model.js';
|
||||||
export declare const models: {
|
export declare const models: {
|
||||||
Value(arg: any): {};
|
Value(arg: any): {};
|
||||||
CharField(data?: import("./models/field/interface.js").CharFieldParams): import("./models/field/allFields.js").CharField;
|
CharField(data?: import("./models/field/interface.js").CharFieldParams): import("./models/field/allFields.js").CharField;
|
||||||
@@ -21,7 +22,8 @@ export declare const models: {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
Model: typeof Model;
|
Model: typeof Model;
|
||||||
|
LocalStorage: typeof LocalStorage;
|
||||||
read: typeof ModelReader.read;
|
read: typeof ModelReader.read;
|
||||||
|
migrate: typeof migrate;
|
||||||
register: typeof registerModel.register;
|
register: typeof registerModel.register;
|
||||||
migrate: typeof registerModel.register;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { Model } from './models/model.js';
|
import { Model } from './models/model.js';
|
||||||
|
import { LocalStorage } from './models/model.js';
|
||||||
import * as Fields from './models/field/fields.js';
|
import * as Fields from './models/field/fields.js';
|
||||||
import { ModelReader } from './models/model.reader.js';
|
import { ModelReader } from './models/model.reader.js';
|
||||||
import { registerModel } from './models/register-model.js';
|
import { registerModel, migrate } from './models/register-model.js';
|
||||||
export const models = Object.assign(Object.assign({ Model, read: ModelReader.read, register: registerModel.register, migrate: registerModel.register }, Fields), { Value(arg) {
|
export const models = Object.assign(Object.assign({ Model,
|
||||||
|
LocalStorage, read: ModelReader.read, migrate: migrate, register: registerModel.register }, Fields), { Value(arg) {
|
||||||
if (arg == 'null') {
|
if (arg == 'null') {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+16
-1
@@ -1,5 +1,5 @@
|
|||||||
import { getParams } from './model.interface.js';
|
import { getParams } from './model.interface.js';
|
||||||
import { DatabaseSchema, TableSchema } from './register-modal.interface.js';
|
import { DatabaseSchema, DatabaseSchemaLocalStorage, TableSchema } from './register-modal.interface.js';
|
||||||
import { ModelManager } from './model-manager.js';
|
import { ModelManager } from './model-manager.js';
|
||||||
export declare class Model extends ModelManager {
|
export declare class Model extends ModelManager {
|
||||||
constructor(obg?: any);
|
constructor(obg?: any);
|
||||||
@@ -47,3 +47,18 @@ export declare class Model extends ModelManager {
|
|||||||
all: () => Promise<any>;
|
all: () => Promise<any>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
export declare class LocalStorage {
|
||||||
|
constructor();
|
||||||
|
static save(data?: Object): void;
|
||||||
|
static get(): any;
|
||||||
|
static getModelName(): string;
|
||||||
|
static getDBSchema(): DatabaseSchemaLocalStorage;
|
||||||
|
static getTableSchema(): TableSchema;
|
||||||
|
private static getIgnoreAttributes;
|
||||||
|
static ignoreAttributes(attributesStartWidth?: string[]): void;
|
||||||
|
private static getFields;
|
||||||
|
private static formValidation;
|
||||||
|
static clear(): void;
|
||||||
|
static clearComponent(): void;
|
||||||
|
static clearStorage(): void;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
var _a, _b;
|
var _a, _b;
|
||||||
import { hashCode, uniqueGenerator } from '../utils.js';
|
import { hashCode, uniqueGenerator } from '../utils.js';
|
||||||
import { ModelManager } from './model-manager.js';
|
import { ModelManager } from './model-manager.js';
|
||||||
import { models, modelsConfig } from './register-model.js';
|
import { models, modelsConfig, modelsConfigLocalStorage } from './register-model.js';
|
||||||
import { FieldType } from '../sql/query/interface.js';
|
import { FieldType } from '../sql/query/interface.js';
|
||||||
import * as Fields from './field/allFields.js';
|
import * as Fields from './field/allFields.js';
|
||||||
let methods = {} = {};
|
let methods = {} = {};
|
||||||
@@ -134,6 +134,10 @@ export class Model extends (_b = ModelManager) {
|
|||||||
delete newInstance[fieldName];
|
delete newInstance[fieldName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Object.defineProperty(newInstance, TableSchema.id.keyPath, {
|
||||||
|
configurable: false,
|
||||||
|
writable: false
|
||||||
|
});
|
||||||
delete newInstance.obj;
|
delete newInstance.obj;
|
||||||
return newInstance;
|
return newInstance;
|
||||||
}
|
}
|
||||||
@@ -211,12 +215,17 @@ export class Model extends (_b = ModelManager) {
|
|||||||
const queryId = uniqueGenerator();
|
const queryId = uniqueGenerator();
|
||||||
const createObject = await super.obj(DBconfig, TableSchema).create(_methods, queryId);
|
const createObject = await super.obj(DBconfig, TableSchema).create(_methods, queryId);
|
||||||
if (createObject) {
|
if (createObject) {
|
||||||
|
if (typeof createObject[TableSchema.id.keyPath] == 'object') {
|
||||||
|
throw (createObject[TableSchema.id.keyPath].error);
|
||||||
|
}
|
||||||
|
else {
|
||||||
const ModelName = this.getModelName();
|
const ModelName = this.getModelName();
|
||||||
let newInstance = new models[ModelName]();
|
let newInstance = new models[ModelName]();
|
||||||
Object.assign(newInstance, createObject);
|
Object.assign(newInstance, createObject);
|
||||||
delete newInstance.obj;
|
delete newInstance.obj;
|
||||||
return newInstance;
|
return newInstance;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,3 +312,82 @@ Model.object = ({ queryId = uniqueGenerator(), DBconfig, TableSchema, some = nul
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
export class LocalStorage {
|
||||||
|
constructor() { }
|
||||||
|
static save(data = {}) {
|
||||||
|
const dataToSave = this.getFields(Object.assign(this, Object.assign({}, data)));
|
||||||
|
const key = this.getTableSchema().id;
|
||||||
|
localStorage.setItem(key.keyPath, JSON.stringify(dataToSave));
|
||||||
|
}
|
||||||
|
static get() {
|
||||||
|
const key = this.getTableSchema().id;
|
||||||
|
const restedData = JSON.parse(localStorage.getItem(key.keyPath));
|
||||||
|
Object.assign(this, Object.assign({}, restedData));
|
||||||
|
return restedData;
|
||||||
|
}
|
||||||
|
static getModelName() {
|
||||||
|
return this.toString().split('(' || /s+/)[0].split(' ' || /s+/)[1];
|
||||||
|
}
|
||||||
|
static getDBSchema() {
|
||||||
|
const modalName = this.getModelName();
|
||||||
|
return modelsConfigLocalStorage[modalName].DatabaseSchema;
|
||||||
|
}
|
||||||
|
static getTableSchema() {
|
||||||
|
const modalName = this.getModelName();
|
||||||
|
return modelsConfigLocalStorage[modalName].TableSchema;
|
||||||
|
}
|
||||||
|
static getIgnoreAttributes() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
static ignoreAttributes(attributesStartWidth = []) {
|
||||||
|
if (!this.getIgnoreAttributes()) {
|
||||||
|
this.getIgnoreAttributes = () => {
|
||||||
|
return attributesStartWidth;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static getFields(arg) {
|
||||||
|
const TableSchema = this.getTableSchema();
|
||||||
|
const filteredArgs = {};
|
||||||
|
const fieldsName = TableSchema.fields.map((field) => field.name);
|
||||||
|
const Attributes = this.getIgnoreAttributes();
|
||||||
|
const fieldNameFilter = fieldsName.filter((fieldName) => {
|
||||||
|
if (Attributes) {
|
||||||
|
for (let Attribute of Attributes) {
|
||||||
|
if (fieldName.startsWith(Attribute)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
for (let fieldName of fieldNameFilter) {
|
||||||
|
if (arg.hasOwnProperty(fieldName)) {
|
||||||
|
filteredArgs[fieldName] = arg[fieldName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return filteredArgs;
|
||||||
|
}
|
||||||
|
static formValidation(data) {
|
||||||
|
const TableSchema = this.getTableSchema();
|
||||||
|
for (let field of TableSchema.fields) {
|
||||||
|
const Field = new Fields[field.className](field.fieldAttributes);
|
||||||
|
const FieldValue = data[field.name];
|
||||||
|
if (!Field.valid(FieldValue)) {
|
||||||
|
throw ('invalid insert into ' + TableSchema.name + ', invalid value for field ' + field.name + ' = ' + JSON.stringify(FieldValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
static clear() {
|
||||||
|
this.clearComponent();
|
||||||
|
this.clearStorage();
|
||||||
|
}
|
||||||
|
static clearComponent() {
|
||||||
|
const key = this.getTableSchema().id;
|
||||||
|
}
|
||||||
|
static clearStorage() {
|
||||||
|
const key = this.getTableSchema().id;
|
||||||
|
localStorage.removeItem(key.keyPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+10
@@ -9,3 +9,13 @@ export declare class ModelReader {
|
|||||||
attributes: AttributesMap<"maxLength" | "minLength" | "choices" | "primaryKey" | "unique" | "autoIncrement" | "type" | "model" | "blank" | "default" | "onDelete" | "foreignKey", string[]>;
|
attributes: AttributesMap<"maxLength" | "minLength" | "choices" | "primaryKey" | "unique" | "autoIncrement" | "type" | "model" | "blank" | "default" | "onDelete" | "foreignKey", string[]>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
export declare class LocalStorageModelReader {
|
||||||
|
static read(modelClassRepresentation: any): {
|
||||||
|
modelName: string;
|
||||||
|
fields: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
attributes: AttributesMap<"maxLength" | "minLength" | "choices" | "primaryKey" | "unique" | "autoIncrement" | "type" | "model" | "blank" | "default" | "onDelete" | "foreignKey", string[]>;
|
||||||
|
fieldTypes: FieldsMap<"CharField" | "JsonField" | "AutoField" | "BigIntegerField" | "DateField" | "IntegerField" | "TextField" | "BooleanField" | "OneToOneField" | "ForeignKey" | "ManyToManyField" | "indexedDBJsonField" | "indexedDBArrayField" | "DateTimeField", string[]>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,3 +32,22 @@ export class ModelReader {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class LocalStorageModelReader {
|
||||||
|
static read(modelClassRepresentation) {
|
||||||
|
const classInstance = modelClassRepresentation;
|
||||||
|
const fieldTypes = {};
|
||||||
|
const attributes = {};
|
||||||
|
const modelName = classInstance.getModelName();
|
||||||
|
const fields = {};
|
||||||
|
for (const [fieldName, Field] of Object.entries(classInstance)) {
|
||||||
|
// const type = Field?.fieldName
|
||||||
|
fields[fieldName] = Field || null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
modelName,
|
||||||
|
fields,
|
||||||
|
attributes,
|
||||||
|
fieldTypes
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+15
-4
@@ -1,11 +1,11 @@
|
|||||||
import { Model } from './model.js';
|
import { Model, LocalStorage } from './model.js';
|
||||||
import { DatabaseSchema, TableSchema } from './register-modal.interface.js';
|
import { DatabaseSchema, DatabaseSchemaLocalStorage, TableSchema, TableSchemaLocalStorage } from './register-modal.interface.js';
|
||||||
import { OneToOneField, ForeignKey, ManyToManyField } from './field/allFields.js';
|
import { OneToOneField, ForeignKey, ManyToManyField } from './field/allFields.js';
|
||||||
interface register {
|
interface register {
|
||||||
databaseName: string;
|
databaseName: string;
|
||||||
version: number;
|
version: number;
|
||||||
type: 'indexedDB';
|
type: 'indexedDB' | 'localStorage';
|
||||||
models: typeof Model[];
|
models: typeof Model[] | typeof LocalStorage[];
|
||||||
}
|
}
|
||||||
export declare const models: {};
|
export declare const models: {};
|
||||||
export declare const modelsConfig: {
|
export declare const modelsConfig: {
|
||||||
@@ -17,10 +17,21 @@ export declare const modelsConfig: {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
export declare const modelsLocalStorage: {};
|
||||||
|
export declare const modelsConfigLocalStorage: {
|
||||||
|
[key: string]: {
|
||||||
|
DatabaseSchema: DatabaseSchemaLocalStorage;
|
||||||
|
TableSchema: TableSchemaLocalStorage;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export declare function migrate(register: register): void;
|
||||||
export declare class registerModel {
|
export declare class registerModel {
|
||||||
static register(entries: register): Promise<void>;
|
static register(entries: register): Promise<void>;
|
||||||
static manyToManyRelationShip(foreignKeyField: ManyToManyField, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): Model;
|
static manyToManyRelationShip(foreignKeyField: ManyToManyField, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): Model;
|
||||||
}
|
}
|
||||||
|
export declare class registerLocalStorage {
|
||||||
|
static register(entries: register): Promise<void>;
|
||||||
|
}
|
||||||
export declare class ModelEditor {
|
export declare class ModelEditor {
|
||||||
static addMethodOneToOneField(foreignKeyField: OneToOneField, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): void;
|
static addMethodOneToOneField(foreignKeyField: OneToOneField, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): void;
|
||||||
static addMethodForeignKey(foreignKeyField: ForeignKey, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): void;
|
static addMethodForeignKey(foreignKeyField: ForeignKey, FieldName: string, modelName: string, databaseSchema: DatabaseSchema): void;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Model } from './model.js';
|
import { Model } from './model.js';
|
||||||
import { ModelReader } from './model.reader.js';
|
import { LocalStorageModelReader, ModelReader } from './model.reader.js';
|
||||||
import { indexedDB } from './../connection/indexedDb/indexedb.js';
|
import { indexedDB } from './../connection/indexedDb/indexedb.js';
|
||||||
import { OneToOneField, ForeignKey, ManyToManyField } from './field/allFields.js';
|
import { OneToOneField, ForeignKey, ManyToManyField } from './field/allFields.js';
|
||||||
import { uncapitalize } from '../utils.js';
|
import { uncapitalize } from '../utils.js';
|
||||||
@@ -7,6 +7,16 @@ import { FieldType } from '../sql/query/interface.js';
|
|||||||
import { ModelMigrations } from './mode-migrations.js';
|
import { ModelMigrations } from './mode-migrations.js';
|
||||||
export const models = {};
|
export const models = {};
|
||||||
export const modelsConfig = {};
|
export const modelsConfig = {};
|
||||||
|
export const modelsLocalStorage = {};
|
||||||
|
export const modelsConfigLocalStorage = {};
|
||||||
|
export function migrate(register) {
|
||||||
|
if (register.type == 'indexedDB') {
|
||||||
|
registerModel.register(register);
|
||||||
|
}
|
||||||
|
else if (register.type == 'localStorage') {
|
||||||
|
registerLocalStorage.register(register);
|
||||||
|
}
|
||||||
|
}
|
||||||
export class registerModel {
|
export class registerModel {
|
||||||
static async register(entries) {
|
static async register(entries) {
|
||||||
var _a, _b, _c;
|
var _a, _b, _c;
|
||||||
@@ -122,6 +132,65 @@ export class registerModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class registerLocalStorage {
|
||||||
|
static async register(entries) {
|
||||||
|
const databaseSchema = {
|
||||||
|
databaseName: entries.databaseName,
|
||||||
|
version: entries.version,
|
||||||
|
type: 'localStorage',
|
||||||
|
stores: []
|
||||||
|
};
|
||||||
|
for (const modelClassRepresentations of entries.models) {
|
||||||
|
const ModelName = modelClassRepresentations.getModelName();
|
||||||
|
modelsLocalStorage[ModelName] = modelClassRepresentations;
|
||||||
|
}
|
||||||
|
let index = 0;
|
||||||
|
for (const modelClassRepresentations of entries.models) {
|
||||||
|
const { fields, modelName, attributes, fieldTypes } = LocalStorageModelReader.read(modelClassRepresentations);
|
||||||
|
// const idFieldName = attributes?.primaryKey?.shift()
|
||||||
|
databaseSchema.stores.push({
|
||||||
|
name: modelName,
|
||||||
|
id: {
|
||||||
|
keyPath: modelName,
|
||||||
|
type: FieldType.VARCHAR,
|
||||||
|
autoIncrement: false
|
||||||
|
},
|
||||||
|
attributes: attributes,
|
||||||
|
fields: [],
|
||||||
|
fieldTypes
|
||||||
|
});
|
||||||
|
for (const [fieldName, Field] of Object.entries(fields)) {
|
||||||
|
databaseSchema.stores[index].fields.push({
|
||||||
|
name: fieldName,
|
||||||
|
keyPath: fieldName,
|
||||||
|
options: {
|
||||||
|
unique: false,
|
||||||
|
type: null
|
||||||
|
},
|
||||||
|
className: Field === null || Field === void 0 ? void 0 : Field.fieldName,
|
||||||
|
fieldAttributes: Object.assign({}, Field)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
for (const modelClassRepresentations of entries.models) {
|
||||||
|
const ModelName = modelClassRepresentations.getModelName();
|
||||||
|
const tableSchema = databaseSchema.stores.find((e) => e.name == ModelName);
|
||||||
|
modelClassRepresentations.getDBSchema = () => {
|
||||||
|
return databaseSchema;
|
||||||
|
};
|
||||||
|
modelClassRepresentations.getTableSchema = () => {
|
||||||
|
return tableSchema;
|
||||||
|
};
|
||||||
|
modelsConfigLocalStorage[ModelName] = {
|
||||||
|
DatabaseSchema: databaseSchema,
|
||||||
|
TableSchema: tableSchema
|
||||||
|
};
|
||||||
|
modelsLocalStorage[ModelName] = modelClassRepresentations;
|
||||||
|
}
|
||||||
|
ModelMigrations.migrationsState(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
export class ModelEditor {
|
export class ModelEditor {
|
||||||
static addMethodOneToOneField(foreignKeyField, FieldName, modelName, databaseSchema) {
|
static addMethodOneToOneField(foreignKeyField, FieldName, modelName, databaseSchema) {
|
||||||
const foreignKeyFieldModel = foreignKeyField.model;
|
const foreignKeyFieldModel = foreignKeyField.model;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "13c50fe49",
|
"shortSHA": "ec475c76b",
|
||||||
"SHA": "13c50fe491fdfd6bc7e0d44c3417b2e89ebbfbd8",
|
"SHA": "ec475c76beabb561946c54be10244bdc854900bd",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Eudes Inácio'",
|
"lastCommitAuthor": "'Eudes Inácio'",
|
||||||
"lastCommitTime": "'Mon Feb 6 19:12:25 2023 +0100'",
|
"lastCommitTime": "'Thu Feb 9 11:25:57 2023 +0100'",
|
||||||
"lastCommitMessage": "Peter bug solved 15 min",
|
"lastCommitMessage": "Required fields description added to forms",
|
||||||
"lastCommitNumber": "4750",
|
"lastCommitNumber": "4751",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nYour branch is up to date with 'origin/no_bug_movemente'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: capacitor.config.ts\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/modals/create-process/create-process.page.html\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.html\n\tmodified: src/app/pages/agenda/new-event/new-event.page.scss\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html\n\tmodified: src/app/pages/publications/edit-action/edit-action.page.html\n\tmodified: src/app/pages/publications/new-action/new-action.page.html\n\tmodified: src/app/pages/publications/new-action/new-action.page.scss\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.scss\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/native-notification.service.ts\n\tmodified: src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.html\n\tmodified: src/app/shared/agenda/new-event/new-event.page.html\n\tmodified: src/app/shared/agenda/new-event/new-event.page.scss\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.scss\n\tmodified: src/app/shared/publication/edit-action/edit-action.page.html\n\tmodified: src/app/shared/publication/new-action/new-action.page.html\n\tmodified: src/app/shared/publication/new-action/new-action.page.scss\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.html\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.scss\n\tnew file: src/assets/images/exclamation-mark.png\n\tnew file: src/assets/images/exclamation_mark.svg\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts",
|
"changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 1 and 10 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/home/home.page.html\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/modals/create-process/create-process.page.html\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/models/dailyworktask.model.ts\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.html\n\tmodified: src/app/pages/agenda/new-event/new-event.page.html\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pipes/expediente-task.pipe.ts\n\tnew file: src/app/services/active-tab.service.spec.ts\n\tnew file: src/app/services/active-tab.service.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/agenda/event-list/event-list.page.html\n\tmodified: src/app/shared/agenda/event-list/event-list.page.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.html\n\tmodified: src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html\n\tmodified: src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/header/header.page.ts\n\tmodified: src/plugin/src/connection/indexedDb/connector.d.ts\n\tmodified: src/plugin/src/connection/indexedDb/connector.js\n\tmodified: src/plugin/src/connection/indexedDb/indexedb.d.ts\n\tmodified: src/plugin/src/connection/indexedDb/indexedb.js\n\tmodified: src/plugin/src/connection/intreface.d.ts\n\tmodified: src/plugin/src/connection/worker.js\n\tmodified: src/plugin/src/index.d.ts\n\tmodified: src/plugin/src/index.js\n\tmodified: src/plugin/src/models/model.d.ts\n\tmodified: src/plugin/src/models/model.js\n\tmodified: src/plugin/src/models/model.reader.d.ts\n\tmodified: src/plugin/src/models/model.reader.js\n\tmodified: src/plugin/src/models/register-model.d.ts\n\tmodified: src/plugin/src/models/register-model.js",
|
||||||
"changeAuthor": "eudes.inacio"
|
"changeAuthor": "eudes.inacio"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user