Skip to content

Commit

Permalink
fix: custom fingerprint delete button
Browse files Browse the repository at this point in the history
  • Loading branch information
jacovinus committed Sep 29, 2023
1 parent 19ba144 commit af417d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/main/plugins/Cardinality/CardinalityDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function CardinalityDialog({
return (
<ThemeProvider theme={theme}>
<div>
<Tooltip title={`Delete fingerprints for ${label}`}>
<Tooltip title={`Delete fingerprints for ${label !== "" ? label : query}`}>
<div
style={{
display: "flex",
Expand Down
30 changes: 17 additions & 13 deletions packages/main/plugins/Cardinality/Configurator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const Configurator: React.FC<ConfiguratorProps> = ({

//a handler for making a get request to the api

const { handleCardinalityRequest, handleDelete } = useCardinalityRequest(true);
const { handleCardinalityRequest, handleDelete } =
useCardinalityRequest(true);
const { setTimeSeriesSelector, setFocusLabel, setLimitEntries, isLoading } =
useCardinalityStore();
const handleReset = () => {
Expand Down Expand Up @@ -146,18 +147,21 @@ const Configurator: React.FC<ConfiguratorProps> = ({
</div>

<div className="buttons-group">
<button className="query-button">
<CardinalityDialog
clearFingerPrints={(query) => handleDelete(query, totalSeries.amount)}
isLoading={isLoading}
label={""}
value={totalSeries.amount}
source={""}
isCustom={true}
query={query}
/>

</button>
{query !== "" && (
<button className="query-button">
<CardinalityDialog
clearFingerPrints={(query) =>
handleDelete(query, totalSeries.amount)
}
isLoading={isLoading}
label={""}
value={totalSeries.amount}
source={""}
isCustom={true}
query={query}
/>
</button>
)}

<DayPicker />
<button onClick={handleReset} className="query-button">
Expand Down

0 comments on commit af417d4

Please sign in to comment.