@oneuptime/common 12.0.11 → 12.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +32 -5
- package/Models/DatabaseModels/NetworkDevice.ts +64 -0
- package/Models/DatabaseModels/StatusPage.ts +59 -0
- package/Models/DatabaseModels/StatusPageOidc.ts +2 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +19 -2
- package/Server/API/AIChatAPI.ts +55 -56
- package/Server/API/CommonAPI.ts +89 -0
- package/Server/API/MicrosoftTeamsAPI.ts +20 -9
- package/Server/API/SlackAPI.ts +13 -10
- package/Server/API/StatusPageAPI.ts +2197 -2128
- package/Server/API/TelemetryAPI.ts +72 -3
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787500000000-AddEnableSearchEngineIndexingToStatusPage.ts +30 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787600000000-AddNetworkDeviceReachabilityColumns.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Middleware/UserAuthorization.ts +11 -2
- package/Server/Services/ApiKeyPermissionService.ts +116 -2
- package/Server/Services/DatabaseService.ts +17 -6
- package/Server/Services/LogAggregationService.ts +34 -0
- package/Server/Services/LogService.ts +21 -0
- package/Server/Services/NetworkSiteService.ts +12 -0
- package/Server/Services/SpanService.ts +21 -0
- package/Server/Services/TraceAggregationService.ts +15 -0
- package/Server/Services/WorkspaceNotificationRuleService.ts +172 -220
- package/Server/Types/AnalyticsDatabase/ModelPermission.ts +9 -0
- package/Server/Types/Database/Permissions/AccessControlPermission.ts +47 -16
- package/Server/Types/Workflow/Components/Conditions/IfElse.ts +9 -0
- package/Server/Types/Workflow/Components/JavaScript.ts +9 -0
- package/Server/Utils/APIKey/AccessPermission.ts +16 -40
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +144 -0
- package/Server/Utils/LogRedaction.ts +576 -0
- package/Server/Utils/Logger.ts +123 -46
- package/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts +94 -23
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +12 -0
- package/Server/Utils/Monitor/MonitorResource.ts +29 -9
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +28 -7
- package/Server/Utils/SessionReplay/SessionReplayGateCacheStore.ts +56 -10
- package/Server/Utils/StartServer.ts +30 -9
- package/Server/Utils/StatusPageSearchEngineIndexing.ts +33 -0
- package/Server/Utils/Telemetry/ResourceEntityFilter.ts +441 -0
- package/Server/Utils/VM/VMRunner.ts +693 -874
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +488 -46
- package/Tests/App/Dashboard/MonitorTypePicker.test.tsx +300 -0
- package/Tests/App/StatusPage/StatusPageIndexPageRobotsMeta.test.ts +130 -0
- package/Tests/Models/DatabaseModels/DatabaseBaseModelToJSONObjectCache.test.ts +180 -0
- package/Tests/Models/StatusPageEnableSearchEngineIndexing.test.ts +157 -0
- package/Tests/Server/API/AIChatCancelAndFeedback.test.ts +23 -1
- package/Tests/Server/API/AIChatRouteAuthorization.test.ts +785 -0
- package/Tests/Server/API/BaseAPIApiKeyAuth.test.ts +21 -8
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +290 -0
- package/Tests/Server/API/MicrosoftTeamsManifest.test.ts +7 -1
- package/Tests/Server/API/StatusPageOverviewCache.test.ts +474 -0
- package/Tests/Server/API/StatusPageSeoSearchEngineIndexing.test.ts +189 -0
- package/Tests/Server/Infrastructure/InMemoryTTLCache.test.ts +158 -0
- package/Tests/Server/Infrastructure/Postgres/DeviceRoleAndDeclaredLinkParentMigration.test.ts +9 -60
- package/Tests/Server/Middleware/ProjectAuthorizationApiKeyMiddleware.test.ts +24 -15
- package/Tests/Server/Middleware/UserAuthorization.test.ts +79 -0
- package/Tests/Server/Services/AddNetworkDeviceReachabilityColumnsMigration.test.ts +332 -0
- package/Tests/Server/Services/ApiKeyPermissionService.test.ts +347 -0
- package/Tests/Server/Services/DatabaseServiceUpdateDebugLogging.test.ts +282 -0
- package/Tests/Server/Services/NetworkSiteService.test.ts +56 -2
- package/Tests/Server/Services/TelemetryResourceFacetFilters.test.ts +267 -0
- package/Tests/Server/Services/WorkspaceNotificationRuleTestRuleChannels.test.ts +702 -0
- package/Tests/Server/Types/Database/Permissions/AccessControlPermission.test.ts +165 -0
- package/Tests/Server/Types/Workflow/Components/CustomCodeScriptError.test.ts +121 -0
- package/Tests/Server/Utils/APIKey/AccessPermission.test.ts +48 -36
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGenerator.test.ts +213 -0
- package/Tests/Server/Utils/LogRedaction.test.ts +415 -0
- package/Tests/Server/Utils/LoggerCredentialLeak.test.ts +245 -0
- package/Tests/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.test.ts +374 -4
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorJavascriptExpression.test.ts +92 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceIngestedStepSelection.test.ts +455 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceReachabilityRoundTrip.test.ts +369 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +86 -8
- package/Tests/Server/Utils/PrivacyFilterUtil.test.ts +64 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayGateCacheStore.test.ts +207 -0
- package/Tests/Server/Utils/StartServerBodyVerify.test.ts +335 -0
- package/Tests/Server/Utils/StatusPageSearchEngineIndexing.test.ts +60 -0
- package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +435 -0
- package/Tests/Server/Utils/VM/VMRunnerIsolation.test.ts +385 -0
- package/Tests/Server/Utils/VM/VMRunnerSsrf.test.ts +3 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsChannelSend.test.ts +607 -62
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsInstalledTeamIdSpace.test.ts +778 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsTeamInstalls.test.ts +44 -10
- package/Tests/Types/API/HostnameFromAuthority.test.ts +164 -0
- package/Tests/Types/Database/AccessControl/ColumnAccessControlCache.test.ts +344 -0
- package/Tests/Types/Database/DatabasePropertyFindOperator.test.ts +518 -0
- package/Tests/Types/Database/TableColumnMetadataCache.test.ts +286 -0
- package/Tests/Types/Monitor/MonitorStep.test.ts +100 -0
- package/Tests/Types/Monitor/MonitorTypeKeywords.test.ts +360 -0
- package/Tests/Types/StatusPage/SearchEngineIndexing.test.ts +86 -0
- package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +254 -0
- package/Tests/UI/Components/CardSelect.test.tsx +1021 -0
- package/Tests/UI/Components/MasterPage.test.tsx +36 -1
- package/Tests/Utils/Monitor/MonitorMetricType.test.ts +66 -1
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +115 -6
- package/Tests/Utils/NetworkDevice/DeviceReachabilityUtil.test.ts +610 -0
- package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +114 -45
- package/Types/API/Hostname.ts +79 -0
- package/Types/Database/AccessControl/ColumnAccessControl.ts +33 -11
- package/Types/Database/AccessControl/ColumnBillingAccessControl.ts +33 -11
- package/Types/Database/DatabaseProperty.ts +38 -0
- package/Types/Database/TableColumn.ts +34 -7
- package/Types/Events/Recurring.ts +16 -1
- package/Types/Monitor/CustomCodeMonitor/CustomCodeMonitorResponse.ts +14 -2
- package/Types/Monitor/MonitorStep.ts +13 -1
- package/Types/Monitor/MonitorType.ts +345 -40
- package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +43 -0
- package/Types/StatusPage/SearchEngineIndexing.ts +61 -0
- package/Types/Telemetry/ResourceEntityFacet.ts +211 -0
- package/UI/Components/CardSelect/CardSelect.tsx +714 -105
- package/UI/Components/EmptyState/EmptyState.tsx +8 -1
- package/UI/Components/Footer/Footer.tsx +32 -6
- package/UI/Components/Forms/Fields/FormField.tsx +3 -0
- package/UI/Components/Forms/Types/Field.ts +8 -0
- package/UI/Components/Loader/PageLoader.tsx +29 -8
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +26 -4
- package/UI/Components/Markdown.tsx/LazyMarkdownViewer.tsx +17 -1
- package/UI/Components/MasterPage/MasterPage.tsx +24 -11
- package/Utils/Monitor/MonitorMetricType.ts +16 -1
- package/Utils/Monitor/NetworkTopologyUtil.ts +60 -8
- package/Utils/NetworkDevice/DeviceReachabilityUtil.ts +262 -0
- package/Utils/NetworkSite/SiteStatusRollupUtil.ts +41 -24
- package/Utils/Telemetry/CrossSignalScope.ts +75 -4
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +20 -4
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +66 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +60 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageOidc.js +2 -0
- package/build/dist/Models/DatabaseModels/StatusPageOidc.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +48 -35
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +59 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +20 -6
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +13 -10
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +745 -673
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +34 -3
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787500000000-AddEnableSearchEngineIndexingToStatusPage.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787500000000-AddEnableSearchEngineIndexingToStatusPage.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787600000000-AddNetworkDeviceReachabilityColumns.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787600000000-AddNetworkDeviceReachabilityColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +6 -2
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Services/ApiKeyPermissionService.js +90 -1
- package/build/dist/Server/Services/ApiKeyPermissionService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +15 -6
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +2 -0
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/LogService.js +16 -0
- package/build/dist/Server/Services/LogService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +12 -0
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/SpanService.js +16 -0
- package/build/dist/Server/Services/SpanService.js.map +1 -1
- package/build/dist/Server/Services/TraceAggregationService.js +2 -0
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +137 -164
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +9 -0
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/AccessControlPermission.js +21 -13
- package/build/dist/Server/Types/Database/Permissions/AccessControlPermission.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +8 -0
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +8 -0
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Utils/APIKey/AccessPermission.js +9 -32
- package/build/dist/Server/Utils/APIKey/AccessPermission.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +87 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/LogRedaction.js +449 -0
- package/build/dist/Server/Utils/LogRedaction.js.map +1 -0
- package/build/dist/Server/Utils/Logger.js +98 -45
- package/build/dist/Server/Utils/Logger.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js +65 -13
- package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +12 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +20 -3
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +27 -7
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCacheStore.js +29 -10
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCacheStore.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +10 -7
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/StatusPageSearchEngineIndexing.js +24 -0
- package/build/dist/Server/Utils/StatusPageSearchEngineIndexing.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +311 -0
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -0
- package/build/dist/Server/Utils/VM/VMRunner.js +402 -525
- package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +366 -37
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/API/Hostname.js +63 -0
- package/build/dist/Types/API/Hostname.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js +20 -6
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js +20 -6
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js.map +1 -1
- package/build/dist/Types/Database/DatabaseProperty.js +38 -0
- package/build/dist/Types/Database/DatabaseProperty.js.map +1 -1
- package/build/dist/Types/Database/TableColumn.js +24 -6
- package/build/dist/Types/Database/TableColumn.js.map +1 -1
- package/build/dist/Types/Events/Recurring.js +13 -1
- package/build/dist/Types/Events/Recurring.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +9 -1
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +330 -31
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/StatusPage/SearchEngineIndexing.js +55 -0
- package/build/dist/Types/StatusPage/SearchEngineIndexing.js.map +1 -0
- package/build/dist/Types/Telemetry/ResourceEntityFacet.js +156 -0
- package/build/dist/Types/Telemetry/ResourceEntityFacet.js.map +1 -0
- package/build/dist/UI/Components/CardSelect/CardSelect.js +360 -40
- package/build/dist/UI/Components/CardSelect/CardSelect.js.map +1 -1
- package/build/dist/UI/Components/EmptyState/EmptyState.js +1 -1
- package/build/dist/UI/Components/EmptyState/EmptyState.js.map +1 -1
- package/build/dist/UI/Components/Footer/Footer.js +7 -4
- package/build/dist/UI/Components/Footer/Footer.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Loader/PageLoader.js +15 -5
- package/build/dist/UI/Components/Loader/PageLoader.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +16 -3
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/LazyMarkdownViewer.js +13 -1
- package/build/dist/UI/Components/Markdown.tsx/LazyMarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.js +10 -2
- package/build/dist/UI/Components/MasterPage/MasterPage.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js +13 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +34 -7
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js +177 -0
- package/build/dist/Utils/NetworkDevice/DeviceReachabilityUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +23 -27
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +44 -4
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The resource facets of the telemetry explorers (Logs / Traces), split by
|
|
3
|
+
* how a selection has to be turned into a predicate.
|
|
4
|
+
*
|
|
5
|
+
* A signal row names exactly one *primary* entity (`primaryEntityId` +
|
|
6
|
+
* `primaryEntityType`) and, since the entity model shipped, the full
|
|
7
|
+
* membership set it belongs to (`entityKeys`). Which of the two a facet
|
|
8
|
+
* selection has to be matched against depends on the ingestion path:
|
|
9
|
+
*
|
|
10
|
+
* - Agent-ingested resource telemetry (Infrastructure / Docker / Podman /
|
|
11
|
+
* Kubernetes agents) has no `service.name`, so the resource IS the
|
|
12
|
+
* primary entity and `primaryEntityId` holds its Postgres id.
|
|
13
|
+
* - OTLP telemetry that carries a `service.name` is primary-keyed on its
|
|
14
|
+
* Service (`OtelIngestBaseService.selectPrimaryEntity`); the host /
|
|
15
|
+
* cluster it runs on is recorded only in `entityKeys`.
|
|
16
|
+
*
|
|
17
|
+
* The second case is why coalescing every resource facet into one
|
|
18
|
+
* `primaryEntityId IN (...)` list returned nothing for a Kubernetes cluster
|
|
19
|
+
* ingested through an OpenTelemetry Collector: the cluster id was compared
|
|
20
|
+
* against a column that only ever held the Service id. Selections on these
|
|
21
|
+
* facets therefore compile to a per-facet OR of both memberships, and the
|
|
22
|
+
* per-facet groups AND with each other so "cluster X" + "service Y"
|
|
23
|
+
* intersects instead of unioning.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Facets whose values are Service ids — the ids that legitimately live in
|
|
27
|
+
* `primaryEntityId` for OTLP telemetry. `serviceId` is the pre-rename alias
|
|
28
|
+
* kept for stale clients (see ResourceFacetResolver).
|
|
29
|
+
*/
|
|
30
|
+
export const SERVICE_FACET_KEYS = [
|
|
31
|
+
"primaryEntityId",
|
|
32
|
+
"serviceId",
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Facets whose values are ids of a NON-Service resource row. These are the
|
|
36
|
+
* ones that need the entity-key treatment; the value is a Postgres id
|
|
37
|
+
* (Host / DockerHost / PodmanHost / KubernetesCluster) which the server
|
|
38
|
+
* resolves to the resource's identifying value and then to its entity key.
|
|
39
|
+
*/
|
|
40
|
+
export const RESOURCE_ENTITY_FACET_KEYS = [
|
|
41
|
+
"hostId",
|
|
42
|
+
"dockerHostId",
|
|
43
|
+
"podmanHostId",
|
|
44
|
+
"kubernetesClusterId",
|
|
45
|
+
];
|
|
46
|
+
const RESOURCE_ENTITY_FACET_KEY_SET = new Set(RESOURCE_ENTITY_FACET_KEYS);
|
|
47
|
+
const SERVICE_FACET_KEY_SET = new Set(SERVICE_FACET_KEYS);
|
|
48
|
+
/**
|
|
49
|
+
* Every facet key that names a resource, in either group. Kept so call
|
|
50
|
+
* sites that only need "is this a resource chip?" (chip rendering, scope
|
|
51
|
+
* hand-off) do not have to consult both sets.
|
|
52
|
+
*/
|
|
53
|
+
export const ALL_RESOURCE_FACET_KEYS = [
|
|
54
|
+
...SERVICE_FACET_KEYS,
|
|
55
|
+
...RESOURCE_ENTITY_FACET_KEYS,
|
|
56
|
+
];
|
|
57
|
+
export function isServiceFacetKey(facetKey) {
|
|
58
|
+
return SERVICE_FACET_KEY_SET.has(facetKey);
|
|
59
|
+
}
|
|
60
|
+
export function isResourceEntityFacetKey(facetKey) {
|
|
61
|
+
return RESOURCE_ENTITY_FACET_KEY_SET.has(facetKey);
|
|
62
|
+
}
|
|
63
|
+
export function isResourceFacetKey(facetKey) {
|
|
64
|
+
return isServiceFacetKey(facetKey) || isResourceEntityFacetKey(facetKey);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Collect the non-Service resource selections out of applied facet filters.
|
|
68
|
+
* Accepts anything entry-iterable so the Logs explorer can pass a
|
|
69
|
+
* `Map<string, Set<string>>` and the Traces explorer a plain record via
|
|
70
|
+
* `Object.entries`.
|
|
71
|
+
*
|
|
72
|
+
* Values are de-duplicated and empty facets are dropped, so an emptied chip
|
|
73
|
+
* group never becomes a `[]` that a reader might read as "match nothing".
|
|
74
|
+
*/
|
|
75
|
+
export function collectResourceEntityFacetSelections(entries) {
|
|
76
|
+
const selections = {};
|
|
77
|
+
for (const [facetKey, values] of entries) {
|
|
78
|
+
if (!isResourceEntityFacetKey(facetKey)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const unique = new Set(selections[facetKey] || []);
|
|
82
|
+
for (const value of values) {
|
|
83
|
+
if (typeof value === "string" && value.length > 0) {
|
|
84
|
+
unique.add(value);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (unique.size > 0) {
|
|
88
|
+
selections[facetKey] = Array.from(unique);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return selections;
|
|
92
|
+
}
|
|
93
|
+
/** Collect the Service-facet selections, same rules as the helper above. */
|
|
94
|
+
export function collectServiceFacetSelections(entries) {
|
|
95
|
+
const unique = new Set();
|
|
96
|
+
for (const [facetKey, values] of entries) {
|
|
97
|
+
if (!isServiceFacetKey(facetKey)) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
for (const value of values) {
|
|
101
|
+
if (typeof value === "string" && value.length > 0) {
|
|
102
|
+
unique.add(value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return Array.from(unique);
|
|
107
|
+
}
|
|
108
|
+
/*
|
|
109
|
+
* Ids are ObjectID (UUID) strings. Validating the shape here means a
|
|
110
|
+
* malformed filter is dropped at the edge instead of reaching a lookup or a
|
|
111
|
+
* SQL parameter.
|
|
112
|
+
*/
|
|
113
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
114
|
+
/** Upper bound on ids per facet, so a crafted request cannot send an unbounded list. */
|
|
115
|
+
export const MAX_RESOURCE_IDS_PER_FACET = 200;
|
|
116
|
+
/**
|
|
117
|
+
* Parse an untrusted `resourceFilters` value (request body field or a
|
|
118
|
+
* persisted saved-view query) into the canonical selection shape.
|
|
119
|
+
*
|
|
120
|
+
* Deliberately lenient: anything that is not `{ <known facet key>:
|
|
121
|
+
* <uuid>[] }` is dropped rather than turned into a predicate, because a
|
|
122
|
+
* malformed filter must mean "no constraint" — never "match nothing", which
|
|
123
|
+
* would show an empty explorer with no explanation.
|
|
124
|
+
*/
|
|
125
|
+
export function parseResourceEntityFacetSelections(source) {
|
|
126
|
+
const selections = {};
|
|
127
|
+
if (!source || typeof source !== "object" || Array.isArray(source)) {
|
|
128
|
+
return selections;
|
|
129
|
+
}
|
|
130
|
+
const record = source;
|
|
131
|
+
for (const facetKey of Object.keys(record)) {
|
|
132
|
+
if (!isResourceEntityFacetKey(facetKey)) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const raw = record[facetKey];
|
|
136
|
+
if (!Array.isArray(raw)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const ids = Array.from(new Set(raw.filter((value) => {
|
|
140
|
+
return typeof value === "string" && UUID_PATTERN.test(value);
|
|
141
|
+
}))).slice(0, MAX_RESOURCE_IDS_PER_FACET);
|
|
142
|
+
if (ids.length > 0) {
|
|
143
|
+
selections[facetKey] = ids;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return selections;
|
|
147
|
+
}
|
|
148
|
+
export function hasResourceEntityFacetSelections(selections) {
|
|
149
|
+
if (!selections) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return Object.keys(selections).some((key) => {
|
|
153
|
+
return (selections[key] || []).length > 0;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=ResourceEntityFacet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceEntityFacet.js","sourceRoot":"","sources":["../../../../Types/Telemetry/ResourceEntityFacet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B;IACvD,iBAAiB;IACjB,WAAW;CACZ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA0B;IAC/D,QAAQ;IACR,cAAc;IACd,cAAc;IACd,qBAAqB;CACtB,CAAC;AAEF,MAAM,6BAA6B,GAAwB,IAAI,GAAG,CAChE,0BAA0B,CAC3B,CAAC;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AC,GAAG,CAAC,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QAED,MAAM,GAAG,GAAkB,KAAK,CAAC,IAAI,CACnC,IAAI,GAAG,CACJ,GAAsB,CAAC,MAAM,CAAC,CAAC,KAAc,EAAmB,EAAE;YACjE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CACH,CACF,CAAC,KAAK,CAAC,CAAC,EAAE,0BAA0B,CAAC,CAAC;QAEvC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,UAAU,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,UAAqD;IAErD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,GAAW,EAAW,EAAE;QAC3D,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,17 +1,98 @@
|
|
|
1
1
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
2
2
|
import Icon, { SizeProp } from "../Icon/Icon";
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { useMemo, useRef, useState, } from "react";
|
|
4
4
|
export function isCardSelectOptionGroup(option) {
|
|
5
5
|
return (option.label !== undefined &&
|
|
6
6
|
Array.isArray(option.options));
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
export const getCardSelectSearchTokens = (search) => {
|
|
9
|
+
return search
|
|
10
|
+
.trim()
|
|
11
|
+
.toLowerCase()
|
|
12
|
+
.split(/\s+/)
|
|
13
|
+
.filter((token) => {
|
|
14
|
+
return token.length > 0;
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const getHaystack = (option, groupLabel) => {
|
|
18
|
+
return `${option.title} ${option.description} ${groupLabel || ""} ${(option.keywords || []).join(" ")}`.toLowerCase();
|
|
19
|
+
};
|
|
20
|
+
export const cardSelectOptionMatchesSearch = (option, tokens, groupLabel) => {
|
|
21
|
+
if (tokens.length === 0) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
const haystack = getHaystack(option, groupLabel || null);
|
|
25
|
+
return tokens.every((token) => {
|
|
26
|
+
return haystack.includes(token);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const getSearchScoreForToken = (option, groupLabel, searchTerm) => {
|
|
30
|
+
const title = option.title.toLowerCase();
|
|
31
|
+
const description = option.description.toLowerCase();
|
|
32
|
+
const label = (groupLabel || "").toLowerCase();
|
|
33
|
+
const keywords = (option.keywords || []).map((keyword) => {
|
|
34
|
+
return keyword.toLowerCase();
|
|
35
|
+
});
|
|
36
|
+
let score = 0;
|
|
37
|
+
if (title === searchTerm) {
|
|
38
|
+
score += 200;
|
|
39
|
+
}
|
|
40
|
+
else if (title.startsWith(searchTerm)) {
|
|
41
|
+
score += 140;
|
|
42
|
+
}
|
|
43
|
+
else if (title.includes(searchTerm)) {
|
|
44
|
+
score += 100;
|
|
45
|
+
}
|
|
46
|
+
/*
|
|
47
|
+
* An exact keyword hit is the strongest signal there is after the title
|
|
48
|
+
* itself: someone who types "k8s" or "postgres" has named the thing, they
|
|
49
|
+
* just have not named it the way the card does.
|
|
50
|
+
*/
|
|
51
|
+
if (keywords.some((keyword) => {
|
|
52
|
+
return keyword === searchTerm;
|
|
53
|
+
})) {
|
|
54
|
+
score += 120;
|
|
55
|
+
}
|
|
56
|
+
else if (keywords.some((keyword) => {
|
|
57
|
+
return keyword.startsWith(searchTerm);
|
|
58
|
+
})) {
|
|
59
|
+
score += 80;
|
|
60
|
+
}
|
|
61
|
+
else if (keywords.some((keyword) => {
|
|
62
|
+
return keyword.includes(searchTerm);
|
|
63
|
+
})) {
|
|
64
|
+
score += 50;
|
|
65
|
+
}
|
|
66
|
+
if (label.startsWith(searchTerm)) {
|
|
67
|
+
score += 75;
|
|
68
|
+
}
|
|
69
|
+
else if (label.includes(searchTerm)) {
|
|
70
|
+
score += 55;
|
|
71
|
+
}
|
|
72
|
+
if (description.includes(searchTerm)) {
|
|
73
|
+
score += 35;
|
|
74
|
+
}
|
|
75
|
+
if (title.split(" ").some((word) => {
|
|
76
|
+
return word.trim().startsWith(searchTerm);
|
|
77
|
+
})) {
|
|
78
|
+
score += 15;
|
|
79
|
+
}
|
|
80
|
+
return score;
|
|
81
|
+
};
|
|
82
|
+
export const getCardSelectOptionSearchScore = (option, tokens, groupLabel) => {
|
|
83
|
+
return tokens.reduce((total, token) => {
|
|
84
|
+
return total + getSearchScoreForToken(option, groupLabel || null, token);
|
|
85
|
+
}, 0);
|
|
86
|
+
};
|
|
87
|
+
/*
|
|
88
|
+
* Flat options and groups can be interleaved by the caller, so a run of flat
|
|
89
|
+
* options becomes its own unlabelled group wherever it appears.
|
|
90
|
+
*/
|
|
91
|
+
export const normalizeCardSelectGroups = (options) => {
|
|
10
92
|
const groups = [];
|
|
11
93
|
let ungroupedOptions = [];
|
|
12
|
-
for (const option of
|
|
94
|
+
for (const option of options) {
|
|
13
95
|
if (isCardSelectOptionGroup(option)) {
|
|
14
|
-
// Flush any accumulated ungrouped options first
|
|
15
96
|
if (ungroupedOptions.length > 0) {
|
|
16
97
|
groups.push({ label: null, options: ungroupedOptions });
|
|
17
98
|
ungroupedOptions = [];
|
|
@@ -25,42 +106,281 @@ const CardSelect = (props) => {
|
|
|
25
106
|
if (ungroupedOptions.length > 0) {
|
|
26
107
|
groups.push({ label: null, options: ungroupedOptions });
|
|
27
108
|
}
|
|
28
|
-
|
|
109
|
+
return groups;
|
|
110
|
+
};
|
|
111
|
+
const CardSelect = (props) => {
|
|
112
|
+
const [search, setSearch] = useState("");
|
|
113
|
+
const searchInputRef = useRef(null);
|
|
114
|
+
const containerRef = useRef(null);
|
|
115
|
+
/*
|
|
116
|
+
* Groups the user has toggled by hand, by label. Anything absent falls back
|
|
117
|
+
* to the default below, so a group does not spring shut again the moment
|
|
118
|
+
* the selection moves elsewhere.
|
|
119
|
+
*/
|
|
120
|
+
const [toggledGroups, setToggledGroups] = useState({});
|
|
121
|
+
const groups = useMemo(() => {
|
|
122
|
+
return normalizeCardSelectGroups(props.options);
|
|
123
|
+
}, [props.options]);
|
|
124
|
+
const tokens = useMemo(() => {
|
|
125
|
+
return getCardSelectSearchTokens(search);
|
|
126
|
+
}, [search]);
|
|
127
|
+
const isSearching = tokens.length > 0;
|
|
128
|
+
const totalOptionCount = useMemo(() => {
|
|
129
|
+
return groups.reduce((total, group) => {
|
|
130
|
+
return total + group.options.length;
|
|
131
|
+
}, 0);
|
|
132
|
+
}, [groups]);
|
|
133
|
+
/*
|
|
134
|
+
* A search flattens the groups. Ranked results in nine separate headed
|
|
135
|
+
* sections would bury the best match under whichever heading happens to
|
|
136
|
+
* come first, which is the problem the search is there to solve.
|
|
137
|
+
*/
|
|
138
|
+
const { searchResults, isShowingClosestMatches } = useMemo(() => {
|
|
139
|
+
if (!isSearching) {
|
|
140
|
+
return { searchResults: [], isShowingClosestMatches: false };
|
|
141
|
+
}
|
|
142
|
+
const collect = (requireEveryWord) => {
|
|
143
|
+
const scored = [];
|
|
144
|
+
for (const group of groups) {
|
|
145
|
+
for (const option of group.options) {
|
|
146
|
+
const matches = requireEveryWord
|
|
147
|
+
? cardSelectOptionMatchesSearch(option, tokens, group.label)
|
|
148
|
+
: tokens.some((token) => {
|
|
149
|
+
return cardSelectOptionMatchesSearch(option, [token], group.label);
|
|
150
|
+
});
|
|
151
|
+
if (!matches) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
scored.push({
|
|
155
|
+
option: option,
|
|
156
|
+
groupLabel: group.label,
|
|
157
|
+
score: getCardSelectOptionSearchScore(option, tokens, group.label),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return scored.sort((a, b) => {
|
|
162
|
+
const scoreDifference = b.score - a.score;
|
|
163
|
+
if (scoreDifference !== 0) {
|
|
164
|
+
return scoreDifference;
|
|
165
|
+
}
|
|
166
|
+
return a.option.title.localeCompare(b.option.title);
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
const everyWord = collect(true);
|
|
170
|
+
if (everyWord.length > 0) {
|
|
171
|
+
return { searchResults: everyWord, isShowingClosestMatches: false };
|
|
172
|
+
}
|
|
173
|
+
/*
|
|
174
|
+
* Nothing contains every word. Rather than a dead end, fall back to the
|
|
175
|
+
* cards matching any of them, ranked the same way - someone who typed
|
|
176
|
+
* "postgres uptime" gets SQL Query rather than an empty panel. With a
|
|
177
|
+
* single word this is the same query, so it correctly stays empty.
|
|
178
|
+
*/
|
|
179
|
+
const anyWord = collect(false);
|
|
180
|
+
return {
|
|
181
|
+
searchResults: anyWord,
|
|
182
|
+
isShowingClosestMatches: anyWord.length > 0,
|
|
183
|
+
};
|
|
184
|
+
}, [groups, tokens, isSearching]);
|
|
185
|
+
const isGroupExpanded = (group, groupIndex) => {
|
|
186
|
+
// Unlabelled groups have no header to collapse behind.
|
|
187
|
+
if (!props.collapsibleGroups || !group.label) {
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
const toggled = toggledGroups[group.label];
|
|
191
|
+
if (toggled !== undefined) {
|
|
192
|
+
return toggled;
|
|
193
|
+
}
|
|
194
|
+
// The group holding the current selection, so re-entering a form shows it.
|
|
195
|
+
if (props.value &&
|
|
196
|
+
group.options.some((option) => {
|
|
197
|
+
return option.value === props.value;
|
|
198
|
+
})) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
/*
|
|
202
|
+
* The first group is the common case in every catalog that bothers to
|
|
203
|
+
* order itself, so it is the one worth opening for a user who has not
|
|
204
|
+
* told us anything yet.
|
|
205
|
+
*/
|
|
206
|
+
return groupIndex === 0;
|
|
207
|
+
};
|
|
208
|
+
const gridClassName = props.singleColumn
|
|
209
|
+
? "grid grid-cols-1 gap-4"
|
|
210
|
+
: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3";
|
|
211
|
+
/*
|
|
212
|
+
* The cards on screen, in the order they are rendered. A search reorders
|
|
213
|
+
* them and a folded group removes them, so this is recomputed rather than
|
|
214
|
+
* taken from props.
|
|
215
|
+
*/
|
|
216
|
+
const visibleOptionValues = useMemo(() => {
|
|
217
|
+
if (isSearching) {
|
|
218
|
+
return searchResults.map((result) => {
|
|
219
|
+
return result.option.value;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const values = [];
|
|
223
|
+
groups.forEach((group, groupIndex) => {
|
|
224
|
+
if (!isGroupExpanded(group, groupIndex)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
for (const option of group.options) {
|
|
228
|
+
values.push(option.value);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return values;
|
|
232
|
+
/*
|
|
233
|
+
* isGroupExpanded is read here rather than listed: it is rebuilt every
|
|
234
|
+
* render, and everything it actually depends on - the groups, the manual
|
|
235
|
+
* toggles and the current value - is in the list.
|
|
236
|
+
*/
|
|
237
|
+
}, [groups, isSearching, searchResults, toggledGroups, props.value]);
|
|
238
|
+
/*
|
|
239
|
+
* One tab stop for the whole group, which is what a radiogroup is supposed
|
|
240
|
+
* to be. Every card used to get its own increasing tabIndex - with the 0
|
|
241
|
+
* that FormField passes, that produced 1, 2, 3 ... 28: positive values,
|
|
242
|
+
* which jump ahead of every other control on the page in tab order. Arrow
|
|
243
|
+
* keys move between the cards once the group has focus.
|
|
244
|
+
*/
|
|
245
|
+
const activeOptionValue = props.value && visibleOptionValues.includes(props.value)
|
|
246
|
+
? props.value
|
|
247
|
+
: visibleOptionValues[0];
|
|
248
|
+
const focusCard = (value) => {
|
|
249
|
+
var _a;
|
|
250
|
+
const card = ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-card-select-value="${CSS.escape(value)}"]`)) || null;
|
|
251
|
+
card === null || card === void 0 ? void 0 : card.focus();
|
|
252
|
+
};
|
|
253
|
+
const moveFocus = (fromValue, offset) => {
|
|
254
|
+
const currentIndex = visibleOptionValues.indexOf(fromValue);
|
|
255
|
+
if (currentIndex < 0) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
/*
|
|
259
|
+
* Clamped rather than wrapping: running off the end of a 29 card grid and
|
|
260
|
+
* landing back at the top reads as a glitch, not as navigation.
|
|
261
|
+
*/
|
|
262
|
+
const nextIndex = Math.min(Math.max(currentIndex + offset, 0), visibleOptionValues.length - 1);
|
|
263
|
+
const nextValue = visibleOptionValues[nextIndex];
|
|
264
|
+
if (!nextValue || nextValue === fromValue) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
focusCard(nextValue);
|
|
268
|
+
};
|
|
269
|
+
const renderCard = (option) => {
|
|
270
|
+
const isSelected = props.value === option.value;
|
|
271
|
+
return (React.createElement("div", { key: option.value, tabIndex: option.value === activeOptionValue ? props.tabIndex || 0 : -1, "data-card-select-value": option.value, onClick: () => {
|
|
272
|
+
props.onChange(option.value);
|
|
273
|
+
}, onKeyDown: (e) => {
|
|
274
|
+
/*
|
|
275
|
+
* Manual activation: arrows move focus, Enter or Space chooses.
|
|
276
|
+
* Selecting on focus would fire onChange for every card arrowed
|
|
277
|
+
* past, and on this form that resets the criteria below.
|
|
278
|
+
*/
|
|
279
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
280
|
+
e.preventDefault();
|
|
281
|
+
props.onChange(option.value);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
285
|
+
e.preventDefault();
|
|
286
|
+
moveFocus(option.value, 1);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
moveFocus(option.value, -1);
|
|
292
|
+
}
|
|
293
|
+
}, className: `relative flex cursor-pointer rounded-lg border p-4 shadow-sm transition-all duration-200 hover:border-indigo-400 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 ${isSelected
|
|
294
|
+
? "border-indigo-500 bg-indigo-50/50"
|
|
295
|
+
: "border-gray-200 bg-white"}`, role: "radio", "aria-checked": isSelected, "data-testid": `card-select-option-${option.value}` },
|
|
296
|
+
React.createElement("div", { className: "flex w-full items-start" },
|
|
297
|
+
React.createElement("div", { className: `flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg ${isSelected ? "bg-indigo-100" : "bg-gray-100"}` },
|
|
298
|
+
React.createElement(Icon, { icon: option.icon, size: SizeProp.Large, className: `h-5 w-5 ${isSelected ? "text-indigo-600" : "text-gray-600"}` })),
|
|
299
|
+
React.createElement("div", { className: "ml-4 flex-1" },
|
|
300
|
+
React.createElement("span", { className: `block text-sm font-semibold ${isSelected ? "text-gray-900" : "text-gray-900"}` }, option.title),
|
|
301
|
+
React.createElement("span", { className: `mt-1 block text-sm ${isSelected ? "text-gray-600" : "text-gray-500"}` }, option.description)),
|
|
302
|
+
isSelected && (React.createElement("div", { className: "flex-shrink-0 ml-2" },
|
|
303
|
+
React.createElement(Icon, { icon: IconProp.CheckCircle, size: SizeProp.Large, className: "h-5 w-5 text-indigo-500" }))))));
|
|
304
|
+
};
|
|
29
305
|
return (React.createElement("div", { "data-testid": props.dataTestId },
|
|
30
|
-
React.createElement("div", {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
306
|
+
props.searchable && (React.createElement("div", { className: "mb-5" },
|
|
307
|
+
React.createElement("div", { className: "relative flex items-center gap-3 rounded-lg border border-gray-300 bg-white px-3 py-2 shadow-sm transition-all duration-200 focus-within:border-indigo-500 focus-within:ring-1 focus-within:ring-indigo-500" },
|
|
308
|
+
React.createElement(Icon, { icon: IconProp.Search, className: "h-4 w-4 flex-shrink-0 text-gray-400" }),
|
|
309
|
+
React.createElement("input", { ref: searchInputRef, type: "text", value: search, placeholder: props.searchPlaceholder || "Search", autoComplete: "off", "aria-label": props.searchPlaceholder || "Search", "data-testid": "card-select-search", className: "block w-full border-0 bg-transparent p-0 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0", onChange: (event) => {
|
|
310
|
+
setSearch(event.target.value);
|
|
311
|
+
}, onKeyDown: (event) => {
|
|
312
|
+
if (event.key === "Escape" && search.length > 0) {
|
|
313
|
+
/*
|
|
314
|
+
* Stops the keypress reaching a modal or side over that
|
|
315
|
+
* would take a clear-the-search Escape as close-the-form.
|
|
316
|
+
*/
|
|
317
|
+
event.stopPropagation();
|
|
318
|
+
event.preventDefault();
|
|
319
|
+
setSearch("");
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
/*
|
|
323
|
+
* Type a couple of letters, press Enter, done - the whole
|
|
324
|
+
* point of the search box for someone who already knows what
|
|
325
|
+
* they want. Left alone when there is nothing to choose.
|
|
326
|
+
*/
|
|
327
|
+
if (event.key === "Enter" && searchResults[0]) {
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
props.onChange(searchResults[0].option.value);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
// The only way into the grid without reaching for the mouse.
|
|
333
|
+
if (event.key === "ArrowDown" && activeOptionValue) {
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
focusCard(activeOptionValue);
|
|
336
|
+
}
|
|
337
|
+
} }),
|
|
338
|
+
search.length > 0 && (React.createElement("button", { type: "button", "aria-label": "Clear search", "data-testid": "card-select-search-clear", className: "flex flex-shrink-0 items-center text-gray-400 hover:text-gray-600", onClick: () => {
|
|
339
|
+
var _a;
|
|
340
|
+
setSearch("");
|
|
341
|
+
(_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
342
|
+
} },
|
|
343
|
+
React.createElement(Icon, { icon: IconProp.Close, className: "h-4 w-4" })))),
|
|
344
|
+
React.createElement("p", { className: "mt-2 text-xs text-gray-500", "data-testid": "card-select-search-summary", role: "status" }, isSearching
|
|
345
|
+
? isShowingClosestMatches
|
|
346
|
+
? `Showing ${searchResults.length} closest of ${totalOptionCount}`
|
|
347
|
+
: `Showing ${searchResults.length} of ${totalOptionCount}`
|
|
348
|
+
: `${totalOptionCount} to choose from. Search by name, category, or what you want to watch.`))),
|
|
349
|
+
React.createElement("div", { ref: containerRef, role: "radiogroup", "aria-label": "Select an option", "aria-labelledby": props.ariaLabelledby },
|
|
350
|
+
isSearching && isShowingClosestMatches && (React.createElement("p", { className: "mb-4 text-sm text-gray-500", "data-testid": "card-select-closest-matches" }, "Nothing matches every word you typed. Closest matches:")),
|
|
351
|
+
isSearching && (React.createElement("div", { className: gridClassName }, searchResults.map((result) => {
|
|
352
|
+
return renderCard(result.option);
|
|
353
|
+
}))),
|
|
354
|
+
isSearching && searchResults.length === 0 && (React.createElement("div", { className: "rounded-lg border border-dashed border-gray-300 bg-gray-50 p-6 text-center", "data-testid": "card-select-no-results" },
|
|
355
|
+
React.createElement("p", { className: "text-sm font-medium text-gray-900" }, "Nothing matches every word you typed."),
|
|
356
|
+
React.createElement("p", { className: "mt-1 text-sm text-gray-500" }, "Try fewer words, or a protocol or product name."),
|
|
357
|
+
React.createElement("button", { type: "button", className: "mt-3 text-sm font-medium text-indigo-600 hover:text-indigo-500", onClick: () => {
|
|
358
|
+
var _a;
|
|
359
|
+
setSearch("");
|
|
360
|
+
(_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
361
|
+
} }, "Clear search"))),
|
|
362
|
+
!isSearching &&
|
|
363
|
+
groups.map((group, groupIndex) => {
|
|
364
|
+
const expanded = isGroupExpanded(group, groupIndex);
|
|
365
|
+
const canCollapse = Boolean(props.collapsibleGroups && group.label);
|
|
366
|
+
return (React.createElement("div", { key: groupIndex, className: groupIndex > 0 ? "mt-8" : "" },
|
|
367
|
+
group.label && !canCollapse && (React.createElement("div", { className: "relative mb-4" },
|
|
368
|
+
React.createElement("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true" },
|
|
369
|
+
React.createElement("div", { className: "w-full border-t border-gray-200" })),
|
|
370
|
+
React.createElement("div", { className: "relative flex justify-start" },
|
|
371
|
+
React.createElement("span", { className: "bg-white pr-3 text-xs font-semibold uppercase tracking-wider text-gray-400" }, group.label)))),
|
|
372
|
+
group.label && canCollapse && (React.createElement("button", { type: "button", "aria-expanded": expanded, "data-testid": `card-select-group-${group.label}`, className: "mb-4 flex w-full items-center gap-2 border-b border-gray-200 pb-2 text-left", onClick: () => {
|
|
373
|
+
setToggledGroups((previous) => {
|
|
374
|
+
return Object.assign(Object.assign({}, previous), { [group.label]: !expanded });
|
|
375
|
+
});
|
|
376
|
+
} },
|
|
377
|
+
React.createElement(Icon, { icon: expanded ? IconProp.ChevronDown : IconProp.ChevronRight, className: "h-4 w-4 flex-shrink-0 text-gray-400" }),
|
|
378
|
+
React.createElement("span", { className: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, group.label),
|
|
379
|
+
React.createElement("span", { className: "rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-500" }, group.options.length))),
|
|
380
|
+
expanded && (React.createElement("div", { className: gridClassName }, group.options.map((option) => {
|
|
381
|
+
return renderCard(option);
|
|
382
|
+
})))));
|
|
383
|
+
})),
|
|
64
384
|
props.error && (React.createElement("p", { className: "mt-2 text-sm text-red-600", role: "alert" }, props.error))));
|
|
65
385
|
};
|
|
66
386
|
export default CardSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardSelect.js","sourceRoot":"","sources":["../../../../../UI/Components/CardSelect/CardSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAA0C,MAAM,OAAO,CAAC;AAc/D,MAAM,UAAU,uBAAuB,CACrC,MAAgD;IAEhD,OAAO,CACJ,MAAgC,CAAC,KAAK,KAAK,SAAS;QACrD,KAAK,CAAC,OAAO,CAAE,MAAgC,CAAC,OAAO,CAAC,CACzD,CAAC;AACJ,CAAC;AAmBD,MAAM,UAAU,GAAsC,CACpD,KAAqB,EACP,EAAE;IAChB,uCAAuC;IACvC,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,IAAI,gBAAgB,GAA4B,EAAE,CAAC;IAEnD,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,gDAAgD;YAChD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBACxD,gBAAgB,GAAG,EAAE,CAAC;YACxB,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,gBAAgB,CAAC,IAAI,CAAC,MAAM,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IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,IAAI,EAAE,QAAQ,CAAC,KAAK,EACpB,SAAS,EAAC,yBAAyB,GACnC,CACE,CACP,CACG,CACF,CACP,CAAC;gBACJ,CAAC,CAAC,CACE,CACF,CACP,CAAC;QACJ,CAAC,CAAC,CACE;QACL,KAAK,CAAC,KAAK,IAAI,CACd,2BAAG,SAAS,EAAC,2BAA2B,EAAC,IAAI,EAAC,OAAO,IAClD,KAAK,CAAC,KAAK,CACV,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"CardSelect.js","sourceRoot":"","sources":["../../../../../UI/Components/CardSelect/CardSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,EAGZ,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAoBf,MAAM,UAAU,uBAAuB,CACrC,MAAgD;IAEhD,OAAO,CACJ,MAAgC,CAAC,KAAK,KAAK,SAAS;QACrD,KAAK,CAAC,OAAO,CAAE,MAAgC,CAAC,OAAO,CAAC,CACzD,CAAC;AACJ,CAAC;AAqCD,MAAM,CAAC,MAAM,yBAAyB,GAAmC,CACvE,MAAc,EACC,EAAE;IACjB,OAAO,MAAM;SACV,IAAI,EAAE;SACN,WAAW,EAAE;SACb,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAWF,MAAM,WAAW,GAA+B,CAC9C,MAAwB,EACxB,UAAyB,EACjB,EAAE;IACV,OAAO,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,IAAI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EAAE;oCACrD,uCACK,QAAQ,KACX,CAAC,KAAK,CAAC,KAAe,CAAC,EAAE,CAAC,QAAQ,IAClC;gCACJ,CAAC,CAAC,CAAC;4BACL,CAAC;4BAED,oBAAC,IAAI,IACH,IAAI,EACF,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,EAEzD,SAAS,EAAC,qCAAqC,GAC/C;4BACF,8BAAM,SAAS,EAAC,8DAA8D,IAC3E,KAAK,CAAC,KAAK,CACP;4BACP,8BAAM,SAAS,EAAC,wEAAwE,IACrF,KAAK,CAAC,OAAO,CAAC,MAAM,CAChB,CACA,CACV;wBAEA,QAAQ,IAAI,CACX,6BAAK,SAAS,EAAE,aAAa,IAC1B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAwB,EAAE,EAAE;4BAC9C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;wBAC5B,CAAC,CAAC,CACE,CACP,CACG,CACP,CAAC;gBACJ,CAAC,CAAC,CACA;QACL,KAAK,CAAC,KAAK,IAAI,CACd,2BAAG,SAAS,EAAC,2BAA2B,EAAC,IAAI,EAAC,OAAO,IAClD,KAAK,CAAC,KAAK,CACV,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
const EmptyState = (props) => {
|
|
5
5
|
const { translateValue } = useTranslateValue();
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement("div", { id: props.id, className: `flex pt-52 pb-52 ${props.showSolidBackground ? "bg-white rounded shadow" : ""}` },
|
|
7
|
+
React.createElement("div", { id: props.id, className: `flex ${props.paddingClassName || "pt-52 pb-52"} ${props.showSolidBackground ? "bg-white rounded shadow" : ""}` },
|
|
8
8
|
React.createElement("div", { className: "m-auto text-center" },
|
|
9
9
|
props.icon && (React.createElement(Icon, { icon: props.icon, className: props.iconClassName || `mx-auto h-12 w-12 text-gray-400` })),
|
|
10
10
|
React.createElement("h3", { className: "mt-2 text-sm font-medium text-gray-900" }, translateValue(props.title)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../../UI/Components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../../UI/Components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAmB/D,MAAM,UAAU,GAAsC,CACpD,KAAqB,EACP,EAAE;IAChB,MAAM,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAC/C,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ;QACb,6BACE,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,SAAS,EAAE,QAAQ,KAAK,CAAC,gBAAgB,IAAI,aAAa,IACxD,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAC1D,EAAE;YAEF,6BAAK,SAAS,EAAC,oBAAoB;gBAChC,KAAK,CAAC,IAAI,IAAI,CACb,oBAAC,IAAI,IACH,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EACP,KAAK,CAAC,aAAa,IAAI,iCAAiC,GAE1D,CACH;gBAED,4BAAI,SAAS,EAAC,wCAAwC,IACnD,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CACzB;gBACL,2BAAG,SAAS,EAAC,4BAA4B,IACtC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAChC;gBACH,KAAK,CAAC,MAAM,IAAI,6BAAK,SAAS,EAAC,MAAM,IAAE,KAAK,CAAC,MAAM,CAAO,CACvD,CACF,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|