@@ -12,7 +12,7 @@ import { toPythonFunctionName } from "@/submodules/javascript-functions/python-f
1212import KernDropdown from "@/submodules/react-components/components/KernDropdown" ;
1313import { Tooltip } from "@nextui-org/react" ;
1414import { useRouter } from "next/router" ;
15- import { useCallback , useEffect , useState } from "react" ;
15+ import { useCallback , useEffect , useMemo , useState } from "react" ;
1616import { useDispatch , useSelector } from "react-redux" ;
1717
1818const ACCEPT_BUTTON = { buttonCaption : "Accept" , useButton : true , disabled : true }
@@ -58,6 +58,10 @@ export default function CreateNewAttributeModal() {
5858 setDuplicateNameExists ( checkName ) ;
5959 }
6060
61+ const filteredDataTypes = useMemo ( ( ) => {
62+ return DATA_TYPES . filter ( type => type . value !== 'PERMISSION' ) ;
63+ } , [ ] ) ;
64+
6165 return ( < Modal modalName = { ModalEnum . CREATE_NEW_ATTRIBUTE } acceptButton = { acceptButton } >
6266 < div className = "flex flex-grow justify-center text-lg leading-6 text-gray-900 font-medium" >
6367 Add new attribute </ div >
@@ -73,7 +77,7 @@ export default function CreateNewAttributeModal() {
7377 < Tooltip content = { TOOLTIPS_DICT . PROJECT_SETTINGS . SELECT_ATTRIBUTE_TYPE } color = "invert" placement = "right" >
7478 < span className = "cursor-help card-title mb-0 label-text font-normal" > < span className = "underline filtersUnderline" > Attribute type</ span > </ span >
7579 </ Tooltip >
76- < KernDropdown buttonName = { attributeType ? attributeType . name : 'Select type' } options = { DATA_TYPES } selectedOption = { ( option : any ) => setAttributeType ( option ) } />
80+ < KernDropdown buttonName = { attributeType ? attributeType . name : 'Select type' } options = { filteredDataTypes } selectedOption = { ( option : any ) => setAttributeType ( option ) } />
7781 </ div >
7882 { duplicateNameExists && < div className = "text-red-700 text-xs mt-2" > Attribute name exists</ div > }
7983 { attributeType . name == 'Embedding List' && < div className = "border border-gray-300 text-xs text-gray-500 p-2.5 rounded-lg text-justify mt-2 max-w-2xl" >
0 commit comments