mirror of
https://github.com/desktop/desktop
synced 2024-11-05 20:49:32 +00:00
Merge pull request #12817 from desktop/fix-cherry-pick-undo
Fix `Undo` link not showing up for cherry-picks
This commit is contained in:
commit
52102a706e
3 changed files with 5 additions and 9 deletions
|
@ -60,7 +60,7 @@ export type Banner =
|
|||
/** number of commits cherry picked */
|
||||
readonly count: number
|
||||
/** callback to run when user clicks undo link in banner */
|
||||
readonly onUndoCherryPick: () => void
|
||||
readonly onUndo: () => void
|
||||
}
|
||||
| {
|
||||
readonly type: BannerType.CherryPickConflictsFound
|
||||
|
|
|
@ -79,7 +79,7 @@ export function renderBanner(
|
|||
targetBranchName={banner.targetBranchName}
|
||||
countCherryPicked={banner.count}
|
||||
onDismissed={onDismissed}
|
||||
onUndoCherryPick={banner.onUndoCherryPick}
|
||||
onUndo={banner.onUndo}
|
||||
/>
|
||||
)
|
||||
case BannerType.CherryPickConflictsFound:
|
||||
|
|
|
@ -5,7 +5,7 @@ interface ISuccessfulCherryPickBannerProps {
|
|||
readonly targetBranchName: string
|
||||
readonly countCherryPicked: number
|
||||
readonly onDismissed: () => void
|
||||
readonly onUndoCherryPick: () => void
|
||||
readonly onUndo: () => void
|
||||
}
|
||||
|
||||
export class SuccessfulCherryPick extends React.Component<
|
||||
|
@ -16,18 +16,14 @@ export class SuccessfulCherryPick extends React.Component<
|
|||
const {
|
||||
countCherryPicked,
|
||||
onDismissed,
|
||||
onUndoCherryPick,
|
||||
onUndo,
|
||||
targetBranchName,
|
||||
} = this.props
|
||||
|
||||
const pluralized = countCherryPicked === 1 ? 'commit' : 'commits'
|
||||
|
||||
return (
|
||||
<SuccessBanner
|
||||
timeout={15000}
|
||||
onDismissed={onDismissed}
|
||||
onUndo={onUndoCherryPick}
|
||||
>
|
||||
<SuccessBanner timeout={15000} onDismissed={onDismissed} onUndo={onUndo}>
|
||||
<span>
|
||||
Successfully copied {countCherryPicked} {pluralized} to{' '}
|
||||
<strong>{targetBranchName}</strong>.
|
||||
|
|
Loading…
Reference in a new issue