Skip to content

Commit

Permalink
[Alerting UI] Fix console error when setting connector params (elasti…
Browse files Browse the repository at this point in the history
…c#83333)

* Fixing console errors

* Setting defaults for undefined inputs in text area/field with message variables

* Cleanup

* Cleanup

* Fixing pagerduty timestamp validation

* Fixing test

* Pagerduty params

* Reverting unnecessary changes
  • Loading branch information
ymao1 committed Nov 17, 2020
1 parent 72933f6 commit 9c35912
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const TextAreaWithMessageVariables: React.FunctionComponent<Props> = ({
fullWidth
isInvalid={errors && errors.length > 0 && inputTargetValue !== undefined}
name={paramsProperty}
value={inputTargetValue}
value={inputTargetValue || ''}
data-test-subj={`${paramsProperty}TextArea`}
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => onChangeWithMessageVariable(e)}
onFocus={(e: React.FocusEvent<HTMLTextAreaElement>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const TextFieldWithMessageVariables: React.FunctionComponent<Props> = ({
id={`${paramsProperty}Id`}
isInvalid={errors && errors.length > 0 && inputTargetValue !== undefined}
data-test-subj={`${paramsProperty}Input`}
value={inputTargetValue}
value={inputTargetValue || ''}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChangeWithMessageVariable(e)}
onFocus={(e: React.FocusEvent<HTMLInputElement>) => {
setCurrentTextElement(e.target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ export const ConnectorAddFlyout = ({
const [isSaving, setIsSaving] = useState<boolean>(false);

const closeFlyout = useCallback(() => {
setActionType(undefined);
setConnector(initialConnector);
onClose();
}, [onClose, initialConnector]);
}, [onClose]);

const canSave = hasSaveActionsCapability(capabilities);

Expand Down

0 comments on commit 9c35912

Please sign in to comment.