Skip to content

Commit

Permalink
Fix: Prevent console-warning on correct plugin config (#1392)
Browse files Browse the repository at this point in the history
* Get rid of warning about 'preset' not being part of active plugins: it's core nowadays, hence it can be hard-coded as active.

* Bug fix: the 'missing plugins' message was not so silent after all. Fixed. Shows only if it detects something.

---------

Co-authored-by: Jacob Wodzyński <[email protected]>
  • Loading branch information
sweco-semara and jacobwod authored Sep 5, 2023
1 parent b9f77e2 commit c71518d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions new-client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ class App extends React.PureComponent {
t.toLowerCase()
);

// Let's push some built-in core elements, that previously were plugins
// and that still have their config there.
lowerCaseActiveTools.push("preset");

// Check which plugins defined in mapConfig don't exist in buildConfig
const unsupportedToolsFoundInMapConfig = this.props.config.mapConfig.tools
.map((t) => t.type.toLowerCase())
Expand All @@ -445,11 +449,12 @@ class App extends React.PureComponent {
});

// Display a silent info message in console
console.log(
`The map configuration contains unavailable plugins: ${unsupportedToolsFoundInMapConfig.join(
", "
)}. Please check your map config and buildConfig.json. `
);
unsupportedToolsFoundInMapConfig.length > 0 &&
console.info(
`The map configuration contains unavailable plugins: ${unsupportedToolsFoundInMapConfig.join(
", "
)}. Please check your map config and buildConfig.json. `
);
};
/**
* @summary Initiates the wanted analytics model (if any).
Expand Down

0 comments on commit c71518d

Please sign in to comment.