@openshift-migration-advisor/shared-components 0.0.0
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/LICENSE +13 -0
- package/README.md +76 -0
- package/dist/charts/MigrationDonutChart.d.ts +53 -0
- package/dist/charts/MigrationDonutChart.d.ts.map +1 -0
- package/dist/charts/MigrationDonutChart.js +186 -0
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +1 -0
- package/dist/forms/CheckboxFormGroup.d.ts +5 -0
- package/dist/forms/CheckboxFormGroup.d.ts.map +1 -0
- package/dist/forms/CheckboxFormGroup.js +14 -0
- package/dist/forms/FormFieldHelperText.d.ts +7 -0
- package/dist/forms/FormFieldHelperText.d.ts.map +1 -0
- package/dist/forms/FormFieldHelperText.js +8 -0
- package/dist/forms/RadioButtonFormGroup.d.ts +12 -0
- package/dist/forms/RadioButtonFormGroup.d.ts.map +1 -0
- package/dist/forms/RadioButtonFormGroup.js +12 -0
- package/dist/forms/SelectFormGroup.d.ts +8 -0
- package/dist/forms/SelectFormGroup.d.ts.map +1 -0
- package/dist/forms/SelectFormGroup.js +12 -0
- package/dist/forms/TextAreaFormGroup.d.ts +3 -0
- package/dist/forms/TextAreaFormGroup.d.ts.map +1 -0
- package/dist/forms/TextAreaFormGroup.js +12 -0
- package/dist/forms/TextInputFormGroup.d.ts +11 -0
- package/dist/forms/TextInputFormGroup.d.ts.map +1 -0
- package/dist/forms/TextInputFormGroup.js +16 -0
- package/dist/forms/index.d.ts +8 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +6 -0
- package/dist/forms/types.d.ts +11 -0
- package/dist/forms/types.d.ts.map +1 -0
- package/dist/forms/types.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/report/CardEmptyState.d.ts +8 -0
- package/dist/report/CardEmptyState.d.ts.map +1 -0
- package/dist/report/CardEmptyState.js +13 -0
- package/dist/report/DashboardEmptyStateBase.d.ts +8 -0
- package/dist/report/DashboardEmptyStateBase.d.ts.map +1 -0
- package/dist/report/DashboardEmptyStateBase.js +5 -0
- package/dist/report/EmptySearchResults.d.ts +7 -0
- package/dist/report/EmptySearchResults.d.ts.map +1 -0
- package/dist/report/EmptySearchResults.js +4 -0
- package/dist/report/OSDistribution.d.ts +14 -0
- package/dist/report/OSDistribution.d.ts.map +1 -0
- package/dist/report/OSDistribution.js +37 -0
- package/dist/report/OsSupportTiersHelpPopover.d.ts +3 -0
- package/dist/report/OsSupportTiersHelpPopover.d.ts.map +1 -0
- package/dist/report/OsSupportTiersHelpPopover.js +37 -0
- package/dist/report/OsUpgradeNotice.d.ts +3 -0
- package/dist/report/OsUpgradeNotice.d.ts.map +1 -0
- package/dist/report/OsUpgradeNotice.js +9 -0
- package/dist/report/OsUpgradeRecommendationPopover.d.ts +13 -0
- package/dist/report/OsUpgradeRecommendationPopover.d.ts.map +1 -0
- package/dist/report/OsUpgradeRecommendationPopover.js +24 -0
- package/dist/report/PopoverIcon.d.ts +11 -0
- package/dist/report/PopoverIcon.d.ts.map +1 -0
- package/dist/report/PopoverIcon.js +8 -0
- package/dist/report/SupportTierBadge.d.ts +9 -0
- package/dist/report/SupportTierBadge.d.ts.map +1 -0
- package/dist/report/SupportTierBadge.js +23 -0
- package/dist/report/constants.d.ts +11 -0
- package/dist/report/constants.d.ts.map +1 -0
- package/dist/report/constants.js +12 -0
- package/dist/report/dashboardStyles.d.ts +20 -0
- package/dist/report/dashboardStyles.d.ts.map +1 -0
- package/dist/report/dashboardStyles.js +99 -0
- package/dist/report/index.d.ts +15 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/index.js +13 -0
- package/dist/report/osSupportTier.d.ts +42 -0
- package/dist/report/osSupportTier.d.ts.map +1 -0
- package/dist/report/osSupportTier.js +106 -0
- package/dist/report/useOsBarChartViewModel.d.ts +26 -0
- package/dist/report/useOsBarChartViewModel.d.ts.map +1 -0
- package/dist/report/useOsBarChartViewModel.js +59 -0
- package/package.json +63 -0
- package/src/charts/MigrationDonutChart.tsx +398 -0
- package/src/charts/index.ts +5 -0
- package/src/forms/CheckboxFormGroup.tsx +53 -0
- package/src/forms/FormFieldHelperText.tsx +32 -0
- package/src/forms/RadioButtonFormGroup.tsx +62 -0
- package/src/forms/SelectFormGroup.tsx +57 -0
- package/src/forms/TextAreaFormGroup.tsx +43 -0
- package/src/forms/TextInputFormGroup.tsx +63 -0
- package/src/forms/index.ts +7 -0
- package/src/forms/types.ts +11 -0
- package/src/index.ts +3 -0
- package/src/report/CardEmptyState.tsx +30 -0
- package/src/report/DashboardEmptyStateBase.tsx +30 -0
- package/src/report/EmptySearchResults.tsx +14 -0
- package/src/report/OSDistribution.tsx +206 -0
- package/src/report/OsSupportTiersHelpPopover.tsx +87 -0
- package/src/report/OsUpgradeNotice.tsx +29 -0
- package/src/report/OsUpgradeRecommendationPopover.tsx +78 -0
- package/src/report/PopoverIcon.tsx +46 -0
- package/src/report/SupportTierBadge.tsx +55 -0
- package/src/report/__tests__/OSDistribution.test.tsx +236 -0
- package/src/report/__tests__/osSupportTier.test.ts +101 -0
- package/src/report/constants.ts +14 -0
- package/src/report/dashboardStyles.ts +116 -0
- package/src/report/index.ts +54 -0
- package/src/report/osSupportTier.ts +161 -0
- package/src/report/useOsBarChartViewModel.ts +115 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptySearchResults.d.ts","sourceRoot":"","sources":["../../src/report/EmptySearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAGA,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DashboardEmptyStateBase } from "./DashboardEmptyStateBase.js";
|
|
3
|
+
export const EmptySearchResults = ({ title = "No results found", body = "To continue, adjust your search or filters and try again", }) => _jsx(DashboardEmptyStateBase, { title: title, body: body });
|
|
4
|
+
EmptySearchResults.displayName = "EmptySearchResults";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { type OSDistributionEntry } from "./osSupportTier.js";
|
|
3
|
+
interface OSDistributionProps {
|
|
4
|
+
osData: Record<string, OSDistributionEntry>;
|
|
5
|
+
isExportMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const OSDistribution: FC<OSDistributionProps>;
|
|
8
|
+
interface OSBarChartProps {
|
|
9
|
+
osData: Record<string, OSDistributionEntry>;
|
|
10
|
+
isExportMode?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const OSBarChart: FC<OSBarChartProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=OSDistribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OSDistribution.d.ts","sourceRoot":"","sources":["../../src/report/OSDistribution.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,EAAE,EAAO,MAAM,OAAO,CAAC;AAQrC,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAyB5B,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyBlD,CAAC;AAEF,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAgH1C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { Card, CardBody, CardTitle, Flex, FlexItem, MenuToggle, SearchInput, Select, SelectList, SelectOption, Toolbar, ToolbarContent, ToolbarItem, } from "@patternfly/react-core";
|
|
4
|
+
import { DesktopIcon } from "@patternfly/react-icons";
|
|
5
|
+
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";
|
|
6
|
+
import { CardEmptyState } from "./CardEmptyState.js";
|
|
7
|
+
import { REPORT_CARD_EMPTY_STATE_TITLES } from "./constants.js";
|
|
8
|
+
import { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
|
|
9
|
+
import { EmptySearchResults } from "./EmptySearchResults.js";
|
|
10
|
+
import { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
|
|
11
|
+
import { OsUpgradeNotice } from "./OsUpgradeNotice.js";
|
|
12
|
+
import { OsNameCell } from "./OsUpgradeRecommendationPopover.js";
|
|
13
|
+
import { getSupportTierLegendLabel, ORDERED_SUPPORT_TIERS, } from "./osSupportTier.js";
|
|
14
|
+
import { SupportTierBadge } from "./SupportTierBadge.js";
|
|
15
|
+
import { ALL_TIERS_FILTER, useOsBarChartViewModel, } from "./useOsBarChartViewModel.js";
|
|
16
|
+
const filterToolbarStyle = css `
|
|
17
|
+
padding-left: 0;
|
|
18
|
+
padding-right: 0;
|
|
19
|
+
`;
|
|
20
|
+
const filterItemStyle = css `
|
|
21
|
+
flex: 1 1 0;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
`;
|
|
24
|
+
const vmsColumnStyle = css `
|
|
25
|
+
text-align: right;
|
|
26
|
+
`;
|
|
27
|
+
const tableScrollStyle = css `
|
|
28
|
+
overflow: auto;
|
|
29
|
+
`;
|
|
30
|
+
export const OSDistribution = ({ osData, isExportMode = false, }) => (_jsxs(Card, { className: isExportMode ? dashboardStyles.cardPrint : dashboardStyles.card, id: "os-distribution", children: [_jsx(CardTitle, { children: _jsxs(Flex, { alignItems: { default: "alignItemsCenter" }, spaceItems: { default: "spaceItemsSm" }, children: [_jsxs(FlexItem, { children: [_jsx(DesktopIcon, {}), " Operating Systems"] }), _jsx(FlexItem, { children: _jsx(OsSupportTiersHelpPopover, {}) })] }) }), _jsx(CardBody, { children: _jsx(OSBarChart, { osData: osData, isExportMode: isExportMode }) })] }));
|
|
31
|
+
export const OSBarChart = ({ osData, isExportMode = false, }) => {
|
|
32
|
+
const vm = useOsBarChartViewModel(osData);
|
|
33
|
+
if (vm.tableRows.length === 0) {
|
|
34
|
+
return (_jsx(CardEmptyState, { title: REPORT_CARD_EMPTY_STATE_TITLES.operatingSystems }));
|
|
35
|
+
}
|
|
36
|
+
return (_jsxs(_Fragment, { children: [!isExportMode ? (_jsx(Toolbar, { className: filterToolbarStyle, children: _jsxs(ToolbarContent, { children: [_jsx(ToolbarItem, { className: filterItemStyle, children: _jsx(SearchInput, { placeholder: "Filter by OS", value: vm.osFilter, onChange: (_event, value) => vm.setOsFilter(value), onClear: vm.clearOsFilter, "aria-label": "Filter operating systems by name" }) }), _jsx(ToolbarItem, { className: filterItemStyle, children: _jsx(Select, { isOpen: vm.isTierSelectOpen, selected: vm.tierFilter, onSelect: vm.handleTierSelect, onOpenChange: vm.setIsTierSelectOpen, toggle: (toggleRef) => (_jsx(MenuToggle, { ref: toggleRef, isExpanded: vm.isTierSelectOpen, onClick: vm.toggleTierSelectOpen, style: { width: "100%" }, children: vm.tierFilterLabel })), "aria-label": "Filter operating systems by support tier", children: _jsxs(SelectList, { children: [_jsx(SelectOption, { value: ALL_TIERS_FILTER, children: "All tiers" }), ORDERED_SUPPORT_TIERS.map((tier) => (_jsx(SelectOption, { value: tier, children: getSupportTierLegendLabel(tier) }, tier)))] }) }) })] }) })) : null, vm.showUpgradeNotice ? _jsx(OsUpgradeNotice, {}) : null, _jsx("div", { className: isExportMode ? undefined : tableScrollStyle, style: isExportMode ? undefined : { maxHeight: "350px" }, children: _jsxs(Table, { "aria-label": "Operating systems", variant: "compact", className: tableFullWidthStyle, children: [_jsx(Thead, { children: _jsxs(Tr, { children: [_jsx(Th, { children: "OS" }), _jsx(Th, { children: "Tier" }), _jsx(Th, { className: vmsColumnStyle, children: "VMs" })] }) }), _jsx(Tbody, { children: vm.showNoResults ? (_jsx(Tr, { children: _jsx(Td, { colSpan: 3, children: _jsx(EmptySearchResults, { title: "No matching operating system found" }) }) })) : (vm.filteredRows.map((row) => (_jsxs(Tr, { children: [_jsx(Td, { dataLabel: "OS", children: _jsx(OsNameCell, { osName: row.osName, upgradeRecommendation: row.upgradeRecommendation, isExportMode: isExportMode }) }), _jsx(Td, { dataLabel: "Tier", children: _jsx(SupportTierBadge, { tier: row.tier, isExportMode: isExportMode }) }), _jsx(Td, { dataLabel: "VMs", className: vmsColumnStyle, children: row.count })] }, row.osName)))) })] }) })] }));
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsSupportTiersHelpPopover.d.ts","sourceRoot":"","sources":["../../src/report/OsSupportTiersHelpPopover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAwEhC,eAAO,MAAM,yBAAyB,EAAE,EASvC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { Label } from "@patternfly/react-core";
|
|
4
|
+
import { ExternalLinkAltIcon } from "@patternfly/react-icons";
|
|
5
|
+
import { getSupportTierBadgeColor, getSupportTierDefinition, getSupportTierLegendLabel, ORDERED_SUPPORT_TIERS, SUPPORT_TIER_LEARN_MORE_URL, } from "./osSupportTier.js";
|
|
6
|
+
import PopoverIcon from "./PopoverIcon.js";
|
|
7
|
+
const tierListStyle = css `
|
|
8
|
+
list-style: none;
|
|
9
|
+
padding: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--pf-t--global--spacer--400);
|
|
14
|
+
`;
|
|
15
|
+
const tierItemStyle = css `
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--pf-t--global--spacer--100);
|
|
19
|
+
`;
|
|
20
|
+
const tierBadgeStyle = css `
|
|
21
|
+
width: fit-content;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
align-self: flex-start;
|
|
24
|
+
`;
|
|
25
|
+
const tierDescriptionStyle = css `
|
|
26
|
+
margin: 0;
|
|
27
|
+
color: var(--pf-t--global--text--color--regular);
|
|
28
|
+
`;
|
|
29
|
+
const learnMoreLinkStyle = css `
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--pf-t--global--spacer--xs);
|
|
33
|
+
margin-top: var(--pf-t--global--spacer--400);
|
|
34
|
+
`;
|
|
35
|
+
const OsSupportTiersHelpBody = () => (_jsxs("div", { children: [_jsx("ul", { className: tierListStyle, children: ORDERED_SUPPORT_TIERS.map((tier) => (_jsxs("li", { className: tierItemStyle, children: [_jsx(Label, { className: tierBadgeStyle, color: getSupportTierBadgeColor(tier), isCompact: true, children: getSupportTierLegendLabel(tier) }), _jsx("p", { className: tierDescriptionStyle, children: getSupportTierDefinition(tier) })] }, tier))) }), _jsxs("a", { className: learnMoreLinkStyle, href: SUPPORT_TIER_LEARN_MORE_URL, target: "_blank", rel: "noopener noreferrer", children: ["Learn more ", _jsx(ExternalLinkAltIcon, {})] })] }));
|
|
36
|
+
export const OsSupportTiersHelpPopover = () => (_jsx(PopoverIcon, { noVerticalAlign: true, maxWidth: "40rem", headerContent: "Guest OS support tiers", bodyContent: _jsx(OsSupportTiersHelpBody, {}), buttonOuiaId: "guest-os-support-tiers-help", "aria-label": "Guest OS support tiers help" }));
|
|
37
|
+
OsSupportTiersHelpPopover.displayName = "OsSupportTiersHelpPopover";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsUpgradeNotice.d.ts","sourceRoot":"","sources":["../../src/report/OsUpgradeNotice.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,eAAO,MAAM,eAAe,EAAE,EAiB7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { Content, Flex, FlexItem, Icon } from "@patternfly/react-core";
|
|
4
|
+
import { InfoCircleIcon } from "@patternfly/react-icons";
|
|
5
|
+
const noticeStyle = css `
|
|
6
|
+
margin-bottom: var(--pf-t--global--spacer--200);
|
|
7
|
+
`;
|
|
8
|
+
export const OsUpgradeNotice = () => (_jsxs(Flex, { alignItems: { default: "alignItemsCenter" }, spaceItems: { default: "spaceItemsSm" }, className: noticeStyle, children: [_jsx(FlexItem, { children: _jsx(Icon, { status: "info", children: _jsx(InfoCircleIcon, {}) }) }), _jsx(FlexItem, { children: _jsx(Content, { component: "p", style: { fontWeight: 500 }, children: "Some operating systems may need upgrades before migration" }) })] }));
|
|
9
|
+
OsUpgradeNotice.displayName = "OsUpgradeNotice";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
interface OsUpgradeRecommendationPopoverProps {
|
|
3
|
+
upgradeRecommendation: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const OsUpgradeRecommendationPopover: FC<OsUpgradeRecommendationPopoverProps>;
|
|
6
|
+
interface OsNameCellProps {
|
|
7
|
+
osName: string;
|
|
8
|
+
upgradeRecommendation?: string;
|
|
9
|
+
isExportMode?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const OsNameCell: FC<OsNameCellProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=OsUpgradeRecommendationPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsUpgradeRecommendationPopover.d.ts","sourceRoot":"","sources":["../../src/report/OsUpgradeRecommendationPopover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAchC,UAAU,mCAAmC;IAC3C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAC7C,mCAAmC,CAiBpC,CAAC;AAIF,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA0B1C,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { Button, Flex, FlexItem, Popover } from "@patternfly/react-core";
|
|
4
|
+
import { InfoCircleIcon } from "@patternfly/react-icons";
|
|
5
|
+
const upgradeRecommendationPopoverCloseButton = css `
|
|
6
|
+
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain,
|
|
7
|
+
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain:hover {
|
|
8
|
+
color: var(--pf-t--global--text--color--regular);
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
const infoButtonStyle = css `
|
|
12
|
+
padding: 0;
|
|
13
|
+
vertical-align: middle;
|
|
14
|
+
`;
|
|
15
|
+
export const OsUpgradeRecommendationPopover = ({ upgradeRecommendation }) => (_jsx(Popover, { className: upgradeRecommendationPopoverCloseButton, position: "bottom", headerContent: "Upgrade to get support", bodyContent: _jsx("div", { children: upgradeRecommendation }), children: _jsx(Button, { type: "button", "aria-label": "Open operating system upgrade information", variant: "plain", className: infoButtonStyle, children: _jsx(InfoCircleIcon, { color: "var(--pf-t--global--icon--color--status--info--default)" }) }) }));
|
|
16
|
+
OsUpgradeRecommendationPopover.displayName = "OsUpgradeRecommendationPopover";
|
|
17
|
+
export const OsNameCell = ({ osName, upgradeRecommendation, isExportMode = false, }) => {
|
|
18
|
+
const hasUpgradeRecommendation = upgradeRecommendation && upgradeRecommendation.trim() !== "";
|
|
19
|
+
if (!hasUpgradeRecommendation || isExportMode) {
|
|
20
|
+
return _jsx(_Fragment, { children: osName });
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(Flex, { alignItems: { default: "alignItemsCenter" }, spaceItems: { default: "spaceItemsXs" }, flexWrap: { default: "nowrap" }, children: [_jsx(FlexItem, { children: osName }), _jsx(FlexItem, { shrink: { default: "shrink" }, children: _jsx(OsUpgradeRecommendationPopover, { upgradeRecommendation: upgradeRecommendation }) })] }));
|
|
23
|
+
};
|
|
24
|
+
OsNameCell.displayName = "OsNameCell";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ButtonProps, type PopoverProps } from "@patternfly/react-core";
|
|
2
|
+
import type { CSSProperties, FC } from "react";
|
|
3
|
+
type PopoverIconProps = PopoverProps & {
|
|
4
|
+
variant?: ButtonProps["variant"];
|
|
5
|
+
noVerticalAlign?: boolean;
|
|
6
|
+
buttonOuiaId?: string;
|
|
7
|
+
buttonStyle?: CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
declare const PopoverIcon: FC<PopoverIconProps>;
|
|
10
|
+
export default PopoverIcon;
|
|
11
|
+
//# sourceMappingURL=PopoverIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverIcon.d.ts","sourceRoot":"","sources":["../../src/report/PopoverIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAGhB,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE/C,KAAK,gBAAgB,GAAG,YAAY,GAAG;IACrC,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA0BrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Icon, Popover, } from "@patternfly/react-core";
|
|
3
|
+
import { QuestionCircleIcon } from "@patternfly/react-icons";
|
|
4
|
+
const PopoverIcon = ({ variant = "plain", noVerticalAlign = false, buttonOuiaId, buttonStyle, "aria-label": ariaLabel, ...props }) => (_jsx(Popover, { ...props, children: _jsx(Button, { icon: _jsx(Icon, { isInline: noVerticalAlign, children: _jsx(QuestionCircleIcon, {}) }), variant: variant, "aria-label": ariaLabel, onClick: (e) => {
|
|
5
|
+
e.preventDefault();
|
|
6
|
+
e.stopPropagation();
|
|
7
|
+
}, className: "pf-v6-c-form__group-label-help pf-v6-u-p-0", ouiaId: buttonOuiaId, style: buttonStyle }) }));
|
|
8
|
+
export default PopoverIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { type SupportTier } from "./osSupportTier.js";
|
|
3
|
+
interface SupportTierBadgeProps {
|
|
4
|
+
tier: SupportTier;
|
|
5
|
+
isExportMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const SupportTierBadge: FC<SupportTierBadgeProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SupportTierBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportTierBadge.d.ts","sourceRoot":"","sources":["../../src/report/SupportTierBadge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAW5B,UAAU,qBAAqB;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAYD,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAiBtD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { Label, Tooltip } from "@patternfly/react-core";
|
|
4
|
+
import { getSupportTierBadgeColor, getSupportTierBadgeInlineStyle, getSupportTierDefinition, getSupportTierLegendLabel, } from "./osSupportTier.js";
|
|
5
|
+
const exportBadgeStyle = css `
|
|
6
|
+
display: inline-block;
|
|
7
|
+
padding: var(--pf-t--global--spacer--xs) var(--pf-t--global--spacer--sm);
|
|
8
|
+
border-radius: var(--pf-t--global--border--radius--pill);
|
|
9
|
+
font-size: var(--pf-t--global--font--size--body--sm);
|
|
10
|
+
line-height: var(--pf-t--global--font--line-height--body);
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
`;
|
|
13
|
+
const ExportSupportTierBadge = ({ tier }) => {
|
|
14
|
+
const { backgroundColor, color } = getSupportTierBadgeInlineStyle(tier);
|
|
15
|
+
return (_jsx("span", { className: exportBadgeStyle, style: { backgroundColor, color }, children: getSupportTierLegendLabel(tier) }));
|
|
16
|
+
};
|
|
17
|
+
export const SupportTierBadge = ({ tier, isExportMode = false, }) => {
|
|
18
|
+
if (isExportMode) {
|
|
19
|
+
return _jsx(ExportSupportTierBadge, { tier: tier });
|
|
20
|
+
}
|
|
21
|
+
return (_jsx(Tooltip, { content: getSupportTierDefinition(tier), children: _jsx("span", { children: _jsx(Label, { color: getSupportTierBadgeColor(tier), isCompact: true, children: getSupportTierLegendLabel(tier) }) }) }));
|
|
22
|
+
};
|
|
23
|
+
SupportTierBadge.displayName = "SupportTierBadge";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PatternFly chart color semantics (https://www.patternfly.org/charts/colors-for-charts/design-guidelines/#best-practices):
|
|
3
|
+
* Blue → success / migratable / supported
|
|
4
|
+
* Red-orange → failure / non-migratable / unsupported
|
|
5
|
+
*/
|
|
6
|
+
export declare const chartColorSuccess: "#0066cc";
|
|
7
|
+
export declare const chartColorFailure: "#dca614";
|
|
8
|
+
export declare const REPORT_CARD_EMPTY_STATE_TITLES: {
|
|
9
|
+
readonly operatingSystems: "Operating system data not collected";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/report/constants.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WAA6B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,WAA+B,CAAC;AAE9D,eAAO,MAAM,8BAA8B;;CAEjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { chart_color_blue_300 } from "@patternfly/react-tokens/dist/esm/chart_color_blue_300";
|
|
2
|
+
import { chart_color_yellow_300 } from "@patternfly/react-tokens/dist/esm/chart_color_yellow_300";
|
|
3
|
+
/**
|
|
4
|
+
* PatternFly chart color semantics (https://www.patternfly.org/charts/colors-for-charts/design-guidelines/#best-practices):
|
|
5
|
+
* Blue → success / migratable / supported
|
|
6
|
+
* Red-orange → failure / non-migratable / unsupported
|
|
7
|
+
*/
|
|
8
|
+
export const chartColorSuccess = chart_color_blue_300.value;
|
|
9
|
+
export const chartColorFailure = chart_color_yellow_300.value;
|
|
10
|
+
export const REPORT_CARD_EMPTY_STATE_TITLES = {
|
|
11
|
+
operatingSystems: "Operating system data not collected",
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const dashboardStyles: {
|
|
2
|
+
cardClip: string;
|
|
3
|
+
cardScroll: string;
|
|
4
|
+
equalHeightRow: string;
|
|
5
|
+
equalHeight: string;
|
|
6
|
+
cardBodyScrollable: string;
|
|
7
|
+
card: string;
|
|
8
|
+
cardPrint: string;
|
|
9
|
+
storageCardOverflowHidden: string;
|
|
10
|
+
storageCardOverflowVisible: string;
|
|
11
|
+
storageChartWrapper: string;
|
|
12
|
+
storageExportSectionMargin: string;
|
|
13
|
+
storageExportSectionTitle: string;
|
|
14
|
+
storageFlexFullWidth: string;
|
|
15
|
+
storageMenuToggleMinWidth: string;
|
|
16
|
+
storageNoDataContainer: string;
|
|
17
|
+
storageTotalsNote: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const tableFullWidthStyle: string;
|
|
20
|
+
//# sourceMappingURL=dashboardStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardStyles.d.ts","sourceRoot":"","sources":["../../src/report/dashboardStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CAyG3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAM/B,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { css } from "@emotion/css";
|
|
2
|
+
export const dashboardStyles = {
|
|
3
|
+
cardClip: css `
|
|
4
|
+
clip-path: inset(0 round 10px);
|
|
5
|
+
background: #fff;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,
|
|
9
|
+
cardScroll: css `
|
|
10
|
+
height: 100%;
|
|
11
|
+
min-height: 300px;
|
|
12
|
+
max-height: 500px;
|
|
13
|
+
overflow: auto;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
`,
|
|
17
|
+
equalHeightRow: css `
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: var(--pf-t--global--spacer--gap--group--horizontal);
|
|
20
|
+
align-items: stretch;
|
|
21
|
+
`,
|
|
22
|
+
equalHeight: css `
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
flex: 1 1 0;
|
|
26
|
+
height: 100%;
|
|
27
|
+
`,
|
|
28
|
+
cardBodyScrollable: css `
|
|
29
|
+
overflow: auto;
|
|
30
|
+
`,
|
|
31
|
+
// `!important` on overflow: PatternFly sets `.pf-v6-c-card { overflow: auto }`
|
|
32
|
+
// at the same specificity, which wins in the production build due to stylesheet
|
|
33
|
+
// injection order. `!important` forces `hidden` regardless of that order.
|
|
34
|
+
card: css `
|
|
35
|
+
min-height: 430px;
|
|
36
|
+
max-height: 520px;
|
|
37
|
+
height: 100%;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
overflow: hidden !important;
|
|
42
|
+
`,
|
|
43
|
+
cardPrint: css `
|
|
44
|
+
border: 1px solid #d2d2d2 !important;
|
|
45
|
+
border-radius: 10px;
|
|
46
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
47
|
+
min-height: unset;
|
|
48
|
+
max-height: unset;
|
|
49
|
+
page-break-inside: avoid;
|
|
50
|
+
`,
|
|
51
|
+
storageCardOverflowHidden: css `
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
`,
|
|
54
|
+
storageCardOverflowVisible: css `
|
|
55
|
+
overflow: visible;
|
|
56
|
+
`,
|
|
57
|
+
storageChartWrapper: css `
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
width: 100%;
|
|
62
|
+
padding: 20px 0;
|
|
63
|
+
`,
|
|
64
|
+
storageExportSectionMargin: css `
|
|
65
|
+
margin-bottom: 24px;
|
|
66
|
+
`,
|
|
67
|
+
storageExportSectionTitle: css `
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
margin-bottom: 12px;
|
|
71
|
+
`,
|
|
72
|
+
storageFlexFullWidth: css `
|
|
73
|
+
width: 100%;
|
|
74
|
+
`,
|
|
75
|
+
storageMenuToggleMinWidth: css `
|
|
76
|
+
min-width: 200px;
|
|
77
|
+
`,
|
|
78
|
+
storageNoDataContainer: css `
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
height: 250px;
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
color: #6a6e73;
|
|
85
|
+
`,
|
|
86
|
+
storageTotalsNote: css `
|
|
87
|
+
margin-top: 12px;
|
|
88
|
+
color: #6a6e73;
|
|
89
|
+
font-style: italic;
|
|
90
|
+
text-align: center;
|
|
91
|
+
`,
|
|
92
|
+
};
|
|
93
|
+
export const tableFullWidthStyle = css `
|
|
94
|
+
margin-inline: calc(-1 * var(--pf-v6-c-card--child--PaddingInlineStart));
|
|
95
|
+
width: calc(
|
|
96
|
+
100% + var(--pf-v6-c-card--child--PaddingInlineStart) +
|
|
97
|
+
var(--pf-v6-c-card--child--PaddingInlineEnd)
|
|
98
|
+
);
|
|
99
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { CARD_EMPTY_STATE_DESCRIPTION, CardEmptyState, type CardEmptyStateProps, } from "./CardEmptyState.js";
|
|
2
|
+
export { chartColorFailure, chartColorSuccess, REPORT_CARD_EMPTY_STATE_TITLES, } from "./constants.js";
|
|
3
|
+
export { DashboardEmptyStateBase, type DashboardEmptyStateBaseProps, } from "./DashboardEmptyStateBase.js";
|
|
4
|
+
export { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
|
|
5
|
+
export { EmptySearchResults, type EmptySearchResultsProps, } from "./EmptySearchResults.js";
|
|
6
|
+
export { OSBarChart, OSDistribution } from "./OSDistribution.js";
|
|
7
|
+
export { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
|
|
8
|
+
export { OsUpgradeNotice } from "./OsUpgradeNotice.js";
|
|
9
|
+
export { OsNameCell, OsUpgradeRecommendationPopover, } from "./OsUpgradeRecommendationPopover.js";
|
|
10
|
+
export type { OSDistributionEntry, SupportTierBadgeStyle, } from "./osSupportTier.js";
|
|
11
|
+
export { getSupportTierBadgeColor, getSupportTierBadgeInlineStyle, getSupportTierDefinition, getSupportTierLegendLabel, getSupportTierSortOrder, hasOsUpgradeNotice, ORDERED_SUPPORT_TIERS, resolveSupportTier, SUPPORT_TIER_BADGE_COLORS, SUPPORT_TIER_BADGE_INLINE_STYLES, SUPPORT_TIER_DEFINITIONS, SUPPORT_TIER_LABELS, SUPPORT_TIER_LEARN_MORE_URL, SupportTier, } from "./osSupportTier.js";
|
|
12
|
+
export { default as PopoverIcon } from "./PopoverIcon.js";
|
|
13
|
+
export { SupportTierBadge } from "./SupportTierBadge.js";
|
|
14
|
+
export { ALL_TIERS_FILTER, type OsBarChartViewModel, type OsTableRow, useOsBarChartViewModel, } from "./useOsBarChartViewModel.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,UAAU,EACV,8BAA8B,GAC/B,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,sBAAsB,GACvB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { CARD_EMPTY_STATE_DESCRIPTION, CardEmptyState, } from "./CardEmptyState.js";
|
|
2
|
+
export { chartColorFailure, chartColorSuccess, REPORT_CARD_EMPTY_STATE_TITLES, } from "./constants.js";
|
|
3
|
+
export { DashboardEmptyStateBase, } from "./DashboardEmptyStateBase.js";
|
|
4
|
+
export { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
|
|
5
|
+
export { EmptySearchResults, } from "./EmptySearchResults.js";
|
|
6
|
+
export { OSBarChart, OSDistribution } from "./OSDistribution.js";
|
|
7
|
+
export { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
|
|
8
|
+
export { OsUpgradeNotice } from "./OsUpgradeNotice.js";
|
|
9
|
+
export { OsNameCell, OsUpgradeRecommendationPopover, } from "./OsUpgradeRecommendationPopover.js";
|
|
10
|
+
export { getSupportTierBadgeColor, getSupportTierBadgeInlineStyle, getSupportTierDefinition, getSupportTierLegendLabel, getSupportTierSortOrder, hasOsUpgradeNotice, ORDERED_SUPPORT_TIERS, resolveSupportTier, SUPPORT_TIER_BADGE_COLORS, SUPPORT_TIER_BADGE_INLINE_STYLES, SUPPORT_TIER_DEFINITIONS, SUPPORT_TIER_LABELS, SUPPORT_TIER_LEARN_MORE_URL, SupportTier, } from "./osSupportTier.js";
|
|
11
|
+
export { default as PopoverIcon } from "./PopoverIcon.js";
|
|
12
|
+
export { SupportTierBadge } from "./SupportTierBadge.js";
|
|
13
|
+
export { ALL_TIERS_FILTER, useOsBarChartViewModel, } from "./useOsBarChartViewModel.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { LabelProps } from "@patternfly/react-core";
|
|
2
|
+
/**
|
|
3
|
+
* Guest OS support tiers (matches agent-sdk / planner-sdk `OsInfoSupportTierEnum` values).
|
|
4
|
+
* Defined locally so this package stays SDK-agnostic.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SupportTier: {
|
|
7
|
+
readonly Certified: "certified";
|
|
8
|
+
readonly VendorSupported: "vendor_supported";
|
|
9
|
+
readonly CommunitySupported: "community_supported";
|
|
10
|
+
readonly SpecialHandling: "special_handling";
|
|
11
|
+
};
|
|
12
|
+
export type SupportTier = (typeof SupportTier)[keyof typeof SupportTier];
|
|
13
|
+
export declare const SUPPORT_TIER_LEARN_MORE_URL = "https://access.redhat.com/articles/4234591";
|
|
14
|
+
export interface OSDistributionEntry {
|
|
15
|
+
count: number;
|
|
16
|
+
supported: boolean;
|
|
17
|
+
supportTier?: SupportTier;
|
|
18
|
+
upgradeRecommendation: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const SUPPORT_TIER_LABELS: Record<SupportTier, string>;
|
|
21
|
+
/** Official tier definitions from Red Hat KCS 4234591. */
|
|
22
|
+
export declare const SUPPORT_TIER_DEFINITIONS: Record<SupportTier, string>;
|
|
23
|
+
export declare const ORDERED_SUPPORT_TIERS: SupportTier[];
|
|
24
|
+
export declare const SUPPORT_TIER_BADGE_COLORS: Record<SupportTier, NonNullable<LabelProps["color"]>>;
|
|
25
|
+
export interface SupportTierBadgeStyle {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
color: string;
|
|
28
|
+
}
|
|
29
|
+
/** Explicit colors for html2canvas PDF export (CSS variables are not captured reliably). */
|
|
30
|
+
export declare const SUPPORT_TIER_BADGE_INLINE_STYLES: Record<SupportTier, SupportTierBadgeStyle>;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves the effective support tier for an OS entry.
|
|
33
|
+
* Falls back to the legacy `supported` boolean when the API omits `supportTier`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveSupportTier(supportTier: SupportTier | undefined, supported: boolean): SupportTier;
|
|
36
|
+
export declare function hasOsUpgradeNotice(osData: Record<string, OSDistributionEntry>): boolean;
|
|
37
|
+
export declare function getSupportTierSortOrder(tier: SupportTier): number;
|
|
38
|
+
export declare function getSupportTierLegendLabel(tier: SupportTier): string;
|
|
39
|
+
export declare function getSupportTierDefinition(tier: SupportTier): string;
|
|
40
|
+
export declare function getSupportTierBadgeColor(tier: SupportTier): NonNullable<LabelProps["color"]>;
|
|
41
|
+
export declare function getSupportTierBadgeInlineStyle(tier: SupportTier): SupportTierBadgeStyle;
|
|
42
|
+
//# sourceMappingURL=osSupportTier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osSupportTier.d.ts","sourceRoot":"","sources":["../../src/report/osSupportTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUzD;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,eAAO,MAAM,2BAA2B,+CACM,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AASD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAK3D,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAShE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,WAAW,EAK9C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,WAAW,EACX,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAMjC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4FAA4F;AAC5F,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,WAAW,EACX,qBAAqB,CAkBtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,SAAS,EAAE,OAAO,GACjB,WAAW,CAMb;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAC1C,OAAO,CAeT;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEjE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEnE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAElE;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,GAChB,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAElC;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,WAAW,GAChB,qBAAqB,CAEvB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t_color_blue_20 } from "@patternfly/react-tokens/dist/esm/t_color_blue_20";
|
|
2
|
+
import { t_color_blue_60 } from "@patternfly/react-tokens/dist/esm/t_color_blue_60";
|
|
3
|
+
import { t_color_green_20 } from "@patternfly/react-tokens/dist/esm/t_color_green_20";
|
|
4
|
+
import { t_color_green_60 } from "@patternfly/react-tokens/dist/esm/t_color_green_60";
|
|
5
|
+
import { t_color_orange_20 } from "@patternfly/react-tokens/dist/esm/t_color_orange_20";
|
|
6
|
+
import { t_color_orange_60 } from "@patternfly/react-tokens/dist/esm/t_color_orange_60";
|
|
7
|
+
import { t_color_yellow_20 } from "@patternfly/react-tokens/dist/esm/t_color_yellow_20";
|
|
8
|
+
import { t_color_yellow_60 } from "@patternfly/react-tokens/dist/esm/t_color_yellow_60";
|
|
9
|
+
/**
|
|
10
|
+
* Guest OS support tiers (matches agent-sdk / planner-sdk `OsInfoSupportTierEnum` values).
|
|
11
|
+
* Defined locally so this package stays SDK-agnostic.
|
|
12
|
+
*/
|
|
13
|
+
export const SupportTier = {
|
|
14
|
+
Certified: "certified",
|
|
15
|
+
VendorSupported: "vendor_supported",
|
|
16
|
+
CommunitySupported: "community_supported",
|
|
17
|
+
SpecialHandling: "special_handling",
|
|
18
|
+
};
|
|
19
|
+
export const SUPPORT_TIER_LEARN_MORE_URL = "https://access.redhat.com/articles/4234591";
|
|
20
|
+
const SUPPORT_TIER_SORT_ORDER = {
|
|
21
|
+
[SupportTier.Certified]: 1,
|
|
22
|
+
[SupportTier.VendorSupported]: 2,
|
|
23
|
+
[SupportTier.CommunitySupported]: 3,
|
|
24
|
+
[SupportTier.SpecialHandling]: 4,
|
|
25
|
+
};
|
|
26
|
+
export const SUPPORT_TIER_LABELS = {
|
|
27
|
+
[SupportTier.Certified]: "Certified",
|
|
28
|
+
[SupportTier.VendorSupported]: "Commercial Vendor Supported",
|
|
29
|
+
[SupportTier.CommunitySupported]: "Community supported",
|
|
30
|
+
[SupportTier.SpecialHandling]: "Special handling",
|
|
31
|
+
};
|
|
32
|
+
/** Official tier definitions from Red Hat KCS 4234591. */
|
|
33
|
+
export const SUPPORT_TIER_DEFINITIONS = {
|
|
34
|
+
[SupportTier.Certified]: "Red Hat has tested, certified and will support this combination of hypervisor and guest operating system. Customers with valid subscriptions may contact Red Hat for support. Red Hat will work with the vendor if the guest operating system issue is related to a hypervisor issue.",
|
|
35
|
+
[SupportTier.VendorSupported]: "Red Hat will provide hypervisor support for this combination of certified hypervisor and commercial vendor supported guest operating system. Contact Red Hat for hypervisor support and your vendor for guest operating system support.",
|
|
36
|
+
[SupportTier.CommunitySupported]: "Red Hat will provide hypervisor support for this combination of hypervisor and guest operating system. Contact Red Hat for hypervisor support and use available community channels for guest operating system support.",
|
|
37
|
+
[SupportTier.SpecialHandling]: 'Red Hat will provide hypervisor support for this combination ("Known to work" in the certified guest OS article), or the guest OS is not listed and support follows Red Hat\'s third-party software support policy. Review vendor and end-of-life policies before migrating.',
|
|
38
|
+
};
|
|
39
|
+
export const ORDERED_SUPPORT_TIERS = [
|
|
40
|
+
SupportTier.Certified,
|
|
41
|
+
SupportTier.VendorSupported,
|
|
42
|
+
SupportTier.CommunitySupported,
|
|
43
|
+
SupportTier.SpecialHandling,
|
|
44
|
+
];
|
|
45
|
+
export const SUPPORT_TIER_BADGE_COLORS = {
|
|
46
|
+
[SupportTier.Certified]: "blue",
|
|
47
|
+
[SupportTier.VendorSupported]: "green",
|
|
48
|
+
[SupportTier.CommunitySupported]: "orange",
|
|
49
|
+
[SupportTier.SpecialHandling]: "yellow",
|
|
50
|
+
};
|
|
51
|
+
/** Explicit colors for html2canvas PDF export (CSS variables are not captured reliably). */
|
|
52
|
+
export const SUPPORT_TIER_BADGE_INLINE_STYLES = {
|
|
53
|
+
[SupportTier.Certified]: {
|
|
54
|
+
backgroundColor: t_color_blue_20.value,
|
|
55
|
+
color: t_color_blue_60.value,
|
|
56
|
+
},
|
|
57
|
+
[SupportTier.VendorSupported]: {
|
|
58
|
+
backgroundColor: t_color_green_20.value,
|
|
59
|
+
color: t_color_green_60.value,
|
|
60
|
+
},
|
|
61
|
+
[SupportTier.CommunitySupported]: {
|
|
62
|
+
backgroundColor: t_color_orange_20.value,
|
|
63
|
+
color: t_color_orange_60.value,
|
|
64
|
+
},
|
|
65
|
+
[SupportTier.SpecialHandling]: {
|
|
66
|
+
backgroundColor: t_color_yellow_20.value,
|
|
67
|
+
color: t_color_yellow_60.value,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Resolves the effective support tier for an OS entry.
|
|
72
|
+
* Falls back to the legacy `supported` boolean when the API omits `supportTier`.
|
|
73
|
+
*/
|
|
74
|
+
export function resolveSupportTier(supportTier, supported) {
|
|
75
|
+
if (supportTier) {
|
|
76
|
+
return supportTier;
|
|
77
|
+
}
|
|
78
|
+
return supported ? SupportTier.Certified : SupportTier.SpecialHandling;
|
|
79
|
+
}
|
|
80
|
+
export function hasOsUpgradeNotice(osData) {
|
|
81
|
+
return Object.entries(osData).some(([osName, entry]) => {
|
|
82
|
+
if (!osName.trim()) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (entry.upgradeRecommendation.trim() !== "") {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return (resolveSupportTier(entry.supportTier, entry.supported) !==
|
|
89
|
+
SupportTier.Certified);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export function getSupportTierSortOrder(tier) {
|
|
93
|
+
return SUPPORT_TIER_SORT_ORDER[tier];
|
|
94
|
+
}
|
|
95
|
+
export function getSupportTierLegendLabel(tier) {
|
|
96
|
+
return SUPPORT_TIER_LABELS[tier];
|
|
97
|
+
}
|
|
98
|
+
export function getSupportTierDefinition(tier) {
|
|
99
|
+
return SUPPORT_TIER_DEFINITIONS[tier];
|
|
100
|
+
}
|
|
101
|
+
export function getSupportTierBadgeColor(tier) {
|
|
102
|
+
return SUPPORT_TIER_BADGE_COLORS[tier];
|
|
103
|
+
}
|
|
104
|
+
export function getSupportTierBadgeInlineStyle(tier) {
|
|
105
|
+
return SUPPORT_TIER_BADGE_INLINE_STYLES[tier];
|
|
106
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent } from "react";
|
|
2
|
+
import { type OSDistributionEntry, type SupportTier } from "./osSupportTier.js";
|
|
3
|
+
export declare const ALL_TIERS_FILTER = "all";
|
|
4
|
+
export interface OsTableRow {
|
|
5
|
+
osName: string;
|
|
6
|
+
tier: SupportTier;
|
|
7
|
+
count: number;
|
|
8
|
+
upgradeRecommendation?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface OsBarChartViewModel {
|
|
11
|
+
osFilter: string;
|
|
12
|
+
tierFilter: string;
|
|
13
|
+
isTierSelectOpen: boolean;
|
|
14
|
+
tableRows: OsTableRow[];
|
|
15
|
+
filteredRows: OsTableRow[];
|
|
16
|
+
tierFilterLabel: string;
|
|
17
|
+
showNoResults: boolean;
|
|
18
|
+
showUpgradeNotice: boolean;
|
|
19
|
+
setOsFilter: (value: string) => void;
|
|
20
|
+
clearOsFilter: () => void;
|
|
21
|
+
setIsTierSelectOpen: (open: boolean) => void;
|
|
22
|
+
toggleTierSelectOpen: () => void;
|
|
23
|
+
handleTierSelect: (_event?: ReactMouseEvent<Element>, value?: string | number) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useOsBarChartViewModel(osData: Record<string, OSDistributionEntry>): OsBarChartViewModel;
|
|
26
|
+
//# sourceMappingURL=useOsBarChartViewModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOsBarChartViewModel.d.ts","sourceRoot":"","sources":["../../src/report/useOsBarChartViewModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAIL,KAAK,mBAAmB,EAExB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,gBAAgB,EAAE,CAChB,MAAM,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,EACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KACpB,IAAI,CAAC;CACX;AAwBD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAC1C,mBAAmB,CAmDrB"}
|