Skip to content

Commit 82c5feb

Browse files
Font family should fallback to Source Code Pro if not valid. #392
Update user management docs.
1 parent 0914ec2 commit 82c5feb

File tree

9 files changed

+41
-47
lines changed

9 files changed

+41
-47
lines changed

docs/en_US/images/add_user.png

-28 KB
Loading

docs/en_US/images/user.png

-7.71 KB
Loading

docs/en_US/preferences.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ Use the fields on the *Editor* panel to change settings of the query editor.
417417
* When the *Code folding?* switch is set to *False*, the editor will disable
418418
code folding. Disabling will improve editor performance with large files.
419419

420-
* Use the *Font family* field to specify the font family that will be used in
421-
all SQL text boxes and editors. If the font is not found, the default font
422-
of *Source Code Pro* will be used.
420+
* Use the *Font family* field to be used for all SQL editors. The specified
421+
font should already be installed on your system. If the font is not found,
422+
the editor will fall back to the default font, Source Code Pro.
423423

424424
* Use the *Font size* field to specify the font size that will be used in text
425425
boxes and editors.

docs/en_US/user_management.rst

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
.. _user_management:
22

33
*******************************
4-
`User Management Dialog`:index:
4+
`User Management`:index:
55
*******************************
66

77
When invoking pgAdmin in desktop mode, a password is randomly generated, and
88
then ignored. If you install pgAdmin in server mode, you will be prompted for
99
an administrator email and password for the pgAdmin client.
1010

1111
When you authenticate with pgAdmin, the server definitions associated with that
12-
login role are made available in the tree control. An administrative user can
13-
use the *User Management* dialog to:
12+
login role are made available in the tree control.
1413

15-
* add or delete pgAdmin roles
16-
* assign privileges
17-
* manage the password associated with a role
14+
Users Tab
15+
*******************
16+
An administrative user can use the *Users* tab to:
17+
18+
* manage pgAdmin users
19+
* change users role
20+
* change password for a user
21+
* deactivate user
22+
* unlock a locked user
1823

1924
.. image:: images/user.png
2025
:alt: pgAdmin user management window
@@ -26,42 +31,39 @@ the following criteria types: *Authentication source*, *Username*, or *Email*.
2631
For example, you can enter *ldap* in the search box and only the records having
2732
*ldap* as authentication source will be displayed in the *User Management* table.
2833

29-
To add a user, click the Add (+) button at the top right corner.
34+
To add a user, click the Add (+) button at the top left corner. It will open a
35+
dialog where you can fill in details for the new user.
3036

3137
.. image:: images/add_user.png
3238
:alt: pgAdmin user management window add new user
3339
:align: center
3440

3541
Provide information about the new pgAdmin role in the row:
3642

37-
* Use the drop-down list box next to *Authentication source* field to select the
38-
type of authentication that should be used for the user. If authentication
39-
source is only 'internal' then *Authentication source* field
40-
is disabled. Supported *Authentication source* are internal, ldap, kerberos,
41-
oauth2 and webserver.
42-
* Click in the *Username* field, and provide a username for the user. This field
43+
* Use the *Authentication source* field to select the type of authentication that
44+
should be used for the user. If authentication source in the pgAdmin server config
45+
has 'internal' only then *Authentication source* field will be disabled. Supported
46+
*Authentication source* are internal, ldap, kerberos, oauth2 and webserver.
47+
* Use the *Username* field to provide a username for the user. This field
4348
is enabled only when you select authentication source except *internal*. If you
44-
select *internal* as authentication source, your email address is displayed in the
45-
username field.
46-
* Click in the *Email* field, and provide an email address for the user.
47-
* Use the drop-down list box next to *Role* to select whether a user is an
48-
*Administrator* or a *User*.
49-
49+
select *internal* as authentication source, your email address will be taken as
50+
the username.
51+
* Use the *Email* field to provide an email address for the user. Email is a
52+
mandatory field for authentication source *internal*.
53+
* Use the *Role* field to select whether a user is an *Administrator* or a *User*.
5054
* Select *Administrator* if the user will have administrative privileges
5155
within the pgAdmin client.
5256
* Select *User* to create a non-administrative user account.
53-
54-
* Move the *Active* switch to the *No* position if the account is not currently
55-
active; the default is *Yes*. Use this switch to disable account activity
56-
without deleting an account.
57+
* Use the *Active* switch to enable or disable account activity without deleting an
58+
account; by default it is enabled.
5759
* Use the *New password* field to provide the password associated with the user
5860
specified in the *Email* field. This field is disabled if you select any
5961
authentication source except *internal*.
6062
* Re-enter the password in the *Confirm password* field. This field is disabled
6163
if you select *ldap* as authentication source.
62-
* *Locked* switch is disabled by default when set to *False*. It is only enabled
63-
when the user is locked by trying unsuccessful login attempts. Move the switch
64-
to the *False* position if you want to unlock the account.
64+
* *Locked* switch cannot be changed if is turned off. It can only be changed
65+
when the user is locked by trying unsuccessful login attempts. Turn off the
66+
switch if you want to unlock the account.
6567

6668
To discard a user, and revoke access to pgAdmin, click the trash icon to the
6769
left of the row and confirm deletion in the *Delete user?* dialog. If the user
@@ -72,9 +74,8 @@ dialog will appear to change the ownership of a shared server.
7274
Users with the *Administrator* role are able to add, edit and remove pgAdmin
7375
users, but otherwise have the same capabilities as those with the *User* role.
7476

77+
* Click the *Refresh* button to get latest users list.
7578
* Click the *Help* button (?) to access online help.
76-
* Click the *Close* button to save work. You will be prompted to return to the
77-
dialog if your selections cannot be saved.
7879

7980

8081
Using 'setup.py' command line script

web/pgadmin/static/js/Theme/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ basicSettings = createTheme(basicSettings, {
3838
fontSize: 14,
3939
htmlFontSize: 14,
4040
fontFamilyIcon: '"Font Awesome 5 Free"',
41+
fontFamilySourceCode: '"Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
4142
fontFamily: [
4243
'Roboto',
4344
'"Helvetica Neue"',
@@ -367,7 +368,7 @@ function getFinalTheme(baseTheme) {
367368
flexGrow: 1,
368369
},
369370
fontSourceCode: {
370-
fontFamily: '"Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
371+
fontFamily: basicSettings.typography.fontFamilySourceCode,
371372
}
372373
};
373374

web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import activeLineExtn from '../extensions/activeLineMarker';
5353
import currentQueryHighlighterExtn from '../extensions/currentQueryHighlighter';
5454
import { autoCompleteCompartment, eolCompartment, indentNewLine, eol } from '../extensions/extraStates';
5555
import { OS_EOL } from '../../../../../tools/sqleditor/static/js/components/QueryToolConstants';
56+
import { useTheme } from '@mui/material';
5657

5758
const arrowRightHtml = ReactDOMServer.renderToString(<KeyboardArrowRightRoundedIcon style={{width: '16px'}} />);
5859
const arrowDownHtml = ReactDOMServer.renderToString(<ExpandMoreRoundedIcon style={{width: '16px'}} />);
@@ -179,6 +180,7 @@ export default function Editor({
179180
};
180181

181182
const preferencesStore = usePreferences();
183+
const theme = useTheme();
182184
const editable = !disabled;
183185

184186
const shortcuts = useRef(new Compartment());
@@ -301,9 +303,9 @@ export default function Editor({
301303

302304
const fontSize = calcFontSize(pref.sql_font_size);
303305
newConfigExtn.push(EditorView.theme({
304-
'& .cm-content': {
306+
'& .cm-scroller .cm-content': {
305307
fontSize: fontSize,
306-
fontFamily: pref.sql_font_family,
308+
fontFamily: `${pref.sql_font_family}, ${theme.typography.fontFamilySourceCode}`,
307309
},
308310
'.cm-gutters': {
309311
fontSize: fontSize,

web/pgadmin/tools/user_management/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -558,14 +558,15 @@ def create_user(data):
558558

559559
try:
560560
new_data = validate_user(data)
561+
new_data['email'] = new_data['email'] if 'email' in new_data else None
561562
new_data['password'] = new_data['password']\
562563
if 'password' in new_data else None
563564

564565
if 'roles' in new_data:
565566
new_data['roles'] = [Role.query.get(new_data['roles'])]
566567

567568
except Exception as e:
568-
return False, str(e.description)
569+
return False, str(e)
569570

570571
try:
571572
_create_new_user(new_data)

web/pgadmin/tools/user_management/static/js/UserDialog.jsx

-11
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ class UserSchema extends BaseUISchema {
3535
current_user['auth_sources'].includes(AUTH_METHODS['INTERNAL']));
3636
}
3737

38-
deleteUser(deleteRow) {
39-
this.pgAdmin.Browser.notifier.confirm(
40-
gettext('Delete user?'),
41-
gettext('Are you sure you wish to delete this user?'),
42-
deleteRow,
43-
function() {
44-
return true;
45-
}
46-
);
47-
}
48-
4938
isUserNameEnabled(state) {
5039
return this.isNew(state) && state.auth_source != AUTH_METHODS['INTERNAL'];
5140
}

web/pgadmin/tools/user_management/static/js/Users.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default function Users() {
100100
setLoading('');
101101
};
102102

103-
pgAdmin.Browser.notifier.confirm(gettext('Delete User'), gettext('Are you sure you want to delete the user %s?', row.original.username),
103+
pgAdmin.Browser.notifier.confirmDelete(gettext('Delete User?'), gettext('Are you sure you want to delete the user %s?', `<strong>${row.original.username}</strong>`),
104104
async () => {
105105
setLoading(gettext('Deleting user...'));
106106
try {

0 commit comments

Comments
 (0)