From cccfc65f9929da740905492ea315016098c4f629 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Wed, 16 Mar 2016 14:58:22 +0000 Subject: [PATCH] SSDM-3026 : "All" field type bugfix, empty value bugfix and store settings by type. SVN: 35926 --- .../1/as/webapps/eln-lims/html/js/server/ServerFacade.js | 2 ++ .../html/js/views/AdvancedSearch/AdvancedSearchView.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index 1790f3cb8aa..d9861073d7c 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -680,6 +680,8 @@ function ServerFacade(openbisServer) { var firstDotIndex = fieldName.indexOf("."); fieldNameType = fieldName.substring(0, firstDotIndex); fieldName = fieldName.substring(firstDotIndex + 1, fieldName.length); + } else { + fieldValue = "*"; } var setPropertyCriteria = function(criteria, propertyName, propertyValue) { diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js index 9c783069356..25fe0ef563d 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js @@ -143,7 +143,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { }); var $newFieldNameContainer = $("<td>"); - $newRow.append($("<td>").append(this._getNewFieldTypeDropdownComponent($newFieldNameContainer, this._advancedSearchModel.criteria.entityKind))) + $newRow.append($("<td>").append(this._getNewFieldTypeDropdownComponent($newFieldNameContainer, this._advancedSearchModel.criteria.entityKind, uuidValue))) .append($newFieldNameContainer) .append($("<td>").append($fieldValue)) .append($("<td>").append(this._getMinusButtonComponentForRow(this._$tbody, $newRow))); @@ -153,7 +153,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { //should make new objects every time. otherwise, using the same object will produce odd results! //how to make an on-select event?? - this._getNewFieldTypeDropdownComponent = function($newFieldNameContainer, entityKind) { + this._getNewFieldTypeDropdownComponent = function($newFieldNameContainer, entityKind, uuid) { var _this = this; var fieldTypeOptions = null; switch(entityKind) { @@ -183,6 +183,8 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { break; } + this._advancedSearchModel.criteria.rules[uuid].type = "All"; //Update model with defaults + var $fieldTypeComponent = FormUtil.getDropdown(fieldTypeOptions, "Select Field Type"); $fieldTypeComponent.change(function() { var $thisComponent = $(this); @@ -521,7 +523,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { } } - var dataGrid = new DataGridController("Search Results", columns, getDataRows, rowClick, false, "ADVANCED_SEARCH_OPENBIS"); + var dataGrid = new DataGridController("Search Results", columns, getDataRows, rowClick, false, "ADVANCED_SEARCH_OPENBIS_" + this._advancedSearchModel.criteria.entityKind); return dataGrid; } -- GitLab