A number of minor cleanups to the recent changes to the query tool.

REL-1_X
Harshal Dhumal 2017-06-28 09:49:39 -04:00 committed by Dave Page
parent 301798d87a
commit 7389744ecf
4 changed files with 22 additions and 14 deletions

View File

@ -44,7 +44,7 @@ class CheckForViewDataTest(BaseFeatureTest):
"""
scenarios = [
("Validate Insert, Update operations in View data with given test "
("Validate Insert, Update operations in View/Edit data with given test "
"data",
dict())
]
@ -97,7 +97,7 @@ CREATE TABLE public.defaults
self.page.add_server(self.server)
self._tables_node_expandable()
self.page.select_tree_item('defaults')
# Open Object -> View data
# Open Object -> View/Edit data
self._view_data_grid()
# Run test to insert a new row in table with default values
@ -203,9 +203,9 @@ CREATE TABLE public.defaults
self.page.driver.find_element_by_link_text("Object").click()
ActionChains(self.page.driver) \
.move_to_element(
self.page.driver.find_element_by_link_text("View Data")) \
self.page.driver.find_element_by_link_text("View/Edit Data")) \
.perform()
self.page.find_by_partial_link_text("View All Rows").click()
self.page.find_by_partial_link_text("All Rows").click()
# wait until datagrid frame is loaded.
self.page.click_tab('Edit Data -')

View File

@ -87,26 +87,26 @@ define([
name: 'view_all_rows_context_' + supported_nodes[idx],
node: supported_nodes[idx], module: this, data: {mnuid: 3},
applies: ['context', 'object'], callback: 'show_data_grid', enable: view_menu_enabled,
category: 'view_data', priority: 101, label: gettext('View All Rows')
category: 'view_data', priority: 101, label: gettext('All Rows')
},{
name: 'view_first_100_rows_context_' + supported_nodes[idx],
node: supported_nodes[idx], module: this, data: {mnuid: 1},
applies: ['context', 'object'], callback: 'show_data_grid', enable: view_menu_enabled,
category: 'view_data', priority: 102, label: gettext('View First 100 Rows')
category: 'view_data', priority: 102, label: gettext('First 100 Rows')
},{
name: 'view_last_100_rows_context_' + supported_nodes[idx],
node: supported_nodes[idx], module: this, data: {mnuid: 2},
applies: ['context', 'object'], callback: 'show_data_grid', enable: view_menu_enabled,
category: 'view_data', priority: 103, label: gettext('View Last 100 Rows')
category: 'view_data', priority: 103, label: gettext('Last 100 Rows')
},{
name: 'view_filtered_rows_context_' + supported_nodes[idx],
node: supported_nodes[idx], module: this, data: {mnuid: 4},
applies: ['context', 'object'], callback: 'show_filtered_row', enable: view_menu_enabled,
category: 'view_data', priority: 104, label: gettext('View Filtered Rows...')
category: 'view_data', priority: 104, label: gettext('Filtered Rows...')
});
}
pgAdmin.Browser.add_menu_category('view_data', gettext('View Data'), 100, 'fa fa-th');
pgAdmin.Browser.add_menu_category('view_data', gettext('View/Edit Data'), 100, 'fa fa-th');
pgAdmin.Browser.add_menus(menus);
// Creating a new pgAdmin.Browser frame to show the data.
@ -263,7 +263,7 @@ define([
this.setContent($content.get(0));
// Apply CodeMirror to filter text area.
this.filter_obj = CodeMirror.fromTextArea($sql_filter.get(0), {
this.filter_obj = codemirror.fromTextArea($sql_filter.get(0), {
lineNumbers: true,
indentUnit: 4,
mode: "text/x-pgsql",

View File

@ -462,7 +462,11 @@ input.editor-checkbox:focus {
.slick-cell span[data-cell-type="row-header-selector"] {
display: block;
text-align: right;
text-align: center;
}
.slick-cell.selected span[data-cell-type="row-header-selector"] {
color: white;
}
#datagrid div.slick-header.ui-state-default {
@ -486,9 +490,12 @@ input.editor-checkbox:focus {
.select-all-icon {
margin-left: 9px;
margin-right: 9px;
margin-right: 4px;
vertical-align: bottom;
float: right;
position: absolute;
bottom: 4px;
right: 0;
}
}
.slick-cell, .slick-headerrow-column {

View File

@ -3003,7 +3003,8 @@ define([
});
dataView.endUpdate();
grid.updateRowCount();
grid.render();
// Pasted row/s always append so bring last row in view port.
grid.scrollRowIntoView(dataView.getLength());
grid.setSelectedRows([]);
}
},