Fixed an issue where the downloaded ERD diagram was 0 bytes. Fixes #7187

This commit is contained in:
Aditya Toshniwal authored and Akshay Joshi committed 2022-04-07 15:19:32 +05:30
1 parent b38847680b
commit bf8e569bde
3 files changed
+40 -2

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ notes for it.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
release_notes_6_9
release_notes_6_8 release_notes_6_8
release_notes_6_7 release_notes_6_7
release_notes_6_6 release_notes_6_6
+20
View File
@@ -0,0 +1,20 @@
************
Version 6.9
************
Release date: 2022-05-05
This release contains a number of bug fixes and new features since the release of pgAdmin4 6.8.
New features
************
Housekeeping
************
Bug fixes
*********
| `Issue #7187 <https://redmine.postgresql.org/issues/7187>`_ - Fixed an issue where the downloaded ERD diagram was 0 bytes.
@@ -657,11 +657,24 @@ export default class BodyWidget extends React.Component {
}; };
setTimeout(()=>{ setTimeout(()=>{
let width = this.canvasEle.scrollWidth + 10;
let height = this.canvasEle.scrollHeight + 10;
let isCut = false;
/* Canvas limitation - https://html2canvas.hertzen.com/faq */
if(width >= 32767){
width = 32766;
isCut = true;
}
if(height >= 32767){
height = 32766;
isCut = true;
}
html2canvas(this.canvasEle, { html2canvas(this.canvasEle, {
width: this.canvasEle.scrollWidth + 10, width: width,
height: this.canvasEle.scrollHeight + 10, height: height,
scrollX: 0, scrollX: 0,
scrollY: 0, scrollY: 0,
scale: 1,
useCORS: true, useCORS: true,
allowTaint: true, allowTaint: true,
backgroundColor: window.getComputedStyle(this.canvasEle).backgroundColor, backgroundColor: window.getComputedStyle(this.canvasEle).backgroundColor,
@@ -691,6 +704,10 @@ export default class BodyWidget extends React.Component {
ele.style.transform = prevTransform; ele.style.transform = prevTransform;
}); });
this.setLoading(null); this.setLoading(null);
if(isCut) {
Notify.alert(gettext('Maximum image size limit'),
gettext('The downloaded image has exceeded the maximum size of 32767 x 32767 pixels, and has been cropped to that size.'));
}
}); });
}, 1000); }, 1000);
} }