Skip to content

Commit c6b93fa

Browse files
committed
renamed routes
1 parent e698098 commit c6b93fa

19 files changed

+38
-53
lines changed

src/Client/Logistics.OfficeApp/src/app/app.routes.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@ export const APP_ROUTES: Routes = [
2222
loadChildren: () => import('./pages/home').then((m) => m.HOME_ROUTES),
2323
},
2424
{
25-
path: 'employee',
25+
path: 'dashboard',
26+
loadChildren: () => import('./pages/dashboard').then((m) => m.DASHBOARD_ROUTES),
27+
data: {
28+
breadcrumb: 'Dashboard',
29+
},
30+
},
31+
{
32+
path: 'employees',
2633
loadChildren: () => import('./pages/employee').then((m) => m.EMPLOYEE_ROUTES),
2734
data: {
2835
breadcrumb: 'Employees',
2936
},
3037
},
3138
{
32-
path: 'load',
39+
path: 'loads',
3340
loadChildren: () => import('./pages/load').then((m) => m.LOAD_ROUTES),
3441
data: {
3542
breadcrumb: 'Loads',
3643
},
3744
},
3845
{
39-
path: 'truck',
46+
path: 'trucks',
4047
loadChildren: () => import('./pages/truck').then((m) => m.TRUCK_ROUTES),
4148
data: {
4249
breadcrumb: 'Trucks',
4350
},
4451
},
45-
{
46-
path: 'dashboard',
47-
loadChildren: () => import('./pages/dashboard').then((m) => m.DASHBOARD_ROUTES),
48-
data: {
49-
breadcrumb: 'Dashboard',
50-
},
51-
},
5252
{
5353
path: 'customers',
5454
loadChildren: () => import('./pages/customer').then((m) => m.CUSTOMER_ROUTES),

src/Client/Logistics.OfficeApp/src/app/layout/sidebar/sidebar.component.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
</a>
1818
</li>
1919
<li class="nav-item">
20-
<a class="nav-link border-bottom" [routerLink]="['/load/list']">
20+
<a class="nav-link border-bottom" [routerLink]="['/loads']">
2121
<i class="bi bi-database h1" pTooltip="Loads"></i>
2222
<span class="ms-2" *ngIf="isOpened">Loads</span>
2323
</a>
2424
</li>
2525
<li class="nav-item">
26-
<a class="nav-link border-bottom" [routerLink]="['/truck/list']">
26+
<a class="nav-link border-bottom" [routerLink]="['/trucks']">
2727
<i class="bi bi-truck h1" pTooltip="Trucks"></i>
2828
<span class="ms-2" *ngIf="isOpened">Trucks</span>
2929
</a>
3030
</li>
3131
<li class="nav-item">
32-
<a class="nav-link border-bottom" [routerLink]="['/employee/list']">
32+
<a class="nav-link border-bottom" [routerLink]="['/employees']">
3333
<i class="bi bi-people h1" pTooltip="Employees"></i>
3434
<span class="ms-2" *ngIf="isOpened">Employees</span>
3535
</a>

src/Client/Logistics.OfficeApp/src/app/pages/dashboard/components/truck-stats-table/truck-stats-table.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h4 class="ps-3 py-2">Truck statistics for
7272
<button pButton
7373
class="p-button-raised ms-2"
7474
label="Edit"
75-
[routerLink]="['/truck/edit', truckStats.truckId]">
75+
[routerLink]="['/trucks/edit', truckStats.truckId]">
7676
</button>
7777
</td>
7878
</tr>

src/Client/Logistics.OfficeApp/src/app/pages/employee/add-employee/add-employee.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1 class="text-center">Add a new employee</h1>
3535
type="button"
3636
class="p-button-raised mt-3 ms-2"
3737
icon="bi bi-arrow-left-square"
38-
routerLink="/employee/list"
38+
routerLink="/employees"
3939
label="Back to list">
4040
</button>
4141
</div>

src/Client/Logistics.OfficeApp/src/app/pages/employee/edit-employee/edit-employee.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h1 class="text-center">Edit Employee</h1>
4444
type="button"
4545
class="p-button-raised mt-3 ms-2"
4646
icon="bi bi-arrow-left-square"
47-
routerLink="/employee/list"
47+
routerLink="/employees"
4848
label="Back to list">
4949
</button>
5050
</div>

src/Client/Logistics.OfficeApp/src/app/pages/employee/employee.routes.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ import {ListEmployeeComponent} from './list-employees/list-employees.component';
99
export const EMPLOYEE_ROUTES: Routes = [
1010
{
1111
path: '',
12-
redirectTo: 'list',
13-
pathMatch: 'full',
14-
},
15-
{
16-
path: 'list',
1712
component: ListEmployeeComponent,
1813
canActivate: [AuthGuard],
1914
data: {
20-
breadcrumb: 'List',
15+
breadcrumb: '',
2116
permission: Permissions.Employees.View,
2217
},
2318
},

src/Client/Logistics.OfficeApp/src/app/pages/employee/list-employees/list-employees.component.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>List Employees</h1>
44
class="p-button-lg p-button-rounded p-button-text text-black ms-2"
55
icon="bi bi-plus-square-fill"
66
pTooltip="Add a new employee"
7-
routerLink="/employee/add">
7+
routerLink="/employees/add">
88
</button>
99
</div>
1010
<hr class="w-100">
@@ -53,12 +53,12 @@ <h1>List Employees</h1>
5353
<ng-template pTemplate="body" let-employee>
5454
<tr>
5555
<td>
56-
<a [routerLink]="['/employee/edit', employee.id]">
56+
<a [routerLink]="['/employees/edit', employee.id]">
5757
{{employee.firstName}}
5858
</a>
5959
</td>
6060
<td>
61-
<a [routerLink]="['/employee/edit', employee.id]">
61+
<a [routerLink]="['/employees/edit', employee.id]">
6262
{{employee.lastName}}
6363
</a>
6464
</td>

src/Client/Logistics.OfficeApp/src/app/pages/employee/list-employees/list-employees.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, OnInit} from '@angular/core';
1+
import {Component} from '@angular/core';
22
import {DatePipe} from '@angular/common';
33
import {RouterLink} from '@angular/router';
44
import {TableLazyLoadEvent, TableModule} from 'primeng/table';

src/Client/Logistics.OfficeApp/src/app/pages/home/home.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ <h4 class="ps-3 py-2">Active loads</h4>
3131
<ng-template pTemplate="body" let-load>
3232
<tr>
3333
<td>
34-
<a [routerLink]="['/load/edit', load.id]">
34+
<a [routerLink]="['/loads/edit', load.id]">
3535
{{load.refId}}
3636
</a>
3737
</td>
3838
<td [pTooltip]="load.currentLocation" [showDelay]="500" tooltipPosition="bottom">
3939
{{load.currentLocation}}
4040
</td>
4141
<td>
42-
<a [routerLink]="['/truck/details', load.assignedTruckId]">
42+
<a [routerLink]="['/trucks/details', load.assignedTruckId]">
4343
{{load.assignedTruckNumber}}
4444
</a>
4545
</td>
@@ -50,12 +50,12 @@ <h4 class="ps-3 py-2">Active loads</h4>
5050
<td colspan="4">
5151
<button pButton
5252
class="p-button-raised"
53-
routerLink="/load/add">
53+
routerLink="/loads/add">
5454
Add
5555
</button>
5656
<button pButton
5757
class="p-button-raised ms-2"
58-
routerLink="/load/list">
58+
routerLink="/loads">
5959
View all loads
6060
</button>
6161
</td>

src/Client/Logistics.OfficeApp/src/app/pages/load/add-load/add-load.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1>Add a new load</h1>
6969
type="button"
7070
class="p-button-raised mt-3 ms-0 ms-md-2"
7171
icon="bi bi-arrow-left-square"
72-
routerLink="/load/list">
72+
routerLink="/loads">
7373
Back to list
7474
</button>
7575
</div>

src/Client/Logistics.OfficeApp/src/app/pages/load/edit-load/edit-load.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h1>Edit a load #{{loadRefId}}</h1>
8484
type="button"
8585
class="p-button-raised mt-3 ms-0 ms-md-2"
8686
icon="bi bi-arrow-left-square"
87-
routerLink="/load/list">
87+
routerLink="/loads">
8888
Back to list
8989
</button>
9090
</div>

src/Client/Logistics.OfficeApp/src/app/pages/load/edit-load/edit-load.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class EditLoadComponent implements OnInit {
179179
this.apiService.deleteLoad(this.id).subscribe((result) => {
180180
if (result.isSuccess) {
181181
this.toastService.showSuccess('A load has been deleted successfully');
182-
this.router.navigateByUrl('/load/list');
182+
this.router.navigateByUrl('/loads');
183183
}
184184

185185
this.isBusy = false;

src/Client/Logistics.OfficeApp/src/app/pages/load/list-loads/list-loads.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>List Loads</h1>
44
class="p-button-lg p-button-rounded p-button-text text-black ms-2"
55
icon="bi bi-plus-square-fill"
66
pTooltip="Add a new load"
7-
routerLink="/load/add">
7+
routerLink="/loads/add">
88
</button>
99
</div>
1010
<hr class="w-100">
@@ -78,7 +78,7 @@ <h1>List Loads</h1>
7878
<ng-template pTemplate="body" let-load>
7979
<tr>
8080
<td>
81-
<a [routerLink]="['/load/edit', load.id]">
81+
<a [routerLink]="['/loads/edit', load.id]">
8282
{{load.refId}}
8383
</a>
8484
</td>

src/Client/Logistics.OfficeApp/src/app/pages/load/load.routes.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ import {AddLoadComponent} from './add-load/add-load.component';
99
export const LOAD_ROUTES: Routes = [
1010
{
1111
path: '',
12-
redirectTo: 'list',
13-
pathMatch: 'full',
14-
},
15-
{
16-
path: 'list',
1712
component: ListLoadComponent,
1813
canActivate: [AuthGuard],
1914
data: {
20-
breadcrumb: 'List',
15+
breadcrumb: '',
2116
permission: Permissions.Loads.View,
2217
},
2318
},

src/Client/Logistics.OfficeApp/src/app/pages/truck/edit-truck/edit-truck.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h1 class="text-center">{{headerText}}</h1>
5050
type="button"
5151
class="p-button-raised mt-3 ms-0 ms-md-2"
5252
icon="bi bi-arrow-left-square"
53-
routerLink="/truck/list">
53+
routerLink="/trucks">
5454
Back to list
5555
</button>
5656
</div>

src/Client/Logistics.OfficeApp/src/app/pages/truck/edit-truck/edit-truck.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export class EditTruckComponent implements OnInit {
7676
this.fetchTruck(this.id);
7777
}
7878

79-
searchDriver(event: any) {
80-
this.apiService.getDrivers(event.query).subscribe((result) => {
79+
searchDriver(event: {query: string}) {
80+
this.apiService.getDrivers({search: event.query}).subscribe((result) => {
8181
if (result.isSuccess && result.data) {
8282
this.suggestedDrivers = result.data;
8383
}

src/Client/Logistics.OfficeApp/src/app/pages/truck/list-trucks/list-trucks.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>List Trucks</h1>
44
class="p-button-lg p-button-rounded p-button-text text-black ms-2"
55
icon="bi bi-plus-square-fill"
66
pTooltip="Add a new truck"
7-
routerLink="/truck/add">
7+
routerLink="/trucks/add">
88
</button>
99
</div>
1010
<hr class="w-100">
@@ -71,7 +71,7 @@ <h1>List Trucks</h1>
7171
<button pButton
7272
class="p-button-raised ms-2"
7373
label="Edit"
74-
[routerLink]="['/truck/edit', truck.id]">
74+
[routerLink]="['/trucks/edit', truck.id]">
7575
</button>
7676
</td>
7777
</tr>

src/Client/Logistics.OfficeApp/src/app/pages/truck/truck-details/truck-details.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h1 class="text-center">Truck Details</h1>
5151
</div>
5252
<div class="col-12 col-md-6 mb-2 mb-md-0">
5353
<span class="fw-bold">Truck Number: </span><br />
54-
<a [routerLink]="['/truck/edit', truck?.id]">{{truck?.truckNumber}}</a>
54+
<a [routerLink]="['/trucks/edit', truck?.id]">{{truck?.truckNumber}}</a>
5555
</div>
5656
</div>
5757

src/Client/Logistics.OfficeApp/src/app/pages/truck/truck.routes.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ import {TruckDetailsComponent} from './truck-details/truck-details.component';
99
export const TRUCK_ROUTES: Routes = [
1010
{
1111
path: '',
12-
redirectTo: 'list',
13-
pathMatch: 'full',
14-
},
15-
{
16-
path: 'list',
1712
component: ListTruckComponent,
1813
canActivate: [AuthGuard],
1914
data: {
20-
breadcrumb: 'List',
15+
breadcrumb: '',
2116
permission: Permissions.Trucks.View,
2217
},
2318
},

0 commit comments

Comments
 (0)