Push notifications route bug fixed

This commit is contained in:
Eudes Inácio
2021-02-10 16:55:04 +01:00
parent 279cf518b2
commit 094bf52e93
3 changed files with 38 additions and 37 deletions
@@ -21,29 +21,29 @@ import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
export class ExpedienteDetailPage implements OnInit {
task: any;
fulltask:any;
eventsList: Event[];
serialnumber:string;
fulltask: any;
eventsList: Event[];
serialnumber: string;
profile: string;
constructor(private activateRoute: ActivatedRoute,
private processes:ProcessesService,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachments: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router:Router,
private router: Router,
private modalController: ModalController,
private navParams: NavParams,
private alertService: AlertService) {
this,this.serialnumber = this.navParams.get('serialNumber');
this,this.profile = this.navParams.get('profile');
}
private alertService: AlertService) {
this.serialnumber = this.navParams.get('serialNumber');
this.profile = this.navParams.get('profile');
}
ngOnInit() {
this.profile = "mdgpr";
this.activateRoute.paramMap.subscribe(paramMap => {
if (!paramMap.has('SerialNumber')){
if (!paramMap.has('SerialNumber')) {
return;
}
this.serialnumber = paramMap.get('SerialNumber');
@@ -55,8 +55,7 @@ export class ExpedienteDetailPage implements OnInit {
}
async LoadTaskDetail(serial:string)
{
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.task = {
"SerialNumber": res.serialNumber,
@@ -68,18 +67,16 @@ export class ExpedienteDetailPage implements OnInit {
}
this.fulltask = res;
console.log(res);
});
}
async LoadRelatedEvents(serial:string)
{
if (this.eventsList == null)
{
async LoadRelatedEvents(serial: string) {
if (this.eventsList == null) {
this.attachments.getAttachmentsBySerial(serial).subscribe(res => {
console.log(res);
res.forEach(att =>{
if (this.eventsList == null){
res.forEach(att => {
if (this.eventsList == null) {
this.eventsList = new Array();
}
this.events.getEvent(att.ParentId).subscribe(event => {
@@ -91,20 +88,20 @@ export class ExpedienteDetailPage implements OnInit {
}
}
viewDocument(){
const url: string = this.task.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
viewDocument() {
const url: string = this.task.DocumentURL.replace("webTRIX.Viewer", "webTRIX.Viewer.Branch1");
const browser = this.iab.create(url, "_blank");
browser.show();
}
openMenu() {
this.menu.open();
this.menu.open();
}
async openExpedientActionsModal(taskAction:any, task:any){
async openExpedientActionsModal(taskAction: any, task: any) {
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps:{
componentProps: {
taskAction: taskAction,
task: task,
},
@@ -115,17 +112,17 @@ export class ExpedienteDetailPage implements OnInit {
modal.onDidDismiss();
}
discartExpedient(){
discartExpedient() {
let body = { "serialNumber": this.serialnumber, "action": "Task Completed" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/expediente']);
}
async openBookMeetingModal(task:any){
async openBookMeetingModal(task: any) {
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps:{
componentProps: {
task: task,
},
cssClass: 'book-meeting-modal',
@@ -135,12 +132,12 @@ export class ExpedienteDetailPage implements OnInit {
modal.onDidDismiss();
}
async viewEventDetail(eventId:any) {
async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps:{
componentProps: {
eventId: eventId,
profile: this.profile,
},
@@ -148,8 +145,8 @@ export class ExpedienteDetailPage implements OnInit {
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
modal.onDidDismiss().then((res) => {
if (res) {
}
});
}