Skip to content

Commit

Permalink
1) Fixed an issue where selecting all rows and copying using shortcut…
Browse files Browse the repository at this point in the history
… only, the first attempt fails to copy.

2) Fixed an issue where a single row is copied first and then clicked on "Select All", the previously copied row's highlight color changes.
3) Fixed an issue where non-shared servers are visible in the Existing Servers list on the Welcome page and New Connection dialog.
  • Loading branch information
akshay-joshi committed Feb 5, 2025
1 parent b90a390 commit efd0dd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion web/pgadmin/tools/sqleditor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import math

import json

from sqlalchemy import or_

from config import PG_DEFAULT_DRIVER, ALLOW_SAVE_PASSWORD, SHARED_STORAGE
from werkzeug.user_agent import UserAgent
from flask import Response, url_for, render_template, session, current_app
Expand Down Expand Up @@ -2353,7 +2356,9 @@ def get_new_connection_data(sgid=None, sid=None):
server_groups = ServerGroup.query.all()
server_group_data = {server_group.name: [] for server_group in
server_groups}
servers = Server.query.filter(Server.is_adhoc == 0)
servers = Server.query.filter(
or_(Server.user_id == current_user.id, Server.shared),
Server.is_adhoc == 0)

for server in servers:
manager = driver.connection_manager(server.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ const StyledPgReactDataGrid = styled(PgReactDataGrid)(({stripedRows, theme})=>({
}},
'& .rdg-row': {
'& .rdg-cell:nth-of-type(1)': {
backgroundColor: theme.palette.grey[600],
backgroundColor: theme.palette.grey[600] + '!important',
},
'&[aria-selected="true"] .rdg-cell:nth-of-type(1)': {
backgroundColor: theme.palette.primary.main,
backgroundColor: theme.palette.primary.main + '!important',
color: theme.palette.primary.contrastText,
}
},
Expand Down Expand Up @@ -160,7 +160,7 @@ function SelectAllHeaderRenderer({isCellSelected}) {
}, [isRowSelected]);

return <div ref={cellRef} style={{width: '100%', height: '100%'}} onClick={onClick}
tabIndex="-1" onKeyDown={(e)=>dataGridExtras.handleShortcuts(e, true)}></div>;
tabIndex="0" onKeyDown={(e)=>dataGridExtras.handleShortcuts(e, true)}></div>;
}
SelectAllHeaderRenderer.propTypes = {
isCellSelected: PropTypes.bool,
Expand Down

0 comments on commit efd0dd2

Please sign in to comment.