mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 03:32:00 +08:00
[Fix]: delete formula issue (#4526)
This commit is contained in:
parent
3a20862d0c
commit
6bc5ceac3e
@ -151,6 +151,7 @@ export function Formula({
|
||||
onToggleVisibility={handleToggleDisableFormula}
|
||||
onDelete={handleDelete}
|
||||
onCollapseEntity={handleToggleCollapseFormula}
|
||||
showDeleteButton
|
||||
/>
|
||||
|
||||
{!isCollapse && (
|
||||
|
@ -2,7 +2,6 @@ import './QBEntityOptions.styles.scss';
|
||||
|
||||
import { Button, Col } from 'antd';
|
||||
import cx from 'classnames';
|
||||
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
|
||||
import { ChevronDown, ChevronRight, Eye, EyeOff, Trash2 } from 'lucide-react';
|
||||
|
||||
interface QBEntityOptionsProps {
|
||||
@ -12,6 +11,7 @@ interface QBEntityOptionsProps {
|
||||
onDelete: () => void;
|
||||
onToggleVisibility: () => void;
|
||||
onCollapseEntity: () => void;
|
||||
showDeleteButton: boolean;
|
||||
}
|
||||
|
||||
export default function QBEntityOptions({
|
||||
@ -21,11 +21,8 @@ export default function QBEntityOptions({
|
||||
onDelete,
|
||||
onToggleVisibility,
|
||||
onCollapseEntity,
|
||||
showDeleteButton,
|
||||
}: QBEntityOptionsProps): JSX.Element {
|
||||
const { currentQuery } = useQueryBuilder();
|
||||
|
||||
const showDeleteButton = currentQuery.builder.queryData.length > 1;
|
||||
|
||||
return (
|
||||
<Col span={24}>
|
||||
<div className="qb-entity-options">
|
||||
|
@ -47,7 +47,7 @@ export const Query = memo(function Query({
|
||||
filterConfigs,
|
||||
queryComponents,
|
||||
}: QueryProps): JSX.Element {
|
||||
const { panelType } = useQueryBuilder();
|
||||
const { panelType, currentQuery } = useQueryBuilder();
|
||||
const { pathname } = useLocation();
|
||||
|
||||
const [isCollapse, setIsCollapsed] = useState(false);
|
||||
@ -288,6 +288,7 @@ export const Query = memo(function Query({
|
||||
onToggleVisibility={handleToggleDisableQuery}
|
||||
onDelete={handleDeleteQuery}
|
||||
onCollapseEntity={handleToggleCollapsQuery}
|
||||
showDeleteButton={currentQuery.builder.queryData.length > 1}
|
||||
/>
|
||||
|
||||
{!isCollapse && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user