From 534d2bd6c1820d245d58ba0a5cf571277a53ad99 Mon Sep 17 00:00:00 2001 From: Cora Johnson-Roberson Date: Wed, 18 Nov 2015 11:25:13 -0800 Subject: [PATCH] add project name to json --- .../modules/core/scripts/dialogs/clustering-dialog.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js index 13bb58aa1..3b544b526 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js @@ -382,10 +382,17 @@ ClusteringDialog.prototype._apply = function(onDone) { ClusteringDialog.prototype._export = function() { var clusters = this._getRestrictedClusters(); - var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(clusters)); + var projectName = theProject.metadata.name; + var columnName = this._columnName; + var obj = { + 'projectName': projectName, + 'columnName': columnName, + 'clusters': clusters, + }; + var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(obj)); var link=document.createElement('a'); link.href='data:' + data; - link.download="clusters" + (new Date()).toISOString() + ".json"; + link.download="clusters_" + projectName + "_" + columnName + "_" + (new Date()).toISOString() + ".json"; link.click(); };