11import Form from 'sentry/components/forms/form' ;
22import JsonForm from 'sentry/components/forms/jsonForm' ;
3- import { t } from 'sentry/locale' ;
3+ import { t , tct } from 'sentry/locale' ;
44import {
55 DEFAULT_CODE_REVIEW_TRIGGERS ,
66 type RepositoryWithSettings ,
@@ -18,6 +18,14 @@ interface Props {
1818export default function RepoDetailsForm ( { organization, repoWithSettings} : Props ) {
1919 const canWrite = useCanWriteSettings ( ) ;
2020
21+ const initialTriggers =
22+ repoWithSettings ?. settings ?. codeReviewTriggers ??
23+ organization . defaultCodeReviewTriggers ??
24+ DEFAULT_CODE_REVIEW_TRIGGERS ;
25+ const modifiableTriggers = initialTriggers . filter (
26+ trigger => trigger !== 'on_command_phrase'
27+ ) ;
28+
2129 return (
2230 < Form
2331 allowUndo
@@ -30,10 +38,7 @@ export default function RepoDetailsForm({organization, repoWithSettings}: Props)
3038 repoWithSettings ?. settings ?. enabledCodeReview ??
3139 organization . autoEnableCodeReview ??
3240 true ,
33- codeReviewTriggers :
34- repoWithSettings ?. settings ?. codeReviewTriggers ??
35- organization . defaultCodeReviewTriggers ??
36- DEFAULT_CODE_REVIEW_TRIGGERS ,
41+ codeReviewTriggers : modifiableTriggers ,
3742 repositoryIds : [ repoWithSettings . id ] ,
3843 } satisfies RepositorySettings
3944 }
@@ -57,13 +62,13 @@ export default function RepoDetailsForm({organization, repoWithSettings}: Props)
5762 {
5863 name : 'codeReviewTriggers' ,
5964 label : t ( 'Code Review Triggers' ) ,
60- help : t (
61- 'Reviews can run on demand, whenever a PR is opened, or after each commit is pushed to a PR.'
65+ help : tct (
66+ 'Reviews can always run on demand by calling [code:@sentry review], whenever a PR is opened, or after each commit is pushed to a PR.' ,
67+ { code : < code /> }
6268 ) ,
6369 type : 'choice' ,
6470 multiple : true ,
6571 choices : [
66- [ 'on_command_phrase' , t ( 'On Command Phrase' ) ] ,
6772 [ 'on_ready_for_review' , t ( 'On Ready for Review' ) ] ,
6873 [ 'on_new_commit' , t ( 'On New Commit' ) ] ,
6974 ] ,
0 commit comments