@burdenoff/microfe-store 2026.1028.1 → 2026.1031.1
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/TemplateRevisionsQueue.d.ts +10 -0
- package/dist/components/TemplateRevisionsQueue.js +300 -0
- package/dist/components/TemplateRevisionsQueue.js.map +1 -0
- package/dist/components/WorkflowTemplatePreviewPanel.d.ts +50 -0
- package/dist/components/WorkflowTemplatePreviewPanel.js +221 -0
- package/dist/components/WorkflowTemplatePreviewPanel.js.map +1 -0
- package/dist/pages/AdminSubmissionsQueuePage.js +447 -334
- package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowTemplatePreviewPanel.js","names":[],"sources":["../../src/components/WorkflowTemplatePreviewPanel.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState } from 'react';\nimport {\n ChevronDown,\n ChevronUp,\n Eraser,\n FileJson,\n KeyRound,\n Network,\n PlugZap,\n TextCursorInput,\n} from 'lucide-react';\n\n/**\n * Reviewer preview of a community workflow template (BOFF-10463): what the\n * template does before a store admin approves it. Mirrors the store service's\n * `WorkflowTemplatePreview` type.\n */\nexport type WorkflowTemplateFieldRef = {\n nodeId?: string | null;\n nodeType?: string | null;\n nodeLabel?: string | null;\n field: string;\n};\n\nexport type WorkflowTemplatePreview = {\n nodeTypes: Array<{\n nodeType: string;\n nodeVersion: string;\n publishType: string;\n displayName: string;\n }>;\n nodeCount: number;\n edgeCount: number;\n requiredInputs: Array<{\n name: string;\n type: string;\n label: string;\n required: boolean;\n usedBy: string[];\n }>;\n requiredCredentials: Array<{\n name: string;\n kind: string;\n nodeId?: string | null;\n nodeType?: string | null;\n nodeLabel?: string | null;\n }>;\n cleaningReport?: {\n connectionsCleared: number;\n secretsRemoved: number;\n pinnedDataRemoved: boolean;\n clearedConnections: WorkflowTemplateFieldRef[];\n removedSecrets: WorkflowTemplateFieldRef[];\n } | null;\n definitionJson?: Record<string, unknown> | null;\n};\n\n/** GraphQL selection for a `WorkflowTemplatePreview` field. */\nexport const WORKFLOW_TEMPLATE_PREVIEW_FIELDS = /* GraphQL */ `\n nodeTypes { nodeType nodeVersion publishType displayName }\n nodeCount\n edgeCount\n requiredInputs { name type label required usedBy }\n requiredCredentials { name kind nodeId nodeType nodeLabel }\n cleaningReport {\n connectionsCleared\n secretsRemoved\n pinnedDataRemoved\n clearedConnections { nodeId nodeType nodeLabel field }\n removedSecrets { nodeId nodeType nodeLabel field }\n }\n definitionJson\n`;\n\nfunction nodeName(ref: { nodeLabel?: string | null; nodeId?: string | null }): string {\n return ref.nodeLabel ?? ref.nodeId ?? 'Workflow';\n}\n\nconst SECTION_TITLE =\n 'mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-[var(--color-text-secondary)]';\nconst CHIP =\n 'inline-flex items-center gap-1 rounded-md border border-[var(--color-border-seam)] bg-[var(--color-surface-default)] px-2 py-1 text-xs text-[var(--color-text-primary)]';\n\nconst FieldRefList: FC<{ refs: WorkflowTemplateFieldRef[]; total: number; testId: string }> = ({\n refs,\n total,\n testId,\n}) => (\n <ul className=\"mt-1.5 space-y-1\" data-testid={testId}>\n {/* A field path is unique within its node, so node id + path is a stable key. */}\n {refs.map((ref) => (\n <li\n key={`${ref.nodeId ?? 'root'}:${ref.field}`}\n className=\"text-xs text-[var(--color-text-secondary)]\"\n >\n <span className=\"font-medium text-[var(--color-text-primary)]\">{nodeName(ref)}</span>\n {ref.nodeType && <span className=\"text-[var(--color-text-muted)]\"> ({ref.nodeType})</span>}\n <span className=\"font-mono\"> · {ref.field}</span>\n </li>\n ))}\n {total > refs.length && (\n <li className=\"text-xs text-[var(--color-text-muted)]\">\n and {total - refs.length} more not listed\n </li>\n )}\n </ul>\n);\n\ntype Preview = WorkflowTemplatePreview;\ntype CleaningReport = NonNullable<Preview['cleaningReport']>;\n\nconst MUTED = 'text-xs text-[var(--color-text-muted)]';\nconst ROW = 'text-xs text-[var(--color-text-secondary)]';\n\nfunction plural(count: number, word: string): string {\n return `${count} ${word}${count === 1 ? '' : 's'}`;\n}\n\nconst NodeTypesSection: FC<{ preview: Preview }> = ({ preview }) => (\n <div>\n <h4 className={SECTION_TITLE}>\n <Network className=\"size-3.5\" />\n Nodes ({plural(preview.nodeCount, 'node')}, {plural(preview.edgeCount, 'connection')},{' '}\n {plural(preview.nodeTypes.length, 'node type')})\n </h4>\n {preview.nodeTypes.length === 0 ? (\n <p className={MUTED}>No node types found.</p>\n ) : (\n <div className=\"flex flex-wrap gap-1.5\" data-testid=\"template-node-types\">\n {preview.nodeTypes.map((node) => (\n <span key={node.nodeType} className={CHIP} title={node.nodeType}>\n {node.displayName}\n <span className=\"font-mono text-[var(--color-text-muted)]\">\n {node.nodeType} · v{node.nodeVersion}\n </span>\n {node.publishType === 'STORE' && (\n <span className=\"rounded bg-[var(--color-status-info-bg-subtle)] px-1 text-[10px] text-[var(--color-status-info-text)]\">\n Store\n </span>\n )}\n </span>\n ))}\n </div>\n )}\n </div>\n);\n\nconst RequiredInputsSection: FC<{ inputs: Preview['requiredInputs'] }> = ({ inputs }) => (\n <div>\n <h4 className={SECTION_TITLE}>\n <TextCursorInput className=\"size-3.5\" />\n Required inputs ({inputs.length})\n </h4>\n {inputs.length === 0 ? (\n <p className={MUTED}>The template reads no variables the importer has to fill in.</p>\n ) : (\n <ul className=\"space-y-1\" data-testid=\"template-required-inputs\">\n {inputs.map((input) => (\n <li key={input.name} className={ROW}>\n <span className=\"font-mono text-[var(--color-text-primary)]\">{input.name}</span>\n {input.type === 'secret' && (\n <span className=\"ml-1 rounded bg-[var(--color-status-warning-bg-subtle)] px-1 text-[10px] text-[var(--color-status-warning-text)]\">\n secret\n </span>\n )}\n {input.usedBy.length > 0 && <span> · used by {input.usedBy.join(', ')}</span>}\n </li>\n ))}\n </ul>\n )}\n </div>\n);\n\nconst RequiredCredentialsSection: FC<{ credentials: Preview['requiredCredentials'] }> = ({\n credentials,\n}) => (\n <div>\n <h4 className={SECTION_TITLE}>\n <PlugZap className=\"size-3.5\" />\n Required credentials ({credentials.length})\n </h4>\n {credentials.length === 0 ? (\n <p className={MUTED}>No credentials needed.</p>\n ) : (\n <ul className=\"space-y-1\" data-testid=\"template-required-credentials\">\n {credentials.map((credential) => {\n const where = credential.nodeLabel ?? credential.nodeId;\n const kind =\n credential.kind === 'connection'\n ? 'saved connection (cleared at submission)'\n : 'credential lookup';\n return (\n <li\n key={`${credential.kind}-${credential.name}-${credential.nodeId ?? ''}`}\n className={ROW}\n >\n <span className=\"font-medium text-[var(--color-text-primary)]\">\n {credential.name}\n </span>\n <span> · {kind}</span>\n {where && <span> · {where}</span>}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n);\n\nconst CleaningReportDetails: FC<{ report: CleaningReport }> = ({ report }) => (\n <div className=\"space-y-3 text-xs\" data-testid=\"template-cleaning-report\">\n <div className=\"flex flex-wrap gap-1.5\">\n <span className={CHIP}>\n <PlugZap className=\"size-3\" />\n {plural(report.connectionsCleared, 'connection')} cleared\n </span>\n <span className={CHIP}>\n <KeyRound className=\"size-3\" />\n {plural(report.secretsRemoved, 'secret')} removed\n </span>\n <span className={CHIP}>\n {report.pinnedDataRemoved ? 'Pinned run data removed' : 'No pinned run data'}\n </span>\n </div>\n {report.clearedConnections.length > 0 && (\n <div>\n <p className=\"font-medium text-[var(--color-text-secondary)]\">Connections cleared</p>\n <FieldRefList\n refs={report.clearedConnections}\n total={report.connectionsCleared}\n testId=\"template-cleared-connections\"\n />\n </div>\n )}\n {report.removedSecrets.length > 0 && (\n <div>\n <p className=\"font-medium text-[var(--color-text-secondary)]\">Secrets removed</p>\n <FieldRefList\n refs={report.removedSecrets}\n total={report.secretsRemoved}\n testId=\"template-removed-secrets\"\n />\n </div>\n )}\n </div>\n);\n\nconst CleaningReportSection: FC<{ report: Preview['cleaningReport'] }> = ({ report }) => (\n <div>\n <h4 className={SECTION_TITLE}>\n <Eraser className=\"size-3.5\" />\n Cleaning report\n </h4>\n {report ? (\n <CleaningReportDetails report={report} />\n ) : (\n <p className={MUTED}>\n No cleaning report was recorded for this template (it was stored before reports were kept).\n </p>\n )}\n </div>\n);\n\nconst DefinitionSection: FC<{ definition: Record<string, unknown> }> = ({ definition }) => {\n const [open, setOpen] = useState(false);\n return (\n <div>\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-[var(--color-border-default)] bg-[var(--color-surface-default)] px-3 py-1.5 text-xs font-medium text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-surface-hover)]\"\n >\n <FileJson className=\"size-3.5\" />\n {open ? 'Hide definition' : 'View cleaned definition'}\n {open ? <ChevronUp className=\"size-3\" /> : <ChevronDown className=\"size-3\" />}\n </button>\n {open && (\n <pre className=\"mt-2 max-h-72 overflow-auto rounded-lg border border-[var(--color-border-seam)] bg-[var(--color-surface-default)] p-4 text-[11px] leading-relaxed text-[var(--color-text-primary)]\">\n {JSON.stringify(definition, null, 2)}\n </pre>\n )}\n </div>\n );\n};\n\nexport const WorkflowTemplatePreviewPanel: FC<{ preview: WorkflowTemplatePreview }> = ({\n preview,\n}) => (\n <div className=\"space-y-5\" data-testid=\"workflow-template-preview\">\n <NodeTypesSection preview={preview} />\n <div className=\"grid gap-5 sm:grid-cols-2\">\n <RequiredInputsSection inputs={preview.requiredInputs} />\n <RequiredCredentialsSection credentials={preview.requiredCredentials} />\n </div>\n <CleaningReportSection report={preview.cleaningReport} />\n {preview.definitionJson && <DefinitionSection definition={preview.definitionJson} />}\n </div>\n);\n"],"mappings":";;;;AA2DA,IAAa,IAAiD;AAgB9D,SAAS,EAAS,GAAoE;AACpF,QAAO,EAAI,aAAa,EAAI,UAAU;;AAGxC,IAAM,IACJ,mHACI,IACJ,2KAEI,KAAyF,EAC7F,SACA,UACA,gBAEA,kBAAC,MAAD;CAAI,WAAU;CAAmB,eAAa;WAA9C,CAEG,E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