fix: [code-1991]: fix small issues in merge message (#2090)

ui/offscreen-diff-contents
Calvin Lee 2024-06-11 06:04:25 +00:00 committed by Harness
parent 4aa055f4e2
commit 7778dc1258
4 changed files with 14 additions and 5 deletions

View File

@ -553,6 +553,7 @@ export interface StringsMap {
manageCredText: string
markAsDraft: string
matchPassword: string
mergeBranchTitle: string
mergeCheckInProgress: string
mergeCommit: string
mergeSetting: string

View File

@ -1174,3 +1174,4 @@ addOptionalCommitMessage: Add (optional) commit message
confirmStrat: 'Confirm {{strat}}'
waiting: Waiting
changesRequestedBy: CHANGES REQUESTED BY
mergeBranchTitle: Merge branch {{branchName}} of {{repoPath}} (#{{prNum}})

View File

@ -9,7 +9,7 @@ import { getErrorMessage, inlineMergeFormValues, type PRMergeOption } from 'util
import { MergeStrategy } from 'utils/GitUtils'
import mergeVideo from '../../../../videos/merge.mp4'
import squashVideo from '../../../../videos/squash.mp4'
import rebaseVideo from '../../../../videos/squash.mp4'
import rebaseVideo from '../../../../videos/rebase.mp4'
import css from './PullRequestActionsBox.module.scss'
interface InlineMergeBoxProps {
inlineMergeRef: React.RefObject<FormikProps<inlineMergeFormValues>>

View File

@ -230,7 +230,14 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
if (pullReqCommits?.commits) {
pullReqCommits?.commits.map(commit => {
messageString += `* ${commit.message}\n`
messageTitle = `${commit.title}`
messageTitle =
mergeOption.method === MergeStrategy.SQUASH
? `${commit.title} (#${pullReqMetadata?.number})`
: getString('mergeBranchTitle', {
branchName: pullReqMetadata?.source_branch,
repoPath: repoMetadata?.path,
prNum: pullReqMetadata?.number
})
})
}
return {
@ -521,12 +528,12 @@ const MergeInfo: React.FC<{ pullRequestMetadata: TypesPullReq }> = ({ pullReques
str={getString('pr.prMergedBannerInfo')}
vars={{
user: (
<Container padding={{ right: 'xsmall' }}>
<Container padding={{ right: 'small' }}>
<strong className={css.boldText}>{pullRequestMetadata.merger?.display_name}</strong>
</Container>
),
source: (
<Container padding={{ left: 'xsmall', right: 'xsmall' }}>
<Container padding={{ left: 'small', right: 'small' }}>
<strong className={cx(css.boldText, css.purpleContainer)}>
<Icon name={CodeIcon.Merged} size={16} color={Color.PURPLE_700} />
{pullRequestMetadata.source_branch}
@ -534,7 +541,7 @@ const MergeInfo: React.FC<{ pullRequestMetadata: TypesPullReq }> = ({ pullReques
</Container>
),
target: (
<Container padding={{ left: 'xsmall', right: 'xsmall' }}>
<Container padding={{ left: 'small', right: 'small' }}>
<strong className={cx(css.boldText, css.purpleContainer)}>
<Icon name={CodeIcon.Merged} size={16} color={Color.PURPLE_700} />
{pullRequestMetadata.target_branch}