mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Schema Diff Improvements:
1. Grid header should be center aligned vertically. 2. Increase the space between object counts. 3. The previous selected objects should not be re-selected on comparison.
This commit is contained in:
parent
9dccd20bb3
commit
d59816054f
@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
.slick-header-column.ui-state-default {
|
.slick-header-column.ui-state-default {
|
||||||
height: 32px !important;
|
height: 32px !important;
|
||||||
|
line-height: 25px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#schema-diff-grid .grid-header label {
|
#schema-diff-grid .grid-header label {
|
||||||
@ -187,3 +188,7 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 40% !important;
|
max-width: 40% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.slick-cell .ml-2 {
|
||||||
|
margin-left: 2rem !important;
|
||||||
|
}
|
||||||
|
@ -318,7 +318,7 @@ export default class SchemaDiffUI {
|
|||||||
// Format Schema object title with appropriate icon
|
// Format Schema object title with appropriate icon
|
||||||
var formatColumnTitle = function (row, cell, value, columnDef, dataContext) {
|
var formatColumnTitle = function (row, cell, value, columnDef, dataContext) {
|
||||||
let icon = 'icon-' + dataContext.type;
|
let icon = 'icon-' + dataContext.type;
|
||||||
return '<i class="ml-5 wcTabIcon '+ icon +'"></i><span>' + value + '</span>';
|
return '<i class="ml-2 wcTabIcon '+ icon +'"></i><span>' + value + '</span>';
|
||||||
};
|
};
|
||||||
|
|
||||||
// Grid Columns
|
// Grid Columns
|
||||||
@ -349,7 +349,14 @@ export default class SchemaDiffUI {
|
|||||||
getter: 'type',
|
getter: 'type',
|
||||||
formatter: function (g) {
|
formatter: function (g) {
|
||||||
let icon = 'icon-coll-' + g.value;
|
let icon = 'icon-coll-' + g.value;
|
||||||
return '<i class="wcTabIcon '+ icon +'"></i><span>' + g.rows[0].label + '</span>';
|
let identical=0, different=0, source_only=0, target_only=0;
|
||||||
|
for (var i = 0; i < g.rows.length; i++) {
|
||||||
|
if (g.rows[i]['status'] == self.filters[0]) identical++;
|
||||||
|
else if (g.rows[i]['status'] == self.filters[1]) different++;
|
||||||
|
else if (g.rows[i]['status'] == self.filters[2]) source_only++;
|
||||||
|
else if (g.rows[i]['status'] == self.filters[3]) target_only++;
|
||||||
|
}
|
||||||
|
return '<i class="wcTabIcon '+ icon +'"></i><span>' + g.rows[0].label + ' - ' + gettext('Identical') + ': <strong>' + identical + '</strong> ' + gettext('Different') + ': <strong>' + different + '</strong> ' + gettext('Source Only') + ': <strong>' + source_only + '</strong> ' + gettext('Target Only') + ': <strong>' + target_only + '</strong></span>';
|
||||||
},
|
},
|
||||||
aggregateCollapsed: true,
|
aggregateCollapsed: true,
|
||||||
lazyTotalsCalculation: true,
|
lazyTotalsCalculation: true,
|
||||||
@ -406,6 +413,8 @@ export default class SchemaDiffUI {
|
|||||||
grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));
|
grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));
|
||||||
grid.registerPlugin(checkboxSelector);
|
grid.registerPlugin(checkboxSelector);
|
||||||
|
|
||||||
|
self.dataView.syncGridSelection(grid, true, true);
|
||||||
|
|
||||||
grid.onClick.subscribe(function(e, args) {
|
grid.onClick.subscribe(function(e, args) {
|
||||||
if (args.row) {
|
if (args.row) {
|
||||||
data = args.grid.getData().getItem(args.row);
|
data = args.grid.getData().getItem(args.row);
|
||||||
@ -431,11 +440,13 @@ export default class SchemaDiffUI {
|
|||||||
|
|
||||||
render_grid_data(data) {
|
render_grid_data(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
self.grid.setSelectedRows([]);
|
||||||
self.dataView.beginUpdate();
|
self.dataView.beginUpdate();
|
||||||
self.dataView.setItems(data);
|
self.dataView.setItems(data);
|
||||||
self.dataView.setFilter(self.filter.bind(self));
|
self.dataView.setFilter(self.filter.bind(self));
|
||||||
self.groupBySchemaObject();
|
self.groupBySchemaObject();
|
||||||
self.dataView.endUpdate();
|
self.dataView.endUpdate();
|
||||||
|
self.dataView.refresh();
|
||||||
|
|
||||||
self.resize_grid();
|
self.resize_grid();
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,12 @@ def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids):
|
|||||||
column_types[col['name']] = col_type
|
column_types[col['name']] = col_type
|
||||||
|
|
||||||
if not is_query_tool:
|
if not is_query_tool:
|
||||||
if key in rset['rows']:
|
col_type['not_null'] = col['not_null'] = \
|
||||||
col_type['not_null'] = col['not_null'] = \
|
rset['rows'][key]['not_null']
|
||||||
rset['rows'][key]['not_null']
|
|
||||||
|
|
||||||
col_type['has_default_val'] = \
|
col_type['has_default_val'] = \
|
||||||
col['has_default_val'] = \
|
col['has_default_val'] = \
|
||||||
rset['rows'][key]['has_default_val']
|
rset['rows'][key]['has_default_val']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for row in rset['rows']:
|
for row in rset['rows']:
|
||||||
|
Loading…
Reference in New Issue
Block a user