UI: add warning before downloading secret data (#23260)

* add confirm modal for downloading masked data

* close modal if user clicks download

* add changelog;

* pass onSuccess function instead

* only render modal on DOM if download is allowed
This commit is contained in:
claire bontempo
2023-09-22 13:19:38 -07:00
committed by GitHub
parent ac9f411949
commit 88ed074287
7 changed files with 65 additions and 28 deletions

View File

@@ -27,12 +27,14 @@ import autosize from 'autosize';
* @param name {String} - The key correlated to the value. Used for the download file name.
* @param [onChange=Callback] {Function|action} - Callback triggered on change, sends new value. Must set the value of @value
* @param [allowCopy=false] {bool} - Whether or not the input should render with a copy button.
* @param [allowDownload=false] {bool} - Renders a download button that prompts a confirmation modal to download the secret value
* @param [displayOnly=false] {bool} - Whether or not to display the value as a display only `pre` element or as an input.
*
*/
export default class MaskedInputComponent extends Component {
textareaId = 'textarea-' + guidFor(this);
@tracked showValue = false;
@tracked modalOpen = false;
constructor() {
super(...arguments);