Skip to content

Commit

Permalink
Merge pull request #106 from ISPC-Bookster/dev
Browse files Browse the repository at this point in the history
Creacion de componente Page-Not-Found - Error
  • Loading branch information
Angelvill321 committed Jun 11, 2024
2 parents b62e9b5 + 6a02f2a commit da1233a
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 16 deletions.
41 changes: 25 additions & 16 deletions Frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,30 @@ import { MasVendidosComponent } from './components/mas-vendidos/mas-vendidos.com
import { authGuard } from './guards/auth-guard';
import { BookDetailsComponent } from './components/book-details/book-details.component';
import { PaymentGatewayComponent } from './components/payment-gateway/payment-gateway.component';

import { NotFoundComponent } from './components/not-found/not-found.component';

export const routes: Routes = [
{path: 'login', component: LoginComponent },
{path: 'landing', component: LandingComponent},
{path: 'busqueda-personalizada', component: BusquedaPersonalizadaComponent},
{path: 'catalogo', component: CatalogoComponent},
{path: 'contacto', component: ContactoComponent},
{path: 'socialnet', component: SocialnetComponent},
{path: 'sobre-nosotros', component: SobreNosotrosComponent},
{path: 'create', component: CreateComponent },
{path: 'dashboard', component: DashboardComponent,canActivate:[authGuard]},
{path: 'mas-vendidos', component:MasVendidosComponent },
{path: 'book/:bookId', component: BookDetailsComponent},
{path: 'pagos', component: PaymentGatewayComponent, canActivate:[authGuard]},
{path: '', redirectTo: '/landing', pathMatch: 'full'},
{path: '**',redirectTo: '/landing', pathMatch: 'full'},
];
{ path: 'login', component: LoginComponent },
{ path: 'landing', component: LandingComponent },
{ path: 'busqueda-personalizada', component: BusquedaPersonalizadaComponent },
{ path: 'catalogo', component: CatalogoComponent },
{ path: 'contacto', component: ContactoComponent },
{ path: 'socialnet', component: SocialnetComponent },
{ path: 'sobre-nosotros', component: SobreNosotrosComponent },
{ path: 'create', component: CreateComponent },
{
path: 'dashboard',
component: DashboardComponent,
canActivate: [authGuard],
},
{ path: 'mas-vendidos', component: MasVendidosComponent },
{ path: 'book/:bookId', component: BookDetailsComponent },
{
path: 'pagos',
component: PaymentGatewayComponent,
canActivate: [authGuard],
},
{ path: 'not-found', component: NotFoundComponent },
{ path: '', redirectTo: '/landing', pathMatch: 'full' },
{ path: '**', redirectTo: '/not-found', pathMatch: 'full' },
];
9 changes: 9 additions & 0 deletions Frontend/src/app/components/not-found/not-found.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.container {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
background-color: #f5f5f5;
flex-direction: column;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="container">
<h1>UPS!!!! No encontramos la página que estas buscando!</h1>
<img width="800px" src="assets/images/eror-404.jpg" alt="pagina error" />

</div>
23 changes: 23 additions & 0 deletions Frontend/src/app/components/not-found/not-found.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NotFoundComponent } from './not-found.component';

describe('NotFoundComponent', () => {
let component: NotFoundComponent;
let fixture: ComponentFixture<NotFoundComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NotFoundComponent]
})
.compileComponents();

fixture = TestBed.createComponent(NotFoundComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions Frontend/src/app/components/not-found/not-found.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-not-found',
standalone: true,
imports: [],
templateUrl: './not-found.component.html',
styleUrl: './not-found.component.css'
})
export class NotFoundComponent {

}
Binary file added Frontend/src/assets/images/eror-404.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da1233a

Please sign in to comment.