Skip to content

Commit efd0dd2

Browse files
committed
1) Fixed an issue where selecting all rows and copying using shortcut 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.
1 parent b90a390 commit efd0dd2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

web/pgadmin/tools/sqleditor/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import math
1919

2020
import json
21+
22+
from sqlalchemy import or_
23+
2124
from config import PG_DEFAULT_DRIVER, ALLOW_SAVE_PASSWORD, SHARED_STORAGE
2225
from werkzeug.user_agent import UserAgent
2326
from flask import Response, url_for, render_template, session, current_app
@@ -2353,7 +2356,9 @@ def get_new_connection_data(sgid=None, sid=None):
23532356
server_groups = ServerGroup.query.all()
23542357
server_group_data = {server_group.name: [] for server_group in
23552358
server_groups}
2356-
servers = Server.query.filter(Server.is_adhoc == 0)
2359+
servers = Server.query.filter(
2360+
or_(Server.user_id == current_user.id, Server.shared),
2361+
Server.is_adhoc == 0)
23572362

23582363
for server in servers:
23592364
manager = driver.connection_manager(server.id)

web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ const StyledPgReactDataGrid = styled(PgReactDataGrid)(({stripedRows, theme})=>({
7676
}},
7777
'& .rdg-row': {
7878
'& .rdg-cell:nth-of-type(1)': {
79-
backgroundColor: theme.palette.grey[600],
79+
backgroundColor: theme.palette.grey[600] + '!important',
8080
},
8181
'&[aria-selected="true"] .rdg-cell:nth-of-type(1)': {
82-
backgroundColor: theme.palette.primary.main,
82+
backgroundColor: theme.palette.primary.main + '!important',
8383
color: theme.palette.primary.contrastText,
8484
}
8585
},
@@ -160,7 +160,7 @@ function SelectAllHeaderRenderer({isCellSelected}) {
160160
}, [isRowSelected]);
161161

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

0 commit comments

Comments
 (0)