@oneuptime/common 11.4.0 → 11.5.0
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/Models/DatabaseModels/AIRun.ts +50 -0
- package/Models/DatabaseModels/AlertSeverity.ts +6 -0
- package/Models/DatabaseModels/IncidentSeverity.ts +6 -0
- package/Models/DatabaseModels/Index.ts +16 -0
- package/Models/DatabaseModels/IoTDeviceCredential.ts +471 -0
- package/Models/DatabaseModels/LlmLog.ts +56 -0
- package/Models/DatabaseModels/LlmProvider.ts +33 -0
- package/Models/DatabaseModels/NetworkDevice.ts +1385 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +717 -0
- package/Models/DatabaseModels/NetworkDeviceLabelRule.ts +514 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerRule.ts +596 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerTeam.ts +487 -0
- package/Models/DatabaseModels/NetworkDeviceOwnerUser.ts +486 -0
- package/Models/DatabaseModels/NetworkInterface.ts +563 -0
- package/Models/DatabaseModels/Project.ts +145 -0
- package/Models/DatabaseModels/TelemetryEntityRelationship.ts +54 -0
- package/Server/API/AIAgentTaskAPI.ts +10 -24
- package/Server/API/AIInvestigationAPI.ts +131 -63
- package/Server/API/AlertAPI.ts +5 -0
- package/Server/API/IncidentAPI.ts +10 -0
- package/Server/API/IncidentEpisodeAPI.ts +5 -0
- package/Server/API/LlmProviderAPI.ts +4 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +5 -0
- package/Server/API/TelemetryAPI.ts +4 -3
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.ts +105 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.ts +15 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.ts +192 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
- package/Server/Services/AIAgentTaskService.ts +62 -0
- package/Server/Services/AIRunService.ts +58 -0
- package/Server/Services/AIService.ts +101 -0
- package/Server/Services/AnalyticsDatabaseService.ts +27 -0
- package/Server/Services/IncidentService.ts +14 -41
- package/Server/Services/Index.ts +14 -0
- package/Server/Services/IoTDeviceCredentialService.ts +351 -0
- package/Server/Services/IoTDeviceService.ts +64 -21
- package/Server/Services/LlmLogService.ts +26 -0
- package/Server/Services/LlmProviderService.ts +3 -0
- package/Server/Services/LogAggregationService.ts +29 -11
- package/Server/Services/MetricService.ts +603 -13
- package/Server/Services/MonitorService.ts +4 -1
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +10 -0
- package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +204 -0
- package/Server/Services/NetworkDeviceLabelRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerRuleEngineService.ts +222 -0
- package/Server/Services/NetworkDeviceOwnerRuleService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +10 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +10 -0
- package/Server/Services/NetworkDeviceService.ts +50 -0
- package/Server/Services/NetworkInterfaceService.ts +10 -0
- package/Server/Services/TelemetryEntityRelationshipService.ts +23 -0
- package/Server/Services/TelemetryEntityService.ts +72 -2
- package/Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts +244 -12
- package/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts +92 -19
- package/Server/Utils/AI/Sentinel/InvestigationQueue.ts +493 -0
- package/Server/Utils/AI/Sentinel/README.md +10 -0
- package/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.ts +88 -68
- package/Server/Utils/AI/Toolbox/Index.ts +2 -1
- package/Server/Utils/AI/Toolbox/MetricTools.ts +391 -0
- package/Server/Utils/LLM/LLMService.ts +21 -0
- package/Server/Utils/Monitor/Criteria/APIRequestCriteria.ts +44 -0
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +170 -2
- package/Server/Utils/Monitor/IoTDeviceAbsenceSeries.ts +101 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +15 -3
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +1 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +19 -3
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +195 -2
- package/Server/Utils/Monitor/MonitorResource.ts +77 -21
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +1 -1
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +201 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +215 -0
- package/Server/Utils/Monitor/SnmpInterfaceRateUtil.ts +169 -0
- package/Tests/Server/Services/AIAgentTaskServiceClaim.test.ts +146 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +173 -0
- package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +97 -0
- package/Tests/Server/Services/IoTDeviceService.test.ts +54 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +22 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +194 -0
- package/Tests/Server/Utils/AI/BaselineAnomalyTool.test.ts +253 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +44 -0
- package/Tests/Server/Utils/AI/SentinelAlertGating.test.ts +360 -0
- package/Tests/Server/Utils/AI/SentinelInvestigationQueue.test.ts +295 -0
- package/Tests/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.test.ts +59 -0
- package/Tests/Server/Utils/Monitor/IoTDeviceAbsenceSeries.test.ts +113 -0
- package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +198 -0
- package/Tests/Types/AI/AIAgentTaskStatus.test.ts +86 -0
- package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +127 -0
- package/Tests/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.test.ts +152 -0
- package/Tests/Types/Monitor/MonitorType.test.ts +1 -1
- package/Tests/Types/Trace/TraceRecordingRuleDefinition.test.ts +308 -0
- package/Tests/UI/Components/Dropdown.test.tsx +17 -0
- package/Tests/UI/Components/EntityDropdown.test.tsx +130 -0
- package/Tests/UI/Components/Modal.test.tsx +144 -2
- package/Tests/UI/Components/TelemetrySearchBar.test.tsx +90 -0
- package/Tests/UI/Utils/Theme.test.ts +161 -0
- package/Tests/Utils/Monitor/LatencyMatrixUtil.test.ts +111 -0
- package/Types/AI/AIRunStatus.ts +9 -0
- package/Types/BaseDatabase/AggregateBy.ts +12 -0
- package/Types/Dashboard/DashboardComponentType.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.ts +24 -0
- package/Types/Dashboard/DashboardTemplates.ts +9 -1
- package/Types/LlmLogStatus.ts +1 -0
- package/Types/Monitor/CriteriaFilter.ts +9 -0
- package/Types/Monitor/HttpPhaseTimings.ts +16 -0
- package/Types/Monitor/IotAlertTemplates.ts +22 -3
- package/Types/Monitor/LatencyMatrix.ts +27 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +2 -2
- package/Types/Monitor/MonitorMetricType.ts +27 -0
- package/Types/Monitor/MonitorStep.ts +36 -11
- package/Types/Monitor/MonitorStepNetworkDeviceMonitor.ts +55 -0
- package/Types/Monitor/MonitorStepSnmpMonitor.ts +8 -0
- package/Types/Monitor/MonitorType.ts +14 -9
- package/Types/Monitor/PingMonitor/PingMonitorResponse.ts +20 -0
- package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +12 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.ts +116 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +29 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +31 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +24 -0
- package/Types/Monitor/SnmpMonitor/SnmpTrap.ts +20 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +173 -0
- package/Types/Permission.ts +314 -0
- package/Types/Probe/ProbeMonitorResponse.ts +22 -0
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +8 -5
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +4 -1
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +6 -3
- package/UI/Components/CodeBlock/CodeBlock.tsx +2 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +3 -0
- package/UI/Components/Divider/Divider.tsx +1 -1
- package/UI/Components/Dropdown/Dropdown.tsx +13 -4
- package/UI/Components/EntityDropdown/EntityDropdown.tsx +110 -2
- package/UI/Components/ErrorBoundary.tsx +2 -1
- package/UI/Components/EventItem/EventItem.tsx +2 -2
- package/UI/Components/GanttChart/Bar/Index.tsx +1 -1
- package/UI/Components/Graphs/UptimeBarTooltip.tsx +30 -23
- package/UI/Components/Header/Header.tsx +7 -0
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +2 -0
- package/UI/Components/Icon/Icon.tsx +8 -6
- package/UI/Components/Label/Label.tsx +2 -2
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +22 -10
- package/UI/Components/LogsViewer/components/LogsHistogram.tsx +9 -3
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +8 -8
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +44 -20
- package/UI/Components/Modal/ConfirmModal.tsx +1 -1
- package/UI/Components/Modal/Modal.tsx +213 -121
- package/UI/Components/Modal/ModalFooter.tsx +33 -22
- package/UI/Components/ModelTable/TableView.tsx +1 -1
- package/UI/Components/MonitorGraphs/UptimeBarDayModal.tsx +20 -12
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +2 -2
- package/UI/Components/Pill/Pill.tsx +21 -13
- package/UI/Components/StatusBubble/StatusBubble.tsx +3 -3
- package/UI/Components/Tabs/Tabs.tsx +10 -1
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +7 -1
- package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +9 -3
- package/UI/Components/TelemetryViewer/components/TelemetrySearchBar.tsx +62 -4
- package/UI/Components/Workflow/Component.tsx +53 -33
- package/UI/Components/Workflow/ComponentPortViewer.tsx +6 -6
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +8 -8
- package/UI/Components/Workflow/ComponentsModal.tsx +16 -9
- package/UI/Components/Workflow/Workflow.tsx +13 -11
- package/UI/Utils/Navigation.ts +10 -1
- package/UI/Utils/Theme.ts +140 -0
- package/Utils/Dashboard/Components/DashboardLogChartComponent.ts +99 -0
- package/Utils/Dashboard/Components/Index.ts +7 -0
- package/Utils/Monitor/LatencyMatrixUtil.ts +162 -0
- package/Utils/Monitor/MonitorMetricType.ts +141 -3
- package/Utils/Monitor/NetworkTopologyUtil.ts +159 -0
- package/Utils/Telemetry/EntityRelationship.ts +11 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +52 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js +6 -0
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js +493 -0
- package/build/dist/Models/DatabaseModels/IoTDeviceCredential.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js +58 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmProvider.js +33 -0
- package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +1426 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +738 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js +503 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js +502 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +589 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Project.js +147 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js +57 -0
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskAPI.js +8 -23
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +95 -55
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +5 -0
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +10 -0
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +5 -0
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +5 -7
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +5 -0
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783650000000-AddAdditionalParamsToLlmProvider.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783695782697-AddCacheTokenColumnsToLlmLog.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783701585317-AddAlertInvestigationGating.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783702431535-AddAiDailyAutonomousTokenLimitToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js +51 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783720000000-AddNetworkDeviceTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783721121260-AddAttemptCountToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js +101 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783730000000-AddNetworkDeviceOwnersAndRules.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783740000000-AddNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783750000000-AddLldpNeighborsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783760576655-AddInvestigationTuningToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783762505482-AddTelemetryEntityRelationshipMetrics.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783780000000-AddIoTDeviceCredentialTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783790000000-AddSnmpV3AuthColumnsToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIAgentTaskService.js +59 -0
- package/build/dist/Server/Services/AIAgentTaskService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +33 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +82 -9
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +19 -0
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +14 -25
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +14 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceCredentialService.js +321 -0
- package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -0
- package/build/dist/Server/Services/IoTDeviceService.js +49 -15
- package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
- package/build/dist/Server/Services/LlmLogService.js +29 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +3 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +21 -7
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +449 -7
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +2 -1
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +166 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js +186 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +52 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js +9 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js +22 -0
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryEntityService.js +64 -2
- package/build/dist/Server/Services/TelemetryEntityService.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js +189 -9
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js +84 -17
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js +428 -0
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js +63 -47
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +300 -0
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +16 -0
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js +29 -0
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +130 -2
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js +81 -0
- package/build/dist/Server/Utils/Monitor/IoTDeviceAbsenceSeries.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +18 -7
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +25 -10
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +155 -5
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +76 -30
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +147 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +167 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js +93 -0
- package/build/dist/Server/Utils/Monitor/SnmpInterfaceRateUtil.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +9 -0
- package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardLogChartComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +9 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/LlmLogStatus.js +1 -0
- package/build/dist/Types/LlmLogStatus.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +9 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/HttpPhaseTimings.js +2 -0
- package/build/dist/Types/Monitor/HttpPhaseTimings.js.map +1 -0
- package/build/dist/Types/Monitor/IotAlertTemplates.js +7 -7
- package/build/dist/Types/Monitor/IotAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/LatencyMatrix.js +2 -0
- package/build/dist/Types/Monitor/LatencyMatrix.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +2 -2
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorMetricType.js +24 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +22 -9
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js +36 -0
- package/build/dist/Types/Monitor/MonitorStepNetworkDeviceMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSnmpMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +14 -9
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/PingMonitor/PingMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/PingMonitor/PingMonitorResponse.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/LldpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +89 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/NetworkTopology.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpInterface.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpTrap.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +137 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -0
- package/build/dist/Types/Permission.js +280 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +7 -4
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +4 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +6 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +3 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Divider/Divider.js +1 -1
- package/build/dist/UI/Components/Divider/Divider.js.map +1 -1
- package/build/dist/UI/Components/Dropdown/Dropdown.js +10 -4
- package/build/dist/UI/Components/Dropdown/Dropdown.js.map +1 -1
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js +76 -3
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +2 -1
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/EventItem/EventItem.js +2 -2
- package/build/dist/UI/Components/EventItem/EventItem.js.map +1 -1
- package/build/dist/UI/Components/GanttChart/Bar/Index.js +1 -1
- package/build/dist/UI/Components/GanttChart/Bar/Index.js.map +1 -1
- package/build/dist/UI/Components/Graphs/UptimeBarTooltip.js +29 -23
- package/build/dist/UI/Components/Graphs/UptimeBarTooltip.js.map +1 -1
- package/build/dist/UI/Components/Header/Header.js +1 -0
- package/build/dist/UI/Components/Header/Header.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +8 -6
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Label/Label.js +2 -2
- package/build/dist/UI/Components/Label/Label.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +20 -8
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +8 -2
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +8 -8
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +40 -20
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +109 -51
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js +13 -10
- package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/TableView.js +1 -1
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/MonitorGraphs/UptimeBarDayModal.js +17 -12
- package/build/dist/UI/Components/MonitorGraphs/UptimeBarDayModal.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +2 -2
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Pill/Pill.js +12 -13
- package/build/dist/UI/Components/Pill/Pill.js.map +1 -1
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js +3 -3
- package/build/dist/UI/Components/StatusBubble/StatusBubble.js.map +1 -1
- package/build/dist/UI/Components/Tabs/Tabs.js +3 -1
- package/build/dist/UI/Components/Tabs/Tabs.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +8 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js +36 -6
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Component.js +43 -33
- package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js +6 -6
- package/build/dist/UI/Components/Workflow/ComponentPortViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +8 -8
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +15 -9
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +13 -11
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +11 -1
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/Theme.js +106 -0
- package/build/dist/UI/Utils/Theme.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js +89 -0
- package/build/dist/Utils/Dashboard/Components/DashboardLogChartComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +4 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js +89 -0
- package/build/dist/Utils/Monitor/LatencyMatrixUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js +138 -4
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +112 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import DatabaseCommonInteractionProps from "../../../Types/BaseDatabase/DatabaseCommonInteractionProps";
|
|
2
|
+
import DatabaseCommonInteractionPropsUtil, {
|
|
3
|
+
PermissionType,
|
|
4
|
+
} from "../../../Types/BaseDatabase/DatabaseCommonInteractionPropsUtil";
|
|
5
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
6
|
+
import Permission, {
|
|
7
|
+
UserPermission,
|
|
8
|
+
UserTenantAccessPermission,
|
|
9
|
+
} from "../../../Types/Permission";
|
|
10
|
+
|
|
11
|
+
describe("DatabaseCommonInteractionPropsUtil.getUserPermissions", () => {
|
|
12
|
+
const makePerm: (
|
|
13
|
+
permission: Permission,
|
|
14
|
+
isBlockPermission: boolean,
|
|
15
|
+
) => UserPermission = (
|
|
16
|
+
permission: Permission,
|
|
17
|
+
isBlockPermission: boolean,
|
|
18
|
+
): UserPermission => {
|
|
19
|
+
return {
|
|
20
|
+
_type: "UserPermission",
|
|
21
|
+
permission,
|
|
22
|
+
labelIds: [],
|
|
23
|
+
isBlockPermission,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const permissionsOf: (result: Array<UserPermission>) => Array<Permission> = (
|
|
28
|
+
result: Array<UserPermission>,
|
|
29
|
+
): Array<Permission> => {
|
|
30
|
+
return result.map((p: UserPermission): Permission => {
|
|
31
|
+
return p.permission;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
describe("global permissions", () => {
|
|
36
|
+
test("always grants Public for an anonymous Allow request", () => {
|
|
37
|
+
const props: DatabaseCommonInteractionProps = {};
|
|
38
|
+
|
|
39
|
+
const perms: Array<Permission> = permissionsOf(
|
|
40
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
41
|
+
props,
|
|
42
|
+
PermissionType.Allow,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
expect(perms).toContain(Permission.Public);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("adds CurrentUser when a user is logged in", () => {
|
|
50
|
+
const props: DatabaseCommonInteractionProps = {
|
|
51
|
+
userId: ObjectID.generate(),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const perms: Array<Permission> = permissionsOf(
|
|
55
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
56
|
+
props,
|
|
57
|
+
PermissionType.Allow,
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
expect(perms).toContain(Permission.Public);
|
|
62
|
+
expect(perms).toContain(Permission.CurrentUser);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("preserves existing global permissions and appends Public", () => {
|
|
66
|
+
const props: DatabaseCommonInteractionProps = {
|
|
67
|
+
userGlobalAccessPermission: {
|
|
68
|
+
_type: "UserGlobalAccessPermission",
|
|
69
|
+
projectIds: [],
|
|
70
|
+
globalPermissions: [Permission.ProjectOwner],
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const perms: Array<Permission> = permissionsOf(
|
|
75
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
76
|
+
props,
|
|
77
|
+
PermissionType.Allow,
|
|
78
|
+
),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
expect(perms).toContain(Permission.ProjectOwner);
|
|
82
|
+
expect(perms).toContain(Permission.Public);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("does not include global permissions for a Block request", () => {
|
|
86
|
+
const props: DatabaseCommonInteractionProps = {};
|
|
87
|
+
|
|
88
|
+
expect(
|
|
89
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
90
|
+
props,
|
|
91
|
+
PermissionType.Block,
|
|
92
|
+
),
|
|
93
|
+
).toEqual([]);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe("tenant permissions", () => {
|
|
98
|
+
const buildTenantProps: () => {
|
|
99
|
+
props: DatabaseCommonInteractionProps;
|
|
100
|
+
tenantId: ObjectID;
|
|
101
|
+
} = (): {
|
|
102
|
+
props: DatabaseCommonInteractionProps;
|
|
103
|
+
tenantId: ObjectID;
|
|
104
|
+
} => {
|
|
105
|
+
const tenantId: ObjectID = ObjectID.generate();
|
|
106
|
+
const tenantPermission: UserTenantAccessPermission = {
|
|
107
|
+
_type: "UserTenantAccessPermission",
|
|
108
|
+
projectId: tenantId,
|
|
109
|
+
permissions: [
|
|
110
|
+
makePerm(Permission.ProjectMember, false), // allow row
|
|
111
|
+
makePerm(Permission.ProjectOwner, true), // block row
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
tenantId,
|
|
117
|
+
props: {
|
|
118
|
+
tenantId,
|
|
119
|
+
userTenantAccessPermission: {
|
|
120
|
+
[tenantId.toString()]: tenantPermission,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
test("Allow includes the tenant's non-block permissions (plus global)", () => {
|
|
127
|
+
const perms: Array<Permission> = permissionsOf(
|
|
128
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
129
|
+
buildTenantProps().props,
|
|
130
|
+
PermissionType.Allow,
|
|
131
|
+
),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
expect(perms).toContain(Permission.ProjectMember); // allow tenant row
|
|
135
|
+
expect(perms).toContain(Permission.Public); // global
|
|
136
|
+
expect(perms).not.toContain(Permission.ProjectOwner); // block row excluded
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("Block includes only the tenant's block permissions", () => {
|
|
140
|
+
const perms: Array<Permission> = permissionsOf(
|
|
141
|
+
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
142
|
+
buildTenantProps().props,
|
|
143
|
+
PermissionType.Block,
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect(perms).toContain(Permission.ProjectOwner); // block tenant row
|
|
148
|
+
expect(perms).not.toContain(Permission.ProjectMember); // allow row excluded
|
|
149
|
+
expect(perms).not.toContain(Permission.Public); // no global for Block
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -120,7 +120,7 @@ describe("MonitorTypeHelper", () => {
|
|
|
120
120
|
MonitorType.SSLCertificate,
|
|
121
121
|
MonitorType.SyntheticMonitor,
|
|
122
122
|
MonitorType.CustomJavaScriptCode,
|
|
123
|
-
MonitorType.
|
|
123
|
+
MonitorType.NetworkDevice,
|
|
124
124
|
MonitorType.DNS,
|
|
125
125
|
MonitorType.DNSSEC,
|
|
126
126
|
MonitorType.Domain,
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import TraceAggregationType from "../../../Types/Trace/TraceAggregationType";
|
|
2
|
+
import TraceRecordingRuleDefinition, {
|
|
3
|
+
TraceRecordingRuleDefinitionUtil,
|
|
4
|
+
TraceRecordingRuleSource,
|
|
5
|
+
TraceRecordingRuleAttributeFilter,
|
|
6
|
+
TRACE_RECORDING_RULE_MAX_SOURCES,
|
|
7
|
+
TRACE_RECORDING_RULE_MAX_EXPRESSION_LENGTH,
|
|
8
|
+
} from "../../../Types/Trace/TraceRecordingRuleDefinition";
|
|
9
|
+
|
|
10
|
+
describe("TraceRecordingRuleDefinitionUtil", () => {
|
|
11
|
+
const makeSource: (
|
|
12
|
+
overrides?: Partial<TraceRecordingRuleSource>,
|
|
13
|
+
) => TraceRecordingRuleSource = (
|
|
14
|
+
overrides: Partial<TraceRecordingRuleSource> = {},
|
|
15
|
+
): TraceRecordingRuleSource => {
|
|
16
|
+
return {
|
|
17
|
+
alias: "A",
|
|
18
|
+
aggregationType: TraceAggregationType.Count,
|
|
19
|
+
...overrides,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe("getAggregationOptions", () => {
|
|
24
|
+
test("every option has a valid value, label and description", () => {
|
|
25
|
+
const options: Array<{
|
|
26
|
+
value: TraceAggregationType;
|
|
27
|
+
label: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}> = TraceRecordingRuleDefinitionUtil.getAggregationOptions();
|
|
30
|
+
|
|
31
|
+
expect(options.length).toBeGreaterThan(0);
|
|
32
|
+
for (const option of options) {
|
|
33
|
+
expect(option.label.length).toBeGreaterThan(0);
|
|
34
|
+
expect(option.description.length).toBeGreaterThan(0);
|
|
35
|
+
expect(Object.values(TraceAggregationType)).toContain(option.value);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe("getSpanKindOptions", () => {
|
|
41
|
+
test("includes an 'Any' option with an empty value", () => {
|
|
42
|
+
const options: Array<{ value: string; label: string }> =
|
|
43
|
+
TraceRecordingRuleDefinitionUtil.getSpanKindOptions();
|
|
44
|
+
|
|
45
|
+
expect(
|
|
46
|
+
options.some((o: { value: string }): boolean => {
|
|
47
|
+
return o.value === "";
|
|
48
|
+
}),
|
|
49
|
+
).toBe(true);
|
|
50
|
+
expect(
|
|
51
|
+
options.some((o: { value: string }): boolean => {
|
|
52
|
+
return o.value === "SPAN_KIND_SERVER";
|
|
53
|
+
}),
|
|
54
|
+
).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe("getSourceAttributeFilters", () => {
|
|
59
|
+
test("returns the multi-filter entries, trimmed", () => {
|
|
60
|
+
const filters: Array<TraceRecordingRuleAttributeFilter> =
|
|
61
|
+
TraceRecordingRuleDefinitionUtil.getSourceAttributeFilters(
|
|
62
|
+
makeSource({
|
|
63
|
+
filterAttributes: [{ key: " http.route ", value: " /api " }],
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
expect(filters).toEqual([{ key: "http.route", value: "/api" }]);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test("drops entries with a missing key or value, and deduplicates by key", () => {
|
|
71
|
+
const filters: Array<TraceRecordingRuleAttributeFilter> =
|
|
72
|
+
TraceRecordingRuleDefinitionUtil.getSourceAttributeFilters(
|
|
73
|
+
makeSource({
|
|
74
|
+
filterAttributes: [
|
|
75
|
+
{ key: "host", value: "a" },
|
|
76
|
+
{ key: "host", value: "b" }, // duplicate key — dropped
|
|
77
|
+
{ key: "empty", value: "" }, // no value — dropped
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
expect(filters).toEqual([{ key: "host", value: "a" }]);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("merges the legacy single filter when its key is not already present", () => {
|
|
86
|
+
const filters: Array<TraceRecordingRuleAttributeFilter> =
|
|
87
|
+
TraceRecordingRuleDefinitionUtil.getSourceAttributeFilters(
|
|
88
|
+
makeSource({
|
|
89
|
+
filterAttributes: [{ key: "host", value: "a" }],
|
|
90
|
+
filterAttributeKey: "env",
|
|
91
|
+
filterAttributeValue: "prod",
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
expect(filters).toEqual([
|
|
96
|
+
{ key: "host", value: "a" },
|
|
97
|
+
{ key: "env", value: "prod" },
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test("array entry wins over the legacy filter for the same key", () => {
|
|
102
|
+
const filters: Array<TraceRecordingRuleAttributeFilter> =
|
|
103
|
+
TraceRecordingRuleDefinitionUtil.getSourceAttributeFilters(
|
|
104
|
+
makeSource({
|
|
105
|
+
filterAttributes: [{ key: "env", value: "staging" }],
|
|
106
|
+
filterAttributeKey: "env",
|
|
107
|
+
filterAttributeValue: "prod",
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
expect(filters).toEqual([{ key: "env", value: "staging" }]);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe("getNextAlias", () => {
|
|
116
|
+
test("returns A when empty and the first free letter otherwise", () => {
|
|
117
|
+
expect(TraceRecordingRuleDefinitionUtil.getNextAlias(undefined)).toBe(
|
|
118
|
+
"A",
|
|
119
|
+
);
|
|
120
|
+
expect(
|
|
121
|
+
TraceRecordingRuleDefinitionUtil.getNextAlias([
|
|
122
|
+
makeSource({ alias: "A" }),
|
|
123
|
+
makeSource({ alias: "C" }),
|
|
124
|
+
]),
|
|
125
|
+
).toBe("B");
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe("getEmptyDefinition", () => {
|
|
130
|
+
test("returns a single Count source aliased A that validates", () => {
|
|
131
|
+
const def: TraceRecordingRuleDefinition =
|
|
132
|
+
TraceRecordingRuleDefinitionUtil.getEmptyDefinition();
|
|
133
|
+
|
|
134
|
+
expect(def.sources.length).toBe(1);
|
|
135
|
+
expect(def.sources[0]!.alias).toBe("A");
|
|
136
|
+
expect(def.sources[0]!.aggregationType).toBe(TraceAggregationType.Count);
|
|
137
|
+
expect(def.expression).toBe("A");
|
|
138
|
+
expect(
|
|
139
|
+
TraceRecordingRuleDefinitionUtil.getValidationError(def),
|
|
140
|
+
).toBeNull();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe("getValidationError", () => {
|
|
145
|
+
const validDefinition: () => TraceRecordingRuleDefinition =
|
|
146
|
+
(): TraceRecordingRuleDefinition => {
|
|
147
|
+
return {
|
|
148
|
+
sources: [makeSource({ alias: "A" }), makeSource({ alias: "B" })],
|
|
149
|
+
expression: "A / B * 100",
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
test("accepts a valid definition", () => {
|
|
154
|
+
expect(
|
|
155
|
+
TraceRecordingRuleDefinitionUtil.getValidationError(validDefinition()),
|
|
156
|
+
).toBeNull();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test("requires a definition", () => {
|
|
160
|
+
expect(
|
|
161
|
+
TraceRecordingRuleDefinitionUtil.getValidationError(undefined),
|
|
162
|
+
).toBe("Definition is required.");
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test("requires at least one source", () => {
|
|
166
|
+
expect(
|
|
167
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
168
|
+
sources: [],
|
|
169
|
+
expression: "A",
|
|
170
|
+
}),
|
|
171
|
+
).toBe("Add at least one source.");
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
test("rejects more than the maximum number of sources", () => {
|
|
175
|
+
const sources: Array<TraceRecordingRuleSource> = Array.from(
|
|
176
|
+
{ length: TRACE_RECORDING_RULE_MAX_SOURCES + 1 },
|
|
177
|
+
(_unused: unknown, i: number) => {
|
|
178
|
+
return makeSource({ alias: "ABCDE"[i] as string });
|
|
179
|
+
},
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
expect(
|
|
183
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
184
|
+
sources,
|
|
185
|
+
expression: "A",
|
|
186
|
+
}),
|
|
187
|
+
).toContain(`at most ${TRACE_RECORDING_RULE_MAX_SOURCES}`);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
test("rejects an invalid alias", () => {
|
|
191
|
+
expect(
|
|
192
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
193
|
+
sources: [makeSource({ alias: "1" })],
|
|
194
|
+
expression: "A",
|
|
195
|
+
}),
|
|
196
|
+
).toContain("single uppercase letter");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("rejects duplicate aliases", () => {
|
|
200
|
+
expect(
|
|
201
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
202
|
+
sources: [makeSource({ alias: "A" }), makeSource({ alias: "A" })],
|
|
203
|
+
expression: "A",
|
|
204
|
+
}),
|
|
205
|
+
).toContain("Duplicate alias");
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
test("requires an aggregation type", () => {
|
|
209
|
+
expect(
|
|
210
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
211
|
+
sources: [
|
|
212
|
+
{
|
|
213
|
+
alias: "A",
|
|
214
|
+
} as unknown as TraceRecordingRuleSource,
|
|
215
|
+
],
|
|
216
|
+
expression: "A",
|
|
217
|
+
}),
|
|
218
|
+
).toContain("Aggregation type is required");
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test("requires both a legacy filter key and value, or neither", () => {
|
|
222
|
+
expect(
|
|
223
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
224
|
+
sources: [makeSource({ alias: "A", filterAttributeValue: "prod" })],
|
|
225
|
+
expression: "A",
|
|
226
|
+
}),
|
|
227
|
+
).toContain("needs both a key and a value");
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
test("rejects a non-array filterAttributes", () => {
|
|
231
|
+
expect(
|
|
232
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
233
|
+
sources: [
|
|
234
|
+
makeSource({
|
|
235
|
+
alias: "A",
|
|
236
|
+
filterAttributes:
|
|
237
|
+
"nope" as unknown as Array<TraceRecordingRuleAttributeFilter>,
|
|
238
|
+
}),
|
|
239
|
+
],
|
|
240
|
+
expression: "A",
|
|
241
|
+
}),
|
|
242
|
+
).toContain("Invalid attribute filters");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test("rejects a half-specified filter row", () => {
|
|
246
|
+
expect(
|
|
247
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
248
|
+
sources: [
|
|
249
|
+
makeSource({
|
|
250
|
+
alias: "A",
|
|
251
|
+
filterAttributes: [{ key: "host", value: "" }],
|
|
252
|
+
}),
|
|
253
|
+
],
|
|
254
|
+
expression: "A",
|
|
255
|
+
}),
|
|
256
|
+
).toContain("remove the row");
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test("requires an expression", () => {
|
|
260
|
+
expect(
|
|
261
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
262
|
+
sources: [makeSource({ alias: "A" })],
|
|
263
|
+
expression: " ",
|
|
264
|
+
}),
|
|
265
|
+
).toBe("Expression is required.");
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
test("rejects an over-length expression", () => {
|
|
269
|
+
expect(
|
|
270
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
271
|
+
sources: [makeSource({ alias: "A" })],
|
|
272
|
+
expression: "A".repeat(
|
|
273
|
+
TRACE_RECORDING_RULE_MAX_EXPRESSION_LENGTH + 1,
|
|
274
|
+
),
|
|
275
|
+
}),
|
|
276
|
+
).toContain(
|
|
277
|
+
`${TRACE_RECORDING_RULE_MAX_EXPRESSION_LENGTH} characters or fewer`,
|
|
278
|
+
);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
test("rejects an expression referencing an undefined alias", () => {
|
|
282
|
+
expect(
|
|
283
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
284
|
+
sources: [makeSource({ alias: "A" })],
|
|
285
|
+
expression: "A + B",
|
|
286
|
+
}),
|
|
287
|
+
).toContain("references alias 'B'");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
test("rejects an expression that references no alias", () => {
|
|
291
|
+
expect(
|
|
292
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
293
|
+
sources: [makeSource({ alias: "A" })],
|
|
294
|
+
expression: "5 + 10",
|
|
295
|
+
}),
|
|
296
|
+
).toContain("must reference at least one source alias");
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
test("rejects an expression with characters outside the DSL grammar", () => {
|
|
300
|
+
expect(
|
|
301
|
+
TraceRecordingRuleDefinitionUtil.getValidationError({
|
|
302
|
+
sources: [makeSource({ alias: "A" }), makeSource({ alias: "B" })],
|
|
303
|
+
expression: "A & B",
|
|
304
|
+
}),
|
|
305
|
+
).toContain("may only contain");
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
});
|
|
@@ -55,6 +55,23 @@ describe("Dropdown", () => {
|
|
|
55
55
|
expect(await screen.findByText("2")).toBeInTheDocument();
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
test("renders the menu portal above modal surfaces", async () => {
|
|
59
|
+
const { getByRole } = render(
|
|
60
|
+
<Dropdown onChange={() => {}} options={options} />,
|
|
61
|
+
);
|
|
62
|
+
const dropdown: HTMLElement = getByRole("combobox");
|
|
63
|
+
|
|
64
|
+
fireEvent.keyDown(dropdown, { key: "ArrowDown", code: "ArrowDown" });
|
|
65
|
+
await screen.findByText("1");
|
|
66
|
+
|
|
67
|
+
const menuPortal: HTMLElement | null = document.querySelector<HTMLElement>(
|
|
68
|
+
".ou-select__menu-portal",
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(menuPortal).toBeInTheDocument();
|
|
72
|
+
expect(menuPortal).toHaveStyle({ zIndex: "60" });
|
|
73
|
+
});
|
|
74
|
+
|
|
58
75
|
test("renders placeholder", async () => {
|
|
59
76
|
const { getByText } = render(
|
|
60
77
|
<Dropdown
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import EntityDropdown from "../../../UI/Components/EntityDropdown/EntityDropdown";
|
|
2
|
+
import {
|
|
3
|
+
DROPDOWN_MENU_Z_INDEX,
|
|
4
|
+
DropdownOption,
|
|
5
|
+
} from "../../../UI/Components/Dropdown/Dropdown";
|
|
6
|
+
import getJestMockFunction, { MockFunction } from "../../../Tests/MockType";
|
|
7
|
+
import { afterEach, describe, expect, jest, test } from "@jest/globals";
|
|
8
|
+
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
9
|
+
import React from "react";
|
|
10
|
+
|
|
11
|
+
describe("EntityDropdown", () => {
|
|
12
|
+
const options: Array<DropdownOption> = [
|
|
13
|
+
{ value: "members", label: "Members" },
|
|
14
|
+
{ value: "admins", label: "Admins" },
|
|
15
|
+
];
|
|
16
|
+
const originalInnerHeight: number = window.innerHeight;
|
|
17
|
+
const originalInnerWidth: number = window.innerWidth;
|
|
18
|
+
|
|
19
|
+
const setViewport: (width: number, height: number) => void = (
|
|
20
|
+
width: number,
|
|
21
|
+
height: number,
|
|
22
|
+
): void => {
|
|
23
|
+
Object.defineProperty(window, "innerWidth", {
|
|
24
|
+
configurable: true,
|
|
25
|
+
value: width,
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(window, "innerHeight", {
|
|
28
|
+
configurable: true,
|
|
29
|
+
value: height,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const makeRect: (
|
|
34
|
+
left: number,
|
|
35
|
+
top: number,
|
|
36
|
+
width: number,
|
|
37
|
+
height: number,
|
|
38
|
+
) => DOMRect = (
|
|
39
|
+
left: number,
|
|
40
|
+
top: number,
|
|
41
|
+
width: number,
|
|
42
|
+
height: number,
|
|
43
|
+
): DOMRect => {
|
|
44
|
+
return {
|
|
45
|
+
bottom: top + height,
|
|
46
|
+
height,
|
|
47
|
+
left,
|
|
48
|
+
right: left + width,
|
|
49
|
+
top,
|
|
50
|
+
width,
|
|
51
|
+
x: left,
|
|
52
|
+
y: top,
|
|
53
|
+
toJSON: (): Record<string, never> => {
|
|
54
|
+
return {};
|
|
55
|
+
},
|
|
56
|
+
} as DOMRect;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const openDropdownAt: (rect: DOMRect) => HTMLInputElement = (
|
|
60
|
+
rect: DOMRect,
|
|
61
|
+
): HTMLInputElement => {
|
|
62
|
+
const input: HTMLInputElement = screen.getByRole("combobox", {
|
|
63
|
+
name: "Team",
|
|
64
|
+
}) as HTMLInputElement;
|
|
65
|
+
const control: HTMLElement | null =
|
|
66
|
+
input.parentElement?.parentElement || null;
|
|
67
|
+
|
|
68
|
+
if (!control) {
|
|
69
|
+
throw new Error("EntityDropdown control was not rendered.");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
jest.spyOn(control, "getBoundingClientRect").mockReturnValue(rect);
|
|
73
|
+
fireEvent.focus(input);
|
|
74
|
+
|
|
75
|
+
return input;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
afterEach(() => {
|
|
79
|
+
cleanup();
|
|
80
|
+
jest.restoreAllMocks();
|
|
81
|
+
setViewport(originalInnerWidth, originalInnerHeight);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test("positions its fixed menu below the control above modal surfaces", () => {
|
|
85
|
+
setViewport(1000, 800);
|
|
86
|
+
render(<EntityDropdown ariaLabel="Team" options={options} />);
|
|
87
|
+
|
|
88
|
+
openDropdownAt(makeRect(120, 200, 320, 40));
|
|
89
|
+
|
|
90
|
+
const menu: HTMLElement = screen.getByTestId("entity-dropdown-menu");
|
|
91
|
+
|
|
92
|
+
expect(menu.classList.contains("fixed")).toBe(true);
|
|
93
|
+
expect(menu.style.top).toBe("244px");
|
|
94
|
+
expect(menu.style.bottom).toBe("");
|
|
95
|
+
expect(menu.style.left).toBe("120px");
|
|
96
|
+
expect(menu.style.width).toBe("320px");
|
|
97
|
+
expect(menu.style.maxHeight).toBe("384px");
|
|
98
|
+
expect(menu.style.visibility).toBe("visible");
|
|
99
|
+
expect(menu.style.zIndex).toBe(String(DROPDOWN_MENU_Z_INDEX));
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("flips its menu above a control near the modal footer", () => {
|
|
103
|
+
setViewport(1000, 600);
|
|
104
|
+
render(<EntityDropdown ariaLabel="Team" options={options} />);
|
|
105
|
+
|
|
106
|
+
openDropdownAt(makeRect(120, 520, 320, 40));
|
|
107
|
+
|
|
108
|
+
const menu: HTMLElement = screen.getByTestId("entity-dropdown-menu");
|
|
109
|
+
|
|
110
|
+
expect(menu.style.top).toBe("");
|
|
111
|
+
expect(menu.style.bottom).toBe("84px");
|
|
112
|
+
expect(menu.style.maxHeight).toBe("384px");
|
|
113
|
+
expect(menu.style.visibility).toBe("visible");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("selects an option from the fixed menu", () => {
|
|
117
|
+
const onChange: MockFunction = getJestMockFunction();
|
|
118
|
+
setViewport(1000, 800);
|
|
119
|
+
render(
|
|
120
|
+
<EntityDropdown ariaLabel="Team" onChange={onChange} options={options} />,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
openDropdownAt(makeRect(120, 200, 320, 40));
|
|
124
|
+
fireEvent.click(screen.getByRole("option", { name: "Members" }));
|
|
125
|
+
|
|
126
|
+
expect(onChange).toHaveBeenCalledTimes(1);
|
|
127
|
+
expect(onChange).toHaveBeenCalledWith("members");
|
|
128
|
+
expect(screen.queryByTestId("entity-dropdown-menu")).toBeNull();
|
|
129
|
+
});
|
|
130
|
+
});
|