fix: conflict
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@
|
||||
"build": "react-app-rewired build",
|
||||
"lint": "eslint . --cache --fix --ext .ts,.tsx",
|
||||
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"pre-install": "node ./scripts/preinstall.js && pnpm install",
|
||||
"prepare": "pnpm build:packages",
|
||||
"pre-commit": "lint-staged",
|
||||
"build:packages": "pnpm -r --filter=./src/plugins/* run build",
|
||||
|
||||
@@ -15,7 +15,7 @@ pluginFolders.forEach((folder) => {
|
||||
// add plugin to package.json
|
||||
const packageJson = require(path.join(pluginFolder, 'package.json'));
|
||||
const packageName = packageJson.name;
|
||||
const packageJsonPath = path.join(__dirname, 'package.json');
|
||||
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
||||
const packageJsonContent = require(packageJsonPath);
|
||||
packageJsonContent.dependencies[packageName] = 'workspace:*';
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ const Index: FC<Props> = ({
|
||||
const pluginSlice: Plugin[] = [];
|
||||
const plugins = PluginKit.getPlugins().filter((plugin) => plugin.activated);
|
||||
|
||||
console.log('default list', plugins);
|
||||
plugins.forEach((plugin) => {
|
||||
console.log('plugininfo ====', plugin);
|
||||
if (type && slug_name) {
|
||||
if (plugin.info.slug_name === slug_name && plugin.info.type === type) {
|
||||
pluginSlice.push(plugin);
|
||||
@@ -49,9 +51,6 @@ const Index: FC<Props> = ({
|
||||
* TODO: Rendering control for non-builtin plug-ins
|
||||
* ps: Logic such as version compatibility determination can be placed here
|
||||
*/
|
||||
|
||||
console.log(pluginSlice, '11');
|
||||
|
||||
if (pluginSlice.length === 0) {
|
||||
if (type === 'editor') {
|
||||
return <div className={className}>{children}</div>;
|
||||
|
||||
@@ -8,6 +8,7 @@ import classNames from 'classnames';
|
||||
import { Empty, QueryGroup, Icon } from '@/components';
|
||||
import * as Type from '@/common/interface';
|
||||
import { useQueryPlugins, updatePluginStatus } from '@/services';
|
||||
import PluginKit from '@/utils/pluginKit';
|
||||
|
||||
const InstalledPluginsFilterKeys: Type.InstalledPluginsFilterBy[] = [
|
||||
'all',
|
||||
@@ -46,6 +47,7 @@ const Users: FC = () => {
|
||||
plugin_slug_name: plugin.slug_name,
|
||||
}).then(() => {
|
||||
updatePlugins();
|
||||
PluginKit.changePluginActiveStatus(plugin.slug_name, !plugin.enabled);
|
||||
if (plugin.have_config) {
|
||||
emitPluginChange('refreshConfigurablePlugins');
|
||||
}
|
||||
|
||||
@@ -104,6 +104,13 @@ class Plugins {
|
||||
});
|
||||
}
|
||||
|
||||
changePluginActiveStatus(slug_name: string, active: boolean) {
|
||||
const plugin = this.getPlugin(slug_name);
|
||||
if (plugin) {
|
||||
plugin.activated = active;
|
||||
}
|
||||
}
|
||||
|
||||
getPlugin(slug_name: string) {
|
||||
return this.plugins.find((p) => p.info.slug_name === slug_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user