mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an error while saving changes to the ERD table. Fixes #5342
This commit is contained in:
committed by
Akshay Joshi
parent
e2b00dda1b
commit
a2a18d4b4a
@@ -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 (
|
||||
<Button ref={ref} size={size} className={clsx(allClassName)} data-label={dataLabel} {...otherProps} variant="contained" color="primary">{children}</Button>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user