-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight related edges and cardinalities when a TableNode is active. #284
Highlight related edges and cardinalities when a TableNode is active. #284
Conversation
a7674be
to
b08232b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The highlighting process is getting more complicated, but it looks good!
frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/type.ts
Outdated
Show resolved
Hide resolved
@@ -65,47 +65,66 @@ export const ERDContentInner: FC<Props> = ({ | |||
const { | |||
state: { loading }, | |||
} = useERDContentContext() | |||
const [clickedNodeId, setClickedNodeId] = useState<string | null>(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is painful to have to create a separate state from the active
state managed by useUserEditingStore()
, but it seems that the logic has to be unravelled to solve the problem. I'd like to try another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. I wanted to write the code more simply, but I couldn't. In the end, the code became more complex🥲.Thank you for thinking about it🙏.
@@ -65,47 +65,66 @@ export const ERDContentInner: FC<Props> = ({ | |||
const { | |||
state: { loading }, | |||
} = useERDContentContext() | |||
const [clickedNodeId, setClickedNodeId] = useState<string | null>(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been considering the following:
Is click
a suitable naming? Perhaps something like active
might be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it is painful. I was thinking about checking whether the changes we made to how we handle data around PR #280 could be utilized. The functionality seems good, so I think it's fine to merge it now and integrate later!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your suggestion! I agree!
I've fixed it. 9c8767e
Thank you all for your reviews.🙏 |
Summary
Highlight related edges and cardinalities when a TableNode is active.
Preview: https://liam-erd-sample-gx3t0p2yn-route-06-core.vercel.app/
Before
After
Related Issue
Changes
Testing
Other Information