migrationUi.ts 552 B

1234567891011121314151617
  1. import {Organization} from 'sentry/types';
  2. import {Dataset, MetricRule} from 'sentry/views/alerts/rules/metric/types';
  3. /**
  4. * Enable ignoring archived issues in metric alerts
  5. */
  6. export const hasIgnoreArchivedFeatureFlag = (organization: Organization): boolean =>
  7. organization.features.includes('metric-alert-ignore-archived');
  8. export const ruleNeedsErrorMigration = (rule: MetricRule): boolean => {
  9. return (
  10. 'dataset' in rule &&
  11. rule.dataset === Dataset.ERRORS &&
  12. 'query' in rule &&
  13. !rule.query.includes('is:unresolved')
  14. );
  15. };