-
Notifications
You must be signed in to change notification settings - Fork 9
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
PB-871 : add debug UI and URL params to override URLs used by data integration team - #minor #1025
Conversation
web-mapviewer Run #3135
Run Properties:
|
Project |
web-mapviewer
|
Branch Review |
feat-PB-871-debug-tools-for-url
|
Run status |
Passed #3135
|
Run duration | 05m 29s |
Commit |
5061ab6bbf: PB-871 : keep base URL config objects private
|
Committer | Pascal Barth |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
21
|
Skipped |
0
|
Passing |
210
|
View all changes introduced in this branch ↗︎ |
af6b508
to
4549f62
Compare
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.
I like the idea of the debug modal to set the url backend.
However having the override check every where in code were we need the backend doesn't seem a good approach.
I would consider having a new approach, now the backend urls are hardcoded as constant in a javascript file, we should have a library that returns the backend urls for each backend, so instead of having API_BASE_URL
we would have a function getApiBaseUrl()
or even better having a singleton class Backends
from which we could as for any backend base url. Then this class would be responsible to override any url if needed. In future we could also consider that the backend urls are not anymore hardcoded in the config but would be asked from the backend at map.geo.admin/api/backends
great, thank you @pakb the identify request is done with the localhost url but the htmlpopup is still done by sys-api3.int.bgdi.ch. |
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.
This helps us a lot for the DI. Beside of the feedback from @ltclm about the popup, it seems to work fine. I'm looking forward to get it merged
4549f62
to
99dc934
Compare
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.
I like your idea to split the config into several files 👍🏼
supporting API3, WMS and WMTS base URL overrides. Changing calls to functions using these base URLs from the config.js so that they now prioritize the debug value if defined.
named like they were in the mf-geoadmin3's code
it otherwise creates a circular dependency and some part of the tests can't load properly (LV95 is imported from config.js, which requires something in utils.js, which requires something in config.js, etc...)
Trying to gather common config together in a meaningfully named config file. Adding function to get base URLs, instead of direct access to constants. So that we have the opportunity to override base URLs. I didn't want to go through the store to do that. Doing so would create a lot of circular dependencies between the store, the config and components. As it's a debug tool, that's "good enough" this way.
moving slash enforcing function back to where other base URLs are in the config
and only export/share function to access them. Also clearing the layers config cache whenever a base URL changes. Changing the API3 URL would not trigger a new layer config load without that.
6e16b4f
to
5061ab6
Compare
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.
Just change the one from my last comment and you good to merge
Test link