Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Fix: 2094 Enable the ability to clear environment variables #163

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,6 @@ fieldset[disabled] .btn-info.active {
font-size: 2.6em;
}
}
&:only-child {
.controls .remove {
opacity: 0.4;
// disable row clearance on last remaining row
pointer-events: none;
}
}
}

.pane-header {
Expand Down
4 changes: 3 additions & 1 deletion src/js/components/modals/AppModalComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ var AppModalComponent = React.createClass({
// env should not be an array.
if ("env" in modelAttrs) {
modelAttrs.env = modelAttrs.env.reduce(function (memo, item) {
memo[item.key] = item.value;
if (item.key != null && item.key !== "") {
memo[item.key] = item.value;
}
return memo;
}, {});
}
Expand Down
7 changes: 5 additions & 2 deletions src/js/validators/appValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function isValidConstraint(p) {
}

function isNotPositiveNumber(value) {
if (value == null) {
return false;
}
return !value.toString().match(/^[0-9\.]+$/);
}

Expand Down Expand Up @@ -79,7 +82,7 @@ var appValidator = {
} else if (Util.isString(attrs.ports)) {
ports = attrs.ports.split(",");
}
if (!ports.every(function (p) {
if (Util.isArray(ports) && !ports.every(function (p) {
return !isNotPositiveNumber(p.toString().trim());
})) {
errors.push(
Expand All @@ -96,7 +99,7 @@ var appValidator = {
});
});
}
if (!constraints.every(isValidConstraint)) {
if (Util.isArray(constraints) && !constraints.every(isValidConstraint)) {
errors.push(
new ValidationError("constraints",
"Invalid constraints format or operator. Supported operators are " +
Expand Down