@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Badge/generateBadgeVariants.js +9 -28
- package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/components/Checkbox/CheckboxGroup.js +16 -13
- package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
- package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +2 -1
- package/dist/components/Radio/RadioGroup.js +16 -13
- package/dist/components/SimpleCharts/Chart/classes.js +1 -1
- package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
- package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
- package/dist/components/SimpleCharts/Metric/classes.js +2 -2
- package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
- package/dist/guidelines/patterns/complex-drawer.md +1084 -0
- package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
- package/dist/guidelines/patterns/detail-drawer.md +31 -13
- package/dist/guidelines/patterns/empty-states.md +6 -5
- package/dist/guidelines/patterns/entity-table.md +25 -29
- package/dist/guidelines/patterns/feedback-toasts.md +3 -11
- package/dist/guidelines/patterns/resource-list-page.md +14 -16
- package/dist/guidelines/rules.md +6 -5
- package/dist/guidelines/templates/ai-assistant.md +1133 -0
- package/dist/guidelines/templates/api-inventory.md +905 -0
- package/dist/guidelines/templates/attack-events.md +2722 -0
- package/dist/guidelines/templates/incident-detail.md +2085 -0
- package/dist/guidelines/templates/integrations-settings.md +836 -0
- package/dist/guidelines/templates/page-states.md +798 -0
- package/dist/guidelines/templates/rule-editor.md +886 -0
- package/dist/guidelines/templates/security-dashboard.md +681 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/metadata/components.json +20 -108
- package/dist/metadata/guidelines.json +1204 -37
- package/dist/theme/tokens.test.ts +52 -0
- package/package.json +1 -4
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
- package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
- package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
- package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
- package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
- package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
- package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
- package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
- package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
- package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
- package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
- package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
- package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
- package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
- package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
- package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
- package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
- package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
- package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
- package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
- package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
- package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
- package/dist/components/Rules/PointSelector/classes.js +0 -22
- package/dist/components/Rules/PointSelector/index.d.ts +0 -20
- package/dist/components/Rules/PointSelector/index.js +0 -18
- package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
- package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
- package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
- package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
- package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
- package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
- package/dist/components/Rules/PointSelector/types.d.ts +0 -304
- package/dist/components/Rules/PointSelector/types.js +0 -0
- package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
- package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
- package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
- package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
- package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
- package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
- package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/classes.js +0 -18
- package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
- package/dist/components/Rules/RuleBuilder/index.js +0 -11
- package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
- package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
- package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
- package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
- package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
- package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
- package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
- package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
- package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
- package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
- package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
- package/dist/components/Rules/RuleBuilder/types.js +0 -0
- package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
- package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
- package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
- package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
- package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
- package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Integrations settings
|
|
3
|
+
description: Use when building the settings page that connects Wallarm to Slack, Jira, PagerDuty, a SIEM or a webhook, with per-integration notification rules.
|
|
4
|
+
components: [AppShell, AppShellHeader, AppShellRail, AppShellRemote, TopHeader, TopHeaderLogo, TopHeaderActions, TopHeaderSeparator, ChatTrigger, NotificationCenter, NotificationCenterTrigger, Logo, NavRail, NavRailBody, NavRailItem, NavRailSeparator, NavRailFooter, RemoteShell, RemoteShellPanel, RemoteShellBreadcrumb, RemoteShellContent, Page, PageHeader, PageHeaderGroup, PageTitle, PageDescription, PageToolbar, PageContent, SearchInput, SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger, NumericBadge, Table, TableEmptyState, EmptyState, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, Badge, Tag, OverflowList, FormatDateTime, Switch, SwitchControl, SwitchLabel, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuSeparator, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerClose, Timeline, TimelineItem, TimelineConnector, TimelineIndicator, TimelineSeparator, TimelineContent, TimelineTitle, Field, FieldLabel, FieldIndicator, Input, Select, SelectInput, SelectPositioner, SelectContent, SelectOption, SelectOptionText, SelectOptionIndicator, CheckboxGroup, Checkbox, CheckboxIndicator, CheckboxLabel, CheckboxDescription, Alert, AlertIcon, AlertContent, AlertTitle, AlertDescription, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, Button, HStack, VStack, Text, Toast]
|
|
5
|
+
keywords: [integrations, integration settings, connectors, notifications, notification rules, slack, jira, pagerduty, splunk, siem, webhook, teams, telegram, connect, disconnect, send test, test notification, settings section]
|
|
6
|
+
order: 70
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Integrations settings
|
|
10
|
+
|
|
11
|
+
Settings › Integrations in the console frame: every tool Wallarm sends events to, in one table. Each row shows its status, events and last delivery. A switch pauses one integration, and the row menu edits, connects, tests or disconnects it.
|
|
12
|
+
|
|
13
|
+
## What it shows
|
|
14
|
+
|
|
15
|
+
- The Settings section from [Application layout](../patterns/app-layout.md): `RemoteShell` with its own `NavConfig`, Settings active in the rail footer, the trail from `RemoteShellBreadcrumb`.
|
|
16
|
+
- The [Resource list page](../patterns/resource-list-page.md) frame with search and status tabs, and the no-results state from [Empty states](../patterns/empty-states.md).
|
|
17
|
+
- [Entity table](../patterns/entity-table.md) cells: an icon tile with a second line, status badges (Connected, Needs attention, Failed, Not connected), event `Tag`s in `OverflowList`, exact times, the em dash, an on/off `Switch` and the row menu in the master cell.
|
|
18
|
+
- The `Timeline` edit drawer from [Create and edit forms](../patterns/create-edit-forms.md): two short fields side by side, card checkboxes for events, a test result as an `Alert` in its section.
|
|
19
|
+
- A server-side save failure as a destructive `Alert` atop the drawer body.
|
|
20
|
+
- The disconnect dialog from [Confirmation dialogs](../patterns/confirmation-dialogs.md).
|
|
21
|
+
- Toasts from [Feedback toasts](../patterns/feedback-toasts.md): a loading "Send test" that turns into success or an error, plus result toasts for save, connect, disconnect and the switch.
|
|
22
|
+
- Skeleton rows on first load ([Empty states](../patterns/empty-states.md)).
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
The working page: filter, toggle, connect Telegram, send a test (Splunk fails) or disconnect. Open a row's menu and pick Edit to see the edit drawer with the row marked active; saving Jira fails, so its reason sits atop the form and the drawer stays open. Disconnect in the same menu opens the confirmation dialog.
|
|
27
|
+
|
|
28
|
+
Settings › Integrations inside the console frame. Search and status tabs filter one table;
|
|
29
|
+
each row shows its status, events and last delivery. The Notifications switch saves at once,
|
|
30
|
+
the row menu edits, connects, sends a test (Splunk fails) or disconnects with a confirmation.
|
|
31
|
+
Saving Jira fails: the server's reason shows atop the drawer body and the drawer stays open.
|
|
32
|
+
|
|
33
|
+
```tsx story=Default
|
|
34
|
+
import { type ChangeEvent, type FormEvent, useState } from 'react';
|
|
35
|
+
import { Alert, AlertContent, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';
|
|
36
|
+
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
|
|
37
|
+
import { Button } from '@wallarm-org/design-system/Button';
|
|
38
|
+
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
|
|
39
|
+
import { Checkbox, CheckboxDescription, CheckboxGroup, CheckboxIndicator, CheckboxLabel } from '@wallarm-org/design-system/Checkbox';
|
|
40
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@wallarm-org/design-system/Dialog';
|
|
41
|
+
import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';
|
|
42
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
|
|
43
|
+
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
44
|
+
import { Field, FieldIndicator, FieldLabel } from '@wallarm-org/design-system/Field';
|
|
45
|
+
import { ChevronUpDown, CircleHelp, Ellipsis, FilterX, History, Home as HomeIcon, Pencil, Plug, Search, SearchX, Settings, Unplug, Zap } from '@wallarm-org/design-system/icons';
|
|
46
|
+
import { Input } from '@wallarm-org/design-system/Input';
|
|
47
|
+
import { Logo } from '@wallarm-org/design-system/Logo';
|
|
48
|
+
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
|
|
49
|
+
import { NotificationCenter, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
|
|
50
|
+
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
|
|
51
|
+
import { Page, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
|
|
52
|
+
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
|
|
53
|
+
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
|
|
54
|
+
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
|
|
55
|
+
import { Select, SelectContent, SelectInput, SelectOption, SelectOptionIndicator, SelectOptionText, SelectPositioner } from '@wallarm-org/design-system/Select';
|
|
56
|
+
import { VStack } from '@wallarm-org/design-system/Stack';
|
|
57
|
+
import { Switch, SwitchControl, SwitchLabel } from '@wallarm-org/design-system/Switch';
|
|
58
|
+
import { type TableCellContext, type TableColumnDef, type TableRow, Table, TableEmptyState } from '@wallarm-org/design-system/Table';
|
|
59
|
+
import { Text } from '@wallarm-org/design-system/Text';
|
|
60
|
+
import { Timeline, TimelineConnector, TimelineContent, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from '@wallarm-org/design-system/Timeline';
|
|
61
|
+
import { useToast } from '@wallarm-org/design-system/Toast';
|
|
62
|
+
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';
|
|
63
|
+
|
|
64
|
+
export const Default = () => {
|
|
65
|
+
const toast = useToast();
|
|
66
|
+
const [pathname, setPathname] = useState(PATHNAME);
|
|
67
|
+
const [integrations, setIntegrations] = useState(INTEGRATIONS);
|
|
68
|
+
const [query, setQuery] = useState('');
|
|
69
|
+
const [status, setStatus] = useState<string>('all');
|
|
70
|
+
const [editing, setEditing] = useState<Integration>(SLACK);
|
|
71
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
72
|
+
const [draft, setDraft] = useState<Draft>(toDraft(SLACK));
|
|
73
|
+
const [saving, setSaving] = useState(false);
|
|
74
|
+
const [testing, setTesting] = useState(false);
|
|
75
|
+
const [testDelivered, setTestDelivered] = useState(false);
|
|
76
|
+
const [testError, setTestError] = useState('');
|
|
77
|
+
const [saveError, setSaveError] = useState('');
|
|
78
|
+
const [disconnecting, setDisconnecting] = useState<Integration>(SLACK);
|
|
79
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
80
|
+
const [pendingDisconnect, setPendingDisconnect] = useState(false);
|
|
81
|
+
|
|
82
|
+
const isConnect = editing.status === 'disconnected';
|
|
83
|
+
const dirty = isDirty(draft, editing);
|
|
84
|
+
const canSubmit =
|
|
85
|
+
draft.name.trim() !== '' &&
|
|
86
|
+
draft.destination.trim() !== '' &&
|
|
87
|
+
draft.events.length > 0 &&
|
|
88
|
+
(isConnect || dirty);
|
|
89
|
+
|
|
90
|
+
const update = (id: string, patch: Partial<Integration>) =>
|
|
91
|
+
setIntegrations(prev => prev.map(item => (item.id === id ? { ...item, ...patch } : item)));
|
|
92
|
+
|
|
93
|
+
const handleNavigate = (to: string) => {
|
|
94
|
+
onNavigate(to);
|
|
95
|
+
setPathname(to);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const openDrawer = (integration: Integration) => {
|
|
99
|
+
setEditing(integration);
|
|
100
|
+
setDraft(toDraft(integration));
|
|
101
|
+
setTestDelivered(false);
|
|
102
|
+
setTestError('');
|
|
103
|
+
setSaveError('');
|
|
104
|
+
setDrawerOpen(true);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const handleDrawerOpenChange = (next: boolean) => {
|
|
108
|
+
if (!saving) setDrawerOpen(next);
|
|
109
|
+
};
|
|
110
|
+
const handleNameChange = (event: ChangeEvent<HTMLInputElement>) =>
|
|
111
|
+
setDraft({ ...draft, name: event.target.value });
|
|
112
|
+
const handleDestinationChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
113
|
+
setDraft({ ...draft, destination: event.target.value });
|
|
114
|
+
setTestDelivered(false);
|
|
115
|
+
setTestError('');
|
|
116
|
+
};
|
|
117
|
+
const handleSeverityChange = ({ value }: { value: string[] }) =>
|
|
118
|
+
setDraft({ ...draft, severity: value[0] ?? draft.severity });
|
|
119
|
+
const handleEventsChange = (value: string[]) => setDraft({ ...draft, events: value });
|
|
120
|
+
|
|
121
|
+
const handleTestInForm = async () => {
|
|
122
|
+
setTesting(true);
|
|
123
|
+
setTestDelivered(false);
|
|
124
|
+
setTestError('');
|
|
125
|
+
try {
|
|
126
|
+
await sendTest(editing);
|
|
127
|
+
setTestDelivered(true);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
setTestError(error instanceof Error ? error.message : 'The destination did not respond.');
|
|
130
|
+
} finally {
|
|
131
|
+
setTesting(false);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const handleSubmit = async (event: FormEvent) => {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
setSaving(true);
|
|
138
|
+
setSaveError('');
|
|
139
|
+
try {
|
|
140
|
+
await saveIntegration(editing, draft);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
setSaveError(error instanceof Error ? error.message : "The server didn't respond.");
|
|
143
|
+
setSaving(false);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
update(editing.id, {
|
|
147
|
+
...draft,
|
|
148
|
+
events: draft.events.filter(isEventKind),
|
|
149
|
+
status: isConnect ? 'connected' : editing.status,
|
|
150
|
+
notify: isConnect ? true : editing.notify,
|
|
151
|
+
});
|
|
152
|
+
setSaving(false);
|
|
153
|
+
setDrawerOpen(false);
|
|
154
|
+
toast.create({
|
|
155
|
+
id: `save-${editing.id}`,
|
|
156
|
+
title: isConnect
|
|
157
|
+
? `${editing.provider} connected`
|
|
158
|
+
: `${editing.provider} integration updated`,
|
|
159
|
+
type: 'success',
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const handleDialogOpenChange = (next: boolean) => {
|
|
164
|
+
if (!pendingDisconnect) setDialogOpen(next);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const handleDisconnect = async () => {
|
|
168
|
+
setPendingDisconnect(true);
|
|
169
|
+
try {
|
|
170
|
+
await disconnectIntegration(disconnecting.id);
|
|
171
|
+
update(disconnecting.id, { status: 'disconnected', notify: false });
|
|
172
|
+
setDialogOpen(false);
|
|
173
|
+
toast.create({
|
|
174
|
+
id: `disconnect-${disconnecting.id}`,
|
|
175
|
+
title: `${disconnecting.provider} disconnected`,
|
|
176
|
+
type: 'default',
|
|
177
|
+
});
|
|
178
|
+
} catch {
|
|
179
|
+
toast.create({ title: `Couldn't disconnect ${disconnecting.provider}`, type: 'error' });
|
|
180
|
+
} finally {
|
|
181
|
+
setPendingDisconnect(false);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const renderNotifications = ({ row }: TableCellContext<Integration, unknown>) => {
|
|
186
|
+
const integration = row.original;
|
|
187
|
+
const handleCheckedChange = async ({ checked }: { checked: boolean }) => {
|
|
188
|
+
update(integration.id, { notify: checked });
|
|
189
|
+
await setNotifications(integration.id, checked);
|
|
190
|
+
toast.create({
|
|
191
|
+
id: `notify-${integration.id}`,
|
|
192
|
+
title: `${integration.provider} notifications ${checked ? 'enabled' : 'disabled'}`,
|
|
193
|
+
type: 'default',
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
if (integration.status === 'disconnected') return '—';
|
|
198
|
+
return (
|
|
199
|
+
<Switch
|
|
200
|
+
checked={integration.notify}
|
|
201
|
+
onCheckedChange={handleCheckedChange}
|
|
202
|
+
data-testid={`integrations-notify-${integration.id}`}
|
|
203
|
+
>
|
|
204
|
+
<SwitchControl />
|
|
205
|
+
<SwitchLabel className='sr-only'>Notifications for {integration.provider}</SwitchLabel>
|
|
206
|
+
</Switch>
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const renderMenuAction = (row: TableRow<Integration>) => {
|
|
211
|
+
const integration = row.original;
|
|
212
|
+
const handleEdit = () => openDrawer(integration);
|
|
213
|
+
const handleSendTest = async () => {
|
|
214
|
+
const id = toast.create({
|
|
215
|
+
id: `test-${integration.id}`,
|
|
216
|
+
title: 'Sending test notification…',
|
|
217
|
+
type: 'loading',
|
|
218
|
+
});
|
|
219
|
+
try {
|
|
220
|
+
await sendTest(integration);
|
|
221
|
+
toast.update({ id, title: `Test delivered via ${integration.provider}`, type: 'success' });
|
|
222
|
+
} catch (error) {
|
|
223
|
+
toast.update({
|
|
224
|
+
id,
|
|
225
|
+
title: 'Test failed',
|
|
226
|
+
description: error instanceof Error ? error.message : undefined,
|
|
227
|
+
type: 'error',
|
|
228
|
+
duration: 10000,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
const handleDisconnectSelect = () => {
|
|
233
|
+
setDisconnecting(integration);
|
|
234
|
+
setDialogOpen(true);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<DropdownMenu>
|
|
239
|
+
<DropdownMenuTrigger asChild>
|
|
240
|
+
<Button
|
|
241
|
+
variant='ghost'
|
|
242
|
+
color='neutral'
|
|
243
|
+
size='small'
|
|
244
|
+
aria-label={`Actions for ${integration.provider}`}
|
|
245
|
+
data-testid={`integrations-actions-${integration.id}`}
|
|
246
|
+
>
|
|
247
|
+
<Ellipsis />
|
|
248
|
+
</Button>
|
|
249
|
+
</DropdownMenuTrigger>
|
|
250
|
+
<DropdownMenuContent>
|
|
251
|
+
{integration.status === 'disconnected' ? (
|
|
252
|
+
<DropdownMenuItem onSelect={handleEdit} data-testid='integrations-connect'>
|
|
253
|
+
<DropdownMenuItemIcon>
|
|
254
|
+
<Plug />
|
|
255
|
+
</DropdownMenuItemIcon>
|
|
256
|
+
<DropdownMenuItemText>Connect {integration.provider}</DropdownMenuItemText>
|
|
257
|
+
</DropdownMenuItem>
|
|
258
|
+
) : (
|
|
259
|
+
<>
|
|
260
|
+
<DropdownMenuItem onSelect={handleEdit} data-testid='integrations-edit'>
|
|
261
|
+
<DropdownMenuItemIcon>
|
|
262
|
+
<Pencil />
|
|
263
|
+
</DropdownMenuItemIcon>
|
|
264
|
+
<DropdownMenuItemText>Edit</DropdownMenuItemText>
|
|
265
|
+
</DropdownMenuItem>
|
|
266
|
+
<DropdownMenuItem onSelect={handleSendTest} data-testid='integrations-send-test'>
|
|
267
|
+
<DropdownMenuItemIcon>
|
|
268
|
+
<Zap />
|
|
269
|
+
</DropdownMenuItemIcon>
|
|
270
|
+
<DropdownMenuItemText>Send test notification</DropdownMenuItemText>
|
|
271
|
+
</DropdownMenuItem>
|
|
272
|
+
<DropdownMenuSeparator />
|
|
273
|
+
<DropdownMenuItem
|
|
274
|
+
variant='destructive'
|
|
275
|
+
onSelect={handleDisconnectSelect}
|
|
276
|
+
data-testid='integrations-disconnect'
|
|
277
|
+
>
|
|
278
|
+
<DropdownMenuItemIcon>
|
|
279
|
+
<Unplug />
|
|
280
|
+
</DropdownMenuItemIcon>
|
|
281
|
+
<DropdownMenuItemText>Disconnect {integration.provider}</DropdownMenuItemText>
|
|
282
|
+
</DropdownMenuItem>
|
|
283
|
+
</>
|
|
284
|
+
)}
|
|
285
|
+
</DropdownMenuContent>
|
|
286
|
+
</DropdownMenu>
|
|
287
|
+
);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const columns: TableColumnDef<Integration>[] = [
|
|
291
|
+
{ ...INTEGRATION_COLUMN, meta: { renderMenuAction } },
|
|
292
|
+
...INFO_COLUMNS,
|
|
293
|
+
{
|
|
294
|
+
id: 'notify',
|
|
295
|
+
header: 'Notifications',
|
|
296
|
+
size: 110,
|
|
297
|
+
enableSorting: false,
|
|
298
|
+
cell: renderNotifications,
|
|
299
|
+
},
|
|
300
|
+
];
|
|
301
|
+
|
|
302
|
+
const search = query.trim().toLowerCase();
|
|
303
|
+
const matching = integrations.filter(
|
|
304
|
+
item =>
|
|
305
|
+
item.provider.toLowerCase().includes(search) ||
|
|
306
|
+
item.name.toLowerCase().includes(search) ||
|
|
307
|
+
item.destination.toLowerCase().includes(search),
|
|
308
|
+
);
|
|
309
|
+
const tabOf = (item: Integration): StatusTab =>
|
|
310
|
+
item.status === 'connected'
|
|
311
|
+
? 'connected'
|
|
312
|
+
: item.status === 'disconnected'
|
|
313
|
+
? 'disconnected'
|
|
314
|
+
: 'issues';
|
|
315
|
+
const counts = {
|
|
316
|
+
all: matching.length,
|
|
317
|
+
connected: matching.filter(item => tabOf(item) === 'connected').length,
|
|
318
|
+
issues: matching.filter(item => tabOf(item) === 'issues').length,
|
|
319
|
+
disconnected: matching.filter(item => tabOf(item) === 'disconnected').length,
|
|
320
|
+
};
|
|
321
|
+
const rows = status === 'all' ? matching : matching.filter(item => tabOf(item) === status);
|
|
322
|
+
|
|
323
|
+
const handleReset = () => {
|
|
324
|
+
setQuery('');
|
|
325
|
+
setStatus('all');
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
return (
|
|
329
|
+
<AppShell data-testid='app-shell'>
|
|
330
|
+
<AppShellHeader>
|
|
331
|
+
<TopHeader>
|
|
332
|
+
<TopHeaderLogo href='/' onClick={handleRailClick}>
|
|
333
|
+
<Logo size='md' />
|
|
334
|
+
</TopHeaderLogo>
|
|
335
|
+
<TopHeaderActions>
|
|
336
|
+
<Button variant='ghost' color='neutral' size='small' aria-label='Search'>
|
|
337
|
+
<Search />
|
|
338
|
+
</Button>
|
|
339
|
+
<TopHeaderSeparator />
|
|
340
|
+
<Button variant='ghost' color='neutral' size='small'>
|
|
341
|
+
Shop Demo
|
|
342
|
+
<ChevronUpDown />
|
|
343
|
+
</Button>
|
|
344
|
+
<ChatTrigger onClick={onOpenAssistant} />
|
|
345
|
+
<NotificationCenter>
|
|
346
|
+
<NotificationCenterTrigger />
|
|
347
|
+
</NotificationCenter>
|
|
348
|
+
<Button variant='ghost' color='neutral' size='small' aria-label='Help'>
|
|
349
|
+
<CircleHelp />
|
|
350
|
+
</Button>
|
|
351
|
+
</TopHeaderActions>
|
|
352
|
+
</TopHeader>
|
|
353
|
+
</AppShellHeader>
|
|
354
|
+
|
|
355
|
+
<AppShellRail>
|
|
356
|
+
<NavRail mode='collapsed'>
|
|
357
|
+
<NavRailBody>
|
|
358
|
+
<NavRailItem href='/' icon={HomeIcon} label='Home' onClick={handleRailClick} />
|
|
359
|
+
<NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
|
|
360
|
+
<NavRailSeparator />
|
|
361
|
+
{PRODUCTS.map(product => (
|
|
362
|
+
<NavRailItem
|
|
363
|
+
key={product.id}
|
|
364
|
+
href={`/${product.id}`}
|
|
365
|
+
icon={product.icon}
|
|
366
|
+
label={product.label}
|
|
367
|
+
shortcut={product.shortcut}
|
|
368
|
+
onClick={handleRailClick}
|
|
369
|
+
/>
|
|
370
|
+
))}
|
|
371
|
+
</NavRailBody>
|
|
372
|
+
<NavRailFooter>
|
|
373
|
+
<NavRailItem
|
|
374
|
+
href='/settings'
|
|
375
|
+
icon={Settings}
|
|
376
|
+
label='Settings'
|
|
377
|
+
shortcut={['G', 'S']}
|
|
378
|
+
active
|
|
379
|
+
onClick={handleRailClick}
|
|
380
|
+
/>
|
|
381
|
+
</NavRailFooter>
|
|
382
|
+
</NavRail>
|
|
383
|
+
</AppShellRail>
|
|
384
|
+
|
|
385
|
+
<AppShellRemote role='main'>
|
|
386
|
+
<RemoteShell
|
|
387
|
+
config={SETTINGS_NAV}
|
|
388
|
+
basePath='/settings'
|
|
389
|
+
pathname={pathname}
|
|
390
|
+
onNavigate={handleNavigate}
|
|
391
|
+
>
|
|
392
|
+
<RemoteShellPanel />
|
|
393
|
+
<RemoteShellBreadcrumb />
|
|
394
|
+
<RemoteShellContent>
|
|
395
|
+
<Page name='settings-integrations' fullSize fixedHeight data-testid='integrations-page'>
|
|
396
|
+
<PageHeader>
|
|
397
|
+
<PageHeaderGroup className='flex-1'>
|
|
398
|
+
<PageTitle>Integrations</PageTitle>
|
|
399
|
+
<PageDescription>
|
|
400
|
+
Where Wallarm sends attacks, incidents and system events, and which ones each
|
|
401
|
+
tool receives.
|
|
402
|
+
</PageDescription>
|
|
403
|
+
</PageHeaderGroup>
|
|
404
|
+
</PageHeader>
|
|
405
|
+
|
|
406
|
+
<PageToolbar>
|
|
407
|
+
<SearchInput
|
|
408
|
+
value={query}
|
|
409
|
+
onChange={setQuery}
|
|
410
|
+
placeholder='Search integration or destination'
|
|
411
|
+
className='w-[320px]'
|
|
412
|
+
data-testid='integrations-search'
|
|
413
|
+
/>
|
|
414
|
+
<SegmentedTabs
|
|
415
|
+
value={status}
|
|
416
|
+
onChange={setStatus}
|
|
417
|
+
data-testid='integrations-status-tabs'
|
|
418
|
+
>
|
|
419
|
+
<SegmentedTabsList>
|
|
420
|
+
<SegmentedTabsTrigger value='all'>
|
|
421
|
+
All <NumericBadge>{counts.all}</NumericBadge>
|
|
422
|
+
</SegmentedTabsTrigger>
|
|
423
|
+
<SegmentedTabsTrigger value='connected'>
|
|
424
|
+
Connected <NumericBadge>{counts.connected}</NumericBadge>
|
|
425
|
+
</SegmentedTabsTrigger>
|
|
426
|
+
<SegmentedTabsTrigger value='issues'>
|
|
427
|
+
Issues <NumericBadge>{counts.issues}</NumericBadge>
|
|
428
|
+
</SegmentedTabsTrigger>
|
|
429
|
+
<SegmentedTabsTrigger value='disconnected'>
|
|
430
|
+
Not connected <NumericBadge>{counts.disconnected}</NumericBadge>
|
|
431
|
+
</SegmentedTabsTrigger>
|
|
432
|
+
</SegmentedTabsList>
|
|
433
|
+
</SegmentedTabs>
|
|
434
|
+
</PageToolbar>
|
|
435
|
+
|
|
436
|
+
<PageContent>
|
|
437
|
+
<Table
|
|
438
|
+
aria-label='Integrations'
|
|
439
|
+
data={rows}
|
|
440
|
+
columns={columns}
|
|
441
|
+
getRowId={getIntegrationId}
|
|
442
|
+
activeRowId={drawerOpen ? editing.id : undefined}
|
|
443
|
+
data-testid='integrations-table'
|
|
444
|
+
>
|
|
445
|
+
<TableEmptyState>
|
|
446
|
+
<EmptyState type='collection-empty' data-testid='integrations-no-results'>
|
|
447
|
+
<EmptyStateIllustration>
|
|
448
|
+
<SearchX />
|
|
449
|
+
</EmptyStateIllustration>
|
|
450
|
+
<EmptyStateMessage>
|
|
451
|
+
<EmptyStateTitle>No results found</EmptyStateTitle>
|
|
452
|
+
<EmptyStateDescription>
|
|
453
|
+
No integrations match your search or status.
|
|
454
|
+
</EmptyStateDescription>
|
|
455
|
+
</EmptyStateMessage>
|
|
456
|
+
<EmptyStateActions>
|
|
457
|
+
<Button
|
|
458
|
+
size='medium'
|
|
459
|
+
variant='outline'
|
|
460
|
+
color='neutral'
|
|
461
|
+
onClick={handleReset}
|
|
462
|
+
>
|
|
463
|
+
<FilterX />
|
|
464
|
+
Reset filters
|
|
465
|
+
</Button>
|
|
466
|
+
</EmptyStateActions>
|
|
467
|
+
</EmptyState>
|
|
468
|
+
</TableEmptyState>
|
|
469
|
+
</Table>
|
|
470
|
+
</PageContent>
|
|
471
|
+
|
|
472
|
+
<Drawer
|
|
473
|
+
open={drawerOpen}
|
|
474
|
+
onOpenChange={handleDrawerOpenChange}
|
|
475
|
+
width={700}
|
|
476
|
+
data-testid='integration-drawer'
|
|
477
|
+
>
|
|
478
|
+
<DrawerContent>
|
|
479
|
+
<DrawerHeader>
|
|
480
|
+
<DrawerTitle>
|
|
481
|
+
{isConnect
|
|
482
|
+
? `Connect ${editing.provider}`
|
|
483
|
+
: `Edit ${editing.provider} integration`}
|
|
484
|
+
</DrawerTitle>
|
|
485
|
+
<DrawerDescription>
|
|
486
|
+
{editing.category} · Wallarm sends the selected events to this{' '}
|
|
487
|
+
{inSentence(editing.destinationLabel)}.
|
|
488
|
+
</DrawerDescription>
|
|
489
|
+
</DrawerHeader>
|
|
490
|
+
<form onSubmit={handleSubmit} className='flex min-h-0 flex-1 flex-col'>
|
|
491
|
+
<DrawerBody>
|
|
492
|
+
<VStack gap={16}>
|
|
493
|
+
{saveError && (
|
|
494
|
+
<Alert color='destructive' data-testid='integration-save-error'>
|
|
495
|
+
<AlertIcon />
|
|
496
|
+
<AlertContent>
|
|
497
|
+
<AlertTitle>Couldn't save changes</AlertTitle>
|
|
498
|
+
<AlertDescription>{saveError}</AlertDescription>
|
|
499
|
+
</AlertContent>
|
|
500
|
+
</Alert>
|
|
501
|
+
)}
|
|
502
|
+
<Timeline>
|
|
503
|
+
<TimelineItem>
|
|
504
|
+
<TimelineConnector>
|
|
505
|
+
<TimelineIndicator>1</TimelineIndicator>
|
|
506
|
+
<TimelineSeparator />
|
|
507
|
+
</TimelineConnector>
|
|
508
|
+
<TimelineContent>
|
|
509
|
+
<TimelineTitle>Destination</TimelineTitle>
|
|
510
|
+
<VStack gap={12}>
|
|
511
|
+
<div className='grid grid-cols-2 gap-12'>
|
|
512
|
+
<Field required>
|
|
513
|
+
<FieldLabel>
|
|
514
|
+
Name
|
|
515
|
+
<FieldIndicator />
|
|
516
|
+
</FieldLabel>
|
|
517
|
+
<Input
|
|
518
|
+
value={draft.name}
|
|
519
|
+
onChange={handleNameChange}
|
|
520
|
+
placeholder='SOC alerts'
|
|
521
|
+
data-testid='integration-name'
|
|
522
|
+
/>
|
|
523
|
+
</Field>
|
|
524
|
+
<Field required>
|
|
525
|
+
<FieldLabel>
|
|
526
|
+
Minimum severity
|
|
527
|
+
<FieldIndicator />
|
|
528
|
+
</FieldLabel>
|
|
529
|
+
<Select
|
|
530
|
+
collection={severities}
|
|
531
|
+
value={[draft.severity]}
|
|
532
|
+
onValueChange={handleSeverityChange}
|
|
533
|
+
>
|
|
534
|
+
<SelectInput className='w-full' />
|
|
535
|
+
<SelectPositioner>
|
|
536
|
+
<SelectContent>
|
|
537
|
+
{severities.items.map(item => (
|
|
538
|
+
<SelectOption key={item.value} item={item}>
|
|
539
|
+
<SelectOptionText>{item.label}</SelectOptionText>
|
|
540
|
+
<SelectOptionIndicator />
|
|
541
|
+
</SelectOption>
|
|
542
|
+
))}
|
|
543
|
+
</SelectContent>
|
|
544
|
+
</SelectPositioner>
|
|
545
|
+
</Select>
|
|
546
|
+
</Field>
|
|
547
|
+
</div>
|
|
548
|
+
<Field required>
|
|
549
|
+
<FieldLabel>
|
|
550
|
+
{editing.destinationLabel}
|
|
551
|
+
<FieldIndicator />
|
|
552
|
+
</FieldLabel>
|
|
553
|
+
<Input
|
|
554
|
+
value={draft.destination}
|
|
555
|
+
onChange={handleDestinationChange}
|
|
556
|
+
data-testid='integration-destination'
|
|
557
|
+
/>
|
|
558
|
+
</Field>
|
|
559
|
+
</VStack>
|
|
560
|
+
</TimelineContent>
|
|
561
|
+
</TimelineItem>
|
|
562
|
+
<TimelineItem>
|
|
563
|
+
<TimelineConnector>
|
|
564
|
+
<TimelineIndicator>2</TimelineIndicator>
|
|
565
|
+
<TimelineSeparator />
|
|
566
|
+
</TimelineConnector>
|
|
567
|
+
<TimelineContent>
|
|
568
|
+
<TimelineTitle>Events</TimelineTitle>
|
|
569
|
+
<CheckboxGroup
|
|
570
|
+
variant='card'
|
|
571
|
+
name='events'
|
|
572
|
+
value={draft.events}
|
|
573
|
+
onValueChange={handleEventsChange}
|
|
574
|
+
>
|
|
575
|
+
{EVENTS.map(event => (
|
|
576
|
+
<Checkbox
|
|
577
|
+
key={event.value}
|
|
578
|
+
value={event.value}
|
|
579
|
+
data-testid={`integration-event-${event.value}`}
|
|
580
|
+
>
|
|
581
|
+
<CheckboxIndicator />
|
|
582
|
+
<CheckboxLabel>{event.label}</CheckboxLabel>
|
|
583
|
+
<CheckboxDescription>{event.description}</CheckboxDescription>
|
|
584
|
+
</Checkbox>
|
|
585
|
+
))}
|
|
586
|
+
</CheckboxGroup>
|
|
587
|
+
</TimelineContent>
|
|
588
|
+
</TimelineItem>
|
|
589
|
+
<TimelineItem>
|
|
590
|
+
<TimelineConnector>
|
|
591
|
+
<TimelineIndicator>3</TimelineIndicator>
|
|
592
|
+
</TimelineConnector>
|
|
593
|
+
<TimelineContent>
|
|
594
|
+
<TimelineTitle>Test delivery</TimelineTitle>
|
|
595
|
+
<VStack gap={12} align='start'>
|
|
596
|
+
<Text size='sm' color='secondary'>
|
|
597
|
+
Allow 203.0.113.0/24 and 198.51.100.0/24 if the destination
|
|
598
|
+
filters by source IP.
|
|
599
|
+
</Text>
|
|
600
|
+
<Button
|
|
601
|
+
variant='outline'
|
|
602
|
+
color='neutral'
|
|
603
|
+
disabled={draft.destination.trim() === ''}
|
|
604
|
+
loading={testing}
|
|
605
|
+
onClick={handleTestInForm}
|
|
606
|
+
data-testid='integration-test'
|
|
607
|
+
>
|
|
608
|
+
<Zap />
|
|
609
|
+
Send test notification
|
|
610
|
+
</Button>
|
|
611
|
+
{testDelivered && (
|
|
612
|
+
<Alert color='success' data-testid='integration-test-result'>
|
|
613
|
+
<AlertIcon />
|
|
614
|
+
<AlertContent>
|
|
615
|
+
<AlertTitle>Test delivered to {draft.destination}</AlertTitle>
|
|
616
|
+
<AlertDescription>
|
|
617
|
+
Check {editing.provider} for a message from Wallarm.
|
|
618
|
+
</AlertDescription>
|
|
619
|
+
</AlertContent>
|
|
620
|
+
</Alert>
|
|
621
|
+
)}
|
|
622
|
+
{testError && (
|
|
623
|
+
<Alert color='destructive' data-testid='integration-test-error'>
|
|
624
|
+
<AlertIcon />
|
|
625
|
+
<AlertContent>
|
|
626
|
+
<AlertTitle>Test failed</AlertTitle>
|
|
627
|
+
<AlertDescription>{testError}</AlertDescription>
|
|
628
|
+
</AlertContent>
|
|
629
|
+
</Alert>
|
|
630
|
+
)}
|
|
631
|
+
</VStack>
|
|
632
|
+
</TimelineContent>
|
|
633
|
+
</TimelineItem>
|
|
634
|
+
</Timeline>
|
|
635
|
+
</VStack>
|
|
636
|
+
</DrawerBody>
|
|
637
|
+
<DrawerFooter>
|
|
638
|
+
<DrawerClose asChild>
|
|
639
|
+
<Button variant='ghost' color='neutral'>
|
|
640
|
+
Cancel
|
|
641
|
+
</Button>
|
|
642
|
+
</DrawerClose>
|
|
643
|
+
<Button
|
|
644
|
+
type='submit'
|
|
645
|
+
disabled={!canSubmit}
|
|
646
|
+
loading={saving}
|
|
647
|
+
data-testid='integration-submit'
|
|
648
|
+
>
|
|
649
|
+
{isConnect ? `Connect ${editing.provider}` : 'Save changes'}
|
|
650
|
+
</Button>
|
|
651
|
+
</DrawerFooter>
|
|
652
|
+
</form>
|
|
653
|
+
</DrawerContent>
|
|
654
|
+
</Drawer>
|
|
655
|
+
|
|
656
|
+
<Dialog
|
|
657
|
+
width={400}
|
|
658
|
+
open={dialogOpen}
|
|
659
|
+
onOpenChange={handleDialogOpenChange}
|
|
660
|
+
data-testid='disconnect-dialog'
|
|
661
|
+
>
|
|
662
|
+
<DialogContent>
|
|
663
|
+
<DialogHeader>
|
|
664
|
+
<DialogTitle>Disconnect {disconnecting.provider}?</DialogTitle>
|
|
665
|
+
<DialogDescription>
|
|
666
|
+
Wallarm stops sending events to {disconnecting.destination}. The event and
|
|
667
|
+
severity settings are kept, so you can reconnect later.
|
|
668
|
+
</DialogDescription>
|
|
669
|
+
</DialogHeader>
|
|
670
|
+
<DialogFooter>
|
|
671
|
+
<DialogClose asChild>
|
|
672
|
+
<Button variant='ghost' color='neutral'>
|
|
673
|
+
Cancel
|
|
674
|
+
</Button>
|
|
675
|
+
</DialogClose>
|
|
676
|
+
<Button
|
|
677
|
+
color='destructive'
|
|
678
|
+
loading={pendingDisconnect}
|
|
679
|
+
onClick={handleDisconnect}
|
|
680
|
+
data-testid='disconnect-confirm'
|
|
681
|
+
>
|
|
682
|
+
Disconnect {disconnecting.provider}
|
|
683
|
+
</Button>
|
|
684
|
+
</DialogFooter>
|
|
685
|
+
</DialogContent>
|
|
686
|
+
</Dialog>
|
|
687
|
+
</Page>
|
|
688
|
+
</RemoteShellContent>
|
|
689
|
+
</RemoteShell>
|
|
690
|
+
</AppShellRemote>
|
|
691
|
+
</AppShell>
|
|
692
|
+
);
|
|
693
|
+
};
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
First load: skeleton rows under the real header, tabs without counts.
|
|
697
|
+
|
|
698
|
+
First load: the real header and toolbar with skeleton rows under the column headers, and tabs
|
|
699
|
+
without counts until the data arrives. Never a `Loader` in place of the table.
|
|
700
|
+
|
|
701
|
+
```tsx story=Loading
|
|
702
|
+
import { AppShell, AppShellHeader, AppShellRail, AppShellRemote } from '@wallarm-org/design-system/AppShell';
|
|
703
|
+
import { Button } from '@wallarm-org/design-system/Button';
|
|
704
|
+
import { ChatTrigger } from '@wallarm-org/design-system/Chat';
|
|
705
|
+
import { ChevronUpDown, CircleHelp, History, Home as HomeIcon, Search, Settings } from '@wallarm-org/design-system/icons';
|
|
706
|
+
import { Logo } from '@wallarm-org/design-system/Logo';
|
|
707
|
+
import { NavRail, NavRailBody, NavRailFooter, NavRailItem, NavRailSeparator } from '@wallarm-org/design-system/NavRail';
|
|
708
|
+
import { NotificationCenter, NotificationCenterTrigger } from '@wallarm-org/design-system/NotificationCenter';
|
|
709
|
+
import { Page, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
|
|
710
|
+
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel } from '@wallarm-org/design-system/RemoteShell';
|
|
711
|
+
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
|
|
712
|
+
import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
|
|
713
|
+
import { Table } from '@wallarm-org/design-system/Table';
|
|
714
|
+
import { TopHeader, TopHeaderActions, TopHeaderLogo, TopHeaderSeparator } from '@wallarm-org/design-system/TopHeader';
|
|
715
|
+
|
|
716
|
+
export const Loading = () => (
|
|
717
|
+
<AppShell data-testid='app-shell'>
|
|
718
|
+
<AppShellHeader>
|
|
719
|
+
<TopHeader>
|
|
720
|
+
<TopHeaderLogo href='/' onClick={handleRailClick}>
|
|
721
|
+
<Logo size='md' />
|
|
722
|
+
</TopHeaderLogo>
|
|
723
|
+
<TopHeaderActions>
|
|
724
|
+
<Button variant='ghost' color='neutral' size='small' aria-label='Search'>
|
|
725
|
+
<Search />
|
|
726
|
+
</Button>
|
|
727
|
+
<TopHeaderSeparator />
|
|
728
|
+
<Button variant='ghost' color='neutral' size='small'>
|
|
729
|
+
Shop Demo
|
|
730
|
+
<ChevronUpDown />
|
|
731
|
+
</Button>
|
|
732
|
+
<ChatTrigger onClick={onOpenAssistant} />
|
|
733
|
+
<NotificationCenter>
|
|
734
|
+
<NotificationCenterTrigger />
|
|
735
|
+
</NotificationCenter>
|
|
736
|
+
<Button variant='ghost' color='neutral' size='small' aria-label='Help'>
|
|
737
|
+
<CircleHelp />
|
|
738
|
+
</Button>
|
|
739
|
+
</TopHeaderActions>
|
|
740
|
+
</TopHeader>
|
|
741
|
+
</AppShellHeader>
|
|
742
|
+
|
|
743
|
+
<AppShellRail>
|
|
744
|
+
<NavRail mode='collapsed'>
|
|
745
|
+
<NavRailBody>
|
|
746
|
+
<NavRailItem href='/' icon={HomeIcon} label='Home' onClick={handleRailClick} />
|
|
747
|
+
<NavRailItem href='/recent' icon={History} label='Recent' onClick={handleRailClick} />
|
|
748
|
+
<NavRailSeparator />
|
|
749
|
+
{PRODUCTS.map(product => (
|
|
750
|
+
<NavRailItem
|
|
751
|
+
key={product.id}
|
|
752
|
+
href={`/${product.id}`}
|
|
753
|
+
icon={product.icon}
|
|
754
|
+
label={product.label}
|
|
755
|
+
shortcut={product.shortcut}
|
|
756
|
+
onClick={handleRailClick}
|
|
757
|
+
/>
|
|
758
|
+
))}
|
|
759
|
+
</NavRailBody>
|
|
760
|
+
<NavRailFooter>
|
|
761
|
+
<NavRailItem
|
|
762
|
+
href='/settings'
|
|
763
|
+
icon={Settings}
|
|
764
|
+
label='Settings'
|
|
765
|
+
shortcut={['G', 'S']}
|
|
766
|
+
active
|
|
767
|
+
onClick={handleRailClick}
|
|
768
|
+
/>
|
|
769
|
+
</NavRailFooter>
|
|
770
|
+
</NavRail>
|
|
771
|
+
</AppShellRail>
|
|
772
|
+
|
|
773
|
+
<AppShellRemote role='main'>
|
|
774
|
+
<RemoteShell
|
|
775
|
+
config={SETTINGS_NAV}
|
|
776
|
+
basePath='/settings'
|
|
777
|
+
pathname={PATHNAME}
|
|
778
|
+
onNavigate={onNavigate}
|
|
779
|
+
>
|
|
780
|
+
<RemoteShellPanel />
|
|
781
|
+
<RemoteShellBreadcrumb />
|
|
782
|
+
<RemoteShellContent>
|
|
783
|
+
<Page name='settings-integrations' fullSize fixedHeight data-testid='integrations-page'>
|
|
784
|
+
<PageHeader>
|
|
785
|
+
<PageHeaderGroup className='flex-1'>
|
|
786
|
+
<PageTitle>Integrations</PageTitle>
|
|
787
|
+
<PageDescription>
|
|
788
|
+
Where Wallarm sends attacks, incidents and system events, and which ones each tool
|
|
789
|
+
receives.
|
|
790
|
+
</PageDescription>
|
|
791
|
+
</PageHeaderGroup>
|
|
792
|
+
</PageHeader>
|
|
793
|
+
|
|
794
|
+
<PageToolbar>
|
|
795
|
+
<SearchInput
|
|
796
|
+
placeholder='Search integration or destination'
|
|
797
|
+
className='w-[320px]'
|
|
798
|
+
data-testid='integrations-search'
|
|
799
|
+
/>
|
|
800
|
+
<SegmentedTabs defaultValue='all' data-testid='integrations-status-tabs'>
|
|
801
|
+
<SegmentedTabsList>
|
|
802
|
+
<SegmentedTabsTrigger value='all'>All</SegmentedTabsTrigger>
|
|
803
|
+
<SegmentedTabsTrigger value='connected'>Connected</SegmentedTabsTrigger>
|
|
804
|
+
<SegmentedTabsTrigger value='issues'>Issues</SegmentedTabsTrigger>
|
|
805
|
+
<SegmentedTabsTrigger value='disconnected'>Not connected</SegmentedTabsTrigger>
|
|
806
|
+
</SegmentedTabsList>
|
|
807
|
+
</SegmentedTabs>
|
|
808
|
+
</PageToolbar>
|
|
809
|
+
|
|
810
|
+
<PageContent>
|
|
811
|
+
<Table
|
|
812
|
+
aria-label='Integrations'
|
|
813
|
+
data={[]}
|
|
814
|
+
columns={STATIC_COLUMNS}
|
|
815
|
+
isLoading
|
|
816
|
+
data-testid='integrations-table'
|
|
817
|
+
/>
|
|
818
|
+
</PageContent>
|
|
819
|
+
</Page>
|
|
820
|
+
</RemoteShellContent>
|
|
821
|
+
</RemoteShell>
|
|
822
|
+
</AppShellRemote>
|
|
823
|
+
</AppShell>
|
|
824
|
+
);
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
## Related
|
|
828
|
+
|
|
829
|
+
- [Application layout](../patterns/app-layout.md)
|
|
830
|
+
- [Resource list page](../patterns/resource-list-page.md)
|
|
831
|
+
- [Entity table](../patterns/entity-table.md)
|
|
832
|
+
- [Create and edit forms](../patterns/create-edit-forms.md)
|
|
833
|
+
- [Confirmation dialogs](../patterns/confirmation-dialogs.md)
|
|
834
|
+
- [Feedback toasts](../patterns/feedback-toasts.md)
|
|
835
|
+
- [Empty states](../patterns/empty-states.md)
|
|
836
|
+
- [Settings page](../patterns/settings-page.md): independent values that save on their own.
|