mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-28 03:49:20 +00:00
[UI] Fix settings rendering (#11987)
- Do not duplicate global plugin settings
This commit is contained in:
@@ -70,10 +70,12 @@ function PluginSettingGroupItem({
|
||||
export default function PluginSettingsGroup({
|
||||
mixin,
|
||||
message,
|
||||
includeBaseSettings,
|
||||
global
|
||||
}: {
|
||||
global: boolean;
|
||||
message?: string;
|
||||
includeBaseSettings?: boolean;
|
||||
mixin?: string;
|
||||
}) {
|
||||
const mixins: string = useMemo(() => {
|
||||
@@ -99,6 +101,7 @@ export default function PluginSettingsGroup({
|
||||
|
||||
return (
|
||||
<Stack gap='xs'>
|
||||
{includeBaseSettings == true && (
|
||||
<Accordion defaultValue='plugin-settings'>
|
||||
<Accordion.Item value='plugin-settings'>
|
||||
<Accordion.Control>
|
||||
@@ -109,6 +112,7 @@ export default function PluginSettingsGroup({
|
||||
</Accordion.Panel>
|
||||
</Accordion.Item>
|
||||
</Accordion>
|
||||
)}
|
||||
<Alert color='blue' icon={<IconInfoCircle />}>
|
||||
<Text>
|
||||
{message ??
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
IconShoppingCart,
|
||||
IconTruckDelivery
|
||||
} from '@tabler/icons-react';
|
||||
import { lazy, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { PluginPanelKey } from '@lib/enums/ModelType';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
@@ -25,13 +25,9 @@ import PageTitle from '../../../components/nav/PageTitle';
|
||||
import { SettingsHeader } from '../../../components/nav/SettingsHeader';
|
||||
import { PanelGroup } from '../../../components/panels/PanelGroup';
|
||||
import { GlobalSettingList } from '../../../components/settings/SettingList';
|
||||
import { Loadable } from '../../../functions/loading';
|
||||
import { useServerApiState } from '../../../states/ServerApiState';
|
||||
import { useUserState } from '../../../states/UserState';
|
||||
|
||||
const PluginSettingsGroup = Loadable(
|
||||
lazy(() => import('./PluginSettingsGroup'))
|
||||
);
|
||||
import PluginSettingsGroup from './PluginSettingsGroup';
|
||||
|
||||
/**
|
||||
* System settings page
|
||||
@@ -371,7 +367,9 @@ export default function SystemSettings() {
|
||||
name: 'plugins',
|
||||
label: t`Plugins`,
|
||||
icon: <IconPlugConnected />,
|
||||
content: <PluginSettingsGroup global={true} />
|
||||
content: (
|
||||
<PluginSettingsGroup global={true} includeBaseSettings={true} />
|
||||
)
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
IconSearch,
|
||||
IconUserCircle
|
||||
} from '@tabler/icons-react';
|
||||
import { lazy, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { PluginPanelKey } from '@lib/enums/ModelType';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
@@ -18,14 +18,10 @@ import PageTitle from '../../../components/nav/PageTitle';
|
||||
import { SettingsHeader } from '../../../components/nav/SettingsHeader';
|
||||
import { PanelGroup } from '../../../components/panels/PanelGroup';
|
||||
import { UserSettingList } from '../../../components/settings/SettingList';
|
||||
import { Loadable } from '../../../functions/loading';
|
||||
import { useUserState } from '../../../states/UserState';
|
||||
import { SecurityContent } from './AccountSettings/SecurityContent';
|
||||
import { AccountContent } from './AccountSettings/UserPanel';
|
||||
|
||||
const PluginSettingsGroup = Loadable(
|
||||
lazy(() => import('./PluginSettingsGroup'))
|
||||
);
|
||||
import PluginSettingsGroup from './PluginSettingsGroup';
|
||||
|
||||
/**
|
||||
* User settings page
|
||||
@@ -130,7 +126,9 @@ export default function UserSettings() {
|
||||
name: 'plugins',
|
||||
label: t`Plugin Settings`,
|
||||
icon: <IconPlugConnected />,
|
||||
content: <PluginSettingsGroup global={false} />
|
||||
content: (
|
||||
<PluginSettingsGroup global={false} includeBaseSettings={true} />
|
||||
)
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user