Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/en_US/release_notes_9_12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ Bundled PostgreSQL Utilities
New features
************

| `Issue #8890 <https://github.com/pgadmin-org/pgadmin4/issues/8890>`_ - Add a new button in the query tool data output toolbar to get entire range of data.


Housekeeping
************

Bug fixes
*********
| `Issue #9380 <https://github.com/pgadmin-org/pgadmin4/issues/9380>`_ - Fixed an issue where the Query History panel would auto-scroll to the top and did not preserve the scroll bar position for the selected entry.

| `Issue #9380 <https://github.com/pgadmin-org/pgadmin4/issues/9380>`_ - Fixed an issue where the Query History panel would auto-scroll to the top and did not preserve the scroll bar position for the selected entry.


Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import SkipPreviousRoundedIcon from '@mui/icons-material/SkipPreviousRounded';
import EditRoundedIcon from '@mui/icons-material/EditRounded';
import EditOffRoundedIcon from '@mui/icons-material/EditOffRounded';
import CheckRoundedIcon from '@mui/icons-material/CheckRounded';
import AllInboxRoundedIcon from '@mui/icons-material/AllInboxRounded';

import {QUERY_TOOL_EVENTS} from '../QueryToolConstants';
import { QueryToolContext, QueryToolEventsContext } from '../QueryToolComponent';
Expand Down Expand Up @@ -114,11 +115,15 @@ function PaginationInputs({pagination, totalRowCount, clearSelection, serverCurs
pageCount: pagination.page_count ?? 0,
});

const fetchWindow = (from, to) => {
eventBus.fireEvent(QUERY_TOOL_EVENTS.FETCH_WINDOW, from, to);
clearSelection();
};

const goToPage = (pageNo)=>{
const from = (pageNo-1) * pagination.page_size + 1;
const to = from + pagination.page_size - 1;
eventBus.fireEvent(QUERY_TOOL_EVENTS.FETCH_WINDOW, from, to, serverCursor);
clearSelection();
fetchWindow(from, to);
};

const onInputChange = (key, value)=>{
Expand All @@ -128,7 +133,7 @@ function PaginationInputs({pagination, totalRowCount, clearSelection, serverCurs
const onInputKeydown = (e)=>{
if(e.code === 'Enter' && !errorInputs.from && !errorInputs.to) {
e.preventDefault();
eventBus.fireEvent(QUERY_TOOL_EVENTS.FETCH_WINDOW, inputs.from, inputs.to);
fetchWindow(inputs.from, inputs.to);
}
};

Expand Down Expand Up @@ -204,33 +209,48 @@ function PaginationInputs({pagination, totalRowCount, clearSelection, serverCurs
error={errorInputs['to']}
/>
</Box> : <span>{gettext('Showing rows: %s to %s', inputs.from, inputs.to)}</span>}
<PgButtonGroup>
{!serverCursor && editPageRange && <PgIconButton size="xs"
title={editPageRange ? gettext('Apply (or press Enter on input)') : gettext('Edit range')}
onClick={()=>eventBus.fireEvent(QUERY_TOOL_EVENTS.FETCH_WINDOW, inputs.from, inputs.to)}
disabled={errorInputs.from || errorInputs.to} icon={<CheckRoundedIcon />}
/>}
{!serverCursor && <PgIconButton size="xs"
title={editPageRange ? gettext('Cancel edit') : gettext('Edit range')}
onClick={()=>setEditPageRange((prev)=>!prev)}
icon={editPageRange ? <EditOffRoundedIcon /> : <EditRoundedIcon />}
/>}
</PgButtonGroup>
<div className='PaginationInputs-divider'>&nbsp;</div>
<span>{gettext('Page No:')}</span>
<InputText
type="int"
size="small"
controlProps={{maxLength: 7}}
style={{
maxWidth: '10ch'
}}
value={inputs.pageNo}
onChange={(value)=>onInputChange('pageNo', value)}
onKeyDown={onInputKeydownPageNo}
error={errorInputs['pageNo']}
/>
<span> {gettext('of')} {pagination.page_count}</span>
{!serverCursor && <>
<PgButtonGroup>
{editPageRange && <PgIconButton size="xs"
title={editPageRange ? gettext('Apply (or press Enter on input)') : gettext('Edit range')}
onClick={()=>fetchWindow(inputs.from, inputs.to)}
disabled={errorInputs.from || errorInputs.to} icon={<CheckRoundedIcon />}
/>}
<PgIconButton size="xs"
title={editPageRange ? gettext('Cancel edit') : gettext('Edit range')}
onClick={()=>setEditPageRange((prev)=>!prev)}
icon={editPageRange ? <EditOffRoundedIcon /> : <EditRoundedIcon />}
/>
</PgButtonGroup>
<div className='PaginationInputs-divider'></div>
<PgButtonGroup>
<PgIconButton size="xs"
title={gettext('Show entire range')}
disabled={inputs.from == 1 && inputs.to == totalRowCount}
onClick={()=>{
onInputChange('from', 1);
onInputChange('to', totalRowCount);
fetchWindow(1, totalRowCount);
}}
icon={<AllInboxRoundedIcon />}
/>
</PgButtonGroup>
<div className='PaginationInputs-divider'>&nbsp;</div>
<span>{gettext('Page No:')}</span>
<InputText
type="int"
size="small"
controlProps={{maxLength: 7}}
style={{
maxWidth: '10ch'
}}
value={inputs.pageNo}
onChange={(value)=>onInputChange('pageNo', value)}
onKeyDown={onInputKeydownPageNo}
error={errorInputs['pageNo']}
/>
<span> {gettext('of')} {pagination.page_count}</span>
</>}
<div className='PaginationInputs-divider'>&nbsp;</div>
<PgButtonGroup size="small">
<PgIconButton title={gettext('First Page')} disabled={pagination.page_no <= 1} onClick={()=>goToPage(1)} icon={<SkipPreviousRoundedIcon />}/>
Expand Down
3 changes: 0 additions & 3 deletions web/pgadmin/translations/it/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,6 @@ msgid ""
"can provide any string with or without placeholders of their choice. A blank "
"title will revert to the default."
msgstr ""
"I segnaposto supportati sono %FUNCTION%, %ARGS%, %SCHEMA% e %DATABASE%. Gli "
"utenti possono specificare qualsiasi stringa con o senza segnaposto a loro "
"scelta. Un titolo vuoto tornerà al valore predefinito."

#: pgadmin/browser/register_browser_preferences.py:456
#: pgadmin/browser/static/js/collection.js:57 pgadmin/browser/static/js/node.js:215
Expand Down
6 changes: 3 additions & 3 deletions web/regression/feature_utils/pgadmin_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,9 @@ def find_codemirror(driver):
action.perform()
else:
self.driver.execute_script(
"arguments[0].cmView.view.setValue(arguments[1]);"
"arguments[0].cmView.view.setCursor("
"arguments[0].cmView.view.lineCount(),-1);",
"arguments[0].cmTile.view.setValue(arguments[1]);"
"arguments[0].cmTile.view.setCursor("
"arguments[0].cmTile.view.lineCount(),-1);",
codemirror_ele, field_content)

def click_tab(self, tab_name):
Expand Down
Loading