From 06886515f8d13d769d10373771b38bdbc1e404d7 Mon Sep 17 00:00:00 2001 From: Felix Wiegand Date: Mon, 19 Apr 2021 10:37:01 +0200 Subject: [PATCH] Stop displaying undefined values in side table of vcf-report (#145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Stop displaying undefined values in side table of vcf-report This fixes #144. * Update CHANGELOG.md Co-authored-by: Johannes Köster --- CHANGELOG.md | 5 ++-- src/bcf/report/js/table-report.js | 44 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0a167f..7e094469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [0.20.5] - 2021-04-19 +### Changed +- Bugfix for `rbt vcf-report` that stops displaying undefined values in the table-report. ### Added -- New parameter `--pin-until` for `rbt csv-report`. -- `--pin-until` pins the table until the given column such that scrolling to the right does not hide the given column and those before. +- New parameter `--pin-until` for `rbt csv-report`. `--pin-until` pins the table until the given column such that scrolling to the right does not hide the given column and those before. ## [0.20.4] - 2021-04-15 ### Changed diff --git a/src/bcf/report/js/table-report.js b/src/bcf/report/js/table-report.js index 2b9a1eaa..c285bc28 100644 --- a/src/bcf/report/js/table-report.js +++ b/src/bcf/report/js/table-report.js @@ -83,29 +83,33 @@ $(document).ready(function () { let ix = x + 1; let field = 'ann[' + j + '][' + ix + ']'; let vl = $(that).data(field); - if (name === "Existing_variation" && vl) { - let fields = vl.split('&'); - let result = ""; - for (var o = 0; o < fields.length; o++) { - let val = fields[o]; - if (val.startsWith("rs")) { - result = result + "" + val + ""; - } else if (val.startsWith("COSM")) { - let num = val.replace( /^\D+/g, ''); - result = result + "" + val + ""; - } else if (val.startsWith("COSN")) { - let num = val.replace( /^\D+/g, ''); - result = result + "" + val + ""; - } else { - result = result + val; - } - if (!(o === fields.length - 1)) { - result = result + ", "; + if (vl) { + if (name === "Existing_variation") { + let fields = vl.split('&'); + let result = ""; + for (var o = 0; o < fields.length; o++) { + let val = fields[o]; + if (val.startsWith("rs")) { + result = result + "" + val + ""; + } else if (val.startsWith("COSM")) { + let num = val.replace( /^\D+/g, ''); + result = result + "" + val + ""; + } else if (val.startsWith("COSN")) { + let num = val.replace( /^\D+/g, ''); + result = result + "" + val + ""; + } else { + result = result + val; + } + if (!(o === fields.length - 1)) { + result = result + ", "; + } } + vl = result; } - vl = result; + $('#ann-sidebar').append('' + vl + ''); + } else { + $('#ann-sidebar').append(''); } - $('#ann-sidebar').append('' + vl + ''); } $('#ann-sidebar').append(''); });