Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defer loading of dataTables data #638

Merged
merged 3 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### Changed

- Source query results table is no longer populated by default, a query must be submitted first [#638](https://github.com/askap-vast/vast-pipeline/pull/638).
- Bumped major versions of astropy (5.0) and pyarrow (7.0) [#641](https://github.com/askap-vast/vast-pipeline/pull/641).
- Addressed future pandas append deprecation, migrated all uses to pd.concat [#643](https://github.com/askap-vast/vast-pipeline/pull/643).
- Bumped all documentation dependancies to latest versions (incl. mkdocs-material minimum 8.2.4) [#627](https://github.com/askap-vast/vast-pipeline/pull/627).
Expand Down Expand Up @@ -90,6 +91,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

#### List of PRs

- [#638](https://github.com/askap-vast/vast-pipeline/pull/638): feat: Support defer loading of dataTables data.
- [#641](https://github.com/askap-vast/vast-pipeline/pull/641): dep: Drop Python 3.7 and dependency refresh.
- [#643](https://github.com/askap-vast/vast-pipeline/pull/643): fix: Addressed pandas DataFrame.append deprecation.
- [#642](https://github.com/askap-vast/vast-pipeline/pull/642): fix: Fix empty groups in parallel association.
Expand Down
8 changes: 8 additions & 0 deletions static/js/datatables-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ $(document).ready(function() {
dom : dom,
buttons: DEFAULT_DATATABLE_BUTTONS
};
// apply deferLoading config, if supplied
if (dataConf.hasOwnProperty('deferLoading')) {
dataTableConf.deferLoading = dataConf.deferLoading;
// change the message printed in the empty table if deferLoading active
dataTableConf.initComplete = function(settings, json) {
$("td.dataTables_empty").text("Submit a query to view results");
}
}
} else {
// expect that there is a 'data' attribute with the data
// data are in this format
Expand Down
1 change: 1 addition & 0 deletions vast_pipeline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@ def SourceQuery(request):
'New High Sigma'
],
'search': False,
'deferLoading': 0, # don't fetch results until a query is made
}
}
)
Expand Down