From d4f11d878d39d8b83b6fbbaf3d7e7b2d97fa432b Mon Sep 17 00:00:00 2001 From: "David L. Duke" Date: Fri, 17 Apr 2026 12:35:08 -0400 Subject: [PATCH] fix: mask plugin config fields with type: 'secret' in Settings UI Both PluginsSettingsPage and CustomPluginsSettingsPage matched { type: 'string' } and { type: 'secret' } together and rendered both as plain TextField elements with no masking. Add type={config.type === 'secret' ? 'password' : 'text'} so secret plugin config values are masked in the Settings UI. --- packages/app/src/components/SettingsModal.tsx | 54 +++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/SettingsModal.tsx b/packages/app/src/components/SettingsModal.tsx index 5e2a9aeb1..5506c1b93 100644 --- a/packages/app/src/components/SettingsModal.tsx +++ b/packages/app/src/components/SettingsModal.tsx @@ -21,7 +21,7 @@ import { useDependsOnPlugins } from '../hooks/useDependsOnPlugins'; import { entries } from '../../../core/src/utils/typeSafety'; import { P, match } from 'ts-pattern'; import Select from '@atlaskit/select'; -import { type SecretPluginConfigurationSpec, type StringPluginConfigurationSpec } from '../../../core/src/index.js'; +import { type SecretPluginConfigurationSpec, type SelectPluginConfigurationSpec, type StringPluginConfigurationSpec } from '../../../core/src/index.js'; import { SideNavigation, NavigationHeader, ButtonItem, Header, NavigationContent } from '@atlaskit/side-navigation'; import CrossIcon from '@atlaskit/icon/glyph/cross'; import { css } from '@emotion/react'; @@ -532,8 +532,8 @@ export const PluginsSettingsPage: FC = () => { (config: StringPluginConfigurationSpec | SecretPluginConfigurationSpec) => ( <> setSettings((s) => ({ ...s, @@ -551,6 +551,30 @@ export const PluginsSettingsPage: FC = () => { ), ) + .with({ type: 'select' }, (config: SelectPluginConfigurationSpec) => { + const currentValue = (settings.pluginSettings?.[plugin.id]?.[key] as string | undefined) ?? config.default ?? ''; + return ( + <> + o.value === currentValue) ?? null} + options={config.options} + onChange={(option) => + setSettings((s) => ({ + ...s, + pluginSettings: { + ...s.pluginSettings, + [plugin.id]: { + ...s.pluginSettings?.[plugin.id], + [key]: option?.value ?? '', + }, + }, + })) + } + /> + {config.helperText && {config.helperText}} + + ); + }) .otherwise(() => null) }