From 5cfca7896fcbb802b700fb669be85979a15ded37 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 18 Jun 2020 16:22:53 -0400 Subject: [PATCH] Adds proptypes to CredentialPluginTestAlert component --- .../CredentialPluginPrompt/MetadataStep.jsx | 4 +--- .../CredentialPlugins/CredentialPluginTestAlert.jsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx index acbabd551b..0597bfb253 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx @@ -158,9 +158,7 @@ function MetadataStep({ i18n }) { id="credential-plugin-test" variant="primary" type="submit" - onClick={() => - testPluginMetadata() - } + onClick={() => testPluginMetadata()} > {i18n._(t`Test`)} diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginTestAlert.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginTestAlert.jsx index 866ca1dae3..741893eb16 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginTestAlert.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginTestAlert.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; +import { string, shape } from 'prop-types'; import { Alert, AlertActionCloseButton, @@ -75,8 +76,15 @@ function CredentialPluginTestAlert({ ); } -CredentialPluginTestAlert.propTypes = {}; +CredentialPluginTestAlert.propTypes = { + credentialName: string.isRequired, + successResponse: shape({}), + errorResponse: shape({}), +}; -CredentialPluginTestAlert.defaultProps = {}; +CredentialPluginTestAlert.defaultProps = { + successResponse: null, + errorResponse: null, +}; export default withI18n()(CredentialPluginTestAlert);