From 3b35680b72fac25471871cbaba738408ae85a349 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Wed, 29 Jun 2022 23:03:04 -0500 Subject: [PATCH] fleek did this --- src/pages/DownloadPage.tsx | 24 ++++++++++++------------ src/util/Jenkins.ts | 23 +++++++++++++++-------- 2 files changed, 27 insertions(+), 20 deletions(-) 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