Skip to content

Show graph data date if available under "Info" - #284

Closed
ratrun wants to merge 3 commits into
graphhopper:masterfrom
ratrun:DataDateVersionInfo
Closed

ratrun wants to merge 3 commits into
graphhopper:masterfrom
ratrun:DataDateVersionInfo

Conversation

@ratrun

@ratrun ratrun commented Nov 13, 2022

Copy link
Copy Markdown
Contributor

I'm missing the graph data date information in the new maps. Therefore I created this PR which shows the OSM data date if availailable and as a fallback the import date. Besides that the graphhopper back-end version is displayed.

Otherwise display import date together with graphhopper back-end version.
@karussell

karussell commented Nov 14, 2022 •

Copy link
Copy Markdown
Member

Would it be fine if we just log this information in the console instead of putting it in the UI for now? We log the Maps version already here: https://github.com/graphhopper/graphhopper-maps/blob/master/src/index.tsx#L33

Comment thread src/sidebar/search/Search.tsx Outdated
Comment on lines +83 to +90
<div className={styles.dataVersionLine}>
{(getApiInfoStore().state.data_date ==='') && (
<div>Import from {getApiInfoStore().state.import_date} </div>
)}
{(getApiInfoStore().state.data_date !=='') && (
<div>Graph data from {getApiInfoStore().state.data_date} </div>
)}
<div>Version {getApiInfoStore().state.version} </div>

@karussell karussell Nov 14, 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.

Accessing the properties from the store directly shouldn't be done (reactjs might cause problems) and instead the props of the function (Search) should be extended or here probably a new argument would be necessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I implemented the suggestion here: e1ab38d

@ratrun

ratrun commented Nov 14, 2022 •

Copy link
Copy Markdown
Contributor Author

Maybe we could put the data/import date into the UI and log the backend version? I believe that the data date is important information for most users, while the exact backend version is only interesting to developers.

@karussell

karussell commented Nov 21, 2022 •

Copy link
Copy Markdown
Member

Maybe we could put the data/import date into the UI and log the backend version?

The problem about the data/import date is that it is not a single value. Behind the scene of our API we have different clusters and so there different values for this and a single value is misleading. But when print this via console.log we know that only devs read it and could comment in the logs about the shortcomings.

@ratrun

ratrun commented Nov 21, 2022 •

Copy link
Copy Markdown
Contributor Author

The problem about the data/import date is that it is not a single value. Behind the scene of our API we have different clusters and so there different values for this and a single value is misleading.

If I understood this correctly then the data/import date would probably need to be moved from the /info endpoint to the route calculation response. Is this what you mean?

@otbutz

otbutz commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

@karussell maybe you could you set the backend information as a header to include it? e.g X-Backend: node1.graphhoper.com

@karussell

karussell commented Nov 23, 2022 •

Copy link
Copy Markdown
Member

@ratrun we could do this, indeed. Will think about it
@otbutz I don't like this much. IMO it won't help and I don't like exposing more details then necessary for various reasons

@ratrun

ratrun commented May 12, 2023

Copy link
Copy Markdown
Contributor Author

Closed in favour of graphhopper/graphhopper#2806

@ratrun ratrun closed this May 12, 2023
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.

3 participants