From 0d69e3be08f231d57c92f8640720d369880e96bf Mon Sep 17 00:00:00 2001 From: luis cespedes Date: Mon, 5 May 2025 18:25:45 -0400 Subject: [PATCH] arreglo de imports y ruta 404 --- angular.json | 20 ++++------- package-lock.json | 9 ----- package.json | 1 - src/app/app.routes.ts | 35 ++++++++++--------- .../route-animations.component.ts | 2 +- .../pages/not-found/not-found.component.html | 1 + .../pages/not-found/not-found.component.scss | 0 .../not-found/not-found.component.spec.ts | 23 ++++++++++++ .../pages/not-found/not-found.component.ts | 11 ++++++ src/main.ts | 1 - 10 files changed, 60 insertions(+), 43 deletions(-) create mode 100644 src/app/pages/not-found/not-found.component.html create mode 100644 src/app/pages/not-found/not-found.component.scss create mode 100644 src/app/pages/not-found/not-found.component.spec.ts create mode 100644 src/app/pages/not-found/not-found.component.ts diff --git a/angular.json b/angular.json index 71b043a..3bc0b7a 100644 --- a/angular.json +++ b/angular.json @@ -37,22 +37,14 @@ "node_modules/primeflex/primeflex.css", "node_modules/primeicons/primeicons.css" ], - "scripts": [] + "scripts": [], + "allowedCommonJsDependencies": [ + "file-saver", + "exceljs" + ] }, "configurations": { "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "4kB", - "maximumError": "8kB" - } - ], "outputHashing": "all" }, "development": { @@ -105,4 +97,4 @@ "cli": { "analytics": false } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7e5f768..1172b77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@angular/platform-browser": "^19.2.0", "@angular/platform-browser-dynamic": "^19.2.0", "@angular/router": "^19.2.0", - "@fortawesome/fontawesome-free": "^6.7.2", "@primeng/themes": "^19.1.0", "animate.css": "^4.1.1", "exceljs": "^4.4.0", @@ -2871,14 +2870,6 @@ "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "license": "MIT" }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz", - "integrity": "sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==", - "engines": { - "node": ">=6" - } - }, "node_modules/@inquirer/checkbox": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.1.5.tgz", diff --git a/package.json b/package.json index b61c3c5..1027dfe 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "@angular/platform-browser": "^19.2.0", "@angular/platform-browser-dynamic": "^19.2.0", "@angular/router": "^19.2.0", - "@fortawesome/fontawesome-free": "^6.7.2", "@primeng/themes": "^19.1.0", "animate.css": "^4.1.1", "exceljs": "^4.4.0", diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 4026757..0eb0acf 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,6 +1,5 @@ import { Routes } from '@angular/router'; import { LoginComponent } from './pages/login/login.component'; -import { SidebarComponent } from './components/sidebar/sidebar.component'; import { LayoutComponent } from './components/layout/layout.component'; import { HomeComponent } from './pages/home/home.component'; import { ConcesionesComponent } from './pages/concesiones/concesiones.component'; @@ -9,23 +8,25 @@ import { AjustePdComponent } from './pages/ajuste-pd/ajuste-pd.component'; import { ResumenComponent } from './pages/resumen/resumen.component'; import { UnidadInformacionComponent } from './pages/unidad-informacion/unidad-informacion.component'; import { authGuard } from './guards/auth.guard'; +import { NotFoundComponent } from './pages/not-found/not-found.component'; export const routes: Routes = [ - { path: 'login', component: LoginComponent }, + { path: 'login', component: LoginComponent }, + { + path: '', + component: LayoutComponent, + canActivate: [authGuard], + children: [ + { path: '', redirectTo: 'inicio', pathMatch: 'full' }, + { path: 'inicio', component: HomeComponent, data: { title: 'Inicio' } }, + { path: 'unidad-concesiones', component: ConcesionesComponent, data: { title: 'Unidad de Concesiones' } }, + { path: 'ct-actualizacion', component: ActualizacionPdComponent, data: { title: 'Cronograma temporal por actualización de PD' } }, + { path: 'ct-ajuste', component: AjustePdComponent, data: { title: 'Cronograma temporal por ajuste de PD' } }, + { path: 'resumen', component: ResumenComponent, data: { title: 'Resumen' } }, + { path: 'unidad-informacion', component: UnidadInformacionComponent, data: { title: 'Unidad de Información' } }, + { path: '404', component: NotFoundComponent }, + ] + }, + { path: '**', redirectTo: '404' } - { - path: '', - component: LayoutComponent, - canActivate: [authGuard], - children: [ - { path: '', redirectTo: 'inicio', pathMatch: 'full' }, - { path: 'inicio', component: HomeComponent, data: { title: 'Inicio' } }, - { path: 'unidad-concesiones', component: ConcesionesComponent, data: { title: 'Unidad de Concesiones' } }, - { path: 'ct-actualizacion', component: ActualizacionPdComponent, data: { title: 'Cronograma temporal por actualización de PD' } }, - { path: 'ct-ajuste', component: AjustePdComponent , data: { title: 'Cronograma temporal por ajuste de PD' } }, - { path: 'resumen', component: ResumenComponent, data: { title: 'Resumen' } }, - { path: 'unidad-informacion', component: UnidadInformacionComponent, data: { title: 'Unidad de Información' } }, - ] - }, - { path: '**', redirectTo: 'inicio' } ]; diff --git a/src/app/components/route-animations/route-animations.component.ts b/src/app/components/route-animations/route-animations.component.ts index 3c14139..b4c5402 100644 --- a/src/app/components/route-animations/route-animations.component.ts +++ b/src/app/components/route-animations/route-animations.component.ts @@ -29,7 +29,7 @@ export class RouteAnimationsComponent implements OnDestroy { // Animaciones disponibles private animations: string[] = [ - 'animate__fadeIn' + 'animate__fadeIn', ]; private routerSub: Subscription; diff --git a/src/app/pages/not-found/not-found.component.html b/src/app/pages/not-found/not-found.component.html new file mode 100644 index 0000000..f6dfa5e --- /dev/null +++ b/src/app/pages/not-found/not-found.component.html @@ -0,0 +1 @@ +

no hay nada aca

\ No newline at end of file diff --git a/src/app/pages/not-found/not-found.component.scss b/src/app/pages/not-found/not-found.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/not-found/not-found.component.spec.ts b/src/app/pages/not-found/not-found.component.spec.ts new file mode 100644 index 0000000..5b65d9e --- /dev/null +++ b/src/app/pages/not-found/not-found.component.spec.ts @@ -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; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NotFoundComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NotFoundComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/not-found/not-found.component.ts b/src/app/pages/not-found/not-found.component.ts new file mode 100644 index 0000000..ca66fc5 --- /dev/null +++ b/src/app/pages/not-found/not-found.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-not-found', + imports: [], + templateUrl: './not-found.component.html', + styleUrl: './not-found.component.scss' +}) +export class NotFoundComponent { + +} diff --git a/src/main.ts b/src/main.ts index a4c0e16..35b00f3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; -import '@fortawesome/fontawesome-free/css/all.min.css'; bootstrapApplication(AppComponent, appConfig) .catch((err) => console.error(err));