Skip to content

Commit

Permalink
Merge branch 'actions/feature' into actions/feature-and-rbac
Browse files Browse the repository at this point in the history
* actions/feature:
  added readonly support to servicenow connector
  • Loading branch information
gmmorris committed Jul 7, 2020
2 parents d412665 + a3f6142 commit 5c5ff2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('ServiceNowActionConnectorFields renders', () => {
editActionConfig={() => {}}
editActionSecrets={() => {}}
docLinks={deps!.docLinks}
readOnly={false}
/>
);
expect(
Expand Down Expand Up @@ -72,6 +73,7 @@ describe('ServiceNowActionConnectorFields renders', () => {
editActionConfig={() => {}}
editActionSecrets={() => {}}
docLinks={deps!.docLinks}
readOnly={false}
/>
);
expect(wrapper.find('[data-test-subj="case-servicenow-mappings"]').length > 0).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { FieldMapping } from './case_mappings/field_mapping';

const ServiceNowConnectorFields: React.FC<ActionConnectorFieldsProps<
ServiceNowActionConnector
>> = ({ action, editActionSecrets, editActionConfig, errors, consumer }) => {
>> = ({ action, editActionSecrets, editActionConfig, errors, consumer, readOnly }) => {
// TODO: remove incidentConfiguration later, when Case ServiceNow will move their fields to the level of action execution
const { apiUrl, incidentConfiguration, isCaseOwned } = action.config;
const mapping = incidentConfiguration ? incidentConfiguration.mapping : [];
Expand Down Expand Up @@ -84,6 +84,7 @@ const ServiceNowConnectorFields: React.FC<ActionConnectorFieldsProps<
fullWidth
isInvalid={isApiUrlInvalid}
name="apiUrl"
readOnly={readOnly}
value={apiUrl || ''} // Needed to prevent uncontrolled input error when value is undefined
data-test-subj="apiUrlFromInput"
placeholder="https://<site-url>"
Expand All @@ -110,6 +111,7 @@ const ServiceNowConnectorFields: React.FC<ActionConnectorFieldsProps<
<EuiFieldText
fullWidth
isInvalid={isUsernameInvalid}
readOnly={readOnly}
name="connector-servicenow-username"
value={username || ''} // Needed to prevent uncontrolled input error when value is undefined
data-test-subj="connector-servicenow-username-form-input"
Expand All @@ -135,6 +137,7 @@ const ServiceNowConnectorFields: React.FC<ActionConnectorFieldsProps<
>
<EuiFieldPassword
fullWidth
readOnly={readOnly}
isInvalid={isPasswordInvalid}
name="connector-servicenow-password"
value={password || ''} // Needed to prevent uncontrolled input error when value is undefined
Expand Down

0 comments on commit 5c5ff2d

Please sign in to comment.