新增发布 artifact validation summary view model
This commit is contained in:
@@ -324,6 +324,59 @@ export function createProjectReleaseReadinessSummaryViewModel(
|
||||
};
|
||||
}
|
||||
|
||||
export function createProjectReleaseReadinessArtifactValidationSummaryViewModel(
|
||||
validation = createProjectReleaseReadinessArtifactValidation(),
|
||||
) {
|
||||
const missing = arrayOrEmpty(validation?.missing);
|
||||
const ready = validation?.ready === true;
|
||||
const statusText = ready ? "Ready" : "Blocked";
|
||||
const detailText = ready
|
||||
? "Artifact evidence complete"
|
||||
: (missing.length > 0 ? missing.join(", ") : "artifact evidence missing");
|
||||
return {
|
||||
apiName: "project-release-readiness-artifact-validation-summary-view-model",
|
||||
viewModelVersion: 1,
|
||||
phase: ready ? "ready" : "blocked",
|
||||
ready,
|
||||
title: "Project release artifact validation",
|
||||
statusText,
|
||||
detailText,
|
||||
statusLine: `${statusText}: ${detailText}`,
|
||||
rows: [
|
||||
{
|
||||
id: "artifact",
|
||||
label: "Readiness artifact",
|
||||
value: validation?.artifactApiName ?? "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-count",
|
||||
label: "Gate count",
|
||||
value: `${validation?.gateCount ?? 0}/${validation?.expectedGateCount ?? 0}`,
|
||||
},
|
||||
{
|
||||
id: "gate-manifest",
|
||||
label: "Gate manifest",
|
||||
value: validation?.gateManifestReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-result-matrix",
|
||||
label: "Gate result matrix",
|
||||
value: validation?.gateResultMatrixReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "gate-action-plan",
|
||||
label: "Gate action plan",
|
||||
value: validation?.gateActionPlanReady === true ? "ready" : "missing",
|
||||
},
|
||||
{
|
||||
id: "missing",
|
||||
label: "Missing artifact evidence",
|
||||
value: missing.length > 0 ? missing.join(", ") : "none",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export function parseProjectReleaseReadinessArtifactJson(text) {
|
||||
return JSON.parse(String(text));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user