Skip to content
Snippets Groups Projects
Commit 1e9b0179 authored by Adrian Orłów's avatar Adrian Orłów
Browse files

feat: add drawer available plugins

parent 459df684
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!115feat: add drawer available plugins
Pipeline #84983 passed
import { FetchDataState } from '@/types/fetchDataState';
import { MinervaPlugin } from '@/types/models';
export type PluginsList = FetchDataState<MinervaPlugin[]>;
export type PluginsState = {
list: PluginsList;
};
import { openSearchDrawerWithSelectedTab } from '@/redux/drawer/drawer.slice';
import { createAsyncThunk } from '@reduxjs/toolkit';
import { getDefaultSearchTab } from '@/components/FunctionalArea/TopBar/SearchBar/SearchBar.utils';
import { PROJECT_ID } from '@/constants';
import { openSearchDrawerWithSelectedTab } from '@/redux/drawer/drawer.slice';
import { AppDispatch } from '@/redux/store';
import { QueryData } from '@/types/query';
import { getDefaultSearchTab } from '@/components/FunctionalArea/TopBar/SearchBar/SearchBar.utils';
import { createAsyncThunk } from '@reduxjs/toolkit';
import { getAllBackgroundsByProjectId } from '../backgrounds/backgrounds.thunks';
import { getAllPublicOverlaysByProjectId } from '../overlays/overlays.thunks';
import { getModels } from '../models/models.thunks';
import { getProjectById } from '../project/project.thunks';
import { getConfiguration, getConfigurationOptions } from '../configuration/configuration.thunks';
import {
initMapBackground,
initMapPosition,
initMapSizeAndModelId,
initOpenedMaps,
} from '../map/map.thunks';
import { getSearchData } from '../search/search.thunks';
import { setPerfectMatch } from '../search/search.slice';
import { getSessionValid } from '../user/user.thunks';
import { getModels } from '../models/models.thunks';
import { getInitOverlays } from '../overlayBioEntity/overlayBioEntity.thunk';
import { getConfiguration, getConfigurationOptions } from '../configuration/configuration.thunks';
import { getAllPublicOverlaysByProjectId } from '../overlays/overlays.thunks';
import { getAllPlugins } from '../plugins/plugins.thunks';
import { getProjectById } from '../project/project.thunks';
import { setPerfectMatch } from '../search/search.slice';
import { getSearchData } from '../search/search.thunks';
import { getStatisticsById } from '../statistics/statistics.thunks';
import { getSessionValid } from '../user/user.thunks';
interface InitializeAppParams {
queryData: QueryData;
......@@ -54,6 +55,9 @@ export const fetchInitialAppData = createAsyncThunk<
dispatch(getStatisticsById(PROJECT_ID));
dispatch(getConfiguration());
// Fetch plugins list
dispatch(getAllPlugins());
/** Trigger search */
if (queryData.searchValue) {
dispatch(setPerfectMatch(queryData.perfectMatch));
......
import { BACKGROUND_INITIAL_STATE_MOCK } from '../backgrounds/background.mock';
import { BIOENTITY_INITIAL_STATE_MOCK } from '../bioEntity/bioEntity.mock';
import { CHEMICALS_INITIAL_STATE_MOCK } from '../chemicals/chemicals.mock';
import { COMPARTMENT_PATHWAYS_INITIAL_STATE_MOCK } from '../compartmentPathways/compartmentPathways.mock';
import { CONFIGURATION_INITIAL_STATE } from '../configuration/configuration.adapter';
import { CONTEXT_MENU_INITIAL_STATE } from '../contextMenu/contextMenu.constants';
import { COOKIE_BANNER_INITIAL_STATE_MOCK } from '../cookieBanner/cookieBanner.mock';
import { initialStateFixture as drawerInitialStateMock } from '../drawer/drawerFixture';
import { DRUGS_INITIAL_STATE_MOCK } from '../drugs/drugs.mock';
import { EXPORT_INITIAL_STATE_MOCK } from '../export/export.mock';
import { LEGEND_INITIAL_STATE_MOCK } from '../legend/legend.mock';
import { initialMapStateFixture } from '../map/map.fixtures';
import { MODAL_INITIAL_STATE_MOCK } from '../modal/modal.mock';
import { MODELS_INITIAL_STATE_MOCK } from '../models/models.mock';
import { OVERLAY_BIO_ENTITY_INITIAL_STATE_MOCK } from '../overlayBioEntity/overlayBioEntity.mock';
import { OVERLAYS_INITIAL_STATE_MOCK } from '../overlays/overlays.mock';
import { PLUGINS_INITIAL_STATE_MOCK } from '../plugins/plugins.mock';
import { PROJECT_STATE_INITIAL_MOCK } from '../project/project.mock';
import { REACTIONS_STATE_INITIAL_MOCK } from '../reactions/reactions.mock';
import { SEARCH_STATE_INITIAL_MOCK } from '../search/search.mock';
import { STATISTICS_STATE_INITIAL_MOCK } from '../statistics/statistics.mock';
import { RootState } from '../store';
import { USER_INITIAL_STATE_MOCK } from '../user/user.mock';
import { STATISTICS_STATE_INITIAL_MOCK } from '../statistics/statistics.mock';
import { COMPARTMENT_PATHWAYS_INITIAL_STATE_MOCK } from '../compartmentPathways/compartmentPathways.mock';
import { EXPORT_INITIAL_STATE_MOCK } from '../export/export.mock';
export const INITIAL_STORE_STATE_MOCK: RootState = {
search: SEARCH_STATE_INITIAL_MOCK,
......@@ -43,4 +44,5 @@ export const INITIAL_STORE_STATE_MOCK: RootState = {
statistics: STATISTICS_STATE_INITIAL_MOCK,
compartmentPathways: COMPARTMENT_PATHWAYS_INITIAL_STATE_MOCK,
export: EXPORT_INITIAL_STATE_MOCK,
plugins: PLUGINS_INITIAL_STATE_MOCK,
};
......@@ -22,11 +22,12 @@ import {
TypedStartListening,
configureStore,
} from '@reduxjs/toolkit';
import compartmentPathwaysReducer from './compartmentPathways/compartmentPathways.slice';
import exportReducer from './export/export.slice';
import legendReducer from './legend/legend.slice';
import { mapListenerMiddleware } from './map/middleware/map.middleware';
import pluginsReducer from './plugins/plugins.slice';
import statisticsReducer from './statistics/statistics.slice';
import compartmentPathwaysReducer from './compartmentPathways/compartmentPathways.slice';
import exportReducer from './export/export.slice';
export const reducers = {
search: searchReducer,
......@@ -50,6 +51,7 @@ export const reducers = {
statistics: statisticsReducer,
compartmentPathways: compartmentPathwaysReducer,
export: exportReducer,
plugins: pluginsReducer,
};
export const middlewares = [mapListenerMiddleware.middleware];
......
......@@ -8,4 +8,5 @@ export type DrawerName =
| 'submaps'
| 'reaction'
| 'overlays'
| 'bio-entity';
| 'bio-entity'
| 'available-plugins';
......@@ -37,6 +37,7 @@ import {
overviewImageLinkModel,
} from '@/models/overviewImageLink';
import { overviewImageView } from '@/models/overviewImageView';
import { pluginSchema } from '@/models/pluginSchema';
import { projectSchema } from '@/models/projectSchema';
import { reactionSchema } from '@/models/reaction';
import { reactionLineSchema } from '@/models/reactionLineSchema';
......@@ -88,3 +89,4 @@ export type CompartmentPathway = z.infer<typeof compartmentPathwaySchema>;
export type CompartmentPathwayDetails = z.infer<typeof compartmentPathwayDetailsSchema>;
export type ExportNetwork = z.infer<typeof exportNetworkchema>;
export type ExportElements = z.infer<typeof exportElementsSchema>;
export type MinervaPlugin = z.infer<typeof pluginSchema>; // Plugin type interfers with global Plugin type
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