Skip to content

Commit 7dd6928

Browse files
committed
frontend/PluginSettingsDetails: Add the type of plugin to the header
1 parent 0e0639e commit 7dd6928

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

frontend/src/components/App/PluginSettings/PluginSettingsDetails.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
import Box, { BoxProps } from '@mui/material/Box';
1818
import Button from '@mui/material/Button';
19+
import Chip from '@mui/material/Chip';
1920
import Stack from '@mui/material/Stack';
2021
import _ from 'lodash';
2122
import { isValidElement, useEffect, useMemo, useState } from 'react';
2223
import { useTranslation } from 'react-i18next';
2324
import { useDispatch } from 'react-redux';
24-
import { useParams } from 'react-router-dom';
25-
import { useHistory } from 'react-router-dom';
25+
import { useHistory, useParams } from 'react-router-dom';
2626
import { isElectron } from '../../../helpers/isElectron';
2727
import { getCluster } from '../../../lib/cluster';
2828
import { deletePlugin } from '../../../lib/k8s/api/v1/pluginsApi';
@@ -32,6 +32,7 @@ import { clusterAction } from '../../../redux/clusterActionSlice';
3232
import { useTypedSelector } from '../../../redux/hooks';
3333
import type { AppDispatch } from '../../../redux/stores/store';
3434
import NotFoundComponent from '../../404';
35+
import { SectionHeader } from '../../common';
3536
import { ConfirmDialog } from '../../common/Dialog';
3637
import ErrorBoundary from '../../common/ErrorBoundary';
3738
import { SectionBox } from '../../common/SectionBox';
@@ -199,8 +200,35 @@ export function PluginSettingsDetailsPure(props: PluginSettingsDetailsPureProps)
199200
<>
200201
<SectionBox
201202
aria-live="polite"
202-
title={name}
203-
subtitle={author ? `${t('translation|By')}: ${author}` : undefined}
203+
title={
204+
<SectionHeader
205+
title={name}
206+
titleSideActions={[
207+
plugin.type && (
208+
<Chip
209+
label={
210+
plugin.type === 'development'
211+
? t('translation|Development')
212+
: plugin.type === 'user'
213+
? t('translation|User-installed')
214+
: t('translation|Shipped')
215+
}
216+
size="small"
217+
color={
218+
plugin.type === 'development'
219+
? 'primary'
220+
: plugin.type === 'user'
221+
? 'info'
222+
: 'default'
223+
}
224+
/>
225+
),
226+
]}
227+
subtitle={author ? `${t('translation|By')}: ${author}` : undefined}
228+
noPadding={false}
229+
headerStyle="subsection"
230+
/>
231+
}
204232
backLink={'/settings/plugins'}
205233
>
206234
{plugin.description}

0 commit comments

Comments
 (0)