Skip to content
Snippets Groups Projects
Commit 6dfc9763 authored by Juan Fuentes's avatar Juan Fuentes
Browse files

SSDM-7423 : Freezing experiments, basic UI infrastructure + detect feature is...

SSDM-7423 : Freezing experiments, basic UI infrastructure + detect feature is available to show buttons
parent 5fd01ee2
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,16 @@ function ExperimentFormController(mainController, mode, experiment) { ...@@ -20,7 +20,16 @@ function ExperimentFormController(mainController, mode, experiment) {
this._experimentFormView = new ExperimentFormView(this, this._experimentFormModel); this._experimentFormView = new ExperimentFormView(this, this._experimentFormModel);
this.init = function(views) { this.init = function(views) {
this._experimentFormView.repaint(views); var _this = this;
require([ "as/dto/experiment/id/ExperimentPermId", "as/dto/experiment/fetchoptions/ExperimentFetchOptions" ],
function(ExperimentPermId, ExperimentFetchOptions) {
var id = new ExperimentPermId(experiment.permId);
mainController.openbisV3.getExperiments([ id ], new ExperimentFetchOptions()).done(function(map) {
_this._experimentFormModel.v3_experiment = map[id];
_this._experimentFormView.repaint(views);
});
});
} }
this.isDirty = function() { this.isDirty = function() {
......
...@@ -104,6 +104,14 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { ...@@ -104,6 +104,14 @@ function ExperimentFormView(experimentFormController, experimentFormModel) {
toolbarModel.push({ component : $createBtn, tooltip: "Create " + Util.getDisplayNameFromCode(mandatorySampleTypeCode) }); toolbarModel.push({ component : $createBtn, tooltip: "Create " + Util.getDisplayNameFromCode(mandatorySampleTypeCode) });
} }
//Freeze
if(_this._experimentFormModel.v3_experiment.frozen !== undefined) { //Freezing available on the API
var isEntityFrozen = _this._experimentFormModel.v3_experiment.frozen;
var isEntityFrozenTooltip = (isEntityFrozen)?"Entity Frozen":"Freeze Entity (Disable further modifications)";
var $freezeButton = FormUtil.getFreezeButton("EXPERIMENT", this._experimentFormModel.v3_experiment.permId.permId, isEntityFrozen);
toolbarModel.push({ component : $freezeButton, tooltip: isEntityFrozenTooltip });
}
//Edit //Edit
var $editBtn = FormUtil.getButtonWithIcon("glyphicon-edit", function () { var $editBtn = FormUtil.getButtonWithIcon("glyphicon-edit", function () {
mainController.changeView("showEditExperimentPageFromIdentifier", _this._experimentFormModel.experiment.identifier); mainController.changeView("showEditExperimentPageFromIdentifier", _this._experimentFormModel.experiment.identifier);
......
...@@ -94,10 +94,12 @@ function ProjectFormView(projectFormController, projectFormModel) { ...@@ -94,10 +94,12 @@ function ProjectFormView(projectFormController, projectFormModel) {
} }
//Freeze //Freeze
var isEntityFrozen = _this._projectFormModel.v3_project.frozen; if(_this._projectFormModel.v3_project.frozen !== undefined) { //Freezing available on the API
var isEntityFrozenTooltip = (isEntityFrozen)?"Entity Frozen":"Freeze Entity (Disable further modifications)"; var isEntityFrozen = _this._projectFormModel.v3_project.frozen;
var $freezeButton = FormUtil.getFreezeButton("PROJECT", this._projectFormModel.v3_project.permId.permId, isEntityFrozen); var isEntityFrozenTooltip = (isEntityFrozen)?"Entity Frozen":"Freeze Entity (Disable further modifications)";
toolbarModel.push({ component : $freezeButton, tooltip: isEntityFrozenTooltip }); var $freezeButton = FormUtil.getFreezeButton("PROJECT", this._projectFormModel.v3_project.permId.permId, isEntityFrozen);
toolbarModel.push({ component : $freezeButton, tooltip: isEntityFrozenTooltip });
}
//Edit //Edit
var $editBtn = FormUtil.getButtonWithIcon("glyphicon-edit", function () { var $editBtn = FormUtil.getButtonWithIcon("glyphicon-edit", function () {
......
...@@ -41,10 +41,12 @@ function SpaceFormView(spaceFormController, spaceFormModel) { ...@@ -41,10 +41,12 @@ function SpaceFormView(spaceFormController, spaceFormModel) {
toolbarModel.push({ component : $createProj, tooltip: "Create Project" }); toolbarModel.push({ component : $createProj, tooltip: "Create Project" });
//Freeze //Freeze
var isEntityFrozen = _this._spaceFormModel.v3_space.frozen; if(_this._spaceFormModel.v3_space.frozen !== undefined) { //Freezing available on the API
var isEntityFrozenTooltip = (isEntityFrozen)?"Entity Frozen":"Freeze Entity (Disable further modifications)"; var isEntityFrozen = _this._spaceFormModel.v3_space.frozen;
var $freezeButton = FormUtil.getFreezeButton("SPACE", _this._spaceFormModel.v3_space.permId.permId, isEntityFrozen); var isEntityFrozenTooltip = (isEntityFrozen)?"Entity Frozen":"Freeze Entity (Disable further modifications)";
toolbarModel.push({ component : $freezeButton, tooltip: isEntityFrozenTooltip }); var $freezeButton = FormUtil.getFreezeButton("SPACE", _this._spaceFormModel.v3_space.permId.permId, isEntityFrozen);
toolbarModel.push({ component : $freezeButton, tooltip: isEntityFrozenTooltip });
}
//Export //Export
var $exportAll = FormUtil.getExportButton([{ type: "SPACE", permId : _this._spaceFormModel.space.code, expand : true }], false); var $exportAll = FormUtil.getExportButton([{ type: "SPACE", permId : _this._spaceFormModel.space.code, expand : true }], false);
......
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