Skip to content
Snippets Groups Projects
Commit 0234bd8d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

allow plugin to open left panel

parent 86b9482c
No related branches found
No related tags found
1 merge request!306Resolve "Allow plugin to hide left panel"
...@@ -4,6 +4,7 @@ minerva-front (19.0.0~alpha.0) stable; urgency=medium ...@@ -4,6 +4,7 @@ minerva-front (19.0.0~alpha.0) stable; urgency=medium
* Feature: allow plugin to add menu option to context menu (#307) * Feature: allow plugin to add menu option to context menu (#307)
* Feature: allow plugin to access info about opened panel (#309) * Feature: allow plugin to access info about opened panel (#309)
* Feature: allow plugin to hide opened panel (#309) * Feature: allow plugin to hide opened panel (#309)
* Feature: allow plugin to open left panel (#309)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 18 Oct 2024 13:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Fri, 18 Oct 2024 13:00:00 +0200
......
...@@ -40,3 +40,13 @@ window.minerva.map.data.hidePanel('available-plugins'); ...@@ -40,3 +40,13 @@ window.minerva.map.data.hidePanel('available-plugins');
//close the panel (regardless which one is opened) //close the panel (regardless which one is opened)
window.minerva.map.data.hidePanel('available-plugins'); window.minerva.map.data.hidePanel('available-plugins');
``` ```
#### OpenPanel
Open specified panel.
##### Example of openPanel method usage:
```javascript
window.minerva.map.data.openPanel('available-plugins');
```
...@@ -77,6 +77,7 @@ declare global { ...@@ -77,6 +77,7 @@ declare global {
interface: { interface: {
getOpenedPanel: typeof getOpenedPanel; getOpenedPanel: typeof getOpenedPanel;
hidePanel: typeof hidePanel; hidePanel: typeof hidePanel;
openPanel: typeof openPanel;
}; };
overviewImage: { overviewImage: {
getCurrentOverviewImage: typeof getCurrentOverviewImage; getCurrentOverviewImage: typeof getCurrentOverviewImage;
......
import { store } from '@/redux/store';
import { DrawerName } from '@/types/drawerName';
import { openDrawer } from '@/redux/drawer/drawer.slice';
export const openPanel = (panelName: DrawerName): void => {
const { dispatch } = store;
dispatch(openDrawer(panelName));
};
...@@ -11,6 +11,7 @@ import { minervaDefine } from '@/services/pluginsManager/map/minervaDefine'; ...@@ -11,6 +11,7 @@ import { minervaDefine } from '@/services/pluginsManager/map/minervaDefine';
import { PluginsContextMenu } from '@/services/pluginsManager/pluginContextMenu/pluginsContextMenu'; import { PluginsContextMenu } from '@/services/pluginsManager/pluginContextMenu/pluginsContextMenu';
import { getOpenedPanel } from '@/services/pluginsManager/interface/getOpenedPanel'; import { getOpenedPanel } from '@/services/pluginsManager/interface/getOpenedPanel';
import { hidePanel } from '@/services/pluginsManager/interface/hidePanel'; import { hidePanel } from '@/services/pluginsManager/interface/hidePanel';
import { openPanel } from '@/services/pluginsManager/interface/openPanel';
import { bioEntitiesMethods } from './bioEntities'; import { bioEntitiesMethods } from './bioEntities';
import { getModels } from './map/models/getModels'; import { getModels } from './map/models/getModels';
import { openMap } from './map/openMap'; import { openMap } from './map/openMap';
...@@ -83,6 +84,7 @@ export const PluginsManager: PluginsManagerType = { ...@@ -83,6 +84,7 @@ export const PluginsManager: PluginsManagerType = {
interface: { interface: {
getOpenedPanel, getOpenedPanel,
hidePanel, hidePanel,
openPanel,
}, },
map: { map: {
data: { data: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment