diff --git a/web/package.json b/web/package.json index b7604d2cf..d56c20118 100644 --- a/web/package.json +++ b/web/package.json @@ -145,7 +145,7 @@ "react": "^17.0.1", "react-aspen": "^1.1.0", "react-checkbox-tree": "^1.7.2", - "react-data-grid": "git+https://github.com/adityatoshniwal/react-data-grid.git/#8d9bc16ddd7c419acfbbd1c1cc2b70eb9f5b453c", + "react-data-grid": "git+https://github.com/EnterpriseDB/react-data-grid.git/#200d2f5e02de694e3e9ffbe177c279bc40240fb8", "react-dom": "^17.0.1", "react-draggable": "^4.4.4", "react-dropzone": "^14.2.1", diff --git a/web/pgadmin/authenticate/__init__.py b/web/pgadmin/authenticate/__init__.py index d637e32dd..8d08b34e8 100644 --- a/web/pgadmin/authenticate/__init__.py +++ b/web/pgadmin/authenticate/__init__.py @@ -61,7 +61,7 @@ class AuthenticateModule(PgAdminModule): blueprint = AuthenticateModule(MODULE_NAME, __name__, static_url_path='') -@blueprint.route('/login', endpoint='login', methods=['GET', 'POST']) +@blueprint.route('/login', endpoint='login', methods=['POST']) def login(): """ Entry point for all the authentication sources. diff --git a/web/pgadmin/authenticate/oauth2.py b/web/pgadmin/authenticate/oauth2.py index 07d398380..f84299e4c 100644 --- a/web/pgadmin/authenticate/oauth2.py +++ b/web/pgadmin/authenticate/oauth2.py @@ -48,7 +48,7 @@ def init_app(app): blueprint = Oauth2Module(MODULE_NAME, __name__, static_url_path='') @blueprint.route('/authorize', endpoint="authorize", - methods=['GET', 'POST']) + methods=['POST']) @pgCSRFProtect.exempt def oauth_authorize(): auth_obj = session['auth_obj'] @@ -66,7 +66,7 @@ def init_app(app): return redirect(get_post_login_redirect()) @blueprint.route('/logout', endpoint="logout", - methods=['GET', 'POST']) + methods=['POST']) @pgCSRFProtect.exempt def oauth_logout(): if not current_user.is_authenticated: diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py index a79d13c8c..90dcd40e6 100644 --- a/web/pgadmin/browser/__init__.py +++ b/web/pgadmin/browser/__init__.py @@ -923,7 +923,7 @@ def signal_runtime(): if hasattr(config, 'SECURITY_CHANGEABLE') and config.SECURITY_CHANGEABLE: @blueprint.route("/change_password", endpoint="change_password", - methods=['GET', 'POST']) + methods=['POST']) @pgCSRFProtect.exempt @login_required def change_password(): @@ -1011,7 +1011,7 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE: user=user, token=token) @blueprint.route("/reset_password", endpoint="forgot_password", - methods=['GET', 'POST']) + methods=['POST']) @pgCSRFProtect.exempt @anonymous_user_required def forgot_password(): @@ -1088,7 +1088,7 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE: '/reset_password' + slash_url_suffix( '/browser/reset_password', '' ), - methods=['GET', 'POST'], + methods=['POST'], endpoint='reset_password' ) @pgCSRFProtect.exempt diff --git a/web/pgadmin/misc/cloud/rds/__init__.py b/web/pgadmin/misc/cloud/rds/__init__.py index 5ce44ffe6..6fa7643e0 100644 --- a/web/pgadmin/misc/cloud/rds/__init__.py +++ b/web/pgadmin/misc/cloud/rds/__init__.py @@ -121,7 +121,7 @@ def get_db_instances(): @blueprint.route('/db_versions/', - methods=['GET', 'POST'], endpoint='db_versions') + methods=['GET'], endpoint='db_versions') @login_required def get_db_versions(): """GET AWS Database Versions for AWS.""" @@ -147,7 +147,7 @@ def get_db_versions(): @blueprint.route('/regions/', - methods=['GET', 'POST'], endpoint='regions') + methods=['GET'], endpoint='regions') @login_required def get_regions(): """GET Regions for AWS.""" diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py index d736f0e10..ce3e9ae3a 100644 --- a/web/pgadmin/misc/file_manager/__init__.py +++ b/web/pgadmin/misc/file_manager/__init__.py @@ -1052,7 +1052,7 @@ class Filemanager(object): @blueprint.route( "/filemanager//", - methods=["GET", "POST"], endpoint='filemanager' + methods=["POST"], endpoint='filemanager' ) @login_required def file_manager(trans_id): diff --git a/web/pgadmin/static/js/Explain/Analysis.jsx b/web/pgadmin/static/js/Explain/Analysis.jsx index 1fbdeb7ce..cc43aa777 100644 --- a/web/pgadmin/static/js/Explain/Analysis.jsx +++ b/web/pgadmin/static/js/Explain/Analysis.jsx @@ -120,7 +120,7 @@ ExplainRow.propTypes = { row: PropTypes.shape({ data: PropTypes.shape({ Plans: PropTypes.array, - level: PropTypes.number, + level: PropTypes.array, _serial: PropTypes.number, parent_node: PropTypes.number, exclusive: PropTypes.number, @@ -129,7 +129,7 @@ ExplainRow.propTypes = { inclusive_flag: PropTypes.string, rowsx_direction: PropTypes.string, rowsx: PropTypes.number, - rowsx_flag: PropTypes.number, + rowsx_flag: PropTypes.oneOfType([PropTypes.number,PropTypes.string]), 'Actual Rows': PropTypes.number, 'Plan Rows': PropTypes.number, 'Actual Loops': PropTypes.number, @@ -145,8 +145,8 @@ ExplainRow.propTypes = { show_plan_rows: PropTypes.bool, }), activeExId: PropTypes.string, - setActiveExId: PropTypes.string, - collapsedExId: PropTypes.string, + setActiveExId: PropTypes.func, + collapsedExId: PropTypes.array, toggleCollapseExId: PropTypes.func, }; diff --git a/web/pgadmin/static/js/Explain/ExplainStatistics.jsx b/web/pgadmin/static/js/Explain/ExplainStatistics.jsx index 7a114a42b..46bb13362 100644 --- a/web/pgadmin/static/js/Explain/ExplainStatistics.jsx +++ b/web/pgadmin/static/js/Explain/ExplainStatistics.jsx @@ -123,20 +123,12 @@ export default function ExplainStatistics({explainTable}) { ); } -const NodeType = { - name: PropTypes.string, - count: PropTypes.number, - sum_of_times: PropTypes.number, -}; ExplainStatistics.propTypes = { explainTable: PropTypes.shape({ show_timings: PropTypes.bool, statistics: PropTypes.shape({ - nodes: PropTypes.arrayOf(NodeType), - tables: PropTypes.arrayOf({ - ...NodeType, - nodes: PropTypes.arrayOf(NodeType), - }), + nodes: PropTypes.object, + tables: PropTypes.object, }), total_time: PropTypes.number, }), diff --git a/web/pgadmin/static/js/Explain/Graphical.jsx b/web/pgadmin/static/js/Explain/Graphical.jsx index bb7851153..a34519cc8 100644 --- a/web/pgadmin/static/js/Explain/Graphical.jsx +++ b/web/pgadmin/static/js/Explain/Graphical.jsx @@ -323,7 +323,7 @@ function PlanSVG({planData, zoomFactor, fitZoomFactor, ...props}) { PlanSVG.propTypes = { planData: PropTypes.object, zoomFactor: PropTypes.number, - fitZoomFactor: PropTypes.number, + fitZoomFactor: PropTypes.func, ctx: PropTypes.object, }; diff --git a/web/pgadmin/static/js/tree/tree.js b/web/pgadmin/static/js/tree/tree.js index 467822b9f..b08c6255d 100644 --- a/web/pgadmin/static/js/tree/tree.js +++ b/web/pgadmin/static/js/tree/tree.js @@ -344,11 +344,12 @@ export class Tree { if (path == null || !Array.isArray(path)) { return Promise.reject(); } + const basepath = '/browser/' + path.slice(0, path.length-1).join('/') + '/'; path = '/browser/' + path.join('/'); let onCorrectPath = function (matchPath) { return (matchPath !== undefined && path !== undefined - && (path.startsWith(matchPath) || path === matchPath)); + && (basepath.startsWith(matchPath) || path === matchPath)); }; return (function findInNode(currentNode) { diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index 479f71308..198de41c5 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -744,13 +744,13 @@ def get_search_path(conn): @blueprint.route( '/initialize_target/////' '/', - methods=['GET', 'POST'], + methods=['POST'], endpoint='initialize_target_for_function' ) @blueprint.route( '/initialize_target/////' '//', - methods=['GET', 'POST'], + methods=['POST'], endpoint='initialize_target_for_trigger' ) @login_required @@ -825,7 +825,7 @@ def initialize_target(debug_type, trans_id, sid, did, # the session variables accordingly, For indirect debugging user will # provide the data from another session so below condition will # be be required - if request.method == 'POST': + if request.data: de_inst.function_data['args_value'] = \ json.loads(request.data, encoding='utf-8') @@ -983,7 +983,7 @@ def start_debugger_listener(trans_id): # If user again start the same debug function with different arguments # then we need to save that values to session variable and database. - if request.method == 'POST': + if request.data: data = json.loads(request.data, encoding='utf-8') if data: de_inst.function_data['args_value'] = data diff --git a/web/pgadmin/tools/debugger/static/js/DebuggerModule.js b/web/pgadmin/tools/debugger/static/js/DebuggerModule.js index afd6bd98b..da4804adf 100644 --- a/web/pgadmin/tools/debugger/static/js/DebuggerModule.js +++ b/web/pgadmin/tools/debugger/static/js/DebuggerModule.js @@ -394,7 +394,7 @@ export default class DebuggerModule { self.api({ url: baseUrl, - method: 'GET', + method: 'POST', }) .then(function (result) { @@ -580,7 +580,7 @@ export default class DebuggerModule { self.api({ url: baseUrl, - method: 'GET', + method: 'POST', }) .then(function (res) { let url = url_for('debugger.direct', { diff --git a/web/pgadmin/tools/debugger/templates/debugger/direct.html b/web/pgadmin/tools/debugger/templates/debugger/direct.html index 318572bf7..fd89c5594 100644 --- a/web/pgadmin/tools/debugger/templates/debugger/direct.html +++ b/web/pgadmin/tools/debugger/templates/debugger/direct.html @@ -38,11 +38,15 @@ try { {% endblock %} {% block body %} {% if is_desktop_mode and is_linux %} {% endif %}
+
+
+
+
+
+
+
{% endblock %} diff --git a/web/pgadmin/tools/debugger/tests/test_init_target.py b/web/pgadmin/tools/debugger/tests/test_init_target.py index 936fa7a0a..411424234 100644 --- a/web/pgadmin/tools/debugger/tests/test_init_target.py +++ b/web/pgadmin/tools/debugger/tests/test_init_target.py @@ -89,13 +89,13 @@ class InitTargetDebugger(BaseTestGenerator): def initialize_traget(self): if hasattr(self, 'create_trigger_func') and self.create_trigger_func: - return self.tester.get( + return self.tester.post( self.url + str(self.trans_id) + '/' + str(self.server_id) + '/' + str(self.db_id) + '/' + str(self.schema_id) + '/' + str(self.table_id) + '/' + str(self.trigger_id), content_type='application/json') else: - return self.tester.get( + return self.tester.post( self.url + str(self.trans_id) + '/' + str(self.server_id) + '/' + str(self.db_id) + '/' + str(self.schema_id) + '/' + str(self.func_id), diff --git a/web/pgadmin/tools/debugger/tests/utils.py b/web/pgadmin/tools/debugger/tests/utils.py index a56f3665f..1e1594402 100644 --- a/web/pgadmin/tools/debugger/tests/utils.py +++ b/web/pgadmin/tools/debugger/tests/utils.py @@ -107,7 +107,7 @@ def init_debugger_function(self): def initialize_target(self, utils, close_debugger_instance=True): target_url = '/debugger/initialize_target/{0}/'.format(self.type) - response = self.tester.get( + response = self.tester.post( target_url + str(self.trans_id) + '/' + str(self.server_id) + '/' + str(self.db_id) + '/' + str(self.schema_id) + '/' + str(self.func_id), @@ -127,7 +127,7 @@ def initialize_target(self, utils, close_debugger_instance=True): def start_listener(self, utils, db_utils): - response = self.tester.get( + response = self.tester.post( 'debugger/start_listener/' + str(self.trans_id), content_type='application/json') if response.status_code != 200: diff --git a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx index dc6b03c39..467cb4848 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx @@ -33,6 +33,7 @@ const useStyles = makeStyles((theme)=>({ display: 'flex', lineHeight: '16px', alignItems: 'center', + fontWeight: 'normal', }, columnName: { fontWeight: 'bold', diff --git a/web/yarn.lock b/web/yarn.lock index fd63f408c..a05752369 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -9515,9 +9515,9 @@ react-checkbox-tree@^1.7.2: nanoid "^3.0.0" prop-types "^15.5.8" -"react-data-grid@git+https://github.com/adityatoshniwal/react-data-grid.git/#8d9bc16ddd7c419acfbbd1c1cc2b70eb9f5b453c": - version "7.0.0-beta.12" - resolved "git+https://github.com/adityatoshniwal/react-data-grid.git/#8d9bc16ddd7c419acfbbd1c1cc2b70eb9f5b453c" +"react-data-grid@git+https://github.com/EnterpriseDB/react-data-grid.git/#200d2f5e02de694e3e9ffbe177c279bc40240fb8": + version "7.0.0-beta.14" + resolved "git+https://github.com/EnterpriseDB/react-data-grid.git/#200d2f5e02de694e3e9ffbe177c279bc40240fb8" dependencies: clsx "^1.1.1"