diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/etc/InstanceProfile.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/etc/InstanceProfile.js index ee60632ee6d7e2154b6757b5ed0fe9c281b4ec1d..c30511b0e86d6f278bc474877cc16627cec934cc 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/etc/InstanceProfile.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/etc/InstanceProfile.js @@ -15,6 +15,7 @@ $.extend(InstanceProfile.prototype, StandardProfile.prototype, { // this.singleSignOnLinkLabel = "Login with SWITCHaai"; // END ANSIBLE MANAGED BLOCK (sso) this.hideSectionsByDefault = true; + this.showSemanticAnnotations = true; this.minBarcodeLength = 10; this.barcodePattern = /^[-a-z0-9]+$/i this.docuBaseUrl = "https://unlimited.ethz.ch/display/openBISDoc2010"; diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js index c17f5213636e90fb5d43793cce6eef1e4bfa337d..0926b446573c0f67b21b79941b052d34b1f2c699 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/SettingsManager.js @@ -236,11 +236,11 @@ function SettingsManager(serverFacade) { } // Miscellaneous - var miscellaneousFields = ["hideSectionsByDefault", "showDatasetArchivingButton"] + var miscellaneousFields = ["hideSectionsByDefault", "showSemanticAnnotations", "showDatasetArchivingButton"] for(var miscellaneousField of miscellaneousFields) { if(isMergeGroup && targetProfile[miscellaneousField] != undefined) { // Merge found values targetProfile[miscellaneousField] = targetProfile[miscellaneousField] || settings[miscellaneousField]; - } else { // Replaces or sets value + } else if (settings[miscellaneousField] != undefined) { // Replaces or sets value targetProfile[miscellaneousField] = settings[miscellaneousField]; } } 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 32377af9d1e94506ff33702da6dbc8469af552b0..ce5999ac69abb1394cac8a457a7f3df3e628b9ee 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 @@ -2754,7 +2754,7 @@ function ServerFacade(openbisServer) { var fetchOptions = new SampleFetchOptions(); fetchOptions.withSpace(); fetchOptions.withType(); - if (fechOptions["withSemanticAnnotations"]) { + if (fechOptions["withSemanticAnnotations"] && profile.showSemanticAnnotations != false) { fetchOptions.withType().withSemanticAnnotations(); fetchOptions.withType().withPropertyAssignments().withSemanticAnnotations(); fetchOptions.withType().withPropertyAssignments().withPropertyType().withSemanticAnnotations(); diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 8cbea659f91e3109b39ca4d9ec362dbcd6d480d2..e7a9d22e87d6731c983a3bebf32cf6608d820a33 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -675,11 +675,14 @@ function SampleFormView(sampleFormController, sampleFormModel) { $legend.remove(); } + var showSemanticAnnotations = profile.showSemanticAnnotations; var propertyGroupPropertiesOnForm = 0; for(var j = 0; j < propertyTypeGroup.propertyTypes.length; j++) { var propertyType = propertyTypeGroup.propertyTypes[j]; var propertyTypeV3 = profile.getPropertyTypeFromSampleTypeV3(this._sampleFormModel.sampleType, propertyType.code); - var semanticAnnotations = this._renderPropertyTypeSemanticAnnotations(this._sampleFormModel.sample.propertyTypesSemanticAnnotations[propertyTypeV3.code]); + if (this._sampleFormModel.sample.propertyTypesSemanticAnnotations) { + var semanticAnnotations = this._renderPropertyTypeSemanticAnnotations(this._sampleFormModel.sample.propertyTypesSemanticAnnotations[propertyTypeV3.code]); + } FormUtil.fixStringPropertiesForForm(propertyTypeV3, this._sampleFormModel.sample); if(!propertyType.showInEditViews && (this._sampleFormModel.mode === FormMode.EDIT || this._sampleFormModel.mode === FormMode.CREATE) && propertyType.code !== "$XMLCOMMENTS") { //Skip continue; diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js index c206fd160ac60faa16721dc6ca20fb9c9391aa1a..46323c4f285f9bb58dfcab1a26dee5bedef88b5c 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormController.js @@ -39,6 +39,9 @@ function SettingsFormController(mainController, settingsSample, mode) { newProfile["inventorySpacesReadOnly"] = profile.inventorySpacesReadOnlyPostFixes; profileToEdit = newProfile; } + if (!("showSemanticAnnotations" in profileToEdit)) { + profileToEdit["showSemanticAnnotations"] = profile.showSemanticAnnotations; + } require(["as/dto/sample/id/SampleIdentifier"], function(SampleIdentifier) { var sampId = new SampleIdentifier(settingsSample.identifier); diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js index 562ecd9ad41772d75ec95cda8fa9e90bd8feaddf..69d51b36cad138563190f06f6cc08856f2b8cfd9 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js @@ -129,6 +129,7 @@ function SettingsFormView(settingsFormController, settingsFormModel) { mainMenu : this._mainMenuItemsTableModel.getValues(), sampleTypeDefinitionsExtension : this._getSampleTypeDefinitionsExtension(), showDatasetArchivingButton : this._miscellaneousTableModel.getValues()["Show Dataset archiving button"], + showSemanticAnnotations : this._miscellaneousTableModel.getValues()["Show Semantic Annotations"], hideSectionsByDefault : this._miscellaneousTableModel.getValues()["Hide sections by default"], inventorySpaces : this._inventorySpacesTableModel.getValues(), inventorySpacesReadOnly : this._inventorySpacesReadOnlyTableModel.getValues() @@ -556,6 +557,10 @@ function SettingsFormView(settingsFormController, settingsFormModel) { label : "Show Dataset archiving button", enabled : this._profileToEdit.showDatasetArchivingButton }); + tableModel.addRow({ + label : "Show Semantic Annotations", + enabled : this._profileToEdit.showSemanticAnnotations + }); tableModel.addRow({ label : "Hide sections by default", enabled : this._profileToEdit.hideSectionsByDefault