mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 15:26:46 -06:00
1. Use EDB's repo for react-data-grid instead of the personal repo.
2. Improved searching in the Search Objects. 3. Fixed react warnings in the query tool. 4. Fixed some SonarQube issues.
This commit is contained in:
parent
ab5d53f3b1
commit
2de965d710
@ -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",
|
||||
|
@ -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.
|
||||
|
@ -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:
|
||||
|
@ -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', '<token>'
|
||||
),
|
||||
methods=['GET', 'POST'],
|
||||
methods=['POST'],
|
||||
endpoint='reset_password'
|
||||
)
|
||||
@pgCSRFProtect.exempt
|
||||
|
@ -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."""
|
||||
|
@ -1052,7 +1052,7 @@ class Filemanager(object):
|
||||
|
||||
@blueprint.route(
|
||||
"/filemanager/<int:trans_id>/",
|
||||
methods=["GET", "POST"], endpoint='filemanager'
|
||||
methods=["POST"], endpoint='filemanager'
|
||||
)
|
||||
@login_required
|
||||
def file_manager(trans_id):
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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,
|
||||
}),
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -744,13 +744,13 @@ def get_search_path(conn):
|
||||
@blueprint.route(
|
||||
'/initialize_target/<debug_type>/<int:trans_id>/<int:sid>/<int:did>/'
|
||||
'<int:scid>/<int:func_id>',
|
||||
methods=['GET', 'POST'],
|
||||
methods=['POST'],
|
||||
endpoint='initialize_target_for_function'
|
||||
)
|
||||
@blueprint.route(
|
||||
'/initialize_target/<debug_type>/<int:trans_id>/<int:sid>/<int:did>/'
|
||||
'<int:scid>/<int:func_id>/<int:tri_id>',
|
||||
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')
|
||||
|
||||
@ -940,7 +940,7 @@ def restart_debugging(trans_id):
|
||||
|
||||
|
||||
@blueprint.route(
|
||||
'/start_listener/<int:trans_id>', methods=['GET', 'POST'],
|
||||
'/start_listener/<int:trans_id>', methods=['POST'],
|
||||
endpoint='start_listener'
|
||||
)
|
||||
@login_required
|
||||
@ -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
|
||||
|
@ -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', {
|
||||
|
@ -38,11 +38,15 @@ try {
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<style>
|
||||
#debugger-main-container {
|
||||
#debugger-main-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#debugger-main-container:not(:empty) + .pg-sp-container {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{% if is_desktop_mode and is_linux %}
|
||||
<style>
|
||||
@ -50,6 +54,13 @@ try {
|
||||
</style>
|
||||
{% endif %}
|
||||
<div id="debugger-main-container" tabindex="0">
|
||||
<div class="pg-sp-container">
|
||||
<div class="pg-sp-content">
|
||||
<div class="row">
|
||||
<div class="col-12 pg-sp-icon"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -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),
|
||||
|
@ -33,11 +33,6 @@ class DebuggerStartListener(BaseTestGenerator):
|
||||
self.db_id = self.schema_data['db_id']
|
||||
self.schema_id = self.schema_data['schema_id']
|
||||
|
||||
local_self = funcs_utils.set_up(self)
|
||||
|
||||
# if self.server['type'] == 'pg':
|
||||
# self.skipTest('Skipping test case for pg')
|
||||
|
||||
self.test_data['funcowner'] = self.server["username"]
|
||||
|
||||
function_info = debugger_utils.create_function(self, utils)
|
||||
@ -60,7 +55,7 @@ class DebuggerStartListener(BaseTestGenerator):
|
||||
data=json.dumps({}),
|
||||
content_type='application/json')
|
||||
else:
|
||||
return self.tester.get(
|
||||
return self.tester.post(
|
||||
self.url + str(self.trans_id),
|
||||
content_type='application/json')
|
||||
|
||||
|
@ -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:
|
||||
|
@ -33,6 +33,7 @@ const useStyles = makeStyles((theme)=>({
|
||||
display: 'flex',
|
||||
lineHeight: '16px',
|
||||
alignItems: 'center',
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
columnName: {
|
||||
fontWeight: 'bold',
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user