From ee13b0661f1c320c56e391b0eb221fbe3b913085 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Mon, 31 Jul 2017 22:21:37 +0000 Subject: [PATCH 1/7] fixed extra width on Dashboard elements --- superset/assets/stylesheets/dashboard.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/superset/assets/stylesheets/dashboard.css b/superset/assets/stylesheets/dashboard.css index ad84807aa14c4..bbd9537c502fb 100644 --- a/superset/assets/stylesheets/dashboard.css +++ b/superset/assets/stylesheets/dashboard.css @@ -130,3 +130,8 @@ div.widget .chart-controls { .slice_container .alert { margin: 10px; } + +.row { + margin-left: 0px; + margin-right: 0px; +} From 62298f0401196c75814fe1053971157b3de50712 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Mon, 31 Jul 2017 22:33:47 +0000 Subject: [PATCH 2/7] updated table to scroll again --- superset/assets/visualizations/table.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset/assets/visualizations/table.js b/superset/assets/visualizations/table.js index b6b596efaa23b..833641c3969eb 100644 --- a/superset/assets/visualizations/table.js +++ b/superset/assets/visualizations/table.js @@ -77,6 +77,7 @@ function tableVis(slice, payload) { data: data.records, columns: columns, paging: paging, + scrollY: true, deferRender: true, pageLength: pageLength, searching: fd.include_search, @@ -151,6 +152,7 @@ function tableVis(slice, payload) { datatable = container.find('.dataTable').DataTable({ paging: paging, + scrollY: true, deferRender: true, pageLength: pageLength, aaSorting: [], From b2efdeb4c1e3e2dbd4584eeb75e98630415c12f1 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Tue, 1 Aug 2017 01:42:02 +0000 Subject: [PATCH 3/7] worked on datatables visualizations. Still a mess, but getting there --- superset/assets/visualizations/table.css | 20 ++++++++++++++++++++ superset/assets/visualizations/table.js | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/superset/assets/visualizations/table.css b/superset/assets/visualizations/table.css index 0284bfe18984f..c8ebdc893eadd 100644 --- a/superset/assets/visualizations/table.css +++ b/superset/assets/visualizations/table.css @@ -46,3 +46,23 @@ table.table thead th.sorting:after, table.table thead th.sorting_asc:after, tabl .dataTables_filter { margin: 4px; } + +.table-header { + height: 10%; +} + +.table-body { + height: 80%; +} + +.table-data { + height: 100%; +} + +.table-footer { + height: 10%; +} + +.dataTables_wrapper { + height: 100%; +} diff --git a/superset/assets/visualizations/table.js b/superset/assets/visualizations/table.js index 833641c3969eb..fec221df9e0b9 100644 --- a/superset/assets/visualizations/table.js +++ b/superset/assets/visualizations/table.js @@ -81,6 +81,9 @@ function tableVis(slice, payload) { deferRender: true, pageLength: pageLength, searching: fd.include_search, + dom: '<"row table-header"<"col-sm-6"lB><"col-sm-6"f>>' + + '<"row table-body"<"col-sm-12 table-data"tr>>' + + '<"row table-footer"<"col-sm-5"i><"col-sm-7"p>>', buttons: buttons, }); } else { @@ -158,7 +161,8 @@ function tableVis(slice, payload) { aaSorting: [], searching: fd.include_search, bInfo: false, - buttons: buttons, + //buttons: buttons, + dom: '', }); } datatable.buttons().container().appendTo( '.dataTables_wrapper .col-sm-6:eq(0)' ); From 889f14d134a8885eb2dca0cbfa6757bc6620bc3d Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Tue, 1 Aug 2017 17:04:09 +0000 Subject: [PATCH 4/7] more changes to ui scrolling --- superset/assets/visualizations/table.css | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/superset/assets/visualizations/table.css b/superset/assets/visualizations/table.css index c8ebdc893eadd..9ebdfa1f96ec0 100644 --- a/superset/assets/visualizations/table.css +++ b/superset/assets/visualizations/table.css @@ -47,22 +47,10 @@ table.table thead th.sorting:after, table.table thead th.sorting_asc:after, tabl margin: 4px; } -.table-header { - height: 10%; -} - -.table-body { - height: 80%; -} - -.table-data { +.dataTables_scroll { height: 100%; } -.table-footer { - height: 10%; -} - .dataTables_wrapper { height: 100%; } From dd79d77d8da0eff3f76b953081a9747412069fc0 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Mon, 7 Aug 2017 21:50:49 +0000 Subject: [PATCH 5/7] included better error messages for redirect loops. Also, fixed redirect loops --- superset/views/core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index 060a55ac6035f..70d5e943d55c3 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2199,10 +2199,8 @@ def show_traceback(self): @expose("/welcome") def welcome(self): """Personalized welcome page""" - print (appbuilder.sm.auth_view) - return appbuilder.sm.auth_view.login() if not g.user or not g.user.get_id(): - return redirect(appbuilder.get_url_for_login) + return appbuilder.sm.auth_view.login() return self.render_template('superset/welcome.html', utils=utils) @has_access From 132377fce9ea56996f22704bd80b0edb21f146d7 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Fri, 18 Aug 2017 21:01:08 +0000 Subject: [PATCH 6/7] more broken attempts --- superset/assets/visualizations/table.css | 3 --- superset/assets/visualizations/table.js | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/superset/assets/visualizations/table.css b/superset/assets/visualizations/table.css index 9ebdfa1f96ec0..9de4ec9c83e09 100644 --- a/superset/assets/visualizations/table.css +++ b/superset/assets/visualizations/table.css @@ -51,6 +51,3 @@ table.table thead th.sorting:after, table.table thead th.sorting_asc:after, tabl height: 100%; } -.dataTables_wrapper { - height: 100%; -} diff --git a/superset/assets/visualizations/table.js b/superset/assets/visualizations/table.js index fec221df9e0b9..a7220f160ba9c 100644 --- a/superset/assets/visualizations/table.js +++ b/superset/assets/visualizations/table.js @@ -161,8 +161,10 @@ function tableVis(slice, payload) { aaSorting: [], searching: fd.include_search, bInfo: false, - //buttons: buttons, - dom: '', + buttons: buttons, + dom: '<"row table-header"<"col-sm-6"lB><"col-sm-6"f>>' + + '<"row table-body"<"col-sm-12 table-data"tr>>' + + '<"row table-footer"<"col-sm-5"i><"col-sm-7"p>>', }); } datatable.buttons().container().appendTo( '.dataTables_wrapper .col-sm-6:eq(0)' ); From 6c2d2beba9fff53ef786852a934ca9056a56ff05 Mon Sep 17 00:00:00 2001 From: Malcolm Flint Date: Fri, 18 Aug 2017 22:07:02 +0000 Subject: [PATCH 7/7] they work!!! --- superset/assets/javascripts/modules/utils.js | 7 ++++++- superset/assets/visualizations/table.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/superset/assets/javascripts/modules/utils.js b/superset/assets/javascripts/modules/utils.js index 7349dbb7f8f11..3b1d74cb6da7f 100644 --- a/superset/assets/javascripts/modules/utils.js +++ b/superset/assets/javascripts/modules/utils.js @@ -123,7 +123,12 @@ export function toggleCheckbox(apiUrlPrefix, selector) { */ export const fixDataTableBodyHeight = function ($tableDom, height) { const headHeight = $tableDom.find('.dataTables_scrollHead').height(); - $tableDom.find('.dataTables_scrollBody').css('max-height', height - headHeight); + const headerFooterHeight = $tableDom.find('.table-header').height() + + $tableDom.find('.table-footer').height(); + $tableDom.find('.dataTables_scrollBody').css('max-height', height - (headerFooterHeight + headHeight)); + $tableDom.find('.table-body').css('max-height', height - headerFooterHeight); + $tableDom.find('.dataTables_scroll').css('max-height', height - headerFooterHeight); + $tableDom.find('.table-data').css('max-height', height - headerFooterHeight); }; export function d3format(format, number) { diff --git a/superset/assets/visualizations/table.js b/superset/assets/visualizations/table.js index a7220f160ba9c..2d9c48696613a 100644 --- a/superset/assets/visualizations/table.js +++ b/superset/assets/visualizations/table.js @@ -38,7 +38,7 @@ function tableVis(slice, payload) { const table = div.append('table') .classed( 'dataframe dataframe table table-striped table-bordered ' + - 'table-condensed table-hover dataTable no-footer', true) + 'table-condensed table-hover dataTable', true) .attr('width', '100%'); const cols = data.columns.map(c => slice.datasource.verbose_map[c] || c);