mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' into developer_mobilefirst
This commit is contained in:
@@ -423,8 +423,9 @@
|
||||
[class.transparent]="mobileComponent.transparentEventToApprove"
|
||||
[serialNumber] = "eventToaprove.serialNumber"
|
||||
[InstanceId] = "eventToaprove.InstanceId"
|
||||
[saveData] = "eventToaprove.saveData"
|
||||
(cloneAllmobileComponent)="viewEventDetailDismiss($event)"
|
||||
(closeEventToApprove)="closeEventToApprove()"
|
||||
(closeEventToApprove)="closeEventToApproveGoBack()"
|
||||
(AproveEventEditEvent)="AproveEventEditEvent($event)"
|
||||
(EditApproveEventDismiss)="EditApproveEventDismiss()"
|
||||
[eventAttendees]="contacts"
|
||||
@@ -437,10 +438,11 @@
|
||||
[taskParticipants]="taskParticipants"
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[serialNumber] = "eventToaprove.serialNumber"
|
||||
[saveData] = "eventToaprove.saveData"
|
||||
(setContact)="setContact($event)"
|
||||
(clearContact)="clearContact()"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
(closeComponent)="closeComponentEditEventOrAdd()"
|
||||
(closeComponent)="approveEventDismissGoBack()"
|
||||
(setIntervenient)="setIntervenient($event)"
|
||||
(setIntervenientCC)="setIntervenientCC($event)"
|
||||
></app-edit-event-to-approve>
|
||||
|
||||
@@ -20,12 +20,9 @@ import {
|
||||
DAYS_OF_WEEK,
|
||||
} from 'angular-calendar';
|
||||
import { CustomDateFormatter } from './custom-date-formatter.provider';
|
||||
import { EventListPage } from '../gabinete-digital/event-list/event-list.page';
|
||||
import { ViewEventPage } from './view-event/view-event.page';
|
||||
import { NewEventPage } from './new-event/new-event.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { letProto } from 'rxjs-compat/operator/let';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
|
||||
@Component({
|
||||
@@ -1209,7 +1206,9 @@ export class AgendaPage implements OnInit {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
async viewEventsToApprove(){
|
||||
|
||||
// called from this template and child event
|
||||
async viewEventsToApprove() {
|
||||
await this.cloneAllmobileComponent();
|
||||
|
||||
if( window.innerWidth <= 801){
|
||||
@@ -1217,13 +1216,26 @@ export class AgendaPage implements OnInit {
|
||||
} else {
|
||||
// hide all components
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.transparentEventList = false;
|
||||
this.mobileComponent.showEventList = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
approveEventDismissGoBack() {
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
// this.mobileComponent.showEventList = false;
|
||||
this.mobileComponent.transparentEventList = true;
|
||||
this.mobileComponent.showEventToApprove = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
approveEventDismiss({saveData, serialNumber, action}){
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
|
||||
if(action == 'Aprovar'){
|
||||
this.eventToaprove = {
|
||||
back: true,
|
||||
@@ -1235,19 +1247,26 @@ export class AgendaPage implements OnInit {
|
||||
this.mobileComponent.transparentEventList = true;
|
||||
this.mobileComponent.showEventToApprove = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
closeEventToApprove(){
|
||||
if (this.eventToaprove.back ==true && this.mobileComponent.showEventList ==true){
|
||||
this.mobileComponent.transparentEventList = false;
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.eventToaprove.back = false;
|
||||
}
|
||||
else {
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.mobileComponent.showEventList = false;
|
||||
}
|
||||
closeEventToApprove() {
|
||||
|
||||
this.mobileComponent.showEventToApprove = false;
|
||||
this.mobileComponent.showEventList = true;
|
||||
|
||||
}
|
||||
|
||||
closeEventToApproveGoBack() {
|
||||
if( window.innerWidth <= 801){
|
||||
this.router.navigate(['/home/agenda/event-list']);
|
||||
} else {
|
||||
// hide all components
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.transparentEventList = false;
|
||||
this.mobileComponent.showEventList = true;
|
||||
}
|
||||
}
|
||||
|
||||
EditApproveEventDismiss(){
|
||||
|
||||
@@ -170,13 +170,14 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="middle-content">
|
||||
<div *ngIf="postEvent.Body.Text">
|
||||
<h5>Detalhes</h5>
|
||||
<ion-item lines="none" class="ion-no-margin ion-no-padding">
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
|
||||
</ion-item>
|
||||
<div class="line"></div>
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2 d-flex width-100">
|
||||
<div class="ion-icon-class d-flex">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-content id="main-content">
|
||||
<div class="main-content d-flex height-100">
|
||||
<div *ngIf="loadedEvent" class="content d-flex flex-column width-100">
|
||||
<ion-content id="main-content" >
|
||||
<div class="main-content d-flex height-100" *ngIf="loadedEvent" >
|
||||
<div class="content d-flex flex-column width-100" *ngIf="loadedEvent.workflowInstanceDataFields">
|
||||
<div class="header-content width-100 d-flex justify-space-between">
|
||||
<div (click)="goBack()" class="header-icon-left cursor-pointer">
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title flex-grow-1 cursor-pointer">
|
||||
<div class="header-title flex-grow-1 cursor-pointer" *ngIf="loadedEvent.workflowInstanceDataFields.Subject">
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}}</label>
|
||||
</div>
|
||||
<div (click)="editar(loadedEvent.serialNumber)" class="header-icon-right display-none-true">
|
||||
@@ -73,7 +73,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="loadedEvent" class="aside-right flex-column height-100">
|
||||
<div class="aside-buttons">
|
||||
<button hidden full class="btn-ok" shape="round" >Editar evento</button>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -9,8 +9,6 @@ import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/
|
||||
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.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 { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
@@ -20,8 +18,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
})
|
||||
export class ApproveEventPage implements OnInit {
|
||||
event: Event;
|
||||
loadedEvent:any;
|
||||
loadedEvent1:any;
|
||||
loadedEvent:any = false
|
||||
loadedAttachments:any;
|
||||
customDate:any;
|
||||
today:any;
|
||||
@@ -51,7 +48,6 @@ export class ApproveEventPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params["params"]);
|
||||
|
||||
@@ -260,9 +256,7 @@ export class ApproveEventPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
|
||||
|
||||
async editar(serialNumber: string) {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EditEventToApproveComponent,
|
||||
@@ -282,7 +276,4 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ApproveEventModalPage } from './approve-event-modal/approve-event-modal.page';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
@@ -13,11 +12,13 @@ import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angula
|
||||
styleUrls: ['./event-list.page.scss'],
|
||||
})
|
||||
export class EventListPage implements OnInit {
|
||||
// [desktop] event list to approve
|
||||
|
||||
profile:string;
|
||||
segment:string;
|
||||
showLoader: boolean;
|
||||
eventsPRList: any;
|
||||
eventsMDGPRList: any;
|
||||
eventsPRList: any = []
|
||||
eventsMDGPRList: any = []
|
||||
eventPerson: EventPerson;
|
||||
eventBody: EventBody;
|
||||
categories: string[];
|
||||
@@ -27,8 +28,7 @@ export class EventListPage implements OnInit {
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -229,6 +229,7 @@ ion-content{
|
||||
width: 35%;
|
||||
justify-content: flex-start !important;
|
||||
border-right: 1px solid #d8d8d8;
|
||||
border: 1px solid red;
|
||||
|
||||
.aside{
|
||||
background:transparent;
|
||||
|
||||
@@ -46,11 +46,11 @@ export class NewActionPage implements OnInit {
|
||||
console.log(this.folder);
|
||||
|
||||
try {
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||
this.toastService.successMessage("Ação presidencial criado")
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise();
|
||||
this.toastService.successMessage("Ação presidencial criado");
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Ação presidencial não criado")
|
||||
this.toastService.badRequest("Ação presidencial não criado");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { ViewPublicationsPage } from '../view-publications/view-publications.page';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -52,6 +53,7 @@ export class NewPublicationPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
private publications: PublicationsService,
|
||||
private camera: Camera,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -112,7 +114,7 @@ export class NewPublicationPage implements OnInit {
|
||||
if(this.publicationType == '3'){
|
||||
console.log(this.navParams.get('publication'));
|
||||
|
||||
if(this.capturedImage != ''){
|
||||
if(this.capturedImage != '') {
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
@@ -124,10 +126,18 @@ export class NewPublicationPage implements OnInit {
|
||||
FileBase64: this.capturedImage,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
console.log('Edit change image');
|
||||
console.log(this.publication);
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise();
|
||||
this.close();
|
||||
|
||||
try {
|
||||
console.log(this.publication);
|
||||
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService.successMessage("Publicação criado")
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
this.publication = {
|
||||
@@ -141,10 +151,18 @@ export class NewPublicationPage implements OnInit {
|
||||
FileBase64: this.publication.FileBase64,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
console.log('Edit - keep image');
|
||||
console.log(this.publication);
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise();
|
||||
this.close();
|
||||
/* console.log('Edit - keep image');
|
||||
console.log(this.publication); */
|
||||
try {
|
||||
console.log(this.publication);
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService.successMessage("Publicação criado")
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -164,6 +182,19 @@ export class NewPublicationPage implements OnInit {
|
||||
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()
|
||||
this.toastService.successMessage("Publicação criado")
|
||||
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,13 +208,13 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImage = '';
|
||||
}
|
||||
setTitle(){
|
||||
if(this.publicationType == '1'){
|
||||
if(this.publicationType == '1') {
|
||||
this.publicationTitle = 'Nova Publicação Rápida';
|
||||
}
|
||||
else if(this.publicationType == '2'){
|
||||
else if(this.publicationType == '2') {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
else if(this.publicationType == '3'){
|
||||
else if(this.publicationType == '3') {
|
||||
this.publicationTitle = 'Editar Publicação';
|
||||
this.pub = this.navParams.get('publication');
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<!-- Main container -->
|
||||
<div class="main-content d-flex height-100 background-white overflow-hidden border-t-radius ">
|
||||
<!-- Left -->
|
||||
<div class="aside-left app-default-padding d-flex flex-grow-1 flex-column aside width-30 ">
|
||||
<div class="aside-left app-default-padding d-flex flex-grow-1 flex-column width-30 ">
|
||||
<!-- Header -->
|
||||
<ion-toolbar >
|
||||
<div class="main-header">
|
||||
<ion-toolbar >
|
||||
<div class="main-header">
|
||||
<div class="title-content d-flex justify-space-between">
|
||||
<div class="div-title flex-grow-1">
|
||||
<ion-label class="title ">Acções Presidenciais</ion-label>
|
||||
@@ -30,10 +30,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-toolbar>
|
||||
<!-- Content -->
|
||||
|
||||
<div class="main-content overflow-auto-y">
|
||||
<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)">
|
||||
@@ -46,7 +46,7 @@
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item width-100"
|
||||
<div class="item width-100 d-flex"
|
||||
*ngFor="let evento of publicationsEventFolderList"
|
||||
(click)="viewPublications(evento)">
|
||||
<div class="item-icon2">
|
||||
|
||||
@@ -82,16 +82,27 @@ ion-toolbar{
|
||||
font-family: Roboto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
|
||||
.aside-left{
|
||||
border-right: 1px solid #d8d8d8;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
|
||||
.main-header{
|
||||
padding: 30px 20px 15px 20px !important;
|
||||
}
|
||||
|
||||
.aside{
|
||||
padding: 0px 20px 0 20px !important;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
//border: 1px solid red;
|
||||
}
|
||||
}
|
||||
.item{
|
||||
width: 100% !important;
|
||||
padding: 0 0px 0 0px !important;
|
||||
margin: 0px auto;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
.item-icon{
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
</ion-header> -->
|
||||
|
||||
<ion-content id="main-content">
|
||||
<div class="main-content d-flex height-100">
|
||||
<div class="main-content d-flex height-100" *ngIf="loadedEvent">
|
||||
<div class="content d-flex flex-column">
|
||||
<div class="header-content width-100 d-flex justify-space-between">
|
||||
<div (click)="close()" class="header-icon-left cursor-pointer">
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title flex-grow-1 cursor-pointer">
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} 11 </label>
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} </label>
|
||||
</div>
|
||||
<div (click)="editar(loadedEvent.serialNumber)" class="header-icon-right display-none-{{showAside}}">
|
||||
<button class="btn-no-color">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ModalController, PopoverController } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -8,12 +8,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
|
||||
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { EditEventToApproveComponent } from '../../gabinete-digital/edit-event-to-approve/edit-event.page';
|
||||
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
templateUrl: './approve-event.page.html',
|
||||
@@ -47,13 +43,11 @@ export class ApproveEventPage implements OnInit {
|
||||
private processes:ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
private alertService: AlertService,
|
||||
private iab: InAppBrowser,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
// $$$
|
||||
) {
|
||||
// Event to approve list
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +81,6 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
async approveTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { AlertController, AnimationController, ModalController } from '@ionic/angular';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import * as moment from 'moment';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
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 { Event } from '../../../models/event.model';
|
||||
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -65,7 +62,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
@Input() serialNumber: string
|
||||
|
||||
|
||||
loadedAttachments: Attachment[]= []
|
||||
|
||||
eventProcess = {
|
||||
@@ -90,8 +86,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
}
|
||||
|
||||
show = false
|
||||
|
||||
postEvent: Event;
|
||||
isRecurring:string;
|
||||
isEventEdited: boolean;
|
||||
segment:string = "true";
|
||||
@@ -121,25 +115,30 @@ export class EditEventToApprovePage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private processes:ProcessesService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
/* this.serialNumber = this.navParams.get('serialNumber'); */
|
||||
|
||||
this.isEventEdited = false;
|
||||
this.dateControlStart = new FormControl(moment(new Date()));
|
||||
this.dateControlEnd = new FormControl(moment(new Date()));
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if(!this.restoreTemporaryData()){
|
||||
|
||||
} else {
|
||||
alert('restore!!')
|
||||
}
|
||||
|
||||
this.getTask();
|
||||
console.log(this.serialNumber);
|
||||
|
||||
// console.log(this.serialNumber);
|
||||
}
|
||||
|
||||
async getTask() {
|
||||
console.log('this.eventProcess', this.eventProcess);
|
||||
// console.log('this.eventProcess', this.eventProcess);
|
||||
|
||||
const result = await this.processes.GetTask(this.serialNumber).subscribe( result =>{
|
||||
this.eventProcess = result
|
||||
@@ -162,19 +161,23 @@ export class EditEventToApprovePage implements OnInit {
|
||||
else {
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
|
||||
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
|
||||
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
close() {
|
||||
console.log('CLOSE');
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
|
||||
this.closeComponent.emit();
|
||||
/* this.setIntervenient.emit([]);
|
||||
@@ -253,64 +256,31 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/* async openAttendees() {
|
||||
|
||||
if(window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
taskParticipantsCc: this.taskParticipantsCc
|
||||
},
|
||||
cssClass: 'attendee modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
// setIntervenient(data){
|
||||
// this.taskParticipants = data;
|
||||
// this.postEvent.Attendees = data;
|
||||
// }
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
if(data){
|
||||
data = data['data'];
|
||||
// setIntervenientCC(data) {
|
||||
// this.taskParticipantsCc = data;
|
||||
// }
|
||||
|
||||
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||
// addParticipants(){
|
||||
// this.adding = 'intervenient'
|
||||
|
||||
this.setIntervenient(newAttendees);
|
||||
this.setIntervenientCC(newAttendeesCC);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showAttendees = true
|
||||
}
|
||||
}
|
||||
// this.openAttendees();
|
||||
// }
|
||||
|
||||
setIntervenient(data){
|
||||
this.taskParticipants = data;
|
||||
this.postEvent.Attendees = data;
|
||||
}
|
||||
|
||||
setIntervenientCC(data) {
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
|
||||
addParticipants(){
|
||||
this.adding = 'intervenient'
|
||||
|
||||
this.openAttendees();
|
||||
}
|
||||
|
||||
addParticipantsCC(){
|
||||
// addParticipantsCC(){
|
||||
|
||||
this.adding = 'CC'
|
||||
this.openAttendees();
|
||||
}
|
||||
// this.adding = 'CC'
|
||||
// this.openAttendees();
|
||||
// }
|
||||
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
|
||||
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
|
||||
this.taskParticipants = taskParticipants;
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
async addParticipants() {
|
||||
@@ -340,13 +310,30 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
this.getDatepickerData()
|
||||
|
||||
window['temp.path:/home/agenda/edit-event-to-approve.page.ts'] = {
|
||||
postEvent: this.postEvent,
|
||||
segment: this.segment
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {
|
||||
eventProcess: this.eventProcess
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
restoreTemporaryData(): boolean {
|
||||
|
||||
const restoredData = window['temp.path:/shared/agenda/edit-event-to-approve.ts']
|
||||
|
||||
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
|
||||
this.eventProcess = restoredData.eventProcess
|
||||
|
||||
// restore dater for date and hours picker
|
||||
this.restoreDatepickerData()
|
||||
return true;
|
||||
} else {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async getAttachments() {
|
||||
|
||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
@@ -357,7 +344,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
this.loadedAttachments = result
|
||||
|
||||
console.log('this.loadedAttachments', this.loadedAttachments, result)
|
||||
// console.log('this.loadedAttachments', this.loadedAttachments, result)
|
||||
}
|
||||
|
||||
deleteAttachment(attachment: Attachment, index) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { NavigationEnd, Router } from '@angular/router';
|
||||
styleUrls: ['./event-list.page.scss'],
|
||||
})
|
||||
export class EventListPage implements OnInit {
|
||||
|
||||
// [desktop] event list to approve
|
||||
|
||||
showLoader: boolean;
|
||||
eventsPRList: any;
|
||||
@@ -38,7 +38,7 @@ export class EventListPage implements OnInit {
|
||||
|
||||
/* console.log(this.profile); */
|
||||
|
||||
if(this.profile == "mdgpr"){
|
||||
if(this.profile == "mdgpr") {
|
||||
this.profile = 'MDGPR'
|
||||
} else {
|
||||
this.profile = 'PR'
|
||||
@@ -53,7 +53,7 @@ export class EventListPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
LoadToApproveEvents(){
|
||||
LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
@@ -65,22 +65,20 @@ export class EventListPage implements OnInit {
|
||||
this.eventsMDGPRList = res;
|
||||
});
|
||||
}
|
||||
async openApproveModal(eventSerialNumber, data){
|
||||
async openApproveModal(eventSerialNumber, data) {
|
||||
|
||||
let a =this.eventsMDGPRList.filter((elem)=>{
|
||||
console.log(eventSerialNumber," ",elem.serialNumber)
|
||||
return eventSerialNumber == elem.serialNumber
|
||||
});
|
||||
|
||||
console.log(a);
|
||||
|
||||
this.approveEventDismiss.emit({
|
||||
"serialNumber": eventSerialNumber,
|
||||
"action": "Aprovar",
|
||||
"saveData": data
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
|
||||
@@ -49,20 +49,14 @@ export class NewActionPage implements OnInit {
|
||||
try {
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage('Publicação criado')
|
||||
this.toastService.successMessage('Acção presidencial criada')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Publicação não criado')
|
||||
this.toastService.badRequest('Não foi possivel criar a acção presidencial')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
this.closeDesktopComponent.emit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,12 +63,14 @@ export class ViewPublicationsPage implements OnInit {
|
||||
close(){
|
||||
this.closeDesktopComponent.emit();
|
||||
}
|
||||
getPublicationDetail(){
|
||||
|
||||
getPublicationDetail() {
|
||||
this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.item = res;
|
||||
});
|
||||
}
|
||||
|
||||
getPublications(){
|
||||
this.showLoader = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user