Skip to content

Commit 2679ff6

Browse files
author
Sanjeevani19
authored
Merge pull request #6419 from AkshayBajajML/bug/DHFPROD-8254
DHFPROD-8254: No edit Modal appears for newly created Ruleset items i…
2 parents dc594d1 + e08d34f commit 2679ff6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

marklogic-data-hub-central/ui/src/components/entities/matching/matching-step-detail/matching-step-detail.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useState, useEffect, useContext} from "react";
1+
import React, {useState, useEffect, useContext, useRef} from "react";
22
import {Row, Col, Card, Menu, Dropdown, Collapse, Icon, Switch} from "antd";
33
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
44
import {faPlusSquare} from "@fortawesome/free-solid-svg-icons";
@@ -105,6 +105,7 @@ const MatchingStepDetail: React.FC = () => {
105105
const [thresholdItems, setThresholdItems] = useState<any []>([]);
106106
const [displayRulesetTimeline, toggleDisplayRulesetTimeline] = useState(false);
107107
const [displayThresholdTimeline, toggleDisplayThresholdTimeline] = useState(false);
108+
const refMatchingRuleset = useRef<any[]>();
108109

109110
const menu = (
110111
<Menu>
@@ -159,6 +160,10 @@ const MatchingStepDetail: React.FC = () => {
159160
}*/
160161
}, [JSON.stringify(curationOptions.activeStep.stepArtifact)]);
161162

163+
useEffect(() => {
164+
refMatchingRuleset.current! = matchingStep.matchRulesets;
165+
}, [matchingStep]);
166+
162167
const handleMatchingActivity = async (matchStepName) => {
163168
let matchActivity = await calculateMatchingActivity(matchStepName);
164169
setMatchingActivity(matchActivity);
@@ -668,9 +673,9 @@ const MatchingStepDetail: React.FC = () => {
668673
};
669674

670675
const onRuleSetTimelineItemClicked = (event) => {
671-
let updateStepArtifactRulesets = curationOptions.activeStep.stepArtifact.matchRulesets;
672676
let index = event.item;
673-
let editMatchRuleset = updateStepArtifactRulesets[index];
677+
let currentRuleset = refMatchingRuleset.current!;
678+
let editMatchRuleset = currentRuleset[index];
674679
setEditRuleset({...editMatchRuleset, index});
675680
if (editMatchRuleset) {
676681
if (editMatchRuleset.hasOwnProperty("rulesetType") && editMatchRuleset["rulesetType"] === "multiple") {

0 commit comments

Comments
 (0)