Fixed errors related to HTML tags shown in the error message for JSON editor. Fixes #6668

This commit is contained in:
Yogesh Mahajan 2021-08-26 14:54:51 +05:30 committed by Akshay Joshi
parent 092f830c3c
commit 51d73b1672
5 changed files with 13 additions and 4 deletions

View File

@ -30,6 +30,7 @@ Bug fixes
| `Issue #6572 <https://redmine.postgresql.org/issues/6572>`_ - Partially fixes the data output panel display issue.
| `Issue #6641 <https://redmine.postgresql.org/issues/6641>`_ - Enables pgAdmin to retrieve user permissions in case of nested roles which helps to terminate the session for AWS RDS.
| `Issue #6663 <https://redmine.postgresql.org/issues/6663>`_ - Fixed no attribute '_asdict' error when connecting the database server.
| `Issue #6668 <https://redmine.postgresql.org/issues/6668>`_ - Fixed errors related to HTML tags shown in the error message for JSON editor.
| `Issue #6671 <https://redmine.postgresql.org/issues/6671>`_ - Fixed UnboundLocalError where local variable 'user_id' referenced before assignment.
| `Issue #6682 <https://redmine.postgresql.org/issues/6682>`_ - Renamed 'Auto rollback?' to 'Auto rollback on error?'.
| `Issue #6684 <https://redmine.postgresql.org/issues/6684>`_ - Fixed the JSON editor issue of hiding the first record.

View File

@ -100,7 +100,7 @@
"jquery-contextmenu": "^2.9.2",
"jquery-ui": "^1.12.1",
"json-bignumber": "^1.0.1",
"jsoneditor": "^9.5.1",
"jsoneditor": "^9.5.4",
"karma-coverage": "^2.0.3",
"leaflet": "^1.5.1",
"lodash": "4.*",

View File

@ -396,7 +396,10 @@ import Alertify from 'pgadmin.alertifyjs';
var jsonContainer = document.getElementById('pg-json-editor');
var options = {
modes: ['code', 'form', 'tree','preview'],
onError: function (){ Alertify.error(gettext('Please fix errors in json contents before switching mode.'));}
onError: function (error){
var msg = 'Invalid Json: ' + error.message.split(':')[0];
Alertify.error(gettext(msg));
}
};
$editor = new JSONEditor(jsonContainer, options);
$editor.setText(data);
@ -415,7 +418,10 @@ import Alertify from 'pgadmin.alertifyjs';
var jsonContainer = document.getElementById('pg-json-editor');
var options = {
modes: ['code', 'form', 'tree','preview'],
onError: function (){Alertify.error(gettext('Please fix errors in json contents before switching mode.'));}
onError: function (error){
var msg = 'Invalid Json: ' + error.message.split(':')[0];
Alertify.error(gettext(msg));
}
};
if(jsonContainer) {
$editor = new JSONEditor(jsonContainer, options);

View File

@ -93,6 +93,8 @@
}
/* Mode drop-down */
.jsoneditor-menu>.jsoneditor-modes>button:active,
.jsoneditor-menu>.jsoneditor-modes>button:focus,
.jsoneditor-menu>.jsoneditor-modes>button,{
font-family: $font-family-primary !important;
font-size: $font-size-base !important;

View File

@ -303,7 +303,7 @@ li.CodeMirror-hint-active {
& #pg-json-editor {
min-width:525px;
min-height:280px;
min-height:300px;
height:295px;
width:550px;
border: $panel-border;