Relabel the Save button on the datagrid text editor to avoid confusion with the actual Save button that updates the database. Fixes #4131

This commit is contained in:
Dave Page 2019-04-02 17:20:43 +01:00
parent fb12b2e2fc
commit f706f7ed0c
3 changed files with 30 additions and 10 deletions

View File

@ -11,6 +11,7 @@ notes for it.
.. toctree::
:maxdepth: 1
release_notes_4_5
release_notes_4_4
release_notes_4_3
release_notes_4_2

View File

@ -0,0 +1,18 @@
***********
Version 4.5
***********
Release date: 2019-05-02
This release contains a number of new features and fixes reported since the
release of pgAdmin4 4.4.
Features
********
Bug fixes
*********
| `Bug #4131 <https://redmine.postgresql.org/issues/4131>`_ - Relabel the Save button on the datagrid text editor to avoid confusion with the actual Save button that updates the database.

View File

@ -14,6 +14,7 @@
*/
import JSONBigNumber from 'json-bignumber';
import gettext from 'sources/gettext';
(function($, JSONBigNumber) {
// register namespace
@ -46,7 +47,7 @@ import JSONBigNumber from 'json-bignumber';
// Generate and return editor buttons
function getButtons(editable) {
var $buttons = $('<div class=\'pg_buttons\' />'),
label = editable ? 'Cancel' : 'OK',
label = editable ? gettext('Cancel') : gettext('OK'),
button_type = editable ? 'btn-secondary' : 'btn-primary',
button_icon = editable ? 'fa-times' : 'fa-check';
@ -56,8 +57,8 @@ import JSONBigNumber from 'json-bignumber';
.appendTo($buttons);
if (editable) {
$('<button class=\'btn btn-primary long_text_editor\' data-label="Save">'+
'<span class="fa fa-save pg-alertify-button"></span>&nbsp;Save'+
$('<button class=\'btn btn-primary long_text_editor\' data-label="' + gettext('OK') + '">'+
'<span class="fa fa-check pg-alertify-button"></span>&nbsp;' + gettext('OK') +
'</button>')
.appendTo($buttons);
}
@ -276,7 +277,7 @@ import JSONBigNumber from 'json-bignumber';
if (args.column.is_array && !is_valid_array($input.val())) {
return {
valid: false,
msg: 'Array must start with \'{\' and end with \'}\'',
msg: gettext('Arrays must start with "{" and end with "}"'),
};
}
@ -640,7 +641,7 @@ import JSONBigNumber from 'json-bignumber';
var defaultValue;
this.init = function() {
$input = $('<INPUT type=text class=\'editor-text\' readonly/>')
$input = $('<input type=text class=\'editor-text\' readonly/>')
.appendTo(args.container)
.on('keydown.nav', function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
@ -710,7 +711,7 @@ import JSONBigNumber from 'json-bignumber';
var defaultValue;
this.init = function() {
$select = $('<INPUT type=checkbox value=\'true\' class=\'editor-checkbox\' hideFocus disabled>');
$select = $('<input type=checkbox value=\'true\' class=\'editor-checkbox\' hideFocus disabled>');
$select.appendTo(args.container);
$select.trigger('focus');
};
@ -773,7 +774,7 @@ import JSONBigNumber from 'json-bignumber';
var defaultValue;
this.init = function() {
$input = $('<INPUT type=text class=\'editor-text\' />');
$input = $('<input type=text class=\'editor-text\' />');
$input.on('keydown.nav', function(e) {
if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) {
@ -836,7 +837,7 @@ import JSONBigNumber from 'json-bignumber';
if (!args.column.is_array && isNaN(value)) {
return {
valid: false,
msg: 'Please enter a valid number',
msg: gettext('Please enter a valid number'),
};
}
if (args.column.validator) {
@ -850,7 +851,7 @@ import JSONBigNumber from 'json-bignumber';
if (!is_valid_array(value)) {
return {
valid: false,
msg: 'Array must start with \'{\' and end with \'}\'',
msg: gettext('Arrays must start with "{" and end with "}"'),
};
}
@ -867,7 +868,7 @@ import JSONBigNumber from 'json-bignumber';
if (isNaN(arr[k])) {
return {
valid: false,
msg: 'Please enter a valid numbers',
msg: gettext('Please enter a valid number'),
};
}
}