From e8de6db70e0b8bfd3ca3d07fe928a1facd10c088 Mon Sep 17 00:00:00 2001 From: vkovtun <vkovtun@ethz.ch> Date: Wed, 7 Jun 2023 16:33:40 +0200 Subject: [PATCH] SSDM-13693: Added samples column to the results of the advanced search view. --- .../1/as/webapps/eln-lims/html/js/config/ELNDictionary.js | 5 +++++ .../1/as/webapps/eln-lims/html/js/server/ServerFacade.js | 7 +++++++ .../js/views/AdvancedSearch/AdvancedSearchController.js | 5 +++-- .../html/js/views/AdvancedSearch/AdvancedSearchView.js | 6 ++++++ .../html/js/views/ArchivingHelper/ArchivingHelperView.js | 1 - .../js/views/UnarchivingHelper/UnarchivingHelperView.js | 1 - 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/ELNDictionary.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/ELNDictionary.js index 78227982906..98bf8f4477c 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/ELNDictionary.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/ELNDictionary.js @@ -3,12 +3,17 @@ var ELNDictionary = { Samples : "Objects", sample : "object", samples : "objects", + SampleELN : "Sample", ExperimentELN : "Experiment", ExperimentCollection : "Collection", ExperimentsELN : "Experiments", ExperimentsCollection : "Collections" } +ELNDictionary.getSampleDualName = function() { + return ELNDictionary.SampleELN + "/" + ELNDictionary.Sample; +} + ELNDictionary.getExperimentDualName = function() { return ELNDictionary.ExperimentELN + "/" + ELNDictionary.ExperimentCollection; } diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index 4725035616a..b8b0a29f418 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -2074,6 +2074,13 @@ function ServerFacade(openbisServer) { break; } break; + case "SAMPLE_CODE": + switch (comparisonOperator) { + case 'thatContains': + criteria.withSample().withCode().thatContains(attributeValue) + break + } + break case "EXPERIMENT_IDENTIFIER": if(!comparisonOperator) { comparisonOperator = "thatEquals"; diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js index 54e5d69ce19..3c97b387f6b 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchController.js @@ -19,7 +19,6 @@ function AdvancedSearchController(mainController, forceSearch) { this._advancedSearchModel = new AdvancedSearchModel(forceSearch); this._advancedSearchView = new AdvancedSearchView(this, this._advancedSearchModel); this.additionalRules = []; - this.fetchWithSample = false; this.enrichResultsFunction = function(results, callback) { callback(results); } @@ -192,7 +191,7 @@ function AdvancedSearchController(mainController, forceSearch) { fetchOptions.withExperiment = true; fetchOptions.withParents = false; fetchOptions.withChildren = false; - fetchOptions.withSample = _this.fetchWithSample; + fetchOptions.withSample = true; optionsSearch = JSON.stringify({ searchMode: options.searchMode, searchMap: options.searchMap, @@ -246,6 +245,8 @@ function AdvancedSearchController(mainController, forceSearch) { gridSubcriteria.rules[Util.guid()] = { type : "Attribute", name : "ENTITY_TYPE", value : search, operator: "thatContains" }; }else if(field === "experiment"){ gridSubcriteria.rules[Util.guid()] = { type : "Attribute", name : "EXPERIMENT_CODE", value : search, operator: "thatContains" }; + }else if(field === "sample"){ + gridSubcriteria.rules[Util.guid()] = { type : "Attribute", name : "SAMPLE_CODE", value : search, operator: "thatContains" }; }else if(field === "code"){ gridSubcriteria.rules[Util.guid()] = { type : "Attribute", name : "CODE", value : search, operator: "thatContains" }; }else if(field === "identifier"){ diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js index cee65ded8e4..e067afb67cf 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/AdvancedSearch/AdvancedSearchView.js @@ -1072,6 +1072,12 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { exportableProperty: DataGridExportOptions.EXPORTABLE_FIELD.EXPERIMENT, filterable: !isGlobalSearch, sortable : false + }, { + label : ELNDictionary.getSampleDualName(), + property : 'sample', + exportableProperty: DataGridExportOptions.EXPORTABLE_FIELD.SAMPLE, + filterable: !isGlobalSearch, + sortable : false }]); if (criteria.entityKind === "DATASET") { diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js index bf666d86389..b8b22005f3d 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ArchivingHelper/ArchivingHelperView.js @@ -48,7 +48,6 @@ function ArchivingHelperView(archivingHelperController, archivingHelperModel) { searchView.configKeyPrefix += "ARCHIVING_HELPER_"; // searchView.suppressedColumns = ['entityKind', 'identifier']; searchView.hideByDefaultColumns = ['$NAME', 'registrator', 'modificationDate', 'modifier']; - searchController.fetchWithSample = true; searchView.firstColumns = [{ label : "Should be archived", property : "archive", diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UnarchivingHelper/UnarchivingHelperView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UnarchivingHelper/UnarchivingHelperView.js index a01333db0c9..78e50b1f27a 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UnarchivingHelper/UnarchivingHelperView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UnarchivingHelper/UnarchivingHelperView.js @@ -85,7 +85,6 @@ function UnarchivingHelperView(unarchivingHelperController, unarchivingHelperMod searchView.configKeyPrefix += "UNARCHIVING_HELPER_"; searchView.suppressedColumns = ['entityKind', 'identifier']; searchView.hideByDefaultColumns = ['$NAME', 'bundle', 'registrator', 'modificationDate', 'modifier']; - searchController.fetchWithSample = true; searchView.firstColumns = [{ label : "Should be unarchived", property : "unarchive", -- GitLab