MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / alert

Function alert

web/pgadmin/static/js/helpers/ModalProvider.jsx:81–93  ·  view source on GitHub ↗
(title, text, onOkClick, okLabel = gettext('OK'), options = {})

Source from the content-addressed store, hash-verified

79};
80
81function 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
95function confirm(title, text, onOkClick, onCancelClick, okLabel = gettext('Yes'), cancelLabel = gettext('No'), okIcon = 'default', modalId=null) {
96 // bind the modal provider before calling

Callers 1

raiseJSONErrorFunction · 0.85

Calls 2

gettextFunction · 0.85
showModalMethod · 0.80

Tested by

no test coverage detected