Browse Source

feat: Change About module to Map

master
Konstantinos Kamaropoulos 5 years ago
parent
commit
a1d4b30c69
  1. 12
      src/app/about/about.module.ts
  2. 2
      src/app/app-routing.module.ts
  3. 6
      src/app/map/map-routing.module.ts
  4. 0
      src/app/map/map.component.html
  5. 4
      src/app/map/map.component.scss
  6. 12
      src/app/map/map.component.spec.ts
  7. 8
      src/app/map/map.component.ts
  8. 12
      src/app/map/map.module.ts
  9. 16
      src/app/shell/header/header.component.html

12
src/app/about/about.module.ts

@ -1,12 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { AboutRoutingModule } from './about-routing.module';
import { AboutComponent } from './about.component';
@NgModule({
imports: [CommonModule, TranslateModule, AboutRoutingModule],
declarations: [AboutComponent]
})
export class AboutModule {}

2
src/app/app-routing.module.ts

@ -3,7 +3,7 @@ import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { Shell } from '@app/shell/shell.service'; import { Shell } from '@app/shell/shell.service';
const routes: Routes = [ const routes: Routes = [
Shell.childRoutes([{ path: 'about', loadChildren: './about/about.module#AboutModule' }]), Shell.childRoutes([{ path: 'map', loadChildren: './map/map.module#MapModule' }]),
// Fallback when no prior route is matched // Fallback when no prior route is matched
{ path: '**', redirectTo: '', pathMatch: 'full' } { path: '**', redirectTo: '', pathMatch: 'full' }
]; ];

6
src/app/about/about-routing.module.ts → src/app/map/map-routing.module.ts

@ -2,11 +2,11 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { extract } from '@app/core'; import { extract } from '@app/core';
import { AboutComponent } from './about.component'; import { MapComponent } from './map.component';
const routes: Routes = [ const routes: Routes = [
// Module is lazy loaded, see app-routing.module.ts // Module is lazy loaded, see app-routing.module.ts
{ path: '', component: AboutComponent, data: { title: extract('About') } } { path: '', component: MapComponent, data: { title: extract('Map') } }
]; ];
@NgModule({ @NgModule({
@ -14,4 +14,4 @@ const routes: Routes = [
exports: [RouterModule], exports: [RouterModule],
providers: [] providers: []
}) })
export class AboutRoutingModule {} export class MapRoutingModule {}

0
src/app/about/about.component.html → src/app/map/map.component.html

4
src/app/about/about.component.scss → src/app/map/map.component.scss

@ -6,3 +6,7 @@
.mapDiv { .mapDiv {
text-align: left; text-align: left;
} }
.mapboxgl-marker {
cursor: pointer;
}

12
src/app/about/about.component.spec.ts → src/app/map/map.component.spec.ts

@ -1,19 +1,19 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AboutComponent } from './about.component'; import { MapComponent } from './map.component';
describe('AboutComponent', () => { describe('MapComponent', () => {
let component: AboutComponent; let component: MapComponent;
let fixture: ComponentFixture<AboutComponent>; let fixture: ComponentFixture<MapComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [AboutComponent] declarations: [MapComponent]
}).compileComponents(); }).compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(AboutComponent); fixture = TestBed.createComponent(MapComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

8
src/app/about/about.component.ts → src/app/map/map.component.ts

@ -8,11 +8,11 @@ import { LogsService } from '@app/logs.service';
import { interval } from 'rxjs'; import { interval } from 'rxjs';
@Component({ @Component({
selector: 'app-about', selector: 'app-map',
templateUrl: './about.component.html', templateUrl: './map.component.html',
styleUrls: ['./about.component.scss'] styleUrls: ['./map.component.scss']
}) })
export class AboutComponent implements OnInit { export class MapComponent implements OnInit {
version: string | null = environment.version; version: string | null = environment.version;
// data: Array<Object>; // data: Array<Object>;

12
src/app/map/map.module.ts

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MapRoutingModule } from './map-routing.module';
import { MapComponent } from './map.component';
@NgModule({
imports: [CommonModule, TranslateModule, MapRoutingModule],
declarations: [MapComponent]
})
export class MapModule {}

16
src/app/shell/header/header.component.html

@ -15,14 +15,18 @@
<div class="navbar-nav"> <div class="navbar-nav">
<a class="nav-item nav-link text-uppercase" routerLink="/home" routerLinkActive="active"> <a class="nav-item nav-link text-uppercase" routerLink="/home" routerLinkActive="active">
<i class="fas fa-home"></i> <i class="fas fa-home"></i>
<span translate>Home</span> <span translate> Home</span>
</a> </a>
<a class="nav-item nav-link text-uppercase" routerLink="/about" routerLinkActive="active"> <a class="nav-item nav-link text-uppercase" routerLink="/map" routerLinkActive="active">
<i class="fas fa-question-circle"></i> <i class="fas fa-map"></i>
<span translate>About</span> <span translate> Map</span>
</a>
<a class="nav-item nav-link text-uppercase" routerLink="/chart" routerLinkActive="active">
<i class="fas fa-chart-area"></i>
<span translate> Chart</span>
</a> </a>
</div> </div>
<div class="navbar-nav ml-auto"> <!-- <div class="navbar-nav ml-auto">
<div class="nav-item" ngbDropdown display="dynamic" placement="bottom-right"> <div class="nav-item" ngbDropdown display="dynamic" placement="bottom-right">
<a id="language-dropdown" class="nav-link" ngbDropdownToggle>{{ currentLanguage }}</a> <a id="language-dropdown" class="nav-link" ngbDropdownToggle>{{ currentLanguage }}</a>
<div ngbDropdownMenu aria-labelledby="language-dropdown"> <div ngbDropdownMenu aria-labelledby="language-dropdown">
@ -31,7 +35,7 @@
</button> </button>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
</nav> </nav>
</header> </header>

Loading…
Cancel
Save