mirror of
https://github.com/apache/superset.git
synced 2026-04-28 04:25:07 +00:00
fix(sqllab): make to hide the delete button of most recent query history (#19358)
This commit is contained in:
@@ -32,6 +32,7 @@ describe('QueryTable', () => {
|
||||
queries,
|
||||
displayLimit: 100,
|
||||
actions,
|
||||
latestQueryId: 'ryhMUZCGb',
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(React.isValidElement(<QueryTable displayLimit={100} />)).toBe(true);
|
||||
|
||||
@@ -54,6 +54,7 @@ interface QueryTableProps {
|
||||
onUserClicked?: Function;
|
||||
onDbClicked?: Function;
|
||||
displayLimit: number;
|
||||
latestQueryId?: string | undefined;
|
||||
}
|
||||
|
||||
const openQuery = (id: number) => {
|
||||
@@ -68,6 +69,7 @@ const QueryTable = ({
|
||||
onUserClicked = () => undefined,
|
||||
onDbClicked = () => undefined,
|
||||
displayLimit,
|
||||
latestQueryId,
|
||||
}: QueryTableProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -290,12 +292,14 @@ const QueryTable = ({
|
||||
>
|
||||
<Icons.PlusCircleOutlined iconSize="xs" css={verticalAlign} />
|
||||
</StyledTooltip>
|
||||
<StyledTooltip
|
||||
tooltip={t('Remove query from log')}
|
||||
onClick={() => removeQuery(query)}
|
||||
>
|
||||
<Icons.Trash iconSize="xs" />
|
||||
</StyledTooltip>
|
||||
{q.id !== latestQueryId && (
|
||||
<StyledTooltip
|
||||
tooltip={t('Remove query from log')}
|
||||
onClick={() => removeQuery(query)}
|
||||
>
|
||||
<Icons.Trash iconSize="xs" />
|
||||
</StyledTooltip>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
return q;
|
||||
|
||||
Reference in New Issue
Block a user