diff --git a/web/src/components/BranchProtection/BranchProtectionForm/BranchProtectionForm.tsx b/web/src/components/BranchProtection/BranchProtectionForm/BranchProtectionForm.tsx index 629d106d5..7b163f8b6 100644 --- a/web/src/components/BranchProtection/BranchProtectionForm/BranchProtectionForm.tsx +++ b/web/src/components/BranchProtection/BranchProtectionForm/BranchProtectionForm.tsx @@ -166,6 +166,9 @@ const BranchProtectionForm = (props: { const isRebasePresent = (rule.definition as ProtectionBranch)?.pullreq?.merge?.strategies_allowed?.includes( MergeStrategy.REBASE ) + const isFFMergePresent = (rule.definition as ProtectionBranch)?.pullreq?.merge?.strategies_allowed?.includes( + MergeStrategy.FAST_FORWARD + ) // List of strings to be included in the final array const includeList = (rule?.pattern as ProtectionPattern)?.include ?? [] const excludeList = (rule?.pattern as ProtectionPattern)?.exclude ?? [] @@ -201,6 +204,7 @@ const BranchProtectionForm = (props: { mergeCommit: isMergePresent, squashMerge: isSquashPresent, rebaseMerge: isRebasePresent, + fastForwardMerge: isFFMergePresent, autoDelete: (rule.definition as ProtectionBranch)?.pullreq?.merge?.delete_branch, blockBranchCreation: (rule.definition as ProtectionBranch)?.lifecycle?.create_forbidden, blockBranchUpdate: @@ -244,7 +248,8 @@ const BranchProtectionForm = (props: { const stratArray = [ formData.squashMerge && MergeStrategy.SQUASH, formData.rebaseMerge && MergeStrategy.REBASE, - formData.mergeCommit && MergeStrategy.MERGE + formData.mergeCommit && MergeStrategy.MERGE, + formData.fastForwardMerge && MergeStrategy.FAST_FORWARD ].filter(Boolean) as EnumMergeMethod[] const includeArray = formData?.targetList?.filter(([type]) => type === 'include').map(([, value]) => value) ?? [] diff --git a/web/src/components/BranchProtection/BranchProtectionForm/ProtectionRulesForm/ProtectionRulesForm.tsx b/web/src/components/BranchProtection/BranchProtectionForm/ProtectionRulesForm/ProtectionRulesForm.tsx index 07f6ebb2e..00aa2c19e 100644 --- a/web/src/components/BranchProtection/BranchProtectionForm/ProtectionRulesForm/ProtectionRulesForm.tsx +++ b/web/src/components/BranchProtection/BranchProtectionForm/ProtectionRulesForm/ProtectionRulesForm.tsx @@ -269,6 +269,11 @@ const ProtectionRulesForm = (props: { + )} diff --git a/web/src/framework/strings/stringTypes.ts b/web/src/framework/strings/stringTypes.ts index 44200474f..a30bc9bd5 100644 --- a/web/src/framework/strings/stringTypes.ts +++ b/web/src/framework/strings/stringTypes.ts @@ -424,6 +424,7 @@ export interface StringsMap { failedToFetchFileContent: string failedToImportSpace: string failedToSavePipeline: string + fastForwardMerge: string featureRoadmap: string fileDeleted: string fileTooLarge: string @@ -801,6 +802,8 @@ export interface StringsMap { 'pr.mergeOptions.createAMergeCommit': string 'pr.mergeOptions.createMergeCommit': string 'pr.mergeOptions.createMergeCommitDesc': string + 'pr.mergeOptions.fastForwardMerge': string + 'pr.mergeOptions.fastForwardMergeDesc': string 'pr.mergeOptions.rebaseAndMerge': string 'pr.mergeOptions.rebaseAndMergeDesc': string 'pr.mergeOptions.squashAndMerge': string @@ -825,6 +828,7 @@ export interface StringsMap { 'pr.prStateChanged': string 'pr.prStateChangedDraft': string 'pr.readyForReview': string + 'pr.rebaseMergePossible': string 'pr.removeSuggestion': string 'pr.requestSubmitted': string 'pr.requestedChanges': string @@ -995,6 +999,7 @@ export interface StringsMap { 'securitySettings.vulnerabilityScanning': string 'securitySettings.vulnerabilityScanningDesc': string seeNMoreMatches: string + selectAuthor: string selectBranchPlaceHolder: string selectLanguagePlaceholder: string selectMergeStrat: string diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 254e29811..72e52364f 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -302,6 +302,7 @@ pr: reviewChanges: Review changes mergePR: Merge pull request branchHasNoConflicts: Pull request can be merged + rebaseMergePossible: Pull request can be merged after rebase checkingToMerge: Checking for ability to merge automatically... prCanBeMerged: Mergeing can be performed automatically. enterDesc: Enter description here @@ -341,6 +342,8 @@ pr: createMergeCommitDesc: All commits from this branch will be added to the base branch via a merge commit. rebaseAndMerge: Rebase and merge rebaseAndMergeDesc: All commits from this branch will be rebased and added to the base branch. + fastForwardMerge: Fast-forward merge + fastForwardMergeDesc: All commits from this branch will be added to the base branch without a merge commit. Rebase may be required. close: Close pull request closeDesc: Close this pull request. You can still re-open the request after closing. createAMergeCommit: Create a merge commit @@ -539,6 +542,7 @@ zoomIn: Zoom In zoomOut: Zoom Out checks: Checks blameCommitLine: '{author} committed {timestamp}' +selectAuthor: Select Author tooltipRepoEdit: You are not authorized to {PERMS} missingPerms: 'You are missing the following permission:' createRepoPerms: 'Create / Edit Repository' @@ -964,6 +968,7 @@ setting: Setting mergeCommit: Merge commit squashMerge: Squash and merge rebaseMerge: Rebase and merge +fastForwardMerge: Fast-forward merge Enable: Enable imageUpload: title: Upload attachment diff --git a/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/InlineMergeBox.tsx b/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/InlineMergeBox.tsx index d1a0550ab..9875e4c06 100644 --- a/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/InlineMergeBox.tsx +++ b/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/InlineMergeBox.tsx @@ -27,6 +27,7 @@ import { MergeStrategy } from 'utils/GitUtils' import mergeVideo from '../../../../videos/merge.mp4' import squashVideo from '../../../../videos/squash.mp4' import rebaseVideo from '../../../../videos/rebase.mp4' +import fastForward from '../../../../videos/fastForward.mp4' import css from './PullRequestActionsBox.module.scss' interface InlineMergeBoxProps { @@ -96,6 +97,8 @@ const InlineMergeBox = (props: InlineMergeBoxProps) => {