Skip to content

Commit

Permalink
Merge pull request #217 from DataRecce/feature/drc-268-bug-the-value-…
Browse files Browse the repository at this point in the history
…diff-execute-is-not-enabled-if-the-default

[Bug] Fix the default pk issue
  • Loading branch information
popcornylu authored Mar 7, 2024
2 parents b551f78 + 07a856d commit 6e51890
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/src/components/valuediff/ValueDiffForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,20 @@ export function ValueDiffForm({
);

const model = params?.model;
const primaryKey = params?.primary_key;
const node = _.find(lineageGraph.lineageGraphSets?.all.nodes, {
name: params?.model,
});
const primaryKey = params?.primary_key || node?.data.current?.primary_key;
const nodePrimaryKey = node?.data.current?.primary_key;

useEffect(() => {
if (!primaryKey && nodePrimaryKey) {
onParamsChanged({
...params,
primary_key: nodePrimaryKey,
});
}
}, [primaryKey, nodePrimaryKey, params, onParamsChanged]);

useEffect(() => {
setIsReadyToExecute(primaryKey && model ? true : false);
Expand Down

0 comments on commit 6e51890

Please sign in to comment.