diff options
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx index de13a247820..dce99ab2ba7 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CustomRuleFormModal.tsx @@ -307,26 +307,30 @@ export default function CustomRuleFormModal(props: Readonly<Props>) { {NameField} {KeyField} - - <div className="sw-flex sw-justify-between sw-gap-6"> - <CleanCodeCategoryField - value={ccCategory} - disabled={submitting} - onChange={setCCCategory} - /> - <CleanCodeAttributeField - value={ccAttribute} - category={ccCategory} - disabled={submitting} - onChange={setCCAtribute} - /> - </div> - <SoftwareQualitiesFields - error={hasError} - value={impacts} - onChange={setImpacts} - disabled={submitting} - /> + {/* do not allow to change CCT fields of existing rule */} + {!customRule && !reactivating && ( + <> + <div className="sw-flex sw-justify-between sw-gap-6"> + <CleanCodeCategoryField + value={ccCategory} + disabled={submitting} + onChange={setCCCategory} + /> + <CleanCodeAttributeField + value={ccAttribute} + category={ccCategory} + disabled={submitting} + onChange={setCCAtribute} + /> + </div> + <SoftwareQualitiesFields + error={hasError} + value={impacts} + onChange={setImpacts} + disabled={submitting} + /> + </> + )} {StatusField} {DescriptionField} {templateParams.map(renderParameterField)} |