From 8d3911556ab5ec1d9ffafb1f95cd71d73c5caad0 Mon Sep 17 00:00:00 2001 From: jamessspanggg Date: Tue, 21 Jan 2020 00:02:48 +0800 Subject: [PATCH 1/2] Add facet for blank values/records per column --- .../modules/core/langs/translation-en.json | 2 ++ .../modules/core/langs/translation-jp.json | 2 ++ .../modules/core/langs/translation-zh.json | 4 +++ .../views/data-table/data-table-view.js | 34 +++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index d8f75e6b5..4dd8ca13d 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -589,6 +589,8 @@ "core-views/facet-flag": "Facet by flag", "core-views/flagged-rows": "Flagged Rows", "core-views/blank-rows": "Blank Rows", + "core-views/blank-values": "Blank values per column", + "core-views/blank-records": "Blank records per column", "core-views/non-blank-values": "Non-blank values per column", "core-views/non-blank-records": "Non-blank records per column", "core-views/edit-rows": "Edit rows", diff --git a/main/webapp/modules/core/langs/translation-jp.json b/main/webapp/modules/core/langs/translation-jp.json index 643f777d0..9131b147f 100644 --- a/main/webapp/modules/core/langs/translation-jp.json +++ b/main/webapp/modules/core/langs/translation-jp.json @@ -718,6 +718,8 @@ "core-dialogs/no-clustering-functions-and-distances": "クラスタリング関数が読み込めませんでした。", "core-recon/add-std-srv": "標準サービスを追加", "core-views/blank-rows": "空白行", + "core-views/blank-values": "カラムの空白値", + "core-views/blank-records": "カラムの空白レコード", "core-views/non-blank-values": "カラムの非空白値", "core-views/non-blank-records": "カラムの非空白レコード", "core-index/tags": "タグ:", diff --git a/main/webapp/modules/core/langs/translation-zh.json b/main/webapp/modules/core/langs/translation-zh.json index fd595924a..aa09ad077 100644 --- a/main/webapp/modules/core/langs/translation-zh.json +++ b/main/webapp/modules/core/langs/translation-zh.json @@ -598,6 +598,10 @@ "core-views/no-settings": "此属性没有可用设置.", "core-views/extend-not-reconciled": "此操作仅在调和列上可用.", "core-views/extend-not-supported": "此和解服务不支持数据扩展. 尝试删除服务并添加它. 如果问题仍然存在,请与服务提供商联系.", + "core-views/blank-values": "每列空白值", + "core-views/blank-records": "每条记录空白值", + "core-views/non-blank-values": "每列非空白值", + "core-views/non-blank-records": "每条记录非空白值", "core-buttons/cancel": "取消", "core-buttons/ok": "  确定  ", "core-buttons/import-proj": "导入项目", diff --git a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js index 3132b2381..abd9041e3 100644 --- a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js +++ b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js @@ -668,6 +668,40 @@ DataTableView.prototype._createMenuForAllColumns = function(elmt) { ); } }, + { + label: $.i18n('core-views/blank-values'), + id: "core/blank-values", + click: function() { + ui.browsingEngine.addFacet( + "list", + { + "name" : $.i18n('core-views/blank-values'), + "columnName" : "", + "expression" : "filter(row.columnNames,cn,isBlank(cells[cn].value))" + }, + { + "scroll" : false + } + ); + } + }, + { + label: $.i18n('core-views/blank-records'), + id: "core/blank-records", + click: function() { + ui.browsingEngine.addFacet( + "list", + { + "name" : $.i18n('core-views/blank-records'), + "columnName" : "", + "expression" : "filter(row.columnNames,cn,isBlank(if(row.record.fromRowIndex==row.index,row.record.cells[cn].value.join(\"\"),null)))" + }, + { + "scroll" : false + } + ); + } + }, { label: $.i18n('core-views/non-blank-values'), id: "core/non-blank-values", From df76cb93b7d633060377eca48ccc77004d6ffa68 Mon Sep 17 00:00:00 2001 From: jamessspanggg Date: Tue, 21 Jan 2020 01:28:19 +0800 Subject: [PATCH 2/2] Fix error in calculation of blank records per column --- .../modules/core/scripts/views/data-table/data-table-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js index abd9041e3..8d15c03a7 100644 --- a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js +++ b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js @@ -694,7 +694,7 @@ DataTableView.prototype._createMenuForAllColumns = function(elmt) { { "name" : $.i18n('core-views/blank-records'), "columnName" : "", - "expression" : "filter(row.columnNames,cn,isBlank(if(row.record.fromRowIndex==row.index,row.record.cells[cn].value.join(\"\"),null)))" + "expression" : "filter(row.columnNames,cn,isBlank(if(row.record.fromRowIndex==row.index,row.record.cells[cn].value.join(\"\"),true)))" }, { "scroll" : false