Skip to content

Commit

Permalink
Merge pull request #574 from mesosphere/fix/3054-app-form-dialog
Browse files Browse the repository at this point in the history
Fix - 3054 app form dialog
  • Loading branch information
Orlando Hohmeier committed Jan 22, 2016
2 parents 7d5e136 + 8a87e37 commit 4527b66
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/js/stores/transforms/AppFormModelPostProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ const AppFormModelPostProcess = {
}
}
},
fetch: (app) => {
// This is a quickfix for mesosphere/marathon#3054
// Please remove this after there is a better solution
if (Util.isArray(app.fetch) && Util.isArray(app.uris)) {
if (app.fetch.length === 0) {
delete app.fetch;
} else if (app.uris.length === 0) {
delete app.uris;
}
}
},
healthChecks: (app) => {
var healthChecks = app.healthChecks;

Expand Down
20 changes: 20 additions & 0 deletions src/test/appFormModelPostProcess.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,28 @@ describe("App Form Model Post Process", function () {

});

});

it("only contains an uris array", function () {
var app = {
fetch: [],
uris: ["test"]
};

AppFormModelPostProcess.fetch(app);

expect(app.fetch).to.be.undefined;
});

it("only contains an fetch array", function () {
var app = {
fetch: ["test"],
uris: []
};

AppFormModelPostProcess.fetch(app);

expect(app.uris).to.be.undefined;
});

});

0 comments on commit 4527b66

Please sign in to comment.