mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add permission logic to nav bar.
This commit is contained in:
@@ -6,7 +6,7 @@ import { ProcessesService } from '../services/processes.service';
|
||||
import { DespachoStore } from '../store/despacho-store.service';
|
||||
import { LoaderService } from 'src/app/store/loader.service'
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { PermissionService } from '../services/permission.service';
|
||||
import { SortService } from '../services/functions/sort.service';
|
||||
|
||||
@Injectable({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { PermissionService } from '../services/permission.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -22,10 +22,10 @@ export class PedidoService {
|
||||
|
||||
createDeferimento(body: any) {
|
||||
|
||||
if(this.p.userRole(['PR'])) {
|
||||
if(this.p.userRole(['PR'])) {
|
||||
throw('PR cant create Deferimento')
|
||||
}
|
||||
|
||||
|
||||
return this.processes.postDeferimento(body)
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ export class PedidoService {
|
||||
}
|
||||
|
||||
arquivar({note = "", serialNumber, documents= [] }) {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<ion-tabs class="tab">
|
||||
<ion-tab-bar class="bottoms" slot="bottom">
|
||||
|
||||
|
||||
<ion-tab-button tab="events" [class.active]="pathname === '/home/events'">
|
||||
<!-- <ion-icon name="home"></ion-icon> -->
|
||||
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||
@@ -11,17 +10,14 @@
|
||||
<ion-label>Início</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<div *ngFor="let permission of user.UserPermissions">
|
||||
<ion-tab-button *ngIf="permission == 530" tab="agenda" [class.active]="pathname === '/home/agenda' ">
|
||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda])" tab="agenda" [class.active]="pathname === '/home/agenda' ">
|
||||
<!-- <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="pathname == '/home/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-tab-button>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let permission of user.UserPermissions">
|
||||
<ion-tab-button *ngIf="permission == 531" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
|
||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete])" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
|
||||
<!-- <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="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
|
||||
@@ -29,23 +25,18 @@
|
||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge> -->
|
||||
<ion-label>Gabinete</ion-label>
|
||||
</ion-tab-button>
|
||||
</div>
|
||||
<div *ngFor="let permission of user.UserPermissions">
|
||||
<ion-tab-button *ngIf="permission == 534" tab="publications" [class.active]="pathname === '/home/publications' ">
|
||||
|
||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions])" tab="publications" [class.active]="pathname === '/home/publications' ">
|
||||
<ion-icon *ngIf="pathname != '/home/publications'" 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-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
|
||||
</ion-tab-button>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let permission of user.UserPermissions">
|
||||
<ion-tab-button *ngIf="permission == 541" tab="chat" [class.active]="pathname === '/home/chat' ">
|
||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions])" tab="chat" [class.active]="pathname === '/home/chat' ">
|
||||
<ion-icon *ngIf="pathname != '/home/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-label>Chat</ion-label>
|
||||
</ion-tab-button>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-tab-bar>
|
||||
</ion-tabs>
|
||||
|
||||
@@ -16,7 +16,7 @@ import { StorageService } from '../services/storage.service';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
/* import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service'; */
|
||||
import { DocumentCounterService } from '../services/worker/document-counter.service';
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { PermissionService } from '../services/permission.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
@@ -31,6 +31,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { NativeNotificationService } from 'src/app/services/native-notification.service';
|
||||
import { UserSession } from '../models/user.model';
|
||||
import { PermissionList } from '../models/permissionList';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -81,6 +82,7 @@ export class HomePage implements OnInit {
|
||||
status: string = "";
|
||||
audioName: string = "";
|
||||
public user: UserSession;
|
||||
permissionList = new PermissionList();
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -104,7 +106,8 @@ export class HomePage implements OnInit {
|
||||
private sqliteservice: SqliteService,
|
||||
public RouteService: RouteService,
|
||||
private WsChatService: WsChatService,
|
||||
private NativeNotificationService: NativeNotificationService) {
|
||||
private NativeNotificationService: NativeNotificationService,
|
||||
) {
|
||||
|
||||
if (SessionStore.exist) {
|
||||
this.user = SessionStore.user;
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service'
|
||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from '../view-document/view-document.page';
|
||||
@@ -132,7 +132,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewDocumentModal() {
|
||||
|
||||
|
||||
const selectedDoc = this.LoadedDocument.Documents[ this.dicIndex]
|
||||
|
||||
let task = {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export class PermissionList{
|
||||
Agenda = 530;
|
||||
Gabinete = 531;
|
||||
Actions = 534;
|
||||
Chat = 541;
|
||||
}
|
||||
@@ -2,12 +2,12 @@ export class UserForm {
|
||||
username: string;
|
||||
password: string;
|
||||
domainName: string;
|
||||
BasicAuthKey: string;
|
||||
BasicAuthKey: string;
|
||||
}
|
||||
|
||||
|
||||
export class LoginUserRespose {
|
||||
BasicAuthKey: string;
|
||||
BasicAuthKey: string;
|
||||
UserId: number;
|
||||
Authorization: string;
|
||||
Email: string
|
||||
@@ -30,11 +30,12 @@ export class LoginUserRespose {
|
||||
}[]
|
||||
UserName: string
|
||||
Profile: any;
|
||||
UserPermissions: any;
|
||||
}
|
||||
|
||||
|
||||
export class UserSession {
|
||||
BasicAuthKey: string;
|
||||
BasicAuthKey: string;
|
||||
UserId: number;
|
||||
Authorization: string;
|
||||
Email: string
|
||||
@@ -63,5 +64,6 @@ export class UserSession {
|
||||
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
||||
PIN: string
|
||||
Inactivity: boolean
|
||||
UrlBeforeInactivity: string
|
||||
}
|
||||
UrlBeforeInactivity: string;
|
||||
UserPermissions: any;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { Location } from '@angular/common'
|
||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
@@ -359,8 +359,8 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reencaminhar",
|
||||
"ActionTypeId": 99999839,
|
||||
"dataFields": {
|
||||
|
||||
+6
-6
@@ -22,7 +22,7 @@ import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||
import { TaskService } from 'src/app/Rules/task.service';
|
||||
import { DocumentViewerPage } from 'src/app/modals/document-viewer/document-viewer.page';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
@@ -165,7 +165,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.onlinecheck = false;
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
console.log("expedient ditail", process)
|
||||
|
||||
|
||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||
var origina
|
||||
if (process[0].originator === "undefined") {
|
||||
@@ -173,7 +173,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
} else {
|
||||
origina = JSON.parse(process[0].originator)
|
||||
}
|
||||
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": workflow.Subject,
|
||||
@@ -191,7 +191,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||
"InstanceID": workflow.InstanceID
|
||||
}
|
||||
|
||||
|
||||
this.fulltask = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
@@ -209,11 +209,11 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName,
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="main-content d-flex height-100 border-t-radius">
|
||||
|
||||
<!-- Aside left -->
|
||||
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||
<div *ngIf="p.per([permission.Agenda])" class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
|
||||
@@ -22,7 +22,7 @@ import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
//import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
|
||||
@@ -115,6 +115,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
customTaskPipe = new CustomTaskPipe()
|
||||
|
||||
permissions = {
|
||||
Agenda: 530
|
||||
}
|
||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
||||
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
||||
@@ -256,7 +259,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
@@ -274,11 +277,11 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList);
|
||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
} else {
|
||||
@@ -287,9 +290,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
|
||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": workflowInstanceDataFields.Subject,
|
||||
@@ -306,11 +309,11 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
"Agenda": workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||
|
||||
|
||||
});
|
||||
console.log("All process from db ", allprocess)
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PermissionService } from './worker/permission.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
|
||||
describe('PermissionService', () => {
|
||||
let service: PermissionService;
|
||||
|
||||
+19
-5
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SessionStore } from '../../store/session.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -15,12 +15,26 @@ export class PermissionService {
|
||||
if(!Array.isArray(args)) {
|
||||
args = [args]
|
||||
}
|
||||
|
||||
return args.includes(this.SessionStore.user.Profile)
|
||||
|
||||
return args.includes(this.SessionStore.user.Profile)
|
||||
}
|
||||
|
||||
userPermission(args) {
|
||||
|
||||
if(!Array.isArray(args)) {
|
||||
args = [args]
|
||||
}
|
||||
for(let permission of this.SessionStore.user.UserPermissions){
|
||||
if (args.includes(permission)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
role(args: any) {
|
||||
|
||||
|
||||
let UserRoleIsValid = this.userRole(args)
|
||||
|
||||
return {
|
||||
@@ -39,4 +53,4 @@ export class PermissionService {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AttachmentsService } from '../attachments.service';
|
||||
import { EventsService } from '../events.service';
|
||||
import { PermissionService } from '../worker/permission.service';
|
||||
import { PermissionService } from '../permission.service';
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export class EventService {
|
||||
|
||||
|
||||
create({body, calendar}) {
|
||||
|
||||
|
||||
|
||||
if(this.p.userRole(['PR'])) {
|
||||
return this.eventService.postEventPr(body, calendar)
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<span>Início</span>
|
||||
</div>
|
||||
|
||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
||||
<div *ngIf="p.userPermission([permissionList.Agenda])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
||||
[class.active]="locationPathname() == '/home/agenda'">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " 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>
|
||||
@@ -85,7 +85,7 @@
|
||||
<span>Agenda</span>
|
||||
</div>
|
||||
|
||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
||||
<div *ngIf="p.userPermission([permissionList.Gabinete])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
||||
[class.active]="locationPathname() == '/home/gabinete-digital'">
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
|
||||
@@ -94,7 +94,7 @@
|
||||
<span>Gabinete</span>
|
||||
</div>
|
||||
|
||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
||||
<div *ngIf="p.userPermission([permissionList.Actions])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
||||
[class.active]="locationPathname() == '/home/publications'">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " 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>
|
||||
@@ -102,7 +102,7 @@
|
||||
<span>Acções</span>
|
||||
</div>
|
||||
|
||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
||||
<div *ngIf="p.userPermission([permissionList.Chat])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
||||
[class.active]="locationPathname() == '/home/chat'">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " 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>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { EventTrigger } from '../../services/eventTrigger.service';
|
||||
import { ThemeService } from '../../services/theme.service';
|
||||
import { interval } from 'rxjs';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionList } from 'src/app/models/permissionList';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
@@ -29,6 +30,7 @@ export class HeaderPage implements OnInit {
|
||||
notificationLength: 0;
|
||||
SessionStore = SessionStore
|
||||
check: boolean;
|
||||
permissionList = new PermissionList();
|
||||
|
||||
production = environment.production
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Location } from '@angular/common'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
@@ -35,7 +35,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
public p: PermissionService,
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
) {
|
||||
) {
|
||||
this.task = this.navParams.get('task')
|
||||
this.fulltask = this.navParams.get('fulltask')
|
||||
|
||||
@@ -84,7 +84,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async distartExpedientModal(){
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
@@ -98,7 +98,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
@@ -127,7 +127,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
@@ -157,8 +157,8 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reencaminhar",
|
||||
"ActionTypeId": 99999839,
|
||||
"dataFields": {
|
||||
@@ -198,20 +198,20 @@ export class DespachosOptionsPage implements OnInit {
|
||||
cssClass: classs,
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res);
|
||||
if(res.data) {
|
||||
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
@@ -235,11 +235,11 @@ export class DespachosOptionsPage implements OnInit {
|
||||
this.goBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
@@ -259,14 +259,14 @@ export class DespachosOptionsPage implements OnInit {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async executado(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
@@ -290,10 +290,10 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async reexecutar(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reexecutar",
|
||||
"ActionTypeId": 100000010,
|
||||
"dataFields": {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@@ -36,11 +36,11 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
@@ -86,7 +86,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
console.log(res['data']);
|
||||
if(res['data']=='openDiscart') {
|
||||
console.log('open discart');
|
||||
|
||||
|
||||
this.distartExpedientModal();
|
||||
|
||||
} else {
|
||||
@@ -108,7 +108,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async distartExpedientModal() {
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
@@ -122,7 +122,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
@@ -132,7 +132,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
this.openMenu(); */
|
||||
}
|
||||
this.popoverController.dismiss('close')
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
modal.onDidDismiss()
|
||||
|
||||
}
|
||||
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
@@ -187,8 +187,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reencaminhar",
|
||||
"ActionTypeId": 99999839,
|
||||
"dataFields": {
|
||||
@@ -227,22 +227,22 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
cssClass: classs,
|
||||
backdropDismiss: true
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
|
||||
|
||||
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
let docs = {
|
||||
ProcessInstanceID: "",
|
||||
Attachments: DocumentToSave,
|
||||
@@ -259,15 +259,15 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
else if(actionName == 'Reexecução') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
}
|
||||
else if(actionName == 'Concluido') {
|
||||
await this.concluir(res.data.note, docs);
|
||||
}
|
||||
|
||||
|
||||
this.goBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async concluir(note:string, documents:any){
|
||||
@@ -297,8 +297,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Arquivo",
|
||||
"ActionTypeId": 95,
|
||||
"dataFields": {
|
||||
@@ -323,8 +323,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
|
||||
|
||||
async executado(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 104,
|
||||
"dataFields": {
|
||||
@@ -347,10 +347,10 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async reexecutar(note:string, documents:any){
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reexecutar",
|
||||
"ActionTypeId": 100000010,
|
||||
"dataFields": {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { TaskService } from 'src/app/Rules/task.service'
|
||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-details-documents-options',
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { TaskService } from 'src/app/Rules/task.service'
|
||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {PopoverController } from '@ionic/angular';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-searched-document-options',
|
||||
|
||||
Reference in New Issue
Block a user