diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/ApiKeyHeader.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/ApiKeyHeader.jsx index aeb3e867170..851a41a94e3 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/ApiKeyHeader.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/ApiKeyHeader.jsx @@ -39,6 +39,7 @@ import APIValidation from 'AppData/APIValidation'; export default function ApiKeyHeader(props) { const { api, configDispatcher } = props; const [apiFromContext] = useAPI(); + const isRestAPI = apiFromContext.type==="HTTP"; const [isHeaderNameValid, setIsHeaderNameValid] = useState(true); let hasResourceWithSecurity; const apiKeyHeaderValue = api.apiKeyHeader; @@ -73,63 +74,65 @@ export default function ApiKeyHeader(props) { } } - return ( - - - - )} - value={hasResourceWithSecurity ? apiKeyHeaderValue : ' '} - error={!isHeaderNameValid} - helperText={ - (!isHeaderNameValid) - && ( + if(isRestAPI){ + return ( + + + - ) - } - InputProps={{ - id: 'itest-id-apiKeyHeaderName-input', - onBlur: ({ target: { value } }) => { - validateHeader(value); - }, - }} - margin='normal' - variant='outlined' - onChange={({ target: { value } }) => configDispatcher({ - action: 'apiKeyHeader', - value: value === '' ? 'ApiKey' : value })} - style={{ display: 'flex' }} - /> - - - - )} - aria-label='ApiKey Header' - placement='right-end' - interactive - > - - + )} + value={hasResourceWithSecurity ? apiKeyHeaderValue : ' '} + error={!isHeaderNameValid} + helperText={ + (!isHeaderNameValid) + && ( + + ) + } + InputProps={{ + id: 'itest-id-apiKeyHeaderName-input', + onBlur: ({ target: { value } }) => { + validateHeader(value); + }, + }} + margin='normal' + variant='outlined' + onChange={({ target: { value } }) => configDispatcher({ + action: 'apiKeyHeader', + value: value === '' ? 'ApiKey' : value })} + style={{ display: 'flex' }} + /> + + + + )} + aria-label='ApiKey Header' + placement='right-end' + interactive + > + + + - - ); + ); + } } ApiKeyHeader.propTypes = {