Skip to content
Snippets Groups Projects
Commit 46545f29 authored by juanf's avatar juanf
Browse files

SSDM-2597 : Merge Properties/Attributes in one dropdown to make it simpler for the users

SVN: 37279
parent 54bdc5a8
No related branches found
No related tags found
No related merge requests found
...@@ -859,10 +859,20 @@ function ServerFacade(openbisServer) { ...@@ -859,10 +859,20 @@ function ServerFacade(openbisServer) {
searchCriteria.withAnyField().thatContains(fieldValue); searchCriteria.withAnyField().thatContains(fieldValue);
break; break;
case "Property": case "Property":
setPropertyCriteria(searchCriteria, fieldName, fieldValue); setPropertyCriteria(setOperator(searchCriteria, advancedSearchCriteria.logicalOperator), fieldName, fieldValue);
break; break;
case "Attribute": case "Attribute":
setAttributeCriteria(searchCriteria, fieldName, fieldValue); setAttributeCriteria(setOperator(searchCriteria, advancedSearchCriteria.logicalOperator), fieldName, fieldValue);
break;
case "Property/Attribute":
switch(fieldNameType) {
case "PROP":
setPropertyCriteria(setOperator(searchCriteria, advancedSearchCriteria.logicalOperator), fieldName, fieldValue);
break;
case "ATTR":
setAttributeCriteria(setOperator(searchCriteria, advancedSearchCriteria.logicalOperator), fieldName, fieldValue);
break;
}
break; break;
case "Sample": case "Sample":
switch(fieldNameType) { switch(fieldNameType) {
......
...@@ -171,21 +171,18 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -171,21 +171,18 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
break; break;
case "SAMPLE": case "SAMPLE":
fieldTypeOptions = [{value : "All", label : "All", selected : true }, fieldTypeOptions = [{value : "All", label : "All", selected : true },
{value : "Property", label : "Property"}, {value : "Property/Attribute", label : "Property"},
{value : "Attribute", label : "Attribute"},
{value : "Experiment", label : ELNDictionary.ExperimentELN + "/" + ELNDictionary.ExperimentInventory}, {value : "Experiment", label : ELNDictionary.ExperimentELN + "/" + ELNDictionary.ExperimentInventory},
{value : "Parent", label : "Parent"}, {value : "Parent", label : "Parent"},
{value : "Children", label : "Children"}]; {value : "Children", label : "Children"}];
break; break;
case "EXPERIMENT": case "EXPERIMENT":
fieldTypeOptions = [{value : "All", label : "All", selected : true }, fieldTypeOptions = [{value : "All", label : "All", selected : true },
{value : "Property", label : "Property"}, {value : "Property/Attribute", label : "Property"}];
{value : "Attribute", label : "Attribute"}];
break; break;
case "DATASET": case "DATASET":
fieldTypeOptions = [{value : "All", label : "All", selected : true }, fieldTypeOptions = [{value : "All", label : "All", selected : true },
{value : "Property", label : "Property"}, {value : "Property/Attribute", label : "Property"},
{value : "Attribute", label : "Attribute"},
{value : "Sample", label : "" + ELNDictionary.Sample + ""}, {value : "Sample", label : "" + ELNDictionary.Sample + ""},
// ELN-UI don't support this yet // ELN-UI don't support this yet
// {value : "Parent", label : "Parent"}, // {value : "Parent", label : "Parent"},
...@@ -210,11 +207,8 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -210,11 +207,8 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
case "All": case "All":
//Do Nothing //Do Nothing
break; break;
case "Property": case "Property/Attribute":
$newFieldNameContainer.append(_this._getNewPropertyDropdown()); $newFieldNameContainer.append(_this._getNewMergedDropdown(_this._advancedSearchModel.criteria.entityKind, "OWN"));
break;
case "Attribute":
$newFieldNameContainer.append(_this._getNewAttributeDropdown(_this._advancedSearchModel.criteria.entityKind));
break; break;
case "Sample": case "Sample":
$newFieldNameContainer.append(_this._getNewMergedDropdown(_this._advancedSearchModel.criteria.entityKind, "SAMPLE")); $newFieldNameContainer.append(_this._getNewMergedDropdown(_this._advancedSearchModel.criteria.entityKind, "SAMPLE"));
...@@ -249,7 +243,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -249,7 +243,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
attributesModel.push({ value : "", label : "-------------------------", disabled : true }); attributesModel.push({ value : "", label : "-------------------------", disabled : true });
var propertiesModel = this._getFieldNameProperties(); var propertiesModel = this._getFieldNameProperties();
model = attributesModel.concat(propertiesModel); model = attributesModel.concat(propertiesModel);
var $dropdown = FormUtil.getDropdown(model, "Select a property or attribute"); var $dropdown = FormUtil.getDropdown(model, "Select a property");
$dropdown.change(function() { $dropdown.change(function() {
var $thisComponent = $(this); var $thisComponent = $(this);
//Get uuid and value and update model (type only) //Get uuid and value and update model (type only)
...@@ -295,7 +289,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -295,7 +289,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
this._getNewAttributeDropdown = function(entityKind) { this._getNewAttributeDropdown = function(entityKind) {
var _this = this; var _this = this;
var model = this._getFieldNameAttributesByEntityKind(entityKind); var model = this._getFieldNameAttributesByEntityKind(entityKind);
var $dropdown = FormUtil.getDropdown(model, "Select an attribute"); var $dropdown = FormUtil.getDropdown(model, "Select a property");
$dropdown.change(function() { $dropdown.change(function() {
var $thisComponent = $(this); var $thisComponent = $(this);
//Get uuid and value and update model (type only) //Get uuid and value and update model (type only)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment