@flanksource/clicky-ui 0.3.84 → 0.3.85
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/dist/components/Combobox.cjs +8 -6
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +8 -6
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +7 -4
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -2
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +7 -4
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/FilterBar.cjs +64 -47
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +63 -46
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/TimeRange.cjs +156 -128
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +156 -128
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/combobox-types.d.ts +5 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/filter-bar-context.cjs.map +1 -1
- package/dist/components/filter-bar-context.d.ts +2 -0
- package/dist/components/filter-bar-context.d.ts.map +1 -1
- package/dist/components/filter-bar-context.js.map +1 -1
- package/dist/components/filter-bar-field-utils.cjs +18 -4
- package/dist/components/filter-bar-field-utils.cjs.map +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +3 -2
- package/dist/components/filter-bar-field-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-field-utils.js +19 -5
- package/dist/components/filter-bar-field-utils.js.map +1 -1
- package/dist/components/filter-bar-menu.cjs +189 -0
- package/dist/components/filter-bar-menu.cjs.map +1 -0
- package/dist/components/filter-bar-menu.d.ts +25 -0
- package/dist/components/filter-bar-menu.d.ts.map +1 -0
- package/dist/components/filter-bar-menu.js +189 -0
- package/dist/components/filter-bar-menu.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +2 -2
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-popup.cjs +37 -0
- package/dist/components/filter-bar-popup.cjs.map +1 -0
- package/dist/components/filter-bar-popup.d.ts +32 -0
- package/dist/components/filter-bar-popup.d.ts.map +1 -0
- package/dist/components/filter-bar-popup.js +37 -0
- package/dist/components/filter-bar-popup.js.map +1 -0
- package/dist/components/filter-bar-tree.cjs +1 -1
- package/dist/components/filter-bar-tree.cjs.map +1 -1
- package/dist/components/filter-bar-tree.js +2 -2
- package/dist/components/filter-bar-tree.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +5 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +5 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/connections/ConnectionPicker.cjs +6 -2
- package/dist/connections/ConnectionPicker.cjs.map +1 -1
- package/dist/connections/ConnectionPicker.d.ts.map +1 -1
- package/dist/connections/ConnectionPicker.js +6 -2
- package/dist/connections/ConnectionPicker.js.map +1 -1
- package/dist/connections/CreateConnectionDialog.cjs +8 -21
- package/dist/connections/CreateConnectionDialog.cjs.map +1 -1
- package/dist/connections/CreateConnectionDialog.d.ts +2 -1
- package/dist/connections/CreateConnectionDialog.d.ts.map +1 -1
- package/dist/connections/CreateConnectionDialog.js +8 -21
- package/dist/connections/CreateConnectionDialog.js.map +1 -1
- package/dist/data/ExpandableMarkdown.cjs +59 -0
- package/dist/data/ExpandableMarkdown.cjs.map +1 -0
- package/dist/data/ExpandableMarkdown.d.ts +17 -0
- package/dist/data/ExpandableMarkdown.d.ts.map +1 -0
- package/dist/data/ExpandableMarkdown.js +59 -0
- package/dist/data/ExpandableMarkdown.js.map +1 -0
- package/dist/data/MultiGaugeBar.cjs +49 -21
- package/dist/data/MultiGaugeBar.cjs.map +1 -1
- package/dist/data/MultiGaugeBar.d.ts +5 -2
- package/dist/data/MultiGaugeBar.d.ts.map +1 -1
- package/dist/data/MultiGaugeBar.js +49 -21
- package/dist/data/MultiGaugeBar.js.map +1 -1
- package/dist/data/flow-node/BoxNode.cjs +45 -0
- package/dist/data/flow-node/BoxNode.cjs.map +1 -0
- package/dist/data/flow-node/BoxNode.d.ts +28 -0
- package/dist/data/flow-node/BoxNode.d.ts.map +1 -0
- package/dist/data/flow-node/BoxNode.js +45 -0
- package/dist/data/flow-node/BoxNode.js.map +1 -0
- package/dist/data/flow-node/FlowMetrics.cjs +208 -0
- package/dist/data/flow-node/FlowMetrics.cjs.map +1 -0
- package/dist/data/flow-node/FlowMetrics.d.ts +60 -0
- package/dist/data/flow-node/FlowMetrics.d.ts.map +1 -0
- package/dist/data/flow-node/FlowMetrics.js +206 -0
- package/dist/data/flow-node/FlowMetrics.js.map +1 -0
- package/dist/data/flow-node/WorkloadNode.cjs +63 -0
- package/dist/data/flow-node/WorkloadNode.cjs.map +1 -0
- package/dist/data/flow-node/WorkloadNode.d.ts +42 -0
- package/dist/data/flow-node/WorkloadNode.d.ts.map +1 -0
- package/dist/data/flow-node/WorkloadNode.js +63 -0
- package/dist/data/flow-node/WorkloadNode.js.map +1 -0
- package/dist/data/flow-node/index.d.ts +5 -0
- package/dist/data/flow-node/index.d.ts.map +1 -0
- package/dist/data/flow-node/latency.cjs +37 -0
- package/dist/data/flow-node/latency.cjs.map +1 -0
- package/dist/data/flow-node/latency.d.ts +13 -0
- package/dist/data/flow-node/latency.d.ts.map +1 -0
- package/dist/data/flow-node/latency.js +35 -0
- package/dist/data/flow-node/latency.js.map +1 -0
- package/dist/data/traces/index.d.ts +1 -0
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +90 -56
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +91 -57
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +83 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +83 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/TraceResults.cjs +81 -13
- package/dist/data/traces/otel/TraceResults.cjs.map +1 -1
- package/dist/data/traces/otel/TraceResults.d.ts +11 -3
- package/dist/data/traces/otel/TraceResults.d.ts.map +1 -1
- package/dist/data/traces/otel/TraceResults.js +81 -13
- package/dist/data/traces/otel/TraceResults.js.map +1 -1
- package/dist/data/traces/otel/api.cjs.map +1 -1
- package/dist/data/traces/otel/api.d.ts +14 -0
- package/dist/data/traces/otel/api.d.ts.map +1 -1
- package/dist/data/traces/otel/api.js.map +1 -1
- package/dist/data/traces/otel/query.cjs +2 -2
- package/dist/data/traces/otel/query.cjs.map +1 -1
- package/dist/data/traces/otel/query.d.ts +1 -1
- package/dist/data/traces/otel/query.d.ts.map +1 -1
- package/dist/data/traces/otel/query.js +2 -2
- package/dist/data/traces/otel/query.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.cjs.map +1 -1
- package/dist/data/version-info.js +3 -3
- package/dist/data/version-info.js.map +1 -1
- package/dist/data/workload-panel/MemoryStack.cjs +38 -1
- package/dist/data/workload-panel/MemoryStack.cjs.map +1 -1
- package/dist/data/workload-panel/MemoryStack.d.ts.map +1 -1
- package/dist/data/workload-panel/MemoryStack.js +38 -1
- package/dist/data/workload-panel/MemoryStack.js.map +1 -1
- package/dist/data.cjs +18 -1
- package/dist/data.d.ts +2 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +8 -2
- package/dist/file-findings/AnnotatedCode.cjs +18 -2
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +2 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +18 -2
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +2 -0
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/file-review/FileReview.cjs +2 -1
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +3 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +2 -1
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/index.cjs +18 -1
- package/dist/index.js +8 -2
- package/dist/profiles/editor/profileEditor.cjs +29 -30
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +29 -30
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +44 -43
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +10 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +44 -43
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +153 -48
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +16 -2
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +155 -50
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/sampleError.cjs +29 -0
- package/dist/profiles/editor/sampleError.cjs.map +1 -0
- package/dist/profiles/editor/sampleError.d.ts +16 -0
- package/dist/profiles/editor/sampleError.d.ts.map +1 -0
- package/dist/profiles/editor/sampleError.js +27 -0
- package/dist/profiles/editor/sampleError.js.map +1 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -1
- package/dist/profiles/query/profileSampleResult.d.ts +2 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleResult.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +2 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/react-grab/core/index.js +1 -1
- package/dist/react-grab/{core-BERtFDWh.js → core-BK5CU6Lb.js} +2 -2
- package/dist/react-grab/index.js +1 -1
- package/dist/react-grab/{renderer-KT3FY3K2.js → renderer-DcHrsQ8k.js} +1 -1
- package/dist/rpc/apiClient.cjs +12 -15
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +12 -15
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/runtime/barrels.json +6481 -6441
- package/dist/runtime/importmap.json +2198 -2190
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditor.cjs","names":["lazy","sampleRequestProfile","profileApiPath","useOperationLookupFetcher","useMemo","cloneProfileDraft","useState","defaultSpanColumns","profileSampleSignature","validateProfileEditorDraft","useProfileInspection","profileConnectionID","profileColumnResetState","useProfileFieldState","processorCatalog","profileSchema","useCallback","resolveProfileUpdatePath","profileUpdateConflictTarget","mergeSampledProfileColumns","useQuery","resetProfileColumns","Button","ProfileGeneralSection","ProfileSourceCard","ProfileSchemaSection","profileGeneralOptionKeys","ProfileQuerySection","_Fragment","ProfileSpansSection","ProfileFieldEditorForm","profileFieldEditorEmptyMessage","ProfileParameterDetail","ProcessorPipeline","Suspense","UiListTree","ProfileEditorRail","profileEditorSectionStatus","ProfileFieldSidebarList","ProfileParameterSidebar","UiTable","ProfileEditorPreview","JsonPathSampleRowsContext","Icon","UiPlay","Workspace","Modal","ProfileSaveAsDialog","profileEditorSections"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,oBAAA,GAAmBA,MAAAA,KAAAA,OAAAA,QAAAA,QAAAA,CAAAA,CAAAA,WAAAA,QACvB,wBAAA,CAAA,CAAA,CAA6B,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;AAGA,SAAS,mBAAmB,MAAsB;CAChD,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,IAAI;EACvC,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,WAAW,UAAU,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO;CAC5H,QAAQ,CAER;CACA,OAAO;AACT;;AAGA,eAAe,kBAAkB,OAAwE;CACvG,MAAM,UAAUC,uBAAAA,qBAAqB,KAAK;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,4CAA4C;CAC1E,MAAM,WAAW,MAAM,MAAMC,mBAAAA,eAAe,gBAAgB,GAAG;EAC7D,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GAAE;GAAS,QAAQ,CAAC;GAAG,mBAAmB;EAAK,CAAC;CACvE,CAAC;CACD,IA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c;IAChC,MAAK;IACL,QACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACxB,eAAAA,QAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe,iBAAiB,EAAE;MACnC,UAAA;KAEO,CAAA,GACR,iBAAA,GAAA,kBAAA,IAAA,CAACA,eAAAA,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO0B,2BAAAA,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
|
|
1
|
+
{"version":3,"file":"profileEditor.cjs","names":["lazy","sampleRequestProfile","profileApiPath","parseSampleError","useOperationLookupFetcher","useMemo","cloneProfileDraft","useState","defaultSpanColumns","profileSampleSignature","validateProfileEditorDraft","useProfileInspection","profileConnectionID","profileColumnResetState","useProfileFieldState","processorCatalog","profileSchema","useCallback","resolveProfileUpdatePath","profileUpdateConflictTarget","mergeSampledProfileColumns","useQuery","resetProfileColumns","Button","ProfileGeneralSection","ProfileSourceCard","ProfileSchemaSection","profileGeneralOptionKeys","ProfileQuerySection","_Fragment","ProfileSpansSection","ProfileFieldEditorForm","profileFieldEditorEmptyMessage","ProfileParameterDetail","ProcessorPipeline","Suspense","UiListTree","ProfileEditorRail","profileEditorSectionStatus","ProfileFieldSidebarList","ProfileParameterSidebar","UiTable","ProfileEditorPreview","JsonPathSampleRowsContext","Icon","UiPlay","Workspace","Modal","ProfileSaveAsDialog","profileEditorSections"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport type { ProfileMappingPreviewStatus } from \"./profileMappingPreview\";\nimport { parseSampleError } from \"./sampleError\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\n/** The Preview pane header's word on the preview, so it never claims \"updates as you edit\" while the preview is failing. */\nconst PREVIEW_STATUS_NOTES: Record<ProfileMappingPreviewStatus, string> = {\n idle: \"not previewed\",\n updating: \"updating…\",\n ready: \"updates as you edit\",\n failed: \"preview failed\",\n};\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(parseSampleError(await response.text()).message);\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n // The service keeps the sample it took; the preview maps it by this id, so the\n // rows (often megabytes of documents) never travel back on an edit.\n const [sampleId, setSampleId] = useState<string>();\n const [previewStatus, setPreviewStatus] = useState<ProfileMappingPreviewStatus>(\"idle\");\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows, sampleId: retained }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n if (!retained) throw new Error(\"Sample response is missing sampleId\");\n setMappingRows(mappingInputRows);\n setSampleId(retained);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n if (sampling) return;\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes: WorkspacePaneSpec[] = (() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleId\n ? `${mappingRows.length} sampled rows · ${PREVIEW_STATUS_NOTES[previewStatus]}`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n sampleId={sampleId}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n onSampleExpired={() => void runSample()}\n onSelectColumn={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onStatusChange={setPreviewStatus}\n />\n ),\n });\n }\n return result;\n })();\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n const entry = profileEditorSections.find((entry) => entry.id === section);\n if (!entry) throw new Error(`Unknown profile editor section: ${section}`);\n return entry.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,IAAM,oBAAA,GAAmBA,MAAAA,KAAAA,OAAAA,QAAAA,QAAAA,CAAAA,CAAAA,WAAAA,QACvB,wBAAA,CAAA,CAAA,CAA6B,MAAM,YAAY,EAC7C,SAAS,OAAO,iBAClB,EAAE,CACJ;;;AAIA,IAAM,uBAAoE;CACxE,MAAM;CACN,UAAU;CACV,OAAO;CACP,QAAQ;AACV;;AAGA,eAAe,kBAAkB,OAAwE;CACvG,MAAM,UAAUC,uBAAAA,qBAAqB,KAAK;CAC1C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,4CAA4C;CAC1E,MAAM,WAAW,MAAM,MAAMC,mBAAAA,eAAe,gBAAgB,GAAG;EAC7D,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GAAE;GAAS,QAAQ,CAAC;GAAG,mBAAmB;EAAK,CAAC;CACvE,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAMC,oBAAAA,iBAAiB,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC,OAAO;CACjF,OAAQ,MAAM,SAAS,KAAK;AAC9B;;;;;;;;;;AAWA,SAAgB,cAAc,EAC5B,QACA,QACA,cACA,YACA,cACA,SACA,aAYC;CACD,MAAM,gBAAgBC,+BAAAA,0BAA0B,MAAM;CACtD,MAAM,gBAAA,GAAeC,MAAAA,QAAAA,OACbC,2BAAAA,kBAAkB,YAAY,GACpC,CAAC,YAAY,CACf;CACA,MAAM,qBAAA,GAAoBD,MAAAA,QAAAA,OAClB,KAAK,UAAU,YAAY,GACjC,CAAC,YAAY,CACf;CACA,MAA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;CACnD,+
|
|
1
|
+
{"version":3,"file":"profileEditor.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA6FnE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,SAAS,GACV,EAAE;IACD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;mCAE+B;IAC/B,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,+BAylBA"}
|
|
@@ -8,6 +8,7 @@ import { UiPlay } from "../../icons/components/UiPlay.js";
|
|
|
8
8
|
import { UiTable } from "../../icons/components/UiTable.js";
|
|
9
9
|
import { cloneProfileDraft, mergeSampledProfileColumns, profileColumnResetState, profileEditorSectionStatus, profileEditorSections, profileGeneralOptionKeys, profileSampleSignature, profileUpdateConflictTarget, resetProfileColumns, validateProfileEditorDraft } from "./profileEditorModel.js";
|
|
10
10
|
import { ProfileEditorPreview } from "./profileEditorPreview.js";
|
|
11
|
+
import { parseSampleError } from "./sampleError.js";
|
|
11
12
|
import { ProfileEditorRail } from "./profileEditorRail.js";
|
|
12
13
|
import { ProfileSaveAsDialog } from "./profileSaveAsDialog.js";
|
|
13
14
|
import { ProfileGeneralSection, ProfileQuerySection, ProfileSchemaSection, ProfileSourceCard } from "./profileEditorSections.js";
|
|
@@ -30,13 +31,13 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
30
31
|
// src/profiles/editor/profileEditor.tsx
|
|
31
32
|
var ProfileEditorRaw = lazy(() => import("./profileEditorRaw.js").then((module) => ({ default: module.ProfileEditorRaw })));
|
|
32
33
|
/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
34
|
+
/** The Preview pane header's word on the preview, so it never claims "updates as you edit" while the preview is failing. */
|
|
35
|
+
var PREVIEW_STATUS_NOTES = {
|
|
36
|
+
idle: "not previewed",
|
|
37
|
+
updating: "updating…",
|
|
38
|
+
ready: "updates as you edit",
|
|
39
|
+
failed: "preview failed"
|
|
40
|
+
};
|
|
40
41
|
/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */
|
|
41
42
|
async function fetchEditorSample(draft) {
|
|
42
43
|
const profile = sampleRequestProfile(draft);
|
|
@@ -50,7 +51,7 @@ async function fetchEditorSample(draft) {
|
|
|
50
51
|
previewProcessors: true
|
|
51
52
|
})
|
|
52
53
|
});
|
|
53
|
-
if (!response.ok) throw new Error(
|
|
54
|
+
if (!response.ok) throw new Error(parseSampleError(await response.text()).message);
|
|
54
55
|
return await response.json();
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
@@ -72,6 +73,8 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
72
73
|
const [sampledColumns, setSampledColumns] = useState([]);
|
|
73
74
|
const [sampleRows, setSampleRows] = useState([]);
|
|
74
75
|
const [mappingRows, setMappingRows] = useState([]);
|
|
76
|
+
const [sampleId, setSampleId] = useState();
|
|
77
|
+
const [previewStatus, setPreviewStatus] = useState("idle");
|
|
75
78
|
const [activeField, setActiveField] = useState(initialDraft.columns?.[0]?.name ?? "");
|
|
76
79
|
const [activeParameter, setActiveParameter] = useState(0);
|
|
77
80
|
const [activeProcessor, setActiveProcessor] = useState(0);
|
|
@@ -161,9 +164,11 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
161
164
|
setSaving(false);
|
|
162
165
|
}
|
|
163
166
|
};
|
|
164
|
-
const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }) => {
|
|
167
|
+
const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows, sampleId: retained }) => {
|
|
165
168
|
if (!mappingInputRows) throw new Error("Sample response is missing mappingInputRows");
|
|
169
|
+
if (!retained) throw new Error("Sample response is missing sampleId");
|
|
166
170
|
setMappingRows(mappingInputRows);
|
|
171
|
+
setSampleId(retained);
|
|
167
172
|
setSampledColumns(structuredClone(columns));
|
|
168
173
|
if (sourceDraft.render !== "traces") setDiscovered(columns);
|
|
169
174
|
setSampleRows(rows);
|
|
@@ -184,6 +189,7 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
184
189
|
});
|
|
185
190
|
const [sampling, setSampling] = useState(false);
|
|
186
191
|
const runSample = async () => {
|
|
192
|
+
if (sampling) return;
|
|
187
193
|
setSampling(true);
|
|
188
194
|
setError("");
|
|
189
195
|
try {
|
|
@@ -326,7 +332,7 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
326
332
|
}) : null
|
|
327
333
|
]
|
|
328
334
|
});
|
|
329
|
-
const panes =
|
|
335
|
+
const panes = (() => {
|
|
330
336
|
const result = [{
|
|
331
337
|
id: "sections",
|
|
332
338
|
label: "Profile",
|
|
@@ -401,34 +407,25 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
401
407
|
maxHeightFraction: .8,
|
|
402
408
|
slots: { headerTrailing: /* @__PURE__ */ jsx("span", {
|
|
403
409
|
className: "text-[11px] text-muted-foreground",
|
|
404
|
-
children:
|
|
410
|
+
children: sampleId ? `${mappingRows.length} sampled rows · ${PREVIEW_STATUS_NOTES[previewStatus]}` : "No sample yet"
|
|
405
411
|
}) },
|
|
406
412
|
content: /* @__PURE__ */ jsx(ProfileEditorPreview, {
|
|
407
413
|
profile: draft,
|
|
408
414
|
columns: draft.columns ?? [],
|
|
409
415
|
rows: mappingRows,
|
|
416
|
+
sampleId,
|
|
410
417
|
stale: sampleStale,
|
|
411
|
-
onNormalized: acceptNormalized
|
|
418
|
+
onNormalized: acceptNormalized,
|
|
419
|
+
onSampleExpired: () => void runSample(),
|
|
420
|
+
onSelectColumn: (name) => {
|
|
421
|
+
fields.setActiveName(name);
|
|
422
|
+
setSection("columns");
|
|
423
|
+
},
|
|
424
|
+
onStatusChange: setPreviewStatus
|
|
412
425
|
})
|
|
413
426
|
});
|
|
414
427
|
return result;
|
|
415
|
-
}
|
|
416
|
-
activeParameter,
|
|
417
|
-
activeProcessor,
|
|
418
|
-
draft,
|
|
419
|
-
fields,
|
|
420
|
-
resetState,
|
|
421
|
-
sampleRows,
|
|
422
|
-
mappingRows,
|
|
423
|
-
sampleStale,
|
|
424
|
-
section,
|
|
425
|
-
sectionContent,
|
|
426
|
-
pipelineCatalog,
|
|
427
|
-
processors,
|
|
428
|
-
setProcessors,
|
|
429
|
-
traces,
|
|
430
|
-
acceptNormalized
|
|
431
|
-
]);
|
|
428
|
+
})();
|
|
432
429
|
const leave = () => dirty ? setConfirmDiscard(true) : onClose();
|
|
433
430
|
return /* @__PURE__ */ jsxs(JsonPathSampleRowsContext.Provider, {
|
|
434
431
|
value: section === "spans" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows,
|
|
@@ -621,7 +618,9 @@ function ProfileEditor({ client, action, createAction, surfaceKey, initialValue,
|
|
|
621
618
|
});
|
|
622
619
|
}
|
|
623
620
|
function sectionLabel(section) {
|
|
624
|
-
|
|
621
|
+
const entry = profileEditorSections.find((entry) => entry.id === section);
|
|
622
|
+
if (!entry) throw new Error(`Unknown profile editor section: ${section}`);
|
|
623
|
+
return entry.label;
|
|
625
624
|
}
|
|
626
625
|
export { ProfileEditor };
|
|
627
626
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditor.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\nfunction sampleErrorMessage(body: string): string {\n try {\n const parsed: unknown = JSON.parse(body);\n if (typeof parsed === \"object\" && parsed !== null && \"error\" in parsed && typeof parsed.error === \"string\") return parsed.error;\n } catch {\n // Not JSON: the body is the message.\n }\n return body;\n}\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(sampleErrorMessage(await response.text()));\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n setMappingRows(mappingInputRows);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes = useMemo<WorkspacePaneSpec[]>(() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleRows.length\n ? `${sampleRows.length} sampled rows · updates as you edit`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n />\n ),\n });\n }\n return result;\n }, [\n activeParameter,\n activeProcessor,\n draft,\n fields,\n resetState,\n sampleRows,\n mappingRows,\n sampleStale,\n section,\n sectionContent,\n pipelineCatalog,\n processors,\n setProcessors,\n traces,\n acceptNormalized,\n ]);\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n return profileEditorSections.find((entry) => entry.id === section)!.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;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B,OAAO,oBAAoB,IAAI,KAAK;MAAI;MAAM;MAC9C,SAAS,kCAAkC,GAAG,eAAe,OAAO;MAAiC;KAIrG;;GACE,CAAA,IACL;GAEH,YAAY,eACX,oBAAC,qBAAD;IACU;IACR,QAAQ;IACD;IACP,gBAAgB,YAAY,KAAK;IACjC,SAAS,OAAO,SAAS;KACvB,MAAM,UAAU,IAAI;KACpB,YAAY,KAAK;IACnB;GACD,CAAA,IACC;GAEH,gBACC,oBAAC,OAAD;IACE,MAAA;IACA,eAAe,iBAAiB,EAAE;IAClC,OAAO,WAAW,cAAc;IAChC,MAAK;IACL,QACE,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe,iBAAiB,EAAE;MACnC,UAAA;KAEO,CAAA,GACR,oBAAC,QAAD;MACE,MAAK;MACL,SAAQ;MACR,UAAU;MACV,eAAe;OACb,iBAAiB,EAAE;OACnB,KAAU,IAAI;MAChB;MACD,UAAA;KAEO,CAAA,CACL;;IAGP,UAAA,qBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA6C;MAC1B;MAAc;KAG9B;;GACE,CAAA,IACL;EAC8B;;AAExC;AAEA,SAAS,aAAa,SAAuC;CAC3D,OAAO,sBAAsB,MAAM,UAAU,MAAM,OAAO,OAAO,CAAC,CAAE;AACtE"}
|
|
1
|
+
{"version":3,"file":"profileEditor.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileEditor.tsx"],"sourcesContent":["import { Button } from \"../../components/button\";\nimport { Workspace } from \"../../layout/Workspace\";\nimport type { WorkspacePaneSpec } from \"../../layout/Workspace\";\nimport { Modal } from \"../../overlay/Modal\";\nimport { useOperationLookupFetcher } from \"../../rpc/operationLookupFetcher\";\nimport type { ResolvedOperation } from \"../../rpc/types\";\nimport type { OperationsApiClient } from \"../../rpc/useOperations\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiListTree, UiPlay, UiTable } from \"../../icons\";\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport {\n cloneProfileDraft,\n mergeSampledProfileColumns,\n profileColumnResetState,\n profileEditorSectionStatus,\n profileEditorSections,\n profileGeneralOptionKeys,\n profileSampleSignature,\n profileUpdateConflictTarget,\n resetProfileColumns,\n validateProfileEditorDraft,\n type ProfileEditorSection,\n} from \"./profileEditorModel\";\nimport { ProfileEditorPreview } from \"./profileEditorPreview\";\nimport type { ProfileMappingPreviewStatus } from \"./profileMappingPreview\";\nimport { parseSampleError } from \"./sampleError\";\nimport { ProfileEditorRail } from \"./profileEditorRail\";\nimport { ProfileSaveAsDialog } from \"./profileSaveAsDialog\";\nimport {\n ProfileGeneralSection,\n ProfileSchemaSection,\n ProfileQuerySection,\n ProfileSourceCard,\n} from \"./profileEditorSections\";\nimport { ProfileFieldSidebarList } from \"../fields/profileFieldList\";\nimport {\n ProfileFieldEditorForm,\n profileFieldEditorEmptyMessage,\n} from \"../fields/profileFieldEditor\";\nimport { useProfileFieldState } from \"../fields/profileFieldState\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport { useProfileInspection } from \"../wizard/useProfileInspection\";\nimport {\n profileConnectionID,\n type ProfileColumn,\n type ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\nimport { resolveProfileUpdatePath } from \"./profileEditorRoutes\";\nimport {\n ProfileParameterDetail,\n ProfileParameterSidebar,\n} from \"./profileParameterEditor\";\nimport { ProcessorPipeline } from \"../processor/processorPipeline\";\nimport {\n processorCatalog,\n type ProcessorSpec,\n} from \"../processor/processorConfig\";\nimport { profileSchema } from \"../profileApi\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile, JsonPathSampleRowsContext } from \"../query/jsonPathSample\";\nimport { defaultSpanColumns } from \"./spanColumns\";\nimport { ProfileSpansSection } from \"./profileSpansSection\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ProfileEditorRaw = lazy(() =>\n import(\"./profileEditorRaw\").then((module) => ({\n default: module.ProfileEditorRaw,\n })),\n);\n\n/** The server answers a failed sample with a JSON diagnostics envelope; its `error` is the message, anything else is shown as sent. */\n/** The Preview pane header's word on the preview, so it never claims \"updates as you edit\" while the preview is failing. */\nconst PREVIEW_STATUS_NOTES: Record<ProfileMappingPreviewStatus, string> = {\n idle: \"not previewed\",\n updating: \"updating…\",\n ready: \"updates as you edit\",\n failed: \"preview failed\",\n};\n\n/** The one request the editor makes to sample a profile: used by the traces source sample and by Run. */\nasync function fetchEditorSample(draft: ProfileWizardDraft): Promise<Omit<ProfileSample, \"sourceDraft\">> {\n const profile = sampleRequestProfile(draft);\n if (!profile) throw new Error(\"Cannot sample a profile without a provider\");\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ profile, params: {}, previewProcessors: true }),\n });\n if (!response.ok) throw new Error(parseSampleError(await response.text()).message);\n return (await response.json()) as Omit<ProfileSample, \"sourceDraft\">;\n}\n\n/**\n * The profile editor as a route rather than a dialog.\n *\n * Six sections, ~130 discoverable fields and a CEL editor per column outgrew a\n * modal: the layout is a clicky-ui Workspace, so the section rail, the column\n * grid and the sampled preview are panes the user can resize, collapse and keep\n * across visits. Collection fields stay in the rail while the selected item is\n * edited in the center, keeping names and icons visible throughout the edit.\n */\nexport function ProfileEditor({\n client,\n action,\n createAction,\n surfaceKey,\n initialValue,\n onClose,\n onSuccess,\n}: {\n client: OperationsApiClient;\n action: ResolvedOperation;\n /** The profiles collection's create operation; when given, the header offers\n * \"Save as new…\", which saves the draft under a new name and leaves the\n * edited profile as it was. */\n createAction?: ResolvedOperation | undefined;\n surfaceKey: string;\n initialValue: Record<string, unknown>;\n onClose: () => void;\n onSuccess: (name: string) => void | Promise<void>;\n}) {\n const lookupFetcher = useOperationLookupFetcher(client);\n const initialDraft = useMemo(\n () => cloneProfileDraft(initialValue),\n [initialValue],\n );\n const initialSerialized = useMemo(\n () => JSON.stringify(initialDraft),\n [initialDraft],\n );\n const [draft, setDraft] = useState<ProfileWizardDraft>(initialDraft);\n const [section, setSection] = useState<ProfileEditorSection>(initialDraft.render === \"traces\" ? \"spans\" : \"general\");\n const [discovered, setDiscovered] = useState<ProfileColumn[]>(\n initialDraft.render === \"traces\" ? defaultSpanColumns() : initialDraft.columns ?? [],\n );\n const [sampledColumns, setSampledColumns] = useState<ProfileColumn[]>([]);\n const [sampleRows, setSampleRows] = useState<Record<string, unknown>[]>([]);\n const [mappingRows, setMappingRows] = useState<Record<string, unknown>[]>([]);\n // The service keeps the sample it took; the preview maps it by this id, so the\n // rows (often megabytes of documents) never travel back on an edit.\n const [sampleId, setSampleId] = useState<string>();\n const [previewStatus, setPreviewStatus] = useState<ProfileMappingPreviewStatus>(\"idle\");\n const [activeField, setActiveField] = useState(\n initialDraft.columns?.[0]?.name ?? \"\",\n );\n const [activeParameter, setActiveParameter] = useState(0);\n const [activeProcessor, setActiveProcessor] = useState(0);\n const [lastSampleSignature, setLastSampleSignature] = useState(() =>\n profileSampleSignature(initialDraft),\n );\n const [rawValid, setRawValid] = useState(true);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState(\"\");\n const [replaceTarget, setReplaceTarget] = useState(\"\");\n const [savingAs, setSavingAs] = useState(false);\n const [confirmDiscard, setConfirmDiscard] = useState(false);\n const [confirmResetColumns, setConfirmResetColumns] = useState(false);\n // The Source section's query workspace portals its Run button here, so Run\n // sits beside Save profile and keeps the workspace's own pending/selection state.\n const [runSlot, setRunSlot] = useState<HTMLElement | null>(null);\n const dirty = JSON.stringify(draft) !== initialSerialized;\n const [normalizedRows, setNormalizedRows] = useState<Record<string, unknown>[]>([]);\n const traces = draft.render === \"traces\";\n const validationError = validateProfileEditorDraft(draft);\n const saveBlocked = saving || Boolean(validationError) || (section === \"raw\" && !rawValid);\n const sampleStale = profileSampleSignature(draft) !== lastSampleSignature;\n // The same inspection the Query workspace reads, so the source field pickers\n // and the workspace share one fetch of the index's mapped fields.\n const sourceInspection = useProfileInspection({\n connectionID: profileConnectionID(draft.provider?.connection ?? \"\"),\n providerOptions: draft.provider?.options ?? {},\n });\n const indexFields =\n sourceInspection.inspection.completion?.kind === \"json-fields\"\n ? sourceInspection.inspection.completion.fields\n : [];\n const resetState = traces ? {visible:true, disabled:false, title:\"Reset to default\"} : profileColumnResetState({\n providerType: draft.provider?.type ?? \"\",\n sampledColumnCount: sampledColumns.length,\n sampleStale,\n });\n\n const fields = useProfileFieldState({\n normalizedOnly: traces,\n discovered,\n configured: draft.columns ?? [],\n activeName: activeField,\n onConfiguredChange: (columns) =>\n setDraft((current) => ({ ...current, columns })),\n onActiveNameChange: setActiveField,\n });\n const processors = Array.isArray(draft.processors)\n ? (draft.processors as ProcessorSpec[])\n : [];\n const pipelineCatalog = useMemo(\n () => processorCatalog(profileSchema().properties?.processors),\n [],\n );\n const setProcessors = useCallback(\n (next: ProcessorSpec[]) =>\n setDraft((current) => ({ ...current, processors: next })),\n [],\n );\n\n // A route can be refreshed or navigated away from; the dialog used to guard\n // unsaved edits with confirmClose, so the route has to guard them too.\n useEffect(() => {\n if (!dirty) return;\n const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n window.addEventListener(\"beforeunload\", warn);\n return () => window.removeEventListener(\"beforeunload\", warn);\n }, [dirty]);\n\n const save = async (replaceExisting = false) => {\n if (validationError) {\n setError(validationError);\n return;\n }\n if (!client.submitForm) {\n setError(\"Profile updates are unavailable\");\n return;\n }\n setSaving(true);\n setError(\"\");\n try {\n const body = {\n ...draft,\n id: surfaceKey,\n ...(replaceExisting ? { replaceExisting: true } : {}),\n };\n const response = await client.submitForm(\n resolveProfileUpdatePath(action.path, surfaceKey),\n action.method,\n body,\n );\n if (!response.success) {\n const message =\n response.error || response.message || \"Profile update failed\";\n const target = profileUpdateConflictTarget(message);\n if (target && !replaceExisting) {\n setReplaceTarget(target);\n return;\n }\n throw new Error(message);\n }\n await onSuccess(draft.profile!.trim());\n } catch (saveError) {\n setError(\n saveError instanceof Error\n ? saveError.message\n : \"Profile update failed\",\n );\n } finally {\n setSaving(false);\n }\n };\n\n const acceptSample = useCallback(({ columns, rows, sourceDraft, mappingInputRows, sampleId: retained }: ProfileSample) => {\n if (!mappingInputRows) throw new Error(\"Sample response is missing mappingInputRows\");\n if (!retained) throw new Error(\"Sample response is missing sampleId\");\n setMappingRows(mappingInputRows);\n setSampleId(retained);\n setSampledColumns(structuredClone(columns));\n if (sourceDraft.render !== \"traces\") setDiscovered(columns);\n setSampleRows(rows);\n setDraft((current) => ({\n ...current,\n columns: current.render === \"traces\" ? current.columns ?? defaultSpanColumns() : mergeSampledProfileColumns(current.columns ?? [], columns),\n }));\n setActiveField((current) => current || columns[0]?.name || \"\");\n setLastSampleSignature(profileSampleSignature(sourceDraft));\n }, []);\n\n const sourceSample = useQuery({\n queryKey:[\"profile-editor-source\", profileSampleSignature(initialDraft)],\n enabled:initialDraft.render === \"traces\", staleTime:Infinity, retry:false, refetchOnWindowFocus:false,\n queryFn:() => fetchEditorSample(initialDraft),\n });\n // Run on Columns and Spans: the same request the traces source sample makes,\n // for the draft as it stands, accepted the same way.\n const [sampling, setSampling] = useState(false);\n const runSample = async () => {\n if (sampling) return;\n setSampling(true);\n setError(\"\");\n try {\n acceptSample({ ...(await fetchEditorSample(draft)), sourceDraft: draft });\n } catch (sampleError) {\n setError(sampleError instanceof Error ? sampleError.message : \"Sample failed\");\n } finally {\n setSampling(false);\n }\n };\n useEffect(() => {\n if (sourceSample.data) acceptSample({...sourceSample.data,sourceDraft:initialDraft});\n if (sourceSample.error) setError(sourceSample.error.message);\n }, [sourceSample.data,sourceSample.error,initialDraft,acceptSample]);\n\n const acceptNormalized = useCallback((rows: Record<string, unknown>[], columns: ProfileColumn[]) => {\n setNormalizedRows(rows);\n setDiscovered(columns);\n }, []);\n\n const resetColumns = () => {\n const defaults = traces ? defaultSpanColumns() : sampledColumns;\n const first = defaults[0];\n if (!first) throw new Error(\"cannot reset columns without a sample\");\n setDraft((current) => resetProfileColumns(current, defaults));\n setActiveField(first.name);\n setConfirmResetColumns(false);\n };\n\n const sectionContent = (\n <div className=\"@container h-full overflow-auto p-5\">\n {traces && (section === \"spans\" || section === \"columns\") ? <div className=\"mb-4 flex items-center gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={() => setConfirmResetColumns(true)}>Reset to default</Button>\n {validationError ? <p role=\"alert\" className=\"text-sm text-destructive\">{validationError}</p> : null}\n </div> : null}\n {section === \"general\" ? (\n <div className=\"space-y-4\">\n <ProfileGeneralSection draft={draft} onChange={setDraft} />\n <ProfileSourceCard\n draft={draft}\n // The provider's documents as read, ahead of any processor, are what\n // a source field name or an unwrap rule refers to.\n indexFields={indexFields}\n sampleRows={mappingRows.length ? mappingRows : sampleRows}\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n <ProfileSchemaSection\n draft={draft}\n keys={profileGeneralOptionKeys}\n title=\"General options\"\n description=\"Compose profiles with imports and aliases, choose the output fields, and ignore values that should not be retained.\"\n idPrefix=\"profile-general-options\"\n {...(lookupFetcher ? { lookupFetcher } : {})}\n onChange={setDraft}\n />\n </div>\n ) : null}\n {section === \"source\" ? (\n <ProfileQuerySection\n draft={draft}\n discovered={discovered}\n sampleStale={sampleStale}\n runSlot={runSlot}\n onChange={setDraft}\n onSample={acceptSample}\n />\n ) : null}\n {section === \"spans\" && traces ? <>\n <ProfileSpansSection draft={draft} rows={mappingRows} normalizedRows={normalizedRows} onChange={setDraft} />\n <details className=\"mt-4\"><summary>Source sample</summary><pre className=\"overflow-auto text-xs\">{JSON.stringify(mappingRows[0] ?? {}, null, 2)}</pre></details>\n </> : null}\n {section === \"columns\" ? (\n fields.activeField ? (\n <section className=\"rounded-xl border bg-card p-5\">\n <div className=\"max-w-6xl\">\n <ProfileFieldEditorForm\n field={fields.activeField}\n onChange={fields.updateActiveField}\n providerType={draft.provider?.type}\n />\n </div>\n </section>\n ) : (\n <div className=\"grid h-full place-items-center text-sm text-muted-foreground\">\n {profileFieldEditorEmptyMessage}\n </div>\n )\n ) : null}\n {section === \"parameters\" ? (\n <ProfileParameterDetail\n draft={draft}\n activeIndex={activeParameter}\n onChange={setDraft}\n />\n ) : null}\n {section === \"processors\" ? (\n <div className=\"max-w-5xl\">\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showSteps={false}\n onSelectedIndexChange={setActiveProcessor}\n onChange={setProcessors}\n />\n </div>\n ) : null}\n {section === \"raw\" ? (\n <Suspense\n fallback={\n <p className=\"text-sm text-muted-foreground\">\n Loading YAML editor…\n </p>\n }\n >\n <ProfileEditorRaw\n draft={draft}\n onChange={setDraft}\n onValidityChange={setRawValid}\n />\n </Suspense>\n ) : null}\n </div>\n );\n\n const panes: WorkspacePaneSpec[] = (() => {\n const rail: WorkspacePaneSpec = {\n id: \"sections\",\n label: \"Profile\",\n icon: <UiListTree />,\n location: \"left\",\n width: 340,\n minWidth: 280,\n maxWidth: 480,\n content: (\n <ProfileEditorRail\n traces={traces}\n value={section}\n status={profileEditorSectionStatus({\n draft,\n availableColumns: fields.available.length,\n sampleStale,\n })}\n collections={{\n columns: (\n <ProfileFieldSidebarList\n state={fields}\n onFieldSelect={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onAdd={() => setSection(\"columns\")}\n {...(resetState.visible\n ? {\n reset: {\n disabled: resetState.disabled,\n title: resetState.title,\n onReset: () => setConfirmResetColumns(true),\n },\n }\n : {})}\n />\n ),\n parameters: (\n <ProfileParameterSidebar\n draft={draft}\n activeIndex={activeParameter}\n onActiveIndexChange={(index) => {\n setActiveParameter(index);\n setSection(\"parameters\");\n }}\n onChange={setDraft}\n />\n ),\n processors: (\n <ProcessorPipeline\n steps={processors}\n catalog={pipelineCatalog}\n profile={draft}\n selectedIndex={activeProcessor}\n showEditor={false}\n tree\n onSelectedIndexChange={(index) => {\n setActiveProcessor(index);\n setSection(\"processors\");\n }}\n onChange={setProcessors}\n />\n ),\n }}\n onChange={setSection}\n />\n ),\n };\n\n const result: WorkspacePaneSpec[] = [\n rail,\n {\n id: \"section\",\n label: sectionLabel(section),\n location: \"center\",\n collapsible: false,\n showHeader: false,\n contentClassName: \"p-0\",\n content: sectionContent,\n },\n ];\n if (section === \"columns\" || section === \"spans\" || (section === \"source\" && draft.search)) {\n result.push({\n id: \"preview\",\n label: \"Preview\",\n icon: <UiTable />,\n location: \"bottom\",\n height: 400,\n minHeightFraction: 0.2,\n maxHeightFraction: 0.8,\n slots: {\n headerTrailing: (\n <span className=\"text-[11px] text-muted-foreground\">\n {sampleId\n ? `${mappingRows.length} sampled rows · ${PREVIEW_STATUS_NOTES[previewStatus]}`\n : \"No sample yet\"}\n </span>\n ),\n },\n content: (\n <ProfileEditorPreview\n profile={draft}\n columns={draft.columns ?? []}\n rows={mappingRows}\n sampleId={sampleId}\n stale={sampleStale}\n onNormalized={acceptNormalized}\n onSampleExpired={() => void runSample()}\n onSelectColumn={(name) => {\n fields.setActiveName(name);\n setSection(\"columns\");\n }}\n onStatusChange={setPreviewStatus}\n />\n ),\n });\n }\n return result;\n })();\n\n const leave = () => (dirty ? setConfirmDiscard(true) : onClose());\n\n return (\n <JsonPathSampleRowsContext.Provider value={section === \"spans\" ? mappingRows : normalizedRows.length ? normalizedRows : sampleRows}>\n <div className=\"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-background\">\n <header className=\"flex items-center gap-3 border-b border-border px-4 py-2.5\">\n <nav className=\"flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground\">\n <button\n type=\"button\"\n className=\"hover:text-foreground\"\n onClick={leave}\n >\n Profiles\n </button>\n <span>/</span>\n <button\n type=\"button\"\n className=\"min-w-0 truncate hover:text-foreground\"\n onClick={leave}\n >\n {initialDraft.profile ?? surfaceKey}\n </button>\n <span>/</span>\n <span className=\"font-medium text-foreground\">Edit</span>\n </nav>\n {error ? (\n <span className=\"min-w-0 truncate text-sm text-destructive\" title={error}>{error}</span>\n ) : null}\n <span className=\"ml-auto hidden shrink-0 text-xs text-muted-foreground md:block\">\n {dirty ? \"Unsaved changes\" : \"No changes\"}\n </span>\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={leave}>\n Discard\n </Button>\n {createAction ? (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => setSavingAs(true)}\n >\n Save as new…\n </Button>\n ) : null}\n <span ref={setRunSlot} className=\"contents\" />\n {section === \"columns\" || section === \"spans\" ? (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={!draft.provider?.type}\n title={draft.provider?.type ? undefined : \"Choose a provider before running a sample\"}\n loading={sampling}\n loadingLabel=\"Running\"\n onClick={() => void runSample()}\n >\n <Icon icon={UiPlay} className=\"size-4\" />\n Run\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={saveBlocked}\n title={validationError ?? undefined}\n onClick={() => void save()}\n >\n {saving ? \"Saving…\" : \"Save profile\"}\n </Button>\n </header>\n\n <Workspace panes={panes} storageKey=\"profile-editor-v2\" />\n </div>\n\n {confirmDiscard ? (\n <Modal\n open\n onClose={() => setConfirmDiscard(false)}\n title=\"Discard profile changes?\"\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmDiscard(false)}\n >\n Keep editing\n </Button>\n <Button type=\"button\" variant=\"destructive\" onClick={onClose}>\n Discard changes\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Your unsaved profile changes will be lost.\n </p>\n </Modal>\n ) : null}\n\n {confirmResetColumns ? (\n <Modal\n open\n onClose={() => setConfirmResetColumns(false)}\n title={traces ? \"Reset to default?\" : \"Reset columns from latest sample?\"}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setConfirmResetColumns(false)}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={resetState.disabled}\n onClick={resetColumns}\n >\n {traces ? \"Reset to default\" : \"Reset columns\"}\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n Replace {fields.configuredCount} configured column\n {fields.configuredCount === 1 ? \"\" : \"s\"} with{\" \"}\n {traces ? \"the canonical default columns\" : `${sampledColumns.length} columns from the latest sample`}.\n Custom labels, expressions, formatting, filtering, ordering, and\n manually added columns will be removed. The profile will remain\n unsaved until you save it.\n </p>\n </Modal>\n ) : null}\n\n {savingAs && createAction ? (\n <ProfileSaveAsDialog\n client={client}\n action={createAction}\n draft={draft}\n onCancel={() => setSavingAs(false)}\n onSaved={async (name) => {\n await onSuccess(name);\n setSavingAs(false);\n }}\n />\n ) : null}\n\n {replaceTarget ? (\n <Modal\n open\n onClose={() => setReplaceTarget(\"\")}\n title={`Replace ${replaceTarget}?`}\n size=\"sm\"\n footer={\n <div className=\"flex w-full justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => setReplaceTarget(\"\")}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n disabled={saving}\n onClick={() => {\n setReplaceTarget(\"\");\n void save(true);\n }}\n >\n Replace profile\n </Button>\n </div>\n }\n >\n <p className=\"text-sm text-muted-foreground\">\n A profile named {replaceTarget} already exists. Its definition will\n be overwritten, the current profile will be renamed, and dependent\n imports will be updated atomically.\n </p>\n </Modal>\n ) : null}\n </JsonPathSampleRowsContext.Provider>\n );\n}\n\nfunction sectionLabel(section: ProfileEditorSection): string {\n const entry = profileEditorSections.find((entry) => entry.id === section);\n if (!entry) throw new Error(`Unknown profile editor section: ${section}`);\n return entry.label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,IAAM,mBAAmB,WACvB,OAAO,wBAAqB,CAAC,MAAM,YAAY,EAC7C,SAAS,OAAO,i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