diff --git a/docs/en_US/images/add_user.png b/docs/en_US/images/add_user.png
index 4c8de80dd..8f5ca9277 100644
Binary files a/docs/en_US/images/add_user.png and b/docs/en_US/images/add_user.png differ
diff --git a/docs/en_US/images/user.png b/docs/en_US/images/user.png
index 7041f1bdf..dcfe729d4 100644
Binary files a/docs/en_US/images/user.png and b/docs/en_US/images/user.png differ
diff --git a/docs/en_US/preferences.rst b/docs/en_US/preferences.rst
index 52fe8214b..65de03577 100644
--- a/docs/en_US/preferences.rst
+++ b/docs/en_US/preferences.rst
@@ -417,9 +417,9 @@ Use the fields on the *Editor* panel to change settings of the query editor.
* When the *Code folding?* switch is set to *False*, the editor will disable
code folding. Disabling will improve editor performance with large files.
-* Use the *Font family* field to specify the font family that will be used in
- all SQL text boxes and editors. If the font is not found, the default font
- of *Source Code Pro* will be used.
+* Use the *Font family* field to be used for all SQL editors. The specified
+ font should already be installed on your system. If the font is not found,
+ the editor will fall back to the default font, Source Code Pro.
* Use the *Font size* field to specify the font size that will be used in text
boxes and editors.
diff --git a/docs/en_US/user_management.rst b/docs/en_US/user_management.rst
index 0765f9503..792f41802 100644
--- a/docs/en_US/user_management.rst
+++ b/docs/en_US/user_management.rst
@@ -1,7 +1,7 @@
.. _user_management:
*******************************
-`User Management Dialog`:index:
+`User Management`:index:
*******************************
When invoking pgAdmin in desktop mode, a password is randomly generated, and
@@ -9,12 +9,17 @@ then ignored. If you install pgAdmin in server mode, you will be prompted for
an administrator email and password for the pgAdmin client.
When you authenticate with pgAdmin, the server definitions associated with that
-login role are made available in the tree control. An administrative user can
-use the *User Management* dialog to:
+login role are made available in the tree control.
-* add or delete pgAdmin roles
-* assign privileges
-* manage the password associated with a role
+Users Tab
+*******************
+An administrative user can use the *Users* tab to:
+
+* manage pgAdmin users
+* change users role
+* change password for a user
+* deactivate user
+* unlock a locked user
.. image:: images/user.png
:alt: pgAdmin user management window
@@ -26,7 +31,8 @@ the following criteria types: *Authentication source*, *Username*, or *Email*.
For example, you can enter *ldap* in the search box and only the records having
*ldap* as authentication source will be displayed in the *User Management* table.
-To add a user, click the Add (+) button at the top right corner.
+To add a user, click the Add (+) button at the top left corner. It will open a
+dialog where you can fill in details for the new user.
.. image:: images/add_user.png
:alt: pgAdmin user management window add new user
@@ -34,34 +40,30 @@ To add a user, click the Add (+) button at the top right corner.
Provide information about the new pgAdmin role in the row:
-* Use the drop-down list box next to *Authentication source* field to select the
- type of authentication that should be used for the user. If authentication
- source is only 'internal' then *Authentication source* field
- is disabled. Supported *Authentication source* are internal, ldap, kerberos,
- oauth2 and webserver.
-* Click in the *Username* field, and provide a username for the user. This field
+* Use the *Authentication source* field to select the type of authentication that
+ should be used for the user. If authentication source in the pgAdmin server config
+ has 'internal' only then *Authentication source* field will be disabled. Supported
+ *Authentication source* are internal, ldap, kerberos, oauth2 and webserver.
+* Use the *Username* field to provide a username for the user. This field
is enabled only when you select authentication source except *internal*. If you
- select *internal* as authentication source, your email address is displayed in the
- username field.
-* Click in the *Email* field, and provide an email address for the user.
-* Use the drop-down list box next to *Role* to select whether a user is an
- *Administrator* or a *User*.
-
+ select *internal* as authentication source, your email address will be taken as
+ the username.
+* Use the *Email* field to provide an email address for the user. Email is a
+ mandatory field for authentication source *internal*.
+* Use the *Role* field to select whether a user is an *Administrator* or a *User*.
* Select *Administrator* if the user will have administrative privileges
within the pgAdmin client.
* Select *User* to create a non-administrative user account.
-
-* Move the *Active* switch to the *No* position if the account is not currently
- active; the default is *Yes*. Use this switch to disable account activity
- without deleting an account.
+* Use the *Active* switch to enable or disable account activity without deleting an
+ account; by default it is enabled.
* Use the *New password* field to provide the password associated with the user
specified in the *Email* field. This field is disabled if you select any
authentication source except *internal*.
* Re-enter the password in the *Confirm password* field. This field is disabled
if you select *ldap* as authentication source.
-* *Locked* switch is disabled by default when set to *False*. It is only enabled
- when the user is locked by trying unsuccessful login attempts. Move the switch
- to the *False* position if you want to unlock the account.
+* *Locked* switch cannot be changed if is turned off. It can only be changed
+ when the user is locked by trying unsuccessful login attempts. Turn off the
+ switch if you want to unlock the account.
To discard a user, and revoke access to pgAdmin, click the trash icon to the
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.
Users with the *Administrator* role are able to add, edit and remove pgAdmin
users, but otherwise have the same capabilities as those with the *User* role.
+* Click the *Refresh* button to get latest users list.
* Click the *Help* button (?) to access online help.
-* Click the *Close* button to save work. You will be prompted to return to the
- dialog if your selections cannot be saved.
Using 'setup.py' command line script
diff --git a/web/pgadmin/static/js/Theme/index.jsx b/web/pgadmin/static/js/Theme/index.jsx
index 10efb39e4..3d3454dd0 100644
--- a/web/pgadmin/static/js/Theme/index.jsx
+++ b/web/pgadmin/static/js/Theme/index.jsx
@@ -38,6 +38,7 @@ basicSettings = createTheme(basicSettings, {
fontSize: 14,
htmlFontSize: 14,
fontFamilyIcon: '"Font Awesome 5 Free"',
+ fontFamilySourceCode: '"Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
fontFamily: [
'Roboto',
'"Helvetica Neue"',
@@ -367,7 +368,7 @@ function getFinalTheme(baseTheme) {
flexGrow: 1,
},
fontSourceCode: {
- fontFamily: '"Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
+ fontFamily: basicSettings.typography.fontFamilySourceCode,
}
};
diff --git a/web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx b/web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx
index 53547b04e..926c052e2 100644
--- a/web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx
+++ b/web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx
@@ -53,6 +53,7 @@ import activeLineExtn from '../extensions/activeLineMarker';
import currentQueryHighlighterExtn from '../extensions/currentQueryHighlighter';
import { autoCompleteCompartment, eolCompartment, indentNewLine, eol } from '../extensions/extraStates';
import { OS_EOL } from '../../../../../tools/sqleditor/static/js/components/QueryToolConstants';
+import { useTheme } from '@mui/material';
const arrowRightHtml = ReactDOMServer.renderToString();
const arrowDownHtml = ReactDOMServer.renderToString();
@@ -179,6 +180,7 @@ export default function Editor({
};
const preferencesStore = usePreferences();
+ const theme = useTheme();
const editable = !disabled;
const shortcuts = useRef(new Compartment());
@@ -301,9 +303,9 @@ export default function Editor({
const fontSize = calcFontSize(pref.sql_font_size);
newConfigExtn.push(EditorView.theme({
- '& .cm-content': {
+ '& .cm-scroller .cm-content': {
fontSize: fontSize,
- fontFamily: pref.sql_font_family,
+ fontFamily: `${pref.sql_font_family}, ${theme.typography.fontFamilySourceCode}`,
},
'.cm-gutters': {
fontSize: fontSize,
diff --git a/web/pgadmin/tools/user_management/__init__.py b/web/pgadmin/tools/user_management/__init__.py
index caa465600..1c6a78e44 100644
--- a/web/pgadmin/tools/user_management/__init__.py
+++ b/web/pgadmin/tools/user_management/__init__.py
@@ -558,6 +558,7 @@ def create_user(data):
try:
new_data = validate_user(data)
+ new_data['email'] = new_data['email'] if 'email' in new_data else None
new_data['password'] = new_data['password']\
if 'password' in new_data else None
@@ -565,7 +566,7 @@ def create_user(data):
new_data['roles'] = [Role.query.get(new_data['roles'])]
except Exception as e:
- return False, str(e.description)
+ return False, str(e)
try:
_create_new_user(new_data)
diff --git a/web/pgadmin/tools/user_management/static/js/UserDialog.jsx b/web/pgadmin/tools/user_management/static/js/UserDialog.jsx
index 131b2b333..a1e930541 100644
--- a/web/pgadmin/tools/user_management/static/js/UserDialog.jsx
+++ b/web/pgadmin/tools/user_management/static/js/UserDialog.jsx
@@ -35,17 +35,6 @@ class UserSchema extends BaseUISchema {
current_user['auth_sources'].includes(AUTH_METHODS['INTERNAL']));
}
- deleteUser(deleteRow) {
- this.pgAdmin.Browser.notifier.confirm(
- gettext('Delete user?'),
- gettext('Are you sure you wish to delete this user?'),
- deleteRow,
- function() {
- return true;
- }
- );
- }
-
isUserNameEnabled(state) {
return this.isNew(state) && state.auth_source != AUTH_METHODS['INTERNAL'];
}
diff --git a/web/pgadmin/tools/user_management/static/js/Users.jsx b/web/pgadmin/tools/user_management/static/js/Users.jsx
index 41325d581..93ff905c1 100644
--- a/web/pgadmin/tools/user_management/static/js/Users.jsx
+++ b/web/pgadmin/tools/user_management/static/js/Users.jsx
@@ -100,7 +100,7 @@ export default function Users() {
setLoading('');
};
- pgAdmin.Browser.notifier.confirm(gettext('Delete User'), gettext('Are you sure you want to delete the user %s?', row.original.username),
+ pgAdmin.Browser.notifier.confirmDelete(gettext('Delete User?'), gettext('Are you sure you want to delete the user %s?', `${row.original.username}`),
async () => {
setLoading(gettext('Deleting user...'));
try {