Fixed all the review comments from Dave.

* Moved the Columns, and Constraint to its repective tabs.
* Ensure all the labels only have a capital letter on the first word
  (except for keywords or acronyms).
* Resolve the typo in string - 'System table'.
* Error messages on fields should not be shown unless the field loses
  focus and has an error.
* "General" section should have a limited subset of information.
* Variables grids should not be on the Security tab.
* Fixes the field labels that imply a question.
* Privileges controls on the Properties lists should be in a "Security"
  group.

Apart from review comments improved few other areas too:
* Used in-place DepsCell functionality for columns in both index, and
  type node.
* Improved the error handling in constraint nodes.
* Added create, alert SQL Help for nodes associated with the table node.
This commit is contained in:
Murtuza Zabuawala
2016-05-24 23:29:32 +05:30
committed by Ashesh Vashi
parent 8c077bc2df
commit af84ba5a4f
15 changed files with 584 additions and 402 deletions

View File

@@ -9,13 +9,15 @@ define([
* Hmm... this module is already been initialized, we can refer to the old
* object from here.
*/
if (pgAdmin.FileManager)
return pgAdmin.FileManager;
if (pgAdmin.FileManager) {
return pgAdmin.FileManager;
}
pgAdmin.FileManager = {
init: function() {
if (this.initialized)
if (this.initialized) {
return;
}
this.initialized = true;
@@ -35,7 +37,7 @@ define([
};
// Function to remove trans id from session
var removeTransId = function() {
var removeTransId = function(trans_id) {
return $.ajax({
type: "GET",
async: false,
@@ -68,26 +70,26 @@ define([
});
transId = getTransId(params);
if (transId.readyState == 4)
var t_res;
if (transId.readyState == 4) {
t_res = JSON.parse(transId.responseText);
}
trans_id = t_res.data.fileTransId;
};
// Dialog property
return {
main: function(params) {
// Set title and button name
if (_.isUndefined(params['dialog_title']))
if (_.isUndefined(params['dialog_title'])) {
params['dialog_title'] = 'Storage manager';
}
this.set('title', params['dialog_title']);
if (_.isUndefined(params['btn_primary']))
if (_.isUndefined(params['btn_primary'])) {
params['btn_primary'] = 'Select';
}
this.set('label', params['btn_primary']);
var trans_id;
this.title = params.dialog_title;
params = JSON.stringify(params);
$container.find('.storage_content').remove();
$container.append("<div class='storage_content'></div>");
@@ -107,6 +109,8 @@ define([
this.__internal.buttons[0].element.innerHTML = newValue;
}
break;
default:
break;
}
},
setup:function() {
@@ -127,9 +131,6 @@ define([
};
},
callback: function(closeEvent) {
if (closeEvent.button.key == 13) {
//closeEvent.cancel = true;
}
if (closeEvent.button.text == "{{ _('Select') }}") {
if($('.fileinfo').data('view') == 'grid') {
sel_file = $('.fileinfo').find('#contents li.selected p span').attr('title');
@@ -178,8 +179,10 @@ define([
});
transId = getTransId(configs);
if (transId.readyState == 4)
var t_res;
if (transId.readyState == 4) {
t_res = JSON.parse(transId.responseText);
}
trans_id = t_res.data.fileTransId;
};
@@ -187,16 +190,15 @@ define([
return {
main: function(params) {
// Set title and button name
if (_.isUndefined(params['dialog_title']))
if (_.isUndefined(params['dialog_title'])) {
params['dialog_title'] = 'Select file';
}
this.set('title', params['dialog_title']);
if (_.isUndefined(params['btn_primary']))
if (_.isUndefined(params['btn_primary'])) {
params['btn_primary'] = 'Select';
}
this.set('label', params['btn_primary']);
var trans_id;
this.title = params.dialog_title;
params = JSON.stringify(params);
$container.find('.storage_content').remove();
$container.append("<div class='storage_content'></div>");
@@ -216,6 +218,8 @@ define([
this.__internal.buttons[0].element.innerHTML = newValue;
}
break;
default:
break;
}
},
setup:function() {
@@ -286,24 +290,26 @@ define([
});
transId = getTransId(params);
if (transId.readyState == 4)
var t_res;
if (transId.readyState == 4) {
t_res = JSON.parse(transId.responseText);
}
trans_id = t_res.data.fileTransId;
};
// Dialog property
return {
main: function(params) {
// Set title and button name
if (_.isUndefined(params['dialog_title']))
if (_.isUndefined(params['dialog_title'])) {
params['dialog_title'] = 'Select folder';
}
this.set('title', params['dialog_title']);
if (_.isUndefined(params['btn_primary']))
if (_.isUndefined(params['btn_primary'])) {
params['btn_primary'] = 'Select';
}
this.set('label', params['btn_primary']);
var trans_id;
params = JSON.stringify(params);
$container.find('.storage_content').remove();
$container.append("<div class='storage_content'></div>");
@@ -323,6 +329,8 @@ define([
this.__internal.buttons[0].element.innerHTML = newValue;
}
break;
default:
break;
}
},
setup:function() {
@@ -392,10 +400,11 @@ define([
});
transId = getTransId(params);
if (transId.readyState == 4)
var t_res;
if (transId.readyState == 4) {
t_res = JSON.parse(transId.responseText);
}
trans_id = t_res.data.fileTransId;
};
// Dialog property
@@ -403,11 +412,13 @@ define([
main: function(params) {
var trans_id;
// Set title and button name
if (_.isUndefined(params['dialog_title']))
if (_.isUndefined(params['dialog_title'])) {
params['dialog_title'] = 'Create file';
}
this.set('title', params['dialog_title']);
if (_.isUndefined(params['btn_primary']))
if (_.isUndefined(params['btn_primary'])) {
params['btn_primary'] = 'Create';
}
this.set('label', params['btn_primary']);
params = JSON.stringify(params);
@@ -429,6 +440,8 @@ define([
this.__internal.buttons[0].element.innerHTML = newValue;
}
break;
default:
break;
}
},
setup:function() {
@@ -455,8 +468,8 @@ define([
$('.replace_file .btn_yes').click(function(self) {
$('.replace_file, .fm_dimmer').hide();
var selected_item = $('.allowed_file_types .create_input input[type="text"]').val(),
newFile = $('.currentpath').val() + selected_item,
newFile = newFile.substr(1);
sel_item = $('.currentpath').val() + selected_item,
newFile = sel_item.substr(1);
pgAdmin.Browser.Events.trigger('pgadmin-storage:finish_btn:create_file', newFile);
$('.file_manager_create_cancel').trigger('click');
});

View File

@@ -1269,7 +1269,8 @@ var enab_dis_level_up = function() {
*/
var fm_url = "{{ url_for('file_manager.index') }}get_trans_id",
transId = loadData(fm_url),
t_id = '';
t_res,
t_id;
if (transId.readyState == 4) {
t_res = JSON.parse(transId.responseText);