diff --git a/.angular-cli.json b/.angular-cli.json index 1290020..f7b4f9c 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -24,9 +24,10 @@ ], "environmentSource": "environments/environment.ts", "environments": { - "dev": "environments/environment.ts", + "dev": "environments/environment.dev.ts", "prod": "environments/environment.prod.ts", - "local": "environments/environment.local.ts" + "local": "environments/environment.local.ts", + "ci": "environments/environment.ci.ts" } } ], diff --git a/.gitignore b/.gitignore index f82ac9f..67d6c52 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ testem.log # local env variable /src/environments/environment.local.ts +/src/environments/environment.prod.ts +/src/environments/environment.dev.ts +/src/environments/environment.ci.ts # ========================= # Operating System Files diff --git a/.travis.yml b/.travis.yml index f262434..22ae810 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ addons: language: node_js node_js: - 8 +before_install: + - openssl aes-256-cbc -K $encrypted_9d2af3734b6c_key -iv $encrypted_9d2af3734b6c_iv -in src/environments/environment.ci.ts.enc -out src/environments/environment.ci.ts -d before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start 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..a6bcc31 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,15 @@ "start": "ng serve", "build": "ng build", "test": "ng test", - "test:once": "ng test --watch=false", + "test:ci": "ng test --watch=false --env=ci", "lint": "ng lint", "e2e": "ng e2e", - "ci": "npm run test:once && npm run e2e" + "e2e:ci": "ng e2e --env=ci", + "ci": "npm run test:ci && npm run e2e:ci" }, "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", diff --git a/src/app/dashboard/dashboard.module.ts b/src/app/dashboard/dashboard.module.ts index 134d8bd..a8c59b0 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, GoogleMapsAPIWrapper } 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,13 +55,15 @@ import { PayrollResultComponent } from '../shared/payroll-result.component'; TransactionResultComponent, PayrollLogComponent, PayrollResultComponent, + MapComponent, FeedbackComponent, GraphWidget, OrgBarSnippetComponent, GraphPanel, ], providers: [ - CurrencyPipe + CurrencyPipe, + GoogleMapsAPIWrapper, ], }) export class DashboardModule { } 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..1c408a4 --- /dev/null +++ b/src/app/dashboard/map.component.html @@ -0,0 +1,41 @@ +