Skip to content

feat(cla): limit CLA sign button display to CL authors only#2027

Merged
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
juanlou1217:main
Mar 19, 2026
Merged

feat(cla): limit CLA sign button display to CL authors only#2027
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
juanlou1217:main

Conversation

@juanlou1217

Copy link
Copy Markdown
Contributor
  • 在 MergeBox 组件中添加 author 参数,用于接收 CL 作者信息
  • 新增 isClAuthor 判断逻辑,比对当前用户与 CL 作者
  • 在 MergeSection 组件中添加 isClAuthor 属性,控制 CLA 签署按钮显示权限
  • 修改 ConversationTab 组件,从 clDetail 中提取 author 并传递给 MergeBox
  • CLA 签署按钮现在仅在 CLA 检查未通过且当前用户为 CL 作者时显示

- 在 MergeBox 组件中添加 author 参数,用于接收 CL 作者信息
- 新增 isClAuthor 判断逻辑,比对当前用户与 CL 作者
- 在 MergeSection 组件中添加 isClAuthor 属性,控制 CLA 签署按钮显示权限
- 修改 ConversationTab 组件,从 clDetail 中提取 author 并传递给 MergeBox
- CLA 签署按钮现在仅在 CLA 检查未通过且当前用户为 CL 作者时显示

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restricts the “Sign CLA” button in the CL merge UI so it only appears for the CL author when the CLA check is failing, aligning the UI with expected permissions around CLA signing.

Changes:

  • Passes CL author information from ConversationTab into MergeBox.
  • Adds isClAuthor gating logic in MergeBox and forwards it to MergeSection.
  • Updates MergeSection to only render the “Sign CLA” button when claCheck fails and the viewer is the CL author.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
moon/apps/web/components/ClView/ConversationTab.tsx Passes clDetail.author to MergeBox for author-based UI gating.
moon/apps/web/components/ClBox/MergeBox.tsx Computes isClAuthor by comparing current user to passed author and forwards it to MergeSection.
moon/apps/web/components/ClBox/MergeSection.tsx Adds isClAuthor prop and uses it to conditionally display the “Sign CLA” button.

<div className='w-full'>
{clDetail && (clDetail.status === 'Open' || clDetail.status === 'Draft') && (
<MergeBox prId={id} status={clDetail.status} />
<MergeBox prId={id} status={clDetail.status} author={clDetail.author} />
const claCondition = additionalChecks.find((c) => c.type === CheckType.ClaSign)
const claCheck = claCondition ? claCondition.result === ConditionResult.PASSED : true

const isClAuthor = data?.username === author
Comment on lines +22 to 23
export const MergeBox = React.memo<{ prId: string; status?: string; author?: string }>(({ prId, status, author }) => {
const { checks } = useMergeChecks(prId)
@benjamin-747 benjamin-747 added this pull request to the merge queue Mar 19, 2026
Merged via the queue into gitmono-dev:main with commit e0dcfd3 Mar 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants