Skip to content

Commit

Permalink
Merge branch 'main' into feature/basic-impersonation
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Sep 28, 2024
2 parents fdf1cf9 + 02f219d commit 29d5162
Show file tree
Hide file tree
Showing 17 changed files with 625 additions and 60 deletions.
12 changes: 6 additions & 6 deletions docs/providers/documentation/ilert-provider.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Ilert Provider"
sidebarTitle: "Ilert Provider"
title: "ilert Provider"
sidebarTitle: "ilert Provider"
description: "The ilert provider enables the creation, updating, and resolution of events or incidents on ilert, leveraging both incident management and event notification capabilities for effective incident response."
---
# Ilert Provider
# ilert Provider

## Overview

Expand All @@ -21,7 +21,7 @@ Depending on the `_type` specified, the provider will route the operation to the
### Incident Management

- `summary`: A brief summary of the incident. This is required for creating a new incident.
- `status`: `IlertIncidentStatus` - The current status of the incident (e.g., INVESTIGATING, RESOLVED, MONITORING, IDENTIFIED).
- `status`: `ilertIncidentStatus` - The current status of the incident (e.g., INVESTIGATING, RESOLVED, MONITORING, IDENTIFIED).
- `message`: A detailed message describing the incident or situation. Default is an empty string.
- `affectedServices`: A JSON string representing the list of affected services and their statuses. Default is an empty array (`"[]"`).
- `id`: The ID of the incident to update. If set to `"0"`, a new incident will be created.
Expand Down Expand Up @@ -69,5 +69,5 @@ This provider is part of Keep's integration with ilert, designed to enhance oper

## Useful Links

- [ilert API Documentation](https://api.ilert.com/api-docs/)
- [ilert Alerting](https://www.ilert.com/product/reliable-actionable-alerting)
- [ilert API Documentation](https://api.ilert.com/api-docs/?utm_campaign=Keep&utm_source=integration&utm_medium=organic)
- [ilert Alerting](https://www.ilert.com/product/reliable-actionable-alerting?utm_campaign=Keep&utm_source=integration&utm_medium=organic)
2 changes: 1 addition & 1 deletion docs/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ By leveraging Keep Providers, users are able to deeply integrate Keep with the t
></Card>

<Card
title="Ilert"
title="ilert"
href="/providers/documentation/ilert-provider"
icon={
<img src="https://img.logo.dev/ilert.com?token=pk_dfXfZBoKQMGDTIgqu7LvYg" />
Expand Down
18 changes: 12 additions & 6 deletions keep-ui/app/dashboard/GridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Responsive, WidthProvider, Layout } from "react-grid-layout";
import GridItemContainer from "./GridItemContainer";
import { LayoutItem, WidgetData } from "./types";
import "react-grid-layout/css/styles.css";
import { Preset } from "app/alerts/models";

const ResponsiveGridLayout = WidthProvider(Responsive);

Expand All @@ -12,9 +13,10 @@ interface GridLayoutProps {
data: WidgetData[];
onEdit: (id: string) => void;
onDelete: (id: string) => void;
presets: Preset[];
}

const GridLayout: React.FC<GridLayoutProps> = ({ layout, onLayoutChange, data, onEdit, onDelete }) => {
const GridLayout: React.FC<GridLayoutProps> = ({ layout, onLayoutChange, data, onEdit, onDelete, presets }) => {
const layouts = { lg: layout };

return (
Expand All @@ -39,11 +41,15 @@ const GridLayout: React.FC<GridLayoutProps> = ({ layout, onLayoutChange, data, o
compactType={null}
draggableHandle=".grid-item__widget"
>
{data.map((item) => (
<div key={item.i} data-grid={item}>
<GridItemContainer item={item} onEdit={onEdit} onDelete={onDelete} />
</div>
))}
{data.map((item) => {
//Fixing the static hardcode db value.
const preset = presets?.find(p => p?.id === item?.preset?.id);
item.preset = { ...item.preset,alerts_count: preset?.alerts_count ?? 0};
return (
<div key={item.i} data-grid={item}>
<GridItemContainer item={item} onEdit={onEdit} onDelete={onDelete} />
</div>
)})}
</ResponsiveGridLayout>
);
};
Expand Down
23 changes: 17 additions & 6 deletions keep-ui/app/dashboard/[id]/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ import { useDashboards } from 'utils/hooks/useDashboards';
import { getApiURL } from 'utils/apiUrl';
import './../styles.css';
import { toast } from 'react-toastify';
import { GenericFilters } from '@/components/filters/GenericFilters';
import { useDashboardPreset } from 'utils/hooks/useDashboardPresets';

const DASHBOARD_FILTERS = [
{
type: "date",
key: "time_stamp",
value: "",
name: "Last received",
}
]

const DashboardPage = () => {
const { useAllPresets, useStaticPresets } = usePresets();
const { data: presets = [] } = useAllPresets();
const { data: staticPresets = [] } = useStaticPresets();
const { id } : any = useParams();
const allPresets = useDashboardPreset();
const { id }: any = useParams();
const { data: session } = useSession();
const { dashboards, isLoading, mutate: mutateDashboard } = useDashboards();
const [isModalOpen, setIsModalOpen] = useState(false);
Expand All @@ -39,8 +48,6 @@ const DashboardPage = () => {
}
}, [id, dashboards, isLoading]);

const allPresets = [...presets, ...staticPresets];

const openModal = () => {
setEditingItem(null); // Ensure new modal opens without editing item context
setIsModalOpen(true);
Expand Down Expand Up @@ -163,6 +170,8 @@ const DashboardPage = () => {
color="orange"
/>
</div>
<div className="flex gap-1 items-end">
<GenericFilters filters={DASHBOARD_FILTERS} />
<div className="flex">
<Button
icon={FiSave}
Expand All @@ -173,6 +182,7 @@ const DashboardPage = () => {
/>
<Button color="orange" onClick={openModal} className="ml-2">Add Widget</Button>
</div>
</div>
</div>
{layout.length === 0 ? (
<Card
Expand All @@ -192,6 +202,7 @@ const DashboardPage = () => {
data={widgetData}
onEdit={handleEditWidget}
onDelete={handleDeleteWidget}
presets={allPresets}
/>
</Card>
)}
Expand Down
11 changes: 8 additions & 3 deletions keep-ui/app/mapping/create-or-edit-mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,14 @@ export default function CreateOrEditMapping({ editRule, editCallback }: Props) {
<Badge color="gray">...</Badge>
) : (
attributes
.filter(
(attribute) => !selectedLookupAttributes.includes(attribute)
)
.filter((attribute) => {
return !selectedLookupAttributes.some((lookupAttr) => {
const parts = lookupAttr
.split("&&")
.map((part) => part.trim());
return parts.includes(attribute);
});
})
.map((attribute) => (
<Badge key={attribute} color="orange">
{attribute}
Expand Down
Loading

0 comments on commit 29d5162

Please sign in to comment.