diff --git a/docs/en_US/release_notes_6_14.rst b/docs/en_US/release_notes_6_14.rst index cac4f1213..061e77202 100644 --- a/docs/en_US/release_notes_6_14.rst +++ b/docs/en_US/release_notes_6_14.rst @@ -44,4 +44,5 @@ Bug fixes | `Issue #5323 `_ - Replace the language selection 'Brazilian' with 'Portuguese (Brazilian). (RM #7693) | `Issue #5325 `_ - Fixed an issue where server names with special characters are not displayed correctly in the process tab. (RM #7695) | `Issue #5333 `_ - Fixed an issue where ERD throws an error if variable is added to the column. (RM #7709) + | `Issue #5342 `_ - Fixed an error while saving changes to the ERD table. | `Issue #5343 `_ - Fixes a redirect vulnerability when the user opens the pgAdmin URL. diff --git a/web/pgadmin/static/js/components/Buttons.jsx b/web/pgadmin/static/js/components/Buttons.jsx index 27dabf998..f7ca5f7f8 100644 --- a/web/pgadmin/static/js/components/Buttons.jsx +++ b/web/pgadmin/static/js/components/Buttons.jsx @@ -92,6 +92,15 @@ const useStyles = makeStyles((theme)=>({ '&.Mui-disabled': { border: 0, }, + }, + noBorderPrimary: { + color: theme.palette.primary.contrastText, + backgroundColor: theme.palette.primary.main, + '&:hover': { + color: theme.palette.primary.contrastText, + backgroundColor: theme.palette.primary.hoverMain, + borderColor: theme.palette.primary.hoverBorderColor, + }, } })); @@ -104,7 +113,7 @@ export const PrimaryButton = forwardRef((props, ref)=>{ size = undefined; allClassName.push(classes.xsButton); } - noBorder && allClassName.push(classes.noBorder); + noBorder && allClassName.push(...[classes.noBorder, classes.noBorderPrimary]); const dataLabel = typeof(children) == 'string' ? children : undefined; return ( diff --git a/web/pgadmin/static/js/components/CodeMirror.jsx b/web/pgadmin/static/js/components/CodeMirror.jsx index b0d496624..4141369d1 100644 --- a/web/pgadmin/static/js/components/CodeMirror.jsx +++ b/web/pgadmin/static/js/components/CodeMirror.jsx @@ -71,17 +71,21 @@ function parseString(string) { } function parseQuery(query, useRegex=false, matchCase=false) { - if (useRegex) { - query = new RegExp(query, matchCase ? 'g': 'gi'); - } else { - query = parseString(query); - if(!matchCase) { - query = query.toLowerCase(); + try { + if (useRegex) { + query = new RegExp(query, matchCase ? 'g': 'gi'); + } else { + query = parseString(query); + if(!matchCase) { + query = query.toLowerCase(); + } } + if (typeof query == 'string' ? query == '' : query.test('')) + query = /x^/; + return query; + } catch (error) { + return null; } - if (typeof query == 'string' ? query == '' : query.test('')) - query = /x^/; - return query; } function getRegexFinder(query) { @@ -143,6 +147,8 @@ export function FindDialog({editor, show, replace, onClose}) { const search = ()=>{ if(editor) { let query = parseQuery(findVal, useRegex, matchCase); + if(!query) return; + searchCursor.current = editor.getSearchCursor(query, 0, !matchCase); if(findVal != '') { editor.removeOverlay(highlightsearch.current); diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js index afcf30c3c..626f649cc 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js +++ b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js @@ -305,11 +305,14 @@ export default class ERDCore { let fkTableNode = this.getModel().getNodesDict()[linkData.local_table_uid]; let newForeingKeys = []; + /* Update the FK table with new references */ fkTableNode.getData().foreign_key?.forEach((theFkRow)=>{ for(let fkColumn of theFkRow.columns) { - let attnum = _.find(oldTableData.columns, (c)=>c.name==fkColumn.referenced).attnum; - fkColumn.referenced = _.find(tableData.columns, (colm)=>colm.attnum==attnum).name; - fkColumn.references_table_name = tableData.name; + if(fkColumn.references == tableNode.getID()) { + let attnum = _.find(oldTableData.columns, (c)=>c.name==fkColumn.referenced).attnum; + fkColumn.referenced = _.find(tableData.columns, (colm)=>colm.attnum==attnum).name; + fkColumn.references_table_name = tableData.name; + } } newForeingKeys.push(theFkRow); });