From b503850ce2d67b78b815cb4e31774a50d2fd8a10 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Thu, 23 Jan 2020 10:22:24 +0100 Subject: [PATCH 01/13] dblclick -> click + event bubbling fix --- app/views/dataview/widgetSpecTable.scala.html | 6 ++++-- public/javascripts/main.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/dataview/widgetSpecTable.scala.html b/app/views/dataview/widgetSpecTable.scala.html index b41a066..b5d743e 100644 --- a/app/views/dataview/widgetSpecTable.scala.html +++ b/app/views/dataview/widgetSpecTable.scala.html @@ -609,8 +609,10 @@ function setWidgetRowClickable(row) { row.css('cursor', 'pointer'); - row.dblclick(function (event) { - showEditModal($(this)) + row.click(function (event) { + if (event.target === this || [...this.children].includes(event.target)) { + showEditModal($(this)) + } }); } diff --git a/public/javascripts/main.js b/public/javascripts/main.js index a21df02..944cdba 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -636,10 +636,10 @@ function loadNewTableContent(element, url, data, callType) { function activateRowClickable() { $(function() { - $(".clickable-row").dblclick(function () { + $(".clickable-row").click(function () { window.document.location = $(this).data("href"); }); - $(".no-rowClicked").dblclick(function (event) { + $(".no-rowClicked").click(function (event) { event.stopPropagation(); }); }); From f2ab1ff6830b2f0df316e12714224515741685ac Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Thu, 23 Jan 2020 10:44:23 +0100 Subject: [PATCH 02/13] improved field name style when sorted in table view --- public/stylesheets/main.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 06ad1cf..81c807e 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -637,4 +637,11 @@ a.carousel-control.right{ .alert-very-light { background-color: #f5f5f5; padding-bottom: 0px; +} + +.glyphicon-chevron-down > a,.glyphicon-chevron-up > a { + font-family: "Ubuntu",Tahoma,"Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 14px; + font-weight: bold; + color: #2c8d3a; } \ No newline at end of file From 40554e67c8aa39324e7d114b1133e0b070e6cd6c Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Thu, 23 Jan 2020 14:46:28 +0100 Subject: [PATCH 03/13] made autocomplete scrollable and only show after 2 letters --- public/javascripts/main.js | 4 ++-- public/stylesheets/typeahead.css | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 944cdba..dfb8932 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -143,14 +143,14 @@ function populateTypeahead(element, source, displayFun, suggestionFun, updateVal element.typeahead({ hint: true, highlight: true, - minLength: 0 + minLength: 2 }, { source: source, display: displayFun, templates: { suggestion: suggestionFun }, - limit: 25 + limit: 100 }); element.on("focus", function () { diff --git a/public/stylesheets/typeahead.css b/public/stylesheets/typeahead.css index a055416..cc10250 100644 --- a/public/stylesheets/typeahead.css +++ b/public/stylesheets/typeahead.css @@ -33,11 +33,12 @@ .tt-menu { width: 300px; + max-height: 155px; + overflow-y: auto; margin: 12px 0; padding: 8px 0; background-color: #fff; border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; @@ -65,4 +66,4 @@ .tt-suggestion p { margin: 0; -} \ No newline at end of file +} From 8117c6988244f81b967d6980066cd245b108150b Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Tue, 28 Jan 2020 08:23:01 +0100 Subject: [PATCH 04/13] typeahed -> typeahead --- .../categorySelectionModal.scala.html | 2 +- app/views/category/edit.scala.html | 2 +- app/views/dataset/cluster.scala.html | 2 +- app/views/dataset/cumulativeCount.scala.html | 4 +- .../dataset/dataSetExportDropdown.scala.html | 4 +- app/views/dataset/distribution.scala.html | 4 +- app/views/dataset/heatmap.scala.html | 4 +- app/views/dataset/processSeries.scala.html | 2 +- app/views/dataset/scatter.scala.html | 4 +- app/views/dataset/transformSeries.scala.html | 2 +- app/views/dataset/widgetsScreen.scala.html | 4 +- .../fieldTypeaheadsActivationJs.scala.html | 14 +-- .../datasettrans/dataSetTypeahead.scala.html | 2 +- ...mergeFullyMultiDataSetsElements.scala.html | 2 +- .../mergeMultiDataSetsElements.scala.html | 2 +- .../dataview/activateTypeahead.scala.html | 8 +- app/views/dataview/widgetSpecTable.scala.html | 4 +- app/views/elements/typeahead.scala.html | 4 +- app/views/layout/dataSets.scala.html | 2 +- app/views/mlRun/create.scala.html | 4 +- .../inputFieldAndFilterResources.scala.html | 4 +- .../runnable/runnableSelection.scala.html | 2 +- app/views/typeaheadSelectionModal.scala.html | 2 +- app/views/user/dataSetTypeahead.scala.html | 2 +- app/views/user/elements.scala.html | 2 +- public/javascripts/main.js | 110 ++++++++++-------- public/javascripts/multiFilter.js | 4 +- 27 files changed, 109 insertions(+), 93 deletions(-) diff --git a/app/views/category/categorySelectionModal.scala.html b/app/views/category/categorySelectionModal.scala.html index ec8742c..399de0f 100644 --- a/app/views/category/categorySelectionModal.scala.html +++ b/app/views/category/categorySelectionModal.scala.html @@ -34,7 +34,7 @@ var typeaheadData = data.map( function(item, index) { return {name: item._id.$oid, label: item.name}; }); - populateFieldTypeahed( + populateFieldTypeahead( $('#categoryTypeahead'), $('#categoryId'), typeaheadData, diff --git a/app/views/category/edit.scala.html b/app/views/category/edit.scala.html index 787428e..58159e9 100644 --- a/app/views/category/edit.scala.html +++ b/app/views/category/edit.scala.html @@ -41,7 +41,7 @@ } diff --git a/app/views/dataset/cluster.scala.html b/app/views/dataset/cluster.scala.html index 22e323d..a855802 100644 --- a/app/views/dataset/cluster.scala.html +++ b/app/views/dataset/cluster.scala.html @@ -38,12 +38,12 @@ var typeaheadData = data.map(function (item, index) { return {name: item._id.$oid, label: item.name}; }); - populateFieldTypeahead( - $('#mlModelTypeahead'), - $('#mlModelId'), - typeaheadData, - @FilterShowFieldStyle.LabelsOnly.id - ); + populateFieldTypeahead({ + typeaheadElement: $('#mlModelTypeahead'), + fieldNameElement: $('#mlModelId'), + fieldNameAndLabels: typeaheadData, + showOption: @FilterShowFieldStyle.LabelsOnly.id + }); } }); diff --git a/app/views/dataset/dataSetExportDropdown.scala.html b/app/views/dataset/dataSetExportDropdown.scala.html index 7da99aa..3467406 100644 --- a/app/views/dataset/dataSetExportDropdown.scala.html +++ b/app/views/dataset/dataSetExportDropdown.scala.html @@ -131,8 +131,20 @@ success: function (fieldNameAndLabels) { var fieldNamesAndLabelsWithNone = fieldNameAndLabels.concat([["", "[None]"]]) - populateFieldTypeahead($('#exportTranSMARTDataModal #visitFieldTypeahead'), $('#exportTranSMARTDataModal #visitFieldName'), fieldNamesAndLabelsWithNone, showOption, true); - populateFieldTypeahead($('#exportTranSMARTMappingModal #visitFieldTypeahead'), $('#exportTranSMARTMappingModal #visitFieldName'), fieldNamesAndLabelsWithNone, showOption, true); + populateFieldTypeahead({ + typeaheadElement: $('#exportTranSMARTDataModal #visitFieldTypeahead'), + fieldNameElement: $('#exportTranSMARTDataModal #visitFieldName'), + fieldNameAndLabels: fieldNamesAndLabelsWithNone, + showOption, + initSelectByNameElement: true + }); + populateFieldTypeahead({ + typeaheadElement: $('#exportTranSMARTMappingModal #visitFieldTypeahead'), + fieldNameElement: $('#exportTranSMARTMappingModal #visitFieldName'), + fieldNameAndLabels: fieldNamesAndLabelsWithNone, + showOption, + initSelectByNameElement: true + }); }, error: showErrorResponse }); diff --git a/app/views/dataset/processSeries.scala.html b/app/views/dataset/processSeries.scala.html index 60b6845..ffd59d4 100644 --- a/app/views/dataset/processSeries.scala.html +++ b/app/views/dataset/processSeries.scala.html @@ -55,12 +55,12 @@ \ No newline at end of file diff --git a/app/views/datasettrans/mergeFullyMultiDataSetsElements.scala.html b/app/views/datasettrans/mergeFullyMultiDataSetsElements.scala.html index a2928e1..55b43e7 100644 --- a/app/views/datasettrans/mergeFullyMultiDataSetsElements.scala.html +++ b/app/views/datasettrans/mergeFullyMultiDataSetsElements.scala.html @@ -38,12 +38,12 @@ \ No newline at end of file diff --git a/app/views/user/elements.scala.html b/app/views/user/elements.scala.html index 4228dbe..9a94195 100644 --- a/app/views/user/elements.scala.html +++ b/app/views/user/elements.scala.html @@ -153,12 +153,12 @@ handleModalButtonEnterPressed("addCustomDataSetPermissionModal", "addCustomDataSetPermissionSubmitButton", addCustomDataSetPermission, true) $("#permission-controller").val("") - populateFieldTypeaheadFromUrl( - $('#classNameTypeahead'), - $('#className'), - '@Html(routes.RunnableController.getRunnableNames().url)', - @FilterShowFieldStyle.LabelsOnly.id - ) + populateFieldTypeaheadFromUrl({ + typeaheadElement: $('#classNameTypeahead'), + fieldNameElement: $('#className'), + url: '@Html(routes.RunnableController.getRunnableNames().url)', + showOption: @FilterShowFieldStyle.LabelsOnly.id + }) $('#addRunnablePermissionModal #classNameTypeahead').on("keydown", function(e) { if(e.keyCode == 13) { diff --git a/build.sbt b/build.sbt index b3dd019..485ffb4 100644 --- a/build.sbt +++ b/build.sbt @@ -88,6 +88,11 @@ mappings in (Compile, packageBin) ~= { _.filter(!_._1.getName.endsWith("custom.c // Asset stages +Closure.flags := Seq( + "--language_in=ES6" +) +//Closure.suffix := ".min.js" + pipelineStages in Assets := Seq(closure, cssCompress, digest, gzip) excludeFilter in gzip := (excludeFilter in gzip).value || new SimpleFileFilter(file => new File(file.getAbsolutePath + ".gz").exists) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 12f9e1b..141fc64 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -113,7 +113,7 @@ function createStringDatumTokenizer(searchAsContainsFlag, nonWhitespaceDelimiter return stringDatumTokenizer.bind(null, searchAsContainsFlag).bind(null, nonWhitespaceDelimiter) } -function populateStringTypeahead(element, data, searchAsContainsFlag, nonWhitespaceDelimiter, updateValueElement) { +function populateStringTypeahead({element, data, searchAsContainsFlag, nonWhitespaceDelimiter, updateValueElement}) { var datumTokenizer = createStringDatumTokenizer(searchAsContainsFlag, nonWhitespaceDelimiter) var source = createBloodhoundSource(data, datumTokenizer) populateTypeahead({element, source, updateValueElement}) @@ -237,14 +237,14 @@ function createFieldBloodhoundSource(fieldNameAndLabels, showOption) { ) } -function populateFieldTypeaheads(typeaheadElements, fieldNameElements, fieldNameAndLabels, showOption, initSelectByNameElement) { +function populateFieldTypeaheads({typeaheadElements, fieldNameElements, fieldNameAndLabels, showOption, initSelectByNameElement}) { var source = createFieldBloodhoundSource(fieldNameAndLabels, showOption) for(var i = 0; i < typeaheadElements.length; i++){ var typeaheadElement = typeaheadElements[i] var fieldNameElement = fieldNameElements[i] - populateFieldTypeaheadAux(typeaheadElement, fieldNameElement, source, showOption) + populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) if (initSelectByNameElement) { selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption) @@ -260,10 +260,10 @@ function populateFieldTypeaheads(typeaheadElements, fieldNameElements, fieldName * @param showOption 0 - show field names only, 1 - show field labels only, * 2 - show field labels, and field names if no label defined, 3 - show both, field names and labels */ -function populateFieldTypeahead(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption, initSelectByNameElement) { +function populateFieldTypeahead({typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption, initSelectByNameElement}) { var source = createFieldBloodhoundSource(fieldNameAndLabels, showOption) - populateFieldTypeaheadAux(typeaheadElement, fieldNameElement, source, showOption) + populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) if (initSelectByNameElement) { selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption) @@ -298,7 +298,7 @@ function selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLab } } -function populateFieldTypeaheadAux(typeaheadElement, fieldNameElement, source, showOption) { +function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) { populateTypeahead({ typeaheadElement, source, @@ -355,11 +355,17 @@ function populateFieldTypeaheadAux(typeaheadElement, fieldNameElement, source, s * @param showOption 0 - show field names only, 1 - show field labels only, * 2 - show field labels, and field names if no label defined, 3 - show both, field names and labels */ -function populateFieldTypeaheadFromUrl(typeaheadElement, fieldNameElement, url, showOption, postFunction, initSelectByNameElement) { +function populateFieldTypeaheadFromUrl({typeaheadElement, fieldNameElement, url, showOption, postFunction, initSelectByNameElement}) { $.ajax({ url: url, success: function (fieldNameAndLabels) { - populateFieldTypeahead(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption, initSelectByNameElement); + populateFieldTypeahead({ + typeaheadElement, + fieldNameElement, + fieldNameAndLabels, + showOption, + initSelectByNameElement + }); if (postFunction) { postFunction() } @@ -368,11 +374,17 @@ function populateFieldTypeaheadFromUrl(typeaheadElement, fieldNameElement, url, }); } -function populateFieldTypeaheadsFromUrl(typeaheadElements, fieldNameElements, url, showOption, initSelectByNameElement, postFunction) { +function populateFieldTypeaheadsFromUrl({typeaheadElements, fieldNameElements, url, showOption, initSelectByNameElement, postFunction}) { $.ajax({ url: url, success: function (fieldNameAndLabels) { - populateFieldTypeaheads(typeaheadElements, fieldNameElements, fieldNameAndLabels, showOption, initSelectByNameElement); + populateFieldTypeaheads({ + typeaheadElements, + fieldNameElements, + fieldNameAndLabels, + showOption, + initSelectByNameElement + }); if (postFunction) { postFunction() } @@ -381,14 +393,20 @@ function populateFieldTypeaheadsFromUrl(typeaheadElements, fieldNameElements, ur }); } -function populateIdNameTypeaheadFromUrl(typeaheadElement, idElement, url, initSelectByNameElement) { +function populateIdNameTypeaheadFromUrl({typeaheadElement, idElement, url, initSelectByNameElement}) { $.ajax({ url: url, success: function (data) { var typeaheadData = data.map(function (item, index) { return {name: item._id.$oid, label: item.name}; }); - populateFieldTypeahead(typeaheadElement, idElement, typeaheadData, 1, initSelectByNameElement); + populateFieldTypeahead({ + typeaheadElement, + fieldNameElement: idElement, + fieldNameAndLabels: typeaheadData, + showOption: 1, + initSelectByNameElement + }); }, error: function(data){ showErrorResponse(data) @@ -396,14 +414,20 @@ function populateIdNameTypeaheadFromUrl(typeaheadElement, idElement, url, initSe }); } -function populateIdNameTypeaheadsFromUrl(typeaheadElements, idElements, url, initSelectByNameElement) { +function populateIdNameTypeaheadsFromUrl({typeaheadElements, idElements, url, initSelectByNameElement}) { $.ajax({ url: url, success: function (data) { var fieldNameAndLabels = data.map(function (item, index) { return {name: item._id.$oid, label: item.name}; }); - populateFieldTypeaheads(typeaheadElements, idElements, fieldNameAndLabels, 1, initSelectByNameElement); + populateFieldTypeaheads({ + typeaheadElements, + fieldNameElements: idElements, + fieldNameAndLabels, + showOption: 1, + initSelectByNameElement + }); }, error: showErrorResponse }); diff --git a/public/javascripts/multiFilter.js b/public/javascripts/multiFilter.js index cb3346d..13b000f 100644 --- a/public/javascripts/multiFilter.js +++ b/public/javascripts/multiFilter.js @@ -423,12 +423,12 @@ $.widget("custom.multiFilter", { }); that.filterTypeaheadElement.typeahead('destroy'); if (filterTypeaheadData.length > 0) { - populateFieldTypeahead( - that.filterTypeaheadElement, - that.filterIdModalElement, - filterTypeaheadData, - 1 - ); + populateFieldTypeahead({ + typeaheadElement: that.filterTypeaheadElement, + fieldNameElement: that.filterIdModalElement, + fieldNameAndLabels: filterTypeaheadData, + showOption: 1 + }); if (successFun) successFun() } else { @@ -502,12 +502,12 @@ $.widget("custom.multiFilter", { this.fieldNameTypeaheadElement.typeahead('destroy'); - populateFieldTypeahead( - this.fieldNameTypeaheadElement, - this.fieldNameElement, - this.fieldNameAndLabels, - choiceValue - ) + populateFieldTypeahead({ + typeaheadElement: this.fieldNameTypeaheadElement, + fieldNameElement: this.fieldNameElement, + fieldNameAndLabels: this.fieldNameAndLabels, + showOption: choiceValue + }) this.fieldNameTypeaheadElement.typeahead('val', ''); From 225b01c088c95e8fbab0ca816bd1e46eae76ac86 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Wed, 29 Jan 2020 12:52:21 +0100 Subject: [PATCH 06/13] setting spark host --- conf/core/spark-ml.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/core/spark-ml.conf b/conf/core/spark-ml.conf index 9cc0b85..c14c4d0 100644 --- a/conf/core/spark-ml.conf +++ b/conf/core/spark-ml.conf @@ -16,6 +16,7 @@ spark.executor.memory = "4g" spark.rdd.compress = "true" // spark.kryo.registrationRequired = "true" +spark.driver.host = "localhost" spark.driver.bindAddress = "127.0.0.1" // spark.driver.port = 35701 // spark.blockManager.port = 35702 From 4526876310d2f141be5443387e8ae73ba9adb194 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 10:14:34 +0100 Subject: [PATCH 07/13] removed closure compiler as it's no longer maintained --- build.sbt | 9 +-------- project/plugins.sbt | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index 4e935df..105119b 100644 --- a/build.sbt +++ b/build.sbt @@ -88,17 +88,10 @@ mappings in (Compile, packageBin) ~= { _.filter(!_._1.getName.endsWith("custom.c // Asset stages -Closure.flags := Seq( - "--language_in=ES6" -) -//Closure.suffix := ".min.js" - -pipelineStages in Assets := Seq(closure, cssCompress, digest, gzip) +pipelineStages in Assets := Seq(cssCompress, digest, gzip) excludeFilter in gzip := (excludeFilter in gzip).value || new SimpleFileFilter(file => new File(file.getAbsolutePath + ".gz").exists) -includeFilter in closure := (includeFilter in closure).value && new SimpleFileFilter(f => f.getPath.contains("javascripts")) - includeFilter in cssCompress := (includeFilter in cssCompress).value && new SimpleFileFilter(f => f.getPath.contains("stylesheets")) //includeFilter in uglify := GlobFilter("javascripts/*.js") diff --git a/project/plugins.sbt b/project/plugins.sbt index 74f17dd..8667a61 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -34,8 +34,6 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2") addSbtPlugin("net.ground5hark.sbt" % "sbt-css-compress" % "0.1.3") -addSbtPlugin("net.ground5hark.sbt" % "sbt-closure" % "0.1.3") - // addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1") // code coverage From 929f9ad301dc821659f51ad65aa5670784bc1c77 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 10:14:51 +0100 Subject: [PATCH 08/13] merged --- app/views/datasettrans/filterDataSetElements.scala.html | 7 ++++++- public/javascripts/main.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/datasettrans/filterDataSetElements.scala.html b/app/views/datasettrans/filterDataSetElements.scala.html index 9799812..2ebd7a7 100644 --- a/app/views/datasettrans/filterDataSetElements.scala.html +++ b/app/views/datasettrans/filterDataSetElements.scala.html @@ -56,7 +56,12 @@ dataSetTransformationJsRoutes2.org.ada.web.controllers.dataset.datatrans.DataSetTransformationController.filterIdAndNames(dataSetId).ajax({ success: function (data) { - populateIdNameTypeahed($('#filterTypeahead'), $('#filterId'), data, true) + populateIdNameTypeahead({ + typeaheadElement: $('#filterTypeahead'), + idElement: $('#filterId'), + idNames: data, + initSelectByNameElement: true + }) }, error: showErrorResponse }) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 4253150..f7071aa 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -397,7 +397,7 @@ function populateIdNameTypeaheadFromUrl({typeaheadElement, idElement, url, initS $.ajax({ url: url, success: function (data) { - populateIdNameTypeahed({ + populateIdNameTypeahead({ typeaheadElement, fieldNameElement: idElement, fieldNameAndLabels: data, From 584cc13b16f3471816170011907ffac4d82d883d Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 13:51:42 +0100 Subject: [PATCH 09/13] fixed a few issues introduced by the refactor --- app/views/category/edit.scala.html | 8 ++--- app/views/category/treeChart.scala.html | 4 +-- .../highcharts/highchartsJsImport.scala.html | 4 +-- ...highchartsJsImportForBulkExport.scala.html | 2 +- app/views/dataset/datasetJsImport.scala.html | 2 +- app/views/dataset/heatmap.scala.html | 4 +-- .../dataset/matthewsCorrelation.scala.html | 4 +-- .../dataset/pearsonCorrelation.scala.html | 4 +-- app/views/dataset/scatter.scala.html | 4 +-- app/views/filter/filterJsImport.scala.html | 6 ++-- app/views/filter/jsTreeImport.scala.html | 6 ++-- app/views/layout/main.scala.html | 4 +-- .../table/dynamicTableJsImport.scala.html | 2 +- app/views/typeaheadJsImport.scala.html | 2 +- public/javascripts/main.js | 33 +++++++++++++++---- 15 files changed, 54 insertions(+), 35 deletions(-) diff --git a/app/views/category/edit.scala.html b/app/views/category/edit.scala.html index 82f0f5b..d21b620 100644 --- a/app/views/category/edit.scala.html +++ b/app/views/category/edit.scala.html @@ -42,10 +42,10 @@ diff --git a/app/views/category/treeChart.scala.html b/app/views/category/treeChart.scala.html index a508973..feff638 100644 --- a/app/views/category/treeChart.scala.html +++ b/app/views/category/treeChart.scala.html @@ -8,10 +8,10 @@ implicit request: Request[_], webJarAssets: WebJarAssets ) - + - +
} - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/chart/highcharts/highchartsJsImportForBulkExport.scala.html b/app/views/chart/highcharts/highchartsJsImportForBulkExport.scala.html index 37a6b6f..7a230fa 100644 --- a/app/views/chart/highcharts/highchartsJsImportForBulkExport.scala.html +++ b/app/views/chart/highcharts/highchartsJsImportForBulkExport.scala.html @@ -3,4 +3,4 @@ @()(implicit webJarAssets: WebJarAssets) - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/dataset/datasetJsImport.scala.html b/app/views/dataset/datasetJsImport.scala.html index 6394be0..dfae733 100644 --- a/app/views/dataset/datasetJsImport.scala.html +++ b/app/views/dataset/datasetJsImport.scala.html @@ -1,3 +1,3 @@ @import org.incal.play.routes.CustomDirAssets - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/dataset/heatmap.scala.html b/app/views/dataset/heatmap.scala.html index 5463528..7fb5c0f 100644 --- a/app/views/dataset/heatmap.scala.html +++ b/app/views/dataset/heatmap.scala.html @@ -29,8 +29,8 @@ @bottomResources = { - - + + @helper.javascriptRouter("dataSetJsRoutes")( dataSetJsRouter.calcHeatmap, diff --git a/app/views/dataset/matthewsCorrelation.scala.html b/app/views/dataset/matthewsCorrelation.scala.html index a3939fe..c34920a 100644 --- a/app/views/dataset/matthewsCorrelation.scala.html +++ b/app/views/dataset/matthewsCorrelation.scala.html @@ -34,8 +34,8 @@ @bottomResources = { - - + + @helper.javascriptRouter("dataSetJsRoutes")( dataSetJsRouter.calcMatthewsCorrelations, diff --git a/app/views/dataset/pearsonCorrelation.scala.html b/app/views/dataset/pearsonCorrelation.scala.html index e28c5cb..f6f9147 100644 --- a/app/views/dataset/pearsonCorrelation.scala.html +++ b/app/views/dataset/pearsonCorrelation.scala.html @@ -30,8 +30,8 @@ @bottomResources = { - - + + @helper.javascriptRouter("dataSetJsRoutes")( dataSetJsRouter.calcPearsonCorrelations, diff --git a/app/views/dataset/scatter.scala.html b/app/views/dataset/scatter.scala.html index 163bea4..38a6285 100644 --- a/app/views/dataset/scatter.scala.html +++ b/app/views/dataset/scatter.scala.html @@ -31,8 +31,8 @@ @bottomResources = { - - + + @helper.javascriptRouter("dataSetJsRoutes")( dataSetJsRouter.calcScatter, diff --git a/app/views/filter/filterJsImport.scala.html b/app/views/filter/filterJsImport.scala.html index 6793299..33dc37c 100644 --- a/app/views/filter/filterJsImport.scala.html +++ b/app/views/filter/filterJsImport.scala.html @@ -4,11 +4,11 @@ @typeaheadJsImport() - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/filter/jsTreeImport.scala.html b/app/views/filter/jsTreeImport.scala.html index 0ff4744..8cbc412 100644 --- a/app/views/filter/jsTreeImport.scala.html +++ b/app/views/filter/jsTreeImport.scala.html @@ -2,7 +2,7 @@ @()(implicit webJarAssets: WebJarAssets) - + - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/layout/main.scala.html b/app/views/layout/main.scala.html index d27e1fd..92a2f89 100644 --- a/app/views/layout/main.scala.html +++ b/app/views/layout/main.scala.html @@ -23,14 +23,14 @@ @title - + @* Optional theme *@ @* *@ - + @if(topResources.isDefined) { @topResources.get } diff --git a/app/views/table/dynamicTableJsImport.scala.html b/app/views/table/dynamicTableJsImport.scala.html index f9d3fed..3816d31 100644 --- a/app/views/table/dynamicTableJsImport.scala.html +++ b/app/views/table/dynamicTableJsImport.scala.html @@ -3,4 +3,4 @@ @()(implicit webJarAssets: WebJarAssets) - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/typeaheadJsImport.scala.html b/app/views/typeaheadJsImport.scala.html index 8b24b79..5f9444b 100644 --- a/app/views/typeaheadJsImport.scala.html +++ b/app/views/typeaheadJsImport.scala.html @@ -2,5 +2,5 @@ @()(implicit webJarAssets: WebJarAssets) - + \ No newline at end of file diff --git a/public/javascripts/main.js b/public/javascripts/main.js index f7071aa..2310147 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -300,7 +300,7 @@ function selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLab function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) { populateTypeahead({ - typeaheadElement, + element: typeaheadElement, source, displayFun: function(item) { return item.value; @@ -341,7 +341,7 @@ function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, else return '
' + item.value + '' + nameBadge + '
'; }, - function(item) { + updateValueElement: function(item) { fieldNameElement.val(item.key); } }); @@ -399,8 +399,8 @@ function populateIdNameTypeaheadFromUrl({typeaheadElement, idElement, url, initS success: function (data) { populateIdNameTypeahead({ typeaheadElement, - fieldNameElement: idElement, - fieldNameAndLabels: data, + idElement, + idNames: data, initSelectByNameElement }); }, @@ -415,14 +415,33 @@ function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSele return {name: item._id.$oid, label: item.name}; }); populateFieldTypeaheads({ - typeaheadElements, - fieldNameElements: idElements, - fieldNameAndLabels, + typeaheadElement, + fieldNameElements: idElement, + fieldNameAndLabels: typeaheadData, showOption: 1, initSelectByNameElement }); } +function populateIdNameTypeaheadsFromUrl({typeaheadElements, idElements, url, initSelectByNameElement}) { + $.ajax({ + url: url, + success: function (data) { + var fieldNameAndLabels = data.map(function (item, index) { + return {name: item._id.$oid, label: item.name}; + }); + populateFieldTypeaheads({ + typeaheadElements, + fieldNameElements: idElements, + fieldNameAndLabels, + showOption: 1, + initSelectByNameElement + }); + }, + error: showErrorResponse + }); +} + function registerMessageEventSource(url) { // if (!!window.EventSource) { if (!window.messageSource) From 30e1fe944058740738076ed6703ba594d2418cfc Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 13:52:20 +0100 Subject: [PATCH 10/13] disabling css compress (gzip is still active) --- build.sbt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 105119b..fdf7ec7 100644 --- a/build.sbt +++ b/build.sbt @@ -88,15 +88,10 @@ mappings in (Compile, packageBin) ~= { _.filter(!_._1.getName.endsWith("custom.c // Asset stages -pipelineStages in Assets := Seq(cssCompress, digest, gzip) +pipelineStages in Assets := Seq(digest, gzip) excludeFilter in gzip := (excludeFilter in gzip).value || new SimpleFileFilter(file => new File(file.getAbsolutePath + ".gz").exists) -includeFilter in cssCompress := (includeFilter in cssCompress).value && new SimpleFileFilter(f => f.getPath.contains("stylesheets")) - -//includeFilter in uglify := GlobFilter("javascripts/*.js") - - // For licenses not automatically downloaded (need to list them manually) licenseOverrides := { case From 5d11c1b07a4f05e2aee6238e29059906b149f495 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 14:34:26 +0100 Subject: [PATCH 11/13] fixed some more issues --- public/javascripts/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 2310147..6430ce1 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -415,9 +415,9 @@ function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSele return {name: item._id.$oid, label: item.name}; }); populateFieldTypeaheads({ - typeaheadElement, - fieldNameElements: idElement, - fieldNameAndLabels: typeaheadData, + typeaheadElements: [typeaheadElement], + fieldNameElements: [idElement], + fieldNameAndLabels: [typeaheadData], showOption: 1, initSelectByNameElement }); From 96921b34ad3cb6e315509f882f96015410d2ebd4 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Fri, 31 Jan 2020 14:55:57 +0100 Subject: [PATCH 12/13] populateFieldTypeaheads -> populateFieldTypeahead --- public/javascripts/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 6430ce1..81e1aff 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -414,10 +414,10 @@ function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSele var typeaheadData = idNames.map(function (item, index) { return {name: item._id.$oid, label: item.name}; }); - populateFieldTypeaheads({ - typeaheadElements: [typeaheadElement], - fieldNameElements: [idElement], - fieldNameAndLabels: [typeaheadData], + populateFieldTypeahead({ + typeaheadElement, + fieldNameElement: idElement, + fieldNameAndLabels: typeaheadData, showOption: 1, initSelectByNameElement }); From 325d85144aeeedac1b1505c4ccef625bf5fc9fc8 Mon Sep 17 00:00:00 2001 From: Sascha Herzinger Date: Tue, 4 Feb 2020 09:52:27 +0100 Subject: [PATCH 13/13] setting fields typeahead to minLength 2 --- app/views/dataset/widgetsScreen.scala.html | 3 +- .../dataview/activateTypeahead.scala.html | 9 +++-- public/javascripts/main.js | 39 ++++++++++++------- public/javascripts/multiFilter.js | 3 +- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/app/views/dataset/widgetsScreen.scala.html b/app/views/dataset/widgetsScreen.scala.html index 8cd2cb9..2ec146b 100644 --- a/app/views/dataset/widgetsScreen.scala.html +++ b/app/views/dataset/widgetsScreen.scala.html @@ -119,7 +119,8 @@ fieldNameElement: nameElement, url, showOption: @setting.filterShowFieldStyle.getOrElse(FilterShowFieldStyle.NamesAndLabels).id, - postFunction: focusFun + postFunction: focusFun, + minLength: 2 }) } diff --git a/app/views/dataview/activateTypeahead.scala.html b/app/views/dataview/activateTypeahead.scala.html index b5d85f8..efea288 100644 --- a/app/views/dataview/activateTypeahead.scala.html +++ b/app/views/dataview/activateTypeahead.scala.html @@ -30,7 +30,8 @@ $('#edit_widgetSpecModal #fieldName') ], fieldNameAndLabels: data, - showOption + showOption, + minLength: 2 }); } }); @@ -48,7 +49,8 @@ $('#edit_widgetSpecModal #groupFieldName') ], fieldNameAndLabels: data, - showOption + showOption, + minLength: 2 }); } }); @@ -74,7 +76,8 @@ $('#edit_widgetSpecModal #valueFieldName') ], fieldNameAndLabels: data, - showOption + showOption, + minLength: 2 }); } }); diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 81e1aff..bd941cd 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -139,18 +139,18 @@ function createBloodhoundSource(data, datumTokenizer) { return listSearchWithAll; } -function populateTypeahead({element, source, displayFun, suggestionFun, updateValueElement}) { +function populateTypeahead({element, source, displayFun, suggestionFun, updateValueElement, minLength}) { element.typeahead({ hint: true, highlight: true, - minLength: 2 + minLength: typeof minLength === 'undefined' ? 0 : minLength }, { source: source, display: displayFun, templates: { suggestion: suggestionFun }, - limit: 100 + limit: 1000 }); element.on("focus", function () { @@ -237,14 +237,19 @@ function createFieldBloodhoundSource(fieldNameAndLabels, showOption) { ) } -function populateFieldTypeaheads({typeaheadElements, fieldNameElements, fieldNameAndLabels, showOption, initSelectByNameElement}) { +function populateFieldTypeaheads({typeaheadElements, + fieldNameElements, + fieldNameAndLabels, + showOption, + initSelectByNameElement, + minLength}) { var source = createFieldBloodhoundSource(fieldNameAndLabels, showOption) for(var i = 0; i < typeaheadElements.length; i++){ var typeaheadElement = typeaheadElements[i] var fieldNameElement = fieldNameElements[i] - populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) + populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption, minLength}) if (initSelectByNameElement) { selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption) @@ -260,10 +265,15 @@ function populateFieldTypeaheads({typeaheadElements, fieldNameElements, fieldNam * @param showOption 0 - show field names only, 1 - show field labels only, * 2 - show field labels, and field names if no label defined, 3 - show both, field names and labels */ -function populateFieldTypeahead({typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption, initSelectByNameElement}) { +function populateFieldTypeahead({typeaheadElement, + fieldNameElement, + fieldNameAndLabels, + showOption, + initSelectByNameElement, + minLength}) { var source = createFieldBloodhoundSource(fieldNameAndLabels, showOption) - populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) + populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption, minLength}) if (initSelectByNameElement) { selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLabels, showOption) @@ -298,7 +308,7 @@ function selectByNameElement(typeaheadElement, fieldNameElement, fieldNameAndLab } } -function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption}) { +function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, showOption, minLength}) { populateTypeahead({ element: typeaheadElement, source, @@ -343,7 +353,8 @@ function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, }, updateValueElement: function(item) { fieldNameElement.val(item.key); - } + }, + minLength }); } @@ -355,7 +366,7 @@ function populateFieldTypeaheadAux({typeaheadElement, fieldNameElement, source, * @param showOption 0 - show field names only, 1 - show field labels only, * 2 - show field labels, and field names if no label defined, 3 - show both, field names and labels */ -function populateFieldTypeaheadFromUrl({typeaheadElement, fieldNameElement, url, showOption, postFunction, initSelectByNameElement}) { +function populateFieldTypeaheadFromUrl({typeaheadElement, fieldNameElement, url, showOption, postFunction, initSelectByNameElement, minLength}) { $.ajax({ url: url, success: function (fieldNameAndLabels) { @@ -364,7 +375,8 @@ function populateFieldTypeaheadFromUrl({typeaheadElement, fieldNameElement, url, fieldNameElement, fieldNameAndLabels, showOption, - initSelectByNameElement + initSelectByNameElement, + minLength }); if (postFunction) { postFunction() @@ -410,7 +422,7 @@ function populateIdNameTypeaheadFromUrl({typeaheadElement, idElement, url, initS }); } -function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSelectByNameElement}) { +function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSelectByNameElement, minLength}) { var typeaheadData = idNames.map(function (item, index) { return {name: item._id.$oid, label: item.name}; }); @@ -419,7 +431,8 @@ function populateIdNameTypeahead({typeaheadElement, idElement, idNames, initSele fieldNameElement: idElement, fieldNameAndLabels: typeaheadData, showOption: 1, - initSelectByNameElement + initSelectByNameElement, + minLength }); } diff --git a/public/javascripts/multiFilter.js b/public/javascripts/multiFilter.js index 69c8b33..3b867c8 100644 --- a/public/javascripts/multiFilter.js +++ b/public/javascripts/multiFilter.js @@ -506,7 +506,8 @@ $.widget("custom.multiFilter", { typeaheadElement: this.fieldNameTypeaheadElement, fieldNameElement: this.fieldNameElement, fieldNameAndLabels: this.fieldNameAndLabels, - showOption: choiceValue + showOption: choiceValue, + minLength: 2 }) this.fieldNameTypeaheadElement.typeahead('val', '');