Skip to content

Commit

Permalink
simplify dependency ID parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomomdahan committed Nov 12, 2024
1 parent b3e23da commit fd147b5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ function parseDataAttributes(container) {
buildExtId: container.dataset.rerunBuildExtId,
dependencyIds: container.dataset.rerunBuildDependencyIds
.split(",")
.filter(Boolean)
.map(id => parseInt(id, 10))
.map(id => parseInt(id))
};
}

Expand All @@ -17,8 +16,7 @@ function parseTriggerAttributes(container) {
projectName: container.dataset.projectName,
dependencyIds: container.dataset.dependencyIds
.split(",")
.filter(Boolean)
.map(id => parseInt(id, 10))
.map(id => parseInt(id))
};
}

Expand All @@ -30,12 +28,14 @@ function handleDialogClick(dataContainer) {

function handleRerunClick(dataContainer) {
const { id, buildExtId, dependencyIds } = parseDataAttributes(dataContainer);
console.log("dependencyIds", dependencyIds);
buildPipeline.showSpinner(id);
buildPipeline.rerunBuild(id, buildExtId, dependencyIds);
}

function handleTriggerBuild(dataContainer) {
const { id, upstreamProjectName, upstreamBuildNumber, projectName, dependencyIds } = parseTriggerAttributes(dataContainer);
console.log("dependencyIds", dependencyIds);
buildPipeline.showSpinner(id);
buildPipeline.triggerBuild(id, upstreamProjectName, upstreamBuildNumber, projectName, dependencyIds);
}
Expand Down

0 comments on commit fd147b5

Please sign in to comment.