Fixed an error while saving changes to the ERD table. Fixes #5342

This commit is contained in:
Aditya Toshniwal
2022-09-19 16:20:07 +05:30
committed by Akshay Joshi
parent e2b00dda1b
commit a2a18d4b4a
4 changed files with 32 additions and 13 deletions

View File

@@ -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>

View File

@@ -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);