Skip to content

Commit

Permalink
not an initial install if more than one pending version
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Feb 27, 2024
1 parent 585a74a commit acd2e1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/src/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ export const Utilities = {
return true;
}

if (app.downstream.pendingVersions.length > 1) {
// there's more than one pending version, so it's not an initial install
return false;
}

const firstPendingVersion = app.downstream.pendingVersions[0];
if (
firstPendingVersion.status === "pending_cluster_management" ||
Expand Down
16 changes: 16 additions & 0 deletions web/src/utilities/utilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ describe("Utilities", () => {
expect(Utilities.isInitialAppInstall(app)).toBe(true);
});

it("should return false if there is more than one pending version", () => {
const app = {
downstream: {
pendingVersions: [
{
status: "pending_config",
},
{
status: "pending_config",
},
],
},
};
expect(Utilities.isInitialAppInstall(app)).toBe(false);
});

it("should return true if first pending version has status `pending_cluster_management`, `pending_config`, `pending_preflight`, or `pending_download`", () => {
let app = {
downstream: {
Expand Down

0 comments on commit acd2e1b

Please sign in to comment.