@redocly/theme 0.56.0-next.2 → 0.56.0-next.4
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/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +4 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +4 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +11 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +0 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityIcon.js +22 -23
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntityTypeTag.js +36 -0
- package/lib/components/Catalog/CatalogPageDescription.js +2 -2
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -14
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +3 -26
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +5 -26
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +5 -6
- package/lib/components/Catalog/variables.js +36 -7
- package/lib/components/Menu/variables.js +2 -0
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +3 -3
- package/lib/components/Tag/variables.js +14 -0
- package/lib/components/Tags/CounterTag.d.ts +1 -1
- package/lib/components/Tags/HttpTag.d.ts +1 -1
- package/lib/core/constants/catalog.d.ts +3 -0
- package/lib/core/constants/catalog.js +55 -1
- package/lib/core/constants/index.d.ts +5 -5
- package/lib/core/constants/index.js +5 -5
- package/lib/core/constants/search.d.ts +1 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
- package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
- package/lib/core/contexts/index.d.ts +3 -3
- package/lib/core/contexts/index.js +3 -3
- package/lib/core/hoc/index.d.ts +1 -1
- package/lib/core/hoc/index.js +1 -1
- package/lib/core/hooks/__mocks__/index.d.ts +28 -28
- package/lib/core/hooks/__mocks__/index.js +28 -28
- package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
- package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
- package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
- package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
- package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
- package/lib/core/hooks/index.d.ts +42 -42
- package/lib/core/hooks/index.js +42 -42
- package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
- package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
- package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
- package/lib/core/hooks/menu/use-nested-menu.js +8 -6
- package/lib/core/hooks/search/use-recent-searches.js +3 -3
- package/lib/core/hooks/search/use-search-dialog.js +4 -3
- package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
- package/lib/core/hooks/search/use-suggested-pages.js +2 -2
- package/lib/core/hooks/use-active-page-version.js +2 -2
- package/lib/core/hooks/use-active-section-id.js +2 -2
- package/lib/core/hooks/use-color-switcher.js +4 -3
- package/lib/core/hooks/use-input-key-commands.js +2 -2
- package/lib/core/hooks/use-language-picker.d.ts +1 -1
- package/lib/core/hooks/use-language-picker.js +4 -4
- package/lib/core/hooks/use-mobile-menu.js +2 -2
- package/lib/core/hooks/use-navbar-height.js +3 -3
- package/lib/core/hooks/use-page-versions.js +2 -2
- package/lib/core/hooks/use-product-picker.js +2 -2
- package/lib/core/hooks/use-theme-config.js +2 -2
- package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
- package/lib/core/hooks/use-theme-hooks.js +2 -2
- package/lib/core/hooks/use-time-ago.js +2 -2
- package/lib/core/hooks/use-user-teams.js +2 -2
- package/lib/core/index.d.ts +7 -7
- package/lib/core/index.js +7 -7
- package/lib/core/openapi/index.d.ts +18 -0
- package/lib/core/openapi/index.js +48 -0
- package/lib/core/styles/global.js +1 -1
- package/lib/core/styles/index.d.ts +2 -2
- package/lib/core/styles/index.js +2 -2
- package/lib/core/templates/Markdown.d.ts +1 -1
- package/lib/core/templates/Markdown.js +8 -6
- package/lib/core/types/catalog.d.ts +6 -2
- package/lib/core/types/code-walkthrough.d.ts +1 -1
- package/lib/core/types/feedback.d.ts +1 -1
- package/lib/core/types/filter.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +11 -3
- package/lib/core/types/index.d.ts +18 -18
- package/lib/core/types/index.js +18 -18
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +1 -1
- package/lib/core/types/sidebar.d.ts +1 -1
- package/lib/core/utils/download-code-walkthrough.js +6 -4
- package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
- package/lib/core/utils/index.d.ts +35 -35
- package/lib/core/utils/index.js +35 -35
- package/lib/core/utils/load-and-navigate.js +2 -2
- package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
- package/lib/core/utils/menu.d.ts +3 -2
- package/lib/core/utils/menu.js +12 -12
- package/lib/core/utils/toc.d.ts +1 -1
- package/lib/core/utils/type-guards.d.ts +1 -1
- package/lib/core/utils/type-guards.js +5 -5
- package/lib/core/utils/urls.d.ts +1 -1
- package/lib/core/utils/urls.js +2 -2
- package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
- package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
- package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
- package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
- package/lib/icons/NotesIcon/NotesIcon.js +26 -0
- package/lib/markdoc/components/Tabs/TabList.js +2 -0
- package/package.json +2 -2
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +6 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +7 -15
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +4 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +10 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +36 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +19 -22
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +0 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +33 -27
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +43 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +4 -3
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +7 -20
- package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -2
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +3 -31
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +5 -31
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +10 -19
- package/src/components/Catalog/variables.ts +36 -7
- package/src/components/Menu/variables.ts +2 -0
- package/src/components/Tag/Tag.tsx +11 -2
- package/src/components/Tag/variables.ts +14 -0
- package/src/core/constants/catalog.ts +58 -0
- package/src/core/constants/index.ts +5 -5
- package/src/core/constants/search.ts +1 -1
- package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
- package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
- package/src/core/contexts/ThemeDataContext.tsx +3 -3
- package/src/core/contexts/index.ts +3 -3
- package/src/core/hoc/index.ts +1 -1
- package/src/core/hooks/__mocks__/index.ts +28 -28
- package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
- package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
- package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
- package/src/core/hooks/index.ts +42 -42
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
- package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
- package/src/core/hooks/menu/use-nested-menu.ts +5 -3
- package/src/core/hooks/search/use-recent-searches.ts +1 -1
- package/src/core/hooks/search/use-search-dialog.ts +2 -1
- package/src/core/hooks/search/use-search-filter.ts +1 -1
- package/src/core/hooks/search/use-suggested-pages.ts +1 -1
- package/src/core/hooks/use-active-page-version.ts +1 -1
- package/src/core/hooks/use-active-section-id.ts +1 -1
- package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
- package/src/core/hooks/use-color-switcher.ts +2 -1
- package/src/core/hooks/use-input-key-commands.ts +1 -1
- package/src/core/hooks/use-language-picker.ts +3 -3
- package/src/core/hooks/use-mobile-menu.ts +1 -1
- package/src/core/hooks/use-navbar-height.ts +1 -1
- package/src/core/hooks/use-page-versions.ts +1 -1
- package/src/core/hooks/use-product-picker.ts +1 -1
- package/src/core/hooks/use-theme-config.ts +2 -2
- package/src/core/hooks/use-theme-hooks.ts +2 -2
- package/src/core/hooks/use-time-ago.ts +3 -2
- package/src/core/hooks/use-user-teams.ts +1 -1
- package/src/core/index.ts +7 -7
- package/src/core/openapi/index.ts +31 -0
- package/src/core/styles/global.ts +2 -1
- package/src/core/styles/index.ts +2 -2
- package/src/core/templates/Markdown.tsx +8 -4
- package/src/core/types/catalog.ts +15 -2
- package/src/core/types/code-walkthrough.ts +1 -1
- package/src/core/types/feedback.ts +6 -6
- package/src/core/types/filter.ts +1 -1
- package/src/core/types/hooks.ts +17 -16
- package/src/core/types/index.ts +18 -18
- package/src/core/types/l10n.ts +4 -0
- package/src/core/types/search.ts +1 -1
- package/src/core/types/sidebar.ts +1 -1
- package/src/core/utils/download-code-walkthrough.ts +3 -5
- package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
- package/src/core/utils/index.ts +35 -35
- package/src/core/utils/load-and-navigate.ts +1 -1
- package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
- package/src/core/utils/menu.ts +4 -3
- package/src/core/utils/toc.ts +1 -1
- package/src/core/utils/type-guards.ts +2 -2
- package/src/core/utils/urls.ts +2 -2
- package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
- package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
- package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
- package/src/markdoc/components/Tabs/TabList.tsx +1 -0
|
@@ -14,6 +14,7 @@ const ArrowUpRightIcon_1 = require("../../../icons/ArrowUpRightIcon/ArrowUpRight
|
|
|
14
14
|
const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
|
|
15
15
|
const CatalogEntityIcon_1 = require("../../../components/Catalog/CatalogEntityIcon");
|
|
16
16
|
const core_1 = require("../../../core");
|
|
17
|
+
const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
|
|
17
18
|
function CatalogCard({ entity, catalogConfig }) {
|
|
18
19
|
var _a, _b, _c;
|
|
19
20
|
const { useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
@@ -25,8 +26,9 @@ function CatalogCard({ entity, catalogConfig }) {
|
|
|
25
26
|
} },
|
|
26
27
|
react_1.default.createElement(CardContent, null,
|
|
27
28
|
react_1.default.createElement(CardHeader, null,
|
|
28
|
-
react_1.default.createElement(
|
|
29
|
-
react_1.default.createElement(
|
|
29
|
+
react_1.default.createElement(Tooltip_1.TooltipComponent, { tip: entity.type, placement: "bottom", className: "catalog" },
|
|
30
|
+
react_1.default.createElement(HeaderIconWrapper, null,
|
|
31
|
+
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type, defaultColor: true }))),
|
|
30
32
|
react_1.default.createElement(CardTitle, null,
|
|
31
33
|
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title))),
|
|
32
34
|
react_1.default.createElement(CardDescription, null,
|
|
@@ -6,7 +6,5 @@ export type CatalogEntityProps = {
|
|
|
6
6
|
entitiesCatalogConfig: EntitiesCatalogConfig;
|
|
7
7
|
catalogConfig: CatalogEntityConfig;
|
|
8
8
|
initialRelations: BffCatalogRelatedEntityList;
|
|
9
|
-
mainCatalogLabelTranslationKey?: string;
|
|
10
|
-
mainCatalogSlug?: string;
|
|
11
9
|
};
|
|
12
|
-
export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations,
|
|
10
|
+
export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }: CatalogEntityProps): React.JSX.Element;
|
|
@@ -18,8 +18,9 @@ const Menu_1 = require("../../../components/Menu/Menu");
|
|
|
18
18
|
const Button_1 = require("../../../components/Button/Button");
|
|
19
19
|
const CatalogEntityRelations_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations");
|
|
20
20
|
const hooks_1 = require("../../../core/hooks");
|
|
21
|
-
const SidebarActions_1 = require("
|
|
22
|
-
|
|
21
|
+
const SidebarActions_1 = require("../../../components/SidebarActions/SidebarActions");
|
|
22
|
+
const CatalogEntitySchema_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntitySchema");
|
|
23
|
+
function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }) {
|
|
23
24
|
var _a;
|
|
24
25
|
const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
|
|
25
26
|
const { translate } = useTranslate();
|
|
@@ -38,14 +39,6 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
|
|
|
38
39
|
] }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
|
|
39
40
|
react_1.default.createElement(CatalogPageContent, null,
|
|
40
41
|
react_1.default.createElement(Breadcrumbs_1.Breadcrumbs, { additionalBreadcrumbs: [
|
|
41
|
-
...(mainCatalogLabelTranslationKey
|
|
42
|
-
? [
|
|
43
|
-
{
|
|
44
|
-
label: translate(mainCatalogLabelTranslationKey),
|
|
45
|
-
link: `catalogs/${mainCatalogSlug}`,
|
|
46
|
-
},
|
|
47
|
-
]
|
|
48
|
-
: []),
|
|
49
42
|
{ label: linkToMainCatalogLabel, link: linkToMainCatalog },
|
|
50
43
|
{ label: entity.title },
|
|
51
44
|
] }),
|
|
@@ -53,7 +46,7 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
|
|
|
53
46
|
react_1.default.createElement(CatalogPageDescription_1.CatalogPageDescription, { title: entity.title, description: (_a = entity.summary) !== null && _a !== void 0 ? _a : '', tag: entity.key }),
|
|
54
47
|
react_1.default.createElement(CatalogEntityProperties_1.CatalogEntityProperties, { entity: entity }),
|
|
55
48
|
react_1.default.createElement(CatalogTwoColumnsSection, null,
|
|
56
|
-
react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity }),
|
|
49
|
+
entity.type === 'data-schema' ? (react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity })) : (react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity })),
|
|
57
50
|
react_1.default.createElement(CatalogEntityLinks_1.CatalogEntityLinks, { entity: entity })),
|
|
58
51
|
react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations })))));
|
|
59
52
|
}
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js
CHANGED
|
@@ -14,12 +14,18 @@ const UserEmailProperty_1 = require("../../../../components/Catalog/CatalogEntit
|
|
|
14
14
|
const DomainsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty");
|
|
15
15
|
const OwnersProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty");
|
|
16
16
|
const ContactProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty");
|
|
17
|
+
const FormatProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty");
|
|
17
18
|
const propertyRenderers = [
|
|
18
19
|
{
|
|
19
20
|
key: 'type',
|
|
20
21
|
condition: (entity) => !!entity.type,
|
|
21
22
|
component: EntityTypeProperty_1.EntityTypeProperty,
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
key: 'format',
|
|
26
|
+
condition: (entity) => { var _a; return entity.type === 'data-schema' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType); },
|
|
27
|
+
component: FormatProperty_1.FormatProperty,
|
|
28
|
+
},
|
|
23
29
|
{
|
|
24
30
|
key: 'contact',
|
|
25
31
|
condition: (entity) => { var _a, _b; return !!((_b = (_a = entity.contact) === null || _a === void 0 ? void 0 : _a.slack) === null || _b === void 0 ? void 0 : _b.channels); },
|
|
@@ -32,7 +38,7 @@ const propertyRenderers = [
|
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
key: 'tags',
|
|
35
|
-
condition: (entity) => !!entity.tags,
|
|
41
|
+
condition: (entity) => { var _a; return !!((_a = entity.tags) === null || _a === void 0 ? void 0 : _a.length); },
|
|
36
42
|
component: TagsProperty_1.TagsProperty,
|
|
37
43
|
},
|
|
38
44
|
{
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js
CHANGED
|
@@ -37,6 +37,7 @@ const CardHeader = styled_components_1.default.div `
|
|
|
37
37
|
display: flex;
|
|
38
38
|
align-items: center;
|
|
39
39
|
gap: var(--catalog-card-content-gap);
|
|
40
|
+
font-weight: var(--font-weight-medium);
|
|
40
41
|
`;
|
|
41
42
|
const CardContent = styled_components_1.default.div `
|
|
42
43
|
flex: 1;
|
|
@@ -44,5 +45,8 @@ const CardContent = styled_components_1.default.div `
|
|
|
44
45
|
align-items: center;
|
|
45
46
|
gap: var(--catalog-card-content-gap);
|
|
46
47
|
flex-wrap: wrap;
|
|
48
|
+
color: var(--text-color-primary);
|
|
49
|
+
font-size: var(--font-size-lg);
|
|
50
|
+
line-height: var(--line-height-lg);
|
|
47
51
|
`;
|
|
48
52
|
//# sourceMappingURL=CatalogEntityPropertyCard.js.map
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DomainsProperty = DomainsProperty;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const GraphIcon_1 = require("../../../../icons/GraphIcon/GraphIcon");
|
|
9
|
-
const
|
|
10
|
-
const CatalogEntityPropertyCard_1 = require("
|
|
9
|
+
const Tag_1 = require("../../../../components/Tag/Tag");
|
|
10
|
+
const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
|
|
11
11
|
function DomainsProperty({ entity }) {
|
|
12
12
|
const { domains = [] } = entity;
|
|
13
13
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty" },
|
|
14
14
|
react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
15
|
react_1.default.createElement(GraphIcon_1.GraphIcon, null),
|
|
16
|
-
"Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(
|
|
16
|
+
"Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(Tag_1.Tag, { key: domain === null || domain === void 0 ? void 0 : domain.id, style: { backgroundColor: 'var(--bg-color)' } },
|
|
17
17
|
react_1.default.createElement(GraphIcon_1.GraphIcon, null), domain === null || domain === void 0 ? void 0 :
|
|
18
18
|
domain.title)))) })));
|
|
19
19
|
}
|
|
@@ -8,13 +8,18 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const EntityTypeIcon_1 = require("../../../../icons/EntityTypeIcon/EntityTypeIcon");
|
|
9
9
|
const utils_1 = require("../../../../core/utils");
|
|
10
10
|
const CatalogEntityTypeIcon_1 = require("../../../../components/Catalog/CatalogEntityTypeIcon");
|
|
11
|
-
const CatalogEntityPropertyCard_1 = require("
|
|
11
|
+
const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
|
|
12
|
+
const formatEntityType = (entityType) => {
|
|
13
|
+
return (0, utils_1.capitalize)(entityType.startsWith('api-')
|
|
14
|
+
? entityType.replace('api-', 'API-').replace(/-/g, ' ')
|
|
15
|
+
: entityType.replace(/-/g, ' '));
|
|
16
|
+
};
|
|
12
17
|
function EntityTypeProperty({ entity }) {
|
|
13
18
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty" },
|
|
14
19
|
react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
20
|
react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null),
|
|
16
21
|
"Entity type"), content: react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
22
|
react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type }),
|
|
18
|
-
|
|
23
|
+
formatEntityType(entity.type)) })));
|
|
19
24
|
}
|
|
20
25
|
//# sourceMappingURL=EntityTypeProperty.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FormatProperty = FormatProperty;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const NotesIcon_1 = require("../../../../icons/NotesIcon/NotesIcon");
|
|
9
|
+
const Tag_1 = require("../../../../components/Tag/Tag");
|
|
10
|
+
const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
|
|
11
|
+
function FormatProperty({ entity }) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty" },
|
|
14
|
+
react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
+
react_1.default.createElement(NotesIcon_1.NotesIcon, null),
|
|
16
|
+
"Format"), content: react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
|
+
react_1.default.createElement(Tag_1.Tag, { textTransform: "none", key: (_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType, style: { backgroundColor: 'var(--bg-color)' } }, (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.specType)) })));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=FormatProperty.js.map
|
|
@@ -12,6 +12,7 @@ export type CatalogEntityDefaultRelationsProps = {
|
|
|
12
12
|
};
|
|
13
13
|
searchQuery: string;
|
|
14
14
|
setSearchQuery: (query: string) => void;
|
|
15
|
+
setFilter: (filter: string) => void;
|
|
15
16
|
sortOption: SortOption | null;
|
|
16
17
|
setSortOption: (sortOption: SortOption | null) => void;
|
|
17
18
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js
CHANGED
|
@@ -5,11 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CatalogEntityDefaultRelations = CatalogEntityDefaultRelations;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const CatalogTableView_1 = require("../../../../components/Catalog/CatalogTableView/CatalogTableView");
|
|
10
8
|
const CatalogEntityCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogEntityCell");
|
|
11
|
-
const Tag_1 = require("../../../../components/Tag/Tag");
|
|
12
9
|
const CatalogEntityRelationsTable_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable");
|
|
10
|
+
const CatalogEntityTypeTag_1 = require("../../../../components/Catalog/CatalogEntityTypeTag");
|
|
11
|
+
const CatalogEntityRelationCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogEntityRelationCell");
|
|
13
12
|
const columns = [
|
|
14
13
|
{
|
|
15
14
|
key: 'entity',
|
|
@@ -17,21 +16,25 @@ const columns = [
|
|
|
17
16
|
render: (entity) => react_1.default.createElement(CatalogEntityCell_1.CatalogEntityCell, { entity: entity }),
|
|
18
17
|
sortable: true,
|
|
19
18
|
sortKey: 'title',
|
|
19
|
+
width: '2.5fr',
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
key: 'type',
|
|
23
23
|
title: 'Type',
|
|
24
|
-
render: (entity) =>
|
|
24
|
+
render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
|
|
25
25
|
sortable: true,
|
|
26
26
|
sortKey: 'type',
|
|
27
|
+
width: '1fr',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: 'relationType',
|
|
31
|
+
title: 'Relations',
|
|
32
|
+
render: (entity) => (react_1.default.createElement(CatalogEntityRelationCell_1.CatalogEntityRelationCell, { relationType: entity.relationType, relationRole: entity.relationRole })),
|
|
33
|
+
width: '1fr',
|
|
27
34
|
},
|
|
28
35
|
];
|
|
29
36
|
function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
30
37
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations" },
|
|
31
38
|
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: "Related entities", columns: columns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
32
39
|
}
|
|
33
|
-
const EntityTypeTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
34
|
-
font-size: var(--font-size-base);
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
`;
|
|
37
40
|
//# sourceMappingURL=CatalogEntityDefaultRelations.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js
CHANGED
|
@@ -1,19 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.CatalogEntityRelations = CatalogEntityRelations;
|
|
7
|
-
const react_1 =
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
8
28
|
const hooks_1 = require("../../../../core/hooks");
|
|
9
29
|
const CatalogEntityDefaultRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations");
|
|
10
30
|
const CatalogEntityTeamRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations");
|
|
11
31
|
const LOAD_MORE_THRESHOLD = 10;
|
|
32
|
+
const ENTITY_DEFAULT_FILTERS = {
|
|
33
|
+
team: 'type:user',
|
|
34
|
+
};
|
|
12
35
|
function CatalogEntityRelations({ entity, entitiesCatalogConfig, initialRelations, catalogConfig, }) {
|
|
36
|
+
var _a;
|
|
13
37
|
const { useCatalogSort, useCatalogSearch, useFetchCatalogEntitiesRelations } = (0, hooks_1.useThemeHooks)();
|
|
14
38
|
const { sortOption, setSortOption, handleSortClick, isColumnSorted } = useCatalogSort();
|
|
15
39
|
const { searchQuery, setSearchQuery } = useCatalogSearch();
|
|
16
|
-
const
|
|
40
|
+
const [filter, setFilter] = (0, react_1.useState)((_a = ENTITY_DEFAULT_FILTERS[entity.type]) !== null && _a !== void 0 ? _a : '');
|
|
41
|
+
const { items: relations, query } = useFetchCatalogEntitiesRelations({ entityKey: entity.key, search: searchQuery, sort: sortOption !== null && sortOption !== void 0 ? sortOption : undefined, filter }, initialRelations);
|
|
17
42
|
if (relations.length === 0) {
|
|
18
43
|
return null;
|
|
19
44
|
}
|
|
@@ -22,10 +47,10 @@ function CatalogEntityRelations({ entity, entitiesCatalogConfig, initialRelation
|
|
|
22
47
|
switch (entity.type) {
|
|
23
48
|
case 'team':
|
|
24
49
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations/CatalogEntityTeamRelations" },
|
|
25
|
-
react_1.default.createElement(CatalogEntityTeamRelations_1.CatalogEntityTeamRelations, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
50
|
+
react_1.default.createElement(CatalogEntityTeamRelations_1.CatalogEntityTeamRelations, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, setFilter: setFilter, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
26
51
|
default:
|
|
27
52
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations/CatalogEntityDefaultRelations" },
|
|
28
|
-
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
53
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, setFilter: setFilter, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
29
54
|
}
|
|
30
55
|
}
|
|
31
56
|
//# sourceMappingURL=CatalogEntityRelations.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export type CatalogEntityRelationsTableProps = {
|
|
|
14
14
|
searchQuery: string;
|
|
15
15
|
setSearchQuery: (query: string) => void;
|
|
16
16
|
heading: string;
|
|
17
|
-
filter?: string;
|
|
18
17
|
columns: CatalogColumn<BffCatalogRelatedEntity>[];
|
|
19
18
|
sortOption: SortOption | null;
|
|
20
19
|
setSortOption: (sortOption: SortOption | null) => void;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts
CHANGED
|
@@ -13,10 +13,11 @@ export type CatalogEntityTeamRelationsProps = {
|
|
|
13
13
|
};
|
|
14
14
|
searchQuery: string;
|
|
15
15
|
setSearchQuery: (query: string) => void;
|
|
16
|
+
setFilter: (filter: string) => void;
|
|
16
17
|
sortOption: SortOption | null;
|
|
17
18
|
setSortOption: (sortOption: SortOption | null) => void;
|
|
18
19
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
19
20
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
20
21
|
shouldShowLoadMore: boolean;
|
|
21
22
|
};
|
|
22
|
-
export declare function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }: CatalogEntityTeamRelationsProps): JSX.Element;
|
|
23
|
+
export declare function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }: CatalogEntityTeamRelationsProps): JSX.Element;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js
CHANGED
|
@@ -13,6 +13,7 @@ const Tag_1 = require("../../../../components/Tag/Tag");
|
|
|
13
13
|
const CatalogEntityRelationsTable_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable");
|
|
14
14
|
const CatalogUserEntityCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogUserEntityCell");
|
|
15
15
|
const CatalogEntityDefaultRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations");
|
|
16
|
+
const CatalogEntityRelationCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogEntityRelationCell");
|
|
16
17
|
const teamColumns = [
|
|
17
18
|
{
|
|
18
19
|
key: 'entity',
|
|
@@ -31,6 +32,11 @@ const teamColumns = [
|
|
|
31
32
|
render: (entity) => { var _a, _b; return (((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.role) ? react_1.default.createElement(Tag_1.Tag, null, (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.role) : null); },
|
|
32
33
|
width: '2fr',
|
|
33
34
|
},
|
|
35
|
+
{
|
|
36
|
+
key: 'relationType',
|
|
37
|
+
title: 'Relations',
|
|
38
|
+
render: (entity) => (react_1.default.createElement(CatalogEntityRelationCell_1.CatalogEntityRelationCell, { relationType: entity.relationType, relationRole: entity.relationRole })),
|
|
39
|
+
},
|
|
34
40
|
{
|
|
35
41
|
key: 'description',
|
|
36
42
|
title: 'Description',
|
|
@@ -38,13 +44,13 @@ const teamColumns = [
|
|
|
38
44
|
width: '3fr',
|
|
39
45
|
},
|
|
40
46
|
];
|
|
41
|
-
function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
47
|
+
function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
42
48
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations" },
|
|
43
49
|
react_1.default.createElement(Tabs_1.Tabs, { forceReady: relations.length > 0, size: Tabs_1.TabsSize.MEDIUM },
|
|
44
|
-
react_1.default.createElement(TabItem, { label: "Members", icon: react_1.default.createElement(PeopleIcon_1.PeopleIcon, null) },
|
|
45
|
-
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: "Members",
|
|
46
|
-
react_1.default.createElement(TabItem, { label: "Related entities", icon: react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null) },
|
|
47
|
-
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })))));
|
|
50
|
+
react_1.default.createElement(TabItem, { label: "Members", icon: react_1.default.createElement(PeopleIcon_1.PeopleIcon, null), onClick: () => setFilter('type:user') },
|
|
51
|
+
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: "Members", columns: teamColumns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })),
|
|
52
|
+
react_1.default.createElement(TabItem, { label: "Related entities", icon: react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null), onClick: () => setFilter('') },
|
|
53
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, setFilter: setFilter, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })))));
|
|
48
54
|
}
|
|
49
55
|
const TabItem = styled_components_1.default.div `
|
|
50
56
|
padding: 12px;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BffCatalogEntity } from '../../../core/types';
|
|
3
|
+
export type CatalogEntitySchemaProps = {
|
|
4
|
+
entity: BffCatalogEntity;
|
|
5
|
+
};
|
|
6
|
+
export declare function CatalogEntitySchema({ entity }: CatalogEntitySchemaProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.CatalogEntitySchema = CatalogEntitySchema;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const hooks_1 = require("../../../core/hooks");
|
|
21
|
+
const JsonViewer_1 = require("../../../components/JsonViewer/JsonViewer");
|
|
22
|
+
function CatalogEntitySchema({ entity }) {
|
|
23
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
24
|
+
const { translate } = useTranslate();
|
|
25
|
+
const _a = entity.metadata || {}, { schema } = _a, metadataToShow = __rest(_a, ["schema"]);
|
|
26
|
+
const metadata = Object.entries(metadataToShow);
|
|
27
|
+
if (!metadata.length) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
let parsedSchema;
|
|
31
|
+
try {
|
|
32
|
+
parsedSchema = JSON.parse(schema);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return (react_1.default.createElement(MetadataWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityMetadata" },
|
|
38
|
+
react_1.default.createElement(Heading, null, translate('catalog.entity.metadata.title')),
|
|
39
|
+
react_1.default.createElement(JsonViewer_1.JsonViewer, { data: parsedSchema, expandLevel: 3, title: "JSON" })));
|
|
40
|
+
}
|
|
41
|
+
const MetadataWrapper = styled_components_1.default.div `
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: var(--spacing-xs);
|
|
45
|
+
border-radius: var(--border-radius);
|
|
46
|
+
background-color: var(--catalog-metadata-bg-color);
|
|
47
|
+
transition: all 0.2s ease-in-out;
|
|
48
|
+
margin: var(--spacing-lg) 0;
|
|
49
|
+
`;
|
|
50
|
+
const Heading = styled_components_1.default.h2 `
|
|
51
|
+
margin-bottom: var(--spacing-base);
|
|
52
|
+
margin-top: 0;
|
|
53
|
+
font-size: var(--catalog-metadata-heading-size);
|
|
54
|
+
`;
|
|
55
|
+
//# sourceMappingURL=CatalogEntitySchema.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
export type CatalogEntityIconProps = {
|
|
3
3
|
entityType: string;
|
|
4
|
+
defaultColor?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export declare function CatalogEntityIcon({ entityType }: CatalogEntityIconProps): JSX.Element;
|
|
6
|
+
export declare function CatalogEntityIcon({ entityType, defaultColor, }: CatalogEntityIconProps): JSX.Element;
|
|
@@ -9,30 +9,29 @@ const CodeIcon_1 = require("../../icons/CodeIcon/CodeIcon");
|
|
|
9
9
|
const GraphIcon_1 = require("../../icons/GraphIcon/GraphIcon");
|
|
10
10
|
const PeopleIcon_1 = require("../../icons/PeopleIcon/PeopleIcon");
|
|
11
11
|
const UserIcon_1 = require("../../icons/UserIcon/UserIcon");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const NetworkIcon_1 = require("../../icons/NetworkIcon/NetworkIcon");
|
|
13
|
+
const MoleculesIcon_1 = require("../../icons/MoleculesIcon/MoleculesIcon");
|
|
14
|
+
const getIconColor = (entityType) => `var(--catalog-entity-icon-color-${entityType})`;
|
|
15
|
+
const getEntityIcon = ({ entityType, defaultColor }) => {
|
|
16
|
+
const iconColor = defaultColor
|
|
17
|
+
? `var(--catalog-entity-icon-color)`
|
|
18
|
+
: getIconColor(entityType);
|
|
19
|
+
const entityIconMap = {
|
|
20
|
+
service: react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
|
|
21
|
+
domain: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor }),
|
|
22
|
+
team: react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor }),
|
|
23
|
+
user: react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor }),
|
|
24
|
+
'api-description': react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
|
|
25
|
+
'data-schema': react_1.default.createElement(NetworkIcon_1.NetworkIcon, { color: iconColor }),
|
|
26
|
+
'api-operation': react_1.default.createElement(MoleculesIcon_1.MoleculesIcon, { color: iconColor }),
|
|
27
|
+
};
|
|
28
|
+
return entityIconMap[entityType];
|
|
19
29
|
};
|
|
20
|
-
function CatalogEntityIcon({ entityType }) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return entityIconMap.service;
|
|
25
|
-
case 'domain':
|
|
26
|
-
return entityIconMap.domain;
|
|
27
|
-
case 'team':
|
|
28
|
-
return entityIconMap.team;
|
|
29
|
-
case 'user':
|
|
30
|
-
return entityIconMap.user;
|
|
31
|
-
case 'api-description':
|
|
32
|
-
return entityIconMap['api-description'];
|
|
33
|
-
default:
|
|
34
|
-
const exhaustiveCheck = key;
|
|
35
|
-
throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
|
|
30
|
+
function CatalogEntityIcon({ entityType, defaultColor = false, }) {
|
|
31
|
+
const icon = getEntityIcon({ entityType, defaultColor });
|
|
32
|
+
if (!icon) {
|
|
33
|
+
throw new Error(`Unhandled entity type: ${entityType}`);
|
|
36
34
|
}
|
|
35
|
+
return icon;
|
|
37
36
|
}
|
|
38
37
|
//# sourceMappingURL=CatalogEntityIcon.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type CatalogEntityTypeIconProps = {
|
|
3
3
|
entityType: string;
|
|
4
|
+
defaultColor?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export declare function CatalogEntityTypeIcon({ entityType }: CatalogEntityTypeIconProps): React.JSX.Element;
|
|
6
|
+
export declare function CatalogEntityTypeIcon({ entityType, defaultColor, }: CatalogEntityTypeIconProps): React.JSX.Element;
|
|
@@ -6,27 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CatalogEntityTypeIcon = CatalogEntityTypeIcon;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const getEntityIcon = (entityType) => {
|
|
14
|
-
const iconColor = 'var(--catalog-entity-icon-color)';
|
|
15
|
-
switch (entityType.toLowerCase()) {
|
|
16
|
-
case 'service':
|
|
17
|
-
return react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor });
|
|
18
|
-
case 'domain':
|
|
19
|
-
return react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor });
|
|
20
|
-
case 'team':
|
|
21
|
-
return react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor });
|
|
22
|
-
case 'user':
|
|
23
|
-
return react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor });
|
|
24
|
-
default:
|
|
25
|
-
return react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor });
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
function CatalogEntityTypeIcon({ entityType }) {
|
|
29
|
-
return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon" }, getEntityIcon(entityType)));
|
|
9
|
+
const CatalogEntityIcon_1 = require("../../components/Catalog/CatalogEntityIcon");
|
|
10
|
+
function CatalogEntityTypeIcon({ entityType, defaultColor = false, }) {
|
|
11
|
+
return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon", entityType: entityType, defaultColor: defaultColor },
|
|
12
|
+
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entityType, defaultColor: defaultColor })));
|
|
30
13
|
}
|
|
31
14
|
const IconContainer = styled_components_1.default.div `
|
|
32
15
|
display: flex;
|
|
@@ -35,8 +18,13 @@ const IconContainer = styled_components_1.default.div `
|
|
|
35
18
|
width: var(--catalog-table-icon-width);
|
|
36
19
|
height: var(--catalog-table-icon-height);
|
|
37
20
|
border-radius: var(--catalog-table-icon-border-radius);
|
|
38
|
-
background-color:
|
|
21
|
+
background-color: ${({ defaultColor, entityType }) => defaultColor
|
|
22
|
+
? 'var(--catalog-entity-bg-color)'
|
|
23
|
+
: `var(--catalog-entity-bg-color-${entityType})`};
|
|
39
24
|
flex-shrink: 0;
|
|
40
|
-
border:
|
|
25
|
+
border: 1px solid
|
|
26
|
+
${({ defaultColor, entityType }) => defaultColor
|
|
27
|
+
? 'var(--catalog-entity-border-color)'
|
|
28
|
+
: `var(--catalog-entity-border-color-${entityType})`};
|
|
41
29
|
`;
|
|
42
30
|
//# sourceMappingURL=CatalogEntityTypeIcon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { EntityType } from '../../core/types';
|
|
3
|
+
export type CatalogEntityTypeTagProps = {
|
|
4
|
+
entityType: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getEntityTagColor: (type: EntityType) => string;
|
|
7
|
+
export declare function CatalogEntityTypeTag({ entityType }: CatalogEntityTypeTagProps): JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getEntityTagColor = void 0;
|
|
7
|
+
exports.CatalogEntityTypeTag = CatalogEntityTypeTag;
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
|
+
const Tag_1 = require("../../components/Tag/Tag");
|
|
11
|
+
const entityTagColorMap = {
|
|
12
|
+
service: 'blue',
|
|
13
|
+
domain: 'grass',
|
|
14
|
+
team: 'purple',
|
|
15
|
+
user: 'yellow',
|
|
16
|
+
'api-description': 'sky',
|
|
17
|
+
'data-schema': 'carrot',
|
|
18
|
+
'api-operation': 'raspberry',
|
|
19
|
+
};
|
|
20
|
+
const getEntityTagColor = (type) => {
|
|
21
|
+
const color = entityTagColorMap[type];
|
|
22
|
+
if (!color) {
|
|
23
|
+
throw new Error(`Unhandled entity type: ${type}`);
|
|
24
|
+
}
|
|
25
|
+
return color;
|
|
26
|
+
};
|
|
27
|
+
exports.getEntityTagColor = getEntityTagColor;
|
|
28
|
+
function CatalogEntityTypeTag({ entityType }) {
|
|
29
|
+
return (react_1.default.createElement(EntityTypeTagWrapper, { color: (0, exports.getEntityTagColor)(entityType) }, entityType));
|
|
30
|
+
}
|
|
31
|
+
const EntityTypeTagWrapper = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
32
|
+
font-size: var(--font-size-base);
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
text-transform: lowercase;
|
|
35
|
+
`;
|
|
36
|
+
//# sourceMappingURL=CatalogEntityTypeTag.js.map
|
|
@@ -8,12 +8,12 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const utils_1 = require("../../core/utils");
|
|
10
10
|
const H3_1 = require("../../components/Typography/H3");
|
|
11
|
-
const
|
|
11
|
+
const Tag_1 = require("../../components/Tag/Tag");
|
|
12
12
|
function CatalogPageDescription({ title, titleTranslationKey, description, descriptionTranslationKey, tag, }) {
|
|
13
13
|
return (react_1.default.createElement(CatalogPageDescriptionWrapper, null,
|
|
14
14
|
react_1.default.createElement(CatalogTitleWrapper, null,
|
|
15
15
|
react_1.default.createElement(CatalogTitle, { "data-translation-key": titleTranslationKey }, title),
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(Tag_1.Tag, { borderless: true, textTransform: "none" }, tag)),
|
|
17
17
|
react_1.default.createElement(CatalogDescription, { "data-translation-key": descriptionTranslationKey }, description)));
|
|
18
18
|
}
|
|
19
19
|
const CatalogPageDescriptionWrapper = styled_components_1.default.div `
|