Skip to content

Commit

Permalink
restore missing toolbar (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Oct 25, 2021
1 parent 3d62038 commit a80fb73
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions geonode_mapstore_client/client/js/hooks/useLazyPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { useEffect, useState } from 'react';
import isEmpty from 'lodash/isEmpty';
import { getPlugins, createPlugin } from '@mapstore/framework/utils/PluginsUtils';
import { getPlugins, createPlugin, isMapStorePlugin } from '@mapstore/framework/utils/PluginsUtils';
import { augmentStore } from '@mapstore/framework/utils/StateUtils';
import join from 'lodash/join';

Expand Down Expand Up @@ -108,7 +108,16 @@ function useLazyPlugins({
});
}
return getPlugins({
...filterRemoved(impls.map(impl => createPlugin(impl.name, impl)), removed)
...filterRemoved(impls.map(impl => {
if (!isMapStorePlugin(impl?.component)) {
// plugin similar to Toolbar implement a selector function
// so need to be parsed separately
return {
[impl.name + 'Plugin']: impl.component
};
}
return createPlugin(impl.name, impl);
}), removed)
});
})
.then((newPlugins) => {
Expand Down

0 comments on commit a80fb73

Please sign in to comment.