Ensure processes related notifiers disappears. #7219

pull/7704/head
Yogesh Mahajan 2024-07-17 13:07:52 +05:30 committed by GitHub
parent 8e16e000c3
commit 1eb07608e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -43,6 +43,7 @@ const StyledBox = styled(Box)(({theme}) => ({
},
}));
const AUTO_HIDE_DURATION = 10000; // In milliseconds
function ProcessNotifyMessage({title, desc, onClose, onViewProcess, success=true, dataTestSuffix=''}) {
return (
<StyledBox className={(success ? 'BgProcessNotify-containerSuccess' : 'BgProcessNotify-containerError')} data-test={'process-popup-' + dataTestSuffix}>
@ -75,7 +76,7 @@ ProcessNotifyMessage.propTypes = {
export function processStarted(desc, onViewProcess) {
pgAdmin.Browser.notifier.notify(
<ProcessNotifyMessage title={gettext('Process started')} desc={desc} onViewProcess={onViewProcess} dataTestSuffix="start"/>,
null
AUTO_HIDE_DURATION
);
}
@ -92,6 +93,6 @@ export function processCompleted(desc, process_state, onViewProcess) {
pgAdmin.Browser.notifier.notify(
<ProcessNotifyMessage title={title} desc={desc} onViewProcess={onViewProcess} success={success} dataTestSuffix="end"/>,
null
AUTO_HIDE_DURATION
);
}