Skip to content

Commit

Permalink
[Fix #620] - Hide severity property with no value for FHA nodes (Root…
Browse files Browse the repository at this point in the history
… and external reference nodes) in FaultEventMenu.tsx
  • Loading branch information
kostobog authored and blcham committed Oct 8, 2024
1 parent 524f6be commit 990af10
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const FaultEventMenu = ({
const [failureModeOverviewDialogOpen, setFailureModeOverviewDialogOpen] = useState(false);
const [failureModeOverview, setFailureModeOverview] = useState<FailureMode | null>(null);

const [criticality, setCriticality] = useState<number | undefined>(0);
const [criticality, setCriticality] = useState<string | undefined>(undefined);
const [ataSystem, setAtaSystem] = useState<string | undefined>("");
const [partNumber, setPartNumber] = useState<string | undefined>("");
const [stock, setStock] = useState<string | undefined>("");
Expand Down Expand Up @@ -195,8 +195,9 @@ const FaultEventMenu = ({
setBasicManuallyDefinedFailureRate(undefined);
setSelectedRadioButton(RadioButtonType.Predicted);

if (shapeToolData?.supertypes?.criticality) {
setCriticality(shapeToolData.supertypes.criticality);
const _criticalityArray = asArray(shapeToolData?.supertypes?.criticality);
if (_criticalityArray.length > 0) {
setCriticality(_criticalityArray.sort().join(", "));
} else {
setCriticality(undefined);
}
Expand Down

0 comments on commit 990af10

Please sign in to comment.