@openshift-migration-advisor/shared-components 0.29.0 → 0.30.0-a50663eb4616
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/report/FeatureStatusBadge.d.ts.map +1 -1
- package/dist/report/FeatureStatusBadge.js +2 -2
- package/dist/report/OsUpgradeRecommendationPopover.d.ts.map +1 -1
- package/dist/report/OsUpgradeRecommendationPopover.js +1 -7
- package/package.json +1 -1
- package/src/report/FeatureStatusBadge.tsx +10 -2
- package/src/report/OsUpgradeRecommendationPopover.tsx +0 -8
- package/src/report/__tests__/ClustersOverview.test.tsx +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureStatusBadge.d.ts","sourceRoot":"","sources":["../../src/report/FeatureStatusBadge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"FeatureStatusBadge.d.ts","sourceRoot":"","sources":["../../src/report/FeatureStatusBadge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA0B1D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Label } from "@patternfly/react-core";
|
|
2
|
+
import { Icon, Label } from "@patternfly/react-core";
|
|
3
3
|
import { CheckCircleIcon, TimesCircleIcon } from "@patternfly/react-icons";
|
|
4
4
|
export const FeatureStatusBadge = ({ status }) => {
|
|
5
5
|
if (status === "unknown") {
|
|
@@ -8,6 +8,6 @@ export const FeatureStatusBadge = ({ status }) => {
|
|
|
8
8
|
if (status === "enabled") {
|
|
9
9
|
return (_jsx(Label, { color: "green", isCompact: true, icon: _jsx(CheckCircleIcon, {}), children: "Enabled" }));
|
|
10
10
|
}
|
|
11
|
-
return (_jsx(Label, { variant: "outline", isCompact: true, icon: _jsx(TimesCircleIcon, {}), children: "Disabled" }));
|
|
11
|
+
return (_jsx(Label, { variant: "outline", isCompact: true, icon: _jsx(Icon, { status: "danger", children: _jsx(TimesCircleIcon, {}) }), children: "Disabled" }));
|
|
12
12
|
};
|
|
13
13
|
FeatureStatusBadge.displayName = "FeatureStatusBadge";
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"OsUpgradeRecommendationPopover.d.ts","sourceRoot":"","sources":["../../src/report/OsUpgradeRecommendationPopover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQhC,UAAU,mCAAmC;IAC3C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAC7C,mCAAmC,CAgBpC,CAAC;AAIF,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAyB1C,CAAC"}
|
|
@@ -3,17 +3,11 @@ import { css } from "@emotion/css";
|
|
|
3
3
|
import { Button, Flex, FlexItem, Popover } from "@patternfly/react-core";
|
|
4
4
|
import { InfoCircleIcon } from "@patternfly/react-icons";
|
|
5
5
|
import { chartExportHideProps } from "./chartExport.js";
|
|
6
|
-
const upgradeRecommendationPopoverCloseButton = css `
|
|
7
|
-
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain,
|
|
8
|
-
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain:hover {
|
|
9
|
-
color: var(--pf-t--global--text--color--regular);
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
6
|
const infoButtonStyle = css `
|
|
13
7
|
padding: 0;
|
|
14
8
|
vertical-align: middle;
|
|
15
9
|
`;
|
|
16
|
-
export const OsUpgradeRecommendationPopover = ({ upgradeRecommendation }) => (_jsx(Popover, {
|
|
10
|
+
export const OsUpgradeRecommendationPopover = ({ upgradeRecommendation }) => (_jsx(Popover, { 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)" }) }) }));
|
|
17
11
|
OsUpgradeRecommendationPopover.displayName = "OsUpgradeRecommendationPopover";
|
|
18
12
|
export const OsNameCell = ({ osName, upgradeRecommendation, }) => {
|
|
19
13
|
const hasUpgradeRecommendation = upgradeRecommendation && upgradeRecommendation.trim() !== "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openshift-migration-advisor/shared-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0-a50663eb4616",
|
|
4
4
|
"description": "Shared React UI components for Migration Advisor apps (report charts, forms, OS support tiers)",
|
|
5
5
|
"author": "Montse Ortega <mortegag@redhat.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label } from "@patternfly/react-core";
|
|
1
|
+
import { Icon, Label } from "@patternfly/react-core";
|
|
2
2
|
import { CheckCircleIcon, TimesCircleIcon } from "@patternfly/react-icons";
|
|
3
3
|
import type { FC } from "react";
|
|
4
4
|
import type { FeatureStatus } from "./infrastructureSummaryModel.js";
|
|
@@ -21,7 +21,15 @@ export const FeatureStatusBadge: FC<FeatureStatusBadgeProps> = ({ status }) => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<Label
|
|
24
|
+
<Label
|
|
25
|
+
variant="outline"
|
|
26
|
+
isCompact
|
|
27
|
+
icon={
|
|
28
|
+
<Icon status="danger">
|
|
29
|
+
<TimesCircleIcon />
|
|
30
|
+
</Icon>
|
|
31
|
+
}
|
|
32
|
+
>
|
|
25
33
|
Disabled
|
|
26
34
|
</Label>
|
|
27
35
|
);
|
|
@@ -4,13 +4,6 @@ import { InfoCircleIcon } from "@patternfly/react-icons";
|
|
|
4
4
|
import type { FC } from "react";
|
|
5
5
|
import { chartExportHideProps } from "./chartExport.js";
|
|
6
6
|
|
|
7
|
-
const upgradeRecommendationPopoverCloseButton = css`
|
|
8
|
-
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain,
|
|
9
|
-
.pf-v6-c-popover__close .pf-v6-c-button.pf-m-plain:hover {
|
|
10
|
-
color: var(--pf-t--global--text--color--regular);
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
7
|
const infoButtonStyle = css`
|
|
15
8
|
padding: 0;
|
|
16
9
|
vertical-align: middle;
|
|
@@ -24,7 +17,6 @@ export const OsUpgradeRecommendationPopover: FC<
|
|
|
24
17
|
OsUpgradeRecommendationPopoverProps
|
|
25
18
|
> = ({ upgradeRecommendation }) => (
|
|
26
19
|
<Popover
|
|
27
|
-
className={upgradeRecommendationPopoverCloseButton}
|
|
28
20
|
position="bottom"
|
|
29
21
|
headerContent="Upgrade to get support"
|
|
30
22
|
bodyContent={<div>{upgradeRecommendation}</div>}
|
|
@@ -189,19 +189,19 @@ describe("ClustersOverview", () => {
|
|
|
189
189
|
|
|
190
190
|
expect(screen.queryByTestId("clusters-donut")).not.toBeInTheDocument();
|
|
191
191
|
expect(screen.getByText("8")).toHaveStyle({
|
|
192
|
-
|
|
192
|
+
backgroundColor: chart_color_blue_300.value,
|
|
193
193
|
});
|
|
194
194
|
expect(screen.getByText("4.25")).toHaveStyle({
|
|
195
|
-
|
|
195
|
+
backgroundColor: chart_color_purple_300.value,
|
|
196
196
|
});
|
|
197
197
|
expect(screen.getByText("3.5")).toHaveStyle({
|
|
198
|
-
|
|
198
|
+
backgroundColor: chart_color_purple_100.value,
|
|
199
199
|
});
|
|
200
200
|
expect(screen.getByText("2")).toHaveStyle({
|
|
201
|
-
|
|
201
|
+
backgroundColor: chart_color_teal_200.value,
|
|
202
202
|
});
|
|
203
203
|
expect(screen.getByText("1")).toHaveStyle({
|
|
204
|
-
|
|
204
|
+
backgroundColor: chart_color_yellow_400.value,
|
|
205
205
|
});
|
|
206
206
|
expect(screen.queryByText("0.5")).not.toBeInTheDocument();
|
|
207
207
|
expect(screen.getByText("Cluster 1 (8)")).toBeInTheDocument();
|