Fixed the following issues for the new query tool:

1) In Dark mode > Replace/Find dialogue forward & reverse buttons are stuck to each other.
 2) In Dark/High contrast mode > Checkbox is not visible for false value.
 3) Wrap toolbar when size goes very small.
 4) Replace functionality does not work when tried in sequence 2 times. Codemirror search is not cyclic. So, changes are made to always search from the start.
 5) Replace all does not work when tried in sequence 2 times. Same reason as above.
 6) Fix broken macros $SELECTION$ feature.
 7) Make query history SQL readonly.
 8) The Filter dialog save button should be disabled when opened.
This commit is contained in:
Aditya Toshniwal
2022-04-26 16:27:53 +05:30
committed by Akshay Joshi
parent 3d1a9624c1
commit 0795b22ae6
6 changed files with 37 additions and 18 deletions
@@ -134,7 +134,7 @@ export function FindDialog({editor, show, replace, onClose}) {
const search = ()=>{
if(editor) {
let query = parseQuery(findVal, useRegex, matchCase);
searchCursor.current = editor.getSearchCursor(query, editor.getCursor(true), !matchCase);
searchCursor.current = editor.getSearchCursor(query, 0, !matchCase);
if(findVal != '') {
editor.removeOverlay(highlightsearch.current);
highlightsearch.current = searchOverlay(query, matchCase);
@@ -221,6 +221,8 @@ export function FindDialog({editor, show, replace, onClose}) {
};
const onReplaceAll = ()=>{
/* search from start */
search();
while(searchCursor.current.from()) {
onReplace();
}
@@ -253,10 +255,13 @@ export function FindDialog({editor, show, replace, onClose}) {
/>}
<Box display="flex" className={classes.marginTop}>
<PgIconButton title={gettext('Previous')} icon={<ArrowUpwardRoundedIcon />} size="xs" noBorder onClick={onFindPrev} />
<PgIconButton title={gettext('Next')} icon={<ArrowDownwardRoundedIcon />} size="xs" noBorder onClick={onFindNext}/>
<PgIconButton title={gettext('Previous')} icon={<ArrowUpwardRoundedIcon />} size="xs" noBorder onClick={onFindPrev}
style={{marginRight: '2px'}} />
<PgIconButton title={gettext('Next')} icon={<ArrowDownwardRoundedIcon />} size="xs" noBorder onClick={onFindNext}
style={{marginRight: '2px'}} />
{replace && <>
<PgIconButton title={gettext('Replace')} icon={<SwapHorizRoundedIcon style={{height: 'unset'}}/>} size="xs" noBorder onClick={onReplace} />
<PgIconButton title={gettext('Replace')} icon={<SwapHorizRoundedIcon style={{height: 'unset'}}/>} size="xs" noBorder onClick={onReplace}
style={{marginRight: '2px'}} />
<PgIconButton title={gettext('Replace All')} icon={<SwapCallsRoundedIcon />} size="xs" noBorder onClick={onReplaceAll}/>
</>}
<Box marginLeft="auto">