UNPKG

@openshift-assisted/ui-lib

Version:

React component library for the Assisted Installer UI

20 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const react_core_1 = require("@patternfly/react-core"); const constants_1 = require("../common/constants"); const helpers_1 = require("../helpers"); const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper"); const AgentAlerts = ({ infraEnv, bareMetalHosts, docVersion }) => { const infraBMHs = infraEnv && (bareMetalHosts === null || bareMetalHosts === void 0 ? void 0 : bareMetalHosts.filter((h) => { var _a, _b, _c; return ((_a = h.metadata) === null || _a === void 0 ? void 0 : _a.namespace) === ((_b = infraEnv.metadata) === null || _b === void 0 ? void 0 : _b.namespace) && (0, helpers_1.getInfraEnvNameOfAgent)(h) === ((_c = infraEnv.metadata) === null || _c === void 0 ? void 0 : _c.name); })); const { t } = (0, use_translation_wrapper_1.useTranslation)(); return (React.createElement(React.Fragment, null, (infraBMHs === null || infraBMHs === void 0 ? void 0 : infraBMHs.some((bmh) => !bmh.status)) && (React.createElement(react_core_1.Alert, { title: t('ai:Metal3 operator is not configured'), variant: react_core_1.AlertVariant.warning, isInline: true, className: "cim-resource-alerts", actionLinks: React.createElement("a", { href: (0, constants_1.getInfraEnvDocs)(docVersion), target: "_blank", rel: "noopener noreferrer" }, t('ai:Open documentation')) }, t('ai:It seems the Metal3 operator is missing configuration which will prevent it to find bare metal hosts in this namespace. Please refer to the documentation for the first time setup steps.'))))); }; exports.default = AgentAlerts; //# sourceMappingURL=AgentAlerts.js.map