Skip to content

Commit

Permalink
fix regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
matewilk committed Apr 25, 2024
1 parent 1cee863 commit f896f45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions visualizations/store-map-viz/queries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { timeRangeToNrql } from "../utils";
const nrqlQuery = (query, timeRange, defaultSince, ignorePicker) => {
if (ignorePicker === true) {
return (
query.replace(/(\r\n|\n|\r)/gm, " ").replace("\\", "\\\\") + defaultSince
query.replace(/(\r\n|\n|\r)/gm, " ").replace(/\\/g, "\\\\") + defaultSince
);
} else {
// Generate the time range part of the NRQL query
const timeRangePart = timeRangeToNrql(timeRange);
// Construct the full NRQL query, remove line breaks
let q = `${query.replace(/(\r\n|\n|\r)/gm, " ").replace("\\", "\\\\")} ${
let q = `${query.replace(/(\r\n|\n|\r)/gm, " ").replace(/\\/g, "\\\\")} ${
timeRangePart === "" ? defaultSince || "" : timeRangePart
}`;
return q;
Expand Down

0 comments on commit f896f45

Please sign in to comment.