@eventcatalog/core 2.16.0 → 2.16.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/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-6VJTKPOS.js → chunk-A3QFF66M.js} +1 -1
- package/dist/{chunk-DMGFALQN.js → chunk-GEPV3ACK.js} +1 -1
- package/dist/{chunk-BT6ILNB3.js → chunk-J5H7ICLD.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/src/components/SideBars/CatalogResourcesSideBar/index.tsx +10 -1
- package/eventcatalog/src/components/Tables/Table.tsx +11 -1
- 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/layouts/DiscoverLayout.astro +1 -1
- package/eventcatalog/src/utils/collections/domains.ts +0 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-A3QFF66M.js";
|
|
4
|
+
import "../chunk-J5H7ICLD.js";
|
|
5
|
+
import "../chunk-GEPV3ACK.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-A3QFF66M.js";
|
|
4
|
+
import "./chunk-J5H7ICLD.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-GEPV3ACK.js";
|
|
11
11
|
import {
|
|
12
12
|
generate
|
|
13
13
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -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;
|
|
@@ -211,6 +211,16 @@ 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
|
|
|
@@ -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) => {
|
|
@@ -3,8 +3,9 @@ import { createColumnHelper } from '@tanstack/react-table';
|
|
|
3
3
|
import type { CollectionMessageTypes } from '@types';
|
|
4
4
|
import type { CollectionEntry } from 'astro:content';
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
|
-
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
|
+
import { filterByName, filterCollectionByName, filterByBadge } from '../filters/custom-filters';
|
|
7
7
|
import { buildUrl } from '@utils/url-builder';
|
|
8
|
+
import { createBadgesColumn } from './SharedColumns';
|
|
8
9
|
|
|
9
10
|
const columnHelper = createColumnHelper<CollectionEntry<CollectionMessageTypes>>();
|
|
10
11
|
|
|
@@ -55,6 +56,7 @@ export const columns = () => [
|
|
|
55
56
|
},
|
|
56
57
|
filterFn: filterByName,
|
|
57
58
|
}),
|
|
59
|
+
|
|
58
60
|
columnHelper.accessor('data.summary', {
|
|
59
61
|
id: 'summary',
|
|
60
62
|
header: () => 'Summary',
|
|
@@ -62,7 +64,7 @@ export const columns = () => [
|
|
|
62
64
|
footer: (info) => info.column.id,
|
|
63
65
|
meta: {
|
|
64
66
|
showFilter: false,
|
|
65
|
-
className: 'max-w-
|
|
67
|
+
className: 'max-w-[200px]',
|
|
66
68
|
},
|
|
67
69
|
}),
|
|
68
70
|
|
|
@@ -145,6 +147,7 @@ export const columns = () => [
|
|
|
145
147
|
footer: (info) => info.column.id,
|
|
146
148
|
filterFn: filterCollectionByName('consumers'),
|
|
147
149
|
}),
|
|
150
|
+
createBadgesColumn(columnHelper),
|
|
148
151
|
columnHelper.accessor('data.name', {
|
|
149
152
|
header: () => <span />,
|
|
150
153
|
cell: (info) => {
|
|
@@ -5,6 +5,7 @@ import { useMemo, useState } from 'react';
|
|
|
5
5
|
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
6
|
import { buildUrl } from '@utils/url-builder';
|
|
7
7
|
import { getColorAndIconForMessageType } from './MessageTableColumns';
|
|
8
|
+
import { createBadgesColumn } from './SharedColumns';
|
|
8
9
|
|
|
9
10
|
const columnHelper = createColumnHelper<CollectionEntry<'services'>>();
|
|
10
11
|
|
|
@@ -40,14 +41,6 @@ export const columns = () => [
|
|
|
40
41
|
},
|
|
41
42
|
filterFn: filterByName,
|
|
42
43
|
}),
|
|
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">{`v${info.getValue()} ${service.data.latestVersion === service.data.version ? '(latest)': ''}`}</div>
|
|
48
|
-
// },
|
|
49
|
-
// footer: (info) => info.column.id,
|
|
50
|
-
// }),
|
|
51
44
|
columnHelper.accessor('data.summary', {
|
|
52
45
|
id: 'summary',
|
|
53
46
|
header: () => 'Summary',
|
|
@@ -175,6 +168,7 @@ export const columns = () => [
|
|
|
175
168
|
},
|
|
176
169
|
filterFn: filterCollectionByName('sends'),
|
|
177
170
|
}),
|
|
171
|
+
createBadgesColumn(columnHelper),
|
|
178
172
|
columnHelper.accessor('data.name', {
|
|
179
173
|
header: () => <span />,
|
|
180
174
|
cell: (info) => {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
|
+
import { Tag } from 'lucide-react';
|
|
3
|
+
import { filterByBadge } from '../filters/custom-filters';
|
|
4
|
+
export const createBadgesColumn = <T extends { data: { badges?: any[] } }>(
|
|
5
|
+
columnHelper: ReturnType<typeof createColumnHelper<T>>
|
|
6
|
+
) => {
|
|
7
|
+
return columnHelper.accessor((row) => row.data.badges, {
|
|
8
|
+
id: 'badges',
|
|
9
|
+
header: () => <span>Badges</span>,
|
|
10
|
+
cell: (info) => {
|
|
11
|
+
const item = info.row.original;
|
|
12
|
+
const badges = item.data.badges || [];
|
|
13
|
+
|
|
14
|
+
if (badges?.length === 0 || !badges)
|
|
15
|
+
return <div className="font-light text-sm text-gray-400/60 text-left italic">No badges documented</div>;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<ul>
|
|
19
|
+
{badges.map((badge: any, index: number) => {
|
|
20
|
+
return (
|
|
21
|
+
<li key={`${badge.id}-${index}`} className="py-1 group font-light ">
|
|
22
|
+
<div className="group-hover:text-primary flex space-x-1 items-center ">
|
|
23
|
+
<div className="flex items-center border border-gray-300 shadow-sm rounded-md">
|
|
24
|
+
<span className="flex items-center">
|
|
25
|
+
<span className={`bg-${badge.backgroundColor}-500 h-full rounded-tl rounded-bl p-1`}>
|
|
26
|
+
{badge.icon && <badge.icon className="h-4 w-4 text-white" />}
|
|
27
|
+
{!badge.icon && <Tag className="h-4 w-4 text-white" />}
|
|
28
|
+
</span>
|
|
29
|
+
<span className="leading-none px-2 group-hover:underline ">{badge.content}</span>
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</li>
|
|
34
|
+
);
|
|
35
|
+
})}
|
|
36
|
+
</ul>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
meta: {
|
|
40
|
+
filterVariant: 'badges',
|
|
41
|
+
},
|
|
42
|
+
filterFn: filterByBadge,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
@@ -12,3 +12,8 @@ export const filterByName = (row: any, key: string, searchValue: string) => {
|
|
|
12
12
|
const label = `${row?.original?.data.name} (v${row?.original?.data.version})` || '';
|
|
13
13
|
return label.toLowerCase().includes(searchValue.toLowerCase());
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
export const filterByBadge = (row: any, key: string, searchValue: string) => {
|
|
17
|
+
const badges = row?.original?.data?.badges || [];
|
|
18
|
+
return badges.some((badge: any) => badge.content.toLowerCase().includes(searchValue.toLowerCase()));
|
|
19
|
+
};
|
|
@@ -56,9 +56,6 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
|
|
|
56
56
|
export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
|
|
57
57
|
const { collection, data, slug } = domain;
|
|
58
58
|
|
|
59
|
-
const allUbiquitousLanguages = await getCollection('ubiquitousLanguages');
|
|
60
|
-
console.log('allUbiquitousLanguages', allUbiquitousLanguages, collection, slug, data.name);
|
|
61
|
-
|
|
62
59
|
const ubiquitousLanguages = await getCollection('ubiquitousLanguages', (ubiquitousLanguage) => {
|
|
63
60
|
return ubiquitousLanguage.id.includes(`${collection}/${data.name}`);
|
|
64
61
|
});
|