mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' into developer_mobilefirst
This commit is contained in:
@@ -139,6 +139,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'edit-event-to-approve',
|
||||
loadChildren: () => import('./shared/agenda/edit-event-to-approve/edit-event-to-approve.module').then( m => m.EditEventToApprovePageModule)
|
||||
},
|
||||
{
|
||||
path: 'actions-options',
|
||||
loadChildren: () => import('./shared/popover/actions-options/actions-options.module').then( m => m.ActionsOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-action',
|
||||
loadChildren: () => import('./shared/publication/edit-action/edit-action.module').then( m => m.EditActionPageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AuthGuard } from './auth.guard';
|
||||
|
||||
describe('AuthGuard', () => {
|
||||
let guard: AuthGuard;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
guard = TestBed.inject(AuthGuard);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(guard).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuard implements CanActivate {
|
||||
constructor(
|
||||
private router:Router
|
||||
){}
|
||||
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
if(window.location.pathname != '' && !localStorage.getItem('UserData')) {
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthGuard } from '../guards/auth.guard';
|
||||
import { HomeGuard } from '../guards/home.guard';
|
||||
import { GroupMessagesPage } from '../pages/chat/group-messages/group-messages.page';
|
||||
import { MessagesPage } from '../pages/chat/messages/messages.page';
|
||||
@@ -36,6 +37,15 @@ const routes: Routes = [
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path:'expedientes-pr',
|
||||
children: [
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -46,7 +56,8 @@ const routes: Routes = [
|
||||
loadChildren: ()=> import('../pages/events/attachments/attachments.module').then(m => m.AttachmentsPageModule)
|
||||
},
|
||||
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'attendees',
|
||||
@@ -55,7 +66,8 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../pages/events/attendees/attendees.module').then(m => m.AttendeesPageModule)
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'attendees-modal',
|
||||
@@ -64,7 +76,8 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../shared/event/attendee-modal/attendee-modal.module').then(m => m.AttendeeModalPageModule)
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'login',
|
||||
@@ -73,7 +86,8 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../pages/login/login.module').then(m => m.LoginPageModule)
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'agenda',
|
||||
@@ -120,7 +134,8 @@ const routes: Routes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'gabinete-digital',
|
||||
@@ -154,6 +169,45 @@ const routes: Routes = [
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'expedientes-pr',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expedientes-pr.module').then(m => m.ExpedientesPrPageModule),
|
||||
},
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.module').then(m => m.ExpedientePrPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'despachos',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despachos.module').then(m => m.DespachosPageModule),
|
||||
},
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/despachos/despacho/despacho.module').then(m => m.DespachoPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'pedidos',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedidos.module').then(m => m.PedidosPageModule),
|
||||
},
|
||||
{
|
||||
path:':SerialNumber/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/pedidos/pedido/pedido.module').then(m => m.PedidoPageModule),
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path:'event-list',
|
||||
children: [
|
||||
@@ -181,7 +235,9 @@ const routes: Routes = [
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
@@ -190,7 +246,8 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../pages/search/search.module').then(m => m.SearchPageModule)
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'publications',
|
||||
@@ -220,7 +277,8 @@ const routes: Routes = [
|
||||
path: 'request-options',
|
||||
loadChildren: () => import('../shared/popover/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'chat',
|
||||
@@ -264,7 +322,8 @@ const routes: Routes = [
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
path: 'document-detail',
|
||||
@@ -273,14 +332,17 @@ const routes: Routes = [
|
||||
path:'',
|
||||
loadChildren: ()=> import('../modals/document-detail/document-detail.module').then(m => m.DocumentDetailPageModule)
|
||||
},
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
]
|
||||
],
|
||||
canActivate: [AuthGuard]
|
||||
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/home/events',
|
||||
pathMatch: 'full'
|
||||
pathMatch: 'full',
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -29,30 +29,12 @@
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
|
||||
<ion-select class="d-block d-md-none" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select class="d-block" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999863"><b>Muito Urgente</b> (1 dia para a execução da tarefa)</ion-select-option>
|
||||
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
<mat-form-field class="width-100 d-none d-md-block" floatLabel="never" required>
|
||||
<mat-select matInput [(ngModel)]="postData.Priority" >
|
||||
<mat-option value="99999861">
|
||||
Normal
|
||||
</mat-option>
|
||||
<mat-option value="99999862">
|
||||
Urgente
|
||||
</mat-option>
|
||||
<mat-option value="99999863">
|
||||
Muito Urgente
|
||||
</mat-option>
|
||||
<mat-option value="99999864">
|
||||
Urgentíssimo
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -435,6 +435,17 @@ export class CreateProcessPage implements OnInit {
|
||||
"AttachmentList" :null,
|
||||
}
|
||||
}
|
||||
if(this.task.activityInstanceName =='Tarefa de Despacho'){
|
||||
body = {
|
||||
"serialNumber": this.task.serialNumber,
|
||||
"action": "Conhecimento",
|
||||
"ActionTypeId": 92,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": message,
|
||||
},
|
||||
"AttachmentList" :null,
|
||||
}
|
||||
}
|
||||
else{
|
||||
body = {
|
||||
"serialNumber": this.task.serialNumber,
|
||||
|
||||
@@ -1,41 +1,3 @@
|
||||
<ion-menu autoHide="false" side="end" content-id="main-content">
|
||||
<ion-header>
|
||||
<ion-toolbar translucent>
|
||||
<ion-title>Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item (click)="notImplemented()">
|
||||
<ion-icon name="documents" slot="start"></ion-icon>
|
||||
<ion-label>Efectuar Despacho</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="notImplemented()">
|
||||
<ion-icon name="arrow-undo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Parecer</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="notImplemented()">
|
||||
<ion-icon name="arrow-redo" slot="start"></ion-icon>
|
||||
<ion-label>Pedido de Deferimento</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="notImplemented()">
|
||||
<ion-icon name="calendar" slot="start"></ion-icon>
|
||||
<ion-label>Marcar reunião</ion-label>
|
||||
</ion-item>
|
||||
<ion-item (click)="notImplemented()">
|
||||
<ion-icon name="trash" slot="start"></ion-icon>
|
||||
<ion-label>Descartar</ion-label>
|
||||
</ion-item>
|
||||
<ion-item disabled>
|
||||
<ion-icon name="paper-plane" slot="start"></ion-icon>
|
||||
<ion-label>Enviar para pendentes</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-menu>
|
||||
<div class="ion-page " id="main-content">
|
||||
<ion-menu-button></ion-menu-button>
|
||||
</div>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content d-flex height-100">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export class PublicationFolder {
|
||||
ProcessId: number;
|
||||
ProcessId: string;
|
||||
Description: string;
|
||||
Detail: string;
|
||||
DateBegin: string;
|
||||
|
||||
@@ -123,8 +123,8 @@
|
||||
<button class="btn-no-color" *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false">
|
||||
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-up.svg" ></ion-icon>
|
||||
</button>
|
||||
<button class="collaps btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='317px';showCalendar=true">
|
||||
<ion-icon src="assets/images/icons-collaps-down.svg" ></ion-icon>
|
||||
<button class="btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='317px';showCalendar=true">
|
||||
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-down.svg" ></ion-icon>
|
||||
</button >
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
>
|
||||
</app-event-list>
|
||||
|
||||
|
||||
<!-- Edit event to approve -->
|
||||
<app-approve-event class="d-flex flex-column"
|
||||
*ngIf="mobileComponent.showEventToApprove"
|
||||
[class.transparent]="mobileComponent.transparentEventToApprove"
|
||||
@@ -437,6 +437,7 @@
|
||||
*ngIf="mobileComponent.showEditEventToApprove"
|
||||
[taskParticipants]="taskParticipants"
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[saveData] = "eventToaprove.saveData"
|
||||
[serialNumber] = "eventToaprove.serialNumber"
|
||||
[saveData] = "eventToaprove.saveData"
|
||||
(setContact)="setContact($event)"
|
||||
|
||||
@@ -114,7 +114,7 @@ export class AgendaPage implements OnInit {
|
||||
eventsListOficial: Event[];
|
||||
|
||||
// this will make toggle add event and.
|
||||
showEventEditOrOpen: "edit" | "add" | "" = ""
|
||||
showEventEditOrOpen: "edit" | "add" | "" | "eventoToApprove" = ""
|
||||
prEventList: Event[];
|
||||
mdEventList: Event[];
|
||||
|
||||
@@ -232,8 +232,6 @@ export class AgendaPage implements OnInit {
|
||||
this.eventSelectedDate = event.start;
|
||||
this.selectedEventId = event.id;
|
||||
|
||||
// this.viewEventDetail(event.id);
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
|
||||
@@ -1190,11 +1188,11 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
// open component
|
||||
async viewEventDetailDismiss(data){
|
||||
async viewEventDetailDismiss(data) {
|
||||
|
||||
await this.cloneAllmobileComponent()
|
||||
|
||||
if (data.type == 'edit'){
|
||||
if (data.type == 'edit') {
|
||||
|
||||
this.selectedEvent = data.event;
|
||||
this.postEvent = data.event;
|
||||
@@ -1221,7 +1219,6 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
approveEventDismissGoBack() {
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
@@ -1231,30 +1228,39 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
approveEventDismiss({saveData, serialNumber, action}){
|
||||
approveEventDismiss({saveData, serialNumber, action}) {
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
|
||||
if(action == 'Aprovar'){
|
||||
if(action == 'Aprovar') {
|
||||
this.eventToaprove = {
|
||||
back: true,
|
||||
saveData: saveData,
|
||||
serialNumber:serialNumber,
|
||||
action: action,
|
||||
InstanceId: saveData.workflowInstanceDataFields.InstanceId || ""
|
||||
}
|
||||
// this.mobileComponent.showEventList = false;
|
||||
|
||||
this.mobileComponent.transparentEventList = true;
|
||||
this.mobileComponent.showEventToApprove = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.showEventEditOrOpen = "eventoToApprove"
|
||||
}
|
||||
|
||||
closeEventToApprove() {
|
||||
if (this.eventToaprove.back ==true && this.mobileComponent.showEventList ==true) {
|
||||
this.mobileComponent.transparentEventList = false;
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.eventToaprove.back = false;
|
||||
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.mobileComponent.showEventList = true;
|
||||
}
|
||||
else {
|
||||
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.mobileComponent.showEventList = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1269,12 +1275,14 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
EditApproveEventDismiss(){
|
||||
// called from emitters
|
||||
/** @description open component to edit event to approve */
|
||||
EditApproveEventDismiss() {
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showEditEventToApprove = true;
|
||||
}
|
||||
|
||||
async cloneAllmobileComponent(){
|
||||
async cloneAllmobileComponent() {
|
||||
|
||||
this.mobileComponent.showAddNewEvent = false;
|
||||
this.mobileComponent.showEditEvent = false;
|
||||
@@ -1288,7 +1296,7 @@ export class AgendaPage implements OnInit {
|
||||
this.closeEventToApprove();
|
||||
}
|
||||
|
||||
async AproveEventEditEvent(data){
|
||||
async AproveEventEditEvent(data) {
|
||||
this.postEvent =data;
|
||||
this.mobileComponent.transparentEventToApprove= true;
|
||||
this.mobileComponent.showAddNewEvent = true;
|
||||
@@ -1303,11 +1311,11 @@ export class AgendaPage implements OnInit {
|
||||
this.mobileComponent.showAttendees = true;
|
||||
}
|
||||
|
||||
async clearContact(){
|
||||
async clearContact() {
|
||||
this.contacts = [];
|
||||
}
|
||||
|
||||
async setContact(data:EventPerson[]){
|
||||
async setContact(data:EventPerson[]) {
|
||||
this.contacts = data;
|
||||
}
|
||||
|
||||
@@ -1319,7 +1327,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
async GoBackEditOrAdd() {
|
||||
|
||||
if(this.showEventEditOrOpen == "edit"){
|
||||
if(this.showEventEditOrOpen == "edit") {
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
this.mobileComponent.showEditEvent = true;
|
||||
@@ -1327,7 +1335,11 @@ export class AgendaPage implements OnInit {
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
this.mobileComponent.showAddNewEvent = true;
|
||||
} else {
|
||||
} else if(this.showEventEditOrOpen == "eventoToApprove") {
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showEditEventToApprove = true
|
||||
}
|
||||
else {
|
||||
// do Nothings
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,8 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height width-100 flex-grow-1">
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
|
||||
<!-- rows="6" cols="20" -->
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -47,10 +47,12 @@ export class EditEventPage implements OnInit {
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
) {
|
||||
|
||||
|
||||
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
this.caller = this.navParams.get('caller');
|
||||
|
||||
@@ -48,6 +48,7 @@ export class EditEventPage implements OnInit {
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -310,18 +310,35 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
goToExpediente(SerialNumber:any){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
|
||||
}
|
||||
}
|
||||
|
||||
viewExpedientListPage(){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes-pr": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ export class DespachoPage implements OnInit {
|
||||
fulltask: any;
|
||||
eventsList: Event[] = [];
|
||||
serialnumber: string;
|
||||
caller:string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
@@ -58,11 +59,16 @@ export class DespachoPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@@ -88,15 +94,30 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||
} else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
'despachos': true
|
||||
}
|
||||
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pendentes": true,
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||
} else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
'despachos': true
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +138,7 @@ export class DespachoPage implements OnInit {
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
this.fulltask = res;
|
||||
console.log(this.task);
|
||||
@@ -267,6 +289,8 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
async sendExpedienteToPending() {
|
||||
console.log(this.serialnumber);
|
||||
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
@@ -405,7 +429,9 @@ export class DespachoPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<ion-item
|
||||
class="expediente ion-no-padding cursor-pointer"
|
||||
*ngFor = "let task of despachoList; let i = index"
|
||||
(click)="viewExpedientDetail(task.SerialNumber)"
|
||||
(click)="GoToDespacho(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
<div class="item width-100">
|
||||
|
||||
@@ -146,16 +146,8 @@ export class DespachosPage implements OnInit {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
}
|
||||
};
|
||||
|
||||
this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras);
|
||||
|
||||
async GoToDespacho(serialNumber:any) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
docIndex(index: number) {
|
||||
|
||||
+1
-32
@@ -45,7 +45,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
|
||||
constructor(
|
||||
private activateRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachments: AttachmentsService,
|
||||
@@ -59,35 +58,17 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private animationController: AnimationController,
|
||||
) {
|
||||
|
||||
this.activateRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap["params"].SerialNumber) {
|
||||
console.log('HERE');
|
||||
|
||||
return;
|
||||
}
|
||||
console.log(paramMap);
|
||||
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.LoadRelatedEvents(this.serialnumber);
|
||||
});
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.LoadRelatedEvents(this.serialnumber);
|
||||
}
|
||||
@@ -115,7 +96,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('HERE');
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
switch (params["params"].caller) {
|
||||
case 'events':
|
||||
@@ -155,8 +135,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
async LoadTaskDetail(serial: string) {
|
||||
|
||||
this.processes.GetTask(serial).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
@@ -171,11 +149,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
|
||||
//console.log('task', this.task);
|
||||
|
||||
this.fulltask = res;
|
||||
//console.log('GetTask', res);
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
@@ -188,8 +162,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.cc = users.filter(user=>{
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
console.log(users);
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
@@ -201,14 +173,12 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
async LoadRelatedEvents(serial: string) {
|
||||
if (this.eventsList == null) {
|
||||
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
|
||||
console.log(res);
|
||||
res.forEach(att => {
|
||||
if (this.eventsList == null) {
|
||||
this.eventsList = new Array();
|
||||
}
|
||||
this.events.getEvent(att.ParentId).subscribe(event => {
|
||||
this.eventsList.push(event);
|
||||
console.log(this.eventsList);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -217,7 +187,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
viewDocument(){
|
||||
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{
|
||||
console.log(res);
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
|
||||
@@ -38,13 +38,14 @@ export class ExpedientePrPage implements OnInit {
|
||||
fulltask: any;
|
||||
eventsList: Event[];
|
||||
serialnumber: string;
|
||||
caller:string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachments: AttachmentsService,
|
||||
@@ -52,7 +53,6 @@ export class ExpedientePrPage implements OnInit {
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private userAuth: AuthService,
|
||||
@@ -61,10 +61,12 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
) {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -73,7 +75,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.serialnumber);
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')) {
|
||||
return;
|
||||
}
|
||||
@@ -90,15 +92,42 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes-pr": true,
|
||||
if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pendentes": true,
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
switch (params["params"].caller) {
|
||||
case 'events':
|
||||
this.router.navigate(['/home',params["params"].caller]);
|
||||
break;
|
||||
|
||||
case 'gabinete-digital':
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes-pr": true,
|
||||
}
|
||||
}
|
||||
if( window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
@@ -333,13 +362,13 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise();
|
||||
this.toastService.successMessage('Processo descartado')
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
@@ -347,30 +376,24 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
//await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,10 +36,10 @@ export class ExpedientesPrPage implements OnInit {
|
||||
private router: Router,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadList();
|
||||
@@ -47,15 +47,6 @@ export class ExpedientesPrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
openExpedientDetailPage(data){
|
||||
console.log(data);
|
||||
this.openExpedientDetail.emit(data);
|
||||
}
|
||||
|
||||
LoadList(){
|
||||
this.showLoader = true;
|
||||
switch (this.loggeduser.Profile) {
|
||||
@@ -124,13 +115,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
"profile": this.loggeduser.Profile
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr/expediente-pr'], navigationExtras);
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
|
||||
@@ -104,17 +104,11 @@ ion-content{
|
||||
width: 173px;
|
||||
height: 200px;
|
||||
margin: 7px;
|
||||
//margin: 8px;
|
||||
padding: 30px 5px 30px 5px;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
background: white;
|
||||
//border: solid 1px #e9e9e9;
|
||||
/* --background-color: #ffffff !important; */
|
||||
// background-color: #ffffff !important;
|
||||
float: left;
|
||||
//border: 1px solid red;
|
||||
//justify-content: center;
|
||||
}
|
||||
.exp-card-long{
|
||||
cursor: pointer;
|
||||
@@ -125,7 +119,6 @@ ion-content{
|
||||
width: 360px;
|
||||
margin: 7px 20px;
|
||||
border-radius: 15px;
|
||||
// background-color: #ffffff !important;
|
||||
padding: 7px;
|
||||
border: blue !important;
|
||||
|
||||
@@ -229,7 +222,6 @@ ion-content{
|
||||
width: 35%;
|
||||
justify-content: flex-start !important;
|
||||
border-right: 1px solid #d8d8d8;
|
||||
border: 1px solid red;
|
||||
|
||||
.aside{
|
||||
background:transparent;
|
||||
|
||||
@@ -58,14 +58,18 @@ export class PedidoPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
}
|
||||
if(params["caller"]) {
|
||||
this.caller = params["caller"];
|
||||
}
|
||||
});
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -81,12 +81,7 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
|
||||
goToPedido(serialNumber:any){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras);
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
|
||||
@@ -129,78 +129,17 @@ export class PendentesPage implements OnInit {
|
||||
|
||||
async viewTaskDetails(serialNumber:string, workflowName:string) {
|
||||
if(workflowName == 'Despacho'){
|
||||
this.goToDespacho(serialNumber);
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento'){
|
||||
this.goToPedido(serialNumber);
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
else if(workflowName == 'Expediente'){
|
||||
this.goToExpediente(serialNumber);
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
goToDespacho(serialNumber:any){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
"from": "pendentes"
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras);
|
||||
}
|
||||
|
||||
goToPedido(serialNumber:any) {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": serialNumber,
|
||||
"from": "pendentes"
|
||||
}
|
||||
};
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras);
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
|
||||
|
||||
async openDespacho(serialNumber:string){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: DespachoPage,
|
||||
componentProps:{
|
||||
enterAnimation: "",
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log('refresh list');
|
||||
this.LoadList();
|
||||
});
|
||||
}
|
||||
|
||||
async openPedido(serialNumber:string){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: PedidoPage,
|
||||
componentProps:{
|
||||
enterAnimation: "",
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log('refresh list');
|
||||
this.LoadList();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-content class="text-white">
|
||||
<div class="main-wrapper">
|
||||
<div class="wrapper" *ngIf="userLoginPreference != 'pin' && userLoginPreference != 'fingerprint' && !setPint ">
|
||||
<div class="wrapper" *ngIf="!hasSession && !setPin || loginPreference == 'none' && !setPin ">
|
||||
|
||||
<div class="bg-1 d-flex justify-center align-center">
|
||||
<div class="bg-2 d-flex justify-center align-center">
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content height-100" *ngIf="userLoginPreference == 'pin' || setPint">
|
||||
<div class="main-content height-100" *ngIf="setPin || hasSession && loginPreference == 'pin' ">
|
||||
<div class=" align-center justify-center">
|
||||
<div class="div-top-header">
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ion-title *ngIf="!setPint" class="title">Digite o PIN</ion-title>
|
||||
<ion-title *ngIf="setPint" class="title">Digite o novo PIN</ion-title>
|
||||
<ion-title *ngIf="hasPin" class="title">Digite o PIN</ion-title>
|
||||
<ion-title *ngIf="!hasPin" class="title">Digite o novo PIN</ion-title>
|
||||
|
||||
<div class="d-flex pt-25 align-center justify-center">
|
||||
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
||||
@@ -70,11 +70,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="!setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="setPint=false; userLoginPreference='none'">
|
||||
<div *ngIf="hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="enterWithPassword=true">
|
||||
Entrar com senha
|
||||
</div>
|
||||
|
||||
<div *ngIf="setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
<div class="voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User, UserForm } from 'src/app/models/user.model';
|
||||
import { UserForm } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { AlertController, AnimationController, ModalController } from '@ionic/angular';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { PhotoService } from 'src/app/services/photo.service';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import crypto from 'crypto-js'
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
|
||||
//import { Token } from '../../models/token.model';
|
||||
//import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
|
||||
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core';
|
||||
const { PushNotifications } = Plugins;
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -34,43 +21,51 @@ export class LoginPage implements OnInit {
|
||||
userattempt: UserForm;
|
||||
code = []
|
||||
|
||||
setPint = false
|
||||
pin = false
|
||||
hasPin: boolean
|
||||
loginPreference: string
|
||||
hasSession = false
|
||||
setPin = false
|
||||
|
||||
userLoginPreference: any
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private notificatinsservice: NotificationsService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private storageService: StorageService,
|
||||
private toastService: ToastService,
|
||||
private photoService: PhotoService,
|
||||
public alertController: AlertController,
|
||||
private modalController: ModalController,
|
||||
private animationController: AnimationController,
|
||||
|
||||
//private fcm: FCM
|
||||
public alertController: AlertController
|
||||
) {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
this.pin = true
|
||||
|
||||
} else {
|
||||
|
||||
this.userLoginPreference = ''
|
||||
this.setPint = false
|
||||
this.pin = false
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() {
|
||||
|
||||
// App has session
|
||||
if(!localStorage.getItem('UserData')) {
|
||||
this.hasSession = false
|
||||
} else {
|
||||
this.hasSession = true
|
||||
// this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
const loginPreference = userData?.loginPreference
|
||||
const pin = userData?.PIN
|
||||
|
||||
if (pin) {
|
||||
this.hasPin = true
|
||||
} else {
|
||||
this.hasPin = false
|
||||
}
|
||||
|
||||
if (loginPreference) {
|
||||
this.loginPreference = loginPreference
|
||||
|
||||
} else {
|
||||
this.loginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateUsername() {
|
||||
@@ -114,13 +109,14 @@ export class LoginPage implements OnInit {
|
||||
} */
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
async Login() {
|
||||
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()){
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
@@ -128,26 +124,24 @@ export class LoginPage implements OnInit {
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt);
|
||||
console.log(JSON.stringify(attempt));
|
||||
|
||||
if (attempt) {
|
||||
//this.loginRocketChat();
|
||||
this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
this.hasSession = true
|
||||
this.hasPin = false
|
||||
this.setPin = true
|
||||
|
||||
if(!this.pin) {
|
||||
this.setPint = true
|
||||
this.pin = true
|
||||
if(!this.hasPin || this.hasPin) {
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('O nome de utilizador e/ou palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar');
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
}
|
||||
}
|
||||
@@ -158,7 +152,6 @@ export class LoginPage implements OnInit {
|
||||
|
||||
setCode(code: string) {
|
||||
|
||||
|
||||
if(this.code.length < 4) {
|
||||
this.code.push(code)
|
||||
}
|
||||
@@ -168,13 +161,14 @@ export class LoginPage implements OnInit {
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
if(this.setPint) {
|
||||
if(!this.hasPin) {
|
||||
// alert('storePin')
|
||||
this.storePin()
|
||||
} else {
|
||||
// alert('pinLogin')
|
||||
this.pinLogin()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clearCode() {
|
||||
@@ -186,7 +180,13 @@ export class LoginPage implements OnInit {
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
const pin = userData?.PIN
|
||||
|
||||
//if( encrypted == pin) {
|
||||
|
||||
if( encrypted == localStorage.getItem('PIN')) {
|
||||
|
||||
//this.toastService.successMessage()
|
||||
this.router.navigate(['/home/events']);
|
||||
} else {
|
||||
@@ -200,6 +200,12 @@ export class LoginPage implements OnInit {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
let userData: Object = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
userData['PIN'] = encrypted
|
||||
|
||||
|
||||
localStorage.setItem('UserData', JSON.stringify(userData) )
|
||||
|
||||
localStorage.setItem('PIN', encrypted)
|
||||
|
||||
@@ -207,50 +213,4 @@ export class LoginPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo não efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=> {
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.clear();
|
||||
// this.takePicture();
|
||||
}
|
||||
takePicture(){
|
||||
takePicture() {
|
||||
const options: CameraOptions = {
|
||||
quality: 90,
|
||||
destinationType: this.camera.DestinationType.DATA_URL,
|
||||
@@ -178,15 +178,10 @@ export class NewPublicationPage implements OnInit {
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
/* console.log('Create');
|
||||
console.log(this.publication); */
|
||||
this.publications.CreatePublication(this.folderId, this.publication).toPromise();
|
||||
this.close();
|
||||
|
||||
|
||||
try {
|
||||
console.log(this.publication);
|
||||
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
|
||||
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
|
||||
this.close();
|
||||
this.toastService.successMessage("Publicação criado")
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import { NewPublicationPageModule } from 'src/app/shared/publication/new-publica
|
||||
import { NewActionPageModule } from 'src/app/shared/publication/new-action/new-action.module';
|
||||
import { PublicationDetailPageModule } from 'src/app/shared/publication/view-publications/publication-detail/publication-detail.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
@@ -32,6 +33,7 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
NewPublicationPageModule,
|
||||
PublicationDetailPageModule,
|
||||
NewActionPageModule,
|
||||
EditActionPageModule,
|
||||
],
|
||||
declarations: [
|
||||
PublicationsPage,
|
||||
|
||||
@@ -34,17 +34,19 @@
|
||||
<!-- Content -->
|
||||
|
||||
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<div class="item d-flex"
|
||||
*ngFor="let viagem of publicationsTravelFolderList"
|
||||
(click)="goToPublicationsList(viagem.ProcessId)">
|
||||
<div class="item-icon">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<p class="item-content-date my-5">De {{viagem.DateBegin}} a {{viagem.DateEnd}}</p>
|
||||
<p class="item-content-title my-10">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div class="item width-100 d-flex"
|
||||
*ngFor="let viagem of publicationsTravelFolderList">
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5">De {{viagem.DateBegin}} a {{viagem.DateEnd}}</p>
|
||||
<p class="item-content-title my-10">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item width-100 d-flex"
|
||||
*ngFor="let evento of publicationsEventFolderList"
|
||||
@@ -52,12 +54,15 @@
|
||||
<div class="item-icon2">
|
||||
<ion-icon slot="end" src='assets/images/icons-nav-actions.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="item-content">
|
||||
<div class="item-content flex-grow-1">
|
||||
<ion-label>
|
||||
<p class="item-content-date">{{evento.DateBegin}}</p>
|
||||
<p class="item-content-title">{{evento.Description}}</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div (click)="openOptions(evento.ProcessId)" class="item-options d-none cursor-pointer" autoHide="false">
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,7 +75,8 @@
|
||||
desktopComponent.showViewPublication == false &&
|
||||
desktopComponent.showAddNewPublication == false &&
|
||||
desktopComponent.showPublicationDetail == false &&
|
||||
desktopComponent.showAddActions == false
|
||||
desktopComponent.showAddActions == false &&
|
||||
desktopComponent.showEditActions == false
|
||||
)"><div>Nenhuma ação presidencial selecionada</div></div>
|
||||
|
||||
<!-- View Publication -->
|
||||
@@ -116,6 +122,16 @@
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
></app-new-action>
|
||||
|
||||
<app-edit-action
|
||||
*ngIf="desktopComponent.showEditActions"
|
||||
[folderId]="folderId"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
(updateDesktopComponent)="updateDesktopComponent($event)"
|
||||
>
|
||||
</app-edit-action>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -104,44 +104,65 @@ ion-toolbar{
|
||||
width: 100% !important;
|
||||
padding: 0 0px 0 0px !important;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
|
||||
.item-icon{
|
||||
//margin-top: 28px;
|
||||
width: 45px;
|
||||
float: left;
|
||||
font-size: 40px;
|
||||
|
||||
.item-icon ion-icon{
|
||||
color: #061b52;
|
||||
}
|
||||
}
|
||||
.item-icon2{
|
||||
//margin-top: 23px;
|
||||
width: 45px;
|
||||
float: left;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.item-content{
|
||||
width: 100%;
|
||||
padding: 15px 0 15px 10px;
|
||||
overflow: auto;
|
||||
|
||||
p{
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
|
||||
.item-content-date{
|
||||
color: #797979;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-title{
|
||||
color: #0d89d1;
|
||||
font-size: 15px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-detail{
|
||||
color: #000000;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.item-options{
|
||||
|
||||
width: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
.item-icon{
|
||||
margin-top: 28px;
|
||||
width: 45px;
|
||||
float: left;
|
||||
font-size: 40px;
|
||||
}
|
||||
.item-icon2{
|
||||
margin-top: 23px;
|
||||
width: 45px;
|
||||
float: left;
|
||||
font-size: 40px;
|
||||
}
|
||||
.item-icon ion-icon{
|
||||
color: #061b52;
|
||||
}
|
||||
.item-content{
|
||||
float: left;
|
||||
padding: 15px 0 15px 10px;
|
||||
}
|
||||
.item-content-date{
|
||||
color: #797979;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-title{
|
||||
color: #0d89d1;
|
||||
font-size: 15px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-detail{
|
||||
color: #000000;
|
||||
font-size: 13px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -154,4 +175,7 @@ ion-toolbar{
|
||||
.aside-left{
|
||||
width: 35%;
|
||||
}
|
||||
.item-options{
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, PopoverController } from '@ionic/angular';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
@@ -11,6 +11,7 @@ import { Animation, AnimationController } from '@ionic/angular';
|
||||
import { LoadingController } from '@ionic/angular';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -38,7 +39,8 @@ export class PublicationsPage implements OnInit {
|
||||
showViewPublication: false,
|
||||
showAddNewPublication: false,
|
||||
showPublicationDetail: false,
|
||||
showAddActions: false
|
||||
showAddActions: false,
|
||||
showEditActions: false
|
||||
}
|
||||
|
||||
folderId: string;
|
||||
@@ -56,6 +58,7 @@ export class PublicationsPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private loading: LoadingService,
|
||||
private publications: PublicationsService,
|
||||
private popoverController:PopoverController,
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
@@ -264,6 +267,10 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async updateDesktopComponent(e?:any){
|
||||
this.getActions();
|
||||
}
|
||||
|
||||
|
||||
async closeDesktopComponent (xx?: any){
|
||||
|
||||
@@ -272,7 +279,52 @@ export class PublicationsPage implements OnInit {
|
||||
showAddNewPublication: false,
|
||||
showPublicationDetail: false,
|
||||
showAddActions: false,
|
||||
showEditActions: false,
|
||||
}
|
||||
}
|
||||
|
||||
async openOptions(id?: string) {
|
||||
this.folderId = id;
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: ActionsOptionsPage,
|
||||
cssClass: 'model profile-modal search-submodal',
|
||||
componentProps: {
|
||||
id: id,
|
||||
},
|
||||
//translucent: true
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res =>{
|
||||
if(res['data']=='edit'){
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showEditActions = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
getPublicationDetail(){
|
||||
this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{
|
||||
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.item = res;
|
||||
});
|
||||
|
||||
@@ -28,6 +28,8 @@ export class AuthService {
|
||||
public alertController: AlertController,
|
||||
) {
|
||||
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
if (localStorage.getItem("user") != null) {
|
||||
|
||||
@@ -41,55 +41,59 @@ export class EventsService {
|
||||
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if(this.loggeduser){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar =>{
|
||||
if(sharedCalendar.CalendarName == 'Oficial'){
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
else if(sharedCalendar.CalendarName == 'Pessoal'){
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
});
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar =>{
|
||||
if(sharedCalendar.CalendarName == 'Oficial'){
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
else if(sharedCalendar.CalendarName == 'Pessoal'){
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
}
|
||||
|
||||
/* getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
@@ -245,8 +249,6 @@ export class EventsService {
|
||||
getEvent(eventid: string): Observable<Event>{
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
|
||||
|
||||
@@ -244,7 +244,6 @@ export class ProcessesService {
|
||||
}
|
||||
|
||||
GetDocumentDetails(DocId:string, FsId:string){
|
||||
console.log(DocId);
|
||||
|
||||
const geturl = environment.apiURL + 'search/documents';
|
||||
let params = new HttpParams();
|
||||
|
||||
@@ -29,7 +29,7 @@ export class PublicationsService {
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
GetPublicationFolderById(id:any){
|
||||
GetPresidentialAction(id:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+id;
|
||||
|
||||
let options = {
|
||||
@@ -38,6 +38,15 @@ export class PublicationsService {
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
UpdatePresidentialAction(body:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions';
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.put<any>(`${geturl}`, body, options);
|
||||
}
|
||||
|
||||
CreatePublicationFolder(body:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions';
|
||||
let options = {
|
||||
@@ -58,15 +67,11 @@ export class PublicationsService {
|
||||
});
|
||||
}
|
||||
|
||||
DeletePublicationFolderById(id:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("id", id);
|
||||
DeletePresidentialAction(id:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+id;
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.delete<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ export class ApproveEventPage implements OnInit {
|
||||
this.getTask();
|
||||
this.getAttachments();
|
||||
|
||||
// console.log(this.showAside);
|
||||
}
|
||||
|
||||
notImplemented() {
|
||||
@@ -79,7 +78,7 @@ export class ApproveEventPage implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
async approveTask(serialNumber:string){
|
||||
async approveTask(serialNumber:string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
|
||||
try {
|
||||
@@ -101,8 +100,6 @@ export class ApproveEventPage implements OnInit {
|
||||
}); */
|
||||
}
|
||||
|
||||
|
||||
|
||||
async rejectTask(serialNumber:string) {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
@@ -118,12 +115,12 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async getAttachments(){
|
||||
async getAttachments() {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
}
|
||||
|
||||
viewDocument(sourceId){
|
||||
viewDocument(sourceId) {
|
||||
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
|
||||
/* console.log(res); */
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
@@ -143,7 +140,7 @@ export class ApproveEventPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
async emendTask(serialNumber:string){
|
||||
async emendTask(serialNumber:string) {
|
||||
console.log('Desktop');
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
@@ -186,7 +183,7 @@ export class ApproveEventPage implements OnInit {
|
||||
//this.goBack();
|
||||
}
|
||||
|
||||
goToEventsToApprove(){
|
||||
goToEventsToApprove() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
@@ -196,32 +193,10 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
/** @description edit event to aprove */
|
||||
async editar(serialNumber: string) {
|
||||
if(window.innerWidth > 800){
|
||||
console.log('DESTOP');
|
||||
|
||||
this.EditApproveEventDismiss.emit();
|
||||
}
|
||||
else{
|
||||
/* const modal = await this.modalController.create({
|
||||
component: EditEventToApproveComponent,
|
||||
componentProps: {
|
||||
serialNumber: serialNumber,
|
||||
InstanceId:this.InstanceId
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
// backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res => {
|
||||
this.getTask();
|
||||
this.getAttachments();
|
||||
}); */
|
||||
}
|
||||
this.EditApproveEventDismiss.emit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,27 +13,44 @@
|
||||
</div>
|
||||
</ion-header>
|
||||
</div>
|
||||
<ion-item-sliding class="overflow-y-auto">
|
||||
<ion-item-sliding class="overflow-y-auto" >
|
||||
<div class="px-20">
|
||||
<div class="ion-item-container width-100">
|
||||
|
||||
<div class="ion-item-container width-100" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Assunto*" [(ngModel)]="eventProcess.workflowInstanceDataFields.Subject"></ion-input>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Subject').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Subject').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Localização*" [(ngModel)]="eventProcess.workflowInstanceDataFields.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
<!-- <span class="error ion-padding" >
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
@@ -68,6 +85,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('participantes').errors?.required">
|
||||
Adicionar participant.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import * as moment from 'moment';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
@@ -11,6 +11,7 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -41,7 +42,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
@@ -60,8 +60,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
@Input() serialNumber: string
|
||||
|
||||
loadedAttachments: Attachment[]= []
|
||||
|
||||
eventProcess = {
|
||||
@@ -88,20 +86,18 @@ export class EditEventToApprovePage implements OnInit {
|
||||
show = false
|
||||
isRecurring:string;
|
||||
isEventEdited: boolean;
|
||||
segment:string = "true";
|
||||
profile:string;
|
||||
eventAttendees: EventPerson[];
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
Location = ''
|
||||
|
||||
showAttendees = false;
|
||||
|
||||
InstanceId: string
|
||||
InstanceId: string;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||
@Output() clearContact = new EventEmitter<any>();
|
||||
@@ -109,6 +105,11 @@ export class EditEventToApprovePage implements OnInit {
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
@Output() closeComponent = new EventEmitter<any>();
|
||||
|
||||
@Input() saveData: any;
|
||||
@Input() serialNumber: string
|
||||
@Input() taskParticipants: EventPerson[];
|
||||
@Input() taskParticipantsCc: EventPerson[];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventsService: EventsService,
|
||||
@@ -117,64 +118,67 @@ export class EditEventToApprovePage implements OnInit {
|
||||
private processes:ProcessesService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
/* this.serialNumber = this.navParams.get('serialNumber'); */
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if(!this.restoreTemporaryData()){
|
||||
|
||||
if(this.restoreTemporaryData()){
|
||||
this.setOtherData()
|
||||
} else {
|
||||
alert('restore!!')
|
||||
this.getTask();
|
||||
|
||||
}
|
||||
|
||||
this.getTask();
|
||||
|
||||
// console.log(this.serialNumber);
|
||||
}
|
||||
|
||||
async getTask() {
|
||||
// console.log('this.eventProcess', this.eventProcess);
|
||||
|
||||
const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{
|
||||
this.eventProcess = result
|
||||
this.processes.GetTask(this.serialNumber).subscribe( result =>{
|
||||
this.eventProcess = result
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
console.log(this.eventProcess.workflowInstanceDataFields.Subject)
|
||||
this.restoreDatepickerData()
|
||||
|
||||
// description
|
||||
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
|
||||
this.eventProcess.workflowInstanceDataFields.Body = body
|
||||
this.Location = this.eventProcess.workflowInstanceDataFields.Location
|
||||
|
||||
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
|
||||
this.getAttachments()
|
||||
|
||||
if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
else {
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
|
||||
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.setOtherData()
|
||||
|
||||
this.saveTemporaryData()
|
||||
})
|
||||
}
|
||||
|
||||
setOtherData() {
|
||||
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants)
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc)
|
||||
|
||||
if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
else {
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
|
||||
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
|
||||
|
||||
this.getAttachments()
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
@@ -187,11 +191,52 @@ export class EditEventToApprovePage implements OnInit {
|
||||
//this.deleteTemporaryData();
|
||||
}
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.eventProcess.workflowInstanceDataFields.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.eventProcess.workflowInstanceDataFields.Location, [
|
||||
Validators.required,
|
||||
]),
|
||||
//CalendarName: new FormControl(this.postEvent.CalendarName),
|
||||
// Categories: new FormControl(this.postEvent.Categories[0], [
|
||||
// Validators.required
|
||||
// ]),
|
||||
dateStart: new FormControl(this.dateStart, [
|
||||
Validators.required
|
||||
]),
|
||||
dateEnd: new FormControl(this.dateEnd, [
|
||||
Validators.required
|
||||
]),
|
||||
// IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
// Validators.required
|
||||
// ]),
|
||||
participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
save() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
// set dates to eventProcess object
|
||||
this.getDatepickerData()
|
||||
|
||||
this.taskParticipantsCc.forEach(e=>{
|
||||
this.taskParticipantsCc.forEach( e => {
|
||||
e.IsRequired = false
|
||||
})
|
||||
|
||||
@@ -223,7 +268,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
ReviewUserComment: ''
|
||||
}
|
||||
|
||||
console.log(event);
|
||||
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||
this.toastService.successMessage('Evento editado');
|
||||
@@ -231,7 +275,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
this.toastService.badRequest('Evento não editado');
|
||||
})
|
||||
|
||||
|
||||
this.loadedAttachments.forEach((document:any)=>{
|
||||
if(document['action'] == 'add') {
|
||||
delete document.action
|
||||
@@ -251,7 +294,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
})
|
||||
|
||||
|
||||
this.modalController.dismiss();
|
||||
|
||||
}
|
||||
@@ -278,8 +320,8 @@ export class EditEventToApprovePage implements OnInit {
|
||||
// }
|
||||
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
|
||||
this.taskParticipants = taskParticipants;
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
this.taskParticipants = removeDuplicate(taskParticipants) ;
|
||||
this.taskParticipantsCc = removeDuplicate(taskParticipantsCc) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -297,8 +339,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
async addParticipantsCC() {
|
||||
|
||||
//this.saveTemporaryData();
|
||||
|
||||
this.openAttendeesComponent.emit({
|
||||
type: "CC"
|
||||
});
|
||||
@@ -333,7 +373,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async getAttachments() {
|
||||
|
||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
@@ -13,15 +13,27 @@
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="ion-item-container">
|
||||
|
||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Subject').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Subject').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,9 +42,20 @@
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Location').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 width-100 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
@@ -40,7 +63,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field floatLabel="never" class="width-100" >
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100 " >
|
||||
<mat-select placeholder="Selecione agenda*" [(ngModel)]="postEvent.CalendarName" >
|
||||
<mat-option value="Oficial">
|
||||
Oficial
|
||||
@@ -62,7 +85,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field floatLabel="never" class="width-100" required>
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
|
||||
<!-- <input matInput type="text" > -->
|
||||
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Categories[0]" >
|
||||
<mat-option value="Reunião">
|
||||
@@ -91,7 +114,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field floatLabel="never" class="date-hour-picker">
|
||||
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlStart"
|
||||
@@ -119,7 +142,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field floatLabel="never" class="date-hour-picker">
|
||||
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
@@ -147,7 +170,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||
<mat-select placeholder="Selecione repetição*" [(ngModel)]="postEvent.IsRecurring">
|
||||
<mat-option value="false">
|
||||
Não se repete
|
||||
@@ -162,12 +185,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('participantes').errors?.required">
|
||||
Adicionar participant.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" d-flex width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -190,7 +221,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
|
||||
@@ -202,3 +202,9 @@ ion-content{
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.materia-top {
|
||||
padding-top: 7px;
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Component({
|
||||
@@ -20,7 +20,6 @@ import * as moment from 'moment';
|
||||
})
|
||||
export class EditEventPage implements OnInit {
|
||||
|
||||
|
||||
stEvent: Event;
|
||||
isRecurring:string;
|
||||
isEventEdited: boolean;
|
||||
@@ -44,6 +43,9 @@ export class EditEventPage implements OnInit {
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
@Input() taskParticipants: EventPerson[];
|
||||
@Input() taskParticipantsCc: EventPerson[];
|
||||
@Input() profile:string;
|
||||
@@ -86,7 +88,6 @@ export class EditEventPage implements OnInit {
|
||||
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
||||
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventsService: EventsService,
|
||||
@@ -97,11 +98,10 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
if(!this.restoreTemporaryData()){
|
||||
if(!this.restoreTemporaryData()) {
|
||||
// clear
|
||||
|
||||
if(this.postEvent){
|
||||
if(this.postEvent) {
|
||||
if( this.postEvent.Body){
|
||||
if(typeof(this.postEvent.Body.Text) == 'string'){
|
||||
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
@@ -128,7 +128,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
if(this.postEvent.IsRecurring == false){
|
||||
if(this.postEvent.IsRecurring == false) {
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
else{
|
||||
@@ -139,7 +139,6 @@ export class EditEventPage implements OnInit {
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -151,8 +150,49 @@ export class EditEventPage implements OnInit {
|
||||
this.deleteTemporaryData();
|
||||
}
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postEvent.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.postEvent.Location, [
|
||||
Validators.required,
|
||||
]),
|
||||
CalendarName: new FormControl(this.postEvent.CalendarName),
|
||||
Categories: new FormControl(this.postEvent.Categories[0], [
|
||||
Validators.required
|
||||
]),
|
||||
dateStart: new FormControl(this.dateStart, [
|
||||
Validators.required
|
||||
]),
|
||||
dateEnd: new FormControl(this.dateEnd, [
|
||||
Validators.required
|
||||
]),
|
||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async save() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
this.getDatepickerData()
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
@@ -190,7 +230,6 @@ export class EditEventPage implements OnInit {
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
|
||||
async addParticipantsCc() {
|
||||
|
||||
this.saveTemporaryData();
|
||||
@@ -245,7 +284,6 @@ export class EditEventPage implements OnInit {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
deleteTemporaryData(){
|
||||
|
||||
@@ -15,8 +15,8 @@ export class EventListPage implements OnInit {
|
||||
// [desktop] event list to approve
|
||||
|
||||
showLoader: boolean;
|
||||
eventsPRList: any;
|
||||
eventsMDGPRList: any;
|
||||
eventsPRList: any = []
|
||||
eventsMDGPRList: any = []
|
||||
eventPerson: EventPerson;
|
||||
eventBody: EventBody;
|
||||
categories: string[];
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
|
||||
<div class="ion-item-container" [className]="Form?.get('Subject')?.invalid && validateFrom ? 'input-error ion-item-container' : 'ion-item-container' ">
|
||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input type="text" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
|
||||
@@ -35,23 +35,23 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="ion-input-class flex-grow-1 width-100" [className]="Form?.get('Subject')?.invalid && validateFrom ? 'input-error ion-input-class flex-grow-1 width-100' : 'ion-input-class flex-grow-1 width-100' " >
|
||||
<div class="ion-input-class flex-grow-1 width-100" [class.input-error]="Form?.get('Location')?.invalid && validateFrom " >
|
||||
<ion-input type="text" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Location').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Location').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
@@ -150,7 +150,7 @@
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[min]="endMinDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
@@ -190,12 +190,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('participantes').errors?.required">
|
||||
Adicionar participant.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1">
|
||||
<div class="ion-input-class-no-height flex-grow-1" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
@@ -218,7 +226,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1">
|
||||
<div class="ion-input-class-no-height flex-grow-1" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
<div class="list-people">
|
||||
|
||||
<ion-item lines="none">
|
||||
|
||||
@@ -215,3 +215,4 @@
|
||||
.materia-top {
|
||||
padding-top: 7px;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export class NewEventPage implements OnInit {
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date();
|
||||
public maxDate = '';
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
@@ -94,7 +94,7 @@ export class NewEventPage implements OnInit {
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
Form: any = {}
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
|
||||
@@ -125,11 +125,8 @@ export class NewEventPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private userService: AuthService,
|
||||
private http: HttpClient,
|
||||
private zone: NgZone,
|
||||
private dateAdapter: DateAdapter<any>,
|
||||
// private translate: TranslateService
|
||||
) {
|
||||
@@ -212,7 +209,6 @@ export class NewEventPage implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
@@ -237,7 +233,7 @@ export class NewEventPage implements OnInit {
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postEvent.Subject, [
|
||||
Validators.required,
|
||||
Validators.minLength(4)
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.postEvent.Location, [
|
||||
Validators.required,
|
||||
@@ -255,16 +251,13 @@ export class NewEventPage implements OnInit {
|
||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.participantes, [
|
||||
participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
get participantes() {
|
||||
return this.taskParticipantsCc.concat(this.taskParticipants)
|
||||
}
|
||||
|
||||
openInicio() {
|
||||
let input: any = document.querySelector('#new-inicio')
|
||||
@@ -327,10 +320,10 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
async save() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
// dont runt this function
|
||||
// if (!this.Form.valid) return false
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
this.getDatepickerData()
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ModalController } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendee-modal',
|
||||
templateUrl: './attendee-modal.page.html',
|
||||
@@ -35,17 +36,15 @@ export class AttendeePage implements OnInit {
|
||||
private modalCtrl: ModalController,
|
||||
private contactsService: ContactsService ) {
|
||||
|
||||
this.LtaskParticipants = this.taskParticipants;
|
||||
this.LtaskParticipantsCc = this.taskParticipantsCc;
|
||||
|
||||
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
}
|
||||
|
||||
ngOnChanges(){
|
||||
this.LtaskParticipants = this.taskParticipants;
|
||||
this.LtaskParticipantsCc = this.taskParticipantsCc;
|
||||
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
}
|
||||
|
||||
|
||||
currentPath = window.location.pathname;
|
||||
@Input() adding: "intervenient" | "CC";
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
// Edit event to approve
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex " (click)="close()">
|
||||
<!-- <div class="d-flex " (click)="close()">
|
||||
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div >
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="email">{{loggeduser.Email}}</div>
|
||||
</div>
|
||||
|
||||
<div class="login-preference">
|
||||
<div class="login-preference" (mouseover)="checkState()" (click)="checkState()">
|
||||
<div class="preference">Preferência Login</div>
|
||||
|
||||
<ion-row>
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class=" footer-container ion-no-border bg-blue">
|
||||
<!-- <ion-footer class=" footer-container ion-no-border bg-blue">
|
||||
|
||||
<div class="d-flex justify-space-between">
|
||||
|
||||
@@ -80,4 +80,4 @@
|
||||
</ion-buttons>
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
</ion-footer> -->
|
||||
@@ -14,6 +14,7 @@ import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
export class ProfileComponent implements OnInit {
|
||||
|
||||
loggeduser: User;
|
||||
userLoginPreference: boolean
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private authService: AuthService,
|
||||
@@ -23,6 +24,8 @@ export class ProfileComponent implements OnInit {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
console.log(this.loggeduser.RoleDescription)
|
||||
|
||||
this.checkState()
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
@@ -130,15 +133,14 @@ export class ProfileComponent implements OnInit {
|
||||
localStorage.setItem('UserData', JSON.stringify(userData) )
|
||||
}
|
||||
|
||||
get userLoginPreference() {
|
||||
checkState() {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
console.log( userData.loginPreference)
|
||||
return userData.loginPreference
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
return false
|
||||
this.userLoginPreference = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ActionsOptionsPage } from './actions-options.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ActionsOptionsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ActionsOptionsPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ActionsOptionsPageRoutingModule } from './actions-options-routing.module';
|
||||
|
||||
import { ActionsOptionsPage } from './actions-options.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ActionsOptionsPageRoutingModule
|
||||
],
|
||||
declarations: [ActionsOptionsPage]
|
||||
})
|
||||
export class ActionsOptionsPageModule {}
|
||||
@@ -0,0 +1,14 @@
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right" (click)="close()">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<button (click)="editAction()" class="btn-cancel" shape="round" >Editar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="deleteAction()" class="btn-delete" shape="round" >Eliminar</button>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,59 @@
|
||||
.container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.arrow-right {
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon {
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.solid {
|
||||
display: none;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
.btn-ok, .btn-cancel{
|
||||
//width: 50% !important;
|
||||
margin-bottom: 5px !important;
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
.btn-cancel:hover, .btn-delete:hover{
|
||||
color: #ffffff !important;
|
||||
background-color: #42b9fe;
|
||||
}
|
||||
@media only screen and (max-width: 800px) {
|
||||
.btn-ok, .btn-cancel, .btn-delete{
|
||||
width: 47% !important;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-delete, .btn-ok{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
.solid{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ActionsOptionsPage } from './actions-options.page';
|
||||
|
||||
describe('ActionsOptionsPage', () => {
|
||||
let component: ActionsOptionsPage;
|
||||
let fixture: ComponentFixture<ActionsOptionsPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActionsOptionsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ActionsOptionsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-actions-options',
|
||||
templateUrl: './actions-options.page.html',
|
||||
styleUrls: ['./actions-options.page.scss'],
|
||||
})
|
||||
export class ActionsOptionsPage implements OnInit {
|
||||
|
||||
id:string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private publicationsService: PublicationsService,
|
||||
) {
|
||||
this.id = this.navParams.get('id');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
close () {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
editAction(){
|
||||
this.modalController.dismiss('edit');
|
||||
}
|
||||
|
||||
deleteAction(){
|
||||
this.publicationsService.DeletePresidentialAction(this.id).toPromise();
|
||||
this.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
@@ -19,8 +19,8 @@
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
@@ -28,8 +28,8 @@
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||
<button (click)="openAddNoteModal('Arquivar')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -30,46 +20,27 @@ export class DespachosOptionsPage implements OnInit {
|
||||
task: any;
|
||||
fulltask: any;
|
||||
serialnumber: string;
|
||||
profile: string
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private animationController: AnimationController,
|
||||
private navParams: NavParams,
|
||||
private toastService: ToastService) {
|
||||
|
||||
this.task = this.navParams.get('task')
|
||||
this.fulltask = this.navParams.get('fulltask')
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close () {
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
async openTaskProcessModal(taskAction: any, task: any) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
@@ -82,25 +53,18 @@ export class DespachosOptionsPage implements OnInit {
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: task,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']=='openDiscart'){
|
||||
console.log('open discart');
|
||||
|
||||
this.distartExpedientModal();
|
||||
|
||||
}
|
||||
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
this.popoverController.dismiss();
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
});
|
||||
@@ -124,11 +88,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
this.close();
|
||||
/* console.log('2Expedient Discard closed2');
|
||||
this.close();
|
||||
this.openMenu(); */
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -154,6 +114,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
this.popoverController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
@@ -169,7 +130,9 @@ export class DespachosOptionsPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any){
|
||||
@@ -310,18 +273,8 @@ export class DespachosOptionsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
goBack() {
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
// "despachospr": true,
|
||||
}
|
||||
}
|
||||
|
||||
this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
|
||||
|
||||
// window.history.back()
|
||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
</div>
|
||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-ok" shape="round" >Marcar para Despacho</button>
|
||||
<button (click)="distartExpedientModal(fulltask)" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
|
||||
@@ -33,6 +33,8 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
profile: string;
|
||||
|
||||
showEnviarPendentes = false;
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
@@ -53,18 +55,21 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
console.log(params["serialNumber"]);
|
||||
}
|
||||
});
|
||||
this.profile = "mdgpr";
|
||||
if(this.task.Status != 'Pending'){
|
||||
this.showEnviarPendentes = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
if( window.innerWidth <= 1024){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
@@ -112,6 +117,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
async approve(note:string, documents:any){
|
||||
this.popoverController.dismiss();
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Aprovar",
|
||||
@@ -131,15 +137,11 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async distartExpedientModal(body:any) {
|
||||
async distartExpedientModal(body:any){
|
||||
this.popoverController.dismiss();
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
@@ -148,42 +150,53 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']== 'Yes'){
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.goBack();
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
let otherbody = {
|
||||
"serialNumber": body.serialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//Volta na lista principal
|
||||
this.goBack();
|
||||
this.modalController.dismiss();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,6 +222,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.popoverController.dismiss();
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
@@ -270,16 +284,6 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
if( window.innerWidth <= 1024) {
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
goBack() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" full class="btn-ok" shape="round" >Pedido de Parecer</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" full class="btn-ok" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="openBookMeetingModal()" full class="btn-ok" shape="round" >Marcar reunião</button>
|
||||
<button (click)="distartExpedientModal()" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<button (click)="distartExpedientModal('descartar')" full class="btn-ok" shape="round" >Descartar</button>
|
||||
<button (click)="sendExpedienteToPending()" full class="btn-ok" shape="round" *ngIf="showEnviarPendentes" >Enviar para pendentes</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-opts-expediente',
|
||||
@@ -14,6 +16,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
task:any;
|
||||
fulltask: any;
|
||||
profile:string;
|
||||
caller:string;
|
||||
|
||||
showEnviarPendentes = false
|
||||
|
||||
@@ -22,20 +25,19 @@ export class OptsExpedientePage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private processes: ProcessesService,
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
|
||||
this.showEnviarPendentes = this.navParams.get('showEnviarPendentes');
|
||||
|
||||
if(!this.showEnviarPendentes) this.showEnviarPendentes = false
|
||||
|
||||
if(this.task.Status != 'Pending'){
|
||||
this.showEnviarPendentes = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.task);
|
||||
this.profile = "mdgpr";
|
||||
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth >= 800){
|
||||
this.popoverController.dismiss();
|
||||
@@ -52,10 +54,50 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
goBack() {
|
||||
if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"pendentes": true,
|
||||
}
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
switch (params["params"].caller) {
|
||||
case 'events':
|
||||
this.router.navigate(['/home',params["params"].caller]);
|
||||
break;
|
||||
|
||||
case 'gabinete-digital':
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes": true,
|
||||
}
|
||||
}
|
||||
if( window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sendExpedienteToPending() {
|
||||
this.close();
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,45 +134,82 @@ export class OptsExpedientePage implements OnInit {
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: task,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']=='openDiscart'){
|
||||
console.log('open discart');
|
||||
|
||||
this.distartExpedientModal();
|
||||
|
||||
let body = res['data'];
|
||||
if(res['data']){
|
||||
console.log('open discart')
|
||||
this.distartExpedientModal(body);
|
||||
}
|
||||
else{
|
||||
console.log('Not open');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
this.close();
|
||||
async distartExpedientModal(body:any){
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
this.close();
|
||||
/* console.log('2Expedient Discard closed2');
|
||||
this.close();
|
||||
this.openMenu(); */
|
||||
}
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
console.log(res['data']);
|
||||
|
||||
if(body == 'descartar'){
|
||||
if(res['data']== 'Yes'){
|
||||
let otherbody = {
|
||||
"serialNumber": this.task.SerialNumber,
|
||||
"action": "Passivo",
|
||||
"ActionTypeId": 99999877,
|
||||
"dataFields": {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditActionPage } from './edit-action.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EditActionPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EditActionPageRoutingModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditActionPageRoutingModule } from './edit-action-routing.module';
|
||||
|
||||
import { EditActionPage } from './edit-action.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EditActionPageRoutingModule
|
||||
],
|
||||
exports: [EditActionPage],
|
||||
declarations: [EditActionPage]
|
||||
})
|
||||
export class EditActionPageModule {}
|
||||
@@ -0,0 +1,95 @@
|
||||
<ion-header class="ion-no-border pt-20 px-20">
|
||||
<div class="title-content d-flex align-center justify-space-between ">
|
||||
<div class="div-title">
|
||||
<ion-label class="title"> Editar acção presidencial</ion-label>
|
||||
</div>
|
||||
<!-- <div class="actionType">
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="Viagem">
|
||||
<ion-label>Viagem</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="Evento">
|
||||
<ion-label>Evento</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="content-container">
|
||||
|
||||
<div class="ion-item-container">
|
||||
<ion-input [(ngModel)]="folder.Description" placeholder="Assunto" ></ion-input>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex ">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-datetime
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
placeholder="Início"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class d-flex flex-grow-1">
|
||||
<ion-datetime
|
||||
class="flex-grow-1"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
placeholder="Fim"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022">
|
||||
</ion-datetime>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class flex-grow-1">
|
||||
<ion-textarea [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar width-100 justify-space-between d-flex px-20">
|
||||
<ion-buttons slot="start">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,127 @@
|
||||
:host{
|
||||
background: #fff;
|
||||
}
|
||||
ion-content{
|
||||
--background: transparent;
|
||||
transform: translate3d(0, 5px, 0);
|
||||
--border-radius: 30px;
|
||||
}
|
||||
ion-footer{
|
||||
background: #fff;
|
||||
}
|
||||
ion-toolbar{
|
||||
/* --background:#0782c9; */
|
||||
border-width: 0 !important;
|
||||
}
|
||||
.div-top-header{
|
||||
margin: 0 auto;
|
||||
background-color: #0782c9;
|
||||
overflow: auto;
|
||||
padding-top: 15px;
|
||||
border: 0!important;
|
||||
}
|
||||
.div-search{
|
||||
font-size: 45px;
|
||||
float: left;
|
||||
margin: 0 0 0 10px
|
||||
}
|
||||
.div-logo{
|
||||
background: transparent;
|
||||
width: 140px;
|
||||
margin: 5px 0 0px 71px;
|
||||
float: left;
|
||||
}
|
||||
.div-logo img{
|
||||
width: 100%;
|
||||
}
|
||||
.div-profile{
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.content-top{
|
||||
background: #f3f2f2;
|
||||
height: 20px;
|
||||
margin: 0 auto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
}
|
||||
.content-container{
|
||||
width: 100%;
|
||||
margin:0 auto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background: #ffffff;
|
||||
height: 100%;
|
||||
padding: 25px 20px 0 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.div-title{
|
||||
width: fit-content;
|
||||
float: left;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-container{
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.ion-item-container-no-border{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
.ion-input-class{
|
||||
height: auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
}
|
||||
.ion-textarea-class{
|
||||
width: 315px;
|
||||
height: auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
}
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.actionType{
|
||||
float: right;
|
||||
overflow: auto;
|
||||
border-radius: 30px;
|
||||
}
|
||||
.ion-segment{
|
||||
--background: #0782c9;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditActionPage } from './edit-action.page';
|
||||
|
||||
describe('EditActionPage', () => {
|
||||
let component: EditActionPage;
|
||||
let fixture: ComponentFixture<EditActionPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditActionPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditActionPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-action',
|
||||
templateUrl: './edit-action.page.html',
|
||||
styleUrls: ['./edit-action.page.scss'],
|
||||
})
|
||||
export class EditActionPage implements OnInit {
|
||||
|
||||
folder: PublicationFolder;
|
||||
@Input() folderId: string;
|
||||
@Output() closeDesktopComponent= new EventEmitter<any>();
|
||||
@Output() updateDesktopComponent= new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private publicationsService: PublicationsService,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getPublicationDetail();
|
||||
}
|
||||
|
||||
close(){
|
||||
this.closeDesktopComponent.emit();
|
||||
}
|
||||
|
||||
getPublicationDetail(){
|
||||
this.publicationsService.GetPresidentialAction(this.folderId).subscribe(res=>{
|
||||
this.folder = res;
|
||||
});
|
||||
}
|
||||
|
||||
async save(){
|
||||
let body = {
|
||||
ProcessId: this.folderId,
|
||||
Description: this.folder.Description,
|
||||
Detail: this.folder.Detail,
|
||||
DateBegin: this.folder.DateBegin,
|
||||
DateEnd: this.folder.DateEnd,
|
||||
ActionType: this.folder.ActionType,
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
|
||||
this.close();
|
||||
this.updateDesktopComponent.emit();
|
||||
this.toastService.successMessage('Acção presidencial atualizada')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{
|
||||
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.item = res;
|
||||
});
|
||||
|
||||
@@ -996,3 +996,20 @@ background: rgb(92, 92, 92);
|
||||
margin-bottom: 10px;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
|
||||
.mat-selected {
|
||||
background-color: #87cefa !important;
|
||||
span {
|
||||
color: white !important;
|
||||
}
|
||||
}
|
||||
|
||||
ngx-mat-datetime-content{
|
||||
.actions {
|
||||
.mat-button-disabled {
|
||||
background-color: #ff5a5a59 !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user