mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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