From b73a74cf3814c279661f0a3906baf651a11a5d05 Mon Sep 17 00:00:00 2001 From: Christopher Cook Date: Sat, 13 Aug 2016 16:45:42 +0800 Subject: [PATCH] Bunch of UI updates --- API/Testing/package.json | 18 ++ .../components/place-search/place-search.html | 26 +-- .../components/poi-details/poi-details.html | 4 +- .../app/components/poi-details/poi-details.ts | 42 +++-- .../route-planner/route-planner.html | 6 + .../components/route-planner/route-planner.ts | 38 +--- .../app/core/ocm/services/APIClient.ts | 2 +- .../app/core/ocm/services/AppManager.ts | 25 ++- .../core/ocm/services/GoogleMapsDirections.ts | 4 +- .../app/core/ocm/services/JourneyManager.ts | 4 +- .../app/core/ocm/services/POIManager.ts | 33 ++-- .../ocm-app/app/pages/comment/comment.ts | 19 +- .../ocm-app/app/pages/journeys/journeys.ts | 18 +- .../app/pages/mediaupload/mediaupload.ts | 2 +- .../app/pages/poi-details/poi-details.scss | 6 + .../app/pages/poi-details/poi-details.ts | 2 +- .../ocm-app/app/pages/profile/profile.ts | 14 +- .../pages/route-planner/route-planner.html | 34 ++++ .../pages/route-planner/route-planner.scss | 3 + .../app/pages/route-planner/route-planner.ts | 26 +++ .../ocm-app/app/pages/search/search.html | 15 +- .../ocm-app/app/pages/search/search.scss | 31 ++- App/Ionic2/ocm-app/app/pages/search/search.ts | 35 +++- .../ocm-app/app/pages/settings/settings.ts | 5 +- App/Ionic2/ocm-app/app/pages/signin/signin.ts | 23 ++- App/Ionic2/ocm-app/app/theme/app.core.scss | 5 + .../ocm-app/app/theme/app.variables.scss | 2 +- App/Ionic2/ocm-app/config.xml | 178 +++++++++--------- App/Ionic2/ocm-app/package.json | 17 +- App/Ionic2/ocm-app/tasks.todo | 10 + App/Ionic2/ocm-app/www/index.html | 2 +- 31 files changed, 419 insertions(+), 230 deletions(-) create mode 100644 API/Testing/package.json create mode 100644 App/Ionic2/ocm-app/app/pages/route-planner/route-planner.html create mode 100644 App/Ionic2/ocm-app/app/pages/route-planner/route-planner.scss create mode 100644 App/Ionic2/ocm-app/app/pages/route-planner/route-planner.ts create mode 100644 App/Ionic2/ocm-app/tasks.todo diff --git a/API/Testing/package.json b/API/Testing/package.json new file mode 100644 index 0000000..622e513 --- /dev/null +++ b/API/Testing/package.json @@ -0,0 +1,18 @@ +{ + "name": "ocm-api-testing", + "version": "1.0.0", + "description": "Test suite for OCM API calls", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": { + "chai": "^3.5.0" + }, + "devDependencies": {}, + "scripts": { + "test": "mocha" + }, + "author": "", + "license": "ISC" +} diff --git a/App/Ionic2/ocm-app/app/components/place-search/place-search.html b/App/Ionic2/ocm-app/app/components/place-search/place-search.html index 86758bc..4e804ed 100644 --- a/App/Ionic2/ocm-app/app/components/place-search/place-search.html +++ b/App/Ionic2/ocm-app/app/components/place-search/place-search.html @@ -1,17 +1,17 @@ - \ No newline at end of file diff --git a/App/Ionic2/ocm-app/app/components/poi-details/poi-details.html b/App/Ionic2/ocm-app/app/components/poi-details/poi-details.html index c7e4ce7..25fc9b2 100644 --- a/App/Ionic2/ocm-app/app/components/poi-details/poi-details.html +++ b/App/Ionic2/ocm-app/app/components/poi-details/poi-details.html @@ -16,7 +16,7 @@

{{poi.AddressInfo.Title}} OCM-{{poi.ID}}

@@ -152,7 +152,7 @@

{{item.ConnectionType?.Title}} {{ 'ocm.details.advancedDetails' | translate }} + {{ 'ocm.details.advancedDetails' | translate }} diff --git a/App/Ionic2/ocm-app/app/components/poi-details/poi-details.ts b/App/Ionic2/ocm-app/app/components/poi-details/poi-details.ts index 0bd02e0..dca5553 100644 --- a/App/Ionic2/ocm-app/app/components/poi-details/poi-details.ts +++ b/App/Ionic2/ocm-app/app/components/poi-details/poi-details.ts @@ -1,11 +1,12 @@ import { Component, Input, OnInit } from '@angular/core'; import {DatePipe} from '@angular/common'; -import {NavController, NavParams, ViewController, Modal, ActionSheet} from 'ionic-angular'; +import {NavController, NavParams, ViewController, ModalController, ActionSheetController} from 'ionic-angular'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; import {AppManager} from '../../core/ocm/services/AppManager'; import {MediaUploadPage} from '../../pages/mediaupload/mediaupload'; import {CommentPage} from '../../pages/comment/comment'; import {FavouriteEditorPage} from '../../pages/journeys/favourite-editor'; +import {Logging} from '../../core/ocm/services/Logging'; @Component({ @@ -20,14 +21,21 @@ export class PoiDetails implements OnInit { selectedTab: string; json: string; - constructor(private appManager: AppManager, private nav: NavController, private translate: TranslateService, private view: ViewController) { + constructor( + private appManager: AppManager, + private nav: NavController, + private translate: TranslateService, + private view: ViewController, + private logging: Logging, + private modalController: ModalController, + private actionSheetController: ActionSheetController) { } - ngOnInit() { + ngOnChanges() { + this.logging.log("In ngOnChanges of POI Details"); - //this.json = JSON.stringify(this.poi, null, 1); if (this.poi == null || this.poi.AddressInfo == null) { alert("Got null POI"); @@ -51,6 +59,16 @@ export class PoiDetails implements OnInit { this.poi._hasComments = false; } } + + ngOnInit() { + + //this.json = JSON.stringify(this.poi, null, 1); + this.logging.log("In ngInit of POI Details"); + + + } + + get staticMapURL(): string { //scale=2 for retina @@ -76,11 +94,11 @@ export class PoiDetails implements OnInit { addComment() { if (this.appManager.isUserAuthenticated()) { - let modal = Modal.create(CommentPage, { + let modal = this.modalController.create(CommentPage, { id: this.poi.ID, poi: this.poi }); - this.nav.present(modal); + modal.present(); } else { this.appManager.showToastNotification(this.nav, "Please Sign In (see Profile tab)"); } @@ -89,11 +107,11 @@ export class PoiDetails implements OnInit { addMedia() { if (this.appManager.isUserAuthenticated()) { - let modal = Modal.create(MediaUploadPage, { + let modal = this.modalController.create(MediaUploadPage, { id: this.poi.ID, poi: this.poi }); - this.nav.present(modal); + modal.present(); } else { this.appManager.showToastNotification(this.nav, "Please Sign In (see Profile tab)"); } @@ -112,7 +130,7 @@ export class PoiDetails implements OnInit { //show action sheet to decide what to do with new favourite - let actionSheet = ActionSheet.create({ + let actionSheet = this.actionSheetController.create({ title: 'Add Favourite', buttons: [ { @@ -120,11 +138,11 @@ export class PoiDetails implements OnInit { handler: () => { //show add to journey modal - let modal = Modal.create(FavouriteEditorPage, { + let modal = this.modalController.create(FavouriteEditorPage, { poi: this.poi }); - this.nav.present(modal); + modal.present(); } }, { text: 'Add as Favourite', @@ -140,7 +158,7 @@ export class PoiDetails implements OnInit { } ] }); - this.nav.present(actionSheet); + actionSheet.present(); } launchNavigation() { diff --git a/App/Ionic2/ocm-app/app/components/route-planner/route-planner.html b/App/Ionic2/ocm-app/app/components/route-planner/route-planner.html index b7a03f2..0e43e91 100644 --- a/App/Ionic2/ocm-app/app/components/route-planner/route-planner.html +++ b/App/Ionic2/ocm-app/app/components/route-planner/route-planner.html @@ -47,6 +47,12 @@

{{placeSearchRouteDestination.selectedPlace?.name}}

+ + + Energy Efficiency (kWh Per km) + + + diff --git a/App/Ionic2/ocm-app/app/components/route-planner/route-planner.ts b/App/Ionic2/ocm-app/app/components/route-planner/route-planner.ts index 00819f5..cd610a7 100644 --- a/App/Ionic2/ocm-app/app/components/route-planner/route-planner.ts +++ b/App/Ionic2/ocm-app/app/components/route-planner/route-planner.ts @@ -25,9 +25,10 @@ export class RoutePlanner { private routePolyline: string; private routeCalcInProgress: boolean = false; private advancedSettingsMode: boolean = false; + private kWhPerKM: number; constructor(private mapping: Mapping, private directions: GoogleMapsDirections, private logging: Logging, private journeyManager: JourneyManager, private changeDetector: ChangeDetectorRef, private numberPipe: DecimalPipe) { - + this.kWhPerKM = 0.212; //Model S = ~0.24, Leaf = ~0.212 } get isRouteSet(): boolean { @@ -83,6 +84,7 @@ export class RoutePlanner { return hours + " hours " + (mins > 0 ? mins + " mins" : ""); } } + calculateRoute() { if (this.routeStartPlace != null && this.routeDestinationPlace != null) { //start a new route discovery @@ -104,7 +106,7 @@ export class RoutePlanner { neLL, swLL ); - this.journeyRoutes = this.directions.analyseRoutes(result); + this.journeyRoutes = this.directions.analyseRoutes(result, this.kWhPerKM); if (this.journeyRoutes.length > 0) this.selectedJourneyRoute = this.journeyRoutes[0]; //Require event emmiter for route changes to notify map @@ -123,36 +125,4 @@ export class RoutePlanner { } } - public placeSelectedOld(item: PlaceSearchResult) { - let placeSearchType = "test"; - let searchKeyword = item.Title; - - //move map to selected place - - this.logging.log("Looking up place details:" + item.ReferenceID); - var attributionDiv = document.getElementById("place-attribution"); - var service = new google.maps.places.PlacesService(attributionDiv); - - (service).getDetails({ placeId: item.ReferenceID }, (place, status) => { - if (status == google.maps.places.PlacesServiceStatus.OK) { - this.logging.log("Got place details:" + place.name); - - if (placeSearchType == 'routeStart') { - this.logging.log("Changed route start:" + place.name); - this.routeStartPlace = place; - } - if (placeSearchType == 'routeDestination') { - this.logging.log("Changed route destination:" + place.name); - this.routeDestinationPlace = place; - } - - - - } else { - this.logging.log("Failed to fetch place:" + status.toString()); - } - }); - - } - } diff --git a/App/Ionic2/ocm-app/app/core/ocm/services/APIClient.ts b/App/Ionic2/ocm-app/app/core/ocm/services/APIClient.ts index 3bf64d1..9c6e2cc 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/services/APIClient.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/services/APIClient.ts @@ -96,7 +96,7 @@ export class APIClient extends Base { }) .catch((error) => { let errMsg = error.message || 'Could not fetch POI list from server.'; - this.log("API Client: " + errMsg, LogLevel.ERROR); + this.log("API Client: " + JSON.stringify(error), LogLevel.ERROR); return Observable.throw(errMsg); }); } else { diff --git a/App/Ionic2/ocm-app/app/core/ocm/services/AppManager.ts b/App/Ionic2/ocm-app/app/core/ocm/services/AppManager.ts index a19d4b7..8e657ba 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/services/AppManager.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/services/AppManager.ts @@ -5,7 +5,7 @@ import {APIClient} from './APIClient'; import {Http} from '@angular/http'; import {Injectable} from '@angular/core'; -import {Events, NavController, Platform, Toast, Loading} from 'ionic-angular'; +import {Events, NavController, Platform, ToastController, LoadingController, Loading} from 'ionic-angular'; import {TranslateService} from 'ng2-translate/ng2-translate'; import {Base, LogLevel} from '../Base'; import {JwtHelper} from 'angular2-jwt'; @@ -31,7 +31,18 @@ export class AppManager extends Base { public isRequestInProgress: boolean = false; - constructor(public http: Http, public events: Events, public api: APIClient, public submissionQueue: SubmissionQueue, private platform: Platform, public referenceDataManager: ReferenceDataManager, public journeyManager: JourneyManager, public translateService: TranslateService) { + constructor( + public http: Http, + public events: Events, + public api: APIClient, + public submissionQueue: SubmissionQueue, + private platform: Platform, + public referenceDataManager: ReferenceDataManager, + public journeyManager: JourneyManager, + public translateService: TranslateService, + private toastController: ToastController, + private loadingController: LoadingController + ) { super(); this.api.clientName = "ocm.app.ionic.v6_0_0"; this.isDebugMode = false; @@ -176,26 +187,26 @@ export class AppManager extends Base { } public showToastNotification(nav: NavController, msg: string) { - let toast = Toast.create({ + let toast = this.toastController.create({ message: msg, duration: 3000, }); - toast.onDismiss(() => { + toast.onDidDismiss(() => { this.log('Dismissed toast'); }); - nav.present(toast); + toast.present(); } public showLoadingProgress(nav: NavController, msg: string) { - this.loading = Loading.create({ + this.loading = this.loadingController.create({ content: msg, dismissOnPageChange: true }); - nav.present(this.loading); + this.loading.present(); } public dismissLoadingProgress(): Promise { return this.loading.dismiss(); diff --git a/App/Ionic2/ocm-app/app/core/ocm/services/GoogleMapsDirections.ts b/App/Ionic2/ocm-app/app/core/ocm/services/GoogleMapsDirections.ts index dab0b8c..5029c65 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/services/GoogleMapsDirections.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/services/GoogleMapsDirections.ts @@ -44,7 +44,7 @@ export class GoogleMapsDirections { }); } - public analyseRoutes(routeResults: google.maps.DirectionsResult): Array { + public analyseRoutes(routeResults: google.maps.DirectionsResult,kWhPerKM:number ): Array { let journeyRoutes = new Array(); //analyse power consumption of the routes and summarise the route routeResults.routes.forEach(route => { @@ -58,7 +58,7 @@ export class GoogleMapsDirections { route.legs.forEach(leg => { let durationsSeconds = leg.duration.value; let distanceKM = leg.distance.value / 1000; - let powerConsumption = this.journeyManager.calculateEnergyConsumptionkWh(distanceKM, 0); + let powerConsumption = this.journeyManager.calculateEnergyConsumptionkWh(distanceKM, 0, null, kWhPerKM); let journeyLeg = new JourneyRouteLeg(); journeyLeg.DistanceKM = distanceKM; diff --git a/App/Ionic2/ocm-app/app/core/ocm/services/JourneyManager.ts b/App/Ionic2/ocm-app/app/core/ocm/services/JourneyManager.ts index 656d54b..4e1b0a7 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/services/JourneyManager.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/services/JourneyManager.ts @@ -250,12 +250,12 @@ export class JourneyManager extends Base { } - public calculateEnergyConsumptionkWh(distanceKM: number, speedKPH: number, elevationDelta: number = 0): number { + public calculateEnergyConsumptionkWh(distanceKM: number, speedKPH: number, elevationDelta: number = 0, kWhPerKM:number): number { //given an input speed in km/h for a given distance, calculate an estimate of required energy consumption in kwh, optionally account for elevation change. //let totalkWhCapacity = 21; //average vehicle energy efficiency in Kilowatt Hours consumed per Kilometer travelled - let kWhPerKM = 0.212; //Model S = ~0.24, Leaf = ~0.212 + //let kWhPerKM = 0.212; //Model S = ~0.24, Leaf = ~0.212 let totalPowerRequiredkWh = distanceKM * kWhPerKM; diff --git a/App/Ionic2/ocm-app/app/core/ocm/services/POIManager.ts b/App/Ionic2/ocm-app/app/core/ocm/services/POIManager.ts index 6ca0aee..35ecfaf 100644 --- a/App/Ionic2/ocm-app/app/core/ocm/services/POIManager.ts +++ b/App/Ionic2/ocm-app/app/core/ocm/services/POIManager.ts @@ -10,35 +10,40 @@ import {Base, LogLevel} from '../Base'; import {POISearchParams} from '../Model/AppModels'; import {APIClient} from './APIClient'; import {ReferenceDataManager} from './ReferenceDataManager'; - +import {Subscription} from 'rxjs/Subscription'; @Injectable() export class POIManager extends Base { poiList; - isRequestInProgress:boolean=false; - - constructor(private api:APIClient, private events:Events) { + isRequestInProgress: boolean = false; + + constructor(private api: APIClient, private events: Events) { super(); } - public fetchPOIList(searchParams: POISearchParams) { + public fetchPOIList(searchParams: POISearchParams): Observable { this.isRequestInProgress = true; - return this.api.fetchPOIListByParam(searchParams) - .subscribe( - (results:Array) => { - console.log('fetched POI list ['+results.length+']'); + let poiFetchObservable = this.api.fetchPOIListByParam(searchParams); + + poiFetchObservable.subscribe( + (results: Array) => { + console.log('fetched POI list [' + results.length + ']'); this.poiList = results; this.events.publish('ocm:poiList:updated'); //this.appManager.isRequestInProgress = false; }, (reason) => { - alert(JSON.stringify(reason)); + this.isRequestInProgress = false; + Observable.throw(reason); + } - ); + ); + + return poiFetchObservable; } public clearResults() { @@ -69,9 +74,9 @@ export class POIManager extends Base { var params = { poiIdList: [poiId] } - - - return this.api.fetchPOIListByParam(params).map((res)=>{ + + + return this.api.fetchPOIListByParam(params).map((res) => { return res[0]; }); } diff --git a/App/Ionic2/ocm-app/app/pages/comment/comment.ts b/App/Ionic2/ocm-app/app/pages/comment/comment.ts index 9d3529a..619eab5 100644 --- a/App/Ionic2/ocm-app/app/pages/comment/comment.ts +++ b/App/Ionic2/ocm-app/app/pages/comment/comment.ts @@ -1,5 +1,5 @@ import {Component, NgZone} from '@angular/core'; -import {NavController, NavParams, Modal, Alert, Loading, ViewController } from 'ionic-angular'; +import {NavController, NavParams, LoadingController, ViewController } from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {UserComment} from '../../core/ocm/model/AppModels'; @@ -15,7 +15,14 @@ export class CommentPage { commentTypes: any; checkinTypes: any; - constructor(private navParams: NavParams, private appManager: AppManager, private nav: NavController, private view: ViewController, private zone: NgZone) { + constructor( + private navParams: NavParams, + private appManager: AppManager, + private nav: NavController, + private view: ViewController, + private zone: NgZone, + private loadingController: LoadingController + ) { this.commentModel = { ChargePointID: this.navParams.get('id'), @@ -42,15 +49,12 @@ export class CommentPage { } add() { - let loading = Loading.create({ + let loading = this.loadingController.create({ content: "Sending ..", dismissOnPageChange: true }); - this.nav.present(loading); - - //alert("Would submit "+JSON.stringify(this.commentModel)); - + loading.present(); this.appManager.submitComment(this.commentModel).then((response) => { this.appManager.log("Comment submitted"); @@ -59,7 +63,6 @@ export class CommentPage { } ); - }, (rejection) => { this.appManager.showToastNotification(this.nav, "There was a problem submitting your comment."); diff --git a/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts b/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts index 768f48c..3bcb083 100644 --- a/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts +++ b/App/Ionic2/ocm-app/app/pages/journeys/journeys.ts @@ -1,5 +1,5 @@ import {Component} from '@angular/core'; -import {Modal, NavController, Alert} from 'ionic-angular'; +import {ModalController, NavController, AlertController} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {Journey, WayPoint, GeoLatLng} from '../../core/ocm/model/AppModels'; import {JourneyManager} from '../../core/ocm/services/JourneyManager'; @@ -15,7 +15,13 @@ import {POIDetailsPage} from '../poi-details/poi-details'; */ export class JourneysPage { - constructor(private appManager: AppManager, private nav: NavController, private journeyManager: JourneyManager, private api: APIClient) { + constructor( + private appManager: AppManager, + private nav: NavController, + private journeyManager: JourneyManager, + private api: APIClient, + private modalController: ModalController, + private alertController: AlertController) { //this.discoverImages(); @@ -48,8 +54,8 @@ export class JourneysPage { } viewPOIDetails(poi) { - var poiDetailsModal = Modal.create(POIDetailsPage, { item: poi }); - this.nav.present(poiDetailsModal); + var poiDetailsModal = this.modalController.create(POIDetailsPage, { item: poi }); + poiDetailsModal.present(); } get staticMapSize(): string { @@ -68,7 +74,7 @@ export class JourneysPage { } deleteJourney(journeyId){ - let confirm = Alert.create({ + let confirm = this.alertController.create({ title: 'Delete this Journey?', message: 'Are you sure you want to delete this Journey?', buttons: [ @@ -87,7 +93,7 @@ export class JourneysPage { ] }); - this.nav.present(confirm); + confirm.present(); } launchNavigation(){ diff --git a/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts b/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts index 865dac3..86fe2f9 100644 --- a/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts +++ b/App/Ionic2/ocm-app/app/pages/mediaupload/mediaupload.ts @@ -1,5 +1,5 @@ import {Component} from '@angular/core'; -import {NavController, NavParams, Modal, Alert, ViewController} from 'ionic-angular'; +import {NavController, NavParams, ViewController} from 'ionic-angular'; import {AppManager} from '../../core/ocm/services/AppManager'; import {Camera} from 'ionic-native'; diff --git a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.scss b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.scss index 2a33f72..4b8c4e0 100644 --- a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.scss +++ b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.scss @@ -49,5 +49,11 @@ ion-label { overflow: inherit; + white-space: pre-line; + } + ion-item { + p{ + + } } } \ No newline at end of file diff --git a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts index 4394569..530c5ad 100644 --- a/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts +++ b/App/Ionic2/ocm-app/app/pages/poi-details/poi-details.ts @@ -1,5 +1,5 @@ import {Component} from '@angular/core'; -import {NavController, NavParams, ViewController, Modal, ActionSheet} from 'ionic-angular'; +import {NavController, NavParams, ViewController} from 'ionic-angular'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; import {DatePipe} from '@angular/common'; import {PoiDetails} from '../../components/poi-details/poi-details'; diff --git a/App/Ionic2/ocm-app/app/pages/profile/profile.ts b/App/Ionic2/ocm-app/app/pages/profile/profile.ts index 6febb4e..eeb7653 100644 --- a/App/Ionic2/ocm-app/app/pages/profile/profile.ts +++ b/App/Ionic2/ocm-app/app/pages/profile/profile.ts @@ -1,5 +1,5 @@ import {Component} from '@angular/core'; -import {NavController, Modal, Alert} from 'ionic-angular'; +import {NavController, ModalController} from 'ionic-angular'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; import {AppManager} from '../../core/ocm/services/AppManager'; import {SignInPage} from '../signin/signin'; @@ -13,7 +13,11 @@ import {CommentPage} from '../comment/comment'; export class ProfilePage { userProfile: any; - constructor(public appManager: AppManager, public nav: NavController, private translate:TranslateService) { + constructor( + public appManager: AppManager, + public nav: NavController, + private translate:TranslateService, + private modalController:ModalController) { } @@ -35,14 +39,14 @@ export class ProfilePage { showSignInModal() { //navigate to sign in page - let signInModal = Modal.create(SignInPage, { Profile: this.userProfile }); + let signInModal = this.modalController.create(SignInPage, { Profile: this.userProfile }); - signInModal.onDismiss(() => { + signInModal.onDidDismiss(() => { //may have an updated user profile this.refreshProfileView(); }); - this.nav.present(signInModal); + signInModal.present(); } signOut() { diff --git a/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.html b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.html new file mode 100644 index 0000000..044543b --- /dev/null +++ b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.html @@ -0,0 +1,34 @@ + + + + Route Planner + + + + + + + Route Planner + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.scss b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.scss new file mode 100644 index 0000000..07afa63 --- /dev/null +++ b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.scss @@ -0,0 +1,3 @@ +.route-planner { + +} diff --git a/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.ts b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.ts new file mode 100644 index 0000000..e21a941 --- /dev/null +++ b/App/Ionic2/ocm-app/app/pages/route-planner/route-planner.ts @@ -0,0 +1,26 @@ +import { Component } from '@angular/core'; +import { NavController, ViewController } from 'ionic-angular'; +import { RoutePlanner} from '../../components/route-planner/route-planner'; +/* + Generated class for the RoutePlannerPage page. + + See http://ionicframework.com/docs/v2/components/#navigation for more info on + Ionic pages and navigation. +*/ +@Component({ + templateUrl: 'build/pages/route-planner/route-planner.html', + directives:[RoutePlanner] +}) +export class RoutePlannerPage { + + constructor(private nav: NavController, private view: ViewController) { + + } + + + close() { + this.view.dismiss(); + } + + +} diff --git a/App/Ionic2/ocm-app/app/pages/search/search.html b/App/Ionic2/ocm-app/app/pages/search/search.html index dcd2c49..a212beb 100644 --- a/App/Ionic2/ocm-app/app/pages/search/search.html +++ b/App/Ionic2/ocm-app/app/pages/search/search.html @@ -1,5 +1,5 @@ - + @@ -12,11 +12,14 @@ [placeholder]="'ocm.search.performSearch' | translate" [debounce]="500"> + - @@ -34,7 +37,7 @@
- + @@ -63,6 +66,12 @@ +
    +
  • Browse the map to find charging locations. Select a location to see the full details.
  • +
  • Zoom in to the region you are interested in to see all charging locations.
  • +
  • You can use the route planner to start planning a journey. Use the 'Save' option when viewing + a charging location to create or add to a Journey.
  • +