Skip to content

Commit

Permalink
fix: active check & plugin form (#1793)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiteSun authored and johzchen committed Apr 19, 2021
1 parent 7ff4ff7 commit bb7598d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions web/src/components/Plugin/PluginDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import addFormats from 'ajv-formats';
import { fetchSchema } from './service';
import { json2yaml, yaml2json } from '../../helpers';
import { PluginForm, PLUGIN_UI_LIST } from './UI';
import { PluginType } from './data';

type Props = {
name: string;
Expand Down Expand Up @@ -365,7 +366,7 @@ const PluginDetail: React.FC<Props> = ({
<PageHeader
title=""
subTitle={
pluginType === 'auth' && schemaType !== 'consumer' && (codeMirrorMode !== codeMirrorModeList.UIForm) ? (
pluginType === PluginType.authentication && schemaType !== 'consumer' && (codeMirrorMode !== codeMirrorModeList.UIForm) ? (
<Alert message={formatMessage({ id: 'component.plugin.noConfigurationRequired' })} type="warning" />
) : null
}
Expand Down Expand Up @@ -402,7 +403,7 @@ const PluginDetail: React.FC<Props> = ({
</Button>
]}
/>
{Boolean(codeMirrorMode === codeMirrorModeList.UIForm) && <PluginForm name={name} form={UIForm} renderForm={!(pluginType === 'auth' && schemaType !== 'consumer')} />}
{Boolean(codeMirrorMode === codeMirrorModeList.UIForm) && <PluginForm name={name} form={UIForm} renderForm={!(pluginType === PluginType.authentication && schemaType !== 'consumer')} />}
<div style={{ display: codeMirrorMode === codeMirrorModeList.UIForm ? 'none' : 'unset' }}><CodeMirror
ref={(codemirror) => {
ref.current = codemirror;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const HttpsVerifyCertificateComponent: React.FC<Props> = ({ readonly }) => {
return (
<Form.Item
label={formatMessage({ id: 'component.upstream.fields.checks.active.https_verify_certificate' })}
name="https_verify_certificate"
name={['checks', 'active', 'https_verify_certificate']}
tooltip={formatMessage({ id: 'component.upstream.fields.checks.active.https_verify_certificate.tooltip' })}
initialValue={true}
valuePropName="checked"
Expand Down

0 comments on commit bb7598d

Please sign in to comment.