diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e38010f2..0def001a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -15,8 +15,7 @@ import { appRoutes } from 'app/app.routing'; const routerConfig: ExtraOptions = { scrollPositionRestoration: 'enabled', - preloadingStrategy : PreloadAllModules, - relativeLinkResolution : 'legacy' + preloadingStrategy : PreloadAllModules }; @NgModule({ diff --git a/src/app/modules/admin/apps/contacts/details/details.component.ts b/src/app/modules/admin/apps/contacts/details/details.component.ts index 56c3c49b..097b2d59 100644 --- a/src/app/modules/admin/apps/contacts/details/details.component.ts +++ b/src/app/modules/admin/apps/contacts/details/details.component.ts @@ -298,22 +298,15 @@ export class ContactsDetailsComponent implements OnInit, OnDestroy return; } - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - // Navigate to the next contact if available if ( nextContactId ) { - this._router.navigate(['../', nextContactId], {relativeTo: route}); + this._router.navigate(['../', nextContactId], {relativeTo: this._activatedRoute}); } // Otherwise, navigate to the parent else { - this._router.navigate(['../'], {relativeTo: route}); + this._router.navigate(['../'], {relativeTo: this._activatedRoute}); } // Toggle the edit mode off diff --git a/src/app/modules/admin/apps/contacts/list/list.component.html b/src/app/modules/admin/apps/contacts/list/list.component.html index 50c75023..ee6027f9 100644 --- a/src/app/modules/admin/apps/contacts/list/list.component.html +++ b/src/app/modules/admin/apps/contacts/list/list.component.html @@ -78,11 +78,11 @@ -
+ [routerLink]="['./', contact.id]">
{{contact.name}}
{{contact.title}}
- + diff --git a/src/app/modules/admin/apps/contacts/list/list.component.ts b/src/app/modules/admin/apps/contacts/list/list.component.ts index a1ac2df4..78efe4b1 100644 --- a/src/app/modules/admin/apps/contacts/list/list.component.ts +++ b/src/app/modules/admin/apps/contacts/list/list.component.ts @@ -160,41 +160,13 @@ export class ContactsListComponent implements OnInit, OnDestroy // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Go to contact - * - * @param id - */ - goToContact(id: string): void - { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go to contact - this._router.navigate(['../', id], {relativeTo: route}); - - // Mark for check - this._changeDetectorRef.markForCheck(); - } - /** * On backdrop clicked */ onBackdropClicked(): void { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go to the parent route - this._router.navigate(['../'], {relativeTo: route}); + // Go back to the list + this._router.navigate(['./'], {relativeTo: this._activatedRoute}); // Mark for check this._changeDetectorRef.markForCheck(); @@ -208,26 +180,14 @@ export class ContactsListComponent implements OnInit, OnDestroy // Create the contact this._contactsService.createContact().subscribe((newContact) => { - // Go to new contact - this.goToContact(newContact.id); + // Go to the new contact + this._router.navigate(['./', newContact.id], {relativeTo: this._activatedRoute}); + + // Mark for check + this._changeDetectorRef.markForCheck(); }); } - /** - * Get country code - * - * @param iso - */ - getCountryCode(iso: string): string - { - if ( !iso ) - { - return ''; - } - - return this.countries.find((country) => country.iso === iso).code; - } - /** * Track by function for ngFor loops * diff --git a/src/app/modules/admin/apps/file-manager/list/list.component.html b/src/app/modules/admin/apps/file-manager/list/list.component.html index 3a4fa299..e2175e8e 100644 --- a/src/app/modules/admin/apps/file-manager/list/list.component.html +++ b/src/app/modules/admin/apps/file-manager/list/list.component.html @@ -68,9 +68,9 @@ -
+ [routerLink]="['./', item.id]">
@@ -109,7 +109,7 @@
{{item.contents}}
-
+ diff --git a/src/app/modules/admin/apps/file-manager/list/list.component.ts b/src/app/modules/admin/apps/file-manager/list/list.component.ts index 5d0dc2c6..c086e3b0 100644 --- a/src/app/modules/admin/apps/file-manager/list/list.component.ts +++ b/src/app/modules/admin/apps/file-manager/list/list.component.ts @@ -90,41 +90,13 @@ export class FileManagerListComponent implements OnInit, OnDestroy // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Go to item - * - * @param id - */ - goToItem(id: string): void - { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go to item - this._router.navigate(['../', id], {relativeTo: route}); - - // Mark for check - this._changeDetectorRef.markForCheck(); - } - /** * On backdrop clicked */ onBackdropClicked(): void { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go back to the parent route - this._router.navigate(['../'], {relativeTo: route}); + // Go back to the list + this._router.navigate(['./'], {relativeTo: this._activatedRoute}); // Mark for check this._changeDetectorRef.markForCheck(); diff --git a/src/app/modules/admin/apps/help-center/faqs/faqs.component.html b/src/app/modules/admin/apps/help-center/faqs/faqs.component.html index 32329e78..0279228e 100644 --- a/src/app/modules/admin/apps/help-center/faqs/faqs.component.html +++ b/src/app/modules/admin/apps/help-center/faqs/faqs.component.html @@ -4,13 +4,13 @@
- +
Frequently Asked Questions diff --git a/src/app/modules/admin/apps/help-center/guides/category/category.component.html b/src/app/modules/admin/apps/help-center/guides/category/category.component.html index ded38c91..bb06d1fc 100644 --- a/src/app/modules/admin/apps/help-center/guides/category/category.component.html +++ b/src/app/modules/admin/apps/help-center/guides/category/category.component.html @@ -4,13 +4,13 @@
- + Back to Guides & Resources +
{{guideCategory.title}} diff --git a/src/app/modules/admin/apps/help-center/guides/guide/guide.component.html b/src/app/modules/admin/apps/help-center/guides/guide/guide.component.html index f5a02ab3..9b5c4fec 100644 --- a/src/app/modules/admin/apps/help-center/guides/guide/guide.component.html +++ b/src/app/modules/admin/apps/help-center/guides/guide/guide.component.html @@ -4,13 +4,13 @@
- +
{{guideCategory.guides[0].title}}
{{guideCategory.guides[0].subtitle}}
diff --git a/src/app/modules/admin/apps/help-center/guides/guides.component.html b/src/app/modules/admin/apps/help-center/guides/guides.component.html index 44ac0df5..202428a4 100644 --- a/src/app/modules/admin/apps/help-center/guides/guides.component.html +++ b/src/app/modules/admin/apps/help-center/guides/guides.component.html @@ -4,13 +4,13 @@
- +
Guides & Resources diff --git a/src/app/modules/admin/apps/help-center/support/support.component.html b/src/app/modules/admin/apps/help-center/support/support.component.html index 216153cf..2c4d4cc6 100644 --- a/src/app/modules/admin/apps/help-center/support/support.component.html +++ b/src/app/modules/admin/apps/help-center/support/support.component.html @@ -4,13 +4,13 @@
- +
Contact support diff --git a/src/app/modules/admin/apps/tasks/details/details.component.ts b/src/app/modules/admin/apps/tasks/details/details.component.ts index c4756fc0..8b200d63 100644 --- a/src/app/modules/admin/apps/tasks/details/details.component.ts +++ b/src/app/modules/admin/apps/tasks/details/details.component.ts @@ -490,22 +490,15 @@ export class TasksDetailsComponent implements OnInit, AfterViewInit, OnDestroy return; } - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - // Navigate to the next task if available if ( nextTaskId ) { - this._router.navigate(['../', nextTaskId], {relativeTo: route}); + this._router.navigate(['../', nextTaskId], {relativeTo: this._activatedRoute}); } // Otherwise, navigate to the parent else { - this._router.navigate(['../'], {relativeTo: route}); + this._router.navigate(['../'], {relativeTo: this._activatedRoute}); } }); diff --git a/src/app/modules/admin/apps/tasks/list/list.component.ts b/src/app/modules/admin/apps/tasks/list/list.component.ts index 38e159d1..80706228 100644 --- a/src/app/modules/admin/apps/tasks/list/list.component.ts +++ b/src/app/modules/admin/apps/tasks/list/list.component.ts @@ -161,41 +161,13 @@ export class TasksListComponent implements OnInit, OnDestroy // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Go to task - * - * @param id - */ - goToTask(id: string): void - { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go to task - this._router.navigate(['../', id], {relativeTo: route}); - - // Mark for check - this._changeDetectorRef.markForCheck(); - } - /** * On backdrop clicked */ onBackdropClicked(): void { - // Get the current activated route - let route = this._activatedRoute; - while ( route.firstChild ) - { - route = route.firstChild; - } - - // Go to the parent route - this._router.navigate(['../'], {relativeTo: route}); + // Go back to the list + this._router.navigate(['./'], {relativeTo: this._activatedRoute}); // Mark for check this._changeDetectorRef.markForCheck(); @@ -211,8 +183,11 @@ export class TasksListComponent implements OnInit, OnDestroy // Create the task this._tasksService.createTask(type).subscribe((newTask) => { - // Go to new task - this.goToTask(newTask.id); + // Go to the new task + this._router.navigate(['./', newTask.id], {relativeTo: this._activatedRoute}); + + // Mark for check + this._changeDetectorRef.markForCheck(); }); }