CEC-1372 manifest_rejects should be displayed as error (#149)
This commit is contained in:
@@ -8,22 +8,26 @@ import s from "./Statuses";
|
||||
|
||||
const AwaitStatus = -1;
|
||||
const ErrorStatus = -100;
|
||||
const CompleteStatus = 100;
|
||||
|
||||
const PHASES = [
|
||||
{
|
||||
label: "Pending",
|
||||
events: [s.Pending],
|
||||
progress: () => 100,
|
||||
progress: () => CompleteStatus,
|
||||
},
|
||||
{
|
||||
label: "Received",
|
||||
events: [s.ManifestAccepted, s.ManifestReceived, s.ManifestRejected],
|
||||
progress: () => 100,
|
||||
progress: (msg) => {
|
||||
if (msg === s.ManifestRejected) return ErrorStatus;
|
||||
return CompleteStatus;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Precondition",
|
||||
events: [s.PreconditionAwait, s.PreconditionSuceeded],
|
||||
progress: () => 100,
|
||||
progress: () => CompleteStatus,
|
||||
},
|
||||
{
|
||||
label: "Download",
|
||||
@@ -55,14 +59,14 @@ const PHASES = [
|
||||
],
|
||||
progress: (msg, progress) => {
|
||||
if (msg === s.InstallFailed) return ErrorStatus;
|
||||
if (msg === s.PackageInstallCompleted) return 100;
|
||||
if (msg === s.PackageInstallCompleted) return CompleteStatus;
|
||||
return progress;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Updated",
|
||||
events: [s.ManifestSucceeded],
|
||||
progress: (_msg, _progress) => 100,
|
||||
progress: (_msg, _progress) => CompleteStatus,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -84,7 +88,7 @@ const Progress = ({ value, classes }) => {
|
||||
|
||||
const getProgress = (index, phase, progress) => {
|
||||
if (index === phase) return progress;
|
||||
if (index < phase) return 100;
|
||||
if (index < phase) return CompleteStatus;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user