From 7c74b7cdb764d54ba7f42e0644b3f1d3ee7c786f Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Tue, 27 May 2025 13:02:11 +0530 Subject: [PATCH] - Pin Electron to v35.4.0 as the v36 is not working on many OS. - Pin html-to-image to v1.11.11 as latest version breaks ERD image downloads. --- Make.bat | 1 + pkg/linux/build-functions.sh | 2 ++ pkg/mac/build-functions.sh | 1 + runtime/src/js/pgadmin.js | 1 + web/package.json | 2 +- .../static/js/components/SelectThemes.jsx | 17 ++++++++--------- .../static/js/erd_tool/links/OneToManyLink.jsx | 8 +++----- web/yarn.lock | 10 +++++----- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Make.bat b/Make.bat index b7e4e6864..70c62a5d4 100644 --- a/Make.bat +++ b/Make.bat @@ -284,6 +284,7 @@ REM Main build sequence Ends REM WGET FOR /f "tokens=*" %%i IN ('npm info electron version') DO SET "ELECTRON_VERSION=%%i" + SET ELECTRON_VERSION="35.4.0" :GET_NW wget https://github.com/electron/electron/releases/download/v%ELECTRON_VERSION%/electron-v%ELECTRON_VERSION%-win32-x64.zip -O "%TMPDIR%\electron-v%ELECTRON_VERSION%-win32-x64.zip" IF %ERRORLEVEL% NEQ 0 GOTO GET_NW diff --git a/pkg/linux/build-functions.sh b/pkg/linux/build-functions.sh index ad7369fe7..aba05034e 100644 --- a/pkg/linux/build-functions.sh +++ b/pkg/linux/build-functions.sh @@ -140,6 +140,8 @@ _build_runtime() { fi ELECTRON_VERSION="$(npm info electron version)" + # Can't use the latest as it is not compatible with few OS versions. + ELECTRON_VERSION="35.4.0" pushd "${BUILDROOT}" > /dev/null || exit while true;do diff --git a/pkg/mac/build-functions.sh b/pkg/mac/build-functions.sh index 2f94dec0e..3c36ce4ea 100644 --- a/pkg/mac/build-functions.sh +++ b/pkg/mac/build-functions.sh @@ -34,6 +34,7 @@ _build_runtime() { fi ELECTRON_VERSION="$(npm info electron version)" + ELECTRON_VERSION="35.4.0" pushd "${BUILD_ROOT}" > /dev/null || exit while true;do diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js index 1499ffd6c..2b2ef8e72 100644 --- a/runtime/src/js/pgadmin.js +++ b/runtime/src/js/pgadmin.js @@ -410,6 +410,7 @@ ipcMain.on('log', (_e, text) => ()=>{ misc.writeServerLog(text); }); ipcMain.on('focus', (e) => { + app.focus({steal: true}); const callerWindow = BrowserWindow.fromWebContents(e.sender) if (callerWindow) { if (callerWindow.isMinimized()) callerWindow.restore(); diff --git a/web/package.json b/web/package.json index 98b826453..f7bbf0562 100644 --- a/web/package.json +++ b/web/package.json @@ -109,7 +109,7 @@ "date-fns": "^4.1.0", "diff-arrays-of-objects": "^1.1.8", "hotkeys-js": "^3.13.3", - "html-to-image": "1.11.13", + "html-to-image": "1.11.11", "immutability-helper": "^3.0.0", "insert-if": "^1.1.0", "ip-address": "^10.0.1", diff --git a/web/pgadmin/static/js/components/SelectThemes.jsx b/web/pgadmin/static/js/components/SelectThemes.jsx index c7ec6f9e0..eacfd6c03 100644 --- a/web/pgadmin/static/js/components/SelectThemes.jsx +++ b/web/pgadmin/static/js/components/SelectThemes.jsx @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////// import gettext from 'sources/gettext'; -import { Grid, FormHelperText } from '@mui/material'; +import { FormHelperText, Box } from '@mui/material'; import React, { useMemo } from 'react'; import {InputSelect } from './FormComponents'; import PropTypes from 'prop-types'; @@ -17,22 +17,21 @@ import HTMLReactParse from 'html-react-parser'; export default function SelectThemes({onChange, helpMessage, ...props}) { - const previewSrc = useMemo(()=>(props.options?.find((o)=>o.value==props.value)?.preview_src), [props.value]); const cid = _.uniqueId('c'); const helpid = `h${cid}`; return ( - - + <> + - - + + { previewSrc && <> {HTMLReactParse(helpMessage || '')} - {gettext('Preview + {gettext('Preview } - - + + ); } diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/links/OneToManyLink.jsx b/web/pgadmin/tools/erd/static/js/erd_tool/links/OneToManyLink.jsx index 046cbc64e..830aceecc 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/links/OneToManyLink.jsx +++ b/web/pgadmin/tools/erd/static/js/erd_tool/links/OneToManyLink.jsx @@ -168,8 +168,8 @@ function NotationForType({itype, width, rotation}) { if(itype == 'many') { return ( <> - - + + ); } else if (itype == 'one') { @@ -354,14 +354,12 @@ export class OneToManyLinkWidget extends RightAngleLinkWidget { } } -const LinkSegment = forwardRef(({model, selected, path, ...props}, ref)=>{ +const LinkSegment = forwardRef(({selected, path, ...props}, ref)=>{ return (