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

SSDM-5895 : Show minimum content copy info when available

SVN: 39042
parent 717a3203
No related branches found
No related tags found
No related merge requests found
......@@ -21,15 +21,29 @@ function DataSetFormController(parentController, mode, entity, dataSet, isMini)
this.init = function(views) {
var _this = this;
mainController.serverFacade.listDataSetTypes(
function(data) {
mainController.serverFacade.listDataSetTypes(function(data) {
_this._dataSetFormModel.dataSetTypes = data.result;
mainController.serverFacade.getSetting("DataSetFormModel.isAutoUpload", function(value) {
_this._dataSetFormModel.isAutoUpload = (value === "true");
_this._dataSetFormView.repaint(views);
if(mode !== FormMode.CREATE) {
var datasetPermId = dataSet.code;
require([ "as/dto/dataset/id/DataSetPermId", "as/dto/dataset/fetchoptions/DataSetFetchOptions" ],
function(DataSetPermId, DataSetFetchOptions) {
var ids = [new DataSetPermId(datasetPermId)];
var fetchOptions = new DataSetFetchOptions();
fetchOptions.withLinkedData().withExternalDms();
mainController.openbisV3.getDataSets(ids, fetchOptions).done(function(map) {
_this._dataSetFormModel.linkedData = map[datasetPermId].linkedData;
_this._dataSetFormView.repaint(views);
});
});
} else {
_this._dataSetFormView.repaint(views);
}
});
}
);
});
}
this.isDirty = function() {
......
......@@ -31,6 +31,7 @@ function DataSetFormModel(mode, entity, dataSet, isMini) {
} else {
this.dataSet = dataSet;
}
this.linkedData = null;
this.dataSetTypes = null;
this.files = [];
......
......@@ -201,6 +201,20 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) {
$dataSetTypeFieldSet.append(FormUtil.getFieldForLabelWithText(ownerName, owner));
}
//
// Content copies info
//
if(this._dataSetFormModel.linkedData && this._dataSetFormModel.linkedData.contentCopies) {
var $ccn = FormUtil.getFieldForLabelWithText("Number of content copies", "" + this._dataSetFormModel.linkedData.contentCopies.length);
$dataSetTypeFieldSet.append($ccn);
for(var cIdx = 0; cIdx < this._dataSetFormModel.linkedData.contentCopies.length; cIdx++) {
var cc = this._dataSetFormModel.linkedData.contentCopies[cIdx];
var $cc = FormUtil.getFieldForLabelWithText("Content Copy", "" + "External DMS: " + cc.externalDms + " Path:" + cc.path);
$dataSetTypeFieldSet.append($cc);
}
}
//
// Registration and modification info
//
......
......@@ -80,9 +80,20 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor
return false;
}
this.isLinkDataset = function(datasetCode) {
for(var idx = 0; idx < this.datasets.length; idx++) {
if(this.datasets[idx].code === datasetCode && this.datasets[idx].linkDataSet) {
return true;
}
}
return false;
}
this.getDirectDirectoryLink = function(datasetCode, pathInDataSet) {
var directLinkComponent = null;
if(profile.directLinkEnabled && (profile.cifsFileServer || profile.sftpFileServer)) {
if(this.isLinkDataset(datasetCode)) {
directLinkComponent = "<span class='glyphicon glyphicon-link'></span>";
} else if(profile.directLinkEnabled && (profile.cifsFileServer || profile.sftpFileServer)) {
var path = null;
if(this.isExperiment()) {
......
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