1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

Refactor support tab and plugin

This commit is contained in:
Jaime Melis 2016-06-09 12:28:41 +02:00
parent 71daae3011
commit 75c9f54abb
6 changed files with 28 additions and 15 deletions

View File

@ -46,7 +46,12 @@ define(function(require) {
title: TemplateTitle(),
listHeader: 'Commercial Support Requests',
infoHeader: 'Commercial Support Request',
subheader: TemplateSubheader(),
subheader: TemplateSubheader({
'support_subscription': 'http://opennebula.systems/support/',
'account': 'http://opennebula.systems/buy/',
'docs': 'http://docs.opennebula.org/5.0/',
'community': 'http://opennebula.org/support/community/',
}),
buttons: Buttons,
actions: Actions,
dataTable: new Table(DATATABLE_ID, {actions: true, info: true, oneSelection: true}),

View File

@ -70,7 +70,8 @@ define(function(require) {
function _htmlWizard() {
return TemplateWizardHTML({
'formPanelId': this.formPanelId
'formPanelId': this.formPanelId,
'project': "OpenNebula",
});
}

View File

@ -23,7 +23,7 @@
</div>
<div class="row">
<div class="medium-6 columns">
<label for="opennebula_version">OpenNebula Version</label>
<label for="opennebula_version">{{ project }} Version</label>
<input id="opennebula_version" type="text" required></input>
</div>
</div>

View File

@ -28,10 +28,13 @@ define(function(require) {
CONSTANTS
*/
var TAB_ID = require('../tabId');
var PANEL_ID = require('./info/panelId');
var RESOURCE = "Support";
var XML_ROOT = "REQUEST";
var TAB_ID = require('../tabId');
var PANEL_ID = require('./info/panelId');
var RESOURCE = "Support";
var XML_ROOT = "REQUEST";
var AUTHOR_ID = 21231023;
var AUTHOR_NAME = "OpenNebula Support Team";
/*
CONSTRUCTOR

View File

@ -25,7 +25,7 @@
<li><i class="fa-li fa fa-check"></i>Offering hints about how to go around missing features</li>
<li><i class="fa-li fa fa-check"></i>Answering questions about product adaptation and integration</li>
</ul>
<p>For more info on support subcriptions, <a href="http://opennebula.systems/support/" target="_blank">click here</a></p>
<p>For more info on support subcriptions, <a href="{{ support_subscription }}" target="_blank">click here</a></p>
</div>
<div class="medium-6 columns" style="padding: 0px 50px;">
<fieldset>
@ -46,7 +46,7 @@
<p>or</p>
</div>
<div class="large-12 columns">
<a href="http://opennebula.systems/buy/" target="_blank" class="button large-12 radius" style="color: #fff !important">Get an account</a>
<a href="{{ account }}" target="_blank" class="button large-12 radius" style="color: #fff !important">Get an account</a>
</div>
</form>
</fieldset>
@ -60,7 +60,7 @@
<br>
<div class="row">
<div class="medium-6 columns">
<a href="http://docs.opennebula.org/5.0/" target="_blank">
<a href="{{ docs }}" target="_blank">
<span class="fa-stack fa-2x" style="color: #cfcfcf;">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-book fa-stack-1x fa-inverse"></i>
@ -70,7 +70,7 @@
</a>
</div>
<div class="medium-6 columns">
<a href="http://opennebula.org/support/community/" target="_blank">
<a href="{{ community }}" target="_blank">
<span class="fa-stack fa-2x" style="color: #cfcfcf;">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-comments fa-stack-1x fa-inverse"></i>

View File

@ -26,6 +26,9 @@ else
end
helpers do
CUSTOM_FIELD_OPENNEBULA_VERSION = 391130
CUSTOM_FIELD_SEVERITY = 391197
def zendesk_client
client = ZendeskAPI::Client.new do |config|
# Mandatory:
@ -84,11 +87,12 @@ helpers do
"comments" => []
}
zrequest.custom_fields.each { |field|
case field.id
when 391130
when CUSTOM_FIELD_OPENNEBULA_VERSION
one_zrequest["opennebula_version"] = field.value
when 391197
when CUSTOM_FIELD_SEVERITY
one_zrequest["severity"] = field.value
end
}
@ -174,8 +178,8 @@ post '/support/request' do
:subject => body_hash['subject'],
:comment => { :value => body_hash['description'] },
:custom_fields => [
{:id => 391197, :value => body_hash['severity']},
{:id => 391130, :value => body_hash['opennebula_version']}
{:id => CUSTOM_FIELD_SEVERITY, :value => body_hash['severity']},
{:id => CUSTOM_FIELD_OPENNEBULA_VERSION, :value => body_hash['opennebula_version']}
]
})