Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions web-common/src/features/alerts/alert-preview-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function getAlertPreviewQueryRequest(
timeControlArgs,
exploreSpec,
);

req.limit = "50"; // arbitrary limit to make sure we do not pull too much of data
if (!timeControlArgs.selectedTimeRange?.end) return req;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,28 +105,36 @@ export function mapSelectedComparisonTimeRangeToV1TimeRange(
return undefined;
}

let isoDuration = timeRange.isoDuration;
const name = selectedComparisonTimeRange.name;

if (
timeRange.expression &&
TIME_COMPARISON[selectedComparisonTimeRange.name]?.rillTimeOffset
) {
const rt = parseRillTime(timeRange.expression);
return {
expression:
rt.toString() +
" offset " +
TIME_COMPARISON[selectedComparisonTimeRange.name]?.rillTimeOffset,
};
if (!rt.isOldFormat) {
return {
expression:
rt.toString() +
" offset " +
TIME_COMPARISON[selectedComparisonTimeRange.name]?.rillTimeOffset,
};
} else {
// Handle old syntax differently until we have the backend parser updated.
isoDuration = timeRange.expression;
}
}

const comparisonTimeRange: V1TimeRange = {};
switch (selectedComparisonTimeRange.name) {
switch (name) {
default:
comparisonTimeRange.isoOffset = selectedComparisonTimeRange.name;
comparisonTimeRange.isoDuration = timeRange.isoDuration;
comparisonTimeRange.isoDuration = isoDuration;
break;
case TimeComparisonOption.CONTIGUOUS:
comparisonTimeRange.isoOffset = comparisonTimeRange.isoDuration =
timeRange.isoDuration;
isoDuration;
break;

case TimeComparisonOption.CUSTOM:
Expand Down