@redocly/theme 0.58.0-next.0 → 0.58.0-next.2
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/Buttons/CopyButton.d.ts +1 -0
- package/lib/components/Buttons/CopyButton.js +3 -3
- package/lib/components/Catalog/Catalog.js +14 -2
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntitiesEmptyState.js +32 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +3 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +13 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +6 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +6 -10
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +5 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +23 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +27 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +11 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +2 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +5 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +64 -30
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +2 -2
- package/lib/components/Catalog/variables.js +1 -1
- package/lib/components/Filter/FilterContent.d.ts +1 -1
- package/lib/core/constants/catalog.d.ts +1 -0
- package/lib/core/constants/catalog.js +28 -1
- package/lib/core/hooks/catalog/useCatalogEntitySchema.d.ts +11 -0
- package/lib/core/hooks/catalog/useCatalogEntitySchema.js +39 -0
- package/lib/core/types/catalog.d.ts +7 -0
- package/lib/core/types/filter.d.ts +1 -1
- package/lib/core/utils/change-text-casing.d.ts +1 -1
- package/lib/core/utils/change-text-casing.js +3 -0
- package/lib/ext/configure.d.ts +1 -0
- package/lib/ext/configure.js +4 -1
- package/lib/ext/useConfigureReplay.d.ts +18 -0
- package/lib/ext/useConfigureReplay.js +64 -0
- package/package.json +4 -3
- package/src/components/Buttons/CopyButton.tsx +4 -1
- package/src/components/Catalog/Catalog.tsx +15 -2
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +39 -16
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +42 -14
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +8 -6
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +15 -14
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +6 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +125 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +5 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +30 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +3 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -13
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +71 -23
- package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +3 -3
- package/src/components/Catalog/variables.ts +1 -1
- package/src/components/Filter/FilterContent.tsx +3 -1
- package/src/core/constants/catalog.ts +28 -0
- package/src/core/hooks/catalog/useCatalogEntitySchema.ts +46 -0
- package/src/core/types/catalog.ts +9 -0
- package/src/core/types/filter.ts +3 -1
- package/src/core/utils/change-text-casing.ts +8 -1
- package/src/ext/configure.ts +5 -1
- package/src/ext/useConfigureReplay.ts +83 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.d.ts +0 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +0 -32
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +0 -46
|
@@ -17,5 +17,6 @@ export type CopyButtonProps = {
|
|
|
17
17
|
fullWidth?: ButtonProps['fullWidth'];
|
|
18
18
|
tone?: ButtonProps['tone'];
|
|
19
19
|
extraClass?: ButtonProps['extraClass'];
|
|
20
|
+
iconPosition?: ButtonProps['iconPosition'];
|
|
20
21
|
};
|
|
21
22
|
export declare const CopyButton: React.NamedExoticComponent<CopyButtonProps>;
|
|
@@ -30,7 +30,7 @@ const hooks_1 = require("../../core/hooks");
|
|
|
30
30
|
const Button_1 = require("../../components/Button/Button");
|
|
31
31
|
const CopyIcon_1 = require("../../icons/CopyIcon/CopyIcon");
|
|
32
32
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
33
|
-
function CopyButtonComponent({ data, type = 'icon', toasterPlacement = 'top', toasterText, toasterDuration, buttonText, onCopyClick, dataTestId = 'copy-button', className, variant = 'text', size = 'small', disabled, fullWidth, tone, extraClass, }) {
|
|
33
|
+
function CopyButtonComponent({ data, type = 'icon', toasterPlacement = 'top', toasterText, toasterDuration, buttonText, onCopyClick, dataTestId = 'copy-button', className, variant = 'text', size = 'small', disabled, fullWidth, tone, extraClass, iconPosition, }) {
|
|
34
34
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
35
35
|
const tooltip = (0, hooks_1.useControl)();
|
|
36
36
|
const { translate } = useTranslate();
|
|
@@ -47,8 +47,8 @@ function CopyButtonComponent({ data, type = 'icon', toasterPlacement = 'top', to
|
|
|
47
47
|
onCopyClick === null || onCopyClick === void 0 ? void 0 : onCopyClick(e);
|
|
48
48
|
};
|
|
49
49
|
return (react_1.default.createElement(Tooltip_1.Tooltip, { className: `copy-button ${className ? className : ''}`, tip: translate('codeSnippet.copy.buttonText', toasterText || 'Copied!'), isOpen: tooltip.isOpened, placement: toasterPlacement, width: "fit-content" },
|
|
50
|
-
react_1.default.createElement(Button_1.Button, { "data-component-name": "Buttons/CopyButton", onClick: (e) => copy(e, toasterDuration), "data-testid": dataTestId, icon: type === 'icon' || type === 'compound' ? react_1.default.createElement(CopyIcon_1.CopyIcon, null) : undefined, size: size, variant: variant, disabled: disabled, fullWidth: fullWidth, tone: tone, extraClass: extraClass }, (type === 'text' || type === 'compound') &&
|
|
51
|
-
translate('codeSnippet.copy.toasterText',
|
|
50
|
+
react_1.default.createElement(Button_1.Button, { "data-component-name": "Buttons/CopyButton", onClick: (e) => copy(e, toasterDuration), "data-testid": dataTestId, icon: type === 'icon' || type === 'compound' ? react_1.default.createElement(CopyIcon_1.CopyIcon, null) : undefined, size: size, variant: variant, disabled: disabled, fullWidth: fullWidth, tone: tone, extraClass: extraClass, iconPosition: iconPosition }, (type === 'text' || type === 'compound') &&
|
|
51
|
+
(buttonText || translate('codeSnippet.copy.toasterText', 'Copy')))));
|
|
52
52
|
}
|
|
53
53
|
exports.CopyButton = (0, react_1.memo)(CopyButtonComponent);
|
|
54
54
|
//# sourceMappingURL=CopyButton.js.map
|
|
@@ -18,6 +18,19 @@ const FilterInput_1 = require("../../components/Filter/FilterInput");
|
|
|
18
18
|
const CatalogViewModeToggle_1 = require("../../components/Catalog/CatalogViewModeToggle");
|
|
19
19
|
const CatalogSortButton_1 = require("../../components/Catalog/CatalogSortButton");
|
|
20
20
|
const CatalogEntities_1 = require("../../components/Catalog/CatalogEntities");
|
|
21
|
+
const customCatalogOptionsCasing = (str) => {
|
|
22
|
+
if (!str)
|
|
23
|
+
return str;
|
|
24
|
+
const words = str.split(/[\s-_]+/);
|
|
25
|
+
return words
|
|
26
|
+
.map((word, index) => {
|
|
27
|
+
if (index === 0 && word.toLowerCase() === 'api') {
|
|
28
|
+
return 'API';
|
|
29
|
+
}
|
|
30
|
+
return word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
31
|
+
})
|
|
32
|
+
.join(' ');
|
|
33
|
+
};
|
|
21
34
|
function Catalog(props) {
|
|
22
35
|
const { catalogConfig, entitiesTypes, initialEntitiesList, catalogSwitcherItems } = props;
|
|
23
36
|
const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
|
|
@@ -25,7 +38,7 @@ function Catalog(props) {
|
|
|
25
38
|
const { filters, searchQuery, setSearchQuery, filterQuery, sortOption, setSortOption, handleSortClick, isColumnSorted, viewMode, setViewMode, entitiesCounter, setEntitiesCounter, onChangeViewClick, onChangeCollapseSidebarClick, layout, collapsedSidebar, } = useCatalog(catalogConfig, (initialEntitiesList === null || initialEntitiesList === void 0 ? void 0 : initialEntitiesList.page.total) || 0);
|
|
26
39
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
40
|
react_1.default.createElement(CatalogPageWrapper, { "data-component-name": "Catalog/Catalog" },
|
|
28
|
-
react_1.default.createElement(FiltersSidebar, { collapsed: collapsedSidebar, header: collapsedSidebar ? null : (react_1.default.createElement(CatalogSelector_1.CatalogSelector, { catalogSwitcherItems: catalogSwitcherItems, setSearchQuery: setSearchQuery, setSortOption: setSortOption })), menu: react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setSearchQuery, filters: filters, filterTerm: searchQuery, hideSearch: true, showCounter: false, filterValuesCasing:
|
|
41
|
+
react_1.default.createElement(FiltersSidebar, { collapsed: collapsedSidebar, header: collapsedSidebar ? null : (react_1.default.createElement(CatalogSelector_1.CatalogSelector, { catalogSwitcherItems: catalogSwitcherItems, setSearchQuery: setSearchQuery, setSortOption: setSortOption })), menu: react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setSearchQuery, filters: filters, filterTerm: searchQuery, hideSearch: true, showCounter: false, filterValuesCasing: customCatalogOptionsCasing }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
|
|
29
42
|
react_1.default.createElement(CatalogPageContent, null,
|
|
30
43
|
react_1.default.createElement(CatalogPageDescription, null,
|
|
31
44
|
react_1.default.createElement(CatalogTitleWrapper, null,
|
|
@@ -113,7 +126,6 @@ const CatalogPageWrapper = styled_components_1.default.div `
|
|
|
113
126
|
}
|
|
114
127
|
`;
|
|
115
128
|
const CatalogPageDescription = styled_components_1.default.div `
|
|
116
|
-
margin: var(--catalog-heading-margin);
|
|
117
129
|
display: var(--catalog-page-description-display-mobile);
|
|
118
130
|
|
|
119
131
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
+
import type { ListType } from '../../core/types';
|
|
2
3
|
interface CatalogEntitiesEmptyStateProps {
|
|
3
|
-
listType?:
|
|
4
|
+
listType?: ListType;
|
|
4
5
|
}
|
|
5
6
|
export declare function CatalogEntitiesEmptyState({ listType, }: CatalogEntitiesEmptyStateProps): JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -7,21 +7,42 @@ exports.CatalogEntitiesEmptyState = CatalogEntitiesEmptyState;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const HexagonIcon_1 = require("../../icons/HexagonIcon/HexagonIcon");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const getEmptyStateContent = (listType) => {
|
|
11
|
+
switch (listType) {
|
|
12
|
+
case 'team':
|
|
13
|
+
return {
|
|
14
|
+
header: 'No team members yet',
|
|
15
|
+
paragraph1: 'Your team members will appear here',
|
|
16
|
+
paragraph2: "once they've been added to the team.",
|
|
17
|
+
};
|
|
18
|
+
case 'api-operation':
|
|
19
|
+
return {
|
|
20
|
+
header: 'No operations yet',
|
|
21
|
+
paragraph1: 'Your operations will appear here',
|
|
22
|
+
paragraph2: "once they've been added to the API description.",
|
|
23
|
+
};
|
|
24
|
+
case 'data-schema':
|
|
25
|
+
return {
|
|
26
|
+
header: 'No schemas yet',
|
|
27
|
+
paragraph1: 'Your schemas will appear here',
|
|
28
|
+
paragraph2: "once they've been added to the API description.",
|
|
29
|
+
};
|
|
30
|
+
default:
|
|
31
|
+
return {
|
|
32
|
+
header: 'No entities found',
|
|
33
|
+
paragraph1: 'Try adjusting your search criteria or',
|
|
34
|
+
paragraph2: 'check back later for new additions.',
|
|
35
|
+
};
|
|
18
36
|
}
|
|
37
|
+
};
|
|
38
|
+
function CatalogEntitiesEmptyState({ listType = 'default', }) {
|
|
39
|
+
const { header, paragraph1, paragraph2 } = getEmptyStateContent(listType);
|
|
19
40
|
return (react_1.default.createElement(EmptyStateWrapper, { "data-component-name": "Catalog/CatalogEntitiesEmptyState" },
|
|
20
41
|
react_1.default.createElement(EmptyStateIconWrapper, null,
|
|
21
42
|
react_1.default.createElement(HexagonIcon_1.HexagonIcon, { size: "21px", color: "var(--color-warm-grey-7)" })),
|
|
22
|
-
react_1.default.createElement(EmptyStateHeader, null,
|
|
23
|
-
react_1.default.createElement(EmptyStateText, null,
|
|
24
|
-
react_1.default.createElement(EmptyStateText, null,
|
|
43
|
+
react_1.default.createElement(EmptyStateHeader, null, header),
|
|
44
|
+
react_1.default.createElement(EmptyStateText, null, paragraph1),
|
|
45
|
+
react_1.default.createElement(EmptyStateText, null, paragraph2)));
|
|
25
46
|
}
|
|
26
47
|
const EmptyStateWrapper = styled_components_1.default.div `
|
|
27
48
|
display: flex;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
-
import type { BffCatalogEntity, BffCatalogRelatedEntityList } from '../../../core/types';
|
|
4
2
|
export type CatalogEntityProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
catalogConfig: CatalogEntityConfig;
|
|
8
|
-
initialRelations: BffCatalogRelatedEntityList;
|
|
3
|
+
RedocSchema: React.ComponentType<any>;
|
|
4
|
+
StoreProvider: React.ComponentType<any>;
|
|
9
5
|
};
|
|
10
|
-
export declare function CatalogEntity({
|
|
6
|
+
export declare function CatalogEntity({ RedocSchema, StoreProvider }: CatalogEntityProps): React.JSX.Element;
|
|
@@ -18,20 +18,25 @@ const hooks_1 = require("../../../core/hooks");
|
|
|
18
18
|
const CatalogEntitySchema_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntitySchema");
|
|
19
19
|
const CatalogEntityMethodAndPath_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityMethodAndPath");
|
|
20
20
|
const CatalogEntityRelationsGraph_lazy_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy");
|
|
21
|
-
const
|
|
21
|
+
const renderFirstColumnEntitySection = (entity) => {
|
|
22
22
|
switch (entity.type) {
|
|
23
|
-
case 'data-schema':
|
|
24
|
-
return react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity });
|
|
25
23
|
case 'api-operation':
|
|
26
24
|
return react_1.default.createElement(CatalogEntityMethodAndPath_1.CatalogEntityMethodAndPath, { entity: entity });
|
|
27
25
|
default:
|
|
28
26
|
return react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity });
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
|
-
|
|
29
|
+
const renderDataSchemaSection = (entity, relatedEntity, RedocSchema, StoreProvider) => {
|
|
30
|
+
if (entity.type !== 'data-schema') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return (react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity, relatedEntity: relatedEntity, RedocSchema: RedocSchema, StoreProvider: StoreProvider }));
|
|
34
|
+
};
|
|
35
|
+
function CatalogEntity({ RedocSchema, StoreProvider }) {
|
|
32
36
|
var _a;
|
|
33
|
-
const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
|
|
37
|
+
const { useTranslate, useCatalog, usePageProps } = (0, hooks_1.useThemeHooks)();
|
|
34
38
|
const { translate } = useTranslate();
|
|
39
|
+
const { entity, relations, catalogConfig, entitiesCatalogConfig, relatedEntity } = usePageProps();
|
|
35
40
|
const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
|
|
36
41
|
const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
|
|
37
42
|
const { searchQuery, setSearchQuery } = useCatalog();
|
|
@@ -47,10 +52,11 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
|
|
|
47
52
|
react_1.default.createElement(react_router_dom_1.Route, { index: true, element: react_1.default.createElement(react_1.default.Fragment, null,
|
|
48
53
|
react_1.default.createElement(CatalogPageDescription_1.CatalogPageDescription, { title: entity.title, description: (_a = entity.summary) !== null && _a !== void 0 ? _a : '', tag: entity.key }),
|
|
49
54
|
react_1.default.createElement(CatalogEntityProperties_1.CatalogEntityProperties, { entity: entity }),
|
|
55
|
+
renderDataSchemaSection(entity, relatedEntity, RedocSchema, StoreProvider),
|
|
50
56
|
react_1.default.createElement(CatalogTwoColumnsSection, null,
|
|
51
|
-
|
|
57
|
+
renderFirstColumnEntitySection(entity),
|
|
52
58
|
react_1.default.createElement(CatalogEntityLinks_1.CatalogEntityLinks, { entity: entity })),
|
|
53
|
-
react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations:
|
|
59
|
+
react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: relations, searchQuery: searchQuery, setSearchQuery: setSearchQuery })) }),
|
|
54
60
|
react_1.default.createElement(react_router_dom_1.Route, { path: "relations-graph", element: react_1.default.createElement(CatalogEntityRelationsGraph_lazy_1.CatalogEntityRelationsGraph, { entity: entity }) })))))));
|
|
55
61
|
}
|
|
56
62
|
const CatalogPageWrapper = styled_components_1.default.div `
|
|
@@ -58,12 +58,12 @@ function renderMetadataValue(value) {
|
|
|
58
58
|
function CatalogEntityMetadata({ entity }) {
|
|
59
59
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
60
60
|
const { translate } = useTranslate();
|
|
61
|
-
const _a = entity.metadata || {}, { schema } = _a,
|
|
62
|
-
const
|
|
61
|
+
const _a = entity.metadata || {}, { schema } = _a, metadata = __rest(_a, ["schema"]);
|
|
62
|
+
const metadataToShow = Object.entries(metadata).filter(([key]) => !(entity.type === 'api-description' && key === 'descriptionFile'));
|
|
63
63
|
const [isOn, setIsOn] = (0, react_1.useState)(false);
|
|
64
|
-
const hasMoreItems =
|
|
65
|
-
const visibleMetadata = isOn ?
|
|
66
|
-
if (!
|
|
64
|
+
const hasMoreItems = metadataToShow.length > MAX_INITIAL_ITEMS;
|
|
65
|
+
const visibleMetadata = isOn ? metadataToShow : metadataToShow.slice(0, MAX_INITIAL_ITEMS);
|
|
66
|
+
if (!metadataToShow.length) {
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
69
|
return (react_1.default.createElement(MetadataWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityMetadata" },
|
|
@@ -101,7 +101,7 @@ const ArrayWrapper = styled_components_1.default.div `
|
|
|
101
101
|
flex-direction: column;
|
|
102
102
|
`;
|
|
103
103
|
const Heading = styled_components_1.default.h2 `
|
|
104
|
-
margin-bottom: var(--spacing-
|
|
104
|
+
margin-bottom: var(--spacing-sm);
|
|
105
105
|
margin-top: 0;
|
|
106
106
|
font-size: var(--catalog-metadata-heading-size);
|
|
107
107
|
`;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js
CHANGED
|
@@ -9,7 +9,6 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const EntityTypeProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty");
|
|
10
10
|
const GitProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty");
|
|
11
11
|
const TagsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty");
|
|
12
|
-
const ApiDescriptionProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty");
|
|
13
12
|
const UserEmailProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty");
|
|
14
13
|
const DomainsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty");
|
|
15
14
|
const OwnersProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty");
|
|
@@ -41,11 +40,6 @@ const propertyRenderers = [
|
|
|
41
40
|
condition: (entity) => { var _a; return !!((_a = entity.tags) === null || _a === void 0 ? void 0 : _a.length); },
|
|
42
41
|
component: TagsProperty_1.TagsProperty,
|
|
43
42
|
},
|
|
44
|
-
{
|
|
45
|
-
key: 'api-description',
|
|
46
|
-
condition: (entity) => { var _a; return entity.type === 'api-description' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.descriptionFile); },
|
|
47
|
-
component: ApiDescriptionProperty_1.ApiDescriptionProperty,
|
|
48
|
-
},
|
|
49
43
|
{
|
|
50
44
|
key: 'user-email',
|
|
51
45
|
condition: (entity) => { var _a; return entity.type === 'user' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.email); },
|
|
@@ -63,13 +57,15 @@ const propertyRenderers = [
|
|
|
63
57
|
},
|
|
64
58
|
];
|
|
65
59
|
function CatalogEntityProperties({ entity }) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
const renderers = propertyRenderers.filter((renderer) => renderer.condition(entity));
|
|
61
|
+
const gridTemplateColumns = [1, 2, 4].includes(renderers.length)
|
|
62
|
+
? 'repeat(2, 1fr)'
|
|
63
|
+
: 'repeat(3, 1fr)';
|
|
64
|
+
return (react_1.default.createElement(CatalogEntityPropertiesGridWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties", gridTemplateColumns: gridTemplateColumns }, renderers.map((renderer) => (react_1.default.createElement(renderer.component, { key: renderer.key + entity.id, entity: entity })))));
|
|
69
65
|
}
|
|
70
66
|
const CatalogEntityPropertiesGridWrapper = styled_components_1.default.div `
|
|
71
67
|
display: grid;
|
|
72
|
-
grid-template-columns:
|
|
68
|
+
grid-template-columns: ${({ gridTemplateColumns }) => gridTemplateColumns};
|
|
73
69
|
gap: var(--spacing-base);
|
|
74
70
|
`;
|
|
75
71
|
//# sourceMappingURL=CatalogEntityProperties.js.map
|
|
@@ -14,6 +14,10 @@ function ContactProperty({ entity }) {
|
|
|
14
14
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty" },
|
|
15
15
|
react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
16
|
react_1.default.createElement(SlackIcon_1.SlackIcon, null),
|
|
17
|
-
"Slack channels"), content: react_1.default.createElement(react_1.default.Fragment, null, channels === null || channels === void 0 ? void 0 : channels.map((channel) => (react_1.default.createElement(Tag_1.Tag, { key: channel.name, textTransform: "none", style: { backgroundColor: 'var(--bg-color)'
|
|
17
|
+
"Slack channels"), content: react_1.default.createElement(react_1.default.Fragment, null, channels === null || channels === void 0 ? void 0 : channels.map((channel) => (react_1.default.createElement(Tag_1.Tag, { key: channel.name, textTransform: "none", style: { backgroundColor: 'var(--bg-color)', cursor: 'pointer' }, onClick: () => {
|
|
18
|
+
if (channel.url) {
|
|
19
|
+
window.open(channel.url, '_blank');
|
|
20
|
+
}
|
|
21
|
+
} }, channel.name)))) })));
|
|
18
22
|
}
|
|
19
23
|
//# sourceMappingURL=ContactProperty.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
+
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '../../../../core/types';
|
|
4
|
+
export type CatalogEntityApiDescriptionRelationsProps = {
|
|
5
|
+
entity: BffCatalogEntity;
|
|
6
|
+
catalogConfig: CatalogEntityConfig;
|
|
7
|
+
entitiesCatalogConfig: EntitiesCatalogConfig;
|
|
8
|
+
relations: BffCatalogRelatedEntity[];
|
|
9
|
+
query: {
|
|
10
|
+
fetchNextPage: () => void;
|
|
11
|
+
isFetchingNextPage: boolean;
|
|
12
|
+
hasNextPage: boolean;
|
|
13
|
+
};
|
|
14
|
+
searchQuery: string;
|
|
15
|
+
setSearchQuery: (query: string) => void;
|
|
16
|
+
setFilter: (filter?: string) => void;
|
|
17
|
+
sortOption: SortOption | null;
|
|
18
|
+
setSortOption: (sortOption: SortOption | null) => void;
|
|
19
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
20
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
21
|
+
shouldShowLoadMore: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function CatalogEntityApiDescriptionRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }: CatalogEntityApiDescriptionRelationsProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
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.CatalogEntityApiDescriptionRelations = CatalogEntityApiDescriptionRelations;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Tabs_1 = require("../../../../markdoc/components/Tabs/Tabs");
|
|
10
|
+
const EntityTypeIcon_1 = require("../../../../icons/EntityTypeIcon/EntityTypeIcon");
|
|
11
|
+
const CatalogEntityDefaultRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations");
|
|
12
|
+
const MoleculesIcon_1 = require("../../../../icons/MoleculesIcon/MoleculesIcon");
|
|
13
|
+
const NetworkIcon_1 = require("../../../../icons/NetworkIcon/NetworkIcon");
|
|
14
|
+
function CatalogEntityApiDescriptionRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
15
|
+
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations" },
|
|
16
|
+
react_1.default.createElement(Tabs_1.Tabs, { forceReady: relations.length > 0, size: Tabs_1.TabsSize.MEDIUM },
|
|
17
|
+
react_1.default.createElement(TabItem, { label: "Operations", icon: react_1.default.createElement(MoleculesIcon_1.MoleculesIcon, null), onClick: () => setFilter('type:api-operation') },
|
|
18
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "operations-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, shouldShowHeading: false, listType: "api-operation" })),
|
|
19
|
+
react_1.default.createElement(TabItem, { label: "Schemas", icon: react_1.default.createElement(NetworkIcon_1.NetworkIcon, null), onClick: () => setFilter('type:data-schema') },
|
|
20
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "schemas-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, shouldShowHeading: false, listType: "data-schema" })),
|
|
21
|
+
react_1.default.createElement(TabItem, { label: "Related entities", icon: react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null), onClick: () => setFilter('-type:api-operation,data-schema') },
|
|
22
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "related-entities-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, shouldShowHeading: false })))));
|
|
23
|
+
}
|
|
24
|
+
const TabItem = styled_components_1.default.div `
|
|
25
|
+
padding: var(--spacing-sm);
|
|
26
|
+
`;
|
|
27
|
+
//# sourceMappingURL=CatalogEntityApiDescriptionRelations.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
+
import type { ListType } from '../../../../core/types';
|
|
3
4
|
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '../../../../core/types';
|
|
4
5
|
export type CatalogEntityDefaultRelationsProps = {
|
|
5
6
|
entity: BffCatalogEntity;
|
|
@@ -12,12 +13,12 @@ export type CatalogEntityDefaultRelationsProps = {
|
|
|
12
13
|
};
|
|
13
14
|
searchQuery: string;
|
|
14
15
|
setSearchQuery: (query: string) => void;
|
|
15
|
-
setFilter: (filter: string) => void;
|
|
16
16
|
sortOption: SortOption | null;
|
|
17
17
|
setSortOption: (sortOption: SortOption | null) => void;
|
|
18
18
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
19
19
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
20
20
|
shouldShowLoadMore: boolean;
|
|
21
21
|
shouldShowHeading?: boolean;
|
|
22
|
+
listType?: ListType;
|
|
22
23
|
};
|
|
23
|
-
export declare function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, shouldShowHeading, }: CatalogEntityDefaultRelationsProps): JSX.Element;
|
|
24
|
+
export declare function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, shouldShowHeading, listType, }: CatalogEntityDefaultRelationsProps): JSX.Element;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js
CHANGED
|
@@ -33,8 +33,8 @@ const columns = [
|
|
|
33
33
|
width: '1fr',
|
|
34
34
|
},
|
|
35
35
|
];
|
|
36
|
-
function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, shouldShowHeading = true, }) {
|
|
36
|
+
function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, shouldShowHeading = true, listType, }) {
|
|
37
37
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations" },
|
|
38
|
-
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: shouldShowHeading ? 'Related entities' : undefined, columns: columns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
|
|
38
|
+
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: shouldShowHeading ? 'Related entities' : undefined, columns: columns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, listType: listType })));
|
|
39
39
|
}
|
|
40
40
|
//# sourceMappingURL=CatalogEntityDefaultRelations.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js
CHANGED
|
@@ -28,19 +28,25 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
const hooks_1 = require("../../../../core/hooks");
|
|
29
29
|
const CatalogEntityDefaultRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations");
|
|
30
30
|
const CatalogEntityTeamRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations");
|
|
31
|
+
const CatalogEntityApiDescriptionRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations");
|
|
31
32
|
const LOAD_MORE_THRESHOLD = 10;
|
|
32
33
|
const ENTITY_DEFAULT_FILTERS = {
|
|
33
34
|
team: 'type:user',
|
|
35
|
+
'api-description': 'type:api-operation',
|
|
34
36
|
};
|
|
35
37
|
function CatalogEntityRelations({ entity, entitiesCatalogConfig, initialRelations, catalogConfig, searchQuery, setSearchQuery, }) {
|
|
36
38
|
const { useCatalogSort, useFetchCatalogEntitiesRelations } = (0, hooks_1.useThemeHooks)();
|
|
37
39
|
const { sortOption, setSortOption, handleSortClick, isColumnSorted } = useCatalogSort();
|
|
38
|
-
const [filter, setFilter] = (0, react_1.useState)();
|
|
40
|
+
const [filter, setFilter] = (0, react_1.useState)(ENTITY_DEFAULT_FILTERS[entity.type]);
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
setFilter(ENTITY_DEFAULT_FILTERS[entity.key]);
|
|
43
|
+
}, [entity.key]);
|
|
39
44
|
const { items: relations, query } = useFetchCatalogEntitiesRelations({
|
|
40
45
|
entityKey: entity.key,
|
|
41
46
|
search: searchQuery,
|
|
42
47
|
sort: sortOption !== null && sortOption !== void 0 ? sortOption : undefined,
|
|
43
48
|
filter: filter !== null && filter !== void 0 ? filter : ENTITY_DEFAULT_FILTERS[entity.type],
|
|
49
|
+
limit: 10,
|
|
44
50
|
}, initialRelations);
|
|
45
51
|
const shouldShowLoadMore = query.hasNextPage ||
|
|
46
52
|
(query.isPlaceholderData && relations && relations.length >= LOAD_MORE_THRESHOLD);
|
|
@@ -48,9 +54,12 @@ function CatalogEntityRelations({ entity, entitiesCatalogConfig, initialRelation
|
|
|
48
54
|
case 'team':
|
|
49
55
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations/CatalogEntityTeamRelations" },
|
|
50
56
|
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 })));
|
|
57
|
+
case 'api-description':
|
|
58
|
+
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations/CatalogEntityApiDescriptionRelations" },
|
|
59
|
+
react_1.default.createElement(CatalogEntityApiDescriptionRelations_1.CatalogEntityApiDescriptionRelations, { 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 })));
|
|
51
60
|
default:
|
|
52
61
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations/CatalogEntityDefaultRelations" },
|
|
53
|
-
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery,
|
|
62
|
+
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 })));
|
|
54
63
|
}
|
|
55
64
|
}
|
|
56
65
|
//# sourceMappingURL=CatalogEntityRelations.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
+
import type { ListType } from '../../../../core/types';
|
|
3
4
|
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '../../../../core/types';
|
|
4
5
|
import { CatalogColumn } from '../../../../components/Catalog/CatalogTableView/CatalogTableView';
|
|
5
6
|
export type CatalogEntityRelationsTableProps = {
|
|
@@ -20,6 +21,6 @@ export type CatalogEntityRelationsTableProps = {
|
|
|
20
21
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
21
22
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
22
23
|
shouldShowLoadMore: boolean;
|
|
23
|
-
listType?:
|
|
24
|
+
listType?: ListType;
|
|
24
25
|
};
|
|
25
26
|
export declare function CatalogEntityRelationsTable({ entitiesCatalogConfig, catalogConfig, relations, query, searchQuery, setSearchQuery, heading, columns, setSortOption, sortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, listType, }: CatalogEntityRelationsTableProps): JSX.Element;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.CatalogEntityRelationsTable = CatalogEntityRelationsTable;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const CatalogActionsRow_1 = require("../../../../components/Catalog/CatalogActionsRow");
|
|
10
|
-
const CatalogEntityRelationsTableContent_1 = require("
|
|
10
|
+
const CatalogEntityRelationsTableContent_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent");
|
|
11
11
|
function CatalogEntityRelationsTable({ entitiesCatalogConfig, catalogConfig, relations, query, searchQuery, setSearchQuery, heading, columns, setSortOption, sortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, listType, }) {
|
|
12
12
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable" },
|
|
13
13
|
heading && react_1.default.createElement(Heading, null, heading),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
+
import type { ListType } from '../../../../core/types';
|
|
3
4
|
import { BffCatalogRelatedEntity, SortOption } from '../../../../core/types';
|
|
4
5
|
import { CatalogColumn } from '../../../../components/Catalog/CatalogTableView/CatalogTableView';
|
|
5
6
|
export type CatalogEntityRelationsTableContentProps = {
|
|
@@ -17,6 +18,6 @@ export type CatalogEntityRelationsTableContentProps = {
|
|
|
17
18
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
18
19
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
19
20
|
shouldShowLoadMore: boolean;
|
|
20
|
-
listType?:
|
|
21
|
+
listType?: ListType;
|
|
21
22
|
};
|
|
22
23
|
export declare function CatalogEntityRelationsTableContent({ entitiesCatalogConfig, catalogConfig, relations, query, searchQuery, columns, setSortOption, sortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, listType, }: CatalogEntityRelationsTableContentProps): JSX.Element;
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js
CHANGED
|
@@ -13,7 +13,6 @@ 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");
|
|
17
16
|
const teamColumns = [
|
|
18
17
|
{
|
|
19
18
|
key: 'entity',
|
|
@@ -32,11 +31,6 @@ const teamColumns = [
|
|
|
32
31
|
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); },
|
|
33
32
|
width: '2fr',
|
|
34
33
|
},
|
|
35
|
-
{
|
|
36
|
-
key: 'relationType',
|
|
37
|
-
title: 'Relations',
|
|
38
|
-
render: (entity) => (react_1.default.createElement(CatalogEntityRelationCell_1.CatalogEntityRelationCell, { relationType: entity.relationType, relationRole: entity.relationRole })),
|
|
39
|
-
},
|
|
40
34
|
{
|
|
41
35
|
key: 'description',
|
|
42
36
|
title: 'Description',
|
|
@@ -50,10 +44,10 @@ function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, set
|
|
|
50
44
|
react_1.default.createElement(TabItem, { label: "Members", icon: react_1.default.createElement(PeopleIcon_1.PeopleIcon, null), onClick: () => setFilter('type:user') },
|
|
51
45
|
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { key: "members-table", entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, columns: teamColumns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, listType: "team" })),
|
|
52
46
|
react_1.default.createElement(TabItem, { label: "Related entities", icon: react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null), onClick: () => setFilter('-type:user') },
|
|
53
|
-
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "related-entities-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery,
|
|
47
|
+
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "related-entities-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, shouldShowHeading: false })))));
|
|
54
48
|
}
|
|
55
49
|
const TabItem = styled_components_1.default.div `
|
|
56
|
-
padding:
|
|
50
|
+
padding: var(--spacing-sm);
|
|
57
51
|
`;
|
|
58
52
|
const EntityDescription = styled_components_1.default.div `
|
|
59
53
|
font-size: var(--catalog-table-entity-summary-font-size);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BffCatalogEntity } from '../../../core/types';
|
|
2
|
+
import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../../core/types';
|
|
3
3
|
export type CatalogEntitySchemaProps = {
|
|
4
4
|
entity: BffCatalogEntity;
|
|
5
|
+
relatedEntity: BffCatalogRelatedEntity | null;
|
|
6
|
+
RedocSchema: React.ComponentType<any>;
|
|
7
|
+
StoreProvider: React.ComponentType<any>;
|
|
5
8
|
};
|
|
6
|
-
export declare function CatalogEntitySchema({ entity }: CatalogEntitySchemaProps): React.JSX.Element
|
|
9
|
+
export declare function CatalogEntitySchema({ entity, relatedEntity, RedocSchema, StoreProvider, }: CatalogEntitySchemaProps): React.JSX.Element;
|