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

Invalid plugin configuration in backend example configs #1391

Closed
sweco-semara opened this issue Aug 31, 2023 · 1 comment · Fixed by #1393
Closed

Invalid plugin configuration in backend example configs #1391

sweco-semara opened this issue Aug 31, 2023 · 1 comment · Fixed by #1393
Labels
Milestone

Comments

@sweco-semara
Copy link
Contributor

Hajk backend map config examples contains an invalid plugin configuration. Specifically "bookmark" plugin, which does not exist.

To Reproduce

  1. Use either .NET or NodeJS backend-based config with backend/mapservice/App_Data/map_1.json or new-client/public/simpleMapConfig.json as base
  2. Open browser console
  3. (Re-)load the map
  4. Check browser console

Expected behavior
Quiet/empty console on using Hajk-supplied config examples. (Currently also expects an empty warning, see also #1390, but the point in this bug report is that a specific error report is not expected after reproducing per above...)

Actual
Console warning:

App.js:396 The map configuration contains unavailable plugins: bookmark. Please check your map config and buildConfig.json.

Root Cause Analysis
I think this might be a Hajk 2 leftover in the demo/example config? The bookmarks plugin in Hajk 3 seems to be introduced in #655 and from what I can see it has always been named with a plural "s"?

Suggested Solution
Simplest fix is probably to just rename "bookmark" to "boomarks" in both of the following example configs?

  1. .NET backend sample config map_1.json L437 in current master
  2. NodeJS backend sample config map_1.json L440 in current master

(Not backwards compatible as a new plugin would then start showing in the demos, so another way to get rid of the warning is to just remove the whole plugin/tool config for "bookmark" from both files... But I think Hajk does not need to maintain a status quo for demo configs?)

@jacobwod
Copy link
Member

jacobwod commented Sep 4, 2023

Hi @sweco-semara,

I absolutely agree. In fact, I've fixed it (outside of upstream though, so you had almost no chance finding it) in b10b50a and 89cdefa.

The first commit ensures that preset is forced into the array we check against. preset is a special case as it can exist in the map config object but can never be a part of the activeTools object and will thus always show up as a warning without this.

The second commit ensures that we don't print an empty message.

Feel free to implement your solution though, as mine was never part of the main branch. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants