@oneuptime/common 14.0.10 → 14.0.11

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.
Files changed (837) hide show
  1. package/Models/DatabaseModels/AIConversation.ts +127 -1
  2. package/Models/DatabaseModels/CephCluster.ts +12 -0
  3. package/Models/DatabaseModels/CloudResource.ts +12 -0
  4. package/Models/DatabaseModels/DatabaseServer.ts +12 -0
  5. package/Models/DatabaseModels/DockerHost.ts +12 -0
  6. package/Models/DatabaseModels/DockerSwarmCluster.ts +12 -0
  7. package/Models/DatabaseModels/GlobalOidc.ts +0 -4
  8. package/Models/DatabaseModels/GlobalOidcProject.ts +0 -4
  9. package/Models/DatabaseModels/GlobalSso.ts +0 -4
  10. package/Models/DatabaseModels/GlobalSsoProject.ts +0 -4
  11. package/Models/DatabaseModels/Host.ts +12 -0
  12. package/Models/DatabaseModels/IncidentForm.ts +594 -0
  13. package/Models/DatabaseModels/IncidentFormSubmission.ts +283 -0
  14. package/Models/DatabaseModels/IncidentTemplate.ts +59 -0
  15. package/Models/DatabaseModels/Index.ts +14 -0
  16. package/Models/DatabaseModels/IoTFleet.ts +12 -0
  17. package/Models/DatabaseModels/KubernetesCluster.ts +12 -0
  18. package/Models/DatabaseModels/MessageQueue.ts +1102 -0
  19. package/Models/DatabaseModels/MessageQueueLabelRule.ts +553 -0
  20. package/Models/DatabaseModels/MessageQueueOwnerRule.ts +633 -0
  21. package/Models/DatabaseModels/MessageQueueOwnerTeam.ts +491 -0
  22. package/Models/DatabaseModels/MessageQueueOwnerUser.ts +490 -0
  23. package/Models/DatabaseModels/PodmanHost.ts +12 -0
  24. package/Models/DatabaseModels/Project.ts +59 -0
  25. package/Models/DatabaseModels/ProjectOidc.ts +0 -4
  26. package/Models/DatabaseModels/ProjectSso.ts +0 -4
  27. package/Models/DatabaseModels/ProxmoxCluster.ts +12 -0
  28. package/Models/DatabaseModels/RumApplication.ts +12 -0
  29. package/Models/DatabaseModels/ServerlessFunction.ts +12 -0
  30. package/Models/DatabaseModels/Service.ts +12 -0
  31. package/Models/DatabaseModels/StatusPageOidc.ts +0 -4
  32. package/Models/DatabaseModels/StatusPageSso.ts +0 -4
  33. package/Models/DatabaseModels/TeamComplianceSetting.ts +47 -2
  34. package/Models/DatabaseModels/VMwareVCenter.ts +12 -0
  35. package/Server/API/AIChatAPI.ts +13 -114
  36. package/Server/API/AIInvestigationAPI.ts +3 -3
  37. package/Server/API/AIInvestigationConversationAPI.ts +266 -0
  38. package/Server/API/IncidentFormAPI.ts +376 -0
  39. package/Server/API/ProjectOIDC.ts +16 -25
  40. package/Server/API/ProjectSSO.ts +16 -24
  41. package/Server/API/StatusPageAPI.ts +42 -77
  42. package/Server/Enterprise/EnterpriseEdition.ts +93 -28
  43. package/Server/Enterprise/EnterpriseFeature.ts +25 -3
  44. package/Server/Enterprise/EnterpriseLicenseSnapshot.ts +1 -1
  45. package/Server/Enterprise/EnterpriseServerModule.ts +4 -1
  46. package/Server/EnvironmentConfig.ts +1 -1
  47. package/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.ts +129 -0
  48. package/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.ts +52 -0
  49. package/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.ts +75 -0
  50. package/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.ts +477 -0
  51. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
  52. package/Server/Middleware/IncidentFormRateLimit.ts +847 -0
  53. package/Server/Middleware/UserAuthorization.ts +16 -38
  54. package/Server/Services/AIService.ts +10 -13
  55. package/Server/Services/IncidentCustomFieldService.ts +112 -2
  56. package/Server/Services/IncidentEpisodeMemberService.ts +24 -4
  57. package/Server/Services/IncidentEpisodeService.ts +10 -1
  58. package/Server/Services/IncidentFormService.ts +1566 -0
  59. package/Server/Services/IncidentFormSubmissionService.ts +97 -0
  60. package/Server/Services/IncidentGroupingEngineService.ts +45 -8
  61. package/Server/Services/IncidentService.ts +123 -5
  62. package/Server/Services/IncidentTemplateService.ts +22 -0
  63. package/Server/Services/Index.ts +14 -0
  64. package/Server/Services/MessageQueueLabelRuleEngineService.ts +321 -0
  65. package/Server/Services/MessageQueueLabelRuleService.ts +14 -0
  66. package/Server/Services/MessageQueueOwnerRuleEngineService.ts +412 -0
  67. package/Server/Services/MessageQueueOwnerRuleService.ts +14 -0
  68. package/Server/Services/MessageQueueOwnerTeamService.ts +62 -0
  69. package/Server/Services/MessageQueueOwnerUserService.ts +62 -0
  70. package/Server/Services/MessageQueueService.ts +1463 -0
  71. package/Server/Services/OpenTelemetryIngestService.ts +37 -4
  72. package/Server/Services/ProjectService.ts +0 -59
  73. package/Server/Services/StatusPagePrivateUserService.ts +1 -4
  74. package/Server/Services/StatusPageService.ts +1 -51
  75. package/Server/Services/TeamComplianceSettingService.ts +163 -42
  76. package/Server/Services/UserNotificationRuleService.ts +8 -1
  77. package/Server/Services/WorkspaceNotificationSummaryService.ts +12 -3
  78. package/Server/Types/Database/Permissions/CreatePermission.ts +17 -3
  79. package/Server/Types/Database/Permissions/EditionPermission.ts +140 -38
  80. package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +16 -0
  81. package/Server/Types/Database/Permissions/TablePermission.ts +3 -3
  82. package/Server/Types/Database/Permissions/UpdatePermission.ts +20 -6
  83. package/Server/Utils/AI/Chat/AgentContextCompactor.ts +200 -0
  84. package/Server/Utils/AI/Chat/ChatAgentRunner.ts +307 -48
  85. package/Server/Utils/AI/Chat/ChatRunCancellation.ts +156 -0
  86. package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +78 -18
  87. package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +1 -1
  88. package/Server/Utils/AI/Chat/ToolOutputPager.ts +322 -0
  89. package/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.ts +88 -30
  90. package/Server/Utils/AI/ClusterAccess/KubectlJobRunner.ts +13 -1
  91. package/Server/Utils/AI/CodeFix/CodeFixReadiness.ts +0 -32
  92. package/Server/Utils/AI/CodeFix/FixRunBudget.ts +27 -25
  93. package/Server/Utils/AI/Remediation/RemediationCommandTools.ts +7 -1
  94. package/Server/Utils/AI/Remediation/RemediationExecutionRunner.ts +34 -14
  95. package/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.ts +69 -24
  96. package/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.ts +9 -0
  97. package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +53 -10
  98. package/Server/Utils/AI/SRE/AlertInvestigationRunner.ts +27 -10
  99. package/Server/Utils/AI/SRE/IncidentInvestigationRunner.ts +27 -10
  100. package/Server/Utils/AI/SRE/InvestigationQueue.ts +16 -19
  101. package/Server/Utils/AI/SRE/InvestigationThread.ts +646 -0
  102. package/Server/Utils/AI/SRE/InvestigationThreadService.ts +715 -0
  103. package/Server/Utils/AI/Toolbox/Serializer.ts +10 -3
  104. package/Server/Utils/EditionEnforcement.ts +19 -202
  105. package/Server/Utils/LLM/LLMService.ts +259 -63
  106. package/Server/Utils/RelaxedScimTeamLocksReport.ts +245 -0
  107. package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
  108. package/Server/Utils/SameOriginRequest.ts +203 -0
  109. package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
  110. package/Server/Utils/Telemetry/EntityRegistry.ts +4 -1
  111. package/Server/Utils/Telemetry/MessageQueueDiscovery.ts +1402 -0
  112. package/Server/Utils/Telemetry/ResourceEntityFilter.ts +4 -1
  113. package/Server/Utils/VendorAssets.ts +3 -3
  114. package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +3 -1
  115. package/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.ts +3 -1
  116. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +10 -1
  117. package/Tests/App/Accounts/IncidentFormPage.test.tsx +2036 -0
  118. package/Tests/App/Accounts/IncidentFormServerMessages.test.ts +119 -0
  119. package/Tests/App/Accounts/IncidentFormUtils.test.ts +1157 -0
  120. package/Tests/App/Accounts/LoginPasskey.test.tsx +6 -4
  121. package/Tests/App/Accounts/LoginSso.test.tsx +724 -0
  122. package/Tests/App/AdminDashboard/AdminAuthenticationRequireSso.test.tsx +338 -0
  123. package/Tests/App/AdminDashboard/AdminAuthenticationSsoCardLocales.test.tsx +331 -0
  124. package/Tests/App/AdminDashboard/AdminEnterprisePluginPage.test.tsx +47 -33
  125. package/Tests/App/AdminDashboard/GlobalSsoOidcPages.test.tsx +1021 -0
  126. package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +876 -78
  127. package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +20 -3
  128. package/Tests/App/Dashboard/CephProxmoxVMwareDocumentationCards.test.tsx +359 -0
  129. package/Tests/App/Dashboard/CephSetupGuide.test.ts +961 -0
  130. package/Tests/App/Dashboard/CloudDocumentationCard.test.tsx +381 -95
  131. package/Tests/App/Dashboard/CloudSetupGuide.test.ts +1463 -0
  132. package/Tests/App/Dashboard/ClusterAccessNotice.test.tsx +174 -12
  133. package/Tests/App/Dashboard/ContainerSetupGuideCards.test.tsx +345 -0
  134. package/Tests/App/Dashboard/CoreListEmptyStates.test.tsx +501 -0
  135. package/Tests/App/Dashboard/DashboardLazyPages.test.tsx +0 -1
  136. package/Tests/App/Dashboard/DatabaseDocumentationCard.test.tsx +400 -0
  137. package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +5 -0
  138. package/Tests/App/Dashboard/DatabaseSetupGuide.test.ts +1869 -0
  139. package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +44 -0
  140. package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +50 -9
  141. package/Tests/App/Dashboard/DockerSetupGuide.test.ts +899 -0
  142. package/Tests/App/Dashboard/DockerSwarmSetupGuide.test.ts +964 -0
  143. package/Tests/App/Dashboard/EnterpriseFeatureUpgrade.test.tsx +141 -7
  144. package/Tests/App/Dashboard/EnterprisePluginPage.test.tsx +52 -39
  145. package/Tests/App/Dashboard/EventOverviewPages.test.tsx +7 -1
  146. package/Tests/App/Dashboard/GettingStartedTaskRoutes.test.tsx +331 -0
  147. package/Tests/App/Dashboard/HomeOverviewStatsFirstRun.test.tsx +925 -0
  148. package/Tests/App/Dashboard/HostDocumentationCard.test.tsx +225 -0
  149. package/Tests/App/Dashboard/HostSetupGuide.test.ts +1183 -0
  150. package/Tests/App/Dashboard/IdentityEnterpriseShells.test.tsx +69 -45
  151. package/Tests/App/Dashboard/IncidentCreateTemplateCustomFieldSettings.test.tsx +745 -0
  152. package/Tests/App/Dashboard/IncidentCreateTemplateOwners.test.tsx +414 -0
  153. package/Tests/App/Dashboard/IncidentCustomFieldCreateSettingsForm.test.ts +1042 -0
  154. package/Tests/App/Dashboard/IncidentCustomFieldSettingsCard.test.tsx +1816 -0
  155. package/Tests/App/Dashboard/IncidentFormPlan.test.ts +89 -0
  156. package/Tests/App/Dashboard/IncidentFormShareLinkCard.test.tsx +846 -0
  157. package/Tests/App/Dashboard/IncidentFormsPages.test.tsx +1324 -0
  158. package/Tests/App/Dashboard/IncidentTemplateCustomFieldSettings.test.tsx +630 -0
  159. package/Tests/App/Dashboard/IncidentsSideMenu.test.tsx +13 -0
  160. package/Tests/App/Dashboard/IncomingEmailMonitorLinkVerifyHint.test.tsx +104 -0
  161. package/Tests/App/Dashboard/InvestigationConversation.test.tsx +1107 -0
  162. package/Tests/App/Dashboard/InvestigationConversationData.test.ts +546 -0
  163. package/Tests/App/Dashboard/InvestigationEvidenceList.test.tsx +170 -5
  164. package/Tests/App/Dashboard/InvestigationNotStarted.test.tsx +207 -2
  165. package/Tests/App/Dashboard/InvestigationPanel.test.tsx +729 -34
  166. package/Tests/App/Dashboard/InvestigationPanelStatus.test.tsx +9 -21
  167. package/Tests/App/Dashboard/InvestigationReportView.test.tsx +274 -37
  168. package/Tests/App/Dashboard/InvestigationStatusBadge.test.tsx +130 -0
  169. package/Tests/App/Dashboard/IoTDocumentationCard.test.tsx +218 -0
  170. package/Tests/App/Dashboard/IoTSetupGuide.test.ts +1124 -0
  171. package/Tests/App/Dashboard/KubernetesClusterAiAccessSettings.test.ts +20 -6
  172. package/Tests/App/Dashboard/KubernetesClusterAiDocumentationMarkdown.test.ts +107 -83
  173. package/Tests/App/Dashboard/KubernetesSetupGuide.test.ts +787 -0
  174. package/Tests/App/Dashboard/MessageQueueBreadcrumbs.test.tsx +228 -0
  175. package/Tests/App/Dashboard/MessageQueueBrokerHealth.test.tsx +1538 -0
  176. package/Tests/App/Dashboard/MessageQueueBrokerHealthMetricChart.test.tsx +969 -0
  177. package/Tests/App/Dashboard/MessageQueueBrokerHealthReads.test.ts +889 -0
  178. package/Tests/App/Dashboard/MessageQueueBrokerMetricsReach.test.ts +236 -0
  179. package/Tests/App/Dashboard/MessageQueueDocumentationCard.test.tsx +479 -0
  180. package/Tests/App/Dashboard/MessageQueueListPages.test.tsx +1232 -0
  181. package/Tests/App/Dashboard/MessageQueueMetricDescriptions.test.ts +244 -0
  182. package/Tests/App/Dashboard/MessageQueueMonitorLink.test.ts +952 -0
  183. package/Tests/App/Dashboard/MessageQueueMonitorLinkMonitorCreate.test.tsx +859 -0
  184. package/Tests/App/Dashboard/MessageQueueOverview.test.tsx +1773 -0
  185. package/Tests/App/Dashboard/MessageQueueOverviewPresentation.test.ts +196 -0
  186. package/Tests/App/Dashboard/MessageQueuePresentation.test.ts +799 -0
  187. package/Tests/App/Dashboard/MessageQueueProducersConsumers.test.tsx +680 -0
  188. package/Tests/App/Dashboard/MessageQueueRoutes.test.tsx +383 -0
  189. package/Tests/App/Dashboard/MessageQueueRulePages.test.tsx +278 -0
  190. package/Tests/App/Dashboard/MessageQueueSetupGuide.test.ts +2778 -0
  191. package/Tests/App/Dashboard/MessageQueueSideMenus.test.tsx +273 -0
  192. package/Tests/App/Dashboard/MessageQueueSpanPopulations.test.ts +930 -0
  193. package/Tests/App/Dashboard/MessageQueueSpanStore.ts +351 -0
  194. package/Tests/App/Dashboard/MessageQueueTelemetryScope.test.ts +375 -0
  195. package/Tests/App/Dashboard/MessageQueueTelemetryScopeTabs.test.tsx +668 -0
  196. package/Tests/App/Dashboard/MessageQueueViewPages.test.tsx +685 -0
  197. package/Tests/App/Dashboard/MonitorAndHomeNotOperationalMenus.test.tsx +342 -0
  198. package/Tests/App/Dashboard/MonitorCreateFirstRunDefaults.test.tsx +623 -0
  199. package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +442 -0
  200. package/Tests/App/Dashboard/MonitorLogsPageViewSummary.test.tsx +814 -0
  201. package/Tests/App/Dashboard/MonitorSetupCardBodies.test.tsx +246 -0
  202. package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +8 -0
  203. package/Tests/App/Dashboard/OnboardingSsoEmptyState.test.tsx +27 -12
  204. package/Tests/App/Dashboard/PlanGatedPage.test.tsx +292 -0
  205. package/Tests/App/Dashboard/PodmanSetupGuide.test.ts +948 -0
  206. package/Tests/App/Dashboard/ProductOrientation.test.tsx +5 -4
  207. package/Tests/App/Dashboard/ProductSettingsSectionCollapsed.test.tsx +266 -0
  208. package/Tests/App/Dashboard/ProxmoxSetupGuide.test.ts +1318 -0
  209. package/Tests/App/Dashboard/ResourceAiAgentAttentionServerParity.test.ts +555 -0
  210. package/Tests/App/Dashboard/ResourceAiAgentPage.test.tsx +298 -9
  211. package/Tests/App/Dashboard/ResourceAiAgentStatus.test.ts +453 -0
  212. package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +16 -0
  213. package/Tests/App/Dashboard/ResourceConnectionGuideCard.test.tsx +444 -0
  214. package/Tests/App/Dashboard/ResourceConnectionGuideOverviewsInfra.test.tsx +798 -0
  215. package/Tests/App/Dashboard/ResourceConnectionGuideOverviewsPlatforms.test.tsx +717 -0
  216. package/Tests/App/Dashboard/ResourceConnectionGuides.test.ts +981 -0
  217. package/Tests/App/Dashboard/ResourceConnectionState.test.ts +132 -0
  218. package/Tests/App/Dashboard/RumDocumentationCard.test.tsx +293 -0
  219. package/Tests/App/Dashboard/RumSessionReplayRetentionSettings.test.tsx +467 -0
  220. package/Tests/App/Dashboard/RumSetupGuide.test.ts +758 -0
  221. package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +25 -0
  222. package/Tests/App/Dashboard/ServerlessDocumentationCard.test.tsx +254 -0
  223. package/Tests/App/Dashboard/ServerlessSetupGuide.test.ts +1074 -0
  224. package/Tests/App/Dashboard/SetupGuide.test.ts +246 -0
  225. package/Tests/App/Dashboard/SetupGuideCard.test.tsx +756 -0
  226. package/Tests/App/Dashboard/SloListSideMenu.test.tsx +120 -0
  227. package/Tests/App/Dashboard/SsoPages.test.tsx +833 -0
  228. package/Tests/App/Dashboard/TelemetryDocumentation.test.tsx +253 -0
  229. package/Tests/App/Dashboard/TelemetryRetentionShells.test.tsx +730 -0
  230. package/Tests/App/Dashboard/VMwareSetupGuide.test.ts +1033 -0
  231. package/Tests/App/StatusPage/StatusPageSsoEmptyState.test.tsx +87 -7
  232. package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +28 -9
  233. package/Tests/Models/DatabaseModels/IncidentFormModel.test.ts +1250 -0
  234. package/Tests/Models/DatabaseModels/MessageQueueModels.test.ts +1983 -0
  235. package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
  236. package/Tests/Models/DatabaseModels/TeamComplianceSettingModel.test.ts +190 -14
  237. package/Tests/Models/IncidentTemplateCustomFieldSettingsColumn.test.ts +291 -0
  238. package/Tests/Server/API/AIInvestigationConversationAPI.test.ts +412 -0
  239. package/Tests/Server/API/GlobalConfigLicense.test.ts +38 -9
  240. package/Tests/Server/API/IncidentFormAPI.test.ts +942 -0
  241. package/Tests/Server/API/IncidentFormPublicRoutes.test.ts +1653 -0
  242. package/Tests/Server/API/KubernetesClusterAiAccessAPI.test.ts +2 -1
  243. package/Tests/Server/API/{SsoProviderListingsEdition.test.ts → SsoProviderListings.test.ts} +164 -110
  244. package/Tests/Server/Enterprise/EnterpriseEdition.test.ts +76 -54
  245. package/Tests/Server/Enterprise/EnterpriseFeatureActive.test.ts +125 -42
  246. package/Tests/Server/Enterprise/EnterpriseLicenseSnapshot.test.ts +36 -10
  247. package/Tests/Server/Enterprise/EnterpriseModelFeatureMap.test.ts +51 -9
  248. package/Tests/Server/Enterprise/FakeEnterpriseModule.ts +13 -8
  249. package/Tests/Server/Enterprise/SsoInCommunityEdition.test.ts +540 -0
  250. package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
  251. package/Tests/Server/Infrastructure/Postgres/AddIncidentFormsMigration.test.ts +438 -0
  252. package/Tests/Server/Infrastructure/Postgres/AddTeamComplianceRuleNotificationChannelsMigration.test.ts +255 -0
  253. package/Tests/Server/Infrastructure/Postgres/MessageQueueTablesMigration.test.ts +637 -0
  254. package/Tests/Server/Middleware/IncidentFormRateLimit.test.ts +1630 -0
  255. package/Tests/Server/Middleware/UserAuthorization.test.ts +16 -17
  256. package/Tests/Server/Middleware/UserAuthorizationSsoEnforcement.test.ts +544 -0
  257. package/Tests/Server/Services/AIServiceDailyBudget.test.ts +37 -8
  258. package/Tests/Server/Services/IncidentCreatedFeedTitle.test.ts +212 -0
  259. package/Tests/Server/Services/IncidentCustomFieldDeleteFormQuestions.test.ts +297 -0
  260. package/Tests/Server/Services/IncidentFormOwnersCreatedNotification.test.ts +497 -0
  261. package/Tests/Server/Services/IncidentFormPostgres.test.ts +958 -0
  262. package/Tests/Server/Services/IncidentFormPublicForm.test.ts +1260 -0
  263. package/Tests/Server/Services/IncidentFormPublicSubmission.test.ts +2520 -0
  264. package/Tests/Server/Services/IncidentFormRegistration.test.ts +159 -0
  265. package/Tests/Server/Services/IncidentFormService.test.ts +663 -0
  266. package/Tests/Server/Services/IncidentFormSubmissionService.test.ts +430 -0
  267. package/Tests/Server/Services/IncidentFormSubmissionTemplateBranch.test.ts +473 -0
  268. package/Tests/Server/Services/IncidentGroupingTemplateSubstitution.test.ts +81 -0
  269. package/Tests/Server/Services/IncidentTemplateCustomFieldSettings.test.ts +262 -0
  270. package/Tests/Server/Services/IncidentTemplateOwnersOnDeclare.test.ts +566 -0
  271. package/Tests/Server/Services/IncidentTitleMarkdownSinks.test.ts +640 -0
  272. package/Tests/Server/Services/LlmLogServiceTokenAggregateParams.test.ts +3 -3
  273. package/Tests/Server/Services/MessageQueueOwnerServices.test.ts +440 -0
  274. package/Tests/Server/Services/MessageQueueRegistries.test.ts +577 -0
  275. package/Tests/Server/Services/MessageQueueRuleEngines.test.ts +900 -0
  276. package/Tests/Server/Services/MessageQueueService.test.ts +2210 -0
  277. package/Tests/Server/Services/MessageQueueSqlPostgres.test.ts +1271 -0
  278. package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +28 -1
  279. package/Tests/Server/Services/OpenTelemetryRetentionOverrideEdition.test.ts +474 -0
  280. package/Tests/Server/Services/OpenTelemetryServiceResolutionCache.test.ts +21 -0
  281. package/Tests/Server/Services/OwnerRowUniqueness.test.ts +3 -0
  282. package/Tests/Server/Services/ProjectServiceAuditLogLicense.test.ts +0 -1
  283. package/Tests/Server/Services/RuleRun/LabelRuleEnginesGroupBRun.test.ts +56 -6
  284. package/Tests/Server/Services/RuleRun/OwnerRuleEnginesGroupBRun.test.ts +30 -1
  285. package/Tests/Server/Services/SsoRequirementReads.test.ts +454 -0
  286. package/Tests/Server/Services/SsoRequirementWrites.test.ts +529 -0
  287. package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
  288. package/Tests/Server/Services/StatusPagePrivateUserInvitationPolicy.test.ts +107 -89
  289. package/Tests/Server/Services/TeamComplianceSettingPostgres.test.ts +1068 -176
  290. package/Tests/Server/Services/TeamComplianceSettingService.test.ts +1962 -200
  291. package/Tests/Server/Types/Database/Permissions/EditionPermission.test.ts +654 -297
  292. package/Tests/Server/Types/Database/Permissions/RetentionOverrideColumns.test.ts +784 -0
  293. package/Tests/Server/Types/Database/Permissions/SsoScalePlanGate.test.ts +418 -0
  294. package/Tests/Server/Utils/AI/AIAlertGating.test.ts +0 -1
  295. package/Tests/Server/Utils/AI/AIInvestigationEngineRunLimits.test.ts +136 -0
  296. package/Tests/Server/Utils/AI/AIInvestigationQueue.test.ts +15 -14
  297. package/Tests/Server/Utils/AI/AgentContextCompactor.test.ts +351 -0
  298. package/Tests/Server/Utils/AI/ChatAgentRunnerSharedThread.test.ts +842 -0
  299. package/Tests/Server/Utils/AI/ChatRunCancellation.test.ts +195 -0
  300. package/Tests/Server/Utils/AI/CodeFixReadiness.test.ts +10 -57
  301. package/Tests/Server/Utils/AI/FixRunBudget.test.ts +20 -24
  302. package/Tests/Server/Utils/AI/Insights/InvestigationQueueInsightSubject.test.ts +7 -30
  303. package/Tests/Server/Utils/AI/InvestigationClusterAccessWiring.test.ts +225 -29
  304. package/Tests/Server/Utils/AI/InvestigationInfrastructureAccessWiring.test.ts +266 -25
  305. package/Tests/Server/Utils/AI/InvestigationThread.test.ts +580 -0
  306. package/Tests/Server/Utils/AI/InvestigationThreadService.test.ts +801 -0
  307. package/Tests/Server/Utils/AI/KubectlInvestigationToolkit.test.ts +525 -43
  308. package/Tests/Server/Utils/AI/KubectlJobRunner.test.ts +4 -2
  309. package/Tests/Server/Utils/AI/LLMServiceUnreachableProvider.test.ts +435 -0
  310. package/Tests/Server/Utils/AI/ObservabilityAssistantLimits.test.ts +462 -0
  311. package/Tests/Server/Utils/AI/RemediationExecutionRunner.test.ts +14 -25
  312. package/Tests/Server/Utils/AI/RemediationExecutionRunnerResourceMode.test.ts +2 -0
  313. package/Tests/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.test.ts +297 -15
  314. package/Tests/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.test.ts +10 -6
  315. package/Tests/Server/Utils/AI/ToolOutputPager.test.ts +382 -0
  316. package/Tests/Server/Utils/AI/ToolResultSerializer.test.ts +23 -4
  317. package/Tests/Server/Utils/AI/Toolbox/LogTools.test.ts +25 -6
  318. package/Tests/Server/Utils/AI/Toolbox/Serializer.test.ts +14 -3
  319. package/Tests/Server/Utils/EditionEnforcement.test.ts +107 -147
  320. package/Tests/Server/Utils/{CommunityEditionSsoReport.test.ts → RelaxedScimTeamLocksReport.test.ts} +212 -208
  321. package/Tests/Server/Utils/SameOriginRequest.test.ts +372 -0
  322. package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +20 -0
  323. package/Tests/Server/Utils/Telemetry/MessageQueueDiscovery.test.ts +2590 -0
  324. package/Tests/Server/Utils/Telemetry/MessageQueueSpanQueryTwin.ts +246 -0
  325. package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +23 -0
  326. package/Tests/Types/AI/AIAgentRunLimits.test.ts +255 -0
  327. package/Tests/Types/Code/JsonSyntax.test.ts +1300 -0
  328. package/Tests/Types/CustomField/CustomFieldCreateSettings.test.ts +1113 -0
  329. package/Tests/Types/CustomField/CustomFieldMappingCatalog.test.ts +91 -0
  330. package/Tests/Types/CustomField/CustomFieldValueValidator.test.ts +30 -0
  331. package/Tests/Types/Incident/IncidentFormIpAllowlist.test.ts +227 -0
  332. package/Tests/Types/Incident/IncidentFormPublic.test.ts +1916 -0
  333. package/Tests/Types/MessageQueue/MessageQueueEntityKey.test.ts +916 -0
  334. package/Tests/Types/MessageQueue/MessageQueueIdentity.test.ts +567 -0
  335. package/Tests/Types/MessageQueue/MessageQueueManualIdentity.test.ts +686 -0
  336. package/Tests/Types/MessageQueue/MessageQueueMetricCatalog.test.ts +1726 -0
  337. package/Tests/Types/MessageQueue/MessageQueueMetricResolution.test.ts +1758 -0
  338. package/Tests/Types/MessageQueue/MessagingInstrumentationFixtures.test.ts +4686 -0
  339. package/Tests/Types/MessageQueue/MessagingSystem.test.ts +840 -0
  340. package/Tests/Types/MessageQueue/MessagingTelemetryFixtures.ts +3287 -0
  341. package/Tests/Types/MessageQueue/MessagingTelemetryResolver.test.ts +2966 -0
  342. package/Tests/Types/Monitor/MessageQueueAlertTemplates.test.ts +5401 -0
  343. package/Tests/Types/Monitor/MetricEngineFold.ts +154 -0
  344. package/Tests/Types/ResourceAiAgent/ResourceAiAccess.test.ts +5 -3
  345. package/Tests/Types/Team/ComplianceRule.test.ts +588 -37
  346. package/Tests/Types/Team/TeamComplianceStatus.test.ts +64 -11
  347. package/Tests/Types/XML.test.ts +51 -0
  348. package/Tests/UI/Components/CodeEditor/CodeEditor.test.tsx +2362 -0
  349. package/Tests/UI/Components/CodeEditor/CodeEditorCommands.test.ts +810 -0
  350. package/Tests/UI/Components/CodeEditor/CodeEditorHighlight.test.ts +338 -0
  351. package/Tests/UI/Components/CodeEditor/CodeEditorLanguages.test.ts +222 -0
  352. package/Tests/UI/Components/CodeEditor/CodeEditorStyles.test.ts +807 -0
  353. package/Tests/UI/Components/CodeEditor/NoMonaco.test.ts +245 -0
  354. package/Tests/UI/Components/CodeEditor/YamlEditor.test.tsx +729 -0
  355. package/Tests/UI/Components/CopyTextButton.test.tsx +76 -0
  356. package/Tests/UI/Components/EditionLabelLapseCopy.ts +51 -14
  357. package/Tests/UI/Components/EditionLabelLicenseStatus.test.tsx +131 -23
  358. package/Tests/UI/Components/ErrorMessageAction.test.tsx +142 -0
  359. package/Tests/UI/Components/FacetSidebarInScope.test.tsx +459 -0
  360. package/Tests/UI/Components/FacetValuesInScope.test.ts +270 -0
  361. package/Tests/UI/Components/Forms/FormFieldCodeEditors.test.tsx +294 -0
  362. package/Tests/UI/Components/Forms/FormFieldMarkdown.test.tsx +126 -0
  363. package/Tests/UI/Components/Forms/FormFieldYaml.test.tsx +22 -75
  364. package/Tests/UI/Components/Forms/ModelFormOnBeforeCreateMiscData.test.tsx +254 -0
  365. package/Tests/UI/Components/Icon.test.tsx +32 -0
  366. package/Tests/UI/Components/Input.test.tsx +31 -0
  367. package/Tests/UI/Components/LockedFilterChipScope.test.tsx +501 -0
  368. package/Tests/UI/Components/MarkdownConverters.test.ts +253 -1
  369. package/Tests/UI/Components/MarkdownEditor.test.tsx +2785 -2
  370. package/Tests/UI/Components/MarkdownEditorHistory.test.ts +243 -0
  371. package/Tests/UI/Components/MarkdownListEditing.test.ts +1118 -0
  372. package/Tests/UI/Components/MarkdownPaste.test.ts +1180 -0
  373. package/Tests/UI/Components/MarkdownViewerCopy.test.tsx +466 -0
  374. package/Tests/UI/Components/MarkdownVisualEditing.test.ts +1089 -0
  375. package/Tests/UI/Components/ModelTable/BaseModelTableEmptyStateAction.test.tsx +623 -0
  376. package/Tests/UI/Components/ResetObjectID.test.tsx +282 -0
  377. package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
  378. package/Tests/UI/Components/Table/EmptyTableMessage.test.ts +439 -0
  379. package/Tests/UI/Components/Table/TableEmptyState.test.tsx +352 -0
  380. package/Tests/UI/Components/TableRowMobileTitles.test.tsx +78 -0
  381. package/Tests/UI/Components/TextArea.test.tsx +19 -0
  382. package/Tests/UI/Components/Workflow/ModelColumnEditor.render.test.tsx +12 -29
  383. package/Tests/UI/Components/fixtures/MarkdownPasteFixtures.ts +460 -0
  384. package/Tests/UI/EsbuildConfig.test.ts +115 -39
  385. package/Tests/UI/EsbuildEnterpriseAlias.test.ts +4 -4
  386. package/Tests/UI/Monitor/MonitorLogSummaryRender.test.tsx +377 -0
  387. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +81 -1
  388. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +17 -0
  389. package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
  390. package/Tests/Utils/Markdown/DashboardMarkdownRenderer.ts +81 -0
  391. package/Tests/Utils/Markdown/UntrustedMarkdown.test.ts +1339 -0
  392. package/Tests/Utils/Monitor/MonitorLogSummaryUtil.test.ts +862 -0
  393. package/Types/AI/AIAgentRunLimits.ts +146 -0
  394. package/Types/Code/CodeType.ts +2 -0
  395. package/Types/Code/JsonSyntax.ts +923 -0
  396. package/Types/CustomField/CustomFieldCreateSettings.ts +549 -0
  397. package/Types/CustomField/CustomFieldMappingCatalog.ts +77 -0
  398. package/Types/CustomField/CustomFieldValueValidator.ts +10 -7
  399. package/Types/EnterpriseLicense/EnterpriseLicensePeriods.ts +1 -1
  400. package/Types/Icon/IconProp.ts +2 -0
  401. package/Types/Incident/IncidentFormIpAllowlist.ts +206 -0
  402. package/Types/Incident/IncidentFormPublic.ts +1145 -0
  403. package/Types/Kubernetes/KubernetesClusterAiAccess.ts +10 -3
  404. package/Types/MessageQueue/MessageQueueIdentity.ts +256 -0
  405. package/Types/MessageQueue/MessageQueueManualIdentity.ts +325 -0
  406. package/Types/MessageQueue/MessageQueueMetricCatalog.ts +1357 -0
  407. package/Types/MessageQueue/MessagingSystem.ts +518 -0
  408. package/Types/MessageQueue/MessagingTelemetryResolver.ts +2311 -0
  409. package/Types/Monitor/MessageQueueAlertTemplates.ts +2128 -0
  410. package/Types/Permission.ts +310 -0
  411. package/Types/ResourceAiAgent/ResourceAiAccess.ts +10 -4
  412. package/Types/Rules/RuleCriteriaFieldRegistry.ts +12 -0
  413. package/Types/Rules/RuleRun.ts +4 -0
  414. package/Types/Team/ComplianceNotificationChannel.ts +4 -3
  415. package/Types/Team/ComplianceRule.ts +71 -18
  416. package/Types/Team/ComplianceRuleType.ts +2 -2
  417. package/Types/Team/TeamComplianceStatus.ts +6 -2
  418. package/Types/Telemetry/EntityType.ts +16 -0
  419. package/Types/Telemetry/LockedFilterDetail.ts +22 -0
  420. package/Types/XML.ts +26 -0
  421. package/UI/Components/CodeEditor/CodeEditor.css +379 -0
  422. package/UI/Components/CodeEditor/CodeEditor.tsx +1128 -294
  423. package/UI/Components/CodeEditor/CodeEditorCommands.ts +774 -0
  424. package/UI/Components/CodeEditor/CodeEditorHighlight.ts +106 -0
  425. package/UI/Components/CodeEditor/CodeEditorLanguages.ts +164 -0
  426. package/UI/Components/CodeEditor/YamlEditor.tsx +28 -326
  427. package/UI/Components/CopyTextButton/CopyTextButton.tsx +5 -1
  428. package/UI/Components/CustomFields/CustomFieldModelFormFields.tsx +6 -25
  429. package/UI/Components/EditionLabel/EditionLabel.tsx +14 -13
  430. package/UI/Components/ErrorMessage/ErrorMessage.tsx +11 -1
  431. package/UI/Components/Forms/Fields/FormField.tsx +8 -0
  432. package/UI/Components/Forms/Types/Field.ts +8 -0
  433. package/UI/Components/Icon/Icon.tsx +18 -0
  434. package/UI/Components/Input/Input.tsx +11 -4
  435. package/UI/Components/LogsViewer/LogsViewer.tsx +4 -0
  436. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +21 -3
  437. package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
  438. package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +877 -79
  439. package/UI/Components/Markdown.tsx/MarkdownEditorHistory.ts +284 -0
  440. package/UI/Components/Markdown.tsx/MarkdownListEditing.ts +1362 -0
  441. package/UI/Components/Markdown.tsx/MarkdownPaste.ts +1326 -0
  442. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +106 -10
  443. package/UI/Components/Markdown.tsx/MarkdownVisualEditing.ts +1032 -0
  444. package/UI/Components/ModelTable/BaseModelTable.tsx +85 -7
  445. package/UI/Components/ResetObjectID/ResetObjectID.tsx +35 -9
  446. package/UI/Components/Table/EmptyTableMessage.ts +81 -0
  447. package/UI/Components/Table/Table.tsx +50 -21
  448. package/UI/Components/Table/TableRow.tsx +9 -1
  449. package/UI/Components/TelemetryViewer/FacetVisibility.ts +97 -2
  450. package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +13 -0
  451. package/UI/Components/TelemetryViewer/components/LockedFilterChip.tsx +214 -7
  452. package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +21 -3
  453. package/UI/Components/TextArea/TextArea.tsx +9 -2
  454. package/UI/Components/Workflow/ModelFieldPicker.tsx +10 -12
  455. package/UI/Styles/Theme.css +8 -0
  456. package/UI/esbuild-config.js +2 -32
  457. package/Utils/LabelRuleImportExport.ts +2 -0
  458. package/Utils/Markdown/UntrustedMarkdown.ts +1513 -0
  459. package/Utils/Monitor/IncomingEmailMonitorRequestUtil.ts +41 -0
  460. package/Utils/Monitor/MonitorLogSummaryUtil.ts +212 -0
  461. package/Utils/Telemetry/EntityKey.ts +48 -0
  462. package/build/dist/Models/DatabaseModels/AIConversation.js +125 -1
  463. package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
  464. package/build/dist/Models/DatabaseModels/CephCluster.js +12 -0
  465. package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -1
  466. package/build/dist/Models/DatabaseModels/CloudResource.js +12 -0
  467. package/build/dist/Models/DatabaseModels/CloudResource.js.map +1 -1
  468. package/build/dist/Models/DatabaseModels/DatabaseServer.js +12 -0
  469. package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -1
  470. package/build/dist/Models/DatabaseModels/DockerHost.js +12 -0
  471. package/build/dist/Models/DatabaseModels/DockerHost.js.map +1 -1
  472. package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js +12 -0
  473. package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js.map +1 -1
  474. package/build/dist/Models/DatabaseModels/GlobalOidc.js +0 -4
  475. package/build/dist/Models/DatabaseModels/GlobalOidc.js.map +1 -1
  476. package/build/dist/Models/DatabaseModels/GlobalOidcProject.js +0 -4
  477. package/build/dist/Models/DatabaseModels/GlobalOidcProject.js.map +1 -1
  478. package/build/dist/Models/DatabaseModels/GlobalSso.js +0 -4
  479. package/build/dist/Models/DatabaseModels/GlobalSso.js.map +1 -1
  480. package/build/dist/Models/DatabaseModels/GlobalSsoProject.js +0 -4
  481. package/build/dist/Models/DatabaseModels/GlobalSsoProject.js.map +1 -1
  482. package/build/dist/Models/DatabaseModels/Host.js +12 -0
  483. package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
  484. package/build/dist/Models/DatabaseModels/IncidentForm.js +605 -0
  485. package/build/dist/Models/DatabaseModels/IncidentForm.js.map +1 -0
  486. package/build/dist/Models/DatabaseModels/IncidentFormSubmission.js +299 -0
  487. package/build/dist/Models/DatabaseModels/IncidentFormSubmission.js.map +1 -0
  488. package/build/dist/Models/DatabaseModels/IncidentTemplate.js +60 -0
  489. package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
  490. package/build/dist/Models/DatabaseModels/Index.js +14 -0
  491. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  492. package/build/dist/Models/DatabaseModels/IoTFleet.js +12 -0
  493. package/build/dist/Models/DatabaseModels/IoTFleet.js.map +1 -1
  494. package/build/dist/Models/DatabaseModels/KubernetesCluster.js +12 -0
  495. package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -1
  496. package/build/dist/Models/DatabaseModels/MessageQueue.js +1106 -0
  497. package/build/dist/Models/DatabaseModels/MessageQueue.js.map +1 -0
  498. package/build/dist/Models/DatabaseModels/MessageQueueLabelRule.js +562 -0
  499. package/build/dist/Models/DatabaseModels/MessageQueueLabelRule.js.map +1 -0
  500. package/build/dist/Models/DatabaseModels/MessageQueueOwnerRule.js +643 -0
  501. package/build/dist/Models/DatabaseModels/MessageQueueOwnerRule.js.map +1 -0
  502. package/build/dist/Models/DatabaseModels/MessageQueueOwnerTeam.js +506 -0
  503. package/build/dist/Models/DatabaseModels/MessageQueueOwnerTeam.js.map +1 -0
  504. package/build/dist/Models/DatabaseModels/MessageQueueOwnerUser.js +505 -0
  505. package/build/dist/Models/DatabaseModels/MessageQueueOwnerUser.js.map +1 -0
  506. package/build/dist/Models/DatabaseModels/PodmanHost.js +12 -0
  507. package/build/dist/Models/DatabaseModels/PodmanHost.js.map +1 -1
  508. package/build/dist/Models/DatabaseModels/Project.js +61 -0
  509. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  510. package/build/dist/Models/DatabaseModels/ProjectOidc.js +0 -4
  511. package/build/dist/Models/DatabaseModels/ProjectOidc.js.map +1 -1
  512. package/build/dist/Models/DatabaseModels/ProjectSso.js +0 -4
  513. package/build/dist/Models/DatabaseModels/ProjectSso.js.map +1 -1
  514. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +12 -0
  515. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -1
  516. package/build/dist/Models/DatabaseModels/RumApplication.js +12 -0
  517. package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
  518. package/build/dist/Models/DatabaseModels/ServerlessFunction.js +12 -0
  519. package/build/dist/Models/DatabaseModels/ServerlessFunction.js.map +1 -1
  520. package/build/dist/Models/DatabaseModels/Service.js +12 -0
  521. package/build/dist/Models/DatabaseModels/Service.js.map +1 -1
  522. package/build/dist/Models/DatabaseModels/StatusPageOidc.js +0 -4
  523. package/build/dist/Models/DatabaseModels/StatusPageOidc.js.map +1 -1
  524. package/build/dist/Models/DatabaseModels/StatusPageSso.js +0 -4
  525. package/build/dist/Models/DatabaseModels/StatusPageSso.js.map +1 -1
  526. package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js +49 -3
  527. package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js.map +1 -1
  528. package/build/dist/Models/DatabaseModels/VMwareVCenter.js +12 -0
  529. package/build/dist/Models/DatabaseModels/VMwareVCenter.js.map +1 -1
  530. package/build/dist/Server/API/AIChatAPI.js +9 -103
  531. package/build/dist/Server/API/AIChatAPI.js.map +1 -1
  532. package/build/dist/Server/API/AIInvestigationAPI.js +3 -3
  533. package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
  534. package/build/dist/Server/API/AIInvestigationConversationAPI.js +162 -0
  535. package/build/dist/Server/API/AIInvestigationConversationAPI.js.map +1 -0
  536. package/build/dist/Server/API/IncidentFormAPI.js +245 -0
  537. package/build/dist/Server/API/IncidentFormAPI.js.map +1 -0
  538. package/build/dist/Server/API/ProjectOIDC.js +16 -24
  539. package/build/dist/Server/API/ProjectOIDC.js.map +1 -1
  540. package/build/dist/Server/API/ProjectSSO.js +16 -24
  541. package/build/dist/Server/API/ProjectSSO.js.map +1 -1
  542. package/build/dist/Server/API/StatusPageAPI.js +42 -75
  543. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  544. package/build/dist/Server/Enterprise/EnterpriseEdition.js +79 -25
  545. package/build/dist/Server/Enterprise/EnterpriseEdition.js.map +1 -1
  546. package/build/dist/Server/Enterprise/EnterpriseFeature.js +24 -3
  547. package/build/dist/Server/Enterprise/EnterpriseFeature.js.map +1 -1
  548. package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js +1 -1
  549. package/build/dist/Server/Enterprise/EnterpriseServerModule.js.map +1 -1
  550. package/build/dist/Server/EnvironmentConfig.js +1 -1
  551. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.js +63 -0
  552. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.js.map +1 -0
  553. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.js +41 -0
  554. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.js.map +1 -0
  555. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.js +40 -0
  556. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.js.map +1 -0
  557. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.js +183 -0
  558. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.js.map +1 -0
  559. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  560. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  561. package/build/dist/Server/Middleware/IncidentFormRateLimit.js +559 -0
  562. package/build/dist/Server/Middleware/IncidentFormRateLimit.js.map +1 -0
  563. package/build/dist/Server/Middleware/UserAuthorization.js +11 -30
  564. package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
  565. package/build/dist/Server/Services/AIService.js +10 -13
  566. package/build/dist/Server/Services/AIService.js.map +1 -1
  567. package/build/dist/Server/Services/IncidentCustomFieldService.js +83 -0
  568. package/build/dist/Server/Services/IncidentCustomFieldService.js.map +1 -1
  569. package/build/dist/Server/Services/IncidentEpisodeMemberService.js +8 -4
  570. package/build/dist/Server/Services/IncidentEpisodeMemberService.js.map +1 -1
  571. package/build/dist/Server/Services/IncidentEpisodeService.js +10 -1
  572. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  573. package/build/dist/Server/Services/IncidentFormService.js +1202 -0
  574. package/build/dist/Server/Services/IncidentFormService.js.map +1 -0
  575. package/build/dist/Server/Services/IncidentFormSubmissionService.js +91 -0
  576. package/build/dist/Server/Services/IncidentFormSubmissionService.js.map +1 -0
  577. package/build/dist/Server/Services/IncidentGroupingEngineService.js +20 -8
  578. package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
  579. package/build/dist/Server/Services/IncidentService.js +106 -4
  580. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  581. package/build/dist/Server/Services/IncidentTemplateService.js +18 -0
  582. package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
  583. package/build/dist/Server/Services/Index.js +14 -0
  584. package/build/dist/Server/Services/Index.js.map +1 -1
  585. package/build/dist/Server/Services/MessageQueueLabelRuleEngineService.js +262 -0
  586. package/build/dist/Server/Services/MessageQueueLabelRuleEngineService.js.map +1 -0
  587. package/build/dist/Server/Services/MessageQueueLabelRuleService.js +13 -0
  588. package/build/dist/Server/Services/MessageQueueLabelRuleService.js.map +1 -0
  589. package/build/dist/Server/Services/MessageQueueOwnerRuleEngineService.js +334 -0
  590. package/build/dist/Server/Services/MessageQueueOwnerRuleEngineService.js.map +1 -0
  591. package/build/dist/Server/Services/MessageQueueOwnerRuleService.js +13 -0
  592. package/build/dist/Server/Services/MessageQueueOwnerRuleService.js.map +1 -0
  593. package/build/dist/Server/Services/MessageQueueOwnerTeamService.js +62 -0
  594. package/build/dist/Server/Services/MessageQueueOwnerTeamService.js.map +1 -0
  595. package/build/dist/Server/Services/MessageQueueOwnerUserService.js +62 -0
  596. package/build/dist/Server/Services/MessageQueueOwnerUserService.js.map +1 -0
  597. package/build/dist/Server/Services/MessageQueueService.js +1140 -0
  598. package/build/dist/Server/Services/MessageQueueService.js.map +1 -0
  599. package/build/dist/Server/Services/OpenTelemetryIngestService.js +25 -4
  600. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  601. package/build/dist/Server/Services/ProjectService.js +0 -54
  602. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  603. package/build/dist/Server/Services/StatusPagePrivateUserService.js +1 -4
  604. package/build/dist/Server/Services/StatusPagePrivateUserService.js.map +1 -1
  605. package/build/dist/Server/Services/StatusPageService.js +0 -46
  606. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  607. package/build/dist/Server/Services/TeamComplianceSettingService.js +120 -31
  608. package/build/dist/Server/Services/TeamComplianceSettingService.js.map +1 -1
  609. package/build/dist/Server/Services/UserNotificationRuleService.js +8 -1
  610. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  611. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +12 -3
  612. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  613. package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +6 -3
  614. package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
  615. package/build/dist/Server/Types/Database/Permissions/EditionPermission.js +109 -37
  616. package/build/dist/Server/Types/Database/Permissions/EditionPermission.js.map +1 -1
  617. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +16 -0
  618. package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
  619. package/build/dist/Server/Types/Database/Permissions/TablePermission.js +3 -3
  620. package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js +9 -6
  621. package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js.map +1 -1
  622. package/build/dist/Server/Utils/AI/Chat/AgentContextCompactor.js +128 -0
  623. package/build/dist/Server/Utils/AI/Chat/AgentContextCompactor.js.map +1 -0
  624. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +192 -50
  625. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
  626. package/build/dist/Server/Utils/AI/Chat/ChatRunCancellation.js +133 -0
  627. package/build/dist/Server/Utils/AI/Chat/ChatRunCancellation.js.map +1 -0
  628. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +53 -13
  629. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
  630. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +1 -1
  631. package/build/dist/Server/Utils/AI/Chat/ToolOutputPager.js +206 -0
  632. package/build/dist/Server/Utils/AI/Chat/ToolOutputPager.js.map +1 -0
  633. package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js +53 -26
  634. package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js.map +1 -1
  635. package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js +4 -2
  636. package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js.map +1 -1
  637. package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js +1 -29
  638. package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js.map +1 -1
  639. package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js +24 -24
  640. package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js.map +1 -1
  641. package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js +7 -2
  642. package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js.map +1 -1
  643. package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js +29 -14
  644. package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js.map +1 -1
  645. package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js +38 -14
  646. package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js.map +1 -1
  647. package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js +2 -0
  648. package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js.map +1 -1
  649. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +40 -10
  650. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
  651. package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js +19 -7
  652. package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js.map +1 -1
  653. package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js +19 -7
  654. package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js.map +1 -1
  655. package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js +15 -18
  656. package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js.map +1 -1
  657. package/build/dist/Server/Utils/AI/SRE/InvestigationThread.js +412 -0
  658. package/build/dist/Server/Utils/AI/SRE/InvestigationThread.js.map +1 -0
  659. package/build/dist/Server/Utils/AI/SRE/InvestigationThreadService.js +495 -0
  660. package/build/dist/Server/Utils/AI/SRE/InvestigationThreadService.js.map +1 -0
  661. package/build/dist/Server/Utils/AI/Toolbox/Serializer.js +10 -3
  662. package/build/dist/Server/Utils/AI/Toolbox/Serializer.js.map +1 -1
  663. package/build/dist/Server/Utils/EditionEnforcement.js +20 -158
  664. package/build/dist/Server/Utils/EditionEnforcement.js.map +1 -1
  665. package/build/dist/Server/Utils/LLM/LLMService.js +193 -54
  666. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  667. package/build/dist/Server/Utils/RelaxedScimTeamLocksReport.js +160 -0
  668. package/build/dist/Server/Utils/RelaxedScimTeamLocksReport.js.map +1 -0
  669. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
  670. package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
  671. package/build/dist/Server/Utils/SameOriginRequest.js +151 -0
  672. package/build/dist/Server/Utils/SameOriginRequest.js.map +1 -0
  673. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
  674. package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
  675. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +4 -1
  676. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  677. package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js +1015 -0
  678. package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js.map +1 -0
  679. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +4 -1
  680. package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
  681. package/build/dist/Server/Utils/VendorAssets.js +3 -3
  682. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +3 -1
  683. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
  684. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js +3 -1
  685. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js.map +1 -1
  686. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +10 -1
  687. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  688. package/build/dist/Types/AI/AIAgentRunLimits.js +91 -0
  689. package/build/dist/Types/AI/AIAgentRunLimits.js.map +1 -0
  690. package/build/dist/Types/Code/CodeType.js +2 -0
  691. package/build/dist/Types/Code/CodeType.js.map +1 -1
  692. package/build/dist/Types/Code/JsonSyntax.js +604 -0
  693. package/build/dist/Types/Code/JsonSyntax.js.map +1 -0
  694. package/build/dist/Types/CustomField/CustomFieldCreateSettings.js +310 -0
  695. package/build/dist/Types/CustomField/CustomFieldCreateSettings.js.map +1 -0
  696. package/build/dist/Types/CustomField/CustomFieldMappingCatalog.js +38 -0
  697. package/build/dist/Types/CustomField/CustomFieldMappingCatalog.js.map +1 -1
  698. package/build/dist/Types/CustomField/CustomFieldValueValidator.js +10 -7
  699. package/build/dist/Types/CustomField/CustomFieldValueValidator.js.map +1 -1
  700. package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js +1 -1
  701. package/build/dist/Types/Icon/IconProp.js +2 -0
  702. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  703. package/build/dist/Types/Incident/IncidentFormIpAllowlist.js +119 -0
  704. package/build/dist/Types/Incident/IncidentFormIpAllowlist.js.map +1 -0
  705. package/build/dist/Types/Incident/IncidentFormPublic.js +678 -0
  706. package/build/dist/Types/Incident/IncidentFormPublic.js.map +1 -0
  707. package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js +10 -3
  708. package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js.map +1 -1
  709. package/build/dist/Types/MessageQueue/MessageQueueIdentity.js +184 -0
  710. package/build/dist/Types/MessageQueue/MessageQueueIdentity.js.map +1 -0
  711. package/build/dist/Types/MessageQueue/MessageQueueManualIdentity.js +190 -0
  712. package/build/dist/Types/MessageQueue/MessageQueueManualIdentity.js.map +1 -0
  713. package/build/dist/Types/MessageQueue/MessageQueueMetricCatalog.js +1057 -0
  714. package/build/dist/Types/MessageQueue/MessageQueueMetricCatalog.js.map +1 -0
  715. package/build/dist/Types/MessageQueue/MessagingSystem.js +394 -0
  716. package/build/dist/Types/MessageQueue/MessagingSystem.js.map +1 -0
  717. package/build/dist/Types/MessageQueue/MessagingTelemetryResolver.js +1768 -0
  718. package/build/dist/Types/MessageQueue/MessagingTelemetryResolver.js.map +1 -0
  719. package/build/dist/Types/Monitor/MessageQueueAlertTemplates.js +1207 -0
  720. package/build/dist/Types/Monitor/MessageQueueAlertTemplates.js.map +1 -0
  721. package/build/dist/Types/Permission.js +274 -0
  722. package/build/dist/Types/Permission.js.map +1 -1
  723. package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js +10 -4
  724. package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js.map +1 -1
  725. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +12 -0
  726. package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
  727. package/build/dist/Types/Rules/RuleRun.js +4 -0
  728. package/build/dist/Types/Rules/RuleRun.js.map +1 -1
  729. package/build/dist/Types/Team/ComplianceNotificationChannel.js +4 -3
  730. package/build/dist/Types/Team/ComplianceNotificationChannel.js.map +1 -1
  731. package/build/dist/Types/Team/ComplianceRule.js +48 -14
  732. package/build/dist/Types/Team/ComplianceRule.js.map +1 -1
  733. package/build/dist/Types/Team/ComplianceRuleType.js +2 -2
  734. package/build/dist/Types/Telemetry/EntityType.js +16 -0
  735. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  736. package/build/dist/Types/XML.js +23 -0
  737. package/build/dist/Types/XML.js.map +1 -1
  738. package/build/dist/UI/Components/CodeEditor/CodeEditor.js +641 -266
  739. package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
  740. package/build/dist/UI/Components/CodeEditor/CodeEditorCommands.js +464 -0
  741. package/build/dist/UI/Components/CodeEditor/CodeEditorCommands.js.map +1 -0
  742. package/build/dist/UI/Components/CodeEditor/CodeEditorHighlight.js +69 -0
  743. package/build/dist/UI/Components/CodeEditor/CodeEditorHighlight.js.map +1 -0
  744. package/build/dist/UI/Components/CodeEditor/CodeEditorLanguages.js +108 -0
  745. package/build/dist/UI/Components/CodeEditor/CodeEditorLanguages.js.map +1 -0
  746. package/build/dist/UI/Components/CodeEditor/YamlEditor.js +14 -186
  747. package/build/dist/UI/Components/CodeEditor/YamlEditor.js.map +1 -1
  748. package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js +5 -1
  749. package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js.map +1 -1
  750. package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js +5 -14
  751. package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js.map +1 -1
  752. package/build/dist/UI/Components/EditionLabel/EditionLabel.js +14 -13
  753. package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
  754. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js +1 -1
  755. package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js.map +1 -1
  756. package/build/dist/UI/Components/Forms/Fields/FormField.js +8 -3
  757. package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
  758. package/build/dist/UI/Components/Icon/Icon.js +8 -0
  759. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  760. package/build/dist/UI/Components/Input/Input.js +11 -3
  761. package/build/dist/UI/Components/Input/Input.js.map +1 -1
  762. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +2 -1
  763. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  764. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +14 -4
  765. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  766. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js +0 -0
  767. package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js.map +1 -1
  768. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +710 -65
  769. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
  770. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditorHistory.js +238 -0
  771. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditorHistory.js.map +1 -0
  772. package/build/dist/UI/Components/Markdown.tsx/MarkdownListEditing.js +1028 -0
  773. package/build/dist/UI/Components/Markdown.tsx/MarkdownListEditing.js.map +1 -0
  774. package/build/dist/UI/Components/Markdown.tsx/MarkdownPaste.js +1088 -0
  775. package/build/dist/UI/Components/Markdown.tsx/MarkdownPaste.js.map +1 -0
  776. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +70 -10
  777. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
  778. package/build/dist/UI/Components/Markdown.tsx/MarkdownVisualEditing.js +887 -0
  779. package/build/dist/UI/Components/Markdown.tsx/MarkdownVisualEditing.js.map +1 -0
  780. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +57 -6
  781. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  782. package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js +7 -5
  783. package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js.map +1 -1
  784. package/build/dist/UI/Components/Table/EmptyTableMessage.js +51 -0
  785. package/build/dist/UI/Components/Table/EmptyTableMessage.js.map +1 -0
  786. package/build/dist/UI/Components/Table/Table.js +30 -11
  787. package/build/dist/UI/Components/Table/Table.js.map +1 -1
  788. package/build/dist/UI/Components/Table/TableRow.js +9 -2
  789. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  790. package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js +63 -1
  791. package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js.map +1 -1
  792. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +4 -2
  793. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
  794. package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js +91 -10
  795. package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js.map +1 -1
  796. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +14 -4
  797. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
  798. package/build/dist/UI/Components/TextArea/TextArea.js +9 -3
  799. package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
  800. package/build/dist/UI/Components/Workflow/ModelFieldPicker.js +1 -2
  801. package/build/dist/UI/Components/Workflow/ModelFieldPicker.js.map +1 -1
  802. package/build/dist/Utils/LabelRuleImportExport.js +2 -0
  803. package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
  804. package/build/dist/Utils/Markdown/UntrustedMarkdown.js +988 -0
  805. package/build/dist/Utils/Markdown/UntrustedMarkdown.js.map +1 -0
  806. package/build/dist/Utils/Monitor/IncomingEmailMonitorRequestUtil.js +34 -0
  807. package/build/dist/Utils/Monitor/IncomingEmailMonitorRequestUtil.js.map +1 -0
  808. package/build/dist/Utils/Monitor/MonitorLogSummaryUtil.js +148 -0
  809. package/build/dist/Utils/Monitor/MonitorLogSummaryUtil.js.map +1 -0
  810. package/build/dist/Utils/Telemetry/EntityKey.js +36 -0
  811. package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
  812. package/package.json +1 -3
  813. package/Server/Utils/CommunityEditionSsoReport.ts +0 -361
  814. package/Tests/App/Accounts/LoginSsoEdition.test.tsx +0 -616
  815. package/Tests/App/AdminDashboard/AdminAuthenticationSsoEdition.test.tsx +0 -217
  816. package/Tests/App/AdminDashboard/GlobalSSOEnterpriseShells.test.tsx +0 -271
  817. package/Tests/App/Dashboard/CloudDocumentationMarkdown.test.ts +0 -215
  818. package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +0 -784
  819. package/Tests/Server/Middleware/UserAuthorizationEditionEnforcement.test.ts +0 -518
  820. package/Tests/Server/Services/SsoRequirementReadMasking.test.ts +0 -419
  821. package/Tests/Server/Services/SsoRequirementWriteGuard.test.ts +0 -769
  822. package/Tests/UI/Components/CodeEditor.test.tsx +0 -638
  823. package/Tests/UI/Components/MonacoLoader.test.ts +0 -67
  824. package/Tests/UI/Components/MonacoRuntime.test.ts +0 -121
  825. package/Tests/UI/Components/Telemetry/TelemetryRetentionConfigForm.test.tsx +0 -329
  826. package/Tests/UI/Components/YamlEditor.test.tsx +0 -847
  827. package/UI/Components/CodeEditor/MonacoLoader.ts +0 -36
  828. package/UI/Components/Telemetry/TelemetryRetentionConfigForm.tsx +0 -319
  829. package/UI/Components/Telemetry/TelemetryRetentionConfigSummary.tsx +0 -223
  830. package/build/dist/Server/Utils/CommunityEditionSsoReport.js +0 -223
  831. package/build/dist/Server/Utils/CommunityEditionSsoReport.js.map +0 -1
  832. package/build/dist/UI/Components/CodeEditor/MonacoLoader.js +0 -34
  833. package/build/dist/UI/Components/CodeEditor/MonacoLoader.js.map +0 -1
  834. package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigForm.js +0 -171
  835. package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigForm.js.map +0 -1
  836. package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigSummary.js +0 -119
  837. package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigSummary.js.map +0 -1
@@ -0,0 +1,1324 @@
1
+ import "@testing-library/jest-dom";
2
+ import {
3
+ afterEach,
4
+ beforeEach,
5
+ describe,
6
+ expect,
7
+ jest,
8
+ test,
9
+ } from "@jest/globals";
10
+ import { act, cleanup, render } from "@testing-library/react";
11
+ import React, { ReactElement } from "react";
12
+ import { MemoryRouter } from "react-router-dom";
13
+ import { getJestSpyOn } from "../../Spy";
14
+
15
+ /*
16
+ * Incidents > Settings > Forms (issue #4114): the list of incident forms, and
17
+ * a form's own page.
18
+ *
19
+ * - the list manages the project's IncidentForm rows and creates a form in
20
+ * two steps - its details, then what its incidents start with, where the
21
+ * severity is required (ModelForm never reads a column's own "required",
22
+ * and the server refuses a form without one);
23
+ * - a form's page has one card per thing an admin decides - Form Details,
24
+ * Share Link, Incident Settings, Form Settings, Questions, Access,
25
+ * Submissions - and a Delete that goes back to the list.
26
+ *
27
+ * The tables, cards and the delete card are stubbed and their props
28
+ * recorded; the Share Link and Questions cards have suites of their own
29
+ * (IncidentFormShareLinkCard.test.tsx, IncidentCustomFieldSettingsCard.test.tsx).
30
+ */
31
+
32
+ const recordedTables: Array<Record<string, unknown>> = [];
33
+ const recordedDetailCards: Array<Record<string, unknown>> = [];
34
+ const recordedDeletes: Array<Record<string, unknown>> = [];
35
+ const recordedShareLinkCards: Array<Record<string, unknown>> = [];
36
+ const recordedSettingsCards: Array<Record<string, unknown>> = [];
37
+
38
+ let mockIpAllowlistEditable: boolean = true;
39
+
40
+ let mockTranslate: (value: string) => string = (value: string): string => {
41
+ return value;
42
+ };
43
+
44
+ jest.mock("../../../UI/Components/ModelTable/ModelTable", () => {
45
+ return {
46
+ __esModule: true,
47
+ default: (props: Record<string, unknown>): ReactElement => {
48
+ recordedTables.push(props);
49
+ return React.createElement("div", {
50
+ "data-testid": `table-${String(props["name"])}`,
51
+ });
52
+ },
53
+ };
54
+ });
55
+
56
+ jest.mock("../../../UI/Components/ModelDetail/CardModelDetail", () => {
57
+ return {
58
+ __esModule: true,
59
+ default: (props: Record<string, unknown>): ReactElement => {
60
+ recordedDetailCards.push(props);
61
+ return React.createElement("div", {
62
+ "data-testid": `card-${String(props["name"])}`,
63
+ });
64
+ },
65
+ };
66
+ });
67
+
68
+ jest.mock("../../../UI/Components/ModelDelete/ModelDelete", () => {
69
+ return {
70
+ __esModule: true,
71
+ default: (props: Record<string, unknown>): ReactElement => {
72
+ recordedDeletes.push(props);
73
+ return React.createElement("div", { "data-testid": "model-delete" });
74
+ },
75
+ };
76
+ });
77
+
78
+ jest.mock(
79
+ "../../../../App/FeatureSet/Dashboard/src/Components/IncidentForm/IncidentFormShareLinkCard",
80
+ () => {
81
+ return {
82
+ __esModule: true,
83
+ default: (props: Record<string, unknown>): ReactElement => {
84
+ recordedShareLinkCards.push(props);
85
+ return React.createElement("div", {
86
+ "data-testid": "share-link-card",
87
+ });
88
+ },
89
+ };
90
+ },
91
+ );
92
+
93
+ jest.mock(
94
+ "../../../../App/FeatureSet/Dashboard/src/Components/Incident/IncidentCustomFieldSettingsCard",
95
+ () => {
96
+ return {
97
+ __esModule: true,
98
+ default: (props: Record<string, unknown>): ReactElement => {
99
+ recordedSettingsCards.push(props);
100
+ return React.createElement("div", {
101
+ "data-testid": "questions-card",
102
+ });
103
+ },
104
+ };
105
+ },
106
+ );
107
+
108
+ jest.mock(
109
+ "../../../../App/FeatureSet/Dashboard/src/Components/IncidentForm/IncidentFormPlan",
110
+ () => {
111
+ return {
112
+ __esModule: true,
113
+ isIncidentFormIpAllowlistEditableOnCurrentPlan: (): boolean => {
114
+ return mockIpAllowlistEditable;
115
+ },
116
+ };
117
+ },
118
+ );
119
+
120
+ jest.mock("../../../UI/Utils/Project", () => {
121
+ return {
122
+ __esModule: true,
123
+ default: {
124
+ getCurrentProjectId: (): unknown => {
125
+ const ObjectIDClass: any = jest.requireActual(
126
+ "../../../Types/ObjectID",
127
+ ) as any;
128
+ return new ObjectIDClass.default(
129
+ "11111111-1111-4111-8111-111111111111",
130
+ );
131
+ },
132
+ },
133
+ };
134
+ });
135
+
136
+ jest.mock("../../../UI/Utils/Translation", () => {
137
+ return {
138
+ __esModule: true,
139
+ default: () => {
140
+ return {
141
+ translateString: (value: string | undefined): string | undefined => {
142
+ return typeof value === "string" && value
143
+ ? mockTranslate(value)
144
+ : value;
145
+ },
146
+ translateValue: (value: unknown): unknown => {
147
+ return typeof value === "string" && value
148
+ ? mockTranslate(value)
149
+ : value;
150
+ },
151
+ };
152
+ },
153
+ };
154
+ });
155
+
156
+ import IncidentForms from "../../../../App/FeatureSet/Dashboard/src/Pages/Incidents/Settings/IncidentForms";
157
+ import IncidentFormView from "../../../../App/FeatureSet/Dashboard/src/Pages/Incidents/Settings/IncidentFormView";
158
+ import IncidentFormCopy from "../../../../App/FeatureSet/Dashboard/src/Components/IncidentForm/IncidentFormCopy";
159
+ import {
160
+ getIncidentFormDescriptionSettingLabel,
161
+ INCIDENT_FORM_DESCRIPTION_SETTING_OPTIONS,
162
+ INCIDENT_FORM_DETAILS_STEP_ID,
163
+ INCIDENT_FORM_INCIDENT_SETTINGS_STEP_ID,
164
+ } from "../../../../App/FeatureSet/Dashboard/src/Components/IncidentForm/IncidentFormFields";
165
+ import PageMap from "../../../../App/FeatureSet/Dashboard/src/Utils/PageMap";
166
+ import RouteMap, {
167
+ RouteUtil,
168
+ } from "../../../../App/FeatureSet/Dashboard/src/Utils/RouteMap";
169
+ import Incident from "../../../Models/DatabaseModels/Incident";
170
+ import IncidentForm from "../../../Models/DatabaseModels/IncidentForm";
171
+ import IncidentFormSubmission from "../../../Models/DatabaseModels/IncidentFormSubmission";
172
+ import IncidentSeverity from "../../../Models/DatabaseModels/IncidentSeverity";
173
+ import IncidentTemplate from "../../../Models/DatabaseModels/IncidentTemplate";
174
+ import Route from "../../../Types/API/Route";
175
+ import SortOrder from "../../../Types/BaseDatabase/SortOrder";
176
+ import Color from "../../../Types/Color";
177
+ import { IncidentFormFieldSetting } from "../../../Types/Incident/IncidentFormPublic";
178
+ import ObjectID from "../../../Types/ObjectID";
179
+ import { DropdownOption } from "../../../UI/Components/Dropdown/Dropdown";
180
+ import FormFieldSchemaType from "../../../UI/Components/Forms/Types/FormFieldSchemaType";
181
+ import FieldType from "../../../UI/Components/Types/FieldType";
182
+ import Navigation from "../../../UI/Utils/Navigation";
183
+
184
+ const PROJECT_ID: string = "11111111-1111-4111-8111-111111111111";
185
+ const FORM_ID: string = "f0f0f0f0-0000-4000-8000-0000000000ff";
186
+ const INCIDENT_ID: string = "e5f6a7b8-c9d0-4e1f-8a3b-4c5d6e7f8a9b";
187
+ const TEMPLATE_ID: string = "d4e5f6a7-b8c9-4d0e-9f2a-3b4c5d6e7f8a";
188
+
189
+ type NavigateSpy = ReturnType<typeof getJestSpyOn>;
190
+
191
+ let navigateSpy: NavigateSpy;
192
+
193
+ beforeEach(() => {
194
+ mockIpAllowlistEditable = true;
195
+ mockTranslate = (value: string): string => {
196
+ return value;
197
+ };
198
+
199
+ jest
200
+ .spyOn(Navigation, "getLastParamAsObjectID")
201
+ .mockImplementation((): ObjectID => {
202
+ return new ObjectID(FORM_ID);
203
+ });
204
+
205
+ navigateSpy = getJestSpyOn(Navigation, "navigate").mockImplementation(
206
+ (): void => {},
207
+ );
208
+ });
209
+
210
+ afterEach(() => {
211
+ cleanup();
212
+ recordedTables.length = 0;
213
+ recordedDetailCards.length = 0;
214
+ recordedDeletes.length = 0;
215
+ recordedShareLinkCards.length = 0;
216
+ recordedSettingsCards.length = 0;
217
+ jest.restoreAllMocks();
218
+ });
219
+
220
+ type Props = Record<string, unknown>;
221
+
222
+ function last(records: Array<Props>): Props {
223
+ expect(records.length).toBeGreaterThan(0);
224
+ return records[records.length - 1]!;
225
+ }
226
+
227
+ function tableNamed(name: string): Props {
228
+ return last(
229
+ recordedTables.filter((props: Props): boolean => {
230
+ return props["name"] === name;
231
+ }),
232
+ );
233
+ }
234
+
235
+ function detailCardNamed(name: string): Props {
236
+ return last(
237
+ recordedDetailCards.filter((props: Props): boolean => {
238
+ return props["name"] === name;
239
+ }),
240
+ );
241
+ }
242
+
243
+ function titlesOf(fields: unknown): Array<unknown> {
244
+ return (fields as Array<Props>).map((field: Props): unknown => {
245
+ return field["title"];
246
+ });
247
+ }
248
+
249
+ function fieldFor(fields: unknown, column: string): Props {
250
+ const found: Props | undefined = (fields as Array<Props>).find(
251
+ (field: Props): boolean => {
252
+ return Boolean(
253
+ field["field"] && Object.keys(field["field"] as Props).includes(column),
254
+ );
255
+ },
256
+ );
257
+
258
+ expect(found).toBeDefined();
259
+ return found!;
260
+ }
261
+
262
+ function columnsOf(fields: unknown): Array<string> {
263
+ return (fields as Array<Props>).map((field: Props): string => {
264
+ return Object.keys(field["field"] as Props)[0]!;
265
+ });
266
+ }
267
+
268
+ function detailFields(card: Props): Array<Props> {
269
+ return (card["modelDetailProps"] as Props)["fields"] as Array<Props>;
270
+ }
271
+
272
+ // A getElement, rendered where its links can resolve.
273
+ function renderElement(element: ReactElement): HTMLElement {
274
+ return render(<MemoryRouter>{element}</MemoryRouter>).container;
275
+ }
276
+
277
+ function route(pageMapKey: string, modelId?: string): string {
278
+ return RouteUtil.populateRouteParams(
279
+ RouteMap[pageMapKey] as Route,
280
+ modelId ? { modelId: new ObjectID(modelId) } : undefined,
281
+ ).toString();
282
+ }
283
+
284
+ describe("the Incident Forms list", () => {
285
+ async function renderList(): Promise<Props> {
286
+ await act(async (): Promise<void> => {
287
+ render(
288
+ <MemoryRouter>
289
+ <IncidentForms
290
+ pageRoute={RouteMap[PageMap.INCIDENTS_SETTINGS_FORMS] as Route}
291
+ currentProject={null}
292
+ hasPaymentMethod={false}
293
+ />
294
+ </MemoryRouter>,
295
+ );
296
+ });
297
+
298
+ return tableNamed("Settings > Incident Forms");
299
+ }
300
+
301
+ test("manages the project's incident forms", async () => {
302
+ const table: Props = await renderList();
303
+
304
+ expect(table["modelType"]).toBe(IncidentForm);
305
+ expect(String((table["query"] as Props)["projectId"])).toBe(PROJECT_ID);
306
+ expect(Object.keys(table["query"] as Props)).toEqual(["projectId"]);
307
+ });
308
+
309
+ test("has ids of its own", async () => {
310
+ const table: Props = await renderList();
311
+
312
+ expect(table["id"]).toBe("incident-forms-table");
313
+ expect(table["userPreferencesKey"]).toBe("incident-forms-table");
314
+ expect(table["saveFilterProps"]).toEqual({
315
+ tableId: "incident-forms-table",
316
+ });
317
+ });
318
+
319
+ test("creates and opens forms; editing and deleting happen on a form's page", async () => {
320
+ const table: Props = await renderList();
321
+
322
+ expect(table["isCreateable"]).toBe(true);
323
+ expect(table["isViewable"]).toBe(true);
324
+ expect(table["isEditable"]).toBe(false);
325
+ expect(table["isDeleteable"]).toBe(false);
326
+ });
327
+
328
+ test("a row opens the form's page, one segment under the list", async () => {
329
+ const table: Props = await renderList();
330
+
331
+ expect(String(table["viewPageRoute"])).toBe(
332
+ `/dashboard/${PROJECT_ID}/incidents/settings/forms`,
333
+ );
334
+ expect(RouteMap[PageMap.INCIDENTS_SETTINGS_FORMS_VIEW]!.toString()).toBe(
335
+ `${RouteMap[PageMap.INCIDENTS_SETTINGS_FORMS]!.toString()}/:id`,
336
+ );
337
+ });
338
+
339
+ test("is the Incident Forms card, with the forms documentation", async () => {
340
+ const table: Props = await renderList();
341
+
342
+ expect(table["cardProps"]).toEqual({
343
+ title: "Incident Forms",
344
+ description: IncidentFormCopy.listDescription,
345
+ });
346
+ expect(table["noItemsMessage"]).toBe(IncidentFormCopy.listEmpty);
347
+ expect(String(table["documentationLink"])).toBe("/docs/incidents/forms");
348
+ });
349
+
350
+ test("creates a form in two steps: its details, then its incidents", async () => {
351
+ const table: Props = await renderList();
352
+
353
+ expect(table["formSteps"]).toEqual([
354
+ { title: "Form Details", id: INCIDENT_FORM_DETAILS_STEP_ID },
355
+ {
356
+ title: "Incident Settings",
357
+ id: INCIDENT_FORM_INCIDENT_SETTINGS_STEP_ID,
358
+ },
359
+ ]);
360
+
361
+ const fields: Array<Props> = table["formFields"] as Array<Props>;
362
+
363
+ expect(
364
+ fields.map((field: Props): Array<unknown> => {
365
+ return [Object.keys(field["field"] as Props)[0], field["stepId"]];
366
+ }),
367
+ ).toEqual([
368
+ ["name", INCIDENT_FORM_DETAILS_STEP_ID],
369
+ ["description", INCIDENT_FORM_DETAILS_STEP_ID],
370
+ ["incidentSeverity", INCIDENT_FORM_INCIDENT_SETTINGS_STEP_ID],
371
+ ["incidentTemplate", INCIDENT_FORM_INCIDENT_SETTINGS_STEP_ID],
372
+ ]);
373
+ });
374
+
375
+ test("a form needs a name", async () => {
376
+ const name: Props = fieldFor((await renderList())["formFields"], "name");
377
+
378
+ expect(name["title"]).toBe("Name");
379
+ expect(name["fieldType"]).toBe(FormFieldSchemaType.Text);
380
+ expect(name["required"]).toBe(true);
381
+ expect(name["placeholder"]).toBe(IncidentFormCopy.namePlaceholder);
382
+ });
383
+
384
+ test("its description is Markdown, without image upload: the public page cannot show a private image", async () => {
385
+ const description: Props = fieldFor(
386
+ (await renderList())["formFields"],
387
+ "description",
388
+ );
389
+
390
+ expect(description["fieldType"]).toBe(FormFieldSchemaType.Markdown);
391
+ expect(description["required"]).toBe(false);
392
+ expect(description["allowImageUpload"]).toBe(false);
393
+ });
394
+
395
+ /*
396
+ * Regression guard: ModelForm never reads TableColumn.required, so without
397
+ * required on the field the wizard would let a form through that
398
+ * IncidentFormService then refuses with a message about a field the user
399
+ * could not tell was needed.
400
+ */
401
+ test("the severity is required, picked from the project's incident severities", async () => {
402
+ const severity: Props = fieldFor(
403
+ (await renderList())["formFields"],
404
+ "incidentSeverity",
405
+ );
406
+
407
+ expect(severity["title"]).toBe("Severity");
408
+ expect(severity["required"]).toBe(true);
409
+ expect(severity["fieldType"]).toBe(FormFieldSchemaType.Dropdown);
410
+ expect(severity["dropdownModal"]).toEqual({
411
+ type: IncidentSeverity,
412
+ labelField: "name",
413
+ valueField: "_id",
414
+ });
415
+ expect(severity["description"]).toBe(IncidentFormCopy.severityDescription);
416
+ });
417
+
418
+ test("the incident template is optional, picked by name, and warns what it sets off", async () => {
419
+ const template: Props = fieldFor(
420
+ (await renderList())["formFields"],
421
+ "incidentTemplate",
422
+ );
423
+
424
+ expect(template["title"]).toBe("Incident Template");
425
+ expect(template["required"]).toBe(false);
426
+ expect(template["fieldType"]).toBe(FormFieldSchemaType.Dropdown);
427
+ expect(template["dropdownModal"]).toEqual({
428
+ type: IncidentTemplate,
429
+ labelField: "templateName",
430
+ valueField: "_id",
431
+ });
432
+
433
+ const warning: string = String(template["description"]);
434
+
435
+ expect(warning).toBe(IncidentFormCopy.templateDescription);
436
+ /*
437
+ * In the server's order: the form's severity (or the reporter's) and the
438
+ * reporter's answers win, and the template fills in the rest - not
439
+ * "everything the template sets applies", which its severity never does
440
+ * while the form has its own.
441
+ */
442
+ expect(warning).toContain(
443
+ "The form's severity (or the one the reporter chooses) and the reporter's title, description and answers come first",
444
+ );
445
+ expect(warning).toContain("the template fills in everything else");
446
+ expect(warning).not.toContain("everything the template sets applies");
447
+ expect(warning).toContain("monitors");
448
+ expect(warning).toContain("on-call policies");
449
+ expect(warning).toContain("a monitor status change");
450
+ });
451
+
452
+ test("lists name, description and Enabled, and filters by them", async () => {
453
+ const table: Props = await renderList();
454
+
455
+ expect(columnsOf(table["columns"])).toEqual([
456
+ "name",
457
+ "description",
458
+ "isEnabled",
459
+ ]);
460
+ expect(titlesOf(table["columns"])).toEqual([
461
+ "Name",
462
+ "Description",
463
+ "Enabled",
464
+ ]);
465
+
466
+ const description: Props = fieldFor(table["columns"], "description");
467
+
468
+ // Free text in a table cell wraps inside its column.
469
+ expect(description["wrapContent"]).toBe(true);
470
+ expect(fieldFor(table["columns"], "isEnabled")["type"]).toBe(
471
+ FieldType.Boolean,
472
+ );
473
+
474
+ expect(columnsOf(table["filters"])).toEqual([
475
+ "name",
476
+ "description",
477
+ "isEnabled",
478
+ ]);
479
+ expect(fieldFor(table["filters"], "isEnabled")["type"]).toBe(
480
+ FieldType.Boolean,
481
+ );
482
+ });
483
+ });
484
+
485
+ describe("a form's page", () => {
486
+ async function renderView(): Promise<void> {
487
+ await act(async (): Promise<void> => {
488
+ render(
489
+ <MemoryRouter>
490
+ <IncidentFormView
491
+ pageRoute={RouteMap[PageMap.INCIDENTS_SETTINGS_FORMS_VIEW] as Route}
492
+ currentProject={null}
493
+ hasPaymentMethod={false}
494
+ />
495
+ </MemoryRouter>,
496
+ );
497
+ });
498
+ }
499
+
500
+ function formDetails(): Props {
501
+ return detailCardNamed("Incident Form > Form Details");
502
+ }
503
+
504
+ function incidentSettings(): Props {
505
+ return detailCardNamed("Incident Form > Incident Settings");
506
+ }
507
+
508
+ function formSettings(): Props {
509
+ return detailCardNamed("Incident Form > Form Settings");
510
+ }
511
+
512
+ function access(): Props {
513
+ return detailCardNamed("Incident Form > Access");
514
+ }
515
+
516
+ function submissions(): Props {
517
+ return tableNamed("Incident Form > Submissions");
518
+ }
519
+
520
+ test("has its cards in the order a new form is set up", async () => {
521
+ await renderView();
522
+
523
+ const order: Array<string> = Array.from(
524
+ document.querySelectorAll<HTMLElement>("[data-testid]"),
525
+ ).map((element: HTMLElement): string => {
526
+ return element.getAttribute("data-testid") || "";
527
+ });
528
+
529
+ expect(order).toEqual([
530
+ "card-Incident Form > Form Details",
531
+ "share-link-card",
532
+ "card-Incident Form > Incident Settings",
533
+ "card-Incident Form > Form Settings",
534
+ "questions-card",
535
+ "card-Incident Form > Access",
536
+ "table-Incident Form > Submissions",
537
+ "model-delete",
538
+ ]);
539
+ });
540
+
541
+ test("every card is about this form", async () => {
542
+ await renderView();
543
+
544
+ for (const card of [
545
+ formDetails(),
546
+ incidentSettings(),
547
+ formSettings(),
548
+ access(),
549
+ ]) {
550
+ const detail: Props = card["modelDetailProps"] as Props;
551
+
552
+ expect(detail["modelType"]).toBe(IncidentForm);
553
+ expect(String(detail["modelId"])).toBe(FORM_ID);
554
+ expect(card["isEditable"]).toBe(true);
555
+ /*
556
+ * Detail sizes a field at 1/n of the card whatever its colSpan: two
557
+ * columns squeezed the description and the success message to half
558
+ * width, and every field to half a phone.
559
+ */
560
+ expect(detail["showDetailsInNumberOfColumns"]).toBe(1);
561
+ }
562
+
563
+ expect(String(last(recordedShareLinkCards)["modelId"])).toBe(FORM_ID);
564
+ expect(String(last(recordedSettingsCards)["modelId"])).toBe(FORM_ID);
565
+ expect(String(last(recordedDeletes)["modelId"])).toBe(FORM_ID);
566
+ });
567
+
568
+ /*
569
+ * A CardModelDetail writes every field it holds when saved: a column held
570
+ * by two cards would be overwritten by whichever was saved last.
571
+ */
572
+ test("no column is edited by two cards", async () => {
573
+ await renderView();
574
+
575
+ const edited: Array<string> = [
576
+ formDetails(),
577
+ incidentSettings(),
578
+ formSettings(),
579
+ access(),
580
+ ].flatMap((card: Props): Array<string> => {
581
+ return columnsOf(card["formFields"]);
582
+ });
583
+
584
+ expect(edited).toEqual(Array.from(new Set(edited)));
585
+ expect(edited.sort()).toEqual(
586
+ [
587
+ "allowReporterToChooseSeverity",
588
+ "description",
589
+ "descriptionSetting",
590
+ "incidentSeverity",
591
+ "incidentTemplate",
592
+ "ipWhitelist",
593
+ "isEnabled",
594
+ "isReporterDetailsRequired",
595
+ "name",
596
+ "successMessage",
597
+ ].sort(),
598
+ );
599
+ // The questions and the link have cards of their own.
600
+ expect(edited).not.toContain("customFieldSettings");
601
+ expect(edited).not.toContain("shareKey");
602
+ });
603
+
604
+ describe("Form Details", () => {
605
+ test("edits the name, the description and Enabled", async () => {
606
+ await renderView();
607
+
608
+ const card: Props = formDetails();
609
+
610
+ expect((card["cardProps"] as Props)["title"]).toBe("Form Details");
611
+ expect(card["editButtonText"]).toBe("Edit Form Details");
612
+ expect(columnsOf(card["formFields"])).toEqual([
613
+ "name",
614
+ "description",
615
+ "isEnabled",
616
+ ]);
617
+ expect(fieldFor(card["formFields"], "name")["required"]).toBe(true);
618
+ expect(
619
+ fieldFor(card["formFields"], "description")["allowImageUpload"],
620
+ ).toBe(false);
621
+
622
+ const enabled: Props = fieldFor(card["formFields"], "isEnabled");
623
+
624
+ expect(enabled["title"]).toBe("Enabled");
625
+ expect(enabled["fieldType"]).toBe(FormFieldSchemaType.Toggle);
626
+ expect(enabled["description"]).toBe(IncidentFormCopy.enabledDescription);
627
+ });
628
+
629
+ test("shows the form's id, name, Enabled and description", async () => {
630
+ await renderView();
631
+
632
+ const fields: Array<Props> = detailFields(formDetails());
633
+
634
+ expect(columnsOf(fields)).toEqual([
635
+ "_id",
636
+ "name",
637
+ "isEnabled",
638
+ "description",
639
+ ]);
640
+ expect(titlesOf(fields)).toEqual([
641
+ "Incident Form ID",
642
+ "Name",
643
+ "Enabled",
644
+ "Description",
645
+ ]);
646
+ expect(fieldFor(fields, "_id")["fieldType"]).toBe(FieldType.ObjectID);
647
+ expect(fieldFor(fields, "isEnabled")["fieldType"]).toBe(
648
+ FieldType.Boolean,
649
+ );
650
+ expect(fieldFor(fields, "description")["fieldType"]).toBe(
651
+ FieldType.Markdown,
652
+ );
653
+ });
654
+
655
+ test("saving it asks the Share Link card to read the form again", async () => {
656
+ await renderView();
657
+
658
+ expect(last(recordedShareLinkCards)["refresher"]).toBe(false);
659
+
660
+ await act(async (): Promise<void> => {
661
+ (formDetails()["onSaveSuccess"] as () => void)();
662
+ });
663
+
664
+ expect(last(recordedShareLinkCards)["refresher"]).toBe(true);
665
+
666
+ await act(async (): Promise<void> => {
667
+ (formDetails()["onSaveSuccess"] as () => void)();
668
+ });
669
+
670
+ expect(last(recordedShareLinkCards)["refresher"]).toBe(false);
671
+ });
672
+ });
673
+
674
+ describe("Incident Settings", () => {
675
+ test("edits the severity (required), Let Reporter Choose Severity and the template", async () => {
676
+ await renderView();
677
+
678
+ const card: Props = incidentSettings();
679
+
680
+ expect((card["cardProps"] as Props)["title"]).toBe("Incident Settings");
681
+ expect(card["editButtonText"]).toBe("Edit Incident Settings");
682
+ expect(columnsOf(card["formFields"])).toEqual([
683
+ "incidentSeverity",
684
+ "allowReporterToChooseSeverity",
685
+ "incidentTemplate",
686
+ ]);
687
+
688
+ // The server refuses clearing it: the edit form must not allow it.
689
+ expect(fieldFor(card["formFields"], "incidentSeverity")["required"]).toBe(
690
+ true,
691
+ );
692
+ expect(fieldFor(card["formFields"], "incidentTemplate")["required"]).toBe(
693
+ false,
694
+ );
695
+
696
+ const choose: Props = fieldFor(
697
+ card["formFields"],
698
+ "allowReporterToChooseSeverity",
699
+ );
700
+
701
+ expect(choose["title"]).toBe("Let Reporter Choose Severity");
702
+ expect(choose["fieldType"]).toBe(FormFieldSchemaType.Toggle);
703
+ });
704
+
705
+ test("warns, on the card and in the edit form, what a template sets off", async () => {
706
+ await renderView();
707
+
708
+ const card: Props = incidentSettings();
709
+ const cardDescription: string = String(
710
+ (card["cardProps"] as Props)["description"],
711
+ );
712
+
713
+ expect(cardDescription).toBe(
714
+ IncidentFormCopy.incidentSettingsDescription,
715
+ );
716
+ // Which comes first, next to the severity the card shows.
717
+ expect(cardDescription).toContain(
718
+ "the form's severity (or the one the reporter chooses) and the reporter's title, description and answers come first",
719
+ );
720
+ expect(cardDescription).toContain(
721
+ "the template fills in everything else",
722
+ );
723
+ expect(cardDescription).not.toContain(
724
+ "everything the template sets applies",
725
+ );
726
+ expect(cardDescription).toContain(
727
+ "including its monitors, on-call policies and a monitor status change",
728
+ );
729
+ expect(
730
+ fieldFor(card["formFields"], "incidentTemplate")["description"],
731
+ ).toBe(IncidentFormCopy.templateDescription);
732
+ });
733
+
734
+ test("shows the severity as a pill", async () => {
735
+ await renderView();
736
+
737
+ const severityField: Props = fieldFor(
738
+ detailFields(incidentSettings()),
739
+ "incidentSeverity",
740
+ );
741
+
742
+ expect(severityField["title"]).toBe("Severity");
743
+
744
+ const form: IncidentForm = new IncidentForm();
745
+ const severity: IncidentSeverity = new IncidentSeverity();
746
+ severity.name = "Critical";
747
+ severity.color = new Color("#ff0000");
748
+ form.incidentSeverity = severity;
749
+
750
+ const container: HTMLElement = renderElement(
751
+ (severityField["getElement"] as (item: IncidentForm) => ReactElement)(
752
+ form,
753
+ ),
754
+ );
755
+
756
+ expect(container).toHaveTextContent("Critical");
757
+ expect(
758
+ container.querySelector('[data-testid="incident-form-no-severity"]'),
759
+ ).toBeNull();
760
+ });
761
+
762
+ test("a form whose severity was deleted says it has none", async () => {
763
+ await renderView();
764
+
765
+ const severityField: Props = fieldFor(
766
+ detailFields(incidentSettings()),
767
+ "incidentSeverity",
768
+ );
769
+
770
+ const container: HTMLElement = renderElement(
771
+ (severityField["getElement"] as (item: IncidentForm) => ReactElement)(
772
+ new IncidentForm(),
773
+ ),
774
+ );
775
+
776
+ expect(
777
+ container.querySelector('[data-testid="incident-form-no-severity"]'),
778
+ ).toHaveTextContent("No severity");
779
+ });
780
+
781
+ test("links the template to its own page", async () => {
782
+ await renderView();
783
+
784
+ const templateField: Props = fieldFor(
785
+ detailFields(incidentSettings()),
786
+ "incidentTemplate",
787
+ );
788
+
789
+ const form: IncidentForm = new IncidentForm();
790
+ const template: IncidentTemplate = new IncidentTemplate();
791
+ template._id = TEMPLATE_ID;
792
+ template.templateName = "Customer data exposure";
793
+ form.incidentTemplate = template;
794
+
795
+ const container: HTMLElement = renderElement(
796
+ (templateField["getElement"] as (item: IncidentForm) => ReactElement)(
797
+ form,
798
+ ),
799
+ );
800
+
801
+ const link: HTMLAnchorElement | null = container.querySelector("a");
802
+
803
+ expect(link).toHaveTextContent("Customer data exposure");
804
+ expect(link!.getAttribute("href")).toBe(
805
+ route(PageMap.INCIDENTS_SETTINGS_TEMPLATES_VIEW, TEMPLATE_ID),
806
+ );
807
+ });
808
+
809
+ test("a form without a template says None", async () => {
810
+ await renderView();
811
+
812
+ const templateField: Props = fieldFor(
813
+ detailFields(incidentSettings()),
814
+ "incidentTemplate",
815
+ );
816
+
817
+ const container: HTMLElement = renderElement(
818
+ (templateField["getElement"] as (item: IncidentForm) => ReactElement)(
819
+ new IncidentForm(),
820
+ ),
821
+ );
822
+
823
+ expect(container).toHaveTextContent("None");
824
+ expect(container.querySelector("a")).toBeNull();
825
+ });
826
+ });
827
+
828
+ describe("Form Settings", () => {
829
+ test("edits the description question (required), Require Reporter Details and the success message", async () => {
830
+ await renderView();
831
+
832
+ const card: Props = formSettings();
833
+
834
+ expect((card["cardProps"] as Props)["title"]).toBe("Form Settings");
835
+ expect(card["editButtonText"]).toBe("Edit Form Settings");
836
+ expect(columnsOf(card["formFields"])).toEqual([
837
+ "descriptionSetting",
838
+ "isReporterDetailsRequired",
839
+ "successMessage",
840
+ ]);
841
+
842
+ const question: Props = fieldFor(
843
+ card["formFields"],
844
+ "descriptionSetting",
845
+ );
846
+
847
+ expect(question["title"]).toBe("Description Question");
848
+ expect(question["fieldType"]).toBe(FormFieldSchemaType.Dropdown);
849
+ // NOT NULL: a cleared dropdown would be refused by the server.
850
+ expect(question["required"]).toBe(true);
851
+ expect(
852
+ (question["dropdownOptions"] as Array<DropdownOption>).map(
853
+ (option: DropdownOption): Array<unknown> => {
854
+ return [option.label, option.value];
855
+ },
856
+ ),
857
+ ).toEqual([
858
+ ["Required", IncidentFormFieldSetting.Required],
859
+ ["Optional", IncidentFormFieldSetting.Optional],
860
+ ["Hidden", IncidentFormFieldSetting.Hidden],
861
+ ]);
862
+ expect(question["dropdownOptions"]).toBe(
863
+ INCIDENT_FORM_DESCRIPTION_SETTING_OPTIONS,
864
+ );
865
+
866
+ const details: Props = fieldFor(
867
+ card["formFields"],
868
+ "isReporterDetailsRequired",
869
+ );
870
+
871
+ expect(details["title"]).toBe("Require Reporter Details");
872
+ expect(details["fieldType"]).toBe(FormFieldSchemaType.Toggle);
873
+
874
+ const success: Props = fieldFor(card["formFields"], "successMessage");
875
+
876
+ expect(success["title"]).toBe("Success Message");
877
+ expect(success["fieldType"]).toBe(FormFieldSchemaType.Markdown);
878
+ expect(success["allowImageUpload"]).toBe(false);
879
+ });
880
+
881
+ test("shows the description question in words, translated", async () => {
882
+ mockTranslate = (value: string): string => {
883
+ return `[de] ${value}`;
884
+ };
885
+
886
+ await renderView();
887
+
888
+ const question: Props = fieldFor(
889
+ detailFields(formSettings()),
890
+ "descriptionSetting",
891
+ );
892
+
893
+ const form: IncidentForm = new IncidentForm();
894
+ form.descriptionSetting = IncidentFormFieldSetting.Hidden;
895
+
896
+ const container: HTMLElement = renderElement(
897
+ (question["getElement"] as (item: IncidentForm) => ReactElement)(form),
898
+ );
899
+
900
+ expect(container).toHaveTextContent("[de] Hidden");
901
+ });
902
+
903
+ test("a description question that was not read shows as the default, Optional", () => {
904
+ expect(getIncidentFormDescriptionSettingLabel(undefined)).toBe(
905
+ "Optional",
906
+ );
907
+ expect(getIncidentFormDescriptionSettingLabel("Sometimes")).toBe(
908
+ "Optional",
909
+ );
910
+ expect(getIncidentFormDescriptionSettingLabel("Required")).toBe(
911
+ "Required",
912
+ );
913
+ expect(getIncidentFormDescriptionSettingLabel("Hidden")).toBe("Hidden");
914
+ });
915
+ });
916
+
917
+ describe("Questions", () => {
918
+ test("is the custom field settings card, in form mode, with its own title", async () => {
919
+ await renderView();
920
+
921
+ const card: Props = last(recordedSettingsCards);
922
+
923
+ expect(card["mode"]).toBe("form");
924
+ expect(card["modelType"]).toBe(IncidentForm);
925
+ expect(card["title"]).toBeUndefined();
926
+ expect(card["description"]).toBeUndefined();
927
+ });
928
+ });
929
+
930
+ describe("Access", () => {
931
+ test("edits the IP allowlist, one address or range per line", async () => {
932
+ await renderView();
933
+
934
+ const card: Props = access();
935
+
936
+ expect((card["cardProps"] as Props)["title"]).toBe("Access");
937
+ expect(card["editButtonText"]).toBe("Edit IP Allowlist");
938
+ expect(columnsOf(card["formFields"])).toEqual(["ipWhitelist"]);
939
+
940
+ const allowlist: Props = fieldFor(card["formFields"], "ipWhitelist");
941
+
942
+ expect(allowlist["title"]).toBe("IP Allowlist");
943
+ expect(allowlist["fieldType"]).toBe(FormFieldSchemaType.LongText);
944
+ expect(allowlist["description"]).toBe(
945
+ IncidentFormCopy.ipAllowlistDescription,
946
+ );
947
+ });
948
+
949
+ test("shows each address or range on its own line", async () => {
950
+ await renderView();
951
+
952
+ const allowlist: Props = fieldFor(detailFields(access()), "ipWhitelist");
953
+ const form: IncidentForm = new IncidentForm();
954
+ form.ipWhitelist = "203.0.113.0/24\n198.51.100.7\n";
955
+
956
+ const container: HTMLElement = renderElement(
957
+ (allowlist["getElement"] as (item: IncidentForm) => ReactElement)(form),
958
+ );
959
+
960
+ const shown: HTMLElement = container.querySelector(
961
+ '[data-testid="incident-form-ip-allowlist"]',
962
+ ) as HTMLElement;
963
+
964
+ expect(shown.textContent).toBe("203.0.113.0/24\n198.51.100.7");
965
+ expect(shown.className).toContain("whitespace-pre-line");
966
+ });
967
+
968
+ test("an empty allowlist says any network may open the form", async () => {
969
+ await renderView();
970
+
971
+ const allowlist: Props = fieldFor(detailFields(access()), "ipWhitelist");
972
+
973
+ for (const value of [undefined, "", " \n "]) {
974
+ const form: IncidentForm = new IncidentForm();
975
+
976
+ if (value !== undefined) {
977
+ form.ipWhitelist = value;
978
+ }
979
+
980
+ const container: HTMLElement = renderElement(
981
+ (allowlist["getElement"] as (item: IncidentForm) => ReactElement)(
982
+ form,
983
+ ),
984
+ );
985
+
986
+ expect(container).toHaveTextContent("Any network");
987
+ expect(
988
+ container.querySelector('[data-testid="incident-form-ip-allowlist"]'),
989
+ ).toBeNull();
990
+
991
+ cleanup();
992
+ }
993
+ });
994
+
995
+ test("says nothing about the plan when it allows the change", async () => {
996
+ mockIpAllowlistEditable = true;
997
+
998
+ await renderView();
999
+
1000
+ const card: Props = access();
1001
+
1002
+ expect((card["cardProps"] as Props)["description"]).toBe(
1003
+ IncidentFormCopy.accessDescription,
1004
+ );
1005
+ expect(fieldFor(card["formFields"], "ipWhitelist")["description"]).toBe(
1006
+ IncidentFormCopy.ipAllowlistDescription,
1007
+ );
1008
+ });
1009
+
1010
+ test("says, on the card and in the edit form, that the change needs the Scale plan", async () => {
1011
+ mockIpAllowlistEditable = false;
1012
+ mockTranslate = (value: string): string => {
1013
+ return `[de] ${value}`;
1014
+ };
1015
+
1016
+ await renderView();
1017
+
1018
+ const card: Props = access();
1019
+
1020
+ for (const description of [
1021
+ (card["cardProps"] as Props)["description"],
1022
+ fieldFor(card["formFields"], "ipWhitelist")["description"],
1023
+ ]) {
1024
+ const container: HTMLElement = renderElement(
1025
+ description as ReactElement,
1026
+ );
1027
+
1028
+ expect(
1029
+ container.querySelector(
1030
+ '[data-testid="incident-form-ip-allowlist-plan-note"]',
1031
+ ),
1032
+ ).toHaveTextContent(
1033
+ "[de] Editing the IP allowlist needs the Scale plan.",
1034
+ );
1035
+
1036
+ cleanup();
1037
+ }
1038
+
1039
+ expect(IncidentFormCopy.accessPlanNote).toContain("Scale plan");
1040
+ });
1041
+ });
1042
+
1043
+ describe("Submissions", () => {
1044
+ test("lists this form's submissions, newest first", async () => {
1045
+ await renderView();
1046
+
1047
+ const table: Props = submissions();
1048
+ const query: Props = table["query"] as Props;
1049
+
1050
+ expect(table["modelType"]).toBe(IncidentFormSubmission);
1051
+ expect(String(query["incidentFormId"])).toBe(FORM_ID);
1052
+ expect(String(query["projectId"])).toBe(PROJECT_ID);
1053
+ expect(table["sortBy"]).toBe("createdAt");
1054
+ expect(table["sortOrder"]).toBe(SortOrder.Descending);
1055
+ expect(table["id"]).toBe("incident-form-submissions-table");
1056
+ expect(table["userPreferencesKey"]).toBe(
1057
+ "incident-form-submissions-table",
1058
+ );
1059
+ });
1060
+
1061
+ test("cannot be created or edited, only deleted (as permissions allow)", async () => {
1062
+ await renderView();
1063
+
1064
+ const table: Props = submissions();
1065
+
1066
+ expect(table["isCreateable"]).toBe(false);
1067
+ expect(table["isEditable"]).toBe(false);
1068
+ expect(table["isViewable"]).toBe(false);
1069
+ expect(table["isDeleteable"]).toBe(true);
1070
+ expect(table["formFields"]).toBeUndefined();
1071
+ });
1072
+
1073
+ test("shows when, who and which incident", async () => {
1074
+ await renderView();
1075
+
1076
+ const table: Props = submissions();
1077
+
1078
+ expect(titlesOf(table["columns"])).toEqual([
1079
+ "Submitted At",
1080
+ "Reporter Name",
1081
+ "Reporter Email",
1082
+ "Incident",
1083
+ ]);
1084
+ expect(columnsOf(table["columns"])).toEqual([
1085
+ "createdAt",
1086
+ "reporterName",
1087
+ "reporterEmail",
1088
+ "incident",
1089
+ ]);
1090
+ expect(fieldFor(table["columns"], "createdAt")["type"]).toBe(
1091
+ FieldType.DateTime,
1092
+ );
1093
+ expect(fieldFor(table["columns"], "reporterEmail")["type"]).toBe(
1094
+ FieldType.Email,
1095
+ );
1096
+ expect((table["cardProps"] as Props)["title"]).toBe("Submissions");
1097
+ expect(table["noItemsMessage"]).toBe(IncidentFormCopy.submissionsEmpty);
1098
+ expect(table["singularName"]).toBe("Submission");
1099
+ expect(table["pluralName"]).toBe("Submissions");
1100
+ });
1101
+
1102
+ function submissionWithIncident(): IncidentFormSubmission {
1103
+ const submission: IncidentFormSubmission = new IncidentFormSubmission();
1104
+ const incident: Incident = new Incident();
1105
+ incident._id = INCIDENT_ID;
1106
+ incident.incidentNumber = 42;
1107
+ incident.incidentNumberWithPrefix = "INC-42";
1108
+ submission.incident = incident;
1109
+ submission.incidentId = new ObjectID(INCIDENT_ID);
1110
+ return submission;
1111
+ }
1112
+
1113
+ test("the incident is its number, linking to the incident", async () => {
1114
+ await renderView();
1115
+
1116
+ const column: Props = fieldFor(submissions()["columns"], "incident");
1117
+ const container: HTMLElement = renderElement(
1118
+ (
1119
+ column["getElement"] as (item: IncidentFormSubmission) => ReactElement
1120
+ )(submissionWithIncident()),
1121
+ );
1122
+
1123
+ const link: HTMLAnchorElement | null = container.querySelector("a");
1124
+
1125
+ expect(link).toHaveTextContent("INC-42");
1126
+ expect(link!.getAttribute("href")).toBe(
1127
+ route(PageMap.INCIDENT_VIEW, INCIDENT_ID),
1128
+ );
1129
+ expect(
1130
+ (column["getExportValue"] as (item: IncidentFormSubmission) => string)(
1131
+ submissionWithIncident(),
1132
+ ),
1133
+ ).toBe("INC-42");
1134
+ });
1135
+
1136
+ test("a project without an incident number prefix shows #42", async () => {
1137
+ await renderView();
1138
+
1139
+ const column: Props = fieldFor(submissions()["columns"], "incident");
1140
+ const submission: IncidentFormSubmission = submissionWithIncident();
1141
+ delete submission.incident!.incidentNumberWithPrefix;
1142
+
1143
+ const container: HTMLElement = renderElement(
1144
+ (
1145
+ column["getElement"] as (item: IncidentFormSubmission) => ReactElement
1146
+ )(submission),
1147
+ );
1148
+
1149
+ expect(container.querySelector("a")).toHaveTextContent("#42");
1150
+ });
1151
+
1152
+ test("a submission whose incident was deleted shows a dash and no link", async () => {
1153
+ await renderView();
1154
+
1155
+ const column: Props = fieldFor(submissions()["columns"], "incident");
1156
+ const container: HTMLElement = renderElement(
1157
+ (
1158
+ column["getElement"] as (item: IncidentFormSubmission) => ReactElement
1159
+ )(new IncidentFormSubmission()),
1160
+ );
1161
+
1162
+ expect(container).toHaveTextContent("-");
1163
+ expect(container.querySelector("a")).toBeNull();
1164
+ expect(
1165
+ (column["getExportValue"] as (item: IncidentFormSubmission) => string)(
1166
+ new IncidentFormSubmission(),
1167
+ ),
1168
+ ).toBe("");
1169
+ });
1170
+
1171
+ test("View Incident opens the submission's incident", async () => {
1172
+ await renderView();
1173
+
1174
+ const actions: Array<Props> = submissions()[
1175
+ "actionButtons"
1176
+ ] as Array<Props>;
1177
+
1178
+ expect(titlesOf(actions)).toEqual(["View Incident"]);
1179
+
1180
+ const viewIncident: Props = actions[0]!;
1181
+ let completed: number = 0;
1182
+
1183
+ (
1184
+ viewIncident["onClick"] as (
1185
+ item: IncidentFormSubmission,
1186
+ onCompleteAction: () => void,
1187
+ ) => void
1188
+ )(submissionWithIncident(), (): void => {
1189
+ completed++;
1190
+ });
1191
+
1192
+ expect(navigateSpy).toHaveBeenCalledTimes(1);
1193
+ expect(String(navigateSpy.mock.calls[0]![0])).toBe(
1194
+ route(PageMap.INCIDENT_VIEW, INCIDENT_ID),
1195
+ );
1196
+ expect(completed).toBe(1);
1197
+ });
1198
+
1199
+ test("View Incident reads the incident id column when the relation was not joined", async () => {
1200
+ await renderView();
1201
+
1202
+ const viewIncident: Props = (
1203
+ submissions()["actionButtons"] as Array<Props>
1204
+ )[0]!;
1205
+ const submission: IncidentFormSubmission = new IncidentFormSubmission();
1206
+ submission.incidentId = new ObjectID(INCIDENT_ID);
1207
+
1208
+ expect(
1209
+ (
1210
+ viewIncident["isVisible"] as (item: IncidentFormSubmission) => boolean
1211
+ )(submission),
1212
+ ).toBe(true);
1213
+
1214
+ (
1215
+ viewIncident["onClick"] as (
1216
+ item: IncidentFormSubmission,
1217
+ onCompleteAction: () => void,
1218
+ ) => void
1219
+ )(submission, (): void => {});
1220
+
1221
+ expect(String(navigateSpy.mock.calls[0]![0])).toBe(
1222
+ route(PageMap.INCIDENT_VIEW, INCIDENT_ID),
1223
+ );
1224
+ expect(submissions()["selectMoreFields"]).toEqual({ incidentId: true });
1225
+ });
1226
+
1227
+ test("View Incident is hidden, and does nothing, when the incident is gone", async () => {
1228
+ await renderView();
1229
+
1230
+ const viewIncident: Props = (
1231
+ submissions()["actionButtons"] as Array<Props>
1232
+ )[0]!;
1233
+ let completed: number = 0;
1234
+
1235
+ expect(
1236
+ (
1237
+ viewIncident["isVisible"] as (item: IncidentFormSubmission) => boolean
1238
+ )(new IncidentFormSubmission()),
1239
+ ).toBe(false);
1240
+
1241
+ (
1242
+ viewIncident["onClick"] as (
1243
+ item: IncidentFormSubmission,
1244
+ onCompleteAction: () => void,
1245
+ ) => void
1246
+ )(new IncidentFormSubmission(), (): void => {
1247
+ completed++;
1248
+ });
1249
+
1250
+ expect(navigateSpy).not.toHaveBeenCalled();
1251
+ expect(completed).toBe(1);
1252
+ });
1253
+
1254
+ test("deleting a submission says the incident stays", async () => {
1255
+ await renderView();
1256
+
1257
+ const confirmation: Props = await (
1258
+ submissions()["getDeleteConfirmation"] as () => Promise<Props>
1259
+ )();
1260
+
1261
+ expect(confirmation).toEqual({
1262
+ title: "Delete Submission",
1263
+ description: IncidentFormCopy.deleteSubmissionDescription,
1264
+ submitButtonText: "Delete",
1265
+ });
1266
+ expect(IncidentFormCopy.deleteSubmissionDescription).toContain(
1267
+ "The incident it declared is not deleted",
1268
+ );
1269
+ });
1270
+
1271
+ test("filters by when and by whom", async () => {
1272
+ await renderView();
1273
+
1274
+ const filters: unknown = submissions()["filters"];
1275
+
1276
+ expect(columnsOf(filters)).toEqual([
1277
+ "createdAt",
1278
+ "reporterName",
1279
+ "reporterEmail",
1280
+ ]);
1281
+ expect(titlesOf(filters)).toEqual([
1282
+ "Submitted At",
1283
+ "Reporter Name",
1284
+ "Reporter Email",
1285
+ ]);
1286
+ });
1287
+ });
1288
+
1289
+ describe("Delete", () => {
1290
+ test("deletes this form and goes back to the list", async () => {
1291
+ await renderView();
1292
+
1293
+ const deleteCard: Props = last(recordedDeletes);
1294
+
1295
+ expect(deleteCard["modelType"]).toBe(IncidentForm);
1296
+
1297
+ (deleteCard["onDeleteSuccess"] as () => void)();
1298
+
1299
+ expect(navigateSpy).toHaveBeenCalledTimes(1);
1300
+ expect(String(navigateSpy.mock.calls[0]![0])).toBe(
1301
+ `/dashboard/${PROJECT_ID}/incidents/settings/forms`,
1302
+ );
1303
+ });
1304
+
1305
+ test("the confirmation says the submissions go with it, and the incidents stay", async () => {
1306
+ mockTranslate = (value: string): string => {
1307
+ return `[de] ${value}`;
1308
+ };
1309
+
1310
+ await renderView();
1311
+
1312
+ const container: HTMLElement = renderElement(
1313
+ last(recordedDeletes)["confirmationContent"] as ReactElement,
1314
+ );
1315
+
1316
+ expect(container).toHaveTextContent(
1317
+ `[de] ${IncidentFormCopy.deleteFormNote}`,
1318
+ );
1319
+ expect(IncidentFormCopy.deleteFormNote).toBe(
1320
+ "Its submissions are deleted with it. The incidents it declared are not deleted.",
1321
+ );
1322
+ });
1323
+ });
1324
+ });