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

Make debug UI background layers configurable with new file debug-ui-config.json #6295

Open
wants to merge 11 commits into
base: dev-2.x
Choose a base branch
from

Conversation

leonardehrenfried
Copy link
Member

Summary

Introduces a new file for configuring the debug UI (debug-ui-config.json) and adds the ability to configure the background layers.

The UI for selecting the background map looks like this:

image

Issue

Closes #6275

Unit tests

Added a few.

Documentation

I added a new configuration page for the new config file and updated a few existing places.

Changelog

Autogenerated.

Bumping the serialization version id

No.

cc @fpurcell

@leonardehrenfried leonardehrenfried requested a review from a team as a code owner December 2, 2024 14:07
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 69.38776% with 30 lines in your changes missing coverage. Please review.

Project coverage is 69.79%. Comparing base (e919778) to head (c6c6c3b).
Report is 4 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...opentripplanner/standalone/config/ConfigModel.java 0.00% 10 Missing ⚠️
...entripplanner/apis/vectortiles/DebugStyleSpec.java 84.84% 5 Missing ⚠️
...entripplanner/standalone/config/DebugUiConfig.java 88.57% 3 Missing and 1 partial ⚠️
...tripplanner/standalone/config/OtpConfigLoader.java 0.00% 4 Missing ⚠️
.../vectortiles/GraphInspectorVectorTileResource.java 0.00% 2 Missing ⚠️
...tripplanner/apis/vectortiles/model/TileSource.java 66.66% 1 Missing ⚠️
...ripplanner/framework/application/OtpFileNames.java 50.00% 0 Missing and 1 partial ⚠️
...nner/standalone/config/configure/ConfigModule.java 0.00% 1 Missing ⚠️
...ner/standalone/configure/ConstructApplication.java 0.00% 1 Missing ⚠️
...standalone/server/DefaultServerRequestContext.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #6295   +/-   ##
==========================================
  Coverage      69.78%   69.79%           
- Complexity     17781    17797   +16     
==========================================
  Files           2017     2019    +2     
  Lines          76040    76126   +86     
  Branches        7781     7786    +5     
==========================================
+ Hits           53067    53130   +63     
- Misses         20269    20289   +20     
- Partials        2704     2707    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t2gran
Copy link
Member

t2gran commented Dec 2, 2024

What should the debug UI be named? In the UI it is called "OTP Debug Client" and here it is called "Debug UI" - We should settle on one name. The name "OTP Debug Client" is taking up too much space. So I suggested to shorten it to just "OTP Debug" - In the UI repeating "UI" or "client" is redundant.

So, maybe use "OTP Debug UI" in doc, "OTP Debug" as title in UI and "debug-ui-config.json" ?

@testower
Copy link
Contributor

testower commented Dec 3, 2024

I'm wondering if this is a little misleading? The debug-ui-config.json doesn't seem to directly configure the debug UI does it? I mean the debug UI code doesn't read the config file. Rather, the config file is read by the OTP application, and it configures some behavior related to the map style endpoint.

I guess my question is, do we want to use this config file also to configure other aspects of the debug UI or just the map styles?

@leonardehrenfried
Copy link
Member Author

We are planning to expand its role to cover other aspects of the debug UI.

@testower
Copy link
Contributor

testower commented Dec 3, 2024

We are planning to expand its role to cover other aspects of the debug UI.

I see, then we are looking at a way to serve this config file directly to the debug UI at runtime, since it then obviously can't be compiled into the static assets. Will it be available via a public endpoint in OTP?

@leonardehrenfried
Copy link
Member Author

I see, then we are looking at a way to serve this config file directly to the debug UI at runtime, since it then obviously can't be compiled into the static assets. Will it be available via a public endpoint in OTP?

There are no concrete plans yet but I also imagine an endpoint from which the debug UI gets the configuration values at runtime.

@testower
Copy link
Contributor

testower commented Dec 3, 2024

I'm ok with this change. My only two cents is that since we are introducing the concept configuration for the debug ui, it seems strange that we don't have a mechanism for the debug ui to fetch it. I suppose it can wait for some actual use case for that.

@leonardehrenfried
Copy link
Member Author

leonardehrenfried commented Dec 3, 2024

We thought about using router-config.json for this particular case, but a Gitter poll showed that almost everyone preferred a separate file for it.

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.

Configurable background map layers for debug UI
3 participants