mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve go back
This commit is contained in:
@@ -26,6 +26,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Device } from '@capacitor/device';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -87,7 +89,8 @@ export class HomePage implements OnInit {
|
||||
private eventservice: EventsService,
|
||||
private processservice: ProcessesService,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService) {
|
||||
private sqliteservice: SqliteService,
|
||||
private RouteService: RouteService) {
|
||||
|
||||
/* this.webNotificationPopupService.askNotificationPermission() */
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-doc
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from '../view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -225,7 +226,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
//this.location.back();
|
||||
//this.RouteService.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -248,7 +249,7 @@ export class DocumentDetailPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
});
|
||||
} */
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||
8
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-document',
|
||||
templateUrl: './view-document.page.html',
|
||||
@@ -103,7 +105,7 @@ export class ViewDocumentPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
//this.location.back();
|
||||
//this.RouteService.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Event } from '../../models/event.model';
|
||||
import { EditEventPage } from 'src/app/pages/agenda/edit-event/edit-event.page';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -65,7 +66,7 @@ export class ViewEventPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
@@ -145,7 +146,7 @@ export class ViewEventPage implements OnInit {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
@@ -327,7 +328,7 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res => {
|
||||
//this.location.back();
|
||||
//this.RouteService.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import { SuccessMessagePage } from 'src/app/shared/popover/success-message/succe
|
||||
import { EmendMessageModalPage } from '../emend-message-modal/emend-message-modal.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-actions-popover',
|
||||
@@ -27,7 +29,7 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
private popoverController: PopoverController,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.instanceId = this.navParams.get('InstanceId');
|
||||
@@ -44,7 +46,7 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
goBack() {
|
||||
this.closePopover();
|
||||
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
}
|
||||
|
||||
closePopover() {
|
||||
|
||||
@@ -20,6 +20,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -71,7 +72,8 @@ export class ViewEventPage implements OnInit {
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private storage: StorageService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
this.loadedEvent = new Event();
|
||||
@@ -179,7 +181,7 @@ export class ViewEventPage implements OnInit {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
@@ -361,7 +363,7 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res => {
|
||||
//this.location.back();
|
||||
//this.RouteService.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
@@ -60,7 +61,8 @@ export class DespachoPrPage implements OnInit {
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if (params["params"].SerialNumber) {
|
||||
@@ -99,7 +101,7 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -57,7 +58,7 @@ export class DespachoPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private despachoService: DespachoService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
@@ -97,7 +98,7 @@ export class DespachoPage implements OnInit {
|
||||
goBack() {
|
||||
|
||||
//this.navigationService.back()
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
|
||||
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
||||
// if (window.innerWidth < 801) {
|
||||
@@ -173,7 +174,7 @@ export class DespachoPage implements OnInit {
|
||||
try {
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
}
|
||||
|
||||
+3
-2
@@ -10,6 +10,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma-assinar',
|
||||
@@ -39,7 +40,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
private router: Router,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -59,7 +60,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
async openOptions(taskAction?: any) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -47,7 +48,7 @@ export class DiplomaPage implements OnInit {
|
||||
private router: Router,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
@@ -76,7 +77,7 @@ export class DiplomaPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
/* if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
||||
if (window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
|
||||
@@ -18,7 +18,7 @@ import { BackgroundService } from '../../../../services/background.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
@@ -58,7 +58,7 @@ export class ApproveEventPage implements OnInit {
|
||||
private iab: InAppBrowser,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
@@ -94,7 +94,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
/* let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { BackgroundService } from '../../../services/background.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
@@ -44,7 +45,8 @@ export class EventListPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private sortService: SortService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -216,7 +218,7 @@ export class EventListPage implements OnInit {
|
||||
// this.router.navigate(['/home/gabinete-digital']);
|
||||
// }
|
||||
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -32,6 +32,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -71,7 +72,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
public p: PermissionService,
|
||||
private taskService: TaskService,
|
||||
@@ -269,7 +270,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
/* if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
|
||||
@@ -21,6 +21,7 @@ import { Location } from '@angular/common';
|
||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-pr',
|
||||
@@ -58,7 +59,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
|
||||
) {
|
||||
@@ -94,7 +95,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
/* if(this.task.Status == "Pending" && this.caller != 'events'){
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
|
||||
@@ -13,6 +13,7 @@ import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedientes-pr',
|
||||
@@ -40,7 +41,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
@@ -131,7 +132,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
// };
|
||||
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedido',
|
||||
@@ -63,7 +63,7 @@ export class PedidoPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
public p: PermissionService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private pedidoService: PedidoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservices: BackgroundService,
|
||||
@@ -670,7 +670,7 @@ export class PedidoPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
|
||||
// if (window.innerWidth <= 700) {
|
||||
// this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Location } from '@angular/common';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail',
|
||||
@@ -28,7 +28,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private publications:PublicationsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService ) {
|
||||
@@ -88,7 +88,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
close() {
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ import { NewPublicationPage } from '../../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail',
|
||||
@@ -30,7 +30,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
|
||||
@@ -100,7 +100,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
this.close()
|
||||
} else {
|
||||
// alert('go back')
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import { Router, NavigationEnd } from '@angular/router'
|
||||
export class NavigationService {
|
||||
private history: string[] = []
|
||||
|
||||
constructor(private router: Router, private location: Location) {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private location: Location
|
||||
) {
|
||||
this.router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
this.history.push(event.urlAfterRedirects)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RouteService } from './route.service';
|
||||
|
||||
describe('RouteService', () => {
|
||||
let service: RouteService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(RouteService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NavigationEnd, Router, NavigationStart } from '@angular/router';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RouteService {
|
||||
|
||||
history: any = [];
|
||||
isGoBack = false;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
) {
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
|
||||
const lastRoute = this.history.slice(-1)
|
||||
|
||||
if(event.url != lastRoute) {
|
||||
this.history.push(event.url)
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
window['RouteService'] = this
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url [string] incase no history to go back
|
||||
* @param option [Object] some options to the url
|
||||
*/
|
||||
goBack(url = null, option: object = {}) {
|
||||
if(this.history.length >= 2) {
|
||||
this.history.pop();
|
||||
const goTo = this.history.pop();
|
||||
this.isGoBack = true;
|
||||
this.router.navigate([goTo]);
|
||||
} else if(url) {
|
||||
this.goTo({url})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
goTo({url}) {
|
||||
this.router.navigate([url]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -234,7 +235,7 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
//this.location.back();
|
||||
//this.RouteService.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { DeplomaService } from 'src/app/Rules/deploma.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-deploma-options',
|
||||
@@ -30,7 +31,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
private deplomaService: DeplomaService,
|
||||
private location: Location) {
|
||||
private RouteService: RouteService) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.task = this.navParams.get('task');
|
||||
this.fulltask = this.navParams.get('fulltask');
|
||||
@@ -216,7 +217,7 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Location } from '@angular/common'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos-options',
|
||||
@@ -33,7 +34,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
public p: PermissionService,
|
||||
public ThemeService: ThemeService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
) {
|
||||
this.task = this.navParams.get('task')
|
||||
this.fulltask = this.navParams.get('fulltask')
|
||||
@@ -316,7 +317,7 @@ export class DespachosOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos-pr-options',
|
||||
@@ -33,7 +33,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
@@ -373,7 +373,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back();
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
|
||||
cancle() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-opts-expediente-pr',
|
||||
@@ -50,7 +50,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService
|
||||
|
||||
) {
|
||||
@@ -329,7 +329,7 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
}
|
||||
|
||||
getAttachments(serialNumber){
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-opts-expediente',
|
||||
@@ -46,7 +46,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public p: PermissionService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private location: Location,
|
||||
private RouteService: RouteService,
|
||||
private TaskService: TaskService,
|
||||
private expedienteService: ExpedienteService,
|
||||
public ThemeService: ThemeService
|
||||
@@ -107,7 +107,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.location.back()
|
||||
this.RouteService.goBack()
|
||||
|
||||
|
||||
/* this.activatedRoute.paramMap.subscribe(params => {
|
||||
|
||||
Reference in New Issue
Block a user