@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,201 @@
|
|
|
1
|
+
import { Yellow } from "../../../Types/BrandColors";
|
|
2
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
3
|
+
import API from "../../Utils/API/API";
|
|
4
|
+
import ModelAPI from "../../Utils/ModelAPI/ModelAPI";
|
|
5
|
+
import PermissionGate from "../../Utils/PermissionGate";
|
|
6
|
+
import useTranslator from "../../Utils/UseTranslator";
|
|
7
|
+
import { ButtonStyleType } from "../Button/Button";
|
|
8
|
+
import Icon from "../Icon/Icon";
|
|
9
|
+
import ConfirmModal from "../Modal/ConfirmModal";
|
|
10
|
+
import Pill from "../Pill/Pill";
|
|
11
|
+
import Toggle from "../Toggle/Toggle";
|
|
12
|
+
import { announceModelSwitchSaved, subscribeToModelSwitchSaved, } from "./ModelSwitchEvents";
|
|
13
|
+
import { getPlanNeededToChangeColumn, getStoredValueForSwitch, } from "./ModelSwitchUtil";
|
|
14
|
+
import React, { useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
15
|
+
export var ModelSwitchSaveState;
|
|
16
|
+
(function (ModelSwitchSaveState) {
|
|
17
|
+
ModelSwitchSaveState["Idle"] = "Idle";
|
|
18
|
+
// Its dialog is open.
|
|
19
|
+
ModelSwitchSaveState["Confirming"] = "Confirming";
|
|
20
|
+
ModelSwitchSaveState["Saving"] = "Saving";
|
|
21
|
+
ModelSwitchSaveState["Saved"] = "Saved";
|
|
22
|
+
})(ModelSwitchSaveState || (ModelSwitchSaveState = {}));
|
|
23
|
+
const ModelSwitchRow = (props) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
const translator = useTranslator();
|
|
26
|
+
const source = `model-switch-${useId()}`;
|
|
27
|
+
const [isOn, setIsOn] = useState(props.initialValue);
|
|
28
|
+
const [saveState, setSaveState] = useState(ModelSwitchSaveState.Idle);
|
|
29
|
+
const [error, setError] = useState("");
|
|
30
|
+
const [pending, setPending] = useState(null);
|
|
31
|
+
/*
|
|
32
|
+
* Set at once, where the state above lands on the next render: two presses
|
|
33
|
+
* before the switch has drawn itself locked must not save twice.
|
|
34
|
+
*/
|
|
35
|
+
const isBusyRef = useRef(false);
|
|
36
|
+
/*
|
|
37
|
+
* The change the dialog is asking about, taken by the first answer: a
|
|
38
|
+
* second press of its button before it closes finds nothing to save.
|
|
39
|
+
*/
|
|
40
|
+
const pendingRef = useRef(null);
|
|
41
|
+
// The callbacks of the latest render, for the subscription below.
|
|
42
|
+
const latestPropsRef = useRef(props);
|
|
43
|
+
latestPropsRef.current = props;
|
|
44
|
+
const model = useMemo(() => {
|
|
45
|
+
return new props.modelType();
|
|
46
|
+
}, [props.modelType]);
|
|
47
|
+
const modelIdString = props.modelId.toString();
|
|
48
|
+
const updateGate = PermissionGate.checkColumnUpdate(model, props.column);
|
|
49
|
+
const planNeeded = getPlanNeededToChangeColumn(model, props.column);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
return subscribeToModelSwitchSaved({
|
|
52
|
+
modelType: props.modelType,
|
|
53
|
+
modelId: props.modelId,
|
|
54
|
+
column: props.column,
|
|
55
|
+
source: source,
|
|
56
|
+
onSaved: (stored) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
// A change of its own in flight has the last word.
|
|
59
|
+
if (isBusyRef.current) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const nextIsOn = latestPropsRef.current.isInverted
|
|
63
|
+
? !stored
|
|
64
|
+
: stored;
|
|
65
|
+
setIsOn(nextIsOn);
|
|
66
|
+
setError("");
|
|
67
|
+
setSaveState(ModelSwitchSaveState.Idle);
|
|
68
|
+
(_b = (_a = latestPropsRef.current).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, nextIsOn);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}, [props.modelType, modelIdString, props.column, source]);
|
|
72
|
+
const save = async (value, previous) => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
isBusyRef.current = true;
|
|
75
|
+
setSaveState(ModelSwitchSaveState.Saving);
|
|
76
|
+
setError("");
|
|
77
|
+
const stored = getStoredValueForSwitch({
|
|
78
|
+
isOn: value,
|
|
79
|
+
isInverted: props.isInverted,
|
|
80
|
+
});
|
|
81
|
+
const modelAPI = props.modelAPI || ModelAPI;
|
|
82
|
+
try {
|
|
83
|
+
await modelAPI.updateById({
|
|
84
|
+
modelType: props.modelType,
|
|
85
|
+
id: props.modelId,
|
|
86
|
+
data: {
|
|
87
|
+
[props.column]: stored,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
isBusyRef.current = false;
|
|
91
|
+
setSaveState(ModelSwitchSaveState.Saved);
|
|
92
|
+
announceModelSwitchSaved({
|
|
93
|
+
modelType: props.modelType,
|
|
94
|
+
modelId: props.modelId,
|
|
95
|
+
column: props.column,
|
|
96
|
+
value: stored,
|
|
97
|
+
source: source,
|
|
98
|
+
});
|
|
99
|
+
(_a = props.onSaved) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
isBusyRef.current = false;
|
|
103
|
+
setIsOn(previous);
|
|
104
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, previous);
|
|
105
|
+
setSaveState(ModelSwitchSaveState.Idle);
|
|
106
|
+
setError(API.getFriendlyMessage(err));
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const change = (value) => {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
if (isBusyRef.current || !updateGate.isAllowed) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const previous = isOn;
|
|
115
|
+
/*
|
|
116
|
+
* The switch has already moved (it keeps its own state, and follows
|
|
117
|
+
* `value` only when `value` changes): the row follows it, so that a
|
|
118
|
+
* refusal or a cancelled dialog - which puts `value` back - moves the
|
|
119
|
+
* switch back too.
|
|
120
|
+
*/
|
|
121
|
+
setIsOn(value);
|
|
122
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
123
|
+
setError("");
|
|
124
|
+
const confirmation = (_b = props.getConfirmation) === null || _b === void 0 ? void 0 : _b.call(props, value);
|
|
125
|
+
if (confirmation) {
|
|
126
|
+
isBusyRef.current = true;
|
|
127
|
+
pendingRef.current = { previous, value, confirmation };
|
|
128
|
+
setPending(pendingRef.current);
|
|
129
|
+
setSaveState(ModelSwitchSaveState.Confirming);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
void save(value, previous);
|
|
133
|
+
};
|
|
134
|
+
const cancelPending = () => {
|
|
135
|
+
var _a;
|
|
136
|
+
const cancelled = pendingRef.current;
|
|
137
|
+
if (!cancelled) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
pendingRef.current = null;
|
|
141
|
+
isBusyRef.current = false;
|
|
142
|
+
setIsOn(cancelled.previous);
|
|
143
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, cancelled.previous);
|
|
144
|
+
setPending(null);
|
|
145
|
+
setSaveState(ModelSwitchSaveState.Idle);
|
|
146
|
+
};
|
|
147
|
+
const confirmPending = () => {
|
|
148
|
+
const confirmed = pendingRef.current;
|
|
149
|
+
if (!confirmed) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
pendingRef.current = null;
|
|
153
|
+
setPending(null);
|
|
154
|
+
void save(confirmed.value, confirmed.previous);
|
|
155
|
+
};
|
|
156
|
+
const descriptionText = (_a = props.getDescription) === null || _a === void 0 ? void 0 : _a.call(props, isOn);
|
|
157
|
+
// Translated here, as one element: the Toggle would look a string up again.
|
|
158
|
+
const description = descriptionText || props.note ? (React.createElement(React.Fragment, null,
|
|
159
|
+
descriptionText ? translator.translateText(descriptionText) : "",
|
|
160
|
+
descriptionText && props.note ? " " : "",
|
|
161
|
+
props.note ? translator.translateText(props.note) : "")) : undefined;
|
|
162
|
+
const isLocked = saveState === ModelSwitchSaveState.Saving ||
|
|
163
|
+
saveState === ModelSwitchSaveState.Confirming ||
|
|
164
|
+
!updateGate.isAllowed;
|
|
165
|
+
const getSaveStateElement = () => {
|
|
166
|
+
if (saveState === ModelSwitchSaveState.Saving) {
|
|
167
|
+
return (React.createElement("span", { className: "text-gray-500" }, translator.translateText("Saving…")));
|
|
168
|
+
}
|
|
169
|
+
if (saveState === ModelSwitchSaveState.Saved) {
|
|
170
|
+
return (React.createElement("span", { className: "inline-flex items-center gap-1 text-emerald-700" },
|
|
171
|
+
React.createElement(Icon, { icon: IconProp.Check, className: "h-4 w-4" }),
|
|
172
|
+
translator.translateText("Saved")));
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
};
|
|
176
|
+
const hasSaveState = saveState === ModelSwitchSaveState.Saving ||
|
|
177
|
+
saveState === ModelSwitchSaveState.Saved;
|
|
178
|
+
return (
|
|
179
|
+
/*
|
|
180
|
+
* The "Saved" status and the plan's pill sit to the right of the
|
|
181
|
+
* switch's text from sm up. On a phone they go under the text, lined up
|
|
182
|
+
* with it (the switch is 44px and 12px from its text: pl-14), so the
|
|
183
|
+
* sentence keeps the width. Each brings its own top margin there, and the
|
|
184
|
+
* column its own left margin from sm up, so a row with neither takes no
|
|
185
|
+
* more room than its switch.
|
|
186
|
+
*/
|
|
187
|
+
React.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between", "data-testid": props.dataTestId ? `${props.dataTestId}-row` : undefined },
|
|
188
|
+
React.createElement("div", { className: "min-w-0 flex-1" },
|
|
189
|
+
React.createElement(Toggle, { title: props.title, description: description, value: isOn, disabled: isLocked, tooltip: updateGate.disabledReason, error: error || undefined, dataTestId: props.dataTestId, onChange: (value) => {
|
|
190
|
+
change(value);
|
|
191
|
+
} })),
|
|
192
|
+
React.createElement("div", { className: `flex flex-shrink-0 flex-wrap items-center gap-x-3 pl-14 text-sm sm:pl-0 sm:pt-0.5 ${hasSaveState || planNeeded ? "sm:ml-4" : ""}` },
|
|
193
|
+
React.createElement("span", { role: "status", className: hasSaveState ? "mt-2 inline-flex sm:mt-0" : "inline-flex", "data-testid": props.dataTestId ? `${props.dataTestId}-status` : undefined }, getSaveStateElement()),
|
|
194
|
+
planNeeded ? (React.createElement("span", { className: "mt-2 inline-flex sm:mt-0" },
|
|
195
|
+
React.createElement(Pill, { text: translator.translateTemplate("{{planName}} Plan", {
|
|
196
|
+
planName: planNeeded,
|
|
197
|
+
}), color: Yellow }))) : (React.createElement(React.Fragment, null))),
|
|
198
|
+
pending ? (React.createElement(ConfirmModal, { title: pending.confirmation.title, description: pending.confirmation.description, submitButtonText: pending.confirmation.submitButtonText, submitButtonType: (_b = pending.confirmation.submitButtonType) !== null && _b !== void 0 ? _b : ButtonStyleType.PRIMARY, onClose: cancelPending, onSubmit: confirmPending })) : (React.createElement(React.Fragment, null))));
|
|
199
|
+
};
|
|
200
|
+
export default ModelSwitchRow;
|
|
201
|
+
//# sourceMappingURL=ModelSwitchRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelSwitchRow.js","sourceRoot":"","sources":["../../../../../UI/Components/ModelSwitch/ModelSwitchRow.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAGpD,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,cAEN,MAAM,4BAA4B,CAAC;AAEpC,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OA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AAC,CACZ,8BAAM,SAAS,EAAC,0BAA0B;gBACxC,oBAAC,IAAI,IACH,IAAI,EAAE,UAAU,CAAC,iBAAiB,CAAC,mBAAmB,EAAE;wBACtD,QAAQ,EAAE,UAAU;qBACrB,CAAC,EACF,KAAK,EAAE,MAAM,GACb,CACG,CACR,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CACG;QACL,OAAO,CAAC,CAAC,CAAC,CACT,oBAAC,YAAY,IACX,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,EACjC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,WAAW,EAC7C,gBAAgB,EAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,EACvD,gBAAgB,EACd,MAAA,OAAO,CAAC,YAAY,CAAC,gBAAgB,mCAAI,eAAe,CAAC,OAAO,EAElE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,cAAc,GACxB,CACH,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import SubscriptionPlan from "../../../Types/Billing/SubscriptionPlan";
|
|
2
|
+
import { getAllEnvVars } from "../../Config";
|
|
3
|
+
import ProjectUtil from "../../Utils/Project";
|
|
4
|
+
/*
|
|
5
|
+
* The plan this project would need to change the column, or null when it
|
|
6
|
+
* can. Fails open, like the dashboard's other plan notes: with billing off
|
|
7
|
+
* (getCurrentPlan is null on every self-hosted install and outside a
|
|
8
|
+
* project, as in the admin dashboard), or a plan it cannot tell, it says
|
|
9
|
+
* nothing, and the server - which refuses the change below the plan anyway
|
|
10
|
+
* - has the last word.
|
|
11
|
+
*/
|
|
12
|
+
export const getPlanNeededToChangeColumn = (model, column) => {
|
|
13
|
+
const currentPlan = ProjectUtil.getCurrentPlan();
|
|
14
|
+
if (!currentPlan) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const billing = model.getColumnBillingAccessControl(column);
|
|
18
|
+
if (!billing || !billing.update) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(billing.update, currentPlan, getAllEnvVars())
|
|
23
|
+
? null
|
|
24
|
+
: billing.update;
|
|
25
|
+
}
|
|
26
|
+
catch (_a) {
|
|
27
|
+
// A plan this dashboard cannot read is no reason to say anything.
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/*
|
|
32
|
+
* What a boolean column holds when nothing was ever written to it: the
|
|
33
|
+
* default its model declares, or false when it declares none (a nullable
|
|
34
|
+
* column the server leaves empty reads as off everywhere else, too).
|
|
35
|
+
*/
|
|
36
|
+
export const getColumnBooleanDefault = (model, column) => {
|
|
37
|
+
let metadata;
|
|
38
|
+
try {
|
|
39
|
+
metadata = model.getTableColumnMetadata(column);
|
|
40
|
+
}
|
|
41
|
+
catch (_a) {
|
|
42
|
+
metadata = undefined;
|
|
43
|
+
}
|
|
44
|
+
return (metadata === null || metadata === void 0 ? void 0 : metadata.defaultValue) === true;
|
|
45
|
+
};
|
|
46
|
+
/*
|
|
47
|
+
* Whether the switch is on for what the column holds. An inverted switch is
|
|
48
|
+
* on while its column is false: a column that stores what to turn off
|
|
49
|
+
* ("Disable Monitoring", "Do not add global probes") behind a switch that
|
|
50
|
+
* reads on = happening. Nothing stored reads as the column's default.
|
|
51
|
+
*/
|
|
52
|
+
export const isModelSwitchOn = (data) => {
|
|
53
|
+
const value = typeof data.stored === "boolean" ? data.stored : data.defaultValue;
|
|
54
|
+
return data.isInverted ? !value : value;
|
|
55
|
+
};
|
|
56
|
+
// What the column stores for a switch that is on or off.
|
|
57
|
+
export const getStoredValueForSwitch = (data) => {
|
|
58
|
+
return data.isInverted ? !data.isOn : data.isOn;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=ModelSwitchUtil.js.map
|
|
@@ -0,0 +1 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AE,YAAY,MAAK,IAAI,CAAC;AACzC,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAIZ,CAAC,IAIhB,EAAW,EAAE;IACZ,MAAM,KAAK,GACT,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;IAErE,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEF,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAGpB,CAAC,IAGhB,EAAW,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import API from "../../Utils/API/API";
|
|
2
|
+
import ModelAPI from "../../Utils/ModelAPI/ModelAPI";
|
|
3
|
+
import Card from "../Card/Card";
|
|
4
|
+
import ComponentLoader from "../ComponentLoader/ComponentLoader";
|
|
5
|
+
import ErrorMessage from "../ErrorMessage/ErrorMessage";
|
|
6
|
+
import ModelSwitchRow from "./ModelSwitchRow";
|
|
7
|
+
import { getColumnBooleanDefault, isModelSwitchOn, } from "./ModelSwitchUtil";
|
|
8
|
+
import React, { useEffect, useRef, useState, } from "react";
|
|
9
|
+
const ModelSwitchesCard = (props) => {
|
|
10
|
+
const [positions, setPositions] = useState(null);
|
|
11
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
12
|
+
const [error, setError] = useState("");
|
|
13
|
+
/*
|
|
14
|
+
* Bumped by every read: an answer for a read the card has moved on from
|
|
15
|
+
* (another record, a retry) is dropped.
|
|
16
|
+
*/
|
|
17
|
+
const readRef = useRef(0);
|
|
18
|
+
const modelIdString = props.modelId.toString();
|
|
19
|
+
// The columns, as one string, so a new array of the same switches is no change.
|
|
20
|
+
const columnsKey = props.switches
|
|
21
|
+
.map((definition) => {
|
|
22
|
+
return definition.column;
|
|
23
|
+
})
|
|
24
|
+
.join(",");
|
|
25
|
+
const fetchItem = async () => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const read = readRef.current + 1;
|
|
28
|
+
readRef.current = read;
|
|
29
|
+
setIsLoading(true);
|
|
30
|
+
setError("");
|
|
31
|
+
const modelAPI = props.modelAPI || ModelAPI;
|
|
32
|
+
const select = Object.assign({}, (props.select || {}));
|
|
33
|
+
for (const definition of props.switches) {
|
|
34
|
+
select[definition.column] = true;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const item = await modelAPI.getItem({
|
|
38
|
+
modelType: props.modelType,
|
|
39
|
+
id: props.modelId,
|
|
40
|
+
select: select,
|
|
41
|
+
});
|
|
42
|
+
if (read !== readRef.current) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!item) {
|
|
46
|
+
setPositions(null);
|
|
47
|
+
setError("Item not found");
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const model = new props.modelType();
|
|
51
|
+
const readPositions = {};
|
|
52
|
+
for (const definition of props.switches) {
|
|
53
|
+
readPositions[definition.column] = isModelSwitchOn({
|
|
54
|
+
stored: item[definition.column],
|
|
55
|
+
defaultValue: getColumnBooleanDefault(model, definition.column),
|
|
56
|
+
isInverted: definition.isInverted,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
setPositions(readPositions);
|
|
60
|
+
(_a = props.onLoaded) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
|
61
|
+
for (const definition of props.switches) {
|
|
62
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, definition.column, Boolean(readPositions[definition.column]));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
if (read !== readRef.current) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
setPositions(null);
|
|
71
|
+
setError(API.getFriendlyMessage(err));
|
|
72
|
+
}
|
|
73
|
+
setIsLoading(false);
|
|
74
|
+
};
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
void fetchItem();
|
|
77
|
+
return () => {
|
|
78
|
+
readRef.current += 1;
|
|
79
|
+
};
|
|
80
|
+
}, [modelIdString, columnsKey]);
|
|
81
|
+
const getBody = () => {
|
|
82
|
+
if (isLoading) {
|
|
83
|
+
return React.createElement(ComponentLoader, null);
|
|
84
|
+
}
|
|
85
|
+
if (error || !positions) {
|
|
86
|
+
return (React.createElement(ErrorMessage, { message: error || "Item not found", onRefreshClick: () => {
|
|
87
|
+
void fetchItem();
|
|
88
|
+
} }));
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
/*
|
|
92
|
+
* Full-bleed rows, ruled like the card's own header rule, as on the
|
|
93
|
+
* project's Notification Channels card and the status page's "What
|
|
94
|
+
* your status page shows".
|
|
95
|
+
*/
|
|
96
|
+
React.createElement("div", { className: "-mx-5 -mb-6 divide-y divide-gray-200 border-t border-gray-200 md:-mx-6" }, props.switches.map((definition) => {
|
|
97
|
+
return (React.createElement("div", { className: "px-5 py-4 md:px-6",
|
|
98
|
+
/*
|
|
99
|
+
* Keyed on the record too, so a switch read for one record
|
|
100
|
+
* never shows on the next one's card.
|
|
101
|
+
*/
|
|
102
|
+
key: `${modelIdString}-${definition.column}` },
|
|
103
|
+
React.createElement(ModelSwitchRow, { modelType: props.modelType, modelId: props.modelId, column: definition.column, initialValue: Boolean(positions[definition.column]), title: definition.title, getDescription: definition.getDescription, note: definition.note, isInverted: definition.isInverted, getConfirmation: definition.getConfirmation, modelAPI: props.modelAPI, onChange: (isOn) => {
|
|
104
|
+
var _a;
|
|
105
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, definition.column, isOn);
|
|
106
|
+
}, onSaved: (isOn) => {
|
|
107
|
+
var _a;
|
|
108
|
+
(_a = props.onSaved) === null || _a === void 0 ? void 0 : _a.call(props, definition.column, isOn);
|
|
109
|
+
}, dataTestId: definition.dataTestId })));
|
|
110
|
+
})));
|
|
111
|
+
};
|
|
112
|
+
return (React.createElement(Card, { title: props.cardTitle, description: props.cardDescription },
|
|
113
|
+
React.createElement("div", { "data-testid": props.dataTestId }, getBody())));
|
|
114
|
+
};
|
|
115
|
+
export default ModelSwitchesCard;
|
|
116
|
+
//# sourceMappingURL=ModelSwitchesCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelSwitchesCard.js","sourceRoot":"","sources":["../../../../../UI/Components/ModelSwitch/ModelSwitchesCard.tsx"],"names":[],"mappings":"AAGA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,cAA2C,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AA6Ef,MAAM,iBAAiB,GAEH,CAClB,KAAiC,EACnB,EAAE;IAChB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAyB,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE/C;;;OAGG;IACH,MAAM,OAAO,GAA6B,MAAM,CAAS,CAAC,CAAC,CAAC;IAE5D,MAAM,aAAa,GAA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AAU,GACjC,CACE,CACP,CAAC;QACJ,CAAC,CACF,CACG,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,eAAe;QAC9D,4CAAkB,KAAK,CAAC,UAAU,IAAG,OAAO,EAAE,CAAO,CAChD,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
2
|
+
import API from "../../Utils/API/API";
|
|
3
|
+
import ModelAPI from "../../Utils/ModelAPI/ModelAPI";
|
|
4
|
+
import PermissionGate from "../../Utils/PermissionGate";
|
|
5
|
+
import { announceModelSwitchSaved } from "./ModelSwitchEvents";
|
|
6
|
+
import { useCallback, useMemo, useRef, useState, } from "react";
|
|
7
|
+
const useSaveModelSwitch = (data) => {
|
|
8
|
+
// The record a save is out for, if any.
|
|
9
|
+
const [savingFor, setSavingFor] = useState(null);
|
|
10
|
+
const [failure, setFailure] = useState(null);
|
|
11
|
+
// Set at once: two presses before the button locks must not save twice.
|
|
12
|
+
const isSavingRef = useRef(false);
|
|
13
|
+
// The latest call's options, for a save that outlives a render.
|
|
14
|
+
const latestRef = useRef(data);
|
|
15
|
+
latestRef.current = data;
|
|
16
|
+
const modelIdString = data.modelId.toString();
|
|
17
|
+
const model = useMemo(() => {
|
|
18
|
+
return new data.modelType();
|
|
19
|
+
}, [data.modelType]);
|
|
20
|
+
const gate = PermissionGate.checkColumnUpdate(model, data.column);
|
|
21
|
+
const save = useCallback(() => {
|
|
22
|
+
if (isSavingRef.current || !gate.isAllowed) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
isSavingRef.current = true;
|
|
26
|
+
setSavingFor(modelIdString);
|
|
27
|
+
setFailure(null);
|
|
28
|
+
const current = latestRef.current;
|
|
29
|
+
const modelId = new ObjectID(modelIdString);
|
|
30
|
+
const modelAPI = current.modelAPI || ModelAPI;
|
|
31
|
+
const run = async () => {
|
|
32
|
+
var _a;
|
|
33
|
+
try {
|
|
34
|
+
await modelAPI.updateById({
|
|
35
|
+
modelType: current.modelType,
|
|
36
|
+
id: modelId,
|
|
37
|
+
data: {
|
|
38
|
+
[current.column]: current.value,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
announceModelSwitchSaved({
|
|
42
|
+
modelType: current.modelType,
|
|
43
|
+
modelId: modelId,
|
|
44
|
+
column: current.column,
|
|
45
|
+
value: current.value,
|
|
46
|
+
});
|
|
47
|
+
(_a = current.onSaved) === null || _a === void 0 ? void 0 : _a.call(current);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
setFailure({
|
|
51
|
+
modelId: modelIdString,
|
|
52
|
+
message: API.getFriendlyMessage(err),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
isSavingRef.current = false;
|
|
56
|
+
setSavingFor(null);
|
|
57
|
+
};
|
|
58
|
+
void run();
|
|
59
|
+
}, [modelIdString, gate.isAllowed]);
|
|
60
|
+
return {
|
|
61
|
+
gate,
|
|
62
|
+
isSaving: savingFor === modelIdString,
|
|
63
|
+
error: (failure === null || failure === void 0 ? void 0 : failure.modelId) === modelIdString ? failure.message : "",
|
|
64
|
+
save,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export default useSaveModelSwitch;
|
|
68
|
+
//# sourceMappingURL=useSaveModelSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveModelSwitch.js","sourceRoot":"","sources":["../../../../../UI/Components/ModelSwitch/useSaveModelSwitch.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,cAEN,MAAM,4BAA4B,CAAC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3202,7 @@ const BaseModelTable = (props) => {
|
|
|
3202
3202
|
modelIdToEdit: modalType === ModalType.Edit && currentEditableItem
|
|
3203
3203
|
? new ObjectID(currentEditableItem["_id"])
|
|
3204
3204
|
: undefined,
|
|
3205
|
+
existingItems: modalType === ModalType.Create ? data : undefined,
|
|
3205
3206
|
})) : (React.createElement(React.Fragment, null)),
|
|
3206
3207
|
showDeleteConfirmModal && (React.createElement(ConfirmModal, { title: (deleteConfirmation === null || deleteConfirmation === void 0 ? void 0 : deleteConfirmation.title) ||
|
|
3207
3208
|
translateNamedAction(translator, {
|