@oneuptime/common 14.0.13 → 14.0.14
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/AlertGroupingRule.ts +10 -6
- package/Models/DatabaseModels/File.ts +41 -2
- package/Models/DatabaseModels/Form.ts +126 -0
- package/Models/DatabaseModels/IncidentGroupingRule.ts +10 -6
- package/Models/DatabaseModels/LogDropFilter.ts +1 -0
- package/Models/DatabaseModels/LogPipeline.ts +1 -0
- package/Models/DatabaseModels/LogScrubRule.ts +14 -8
- package/Models/DatabaseModels/MetricRecordingRule.ts +2 -1
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.ts +4 -2
- package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +22 -9
- package/Models/DatabaseModels/ProjectCallSMSConfig.ts +6 -1
- package/Models/DatabaseModels/StatusPage.ts +8 -4
- package/Models/DatabaseModels/TraceDropFilter.ts +1 -0
- package/Models/DatabaseModels/TracePipeline.ts +1 -0
- package/Models/DatabaseModels/TraceRecordingRule.ts +2 -1
- package/Models/DatabaseModels/TraceScrubRule.ts +14 -8
- package/Models/DatabaseModels/UserOnCallLog.ts +4 -2
- package/Server/API/CustomDomainRoutes.ts +251 -0
- package/Server/API/DashboardAPI.ts +33 -4
- package/Server/API/DashboardDomainAPI.ts +63 -93
- package/Server/API/StatusPageAPI.ts +92 -0
- package/Server/API/StatusPageDomainAPI.ts +59 -96
- package/Server/Infrastructure/GlobalCache.ts +84 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1797700000000-AddFormBranding.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/AlertGroupingEngineService.ts +48 -70
- package/Server/Services/AlertGroupingRuleService.ts +38 -0
- package/Server/Services/CephClusterService.ts +25 -0
- package/Server/Services/CloudResourceService.ts +42 -0
- package/Server/Services/DashboardDomainService.ts +640 -214
- package/Server/Services/DashboardService.ts +30 -8
- package/Server/Services/DatabaseService.ts +143 -12
- package/Server/Services/DockerHostService.ts +60 -0
- package/Server/Services/DockerSwarmClusterService.ts +25 -0
- package/Server/Services/FileService.ts +60 -0
- package/Server/Services/FormService.ts +212 -2
- package/Server/Services/GlobalOidcService.ts +10 -0
- package/Server/Services/GlobalSsoService.ts +10 -0
- package/Server/Services/HostService.ts +58 -0
- package/Server/Services/IncidentGroupingEngineService.ts +48 -70
- package/Server/Services/IncidentGroupingRuleService.ts +38 -0
- package/Server/Services/IoTFleetService.ts +26 -0
- package/Server/Services/KubernetesClusterService.ts +64 -0
- package/Server/Services/LabelService.ts +6 -17
- package/Server/Services/LogScrubRuleService.ts +50 -0
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +264 -0
- package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +9 -1
- package/Server/Services/OnCallNotificationAlertingService.ts +24 -29
- package/Server/Services/OnCallSetupReminderService.ts +41 -40
- package/Server/Services/PodmanHostService.ts +60 -0
- package/Server/Services/ProfileAggregationService.ts +38 -0
- package/Server/Services/ProjectCallSMSConfigService.ts +76 -3
- package/Server/Services/ProjectOidcService.ts +20 -0
- package/Server/Services/ProjectSsoService.ts +20 -0
- package/Server/Services/ProxmoxClusterService.ts +25 -0
- package/Server/Services/RumApplicationService.ts +45 -0
- package/Server/Services/ScheduledMaintenanceService.ts +9 -23
- package/Server/Services/ServerlessFunctionService.ts +47 -0
- package/Server/Services/ServiceService.ts +33 -10
- package/Server/Services/StatusPageDomainService.ts +622 -213
- package/Server/Services/StatusPageOidcService.ts +20 -0
- package/Server/Services/StatusPageResourceService.ts +89 -34
- package/Server/Services/StatusPageService.ts +270 -54
- package/Server/Services/StatusPageSsoService.ts +20 -0
- package/Server/Services/TraceScrubRuleService.ts +50 -0
- package/Server/Services/UserIncomingCallNumberService.ts +28 -14
- package/Server/Services/VMwareVCenterService.ts +25 -0
- package/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.ts +3 -3
- package/Server/Utils/Greenlock/CertificateOrder.ts +482 -0
- package/Server/Utils/Greenlock/CertificateOrderBudget.ts +134 -0
- package/Server/Utils/Greenlock/CertificateOrderFailures.ts +288 -0
- package/Server/Utils/Greenlock/CertificateOrderLock.ts +163 -0
- package/Server/Utils/Greenlock/CertificateOrderOutcome.ts +29 -0
- package/Server/Utils/Greenlock/CertificateOwners.ts +72 -0
- package/Server/Utils/Greenlock/CertificateReissueOrder.ts +99 -0
- package/Server/Utils/Greenlock/CustomDomainOrders.ts +397 -0
- package/Server/Utils/Greenlock/Greenlock.ts +839 -203
- package/Server/Utils/Rules/GroupingRuleEpisodeOwners.ts +551 -0
- package/Server/Utils/Rules/OwnerRuleAssignment.ts +8 -1
- package/Server/Utils/ScrubRuleValidation.ts +248 -0
- package/Server/Utils/StatusPage/AffectedStatusPageResources.ts +138 -0
- package/Server/Utils/StatusPage/StatusPagesListingMonitorsBuilder.ts +294 -0
- package/Server/Utils/Telemetry/DiscoveredResourceCreate.ts +275 -0
- package/Server/Utils/Telemetry/DiscoveredResourceUpdate.ts +217 -0
- package/Server/Utils/Telemetry/MessageQueueDiscovery.ts +8 -2
- package/Tests/App/Accounts/FormPage.test.tsx +238 -0
- package/Tests/App/Accounts/FormUtils.test.ts +108 -0
- package/Tests/App/AdminDashboard/AdminAddToProjectMembersTeam.test.tsx +1087 -0
- package/Tests/App/AdminDashboard/AdminAuthenticationRequireSso.test.tsx +140 -138
- package/Tests/App/AdminDashboard/AdminAuthenticationSsoCardLocales.test.tsx +144 -145
- package/Tests/App/AdminDashboard/AdminSettingsFormsOnePage.test.tsx +907 -0
- package/Tests/App/AdminDashboard/AdminSettingsSwitches.test.tsx +906 -0
- package/Tests/App/AdminDashboard/AdminSmtpSettingsForm.test.tsx +823 -0
- package/Tests/App/AdminDashboard/BulkAddUsersToProjectModal.test.tsx +341 -368
- package/Tests/App/AdminDashboard/GlobalSsoOidcPages.test.tsx +199 -54
- package/Tests/App/AdminDashboard/ProjectScopedTeamsPicker.test.tsx +991 -0
- package/Tests/App/Dashboard/AIInvestigationSettingsLimits.test.tsx +147 -90
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +224 -104
- package/Tests/App/Dashboard/AdminUserNotificationMethodsPage.test.tsx +302 -0
- package/Tests/App/Dashboard/AdminUserOnCallPages.test.tsx +408 -152
- package/Tests/App/Dashboard/AffectedResourcesPicker.test.tsx +55 -0
- package/Tests/App/Dashboard/AffectedResourcesPickerEditForm.test.tsx +206 -115
- package/Tests/App/Dashboard/AffectedResourcesPickerFocusLeave.test.tsx +32 -0
- package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +206 -71
- package/Tests/App/Dashboard/AlertEpisodeViewFields.test.tsx +45 -9
- package/Tests/App/Dashboard/AnnouncementCreateForm.test.tsx +1208 -0
- package/Tests/App/Dashboard/AnnouncementEditAndTemplateForms.test.tsx +693 -0
- package/Tests/App/Dashboard/AnnouncementFormsStructure.test.ts +546 -0
- package/Tests/App/Dashboard/AnnouncementStatusPageSuggestions.test.tsx +425 -0
- package/Tests/App/Dashboard/AnnouncementsTableCreateLinks.test.tsx +267 -0
- package/Tests/App/Dashboard/ApiKeyCreateForm.test.ts +68 -51
- package/Tests/App/Dashboard/ApiKeyViewPermissions.test.tsx +11 -9
- package/Tests/App/Dashboard/ApiKeysCreateAccess.test.tsx +24 -16
- package/Tests/App/Dashboard/BulkChangeStateModalOnePage.test.tsx +333 -0
- package/Tests/App/Dashboard/CardDescriptionsSayWhatFor.test.tsx +307 -0
- package/Tests/App/Dashboard/ChangeAlertStateAIHeader.test.tsx +18 -4
- package/Tests/App/Dashboard/CloudDocumentationCard.test.tsx +7 -2
- package/Tests/App/Dashboard/ColorFieldsPrefilledPages.test.tsx +453 -0
- package/Tests/App/Dashboard/CreateFromRecordBreadcrumbs.test.ts +272 -0
- package/Tests/App/Dashboard/CreateFromRecordLinks.test.tsx +495 -0
- package/Tests/App/Dashboard/CreateFromRecordPages.test.tsx +1026 -0
- package/Tests/App/Dashboard/CreateWorkflowModal.test.tsx +65 -23
- package/Tests/App/Dashboard/CriteriaName.test.ts +5 -1
- package/Tests/App/Dashboard/CustomDomainCreateFlow.test.tsx +516 -0
- package/Tests/App/Dashboard/CustomDomainDnsSetupModal.test.tsx +547 -0
- package/Tests/App/Dashboard/CustomDomainsPages.test.tsx +1077 -0
- package/Tests/App/Dashboard/CustomFieldSimpleCreate.test.tsx +2 -2
- package/Tests/App/Dashboard/CustomFieldSimpleCreateRender.test.tsx +12 -6
- package/Tests/App/Dashboard/CustomFieldsSettingsIncidentOptions.test.tsx +1 -1
- package/Tests/App/Dashboard/CustomSmtpConfigForm.test.tsx +969 -0
- package/Tests/App/Dashboard/DashboardBlankCanvasAddWidget.test.tsx +425 -0
- package/Tests/App/Dashboard/DashboardCommandPalette.test.tsx +400 -0
- package/Tests/App/Dashboard/DashboardComponentsMRTranslation.test.tsx +4 -3
- package/Tests/App/Dashboard/DashboardCreateForm.test.ts +375 -0
- package/Tests/App/Dashboard/DashboardCreateFromTemplate.test.tsx +727 -0
- package/Tests/App/Dashboard/DashboardEmptyCanvasAddWidget.test.tsx +86 -0
- package/Tests/App/Dashboard/DashboardPhoneProductsMenu.test.tsx +99 -9
- package/Tests/App/Dashboard/DashboardSharingCard.test.tsx +1226 -0
- package/Tests/App/Dashboard/DashboardSharingEntryPoints.test.tsx +383 -0
- package/Tests/App/Dashboard/DashboardSharingPage.test.tsx +478 -0
- package/Tests/App/Dashboard/DeclareFormsAdvancedRender.test.tsx +90 -34
- package/Tests/App/Dashboard/DeclareIncidentMonitorsApart.test.tsx +1028 -0
- package/Tests/App/Dashboard/DefaultSsoTeams.test.tsx +215 -0
- package/Tests/App/Dashboard/DisabledWarningArchived.test.tsx +3 -3
- package/Tests/App/Dashboard/DisabledWarningRobustness.test.tsx +15 -12
- package/Tests/App/Dashboard/DiscoveredResourceCreateForms.test.tsx +936 -0
- package/Tests/App/Dashboard/EmbeddedMetricCardGroup.test.tsx +720 -0
- package/Tests/App/Dashboard/EpisodeMemberRoleAssignmentsFormField.test.tsx +331 -0
- package/Tests/App/Dashboard/EpisodePostmortemPage.test.tsx +327 -0
- package/Tests/App/Dashboard/EscalationRuleForm.test.ts +2 -2
- package/Tests/App/Dashboard/EscalationRuleFormGuard.test.ts +6 -2
- package/Tests/App/Dashboard/EscalationRuleOneStep.test.tsx +8 -4
- package/Tests/App/Dashboard/EventMeasurements.test.ts +1175 -0
- package/Tests/App/Dashboard/EventMeasurementsCard.test.tsx +993 -0
- package/Tests/App/Dashboard/EventNoteComposerDialog.test.tsx +939 -0
- package/Tests/App/Dashboard/EventNotes.test.tsx +34 -1
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +186 -1
- package/Tests/App/Dashboard/EventSettingsSwitchPages.test.tsx +625 -0
- package/Tests/App/Dashboard/ExceptionMonitorEnvironmentFilter.test.tsx +6 -2
- package/Tests/App/Dashboard/FeedNoteComposerDialog.test.tsx +1327 -0
- package/Tests/App/Dashboard/FeedNoteDialogHelpers.ts +109 -0
- package/Tests/App/Dashboard/FilterChipClearButton.test.tsx +356 -0
- package/Tests/App/Dashboard/FormBrandingSection.test.tsx +504 -0
- package/Tests/App/Dashboard/FormBrandingValues.test.ts +255 -0
- package/Tests/App/Dashboard/FormBuilderParts.test.tsx +38 -1
- package/Tests/App/Dashboard/FormBuilderUi.test.tsx +176 -2
- package/Tests/App/Dashboard/FormMappingCard.test.tsx +33 -13
- package/Tests/App/Dashboard/FormsMovedPagesAndSubmissions.test.tsx +1 -1
- package/Tests/App/Dashboard/GeneratedKeyForms.test.tsx +30 -7
- package/Tests/App/Dashboard/GlobalProbesOnNewMonitorsCard.test.tsx +258 -0
- package/Tests/App/Dashboard/GroupingRuleFormFlow.test.tsx +653 -37
- package/Tests/App/Dashboard/GroupingRulePages.test.tsx +218 -9
- package/Tests/App/Dashboard/IncidentCreateStatusPageScope.test.tsx +52 -4
- package/Tests/App/Dashboard/IncidentEpisodeFeedPublicNoteNotifyDefault.test.tsx +230 -338
- package/Tests/App/Dashboard/IncidentEpisodeViewFields.test.tsx +45 -9
- package/Tests/App/Dashboard/IncidentFeedPublicNoteNotifyDefault.test.tsx +227 -295
- package/Tests/App/Dashboard/IncidentLinkedAlertsSettingsPage.test.tsx +157 -181
- package/Tests/App/Dashboard/IncidentPostmortemPage.test.tsx +775 -0
- package/Tests/App/Dashboard/IncidentRoleFormField.test.tsx +379 -15
- package/Tests/App/Dashboard/IncidentRolesSettingsPage.test.tsx +148 -32
- package/Tests/App/Dashboard/IncidentTemplateInitialState.test.tsx +430 -0
- package/Tests/App/Dashboard/IncidentTemplateMonitorsApart.test.tsx +492 -0
- package/Tests/App/Dashboard/IncomingCallEscalationOneStep.test.tsx +830 -0
- package/Tests/App/Dashboard/IncomingCallEscalationRuleForm.test.ts +510 -0
- package/Tests/App/Dashboard/IncomingCallEscalationRuleFormGuard.test.ts +378 -0
- package/Tests/App/Dashboard/IngestionKeyForm.test.ts +664 -0
- package/Tests/App/Dashboard/IngestionKeySelectorCreate.test.tsx +523 -0
- package/Tests/App/Dashboard/InventoryTypeAndStatusFacets.test.tsx +130 -9
- package/Tests/App/Dashboard/IpAllowlistCopy.test.ts +122 -0
- package/Tests/App/Dashboard/KubernetesClusterAiPage.test.tsx +19 -3
- package/Tests/App/Dashboard/KubernetesMetricsSetupEmptyState.test.tsx +275 -0
- package/Tests/App/Dashboard/KubernetesMetricsSetupHints.test.tsx +720 -0
- package/Tests/App/Dashboard/LabelsFormField.test.tsx +18 -13
- package/Tests/App/Dashboard/LegacyDefaultAssigneeNote.test.tsx +359 -0
- package/Tests/App/Dashboard/LogMonitorAttributeOperatorPreview.test.tsx +10 -10
- package/Tests/App/Dashboard/MarkdownTemplateDialogsWide.test.tsx +42 -20
- package/Tests/App/Dashboard/MeasurementForms.test.tsx +191 -5
- package/Tests/App/Dashboard/MeasurementPagesI18n.test.ts +2 -0
- package/Tests/App/Dashboard/MeasurementSetup.test.ts +5 -2
- package/Tests/App/Dashboard/MenuSpecificFoldedSections.test.tsx +38 -12
- package/Tests/App/Dashboard/MessageQueueRulePages.test.tsx +34 -11
- package/Tests/App/Dashboard/MetricAndRecordingRuleFormsRender.test.tsx +1206 -0
- package/Tests/App/Dashboard/MetricResultsState.test.ts +248 -0
- package/Tests/App/Dashboard/MetricViewResultsState.test.tsx +404 -0
- package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +1 -1
- package/Tests/App/Dashboard/MonitorCriteriaAdvancedOptions.test.tsx +77 -27
- package/Tests/App/Dashboard/MonitorCriteriaAttributeFilter.test.tsx +5 -8
- package/Tests/App/Dashboard/MonitorCriteriaHeaderControls.test.tsx +228 -0
- package/Tests/App/Dashboard/MonitorCriteriaIncidentRoles.test.tsx +411 -0
- package/Tests/App/Dashboard/MonitorFeedRefresh.test.tsx +5 -1
- package/Tests/App/Dashboard/MonitorFormIncidentRoles.test.tsx +460 -0
- package/Tests/App/Dashboard/MonitorIntervalRedirect.test.tsx +299 -0
- package/Tests/App/Dashboard/MonitorOverviewHero.test.tsx +243 -2
- package/Tests/App/Dashboard/MonitorProbesAndIntervalPage.test.tsx +638 -0
- package/Tests/App/Dashboard/MonitorStepsDefaultStatusAdvanced.test.tsx +2 -2
- package/Tests/App/Dashboard/MonitorSummaryTestMonitorButton.test.tsx +2 -2
- package/Tests/App/Dashboard/MonitoringIntervalCard.test.tsx +493 -0
- package/Tests/App/Dashboard/MonitoringSwitch.test.tsx +597 -0
- package/Tests/App/Dashboard/MovedRunnerSettingsRedirects.test.tsx +4 -5
- package/Tests/App/Dashboard/NotificationChannelOffSwitchLists.test.tsx +636 -0
- package/Tests/App/Dashboard/OnCallPolicyCreateFormGuard.test.ts +8 -4
- package/Tests/App/Dashboard/OnCallPolicyFirstResponders.test.tsx +1 -1
- package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +54 -0
- package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +43 -24
- package/Tests/App/Dashboard/OnCallRulesRedirects.test.tsx +530 -0
- package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +158 -74
- package/Tests/App/Dashboard/OnCallRulesTabs.test.tsx +511 -0
- package/Tests/App/Dashboard/OnCallScheduleAddLayerDefaults.test.tsx +236 -0
- package/Tests/App/Dashboard/OnCallScheduleCreateFormGuard.test.ts +633 -0
- package/Tests/App/Dashboard/OnCallScheduleOverrideClarity.test.tsx +13 -2
- package/Tests/App/Dashboard/OnCallScheduleWhoTakesTurns.test.tsx +771 -0
- package/Tests/App/Dashboard/OnCallSharedCalendarFeedSettingsForm.test.tsx +357 -0
- package/Tests/App/Dashboard/OnCallShiftRemindersAndUpcomingShifts.test.tsx +16 -6
- package/Tests/App/Dashboard/OnboardingSsoEmptyState.test.tsx +112 -23
- package/Tests/App/Dashboard/PageSearchIndexCoversMenus.test.tsx +594 -0
- package/Tests/App/Dashboard/PageSearchIndexCoversRoutes.test.tsx +271 -0
- package/Tests/App/Dashboard/PageSearchRanking.test.tsx +373 -0
- package/Tests/App/Dashboard/PostmortemPageParts.test.tsx +548 -0
- package/Tests/App/Dashboard/ProbeAgreementCard.test.tsx +483 -0
- package/Tests/App/Dashboard/ProductOrientation.test.tsx +9 -2
- package/Tests/App/Dashboard/ProjectAISettingsPages.test.tsx +282 -404
- package/Tests/App/Dashboard/ProjectAiSettingsSwitchPages.test.tsx +1414 -0
- package/Tests/App/Dashboard/ProjectNotificationChannels.test.tsx +1191 -0
- package/Tests/App/Dashboard/ProjectSettingsSwitchCards.test.tsx +603 -0
- package/Tests/App/Dashboard/RemindersCard.test.tsx +477 -0
- package/Tests/App/Dashboard/ResourceDetailsCard.test.tsx +458 -0
- package/Tests/App/Dashboard/ResourceRuleForm.test.ts +525 -0
- package/Tests/App/Dashboard/ResourceRuleFormsRender.test.tsx +803 -0
- package/Tests/App/Dashboard/RoleAccess.test.ts +753 -0
- package/Tests/App/Dashboard/RoleCardSelectOptions.test.ts +13 -6
- package/Tests/App/Dashboard/RouteUtilPageRoute.test.ts +116 -0
- package/Tests/App/Dashboard/RowActionPlacementOverrides.test.tsx +1 -1
- package/Tests/App/Dashboard/RumSessionReplayRetentionSettings.test.tsx +172 -219
- package/Tests/App/Dashboard/RunbookStepHeaderControls.test.tsx +269 -0
- package/Tests/App/Dashboard/RunnerKubernetesAgentForm.test.tsx +45 -85
- package/Tests/App/Dashboard/RunnerSupersededByAiAgentNote.test.tsx +16 -23
- package/Tests/App/Dashboard/ScheduledMaintenanceAffectedResourcesEditForm.test.tsx +485 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceChangeStateNotifyDefault.test.tsx +27 -2
- package/Tests/App/Dashboard/ScheduledMaintenanceCreateForm.test.tsx +65 -28
- package/Tests/App/Dashboard/ScheduledMaintenanceFeedPublicNoteNotifyDefault.test.tsx +208 -309
- package/Tests/App/Dashboard/ScheduledMaintenanceFeedRefresh.test.tsx +36 -53
- package/Tests/App/Dashboard/ScheduledMaintenanceFormsStructure.test.ts +83 -14
- package/Tests/App/Dashboard/ScheduledMaintenanceMonitorsApart.test.tsx +1085 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +378 -25
- package/Tests/App/Dashboard/ScheduledMaintenanceStatusPageSuggestions.test.tsx +513 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceTemplateForm.test.tsx +31 -9
- package/Tests/App/Dashboard/ScheduledMaintenanceTemplateMonitorsApart.test.tsx +760 -0
- package/Tests/App/Dashboard/SecurityEventConnectionFormModal.test.tsx +11 -13
- package/Tests/App/Dashboard/SecurityEventsMonitorStepForm.test.tsx +228 -69
- package/Tests/App/Dashboard/SelectedProjectSwitches.test.tsx +359 -0
- package/Tests/App/Dashboard/ServerlessSetupGuide.test.ts +1 -1
- package/Tests/App/Dashboard/SessionReplayAllowedCard.test.tsx +297 -0
- package/Tests/App/Dashboard/SetupGuideCard.test.tsx +7 -1
- package/Tests/App/Dashboard/ShortFormsOnePage.test.tsx +591 -0
- package/Tests/App/Dashboard/SloNoticeBanner.test.tsx +253 -6
- package/Tests/App/Dashboard/SloOverviewData.test.tsx +99 -0
- package/Tests/App/Dashboard/SloOverviewLayout.test.tsx +3 -1
- package/Tests/App/Dashboard/SloSettings.test.tsx +257 -4
- package/Tests/App/Dashboard/SsoPages.test.tsx +448 -52
- package/Tests/App/Dashboard/StateChangeDialogsFolded.test.tsx +695 -0
- package/Tests/App/Dashboard/StateChangeFormFields.test.ts +376 -0
- package/Tests/App/Dashboard/StatusPageAccessCard.test.tsx +1088 -0
- package/Tests/App/Dashboard/StatusPageAccessCopy.test.ts +450 -0
- package/Tests/App/Dashboard/StatusPageAccessMenu.test.tsx +137 -0
- package/Tests/App/Dashboard/StatusPageAccessPage.test.tsx +458 -0
- package/Tests/App/Dashboard/StatusPageAdvancedSettingsPage.test.tsx +30 -86
- package/Tests/App/Dashboard/StatusPageBrandingPage.test.tsx +28 -15
- package/Tests/App/Dashboard/StatusPageDisplaySettingsCard.test.tsx +949 -14
- package/Tests/App/Dashboard/StatusPagePrivateUsersNotice.test.tsx +233 -0
- package/Tests/App/Dashboard/StatusPageReportsCard.test.tsx +1001 -0
- package/Tests/App/Dashboard/StatusPageRequireSsoCard.test.tsx +247 -0
- package/Tests/App/Dashboard/StatusPageSubscriberSettingsPages.test.tsx +4 -17
- package/Tests/App/Dashboard/StatusPageSuggestions.test.tsx +930 -0
- package/Tests/App/Dashboard/StatusPageSwitchCardPages.test.tsx +335 -0
- package/Tests/App/Dashboard/TeamBlockPermissionsRedirect.test.tsx +332 -0
- package/Tests/App/Dashboard/TeamCreateForm.test.ts +206 -0
- package/Tests/App/Dashboard/TeamViewPermissions.test.tsx +713 -0
- package/Tests/App/Dashboard/TeamViewSideMenuBlockPermissions.test.tsx +113 -0
- package/Tests/App/Dashboard/TeamsCreateAccess.test.tsx +799 -0
- package/Tests/App/Dashboard/TelemetryDataRuleForms.test.ts +655 -0
- package/Tests/App/Dashboard/TelemetryDataRuleFormsRender.test.tsx +1014 -0
- package/Tests/App/Dashboard/TelemetryIngestionKeyEdit.test.tsx +6 -3
- package/Tests/App/Dashboard/TelemetryIngestionKeyForm.test.tsx +446 -446
- package/Tests/App/Dashboard/TelemetryMonitorFiltersFold.test.tsx +613 -0
- package/Tests/App/Dashboard/TelemetryRetentionShells.test.tsx +37 -2
- package/Tests/App/Dashboard/TemplateFormsNoInternalDataWarning.test.tsx +3 -3
- package/Tests/App/Dashboard/TraceExplorer.test.tsx +338 -0
- package/Tests/App/Dashboard/TwilioConfigFirstDefault.test.tsx +786 -0
- package/Tests/App/Dashboard/UpcomingShiftGetCover.test.tsx +306 -0
- package/Tests/App/Dashboard/UseBulkShortenDeviceNames.test.tsx +36 -11
- package/Tests/App/Dashboard/UserOverrideForm.test.ts +505 -0
- package/Tests/App/Dashboard/UserOverrideFormGuard.test.ts +334 -0
- package/Tests/App/Dashboard/UserOverrideWhoIsAway.test.tsx +999 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +33 -11
- package/Tests/App/Dashboard/UserSettingsSetupChecklistPage.test.tsx +49 -4
- package/Tests/App/Dashboard/UsersPageEmptyState.test.tsx +245 -0
- package/Tests/App/Dashboard/WorkflowVariableOAuthSettingsEditSteps.test.tsx +13 -6
- package/Tests/App/Dashboard/WorkspaceMenusConnected.test.tsx +0 -2
- package/Tests/App/StatusPage/BulkAddStatusPageMonitorsModal.test.tsx +108 -86
- package/Tests/App/StatusPage/StatusPageResourceExplorer.test.tsx +397 -0
- package/Tests/App/StatusPage/StatusPageResourceForm.test.tsx +931 -0
- package/Tests/App/StatusPage/StatusPageSubscribeOnePage.test.tsx +686 -0
- package/Tests/DialogActionRules.ts +16 -5
- package/Tests/Helpers/CardHeaderScan.ts +258 -0
- package/Tests/Helpers/FormStepsScan.ts +576 -11
- package/Tests/Helpers/MonitorGroupStatusPageRows.ts +237 -0
- package/Tests/Helpers/NestedControls.ts +184 -0
- package/Tests/Helpers/NestedControlsScan.ts +414 -0
- package/Tests/Helpers/SteppedFooterScan.ts +722 -0
- package/Tests/Models/DatabaseModels/FormModel.test.ts +31 -7
- package/Tests/Models/DatabaseModels/UserOverrideColumnDescriptions.test.ts +123 -0
- package/Tests/Models/TelemetryDataRuleColumnDefaults.test.ts +239 -0
- package/Tests/ResponsiveFlexLayout.test.ts +111 -0
- package/Tests/ResponsiveFlexLayout.ts +165 -0
- package/Tests/Server/API/DashboardDomainOrderSslAPI.test.ts +372 -0
- package/Tests/Server/API/DashboardDomainVerifyCnameAPI.test.ts +921 -0
- package/Tests/Server/API/DashboardSharingPublicRoutes.test.ts +559 -0
- package/Tests/Server/API/FormBrandingPublicRoutes.test.ts +680 -0
- package/Tests/Server/API/ProjectAPICreateWithTenantHeader.test.ts +300 -0
- package/Tests/Server/API/ProjectCreateTestHelpers.ts +211 -0
- package/Tests/Server/API/ProjectCreateWithTenantHeaderPostgres.test.ts +387 -0
- package/Tests/Server/API/PublicRouteInvalidAccessToken.test.ts +29 -12
- package/Tests/Server/API/StatusPageDomainVerifyCnameAPI.test.ts +1090 -0
- package/Tests/Server/API/StatusPageMasterPageAccess.test.ts +254 -0
- package/Tests/Server/API/StatusPageReportScheduleWrites.test.ts +829 -0
- package/Tests/Server/API/StatusPageUptimeSettingsWrites.test.ts +417 -0
- package/Tests/Server/API/StatusPagesListingMonitorsAPI.test.ts +1029 -0
- package/Tests/Server/API/StatusPagesListingMonitorsRoute.test.ts +286 -0
- package/Tests/Server/Infrastructure/GlobalCache.test.ts +156 -0
- package/Tests/Server/Infrastructure/Postgres/MigrateIncidentFormsToFormsMigration.test.ts +52 -1
- package/Tests/Server/Services/CustomDomainCertificateLifecycle.test.ts +1559 -0
- package/Tests/Server/Services/CustomDomainCertificateReissue.test.ts +186 -16
- package/Tests/Server/Services/DashboardAccessChoice.test.ts +657 -0
- package/Tests/Server/Services/DashboardCreateFromTemplate.test.ts +200 -0
- package/Tests/Server/Services/DashboardDomainCertificateSweeps.test.ts +1142 -0
- package/Tests/Server/Services/DiscoveredResourceCreate.test.ts +864 -0
- package/Tests/Server/Services/DiscoveredResourceUpdate.test.ts +822 -0
- package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +3 -4
- package/Tests/Server/Services/FileServiceProject.test.ts +345 -0
- package/Tests/Server/Services/FormBranding.test.ts +982 -0
- package/Tests/Server/Services/FormPublicForm.test.ts +15 -0
- package/Tests/Server/Services/GroupingRuleEpisodeOwners.test.ts +857 -0
- package/Tests/Server/Services/IncidentFormPostgres.test.ts +297 -1
- package/Tests/Server/Services/MachinePickedColors.test.ts +202 -0
- package/Tests/Server/Services/OidcProviderCreateDefaults.test.ts +252 -0
- package/Tests/Server/Services/OnCallDutyPolicyScheduleFirstLayer.test.ts +799 -0
- package/Tests/Server/Services/OnCallDutyPolicyScheduleFirstLayerPlans.test.ts +172 -0
- package/Tests/Server/Services/OnCallDutyPolicyUserOverrideWhoIsAway.test.ts +571 -0
- package/Tests/Server/Services/OnCallSetupReminder.test.ts +35 -13
- package/Tests/Server/Services/OnCallUndeliverablePageRulesLink.test.ts +217 -0
- package/Tests/Server/Services/ProfileAggregationService.test.ts +213 -4
- package/Tests/Server/Services/ProjectCallSMSConfigFirstDefault.test.ts +699 -0
- package/Tests/Server/Services/ProjectCallSMSConfigFirstDefaultBilling.test.ts +247 -0
- package/Tests/Server/Services/SamlProviderCreateDefaults.test.ts +255 -0
- package/Tests/Server/Services/ScheduledMaintenanceSubscriberMonitorGroups.test.ts +333 -0
- package/Tests/Server/Services/ScrubRuleSaveValidation.test.ts +947 -0
- package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +17 -4
- package/Tests/Server/Services/StatusPageAccessChoice.test.ts +548 -0
- package/Tests/Server/Services/StatusPageDomainCertificateSweeps.test.ts +1238 -0
- package/Tests/Server/Services/TeamCreateAccessGrant.test.ts +607 -0
- package/Tests/Server/Services/TwilioConfigSendersGuard.test.ts +249 -0
- package/Tests/Server/Services/VerificationCodesUseProjectTwilioConfig.test.ts +264 -0
- package/Tests/Server/Types/Database/Permissions/FormBrandingColumns.test.ts +270 -0
- package/Tests/Server/Utils/Greenlock/CertificateCleanup.test.ts +526 -0
- package/Tests/Server/Utils/Greenlock/CertificateOrder.test.ts +1062 -0
- package/Tests/Server/Utils/Greenlock/CertificateOrderBudget.test.ts +243 -0
- package/Tests/Server/Utils/Greenlock/CertificateOrderFailures.test.ts +293 -0
- package/Tests/Server/Utils/Greenlock/CertificateOrderLock.test.ts +152 -0
- package/Tests/Server/Utils/Greenlock/CertificateOwnersGuard.test.ts +119 -0
- package/Tests/Server/Utils/Greenlock/CertificateRenewalOwnership.test.ts +1170 -0
- package/Tests/Server/Utils/Greenlock/CertificateRenewalSafety.test.ts +368 -0
- package/Tests/Server/Utils/Greenlock/CertificateRenewalSchedule.test.ts +188 -11
- package/Tests/Server/Utils/Greenlock/CustomDomainOrders.test.ts +723 -0
- package/Tests/Server/Utils/Greenlock/InMemoryRedis.ts +189 -0
- package/Tests/Server/Utils/Greenlock/NginxAcmeCertificatesToDisk.test.ts +242 -0
- package/Tests/Server/Utils/Greenlock/NginxCustomCertificatesToDisk.test.ts +305 -0
- package/Tests/Server/Utils/Greenlock/OrderCertGuards.test.ts +583 -0
- package/Tests/Server/Utils/Greenlock/OrderCertStorage.test.ts +203 -0
- package/Tests/Server/Utils/StatusPage/AffectedStatusPageResources.test.ts +700 -0
- package/Tests/Server/Utils/StatusPage/StatusPagesListingMonitorsBuilder.test.ts +744 -0
- package/Tests/Types/CustomDomain/CustomDomainCertificates.test.ts +106 -0
- package/Tests/Types/CustomDomain/CustomDomainVerification.test.ts +94 -0
- package/Tests/Types/Dashboard/DashboardAccess.test.ts +460 -0
- package/Tests/Types/Filter/FilterConditionUtil.test.ts +59 -0
- package/Tests/Types/Form/FormBranding.test.ts +760 -0
- package/Tests/Types/IncomingCall/IncomingCallRingTime.test.ts +80 -0
- package/Tests/Types/NotificationRule/OnCallRuleKind.test.ts +271 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleFirstLayer.test.ts +300 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleLayerDefaults.test.ts +316 -0
- package/Tests/Types/OnCallDutyPolicy/UserOverrideCoverRequest.test.ts +257 -0
- package/Tests/Types/SSO/OidcProviderDefaults.test.ts +474 -0
- package/Tests/Types/SSO/SamlProviderDefaults.test.ts +150 -0
- package/Tests/Types/SSO/SsoProviderDefaults.test.ts +181 -0
- package/Tests/Types/StatusPage/StatusPageAccess.test.ts +393 -0
- package/Tests/Types/StatusPage/StatusPagesListingMonitors.test.ts +149 -0
- package/Tests/Types/Telemetry/ScrubRule.test.ts +375 -0
- package/Tests/UI/Components/AdvancedPageSection.test.tsx +201 -61
- package/Tests/UI/Components/BasicFormModalSteps.test.tsx +129 -153
- package/Tests/UI/Components/Card.test.tsx +354 -367
- package/Tests/UI/Components/CardHeaderActionsGuard.test.tsx +605 -0
- package/Tests/UI/Components/CardModelDetailHeaderLayout.test.tsx +23 -8
- package/Tests/UI/Components/CardModelDetailOnBeforeUpdate.test.tsx +224 -0
- package/Tests/UI/Components/CardModelDetailPageButtons.test.tsx +231 -0
- package/Tests/UI/Components/ChoiceRows.test.tsx +365 -0
- package/Tests/UI/Components/CommandPalette/CommandPalette.test.tsx +341 -5
- package/Tests/UI/Components/CommandPalette/PaletteFilter.test.ts +655 -64
- package/Tests/UI/Components/Detail/DetailCreatedOnIdLine.test.tsx +669 -0
- package/Tests/UI/Components/Detail/DetailIdLineDarkMode.test.ts +34 -7
- package/Tests/UI/Components/Detail/DetailIdLineInLocale.test.tsx +71 -0
- package/Tests/UI/Components/Detail/DetailRecordIdLine.test.tsx +26 -7
- package/Tests/UI/Components/Detail/DetailRecordLine.test.tsx +326 -0
- package/Tests/UI/Components/Detail/DetailRecordTime.test.ts +324 -0
- package/Tests/UI/Components/DetailCompactStyle.test.tsx +7 -3
- package/Tests/UI/Components/Dropdown/DropdownChange.test.ts +163 -0
- package/Tests/UI/Components/EntityDropdown.test.tsx +103 -1
- package/Tests/UI/Components/EntityDropdownClearButton.test.tsx +638 -0
- package/Tests/UI/Components/EntityDropdownEscape.test.tsx +6 -6
- package/Tests/UI/Components/EntityDropdownFocusLeave.test.tsx +21 -4
- package/Tests/UI/Components/EntityDropdownQuery.test.tsx +411 -0
- package/Tests/UI/Components/EntityDropdownQueryHelpers.test.ts +131 -0
- package/Tests/UI/Components/FilePicker.test.tsx +220 -1
- package/Tests/UI/Components/FoldedSection/FoldedSection.test.tsx +582 -0
- package/Tests/UI/Components/FoldedSection/FoldedSectionDarkMode.test.ts +197 -0
- package/Tests/UI/Components/FoldedSection/FoldedSectionItem.test.ts +247 -0
- package/Tests/UI/Components/FoldedSection/FoldedSectionQueries.ts +86 -0
- package/Tests/UI/Components/Forms/AdvancedStepsGuard.test.ts +358 -32
- package/Tests/UI/Components/Forms/AnchoredFieldPopupPlacement.test.tsx +195 -0
- package/Tests/UI/Components/Forms/BasicFormCollapsibleSections.test.tsx +187 -23
- package/Tests/UI/Components/Forms/BasicFormFillsInOnShow.test.tsx +246 -0
- package/Tests/UI/Components/Forms/BasicFormFooterSetValue.test.tsx +283 -0
- package/Tests/UI/Components/Forms/BasicFormPrimaryActionLastStep.test.tsx +780 -0
- package/Tests/UI/Components/Forms/BasicFormSingleStep.test.tsx +232 -0
- package/Tests/UI/Components/Forms/BasicFormStepValidation.test.tsx +7 -4
- package/Tests/UI/Components/Forms/BasicFormSubmitAllSteps.test.tsx +4 -3
- package/Tests/UI/Components/Forms/CreateFormDefaultsGuard.test.ts +252 -7
- package/Tests/UI/Components/Forms/DeclareAndCreateFormsGuard.test.ts +247 -7
- package/Tests/UI/Components/Forms/DiscoveredResourceCreateFormsGuard.test.ts +492 -0
- package/Tests/UI/Components/Forms/FilterConditionOnlyWithTwoFiltersGuard.test.ts +333 -0
- package/Tests/UI/Components/Forms/FoldedEditorWidthTiming.test.tsx +127 -0
- package/Tests/UI/Components/Forms/FoldedSectionsGuard.test.ts +523 -0
- package/Tests/UI/Components/Forms/FollowPickName.test.ts +88 -0
- package/Tests/UI/Components/Forms/FormFieldDropdownChange.test.tsx +294 -0
- package/Tests/UI/Components/Forms/FormModalWidth.test.tsx +237 -2
- package/Tests/UI/Components/Forms/FormSummary.test.tsx +181 -0
- package/Tests/UI/Components/Forms/IncidentEpisodePublicNoteNotifyPayload.test.tsx +110 -86
- package/Tests/UI/Components/Forms/LabelsFormFieldGuard.test.ts +101 -96
- package/Tests/UI/Components/Forms/LongFormStepsGuard.test.ts +559 -10
- package/Tests/UI/Components/Forms/MarkdownFormsAreWide.test.ts +56 -4
- package/Tests/UI/Components/Forms/MetricAndRecordingRuleFormsGuard.test.ts +400 -0
- package/Tests/UI/Components/Forms/ModelFormColorDefaults.test.tsx +659 -0
- package/Tests/UI/Components/Forms/ModelFormCreateDefaults.test.tsx +108 -4
- package/Tests/UI/Components/Forms/ModelFormDropdownQuery.test.tsx +403 -0
- package/Tests/UI/Components/Forms/ModelFormPreservesUserInput.test.tsx +126 -0
- package/Tests/UI/Components/Forms/ModelFormSinglePickPeoplePicker.test.tsx +453 -0
- package/Tests/UI/Components/Forms/OidcProviderFormsGuard.test.ts +321 -0
- package/Tests/UI/Components/Forms/OneIncidentRolePickerGuard.test.ts +823 -0
- package/Tests/UI/Components/Forms/OneSwitchCardsGuard.test.ts +739 -0
- package/Tests/UI/Components/Forms/OpenFormSections.test.tsx +169 -0
- package/Tests/UI/Components/Forms/OverloadedFormStepsGuard.test.ts +21 -9
- package/Tests/UI/Components/Forms/PrimaryActionLastStepGuard.test.ts +478 -0
- package/Tests/UI/Components/Forms/ProjectTeamFormsGuard.test.ts +240 -0
- package/Tests/UI/Components/Forms/ResourceDetailsOnePlaceGuard.test.ts +936 -0
- package/Tests/UI/Components/Forms/ResourceRuleFormsGuard.test.ts +527 -0
- package/Tests/UI/Components/Forms/SamlProviderFormsGuard.test.ts +387 -0
- package/Tests/UI/Components/Forms/SmallWizardsOnePageGuard.test.ts +331 -0
- package/Tests/UI/Components/Forms/SmtpConfigFormsGuard.test.ts +470 -0
- package/Tests/UI/Components/Forms/StateChangeDialogsFoldTheNote.test.ts +322 -0
- package/Tests/UI/Components/Forms/StatusPageResourceFormsGuard.test.ts +381 -0
- package/Tests/UI/Components/Forms/SteppedFormFooter.test.ts +225 -0
- package/Tests/UI/Components/Forms/SteppedFormFooterTiming.test.tsx +82 -40
- package/Tests/UI/Components/Forms/SwitchCardsGuard.test.ts +339 -0
- package/Tests/UI/Components/Forms/TelemetryDataRuleFormsGuard.test.ts +383 -0
- package/Tests/UI/Components/Forms/UniqueName.test.ts +163 -0
- package/Tests/UI/Components/Forms/Utils/AdvancedFormSection.test.ts +131 -11
- package/Tests/UI/Components/Forms/Utils/CreateFormColorDefaults.test.ts +373 -0
- package/Tests/UI/Components/Forms/Utils/FoldedFormFields.test.ts +482 -0
- package/Tests/UI/Components/LabelRuleImportExport.test.tsx +32 -0
- package/Tests/UI/Components/MemberRoleAssignment.test.tsx +51 -7
- package/Tests/UI/Components/ModalSecondaryButton.test.tsx +60 -3
- package/Tests/UI/Components/ModelFormDraftValues.test.tsx +255 -0
- package/Tests/UI/Components/ModelPageHeaderChanged.test.tsx +293 -0
- package/Tests/UI/Components/ModelSwitchCard.test.tsx +813 -0
- package/Tests/UI/Components/ModelSwitchEvents.test.ts +188 -0
- package/Tests/UI/Components/ModelSwitchRow.test.tsx +861 -0
- package/Tests/UI/Components/ModelSwitchUtil.test.ts +239 -0
- package/Tests/UI/Components/ModelSwitchesCard.test.tsx +699 -0
- package/Tests/UI/Components/NavBar.test.tsx +41 -2
- package/Tests/UI/Components/NavBarCategoryToggleDarkMode.test.ts +12 -0
- package/Tests/UI/Components/NavBarMenuCatalog.test.tsx +197 -30
- package/Tests/UI/Components/NavBarMenuFolding.test.tsx +221 -39
- package/Tests/UI/Components/NavBarMenuSearch.test.tsx +15 -10
- package/Tests/UI/Components/NestedControlsGuard.test.ts +300 -0
- package/Tests/UI/Components/PageBreadcrumbOverride.test.tsx +202 -0
- package/Tests/UI/Components/PeoplePicker/OwnersFieldGuard.test.ts +269 -5
- package/Tests/UI/Components/PeoplePicker/PeoplePickerChange.test.tsx +414 -0
- package/Tests/UI/Components/PeoplePicker/PeoplePickerExcludePicks.test.tsx +582 -0
- package/Tests/UI/Components/PeoplePicker/PeoplePickerSinglePick.test.tsx +519 -0
- package/Tests/UI/Components/PeoplePicker/PeoplePickerSinglePickTypes.test.ts +174 -0
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +8 -3
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaNamesGuard.test.ts +14 -6
- package/Tests/UI/Components/RuleRun/RuleViewDescription.test.tsx +107 -0
- package/Tests/UI/Components/SaveStatus.test.tsx +81 -0
- package/Tests/UI/Components/SmtpConfig/SmtpConfigFormFields.test.ts +1078 -0
- package/Tests/UI/Components/Sso/OidcProviderForm.test.tsx +608 -0
- package/Tests/UI/Components/Sso/OidcProviderFormFields.test.ts +698 -0
- package/Tests/UI/Components/Sso/SamlProviderForm.test.tsx +583 -0
- package/Tests/UI/Components/Sso/SamlProviderFormFields.test.ts +619 -0
- package/Tests/UI/Components/SteppedEditFormSave.test.tsx +199 -141
- package/Tests/UI/Components/Table/TableEmptyStateComponent.test.tsx +143 -0
- package/Tests/UI/Components/UseSaveModelSwitch.test.tsx +409 -0
- package/Tests/UI/Components/Workflow/ArgumentsForm.test.tsx +3 -3
- package/Tests/UI/Components/Workflow/ArgumentsFormAdvancedSettings.test.tsx +83 -27
- package/Tests/UI/Components/Workflow/WorkflowLogModal.test.tsx +7 -2
- package/Tests/UI/Components/useSaveOnChange.test.tsx +341 -0
- package/Tests/UI/Monitor/MonitorStepRetrySettings.test.tsx +1 -1
- package/Tests/UI/Rum/ReplayTimeline.test.tsx +75 -5
- package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +97 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +12 -39
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +1 -6
- package/Tests/{App/Dashboard → UI/Utils}/DefaultInviteTeam.test.ts +126 -4
- package/Tests/UI/Utils/GrantablePermission.test.ts +172 -0
- package/Tests/UI/Utils/PermissionGateColumnUpdate.test.ts +211 -0
- package/Tests/UI/Utils/TranslateTemplate.test.ts +31 -0
- package/Tests/Utils/DistinctColor.test.ts +446 -0
- package/Tests/Utils/Monitor/MonitorOverviewPresentationUtil.test.ts +14 -2
- package/Tests/Utils/Monitor/MonitoringIntervalUtil.test.ts +1 -1
- package/Tests/Utils/NetworkDiscovery/ShortHostnameUtil.test.ts +2 -2
- package/Tests/Utils/Slo/SloHealth.test.ts +28 -6
- package/Tests/Utils/StatusPage/ReportSchedule.test.ts +867 -0
- package/Tests/Utils/Telemetry/DiscoveredResourceName.test.ts +189 -0
- package/Tests/Utils/WordMatch.test.ts +104 -0
- package/Types/BrandColors.ts +10 -0
- package/Types/CustomDomain/CustomDomainCertificates.ts +128 -0
- package/Types/CustomDomain/CustomDomainVerification.ts +78 -0
- package/Types/Dashboard/DashboardAccess.ts +250 -0
- package/Types/Dashboard/DashboardTemplates.ts +33 -0
- package/Types/Filter/FilterConditionUtil.ts +29 -0
- package/Types/Form/FormBranding.ts +475 -0
- package/Types/Form/FormPublic.ts +26 -0
- package/Types/IncomingCall/IncomingCallRingTime.ts +48 -0
- package/Types/Log/LogScrubField.ts +14 -0
- package/Types/Monitor/SeriesContext/SeriesLabelDisplay.ts +1 -1
- package/Types/NotificationRule/OnCallRuleKind.ts +194 -0
- package/Types/OnCallDutyPolicy/FirstResponders.ts +3 -32
- package/Types/OnCallDutyPolicy/MiscDataId.ts +38 -0
- package/Types/OnCallDutyPolicy/ScheduleFirstLayer.ts +165 -0
- package/Types/OnCallDutyPolicy/ScheduleLayerDefaults.ts +160 -0
- package/Types/OnCallDutyPolicy/UserOverrideCoverRequest.ts +148 -0
- package/Types/SSO/OidcProviderDefaults.ts +282 -0
- package/Types/SSO/SamlProviderDefaults.ts +77 -0
- package/Types/SSO/SsoProviderDefaults.ts +101 -0
- package/Types/StatusPage/StatusPageAccess.ts +215 -0
- package/Types/StatusPage/StatusPagesListingMonitors.ts +150 -0
- package/Types/Telemetry/ScrubRule.ts +240 -0
- package/UI/Components/AdvancedPageSection/AdvancedPageSection.tsx +59 -29
- package/UI/Components/Card/Card.tsx +139 -80
- package/UI/Components/ChoiceRows/ChoiceRows.tsx +249 -0
- package/UI/Components/CommandPalette/CommandPalette.tsx +28 -12
- package/UI/Components/CommandPalette/PaletteFilter.ts +962 -75
- package/UI/Components/CommandPalette/PaletteRow.tsx +35 -3
- package/UI/Components/CommandPalette/Types.ts +37 -1
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +6 -0
- package/UI/Components/Detail/Detail.tsx +52 -15
- package/UI/Components/Detail/DetailRecordLine.tsx +96 -0
- package/UI/Components/Detail/DetailRecordTime.ts +196 -0
- package/UI/Components/Dropdown/DropdownChange.ts +198 -0
- package/UI/Components/EntityDropdown/EntityDropdown.tsx +270 -106
- package/UI/Components/EntityDropdown/EntityDropdownQuery.ts +119 -0
- package/UI/Components/FilePicker/FilePicker.tsx +90 -6
- package/UI/Components/FoldedSection/FoldedSection.tsx +370 -0
- package/UI/Components/FoldedSection/FoldedSectionItem.ts +141 -0
- package/UI/Components/FoldedSection/FoldedSectionTitles.ts +39 -0
- package/UI/Components/FormModal/BasicFormModal.tsx +40 -67
- package/UI/Components/Forms/BasicForm.tsx +218 -119
- package/UI/Components/Forms/BasicModelForm.tsx +0 -2
- package/UI/Components/Forms/CollapsibleFormSection.tsx +108 -18
- package/UI/Components/Forms/Fields/FormField.tsx +62 -15
- package/UI/Components/Forms/Fields/GeneratedKeyField.tsx +1 -5
- package/UI/Components/Forms/FormSummary.tsx +5 -3
- package/UI/Components/Forms/ModelForm.tsx +123 -16
- package/UI/Components/Forms/Types/Field.ts +98 -16
- package/UI/Components/Forms/Utils/AdvancedFormSection.ts +102 -31
- package/UI/Components/Forms/Utils/CreateFormDefaults.ts +158 -17
- package/UI/Components/Forms/Utils/FoldedFormFields.ts +393 -0
- package/UI/Components/Forms/Utils/FollowPickName.ts +52 -0
- package/UI/Components/Forms/Utils/FormModalWidth.ts +35 -4
- package/UI/Components/Forms/Utils/OpenFormSections.ts +104 -0
- package/UI/Components/Forms/Utils/SteppedFormFooter.ts +151 -0
- package/UI/Components/Forms/Utils/UniqueName.ts +81 -0
- package/UI/Components/LabelRule/ImportLabelRulesModal.tsx +22 -3
- package/UI/Components/MemberRoleAssignment/MemberRoleAssignment.tsx +6 -5
- package/UI/Components/Modal/ModalFooter.tsx +10 -1
- package/UI/Components/ModelDetail/CardModelDetail.tsx +33 -8
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +44 -58
- package/UI/Components/ModelSwitch/ModelSwitchCard.tsx +305 -0
- package/UI/Components/ModelSwitch/ModelSwitchEvents.ts +109 -0
- package/UI/Components/ModelSwitch/ModelSwitchRow.tsx +438 -0
- package/UI/Components/ModelSwitch/ModelSwitchUtil.ts +120 -0
- package/UI/Components/ModelSwitch/ModelSwitchesCard.tsx +265 -0
- package/UI/Components/ModelSwitch/useSaveModelSwitch.ts +144 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +6 -0
- package/UI/Components/ModelTable/ModelTable.tsx +5 -0
- package/UI/Components/Navbar/NavBar.tsx +10 -9
- package/UI/Components/Navbar/NavBarMenuCatalog.ts +57 -22
- package/UI/Components/Navbar/NavBarMenuModal.tsx +17 -13
- package/UI/Components/Navbar/NavBarMobileMenu.tsx +40 -23
- package/UI/Components/Page/ModelHeaderEvents.ts +75 -0
- package/UI/Components/Page/ModelPage.tsx +21 -1
- package/UI/Components/Page/Page.tsx +68 -13
- package/UI/Components/PeoplePicker/PeoplePicker.tsx +150 -45
- package/UI/Components/PeoplePicker/PeoplePickerTypes.ts +193 -4
- package/UI/Components/PeoplePicker/PeopleSearchPopup.tsx +37 -10
- package/UI/Components/PublicForm/PublicFormFavicon.ts +99 -0
- package/UI/Components/PublicForm/PublicFormLogo.tsx +81 -0
- package/UI/Components/RuleCriteria/RuleCriteriaBuilder.tsx +5 -3
- package/UI/Components/RuleRun/RuleView.tsx +2 -5
- package/UI/Components/SaveStatus/SaveStatus.tsx +76 -0
- package/UI/Components/SaveStatus/useSaveOnChange.ts +178 -0
- package/UI/Components/SmtpConfig/SmtpConfigFormFields.ts +815 -0
- package/UI/Components/Sso/OidcProviderFormFields.ts +481 -0
- package/UI/Components/Sso/SamlProviderFormFields.ts +322 -0
- package/UI/Components/Sso/SsoProviderFormFields.ts +331 -0
- package/UI/Components/Table/TableEmptyState.tsx +39 -5
- package/UI/Components/Workflow/ArgumentsForm.tsx +21 -78
- package/UI/Components/Workflow/ComponentPicker/ComponentSearch.ts +18 -145
- package/UI/Components/Workflow/WorkflowLogModal.tsx +1 -3
- package/UI/Types/UseAnchoredFieldPopup.ts +46 -4
- package/UI/Utils/DefaultInviteTeam.ts +306 -0
- package/UI/Utils/GrantablePermission.ts +46 -0
- package/UI/Utils/PermissionGate.ts +80 -7
- package/UI/Utils/TranslateTemplate.ts +22 -0
- package/Utils/DistinctColor.ts +223 -0
- package/Utils/Monitor/MonitorOverviewPresentationUtil.ts +47 -2
- package/Utils/Slo/SloHealth.ts +9 -3
- package/Utils/StatusPage/ReportSchedule.ts +462 -0
- package/Utils/Telemetry/DiscoveredResourceName.ts +95 -0
- package/Utils/WordMatch.ts +185 -0
- package/build/dist/Models/DatabaseModels/AlertGroupingRule.js +6 -6
- package/build/dist/Models/DatabaseModels/AlertGroupingRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/File.js +47 -1
- package/build/dist/Models/DatabaseModels/File.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Form.js +125 -0
- package/build/dist/Models/DatabaseModels/Form.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentGroupingRule.js +6 -6
- package/build/dist/Models/DatabaseModels/IncidentGroupingRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +1 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogPipeline.js +1 -0
- package/build/dist/Models/DatabaseModels/LogPipeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogScrubRule.js +14 -8
- package/build/dist/Models/DatabaseModels/LogScrubRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricRecordingRule.js +1 -1
- package/build/dist/Models/DatabaseModels/MetricRecordingRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +2 -2
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +20 -9
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectCallSMSConfig.js +6 -1
- package/build/dist/Models/DatabaseModels/ProjectCallSMSConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +4 -4
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js +1 -0
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TracePipeline.js +1 -0
- package/build/dist/Models/DatabaseModels/TracePipeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceRecordingRule.js +1 -1
- package/build/dist/Models/DatabaseModels/TraceRecordingRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceScrubRule.js +14 -8
- package/build/dist/Models/DatabaseModels/TraceScrubRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js +2 -2
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js.map +1 -1
- package/build/dist/Server/API/CustomDomainRoutes.js +124 -0
- package/build/dist/Server/API/CustomDomainRoutes.js.map +1 -0
- package/build/dist/Server/API/DashboardAPI.js +22 -4
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardDomainAPI.js +56 -49
- package/build/dist/Server/API/DashboardDomainAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +101 -39
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageDomainAPI.js +52 -51
- package/build/dist/Server/API/StatusPageDomainAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/GlobalCache.js +63 -0
- package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1797700000000-AddFormBranding.js +36 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1797700000000-AddFormBranding.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertGroupingEngineService.js +44 -61
- package/build/dist/Server/Services/AlertGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/AlertGroupingRuleService.js +45 -0
- package/build/dist/Server/Services/AlertGroupingRuleService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterService.js +23 -0
- package/build/dist/Server/Services/CephClusterService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceService.js +39 -0
- package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
- package/build/dist/Server/Services/DashboardDomainService.js +510 -172
- package/build/dist/Server/Services/DashboardDomainService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +22 -9
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +114 -10
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostService.js +51 -0
- package/build/dist/Server/Services/DockerHostService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterService.js +23 -0
- package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
- package/build/dist/Server/Services/FileService.js +45 -0
- package/build/dist/Server/Services/FileService.js.map +1 -1
- package/build/dist/Server/Services/FormService.js +158 -14
- package/build/dist/Server/Services/FormService.js.map +1 -1
- package/build/dist/Server/Services/GlobalOidcService.js +9 -0
- package/build/dist/Server/Services/GlobalOidcService.js.map +1 -1
- package/build/dist/Server/Services/GlobalSsoService.js +9 -0
- package/build/dist/Server/Services/GlobalSsoService.js.map +1 -1
- package/build/dist/Server/Services/HostService.js +50 -0
- package/build/dist/Server/Services/HostService.js.map +1 -1
- package/build/dist/Server/Services/IncidentGroupingEngineService.js +45 -62
- package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentGroupingRuleService.js +45 -0
- package/build/dist/Server/Services/IncidentGroupingRuleService.js.map +1 -1
- package/build/dist/Server/Services/IoTFleetService.js +23 -0
- package/build/dist/Server/Services/IoTFleetService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +54 -0
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/LabelService.js +6 -16
- package/build/dist/Server/Services/LabelService.js.map +1 -1
- package/build/dist/Server/Services/LogScrubRuleService.js +31 -0
- package/build/dist/Server/Services/LogScrubRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +202 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +7 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js +17 -24
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js.map +1 -1
- package/build/dist/Server/Services/OnCallSetupReminderService.js +32 -38
- package/build/dist/Server/Services/OnCallSetupReminderService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostService.js +51 -0
- package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
- package/build/dist/Server/Services/ProfileAggregationService.js +34 -0
- package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -1
- package/build/dist/Server/Services/ProjectCallSMSConfigService.js +53 -3
- package/build/dist/Server/Services/ProjectCallSMSConfigService.js.map +1 -1
- package/build/dist/Server/Services/ProjectOidcService.js +28 -0
- package/build/dist/Server/Services/ProjectOidcService.js.map +1 -1
- package/build/dist/Server/Services/ProjectSsoService.js +28 -0
- package/build/dist/Server/Services/ProjectSsoService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterService.js +23 -0
- package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
- package/build/dist/Server/Services/RumApplicationService.js +42 -0
- package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +18 -26
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ServerlessFunctionService.js +44 -0
- package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
- package/build/dist/Server/Services/ServiceService.js +30 -4
- package/build/dist/Server/Services/ServiceService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageDomainService.js +495 -174
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageOidcService.js +28 -0
- package/build/dist/Server/Services/StatusPageOidcService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageResourceService.js +82 -46
- package/build/dist/Server/Services/StatusPageResourceService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +174 -45
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSsoService.js +28 -0
- package/build/dist/Server/Services/StatusPageSsoService.js.map +1 -1
- package/build/dist/Server/Services/TraceScrubRuleService.js +31 -0
- package/build/dist/Server/Services/TraceScrubRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserIncomingCallNumberService.js +20 -10
- package/build/dist/Server/Services/UserIncomingCallNumberService.js.map +1 -1
- package/build/dist/Server/Services/VMwareVCenterService.js +23 -0
- package/build/dist/Server/Services/VMwareVCenterService.js.map +1 -1
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js +3 -3
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js.map +1 -1
- package/build/dist/Server/Utils/Greenlock/CertificateOrder.js +353 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrder.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderBudget.js +119 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderBudget.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderFailures.js +208 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderFailures.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderLock.js +111 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderLock.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderOutcome.js +30 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOrderOutcome.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOwners.js +52 -0
- package/build/dist/Server/Utils/Greenlock/CertificateOwners.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CertificateReissueOrder.js +80 -0
- package/build/dist/Server/Utils/Greenlock/CertificateReissueOrder.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/CustomDomainOrders.js +296 -0
- package/build/dist/Server/Utils/Greenlock/CustomDomainOrders.js.map +1 -0
- package/build/dist/Server/Utils/Greenlock/Greenlock.js +595 -146
- package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
- package/build/dist/Server/Utils/Rules/GroupingRuleEpisodeOwners.js +366 -0
- package/build/dist/Server/Utils/Rules/GroupingRuleEpisodeOwners.js.map +1 -0
- package/build/dist/Server/Utils/Rules/OwnerRuleAssignment.js +7 -0
- package/build/dist/Server/Utils/Rules/OwnerRuleAssignment.js.map +1 -1
- package/build/dist/Server/Utils/ScrubRuleValidation.js +127 -0
- package/build/dist/Server/Utils/ScrubRuleValidation.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/AffectedStatusPageResources.js +97 -0
- package/build/dist/Server/Utils/StatusPage/AffectedStatusPageResources.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/StatusPagesListingMonitorsBuilder.js +195 -0
- package/build/dist/Server/Utils/StatusPage/StatusPagesListingMonitorsBuilder.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/DiscoveredResourceCreate.js +177 -0
- package/build/dist/Server/Utils/Telemetry/DiscoveredResourceCreate.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/DiscoveredResourceUpdate.js +129 -0
- package/build/dist/Server/Utils/Telemetry/DiscoveredResourceUpdate.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js +8 -2
- package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js.map +1 -1
- package/build/dist/Types/BrandColors.js +9 -0
- package/build/dist/Types/BrandColors.js.map +1 -1
- package/build/dist/Types/CustomDomain/CustomDomainCertificates.js +71 -0
- package/build/dist/Types/CustomDomain/CustomDomainCertificates.js.map +1 -0
- package/build/dist/Types/CustomDomain/CustomDomainVerification.js +58 -0
- package/build/dist/Types/CustomDomain/CustomDomainVerification.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardAccess.js +157 -0
- package/build/dist/Types/Dashboard/DashboardAccess.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +26 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/Filter/FilterConditionUtil.js +24 -0
- package/build/dist/Types/Filter/FilterConditionUtil.js.map +1 -0
- package/build/dist/Types/Form/FormBranding.js +266 -0
- package/build/dist/Types/Form/FormBranding.js.map +1 -0
- package/build/dist/Types/Form/FormPublic.js +6 -0
- package/build/dist/Types/Form/FormPublic.js.map +1 -1
- package/build/dist/Types/IncomingCall/IncomingCallRingTime.js +37 -0
- package/build/dist/Types/IncomingCall/IncomingCallRingTime.js.map +1 -0
- package/build/dist/Types/Log/LogScrubField.js +15 -0
- package/build/dist/Types/Log/LogScrubField.js.map +1 -0
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +1 -1
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js.map +1 -1
- package/build/dist/Types/NotificationRule/OnCallRuleKind.js +134 -0
- package/build/dist/Types/NotificationRule/OnCallRuleKind.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/FirstResponders.js +2 -23
- package/build/dist/Types/OnCallDutyPolicy/FirstResponders.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/MiscDataId.js +30 -0
- package/build/dist/Types/OnCallDutyPolicy/MiscDataId.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleFirstLayer.js +113 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleFirstLayer.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleLayerDefaults.js +95 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleLayerDefaults.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/UserOverrideCoverRequest.js +99 -0
- package/build/dist/Types/OnCallDutyPolicy/UserOverrideCoverRequest.js.map +1 -0
- package/build/dist/Types/SSO/OidcProviderDefaults.js +189 -0
- package/build/dist/Types/SSO/OidcProviderDefaults.js.map +1 -0
- package/build/dist/Types/SSO/SamlProviderDefaults.js +55 -0
- package/build/dist/Types/SSO/SamlProviderDefaults.js.map +1 -0
- package/build/dist/Types/SSO/SsoProviderDefaults.js +67 -0
- package/build/dist/Types/SSO/SsoProviderDefaults.js.map +1 -0
- package/build/dist/Types/StatusPage/StatusPageAccess.js +132 -0
- package/build/dist/Types/StatusPage/StatusPageAccess.js.map +1 -0
- package/build/dist/Types/StatusPage/StatusPagesListingMonitors.js +84 -0
- package/build/dist/Types/StatusPage/StatusPagesListingMonitors.js.map +1 -0
- package/build/dist/Types/Telemetry/ScrubRule.js +180 -0
- package/build/dist/Types/Telemetry/ScrubRule.js.map +1 -0
- package/build/dist/UI/Components/AdvancedPageSection/AdvancedPageSection.js +9 -7
- package/build/dist/UI/Components/AdvancedPageSection/AdvancedPageSection.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +81 -35
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/ChoiceRows/ChoiceRows.js +54 -0
- package/build/dist/UI/Components/ChoiceRows/ChoiceRows.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js +25 -12
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
- package/build/dist/UI/Components/CommandPalette/PaletteFilter.js +632 -64
- package/build/dist/UI/Components/CommandPalette/PaletteFilter.js.map +1 -1
- package/build/dist/UI/Components/CommandPalette/PaletteRow.js +7 -1
- package/build/dist/UI/Components/CommandPalette/PaletteRow.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +7 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +26 -13
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/Detail/DetailRecordLine.js +32 -0
- package/build/dist/UI/Components/Detail/DetailRecordLine.js.map +1 -0
- package/build/dist/UI/Components/Detail/DetailRecordTime.js +134 -0
- package/build/dist/UI/Components/Detail/DetailRecordTime.js.map +1 -0
- package/build/dist/UI/Components/Dropdown/DropdownChange.js +102 -0
- package/build/dist/UI/Components/Dropdown/DropdownChange.js.map +1 -0
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js +134 -57
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js.map +1 -1
- package/build/dist/UI/Components/EntityDropdown/EntityDropdownQuery.js +78 -0
- package/build/dist/UI/Components/EntityDropdown/EntityDropdownQuery.js.map +1 -0
- package/build/dist/UI/Components/FilePicker/FilePicker.js +55 -6
- package/build/dist/UI/Components/FilePicker/FilePicker.js.map +1 -1
- package/build/dist/UI/Components/FoldedSection/FoldedSection.js +139 -0
- package/build/dist/UI/Components/FoldedSection/FoldedSection.js.map +1 -0
- package/build/dist/UI/Components/FoldedSection/FoldedSectionItem.js +58 -0
- package/build/dist/UI/Components/FoldedSection/FoldedSectionItem.js.map +1 -0
- package/build/dist/UI/Components/FoldedSection/FoldedSectionTitles.js +34 -0
- package/build/dist/UI/Components/FoldedSection/FoldedSectionTitles.js.map +1 -0
- package/build/dist/UI/Components/FormModal/BasicFormModal.js +29 -45
- package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +148 -89
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicModelForm.js +1 -1
- package/build/dist/UI/Components/Forms/BasicModelForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/CollapsibleFormSection.js +49 -10
- package/build/dist/UI/Components/Forms/CollapsibleFormSection.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +25 -11
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/GeneratedKeyField.js +2 -5
- package/build/dist/UI/Components/Forms/Fields/GeneratedKeyField.js.map +1 -1
- package/build/dist/UI/Components/Forms/FormSummary.js +5 -3
- package/build/dist/UI/Components/Forms/FormSummary.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +72 -14
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/Types/Field.js.map +1 -1
- package/build/dist/UI/Components/Forms/Utils/AdvancedFormSection.js +80 -23
- package/build/dist/UI/Components/Forms/Utils/AdvancedFormSection.js.map +1 -1
- package/build/dist/UI/Components/Forms/Utils/CreateFormDefaults.js +91 -9
- package/build/dist/UI/Components/Forms/Utils/CreateFormDefaults.js.map +1 -1
- package/build/dist/UI/Components/Forms/Utils/FoldedFormFields.js +243 -0
- package/build/dist/UI/Components/Forms/Utils/FoldedFormFields.js.map +1 -0
- package/build/dist/UI/Components/Forms/Utils/FollowPickName.js +32 -0
- package/build/dist/UI/Components/Forms/Utils/FollowPickName.js.map +1 -0
- package/build/dist/UI/Components/Forms/Utils/FormModalWidth.js +25 -5
- package/build/dist/UI/Components/Forms/Utils/FormModalWidth.js.map +1 -1
- package/build/dist/UI/Components/Forms/Utils/OpenFormSections.js +32 -0
- package/build/dist/UI/Components/Forms/Utils/OpenFormSections.js.map +1 -0
- package/build/dist/UI/Components/Forms/Utils/SteppedFormFooter.js +71 -0
- package/build/dist/UI/Components/Forms/Utils/SteppedFormFooter.js.map +1 -0
- package/build/dist/UI/Components/Forms/Utils/UniqueName.js +56 -0
- package/build/dist/UI/Components/Forms/Utils/UniqueName.js.map +1 -0
- package/build/dist/UI/Components/LabelRule/ImportLabelRulesModal.js +17 -1
- package/build/dist/UI/Components/LabelRule/ImportLabelRulesModal.js.map +1 -1
- package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js +1 -2
- package/build/dist/UI/Components/MemberRoleAssignment/MemberRoleAssignment.js.map +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js +8 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +19 -6
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js +33 -43
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchCard.js +151 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchCard.js.map +1 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchEvents.js +54 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchEvents.js.map +1 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchRow.js +201 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchRow.js.map +1 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchUtil.js +60 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchUtil.js.map +1 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchesCard.js +116 -0
- package/build/dist/UI/Components/ModelSwitch/ModelSwitchesCard.js.map +1 -0
- package/build/dist/UI/Components/ModelSwitch/useSaveModelSwitch.js +68 -0
- package/build/dist/UI/Components/ModelSwitch/useSaveModelSwitch.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +1 -0
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ModelTable.js +3 -1
- package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +2 -2
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuCatalog.js +21 -10
- package/build/dist/UI/Components/Navbar/NavBarMenuCatalog.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +10 -7
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMobileMenu.js +17 -9
- package/build/dist/UI/Components/Navbar/NavBarMobileMenu.js.map +1 -1
- package/build/dist/UI/Components/Page/ModelHeaderEvents.js +43 -0
- package/build/dist/UI/Components/Page/ModelHeaderEvents.js.map +1 -0
- package/build/dist/UI/Components/Page/ModelPage.js +19 -1
- package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
- package/build/dist/UI/Components/Page/Page.js +31 -13
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/PeoplePicker/PeoplePicker.js +62 -20
- package/build/dist/UI/Components/PeoplePicker/PeoplePicker.js.map +1 -1
- package/build/dist/UI/Components/PeoplePicker/PeoplePickerTypes.js +98 -1
- package/build/dist/UI/Components/PeoplePicker/PeoplePickerTypes.js.map +1 -1
- package/build/dist/UI/Components/PeoplePicker/PeopleSearchPopup.js +35 -14
- package/build/dist/UI/Components/PeoplePicker/PeopleSearchPopup.js.map +1 -1
- package/build/dist/UI/Components/PublicForm/PublicFormFavicon.js +66 -0
- package/build/dist/UI/Components/PublicForm/PublicFormFavicon.js.map +1 -0
- package/build/dist/UI/Components/PublicForm/PublicFormLogo.js +38 -0
- package/build/dist/UI/Components/PublicForm/PublicFormLogo.js.map +1 -0
- package/build/dist/UI/Components/RuleCriteria/RuleCriteriaBuilder.js +5 -3
- package/build/dist/UI/Components/RuleCriteria/RuleCriteriaBuilder.js.map +1 -1
- package/build/dist/UI/Components/RuleRun/RuleView.js +2 -2
- package/build/dist/UI/Components/RuleRun/RuleView.js.map +1 -1
- package/build/dist/UI/Components/SaveStatus/SaveStatus.js +46 -0
- package/build/dist/UI/Components/SaveStatus/SaveStatus.js.map +1 -0
- package/build/dist/UI/Components/SaveStatus/useSaveOnChange.js +98 -0
- package/build/dist/UI/Components/SaveStatus/useSaveOnChange.js.map +1 -0
- package/build/dist/UI/Components/SmtpConfig/SmtpConfigFormFields.js +503 -0
- package/build/dist/UI/Components/SmtpConfig/SmtpConfigFormFields.js.map +1 -0
- package/build/dist/UI/Components/Sso/OidcProviderFormFields.js +283 -0
- package/build/dist/UI/Components/Sso/OidcProviderFormFields.js.map +1 -0
- package/build/dist/UI/Components/Sso/SamlProviderFormFields.js +182 -0
- package/build/dist/UI/Components/Sso/SamlProviderFormFields.js.map +1 -0
- package/build/dist/UI/Components/Sso/SsoProviderFormFields.js +208 -0
- package/build/dist/UI/Components/Sso/SsoProviderFormFields.js.map +1 -0
- package/build/dist/UI/Components/Table/TableEmptyState.js +17 -4
- package/build/dist/UI/Components/Table/TableEmptyState.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js +17 -52
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentPicker/ComponentSearch.js +7 -89
- package/build/dist/UI/Components/Workflow/ComponentPicker/ComponentSearch.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js.map +1 -1
- package/build/dist/UI/Types/UseAnchoredFieldPopup.js +22 -3
- package/build/dist/UI/Types/UseAnchoredFieldPopup.js.map +1 -1
- package/build/dist/UI/Utils/DefaultInviteTeam.js +207 -0
- package/build/dist/UI/Utils/DefaultInviteTeam.js.map +1 -0
- package/build/dist/UI/Utils/GrantablePermission.js +31 -0
- package/build/dist/UI/Utils/GrantablePermission.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +54 -3
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/build/dist/UI/Utils/TranslateTemplate.js +16 -0
- package/build/dist/UI/Utils/TranslateTemplate.js.map +1 -1
- package/build/dist/Utils/DistinctColor.js +151 -0
- package/build/dist/Utils/DistinctColor.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorOverviewPresentationUtil.js +12 -1
- package/build/dist/Utils/Monitor/MonitorOverviewPresentationUtil.js.map +1 -1
- package/build/dist/Utils/Slo/SloHealth.js +9 -3
- package/build/dist/Utils/Slo/SloHealth.js.map +1 -1
- package/build/dist/Utils/StatusPage/ReportSchedule.js +304 -0
- package/build/dist/Utils/StatusPage/ReportSchedule.js.map +1 -0
- package/build/dist/Utils/Telemetry/DiscoveredResourceName.js +65 -0
- package/build/dist/Utils/Telemetry/DiscoveredResourceName.js.map +1 -0
- package/build/dist/Utils/WordMatch.js +115 -0
- package/build/dist/Utils/WordMatch.js.map +1 -0
- package/package.json +1 -1
- package/Tests/App/Dashboard/BulkChangeStateModalSteps.test.ts +0 -109
- package/Tests/App/StatusPage/StatusPageSubscribeFromFirstStep.test.tsx +0 -382
- package/Tests/UI/Components/Forms/BasicFormFinishFromAnyStep.test.tsx +0 -729
- package/Tests/UI/Components/Forms/FinishFromAnyStep.test.ts +0 -571
- package/Tests/UI/Components/Forms/FinishFromAnyStepGuard.test.ts +0 -566
- package/UI/Components/Forms/Utils/FinishFromAnyStep.ts +0 -284
- package/build/dist/UI/Components/Forms/Utils/FinishFromAnyStep.js +0 -132
- package/build/dist/UI/Components/Forms/Utils/FinishFromAnyStep.js.map +0 -1
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
import BaseModel from "../../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
|
2
|
+
import OnCallDutyPolicySchedule from "../../../Models/DatabaseModels/OnCallDutyPolicySchedule";
|
|
3
|
+
import OnCallDutyPolicyScheduleLayer from "../../../Models/DatabaseModels/OnCallDutyPolicyScheduleLayer";
|
|
4
|
+
import OnCallDutyPolicyScheduleLayerUser from "../../../Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser";
|
|
5
|
+
import TeamMember from "../../../Models/DatabaseModels/TeamMember";
|
|
6
|
+
import AuditLogService from "../../../Server/Services/AuditLogService";
|
|
7
|
+
import DatabaseService from "../../../Server/Services/DatabaseService";
|
|
8
|
+
import OnCallDutyPolicyScheduleLayerService from "../../../Server/Services/OnCallDutyPolicyScheduleLayerService";
|
|
9
|
+
import OnCallDutyPolicyScheduleLayerUserService from "../../../Server/Services/OnCallDutyPolicyScheduleLayerUserService";
|
|
10
|
+
import OnCallDutyPolicyScheduleService from "../../../Server/Services/OnCallDutyPolicyScheduleService";
|
|
11
|
+
import TeamMemberService from "../../../Server/Services/TeamMemberService";
|
|
12
|
+
import CreateBy from "../../../Server/Types/Database/CreateBy";
|
|
13
|
+
import { OnCreate } from "../../../Server/Types/Database/Hooks";
|
|
14
|
+
import logger from "../../../Server/Utils/Logger";
|
|
15
|
+
import DatabaseCommonInteractionProps from "../../../Types/BaseDatabase/DatabaseCommonInteractionProps";
|
|
16
|
+
import PermissionScope from "../../../Types/Database/AccessControl/PermissionScope";
|
|
17
|
+
import OneUptimeDate from "../../../Types/Date";
|
|
18
|
+
import EventInterval from "../../../Types/Events/EventInterval";
|
|
19
|
+
import Recurring from "../../../Types/Events/Recurring";
|
|
20
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
21
|
+
import NotAuthorizedException from "../../../Types/Exception/NotAuthorizedException";
|
|
22
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
23
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
24
|
+
import { RestrictionType } from "../../../Types/OnCallDutyPolicy/RestrictionTimes";
|
|
25
|
+
import Permission, { UserPermission } from "../../../Types/Permission";
|
|
26
|
+
import PositiveNumber from "../../../Types/PositiveNumber";
|
|
27
|
+
import Timezone from "../../../Types/Timezone";
|
|
28
|
+
import { afterEach, beforeEach, describe, expect, test } from "@jest/globals";
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* A NEW ON-CALL SCHEDULE PUTS SOMEONE ON CALL FROM THE START.
|
|
32
|
+
*
|
|
33
|
+
* Create On-Call Schedule asks "Who takes turns?" and sends the picks as
|
|
34
|
+
* misc data (firstLayerUsers, in the order they take turns, and
|
|
35
|
+
* firstLayerRotation, how long each turn lasts). OnCallDutyPolicyScheduleService
|
|
36
|
+
* .create then adds the schedule's first layer - "Layer 1", on call from
|
|
37
|
+
* now - with those people in it, in that order. These tests drive the real
|
|
38
|
+
* create override and the real permission checks, with only the database
|
|
39
|
+
* stubbed:
|
|
40
|
+
*
|
|
41
|
+
* - nobody picked: no layer, nothing extra read - as before;
|
|
42
|
+
* - somebody picked: one layer, created after the schedule exists, as the
|
|
43
|
+
* caller, then one layer user per person, in pick order;
|
|
44
|
+
* - what can be refused is refused before anything is saved: bad lists, a
|
|
45
|
+
* bad rotation, a caller who may not add layers or people to them, and
|
|
46
|
+
* people from outside the project;
|
|
47
|
+
* - what fails once the schedule is saved is logged, and the schedule is
|
|
48
|
+
* kept.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
const PROJECT_ID: ObjectID = new ObjectID(
|
|
52
|
+
"0c000000-0000-4000-8000-000000000001",
|
|
53
|
+
);
|
|
54
|
+
const SCHEDULE_ID: ObjectID = new ObjectID(
|
|
55
|
+
"0c000000-0000-4000-8000-000000000002",
|
|
56
|
+
);
|
|
57
|
+
const LAYER_ID: ObjectID = new ObjectID("0c000000-0000-4000-8000-000000000003");
|
|
58
|
+
const CALLER_ID: ObjectID = new ObjectID(
|
|
59
|
+
"0c000000-0000-4000-8000-000000000004",
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const ALEX: string = "0c000000-0000-4000-8000-0000000000a1";
|
|
63
|
+
const SAM: string = "0c000000-0000-4000-8000-0000000000a2";
|
|
64
|
+
const PRIYA: string = "0c000000-0000-4000-8000-0000000000a3";
|
|
65
|
+
|
|
66
|
+
// Somebody who is not a member of the project.
|
|
67
|
+
const STRANGER: string = "0c000000-0000-4000-8000-0000000000f9";
|
|
68
|
+
|
|
69
|
+
// The base create as it is, taken before any test stubs it.
|
|
70
|
+
const REAL_BASE_CREATE: (
|
|
71
|
+
this: DatabaseService<BaseModel>,
|
|
72
|
+
createBy: CreateBy<BaseModel>,
|
|
73
|
+
) => Promise<BaseModel> = DatabaseService.prototype.create;
|
|
74
|
+
|
|
75
|
+
const MEMBERS: Array<string> = [ALEX, SAM, PRIYA, CALLER_ID.toString()];
|
|
76
|
+
|
|
77
|
+
const WEEK_IN_MS: number = 7 * 24 * 3600 * 1000;
|
|
78
|
+
|
|
79
|
+
function grant(permission: Permission): UserPermission {
|
|
80
|
+
return {
|
|
81
|
+
_type: "UserPermission",
|
|
82
|
+
permission,
|
|
83
|
+
labelIds: [],
|
|
84
|
+
scope: PermissionScope.All,
|
|
85
|
+
isBlockPermission: false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function callerProps(
|
|
90
|
+
permissions: Array<Permission> = [Permission.OnCallMember],
|
|
91
|
+
): DatabaseCommonInteractionProps {
|
|
92
|
+
return {
|
|
93
|
+
userId: CALLER_ID,
|
|
94
|
+
tenantId: PROJECT_ID,
|
|
95
|
+
userTenantAccessPermission: {
|
|
96
|
+
[PROJECT_ID.toString()]: {
|
|
97
|
+
_type: "UserTenantAccessPermission",
|
|
98
|
+
projectId: PROJECT_ID,
|
|
99
|
+
permissions: permissions.map(grant),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function newSchedule(): OnCallDutyPolicySchedule {
|
|
106
|
+
const schedule: OnCallDutyPolicySchedule = new OnCallDutyPolicySchedule();
|
|
107
|
+
schedule.name = "Payments primary";
|
|
108
|
+
schedule.timezone = Timezone.EuropeBerlin;
|
|
109
|
+
return schedule;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function createSchedule(
|
|
113
|
+
miscDataProps: JSONObject | undefined,
|
|
114
|
+
props: DatabaseCommonInteractionProps = callerProps(),
|
|
115
|
+
data: OnCallDutyPolicySchedule = newSchedule(),
|
|
116
|
+
): Promise<OnCallDutyPolicySchedule> {
|
|
117
|
+
const createBy: CreateBy<OnCallDutyPolicySchedule> = { data, props };
|
|
118
|
+
|
|
119
|
+
if (miscDataProps !== undefined) {
|
|
120
|
+
createBy.miscDataProps = miscDataProps;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return OnCallDutyPolicyScheduleService.create(createBy);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function rotationOf(intervalType: EventInterval, count: number): Recurring {
|
|
127
|
+
const rotation: Recurring = new Recurring();
|
|
128
|
+
rotation.intervalType = intervalType;
|
|
129
|
+
rotation.intervalCount = new PositiveNumber(count);
|
|
130
|
+
return rotation;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// The ids a `userId IN (...)` query asks for.
|
|
134
|
+
function idsIn(operator: unknown): Array<string> {
|
|
135
|
+
const parameters: Record<string, unknown> =
|
|
136
|
+
(operator as { objectLiteralParameters?: Record<string, unknown> })
|
|
137
|
+
.objectLiteralParameters || {};
|
|
138
|
+
|
|
139
|
+
const values: unknown = Object.values(parameters)[0];
|
|
140
|
+
|
|
141
|
+
return Array.isArray(values)
|
|
142
|
+
? values.map((value: unknown): string => {
|
|
143
|
+
return String(value).toLowerCase();
|
|
144
|
+
})
|
|
145
|
+
: [];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface MembershipQuery {
|
|
149
|
+
query: Record<string, unknown>;
|
|
150
|
+
props: DatabaseCommonInteractionProps;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let events: Array<string>;
|
|
154
|
+
let layerCreates: Array<CreateBy<OnCallDutyPolicyScheduleLayer>>;
|
|
155
|
+
let layerUserCreates: Array<CreateBy<OnCallDutyPolicyScheduleLayerUser>>;
|
|
156
|
+
let membershipQueries: Array<MembershipQuery>;
|
|
157
|
+
let layerCreateError: Error | null;
|
|
158
|
+
let failingUserIds: Array<string>;
|
|
159
|
+
let scheduleCreateSpy: jest.SpyInstance;
|
|
160
|
+
let loggerErrorSpy: jest.SpyInstance;
|
|
161
|
+
|
|
162
|
+
beforeEach(() => {
|
|
163
|
+
events = [];
|
|
164
|
+
layerCreates = [];
|
|
165
|
+
layerUserCreates = [];
|
|
166
|
+
membershipQueries = [];
|
|
167
|
+
layerCreateError = null;
|
|
168
|
+
failingUserIds = [];
|
|
169
|
+
|
|
170
|
+
/*
|
|
171
|
+
* Every create is stubbed at the base, after the real permission checks
|
|
172
|
+
* the schedule service makes before it: the schedule's own create stands
|
|
173
|
+
* for its hooks and its save; a layer and a layer user are recorded as
|
|
174
|
+
* their services would be handed them.
|
|
175
|
+
*/
|
|
176
|
+
scheduleCreateSpy = jest
|
|
177
|
+
.spyOn(DatabaseService.prototype, "create")
|
|
178
|
+
.mockImplementation(async function (
|
|
179
|
+
this: DatabaseService<BaseModel>,
|
|
180
|
+
createBy: CreateBy<BaseModel>,
|
|
181
|
+
): Promise<BaseModel> {
|
|
182
|
+
if (this.modelType === OnCallDutyPolicySchedule) {
|
|
183
|
+
events.push("schedule create started");
|
|
184
|
+
await Promise.resolve();
|
|
185
|
+
const schedule: OnCallDutyPolicySchedule =
|
|
186
|
+
createBy.data as OnCallDutyPolicySchedule;
|
|
187
|
+
schedule.id = SCHEDULE_ID;
|
|
188
|
+
schedule.projectId = createBy.props.tenantId || schedule.projectId!;
|
|
189
|
+
events.push("schedule created");
|
|
190
|
+
return schedule;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (this.modelType === OnCallDutyPolicyScheduleLayer) {
|
|
194
|
+
events.push("layer created");
|
|
195
|
+
layerCreates.push(createBy as CreateBy<OnCallDutyPolicyScheduleLayer>);
|
|
196
|
+
|
|
197
|
+
if (layerCreateError) {
|
|
198
|
+
throw layerCreateError;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
createBy.data.id = LAYER_ID;
|
|
202
|
+
return createBy.data;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (this.modelType === OnCallDutyPolicyScheduleLayerUser) {
|
|
206
|
+
const userId: string =
|
|
207
|
+
(
|
|
208
|
+
createBy.data as OnCallDutyPolicyScheduleLayerUser
|
|
209
|
+
).userId?.toString() || "";
|
|
210
|
+
|
|
211
|
+
events.push(`layer user ${userId}`);
|
|
212
|
+
layerUserCreates.push(
|
|
213
|
+
createBy as CreateBy<OnCallDutyPolicyScheduleLayerUser>,
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
if (failingUserIds.includes(userId)) {
|
|
217
|
+
throw new Error(`${userId} could not be added.`);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return createBy.data;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
throw new Error(`Unexpected create of ${this.modelType.name}`);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
jest
|
|
227
|
+
.spyOn(TeamMemberService, "findBy")
|
|
228
|
+
.mockImplementation(async (request: any): Promise<Array<TeamMember>> => {
|
|
229
|
+
membershipQueries.push({
|
|
230
|
+
query: request.query,
|
|
231
|
+
props: request.props,
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// One row per team the person is in: two teams for each member.
|
|
235
|
+
return idsIn(request.query.userId)
|
|
236
|
+
.filter((id: string): boolean => {
|
|
237
|
+
return MEMBERS.includes(id);
|
|
238
|
+
})
|
|
239
|
+
.flatMap((id: string): Array<TeamMember> => {
|
|
240
|
+
return [0, 1].map((): TeamMember => {
|
|
241
|
+
const member: TeamMember = new TeamMember();
|
|
242
|
+
member.userId = new ObjectID(id.toUpperCase());
|
|
243
|
+
return member;
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
loggerErrorSpy = jest.spyOn(logger, "error").mockImplementation(() => {
|
|
249
|
+
return undefined as never;
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
afterEach(() => {
|
|
254
|
+
jest.restoreAllMocks();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
function scheduleWasSaved(): boolean {
|
|
258
|
+
return events.includes("schedule create started");
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function layerUserIds(): Array<string> {
|
|
262
|
+
return layerUserCreates.map(
|
|
263
|
+
(createBy: CreateBy<OnCallDutyPolicyScheduleLayerUser>): string => {
|
|
264
|
+
return createBy.data.userId?.toString() || "";
|
|
265
|
+
},
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
describe("a schedule with nobody to take turns", () => {
|
|
270
|
+
test.each([
|
|
271
|
+
["no misc data", undefined],
|
|
272
|
+
["empty misc data", {}],
|
|
273
|
+
["an empty list", { firstLayerUsers: [] }],
|
|
274
|
+
["other misc data only", { ownerUsers: [ALEX], users: [SAM] }],
|
|
275
|
+
[
|
|
276
|
+
"a rotation and nobody to rotate",
|
|
277
|
+
{
|
|
278
|
+
firstLayerRotation: rotationOf(EventInterval.Day, 1).toJSON(),
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
] as Array<[string, JSONObject | undefined]>)(
|
|
282
|
+
"%s: is created without layers, as before",
|
|
283
|
+
async (_label: string, miscDataProps: JSONObject | undefined) => {
|
|
284
|
+
const schedule: OnCallDutyPolicySchedule =
|
|
285
|
+
await createSchedule(miscDataProps);
|
|
286
|
+
|
|
287
|
+
expect(schedule.id?.toString()).toBe(SCHEDULE_ID.toString());
|
|
288
|
+
expect(events).toEqual(["schedule create started", "schedule created"]);
|
|
289
|
+
expect(layerCreates).toHaveLength(0);
|
|
290
|
+
expect(layerUserCreates).toHaveLength(0);
|
|
291
|
+
// Nothing extra is looked up either.
|
|
292
|
+
expect(membershipQueries).toHaveLength(0);
|
|
293
|
+
},
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
describe("a schedule with people to take turns", () => {
|
|
298
|
+
test("gets one layer after it is saved, then its people in the order they were picked", async () => {
|
|
299
|
+
const schedule: OnCallDutyPolicySchedule = await createSchedule({
|
|
300
|
+
firstLayerUsers: [SAM, ALEX, PRIYA],
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
expect(schedule.id?.toString()).toBe(SCHEDULE_ID.toString());
|
|
304
|
+
expect(events).toEqual([
|
|
305
|
+
"schedule create started",
|
|
306
|
+
"schedule created",
|
|
307
|
+
"layer created",
|
|
308
|
+
`layer user ${SAM}`,
|
|
309
|
+
`layer user ${ALEX}`,
|
|
310
|
+
`layer user ${PRIYA}`,
|
|
311
|
+
]);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
test("the layer is Layer 1 of the new schedule, on call from now, weekly, around the clock", async () => {
|
|
315
|
+
const before: number = Date.now();
|
|
316
|
+
|
|
317
|
+
await createSchedule({ firstLayerUsers: [ALEX] });
|
|
318
|
+
|
|
319
|
+
const after: number = Date.now();
|
|
320
|
+
|
|
321
|
+
expect(layerCreates).toHaveLength(1);
|
|
322
|
+
|
|
323
|
+
const layer: OnCallDutyPolicyScheduleLayer = layerCreates[0]!.data;
|
|
324
|
+
|
|
325
|
+
expect(layer).toBeInstanceOf(OnCallDutyPolicyScheduleLayer);
|
|
326
|
+
expect(layer.name).toBe("Layer 1");
|
|
327
|
+
expect(layer.onCallDutyPolicyScheduleId?.toString()).toBe(
|
|
328
|
+
SCHEDULE_ID.toString(),
|
|
329
|
+
);
|
|
330
|
+
expect(layer.projectId?.toString()).toBe(PROJECT_ID.toString());
|
|
331
|
+
|
|
332
|
+
// Left to the layer service: it puts the layer first.
|
|
333
|
+
expect(layer.order).toBeUndefined();
|
|
334
|
+
expect(layer.description).toBeUndefined();
|
|
335
|
+
|
|
336
|
+
// On call from now.
|
|
337
|
+
expect(layer.startsAt!.getTime()).toBeGreaterThanOrEqual(before);
|
|
338
|
+
expect(layer.startsAt!.getTime()).toBeLessThanOrEqual(after);
|
|
339
|
+
|
|
340
|
+
// Each person for a week, handing off a week after the start.
|
|
341
|
+
expect(layer.rotation?.intervalType).toBe(EventInterval.Week);
|
|
342
|
+
expect(layer.rotation?.intervalCount.toNumber()).toBe(1);
|
|
343
|
+
|
|
344
|
+
const handOffIn: number =
|
|
345
|
+
layer.handOffTime!.getTime() - layer.startsAt!.getTime();
|
|
346
|
+
|
|
347
|
+
expect(Math.abs(handOffIn - WEEK_IN_MS)).toBeLessThanOrEqual(3600 * 1000);
|
|
348
|
+
|
|
349
|
+
// Around the clock.
|
|
350
|
+
expect(layer.restrictionTimes?.restictionType).toBe(RestrictionType.None);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
test("the first hand-off keeps the time of day in the schedule's time zone", async () => {
|
|
354
|
+
/*
|
|
355
|
+
* Stand the clock where a week spans Berlin's autumn change (25 October
|
|
356
|
+
* 2026): Thursday 22 October, 09:00 CEST is 07:00 UTC; the next Thursday
|
|
357
|
+
* at 09:00 CET is 08:00 UTC.
|
|
358
|
+
*/
|
|
359
|
+
jest
|
|
360
|
+
.spyOn(OneUptimeDate, "getCurrentDate")
|
|
361
|
+
.mockReturnValue(new Date("2026-10-22T07:00:00.000Z"));
|
|
362
|
+
|
|
363
|
+
await createSchedule({ firstLayerUsers: [ALEX] });
|
|
364
|
+
|
|
365
|
+
const layer: OnCallDutyPolicyScheduleLayer = layerCreates[0]!.data;
|
|
366
|
+
|
|
367
|
+
expect(layer.startsAt?.toISOString()).toBe("2026-10-22T07:00:00.000Z");
|
|
368
|
+
expect(layer.handOffTime?.toISOString()).toBe("2026-10-29T08:00:00.000Z");
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
test("the layer hands off on the rotation the create asked for", async () => {
|
|
372
|
+
await createSchedule({
|
|
373
|
+
firstLayerUsers: [ALEX, SAM],
|
|
374
|
+
firstLayerRotation: rotationOf(EventInterval.Week, 2).toJSON(),
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
const layer: OnCallDutyPolicyScheduleLayer = layerCreates[0]!.data;
|
|
378
|
+
|
|
379
|
+
expect(layer.rotation?.intervalType).toBe(EventInterval.Week);
|
|
380
|
+
expect(layer.rotation?.intervalCount.toNumber()).toBe(2);
|
|
381
|
+
|
|
382
|
+
const handOffIn: number =
|
|
383
|
+
layer.handOffTime!.getTime() - layer.startsAt!.getTime();
|
|
384
|
+
|
|
385
|
+
expect(Math.abs(handOffIn - 2 * WEEK_IN_MS)).toBeLessThanOrEqual(
|
|
386
|
+
3600 * 1000,
|
|
387
|
+
);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
test("each person is a layer user of the new layer, in the schedule and the project", async () => {
|
|
391
|
+
await createSchedule({ firstLayerUsers: [SAM, ALEX] });
|
|
392
|
+
|
|
393
|
+
expect(layerUserIds()).toEqual([SAM, ALEX]);
|
|
394
|
+
|
|
395
|
+
for (const createBy of layerUserCreates) {
|
|
396
|
+
const layerUser: OnCallDutyPolicyScheduleLayerUser = createBy.data;
|
|
397
|
+
|
|
398
|
+
expect(layerUser).toBeInstanceOf(OnCallDutyPolicyScheduleLayerUser);
|
|
399
|
+
expect(layerUser.onCallDutyPolicyScheduleLayerId?.toString()).toBe(
|
|
400
|
+
LAYER_ID.toString(),
|
|
401
|
+
);
|
|
402
|
+
expect(layerUser.onCallDutyPolicyScheduleId?.toString()).toBe(
|
|
403
|
+
SCHEDULE_ID.toString(),
|
|
404
|
+
);
|
|
405
|
+
expect(layerUser.projectId?.toString()).toBe(PROJECT_ID.toString());
|
|
406
|
+
// Left to the service: each goes last, so creation order is turn order.
|
|
407
|
+
expect(layerUser.order).toBeUndefined();
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
test("each person once, whatever the case or form they were sent in", async () => {
|
|
412
|
+
await createSchedule({
|
|
413
|
+
firstLayerUsers: [ALEX.toUpperCase(), SAM, new ObjectID(ALEX)],
|
|
414
|
+
} as unknown as JSONObject);
|
|
415
|
+
|
|
416
|
+
expect(layerUserIds()).toEqual([ALEX, SAM]);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
test("the layer and its people are created as the caller", async () => {
|
|
420
|
+
const props: DatabaseCommonInteractionProps = callerProps();
|
|
421
|
+
|
|
422
|
+
await createSchedule({ firstLayerUsers: [ALEX, SAM] }, props);
|
|
423
|
+
|
|
424
|
+
// The very props of the schedule create: same user, same plan, not root.
|
|
425
|
+
expect(layerCreates[0]!.props).toBe(props);
|
|
426
|
+
expect(layerCreates[0]!.props.isRoot).toBeUndefined();
|
|
427
|
+
|
|
428
|
+
for (const createBy of layerUserCreates) {
|
|
429
|
+
expect(createBy.props).toBe(props);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
test("an API caller's ObjectIDs and Recurring are read the same as the dashboard's JSON", async () => {
|
|
434
|
+
await createSchedule({
|
|
435
|
+
firstLayerUsers: [new ObjectID(PRIYA), new ObjectID(ALEX).toJSON()],
|
|
436
|
+
firstLayerRotation: rotationOf(EventInterval.Day, 1),
|
|
437
|
+
} as unknown as JSONObject);
|
|
438
|
+
|
|
439
|
+
expect(layerUserIds()).toEqual([PRIYA, ALEX]);
|
|
440
|
+
expect(layerCreates[0]!.data.rotation?.intervalType).toBe(
|
|
441
|
+
EventInterval.Day,
|
|
442
|
+
);
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
test("a root caller's schedule names its project in the data", async () => {
|
|
446
|
+
const data: OnCallDutyPolicySchedule = newSchedule();
|
|
447
|
+
data.projectId = PROJECT_ID;
|
|
448
|
+
|
|
449
|
+
await createSchedule({ firstLayerUsers: [ALEX] }, { isRoot: true }, data);
|
|
450
|
+
|
|
451
|
+
expect(layerCreates).toHaveLength(1);
|
|
452
|
+
expect(layerCreates[0]!.props.isRoot).toBe(true);
|
|
453
|
+
expect(String(membershipQueries[0]!.query["projectId"])).toBe(
|
|
454
|
+
PROJECT_ID.toString(),
|
|
455
|
+
);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
test("past the hooks (ignoreHooks), nothing is read and no layer is made", async () => {
|
|
459
|
+
const props: DatabaseCommonInteractionProps = {
|
|
460
|
+
...callerProps(),
|
|
461
|
+
ignoreHooks: true,
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
// Not even a bad list is looked at.
|
|
465
|
+
await createSchedule(
|
|
466
|
+
{ firstLayerUsers: "everyone" } as unknown as JSONObject,
|
|
467
|
+
props,
|
|
468
|
+
);
|
|
469
|
+
|
|
470
|
+
expect(layerCreates).toHaveLength(0);
|
|
471
|
+
expect(membershipQueries).toHaveLength(0);
|
|
472
|
+
expect(scheduleWasSaved()).toBe(true);
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
describe("refused before anything is saved", () => {
|
|
477
|
+
test("a list that is not a list of user ids", async () => {
|
|
478
|
+
await expect(
|
|
479
|
+
createSchedule({ firstLayerUsers: ["alex@example.com"] }),
|
|
480
|
+
).rejects.toThrow(BadDataException);
|
|
481
|
+
|
|
482
|
+
expect(scheduleWasSaved()).toBe(false);
|
|
483
|
+
expect(layerCreates).toHaveLength(0);
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
test("a rotation that is not one", async () => {
|
|
487
|
+
await expect(
|
|
488
|
+
createSchedule({
|
|
489
|
+
firstLayerUsers: [ALEX],
|
|
490
|
+
firstLayerRotation: "weekly",
|
|
491
|
+
}),
|
|
492
|
+
).rejects.toThrow(
|
|
493
|
+
"firstLayerRotation must be a rotation: how many hours, days, weeks, months or years each turn lasts.",
|
|
494
|
+
);
|
|
495
|
+
|
|
496
|
+
expect(scheduleWasSaved()).toBe(false);
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
test("a caller who may create schedules but not layers", async () => {
|
|
500
|
+
const attempt: Promise<OnCallDutyPolicySchedule> = createSchedule(
|
|
501
|
+
{ firstLayerUsers: [ALEX] },
|
|
502
|
+
callerProps([Permission.CreateProjectOnCallDutyPolicySchedule]),
|
|
503
|
+
);
|
|
504
|
+
|
|
505
|
+
await expect(attempt).rejects.toThrow(NotAuthorizedException);
|
|
506
|
+
await expect(attempt).rejects.toThrow(
|
|
507
|
+
new OnCallDutyPolicyScheduleLayer().singularName!,
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
expect(scheduleWasSaved()).toBe(false);
|
|
511
|
+
expect(membershipQueries).toHaveLength(0);
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
test("the same caller with nobody picked still creates the schedule", async () => {
|
|
515
|
+
await createSchedule(
|
|
516
|
+
{},
|
|
517
|
+
callerProps([Permission.CreateProjectOnCallDutyPolicySchedule]),
|
|
518
|
+
);
|
|
519
|
+
|
|
520
|
+
expect(scheduleWasSaved()).toBe(true);
|
|
521
|
+
expect(layerCreates).toHaveLength(0);
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
test("a caller who may add layers, with the permission adding them by hand needs", async () => {
|
|
525
|
+
await createSchedule(
|
|
526
|
+
{ firstLayerUsers: [ALEX] },
|
|
527
|
+
callerProps([
|
|
528
|
+
Permission.CreateProjectOnCallDutyPolicySchedule,
|
|
529
|
+
Permission.CreateOnCallDutyPolicyScheduleLayer,
|
|
530
|
+
]),
|
|
531
|
+
);
|
|
532
|
+
|
|
533
|
+
expect(layerCreates).toHaveLength(1);
|
|
534
|
+
expect(layerUserCreates).toHaveLength(1);
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
test("a person who is not a member of the project", async () => {
|
|
538
|
+
await expect(
|
|
539
|
+
createSchedule({ firstLayerUsers: [ALEX, STRANGER] }),
|
|
540
|
+
).rejects.toThrow(
|
|
541
|
+
"Some of the people picked to take turns are not members of this project.",
|
|
542
|
+
);
|
|
543
|
+
|
|
544
|
+
expect(scheduleWasSaved()).toBe(false);
|
|
545
|
+
expect(layerCreates).toHaveLength(0);
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
test("a schedule with no project", async () => {
|
|
549
|
+
await expect(
|
|
550
|
+
createSchedule({ firstLayerUsers: [ALEX] }, { isRoot: true }),
|
|
551
|
+
).rejects.toThrow(
|
|
552
|
+
"A project is required to add people to a new on-call schedule.",
|
|
553
|
+
);
|
|
554
|
+
|
|
555
|
+
expect(scheduleWasSaved()).toBe(false);
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
describe("the membership check", () => {
|
|
560
|
+
test("looks the people up in this project only, as root", async () => {
|
|
561
|
+
await createSchedule({ firstLayerUsers: [SAM, ALEX] });
|
|
562
|
+
|
|
563
|
+
expect(membershipQueries).toHaveLength(1);
|
|
564
|
+
expect(String(membershipQueries[0]!.query["projectId"])).toBe(
|
|
565
|
+
PROJECT_ID.toString(),
|
|
566
|
+
);
|
|
567
|
+
expect(membershipQueries[0]!.props.isRoot).toBe(true);
|
|
568
|
+
expect(idsIn(membershipQueries[0]!.query["userId"])).toEqual([SAM, ALEX]);
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
test("is made against the caller's project, not a project named in the data", async () => {
|
|
572
|
+
const data: OnCallDutyPolicySchedule = newSchedule();
|
|
573
|
+
data.projectId = new ObjectID("0c000000-0000-4000-8000-0000000000ff");
|
|
574
|
+
|
|
575
|
+
await createSchedule({ firstLayerUsers: [ALEX] }, callerProps(), data);
|
|
576
|
+
|
|
577
|
+
expect(String(membershipQueries[0]!.query["projectId"])).toBe(
|
|
578
|
+
PROJECT_ID.toString(),
|
|
579
|
+
);
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
test("a person in several of the project's teams is one member", async () => {
|
|
583
|
+
await createSchedule({ firstLayerUsers: [ALEX, CALLER_ID.toString()] });
|
|
584
|
+
|
|
585
|
+
expect(layerUserIds()).toEqual([ALEX, CALLER_ID.toString()]);
|
|
586
|
+
});
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
describe("once the schedule is saved", () => {
|
|
590
|
+
test("a layer that cannot be added is logged, and the schedule is kept", async () => {
|
|
591
|
+
layerCreateError = new Error("The database went away.");
|
|
592
|
+
|
|
593
|
+
const schedule: OnCallDutyPolicySchedule = await createSchedule({
|
|
594
|
+
firstLayerUsers: [ALEX, SAM],
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
expect(schedule.id?.toString()).toBe(SCHEDULE_ID.toString());
|
|
598
|
+
expect(layerCreates).toHaveLength(1);
|
|
599
|
+
// Nobody is added to a layer that does not exist.
|
|
600
|
+
expect(layerUserCreates).toHaveLength(0);
|
|
601
|
+
expect(loggerErrorSpy).toHaveBeenCalledTimes(1);
|
|
602
|
+
expect(String(loggerErrorSpy.mock.calls[0]![0])).toContain(
|
|
603
|
+
"The database went away.",
|
|
604
|
+
);
|
|
605
|
+
expect(loggerErrorSpy.mock.calls[0]![1]).toEqual({
|
|
606
|
+
projectId: PROJECT_ID.toString(),
|
|
607
|
+
onCallDutyPolicyScheduleId: SCHEDULE_ID.toString(),
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
test("a person who cannot be added is logged, and the others still take their turns", async () => {
|
|
612
|
+
failingUserIds = [SAM];
|
|
613
|
+
|
|
614
|
+
const schedule: OnCallDutyPolicySchedule = await createSchedule({
|
|
615
|
+
firstLayerUsers: [ALEX, SAM, PRIYA],
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
expect(schedule.id?.toString()).toBe(SCHEDULE_ID.toString());
|
|
619
|
+
expect(layerUserIds()).toEqual([ALEX, SAM, PRIYA]);
|
|
620
|
+
expect(loggerErrorSpy).toHaveBeenCalledTimes(1);
|
|
621
|
+
expect(String(loggerErrorSpy.mock.calls[0]![0])).toContain(
|
|
622
|
+
`${SAM} could not be added.`,
|
|
623
|
+
);
|
|
624
|
+
expect(loggerErrorSpy.mock.calls[0]![1]).toEqual({
|
|
625
|
+
projectId: PROJECT_ID.toString(),
|
|
626
|
+
onCallDutyPolicyScheduleId: SCHEDULE_ID.toString(),
|
|
627
|
+
onCallDutyPolicyScheduleLayerId: LAYER_ID.toString(),
|
|
628
|
+
userId: SAM,
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
test("a schedule create that fails makes no layer", async () => {
|
|
633
|
+
scheduleCreateSpy.mockImplementationOnce(async (): Promise<never> => {
|
|
634
|
+
throw new BadDataException("name is required");
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
await expect(createSchedule({ firstLayerUsers: [ALEX] })).rejects.toThrow(
|
|
638
|
+
"name is required",
|
|
639
|
+
);
|
|
640
|
+
|
|
641
|
+
expect(layerCreates).toHaveLength(0);
|
|
642
|
+
expect(layerUserCreates).toHaveLength(0);
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
/*
|
|
647
|
+
* What the layer services make of what they are handed: the same layer and
|
|
648
|
+
* layer users Add Layer and Add User would have created.
|
|
649
|
+
*/
|
|
650
|
+
describe("the layer services, given the first layer", () => {
|
|
651
|
+
test("the layer service puts the layer first and finds nothing wrong with it", async () => {
|
|
652
|
+
await createSchedule({ firstLayerUsers: [ALEX] });
|
|
653
|
+
|
|
654
|
+
const createBy: CreateBy<OnCallDutyPolicyScheduleLayer> = layerCreates[0]!;
|
|
655
|
+
|
|
656
|
+
// A new schedule has no layers yet.
|
|
657
|
+
jest
|
|
658
|
+
.spyOn(OnCallDutyPolicyScheduleLayerService, "countBy")
|
|
659
|
+
.mockResolvedValue(new PositiveNumber(0) as never);
|
|
660
|
+
jest
|
|
661
|
+
.spyOn(OnCallDutyPolicyScheduleLayerService, "findBy")
|
|
662
|
+
.mockResolvedValue([] as never);
|
|
663
|
+
|
|
664
|
+
const result: OnCreate<OnCallDutyPolicyScheduleLayer> = await (
|
|
665
|
+
OnCallDutyPolicyScheduleLayerService as unknown as {
|
|
666
|
+
onBeforeCreate: (
|
|
667
|
+
createBy: CreateBy<OnCallDutyPolicyScheduleLayer>,
|
|
668
|
+
) => Promise<OnCreate<OnCallDutyPolicyScheduleLayer>>;
|
|
669
|
+
}
|
|
670
|
+
).onBeforeCreate(createBy);
|
|
671
|
+
|
|
672
|
+
expect(result.createBy.data.order).toBe(1);
|
|
673
|
+
expect(result.createBy.data.name).toBe("Layer 1");
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
test("the layer user service puts each person after the ones before", async () => {
|
|
677
|
+
await createSchedule({ firstLayerUsers: [ALEX, SAM, PRIYA] });
|
|
678
|
+
|
|
679
|
+
let usersInLayer: number = 0;
|
|
680
|
+
|
|
681
|
+
jest
|
|
682
|
+
.spyOn(OnCallDutyPolicyScheduleLayerUserService, "countBy")
|
|
683
|
+
.mockImplementation(async (): Promise<PositiveNumber> => {
|
|
684
|
+
return new PositiveNumber(usersInLayer);
|
|
685
|
+
});
|
|
686
|
+
jest
|
|
687
|
+
.spyOn(OnCallDutyPolicyScheduleLayerUserService, "findBy")
|
|
688
|
+
.mockResolvedValue([] as never);
|
|
689
|
+
|
|
690
|
+
const orders: Array<number | undefined> = [];
|
|
691
|
+
|
|
692
|
+
for (const createBy of layerUserCreates) {
|
|
693
|
+
const result: OnCreate<OnCallDutyPolicyScheduleLayerUser> = await (
|
|
694
|
+
OnCallDutyPolicyScheduleLayerUserService as unknown as {
|
|
695
|
+
onBeforeCreate: (
|
|
696
|
+
createBy: CreateBy<OnCallDutyPolicyScheduleLayerUser>,
|
|
697
|
+
) => Promise<OnCreate<OnCallDutyPolicyScheduleLayerUser>>;
|
|
698
|
+
}
|
|
699
|
+
).onBeforeCreate(createBy);
|
|
700
|
+
|
|
701
|
+
orders.push(result.createBy.data.order);
|
|
702
|
+
usersInLayer++;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
expect(orders).toEqual([1, 2, 3]);
|
|
706
|
+
});
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
/*
|
|
710
|
+
* The layer is added once the schedule really exists: after the base create
|
|
711
|
+
* has saved it and run its success hook. This runs the real base create of
|
|
712
|
+
* the schedule (with the database and its side effects stubbed) to pin it.
|
|
713
|
+
*/
|
|
714
|
+
describe("with the real base create of the schedule", () => {
|
|
715
|
+
test("the layer is made after the schedule is saved and its success hook has run", async () => {
|
|
716
|
+
scheduleCreateSpy.mockImplementation(async function (
|
|
717
|
+
this: DatabaseService<BaseModel>,
|
|
718
|
+
createBy: CreateBy<BaseModel>,
|
|
719
|
+
): Promise<BaseModel> {
|
|
720
|
+
if (this.modelType === OnCallDutyPolicyScheduleLayer) {
|
|
721
|
+
events.push("layer created");
|
|
722
|
+
createBy.data.id = LAYER_ID;
|
|
723
|
+
layerCreates.push(createBy as CreateBy<OnCallDutyPolicyScheduleLayer>);
|
|
724
|
+
return createBy.data;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (this.modelType === OnCallDutyPolicyScheduleLayerUser) {
|
|
728
|
+
events.push("layer user created");
|
|
729
|
+
return createBy.data;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return await REAL_BASE_CREATE.call(this, createBy);
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
jest
|
|
736
|
+
.spyOn(OnCallDutyPolicyScheduleService, "countBy")
|
|
737
|
+
.mockResolvedValue(new PositiveNumber(0) as never);
|
|
738
|
+
|
|
739
|
+
jest
|
|
740
|
+
.spyOn(OnCallDutyPolicyScheduleService, "getRepository")
|
|
741
|
+
.mockReturnValue({
|
|
742
|
+
save: async (
|
|
743
|
+
data: OnCallDutyPolicySchedule,
|
|
744
|
+
): Promise<OnCallDutyPolicySchedule> => {
|
|
745
|
+
events.push("schedule saved");
|
|
746
|
+
data.id = SCHEDULE_ID;
|
|
747
|
+
return data;
|
|
748
|
+
},
|
|
749
|
+
} as never);
|
|
750
|
+
|
|
751
|
+
jest
|
|
752
|
+
.spyOn(
|
|
753
|
+
OnCallDutyPolicyScheduleService as unknown as {
|
|
754
|
+
onCreateSuccess: (
|
|
755
|
+
onCreate: unknown,
|
|
756
|
+
item: OnCallDutyPolicySchedule,
|
|
757
|
+
) => Promise<OnCallDutyPolicySchedule>;
|
|
758
|
+
},
|
|
759
|
+
"onCreateSuccess",
|
|
760
|
+
)
|
|
761
|
+
.mockImplementation(
|
|
762
|
+
async (
|
|
763
|
+
_onCreate: unknown,
|
|
764
|
+
item: OnCallDutyPolicySchedule,
|
|
765
|
+
): Promise<OnCallDutyPolicySchedule> => {
|
|
766
|
+
events.push("schedule success hook");
|
|
767
|
+
return item;
|
|
768
|
+
},
|
|
769
|
+
);
|
|
770
|
+
|
|
771
|
+
jest
|
|
772
|
+
.spyOn(OnCallDutyPolicyScheduleService, "onTriggerWorkflow")
|
|
773
|
+
.mockResolvedValue(undefined as never);
|
|
774
|
+
jest
|
|
775
|
+
.spyOn(OnCallDutyPolicyScheduleService, "onTriggerRealtime")
|
|
776
|
+
.mockResolvedValue(undefined as never);
|
|
777
|
+
jest
|
|
778
|
+
.spyOn(AuditLogService, "recordCreate")
|
|
779
|
+
.mockResolvedValue(undefined as never);
|
|
780
|
+
|
|
781
|
+
const schedule: OnCallDutyPolicySchedule = await createSchedule({
|
|
782
|
+
firstLayerUsers: [ALEX],
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
expect(schedule.id?.toString()).toBe(SCHEDULE_ID.toString());
|
|
786
|
+
expect(schedule.projectId?.toString()).toBe(PROJECT_ID.toString());
|
|
787
|
+
expect(events).toEqual([
|
|
788
|
+
"schedule saved",
|
|
789
|
+
"schedule success hook",
|
|
790
|
+
"layer created",
|
|
791
|
+
"layer user created",
|
|
792
|
+
]);
|
|
793
|
+
|
|
794
|
+
// The layer hands off in the time zone the schedule was saved with.
|
|
795
|
+
expect(layerCreates[0]!.data.onCallDutyPolicyScheduleId?.toString()).toBe(
|
|
796
|
+
SCHEDULE_ID.toString(),
|
|
797
|
+
);
|
|
798
|
+
});
|
|
799
|
+
});
|