mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
Feature #3748: Support request creation wizard
This commit is contained in:
parent
72004d084a
commit
8c1acdc07b
@ -20,7 +20,7 @@ define(function(require) {
|
||||
];
|
||||
|
||||
var _formPanels = [
|
||||
//require('./support-tab/form-panels/create')
|
||||
require('./support-tab/form-panels/create')
|
||||
];
|
||||
|
||||
var Tab = {
|
||||
|
@ -6,7 +6,7 @@ define(function(require) {
|
||||
|
||||
var RESOURCE = "Support";
|
||||
var TAB_ID = require('./tabId');
|
||||
//var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
|
||||
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
|
||||
|
||||
var _actions = {
|
||||
"Support.list" : {
|
||||
@ -60,42 +60,30 @@ define(function(require) {
|
||||
SupportUtils.showSupportConnect();
|
||||
}
|
||||
},
|
||||
/*TODO
|
||||
"Support.create" : {
|
||||
type: "create",
|
||||
call: OpenNebulaSupport.create,
|
||||
callback: function(request, response){
|
||||
$("a[href=back]", $("#support-tab")).trigger("click");
|
||||
popFormDialog("create_support_request_form", $("#support-tab"));
|
||||
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
Sunstone.runAction("Support.refresh");
|
||||
//addTemplateElement(request, response);
|
||||
//notifyCustom(tr("Request created"), " ID: " + response.VMTEMPLATE.ID, false)
|
||||
},
|
||||
error: function(request, error_json){
|
||||
popFormDialog("create_support_request_form", $("#support-tab"));
|
||||
if (error_json.error.http_status=="403") {
|
||||
notifyError(error_json.error.message);
|
||||
Sunstone.hideFormPanelLoading(TAB_ID);
|
||||
Notifier.notifyError(error_json.error.message);
|
||||
} else {
|
||||
$("a[href=back]", $("#support-tab")).trigger("click");
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
SupportUtils.showSupportConnect();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
"Support.create_dialog" : {
|
||||
type: "custom",
|
||||
call: function(){
|
||||
Sunstone.popUpFormPanel(
|
||||
"create_support_request_form",
|
||||
"support-tab",
|
||||
"create",
|
||||
false,
|
||||
function(context){});
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create");
|
||||
}
|
||||
},
|
||||
*/
|
||||
"Support.update" : {
|
||||
type: "single",
|
||||
call: OpenNebulaSupport.update,
|
||||
|
@ -0,0 +1,79 @@
|
||||
define(function(require) {
|
||||
/*
|
||||
DEPENDENCIES
|
||||
*/
|
||||
|
||||
require('foundation.tab');
|
||||
var BaseFormPanel = require('utils/form-panels/form-panel');
|
||||
var Sunstone = require('sunstone');
|
||||
|
||||
/*
|
||||
TEMPLATES
|
||||
*/
|
||||
|
||||
var TemplateWizardHTML = require('hbs!./create/wizard');
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
*/
|
||||
|
||||
var FORM_PANEL_ID = require('./create/formPanelId');
|
||||
var TAB_ID = require('../tabId');
|
||||
|
||||
/*
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function FormPanel() {
|
||||
this.formPanelId = FORM_PANEL_ID;
|
||||
this.tabId = TAB_ID;
|
||||
this.actions = {
|
||||
'create': {
|
||||
'title': "Submit a Request",
|
||||
'buttonText': "Submit",
|
||||
'resetButton': true
|
||||
}
|
||||
};
|
||||
|
||||
BaseFormPanel.call(this);
|
||||
}
|
||||
|
||||
FormPanel.FORM_PANEL_ID = FORM_PANEL_ID;
|
||||
FormPanel.prototype = Object.create(BaseFormPanel.prototype);
|
||||
FormPanel.prototype.constructor = FormPanel;
|
||||
FormPanel.prototype.htmlWizard = _htmlWizard;
|
||||
FormPanel.prototype.submitWizard = _submitWizard;
|
||||
FormPanel.prototype.onShow = _onShow;
|
||||
FormPanel.prototype.setup = _setup;
|
||||
|
||||
return FormPanel;
|
||||
|
||||
/*
|
||||
FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
function _htmlWizard() {
|
||||
return TemplateWizardHTML({
|
||||
'formPanelId': this.formPanelId
|
||||
});
|
||||
}
|
||||
|
||||
function _onShow(context) {
|
||||
}
|
||||
|
||||
function _setup(context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function _submitWizard(context) {
|
||||
var template = {
|
||||
"subject" : $('#subject', context).val(),
|
||||
"description" : $('#description', context).val(),
|
||||
"opennebula_version" : $('#opennebula_version', context).val(),
|
||||
"severity" : $('#severity', context).val(),
|
||||
};
|
||||
|
||||
Sunstone.runAction("Support.create", template);
|
||||
return false;
|
||||
}
|
||||
});
|
@ -0,0 +1,3 @@
|
||||
define(function(require){
|
||||
return 'createSupportRequestForm';
|
||||
});
|
@ -0,0 +1,31 @@
|
||||
<form data-abide="ajax" id="{{formPanelId}}Wizard" class="custom creation">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label for="subject">Subject</label>
|
||||
<input id="subject" type="text" required></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="opennebula_version">OpenNebula Version</label>
|
||||
<input id="opennebula_version" type="text" required></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label for="description">Description</label>
|
||||
<textarea id="description" rows="5" placeholder="Please enter the details of your request. A member of our support staff will respond as soon as possible." required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label for="severity">Subject</label>
|
||||
<select id="severity" name="severity">
|
||||
<option value="severity_1">Severity 1. Product Error: Catastrophic problem in running production systems</option>
|
||||
<option value="severity_2">Severity 2. Product Error: High-impact problem in running production systems</option>
|
||||
<option value="severity_3">Severity 3. Product Error: Low impact problem on a running production system </option>
|
||||
<option value="severity_4" selected>Severity 4. Usage, Design, Configuration, or Integration Question</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
Loading…
x
Reference in New Issue
Block a user