mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Fix
This commit is contained in:
@@ -15,6 +15,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
|
|||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||||
|
import { Location } from '@angular/common'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-event',
|
selector: 'app-view-event',
|
||||||
@@ -58,6 +59,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
|
private location: Location
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.isEventEdited = false;
|
this.isEventEdited = false;
|
||||||
@@ -128,13 +130,17 @@ export class ViewEventPage implements OnInit {
|
|||||||
/* this.today = new Date(res.StartDate);
|
/* this.today = new Date(res.StartDate);
|
||||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
|
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}, ()=>{
|
}, (error)=>{
|
||||||
|
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
|
||||||
|
} else {
|
||||||
|
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||||
|
}
|
||||||
|
|
||||||
loader.remove()
|
loader.remove()
|
||||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
|
||||||
this.modalController.dismiss('Eevent not Foud');
|
this.modalController.dismiss('Eevent not Foud');
|
||||||
this.router.navigate(['/home/agenda']);
|
this.location.back();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
|||||||
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { DespachoMdService } from 'src/app/Rules/despacho-md.service'
|
import { DespachoMdService } from 'src/app/Rules/despacho-md.service'
|
||||||
|
import { NavigationService } from 'src/app/services/navigation.service';
|
||||||
|
import { Location } from '@angular/common'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho',
|
selector: 'app-despacho',
|
||||||
templateUrl: './despacho.page.html',
|
templateUrl: './despacho.page.html',
|
||||||
@@ -50,7 +53,10 @@ export class DespachoPage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private despachoMdService: DespachoMdService
|
private despachoMdService: DespachoMdService,
|
||||||
|
private navigationService: NavigationService,
|
||||||
|
private location: Location
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if(params["params"].SerialNumber) {
|
if(params["params"].SerialNumber) {
|
||||||
@@ -81,31 +87,35 @@ export class DespachoPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
|
||||||
if (window.innerWidth < 801) {
|
//this.navigationService.back()
|
||||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
this.location.back();
|
||||||
}
|
|
||||||
else {
|
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
||||||
let navigationExtras: NavigationExtras = {
|
// if (window.innerWidth < 801) {
|
||||||
queryParams: {
|
// this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||||
"pendentes": true,
|
// }
|
||||||
}
|
// else {
|
||||||
}
|
// let navigationExtras: NavigationExtras = {
|
||||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
// queryParams: {
|
||||||
}
|
// "pendentes": true,
|
||||||
}
|
// }
|
||||||
else{
|
// }
|
||||||
if (window.innerWidth < 801) {
|
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
// }
|
||||||
} else {
|
// }
|
||||||
let navigationExtras: NavigationExtras = {
|
// else{
|
||||||
queryParams: {
|
// if (window.innerWidth < 801) {
|
||||||
'despachos': true
|
// this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||||
}
|
// } else {
|
||||||
}
|
// let navigationExtras: NavigationExtras = {
|
||||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
// queryParams: {
|
||||||
}
|
// 'despachos': true
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { NavigationService } from './navigation.service';
|
||||||
|
|
||||||
|
describe('NavigationService', () => {
|
||||||
|
let service: NavigationService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(NavigationService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { Injectable } from '@angular/core'
|
||||||
|
import { Location } from '@angular/common'
|
||||||
|
import { Router, NavigationEnd } from '@angular/router'
|
||||||
|
|
||||||
|
@Injectable({ providedIn: 'root' })
|
||||||
|
export class NavigationService {
|
||||||
|
private history: string[] = []
|
||||||
|
|
||||||
|
constructor(private router: Router, private location: Location) {
|
||||||
|
this.router.events.subscribe((event) => {
|
||||||
|
if (event instanceof NavigationEnd) {
|
||||||
|
this.history.push(event.urlAfterRedirects)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
back(): void {
|
||||||
|
this.history.pop()
|
||||||
|
if (this.history.length > 0) {
|
||||||
|
this.location.back()
|
||||||
|
} else {
|
||||||
|
this.router.navigateByUrl('/')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -69,12 +69,12 @@ export class ApproveEventPage implements OnInit {
|
|||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.getTask();
|
this.getTask();
|
||||||
this.getAttachments();
|
this.getAttachments();
|
||||||
}, 4000)
|
}, 6000)
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.getTask();
|
this.getTask();
|
||||||
this.getAttachments();
|
this.getAttachments();
|
||||||
}, 6000)
|
}, 10000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user