tiagobento commented on code in PR #3031:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3031#discussion_r2035933986


##########
packages/dmn-editor/src/dataTypes/DataTypes.tsx:
##########
@@ -169,13 +182,37 @@ export function DataTypes() {
         addTopLevelItemDefinition(itemDefinition);
       }
     });
-  }, [addTopLevelItemDefinition, settings.isReadOnly]);
+  }, [addTopLevelItemDefinition, isReadOnly]);
 
   const [isAddDataTypeDropdownOpen, setAddDataTypeDropdownOpen] = 
useState(false);
 
   // Using this object because DropdownToggleAction's props doesn't accept a 
'title'.
   const extraPropsForDropdownToggleAction = { title: "New Data Type" };
 
+  const addDataTypesDropdownItems = useMemo(() => {
+    const dropdownItems = [
+      <DropdownItem
+        key={"paste"}
+        onClick={() => pasteTopLevelItemDefinition()}
+        style={{ minWidth: "240px" }}
+        icon={<PasteIcon />}
+      >
+        Paste
+      </DropdownItem>,
+    ];
+    if (isImportDataTypesFromJavaClassesSupported && 
javaCodeCompletionService) {
+      dropdownItems.unshift(
+        <ImportJavaClassesI18nDictionariesProvider key={"import-java-classes"}>
+          <ImportJavaClassesDropdownItem
+            javaCodeCompletionService={javaCodeCompletionService}
+            onClick={handleImportJavaClassButtonClick}
+          />
+        </ImportJavaClassesI18nDictionariesProvider>
+      );
+    }
+    return dropdownItems;
+  }, [isImportDataTypesFromJavaClassesSupported, javaCodeCompletionService]);

Review Comment:
   Missing dependency hooks here...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to