diff options
author | stanislavh <stanislav.honcharov@sonarsource.com> | 2023-12-05 11:07:07 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-08 20:03:05 +0000 |
commit | 631ea82186d2093a77ac9d76129c742cddc72518 (patch) | |
tree | 0d6ffde5eb99d9c947830b0509a5eb5640ae7812 /server/sonar-web | |
parent | b39f4b637522349a6c5c1c69fb19274205e48819 (diff) | |
download | sonarqube-631ea82186d2093a77ac9d76129c742cddc72518.tar.gz sonarqube-631ea82186d2093a77ac9d76129c742cddc72518.zip |
SONAR-21132 Do not show CCT fields in edit dialog
Co-authored-by: Benjamin Raymond <31401273+7PH@users.noreply.github.com>
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)} |