-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create insert panel for inserting instances and relations #48
base: master
Are you sure you want to change the base?
Conversation
…dense all possible buttons to keep the toolbar small. Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
|
||
interface InsertItemProps { | ||
label: string; | ||
onItemClicked: () => void; |
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.
@aematei You may want to have a function called handleItemClicked
. The code will be more reusable than arrow functions. This arrow function is anonymous so it may be hard to call the logic within the function in another part of the app.
Look at the official Typescript documentation and this Stack Overflow post for more details:
https://www.typescriptlang.org/docs/handbook/interfaces.html#function-types
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.
@pogi7 should I still include the function in the interface/type?
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.
@aematei Yes. It would look like
interface InsertItemProps {
label: string;
onItemClicked: handleItemClicked
}
const handleItemClicked: void = () => {
// you'll handle the logic of an item being clicked
console.log('Item Clicked');
}
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.
Oh got it! That makes sense, thanks.
|
||
export type InsertItem = { | ||
label: string, | ||
onItemClicked: () => void, |
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.
@aematei Please refer to my earlier comment regarding the arrow function
https://github.com/opencaesar/oml-vision/pull/48/files#r1574922754
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Hey @pogi7, I noticed that the color of diagram nodes is specified in a model's |
@aematei You may be able to access the color of the diagram nodes by accessing the Here's an example of using React.useRef in the code to find the const tableContainerRef = React.useRef<HTMLDivElement>(null);
// Set the Font Size
React.useEffect(() => {
if (tableContainerRef.current) {
tableContainerRef.current.style.setProperty("--font-size", `${fontSize}`);
}
}, [fontSize]); |
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: greypilgrim <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex Work <[email protected]>
Checklist before submitting a merge request
Description of contribution
[Describe your contribution, link to any existing relevant issues]
Testing performed
How to Test Expected functionality changes
[Describe expected behaviour changes in steps]
Additional context
[If needed, you may add additional context]