-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add all routing parameters to debug UI #6370
Add all routing parameters to debug UI #6370
Conversation
…eft side of screen and a lot of other minor changes.
…de arguments logic, moved attribution control and added reset option for boolean arguments.
# Conflicts: # client/package-lock.json # client/package.json # client/src/components/MapView/LayerControl.tsx # client/src/components/SearchBar/SearchBar.tsx # client/src/static/query/tripQuery.tsx
…de arguments logic, moved attribution control and added reset option for boolean arguments.
I would love to see a screenshot. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6370 +/- ##
=============================================
+ Coverage 69.73% 69.77% +0.04%
- Complexity 18023 18051 +28
=============================================
Files 2057 2060 +3
Lines 76978 77122 +144
Branches 7845 7856 +11
=============================================
+ Hits 53678 53812 +134
- Misses 20550 20556 +6
- Partials 2750 2754 +4 ☔ View full report in Codecov by Sentry. |
From the screenshots it looks like this is no longer possible: Screencast.From.2025-01-23.12-53-07.mp4Am I right in thinking this? |
If you're not fetching the schema file from a running OTP instance, do you still need the endpoint that @t2gran added to the Transmodel API? |
I see now this disappeared in refactoring. The refactoring of the debug layer menu, was meant to move from raw DOM manipulation and to React. I missed this. Would appreciate if you could have a look at the debug layer menu and see if there are other issues. It should be possible to recreate this function. I can have a look. |
No, that was a misunderstanding from my part. The schema is now read twice. Once during build, to generate the trip query file used by the client for queries. And once via introspection at runtime, to get the actual schema for the running OTP instance, to generate the complete list of the arguments. Just to be clear. The endpoint is not used/needed. |
Just to be clear on why we both need to read the static schema on compile-time, AND do introspection in the runtime: The former is also needed to generate typescript types (and to generate the query code, which also needs to be present on compile-time for type-checking to work) - whereas the runtime introspection step is there to correctly generate the form components based on the actual schema running on the server. |
I have added the debug layer group toggle functionality requested. |
Screencast.From.2025-01-23.17-44-37.mp4Thanks it works beautifully! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
This PR does one main thing, and also has a side-effect.
The main feature is to dynamically create UI for all arguments in the trip query schema.
The side-effect, but also a feature, is a redesign of the layout of the client.
Issue
Links to issue #6258.
The process for generating UI for all arguments works like this:
When the tool is built a code-gen script is run to create a json structure of the arguments and a trip query. This will make sure that both the trip query and the arguments are based on the current schema.
The json structure is then read by a React component (TripQueryArguments) that generates UI for setting arguments for the trip query. There is a file excluded-arguments.ts that is used to exclude any arguments from being generated. This file is to ensure the main input fields (in the search bar) don't have duplicate inputs.
The generated trip query file is the file used for performing queries in the tool and when opening the query in GraphiQL.
When it comes to the changes in layout there are three main changes: