From 67bb904770897970d2ed27651230b6993d3d46a4 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Tue, 26 Sep 2017 16:22:54 +0100 Subject: [PATCH 01/15] Package added & npm updated --- package-lock.json | 9 +++++++-- package.json | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c53884..b3325ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,14 @@ { - "name": "coreui-angular", - "version": "1.0.0-alpha.5", + "name": "localloop-web", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { + "@agm/core": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@agm/core/-/core-1.0.0-beta.1.tgz", + "integrity": "sha512-IVwQGmcaE42SmYY2e5QwqOC0vrSXZCW8BhATY0Vpy3NjbiydSXi9T81hVqKLvuKaB3ves1sv3W++SB1Wj+5B6A==" + }, "@angular-devkit/build-optimizer": { "version": "0.0.13", "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.0.13.tgz", diff --git a/package.json b/package.json index 9c56d35..1fd8e65 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ }, "private": true, "dependencies": { + "@agm/core": "^1.0.0-beta.1", "@angular/common": "4.0.3", "@angular/compiler": "4.0.3", "@angular/core": "4.0.3", From 40bd7459b5e5c683eaea3e3a7792c2746cf387ed Mon Sep 17 00:00:00 2001 From: piratefinn Date: Tue, 26 Sep 2017 17:31:40 +0100 Subject: [PATCH 02/15] Map page added with map --- src/app/dashboard/dashboard.module.ts | 9 ++++++++ src/app/dashboard/dashboard.routing.ts | 7 +++++++ src/app/dashboard/map.component.html | 19 +++++++++++++++++ src/app/dashboard/map.component.ts | 24 ++++++++++++++++++++++ src/app/layouts/full-layout.component.html | 5 +++++ src/scss/_custom.scss | 6 ++++++ 6 files changed, 70 insertions(+) create mode 100644 src/app/dashboard/map.component.html create mode 100644 src/app/dashboard/map.component.ts diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts index 134d8bd..f584ef4 100644 --- a/src/app/dashboard/dashboard.module.ts +++ b/src/app/dashboard/dashboard.module.ts @@ -4,6 +4,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ChartsModule } from 'ng2-charts/ng2-charts'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { NgxPaginationModule } from 'ngx-pagination'; +import { AgmCoreModule } from '@agm/core'; import { CurrencyPipe } from '@angular/common'; @@ -14,6 +15,7 @@ import { AddDataComponent } from './add-data.component'; import { FeedbackComponent } from './feedback.component'; import { TransactionLogComponent } from './transaction-log.component'; import { PayrollLogComponent } from './payroll-log.component'; +import { MapComponent } from './map.component'; import { GraphWidget } from '../widgets/graph-widget.component'; import { OrgBarSnippetComponent } from '../snippets/org-snippet-bar.component'; @@ -25,6 +27,9 @@ import { OrgTableComponent } from '../shared/org-table.component'; import { TransactionResultComponent } from '../shared/transaction-result.component'; import { PayrollResultComponent } from '../shared/payroll-result.component'; +// API key env variable import +import { environment } from '../../environments/environment'; + @NgModule({ imports: [ // Angular imports @@ -32,6 +37,9 @@ import { PayrollResultComponent } from '../shared/payroll-result.component'; FormsModule, ReactiveFormsModule, ChartsModule, + AgmCoreModule.forRoot({ + apiKey: environment.mapApiKey + }), BsDropdownModule, NgxPaginationModule, DashboardRoutingModule, @@ -47,6 +55,7 @@ import { PayrollResultComponent } from '../shared/payroll-result.component'; TransactionResultComponent, PayrollLogComponent, PayrollResultComponent, + MapComponent, FeedbackComponent, GraphWidget, OrgBarSnippetComponent, diff --git a/src/app/dashboard/dashboard.routing.ts b/src/app/dashboard/dashboard.routing.ts index c36cfb2..f28c65e 100644 --- a/src/app/dashboard/dashboard.routing.ts +++ b/src/app/dashboard/dashboard.routing.ts @@ -13,6 +13,7 @@ import { AddDataComponent } from './add-data.component'; import { FeedbackComponent } from './feedback.component'; import { TransactionLogComponent } from './transaction-log.component'; import { PayrollLogComponent } from './payroll-log.component'; +import { MapComponent } from './map.component'; // Using child path to allow for FullLayout theming const routes: Routes = [ @@ -49,6 +50,12 @@ const routes: Routes = [ component: TransactionLogComponent, data: { title: 'Transaction Log' }, }, + { + path: 'map', + component: MapComponent, + data: { title: 'Supplier Map' }, + canActivate: [OrgGuard], + }, { path: 'payroll-log', component: PayrollLogComponent, diff --git a/src/app/dashboard/map.component.html b/src/app/dashboard/map.component.html new file mode 100644 index 0000000..27ce4c7 --- /dev/null +++ b/src/app/dashboard/map.component.html @@ -0,0 +1,19 @@ +
+
+
+
+
+ Supplier Map + Required Data marked in bold. +
+
+ + + + + +
+
+
+
+
diff --git a/src/app/dashboard/map.component.ts b/src/app/dashboard/map.component.ts new file mode 100644 index 0000000..233ad94 --- /dev/null +++ b/src/app/dashboard/map.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { Http, Response } from '@angular/http'; +import { ApiService } from '../providers/api-service'; +import { AgmCoreModule } from '@agm/core'; +import 'rxjs/add/operator/map'; + +@Component({ + templateUrl: 'map.component.html', +}) +export class MapComponent implements OnInit { + + lat: number = 54.0466; + lng: number = 2.8007; + + constructor( + private http: Http, + private api: ApiService, + ) { } + + ngOnInit(): void { + + } + +} diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html index 17f0b57..f92357c 100644 --- a/src/app/layouts/full-layout.component.html +++ b/src/app/layouts/full-layout.component.html @@ -40,6 +40,11 @@ Enter Feedback +