@eventcatalog/core 2.16.2 → 2.16.3
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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-5K2SMJL6.js → chunk-FVZU5WEI.js} +1 -1
- package/dist/{chunk-7V6DXP63.js → chunk-JLXI6Z6O.js} +1 -1
- package/dist/{chunk-D5BKFMHD.js → chunk-ULFGBIV2.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/package.json +69 -0
- package/eventcatalog/src/components/MDX/Accordion/Accordion.tsx +2 -2
- package/eventcatalog/src/components/MDX/AsyncAPI/AsyncAPI.astro +2 -2
- package/eventcatalog/src/components/MDX/ChannelInformation/ChannelInformation.tsx +2 -2
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -2
- package/eventcatalog/src/components/MDX/NodeGraph/DownloadButton.tsx +2 -2
- package/eventcatalog/src/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +2 -1
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +12 -1
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +6 -5
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Channel.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Command.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Event.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/ExternalSystem.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Query.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Service.tsx +1 -1
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Step.tsx +3 -3
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/User.tsx +3 -3
- package/eventcatalog/src/components/MDX/OpenAPI/OpenAPI.astro +2 -2
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.astro +2 -2
- package/eventcatalog/src/components/SideBars/CatalogResourcesSideBar/index.tsx +10 -1
- package/eventcatalog/src/components/Tables/Table.tsx +15 -5
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +4 -10
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +3 -3
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +5 -2
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +2 -8
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +44 -0
- package/eventcatalog/src/components/Tables/filters/custom-filters.ts +5 -0
- package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +12 -7
- package/eventcatalog/src/layouts/DiscoverLayout.astro +1 -1
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +10 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/language.astro +6 -6
- package/eventcatalog/src/pages/visualiser/context-map/index.astro +30 -0
- package/eventcatalog/src/utils/collections/icons.ts +3 -0
- package/eventcatalog/src/utils/collections/services.ts +35 -0
- package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +206 -3
- package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +2 -2
- package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +1 -1
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +1 -1
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +1 -1
- package/package.json +2 -2
- package/bin/dist/eventcatalog.cjs +0 -558
- package/bin/dist/eventcatalog.config.cjs +0 -18
- package/bin/dist/eventcatalog.config.d.cts +0 -35
- package/bin/dist/eventcatalog.config.d.ts +0 -35
- package/bin/dist/eventcatalog.config.js +0 -0
- package/bin/dist/eventcatalog.d.cts +0 -1
- package/bin/dist/eventcatalog.d.ts +0 -1
- package/bin/dist/eventcatalog.js +0 -531
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ULFGBIV2.js";
|
|
4
|
+
import "../chunk-JLXI6Z6O.js";
|
|
5
|
+
import "../chunk-FVZU5WEI.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ULFGBIV2.js";
|
|
4
|
+
import "./chunk-JLXI6Z6O.js";
|
|
5
5
|
import {
|
|
6
6
|
catalogToAstro
|
|
7
7
|
} from "./chunk-55YPRY5U.js";
|
|
8
8
|
import {
|
|
9
9
|
VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FVZU5WEI.js";
|
|
11
11
|
import {
|
|
12
12
|
generate
|
|
13
13
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eventcatalog",
|
|
3
|
+
"homepage": "https://github.com/event-catalog/eventcatalog",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/event-catalog/eventcatalog.git",
|
|
7
|
+
"directory": "eventcatalog/"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"version": "0.1.0",
|
|
11
|
+
"private": true,
|
|
12
|
+
"scripts": {
|
|
13
|
+
"astro": "astro",
|
|
14
|
+
"build": "astro build",
|
|
15
|
+
"dev": "astro dev",
|
|
16
|
+
"preview": "astro preview",
|
|
17
|
+
"start": "astro dev"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@astrojs/markdown-remark": "^5.3.0",
|
|
21
|
+
"@astrojs/mdx": "^3.1.8",
|
|
22
|
+
"@astrojs/react": "^3.6.2",
|
|
23
|
+
"@astrojs/tailwind": "^5.1.2",
|
|
24
|
+
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
25
|
+
"@asyncapi/parser": "^3.4.0",
|
|
26
|
+
"@asyncapi/react-component": "^2.4.3",
|
|
27
|
+
"@headlessui/react": "^2.0.3",
|
|
28
|
+
"@heroicons/react": "^2.1.3",
|
|
29
|
+
"@stoplight/json-schema-viewer": "^4.7.0",
|
|
30
|
+
"@stoplight/mosaic": "^1.53.2",
|
|
31
|
+
"@tailwindcss/typography": "^0.5.13",
|
|
32
|
+
"@tanstack/react-table": "^8.17.3",
|
|
33
|
+
"@xyflow/react": "^12.3.6",
|
|
34
|
+
"astro": "^4.16.5",
|
|
35
|
+
"astro-expressive-code": "^0.36.1",
|
|
36
|
+
"astro-pagefind": "^1.6.0",
|
|
37
|
+
"astro-seo": "^0.8.4",
|
|
38
|
+
"dagre": "^0.8.5",
|
|
39
|
+
"diff": "^7.0.0",
|
|
40
|
+
"diff2html": "^3.4.48",
|
|
41
|
+
"html-to-image": "^1.11.11",
|
|
42
|
+
"js-yaml": "^4.1.0",
|
|
43
|
+
"lodash.debounce": "^4.0.8",
|
|
44
|
+
"lodash.merge": "4.6.2",
|
|
45
|
+
"lucide-react": "^0.453.0",
|
|
46
|
+
"mermaid": "^10.9.1",
|
|
47
|
+
"prismjs": "^1.29.0",
|
|
48
|
+
"rapidoc": "^9.3.4",
|
|
49
|
+
"react": "^18.3.1",
|
|
50
|
+
"react-dom": "^18.3.1",
|
|
51
|
+
"rehype-slug": "^6.0.0",
|
|
52
|
+
"remark-gfm": "^3.0.1",
|
|
53
|
+
"semver": "7.6.3",
|
|
54
|
+
"tailwindcss": "^3.4.3",
|
|
55
|
+
"unist-util-visit": "^5.0.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/dagre": "^0.7.52",
|
|
59
|
+
"@types/diff": "^5.2.2",
|
|
60
|
+
"@types/js-yaml": "^4.0.9",
|
|
61
|
+
"@types/lodash.debounce": "^4.0.9",
|
|
62
|
+
"@types/lodash.merge": "4.6.9",
|
|
63
|
+
"@types/node": "^20.14.2",
|
|
64
|
+
"@types/react": "^18.3.3",
|
|
65
|
+
"@types/react-dom": "^18.3.0",
|
|
66
|
+
"@types/semver": "^7.5.8",
|
|
67
|
+
"typescript": "^5.4.5"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -7,7 +7,7 @@ export default function Example({ title, children }: any) {
|
|
|
7
7
|
<div className="border border-gray-200 rounded-md px-4 shadow-sm py-2 accordion">
|
|
8
8
|
<Disclosure as="div" key={title} className="">
|
|
9
9
|
{({ open }) => (
|
|
10
|
-
|
|
10
|
+
<div>
|
|
11
11
|
<DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
|
|
12
12
|
<span className="text-base font-semibold leading-7">{title}</span>
|
|
13
13
|
<span className="ml-6 flex h-7 items-center">
|
|
@@ -21,7 +21,7 @@ export default function Example({ title, children }: any) {
|
|
|
21
21
|
<DisclosurePanel as="dd" className="pr-12 not-prose py-4">
|
|
22
22
|
<p className="text-base leading-7 text-gray-600">{children}</p>
|
|
23
23
|
</DisclosurePanel>
|
|
24
|
-
|
|
24
|
+
</div>
|
|
25
25
|
)}
|
|
26
26
|
</Disclosure>
|
|
27
27
|
</div>
|
|
@@ -4,13 +4,13 @@ import Admonition from '../Admonition';
|
|
|
4
4
|
|
|
5
5
|
<div class="mb-4">
|
|
6
6
|
<Admonition type="warning">
|
|
7
|
-
|
|
7
|
+
<div>
|
|
8
8
|
<span class="block font-bold">{`<AsyncAPI/>`} component now deprecated</span>
|
|
9
9
|
<span class="block"
|
|
10
10
|
>Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
|
|
11
11
|
>Read more here.</a
|
|
12
12
|
></span
|
|
13
13
|
>
|
|
14
|
-
|
|
14
|
+
</div>
|
|
15
15
|
</Admonition>
|
|
16
16
|
</div>
|
|
@@ -25,9 +25,9 @@ const ChannelParameters = (data: CollectionEntry<'channels'>['data']) => {
|
|
|
25
25
|
<div>
|
|
26
26
|
<p className="text-md">
|
|
27
27
|
{data.address && (
|
|
28
|
-
|
|
28
|
+
<div>
|
|
29
29
|
<span className="font-semibold">Address:</span> <code className="bg-gray-100 p-1 rounded">{data.address}</code>
|
|
30
|
-
|
|
30
|
+
</div>
|
|
31
31
|
)}
|
|
32
32
|
{data.protocols && data.protocols.length > 0 && (
|
|
33
33
|
<div className="mt-2 flex items-center space-x-1">
|
|
@@ -23,12 +23,12 @@ const { nodes, edges } = await getNodesAndEdges({
|
|
|
23
23
|
{
|
|
24
24
|
!flow && (
|
|
25
25
|
<Admonition type="warning">
|
|
26
|
-
|
|
26
|
+
<div>
|
|
27
27
|
<span class="block font-bold">{`<Flow/>`} failed to load</span>
|
|
28
28
|
<span class="block">
|
|
29
29
|
Tried to load flow id: {id} with version {version}. Make sure you have this flow defined in your project.
|
|
30
30
|
</span>
|
|
31
|
-
|
|
31
|
+
</div>
|
|
32
32
|
</Admonition>
|
|
33
33
|
)
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from '
|
|
1
|
+
import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from '@xyflow/react';
|
|
2
2
|
import { toPng } from 'html-to-image';
|
|
3
3
|
import { DocumentArrowDownIcon } from '@heroicons/react/24/outline';
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ function DownloadButton({ filename, addPadding = true }: { filename?: string; ad
|
|
|
19
19
|
const nodesBounds = getNodesBounds(getNodes());
|
|
20
20
|
const width = imageWidth > nodesBounds.width ? imageWidth : nodesBounds.width;
|
|
21
21
|
const height = imageHeight > nodesBounds.height ? imageHeight : nodesBounds.height;
|
|
22
|
-
const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2);
|
|
22
|
+
const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2, 0);
|
|
23
23
|
|
|
24
24
|
// Hide the button
|
|
25
25
|
// @ts-ignore
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { BaseEdge, getBezierPath } from '
|
|
2
|
+
import { BaseEdge, getBezierPath } from '@xyflow/react';
|
|
3
3
|
|
|
4
4
|
const AnimatedMessageEdge = ({
|
|
5
5
|
id,
|
|
@@ -44,6 +44,7 @@ const AnimatedMessageEdge = ({
|
|
|
44
44
|
const randomDelay = useMemo(() => Math.random() * 1, []);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
+
// @ts-ignore
|
|
47
48
|
<>
|
|
48
49
|
<BaseEdge id={id} path={edgePath} markerEnd={markerEnd} />
|
|
49
50
|
{/* Circle Icon */}
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
getNodesAndEdgesForEvents,
|
|
7
7
|
getNodesAndEdgesForQueries,
|
|
8
8
|
} from '@utils/node-graphs/message-node-graph';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getNodesAndEdges as getNodesAndEdgesForDomain,
|
|
11
|
+
getNodesAndEdgesForDomainContextMap,
|
|
12
|
+
} from '@utils/node-graphs/domains-node-graph';
|
|
10
13
|
import { getNodesAndEdges as getNodesAndEdgesForFlows } from '@utils/node-graphs/flows-node-graph';
|
|
11
14
|
|
|
12
15
|
interface Props {
|
|
@@ -24,8 +27,10 @@ interface Props {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href, linksToVisualiser } = Astro.props;
|
|
30
|
+
|
|
27
31
|
let nodes = [],
|
|
28
32
|
edges = [];
|
|
33
|
+
|
|
29
34
|
const getNodesAndEdgesFunctions = {
|
|
30
35
|
services: getNodesAndEdgesForService,
|
|
31
36
|
events: getNodesAndEdgesForEvents,
|
|
@@ -47,6 +52,12 @@ if (collection in getNodesAndEdgesFunctions) {
|
|
|
47
52
|
nodes = fetchedNodes;
|
|
48
53
|
edges = fetchedEdges;
|
|
49
54
|
}
|
|
55
|
+
|
|
56
|
+
if (collection === 'domain-context-map') {
|
|
57
|
+
const { nodes: fetchedNodes, edges: fetchedEdges } = await getNodesAndEdgesForDomainContextMap({});
|
|
58
|
+
nodes = fetchedNodes;
|
|
59
|
+
edges = fetchedEdges;
|
|
60
|
+
}
|
|
50
61
|
---
|
|
51
62
|
|
|
52
63
|
<div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
ReactFlow,
|
|
4
5
|
Background,
|
|
5
6
|
ConnectionLineType,
|
|
6
7
|
Controls,
|
|
@@ -11,8 +12,8 @@ import ReactFlow, {
|
|
|
11
12
|
type Edge,
|
|
12
13
|
type Node,
|
|
13
14
|
useReactFlow,
|
|
14
|
-
} from '
|
|
15
|
-
import '
|
|
15
|
+
} from '@xyflow/react';
|
|
16
|
+
import '@xyflow/react/dist/style.css';
|
|
16
17
|
|
|
17
18
|
// Nodes and edges
|
|
18
19
|
import ServiceNode from './Nodes/Service';
|
|
@@ -105,10 +106,10 @@ const NodeGraphBuilder = ({
|
|
|
105
106
|
(_: any, node: Node) => {
|
|
106
107
|
if (linksToVisualiser) {
|
|
107
108
|
if (node.type === 'events' || node.type === 'commands') {
|
|
108
|
-
navigate(getVisualiserUrlForCollection(node.data.message));
|
|
109
|
+
navigate(getVisualiserUrlForCollection(node.data.message as CollectionEntry<CollectionTypes>));
|
|
109
110
|
}
|
|
110
111
|
if (node.type === 'services') {
|
|
111
|
-
navigate(getVisualiserUrlForCollection(node.data.service));
|
|
112
|
+
navigate(getVisualiserUrlForCollection(node.data.service as CollectionEntry<'services'>));
|
|
112
113
|
}
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
@@ -2,7 +2,7 @@ import { BoltIcon } from '@heroicons/react/16/solid';
|
|
|
2
2
|
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import type { CollectionMessageTypes, CollectionTypes } from '@types';
|
|
4
4
|
import type { CollectionEntry } from 'astro:content';
|
|
5
|
-
import { Handle } from '
|
|
5
|
+
import { Handle } from '@xyflow/react';
|
|
6
6
|
|
|
7
7
|
interface Data {
|
|
8
8
|
title: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerIcon } from '@heroicons/react/16/solid';
|
|
2
2
|
import { GlobeAmericasIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import type { CollectionEntry } from 'astro:content';
|
|
4
|
-
import { Handle } from '
|
|
4
|
+
import { Handle } from '@xyflow/react';
|
|
5
5
|
|
|
6
6
|
interface Data {
|
|
7
7
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Handle } from '
|
|
1
|
+
import { Handle } from '@xyflow/react';
|
|
2
2
|
|
|
3
3
|
interface Data {
|
|
4
4
|
title: string;
|
|
@@ -45,7 +45,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
|
|
|
45
45
|
)}
|
|
46
46
|
|
|
47
47
|
{summary && (
|
|
48
|
-
|
|
48
|
+
<div>
|
|
49
49
|
<div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
|
|
50
50
|
<span className="text-xs font-bold block pb-0.5">{title}</span>
|
|
51
51
|
</div>
|
|
@@ -56,7 +56,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
|
|
|
56
56
|
</div>
|
|
57
57
|
</div>
|
|
58
58
|
)}
|
|
59
|
-
|
|
59
|
+
</div>
|
|
60
60
|
)}
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserIcon } from '@heroicons/react/20/solid';
|
|
2
|
-
import { Handle } from '
|
|
2
|
+
import { Handle } from '@xyflow/react';
|
|
3
3
|
|
|
4
4
|
interface Data {
|
|
5
5
|
title: string;
|
|
@@ -57,7 +57,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
|
|
|
57
57
|
)}
|
|
58
58
|
|
|
59
59
|
{summary && mode === 'full' && (
|
|
60
|
-
|
|
60
|
+
<div>
|
|
61
61
|
<div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
|
|
62
62
|
<span className="text-xs font-bold block pb-0.5">{name}</span>
|
|
63
63
|
</div>
|
|
@@ -68,7 +68,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
|
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
)}
|
|
71
|
-
|
|
71
|
+
</div>
|
|
72
72
|
)}
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
@@ -4,13 +4,13 @@ import Admonition from '../Admonition';
|
|
|
4
4
|
|
|
5
5
|
<div class="mb-4">
|
|
6
6
|
<Admonition type="warning">
|
|
7
|
-
|
|
7
|
+
<div>
|
|
8
8
|
<span class="block font-bold">{`<OpenAPI/>`} component now deprecated</span>
|
|
9
9
|
<span class="block"
|
|
10
10
|
>Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
|
|
11
11
|
>Read more here.</a
|
|
12
12
|
></span
|
|
13
13
|
>
|
|
14
|
-
|
|
14
|
+
</div>
|
|
15
15
|
</Admonition>
|
|
16
16
|
</div>
|
|
@@ -82,10 +82,10 @@ try {
|
|
|
82
82
|
{/* User has tried to load the schema, but it was not found on file system */}
|
|
83
83
|
{!schema.exists && (
|
|
84
84
|
<Admonition type="warning">
|
|
85
|
-
|
|
85
|
+
<div>
|
|
86
86
|
<span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
|
|
87
87
|
<span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
|
|
88
|
-
|
|
88
|
+
</div>
|
|
89
89
|
</Admonition>
|
|
90
90
|
)}
|
|
91
91
|
</div>
|
|
@@ -6,7 +6,16 @@ import { getIconForCollection as getIconForCollectionOriginal } from '@utils/col
|
|
|
6
6
|
|
|
7
7
|
const STORAGE_KEY = 'EventCatalog:catalogSidebarCollapsedGroups';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface CatalogResourcesSideBarProps {
|
|
10
|
+
resources: any;
|
|
11
|
+
currentPath: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const CatalogResourcesSideBar: React.FC<CatalogResourcesSideBarProps> = ({ resources, currentPath }) => {
|
|
15
|
+
if (typeof window === 'undefined') {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
const [data, setData] = useState(resources);
|
|
11
20
|
const [searchQuery, setSearchQuery] = useState('');
|
|
12
21
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
@@ -21,7 +21,7 @@ import type { CollectionTypes } from '@types';
|
|
|
21
21
|
declare module '@tanstack/react-table' {
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
24
|
-
filterVariant?: 'collection' | 'name';
|
|
24
|
+
filterVariant?: 'collection' | 'name' | 'badges';
|
|
25
25
|
collectionFilterKey?: string;
|
|
26
26
|
showFilter?: boolean;
|
|
27
27
|
className?: string;
|
|
@@ -67,7 +67,7 @@ export const Table = ({
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
|
-
|
|
70
|
+
<div>
|
|
71
71
|
{/* <div className='text-right text-gray-400'>{table.getPrePaginationRowModel().rows.length} results</div> */}
|
|
72
72
|
<div className=" bg-gray-100/20 rounded-md border-2 border-gray-200 shadow-sm ">
|
|
73
73
|
<table className="min-w-full divide-y divide-gray-200 rounded-md ">
|
|
@@ -171,7 +171,7 @@ export const Table = ({
|
|
|
171
171
|
</select>
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
|
174
|
-
|
|
174
|
+
</div>
|
|
175
175
|
);
|
|
176
176
|
};
|
|
177
177
|
|
|
@@ -211,11 +211,21 @@ function Filter({ column }: { column: Column<any, unknown> }) {
|
|
|
211
211
|
|
|
212
212
|
return uniqueItemsInList.sort().slice(0, 2000);
|
|
213
213
|
}
|
|
214
|
+
if (filterVariant === 'badges') {
|
|
215
|
+
const allBadges = column.getFacetedUniqueValues().keys();
|
|
216
|
+
// join all badges into a single array
|
|
217
|
+
const allBadgesArray = Array.from(allBadges)
|
|
218
|
+
.flat()
|
|
219
|
+
.filter((b) => !!b);
|
|
220
|
+
const allBadgesString = allBadgesArray.map((badge) => badge.content);
|
|
221
|
+
const uniqueBadges = Array.from(new Set(allBadgesString));
|
|
222
|
+
return uniqueBadges.sort().slice(0, 2000);
|
|
223
|
+
}
|
|
214
224
|
return Array.from(column.getFacetedUniqueValues().keys()).sort().slice(0, 2000);
|
|
215
225
|
}, [column.getFacetedUniqueValues(), filterVariant]);
|
|
216
226
|
|
|
217
227
|
return (
|
|
218
|
-
|
|
228
|
+
<div>
|
|
219
229
|
{/* Autocomplete suggestions from faceted values feature */}
|
|
220
230
|
<datalist id={column.id + 'list'}>
|
|
221
231
|
{sortedUniqueValues.map((value: any, index) => (
|
|
@@ -231,6 +241,6 @@ function Filter({ column }: { column: Column<any, unknown> }) {
|
|
|
231
241
|
list={column.id + 'list'}
|
|
232
242
|
/>
|
|
233
243
|
<div className="h-1" />
|
|
234
|
-
|
|
244
|
+
</div>
|
|
235
245
|
);
|
|
236
246
|
}
|
|
@@ -2,8 +2,10 @@ import { ServerIcon } from '@heroicons/react/20/solid';
|
|
|
2
2
|
import { RectangleGroupIcon } from '@heroicons/react/20/solid';
|
|
3
3
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
4
4
|
import type { CollectionEntry } from 'astro:content';
|
|
5
|
-
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
5
|
+
import { filterByBadge, filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
6
|
import { buildUrl } from '@utils/url-builder';
|
|
7
|
+
import { Tag } from 'lucide-react';
|
|
8
|
+
import { createBadgesColumn } from './SharedColumns';
|
|
7
9
|
|
|
8
10
|
const columnHelper = createColumnHelper<CollectionEntry<'domains'>>();
|
|
9
11
|
|
|
@@ -40,14 +42,6 @@ export const columns = () => [
|
|
|
40
42
|
},
|
|
41
43
|
filterFn: filterByName,
|
|
42
44
|
}),
|
|
43
|
-
// columnHelper.accessor('data.version', {
|
|
44
|
-
// header: () => <span>Version</span>,
|
|
45
|
-
// cell: (info) => {
|
|
46
|
-
// const service = info.row.original;
|
|
47
|
-
// return <div className="text-left font-light">{`v${info.getValue()} ${service.data.latestVersion === service.data.version ? '(latest)': ''}`}</div>
|
|
48
|
-
// },
|
|
49
|
-
// footer: (info) => info.column.id,
|
|
50
|
-
// }),
|
|
51
45
|
columnHelper.accessor('data.summary', {
|
|
52
46
|
id: 'summary',
|
|
53
47
|
header: () => 'Summary',
|
|
@@ -96,9 +90,9 @@ export const columns = () => [
|
|
|
96
90
|
</ul>
|
|
97
91
|
);
|
|
98
92
|
},
|
|
99
|
-
// footer: (info) => info.column.id,
|
|
100
93
|
filterFn: filterCollectionByName('services'),
|
|
101
94
|
}),
|
|
95
|
+
createBadgesColumn(columnHelper),
|
|
102
96
|
columnHelper.accessor('data.name', {
|
|
103
97
|
header: () => <span />,
|
|
104
98
|
cell: (info) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ServerIcon } from '@heroicons/react/20/solid';
|
|
2
|
-
import { RectangleGroupIcon } from '@heroicons/react/20/solid';
|
|
3
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
4
2
|
import type { CollectionEntry } from 'astro:content';
|
|
5
|
-
import { filterByName
|
|
3
|
+
import { filterByName } from '../filters/custom-filters';
|
|
6
4
|
import { buildUrl } from '@utils/url-builder';
|
|
7
5
|
import { QueueListIcon } from '@heroicons/react/24/solid';
|
|
6
|
+
import { createBadgesColumn } from './SharedColumns';
|
|
8
7
|
|
|
9
8
|
const columnHelper = createColumnHelper<CollectionEntry<'flows'>>();
|
|
10
9
|
|
|
@@ -61,6 +60,7 @@ export const columns = () => [
|
|
|
61
60
|
className: 'max-w-md',
|
|
62
61
|
},
|
|
63
62
|
}),
|
|
63
|
+
createBadgesColumn(columnHelper),
|
|
64
64
|
columnHelper.accessor('data.name', {
|
|
65
65
|
header: () => <span />,
|
|
66
66
|
cell: (info) => {
|