@oneuptime/common 11.7.3 → 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/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/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/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 +8 -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/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/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/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +427 -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/Types/Date.ts +15 -6
- 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/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +116 -67
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +150 -47
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -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/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/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/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 +8 -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/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/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 +69 -33
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +73 -32
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -1
- 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/StatusPage/ResourceGroupSection.js +73 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
- 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/package.json +1 -1
|
@@ -569,4 +569,431 @@ describe("ColumnCustomizationModal", () => {
|
|
|
569
569
|
"Customize Columns",
|
|
570
570
|
);
|
|
571
571
|
});
|
|
572
|
+
|
|
573
|
+
test("the header carries the title and description, and no icon", () => {
|
|
574
|
+
const { view }: RenderedModal = renderModal();
|
|
575
|
+
|
|
576
|
+
expect(view.getByTestId("modal-description")).toHaveTextContent(
|
|
577
|
+
"Choose which columns to show and drag them into the order you want.",
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
// The header icon was decorative; it repeated what the title already said.
|
|
581
|
+
expect(view.queryByTestId("icon")).not.toBeInTheDocument();
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
test("uses a custom description when one is given", () => {
|
|
585
|
+
const onSave: MockFunction = getJestMockFunction();
|
|
586
|
+
const onClose: MockFunction = getJestMockFunction();
|
|
587
|
+
const onReset: MockFunction = getJestMockFunction();
|
|
588
|
+
|
|
589
|
+
const view: RenderResult = render(
|
|
590
|
+
<ColumnCustomizationModal<Monitor>
|
|
591
|
+
columns={getDefaultColumns()}
|
|
592
|
+
onSave={onSave}
|
|
593
|
+
onClose={onClose}
|
|
594
|
+
onReset={onReset}
|
|
595
|
+
description="Pick the ones you care about."
|
|
596
|
+
/>,
|
|
597
|
+
);
|
|
598
|
+
|
|
599
|
+
expect(view.getByTestId("modal-description")).toHaveTextContent(
|
|
600
|
+
"Pick the ones you care about.",
|
|
601
|
+
);
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
/*
|
|
605
|
+
* Below: the state the two bulk actions and the search box put the rest of
|
|
606
|
+
* the body into. These are the parts a viewer reads to work out why a
|
|
607
|
+
* control did nothing, so each one is pinned rather than left to the styling.
|
|
608
|
+
*/
|
|
609
|
+
|
|
610
|
+
test("Show all is inert once every column is already on", () => {
|
|
611
|
+
const { view }: RenderedModal = renderModal();
|
|
612
|
+
|
|
613
|
+
const showAll: HTMLElement = view.getByTestId(
|
|
614
|
+
"column-customization-show-all",
|
|
615
|
+
);
|
|
616
|
+
|
|
617
|
+
expect(showAll).not.toBeDisabled();
|
|
618
|
+
|
|
619
|
+
fireEvent.click(showAll);
|
|
620
|
+
|
|
621
|
+
// Nothing left to show, so the control says so rather than doing nothing.
|
|
622
|
+
expect(showAll).toBeDisabled();
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
test("Show all comes back to life as soon as a column is switched off", () => {
|
|
626
|
+
const { view }: RenderedModal = renderModal();
|
|
627
|
+
|
|
628
|
+
fireEvent.click(view.getByTestId("column-customization-show-all"));
|
|
629
|
+
fireEvent.click(view.getByTestId("column-toggle-description"));
|
|
630
|
+
|
|
631
|
+
expect(
|
|
632
|
+
view.getByTestId("column-customization-show-all"),
|
|
633
|
+
).not.toBeDisabled();
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
test("Hide all is inert once only the one required column is left", () => {
|
|
637
|
+
const { view }: RenderedModal = renderModal();
|
|
638
|
+
|
|
639
|
+
const hideAll: HTMLElement = view.getByTestId(
|
|
640
|
+
"column-customization-hide-all",
|
|
641
|
+
);
|
|
642
|
+
|
|
643
|
+
fireEvent.click(hideAll);
|
|
644
|
+
|
|
645
|
+
/*
|
|
646
|
+
* A second press could only try to hide the column that has to stay, so
|
|
647
|
+
* the button is switched off instead of quietly refusing.
|
|
648
|
+
*/
|
|
649
|
+
expect(hideAll).toBeDisabled();
|
|
650
|
+
expect(view.getByTestId("column-customization-count")).toHaveTextContent(
|
|
651
|
+
"1 of 4 columns shown",
|
|
652
|
+
);
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
test("Hide all starts out inert when the caller opens with a single column on", () => {
|
|
656
|
+
const { view }: RenderedModal = renderModal({
|
|
657
|
+
columns: [
|
|
658
|
+
makeEntry({ id: "name", title: "Monitor Name", isVisible: true }),
|
|
659
|
+
makeEntry({
|
|
660
|
+
id: "description",
|
|
661
|
+
title: "Description",
|
|
662
|
+
isVisible: false,
|
|
663
|
+
}),
|
|
664
|
+
],
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
expect(view.getByTestId("column-customization-hide-all")).toBeDisabled();
|
|
668
|
+
expect(
|
|
669
|
+
view.getByTestId("column-customization-show-all"),
|
|
670
|
+
).not.toBeDisabled();
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
test("the column that cannot be switched off is marked as required", () => {
|
|
674
|
+
const { view }: RenderedModal = renderModal();
|
|
675
|
+
|
|
676
|
+
expect(view.queryByTestId("column-locked-name")).not.toBeInTheDocument();
|
|
677
|
+
|
|
678
|
+
fireEvent.click(view.getByTestId("column-customization-hide-all"));
|
|
679
|
+
|
|
680
|
+
/*
|
|
681
|
+
* The disabled checkbox alone reads as a glitch. The badge is the only
|
|
682
|
+
* thing on the row that explains why it will not move.
|
|
683
|
+
*/
|
|
684
|
+
expect(view.getByTestId("column-locked-name")).toHaveTextContent(
|
|
685
|
+
"Required",
|
|
686
|
+
);
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
test("the required badge follows the column that is actually locked", () => {
|
|
690
|
+
const { view }: RenderedModal = renderModal({
|
|
691
|
+
columns: [
|
|
692
|
+
makeEntry({ id: "name", title: "Monitor Name", isVisible: true }),
|
|
693
|
+
makeEntry({ id: "description", title: "Description", isVisible: true }),
|
|
694
|
+
],
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
fireEvent.click(view.getByTestId("column-toggle-name"));
|
|
698
|
+
|
|
699
|
+
expect(view.getByTestId("column-locked-description")).toBeInTheDocument();
|
|
700
|
+
expect(view.queryByTestId("column-locked-name")).not.toBeInTheDocument();
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
test("the clear button only exists while there is something to clear", () => {
|
|
704
|
+
const { view }: RenderedModal = renderModal();
|
|
705
|
+
|
|
706
|
+
expect(
|
|
707
|
+
view.queryByTestId("column-customization-search-clear"),
|
|
708
|
+
).not.toBeInTheDocument();
|
|
709
|
+
|
|
710
|
+
typeSearch(view, "desc");
|
|
711
|
+
|
|
712
|
+
expect(
|
|
713
|
+
view.getByTestId("column-customization-search-clear"),
|
|
714
|
+
).toBeInTheDocument();
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
test("the clear button empties the box and brings the whole list back", () => {
|
|
718
|
+
const { view }: RenderedModal = renderModal();
|
|
719
|
+
|
|
720
|
+
typeSearch(view, "desc");
|
|
721
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(1);
|
|
722
|
+
|
|
723
|
+
fireEvent.click(view.getByTestId("column-customization-search-clear"));
|
|
724
|
+
|
|
725
|
+
expect(view.getByTestId("column-customization-search")).toHaveValue("");
|
|
726
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(4);
|
|
727
|
+
expect(
|
|
728
|
+
view.queryByTestId("column-customization-search-clear"),
|
|
729
|
+
).not.toBeInTheDocument();
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
test("clearing through the button re-arms the move buttons", () => {
|
|
733
|
+
const { view, onSave }: RenderedModal = renderModal();
|
|
734
|
+
|
|
735
|
+
typeSearch(view, "desc");
|
|
736
|
+
fireEvent.click(view.getByTestId("column-customization-search-clear"));
|
|
737
|
+
fireEvent.click(view.getByTestId("column-move-down-name"));
|
|
738
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
739
|
+
|
|
740
|
+
expect(getSavedIds(onSave)).toEqual([
|
|
741
|
+
"currentMonitorStatus",
|
|
742
|
+
"name",
|
|
743
|
+
"description",
|
|
744
|
+
"createdAt",
|
|
745
|
+
]);
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
test("a search that matches nothing still offers a way out", () => {
|
|
749
|
+
const { view }: RenderedModal = renderModal();
|
|
750
|
+
|
|
751
|
+
typeSearch(view, "no-such-column");
|
|
752
|
+
|
|
753
|
+
expect(
|
|
754
|
+
view.getByTestId("column-customization-no-results"),
|
|
755
|
+
).toBeInTheDocument();
|
|
756
|
+
|
|
757
|
+
fireEvent.click(view.getByTestId("column-customization-search-clear"));
|
|
758
|
+
|
|
759
|
+
expect(
|
|
760
|
+
view.queryByTestId("column-customization-no-results"),
|
|
761
|
+
).not.toBeInTheDocument();
|
|
762
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(4);
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
test("the hint explains reordering, and explains its absence while searching", () => {
|
|
766
|
+
const { view }: RenderedModal = renderModal();
|
|
767
|
+
|
|
768
|
+
expect(view.getByTestId("column-customization-hint")).toHaveTextContent(
|
|
769
|
+
"Drag a row, or use the arrows, to change the column order.",
|
|
770
|
+
);
|
|
771
|
+
|
|
772
|
+
typeSearch(view, "desc");
|
|
773
|
+
|
|
774
|
+
/*
|
|
775
|
+
* The move buttons go grey during a search. Without this line the viewer
|
|
776
|
+
* is left to guess whether that is deliberate.
|
|
777
|
+
*/
|
|
778
|
+
expect(view.getByTestId("column-customization-hint")).toHaveTextContent(
|
|
779
|
+
"Clear the search to reorder columns.",
|
|
780
|
+
);
|
|
781
|
+
|
|
782
|
+
typeSearch(view, "");
|
|
783
|
+
|
|
784
|
+
expect(view.getByTestId("column-customization-hint")).toHaveTextContent(
|
|
785
|
+
"Drag a row, or use the arrows, to change the column order.",
|
|
786
|
+
);
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
test("whitespace alone is not a search", () => {
|
|
790
|
+
const { view }: RenderedModal = renderModal();
|
|
791
|
+
|
|
792
|
+
typeSearch(view, " ");
|
|
793
|
+
|
|
794
|
+
// Nothing is filtered out, so nothing about the list should change either.
|
|
795
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(4);
|
|
796
|
+
expect(view.getByTestId("column-customization-hint")).toHaveTextContent(
|
|
797
|
+
"Drag a row, or use the arrows, to change the column order.",
|
|
798
|
+
);
|
|
799
|
+
expect(view.getByTestId("column-move-down-name")).not.toBeDisabled();
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
test("a search that matches everything leaves every row in place", () => {
|
|
803
|
+
const { view }: RenderedModal = renderModal({
|
|
804
|
+
columns: [
|
|
805
|
+
makeEntry({ id: "one", title: "Alpha One", isVisible: true }),
|
|
806
|
+
makeEntry({ id: "two", title: "Alpha Two", isVisible: true }),
|
|
807
|
+
],
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
typeSearch(view, "alpha");
|
|
811
|
+
|
|
812
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(2);
|
|
813
|
+
// Still a search, so reordering stays off.
|
|
814
|
+
expect(view.getByTestId("column-move-down-one")).toBeDisabled();
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
test("a column can be toggled from inside a filtered list", () => {
|
|
818
|
+
const { view, onSave }: RenderedModal = renderModal();
|
|
819
|
+
|
|
820
|
+
typeSearch(view, "description");
|
|
821
|
+
fireEvent.click(view.getByTestId("column-toggle-description"));
|
|
822
|
+
|
|
823
|
+
expect(view.getByTestId("column-customization-count")).toHaveTextContent(
|
|
824
|
+
"2 of 4 columns shown",
|
|
825
|
+
);
|
|
826
|
+
|
|
827
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
828
|
+
|
|
829
|
+
expect(
|
|
830
|
+
getSaved(onSave).find((entry: CustomizableColumn<Monitor>) => {
|
|
831
|
+
return entry.id === "description";
|
|
832
|
+
})?.isVisible,
|
|
833
|
+
).toBe(false);
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
test("bulk actions reach the columns a search is hiding", () => {
|
|
837
|
+
const { view, onSave }: RenderedModal = renderModal();
|
|
838
|
+
|
|
839
|
+
typeSearch(view, "name");
|
|
840
|
+
fireEvent.click(view.getByTestId("column-customization-show-all"));
|
|
841
|
+
typeSearch(view, "");
|
|
842
|
+
|
|
843
|
+
/*
|
|
844
|
+
* "Show all" is not "show all of the matches" - it works on the layout,
|
|
845
|
+
* not on what happens to be on screen.
|
|
846
|
+
*/
|
|
847
|
+
expect(view.getByTestId("column-customization-count")).toHaveTextContent(
|
|
848
|
+
"4 of 4 columns shown",
|
|
849
|
+
);
|
|
850
|
+
|
|
851
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
852
|
+
|
|
853
|
+
expect(
|
|
854
|
+
getSaved(onSave).every((entry: CustomizableColumn<Monitor>) => {
|
|
855
|
+
return entry.isVisible;
|
|
856
|
+
}),
|
|
857
|
+
).toBe(true);
|
|
858
|
+
});
|
|
859
|
+
|
|
860
|
+
test("Save reports the entries untouched when nothing was changed", () => {
|
|
861
|
+
const { view, onSave }: RenderedModal = renderModal();
|
|
862
|
+
|
|
863
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
864
|
+
|
|
865
|
+
expect(getSavedIds(onSave)).toEqual([
|
|
866
|
+
"name",
|
|
867
|
+
"currentMonitorStatus",
|
|
868
|
+
"description",
|
|
869
|
+
"createdAt",
|
|
870
|
+
]);
|
|
871
|
+
expect(
|
|
872
|
+
getSaved(onSave).map((entry: CustomizableColumn<Monitor>) => {
|
|
873
|
+
return entry.isVisible;
|
|
874
|
+
}),
|
|
875
|
+
).toEqual([true, true, true, false]);
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
test("Escape closes the modal without saving", () => {
|
|
879
|
+
const { onSave, onClose }: RenderedModal = renderModal();
|
|
880
|
+
|
|
881
|
+
fireEvent.keyDown(document, { key: "Escape" });
|
|
882
|
+
|
|
883
|
+
expect(onClose).toHaveBeenCalledTimes(1);
|
|
884
|
+
expect(onSave).not.toHaveBeenCalled();
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
test("the header close button closes without saving", () => {
|
|
888
|
+
const { view, onSave, onClose }: RenderedModal = renderModal();
|
|
889
|
+
|
|
890
|
+
fireEvent.click(view.getByTestId("column-toggle-description"));
|
|
891
|
+
fireEvent.click(view.getByTestId("close-button"));
|
|
892
|
+
|
|
893
|
+
expect(onClose).toHaveBeenCalledTimes(1);
|
|
894
|
+
expect(onSave).not.toHaveBeenCalled();
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
test("a single-column table opens with everything locked down", () => {
|
|
898
|
+
const { view }: RenderedModal = renderModal({
|
|
899
|
+
columns: [
|
|
900
|
+
makeEntry({ id: "name", title: "Monitor Name", isVisible: true }),
|
|
901
|
+
],
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
expect(view.getByTestId("column-toggle-name")).toBeDisabled();
|
|
905
|
+
expect(view.getByTestId("column-move-up-name")).toBeDisabled();
|
|
906
|
+
expect(view.getByTestId("column-move-down-name")).toBeDisabled();
|
|
907
|
+
expect(view.getByTestId("column-customization-show-all")).toBeDisabled();
|
|
908
|
+
expect(view.getByTestId("column-customization-hide-all")).toBeDisabled();
|
|
909
|
+
expect(view.getByTestId("column-customization-count")).toHaveTextContent(
|
|
910
|
+
"1 of 1 columns shown",
|
|
911
|
+
);
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
test("an empty column list renders without falling over", () => {
|
|
915
|
+
const { view }: RenderedModal = renderModal({ columns: [] });
|
|
916
|
+
|
|
917
|
+
expect(view.getByTestId("column-customization-modal")).toBeInTheDocument();
|
|
918
|
+
expect(view.queryAllByTestId(/^column-toggle-/)).toHaveLength(0);
|
|
919
|
+
expect(view.getByTestId("column-customization-count")).toHaveTextContent(
|
|
920
|
+
"0 of 0 columns shown",
|
|
921
|
+
);
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
test("columns with the same title are still addressed individually", () => {
|
|
925
|
+
const { view, onSave }: RenderedModal = renderModal({
|
|
926
|
+
columns: [
|
|
927
|
+
makeEntry({ id: "createdAt", title: "Date", isVisible: true }),
|
|
928
|
+
makeEntry({ id: "updatedAt", title: "Date", isVisible: true }),
|
|
929
|
+
],
|
|
930
|
+
});
|
|
931
|
+
|
|
932
|
+
// The row is keyed by id, not by the title the viewer happens to see.
|
|
933
|
+
fireEvent.click(view.getByTestId("column-toggle-updatedAt"));
|
|
934
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
935
|
+
|
|
936
|
+
expect(
|
|
937
|
+
getSaved(onSave).map((entry: CustomizableColumn<Monitor>) => {
|
|
938
|
+
return { id: entry.id, isVisible: entry.isVisible };
|
|
939
|
+
}),
|
|
940
|
+
).toEqual([
|
|
941
|
+
{ id: "createdAt", isVisible: true },
|
|
942
|
+
{ id: "updatedAt", isVisible: false },
|
|
943
|
+
]);
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
test("a column with no title is searchable without breaking the filter", () => {
|
|
947
|
+
const untitled: CustomizableColumn<Monitor> = makeEntry({
|
|
948
|
+
id: "untitled",
|
|
949
|
+
title: "",
|
|
950
|
+
isVisible: true,
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
const { view }: RenderedModal = renderModal({
|
|
954
|
+
columns: [
|
|
955
|
+
makeEntry({ id: "name", title: "Monitor Name", isVisible: true }),
|
|
956
|
+
untitled,
|
|
957
|
+
],
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(2);
|
|
961
|
+
|
|
962
|
+
typeSearch(view, "monitor");
|
|
963
|
+
|
|
964
|
+
// The untitled column simply does not match; it does not throw.
|
|
965
|
+
expect(view.getAllByTestId(/^column-toggle-/)).toHaveLength(1);
|
|
966
|
+
expect(view.getByTestId("column-toggle-name")).toBeInTheDocument();
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
test("Reset does not close the modal on the viewer's behalf", () => {
|
|
970
|
+
const { view, onReset, onClose }: RenderedModal = renderModal({
|
|
971
|
+
isDefaultLayout: false,
|
|
972
|
+
});
|
|
973
|
+
|
|
974
|
+
fireEvent.click(view.getByTestId("column-customization-reset"));
|
|
975
|
+
|
|
976
|
+
/*
|
|
977
|
+
* Closing is the caller's decision - it owns the stored layout and this
|
|
978
|
+
* modal only reports the click.
|
|
979
|
+
*/
|
|
980
|
+
expect(onReset).toHaveBeenCalledTimes(1);
|
|
981
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
test("the props handed to Save are a fresh list, not the caller's array", () => {
|
|
985
|
+
const columns: Array<CustomizableColumn<Monitor>> = getDefaultColumns();
|
|
986
|
+
const { view, onSave }: RenderedModal = renderModal({ columns });
|
|
987
|
+
|
|
988
|
+
fireEvent.click(view.getByTestId("column-move-down-name"));
|
|
989
|
+
fireEvent.click(view.getByTestId("modal-footer-submit-button"));
|
|
990
|
+
|
|
991
|
+
// The caller's own array is left exactly as it was passed in.
|
|
992
|
+
expect(
|
|
993
|
+
columns.map((entry: CustomizableColumn<Monitor>) => {
|
|
994
|
+
return entry.id;
|
|
995
|
+
}),
|
|
996
|
+
).toEqual(["name", "currentMonitorStatus", "description", "createdAt"]);
|
|
997
|
+
expect(getSaved(onSave)).not.toBe(columns);
|
|
998
|
+
});
|
|
572
999
|
});
|