Fix web dequeue of post items
This is a partial revert of 6c1c91f8ba
which relied on change.id being absent in the case that a queue item
was for a non-change ref; however, all queue items have an id. This
reverts that section of code back to the previous regex-based
heuristic.
Change-Id: I07ff7c2925b44a7e85529491755b2f3d3f73eaf8
This commit is contained in:
parent
4680c58a27
commit
c92b2c2221
|
@ -75,7 +75,16 @@ class Item extends React.Component {
|
|||
let refRef = ref.ref
|
||||
this.setState(() => ({ showDequeueModal: false }))
|
||||
// post-merge
|
||||
if (refId !== 'N/A') {
|
||||
if (/^[0-9a-f]{40}$/.test(refId)) {
|
||||
dequeue_ref(tenant.apiPrefix, projectName, pipeline.name, refRef)
|
||||
.then(() => {
|
||||
this.props.dispatch(fetchStatusIfNeeded(tenant))
|
||||
})
|
||||
.catch(error => {
|
||||
this.props.dispatch(addDequeueError(error))
|
||||
})
|
||||
// pre-merge, ie we have a change id
|
||||
} else if (refId !== 'N/A') {
|
||||
dequeue(tenant.apiPrefix, projectName, pipeline.name, refId)
|
||||
.then(() => {
|
||||
this.props.dispatch(fetchStatusIfNeeded(tenant))
|
||||
|
@ -84,13 +93,12 @@ class Item extends React.Component {
|
|||
this.props.dispatch(addDequeueError(error))
|
||||
})
|
||||
} else {
|
||||
dequeue_ref(tenant.apiPrefix, projectName, pipeline.name, refRef)
|
||||
.then(() => {
|
||||
this.props.dispatch(fetchStatusIfNeeded(tenant))
|
||||
})
|
||||
.catch(error => {
|
||||
this.props.dispatch(addDequeueError(error))
|
||||
})
|
||||
this.props.dispatch(addNotification({
|
||||
url: null,
|
||||
status: 'Invalid change ' + refRef + ' on project ' + projectName,
|
||||
text: '',
|
||||
type: 'error',
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue