Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
copyhold committed Apr 7, 2024
1 parent f8398d7 commit 61f7d30
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import appEvents from 'app/core/app_events';
import { contextSrv } from 'app/core/services/context_srv';
import { createFolder } from 'app/features/manage-dashboards/state/actions';
import { DashboardSearchHit } from 'app/features/search/types';
import { AccessControlAction, useDispatch } from 'app/types';
import { CombinedRuleGroup } from 'app/types/unified-alerting';
import { RulerRulesConfigDTO } from 'app/types/unified-alerting-dto';
Expand All @@ -36,7 +37,6 @@ import { evaluateEveryValidationOptions } from '../rules/EditRuleGroupModal';

import { containsSlashes, Folder, RuleFolderPicker } from './RuleFolderPicker';
import { checkForPathSeparator } from './util';
import { DashboardSearchHit } from 'app/features/search/types';

export const MAX_GROUP_RESULTS = 1000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { config } from '@grafana/runtime';
import { RulerGrafanaRuleDTO } from 'app/types/unified-alerting-dto';

import { StateHistoryImplementation } from '../../../hooks/useStateHistoryModal';
import { Annotation } from '../../../utils/constants';

const AnnotationsStateHistory = lazy(() => import('../../../components/rules/state-history/StateHistory'));
const LokiStateHistory = lazy(() => import('../../../components/rules/state-history/LokiStateHistory'));
Expand All @@ -29,10 +30,13 @@ const History = ({ rule }: HistoryProps) => {
const ruleID = rule.grafana_alert.id ?? '';
const ruleUID = rule.grafana_alert.uid;

// LOGZ.IO GRAFANA CHANGE :: DEV-31760 - Retrieve annotations for migrated unified alerts
const oldAlertId = rule.annotations[Annotation.alertId] ?? '';

return (
<Suspense fallback={'Loading...'}>
{implementation === StateHistoryImplementation.Loki && <LokiStateHistory ruleUID={ruleUID} />}
{implementation === StateHistoryImplementation.Annotations && <AnnotationsStateHistory alertId={ruleID} />}
{implementation === StateHistoryImplementation.Annotations && <AnnotationsStateHistory oldAlertId={oldAlertId} alertId={ruleID} />}
</Suspense>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const RuleDetailsActionButtons = ({ rule, rulesSource, isViewMode }: Prop
const { namespace, group, rulerRule } = rule;
// LOGZ.IO GRAFANA CHANGE :: DEV-31760 - Retrieve annotations for migrated unified alerts
const oldAlertId = rule.annotations[Annotation.alertId] ?? '';
const { StateHistoryModal, showStateHistoryModal } = useStateHistoryModal(alertId, oldAlertId);
const { StateHistoryModal, showStateHistoryModal } = useStateHistoryModal(oldAlertId);
// LOGZ.IO GRAFANA CHANGE :: end
const dispatch = useDispatch();
const location = useLocation();
Expand Down Expand Up @@ -326,7 +326,7 @@ export const RuleDetailsActionButtons = ({ rule, rulesSource, isViewMode }: Prop
}

return null;
};
}

/**
* Since Incident isn't available as an open-source product we shouldn't show it for Open-Source licenced editions of Grafana.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AlertingAction } from '../../hooks/useAbilities';
import { isCloudRulesSource, isGrafanaRulesSource } from '../../utils/datasource';
import { Authorize } from '../Authorize';

import { CloudRules } from './CloudRules';
// import { CloudRules } from './CloudRules'; // LOGZ.IO GRAFANA CHANGE :: hide cloud managed alerts
import { GrafanaRules } from './GrafanaRules';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/dashboard/utils/getPanelMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
copyPanel,
duplicatePanel,
removePanel,
sharePanel,
// sharePanel, // LOGZ.IO GRAFANA CHANGE :: hide share for now
toggleLegend,
unlinkLibraryPanel,
} from 'app/features/dashboard/utils/panel';
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/panel/panellinks/link_srv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
// locationUtil, // LOGZ.IO GRAFANA CHANGE :: comment out to prevent ts errors
ScopedVars,
textUtil,
urlUtil,
// urlUtil, // LOGZ.IO GRAFANA CHANGE :: comment out to prevent ts errors
VariableOrigin,
VariableSuggestion,
VariableSuggestionsScope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { css, cx } from '@emotion/css';
import React, { memo } from 'react';
// import { usePrevious } from 'react-use';
// LOGZIO GRAFANA CHANGE :: end

import { InlineFormLabel, RadioButtonGroup } from '@grafana/ui';

import { PrometheusDatasource } from '../datasource';
Expand Down

0 comments on commit 61f7d30

Please sign in to comment.