diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 0f952310b58f9b56e3d2a7c09d9048c9dcd95a97..462a6c0dcc3603c10fa32f637073fc18b94bf1a3 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -69,18 +69,32 @@ function SampleFormView(sampleFormController, sampleFormModel) { //Delete var warningText = null; if(this._sampleFormModel.sample.children.length > 0 || this._sampleFormModel.datasets.length > 0) { - warningText = 'Are you sure you want to move this sample to the trashcan? The next relationships will be broken but the entities will remain.' + warningText = 'Are you sure you want to delete this sample? The next relationships will be broken but the entities will remain.' if(this._sampleFormModel.sample.children.length > 0) { warningText += "\n- The sample has " + this._sampleFormModel.sample.children.length + " children samples:"; - for(var cIdx = 0 ; cIdx < this._sampleFormModel.sample.children.length; cIdx++) { + var numChildrenToShow = this._sampleFormModel.sample.children.length; + if(numChildrenToShow > 10) { + numChildrenToShow = 10; + } + for(var cIdx = 0 ; cIdx < numChildrenToShow; cIdx++) { warningText += "\n\t" + this._sampleFormModel.sample.children[cIdx].code; } + if(numChildrenToShow > 10) { + warningText += "\n\t..."; + } } if(this._sampleFormModel.datasets.length > 0) { warningText += "\n- The sample has " + this._sampleFormModel.datasets.length + " datasets:"; - for(var cIdx = 0 ; cIdx < this._sampleFormModel.datasets.length; cIdx++) { + var numDatasetsToShow = this._sampleFormModel.datasets.length; + if(numDatasetsToShow > 10) { + numDatasetsToShow = 10; + } + for(var cIdx = 0 ; cIdx < numDatasetsToShow; cIdx++) { warningText += "\n\t" + this._sampleFormModel.datasets[cIdx].code; } + if(numDatasetsToShow > 10) { + warningText += "\n\t..."; + } } }