Skip to content

167 fix parseurl query - #186

Merged
Janekdererste merged 1 commit into
masterfrom
167_parseUrl_is_broken
Apr 4, 2022
Merged

Janekdererste merged 1 commit into
masterfrom
167_parseUrl_is_broken

Conversation

@Janekdererste

@Janekdererste Janekdererste commented Mar 29, 2022 •

Copy link
Copy Markdown
Collaborator
  • Add action which sets all routing params at once
  • Change navbar so that it sets the query points and the routing profile at once
  • make the query store digest the setrutingparamsatonce action

fixes #167

* Change navbar so that it sets the query points and the routing profile at once
* make the query store digest the setrutingparamsatonce action
@Janekdererste
Janekdererste requested a review from easbar March 29, 2022 14:57
@Janekdererste Janekdererste self-assigned this Mar 29, 2022

@easbar easbar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I tested this PR and I can confirm that the rapid route updates after clicking the back button I described in #167 are fixed.

Comment thread src/stores/QueryStore.ts Resolved
Comment thread src/stores/QueryStore.ts
Comment on lines -87 to -90
if (action instanceof SetPoint) {
const newState: QueryStoreState = {
...state,
queryPoints: QueryStore.replacePoint(state.queryPoints, action.point),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very minor, but it looks like you changed the order of the if/else blocks for SetPoint and InvalidatePoint here for no real reason? Without this change it would be a bit easier to see what changed in this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You are right. I changed the order so that SetPoint, AddPoint, SetParametersAtOnce are close to each other. I can put this back however.

@easbar easbar Mar 30, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No no that makes sense then! I wasn't sure this was intentional.

Comment thread src/NavBar.ts
Comment on lines +98 to +100
// we want either all the points replaced from the url or we just have one and we want to replace the one default
// one
const points = parseResult.points.length > 2 ? parseResult.points : this.fillPoints(parseResult.points)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When do we have only a single point and with which default one do we want to replace this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the case, when the url contains only 1 point. Since we don't have information about the index of this point, this assumes that this single point is the starting point.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah ok if I enter only one point in the url the first input field is populated and the second remains empty. So this seems to work :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's what I meant :-)

@Janekdererste
Janekdererste merged commit eeeac7a into master Apr 4, 2022
@Janekdererste
Janekdererste deleted the 167_parseUrl_is_broken branch April 4, 2022 09:44
@karussell karussell added this to the 0.4 milestone Sep 5, 2022
ZeroGxMax pushed a commit to minhhpkp/graphhopper-maps that referenced this pull request Nov 12, 2024
* Add action which sets all routing params at once
* Change navbar so that it sets the query points and the routing profile at once
* make the query store digest the setrutingparamsatonce action
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.

NavBar#parseUrlAndReplaceQuery seems a bit broken

3 participants