refactor: rename components and update dialog implementations; add confirm dialog for deletion actions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import {Routes} from '@angular/router';
|
||||
import {HomeComponent} from './pages/home/home.component';
|
||||
import {RegisterComponent} from './pages/register/register.component';
|
||||
import {LoginComponent} from './pages/login/login.component';
|
||||
@@ -7,19 +7,18 @@ import {guestOnlyCanActivate, guestOnlyCanMatch} from './guards/guest-only.guard
|
||||
import {authOnlyCanActivate, authOnlyCanMatch} from './guards/auth-only.guard';
|
||||
import {AdminComponent} from './pages/admin/admin.component';
|
||||
import {adminOnlyCanActivate, adminOnlyCanMatch} from './guards/admin-only.guard';
|
||||
import {AddProductComponent} from './pages/add-product/add-product.component';
|
||||
import {ProductsComponent} from './pages/products/products.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path : '',
|
||||
path: '',
|
||||
children: [
|
||||
{
|
||||
path : '',
|
||||
path: '',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path : 'home',
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
}
|
||||
]
|
||||
@@ -31,38 +30,32 @@ export const routes: Routes = [
|
||||
canActivate: [guestOnlyCanActivate]
|
||||
},
|
||||
{
|
||||
path : 'login',
|
||||
path: 'login',
|
||||
component: LoginComponent,
|
||||
canMatch: [guestOnlyCanMatch],
|
||||
canActivate: [guestOnlyCanActivate]
|
||||
|
||||
},
|
||||
{
|
||||
path : 'profile',
|
||||
path: 'profile',
|
||||
component: ProfileComponent,
|
||||
canMatch: [authOnlyCanMatch],
|
||||
canActivate: [authOnlyCanMatch]
|
||||
},
|
||||
{
|
||||
path : 'admin',
|
||||
path: 'admin',
|
||||
component: AdminComponent,
|
||||
canMatch: [adminOnlyCanMatch],
|
||||
canActivate: [adminOnlyCanActivate]
|
||||
},
|
||||
{
|
||||
path : 'products',
|
||||
path: 'products',
|
||||
component: ProductsComponent,
|
||||
canMatch: [authOnlyCanMatch],
|
||||
canActivate: [authOnlyCanActivate]
|
||||
canActivate: [authOnlyCanActivate],
|
||||
},
|
||||
{
|
||||
path : 'add-product',
|
||||
component: AddProductComponent,
|
||||
canMatch: [authOnlyCanMatch],
|
||||
canActivate: [authOnlyCanActivate]
|
||||
},
|
||||
{
|
||||
path : '**',
|
||||
path: '**',
|
||||
redirectTo: ''
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user