Skip to content

Commit

Permalink
B #3368: missing datastores import market (#3388)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Lobo <[email protected]>
  • Loading branch information
jloboescalona2 authored and Tino Vázquez committed May 30, 2019
1 parent ed44bca commit e11fa27
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,22 @@ define(function(require) {

/*
CONSTRUCTOR
*/
*/

function getDataStore(formPanelId){
var r = null;
if(formPanelId){
r = new DataStoresTable(
formPanelId + "datastoresTable", {
"select": true,
"selectOptions": {
"filter_fn": function(ds) { return ds.TYPE == DataStore.TYPES.IMAGE_DS; }
}
}
);
}
return r;
}

function FormPanel() {
this.formPanelId = FORM_PANEL_ID;
Expand All @@ -59,13 +74,7 @@ define(function(require) {
}
};

this.datastoresTable = new DataStoresTable(
FORM_PANEL_ID + "datastoresTable", {
"select": true,
"selectOptions": {
"filter_fn": function(ds) { return ds.TYPE == DataStore.TYPES.IMAGE_DS; } // Show system DS only
}
});
this.datastoresTable = getDataStore(FORM_PANEL_ID);

BaseFormPanel.call(this);
}
Expand All @@ -88,16 +97,21 @@ define(function(require) {
function _htmlWizard() {
return TemplateWizardHTML({
"formPanelId": this.formPanelId,
"template": this.type == "VMTEMPLATE",
"datastoresTableHTML": this.datastoresTable.dataTableHTML
});
}

function _onShow(context) {
var placeDataStore = "#placeDatatableDatastore";
Sunstone.disableFormPanelSubmit(TAB_ID);
if(this.type === "VMTEMPLATE"){
this.datastoresTable.dataTable.parents("#placeDatatableDatastore").remove();
if(this.type === "VMTEMPLATE" ){
this.datastoresTable.dataTable.parents(placeDataStore).remove();
}else{
if(!($(placeDataStore).length)){
$("#exportMarketPlaceAppFormWizard").append(this.datastoresTable.dataTableHTML);
this.datastoresTable = getDataStore(FORM_PANEL_ID);
this.datastoresTable.initialize();
}
this.datastoresTable.resetResourceTableSelect();
}
$("#NAME", context).focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@
<input id="VMNAME" type="text" wizard_field="VMNAME"/>
</div>
</div>
{{#unless template}}
<fieldset id="placeDatatableDatastore">
<legend>{{tr "Select the Datastore to store the resource"}}</legend>
{{{datastoresTableHTML}}}
</fieldset>
{{/unless}}
<fieldset id="placeDatatableDatastore">
<legend>{{tr "Select the Datastore to store the resource"}}</legend>
{{{datastoresTableHTML}}}
</fieldset>
</form>

0 comments on commit e11fa27

Please sign in to comment.