diff --git a/kibicara-frontend/src/app/app-routing.module.ts b/kibicara-frontend/src/app/app-routing.module.ts index 650e109..c0521ab 100644 --- a/kibicara-frontend/src/app/app-routing.module.ts +++ b/kibicara-frontend/src/app/app-routing.module.ts @@ -1,25 +1,22 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { NotFoundComponent } from './shared/not-found/not-found.component'; -import { HomepageComponent } from './homepage/homepage.component'; -import { LoginComponent } from './auth/login/login.component'; -import { RegisterComponent } from './auth/register/register.component'; -import { OrganizerspageComponent } from './organizerspage/organizerspage.component'; -import { HoodspageComponent } from './hoodspage/hoodspage.component'; -import { HoodpageComponent } from './hoodpage/hoodpage.component'; import { SharedModule } from './shared/shared.module'; -import { ConfirmComponent } from './auth/confirm/confirm.component'; import { EmailConfirmationComponent } from './platforms/email/email-confirmation/email-confirmation.component'; import { EmailUnsubscribeComponent } from './platforms/email/email-unsubscribe/email-unsubscribe.component'; const routes: Routes = [ - { path: '', component: HomepageComponent }, - { path: 'login', component: LoginComponent }, - { path: 'register', component: RegisterComponent }, - { path: 'confirm', component: ConfirmComponent }, - { path: 'organizers', component: OrganizerspageComponent }, - { path: 'hoods', component: HoodspageComponent }, - { path: 'hoods/:id', component: HoodpageComponent }, + { + path: '', + loadChildren: () => + import('./public-pages/public-pages.module').then( + (m) => m.PublicPagesModule + ), + }, + { + path: '', + loadChildren: () => import('./auth/auth.module').then((m) => m.AuthModule), + }, { path: 'hoods/:id/email-confirm', component: EmailConfirmationComponent }, { path: 'hoods/:id/email-unsubscribe', component: EmailUnsubscribeComponent }, { diff --git a/kibicara-frontend/src/app/app.component.html b/kibicara-frontend/src/app/app.component.html index 4a6e26e..6c0b0b6 100644 --- a/kibicara-frontend/src/app/app.component.html +++ b/kibicara-frontend/src/app/app.component.html @@ -1,5 +1,4 @@
-
- + \ No newline at end of file diff --git a/kibicara-frontend/src/app/app.module.ts b/kibicara-frontend/src/app/app.module.ts index ee86cd1..4bd84a5 100644 --- a/kibicara-frontend/src/app/app.module.ts +++ b/kibicara-frontend/src/app/app.module.ts @@ -1,56 +1,29 @@ -import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; - import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { SharedModule } from './shared/shared.module'; -import { HomepageComponent } from './homepage/homepage.component'; -import { OrganizerspageComponent } from './organizerspage/organizerspage.component'; import { DashboardModule } from './dashboard/dashboard.module'; -import { HoodpageComponent } from './hoodpage/hoodpage.component'; -import { HoodspageComponent } from './hoodspage/hoodspage.component'; import { ApiModule } from './core/api/api.module'; -import { - HttpClientModule, - HTTP_INTERCEPTORS, - HttpClient, -} from '@angular/common/http'; +import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { BASE_PATH } from './core/api/variables'; import { environment } from 'src/environments/environment'; -import { LoginComponent } from './auth/login/login.component'; -import { RegisterComponent } from './auth/register/register.component'; -import { ReactiveFormsModule } from '@angular/forms'; import { AuthTokenInterceptor } from './core/auth/auth-token.interceptor'; -import { ConfirmComponent } from './auth/confirm/confirm.component'; import { ErrorInterceptor } from './core/auth/error.interceptor'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MarkdownModule } from 'ngx-markdown'; -import { PlatformsModule } from './platforms/platforms.module'; -import { FaqComponent } from './homepage/faq/faq.component'; +import { PublicPagesModule } from './public-pages/public-pages.module'; +import { AuthModule } from './auth/auth.module'; @NgModule({ - declarations: [ - AppComponent, - HomepageComponent, - OrganizerspageComponent, - HoodpageComponent, - HoodspageComponent, - LoginComponent, - RegisterComponent, - ConfirmComponent, - FaqComponent, - ], + declarations: [AppComponent], imports: [ - BrowserModule, AppRoutingModule, SharedModule, DashboardModule, + PublicPagesModule, + AuthModule, ApiModule, HttpClientModule, - ReactiveFormsModule, BrowserAnimationsModule, - PlatformsModule, - MarkdownModule.forRoot({ loader: HttpClient }), ], providers: [ { provide: BASE_PATH, useValue: environment.API_BASE_PATH }, diff --git a/kibicara-frontend/src/app/auth/auth-routing.module.ts b/kibicara-frontend/src/app/auth/auth-routing.module.ts new file mode 100644 index 0000000..51d33d8 --- /dev/null +++ b/kibicara-frontend/src/app/auth/auth-routing.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { LoginComponent } from './login/login.component'; +import { RegisterComponent } from './register/register.component'; +import { ConfirmComponent } from './confirm/confirm.component'; + +const routes: Routes = [ + { + path: '', + children: [ + { path: 'login', component: LoginComponent }, + { path: 'register', component: RegisterComponent }, + { path: 'confirm', component: ConfirmComponent }, + ], + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class AuthRoutingModule {} diff --git a/kibicara-frontend/src/app/auth/auth.module.ts b/kibicara-frontend/src/app/auth/auth.module.ts new file mode 100644 index 0000000..338c461 --- /dev/null +++ b/kibicara-frontend/src/app/auth/auth.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { AuthRoutingModule } from './auth-routing.module'; +import { ConfirmComponent } from './confirm/confirm.component'; +import { RegisterComponent } from './register/register.component'; +import { LoginComponent } from './login/login.component'; +import { SharedModule } from '../shared/shared.module'; + +@NgModule({ + declarations: [ConfirmComponent, LoginComponent, RegisterComponent], + imports: [AuthRoutingModule, SharedModule], +}) +export class AuthModule {} diff --git a/kibicara-frontend/src/app/homepage/faq/faq.component.html b/kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.html similarity index 100% rename from kibicara-frontend/src/app/homepage/faq/faq.component.html rename to kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.html diff --git a/kibicara-frontend/src/app/homepage/faq/faq.component.scss b/kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.scss similarity index 100% rename from kibicara-frontend/src/app/homepage/faq/faq.component.scss rename to kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.scss diff --git a/kibicara-frontend/src/app/homepage/faq/faq.component.spec.ts b/kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.spec.ts similarity index 100% rename from kibicara-frontend/src/app/homepage/faq/faq.component.spec.ts rename to kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.spec.ts diff --git a/kibicara-frontend/src/app/homepage/faq/faq.component.ts b/kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.ts similarity index 100% rename from kibicara-frontend/src/app/homepage/faq/faq.component.ts rename to kibicara-frontend/src/app/public-pages/homepage/faq/faq.component.ts diff --git a/kibicara-frontend/src/app/homepage/homepage.component.html b/kibicara-frontend/src/app/public-pages/homepage/homepage.component.html similarity index 100% rename from kibicara-frontend/src/app/homepage/homepage.component.html rename to kibicara-frontend/src/app/public-pages/homepage/homepage.component.html diff --git a/kibicara-frontend/src/app/homepage/homepage.component.scss b/kibicara-frontend/src/app/public-pages/homepage/homepage.component.scss similarity index 93% rename from kibicara-frontend/src/app/homepage/homepage.component.scss rename to kibicara-frontend/src/app/public-pages/homepage/homepage.component.scss index 4e72f4e..37ced6f 100644 --- a/kibicara-frontend/src/app/homepage/homepage.component.scss +++ b/kibicara-frontend/src/app/public-pages/homepage/homepage.component.scss @@ -34,7 +34,7 @@ } .banner { - background: url("../../assets/hoods3.jpg"); + background: url("../../../assets/hoods3.jpg"); background-size: 100%; display: block; width: 100%; @@ -72,7 +72,7 @@ } .banner2 { - background: url("../../assets/hoods3.jpg"); + background: url("../../../assets/hoods3.jpg"); background-size: 100%; display: block; width: 100%; diff --git a/kibicara-frontend/src/app/homepage/homepage.component.spec.ts b/kibicara-frontend/src/app/public-pages/homepage/homepage.component.spec.ts similarity index 100% rename from kibicara-frontend/src/app/homepage/homepage.component.spec.ts rename to kibicara-frontend/src/app/public-pages/homepage/homepage.component.spec.ts diff --git a/kibicara-frontend/src/app/homepage/homepage.component.ts b/kibicara-frontend/src/app/public-pages/homepage/homepage.component.ts similarity index 100% rename from kibicara-frontend/src/app/homepage/homepage.component.ts rename to kibicara-frontend/src/app/public-pages/homepage/homepage.component.ts diff --git a/kibicara-frontend/src/app/hoodpage/hoodpage.component.html b/kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.html similarity index 100% rename from kibicara-frontend/src/app/hoodpage/hoodpage.component.html rename to kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.html diff --git a/kibicara-frontend/src/app/hoodpage/hoodpage.component.scss b/kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.scss similarity index 100% rename from kibicara-frontend/src/app/hoodpage/hoodpage.component.scss rename to kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.scss diff --git a/kibicara-frontend/src/app/hoodpage/hoodpage.component.spec.ts b/kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.spec.ts similarity index 100% rename from kibicara-frontend/src/app/hoodpage/hoodpage.component.spec.ts rename to kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.spec.ts diff --git a/kibicara-frontend/src/app/hoodpage/hoodpage.component.ts b/kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.ts similarity index 92% rename from kibicara-frontend/src/app/hoodpage/hoodpage.component.ts rename to kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.ts index 1fbb3f3..ce54cef 100644 --- a/kibicara-frontend/src/app/hoodpage/hoodpage.component.ts +++ b/kibicara-frontend/src/app/public-pages/hoodpage/hoodpage.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { HoodsService, BodyHood } from '../core/api'; +import { HoodsService, BodyHood } from '../../core/api'; import { first } from 'rxjs/operators'; @Component({ diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.html b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.html similarity index 100% rename from kibicara-frontend/src/app/hoodspage/hoodspage.component.html rename to kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.html diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.scss b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.scss similarity index 95% rename from kibicara-frontend/src/app/hoodspage/hoodspage.component.scss rename to kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.scss index fa8ba37..27de6d3 100644 --- a/kibicara-frontend/src/app/hoodspage/hoodspage.component.scss +++ b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.scss @@ -28,7 +28,7 @@ h1 { } .banner { - background: url("../../assets/hoods1.jpg"); + background: url("../../../assets/hoods1.jpg"); background-size: 100%; width: 100%; } diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.spec.ts b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.spec.ts similarity index 100% rename from kibicara-frontend/src/app/hoodspage/hoodspage.component.spec.ts rename to kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.spec.ts diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.ts similarity index 87% rename from kibicara-frontend/src/app/hoodspage/hoodspage.component.ts rename to kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.ts index e21275a..81afa9a 100644 --- a/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts +++ b/kibicara-frontend/src/app/public-pages/hoodspage/hoodspage.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { HoodsService } from '../core/api/api/hoods.service'; +import { HoodsService } from '../../core/api/api/hoods.service'; @Component({ selector: 'app-hoodspage', diff --git a/kibicara-frontend/src/app/organizerspage/organizerspage.component.html b/kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.html similarity index 100% rename from kibicara-frontend/src/app/organizerspage/organizerspage.component.html rename to kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.html diff --git a/kibicara-frontend/src/app/organizerspage/organizerspage.component.scss b/kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.scss similarity index 100% rename from kibicara-frontend/src/app/organizerspage/organizerspage.component.scss rename to kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.scss diff --git a/kibicara-frontend/src/app/organizerspage/organizerspage.component.spec.ts b/kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.spec.ts similarity index 100% rename from kibicara-frontend/src/app/organizerspage/organizerspage.component.spec.ts rename to kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.spec.ts diff --git a/kibicara-frontend/src/app/organizerspage/organizerspage.component.ts b/kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.ts similarity index 100% rename from kibicara-frontend/src/app/organizerspage/organizerspage.component.ts rename to kibicara-frontend/src/app/public-pages/organizerspage/organizerspage.component.ts diff --git a/kibicara-frontend/src/app/public-pages/public-pages-routing.module.ts b/kibicara-frontend/src/app/public-pages/public-pages-routing.module.ts new file mode 100644 index 0000000..2342208 --- /dev/null +++ b/kibicara-frontend/src/app/public-pages/public-pages-routing.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { HomepageComponent } from './homepage/homepage.component'; +import { PublicPagesComponent } from './public-pages.component'; +import { OrganizerspageComponent } from './organizerspage/organizerspage.component'; +import { HoodspageComponent } from './hoodspage/hoodspage.component'; +import { HoodpageComponent } from './hoodpage/hoodpage.component'; + +const routes: Routes = [ + { + path: '', + component: PublicPagesComponent, + children: [ + { path: '', component: HomepageComponent }, + { path: 'organizers', component: OrganizerspageComponent }, + { path: 'hoods', component: HoodspageComponent }, + { path: 'hoods/:id', component: HoodpageComponent }, + ], + }, +]; + +@NgModule({ + declarations: [], + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class PublicPagesRoutingModule {} diff --git a/kibicara-frontend/src/app/public-pages/public-pages.component.html b/kibicara-frontend/src/app/public-pages/public-pages.component.html new file mode 100644 index 0000000..4cca73f --- /dev/null +++ b/kibicara-frontend/src/app/public-pages/public-pages.component.html @@ -0,0 +1,2 @@ + + diff --git a/kibicara-frontend/src/app/public-pages/public-pages.component.scss b/kibicara-frontend/src/app/public-pages/public-pages.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/kibicara-frontend/src/app/public-pages/public-pages.component.spec.ts b/kibicara-frontend/src/app/public-pages/public-pages.component.spec.ts new file mode 100644 index 0000000..6eae741 --- /dev/null +++ b/kibicara-frontend/src/app/public-pages/public-pages.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PublicPagesComponent } from './public-pages.component'; + +describe('PublicPagesComponent', () => { + let component: PublicPagesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PublicPagesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PublicPagesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/kibicara-frontend/src/app/public-pages/public-pages.component.ts b/kibicara-frontend/src/app/public-pages/public-pages.component.ts new file mode 100644 index 0000000..aef0c49 --- /dev/null +++ b/kibicara-frontend/src/app/public-pages/public-pages.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-public-pages', + templateUrl: './public-pages.component.html', + styleUrls: ['./public-pages.component.scss'] +}) +export class PublicPagesComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/kibicara-frontend/src/app/public-pages/public-pages.module.ts b/kibicara-frontend/src/app/public-pages/public-pages.module.ts new file mode 100644 index 0000000..1b77d62 --- /dev/null +++ b/kibicara-frontend/src/app/public-pages/public-pages.module.ts @@ -0,0 +1,37 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HomepageComponent } from './homepage/homepage.component'; +import { HoodspageComponent } from './hoodspage/hoodspage.component'; +import { HoodpageComponent } from './hoodpage/hoodpage.component'; +import { OrganizerspageComponent } from './organizerspage/organizerspage.component'; +import { FaqComponent } from './homepage/faq/faq.component'; +import { SharedModule } from '../shared/shared.module'; +import { PlatformsModule } from '../platforms/platforms.module'; +import { MarkdownModule } from 'ngx-markdown'; +import { HttpClient } from '@angular/common/http'; +import { PublicPagesComponent } from './public-pages.component'; +import { PublicPagesRoutingModule } from './public-pages-routing.module'; + +@NgModule({ + declarations: [ + HomepageComponent, + HoodspageComponent, + HoodpageComponent, + OrganizerspageComponent, + FaqComponent, + PublicPagesComponent, + ], + imports: [ + SharedModule, + PlatformsModule, + MarkdownModule.forRoot({ loader: HttpClient }), + PublicPagesRoutingModule, + ], + exports: [ + HomepageComponent, + HoodspageComponent, + HoodpageComponent, + OrganizerspageComponent, + ], +}) +export class PublicPagesModule {} diff --git a/kibicara-frontend/src/app/shared/shared.module.ts b/kibicara-frontend/src/app/shared/shared.module.ts index c8eebc1..ec06533 100644 --- a/kibicara-frontend/src/app/shared/shared.module.ts +++ b/kibicara-frontend/src/app/shared/shared.module.ts @@ -38,6 +38,7 @@ import { FooterComponent } from './footer/footer.component'; FormsModule, CommonModule, Ng2SearchPipeModule, + RouterModule, ], }) export class SharedModule {}