Add auto-filter hyperlinks for batch row status breakdown

This commit is contained in:
Lance Edgar 2022-02-20 19:40:32 -06:00
parent 5b697cdf26
commit 4d404cb20b
6 changed files with 93 additions and 17 deletions

View file

@ -154,13 +154,18 @@
</%def>
<%def name="render_status_breakdown()">
% if status_breakdown is not Undefined and status_breakdown is not None:
% if use_buefy:
<div class="object-helper">
<h3>Row Status Breakdown</h3>
<div class="object-helper-content">
% if use_buefy:
${status_breakdown_grid.render_buefy_table_element(data_prop='statusBreakdownData', empty_labels=True)|n}
% elif status_breakdown:
${status_breakdown_grid|n}
</div>
</div>
% elif status_breakdown is not Undefined and status_breakdown is not None:
<div class="object-helper">
<h3>Row Status Breakdown</h3>
<div class="object-helper-content">
% if status_breakdown:
<div class="grid full">
<table>
% for i, (status, count) in enumerate(status_breakdown):
@ -407,7 +412,18 @@
${parent.modify_this_page_vars()}
<script type="text/javascript">
ThisPageData.statusBreakdownData = ${json.dumps(status_breakdown_grid.get_buefy_data()['data'])|n}
ThisPageData.statusBreakdownData = ${json.dumps(status_breakdown_data)|n}
ThisPage.methods.autoFilterStatus = function(row) {
this.$refs.rowGrid.setFilters([
{key: 'status_code',
verb: 'equal',
value: row.code},
])
document.getElementById('rowGrid').scrollIntoView({
behavior: 'smooth',
})
}
% if master.has_worksheet_file and master.allow_worksheet(batch) and master.has_perm('worksheet'):