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 64837b8c7a08cfb91d6ab2075e94146204d7d89c..7328cf9ee05144c0f1e00353414865dc64131339 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 @@ -13,9 +13,8 @@ ELNDictionary.getExperimentDualName = function() { return ELNDictionary.ExperimentELN + "/" + ELNDictionary.ExperimentInventory; } -ELNDictionary.getExperimentKindName = function(identifier, isPlural) { - var space = IdentifierUtil.getSpaceCodeFromIdentifier(identifier); - if(profile.isInventorySpace(space)) { +ELNDictionary.getExperimentKindName = function(entityType, isPlural) { + if (entityType === "COLLECTION") { return (isPlural)?ELNDictionary.ExperimentsInventory:ELNDictionary.ExperimentInventory; } else { return (isPlural)?ELNDictionary.ExperimentsELN:ELNDictionary.ExperimentELN; diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index 22731e2d8070ddbb6e475a2fb0fd0a19cdd1ff16..82a2c567800ad07e346b6540842f01936cb04b44 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -600,7 +600,7 @@ function MainController(profile) { var experimentTypeCode = argsMap["experimentTypeCode"]; var projectIdentifier = argsMap["projectIdentifier"]; - document.title = "Create " + ELNDictionary.getExperimentKindName(projectIdentifier) + " " + experimentTypeCode; + document.title = "Create " + ELNDictionary.getExperimentKindName(experimentTypeCode) + " " + experimentTypeCode; var experiment = { experimentTypeCode : experimentTypeCode, identifier : projectIdentifier @@ -1180,7 +1180,7 @@ function MainController(profile) { switch (collectionView) { case "FORM_VIEW": { - document.title = "" + ELNDictionary.getExperimentKindName(experimentIdentifier) + " " + + document.title = ELNDictionary.getExperimentKindName(experiment.experimentTypeCode) + " " + experimentIdentifier; _this._showExperimentPage(experiment, FormMode.VIEW); break; @@ -1191,7 +1191,7 @@ function MainController(profile) { } var sampleTableController = new SampleTableController(_this, - "" + ELNDictionary.getExperimentKindName(experimentIdentifier) + " " + + Util.getDisplayNameFromCode(experiment.experimentTypeCode) + " " + experimentIdentifier, experimentIdentifier, null, null, experiment); sampleTableController.init(views); _this.currentView = sampleTableController; 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 7b11bc99b2547b905bf3c10f5fb7dcdef45343eb..9f4e3ab49ddfe68080f112b3aaa5dd51e92b04f7 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 @@ -960,7 +960,7 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { if(data.entityKind === "Sample") { return ELNDictionary.Sample; } else if(data.entityKind === "Experiment") { - return ELNDictionary.getExperimentKindName(data.identifier); + return ELNDictionary.getExperimentKindName(data.entityType); } else { return data.entityKind; } diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js index 2daed66fb06784d16fdc745c92bfda772a1e4e8e..29dc16fe90746a0f3000fb97efc76bd3682059c0 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js @@ -76,7 +76,7 @@ function ExperimentFormController(mainController, mode, experiment) { if(dataExperiment.error) { Util.showError(dataExperiment.error.message); } else { - Util.showSuccess("" + ELNDictionary.getExperimentKindName(_this._experimentFormModel.experiment.identifier) + " moved to Trashcan"); + Util.showSuccess("" + ELNDictionary.getExperimentKindName(_this._experimentFormModel.experiment.experimentTypeCode) + " moved to Trashcan"); //Delete experiment from UI mainController.sideMenu.deleteNodeByEntityPermId(_this._experimentFormModel.experiment.permId, true); @@ -130,10 +130,11 @@ function ExperimentFormController(mainController, mode, experiment) { } var message = ""; + var prefix = ELNDictionary.getExperimentKindName(_this._experimentFormModel.experiment.experimentTypeCode); if(_this._experimentFormModel.mode === FormMode.CREATE) { - message = "" + ELNDictionary.getExperimentKindName(experimentIdentifier) + " Created."; + message = prefix + " Created."; } else if(_this._experimentFormModel.mode === FormMode.EDIT) { - message = "" + ELNDictionary.getExperimentKindName(experimentIdentifier) + " Updated."; + message = prefix + " Updated."; } var callbackOk = function() { diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js index db39838fb47d4831ea9dfb4a27f7616a1cd9aef7..f84c42eec103e0ca03bbb62de6746934b0cf4828 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableView.js @@ -26,10 +26,10 @@ function SampleTableView(sampleTableController, sampleTableModel) { var $title = $("<div>"); if(this._sampleTableModel.title && this._sampleTableModel.experimentIdentifier) { - - var title = "" + ELNDictionary.getExperimentKindName(this._sampleTableModel.experimentIdentifier) + ": " + IdentifierUtil.getCodeFromIdentifier(this._sampleTableModel.experimentIdentifier); + var titlePrefix = Util.getDisplayNameFromCode(this._sampleTableModel.experiment.experimentTypeCode) + ": "; + var title = titlePrefix + IdentifierUtil.getCodeFromIdentifier(this._sampleTableModel.experimentIdentifier); if(this._sampleTableModel.experiment && this._sampleTableModel.experiment.properties[profile.propertyReplacingCode]) { - title = "" + ELNDictionary.getExperimentKindName(this._sampleTableModel.experimentIdentifier) + ": " + this._sampleTableModel.experiment.properties[profile.propertyReplacingCode]; + title = titlePrefix + this._sampleTableModel.experiment.properties[profile.propertyReplacingCode]; } var spaceCode = IdentifierUtil.getSpaceCodeFromIdentifier(this._sampleTableModel.experimentIdentifier);