@oneuptime/common 12.0.8 → 12.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +1 -1
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +1 -1
- package/Models/DatabaseModels/AIConversation.ts +32 -0
- package/Models/DatabaseModels/AIConversationMessage.ts +41 -0
- package/Models/DatabaseModels/AlertEpisodeMember.ts +27 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.ts +28 -0
- package/Models/DatabaseModels/Index.ts +12 -4
- package/Models/DatabaseModels/{TelemetryEntity.ts → InventoryItem.ts} +139 -9
- package/Models/DatabaseModels/InventoryItemCustomField.ts +434 -0
- package/Models/DatabaseModels/{TelemetryEntityRelationship.ts → InventoryItemRelationship.ts} +8 -8
- package/Models/DatabaseModels/NetworkDevice.ts +141 -0
- package/Models/DatabaseModels/NetworkDeviceLink.ts +699 -0
- package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +467 -0
- package/Models/DatabaseModels/NetworkTopologySuppression.ts +429 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.ts +9 -0
- package/Models/DatabaseModels/Project.ts +78 -0
- package/Models/DatabaseModels/UserCall.ts +42 -0
- package/Models/DatabaseModels/UserEmail.ts +44 -0
- package/Models/DatabaseModels/UserNotificationRule.ts +425 -55
- package/Models/DatabaseModels/UserOnCallLogTimeline.ts +24 -2
- package/Models/DatabaseModels/UserPush.ts +49 -0
- package/Models/DatabaseModels/UserSMS.ts +43 -0
- package/Models/DatabaseModels/UserTelegram.ts +59 -0
- package/Models/DatabaseModels/UserWebhook.ts +52 -0
- package/Models/DatabaseModels/UserWhatsApp.ts +41 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +12 -0
- package/Server/API/AIChatAPI.ts +315 -1
- package/Server/API/DashboardAPI.ts +217 -1
- package/Server/API/OnCallReadinessAPI.ts +841 -0
- package/Server/API/TeamComplianceAPI.ts +69 -17
- package/Server/API/TelemetryAPI.ts +220 -12
- package/Server/EnvironmentConfig.ts +52 -0
- package/Server/Infrastructure/Postgres/DataSourceOptions.ts +22 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.ts +4 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.ts +5 -5
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.ts +82 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.ts +91 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.ts +255 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.ts +107 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.ts +90 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.ts +39 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +20 -0
- package/Server/Infrastructure/Queue.ts +78 -13
- package/Server/Middleware/PublicDashboardRateLimit.ts +593 -0
- package/Server/Services/AIService.ts +7 -0
- package/Server/Services/AlertEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/AlertSeverityService.ts +63 -0
- package/Server/Services/DashboardService.ts +9 -10
- package/Server/Services/DatabaseService.ts +32 -2
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/IncidentSeverityService.ts +76 -0
- package/Server/Services/Index.ts +12 -4
- package/Server/Services/InventoryItemCustomFieldService.ts +9 -0
- package/Server/Services/{TelemetryEntityRelationshipService.ts → InventoryItemRelationshipService.ts} +4 -4
- package/Server/Services/{TelemetryEntityService.ts → InventoryItemService.ts} +89 -20
- package/Server/Services/LogAggregationService.ts +45 -8
- package/Server/Services/MetricAggregationService.ts +121 -0
- package/Server/Services/MetricService.ts +7 -7
- package/Server/Services/NetworkDeviceLinkRuleService.ts +10 -0
- package/Server/Services/NetworkDeviceLinkService.ts +84 -0
- package/Server/Services/NetworkDeviceService.ts +140 -0
- package/Server/Services/NetworkSiteService.ts +77 -25
- package/Server/Services/NetworkTopologySuppressionService.ts +84 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +41 -29
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +8 -0
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +62 -13
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +61 -1
- package/Server/Services/OnCallNotificationAlertingService.ts +742 -0
- package/Server/Services/OnCallReadinessService.ts +2803 -0
- package/Server/Services/OnCallSetupReminderService.ts +955 -0
- package/Server/Services/ProfileAggregationService.ts +123 -0
- package/Server/Services/StatusPageService.ts +9 -10
- package/Server/Services/TeamComplianceService.ts +429 -252
- package/Server/Services/UserCallService.ts +26 -1
- package/Server/Services/UserEmailService.ts +26 -1
- package/Server/Services/UserNotificationRuleAdminService.ts +1183 -0
- package/Server/Services/UserNotificationRuleService.ts +3812 -333
- package/Server/Services/UserOnCallLogService.ts +561 -48
- package/Server/Services/UserPushService.ts +29 -0
- package/Server/Services/UserService.ts +11 -0
- package/Server/Services/UserSmsService.ts +26 -1
- package/Server/Services/UserTelegramService.ts +24 -1
- package/Server/Services/UserWebhookService.ts +28 -1
- package/Server/Services/UserWhatsAppService.ts +24 -1
- package/Server/Types/Database/Permissions/BasePermission.ts +19 -0
- package/Server/Types/Database/Permissions/CreatePermission.ts +164 -0
- package/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.ts +340 -0
- package/Server/Types/Database/Permissions/QueryPermission.ts +48 -0
- package/Server/Types/Database/Permissions/TenantPermission.ts +8 -1
- package/Server/Types/Workflow/Components/API/Delete.ts +1 -1
- package/Server/Types/Workflow/Components/API/Get.ts +1 -1
- package/Server/Types/Workflow/Components/API/Patch.ts +1 -1
- package/Server/Types/Workflow/Components/API/Post.ts +1 -1
- package/Server/Types/Workflow/Components/API/Put.ts +1 -1
- package/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.ts +29 -5
- package/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.ts +18 -10
- package/Server/Types/Workflow/Components/BaseModel/ModelArguments.ts +55 -0
- package/Server/Types/Workflow/Components/Conditions/IfElse.ts +3 -17
- package/Server/Types/Workflow/Components/Email.ts +25 -7
- package/Server/Types/Workflow/Components/JavaScript.ts +10 -3
- package/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.ts +1 -1
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +643 -48
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +32 -3
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +20 -6
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +7 -0
- package/Server/Utils/AI/Toolbox/AIActionTools.ts +2 -2
- package/Server/Utils/AI/Toolbox/AIMetaTools.ts +863 -0
- package/Server/Utils/AI/Toolbox/AlertTools.ts +177 -15
- package/Server/Utils/AI/Toolbox/IncidentTools.ts +191 -10
- package/Server/Utils/AI/Toolbox/Index.ts +48 -0
- package/Server/Utils/AI/Toolbox/MonitorTools.ts +298 -11
- package/Server/Utils/AI/Toolbox/NoteWriteTools.ts +295 -0
- package/Server/Utils/AI/Toolbox/OnCallTools.ts +1246 -0
- package/Server/Utils/AI/Toolbox/RunbookTools.ts +424 -0
- package/Server/Utils/AI/Toolbox/SloTools.ts +456 -0
- package/Server/Utils/AI/Toolbox/StatusPageTools.ts +559 -0
- package/Server/Utils/AI/Toolbox/TeamTools.ts +327 -0
- package/Server/Utils/AI/Toolbox/TimelineTools.ts +615 -0
- package/Server/Utils/AI/Toolbox/WorkflowProbeTools.ts +664 -0
- package/Server/Utils/ClientIp.ts +221 -0
- package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +47 -0
- package/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.ts +163 -0
- package/Server/Utils/Dashboard/PublicDashboardSloWidget.ts +147 -0
- package/Server/Utils/Express.ts +12 -17
- package/Server/Utils/LLM/LLMService.ts +85 -8
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +204 -10
- package/Server/Utils/SSRFProtection.ts +98 -23
- package/Server/Utils/StartServer.ts +12 -3
- package/Server/Utils/Telemetry/EntityRegistry.ts +205 -18
- package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +25 -25
- package/Server/Utils/Telemetry/TelemetryEntity.ts +160 -52
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +7 -3
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +2146 -0
- package/Tests/App/Dashboard/CreateWorkflowModal.test.tsx +561 -0
- package/Tests/App/Dashboard/EscalationRuleReadiness.test.tsx +2470 -0
- package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +1897 -0
- package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3606 -0
- package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +784 -0
- package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +1119 -0
- package/Tests/App/Dashboard/SloWidgetFetching.test.tsx +531 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +1312 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistPage.test.tsx +1390 -0
- package/Tests/Models/InventoryItemModel.test.ts +174 -0
- package/Tests/Models/InventoryItemNaming.test.ts +302 -0
- package/Tests/Server/API/AIChatCancelAndFeedback.test.ts +437 -0
- package/Tests/Server/API/DashboardPublicRateLimit.test.ts +659 -0
- package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +18 -0
- package/Tests/Server/API/DashboardPublicSloAPI.test.ts +880 -0
- package/Tests/Server/API/Helpers.ts +24 -15
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +2680 -0
- package/Tests/Server/API/OnCallSetupReminderAPI.test.ts +915 -0
- package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +533 -0
- package/Tests/Server/Infrastructure/Postgres/InventoryItemArchiveMigration.test.ts +213 -0
- package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +432 -0
- package/Tests/Server/Infrastructure/Queue.test.ts +293 -0
- package/Tests/Server/Middleware/PublicDashboardRateLimit.test.ts +1645 -0
- package/Tests/Server/Services/AdminRuleEditGuards.test.ts +2848 -0
- package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +1393 -0
- package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +1802 -0
- package/Tests/Server/Services/EpisodeStateTimelineNote.test.ts +304 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +339 -0
- package/Tests/Server/Services/{TelemetryEntityManualCreate.test.ts → InventoryItemManualCreate.test.ts} +27 -27
- package/Tests/Server/Services/IpAllowlistSpoofing.test.ts +450 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +235 -1
- package/Tests/Server/Services/MetricAggregationService.test.ts +231 -0
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +80 -29
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +30 -30
- package/Tests/Server/Services/NetworkSiteService.test.ts +18 -3
- package/Tests/Server/Services/NotificationChannelEventCoverage.test.ts +1728 -0
- package/Tests/Server/Services/NotificationDeletionImpact.test.ts +2402 -0
- package/Tests/Server/Services/OnCallDutyPolicyExecutionLogTimelineGapFeed.test.ts +394 -0
- package/Tests/Server/Services/OnCallNotificationFallback.test.ts +1744 -0
- package/Tests/Server/Services/OnCallReadinessService.test.ts +4295 -0
- package/Tests/Server/Services/OnCallSetupReminder.test.ts +1272 -0
- package/Tests/Server/Services/OnCallWeeklyReadinessDigest.test.ts +1021 -0
- package/Tests/Server/Services/ProfileAggregationService.test.ts +296 -0
- package/Tests/Server/Services/SeverityCreationRuleBackfill.test.ts +1536 -0
- package/Tests/Server/Services/SeverityRuleBackfill.test.ts +1818 -0
- package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +1845 -0
- package/Tests/Server/Services/UserNotificationRuleAdminGuards.test.ts +1394 -0
- package/Tests/Server/Services/UserNotificationRuleDefaultCreation.test.ts +1166 -0
- package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +1468 -0
- package/Tests/Server/Services/UserOnCallLogNoNotificationRules.test.ts +1457 -0
- package/Tests/Server/Types/Database/Permissions/AdminNotificationRuleAccess.test.ts +1546 -0
- package/Tests/Server/Types/Database/Permissions/CreateOwnershipScoping.test.ts +529 -0
- package/Tests/Server/Types/Database/Permissions/OwnerOnlyColumns.test.ts +1219 -0
- package/Tests/Server/Types/Database/Permissions/UserNotificationRuleScoping.test.ts +1089 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +2 -1
- package/Tests/Server/Types/Workflow/Components/BaseModelDatabaseComponents.test.ts +190 -0
- package/Tests/Server/Types/Workflow/Components/ChatWebhookComponents.test.ts +44 -14
- package/Tests/Server/Types/Workflow/Components/Email.test.ts +151 -0
- package/Tests/Server/Types/Workflow/Components/IfElse.test.ts +98 -0
- package/Tests/Server/Types/Workflow/Components/JavaScript.test.ts +51 -0
- package/Tests/Server/Utils/AI/AIMetaTools.test.ts +586 -0
- package/Tests/Server/Utils/AI/AlertMonitorFilters.test.ts +582 -0
- package/Tests/Server/Utils/AI/ChatAgentRunner.test.ts +726 -0
- package/Tests/Server/Utils/AI/IncidentToolsFilters.test.ts +315 -0
- package/Tests/Server/Utils/AI/LLMServiceStopReason.test.ts +314 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +26 -3
- package/Tests/Server/Utils/AI/NoteWriteTools.test.ts +268 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +169 -0
- package/Tests/Server/Utils/AI/OnCallTools.test.ts +664 -0
- package/Tests/Server/Utils/AI/RunbookTools.test.ts +325 -0
- package/Tests/Server/Utils/AI/SloTools.test.ts +306 -0
- package/Tests/Server/Utils/AI/StatusPageTools.test.ts +391 -0
- package/Tests/Server/Utils/AI/TeamTools.test.ts +257 -0
- package/Tests/Server/Utils/AI/TimelineTools.test.ts +472 -0
- package/Tests/Server/Utils/AI/WorkflowProbeTools.test.ts +428 -0
- package/Tests/Server/Utils/ClientIp.test.ts +438 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +171 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.test.ts +383 -0
- package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +23 -25
- package/Tests/Server/Utils/MicrosoftTeamsWebhookUrlValidation.test.ts +6 -0
- package/Tests/Server/Utils/Monitor/Criteria/DnssecMonitorCriteria.test.ts +307 -0
- package/Tests/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.test.ts +468 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorTelemetryDeepLinks.test.ts +460 -0
- package/Tests/Server/Utils/ResponseRateLimitStatusCodes.test.ts +137 -0
- package/Tests/Server/Utils/SSRFProtectionBypasses.test.ts +40 -8
- package/Tests/Server/Utils/SSRFProtectionUserInfo.test.ts +351 -0
- package/Tests/Server/Utils/Telemetry/EntityRegistryRetirement.test.ts +531 -0
- package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +15 -15
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +356 -39
- package/Tests/Types/IP/IP.test.ts +263 -0
- package/Tests/Types/IP/IPWhitelist.test.ts +197 -0
- package/Tests/Types/IP/IPv6.test.ts +12 -1
- package/Tests/Types/Monitor/SnmpOid.test.ts +64 -0
- package/Tests/Types/NetworkDevice/NetworkDeviceMonitoringMethod.test.ts +110 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +106 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeDifferential.test.ts +511 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageEndToEnd.test.ts +489 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageGapTolerance.test.ts +479 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageState.test.ts +822 -0
- package/Tests/Types/Telemetry/EntityTypeGroups.test.ts +6 -6
- package/Tests/Types/Workflow/BaseModelComponents.test.ts +429 -0
- package/Tests/Types/Workflow/Components/BaseModel.test.ts +225 -0
- package/Tests/Types/Workflow/IntegrationCredentialMetadata.test.ts +100 -0
- package/Tests/Types/Workflow/TemplateSyntax.test.ts +112 -0
- package/Tests/Types/Workflow/Templates.test.ts +916 -101
- package/Tests/UI/Components/ActiveFilterChipsOpenRoute.test.tsx +82 -0
- package/Tests/UI/Components/ComponentsModal.test.tsx +564 -7
- package/Tests/UI/Components/KeyboardShortcut.test.tsx +95 -0
- package/Tests/UI/Components/LogDetailsPanelCrossSignal.test.tsx +448 -0
- package/Tests/UI/Components/LogsTableCrossLinks.test.tsx +263 -0
- package/Tests/UI/Components/PendingProjectInvitations.test.tsx +913 -0
- package/Tests/UI/Components/SimpleLogViewer.test.tsx +228 -0
- package/Tests/UI/Components/TableRowSelectability.test.tsx +312 -0
- package/Tests/UI/Components/Workflow/GraphLint.test.ts +72 -0
- package/Tests/UI/Components/Workflow/GraphLintSummary.test.ts +755 -0
- package/Tests/UI/Components/Workflow/ModelColumnEditor.test.ts +242 -7
- package/Tests/UI/Components/Workflow/ModelColumnEditorServerContract.test.ts +15 -7
- package/Tests/UI/Components/Workflow/ModelSchema.test.ts +242 -28
- package/Tests/UI/Components/Workflow/RunStatusWatcher.test.ts +59 -1
- package/Tests/UI/Components/Workflow/StepTraceViewer.test.tsx +256 -0
- package/Tests/UI/Components/Workflow/UseRunWatch.test.tsx +665 -0
- package/Tests/UI/Components/Workflow/WorkflowIssuesModal.test.tsx +485 -0
- package/Tests/UI/Components/Workflow/WorkflowLogModal.test.tsx +478 -0
- package/Tests/UI/Components/Workflow/WorkflowStatusBar.test.tsx +379 -0
- package/Tests/UI/EsbuildConfig.test.ts +607 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +11 -4
- package/Tests/UI/Utils/ModelAPICreateMiscData.test.ts +94 -0
- package/Tests/UI/Utils/Platform.test.ts +147 -0
- package/Tests/UI/Utils/ProjectInvitationDisplay.test.ts +357 -0
- package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +198 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +487 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +698 -0
- package/Tests/__mocks__/bullmq.js +55 -0
- package/Types/AI/AIChatMessageStatus.ts +8 -1
- package/Types/AI/AIChatTypes.ts +12 -0
- package/Types/Database/AccessControl/OwnerOnlyColumn.ts +88 -0
- package/Types/Exception/ExceptionCode.ts +2 -0
- package/Types/Exception/ServiceUnavailableException.ts +8 -0
- package/Types/Exception/TooManyRequestsException.ts +8 -0
- package/Types/IP/IP.ts +93 -47
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +49 -3
- package/Types/NetworkDevice/NetworkDeviceMonitoringMethod.ts +55 -0
- package/Types/OnCallDutyPolicy/Layer.ts +203 -149
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +13 -0
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +155 -10
- package/Types/Permission.ts +193 -0
- package/Types/Telemetry/EntityRelationshipType.ts +1 -1
- package/Types/Telemetry/EntitySource.ts +1 -1
- package/Types/Telemetry/EntityType.ts +1 -1
- package/Types/Telemetry/EntityTypeGroups.ts +1 -1
- package/Types/Workflow/Components/BaseModel.ts +75 -29
- package/Types/Workflow/Components/Discord.ts +1 -0
- package/Types/Workflow/Components/Email.ts +12 -3
- package/Types/Workflow/Components/JavaScript.ts +7 -0
- package/Types/Workflow/Components/MicrosoftTeams.ts +3 -2
- package/Types/Workflow/Components/Slack.ts +1 -0
- package/Types/Workflow/Components/Telegram.ts +1 -0
- package/Types/Workflow/TemplateSyntax.ts +44 -0
- package/Types/Workflow/Templates.ts +2097 -45
- package/UI/Components/Calendar/Calendar.css +43 -0
- package/UI/Components/Calendar/Calendar.tsx +8 -0
- package/UI/Components/Card/Card.tsx +2 -2
- package/UI/Components/Checkbox/Checkbox.tsx +16 -0
- package/UI/Components/Dictionary/Dictionary.tsx +48 -9
- package/UI/Components/FormModal/BasicFormModal.tsx +2 -1
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +53 -3
- package/UI/Components/Input/Input.tsx +1 -0
- package/UI/Components/KeyboardShortcut/KeyboardKey.ts +185 -0
- package/UI/Components/KeyboardShortcut/KeyboardShortcut.tsx +87 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +28 -0
- package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +31 -0
- package/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.tsx +18 -18
- package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +363 -14
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +11 -0
- package/UI/Components/LogsViewer/components/LogsTable.tsx +155 -12
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +29 -0
- package/UI/Components/LogsViewer/types.ts +23 -0
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +9 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +15 -30
- package/UI/Components/ProjectInvitations/PendingProjectInvitations.tsx +442 -0
- package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +23 -1
- package/UI/Components/Table/Table.tsx +49 -16
- package/UI/Components/Table/TableBody.tsx +53 -28
- package/UI/Components/Table/TableHeader.tsx +13 -0
- package/UI/Components/Table/TableRow.tsx +58 -26
- package/UI/Components/Workflow/ArgumentsForm.tsx +155 -9
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +26 -0
- package/UI/Components/Workflow/ComponentSettingsModal.tsx +10 -1
- package/UI/Components/Workflow/ComponentValuePickerModal.tsx +135 -7
- package/UI/Components/Workflow/ComponentsModal.tsx +116 -22
- package/UI/Components/Workflow/DocumentationViewer.tsx +59 -9
- package/UI/Components/Workflow/GraphLint.ts +42 -5
- package/UI/Components/Workflow/GraphLintSummary.ts +390 -0
- package/UI/Components/Workflow/ModelColumnEditor.tsx +154 -22
- package/UI/Components/Workflow/ModelSchema.ts +115 -33
- package/UI/Components/Workflow/RunStatusWatcher.ts +1 -1
- package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
- package/UI/Components/Workflow/UseRunWatch.ts +212 -0
- package/UI/Components/Workflow/VariableModal.tsx +6 -2
- package/UI/Components/Workflow/Workflow.tsx +49 -3
- package/UI/Components/Workflow/WorkflowIssuesModal.tsx +255 -0
- package/UI/Components/Workflow/WorkflowLogModal.tsx +128 -0
- package/UI/Components/Workflow/WorkflowStatusBar.tsx +224 -0
- package/UI/Utils/AIChatExport/ConversationMarkdown.ts +10 -0
- package/UI/Utils/ModelAPI/ModelAPI.ts +7 -1
- package/UI/Utils/Platform.ts +149 -0
- package/UI/Utils/ProjectInvitationDisplay.ts +118 -0
- package/UI/esbuild-config.js +22 -1
- package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +187 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +888 -164
- package/Utils/Telemetry/CrossSignalScope.ts +502 -0
- package/Utils/Telemetry/EntityKey.ts +5 -5
- package/Utils/Telemetry/EntityRelationship.ts +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +1 -1
- package/build/dist/Models/DatabaseModels/AIConversation.js +32 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js +42 -0
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js +28 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js +29 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +12 -4
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/{TelemetryEntity.js → InventoryItem.js} +167 -31
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js +454 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js.map +1 -0
- package/build/dist/Models/DatabaseModels/{TelemetryEntityRelationship.js → InventoryItemRelationship.js} +27 -27
- package/build/dist/Models/DatabaseModels/InventoryItemRelationship.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +141 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +719 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +475 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js +446 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js +9 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +80 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserCall.js +46 -2
- package/build/dist/Models/DatabaseModels/UserCall.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserEmail.js +48 -2
- package/build/dist/Models/DatabaseModels/UserEmail.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js +424 -55
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +24 -2
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserPush.js +51 -1
- package/build/dist/Models/DatabaseModels/UserPush.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserSMS.js +47 -2
- package/build/dist/Models/DatabaseModels/UserSMS.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserTelegram.js +65 -3
- package/build/dist/Models/DatabaseModels/UserTelegram.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWebhook.js +56 -2
- package/build/dist/Models/DatabaseModels/UserWebhook.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js +45 -2
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +12 -0
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +237 -1
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +165 -13
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/OnCallReadinessAPI.js +599 -0
- package/build/dist/Server/API/OnCallReadinessAPI.js.map +1 -0
- package/build/dist/Server/API/TeamComplianceAPI.js +68 -9
- package/build/dist/Server/API/TeamComplianceAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +129 -18
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +45 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js +4 -4
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js +150 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js +57 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js +69 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js +48 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +72 -13
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js +399 -0
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js.map +1 -0
- package/build/dist/Server/Services/AIService.js +1 -0
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AlertSeverityService.js +54 -0
- package/build/dist/Server/Services/AlertSeverityService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +10 -9
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +24 -2
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSeverityService.js +67 -0
- package/build/dist/Server/Services/IncidentSeverityService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +12 -4
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js +9 -0
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityRelationshipService.js → InventoryItemRelationshipService.js} +6 -6
- package/build/dist/Server/Services/InventoryItemRelationshipService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityService.js → InventoryItemService.js} +68 -23
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -0
- package/build/dist/Server/Services/LogAggregationService.js +27 -8
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +80 -0
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +6 -6
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +113 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +53 -13
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js +85 -0
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +48 -32
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +8 -0
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +51 -12
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +57 -13
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js +548 -0
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js.map +1 -0
- package/build/dist/Server/Services/OnCallReadinessService.js +1961 -0
- package/build/dist/Server/Services/OnCallReadinessService.js.map +1 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js +738 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js.map +1 -0
- package/build/dist/Server/Services/ProfileAggregationService.js +68 -4
- package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +11 -10
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamComplianceService.js +312 -160
- package/build/dist/Server/Services/TeamComplianceService.js.map +1 -1
- package/build/dist/Server/Services/UserCallService.js +24 -1
- package/build/dist/Server/Services/UserCallService.js.map +1 -1
- package/build/dist/Server/Services/UserEmailService.js +24 -1
- package/build/dist/Server/Services/UserEmailService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js +858 -0
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationRuleService.js +2830 -175
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogService.js +488 -43
- package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
- package/build/dist/Server/Services/UserPushService.js +26 -0
- package/build/dist/Server/Services/UserPushService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +10 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserSmsService.js +24 -1
- package/build/dist/Server/Services/UserSmsService.js.map +1 -1
- package/build/dist/Server/Services/UserTelegramService.js +22 -1
- package/build/dist/Server/Services/UserTelegramService.js.map +1 -1
- package/build/dist/Server/Services/UserWebhookService.js +25 -1
- package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +22 -1
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js +12 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +126 -0
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js +254 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js.map +1 -0
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js +47 -2
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +7 -0
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js +21 -5
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js +14 -10
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js +31 -0
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +3 -9
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +15 -4
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +7 -2
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +514 -56
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +20 -3
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +19 -6
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +7 -0
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js +2 -2
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js +692 -0
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +148 -12
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +157 -10
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +37 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +259 -14
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js +235 -0
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js +1000 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js +356 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +394 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js +465 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js +280 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +527 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js +548 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js.map +1 -0
- package/build/dist/Server/Utils/ClientIp.js +137 -0
- package/build/dist/Server/Utils/ClientIp.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +38 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js +89 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js +77 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js.map +1 -0
- package/build/dist/Server/Utils/Express.js +12 -12
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +70 -7
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +121 -11
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/SSRFProtection.js +82 -21
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +12 -4
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +165 -18
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +11 -11
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +122 -47
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +7 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js +8 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -1
- package/build/dist/Types/AI/AIChatTypes.js +12 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +60 -0
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -0
- package/build/dist/Types/Exception/ExceptionCode.js +2 -0
- package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
- package/build/dist/Types/Exception/ServiceUnavailableException.js +8 -0
- package/build/dist/Types/Exception/ServiceUnavailableException.js.map +1 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js +8 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js.map +1 -0
- package/build/dist/Types/IP/IP.js +87 -43
- package/build/dist/Types/IP/IP.js.map +1 -1
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js +50 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +186 -123
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js +13 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +105 -11
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
- package/build/dist/Types/Permission.js +174 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityRelationshipType.js +1 -1
- package/build/dist/Types/Telemetry/EntitySource.js +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js.map +1 -1
- package/build/dist/Types/Workflow/Components/BaseModel.js +66 -28
- package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Discord.js +1 -0
- package/build/dist/Types/Workflow/Components/Discord.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +12 -3
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Types/Workflow/Components/JavaScript.js +7 -0
- package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +3 -2
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Slack.js +1 -0
- package/build/dist/Types/Workflow/Components/Slack.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Telegram.js +1 -0
- package/build/dist/Types/Workflow/Components/Telegram.js.map +1 -1
- package/build/dist/Types/Workflow/TemplateSyntax.js +12 -0
- package/build/dist/Types/Workflow/TemplateSyntax.js.map +1 -1
- package/build/dist/Types/Workflow/Templates.js +1931 -38
- package/build/dist/Types/Workflow/Templates.js.map +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js.map +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js +25 -11
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +27 -4
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +1 -0
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js +163 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js.map +1 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js +47 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js.map +1 -0
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +4 -4
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +11 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js +10 -8
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +227 -14
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +5 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +69 -5
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +8 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +9 -2
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +8 -21
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js +251 -0
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js.map +1 -0
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +9 -2
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +27 -15
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableBody.js +24 -18
- package/build/dist/UI/Components/Table/TableBody.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +9 -1
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +29 -21
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js +130 -12
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +10 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +4 -4
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js +57 -7
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +53 -18
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js +19 -6
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLint.js +33 -4
- package/build/dist/UI/Components/Workflow/GraphLint.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js +231 -0
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +116 -21
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ModelSchema.js +72 -34
- package/build/dist/UI/Components/Workflow/ModelSchema.js.map +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js.map +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/UseRunWatch.js +123 -0
- package/build/dist/UI/Components/Workflow/UseRunWatch.js.map +1 -0
- package/build/dist/UI/Components/Workflow/VariableModal.js +3 -2
- package/build/dist/UI/Components/Workflow/VariableModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +41 -1
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js +99 -0
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js +56 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js +92 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +9 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/Platform.js +118 -0
- package/build/dist/UI/Utils/Platform.js.map +1 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js +106 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +108 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +642 -136
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +328 -0
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +5 -5
- package/build/dist/Utils/Telemetry/EntityRelationship.js +1 -1
- package/jest.config.json +1 -0
- package/package.json +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntity.js.map +0 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityService.js.map +0 -1
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import API from "../../Utils/API/API";
|
|
2
|
+
import ModelAPI from "../../Utils/ModelAPI/ModelAPI";
|
|
3
|
+
import ProjectInvitationDisplay from "../../Utils/ProjectInvitationDisplay";
|
|
4
|
+
import User from "../../Utils/User";
|
|
5
|
+
import Button, { ButtonSize, ButtonStyleType } from "../Button/Button";
|
|
6
|
+
import ErrorMessage from "../ErrorMessage/ErrorMessage";
|
|
7
|
+
import Icon, { SizeProp } from "../Icon/Icon";
|
|
8
|
+
import ConfirmModal from "../Modal/ConfirmModal";
|
|
9
|
+
import TeamMember from "../../../Models/DatabaseModels/TeamMember";
|
|
10
|
+
import TeamMembersByProject from "../../../Utils/TeamMembersByProject";
|
|
11
|
+
import SortOrder from "../../../Types/BaseDatabase/SortOrder";
|
|
12
|
+
import { LIMIT_PER_PROJECT } from "../../../Types/Database/LimitMax";
|
|
13
|
+
import OneUptimeDate from "../../../Types/Date";
|
|
14
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
15
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
16
|
+
import React, { useState } from "react";
|
|
17
|
+
import useAsyncEffect from "use-async-effect";
|
|
18
|
+
/*
|
|
19
|
+
* Every project the signed-in user has been invited to and has not accepted
|
|
20
|
+
* yet, offered for acceptance in place.
|
|
21
|
+
*
|
|
22
|
+
* The list is memberships grouped into projects, not memberships: a person
|
|
23
|
+
* invited to three teams of one project is invited to ONE project, and asking
|
|
24
|
+
* them to press Accept three times to get in reads as three separate invites
|
|
25
|
+
* from the same company. Accepting a card therefore accepts every membership
|
|
26
|
+
* behind it, and declining deletes every one of them.
|
|
27
|
+
*
|
|
28
|
+
* Nothing is rendered until the first load finishes (and nothing at all when
|
|
29
|
+
* there is nothing pending), so a page can mount this unconditionally without
|
|
30
|
+
* a loader flashing at the majority of users, who have no invitations.
|
|
31
|
+
*/
|
|
32
|
+
const PendingProjectInvitations = (props) => {
|
|
33
|
+
const [invitations, setInvitations] = useState([]);
|
|
34
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
35
|
+
const [loadError, setLoadError] = useState("");
|
|
36
|
+
const [refreshToggle, setRefreshToggle] = useState(false);
|
|
37
|
+
/*
|
|
38
|
+
* The row key of the card currently mid-request, so only that card's buttons
|
|
39
|
+
* go busy. A single boolean would disable every Accept on the page while one
|
|
40
|
+
* of them is in flight.
|
|
41
|
+
*/
|
|
42
|
+
const [busyRowKey, setBusyRowKey] = useState("");
|
|
43
|
+
const [actionError, setActionError] = useState("");
|
|
44
|
+
const [invitationToDecline, setInvitationToDecline] = useState(null);
|
|
45
|
+
const fetchInvitations = async () => {
|
|
46
|
+
setIsLoading(true);
|
|
47
|
+
setLoadError("");
|
|
48
|
+
try {
|
|
49
|
+
const listResult = await ModelAPI.getList({
|
|
50
|
+
modelType: TeamMember,
|
|
51
|
+
query: {
|
|
52
|
+
userId: User.getUserId(),
|
|
53
|
+
hasAcceptedInvitation: false,
|
|
54
|
+
},
|
|
55
|
+
select: {
|
|
56
|
+
_id: true,
|
|
57
|
+
createdAt: true,
|
|
58
|
+
projectId: true,
|
|
59
|
+
project: {
|
|
60
|
+
_id: true,
|
|
61
|
+
name: true,
|
|
62
|
+
},
|
|
63
|
+
teamId: true,
|
|
64
|
+
team: {
|
|
65
|
+
_id: true,
|
|
66
|
+
name: true,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
sort: {
|
|
70
|
+
createdAt: SortOrder.Ascending,
|
|
71
|
+
},
|
|
72
|
+
limit: LIMIT_PER_PROJECT,
|
|
73
|
+
skip: 0,
|
|
74
|
+
/*
|
|
75
|
+
* A pending invitation is the one thing a user reads about a project
|
|
76
|
+
* they are not yet a member of, so it cannot be scoped to the project
|
|
77
|
+
* currently selected in the dashboard - on the welcome page there is
|
|
78
|
+
* no selected project at all.
|
|
79
|
+
*/
|
|
80
|
+
requestOptions: {
|
|
81
|
+
isMultiTenantRequest: true,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const rows = TeamMembersByProject.sortByProjectName(TeamMembersByProject.groupByProject(listResult.data));
|
|
85
|
+
setInvitations(rows);
|
|
86
|
+
setIsLoading(false);
|
|
87
|
+
if (props.onInvitationsLoaded) {
|
|
88
|
+
props.onInvitationsLoaded(rows.length);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
setInvitations([]);
|
|
93
|
+
setLoadError(API.getFriendlyMessage(err));
|
|
94
|
+
setIsLoading(false);
|
|
95
|
+
if (props.onInvitationsLoaded) {
|
|
96
|
+
props.onInvitationsLoaded(0);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
useAsyncEffect(async () => {
|
|
101
|
+
await fetchInvitations();
|
|
102
|
+
}, [refreshToggle]);
|
|
103
|
+
const acceptInvitation = async (invitation) => {
|
|
104
|
+
setBusyRowKey(ProjectInvitationDisplay.getRowKey(invitation));
|
|
105
|
+
setActionError("");
|
|
106
|
+
try {
|
|
107
|
+
/*
|
|
108
|
+
* One request per membership, in sequence. There is no bulk accept, and
|
|
109
|
+
* a card stands for at most a handful of teams; running them in sequence
|
|
110
|
+
* keeps a failure attributable to the membership that caused it.
|
|
111
|
+
*
|
|
112
|
+
* A failure part-way through leaves the user accepted into the teams
|
|
113
|
+
* already updated - which does put them in the project - so the list is
|
|
114
|
+
* reloaded below rather than left as it was, and what is still pending
|
|
115
|
+
* comes back as a smaller invitation they can accept again.
|
|
116
|
+
*/
|
|
117
|
+
for (const teamMemberId of invitation.teamMemberIds) {
|
|
118
|
+
await ModelAPI.updateById({
|
|
119
|
+
modelType: TeamMember,
|
|
120
|
+
id: new ObjectID(teamMemberId),
|
|
121
|
+
data: {
|
|
122
|
+
hasAcceptedInvitation: true,
|
|
123
|
+
invitationAcceptedAt: OneUptimeDate.getCurrentDate(),
|
|
124
|
+
},
|
|
125
|
+
requestOptions: {
|
|
126
|
+
isMultiTenantRequest: true,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (props.onInvitationAccepted && invitation.projectId) {
|
|
131
|
+
props.onInvitationAccepted(invitation.projectId);
|
|
132
|
+
}
|
|
133
|
+
/*
|
|
134
|
+
* The caller normally reloads the dashboard into the project it was just
|
|
135
|
+
* handed, and this never runs. It is here for the case where it does not
|
|
136
|
+
* - an invitation with no project id to hand over, or a caller that only
|
|
137
|
+
* wants to be told - so the accepted card leaves the list either way.
|
|
138
|
+
*/
|
|
139
|
+
setBusyRowKey("");
|
|
140
|
+
setRefreshToggle((toggle) => {
|
|
141
|
+
return !toggle;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
setActionError(API.getFriendlyMessage(err));
|
|
146
|
+
setBusyRowKey("");
|
|
147
|
+
setRefreshToggle((toggle) => {
|
|
148
|
+
return !toggle;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const declineInvitation = async (invitation) => {
|
|
153
|
+
setBusyRowKey(ProjectInvitationDisplay.getRowKey(invitation));
|
|
154
|
+
setActionError("");
|
|
155
|
+
setInvitationToDecline(null);
|
|
156
|
+
try {
|
|
157
|
+
for (const teamMemberId of invitation.teamMemberIds) {
|
|
158
|
+
await ModelAPI.deleteItem({
|
|
159
|
+
modelType: TeamMember,
|
|
160
|
+
id: new ObjectID(teamMemberId),
|
|
161
|
+
requestOptions: {
|
|
162
|
+
isMultiTenantRequest: true,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
setActionError(API.getFriendlyMessage(err));
|
|
169
|
+
}
|
|
170
|
+
setBusyRowKey("");
|
|
171
|
+
setRefreshToggle((toggle) => {
|
|
172
|
+
return !toggle;
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
const renderInvitation = (invitation) => {
|
|
176
|
+
const rowKey = ProjectInvitationDisplay.getRowKey(invitation);
|
|
177
|
+
const projectName = ProjectInvitationDisplay.getProjectName(invitation);
|
|
178
|
+
const teamNames = ProjectInvitationDisplay.getTeamNames(invitation);
|
|
179
|
+
const isBusy = Boolean(rowKey) && busyRowKey === rowKey;
|
|
180
|
+
return (React.createElement("li", { key: rowKey, "data-testid": "project-invitation", className: "px-5 py-4 transition-colors duration-200 hover:bg-gray-50 md:px-6" },
|
|
181
|
+
React.createElement("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" },
|
|
182
|
+
React.createElement("div", { className: "flex min-w-0 items-center gap-4" },
|
|
183
|
+
React.createElement("div", { "aria-hidden": "true", className: "flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-xl bg-indigo-600 text-sm font-semibold tracking-wide text-white shadow-sm" }, ProjectInvitationDisplay.getInitials(projectName)),
|
|
184
|
+
React.createElement("div", { className: "min-w-0" },
|
|
185
|
+
React.createElement("p", { className: "truncate text-sm font-semibold text-gray-900" }, projectName),
|
|
186
|
+
teamNames.length > 0 ? (React.createElement("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5" }, teamNames.map((teamName) => {
|
|
187
|
+
return (React.createElement("span", { key: teamName, className: "inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-200" }, teamName));
|
|
188
|
+
}))) : (React.createElement("p", { className: "mt-1 text-xs text-gray-500" }, `You have been invited to ${ProjectInvitationDisplay.getTeamCountLabel(invitation)} in this project.`)),
|
|
189
|
+
invitation.joinedAt ? (React.createElement("p", { className: "mt-1.5 text-xs text-gray-400" }, `Invited ${OneUptimeDate.fromNow(invitation.joinedAt)}`)) : (React.createElement(React.Fragment, null)))),
|
|
190
|
+
React.createElement("div", { className: "flex flex-shrink-0 items-center gap-2 md:justify-end" },
|
|
191
|
+
React.createElement(Button, { title: "Decline", buttonStyle: ButtonStyleType.NORMAL, buttonSize: ButtonSize.Small,
|
|
192
|
+
/*
|
|
193
|
+
* Both buttons carry `w-full` below the md breakpoint, so on a
|
|
194
|
+
* phone they share the row and "Accept & Join" breaks across two
|
|
195
|
+
* lines inside its own box. They fit side by side unwrapped at
|
|
196
|
+
* 375px; this is what stops them being wrapped anyway.
|
|
197
|
+
*/
|
|
198
|
+
className: "whitespace-nowrap", disabled: isBusy, dataTestId: "decline-invitation-button", ariaLabel: `Decline invitation to ${projectName}`, onClick: () => {
|
|
199
|
+
setInvitationToDecline(invitation);
|
|
200
|
+
} }),
|
|
201
|
+
React.createElement(Button, { title: "Accept & Join", icon: IconProp.Check, buttonStyle: ButtonStyleType.PRIMARY, buttonSize: ButtonSize.Small, className: "whitespace-nowrap", isLoading: isBusy, disabled: isBusy, dataTestId: "accept-invitation-button", ariaLabel: `Accept invitation to ${projectName}`, onClick: () => {
|
|
202
|
+
acceptInvitation(invitation).catch(() => {
|
|
203
|
+
/*
|
|
204
|
+
* acceptInvitation reports its own failures into the card;
|
|
205
|
+
* this only stops an unhandled rejection reaching the console.
|
|
206
|
+
*/
|
|
207
|
+
});
|
|
208
|
+
} })))));
|
|
209
|
+
};
|
|
210
|
+
/*
|
|
211
|
+
* Nothing at all until the first load lands. Most people who reach the
|
|
212
|
+
* welcome page have no invitation waiting, and a loader that resolves to an
|
|
213
|
+
* empty region is a flash of furniture they never needed.
|
|
214
|
+
*/
|
|
215
|
+
if (isLoading) {
|
|
216
|
+
return React.createElement(React.Fragment, null);
|
|
217
|
+
}
|
|
218
|
+
if (loadError) {
|
|
219
|
+
return (React.createElement("div", { className: props.className || "", "data-testid": "invitations-error" },
|
|
220
|
+
React.createElement(ErrorMessage, { message: loadError, onRefreshClick: () => {
|
|
221
|
+
setRefreshToggle((toggle) => {
|
|
222
|
+
return !toggle;
|
|
223
|
+
});
|
|
224
|
+
} })));
|
|
225
|
+
}
|
|
226
|
+
if (invitations.length === 0) {
|
|
227
|
+
return React.createElement(React.Fragment, null);
|
|
228
|
+
}
|
|
229
|
+
return (React.createElement("div", { className: props.className || "", "data-testid": "pending-invitations" },
|
|
230
|
+
React.createElement("div", { className: "overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm" },
|
|
231
|
+
React.createElement("div", { className: "flex items-start gap-4 border-b border-gray-200 bg-gradient-to-r from-indigo-50 to-white px-5 py-5 md:px-6" },
|
|
232
|
+
React.createElement("div", { className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-indigo-600 shadow-sm" },
|
|
233
|
+
React.createElement(Icon, { icon: IconProp.Email, size: SizeProp.Five, className: "h-5 w-5 text-white" })),
|
|
234
|
+
React.createElement("div", { className: "min-w-0" },
|
|
235
|
+
React.createElement("h2", { className: "text-lg font-semibold leading-6 text-gray-900" }, invitations.length === 1
|
|
236
|
+
? "You have been invited to a project"
|
|
237
|
+
: `You have been invited to ${invitations.length} projects`),
|
|
238
|
+
React.createElement("p", { className: "mt-1 text-sm leading-relaxed text-gray-500" }, "Accept an invitation to join right away. There is nothing to set up."))),
|
|
239
|
+
actionError ? (React.createElement("div", { "data-testid": "invitation-action-error", role: "alert", className: "border-b border-red-200 bg-red-50 px-5 py-3 text-sm text-red-700 md:px-6" }, actionError)) : (React.createElement(React.Fragment, null)),
|
|
240
|
+
React.createElement("ul", { role: "list", className: "divide-y divide-gray-200" }, invitations.map(renderInvitation))),
|
|
241
|
+
invitationToDecline ? (React.createElement(ConfirmModal, { title: `Decline invitation`, description: `Are you sure you want to decline the invitation to ${ProjectInvitationDisplay.getProjectName(invitationToDecline)}? You will lose access to ${ProjectInvitationDisplay.getTeamCountLabel(invitationToDecline)} in this project, and will need a new invitation to join.`, submitButtonText: `Decline`, submitButtonType: ButtonStyleType.DANGER, onSubmit: () => {
|
|
242
|
+
const invitation = invitationToDecline;
|
|
243
|
+
declineInvitation(invitation).catch(() => {
|
|
244
|
+
// declineInvitation reports its own failures into the card.
|
|
245
|
+
});
|
|
246
|
+
}, onClose: () => {
|
|
247
|
+
setInvitationToDecline(null);
|
|
248
|
+
} })) : (React.createElement(React.Fragment, null))));
|
|
249
|
+
};
|
|
250
|
+
export default PendingProjectInvitations;
|
|
251
|
+
//# sourceMappingURL=PendingProjectInvitations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PendingProjectInvitations.js","sourceRoot":"","sources":["../../../../../UI/Components/ProjectInvitations/PendingProjectInvitations.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,QAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,MAAM,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,UAAU,MAAM,2CAA2C,CAAC;AACnE,OAAO,oBAEN,MAAM,qCAAqC,CAAC;AAC7C,OAAO,SAAS,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAmC,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAyB9C;;;;;;;;;;;;;GAaG;AACH,MAAM,yBAAyB,GAAsC,CACnE,KAAqB,EACP,EAAE;IAChB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,G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CAAC,CAC/B,CACD;QAEL,mBAAmB,CAAC,CAAC,CAAC,CACrB,oBAAC,YAAY,IACX,KAAK,EAAE,oBAAoB,EAC3B,WAAW,EAAE,sDAAsD,wBAAwB,CAAC,cAAc,CACxG,mBAAmB,CACpB,6BAA6B,wBAAwB,CAAC,iBAAiB,CACtE,mBAAmB,CACpB,2DAA2D,EAC5D,gBAAgB,EAAE,SAAS,EAC3B,gBAAgB,EAAE,eAAe,CAAC,MAAM,EACxC,QAAQ,EAAE,GAAG,EAAE;gBACb,MAAM,UAAU,GAA0B,mBAAmB,CAAC;gBAE9D,iBAAiB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;oBACvC,4DAA4D;gBAC9D,CAAC,CAAC,CAAC;YACL,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;gBACZ,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC,GACD,CACH,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useEffect, useRef, } from "react";
|
|
2
2
|
const SimpleLogViewer = (props) => {
|
|
3
3
|
const showLineNumbers = props.showLineNumbers !== false;
|
|
4
4
|
const height = props.height || "400px";
|
|
@@ -21,6 +21,13 @@ const SimpleLogViewer = (props) => {
|
|
|
21
21
|
}
|
|
22
22
|
return (React.createElement("div", { className: "text-slate-300 whitespace-pre-wrap break-all" }, props.children));
|
|
23
23
|
};
|
|
24
|
+
const contentRef = useRef(null);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!props.autoScrollToBottom || !contentRef.current) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
contentRef.current.scrollTop = contentRef.current.scrollHeight;
|
|
30
|
+
}, [props.autoScrollToBottom, props.children]);
|
|
24
31
|
const scrollbarStyles = {
|
|
25
32
|
maxHeight: height,
|
|
26
33
|
scrollbarWidth: "thin",
|
|
@@ -29,7 +36,7 @@ const SimpleLogViewer = (props) => {
|
|
|
29
36
|
return (React.createElement("div", { className: "rounded-lg overflow-hidden border border-slate-700 bg-slate-900 shadow-lg" },
|
|
30
37
|
title && (React.createElement("div", { className: "px-4 py-3 border-b border-slate-700 bg-slate-800" },
|
|
31
38
|
React.createElement("h3", { className: "text-sm font-medium text-slate-200" }, title))),
|
|
32
|
-
React.createElement("div", { className: "overflow-auto font-mono text-sm leading-6 p-4 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-800 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:hover:bg-slate-500", style: scrollbarStyles }, renderContent())));
|
|
39
|
+
React.createElement("div", { ref: contentRef, className: "overflow-auto font-mono text-sm leading-6 p-4 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-slate-800 [&::-webkit-scrollbar-thumb]:bg-slate-600 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:hover:bg-slate-500", style: scrollbarStyles }, renderContent())));
|
|
33
40
|
};
|
|
34
41
|
export default SimpleLogViewer;
|
|
35
42
|
//# sourceMappingURL=SimpleLogViewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleLogViewer.js","sourceRoot":"","sources":["../../../../../UI/Components/SimpleLogViewer/SimpleLogViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SimpleLogViewer.js","sourceRoot":"","sources":["../../../../../UI/Components/SimpleLogViewer/SimpleLogViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAC;AAcf,MAAM,eAAe,GAAsC,CACzD,KAAqB,EACP,EAAE;IAChB,MAAM,eAAe,GAAY,KAA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C;IAEF,MAAM,UAAU,GACd,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACrD,OAAO;QACT,CAAC;QAED,UAAU,CAAC,OAAO,CAAC,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC;IACjE,CAAC,EAAE,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C,MAAM,eAAe,GAAwB;QAC3C,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,MAAM;QACtB,cAAc,EAAE,iBAAiB;KAClC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,2EAA2E;QAEvF,KAAK,IAAI,CACR,6BAAK,SAAS,EAAC,kDAAkD;YAC/D,4BAAI,SAAS,EAAC,oCAAoC,IAAE,KAAK,CAAM,CAC3D,CACP;QAED,6BACE,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,wPAAwP,EAClQ,KAAK,EAAE,eAAe,IAErB,aAAa,EAAE,CACZ,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -136,23 +136,35 @@ const Table = (props) => {
|
|
|
136
136
|
((_b = item[props.matchBulkSelectedItemByField]) === null || _b === void 0 ? void 0 : _b.toString()));
|
|
137
137
|
}));
|
|
138
138
|
(_a = props.onBulkSelectedItemRemoved) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
|
139
|
-
}, selectedItems: bulkSelectedItems, matchBulkSelectedItemByField: props.matchBulkSelectedItemByField, isMobile: isMobile }));
|
|
139
|
+
}, selectedItems: bulkSelectedItems, matchBulkSelectedItemByField: props.matchBulkSelectedItemByField, isItemSelectable: props.isItemSelectable, itemNotSelectableReason: props.itemNotSelectableReason, bulkItemToString: props.bulkItemToString, isMobile: isMobile }));
|
|
140
140
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
/*
|
|
142
|
+
* The rows on this page the header checkbox is actually talking about. With no
|
|
143
|
+
* isItemSelectable this is every row, which is what it has always been.
|
|
144
|
+
*/
|
|
145
|
+
const selectableRowsOnThePage = props.isItemSelectable
|
|
146
|
+
? props.data.filter(props.isItemSelectable)
|
|
147
|
+
: props.data;
|
|
148
|
+
const isRowSelected = (item) => {
|
|
149
|
+
const matchBy = props.matchBulkSelectedItemByField;
|
|
150
|
+
if (matchBy === undefined) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return bulkSelectedItems.some((selected) => {
|
|
145
154
|
var _a, _b;
|
|
146
|
-
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
return (((_a = x[props.matchBulkSelectedItemByField]) === null || _a === void 0 ? void 0 : _a.toString()) ===
|
|
150
|
-
((_b = item[props.matchBulkSelectedItemByField]) === null || _b === void 0 ? void 0 : _b.toString()));
|
|
155
|
+
return ((_a = selected[matchBy]) === null || _a === void 0 ? void 0 : _a.toString()) === ((_b = item[matchBy]) === null || _b === void 0 ? void 0 : _b.toString());
|
|
151
156
|
});
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
};
|
|
158
|
+
const selectedRowsOnThePageCount = selectableRowsOnThePage.filter(isRowSelected).length;
|
|
159
|
+
/*
|
|
160
|
+
* "All selected" means all of the SELECTABLE rows, and a page with none of
|
|
161
|
+
* those does not count as fully selected - otherwise a page of entirely locked
|
|
162
|
+
* rows would render a ticked header box above nothing that is ticked.
|
|
163
|
+
*/
|
|
164
|
+
const isAllItemsOnThePageSelected = selectableRowsOnThePage.length > 0 &&
|
|
165
|
+
selectedRowsOnThePageCount === selectableRowsOnThePage.length;
|
|
166
|
+
const isSomeItemsOnThePageSelected = selectedRowsOnThePageCount > 0 &&
|
|
167
|
+
selectedRowsOnThePageCount < selectableRowsOnThePage.length;
|
|
156
168
|
return (React.createElement("div", { className: props.className },
|
|
157
169
|
React.createElement(FilterViewer, { id: `${props.id}-filter`, showFilterModal: props.showFilterModal || false, onFilterChanged: props.onFilterChanged || undefined, isModalLoading: props.isFilterLoading || false, filterError: props.filterError, onFilterRefreshClick: props.onFilterRefreshClick, filters: props.filters || [], onFilterModalClose: props.onFilterModalClose, onFilterModalOpen: props.onFilterModalOpen, singularLabel: translatedSingularLabel, pluralLabel: translatedPluralLabel, filterData: props.filterData, onAdvancedFiltersToggle: props.onAdvancedFiltersToggle }),
|
|
158
170
|
bulkActionButtons.length > 0 && (React.createElement(BulkUpdateForm, { buttons: bulkActionButtons, onClearSelectionClick: () => {
|
|
@@ -199,7 +211,7 @@ const Table = (props) => {
|
|
|
199
211
|
if (props.onBulkSelectItemsOnCurrentPage) {
|
|
200
212
|
props.onBulkSelectItemsOnCurrentPage();
|
|
201
213
|
}
|
|
202
|
-
}, isAllItemsOnThePageSelected: isAllItemsOnThePageSelected, hasTableItems:
|
|
214
|
+
}, isAllItemsOnThePageSelected: isAllItemsOnThePageSelected, isSomeItemsOnThePageSelected: isSomeItemsOnThePageSelected, hasTableItems: selectableRowsOnThePage.length > 0 }),
|
|
203
215
|
getTablebody()))))),
|
|
204
216
|
React.createElement("div", { className: "bg-gray-50 text-right md:-mx-6 -mb-6 rounded-b-xl" }, !props.disablePagination && (React.createElement(Pagination, { singularLabel: translatedSingularLabel, pluralLabel: translatedPluralLabel, currentPageNumber: props.currentPageNumber, totalItemsCount: props.totalItemsCount, hasMore: props.hasMore, itemsOnCurrentPage: props.data.length, itemsOnPage: props.itemsOnPage, onNavigateToPage: props.onNavigateToPage, isLoading: props.isLoading, isError: Boolean(props.error) }))))));
|
|
205
217
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../../../UI/Components/Table/Table.tsx"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACx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AK,CAAC,iBAAiB,IAAI,CAC3B,oBAAC,UAAU,IACT,aAAa,EAAE,uBAAuB,EACtC,WAAW,EAAE,qBAAqB,EAClC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EACrC,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAC7B,CACH,CACG,CACU,CACd,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -2,21 +2,35 @@ import TableRow from "./TableRow";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Droppable } from "react-beautiful-dnd";
|
|
4
4
|
const TableBody = (props) => {
|
|
5
|
+
const getSelectionProps = (item) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const matchBy = props.matchBulkSelectedItemByField;
|
|
8
|
+
const isItemSelected = Boolean(matchBy !== undefined &&
|
|
9
|
+
((_a = props.selectedItems) === null || _a === void 0 ? void 0 : _a.some((selectedItem) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return (((_a = selectedItem[matchBy]) === null || _a === void 0 ? void 0 : _a.toString()) === ((_b = item[matchBy]) === null || _b === void 0 ? void 0 : _b.toString()));
|
|
12
|
+
})));
|
|
13
|
+
const label = props.bulkItemToString
|
|
14
|
+
? `Select ${props.bulkItemToString(item)}`
|
|
15
|
+
: undefined;
|
|
16
|
+
return {
|
|
17
|
+
isItemSelected: isItemSelected,
|
|
18
|
+
isItemSelectable: props.isItemSelectable
|
|
19
|
+
? props.isItemSelectable(item)
|
|
20
|
+
: true,
|
|
21
|
+
itemSelectLabel: label,
|
|
22
|
+
itemNotSelectableReason: props.itemNotSelectableReason
|
|
23
|
+
? props.itemNotSelectableReason(item)
|
|
24
|
+
: undefined,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
5
27
|
const getBody = (provided) => {
|
|
6
28
|
// Mobile view: render as list
|
|
7
29
|
if (props.isMobile) {
|
|
8
30
|
return (React.createElement("div", Object.assign({ id: props.id, ref: provided === null || provided === void 0 ? void 0 : provided.innerRef }, provided === null || provided === void 0 ? void 0 : provided.droppableProps, { className: "divide-y divide-gray-200 bg-white" }),
|
|
9
31
|
props.data &&
|
|
10
32
|
props.data.map((item, i) => {
|
|
11
|
-
|
|
12
|
-
return (React.createElement(TableRow, { isBulkActionsEnabled: props.isBulkActionsEnabled, onItemSelected: props.onItemSelected, onItemDeselected: props.onItemDeselected, isItemSelected: ((_a = props.selectedItems) === null || _a === void 0 ? void 0 : _a.filter((selectedItem) => {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
if (props.matchBulkSelectedItemByField === undefined) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return (((_a = selectedItem[props.matchBulkSelectedItemByField]) === null || _a === void 0 ? void 0 : _a.toString()) ===
|
|
18
|
-
((_b = item[props.matchBulkSelectedItemByField]) === null || _b === void 0 ? void 0 : _b.toString()));
|
|
19
|
-
}).length) > 0 || false, dragAndDropScope: props.dragAndDropScope, enableDragAndDrop: props.enableDragAndDrop, key: i, item: item, columns: props.columns, actionButtons: props.actionButtons, dragDropIdField: props.dragDropIdField, dragDropIndexField: props.dragDropIndexField, isMobile: true }));
|
|
33
|
+
return (React.createElement(TableRow, Object.assign({ isBulkActionsEnabled: props.isBulkActionsEnabled, onItemSelected: props.onItemSelected, onItemDeselected: props.onItemDeselected }, getSelectionProps(item), { dragAndDropScope: props.dragAndDropScope, enableDragAndDrop: props.enableDragAndDrop, key: i, item: item, columns: props.columns, actionButtons: props.actionButtons, dragDropIdField: props.dragDropIdField, dragDropIndexField: props.dragDropIndexField, isMobile: true })));
|
|
20
34
|
}), provided === null || provided === void 0 ? void 0 :
|
|
21
35
|
provided.placeholder));
|
|
22
36
|
}
|
|
@@ -24,15 +38,7 @@ const TableBody = (props) => {
|
|
|
24
38
|
return (React.createElement("tbody", Object.assign({ id: props.id, ref: provided === null || provided === void 0 ? void 0 : provided.innerRef }, provided === null || provided === void 0 ? void 0 : provided.droppableProps, { className: "divide-y divide-gray-200 bg-white" }),
|
|
25
39
|
props.data &&
|
|
26
40
|
props.data.map((item, i) => {
|
|
27
|
-
|
|
28
|
-
return (React.createElement(TableRow, { isBulkActionsEnabled: props.isBulkActionsEnabled, onItemSelected: props.onItemSelected, onItemDeselected: props.onItemDeselected, isItemSelected: ((_a = props.selectedItems) === null || _a === void 0 ? void 0 : _a.filter((selectedItem) => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
if (props.matchBulkSelectedItemByField === undefined) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return (((_a = selectedItem[props.matchBulkSelectedItemByField]) === null || _a === void 0 ? void 0 : _a.toString()) ===
|
|
34
|
-
((_b = item[props.matchBulkSelectedItemByField]) === null || _b === void 0 ? void 0 : _b.toString()));
|
|
35
|
-
}).length) > 0 || false, dragAndDropScope: props.dragAndDropScope, enableDragAndDrop: props.enableDragAndDrop, key: i, item: item, columns: props.columns, actionButtons: props.actionButtons, dragDropIdField: props.dragDropIdField, dragDropIndexField: props.dragDropIndexField, isMobile: false }));
|
|
41
|
+
return (React.createElement(TableRow, Object.assign({ isBulkActionsEnabled: props.isBulkActionsEnabled, onItemSelected: props.onItemSelected, onItemDeselected: props.onItemDeselected }, getSelectionProps(item), { dragAndDropScope: props.dragAndDropScope, enableDragAndDrop: props.enableDragAndDrop, key: i, item: item, columns: props.columns, actionButtons: props.actionButtons, dragDropIdField: props.dragDropIdField, dragDropIndexField: props.dragDropIndexField, isMobile: false })));
|
|
36
42
|
}), provided === null || provided === void 0 ? void 0 :
|
|
37
43
|
provided.placeholder));
|
|
38
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../../UI/Components/Table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../../UI/Components/Table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AAoCnE,MAAM,SAAS,GAAsB,CACnC,KAAwB,EACV,EAAE;IAiBhB,MAAM,iBAAiB,GAA2B,CAAC,IAAO,EAAE,EAAE;;QAC5D,MAAM,OAAO,GAAwB,KAAK,CAAC,4BAA4B,CAAC;QAExE,MAAM,cAAc,GAAY,OAAO,CACrC,OAAO,KAAK,SAAS;aACnB,MAAA,KAAK,CAAC,aAAa,0CAAE,IAAI,CAAC,CAAC,YAAe,EAAE,EAAE;;gBAC5C,OAAO,CACL,CAAA,MAAA,YAAY,CAAC,OAAO,CAAC,0CAAE,QAAQ,EAAE,OAAK,MAAA,IAAI,CAAC,OAAO,CAAC,0CAAE,QAAQ,EAAE,CAAA,CAChE,CAAC;YACJ,CAAC,CAAC,CAAA,CACL,CAAC;QAEF,MAAM,KAAK,GAAuB,KAAK,CAAC,gBAAgB;YACtD,CAAC,CAAC,UAAU,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC1C,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO;YACL,cAAc,EAAE,cAAc;YAC9B,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACtC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBAC9B,CAAC,CAAC,IAAI;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eader = (props) => {
|
|
|
27
27
|
props.isBulkActionsEnabled && (React.createElement("th", { scope: "col" },
|
|
28
28
|
React.createElement("span", { className: "sr-only" }, translateString("Select all items")),
|
|
29
29
|
React.createElement("div", { className: "ml-5" },
|
|
30
|
-
React.createElement(CheckboxElement, { disabled: !props.hasTableItems, value: selectBulkSelectCheckbox,
|
|
30
|
+
React.createElement(CheckboxElement, { disabled: !props.hasTableItems, value: selectBulkSelectCheckbox, ariaLabel: translateString("Select all items"),
|
|
31
|
+
/*
|
|
32
|
+
* Half-filled when only part of the page is selected. Without
|
|
33
|
+
* it, a page where some rows cannot be selected at all can
|
|
34
|
+
* never reach "all selected", so the box sits permanently
|
|
35
|
+
* empty and reads as "your selection was lost".
|
|
36
|
+
*/
|
|
37
|
+
isIndeterminate: Boolean(props.isSomeItemsOnThePageSelected &&
|
|
38
|
+
!selectBulkSelectCheckbox), onChange: (value) => {
|
|
31
39
|
if (value) {
|
|
32
40
|
if (props.onAllItemsOnThePageSelected) {
|
|
33
41
|
props.onAllItemsOnThePageSelected();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.js","sourceRoot":"","sources":["../../../../../UI/Components/Table/TableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,SAAS,EAAE,EAChB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAgB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TableHeader.js","sourceRoot":"","sources":["../../../../../UI/Components/Table/TableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO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SAAS,CAAC,UAAU,IAAI,CAC1C,oBAAC,IAAI,IACH,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,SAAS,EAAC,sFAAsF,GAChG,CACH,CACC,CACH,CACN,CAAC;YACJ,CAAC,CAAC,CACD,CACC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -38,6 +38,33 @@ const TableRow = (props) => {
|
|
|
38
38
|
const renderedColumns = (props.columns || []).filter((column) => {
|
|
39
39
|
return !(column.hideOnMobile && isMobile);
|
|
40
40
|
});
|
|
41
|
+
/*
|
|
42
|
+
* Absent means selectable, so every existing caller is unaffected. Only an
|
|
43
|
+
* explicit false locks the box.
|
|
44
|
+
*/
|
|
45
|
+
const isItemSelectable = props.isItemSelectable !== false;
|
|
46
|
+
/*
|
|
47
|
+
* The bulk-select box, identical on the mobile card and the desktop row. It is
|
|
48
|
+
* one function rather than two copies because the two used to drift: the
|
|
49
|
+
* mobile copy still has no `disabled` handling of its own, and a locked row
|
|
50
|
+
* that is only locked at one breakpoint is not locked.
|
|
51
|
+
*/
|
|
52
|
+
const getBulkSelectCheckbox = () => {
|
|
53
|
+
return (React.createElement(CheckboxElement, { value: Boolean(props.isItemSelected), disabled: !isItemSelectable, ariaLabel: props.itemSelectLabel, hoverText: isItemSelectable
|
|
54
|
+
? props.itemSelectLabel
|
|
55
|
+
: props.itemNotSelectableReason || props.itemSelectLabel, onChange: (value) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
if (!isItemSelectable) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (value) {
|
|
61
|
+
(_a = props.onItemSelected) === null || _a === void 0 ? void 0 : _a.call(props, props.item);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
(_b = props.onItemDeselected) === null || _b === void 0 ? void 0 : _b.call(props, props.item);
|
|
65
|
+
}
|
|
66
|
+
} }));
|
|
67
|
+
};
|
|
41
68
|
const getRow = (provided) => {
|
|
42
69
|
// Mobile view: render as a card
|
|
43
70
|
if (props.isMobile) {
|
|
@@ -45,16 +72,7 @@ const TableRow = (props) => {
|
|
|
45
72
|
React.createElement("div", Object.assign({}, provided === null || provided === void 0 ? void 0 : provided.draggableProps, { ref: provided === null || provided === void 0 ? void 0 : provided.innerRef, className: "p-4 bg-white border-b border-gray-200" }),
|
|
46
73
|
props.enableDragAndDrop ? (React.createElement("div", Object.assign({ className: "mb-3 flex justify-center" }, provided === null || provided === void 0 ? void 0 : provided.dragHandleProps),
|
|
47
74
|
React.createElement(Icon, { icon: IconProp.ArrowUpDown, className: "h-4 w-4 text-gray-400" }))) : (React.createElement(React.Fragment, null)),
|
|
48
|
-
props.isBulkActionsEnabled ? (React.createElement("div", { className: "mb-3" },
|
|
49
|
-
React.createElement(CheckboxElement, { value: Boolean(props.isItemSelected), onChange: (value) => {
|
|
50
|
-
var _a, _b;
|
|
51
|
-
if (value) {
|
|
52
|
-
(_a = props.onItemSelected) === null || _a === void 0 ? void 0 : _a.call(props, props.item);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
(_b = props.onItemDeselected) === null || _b === void 0 ? void 0 : _b.call(props, props.item);
|
|
56
|
-
}
|
|
57
|
-
} }))) : (React.createElement(React.Fragment, null)),
|
|
75
|
+
props.isBulkActionsEnabled ? (React.createElement("div", { className: "mb-3" }, getBulkSelectCheckbox())) : (React.createElement(React.Fragment, null)),
|
|
58
76
|
React.createElement("div", { className: "space-y-3" }, props.columns.map((column, i) => {
|
|
59
77
|
var _a, _b;
|
|
60
78
|
if (column.type === FieldType.Actions) {
|
|
@@ -112,17 +130,7 @@ const TableRow = (props) => {
|
|
|
112
130
|
props.enableDragAndDrop && (React.createElement("td", Object.assign({ className: "ml-5 py-4 w-10 align-top" }, provided === null || provided === void 0 ? void 0 : provided.dragHandleProps),
|
|
113
131
|
React.createElement(Icon, { icon: IconProp.ArrowUpDown, className: "ml-6 h-5 w-5 text-gray-500 hover:text-indigo-800 m-auto cursor-ns-resize" }))),
|
|
114
132
|
props.isBulkActionsEnabled && (React.createElement("td", Object.assign({ className: "w-10 py-3.5 align-top" }, provided === null || provided === void 0 ? void 0 : provided.dragHandleProps),
|
|
115
|
-
React.createElement("div", { className: "ml-5" },
|
|
116
|
-
React.createElement(CheckboxElement, { value: props.isItemSelected, onChange: (value) => {
|
|
117
|
-
if (value) {
|
|
118
|
-
if (props.onItemSelected) {
|
|
119
|
-
props.onItemSelected(props.item);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
else if (props.onItemDeselected) {
|
|
123
|
-
props.onItemDeselected(props.item);
|
|
124
|
-
}
|
|
125
|
-
} })))),
|
|
133
|
+
React.createElement("div", { className: "ml-5" }, getBulkSelectCheckbox()))),
|
|
126
134
|
props.columns &&
|
|
127
135
|
renderedColumns.map((column, i) => {
|
|
128
136
|
var _a, _b;
|