Skip to content

Remove generate unit test button #2717

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import NodesIcon from '~/components/Icons/NodesIcon'
import PlusIcon from '~/components/Icons/PlusIcon'
import { useNodeNavigation } from '~/components/Universe/useNodeNavigation'
import { getActionDetails } from '~/network/actions'
import { useSelectedNode } from '~/stores/useGraphStore'
import { useModal } from '~/stores/useModalStore'
import { useSchemaStore } from '~/stores/useSchemaStore'
import { useUserStore } from '~/stores/useUserStore'
Expand All @@ -38,20 +37,11 @@ type Props = {
id: string
}

type ButtonProps = {
left: number
backgroundColor?: string
borderColor?: string
fontColor?: string
}

export const Node = ({ onClick, node, selected, rounded = true, x, y, z, id }: Props) => {
const nodeRef = useRef<Mesh | null>(null)
const [isAdmin] = useUserStore((s) => [s.isAdmin])
const { open: openEditNodeNameModal } = useModal('editNodeName')
const { open: createBountyModal } = useModal('createBounty')
const { open: openNodeActionModal } = useModal('nodeAction')
const selectedNode = useSelectedNode()
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)
const [nodeActions, setNodeActions] = useState<ActionDetail[]>()
const [loadingActions, setLoadingActions] = useState<boolean>(false)
Expand Down Expand Up @@ -117,8 +107,6 @@ export const Node = ({ onClick, node, selected, rounded = true, x, y, z, id }: P
const description = keyProperty !== 'description' ? node.properties?.description : ''
const descriptionShortened = description ? truncateText(description, 60) : ''

const isShowCreateTestButton = !!(selectedNode && selectedNode?.node_type?.toLowerCase() === 'function')

return (
<mesh ref={nodeRef}>
<Html center sprite zIndexRange={[0, 0]}>
Expand Down Expand Up @@ -182,17 +170,6 @@ export const Node = ({ onClick, node, selected, rounded = true, x, y, z, id }: P
<Text className="selected__title">{titleShortened}</Text>
{descriptionShortened ? <Text>{descriptionShortened}</Text> : null}
</Flex>

{isShowCreateTestButton && (
<CreateTestButton
left={2}
onClick={() => {
createBountyModal()
}}
>
Generate Unit Test
</CreateTestButton>
)}
</Selected>
) : (
<>
Expand Down Expand Up @@ -350,28 +327,6 @@ const Avatar = styled(Flex)<AvatarProps>`
font-size: 20px;
`

const CreateTestButton = styled.div<ButtonProps>`
position: absolute;
top: 170px;
left: ${(p: ButtonProps) => 30 + p.left}px;
width: 140px;
padding: 8px;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
background: ${colors.createTestButton};
color: ${colors.black};
font-size: 14px;
font-family: Barlow;
font-weight: 600;
z-index: 1002;
cursor: pointer;
&:hover {
transform: scale(1.05);
}
`

const PopoverOption = styled(Flex).attrs({
direction: 'row',
px: 12,
Expand Down
Loading