Skip to content

Commit

Permalink
WIP Side_Workspace
Browse files Browse the repository at this point in the history
Added adhoc connection support

1) Disable menu for other workspace.
2) Compare server name as well while adding the adhoc server.
3) PSQL tool should shown error if binary path is not set.

Added logic to disconnect from all the servers, when layout is changed.

1) Disabled Schema Diff workspace if no tabs are present.
2) Make code generic.

Fixed Demo comments.

Fixed Javascript test cases

Fixed feature test.

Updated documentation.
  • Loading branch information
akshay-joshi committed Dec 10, 2024
1 parent c3a334f commit 3a8a033
Show file tree
Hide file tree
Showing 126 changed files with 4,001 additions and 543 deletions.
4 changes: 2 additions & 2 deletions docs/en_US/container_deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ The default binary paths set in the container are as follows:
.. code-block:: bash
DEFAULT_BINARY_PATHS = {
'pg-17': '/usr/local/pgsql-17',
'pg-16': '/usr/local/pgsql-16',
'pg-15': '/usr/local/pgsql-15',
'pg-14': '/usr/local/pgsql-14',
'pg-13': '/usr/local/pgsql-13',
'pg-12': '/usr/local/pgsql-12'
'pg-13': '/usr/local/pgsql-13'
}
this may be changed in the :ref:`preferences`.
Expand Down
Binary file modified docs/en_US/images/main_left_pane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en_US/images/preferences_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/en_US/images/preferences_misc_themes.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/en_US/images/preferences_paths_binary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en_US/images/psql_workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en_US/images/query_tool_workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en_US/images/runtime_standalone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en_US/images/schema_diff_workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en_US/images/welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/en_US/keyboard_shortcuts.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
****************************
`Keyboard Shortcuts`:index::
****************************
***************************
`Keyboard Shortcuts`:index:
***************************

Keyboard shortcuts are provided in pgAdmin to allow easy access to specific
functions. Alternate shortcuts can be configured through File > Preferences if
Expand Down
25 changes: 17 additions & 8 deletions docs/en_US/preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
***************************

Use options on the *Preferences* dialog to customize the behavior of the client.
To open the *Preferences* dialog, select *Preferences* from the *File* menu.
To open the *Preferences* dialog, select *Preferences* from the *File* menu or
click on the *Settings* button at the bottom left corner in case of Workspace
layout.

.. image:: images/preferences_menu.png
:alt: Preferences menu
:align: center

The left pane of the *Preferences* dialog displays a tree control; each node of
the tree control provides access to options that are related to the node under
which they are displayed.
Expand Down Expand Up @@ -266,21 +273,23 @@ The Miscellaneous Node

Expand the *Miscellaneous* node to specify miscellaneous display preferences.

.. image:: images/preferences_misc_user_language.png
:alt: Preferences dialog user language section
.. image:: images/preferences_misc_user_interface.png
:alt: Preferences dialog user interface section
:align: center

* Use the *User language* drop-down listbox to select the display language for
* Use the *Language* drop-down listbox to select the display language for
the client.

.. image:: images/preferences_misc_themes.png
:alt: Preferences dialog themes section
:align: center
* Use the *Layout* drop-down listbox to select the layout for the client.
pgAdmin offers two options: the Classic layout, a longstanding and familiar
design, and the Workspace layout, which provides distraction free dedicated
areas for the Query Tool, PSQL, and Schema Diff tools. 'Workspace' layout is
the default layout, but user can change it to 'Classic'.

* Use the *Themes* drop-down listbox to select the theme for pgAdmin. You'll also get a preview just below the
drop down. You can also submit your own themes,
check `here <https://github.com/pgadmin-org/pgadmin4/blob/master/README.md>`_ how.
Currently we support Standard, Dark and High Contrast and System theme. Selecting System option will follow
Currently we support Light, Dark, High Contrast and System theme. Selecting System option will follow
your computer's settings.

The Paths Node
Expand Down
42 changes: 41 additions & 1 deletion docs/en_US/psql_tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,44 @@ mode, but is disabled by default in Server mode. This is because users can run
arbitrary shell commands through psql which may be considered a security risk in
some deployments. System Administrators can enable the use of the PSQL tool in
the pgAdmin configuration by setting the *ENABLE_PSQL* option to *True*; see
:ref:`config_py` for more information.
:ref:`config_py` for more information.

PSQL Tool in Workspace Layout
******************************

The workspace layout offers a distraction-free, dedicated area for the PSQL Tool.
When the PSQL Tool workspace is accessed, the Welcome page opens by default.

**Note**: In the Workspace layout, all PSQL tabs open within the PSQL Tool workspace.

In the classic UI, users must connect to a database server and navigate to the
database node before using the PSQL Tool. However, with the introduction of the
Workspace layout and Welcome page, users can seamlessly connect to any ad-hoc
server, even if it is not registered in the Object Explorer.

.. image:: images/psql_workspace.png
:alt: PSQL tool workspace
:align: center

* Select *Existing Server* from the dropdown to connect to a server already
listed in the Object Explorer. It is optional.
* Provide the *Server Name* for ad-hoc servers.
* Specify the IP address of the server host, or the fully qualified domain
name in the *Host name/address* field.
* Enter the listener port number of the server host in the *Port* field.
* Use the *Database* field to specify the name of the database to which
the client will connect.
* Use the *User* field to specify the name of a user that will be used when
authenticating with the server.
* Use the *Password* field to provide a password that will be supplied when
authenticating with the server.
* Use the *Role* field to specify the name of a role that has privileges that
will be conveyed to the client after authentication with the server.
* Use the *Service* field to specify the service name. For more information,
see
`Section 33.16 of the Postgres documentation <https://www.postgresql.org/docs/current/libpq-pgservice.html>`_.
* Use the fields in the *Connection Parameters* to configure the connection parameters.

After filling in all the required fields, click the Connect & Open PSQL Tool
button to launch the PSQL Tool with the provided server details. If the password
is not supplied, you will be prompted to enter it.
41 changes: 41 additions & 0 deletions docs/en_US/query_tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,47 @@ The Query Tool features two panels:
server messages related to the query's execution and any asynchronous
notifications received from the server.

Query Tool in Workspace Layout
******************************

The workspace layout offers a distraction-free, dedicated area for the Query Tool.
When the Query Tool workspace is accessed, the Welcome page opens by default.

**Note**: In the Workspace layout, all Query Tool and View/Edit Data tabs open within the Query Tool workspace.

In the classic UI, users must connect to a database server and navigate to the
database node before using the Query Tool. However, with the introduction of the
Workspace layout and Welcome page, users can seamlessly connect to any ad-hoc
server, even if it is not registered in the Object Explorer.

.. image:: images/query_tool_workspace.png
:alt: Query tool workspace
:align: center

* Select *Existing Server* from the dropdown to connect to a server already
listed in the Object Explorer. It is optional.
* Provide the *Server Name* for ad-hoc servers.
* Specify the IP address of the server host, or the fully qualified domain
name in the *Host name/address* field.
* Enter the listener port number of the server host in the *Port* field.
* Use the *Database* field to specify the name of the database to which
the client will connect.
* Use the *User* field to specify the name of a user that will be used when
authenticating with the server.
* Use the *Password* field to provide a password that will be supplied when
authenticating with the server.
* Use the *Role* field to specify the name of a role that has privileges that
will be conveyed to the client after authentication with the server.
* Use the *Service* field to specify the service name. For more information,
see
`Section 33.16 of the Postgres documentation <https://www.postgresql.org/docs/current/libpq-pgservice.html>`_.
* Use the fields in the *Connection Parameters* to configure the connection parameters.

After filling in all the required fields, click the Connect & Open Query Tool
button to launch the Query Tool with the provided server details. If the password
is not supplied, you will be prompted to enter it.


Toolbar
*******

Expand Down
1 change: 1 addition & 0 deletions docs/en_US/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ notes for it.
:maxdepth: 1


release_notes_9_0
release_notes_8_14
release_notes_8_13
release_notes_8_12
Expand Down
31 changes: 31 additions & 0 deletions docs/en_US/release_notes_9_0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
***********
Version 9.0
***********

Release date: 2025-01-09

This release contains a number of bug fixes and new features since the release of pgAdmin 4 v8.14.

Supported Database Servers
**************************
**PostgreSQL**: 13, 14, 15, 16 and 17

**EDB Advanced Server**: 13, 14, 15, 16 and 17

Bundled PostgreSQL Utilities
****************************
**psql**, **pg_dump**, **pg_dumpall**, **pg_restore**: 17.0


New features
************

| `Issue #7708 <https://github.com/pgadmin-org/pgadmin4/issues/7708>`_ - Enhanced pgAdmin 4 with support for Workspace layouts.
Housekeeping
************


Bug fixes
*********

12 changes: 12 additions & 0 deletions docs/en_US/schema_diff.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ Use the :ref:`Preferences <preferences>` dialog to specify following:
* *Schema Diff* should ignore the whitespaces while comparing string objects. Set *Ignore whitespaces* option to true.
* *Schema Diff* should ignore the owner while comparing objects. Set *Ignore owner* option to true.

Schema Diff in Workspace Layout
*******************************

The workspace layout offers a distraction-free, dedicated area for the Schema Diff.
By default, the Schema Diff workspace button remains disabled until at least one Schema Diff tab is opened.

**Note**: In the Workspace layout, all Schema Diff tabs open within the Schema Diff workspace.

.. image:: images/schema_diff_workspace.png
:alt: schema diff workspace
:align: center


The *Schema Diff* panel is divided into two panels; an Object Comparison panel
and a DDL Comparison panel.
Expand Down
2 changes: 1 addition & 1 deletion docs/en_US/user_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the right pane.
Select an icon from the *Quick Links* panel on the *Dashboard* tab to:

* Click the *Add New Server* button to open the
:ref:`Create - Server dialog <server_dialog>` to add a new server definition.
:ref:`Register - Server dialog <server_dialog>` to add a new server definition.
* Click the *Configure pgAdmin* button to open the
:ref:`Preferences dialog <preferences>` to customize your pgAdmin client.

Expand Down
3 changes: 1 addition & 2 deletions pkg/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ DEFAULT_BINARY_PATHS = {
'pg-16': '/usr/local/pgsql-16',
'pg-15': '/usr/local/pgsql-15',
'pg-14': '/usr/local/pgsql-14',
'pg-13': '/usr/local/pgsql-13',
'pg-12': '/usr/local/pgsql-12'
'pg-13': '/usr/local/pgsql-13'
}
EOF

Expand Down
4 changes: 0 additions & 4 deletions web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,12 @@
##########################################################################
DEFAULT_BINARY_PATHS = {
"pg": "",
"pg-12": "",
"pg-13": "",
"pg-14": "",
"pg-15": "",
"pg-16": "",
"pg-17": "",
"ppas": "",
"ppas-12": "",
"ppas-13": "",
"ppas-14": "",
"ppas-15": "",
Expand All @@ -480,14 +478,12 @@

FIXED_BINARY_PATHS = {
"pg": "",
"pg-12": "",
"pg-13": "",
"pg-14": "",
"pg-15": "",
"pg-16": "",
"pg-17": "",
"ppas": "",
"ppas-12": "",
"ppas-13": "",
"ppas-14": "",
"ppas-15": "",
Expand Down
39 changes: 39 additions & 0 deletions web/migrations/versions/255e2842e4d7_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################

"""
Revision ID: 255e2842e4d7
Revises: f28be870d5ec
Create Date: 2024-12-05 13:14:53.602974
"""
from alembic import op, context
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '255e2842e4d7'
down_revision = 'f28be870d5ec'
branch_labels = None
depends_on = None


def upgrade():
with (op.batch_alter_table("server",
table_kwargs={'sqlite_autoincrement': True}) as batch_op):
if context.get_impl().bind.dialect.name == "sqlite":
batch_op.alter_column('id', autoincrement=True)
batch_op.add_column(sa.Column('is_adhoc', sa.Integer(),
server_default='0'))


def downgrade():
# pgAdmin only upgrades, downgrade not implemented.
pass
6 changes: 6 additions & 0 deletions web/pgadmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ def run_migration_for_others():
else:
run_migration_for_sqlite()

# Delete all the adhoc(temporary) servers from the pgAdmin database.
from pgadmin.browser.server_groups.servers.utils import (
delete_adhoc_servers)
with app.app_context():
delete_adhoc_servers()

Mail(app)

# Don't bother paths when running in cli mode
Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/about/static/js/AboutComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React, { useEffect, useState, useRef } from 'react';
import { Box, Grid, InputLabel } from '@mui/material';
import { InputSQL } from '../../../static/js/components/FormComponents';
import getApiInstance from '../../../static/js/api_instance';
import { usePgAdmin } from '../../../static/js/BrowserComponent';
import { usePgAdmin } from '../../../static/js/PgAdminProvider';

export default function AboutComponent() {
const containerRef = useRef();
Expand Down
Loading

0 comments on commit 3a8a033

Please sign in to comment.