diff --git a/web/src/containers/build/Buildset.jsx b/web/src/containers/build/Buildset.jsx index 1e9ca86c77..048a277bc8 100644 --- a/web/src/containers/build/Buildset.jsx +++ b/web/src/containers/build/Buildset.jsx @@ -65,8 +65,8 @@ function Buildset({ buildset, timezone, tenant, user }) { const overallDuration = (moment.utc(lastEndBuild.end_time).tz(timezone) - moment.utc( - buildset.event_timestamp!=null - ? buildset.event_timestamp : firstStartBuild.start_time + buildset.event_timestamp != null + ? buildset.event_timestamp : firstStartBuild.start_time ).tz(timezone) ) / 1000 @@ -177,15 +177,15 @@ function Buildset({ buildset, timezone, tenant, user }) { } function enqueueConfirm() { - let changeId = buildset.change ? buildset.change + ',' + buildset.patchset : buildset.newrev setShowEnqueueModal(false) - if (/^[0-9a-f]{40}$/.test(changeId)) { + if (buildset.change === null) { const oldrev = '0000000000000000000000000000000000000000' - enqueue_ref(tenant.apiPrefix, buildset.project, buildset.pipeline, buildset.ref, oldrev, changeId, user.token) + const newrev = buildset.newrev ? buildset.newrev : '0000000000000000000000000000000000000000' + enqueue_ref(tenant.apiPrefix, buildset.project, buildset.pipeline, buildset.ref, oldrev, newrev, user.token) .then(() => { dispatch(addNotification( { - text: 'Change queued successfully.', + text: 'Enqueue successful.', type: 'success', status: '', url: '', @@ -195,6 +195,7 @@ function Buildset({ buildset, timezone, tenant, user }) { dispatch(addApiError(error)) }) } else { + const changeId = buildset.change + ',' + buildset.patchset enqueue(tenant.apiPrefix, buildset.project, buildset.pipeline, changeId, user.token) .then(() => { dispatch(addNotification( @@ -213,6 +214,9 @@ function Buildset({ buildset, timezone, tenant, user }) { function renderEnqueueModal() { let changeId = buildset.change ? buildset.change + ',' + buildset.patchset : buildset.newrev + let changeInfo = changeId + ? <>for change {changeId} + : <>for ref {buildset.ref} const title = 'You are about to re-enqueue a change' return ( Confirm, , ]}> -

Please confirm that you want to re-enqueue all jobs for change {changeId} (project {buildset.project}) on pipeline {buildset.pipeline}.

+

Please confirm that you want to re-enqueue all jobs {changeInfo} on project {buildset.project} on pipeline {buildset.pipeline}.

) }