Update murano-dashboard eslint devDependencies

Synchronize the eslint and eslint-config-openstack versions with horizon.

Change-Id: I117d1e5e418183cc72048a889acbd825a240cfe0
This commit is contained in:
zhurong 2016-09-21 09:54:40 +08:00
parent 8c9f0e87ae
commit ed344e55aa
9 changed files with 74 additions and 55 deletions

View File

@ -15,6 +15,25 @@ globals:
# allow passing TENANT_ID from django templates
TENANT_ID: false
# Below we adjust rules specific to horizon's usage of openstack's linting
# rules, and its own plugin inclusions.
rules:
#############################################################################
# Disabled Rules from eslint-config-openstack
#############################################################################
valid-jsdoc: [1, {
requireParamDescription: false
}]
no-undefined: 1
brace-style: 1
no-extra-parens: 1
callback-return: 1
block-scoped-var: 1
quote-props: 0
space-in-parens: 1
no-use-before-define: 1
no-unneeded-ternary: 1
# Only support ECMA5, disable everything else.
# NOTE(kzaitsev): blatantly copied from horizon
ecmaFeatures:

View File

@ -17,11 +17,11 @@ $(function() {
"use strict";
var plus = "<i class='fa fa-plus-circle'></i>";
if ( typeof window.murano === "undefined" ) {
if (typeof window.murano === "undefined") {
window.murano = {};
}
if ( !window.murano.bind_add_item_handlers ) {
if (!window.murano.bind_add_item_handlers) {
window.murano.bind_add_item_handlers = true;
horizon.modals.addModalInitFunction(initPlusButton);
@ -37,13 +37,13 @@ $(function() {
var urls, link, $choices;
try {
urls = $.parseJSON($this.attr("data-add-item-url"));
} catch(err) {
} catch (err) {
if (window.console) {
window.console.log(err);
}
}
if ( urls && urls[0].length ) {
if ( urls.length === 1 ) {
if (urls && urls[0].length) {
if (urls.length === 1) {
link = $this.next().find('a');
link.html(plus);
link.attr('href', urls[0][1]);
@ -62,9 +62,9 @@ $(function() {
$this.next('span').append($choices);
}
}
if ( $this.hasClass('murano_add_select') ) {
if ($this.hasClass('murano_add_select')) {
// NOTE(tsufiev): hide selectbox in case it contains no elements
if ( this.options.length === 1 ) {
if (this.options.length === 1) {
$this.hide();
$this.next('span').removeClass('input-group-btn').find('i').text(
' Add Application');
@ -72,7 +72,7 @@ $(function() {
// NOTE(tsufiev): show hidden select once the new option was added to it
// programmatically (on return from the finished modal dialog)
$this.change(function() {
if ( !$this.is(':visible') && this.options.length > 1 ) {
if (!$this.is(':visible') && this.options.length > 1) {
$this.show();
$this.next('span').addClass('input-group-btn').find('i').text('');
$this.val($(this.options[1]).val());

View File

@ -241,9 +241,9 @@ $(function() {
modalContent.append(button);
$('.modal-close button').tooltip();
$('.modal-close button').on("click", function () {
window.clearInterval(intervalId);
document.location = $form.attr('action');
});
window.clearInterval(intervalId);
document.location = $form.attr('action');
});
if (startUrl) {
$.ajax({
type: 'POST',
@ -255,7 +255,7 @@ $(function() {
},
error: handleError
});
if ( resultUrl ) {
if (resultUrl) {
intervalId = window.setInterval(function () {
// it's better to avoid placing the whole downloadable content

View File

@ -42,7 +42,7 @@ $(function() {
var $form = $(data).find('form');
var $name = $form.find('div.form-group');
$name.addClass("col-md-6");
if ( validationFailed ) {
if (validationFailed) {
$thead.find('tr.new_env').remove();
}
@ -83,7 +83,7 @@ $(function() {
gettext("There was an error submitting the form. Please try again."));
},
success: function(data, status, xhr) {
if ( data === '' ) {
if (data === '') {
// environment was created successfully
var redirUrl = xhr.getResponseHeader('X-Horizon-Location');
$newEnvTr.remove();

View File

@ -18,13 +18,13 @@ $(function() {
var checked = $("input[id*='externalAD']").prop('checked');
if (checked === true) {
$("select[id*='-domain']").attr("disabled", "disabled");
$("label[for*='domainAdminUserName']").parent().css({'display': 'inline-block'});
$("label[for*='domainAdminPassword']").parent().css({'display': 'inline-block'});
$("label[for*='domainAdminUserName']").parent().css({"display": 'inline-block'});
$("label[for*='domainAdminPassword']").parent().css({"display": 'inline-block'});
}
if (checked === false) {
$("select[id*='-domain']").removeAttr("disabled");
$("label[for*='domainAdminUserName']").parent().css({'display': 'none'});
$("label[for*='domainAdminPassword']").parent().css({'display': 'none'});
$("label[for*='domainAdminUserName']").parent().css({"display": 'none'});
$("label[for*='domainAdminPassword']").parent().css({"display": 'none'});
}
}

View File

@ -56,46 +56,46 @@ $(function() {
function update() {
node = node.data(nodes, function(d) {
return d.id;
});
return d.id;
});
link = link.data(links);
var nodeEnter = node.enter().append("g")
.attr("class", "node")
.attr("node_name", function(d) {
return d.name;
})
return d.name;
})
.attr("node_id", function(d) {
return d.id;
})
return d.id;
})
.call(force.drag);
nodeEnter.append("image")
.attr("xlink:href", function(d) {
return d.image;
})
return d.image;
})
.attr("id", function(d) {
return "image_" + d.id;
})
return "image_" + d.id;
})
.attr("x", function(d) {
return d.image_x;
})
return d.image_x;
})
.attr("y", function(d) {
return d.image_y;
})
return d.image_y;
})
.attr("width", function(d) {
return d.image_size;
})
return d.image_size;
})
.attr("height", function(d) {
return d.image_size;
})
return d.image_size;
})
.attr("clip-path", "url(#clipCircle)");
node.exit().remove();
link.enter().insert("path", "g.node")
.attr("class", function(d) {
return "link " + d.link_type;
});
return "link " + d.link_type;
});
link.exit().remove();
//Setup click action for all nodes
@ -117,8 +117,8 @@ $(function() {
function tick() {
link.attr('d', drawLink).style('stroke-width', 3).attr('marker-end', "url(#end)");
node.attr("transform", function(d) {
return "translate(" + d.x + "," + d.y + ")";
});
return "translate(" + d.x + "," + d.y + ")";
});
}
function setInProgress(stack, innerNodes) {
@ -192,7 +192,7 @@ $(function() {
//make sure target node exists
try {
targetIdx = findNodeIndex(innerNode.required_by[j]);
} catch(err) {
} catch (err) {
if (window.console) {
window.console.log(err);
}
@ -208,10 +208,10 @@ $(function() {
if (pushLink === true && (sourceIdx && targetIdx)) {
links.push({
'target': sourceIdx,
'source': targetIdx,
'value': 1,
'link_type': innerNode.link_type
"target": sourceIdx,
"source": targetIdx,
"value": 1,
"link_type": innerNode.link_type
});
}
}
@ -225,10 +225,10 @@ $(function() {
//if new node is required by existing node, push new link
if (innerNode.id === dependency) {
links.push({
'target': findNodeIndex(nodes[i].id),
'source': findNodeIndex(innerNode.id),
'value': 1,
'link_type': nodes[i].link_type
"target": findNodeIndex(nodes[i].id),
"source": findNodeIndex(innerNode.id),
"value": 1,
"link_type": nodes[i].link_type
});
}
}

View File

@ -16,10 +16,10 @@ $(function() {
"use strict";
function checkMixedMode() {
var checked = $("input[id*='mixedModeAuth']").prop('checked');
if ( checked === true) {
$("label[for*='saPassword']").parent().css({'display': 'inline-block'});
if (checked === true) {
$("label[for*='saPassword']").parent().css({"display": 'inline-block'});
} else if (checked === false) {
$("label[for*='saPassword']").parent().css({'display': 'none'});
$("label[for*='saPassword']").parent().css({"display": 'none'});
}
}

View File

@ -64,7 +64,7 @@
*/
function getPackages(params) {
var config = params ? { 'params' : params} : {};
var config = params ? { "params" : params} : {};
return apiService.get('/api/app-catalog/packages/', config)
.error(function () {
toastService.add('error', gettext('Unable to retrieve the packages.'));

View File

@ -6,8 +6,8 @@
"repository": "none",
"license": "Apache 2.0",
"devDependencies": {
"eslint": "1.2.1",
"eslint-config-openstack": "1.2.3"
"eslint": "1.10.3",
"eslint-config-openstack": "1.2.4"
},
"scripts": {
"lint": "eslint --no-color muranodashboard/static"