diff --git a/src/pages/DownloadPage.tsx b/src/pages/DownloadPage.tsx index c2c265be..21440ee5 100644 --- a/src/pages/DownloadPage.tsx +++ b/src/pages/DownloadPage.tsx @@ -41,10 +41,10 @@ const DownloadPage = () => {

Scissors Downloads

-
+
-

+

- {jobs.get(Array.from(jobs.keys()).filter(value => value.name == version)[0])?.map(value => { - return - - - - - })} + {jobs.get(Array.from(jobs.keys()).filter(value => value.name == version)[0])?.map(value => { + return + + + + + })}
    {value.changes?.map(value1 => { - return (
  • [{value1.id}]  {value1.comment}
  • ) - })}
{dayjs(value.timestamp!).format("MM/DD/YYYY [at] hh:mm A")}
    {value.changes?.map(value1 => { + return (
  • [{value1.id}]  {value1.comment}
  • ) + })}
{dayjs(value.timestamp!).format("MM/DD/YYYY [at] hh:mm A")}
diff --git a/src/util/Jenkins.ts b/src/util/Jenkins.ts index 005e75be..9ad7bd6a 100644 --- a/src/util/Jenkins.ts +++ b/src/util/Jenkins.ts @@ -32,7 +32,6 @@ export function getJobs(): Promise { }).catch(() => reject) }) } - export function getBuilds(version: string): Promise { let builds: Build[] = [] let request = axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/job/${version}/api/json?pretty=true`) @@ -46,22 +45,30 @@ export function getBuilds(version: string): Promise { let changeSet: any[] = value1.data.changeSets if (changeSet.length > 0) { let changes = changeSet[0].items as BuildChange[] - for (let change of changes) { - change.id = change.id.substring(0, 7) + if (changes.length > 0) { + for (let change of changes) { + change.id = change.id.substring(0, 7) + } } build.changes = changes if (value1.data.artifacts) { let artifacts: any[] = value1.data.artifacts if (artifacts.length > 0) { - build.artifact = value1.data.artifacts[0].relativePath + build.artifact = artifacts[0].relativePath } } - - resolve(builds) + } else { + let changes: BuildChange[] = [] + changes.push({ + id: "x", + comment: "No changes" + }) + build.changes = changes } + + resolve(builds) }) } }).catch(() => reject) }) -} - +} \ No newline at end of file