Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nav visual instructions base ready #25

Merged
merged 15 commits into from
Aug 7, 2019
Merged

nav visual instructions base ready #25

merged 15 commits into from
Aug 7, 2019

Conversation

TheBigR
Copy link
Contributor

@TheBigR TheBigR commented Aug 6, 2019

No description provided.

Copy link
Member

@shacharmo shacharmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in files and open corresponding issues

@@ -5,4 +5,8 @@
<div class="settingsButtonContainer">
<button mat-raised-button (click)="startNavigation()">Start</button>
</div>
<div class="remaining-distance-display-container">
<span class="remain-span">{{distanceToEndpoint$ | async}} </span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be displayed as integer and in quantizations (for distance of 10-100km should update every 10km, for 1-10km show update every 1km, for 100-1000m show update every 100m an so on).
Also, the display unit should be shown (km/m)

Please add an issue for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#33
please advise - this is not the way to our main competitor works.

constructor(private store: Store<any>) { }

ngOnInit() {
this.distanceToEndpoint$ = this.store.pipe(select(distanceToEndpointSelector));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to be on init.
Can be in constructor or before on the variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved.

}

openSearchPage() {
this.store.dispatch(new SetShowSearchAction({isShowSearch: true}));
}

startNavigation() {
this.store.dispatch(new SetActiveNavAction({isActiveNav: true}));
this.store.dispatch(new SetPhrazeStateAction({phrazeState: PhrazeState.NAVIGATION}));
this.store.dispatch(new SetNextWaypointIndexAction({nextWaypointIndex: 1}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe should be part of set state reducer in order to avoid two actions
Also order matters, next should be before state

@@ -0,0 +1,4 @@
<div class="instructions-container">
in {{distanceToNextWaypoint$ | async}} {{nextWaypointManeuver$ | async}} to {{nextWaypointName$ | async}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark of how to display km/m in proper quantizations.
Maneuver should be shown as image or at least separated to words

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#34


ngOnInit() {

this.distanceToNextWaypoint$ = this.store.pipe(select(nextWaypointDistanceSelector));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be shown only on navigation and otherwise hidden/some value

@@ -13,11 +14,43 @@ export class RoutesService {
constructor(@Inject(BINGPROVIDER_CONFIG) public bingProviderConfig: BingProviderInterface) { }

getRoute(from, to): Observable<any> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor to using store action/effects instead of direct call

}

const resultSubject = new Subject<any>();
const routeDetails: RouteDetails = new class implements RouteDetails {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for new class, just object ({ ... }) with the required properties.
There is no need for this overhead.

routeDetails.routeDuration = routeBase.travelDuration;
routeDetails.routeLegs = indexLegs(routeBase.routeLegs);
routeDetails.routeLegs = mapLegs(routeBase.routeLegs[0].itineraryItems);
routeDetails.routeLegs = indexLegs(routeDetails.routeLegs, routeDetails.routePoints);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexLegs just adds/update the value, it's shouldn't override the routeLegs. i.e. routeLegs should be created one

SetPhrazeStateAction,
SetRouteAction,
SetShowSearchAction
} from './nav.actions';


export const NavState: NavInterface = {
routeDetails: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value is usually separated to another file (nav.init.ts)

const nextWaypointDistance = (action as SetNextWaypointDistanceAction).payload.nextWaypointDistance;
return { ...state, nextWaypointDistance: nextWaypointDistance };
}
case navActionTypes.SET_DISTANCE_TO_ENDPOINT: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be part of SET_NEXT_WAYPOINT_DISTANCE as overall distance doesn't change without distance to next way point

@shacharmo shacharmo merged commit 9827042 into master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants