diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index 4774787f7..a980771ba 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -361,7 +361,8 @@ }, "actions": { "enable": "Enable", - "disable": "Disable" + "disable": "Disable", + "disabledDueToError": "Fix the error before enabling" }, "notifications": { "enabled": "Plugin enabled", diff --git a/ui/src/plugin/PluginList.jsx b/ui/src/plugin/PluginList.jsx index 614fda503..1449f8daa 100644 --- a/ui/src/plugin/PluginList.jsx +++ b/ui/src/plugin/PluginList.jsx @@ -78,19 +78,24 @@ const ToggleEnabledInput = ({ props }) => { [toggleEnabled], ) + const hasError = !!record.lastError + const isDisabled = loading || hasError + return ( diff --git a/ui/src/plugin/PluginShow.jsx b/ui/src/plugin/PluginShow.jsx index c05d09ab6..9c318536e 100644 --- a/ui/src/plugin/PluginShow.jsx +++ b/ui/src/plugin/PluginShow.jsx @@ -215,30 +215,50 @@ const ErrorSection = ({ error, translate }) => { } // Status card with enable/disable toggle -const StatusCard = ({ record, classes, translate, onToggle, loading }) => ( - - - - {translate('resources.plugin.sections.status')} - - { + const isDisabled = loading || hasError + + return ( + + + + {translate('resources.plugin.sections.status')} + + + + } + label={translate( + record.enabled + ? 'resources.plugin.actions.disable' + : 'resources.plugin.actions.enable', + )} /> - } - label={translate( - record.enabled - ? 'resources.plugin.actions.disable' - : 'resources.plugin.actions.enable', - )} - /> - - -) + + + + ) +} // Plugin information card const InfoCard = ({ record, manifest, classes, translate, isSmall }) => ( @@ -570,6 +590,7 @@ const PluginShowLayout = () => { translate={translate} onToggle={handleToggleEnabled} loading={loading} + hasError={!!record.lastError} />