]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20690 Handle empty impacts for changelog events
authorViktor Vorona <viktor.vorona@sonarsource.com>
Thu, 2 Nov 2023 12:38:39 +0000 (13:38 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 2 Nov 2023 20:02:42 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/quality-profiles/changelog/Changelog.tsx
server/sonar-web/src/main/js/apps/quality-profiles/types.ts

index 06a73517d890969814e7804b6301c2c72d74d10b..0c93cf091e7568c0b262caf93d836f55f35e725a 100644 (file)
@@ -139,7 +139,7 @@ export default function Changelog(props: Props) {
                 cleanCodeAttributeCategory={event.cleanCodeAttributeCategory}
               />
             )}
-            <SoftwareImpactPillList softwareImpacts={event.impacts} />
+            {event.impacts && <SoftwareImpactPillList softwareImpacts={event.impacts} />}
           </div>
         </CellComponent>
 
index b361587f8ecb40a1068406f132bccf686c171702..6c6550f6eb087d54627fa13e1450ed88e5d8963b 100644 (file)
@@ -49,7 +49,8 @@ export interface ProfileChangelogEvent {
   action: string;
   authorName?: string;
   cleanCodeAttributeCategory?: CleanCodeAttributeCategory;
-  impacts: {
+  // impacts should be always set in the wild. But Next currently has a specific database state for which this field is undefined. May be possible to make this field required in the future.
+  impacts?: {
     softwareQuality: SoftwareQuality;
     severity: SoftwareImpactSeverity;
   }[];