Skip to content
Snippets Groups Projects

feat: add drawer available plugins

Merged Adrian Orłów requested to merge MIN-230-0-plugins-drawer-available-plugins into development
2 unresolved threads

Closes MIN-230

Objective:

Implement drawer available plugins with public plugins list

What has been done:

  • redux state for plugins list
  • init loading of all plugins list
  • available plugins drawer
  • components for loading individual plugins (from state or by url)
  • unit tests

Important:

  • Implementation of plugins loading (for use inside the app) is not part of this PR

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 import { pluginSchema } from '@/models/pluginSchema';
2 import { axiosInstance } from '@/services/api/utils/axiosInstance';
3 import { MinervaPlugin } from '@/types/models';
4 import { validateDataUsingZodSchema } from '@/utils/validateDataUsingZodSchema';
5 import { createAsyncThunk } from '@reduxjs/toolkit';
6 import { z } from 'zod';
7 import { apiPath } from '../apiPath';
8
9 export const getAllPlugins = createAsyncThunk(
  • 1 import { publicPluginsListSelector } from '@/redux/plugins/plugins.selectors';
    2 import { DrawerHeading } from '@/shared/DrawerHeading';
    3 import { useSelector } from 'react-redux';
    4 import { LoadPlugin } from './LoadPlugin';
    5 import { LoadPluginFromUrl } from './LoadPluginFromUrl';
    6
    7 export const AvailablePluginsDrawer = (): JSX.Element => {
    8 const publicPlugins = useSelector(publicPluginsListSelector);
    9
    10 return (
    11 <div className="h-full max-h-full" data-testid="available-plugins-drawer">
    12 <DrawerHeading title="Available plugins" />
    13 <div className="flex flex-col gap-6 p-6">
    14 <LoadPluginFromUrl />
    15 {publicPlugins.map(plugin => (
    • I think it would be nice to extract publicPlugins into a separate component like "PublicPlugins" because we will have publicPlugins and non-public plugins which are loaded from the url from the input. It's not important, I might as well extract it when merging your changes to plugin management

    • That's a great idea but this is IMO not worth it as it would impact 3 PRs - this one, yours (regarding plugin management) and mine (regarding second plugin drawer)

    • Please register or sign in to reply
  • LGTM, just 2 little things

  • mateusz-winiarczyk approved this merge request

    approved this merge request

  • Adrian Orłów mentioned in merge request !122 (merged)

    mentioned in merge request !122 (merged)

  • Adrian Orłów mentioned in commit 23f26911

    mentioned in commit 23f26911

  • merged

  • Please register or sign in to reply
    Loading