-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alerts time range refactor #4240
Conversation
@@ -36,14 +41,18 @@ The main feature-set component for dashboard filters | |||
</script> | |||
|
|||
<div class="relative flex flex-row flex-wrap gap-x-2 gap-y-2 items-center"> | |||
{#if timeRange} | |||
<ReadOnlyTimeRange {timeRange} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice symmetry with DimensionFilterReadOnlyChip
and MeasureFilterReadOnlyChip
if this component were named TimeRangeReadOnlyChip
web-common/src/features/alerts/delivery-tab/AlertDialogDeliveryTab.svelte
Outdated
Show resolved
Hide resolved
$: if ($metricsViewSpec?.data && $timeRange?.data) { | ||
const formValues = extractAlertFormValues( | ||
queryArgsJson, | ||
$metricsViewSpec.data, | ||
$timeRange.data, | ||
); | ||
for (const fk in formValues) { | ||
$form[fk] = formValues[fk]; | ||
} | ||
console.log(formValues); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code necessary? Looks like it might have been used for debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Loading of metrics view spec and time range is async. So we need this to be loaded into the form. The other option is to get the args to the component, but this felt cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This PR updates how we handle time range in alerts.