(title, text, onOkClick, okLabel = gettext('OK'), options = {})
| 79 | }; |
| 80 | |
| 81 | function alert(title, text, onOkClick, okLabel = gettext('OK'), options = {}) { |
| 82 | const {plainText = false} = options; |
| 83 | // bind the modal provider before calling |
| 84 | this.showModal(title, (closeModal) => { |
| 85 | const onOkClickClose = () => { |
| 86 | onOkClick?.(); |
| 87 | closeModal(); |
| 88 | }; |
| 89 | return ( |
| 90 | <AlertContent text={text} onOkClick={onOkClickClose} okLabel={okLabel} plainText={plainText} /> |
| 91 | ); |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | function confirm(title, text, onOkClick, onCancelClick, okLabel = gettext('Yes'), cancelLabel = gettext('No'), okIcon = 'default', modalId=null) { |
| 96 | // bind the modal provider before calling |
no test coverage detected