-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI notifier to indicate secret fields and to remember / reenter v…
…alues (#80657) * Initial work * Add messaging to Jira connector * Add messaging to PagerDuty connector * Add messaging to Email connector * Add messaging to ServiceNow connector * Add messaging to Webhook connector * Add unit tests * Fix jest test * Apply design feedback * Apply copy feedback * Fix failing test * Fix connector descriptions for jira and resilient Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
7017ca6
commit 9aa9290
Showing
19 changed files
with
746 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,51 @@ describe('EmailActionConnectorFields renders', () => { | |
expect(wrapper.find('[data-test-subj="emailUserInput"]').length > 0).toBeFalsy(); | ||
expect(wrapper.find('[data-test-subj="emailPasswordInput"]').length > 0).toBeFalsy(); | ||
}); | ||
|
||
test('should display a message to remember username and password when creating a connector with authentication', () => { | ||
const actionConnector = { | ||
actionTypeId: '.email', | ||
config: { | ||
hasAuth: true, | ||
}, | ||
secrets: {}, | ||
} as EmailActionConnector; | ||
const wrapper = mountWithIntl( | ||
<EmailActionConnectorFields | ||
action={actionConnector} | ||
errors={{ from: [], port: [], host: [], user: [], password: [] }} | ||
editActionConfig={() => {}} | ||
editActionSecrets={() => {}} | ||
docLinks={{ ELASTIC_WEBSITE_URL: '', DOC_LINK_VERSION: '' } as DocLinksStart} | ||
readOnly={false} | ||
/> | ||
); | ||
expect(wrapper.find('[data-test-subj="rememberValuesMessage"]').length).toBeGreaterThan(0); | ||
expect(wrapper.find('[data-test-subj="reenterValuesMessage"]').length).toEqual(0); | ||
}); | ||
|
||
test('should display a message when editing an authenticated email connector explaining why username and password must be re-entered', () => { | ||
const actionConnector = { | ||
secrets: {}, | ||
id: 'test', | ||
actionTypeId: '.email', | ||
name: 'email', | ||
config: { | ||
from: '[email protected]', | ||
hasAuth: true, | ||
}, | ||
} as EmailActionConnector; | ||
const wrapper = mountWithIntl( | ||
<EmailActionConnectorFields | ||
action={actionConnector} | ||
errors={{ from: [], port: [], host: [], user: [], password: [] }} | ||
editActionConfig={() => {}} | ||
editActionSecrets={() => {}} | ||
docLinks={{ ELASTIC_WEBSITE_URL: '', DOC_LINK_VERSION: '' } as DocLinksStart} | ||
readOnly={false} | ||
/> | ||
); | ||
expect(wrapper.find('[data-test-subj="reenterValuesMessage"]').length).toBeGreaterThan(0); | ||
expect(wrapper.find('[data-test-subj="rememberValuesMessage"]').length).toEqual(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.