@oneuptime/common 11.7.2 → 11.7.4
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/AnalyticsModels/KubernetesCostAllocation.ts +103 -0
- package/Models/DatabaseModels/AlertEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/AlertStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
- package/Models/DatabaseModels/Index.ts +5 -0
- package/Models/DatabaseModels/LogDropFilter.ts +89 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +13 -3
- package/Models/DatabaseModels/RecommendationDismissal.ts +463 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
- package/Models/DatabaseModels/StatusPageGroup.ts +95 -0
- package/Models/DatabaseModels/TableView.ts +40 -0
- package/Models/DatabaseModels/TraceDropFilter.ts +89 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +5 -1
- package/Server/API/AlertAPI.ts +32 -17
- package/Server/API/BaseAPI.ts +31 -2
- package/Server/API/BaseAnalyticsAPI.ts +36 -2
- package/Server/API/CommonAPI.ts +57 -0
- package/Server/API/IncidentAPI.ts +60 -33
- package/Server/API/IncidentEpisodeAPI.ts +31 -16
- package/Server/API/MonitorAPI.ts +30 -0
- package/Server/API/MonitorTemplateAPI.ts +8 -0
- package/Server/API/ProbeAPI.ts +196 -15
- package/Server/API/ProjectAPI.ts +79 -1
- package/Server/API/ScheduledMaintenanceAPI.ts +33 -18
- package/Server/API/StatusPageAPI.ts +74 -37
- package/Server/API/WorkspaceNotificationRuleAPI.ts +34 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.ts +13 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.ts +527 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.ts +55 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +10 -0
- package/Server/Services/AlertEpisodeService.ts +47 -0
- package/Server/Services/AlertService.ts +125 -0
- package/Server/Services/BillingService.ts +98 -0
- package/Server/Services/DatabaseService.ts +184 -20
- package/Server/Services/IncidentEpisodeService.ts +47 -0
- package/Server/Services/IncidentService.ts +123 -0
- package/Server/Services/IncidentTemplateService.ts +123 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LogDropFilterService.ts +133 -0
- package/Server/Services/MonitorProbeService.ts +94 -4
- package/Server/Services/MonitorService.ts +48 -43
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +70 -0
- package/Server/Services/ProbeService.ts +66 -0
- package/Server/Services/ProjectService.ts +131 -7
- package/Server/Services/RecommendationDismissalService.ts +52 -0
- package/Server/Services/RunbookAgentJobService.ts +68 -7
- package/Server/Services/ScheduledMaintenanceService.ts +103 -0
- package/Server/Services/ScheduledMaintenanceTemplateService.ts +90 -0
- package/Server/Services/StatusPageGroupService.ts +186 -0
- package/Server/Services/TraceDropFilterService.ts +133 -0
- package/Server/Types/Workflow/Components/API/Delete.ts +12 -0
- package/Server/Types/Workflow/Components/API/Get.ts +12 -0
- package/Server/Types/Workflow/Components/API/Patch.ts +12 -0
- package/Server/Types/Workflow/Components/API/Post.ts +12 -0
- package/Server/Types/Workflow/Components/API/Put.ts +13 -0
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +212 -0
- package/Server/Utils/DropFilterValidation.ts +127 -0
- package/Server/Utils/Errors.ts +5 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +31 -2
- package/Server/Utils/Telemetry/AppMetrics.ts +31 -0
- package/Tests/Models/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -0
- package/Tests/Models/DatabaseModels/MonitorProbeColumnAccessControl.test.ts +196 -0
- package/Tests/Models/RecommendationDismissalModel.test.ts +269 -0
- package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +320 -0
- package/Tests/Server/API/BaseAnalyticsAPIUpdatePayloadValidation.test.ts +293 -0
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +164 -0
- package/Tests/Server/API/ProbeAPI.test.ts +422 -53
- package/Tests/Server/API/ProjectAPI.test.ts +180 -0
- package/Tests/Server/API/ProjectAPIExtendTrialBillingDisabled.test.ts +138 -0
- package/Tests/Server/API/ProjectScopedCustomRouteAuth.test.ts +458 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +359 -0
- package/Tests/Server/Infrastructure/ProcessSignalDelivery.test.ts +427 -0
- package/Tests/Server/Services/BillingServiceExtendTrial.test.ts +439 -0
- package/Tests/Server/Services/CrossProjectReferenceWriteGuard.test.ts +810 -0
- package/Tests/Server/Services/DatabaseServiceAtomicAddToColumns.test.ts +269 -0
- package/Tests/Server/Services/DatabaseServiceEmptyUpdate.test.ts +277 -0
- package/Tests/Server/Services/DatabaseServiceSortColumnSelect.test.ts +201 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +81 -23
- package/Tests/Server/Services/DropFilterSaveValidation.test.ts +398 -0
- package/Tests/Server/Services/MonitorProbeDeleteHooks.test.ts +280 -0
- package/Tests/Server/Services/MonitorProbeServiceProbeTenancy.test.ts +304 -0
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +262 -0
- package/Tests/Server/Services/ProjectServiceExtendTrial.test.ts +614 -0
- package/Tests/Server/Services/RecommendationDismissalService.test.ts +306 -0
- package/Tests/Server/Services/RepairCrossProjectIncidentReferencesMigration.test.ts +528 -0
- package/Tests/Server/Services/StatusPageGroupNesting.test.ts +395 -0
- package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +26 -21
- package/Tests/Server/Types/Database/Permissions/WorkflowVariableColumnPermission.test.ts +227 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +285 -0
- package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +463 -0
- package/Tests/Server/Utils/DropFilterValidation.test.ts +269 -0
- package/Tests/Server/Utils/Telemetry/SpanUtil.test.ts +94 -0
- package/Tests/Types/DateUserTimezone.test.ts +52 -0
- package/Tests/Types/JSONFunctions.test.ts +103 -1
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +177 -9
- package/Tests/Types/Monitor/MonitorStepDnsMonitor.test.ts +105 -0
- package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +131 -0
- package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +60 -0
- package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +82 -0
- package/Tests/Types/Monitor/MonitorStepInfrastructureMonitors.test.ts +268 -0
- package/Tests/Types/Monitor/MonitorStepMetricMonitor.test.ts +386 -0
- package/Tests/Types/Monitor/MonitorStepProfileMonitor.test.ts +185 -0
- package/Tests/Types/Monitor/MonitorStepSnmpMonitor.test.ts +156 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +371 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +901 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +607 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +754 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +960 -0
- package/Tests/Types/RollingTime/RollingTimeUtil.test.ts +186 -0
- package/Tests/Types/Runbook/RunbookStepTimeout.test.ts +410 -0
- package/Tests/Types/Telemetry/DropFilterSampling.test.ts +241 -0
- package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +353 -0
- package/Tests/Types/Workspace/NotificationRuleUtil.test.ts +566 -0
- package/Tests/UI/Components/CodeEditor.test.tsx +174 -0
- package/Tests/UI/Components/ErrorBoundary.test.tsx +555 -24
- package/Tests/UI/Components/InfoCard.test.tsx +358 -0
- package/Tests/UI/Components/LogTimeRangePicker.test.tsx +138 -0
- package/Tests/UI/Components/Modal.test.tsx +43 -5
- package/Tests/UI/Components/ModelTable/BaseModelTableColumnCustomization.test.tsx +679 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +999 -0
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -0
- package/Tests/UI/Components/Runbook/StepTimeoutInput.test.tsx +386 -0
- package/Tests/UI/Components/StatusPage/ResourceGroupSection.test.tsx +671 -0
- package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +404 -0
- package/Tests/UI/Utils/DropdownAlignment.test.ts +306 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +292 -0
- package/Tests/Utils/Monitor/MonitorSummaryProbeUtil.test.ts +263 -0
- package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +583 -0
- package/Tests/Utils/StatusPage/GroupNestingLayout.test.ts +1072 -0
- package/Tests/Utils/StatusPage/GroupTree.test.ts +583 -0
- package/Tests/Utils/StatusPage/ResourceUptime.test.ts +411 -0
- package/Tests/Utils/UserPreferences.test.ts +563 -0
- package/Types/Date.ts +15 -6
- package/Types/JSONFunctions.ts +7 -2
- package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
- package/Types/Monitor/KubernetesAlertTemplates.ts +205 -0
- package/Types/Monitor/MonitorStep.ts +10 -1
- package/Types/Monitor/MonitorStepMetricMonitor.ts +46 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +413 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +168 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +175 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +743 -0
- package/Types/Permission.ts +45 -0
- package/Types/Recommendation/RecommendationType.ts +20 -0
- package/Types/Runbook/RunbookExecutionDeadline.ts +129 -0
- package/Types/Runbook/RunbookStepTimeout.ts +202 -0
- package/Types/Telemetry/DropFilterSampling.ts +92 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +0 -2
- package/UI/Components/Accordion/Accordion.tsx +10 -2
- package/UI/Components/BulkUpdate/BulkLabelActions.tsx +0 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +34 -20
- package/UI/Components/Date/RangeStartAndEndDateView.tsx +0 -1
- package/UI/Components/EditionLabel/EditionLabel.tsx +1 -27
- package/UI/Components/Error/PageError.tsx +0 -4
- package/UI/Components/ErrorBoundary.tsx +252 -15
- package/UI/Components/InfoCard/InfoCard.tsx +58 -1
- package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +34 -1
- package/UI/Components/MasterPage/MasterPage.tsx +65 -0
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +503 -71
- package/UI/Components/ModelTable/Column.ts +17 -0
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +523 -0
- package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
- package/UI/Components/ModelTable/TableView.tsx +24 -2
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/SideMenu/SideMenu.tsx +24 -4
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/Table/Table.tsx +14 -1
- package/UI/Components/Table/TableRow.tsx +180 -175
- package/UI/Components/Table/Types/Column.ts +2 -0
- package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +34 -1
- package/UI/Utils/DropdownAlignment.ts +162 -0
- package/UI/Utils/TableFilterUrlState.ts +59 -20
- package/Utils/API.ts +106 -2
- package/Utils/Monitor/MonitorSummaryProbeUtil.ts +130 -0
- package/Utils/NetworkDiscovery/ScanTargetUtil.ts +434 -0
- package/Utils/StatusPage/GroupNestingLayout.ts +343 -0
- package/Utils/StatusPage/GroupTree.ts +307 -0
- package/Utils/StatusPage/ResourceUptime.ts +90 -17
- package/Utils/UserPreferences.ts +53 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +14 -4
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js +484 -0
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js +94 -0
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TableView.js +40 -0
- package/build/dist/Models/DatabaseModels/TableView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +5 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +22 -13
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +22 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +24 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +42 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +43 -26
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +21 -12
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorAPI.js +23 -0
- package/build/dist/Server/API/MonitorAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorTemplateAPI.js +4 -0
- package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -1
- package/build/dist/Server/API/ProbeAPI.js +131 -15
- package/build/dist/Server/API/ProbeAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectAPI.js +62 -3
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +23 -14
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +61 -33
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js +26 -2
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js +397 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +10 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +39 -0
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +95 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +71 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +140 -17
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +39 -0
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +100 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +97 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LogDropFilterService.js +93 -0
- package/build/dist/Server/Services/LogDropFilterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +73 -5
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +34 -39
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +64 -0
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +103 -7
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RecommendationDismissalService.js +50 -0
- package/build/dist/Server/Services/RecommendationDismissalService.js.map +1 -0
- package/build/dist/Server/Services/RunbookAgentJobService.js +63 -5
- package/build/dist/Server/Services/RunbookAgentJobService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +83 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js +65 -0
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageGroupService.js +136 -0
- package/build/dist/Server/Services/StatusPageGroupService.js.map +1 -1
- package/build/dist/Server/Services/TraceDropFilterService.js +93 -0
- package/build/dist/Server/Services/TraceDropFilterService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +12 -0
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +132 -0
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -0
- package/build/dist/Server/Utils/DropFilterValidation.js +80 -0
- package/build/dist/Server/Utils/DropFilterValidation.js.map +1 -0
- package/build/dist/Server/Utils/Errors.js +3 -0
- package/build/dist/Server/Utils/Errors.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +30 -12
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +38 -18
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +26 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Types/Date.js +14 -4
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +8 -3
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +192 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -1
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js +32 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +294 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +110 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +58 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +451 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -0
- package/build/dist/Types/Permission.js +40 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Recommendation/RecommendationType.js +21 -0
- package/build/dist/Types/Recommendation/RecommendationType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js +93 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js +142 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js.map +1 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js +75 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js.map +1 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -2
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Accordion/Accordion.js +9 -2
- package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +27 -14
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +2 -20
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/Error/PageError.js +1 -3
- package/build/dist/UI/Components/Error/PageError.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +145 -11
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +28 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js +50 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +4 -32
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +308 -40
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +230 -0
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js +101 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js.map +1 -0
- package/build/dist/UI/Components/SideMenu/SideMenu.js +15 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js +73 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
- package/build/dist/UI/Components/Table/Table.js +15 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +11 -6
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Utils/DropdownAlignment.js +98 -0
- package/build/dist/UI/Utils/DropdownAlignment.js.map +1 -0
- package/build/dist/UI/Utils/TableFilterUrlState.js +48 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/Utils/API.js +39 -2
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js +97 -0
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +330 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js +280 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupTree.js +214 -0
- package/build/dist/Utils/StatusPage/GroupTree.js.map +1 -0
- package/build/dist/Utils/StatusPage/ResourceUptime.js +60 -16
- package/build/dist/Utils/StatusPage/ResourceUptime.js.map +1 -1
- package/build/dist/Utils/UserPreferences.js +33 -0
- package/build/dist/Utils/UserPreferences.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,9 @@ import NotEqual from "../../../Types/BaseDatabase/NotEqual";
|
|
|
9
9
|
import NotNull from "../../../Types/BaseDatabase/NotNull";
|
|
10
10
|
import Search from "../../../Types/BaseDatabase/Search";
|
|
11
11
|
import ObjectID from "../../../Types/ObjectID";
|
|
12
|
+
import Dictionary from "../../../Types/Dictionary";
|
|
12
13
|
import { JSONObject } from "../../../Types/JSON";
|
|
14
|
+
import JSONFunctions from "../../../Types/JSONFunctions";
|
|
13
15
|
import {
|
|
14
16
|
afterEach,
|
|
15
17
|
beforeEach,
|
|
@@ -31,6 +33,8 @@ import {
|
|
|
31
33
|
* their own filters;
|
|
32
34
|
* - a hand-edited or truncated param degrades to "no filters", never to a
|
|
33
35
|
* crash;
|
|
36
|
+
* - a link built elsewhere in the product (a summary count whose rows live on
|
|
37
|
+
* another page) lands that page in the state it names;
|
|
34
38
|
* - and the URL can't grow without bound.
|
|
35
39
|
*/
|
|
36
40
|
|
|
@@ -86,6 +90,29 @@ describe("TableFilterUrlState", () => {
|
|
|
86
90
|
"monitors-table-view",
|
|
87
91
|
]);
|
|
88
92
|
});
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* The link builder and the reader have to agree on the param name or a
|
|
96
|
+
* "show me these rows" link silently lands on an unfiltered table. This is
|
|
97
|
+
* the one place naming is pinned, so keep the writer in it.
|
|
98
|
+
*/
|
|
99
|
+
test("the names getLinkQueryParams writes are the names read looks up", () => {
|
|
100
|
+
const params: Dictionary<string> = TableFilterUrlState.getLinkQueryParams(
|
|
101
|
+
"monitors-table",
|
|
102
|
+
{
|
|
103
|
+
filter: { name: "api" },
|
|
104
|
+
facets: { selectedLabelIds: ["a"] },
|
|
105
|
+
view: { page: 2 },
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
expect(Object.keys(params).sort()).toEqual(
|
|
110
|
+
[...TableFilterUrlState.getAllParamNames("monitors-table")].sort(),
|
|
111
|
+
);
|
|
112
|
+
expect(Object.keys(params)).toContain(
|
|
113
|
+
TableFilterUrlState.getParamName("monitors-table", "facets"),
|
|
114
|
+
);
|
|
115
|
+
});
|
|
89
116
|
});
|
|
90
117
|
|
|
91
118
|
describe("read", () => {
|
|
@@ -403,6 +430,271 @@ describe("TableFilterUrlState", () => {
|
|
|
403
430
|
});
|
|
404
431
|
});
|
|
405
432
|
|
|
433
|
+
describe("serializeState", () => {
|
|
434
|
+
type BuildCircularStateFunction = () => JSONObject;
|
|
435
|
+
|
|
436
|
+
/*
|
|
437
|
+
* Filter data never looks like this, but a caller passing a React object
|
|
438
|
+
* with a back-reference by accident must not take the table down with it.
|
|
439
|
+
*/
|
|
440
|
+
const buildCircularState: BuildCircularStateFunction = (): JSONObject => {
|
|
441
|
+
const state: JSONObject = { name: "api" };
|
|
442
|
+
state["self"] = state;
|
|
443
|
+
return state;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
/*
|
|
447
|
+
* "Nothing to write" and "could not write" have to be indistinguishable to
|
|
448
|
+
* a caller, because both mean "put no param on the URL". read() treats a
|
|
449
|
+
* missing param and an object with no keys the same way, so an object with
|
|
450
|
+
* no keys must never reach the URL as a param either.
|
|
451
|
+
*/
|
|
452
|
+
test("returns null for every flavour of empty", () => {
|
|
453
|
+
expect(TableFilterUrlState.serializeState(null)).toBeNull();
|
|
454
|
+
expect(TableFilterUrlState.serializeState(undefined)).toBeNull();
|
|
455
|
+
expect(TableFilterUrlState.serializeState({})).toBeNull();
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
test("returns a JSON string for a plain object", () => {
|
|
459
|
+
const serialized: string | null = TableFilterUrlState.serializeState({
|
|
460
|
+
name: "api",
|
|
461
|
+
disableActiveMonitoring: false,
|
|
462
|
+
count: 12,
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
expect(typeof serialized).toBe("string");
|
|
466
|
+
expect(JSON.parse(serialized as string)).toEqual({
|
|
467
|
+
name: "api",
|
|
468
|
+
disableActiveMonitoring: false,
|
|
469
|
+
count: 12,
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
/*
|
|
474
|
+
* Serialization goes through JSONFunctions rather than plain stringify for
|
|
475
|
+
* exactly one reason: type fidelity. A bare JSON.stringify would flatten an
|
|
476
|
+
* Includes to `{}` and the restored query would mean "no constraint"
|
|
477
|
+
* instead of "one of these ids" — a table showing every row instead of
|
|
478
|
+
* three.
|
|
479
|
+
*/
|
|
480
|
+
test("keeps typed query values recoverable as class instances", () => {
|
|
481
|
+
const ids: Array<string> = buildIds(2);
|
|
482
|
+
|
|
483
|
+
const serialized: string | null = TableFilterUrlState.serializeState({
|
|
484
|
+
name: new Search("api gateway"),
|
|
485
|
+
labels: new Includes(ids),
|
|
486
|
+
deletedAt: new IsNull(),
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
expect(serialized).not.toBeNull();
|
|
490
|
+
|
|
491
|
+
const restored: JSONObject = JSONFunctions.deserialize(
|
|
492
|
+
JSONFunctions.parseJSONObject(serialized as string),
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
expect(restored["name"]).toBeInstanceOf(Search);
|
|
496
|
+
expect((restored["name"] as Search<string>).toString()).toBe(
|
|
497
|
+
"api gateway",
|
|
498
|
+
);
|
|
499
|
+
expect(restored["labels"]).toBeInstanceOf(Includes);
|
|
500
|
+
expect(
|
|
501
|
+
(restored["labels"] as Includes).values.map((v: unknown) => {
|
|
502
|
+
return v!.toString();
|
|
503
|
+
}),
|
|
504
|
+
).toEqual(ids);
|
|
505
|
+
expect(restored["deletedAt"]).toBeInstanceOf(IsNull);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
test("returns null and warns instead of throwing on state it cannot serialize", () => {
|
|
509
|
+
const warn: ReturnType<typeof jest.spyOn> = jest
|
|
510
|
+
.spyOn(console, "warn")
|
|
511
|
+
.mockImplementation(() => {});
|
|
512
|
+
|
|
513
|
+
expect(
|
|
514
|
+
TableFilterUrlState.serializeState(buildCircularState()),
|
|
515
|
+
).toBeNull();
|
|
516
|
+
|
|
517
|
+
expect(warn).toHaveBeenCalledTimes(1);
|
|
518
|
+
expect(String(warn.mock.calls[0]?.[0])).toContain(
|
|
519
|
+
"could not serialize state",
|
|
520
|
+
);
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
/*
|
|
524
|
+
* write/writeMany share this serializer, so a slice that will not
|
|
525
|
+
* serialize has to drop its param rather than leave the previous one behind
|
|
526
|
+
* describing an older view.
|
|
527
|
+
*/
|
|
528
|
+
test("a slice that will not serialize drops its param instead of going stale", () => {
|
|
529
|
+
jest.spyOn(console, "warn").mockImplementation(() => {});
|
|
530
|
+
|
|
531
|
+
TableFilterUrlState.write("monitors-table", "filter", { name: "api" });
|
|
532
|
+
|
|
533
|
+
TableFilterUrlState.write(
|
|
534
|
+
"monitors-table",
|
|
535
|
+
"filter",
|
|
536
|
+
buildCircularState(),
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
expect(readParam("monitors-table-filter")).toBeNull();
|
|
540
|
+
expect(TableFilterUrlState.read("monitors-table", "filter")).toBeNull();
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
describe("getLinkQueryParams", () => {
|
|
545
|
+
type NavigateWithFunction = (params: Dictionary<string>) => void;
|
|
546
|
+
|
|
547
|
+
/*
|
|
548
|
+
* What Route.addQueryParams plus a real navigation do with these params:
|
|
549
|
+
* the values are concatenated into the route exactly as handed over.
|
|
550
|
+
*/
|
|
551
|
+
const navigateWith: NavigateWithFunction = (
|
|
552
|
+
params: Dictionary<string>,
|
|
553
|
+
): void => {
|
|
554
|
+
const query: string = Object.keys(params)
|
|
555
|
+
.map((name: string): string => {
|
|
556
|
+
return `${name}=${params[name]!}`;
|
|
557
|
+
})
|
|
558
|
+
.join("&");
|
|
559
|
+
|
|
560
|
+
setUrl(`/dashboard/monitors?${query}`);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
test("names each param under the table id and slice", () => {
|
|
564
|
+
const params: Dictionary<string> = TableFilterUrlState.getLinkQueryParams(
|
|
565
|
+
"monitors-table",
|
|
566
|
+
{ facets: { selectedLabelIds: ["a"] } },
|
|
567
|
+
);
|
|
568
|
+
|
|
569
|
+
expect(Object.keys(params)).toEqual(["monitors-table-facets"]);
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
/*
|
|
573
|
+
* Route.addQueryParams pastes values into the route verbatim while read()
|
|
574
|
+
* pulls them back out of URLSearchParams, which decodes. Serialized state
|
|
575
|
+
* is JSON — full of `{`, `"` and, in any search text, `&` — so an
|
|
576
|
+
* unencoded value would truncate at the first `&` and arrive as a param the
|
|
577
|
+
* reader cannot parse: a link that lands on an unfiltered table.
|
|
578
|
+
*/
|
|
579
|
+
test("percent-encodes the value so the reader gets back what was written", () => {
|
|
580
|
+
const state: JSONObject = { name: new Search("api & gateway") };
|
|
581
|
+
|
|
582
|
+
const params: Dictionary<string> = TableFilterUrlState.getLinkQueryParams(
|
|
583
|
+
"monitors-table",
|
|
584
|
+
{ facets: state },
|
|
585
|
+
);
|
|
586
|
+
|
|
587
|
+
const value: string = params["monitors-table-facets"]!;
|
|
588
|
+
|
|
589
|
+
expect(value).not.toContain("{");
|
|
590
|
+
expect(value).not.toContain('"');
|
|
591
|
+
expect(value).not.toContain("&");
|
|
592
|
+
expect(value).toContain("%7B");
|
|
593
|
+
expect(decodeURIComponent(value)).toBe(
|
|
594
|
+
TableFilterUrlState.serializeState(state),
|
|
595
|
+
);
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
/*
|
|
599
|
+
* An empty slice has to vanish, not become `monitors-table-facets=`. The
|
|
600
|
+
* absence of the param is already how read() spells "no state", and an
|
|
601
|
+
* empty one would ride along in every bookmark claiming the link carries
|
|
602
|
+
* state it does not.
|
|
603
|
+
*/
|
|
604
|
+
test("omits empty slices entirely", () => {
|
|
605
|
+
const params: Dictionary<string> = TableFilterUrlState.getLinkQueryParams(
|
|
606
|
+
"monitors-table",
|
|
607
|
+
{ filter: { name: "api" }, facets: null, view: {} },
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
expect(Object.keys(params)).toEqual(["monitors-table-filter"]);
|
|
611
|
+
expect(params["monitors-table-facets"]).toBeUndefined();
|
|
612
|
+
expect(params["monitors-table-view"]).toBeUndefined();
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
test("carries several slices in one link", () => {
|
|
616
|
+
const filter: JSONObject = { name: new Search("api") };
|
|
617
|
+
const facets: JSONObject = { selectedLabelIds: ["a", "b"] };
|
|
618
|
+
const view: JSONObject = { page: 3 };
|
|
619
|
+
|
|
620
|
+
const params: Dictionary<string> = TableFilterUrlState.getLinkQueryParams(
|
|
621
|
+
"monitors-table",
|
|
622
|
+
{ filter, facets, view },
|
|
623
|
+
);
|
|
624
|
+
|
|
625
|
+
expect(decodeURIComponent(params["monitors-table-filter"]!)).toBe(
|
|
626
|
+
TableFilterUrlState.serializeState(filter),
|
|
627
|
+
);
|
|
628
|
+
expect(decodeURIComponent(params["monitors-table-facets"]!)).toBe(
|
|
629
|
+
TableFilterUrlState.serializeState(facets),
|
|
630
|
+
);
|
|
631
|
+
expect(decodeURIComponent(params["monitors-table-view"]!)).toBe(
|
|
632
|
+
TableFilterUrlState.serializeState(view),
|
|
633
|
+
);
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
test("asked for nothing, adds nothing to the link", () => {
|
|
637
|
+
expect(
|
|
638
|
+
TableFilterUrlState.getLinkQueryParams("monitors-table", {}),
|
|
639
|
+
).toEqual({});
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
/*
|
|
643
|
+
* The property the whole feature rests on: a summary tile builds a link,
|
|
644
|
+
* the browser follows it, and the target table mounts already in that
|
|
645
|
+
* state — chip set, values typed, nothing lost to the URL round trip.
|
|
646
|
+
*/
|
|
647
|
+
test("a link built from these params lands the table in that state", () => {
|
|
648
|
+
const ids: Array<string> = buildIds(2);
|
|
649
|
+
const state: JSONObject = {
|
|
650
|
+
name: new Search("api & gateway"),
|
|
651
|
+
labels: new Includes(ids),
|
|
652
|
+
deletedAt: new IsNull(),
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
navigateWith(
|
|
656
|
+
TableFilterUrlState.getLinkQueryParams("monitors-table", {
|
|
657
|
+
facets: state,
|
|
658
|
+
}),
|
|
659
|
+
);
|
|
660
|
+
|
|
661
|
+
const restored: JSONObject | null = TableFilterUrlState.read(
|
|
662
|
+
"monitors-table",
|
|
663
|
+
"facets",
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
expect(restored?.["name"]).toBeInstanceOf(Search);
|
|
667
|
+
expect((restored?.["name"] as Search<string>).toString()).toBe(
|
|
668
|
+
"api & gateway",
|
|
669
|
+
);
|
|
670
|
+
expect(restored?.["labels"]).toBeInstanceOf(Includes);
|
|
671
|
+
expect(
|
|
672
|
+
(restored?.["labels"] as Includes).values.map((v: unknown) => {
|
|
673
|
+
return v!.toString();
|
|
674
|
+
}),
|
|
675
|
+
).toEqual(ids);
|
|
676
|
+
expect(restored?.["deletedAt"]).toBeInstanceOf(IsNull);
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
/*
|
|
680
|
+
* A link only carries the slices it names; the arriving table must not be
|
|
681
|
+
* told anything about the others.
|
|
682
|
+
*/
|
|
683
|
+
test("a link's slices do not leak into another table or slice", () => {
|
|
684
|
+
navigateWith(
|
|
685
|
+
TableFilterUrlState.getLinkQueryParams("monitors-table", {
|
|
686
|
+
facets: { selectedLabelIds: ["a"] },
|
|
687
|
+
}),
|
|
688
|
+
);
|
|
689
|
+
|
|
690
|
+
expect(TableFilterUrlState.read("monitors-table", "facets")).toEqual({
|
|
691
|
+
selectedLabelIds: ["a"],
|
|
692
|
+
});
|
|
693
|
+
expect(TableFilterUrlState.read("monitors-table", "filter")).toBeNull();
|
|
694
|
+
expect(TableFilterUrlState.read("incidents-table", "facets")).toBeNull();
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
|
|
406
698
|
describe("URL size guard", () => {
|
|
407
699
|
type OversizedFilterFunction = () => JSONObject;
|
|
408
700
|
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import MonitorSummaryProbeUtil, {
|
|
2
|
+
AttachedProbe,
|
|
3
|
+
MonitorSummaryProbeState,
|
|
4
|
+
} from "../../../Utils/Monitor/MonitorSummaryProbeUtil";
|
|
5
|
+
import { describe, expect, it } from "@jest/globals";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* https://github.com/OneUptime/oneuptime/issues/2899
|
|
9
|
+
*
|
|
10
|
+
* The Monitor Summary card carries a "Select Probe" dropdown. It was fed every
|
|
11
|
+
* probe in the project plus every global probe - not the probes attached to the
|
|
12
|
+
* monitor being viewed. So a project with a global probe "Probe" and a custom
|
|
13
|
+
* probe "WBHQ" offered both on a monitor that only "Probe" watched, and picking
|
|
14
|
+
* "WBHQ" answered "No summary available for the selected probe. Should be few
|
|
15
|
+
* minutes for summary to show up." about data that was never going to arrive.
|
|
16
|
+
* Worse, the list is project-probes-first, so the card often *opened* on the
|
|
17
|
+
* stranger. The reporter's conclusion: "i have changed the probe, but the
|
|
18
|
+
* change was not actually applied".
|
|
19
|
+
*
|
|
20
|
+
* These pin the three rules that make the picker honest: it only offers
|
|
21
|
+
* attached probes, it keeps the user's choice, and it says which of the three
|
|
22
|
+
* empty states it is in.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const GLOBAL_PROBE: AttachedProbe = {
|
|
26
|
+
id: "33333333-3333-4333-8333-333333333333",
|
|
27
|
+
name: "Probe",
|
|
28
|
+
isEnabled: true,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const CUSTOM_PROBE: AttachedProbe = {
|
|
32
|
+
id: "44444444-4444-4444-8444-444444444444",
|
|
33
|
+
name: "WBHQ",
|
|
34
|
+
isEnabled: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const DISABLED_PROBE: AttachedProbe = {
|
|
38
|
+
id: "55555555-5555-4555-8555-555555555555",
|
|
39
|
+
name: "Retired Probe",
|
|
40
|
+
isEnabled: false,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
describe("MonitorSummaryProbeUtil.resolveSelectedProbeId", () => {
|
|
44
|
+
it("returns null when the monitor has no probes attached", () => {
|
|
45
|
+
expect(
|
|
46
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({ probes: [] }),
|
|
47
|
+
).toBeNull();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("returns null for a missing probe list rather than throwing", () => {
|
|
51
|
+
expect(
|
|
52
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
53
|
+
probes: undefined as unknown as Array<AttachedProbe>,
|
|
54
|
+
}),
|
|
55
|
+
).toBeNull();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("selects the first probe when nothing is selected yet", () => {
|
|
59
|
+
expect(
|
|
60
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
61
|
+
probes: [CUSTOM_PROBE, GLOBAL_PROBE],
|
|
62
|
+
}),
|
|
63
|
+
).toBe(CUSTOM_PROBE.id);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("keeps the probe the user picked when the list is handed down again", () => {
|
|
67
|
+
/*
|
|
68
|
+
* The effect that calls this re-runs on every new probes array. Resetting
|
|
69
|
+
* to the first entry there is indistinguishable, to a user, from a
|
|
70
|
+
* selection that refuses to stick.
|
|
71
|
+
*/
|
|
72
|
+
expect(
|
|
73
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
74
|
+
probes: [CUSTOM_PROBE, GLOBAL_PROBE],
|
|
75
|
+
currentlySelectedProbeId: GLOBAL_PROBE.id,
|
|
76
|
+
}),
|
|
77
|
+
).toBe(GLOBAL_PROBE.id);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("keeps the selection even when that probe has since been disabled", () => {
|
|
81
|
+
// The user asked to look at it; showing something else would be surprising.
|
|
82
|
+
expect(
|
|
83
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
84
|
+
probes: [GLOBAL_PROBE, DISABLED_PROBE],
|
|
85
|
+
currentlySelectedProbeId: DISABLED_PROBE.id,
|
|
86
|
+
}),
|
|
87
|
+
).toBe(DISABLED_PROBE.id);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("falls back when the selected probe has been detached from the monitor", () => {
|
|
91
|
+
expect(
|
|
92
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
93
|
+
probes: [GLOBAL_PROBE],
|
|
94
|
+
currentlySelectedProbeId: CUSTOM_PROBE.id,
|
|
95
|
+
}),
|
|
96
|
+
).toBe(GLOBAL_PROBE.id);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("prefers an enabled probe over a disabled one when defaulting", () => {
|
|
100
|
+
/*
|
|
101
|
+
* A disabled probe has nothing to show, so opening the card on one reads
|
|
102
|
+
* as broken even though everything is working as configured.
|
|
103
|
+
*/
|
|
104
|
+
expect(
|
|
105
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
106
|
+
probes: [DISABLED_PROBE, GLOBAL_PROBE],
|
|
107
|
+
}),
|
|
108
|
+
).toBe(GLOBAL_PROBE.id);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("still selects something when every attached probe is disabled", () => {
|
|
112
|
+
expect(
|
|
113
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
114
|
+
probes: [DISABLED_PROBE],
|
|
115
|
+
}),
|
|
116
|
+
).toBe(DISABLED_PROBE.id);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("ignores rows with no id, which cannot be selected", () => {
|
|
120
|
+
const noId: AttachedProbe = { id: "", name: "Broken", isEnabled: true };
|
|
121
|
+
|
|
122
|
+
expect(
|
|
123
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
124
|
+
probes: [noId, GLOBAL_PROBE],
|
|
125
|
+
}),
|
|
126
|
+
).toBe(GLOBAL_PROBE.id);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("treats an empty currently-selected id as no selection", () => {
|
|
130
|
+
expect(
|
|
131
|
+
MonitorSummaryProbeUtil.resolveSelectedProbeId({
|
|
132
|
+
probes: [DISABLED_PROBE, GLOBAL_PROBE],
|
|
133
|
+
currentlySelectedProbeId: "",
|
|
134
|
+
}),
|
|
135
|
+
).toBe(GLOBAL_PROBE.id);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe("MonitorSummaryProbeUtil.getProbeDropdownOptions", () => {
|
|
140
|
+
it("offers exactly the probes it is given, in order", () => {
|
|
141
|
+
/*
|
|
142
|
+
* The whole defect: the picker used to be handed every probe in the
|
|
143
|
+
* project. It can only ever offer what actually monitors this resource.
|
|
144
|
+
*/
|
|
145
|
+
expect(
|
|
146
|
+
MonitorSummaryProbeUtil.getProbeDropdownOptions({
|
|
147
|
+
probes: [GLOBAL_PROBE, CUSTOM_PROBE],
|
|
148
|
+
}),
|
|
149
|
+
).toEqual([
|
|
150
|
+
{ label: "Probe", value: GLOBAL_PROBE.id },
|
|
151
|
+
{ label: "WBHQ", value: CUSTOM_PROBE.id },
|
|
152
|
+
]);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("marks a disabled probe so its empty summary is explained", () => {
|
|
156
|
+
expect(
|
|
157
|
+
MonitorSummaryProbeUtil.getProbeDropdownOptions({
|
|
158
|
+
probes: [DISABLED_PROBE],
|
|
159
|
+
}),
|
|
160
|
+
).toEqual([
|
|
161
|
+
{ label: "Retired Probe (disabled)", value: DISABLED_PROBE.id },
|
|
162
|
+
]);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it("falls back to a placeholder name rather than rendering an empty option", () => {
|
|
166
|
+
expect(
|
|
167
|
+
MonitorSummaryProbeUtil.getProbeDropdownOptions({
|
|
168
|
+
probes: [{ id: GLOBAL_PROBE.id, name: "", isEnabled: true }],
|
|
169
|
+
}),
|
|
170
|
+
).toEqual([{ label: "Unknown", value: GLOBAL_PROBE.id }]);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("drops rows with no id, which would produce an unselectable option", () => {
|
|
174
|
+
expect(
|
|
175
|
+
MonitorSummaryProbeUtil.getProbeDropdownOptions({
|
|
176
|
+
probes: [{ id: "", name: "Broken", isEnabled: true }, GLOBAL_PROBE],
|
|
177
|
+
}),
|
|
178
|
+
).toEqual([{ label: "Probe", value: GLOBAL_PROBE.id }]);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("returns nothing for a monitor with no probes", () => {
|
|
182
|
+
expect(
|
|
183
|
+
MonitorSummaryProbeUtil.getProbeDropdownOptions({ probes: [] }),
|
|
184
|
+
).toEqual([]);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
describe("MonitorSummaryProbeUtil.getProbeState", () => {
|
|
189
|
+
it("reports results whenever there is anything to render", () => {
|
|
190
|
+
expect(
|
|
191
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
192
|
+
isProbeableMonitor: true,
|
|
193
|
+
attachedProbeCount: 1,
|
|
194
|
+
isSelectedProbeEnabled: true,
|
|
195
|
+
probeResponseCount: 1,
|
|
196
|
+
}),
|
|
197
|
+
).toBe(MonitorSummaryProbeState.HasResults);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("prefers showing results over any empty-state explanation", () => {
|
|
201
|
+
/*
|
|
202
|
+
* A probe switched off after it reported still has data worth looking at.
|
|
203
|
+
*/
|
|
204
|
+
expect(
|
|
205
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
206
|
+
isProbeableMonitor: true,
|
|
207
|
+
attachedProbeCount: 1,
|
|
208
|
+
isSelectedProbeEnabled: false,
|
|
209
|
+
probeResponseCount: 2,
|
|
210
|
+
}),
|
|
211
|
+
).toBe(MonitorSummaryProbeState.HasResults);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("says nothing is monitoring the resource when no probe is attached", () => {
|
|
215
|
+
// Not "wait a few minutes" - waiting will never help.
|
|
216
|
+
expect(
|
|
217
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
218
|
+
isProbeableMonitor: true,
|
|
219
|
+
attachedProbeCount: 0,
|
|
220
|
+
isSelectedProbeEnabled: true,
|
|
221
|
+
probeResponseCount: 0,
|
|
222
|
+
}),
|
|
223
|
+
).toBe(MonitorSummaryProbeState.NoProbesAttached);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("says the probe is switched off when it is attached but disabled", () => {
|
|
227
|
+
expect(
|
|
228
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
229
|
+
isProbeableMonitor: true,
|
|
230
|
+
attachedProbeCount: 1,
|
|
231
|
+
isSelectedProbeEnabled: false,
|
|
232
|
+
probeResponseCount: 0,
|
|
233
|
+
}),
|
|
234
|
+
).toBe(MonitorSummaryProbeState.SelectedProbeDisabled);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it("asks the user to wait only when waiting is actually the answer", () => {
|
|
238
|
+
expect(
|
|
239
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
240
|
+
isProbeableMonitor: true,
|
|
241
|
+
attachedProbeCount: 1,
|
|
242
|
+
isSelectedProbeEnabled: true,
|
|
243
|
+
probeResponseCount: 0,
|
|
244
|
+
}),
|
|
245
|
+
).toBe(MonitorSummaryProbeState.AwaitingFirstResult);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it("does not blame probes on a monitor type that has none", () => {
|
|
249
|
+
/*
|
|
250
|
+
* Server, incoming-request and telemetry monitors are not watched by
|
|
251
|
+
* probes at all, so "no probes are monitoring this resource" would be
|
|
252
|
+
* nonsense there.
|
|
253
|
+
*/
|
|
254
|
+
expect(
|
|
255
|
+
MonitorSummaryProbeUtil.getProbeState({
|
|
256
|
+
isProbeableMonitor: false,
|
|
257
|
+
attachedProbeCount: 0,
|
|
258
|
+
isSelectedProbeEnabled: true,
|
|
259
|
+
probeResponseCount: 0,
|
|
260
|
+
}),
|
|
261
|
+
).toBe(MonitorSummaryProbeState.AwaitingFirstResult);
|
|
262
|
+
});
|
|
263
|
+
});
|